diff --git a/assets/ccip-70098440.js b/assets/ccip-70098440.js deleted file mode 100644 index ad4f5215..00000000 --- a/assets/ccip-70098440.js +++ /dev/null @@ -1 +0,0 @@ -import{as as f,at as w,au as y,av as p,aw as h,ax as g,ay as k,az as O,aA as L,aB as m,aC as E}from"./index-6a2af3e6.js";class x extends f{constructor({callbackSelector:e,cause:t,data:n,extraData:c,sender:d,urls:a}){var i;super(t.shortMessage||"An error occurred while fetching for an offchain result.",{cause:t,metaMessages:[...t.metaMessages||[],(i=t.metaMessages)!=null&&i.length?"":[],"Offchain Gateway Call:",a&&[" Gateway URL(s):",...a.map(u=>` ${w(u)}`)],` Sender: ${d}`,` Data: ${n}`,` Callback selector: ${e}`,` Extra data: ${c}`].flat()}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupError"})}}class M extends f{constructor({result:e,url:t}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${w(t)}`,`Response: ${y(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupResponseMalformedError"})}}class R extends f{constructor({sender:e,to:t}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${t}`,`OffchainLookup sender address: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupSenderMismatchError"})}}function $(s,e){if(!p(s))throw new h({address:s});if(!p(e))throw new h({address:e});return s.toLowerCase()===e.toLowerCase()}const C="0x556f1830",A={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function P(s,{blockNumber:e,blockTag:t,data:n,to:c}){const{args:d}=g({data:n,abi:[A]}),[a,i,u,r,o]=d;try{if(!$(c,a))throw new R({sender:a,to:c});const l=await S({data:u,sender:a,urls:i}),{data:b}=await k(s,{blockNumber:e,blockTag:t,data:O([r,L([{type:"bytes"},{type:"bytes"}],[l,o])]),to:c});return b}catch(l){throw new x({callbackSelector:r,cause:l,data:n,extraData:o,sender:a,urls:i})}}async function S({data:s,sender:e,urls:t}){var c;let n=new Error("An unknown error occurred.");for(let d=0;d` ${w(u)}`)],` Sender: ${d}`,` Data: ${o}`,` Callback selector: ${e}`,` Extra data: ${c}`].flat()}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupError"})}}class M extends l{constructor({result:e,url:a}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${w(a)}`,`Response: ${y(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupResponseMalformedError"})}}class R extends l{constructor({sender:e,to:a}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${a}`,`OffchainLookup sender address: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupSenderMismatchError"})}}function $(n,e){if(!p(n))throw new h({address:n});if(!p(e))throw new h({address:e});return n.toLowerCase()===e.toLowerCase()}const C="0x556f1830",S={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function P(n,{blockNumber:e,blockTag:a,data:o,to:c}){const{args:d}=g({data:o,abi:[S]}),[r,i,u,t,s]=d;try{if(!$(c,r))throw new R({sender:r,to:c});const f=await A({data:u,sender:r,urls:i}),{data:b}=await k(n,{blockNumber:e,blockTag:a,data:O([t,L([{type:"bytes"},{type:"bytes"}],[f,s])]),to:c});return b}catch(f){throw new x({callbackSelector:t,cause:f,data:o,extraData:s,sender:r,urls:i})}}async function A({data:n,sender:e,urls:a}){var c;let o=new Error("An unknown error occurred.");for(let d=0;d0&&(s=n[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var c=f[e];if(c===void 0)return!1;if(typeof c=="function")d(c,this,n);else for(var h=c.length,O=E(c,h),r=0;r0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,j(u)}return t}o.prototype.addListener=function(e,n){return g(this,e,n,!1)};o.prototype.on=o.prototype.addListener;o.prototype.prependListener=function(e,n){return g(this,e,n,!0)};function N(){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 _(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=N.bind(r);return i.listener=n,r.wrapFn=i,i}o.prototype.once=function(e,n){return v(n),this.on(e,_(this,e,n)),this};o.prototype.prependOnceListener=function(e,n){return v(n),this.prependListener(e,_(this,e,n)),this};o.prototype.removeListener=function(e,n){var r,i,f,s,u;if(v(n),i=this._events,i===void 0)return this;if(r=i[e],r===void 0)return this;if(r===n||r.listener===n)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||n));else if(typeof r!="function"){for(f=-1,s=r.length-1;s>=0;s--)if(r[s]===n||r[s].listener===n){u=r[s].listener,f=s;break}if(f<0)return this;f===0?r.shift():R(r,f),r.length===1&&(i[e]=r[0]),i.removeListener!==void 0&&this.emit("removeListener",e,u||n)}return this};o.prototype.off=o.prototype.removeListener;o.prototype.removeAllListeners=function(e){var n,r,i;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[e]),this;if(arguments.length===0){var f=Object.keys(r),s;for(i=0;i=0;i--)this.removeListener(e,n[i]);return this};function w(t,e,n){var r=t._events;if(r===void 0)return[];var i=r[e];return i===void 0?[]:typeof i=="function"?n?[i.listener||i]:[i]:n?M(i):E(i,i.length)}o.prototype.listeners=function(e){return w(this,e,!0)};o.prototype.rawListeners=function(e){return w(this,e,!1)};o.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):b.call(t,e)};o.prototype.listenerCount=b;function b(t){var e=this._events;if(e!==void 0){var n=e[t];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?l(this._events):[]};function E(t,e){for(var n=new Array(e),r=0;re in t?Hve(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var Rr=(t,e,r)=>(qve(t,typeof e!="symbol"?e+"":e,r),r),eA=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)};var Mn=(t,e,r)=>(eA(t,e,"read from private field"),r?r.call(t):e.get(t)),Wh=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},Vh=(t,e,r,n)=>(eA(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r);var rp=(t,e,r)=>(eA(t,e,"access private method"),r);function Wve(t,e){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(t,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"]'))n(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"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(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 n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();var Je=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function wf(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var hJ={exports:{}},z_={},pJ={exports:{}},lr={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var j2=Symbol.for("react.element"),Vve=Symbol.for("react.portal"),Gve=Symbol.for("react.fragment"),Kve=Symbol.for("react.strict_mode"),Jve=Symbol.for("react.profiler"),Qve=Symbol.for("react.provider"),Yve=Symbol.for("react.context"),Zve=Symbol.for("react.forward_ref"),Xve=Symbol.for("react.suspense"),eye=Symbol.for("react.memo"),tye=Symbol.for("react.lazy"),$B=Symbol.iterator;function rye(t){return t===null||typeof t!="object"?null:(t=$B&&t[$B]||t["@@iterator"],typeof t=="function"?t:null)}var gJ={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},mJ=Object.assign,vJ={};function wm(t,e,r){this.props=t,this.context=e,this.refs=vJ,this.updater=r||gJ}wm.prototype.isReactComponent={};wm.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};wm.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function yJ(){}yJ.prototype=wm.prototype;function QR(t,e,r){this.props=t,this.context=e,this.refs=vJ,this.updater=r||gJ}var YR=QR.prototype=new yJ;YR.constructor=QR;mJ(YR,wm.prototype);YR.isPureReactComponent=!0;var NB=Array.isArray,bJ=Object.prototype.hasOwnProperty,ZR={current:null},wJ={key:!0,ref:!0,__self:!0,__source:!0};function xJ(t,e,r){var n,i={},s=null,o=null;if(e!=null)for(n in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)bJ.call(e,n)&&!wJ.hasOwnProperty(n)&&(i[n]=e[n]);var a=arguments.length-2;if(a===1)i.children=r;else if(1>>1,I=R[N];if(0>>1;Ni(M,q))Gi(H,M)?(R[N]=H,R[G]=q,N=G):(R[N]=M,R[re]=q,N=re);else if(Gi(H,q))R[N]=H,R[G]=q,N=G;else break e}}return L}function i(R,L){var q=R.sortIndex-L.sortIndex;return q!==0?q:R.id-L.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var c=[],l=[],u=1,f=null,d=3,p=!1,g=!1,v=!1,y=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(R){for(var L=r(l);L!==null;){if(L.callback===null)n(l);else if(L.startTime<=R)n(l),L.sortIndex=L.expirationTime,e(c,L);else break;L=r(l)}}function C(R){if(v=!1,E(R),!g)if(r(c)!==null)g=!0,B(S);else{var L=r(l);L!==null&&z(C,L.startTime-R)}}function S(R,L){g=!1,v&&(v=!1,b(T),T=-1),p=!0;var q=d;try{for(E(L),f=r(c);f!==null&&(!(f.expirationTime>L)||R&&!ne());){var N=f.callback;if(typeof N=="function"){f.callback=null,d=f.priorityLevel;var I=N(f.expirationTime<=L);L=t.unstable_now(),typeof I=="function"?f.callback=I:f===r(c)&&n(c),E(L)}else n(c);f=r(c)}if(f!==null)var U=!0;else{var re=r(l);re!==null&&z(C,re.startTime-L),U=!1}return U}finally{f=null,d=q,p=!1}}var P=!1,_=null,T=-1,Q=5,Z=-1;function ne(){return!(t.unstable_now()-ZR||125N?(R.sortIndex=q,e(l,R),r(c)===null&&R===r(l)&&(v?(b(T),T=-1):v=!0,z(C,q-N))):(R.sortIndex=I,e(c,R),g||p||(g=!0,B(S))),R},t.unstable_shouldYield=ne,t.unstable_wrapCallback=function(R){var L=d;return function(){var q=d;d=L;try{return R.apply(this,arguments)}finally{d=q}}}})(AJ);SJ.exports=AJ;var pye=SJ.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var kJ=$,oa=pye;function Be(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),X7=Object.prototype.hasOwnProperty,gye=/^[: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]*$/,DB={},LB={};function mye(t){return X7.call(LB,t)?!0:X7.call(DB,t)?!1:gye.test(t)?LB[t]=!0:(DB[t]=!0,!1)}function vye(t,e,r,n){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function yye(t,e,r,n){if(e===null||typeof e>"u"||vye(t,e,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Zs(t,e,r,n,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var es={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){es[t]=new Zs(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];es[e]=new Zs(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){es[t]=new Zs(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){es[t]=new Zs(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){es[t]=new Zs(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){es[t]=new Zs(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){es[t]=new Zs(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){es[t]=new Zs(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){es[t]=new Zs(t,5,!1,t.toLowerCase(),null,!1,!1)});var tT=/[\-:]([a-z])/g;function rT(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(tT,rT);es[e]=new Zs(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(tT,rT);es[e]=new Zs(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(tT,rT);es[e]=new Zs(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){es[t]=new Zs(t,1,!1,t.toLowerCase(),null,!1,!1)});es.xlinkHref=new Zs("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){es[t]=new Zs(t,1,!1,t.toLowerCase(),null,!0,!0)});function nT(t,e,r,n){var i=es.hasOwnProperty(e)?es[e]:null;(i!==null?i.type!==0:n||!(2a||i[o]!==s[a]){var c=` +`+i[o].replace(" at new "," at ");return t.displayName&&c.includes("")&&(c=c.replace("",t.displayName)),c}while(1<=o&&0<=a);break}}}finally{nA=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?Ey(t):""}function bye(t){switch(t.tag){case 5:return Ey(t.type);case 16:return Ey("Lazy");case 13:return Ey("Suspense");case 19:return Ey("SuspenseList");case 0:case 2:case 15:return t=iA(t.type,!1),t;case 11:return t=iA(t.type.render,!1),t;case 1:return t=iA(t.type,!0),t;default:return""}}function nk(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Lp:return"Fragment";case Dp:return"Portal";case ek:return"Profiler";case iT:return"StrictMode";case tk:return"Suspense";case rk:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case RJ:return(t.displayName||"Context")+".Consumer";case PJ:return(t._context.displayName||"Context")+".Provider";case sT:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case oT:return e=t.displayName||null,e!==null?e:nk(t.type)||"Memo";case nd:e=t._payload,t=t._init;try{return nk(t(e))}catch{}}return null}function wye(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return nk(e);case 8:return e===iT?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function jd(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function OJ(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function xye(t){var e=OJ(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,s=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function d5(t){t._valueTracker||(t._valueTracker=xye(t))}function $J(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=OJ(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function ME(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function ik(t,e){var r=e.checked;return Tn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function FB(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=jd(e.value!=null?e.value:r),t._wrapperState={initialChecked:n,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function NJ(t,e){e=e.checked,e!=null&&nT(t,"checked",e,!1)}function sk(t,e){NJ(t,e);var r=jd(e.value),n=e.type;if(r!=null)n==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(n==="submit"||n==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?ok(t,e.type,r):e.hasOwnProperty("defaultValue")&&ok(t,e.type,jd(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function jB(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function ok(t,e,r){(e!=="number"||ME(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var _y=Array.isArray;function og(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=h5.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function yb(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var Oy={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Eye=["Webkit","ms","Moz","O"];Object.keys(Oy).forEach(function(t){Eye.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Oy[e]=Oy[t]})});function BJ(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||Oy.hasOwnProperty(t)&&Oy[t]?(""+e).trim():e+"px"}function FJ(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=BJ(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,i):t[r]=i}}var _ye=Tn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function lk(t,e){if(e){if(_ye[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Be(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Be(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Be(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Be(62))}}function uk(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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 fk=null;function aT(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var dk=null,ag=null,cg=null;function HB(t){if(t=H2(t)){if(typeof dk!="function")throw Error(Be(280));var e=t.stateNode;e&&(e=G_(e),dk(t.stateNode,t.type,e))}}function jJ(t){ag?cg?cg.push(t):cg=[t]:ag=t}function UJ(){if(ag){var t=ag,e=cg;if(cg=ag=null,HB(t),e)for(t=0;t>>=0,t===0?32:31-(Nye(t)/Mye|0)|0}var p5=64,g5=4194304;function Cy(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function FE(t,e){var r=t.pendingLanes;if(r===0)return 0;var n=0,i=t.suspendedLanes,s=t.pingedLanes,o=r&268435455;if(o!==0){var a=o&~i;a!==0?n=Cy(a):(s&=o,s!==0&&(n=Cy(s)))}else o=r&~i,o!==0?n=Cy(o):s!==0&&(n=Cy(s));if(n===0)return 0;if(e!==0&&e!==n&&!(e&i)&&(i=n&-n,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(n&4&&(n|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=n;0r;r++)e.push(t);return e}function U2(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Fc(e),t[e]=r}function Fye(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var n=t.eventTimes;for(t=t.expirationTimes;0=Ny),ZB=String.fromCharCode(32),XB=!1;function aQ(t,e){switch(t){case"keyup":return hbe.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cQ(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Bp=!1;function gbe(t,e){switch(t){case"compositionend":return cQ(e);case"keypress":return e.which!==32?null:(XB=!0,ZB);case"textInput":return t=e.data,t===ZB&&XB?null:t;default:return null}}function mbe(t,e){if(Bp)return t==="compositionend"||!gT&&aQ(t,e)?(t=sQ(),L3=dT=hd=null,Bp=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=nF(r)}}function dQ(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?dQ(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function hQ(){for(var t=window,e=ME();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=ME(t.document)}return e}function mT(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function Sbe(t){var e=hQ(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&dQ(r.ownerDocument.documentElement,r)){if(n!==null&&mT(r)){if(e=n.start,t=n.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=r.textContent.length,s=Math.min(n.start,i);n=n.end===void 0?s:Math.min(n.end,i),!t.extend&&s>n&&(i=n,n=s,s=i),i=iF(r,s);var o=iF(r,n);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>n?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,Fp=null,yk=null,Dy=null,bk=!1;function sF(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;bk||Fp==null||Fp!==ME(n)||(n=Fp,"selectionStart"in n&&mT(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Dy&&Cb(Dy,n)||(Dy=n,n=zE(yk,"onSelect"),0zp||(t.current=Sk[zp],Sk[zp]=null,zp--)}function rn(t,e){zp++,Sk[zp]=t.current,t.current=e}var Ud={},ks=hh(Ud),Ao=hh(!1),U0=Ud;function Mg(t,e){var r=t.type.contextTypes;if(!r)return Ud;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in r)i[s]=e[s];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function ko(t){return t=t.childContextTypes,t!=null}function qE(){fn(Ao),fn(ks)}function dF(t,e,r){if(ks.current!==Ud)throw Error(Be(168));rn(ks,e),rn(Ao,r)}function EQ(t,e,r){var n=t.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in e))throw Error(Be(108,wye(t)||"Unknown",i));return Tn({},r,n)}function WE(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Ud,U0=ks.current,rn(ks,t),rn(Ao,Ao.current),!0}function hF(t,e,r){var n=t.stateNode;if(!n)throw Error(Be(169));r?(t=EQ(t,e,U0),n.__reactInternalMemoizedMergedChildContext=t,fn(Ao),fn(ks),rn(ks,t)):fn(Ao),rn(Ao,r)}var Pu=null,K_=!1,yA=!1;function _Q(t){Pu===null?Pu=[t]:Pu.push(t)}function Lbe(t){K_=!0,_Q(t)}function ph(){if(!yA&&Pu!==null){yA=!0;var t=0,e=Lr;try{var r=Pu;for(Lr=1;t>=o,i-=o,Bu=1<<32-Fc(e)+i|r<T?(Q=_,_=null):Q=_.sibling;var Z=d(b,_,E[T],C);if(Z===null){_===null&&(_=Q);break}t&&_&&Z.alternate===null&&e(b,_),w=s(Z,w,T),P===null?S=Z:P.sibling=Z,P=Z,_=Q}if(T===E.length)return r(b,_),mn&&i0(b,T),S;if(_===null){for(;TT?(Q=_,_=null):Q=_.sibling;var ne=d(b,_,Z.value,C);if(ne===null){_===null&&(_=Q);break}t&&_&&ne.alternate===null&&e(b,_),w=s(ne,w,T),P===null?S=ne:P.sibling=ne,P=ne,_=Q}if(Z.done)return r(b,_),mn&&i0(b,T),S;if(_===null){for(;!Z.done;T++,Z=E.next())Z=f(b,Z.value,C),Z!==null&&(w=s(Z,w,T),P===null?S=Z:P.sibling=Z,P=Z);return mn&&i0(b,T),S}for(_=n(b,_);!Z.done;T++,Z=E.next())Z=p(_,b,T,Z.value,C),Z!==null&&(t&&Z.alternate!==null&&_.delete(Z.key===null?T:Z.key),w=s(Z,w,T),P===null?S=Z:P.sibling=Z,P=Z);return t&&_.forEach(function(ce){return e(b,ce)}),mn&&i0(b,T),S}function y(b,w,E,C){if(typeof E=="object"&&E!==null&&E.type===Lp&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case f5:e:{for(var S=E.key,P=w;P!==null;){if(P.key===S){if(S=E.type,S===Lp){if(P.tag===7){r(b,P.sibling),w=i(P,E.props.children),w.return=b,b=w;break e}}else if(P.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===nd&&wF(S)===P.type){r(b,P.sibling),w=i(P,E.props),w.ref=Lv(b,P,E),w.return=b,b=w;break e}r(b,P);break}else e(b,P);P=P.sibling}E.type===Lp?(w=T0(E.props.children,b.mode,C,E.key),w.return=b,b=w):(C=W3(E.type,E.key,E.props,null,b.mode,C),C.ref=Lv(b,w,E),C.return=b,b=C)}return o(b);case Dp:e:{for(P=E.key;w!==null;){if(w.key===P)if(w.tag===4&&w.stateNode.containerInfo===E.containerInfo&&w.stateNode.implementation===E.implementation){r(b,w.sibling),w=i(w,E.children||[]),w.return=b,b=w;break e}else{r(b,w);break}else e(b,w);w=w.sibling}w=AA(E,b.mode,C),w.return=b,b=w}return o(b);case nd:return P=E._init,y(b,w,P(E._payload),C)}if(_y(E))return g(b,w,E,C);if(Ov(E))return v(b,w,E,C);E5(b,E)}return typeof E=="string"&&E!==""||typeof E=="number"?(E=""+E,w!==null&&w.tag===6?(r(b,w.sibling),w=i(w,E),w.return=b,b=w):(r(b,w),w=SA(E,b.mode,C),w.return=b,b=w),o(b)):r(b,w)}return y}var Lg=TQ(!0),OQ=TQ(!1),q2={},Ll=hh(q2),Ib=hh(q2),Pb=hh(q2);function E0(t){if(t===q2)throw Error(Be(174));return t}function ST(t,e){switch(rn(Pb,e),rn(Ib,t),rn(Ll,q2),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:ck(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=ck(e,t)}fn(Ll),rn(Ll,e)}function Bg(){fn(Ll),fn(Ib),fn(Pb)}function $Q(t){E0(Pb.current);var e=E0(Ll.current),r=ck(e,t.type);e!==r&&(rn(Ib,t),rn(Ll,r))}function AT(t){Ib.current===t&&(fn(Ll),fn(Ib))}var An=hh(0);function YE(t){for(var e=t;e!==null;){if(e.tag===13){var r=e.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var bA=[];function kT(){for(var t=0;tr?r:4,t(!0);var n=wA.transition;wA.transition={};try{t(!1),e()}finally{Lr=r,wA.transition=n}}function JQ(){return Ka().memoizedState}function Ube(t,e,r){var n=Id(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},QQ(t))YQ(e,r);else if(r=kQ(t,e,r,n),r!==null){var i=Vs();jc(r,t,n,i),ZQ(r,e,n)}}function zbe(t,e,r){var n=Id(t),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(QQ(t))YQ(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,r);if(i.hasEagerState=!0,i.eagerState=a,Hc(a,o)){var c=e.interleaved;c===null?(i.next=i,_T(e)):(i.next=c.next,c.next=i),e.interleaved=i;return}}catch{}finally{}r=kQ(t,e,i,n),r!==null&&(i=Vs(),jc(r,t,n,i),ZQ(r,e,n))}}function QQ(t){var e=t.alternate;return t===Pn||e!==null&&e===Pn}function YQ(t,e){Ly=ZE=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function ZQ(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,lT(t,r)}}var XE={readContext:Ga,useCallback:ps,useContext:ps,useEffect:ps,useImperativeHandle:ps,useInsertionEffect:ps,useLayoutEffect:ps,useMemo:ps,useReducer:ps,useRef:ps,useState:ps,useDebugValue:ps,useDeferredValue:ps,useTransition:ps,useMutableSource:ps,useSyncExternalStore:ps,useId:ps,unstable_isNewReconciler:!1},Hbe={readContext:Ga,useCallback:function(t,e){return pl().memoizedState=[t,e===void 0?null:e],t},useContext:Ga,useEffect:EF,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,U3(4194308,4,qQ.bind(null,e,t),r)},useLayoutEffect:function(t,e){return U3(4194308,4,t,e)},useInsertionEffect:function(t,e){return U3(4,2,t,e)},useMemo:function(t,e){var r=pl();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=pl();return e=r!==void 0?r(e):e,n.memoizedState=n.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},n.queue=t,t=t.dispatch=Ube.bind(null,Pn,t),[n.memoizedState,t]},useRef:function(t){var e=pl();return t={current:t},e.memoizedState=t},useState:xF,useDebugValue:OT,useDeferredValue:function(t){return pl().memoizedState=t},useTransition:function(){var t=xF(!1),e=t[0];return t=jbe.bind(null,t[1]),pl().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=Pn,i=pl();if(mn){if(r===void 0)throw Error(Be(407));r=r()}else{if(r=e(),Fi===null)throw Error(Be(349));H0&30||DQ(n,e,r)}i.memoizedState=r;var s={value:r,getSnapshot:e};return i.queue=s,EF(BQ.bind(null,n,s,t),[t]),n.flags|=2048,Ob(9,LQ.bind(null,n,s,r,e),void 0,null),r},useId:function(){var t=pl(),e=Fi.identifierPrefix;if(mn){var r=Fu,n=Bu;r=(n&~(1<<32-Fc(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=Rb++,0<\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=o.createElement(r,{is:n.is}):(t=o.createElement(r),r==="select"&&(o=t,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):t=o.createElementNS(t,r),t[_l]=e,t[kb]=n,aY(t,e,!1,!1),e.stateNode=t;e:{switch(o=uk(r,n),r){case"dialog":an("cancel",t),an("close",t),i=n;break;case"iframe":case"object":case"embed":an("load",t),i=n;break;case"video":case"audio":for(i=0;ijg&&(e.flags|=128,n=!0,Bv(s,!1),e.lanes=4194304)}else{if(!n)if(t=YE(o),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),Bv(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!mn)return gs(e),null}else 2*Yn()-s.renderingStartTime>jg&&r!==1073741824&&(e.flags|=128,n=!0,Bv(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(r=s.last,r!==null?r.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Yn(),e.sibling=null,r=An.current,rn(An,n?r&1|2:r&1),e):(gs(e),null);case 22:case 23:return BT(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?Vo&1073741824&&(gs(e),e.subtreeFlags&6&&(e.flags|=8192)):gs(e),null;case 24:return null;case 25:return null}throw Error(Be(156,e.tag))}function Ybe(t,e){switch(yT(e),e.tag){case 1:return ko(e.type)&&qE(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Bg(),fn(Ao),fn(ks),kT(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return AT(e),null;case 13:if(fn(An),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Be(340));Dg()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return fn(An),null;case 4:return Bg(),null;case 10:return ET(e.type._context),null;case 22:case 23:return BT(),null;case 24:return null;default:return null}}var C5=!1,ws=!1,Zbe=typeof WeakSet=="function"?WeakSet:Set,rt=null;function Vp(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Ln(t,e,n)}else r.current=null}function Lk(t,e,r){try{r()}catch(n){Ln(t,e,n)}}var TF=!1;function Xbe(t,e){if(wk=jE,t=hQ(),mT(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break e}var o=0,a=-1,c=-1,l=0,u=0,f=t,d=null;t:for(;;){for(var p;f!==r||i!==0&&f.nodeType!==3||(a=o+i),f!==s||n!==0&&f.nodeType!==3||(c=o+n),f.nodeType===3&&(o+=f.nodeValue.length),(p=f.firstChild)!==null;)d=f,f=p;for(;;){if(f===t)break t;if(d===r&&++l===i&&(a=o),d===s&&++u===n&&(c=o),(p=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=p}r=a===-1||c===-1?null:{start:a,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(xk={focusedElem:t,selectionRange:r},jE=!1,rt=e;rt!==null;)if(e=rt,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,rt=t;else for(;rt!==null;){e=rt;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var v=g.memoizedProps,y=g.memoizedState,b=e.stateNode,w=b.getSnapshotBeforeUpdate(e.elementType===e.type?v:Ic(e.type,v),y);b.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var E=e.stateNode.containerInfo;E.nodeType===1?E.textContent="":E.nodeType===9&&E.documentElement&&E.removeChild(E.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Be(163))}}catch(C){Ln(e,e.return,C)}if(t=e.sibling,t!==null){t.return=e.return,rt=t;break}rt=e.return}return g=TF,TF=!1,g}function By(t,e,r){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&Lk(e,r,s)}i=i.next}while(i!==n)}}function Y_(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var n=r.create;r.destroy=n()}r=r.next}while(r!==e)}}function Bk(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function uY(t){var e=t.alternate;e!==null&&(t.alternate=null,uY(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[_l],delete e[kb],delete e[Ck],delete e[Mbe],delete e[Dbe])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function fY(t){return t.tag===5||t.tag===3||t.tag===4}function OF(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||fY(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Fk(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=HE));else if(n!==4&&(t=t.child,t!==null))for(Fk(t,e,r),t=t.sibling;t!==null;)Fk(t,e,r),t=t.sibling}function jk(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(jk(t,e,r),t=t.sibling;t!==null;)jk(t,e,r),t=t.sibling}var Wi=null,Tc=!1;function Wf(t,e,r){for(r=r.child;r!==null;)dY(t,e,r),r=r.sibling}function dY(t,e,r){if(Dl&&typeof Dl.onCommitFiberUnmount=="function")try{Dl.onCommitFiberUnmount(H_,r)}catch{}switch(r.tag){case 5:ws||Vp(r,e);case 6:var n=Wi,i=Tc;Wi=null,Wf(t,e,r),Wi=n,Tc=i,Wi!==null&&(Tc?(t=Wi,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):Wi.removeChild(r.stateNode));break;case 18:Wi!==null&&(Tc?(t=Wi,r=r.stateNode,t.nodeType===8?vA(t.parentNode,r):t.nodeType===1&&vA(t,r),Eb(t)):vA(Wi,r.stateNode));break;case 4:n=Wi,i=Tc,Wi=r.stateNode.containerInfo,Tc=!0,Wf(t,e,r),Wi=n,Tc=i;break;case 0:case 11:case 14:case 15:if(!ws&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Lk(r,e,o),i=i.next}while(i!==n)}Wf(t,e,r);break;case 1:if(!ws&&(Vp(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){Ln(r,e,a)}Wf(t,e,r);break;case 21:Wf(t,e,r);break;case 22:r.mode&1?(ws=(n=ws)||r.memoizedState!==null,Wf(t,e,r),ws=n):Wf(t,e,r);break;default:Wf(t,e,r)}}function $F(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new Zbe),e.forEach(function(n){var i=c2e.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}}function mc(t,e){var r=e.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~s}if(n=i,n=Yn()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*t2e(n/1960))-n,10t?16:t,pd===null)var n=!1;else{if(t=pd,pd=null,r6=0,Ar&6)throw Error(Be(331));var i=Ar;for(Ar|=4,rt=t.current;rt!==null;){var s=rt,o=s.child;if(rt.flags&16){var a=s.deletions;if(a!==null){for(var c=0;cYn()-DT?R0(t,0):MT|=r),Io(t,e)}function wY(t,e){e===0&&(t.mode&1?(e=g5,g5<<=1,!(g5&130023424)&&(g5=4194304)):e=1);var r=Vs();t=Qu(t,e),t!==null&&(U2(t,e,r),Io(t,r))}function a2e(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),wY(t,r)}function c2e(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,i=t.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(Be(314))}n!==null&&n.delete(e),wY(t,r)}var xY;xY=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||Ao.current)xo=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return xo=!1,Jbe(t,e,r);xo=!!(t.flags&131072)}else xo=!1,mn&&e.flags&1048576&&CQ(e,GE,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;z3(t,e),t=e.pendingProps;var i=Mg(e,ks.current);ug(e,r),i=PT(null,e,n,t,i,r);var s=RT();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,ko(n)?(s=!0,WE(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,CT(e),i.updater=J_,e.stateNode=i,i._reactInternals=e,Rk(e,n,t,r),e=$k(null,e,n,!0,s,r)):(e.tag=0,mn&&s&&vT(e),Us(null,e,i,r),e=e.child),e;case 16:n=e.elementType;e:{switch(z3(t,e),t=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=u2e(n),t=Ic(n,t),i){case 0:e=Ok(null,e,n,t,r);break e;case 1:e=IF(null,e,n,t,r);break e;case 11:e=AF(null,e,n,t,r);break e;case 14:e=kF(null,e,n,Ic(n.type,t),r);break e}throw Error(Be(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Ic(n,i),Ok(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Ic(n,i),IF(t,e,n,i,r);case 3:e:{if(iY(e),t===null)throw Error(Be(387));n=e.pendingProps,s=e.memoizedState,i=s.element,IQ(t,e),QE(e,n,null,r);var o=e.memoizedState;if(n=o.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=Fg(Error(Be(423)),e),e=PF(t,e,n,r,i);break e}else if(n!==i){i=Fg(Error(Be(424)),e),e=PF(t,e,n,r,i);break e}else for(Zo=Sd(e.stateNode.containerInfo.firstChild),ta=e,mn=!0,Nc=null,r=OQ(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Dg(),n===i){e=Yu(t,e,r);break e}Us(t,e,n,r)}e=e.child}return e;case 5:return $Q(e),t===null&&kk(e),n=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,Ek(n,i)?o=null:s!==null&&Ek(n,s)&&(e.flags|=32),nY(t,e),Us(t,e,o,r),e.child;case 6:return t===null&&kk(e),null;case 13:return sY(t,e,r);case 4:return ST(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=Lg(e,null,n,r):Us(t,e,n,r),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Ic(n,i),AF(t,e,n,i,r);case 7:return Us(t,e,e.pendingProps,r),e.child;case 8:return Us(t,e,e.pendingProps.children,r),e.child;case 12:return Us(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(n=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,rn(KE,n._currentValue),n._currentValue=o,s!==null)if(Hc(s.value,o)){if(s.children===i.children&&!Ao.current){e=Yu(t,e,r);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var c=a.firstContext;c!==null;){if(c.context===n){if(s.tag===1){c=Hu(-1,r&-r),c.tag=2;var l=s.updateQueue;if(l!==null){l=l.shared;var u=l.pending;u===null?c.next=c:(c.next=u.next,u.next=c),l.pending=c}}s.lanes|=r,c=s.alternate,c!==null&&(c.lanes|=r),Ik(s.return,r,e),a.lanes|=r;break}c=c.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(Be(341));o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),Ik(o,r,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Us(t,e,i.children,r),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,ug(e,r),i=Ga(i),n=n(i),e.flags|=1,Us(t,e,n,r),e.child;case 14:return n=e.type,i=Ic(n,e.pendingProps),i=Ic(n.type,i),kF(t,e,n,i,r);case 15:return tY(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Ic(n,i),z3(t,e),e.tag=1,ko(n)?(t=!0,WE(e)):t=!1,ug(e,r),RQ(e,n,i),Rk(e,n,i,r),$k(null,e,n,!0,t,r);case 19:return oY(t,e,r);case 22:return rY(t,e,r)}throw Error(Be(156,e.tag))};function EY(t,e){return KJ(t,e)}function l2e(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ua(t,e,r,n){return new l2e(t,e,r,n)}function jT(t){return t=t.prototype,!(!t||!t.isReactComponent)}function u2e(t){if(typeof t=="function")return jT(t)?1:0;if(t!=null){if(t=t.$$typeof,t===sT)return 11;if(t===oT)return 14}return 2}function Pd(t,e){var r=t.alternate;return r===null?(r=Ua(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function W3(t,e,r,n,i,s){var o=2;if(n=t,typeof t=="function")jT(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case Lp:return T0(r.children,i,s,e);case iT:o=8,i|=8;break;case ek:return t=Ua(12,r,e,i|2),t.elementType=ek,t.lanes=s,t;case tk:return t=Ua(13,r,e,i),t.elementType=tk,t.lanes=s,t;case rk:return t=Ua(19,r,e,i),t.elementType=rk,t.lanes=s,t;case TJ:return X_(r,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case PJ:o=10;break e;case RJ:o=9;break e;case sT:o=11;break e;case oT:o=14;break e;case nd:o=16,n=null;break e}throw Error(Be(130,t==null?t:typeof t,""))}return e=Ua(o,r,e,i),e.elementType=t,e.type=n,e.lanes=s,e}function T0(t,e,r,n){return t=Ua(7,t,n,e),t.lanes=r,t}function X_(t,e,r,n){return t=Ua(22,t,n,e),t.elementType=TJ,t.lanes=r,t.stateNode={isHidden:!1},t}function SA(t,e,r){return t=Ua(6,t,null,e),t.lanes=r,t}function AA(t,e,r){return e=Ua(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function f2e(t,e,r,n,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=oA(0),this.expirationTimes=oA(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=oA(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function UT(t,e,r,n,i,s,o,a,c){return t=new f2e(t,e,r,a,c),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Ua(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},CT(s),t}function d2e(t,e,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(AY)}catch(t){console.error(t)}}AY(),CJ.exports=ca;var Gc=CJ.exports;const v2e=rs(Gc);var UF=Gc;Z7.createRoot=UF.createRoot,Z7.hydrateRoot=UF.hydrateRoot;const y2e=[{inputs:[{internalType:"bytes32",type:"bytes32"}],name:"getAlternativeSignature",outputs:[{internalType:"string",type:"string"}],stateMutability:"view",type:"function"}];var b2e=Object.freeze({__proto__:null,abi:y2e});const w2e=[{type:"function",name:"isValidSignature",constant:!0,inputs:[{type:"bytes32"},{type:"bytes"}],outputs:[{type:"bytes4"}],payable:!1,stateMutability:"view"}],x2e={isValidSignatureBytes32:"0x1626ba7e"};var E2e=Object.freeze({__proto__:null,abi:w2e,returns:x2e});const _2e=[{inputs:[{internalType:"bytes",name:"error",type:"bytes"}],name:"ERC1271Revert",type:"error"},{inputs:[{internalType:"bytes",name:"error",type:"bytes"}],name:"ERC6492DeployFailed",type:"error"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSig",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"},{internalType:"bool",name:"allowSideEffects",type:"bool"},{internalType:"bool",name:"deployAlreadyDeployed",type:"bool"}],name:"isValidSigImpl",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSigNoThrow",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSigWithSideEffects",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSigWithSideEffectsNoThrow",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}];var C2e=Object.freeze({__proto__:null,abi:_2e});const S2e=[{type:"function",name:"deploy",constant:!1,inputs:[{type:"address"},{type:"bytes32"}],outputs:[],payable:!0,stateMutability:"payable"}];var A2e=Object.freeze({__proto__:null,abi:S2e});const k2e=[{type:"function",name:"nonce",constant:!0,inputs:[],outputs:[{type:"uint256"}],payable:!1,stateMutability:"view"},{type:"function",name:"readNonce",constant:!0,inputs:[{type:"uint256"}],outputs:[{type:"uint256"}],payable:!1,stateMutability:"view"},{type:"function",name:"updateImplementation",constant:!1,inputs:[{type:"address"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"selfExecute",constant:!1,inputs:[{components:[{type:"bool",name:"delegateCall"},{type:"bool",name:"revertOnError"},{type:"uint256",name:"gasLimit"},{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}],type:"tuple[]"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"execute",constant:!1,inputs:[{components:[{type:"bool",name:"delegateCall"},{type:"bool",name:"revertOnError"},{type:"uint256",name:"gasLimit"},{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}],type:"tuple[]"},{type:"uint256"},{type:"bytes"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"createContract",inputs:[{type:"bytes"}],payable:!0,stateMutability:"payable"},{type:"function",name:"setExtraImageHash",constant:!1,inputs:[{type:"bytes32",name:"imageHash"},{type:"uint256",name:"expiration"}],outputs:[],payable:!1,stateMutability:"nonpayable"}];var I2e=Object.freeze({__proto__:null,abi:k2e});const P2e=[{type:"function",name:"updateImageHash",constant:!0,inputs:[{type:"bytes32"}],outputs:[],payable:!1,stateMutability:"view"},{type:"function",name:"imageHash",constant:!0,inputs:[],outputs:[{type:"bytes32"}],payable:!1,stateMutability:"view"}];var R2e=Object.freeze({__proto__:null,abi:P2e});const T2e=[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_mainModule",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_wallet",type:"address"},{indexed:!0,internalType:"bytes32",name:"_imageHash",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"_threshold",type:"uint256"},{indexed:!1,internalType:"bytes",name:"_signers",type:"bytes"}],name:"RequiredConfig",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_wallet",type:"address"},{indexed:!0,internalType:"address",name:"_signer",type:"address"}],name:"RequiredSigner",type:"event"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callBalanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callBlockNumber",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_i",type:"uint256"}],name:"callBlockhash",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"callChainId",outputs:[{internalType:"uint256",name:"id",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCode",outputs:[{internalType:"bytes",name:"code",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCodeHash",outputs:[{internalType:"bytes32",name:"codeHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCodeSize",outputs:[{internalType:"uint256",name:"size",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callCoinbase",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"callDifficulty",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasLeft",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasLimit",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasPrice",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callOrigin",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"callTimestamp",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"knownImageHashes",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"lastImageHashUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"lastSignerUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"lastWalletUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"bool",name:"delegateCall",type:"bool"},{internalType:"bool",name:"revertOnError",type:"bool"},{internalType:"uint256",name:"gasLimit",type:"uint256"},{internalType:"address",name:"target",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],internalType:"struct IModuleCalls.Transaction[]",name:"_txs",type:"tuple[]"}],name:"multiCall",outputs:[{internalType:"bool[]",name:"_successes",type:"bool[]"},{internalType:"bytes[]",name:"_results",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"uint256",name:"_threshold",type:"uint256"},{components:[{internalType:"uint256",name:"weight",type:"uint256"},{internalType:"address",name:"signer",type:"address"}],internalType:"struct RequireUtils.Member[]",name:"_members",type:"tuple[]"},{internalType:"bool",name:"_index",type:"bool"}],name:"publishConfig",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"uint256",name:"_sizeMembers",type:"uint256"},{internalType:"bytes",name:"_signature",type:"bytes"},{internalType:"bool",name:"_index",type:"bool"}],name:"publishInitialSigners",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"uint256",name:"_nonce",type:"uint256"}],name:"requireMinNonce",outputs:[],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_expiration",type:"uint256"}],name:"requireNonExpired",outputs:[],stateMutability:"view",type:"function"}];var O2e=Object.freeze({__proto__:null,abi:T2e});const $2e=[{inputs:[{internalType:"address",name:"",type:"address"}],name:"requireFreshSigner",outputs:[],stateMutability:"nonpayable",type:"function"}];var N2e=Object.freeze({__proto__:null,abi:$2e});const ji={erc6492:C2e,erc5719:b2e,erc1271:E2e,factory:A2e,mainModule:I2e,mainModuleUpgradable:R2e,sequenceUtils:O2e,requireFreshSigner:N2e},M2e=Object.freeze(Object.defineProperty({__proto__:null,walletContracts:ji},Symbol.toStringTag,{value:"Module"}));function s6(){return s6=Object.assign?Object.assign.bind():function(t){for(var e=1;ethis.fetch(this.url("Ping"),pt({},n)).then(i=>gt(i).then(s=>({status:s.status}))),this.version=n=>this.fetch(this.url("Version"),pt({},n)).then(i=>gt(i).then(s=>({version:s.version}))),this.runtimeStatus=n=>this.fetch(this.url("RuntimeStatus"),pt({},n)).then(i=>gt(i).then(s=>({status:s.status}))),this.getSequenceContext=n=>this.fetch(this.url("GetSequenceContext"),pt({},n)).then(i=>gt(i).then(s=>({data:s.data}))),this.getAuthToken=(n,i)=>this.fetch(this.url("GetAuthToken"),pt(n,i)).then(s=>gt(s).then(o=>({status:o.status,jwtToken:o.jwtToken,address:o.address,user:o.user}))),this.sendPasswordlessLink=(n,i)=>this.fetch(this.url("SendPasswordlessLink"),pt(n,i)).then(s=>gt(s).then(o=>({status:o.status}))),this.friendList=(n,i)=>this.fetch(this.url("FriendList"),pt(n,i)).then(s=>gt(s).then(o=>({page:o.page,friends:o.friends}))),this.getFriendByAddress=(n,i)=>this.fetch(this.url("GetFriendByAddress"),pt(n,i)).then(s=>gt(s).then(o=>({status:o.status,friend:o.friend}))),this.searchFriends=(n,i)=>this.fetch(this.url("SearchFriends"),pt(n,i)).then(s=>gt(s).then(o=>({friends:o.friends}))),this.addFriend=(n,i)=>this.fetch(this.url("AddFriend"),pt(n,i)).then(s=>gt(s).then(o=>({status:o.status,friend:o.friend}))),this.updateFriendNickname=(n,i)=>this.fetch(this.url("UpdateFriendNickname"),pt(n,i)).then(s=>gt(s).then(o=>({status:o.status,friend:o.friend}))),this.removeFriend=(n,i)=>this.fetch(this.url("RemoveFriend"),pt(n,i)).then(s=>gt(s).then(o=>({status:o.status}))),this.contractCall=(n,i)=>this.fetch(this.url("ContractCall"),pt(n,i)).then(s=>gt(s).then(o=>({returns:o.returns}))),this.decodeContractCall=(n,i)=>this.fetch(this.url("DecodeContractCall"),pt(n,i)).then(s=>gt(s).then(o=>({call:o.call}))),this.lookupContractCallSelectors=(n,i)=>this.fetch(this.url("LookupContractCallSelectors"),pt(n,i)).then(s=>gt(s).then(o=>({signatures:o.signatures}))),this.userStorageFetch=(n,i)=>this.fetch(this.url("UserStorageFetch"),pt(n,i)).then(s=>gt(s).then(o=>({object:o.object}))),this.userStorageSave=(n,i)=>this.fetch(this.url("UserStorageSave"),pt(n,i)).then(s=>gt(s).then(o=>({ok:o.ok}))),this.userStorageDelete=(n,i)=>this.fetch(this.url("UserStorageDelete"),pt(n,i)).then(s=>gt(s).then(o=>({ok:o.ok}))),this.userStorageFetchAll=(n,i)=>this.fetch(this.url("UserStorageFetchAll"),pt(n,i)).then(s=>gt(s).then(o=>({objects:o.objects}))),this.getMoonpayLink=(n,i)=>this.fetch(this.url("GetMoonpayLink"),pt(n,i)).then(s=>gt(s).then(o=>({signedUrl:o.signedUrl}))),this.getSardineClientToken=n=>this.fetch(this.url("GetSardineClientToken"),pt({},n)).then(i=>gt(i).then(s=>({token:s.token}))),this.isUsingGoogleMail=(n,i)=>this.fetch(this.url("IsUsingGoogleMail"),pt(n,i)).then(s=>gt(s).then(o=>({yes:o.yes}))),this.resolveENSAddress=(n,i)=>this.fetch(this.url("ResolveENSAddress"),pt(n,i)).then(s=>gt(s).then(o=>({address:o.address,ok:o.ok}))),this.isValidSignature=(n,i)=>this.fetch(this.url("IsValidSignature"),pt(n,i)).then(s=>gt(s).then(o=>({isValid:o.isValid}))),this.isValidMessageSignature=(n,i)=>this.fetch(this.url("IsValidMessageSignature"),pt(n,i)).then(s=>gt(s).then(o=>({isValid:o.isValid}))),this.isValidTypedDataSignature=(n,i)=>this.fetch(this.url("IsValidTypedDataSignature"),pt(n,i)).then(s=>gt(s).then(o=>({isValid:o.isValid}))),this.isValidETHAuthProof=(n,i)=>this.fetch(this.url("IsValidETHAuthProof"),pt(n,i)).then(s=>gt(s).then(o=>({isValid:o.isValid}))),this.getCoinPrices=(n,i)=>this.fetch(this.url("GetCoinPrices"),pt(n,i)).then(s=>gt(s).then(o=>({tokenPrices:o.tokenPrices}))),this.getCollectiblePrices=(n,i)=>this.fetch(this.url("GetCollectiblePrices"),pt(n,i)).then(s=>gt(s).then(o=>({tokenPrices:o.tokenPrices}))),this.getExchangeRate=(n,i)=>this.fetch(this.url("GetExchangeRate"),pt(n,i)).then(s=>gt(s).then(o=>({exchangeRate:o.exchangeRate}))),this.memoryStore=(n,i)=>this.fetch(this.url("MemoryStore"),pt(n,i)).then(s=>gt(s).then(o=>({ok:o.ok}))),this.memoryLoad=(n,i)=>this.fetch(this.url("MemoryLoad"),pt(n,i)).then(s=>gt(s).then(o=>({value:o.value}))),this.listPayCardsOnFile=n=>this.fetch(this.url("ListPayCardsOnFile"),pt({},n)).then(i=>gt(i).then(s=>({payCards:s.payCards}))),this.savePayCard=(n,i)=>this.fetch(this.url("SavePayCard"),pt(n,i)).then(s=>gt(s).then(o=>({ok:o.ok,payCard:o.payCard}))),this.updatePayCardCVC=(n,i)=>this.fetch(this.url("UpdatePayCardCVC"),pt(n,i)).then(s=>gt(s).then(o=>({ok:o.ok}))),this.deletePayCard=(n,i)=>this.fetch(this.url("DeletePayCard"),pt(n,i)).then(s=>gt(s).then(o=>({ok:o.ok}))),this.smartRampQuote=(n,i)=>this.fetch(this.url("SmartRampQuote"),pt(n,i)).then(s=>gt(s).then(o=>({status:o.status,quoteDetails:o.quoteDetails}))),this.smartRampPurchase=(n,i)=>this.fetch(this.url("SmartRampPurchase"),pt(n,i)).then(s=>gt(s).then(o=>({processing:o.processing,receipt:o.receipt}))),this.smartRampWaitOrderConfirmation=(n,i)=>this.fetch(this.url("SmartRampWaitOrderConfirmation"),pt(n,i)).then(s=>gt(s).then(o=>({done:o.done,receipt:o.receipt}))),this.smartRampGetOrder=(n,i)=>this.fetch(this.url("SmartRampGetOrder"),pt(n,i)).then(s=>gt(s).then(o=>({order:o.order}))),this.smartRampCheckCardAuthorization=(n,i)=>this.fetch(this.url("SmartRampCheckCardAuthorization"),pt(n,i)).then(s=>gt(s).then(o=>({cardAuth:o.cardAuth}))),this.smartRampOrdersList=(n,i)=>this.fetch(this.url("SmartRampOrdersList"),pt(n,i)).then(s=>gt(s).then(o=>({page:o.page,orders:o.orders}))),this.smartRampGetOrderTxnHash=(n,i)=>this.fetch(this.url("SmartRampGetOrderTxnHash"),pt(n,i)).then(s=>gt(s).then(o=>({txnHash:o.txnHash,txnSuccessful:o.txnSuccessful}))),this.smartRampSubmitCardAuthorization=(n,i)=>this.fetch(this.url("SmartRampSubmitCardAuthorization"),pt(n,i)).then(s=>gt(s).then(o=>({status:o.status}))),this.adminSmartRampGetOrder=(n,i)=>this.fetch(this.url("AdminSmartRampGetOrder"),pt(n,i)).then(s=>gt(s).then(o=>({order:o.order}))),this.adminSmartRampListCompletedOrders=(n,i)=>this.fetch(this.url("AdminSmartRampListCompletedOrders"),pt(n,i)).then(s=>gt(s).then(o=>({orders:o.orders}))),this.adminSmartRampListPendingOrders=(n,i)=>this.fetch(this.url("AdminSmartRampListPendingOrders"),pt(n,i)).then(s=>gt(s).then(o=>({pendingOrders:o.pendingOrders}))),this.getInviteInfo=n=>this.fetch(this.url("GetInviteInfo"),pt({},n)).then(i=>gt(i).then(s=>({inviteInfo:s.inviteInfo}))),this.isValidAccessCode=(n,i)=>this.fetch(this.url("IsValidAccessCode"),pt(n,i)).then(s=>gt(s).then(o=>({status:o.status}))),this.internalClaimAccessCode=(n,i)=>this.fetch(this.url("InternalClaimAccessCode"),pt(n,i)).then(s=>gt(s).then(o=>({status:o.status}))),this.walletRecover=(n,i)=>this.fetch(this.url("WalletRecover"),pt(n,i)).then(s=>gt(s).then(o=>({encryptedWallet:o.encryptedWallet}))),this.blockNumberAtTime=(n,i)=>this.fetch(this.url("BlockNumberAtTime"),pt(n,i)).then(s=>gt(s).then(o=>({blocks:o.blocks}))),this.paperSessionSecret=(n,i)=>this.fetch(this.url("PaperSessionSecret"),pt(n,i)).then(s=>gt(s).then(o=>({secret:o.secret}))),this.paperSessionSecret2=(n,i)=>this.fetch(this.url("PaperSessionSecret2"),pt(n,i)).then(s=>gt(s).then(o=>({secret:o.secret}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const pt=(t={},e={})=>({method:"POST",headers:s6({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{})}),gt=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch{throw{code:"unknown",msg:`expecting JSON, got: ${e}`,status:t.status}}if(!t.ok)throw r;return r}),zF=typeof global=="object"?global.fetch:window.fetch;class Uy extends kY{constructor(e,r,n){super(e.endsWith("/")?e.slice(0,-1):e,zF),this.projectAccessKey=r,this.jwtAuth=n,this._fetch=(i,s)=>{const o={},a=this.jwtAuth,c=this.projectAccessKey;return a&&a.length>0&&(o.Authorization=`BEARER ${a}`),c&&c.length>0&&(o["X-Access-Key"]=c),s.headers=s6({},s.headers,o),zF(i,s)},this.fetch=this._fetch}}const z2e=Object.freeze(Object.defineProperty({__proto__:null,API:kY,SequenceAPIClient:Uy,SmartRampOrderStatus:F2e,SmartRampTxnStatus:j2e,SortOrder:U2e,WebRPCSchemaHash:B2e,WebRPCSchemaVersion:L2e,WebRPCVersion:D2e},Symbol.toStringTag,{value:"Module"}));var WT={exports:{}};const H2e={},q2e=Object.freeze(Object.defineProperty({__proto__:null,default:H2e},Symbol.toStringTag,{value:"Module"})),i8=wf(q2e);WT.exports;(function(t){(function(e,r){function n(K,x){if(!K)throw new Error(x||"Assertion failed")}function i(K,x){K.super_=x;var A=function(){};A.prototype=x.prototype,K.prototype=new A,K.prototype.constructor=K}function s(K,x,A){if(s.isBN(K))return K;this.negative=0,this.words=null,this.length=0,this.red=null,K!==null&&((x==="le"||x==="be")&&(A=x,x=10),this._init(K||0,x||10,A||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=i8.Buffer}catch{}s.isBN=function(x){return x instanceof s?!0:x!==null&&typeof x=="object"&&x.constructor.wordSize===s.wordSize&&Array.isArray(x.words)},s.max=function(x,A){return x.cmp(A)>0?x:A},s.min=function(x,A){return x.cmp(A)<0?x:A},s.prototype._init=function(x,A,B){if(typeof x=="number")return this._initNumber(x,A,B);if(typeof x=="object")return this._initArray(x,A,B);A==="hex"&&(A=16),n(A===(A|0)&&A>=2&&A<=36),x=x.toString().replace(/\s+/g,"");var z=0;x[0]==="-"&&(z++,this.negative=1),z=0;z-=3)L=x[z]|x[z-1]<<8|x[z-2]<<16,this.words[R]|=L<>>26-q&67108863,q+=24,q>=26&&(q-=26,R++);else if(B==="le")for(z=0,R=0;z>>26-q&67108863,q+=24,q>=26&&(q-=26,R++);return this._strip()};function a(K,x){var A=K.charCodeAt(x);if(A>=48&&A<=57)return A-48;if(A>=65&&A<=70)return A-55;if(A>=97&&A<=102)return A-87;n(!1,"Invalid character in "+K)}function c(K,x,A){var B=a(K,A);return A-1>=x&&(B|=a(K,A-1)<<4),B}s.prototype._parseHex=function(x,A,B){this.length=Math.ceil((x.length-A)/6),this.words=new Array(this.length);for(var z=0;z=A;z-=2)q=c(x,A,z)<=18?(R-=18,L+=1,this.words[L]|=q>>>26):R+=8;else{var N=x.length-A;for(z=N%2===0?A+1:A;z=18?(R-=18,L+=1,this.words[L]|=q>>>26):R+=8}this._strip()};function l(K,x,A,B){for(var z=0,R=0,L=Math.min(K.length,A),q=x;q=49?R=N-49+10:N>=17?R=N-17+10:R=N,n(N>=0&&R1&&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?""}var d=["","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"],p=[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],g=[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(x,A){x=x||10,A=A|0||1;var B;if(x===16||x==="hex"){B="";for(var z=0,R=0,L=0;L>>24-z&16777215,z+=2,z>=26&&(z-=26,L--),R!==0||L!==this.length-1?B=d[6-N.length]+N+B:B=N+B}for(R!==0&&(B=R.toString(16)+B);B.length%A!==0;)B="0"+B;return this.negative!==0&&(B="-"+B),B}if(x===(x|0)&&x>=2&&x<=36){var I=p[x],U=g[x];B="";var re=this.clone();for(re.negative=0;!re.isZero();){var M=re.modrn(U).toString(x);re=re.idivn(U),re.isZero()?B=M+B:B=d[I-M.length]+M+B}for(this.isZero()&&(B="0"+B);B.length%A!==0;)B="0"+B;return this.negative!==0&&(B="-"+B),B}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var x=this.words[0];return this.length===2?x+=this.words[1]*67108864:this.length===3&&this.words[2]===1?x+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-x:x},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(x,A){return this.toArrayLike(o,x,A)}),s.prototype.toArray=function(x,A){return this.toArrayLike(Array,x,A)};var v=function(x,A){return x.allocUnsafe?x.allocUnsafe(A):new x(A)};s.prototype.toArrayLike=function(x,A,B){this._strip();var z=this.byteLength(),R=B||Math.max(1,z);n(z<=R,"byte array longer than desired length"),n(R>0,"Requested array length <= 0");var L=v(x,R),q=A==="le"?"LE":"BE";return this["_toArrayLike"+q](L,z),L},s.prototype._toArrayLikeLE=function(x,A){for(var B=0,z=0,R=0,L=0;R>8&255),B>16&255),L===6?(B>24&255),z=0,L=0):(z=q>>>24,L+=2)}if(B=0&&(x[B--]=q>>8&255),B>=0&&(x[B--]=q>>16&255),L===6?(B>=0&&(x[B--]=q>>24&255),z=0,L=0):(z=q>>>24,L+=2)}if(B>=0)for(x[B--]=z;B>=0;)x[B--]=0},Math.clz32?s.prototype._countBits=function(x){return 32-Math.clz32(x)}:s.prototype._countBits=function(x){var A=x,B=0;return A>=4096&&(B+=13,A>>>=13),A>=64&&(B+=7,A>>>=7),A>=8&&(B+=4,A>>>=4),A>=2&&(B+=2,A>>>=2),B+A},s.prototype._zeroBits=function(x){if(x===0)return 26;var A=x,B=0;return A&8191||(B+=13,A>>>=13),A&127||(B+=7,A>>>=7),A&15||(B+=4,A>>>=4),A&3||(B+=2,A>>>=2),A&1||B++,B},s.prototype.bitLength=function(){var x=this.words[this.length-1],A=this._countBits(x);return(this.length-1)*26+A};function y(K){for(var x=new Array(K.bitLength()),A=0;A>>z&1}return x}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var x=0,A=0;Ax.length?this.clone().ior(x):x.clone().ior(this)},s.prototype.uor=function(x){return this.length>x.length?this.clone().iuor(x):x.clone().iuor(this)},s.prototype.iuand=function(x){var A;this.length>x.length?A=x:A=this;for(var B=0;Bx.length?this.clone().iand(x):x.clone().iand(this)},s.prototype.uand=function(x){return this.length>x.length?this.clone().iuand(x):x.clone().iuand(this)},s.prototype.iuxor=function(x){var A,B;this.length>x.length?(A=this,B=x):(A=x,B=this);for(var z=0;zx.length?this.clone().ixor(x):x.clone().ixor(this)},s.prototype.uxor=function(x){return this.length>x.length?this.clone().iuxor(x):x.clone().iuxor(this)},s.prototype.inotn=function(x){n(typeof x=="number"&&x>=0);var A=Math.ceil(x/26)|0,B=x%26;this._expand(A),B>0&&A--;for(var z=0;z0&&(this.words[z]=~this.words[z]&67108863>>26-B),this._strip()},s.prototype.notn=function(x){return this.clone().inotn(x)},s.prototype.setn=function(x,A){n(typeof x=="number"&&x>=0);var B=x/26|0,z=x%26;return this._expand(B+1),A?this.words[B]=this.words[B]|1<x.length?(B=this,z=x):(B=x,z=this);for(var R=0,L=0;L>>26;for(;R!==0&&L>>26;if(this.length=B.length,R!==0)this.words[this.length]=R,this.length++;else if(B!==this)for(;Lx.length?this.clone().iadd(x):x.clone().iadd(this)},s.prototype.isub=function(x){if(x.negative!==0){x.negative=0;var A=this.iadd(x);return x.negative=1,A._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(x),this.negative=1,this._normSign();var B=this.cmp(x);if(B===0)return this.negative=0,this.length=1,this.words[0]=0,this;var z,R;B>0?(z=this,R=x):(z=x,R=this);for(var L=0,q=0;q>26,this.words[q]=A&67108863;for(;L!==0&&q>26,this.words[q]=A&67108863;if(L===0&&q>>26,re=N&67108863,M=Math.min(I,x.length-1),G=Math.max(0,I-K.length+1);G<=M;G++){var H=I-G|0;z=K.words[H]|0,R=x.words[G]|0,L=z*R+re,U+=L/67108864|0,re=L&67108863}A.words[I]=re|0,N=U|0}return N!==0?A.words[I]=N|0:A.length--,A._strip()}var w=function(x,A,B){var z=x.words,R=A.words,L=B.words,q=0,N,I,U,re=z[0]|0,M=re&8191,G=re>>>13,H=z[1]|0,J=H&8191,X=H>>>13,D=z[2]|0,F=D&8191,Y=D>>>13,ue=z[3]|0,he=ue&8191,Ce=ue>>>13,Me=z[4]|0,Oe=Me&8191,We=Me>>>13,ot=z[5]|0,ze=ot&8191,Le=ot>>>13,et=z[6]|0,He=et&8191,Ge=et>>>13,Ye=z[7]|0,qe=Ye&8191,ee=Ye>>>13,j=z[8]|0,W=j&8191,ie=j>>>13,de=z[9]|0,pe=de&8191,be=de>>>13,je=R[0]|0,Fe=je&8191,Qe=je>>>13,kt=R[1]|0,Ze=kt&8191,$t=kt>>>13,Wn=R[2]|0,Xt=Wn&8191,rr=Wn>>>13,gr=R[3]|0,dt=gr&8191,yt=gr>>>13,mr=R[4]|0,vt=mr&8191,ht=mr>>>13,kr=R[5]|0,_t=kr&8191,bt=kr>>>13,Ir=R[6]|0,wt=Ir&8191,xt=Ir>>>13,vr=R[7]|0,ft=vr&8191,Ct=vr>>>13,Pr=R[8]|0,yr=Pr&8191,br=Pr>>>13,Rs=R[9]|0,Wt=Rs&8191,wr=Rs>>>13;B.negative=x.negative^A.negative,B.length=19,N=Math.imul(M,Fe),I=Math.imul(M,Qe),I=I+Math.imul(G,Fe)|0,U=Math.imul(G,Qe);var cs=(q+N|0)+((I&8191)<<13)|0;q=(U+(I>>>13)|0)+(cs>>>26)|0,cs&=67108863,N=Math.imul(J,Fe),I=Math.imul(J,Qe),I=I+Math.imul(X,Fe)|0,U=Math.imul(X,Qe),N=N+Math.imul(M,Ze)|0,I=I+Math.imul(M,$t)|0,I=I+Math.imul(G,Ze)|0,U=U+Math.imul(G,$t)|0;var ls=(q+N|0)+((I&8191)<<13)|0;q=(U+(I>>>13)|0)+(ls>>>26)|0,ls&=67108863,N=Math.imul(F,Fe),I=Math.imul(F,Qe),I=I+Math.imul(Y,Fe)|0,U=Math.imul(Y,Qe),N=N+Math.imul(J,Ze)|0,I=I+Math.imul(J,$t)|0,I=I+Math.imul(X,Ze)|0,U=U+Math.imul(X,$t)|0,N=N+Math.imul(M,Xt)|0,I=I+Math.imul(M,rr)|0,I=I+Math.imul(G,Xt)|0,U=U+Math.imul(G,rr)|0;var us=(q+N|0)+((I&8191)<<13)|0;q=(U+(I>>>13)|0)+(us>>>26)|0,us&=67108863,N=Math.imul(he,Fe),I=Math.imul(he,Qe),I=I+Math.imul(Ce,Fe)|0,U=Math.imul(Ce,Qe),N=N+Math.imul(F,Ze)|0,I=I+Math.imul(F,$t)|0,I=I+Math.imul(Y,Ze)|0,U=U+Math.imul(Y,$t)|0,N=N+Math.imul(J,Xt)|0,I=I+Math.imul(J,rr)|0,I=I+Math.imul(X,Xt)|0,U=U+Math.imul(X,rr)|0,N=N+Math.imul(M,dt)|0,I=I+Math.imul(M,yt)|0,I=I+Math.imul(G,dt)|0,U=U+Math.imul(G,yt)|0;var fs=(q+N|0)+((I&8191)<<13)|0;q=(U+(I>>>13)|0)+(fs>>>26)|0,fs&=67108863,N=Math.imul(Oe,Fe),I=Math.imul(Oe,Qe),I=I+Math.imul(We,Fe)|0,U=Math.imul(We,Qe),N=N+Math.imul(he,Ze)|0,I=I+Math.imul(he,$t)|0,I=I+Math.imul(Ce,Ze)|0,U=U+Math.imul(Ce,$t)|0,N=N+Math.imul(F,Xt)|0,I=I+Math.imul(F,rr)|0,I=I+Math.imul(Y,Xt)|0,U=U+Math.imul(Y,rr)|0,N=N+Math.imul(J,dt)|0,I=I+Math.imul(J,yt)|0,I=I+Math.imul(X,dt)|0,U=U+Math.imul(X,yt)|0,N=N+Math.imul(M,vt)|0,I=I+Math.imul(M,ht)|0,I=I+Math.imul(G,vt)|0,U=U+Math.imul(G,ht)|0;var $n=(q+N|0)+((I&8191)<<13)|0;q=(U+(I>>>13)|0)+($n>>>26)|0,$n&=67108863,N=Math.imul(ze,Fe),I=Math.imul(ze,Qe),I=I+Math.imul(Le,Fe)|0,U=Math.imul(Le,Qe),N=N+Math.imul(Oe,Ze)|0,I=I+Math.imul(Oe,$t)|0,I=I+Math.imul(We,Ze)|0,U=U+Math.imul(We,$t)|0,N=N+Math.imul(he,Xt)|0,I=I+Math.imul(he,rr)|0,I=I+Math.imul(Ce,Xt)|0,U=U+Math.imul(Ce,rr)|0,N=N+Math.imul(F,dt)|0,I=I+Math.imul(F,yt)|0,I=I+Math.imul(Y,dt)|0,U=U+Math.imul(Y,yt)|0,N=N+Math.imul(J,vt)|0,I=I+Math.imul(J,ht)|0,I=I+Math.imul(X,vt)|0,U=U+Math.imul(X,ht)|0,N=N+Math.imul(M,_t)|0,I=I+Math.imul(M,bt)|0,I=I+Math.imul(G,_t)|0,U=U+Math.imul(G,bt)|0;var no=(q+N|0)+((I&8191)<<13)|0;q=(U+(I>>>13)|0)+(no>>>26)|0,no&=67108863,N=Math.imul(He,Fe),I=Math.imul(He,Qe),I=I+Math.imul(Ge,Fe)|0,U=Math.imul(Ge,Qe),N=N+Math.imul(ze,Ze)|0,I=I+Math.imul(ze,$t)|0,I=I+Math.imul(Le,Ze)|0,U=U+Math.imul(Le,$t)|0,N=N+Math.imul(Oe,Xt)|0,I=I+Math.imul(Oe,rr)|0,I=I+Math.imul(We,Xt)|0,U=U+Math.imul(We,rr)|0,N=N+Math.imul(he,dt)|0,I=I+Math.imul(he,yt)|0,I=I+Math.imul(Ce,dt)|0,U=U+Math.imul(Ce,yt)|0,N=N+Math.imul(F,vt)|0,I=I+Math.imul(F,ht)|0,I=I+Math.imul(Y,vt)|0,U=U+Math.imul(Y,ht)|0,N=N+Math.imul(J,_t)|0,I=I+Math.imul(J,bt)|0,I=I+Math.imul(X,_t)|0,U=U+Math.imul(X,bt)|0,N=N+Math.imul(M,wt)|0,I=I+Math.imul(M,xt)|0,I=I+Math.imul(G,wt)|0,U=U+Math.imul(G,xt)|0;var cc=(q+N|0)+((I&8191)<<13)|0;q=(U+(I>>>13)|0)+(cc>>>26)|0,cc&=67108863,N=Math.imul(qe,Fe),I=Math.imul(qe,Qe),I=I+Math.imul(ee,Fe)|0,U=Math.imul(ee,Qe),N=N+Math.imul(He,Ze)|0,I=I+Math.imul(He,$t)|0,I=I+Math.imul(Ge,Ze)|0,U=U+Math.imul(Ge,$t)|0,N=N+Math.imul(ze,Xt)|0,I=I+Math.imul(ze,rr)|0,I=I+Math.imul(Le,Xt)|0,U=U+Math.imul(Le,rr)|0,N=N+Math.imul(Oe,dt)|0,I=I+Math.imul(Oe,yt)|0,I=I+Math.imul(We,dt)|0,U=U+Math.imul(We,yt)|0,N=N+Math.imul(he,vt)|0,I=I+Math.imul(he,ht)|0,I=I+Math.imul(Ce,vt)|0,U=U+Math.imul(Ce,ht)|0,N=N+Math.imul(F,_t)|0,I=I+Math.imul(F,bt)|0,I=I+Math.imul(Y,_t)|0,U=U+Math.imul(Y,bt)|0,N=N+Math.imul(J,wt)|0,I=I+Math.imul(J,xt)|0,I=I+Math.imul(X,wt)|0,U=U+Math.imul(X,xt)|0,N=N+Math.imul(M,ft)|0,I=I+Math.imul(M,Ct)|0,I=I+Math.imul(G,ft)|0,U=U+Math.imul(G,Ct)|0;var io=(q+N|0)+((I&8191)<<13)|0;q=(U+(I>>>13)|0)+(io>>>26)|0,io&=67108863,N=Math.imul(W,Fe),I=Math.imul(W,Qe),I=I+Math.imul(ie,Fe)|0,U=Math.imul(ie,Qe),N=N+Math.imul(qe,Ze)|0,I=I+Math.imul(qe,$t)|0,I=I+Math.imul(ee,Ze)|0,U=U+Math.imul(ee,$t)|0,N=N+Math.imul(He,Xt)|0,I=I+Math.imul(He,rr)|0,I=I+Math.imul(Ge,Xt)|0,U=U+Math.imul(Ge,rr)|0,N=N+Math.imul(ze,dt)|0,I=I+Math.imul(ze,yt)|0,I=I+Math.imul(Le,dt)|0,U=U+Math.imul(Le,yt)|0,N=N+Math.imul(Oe,vt)|0,I=I+Math.imul(Oe,ht)|0,I=I+Math.imul(We,vt)|0,U=U+Math.imul(We,ht)|0,N=N+Math.imul(he,_t)|0,I=I+Math.imul(he,bt)|0,I=I+Math.imul(Ce,_t)|0,U=U+Math.imul(Ce,bt)|0,N=N+Math.imul(F,wt)|0,I=I+Math.imul(F,xt)|0,I=I+Math.imul(Y,wt)|0,U=U+Math.imul(Y,xt)|0,N=N+Math.imul(J,ft)|0,I=I+Math.imul(J,Ct)|0,I=I+Math.imul(X,ft)|0,U=U+Math.imul(X,Ct)|0,N=N+Math.imul(M,yr)|0,I=I+Math.imul(M,br)|0,I=I+Math.imul(G,yr)|0,U=U+Math.imul(G,br)|0;var lc=(q+N|0)+((I&8191)<<13)|0;q=(U+(I>>>13)|0)+(lc>>>26)|0,lc&=67108863,N=Math.imul(pe,Fe),I=Math.imul(pe,Qe),I=I+Math.imul(be,Fe)|0,U=Math.imul(be,Qe),N=N+Math.imul(W,Ze)|0,I=I+Math.imul(W,$t)|0,I=I+Math.imul(ie,Ze)|0,U=U+Math.imul(ie,$t)|0,N=N+Math.imul(qe,Xt)|0,I=I+Math.imul(qe,rr)|0,I=I+Math.imul(ee,Xt)|0,U=U+Math.imul(ee,rr)|0,N=N+Math.imul(He,dt)|0,I=I+Math.imul(He,yt)|0,I=I+Math.imul(Ge,dt)|0,U=U+Math.imul(Ge,yt)|0,N=N+Math.imul(ze,vt)|0,I=I+Math.imul(ze,ht)|0,I=I+Math.imul(Le,vt)|0,U=U+Math.imul(Le,ht)|0,N=N+Math.imul(Oe,_t)|0,I=I+Math.imul(Oe,bt)|0,I=I+Math.imul(We,_t)|0,U=U+Math.imul(We,bt)|0,N=N+Math.imul(he,wt)|0,I=I+Math.imul(he,xt)|0,I=I+Math.imul(Ce,wt)|0,U=U+Math.imul(Ce,xt)|0,N=N+Math.imul(F,ft)|0,I=I+Math.imul(F,Ct)|0,I=I+Math.imul(Y,ft)|0,U=U+Math.imul(Y,Ct)|0,N=N+Math.imul(J,yr)|0,I=I+Math.imul(J,br)|0,I=I+Math.imul(X,yr)|0,U=U+Math.imul(X,br)|0,N=N+Math.imul(M,Wt)|0,I=I+Math.imul(M,wr)|0,I=I+Math.imul(G,Wt)|0,U=U+Math.imul(G,wr)|0;var uc=(q+N|0)+((I&8191)<<13)|0;q=(U+(I>>>13)|0)+(uc>>>26)|0,uc&=67108863,N=Math.imul(pe,Ze),I=Math.imul(pe,$t),I=I+Math.imul(be,Ze)|0,U=Math.imul(be,$t),N=N+Math.imul(W,Xt)|0,I=I+Math.imul(W,rr)|0,I=I+Math.imul(ie,Xt)|0,U=U+Math.imul(ie,rr)|0,N=N+Math.imul(qe,dt)|0,I=I+Math.imul(qe,yt)|0,I=I+Math.imul(ee,dt)|0,U=U+Math.imul(ee,yt)|0,N=N+Math.imul(He,vt)|0,I=I+Math.imul(He,ht)|0,I=I+Math.imul(Ge,vt)|0,U=U+Math.imul(Ge,ht)|0,N=N+Math.imul(ze,_t)|0,I=I+Math.imul(ze,bt)|0,I=I+Math.imul(Le,_t)|0,U=U+Math.imul(Le,bt)|0,N=N+Math.imul(Oe,wt)|0,I=I+Math.imul(Oe,xt)|0,I=I+Math.imul(We,wt)|0,U=U+Math.imul(We,xt)|0,N=N+Math.imul(he,ft)|0,I=I+Math.imul(he,Ct)|0,I=I+Math.imul(Ce,ft)|0,U=U+Math.imul(Ce,Ct)|0,N=N+Math.imul(F,yr)|0,I=I+Math.imul(F,br)|0,I=I+Math.imul(Y,yr)|0,U=U+Math.imul(Y,br)|0,N=N+Math.imul(J,Wt)|0,I=I+Math.imul(J,wr)|0,I=I+Math.imul(X,Wt)|0,U=U+Math.imul(X,wr)|0;var so=(q+N|0)+((I&8191)<<13)|0;q=(U+(I>>>13)|0)+(so>>>26)|0,so&=67108863,N=Math.imul(pe,Xt),I=Math.imul(pe,rr),I=I+Math.imul(be,Xt)|0,U=Math.imul(be,rr),N=N+Math.imul(W,dt)|0,I=I+Math.imul(W,yt)|0,I=I+Math.imul(ie,dt)|0,U=U+Math.imul(ie,yt)|0,N=N+Math.imul(qe,vt)|0,I=I+Math.imul(qe,ht)|0,I=I+Math.imul(ee,vt)|0,U=U+Math.imul(ee,ht)|0,N=N+Math.imul(He,_t)|0,I=I+Math.imul(He,bt)|0,I=I+Math.imul(Ge,_t)|0,U=U+Math.imul(Ge,bt)|0,N=N+Math.imul(ze,wt)|0,I=I+Math.imul(ze,xt)|0,I=I+Math.imul(Le,wt)|0,U=U+Math.imul(Le,xt)|0,N=N+Math.imul(Oe,ft)|0,I=I+Math.imul(Oe,Ct)|0,I=I+Math.imul(We,ft)|0,U=U+Math.imul(We,Ct)|0,N=N+Math.imul(he,yr)|0,I=I+Math.imul(he,br)|0,I=I+Math.imul(Ce,yr)|0,U=U+Math.imul(Ce,br)|0,N=N+Math.imul(F,Wt)|0,I=I+Math.imul(F,wr)|0,I=I+Math.imul(Y,Wt)|0,U=U+Math.imul(Y,wr)|0;var ma=(q+N|0)+((I&8191)<<13)|0;q=(U+(I>>>13)|0)+(ma>>>26)|0,ma&=67108863,N=Math.imul(pe,dt),I=Math.imul(pe,yt),I=I+Math.imul(be,dt)|0,U=Math.imul(be,yt),N=N+Math.imul(W,vt)|0,I=I+Math.imul(W,ht)|0,I=I+Math.imul(ie,vt)|0,U=U+Math.imul(ie,ht)|0,N=N+Math.imul(qe,_t)|0,I=I+Math.imul(qe,bt)|0,I=I+Math.imul(ee,_t)|0,U=U+Math.imul(ee,bt)|0,N=N+Math.imul(He,wt)|0,I=I+Math.imul(He,xt)|0,I=I+Math.imul(Ge,wt)|0,U=U+Math.imul(Ge,xt)|0,N=N+Math.imul(ze,ft)|0,I=I+Math.imul(ze,Ct)|0,I=I+Math.imul(Le,ft)|0,U=U+Math.imul(Le,Ct)|0,N=N+Math.imul(Oe,yr)|0,I=I+Math.imul(Oe,br)|0,I=I+Math.imul(We,yr)|0,U=U+Math.imul(We,br)|0,N=N+Math.imul(he,Wt)|0,I=I+Math.imul(he,wr)|0,I=I+Math.imul(Ce,Wt)|0,U=U+Math.imul(Ce,wr)|0;var va=(q+N|0)+((I&8191)<<13)|0;q=(U+(I>>>13)|0)+(va>>>26)|0,va&=67108863,N=Math.imul(pe,vt),I=Math.imul(pe,ht),I=I+Math.imul(be,vt)|0,U=Math.imul(be,ht),N=N+Math.imul(W,_t)|0,I=I+Math.imul(W,bt)|0,I=I+Math.imul(ie,_t)|0,U=U+Math.imul(ie,bt)|0,N=N+Math.imul(qe,wt)|0,I=I+Math.imul(qe,xt)|0,I=I+Math.imul(ee,wt)|0,U=U+Math.imul(ee,xt)|0,N=N+Math.imul(He,ft)|0,I=I+Math.imul(He,Ct)|0,I=I+Math.imul(Ge,ft)|0,U=U+Math.imul(Ge,Ct)|0,N=N+Math.imul(ze,yr)|0,I=I+Math.imul(ze,br)|0,I=I+Math.imul(Le,yr)|0,U=U+Math.imul(Le,br)|0,N=N+Math.imul(Oe,Wt)|0,I=I+Math.imul(Oe,wr)|0,I=I+Math.imul(We,Wt)|0,U=U+Math.imul(We,wr)|0;var di=(q+N|0)+((I&8191)<<13)|0;q=(U+(I>>>13)|0)+(di>>>26)|0,di&=67108863,N=Math.imul(pe,_t),I=Math.imul(pe,bt),I=I+Math.imul(be,_t)|0,U=Math.imul(be,bt),N=N+Math.imul(W,wt)|0,I=I+Math.imul(W,xt)|0,I=I+Math.imul(ie,wt)|0,U=U+Math.imul(ie,xt)|0,N=N+Math.imul(qe,ft)|0,I=I+Math.imul(qe,Ct)|0,I=I+Math.imul(ee,ft)|0,U=U+Math.imul(ee,Ct)|0,N=N+Math.imul(He,yr)|0,I=I+Math.imul(He,br)|0,I=I+Math.imul(Ge,yr)|0,U=U+Math.imul(Ge,br)|0,N=N+Math.imul(ze,Wt)|0,I=I+Math.imul(ze,wr)|0,I=I+Math.imul(Le,Wt)|0,U=U+Math.imul(Le,wr)|0;var Ih=(q+N|0)+((I&8191)<<13)|0;q=(U+(I>>>13)|0)+(Ih>>>26)|0,Ih&=67108863,N=Math.imul(pe,wt),I=Math.imul(pe,xt),I=I+Math.imul(be,wt)|0,U=Math.imul(be,xt),N=N+Math.imul(W,ft)|0,I=I+Math.imul(W,Ct)|0,I=I+Math.imul(ie,ft)|0,U=U+Math.imul(ie,Ct)|0,N=N+Math.imul(qe,yr)|0,I=I+Math.imul(qe,br)|0,I=I+Math.imul(ee,yr)|0,U=U+Math.imul(ee,br)|0,N=N+Math.imul(He,Wt)|0,I=I+Math.imul(He,wr)|0,I=I+Math.imul(Ge,Wt)|0,U=U+Math.imul(Ge,wr)|0;var Ph=(q+N|0)+((I&8191)<<13)|0;q=(U+(I>>>13)|0)+(Ph>>>26)|0,Ph&=67108863,N=Math.imul(pe,ft),I=Math.imul(pe,Ct),I=I+Math.imul(be,ft)|0,U=Math.imul(be,Ct),N=N+Math.imul(W,yr)|0,I=I+Math.imul(W,br)|0,I=I+Math.imul(ie,yr)|0,U=U+Math.imul(ie,br)|0,N=N+Math.imul(qe,Wt)|0,I=I+Math.imul(qe,wr)|0,I=I+Math.imul(ee,Wt)|0,U=U+Math.imul(ee,wr)|0;var Rh=(q+N|0)+((I&8191)<<13)|0;q=(U+(I>>>13)|0)+(Rh>>>26)|0,Rh&=67108863,N=Math.imul(pe,yr),I=Math.imul(pe,br),I=I+Math.imul(be,yr)|0,U=Math.imul(be,br),N=N+Math.imul(W,Wt)|0,I=I+Math.imul(W,wr)|0,I=I+Math.imul(ie,Wt)|0,U=U+Math.imul(ie,wr)|0;var Th=(q+N|0)+((I&8191)<<13)|0;q=(U+(I>>>13)|0)+(Th>>>26)|0,Th&=67108863,N=Math.imul(pe,Wt),I=Math.imul(pe,wr),I=I+Math.imul(be,Wt)|0,U=Math.imul(be,wr);var Nf=(q+N|0)+((I&8191)<<13)|0;return q=(U+(I>>>13)|0)+(Nf>>>26)|0,Nf&=67108863,L[0]=cs,L[1]=ls,L[2]=us,L[3]=fs,L[4]=$n,L[5]=no,L[6]=cc,L[7]=io,L[8]=lc,L[9]=uc,L[10]=so,L[11]=ma,L[12]=va,L[13]=di,L[14]=Ih,L[15]=Ph,L[16]=Rh,L[17]=Th,L[18]=Nf,q!==0&&(L[19]=q,B.length++),B};Math.imul||(w=b);function E(K,x,A){A.negative=x.negative^K.negative,A.length=K.length+x.length;for(var B=0,z=0,R=0;R>>26)|0,z+=L>>>26,L&=67108863}A.words[R]=q,B=L,L=z}return B!==0?A.words[R]=B:A.length--,A._strip()}function C(K,x,A){return E(K,x,A)}s.prototype.mulTo=function(x,A){var B,z=this.length+x.length;return this.length===10&&x.length===10?B=w(this,x,A):z<63?B=b(this,x,A):z<1024?B=E(this,x,A):B=C(this,x,A),B},s.prototype.mul=function(x){var A=new s(null);return A.words=new Array(this.length+x.length),this.mulTo(x,A)},s.prototype.mulf=function(x){var A=new s(null);return A.words=new Array(this.length+x.length),C(this,x,A)},s.prototype.imul=function(x){return this.clone().mulTo(x,this)},s.prototype.imuln=function(x){var A=x<0;A&&(x=-x),n(typeof x=="number"),n(x<67108864);for(var B=0,z=0;z>=26,B+=R/67108864|0,B+=L>>>26,this.words[z]=L&67108863}return B!==0&&(this.words[z]=B,this.length++),A?this.ineg():this},s.prototype.muln=function(x){return this.clone().imuln(x)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(x){var A=y(x);if(A.length===0)return new s(1);for(var B=this,z=0;z=0);var A=x%26,B=(x-A)/26,z=67108863>>>26-A<<26-A,R;if(A!==0){var L=0;for(R=0;R>>26-A}L&&(this.words[R]=L,this.length++)}if(B!==0){for(R=this.length-1;R>=0;R--)this.words[R+B]=this.words[R];for(R=0;R=0);var z;A?z=(A-A%26)/26:z=0;var R=x%26,L=Math.min((x-R)/26,this.length),q=67108863^67108863>>>R<L)for(this.length-=L,I=0;I=0&&(U!==0||I>=z);I--){var re=this.words[I]|0;this.words[I]=U<<26-R|re>>>R,U=re&q}return N&&U!==0&&(N.words[N.length++]=U),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(x,A,B){return n(this.negative===0),this.iushrn(x,A,B)},s.prototype.shln=function(x){return this.clone().ishln(x)},s.prototype.ushln=function(x){return this.clone().iushln(x)},s.prototype.shrn=function(x){return this.clone().ishrn(x)},s.prototype.ushrn=function(x){return this.clone().iushrn(x)},s.prototype.testn=function(x){n(typeof x=="number"&&x>=0);var A=x%26,B=(x-A)/26,z=1<=0);var A=x%26,B=(x-A)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=B)return this;if(A!==0&&B++,this.length=Math.min(B,this.length),A!==0){var z=67108863^67108863>>>A<=67108864;A++)this.words[A]-=67108864,A===this.length-1?this.words[A+1]=1:this.words[A+1]++;return this.length=Math.max(this.length,A+1),this},s.prototype.isubn=function(x){if(n(typeof x=="number"),n(x<67108864),x<0)return this.iaddn(-x);if(this.negative!==0)return this.negative=0,this.iaddn(x),this.negative=1,this;if(this.words[0]-=x,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var A=0;A>26)-(N/67108864|0),this.words[R+B]=L&67108863}for(;R>26,this.words[R+B]=L&67108863;if(q===0)return this._strip();for(n(q===-1),q=0,R=0;R>26,this.words[R]=L&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(x,A){var B=this.length-x.length,z=this.clone(),R=x,L=R.words[R.length-1]|0,q=this._countBits(L);B=26-q,B!==0&&(R=R.ushln(B),z.iushln(B),L=R.words[R.length-1]|0);var N=z.length-R.length,I;if(A!=="mod"){I=new s(null),I.length=N+1,I.words=new Array(I.length);for(var U=0;U=0;M--){var G=(z.words[R.length+M]|0)*67108864+(z.words[R.length+M-1]|0);for(G=Math.min(G/L|0,67108863),z._ishlnsubmul(R,G,M);z.negative!==0;)G--,z.negative=0,z._ishlnsubmul(R,1,M),z.isZero()||(z.negative^=1);I&&(I.words[M]=G)}return I&&I._strip(),z._strip(),A!=="div"&&B!==0&&z.iushrn(B),{div:I||null,mod:z}},s.prototype.divmod=function(x,A,B){if(n(!x.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var z,R,L;return this.negative!==0&&x.negative===0?(L=this.neg().divmod(x,A),A!=="mod"&&(z=L.div.neg()),A!=="div"&&(R=L.mod.neg(),B&&R.negative!==0&&R.iadd(x)),{div:z,mod:R}):this.negative===0&&x.negative!==0?(L=this.divmod(x.neg(),A),A!=="mod"&&(z=L.div.neg()),{div:z,mod:L.mod}):this.negative&x.negative?(L=this.neg().divmod(x.neg(),A),A!=="div"&&(R=L.mod.neg(),B&&R.negative!==0&&R.isub(x)),{div:L.div,mod:R}):x.length>this.length||this.cmp(x)<0?{div:new s(0),mod:this}:x.length===1?A==="div"?{div:this.divn(x.words[0]),mod:null}:A==="mod"?{div:null,mod:new s(this.modrn(x.words[0]))}:{div:this.divn(x.words[0]),mod:new s(this.modrn(x.words[0]))}:this._wordDiv(x,A)},s.prototype.div=function(x){return this.divmod(x,"div",!1).div},s.prototype.mod=function(x){return this.divmod(x,"mod",!1).mod},s.prototype.umod=function(x){return this.divmod(x,"mod",!0).mod},s.prototype.divRound=function(x){var A=this.divmod(x);if(A.mod.isZero())return A.div;var B=A.div.negative!==0?A.mod.isub(x):A.mod,z=x.ushrn(1),R=x.andln(1),L=B.cmp(z);return L<0||R===1&&L===0?A.div:A.div.negative!==0?A.div.isubn(1):A.div.iaddn(1)},s.prototype.modrn=function(x){var A=x<0;A&&(x=-x),n(x<=67108863);for(var B=(1<<26)%x,z=0,R=this.length-1;R>=0;R--)z=(B*z+(this.words[R]|0))%x;return A?-z:z},s.prototype.modn=function(x){return this.modrn(x)},s.prototype.idivn=function(x){var A=x<0;A&&(x=-x),n(x<=67108863);for(var B=0,z=this.length-1;z>=0;z--){var R=(this.words[z]|0)+B*67108864;this.words[z]=R/x|0,B=R%x}return this._strip(),A?this.ineg():this},s.prototype.divn=function(x){return this.clone().idivn(x)},s.prototype.egcd=function(x){n(x.negative===0),n(!x.isZero());var A=this,B=x.clone();A.negative!==0?A=A.umod(x):A=A.clone();for(var z=new s(1),R=new s(0),L=new s(0),q=new s(1),N=0;A.isEven()&&B.isEven();)A.iushrn(1),B.iushrn(1),++N;for(var I=B.clone(),U=A.clone();!A.isZero();){for(var re=0,M=1;!(A.words[0]&M)&&re<26;++re,M<<=1);if(re>0)for(A.iushrn(re);re-- >0;)(z.isOdd()||R.isOdd())&&(z.iadd(I),R.isub(U)),z.iushrn(1),R.iushrn(1);for(var G=0,H=1;!(B.words[0]&H)&&G<26;++G,H<<=1);if(G>0)for(B.iushrn(G);G-- >0;)(L.isOdd()||q.isOdd())&&(L.iadd(I),q.isub(U)),L.iushrn(1),q.iushrn(1);A.cmp(B)>=0?(A.isub(B),z.isub(L),R.isub(q)):(B.isub(A),L.isub(z),q.isub(R))}return{a:L,b:q,gcd:B.iushln(N)}},s.prototype._invmp=function(x){n(x.negative===0),n(!x.isZero());var A=this,B=x.clone();A.negative!==0?A=A.umod(x):A=A.clone();for(var z=new s(1),R=new s(0),L=B.clone();A.cmpn(1)>0&&B.cmpn(1)>0;){for(var q=0,N=1;!(A.words[0]&N)&&q<26;++q,N<<=1);if(q>0)for(A.iushrn(q);q-- >0;)z.isOdd()&&z.iadd(L),z.iushrn(1);for(var I=0,U=1;!(B.words[0]&U)&&I<26;++I,U<<=1);if(I>0)for(B.iushrn(I);I-- >0;)R.isOdd()&&R.iadd(L),R.iushrn(1);A.cmp(B)>=0?(A.isub(B),z.isub(R)):(B.isub(A),R.isub(z))}var re;return A.cmpn(1)===0?re=z:re=R,re.cmpn(0)<0&&re.iadd(x),re},s.prototype.gcd=function(x){if(this.isZero())return x.abs();if(x.isZero())return this.abs();var A=this.clone(),B=x.clone();A.negative=0,B.negative=0;for(var z=0;A.isEven()&&B.isEven();z++)A.iushrn(1),B.iushrn(1);do{for(;A.isEven();)A.iushrn(1);for(;B.isEven();)B.iushrn(1);var R=A.cmp(B);if(R<0){var L=A;A=B,B=L}else if(R===0||B.cmpn(1)===0)break;A.isub(B)}while(!0);return B.iushln(z)},s.prototype.invm=function(x){return this.egcd(x).a.umod(x)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(x){return this.words[0]&x},s.prototype.bincn=function(x){n(typeof x=="number");var A=x%26,B=(x-A)/26,z=1<>>26,q&=67108863,this.words[L]=q}return R!==0&&(this.words[L]=R,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(x){var A=x<0;if(this.negative!==0&&!A)return-1;if(this.negative===0&&A)return 1;this._strip();var B;if(this.length>1)B=1;else{A&&(x=-x),n(x<=67108863,"Number is too big");var z=this.words[0]|0;B=z===x?0:zx.length)return 1;if(this.length=0;B--){var z=this.words[B]|0,R=x.words[B]|0;if(z!==R){zR&&(A=1);break}}return A},s.prototype.gtn=function(x){return this.cmpn(x)===1},s.prototype.gt=function(x){return this.cmp(x)===1},s.prototype.gten=function(x){return this.cmpn(x)>=0},s.prototype.gte=function(x){return this.cmp(x)>=0},s.prototype.ltn=function(x){return this.cmpn(x)===-1},s.prototype.lt=function(x){return this.cmp(x)===-1},s.prototype.lten=function(x){return this.cmpn(x)<=0},s.prototype.lte=function(x){return this.cmp(x)<=0},s.prototype.eqn=function(x){return this.cmpn(x)===0},s.prototype.eq=function(x){return this.cmp(x)===0},s.red=function(x){return new ne(x)},s.prototype.toRed=function(x){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),x.convertTo(this)._forceRed(x)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(x){return this.red=x,this},s.prototype.forceRed=function(x){return n(!this.red,"Already a number in reduction context"),this._forceRed(x)},s.prototype.redAdd=function(x){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,x)},s.prototype.redIAdd=function(x){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,x)},s.prototype.redSub=function(x){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,x)},s.prototype.redISub=function(x){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,x)},s.prototype.redShl=function(x){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,x)},s.prototype.redMul=function(x){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,x),this.red.mul(this,x)},s.prototype.redIMul=function(x){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,x),this.red.imul(this,x)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(x){return n(this.red&&!x.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,x)};var S={k256:null,p224:null,p192:null,p25519:null};function P(K,x){this.name=K,this.p=new s(x,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}P.prototype._tmp=function(){var x=new s(null);return x.words=new Array(Math.ceil(this.n/13)),x},P.prototype.ireduce=function(x){var A=x,B;do this.split(A,this.tmp),A=this.imulK(A),A=A.iadd(this.tmp),B=A.bitLength();while(B>this.n);var z=B0?A.isub(this.p):A.strip!==void 0?A.strip():A._strip(),A},P.prototype.split=function(x,A){x.iushrn(this.n,0,A)},P.prototype.imulK=function(x){return x.imul(this.k)};function _(){P.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(_,P),_.prototype.split=function(x,A){for(var B=4194303,z=Math.min(x.length,9),R=0;R>>22,L=q}L>>>=22,x.words[R-10]=L,L===0&&x.length>10?x.length-=10:x.length-=9},_.prototype.imulK=function(x){x.words[x.length]=0,x.words[x.length+1]=0,x.length+=2;for(var A=0,B=0;B>>=26,x.words[B]=R,A=z}return A!==0&&(x.words[x.length++]=A),x},s._prime=function(x){if(S[x])return S[x];var A;if(x==="k256")A=new _;else if(x==="p224")A=new T;else if(x==="p192")A=new Q;else if(x==="p25519")A=new Z;else throw new Error("Unknown prime "+x);return S[x]=A,A};function ne(K){if(typeof K=="string"){var x=s._prime(K);this.m=x.p,this.prime=x}else n(K.gtn(1),"modulus must be greater than 1"),this.m=K,this.prime=null}ne.prototype._verify1=function(x){n(x.negative===0,"red works only with positives"),n(x.red,"red works only with red numbers")},ne.prototype._verify2=function(x,A){n((x.negative|A.negative)===0,"red works only with positives"),n(x.red&&x.red===A.red,"red works only with red numbers")},ne.prototype.imod=function(x){return this.prime?this.prime.ireduce(x)._forceRed(this):(u(x,x.umod(this.m)._forceRed(this)),x)},ne.prototype.neg=function(x){return x.isZero()?x.clone():this.m.sub(x)._forceRed(this)},ne.prototype.add=function(x,A){this._verify2(x,A);var B=x.add(A);return B.cmp(this.m)>=0&&B.isub(this.m),B._forceRed(this)},ne.prototype.iadd=function(x,A){this._verify2(x,A);var B=x.iadd(A);return B.cmp(this.m)>=0&&B.isub(this.m),B},ne.prototype.sub=function(x,A){this._verify2(x,A);var B=x.sub(A);return B.cmpn(0)<0&&B.iadd(this.m),B._forceRed(this)},ne.prototype.isub=function(x,A){this._verify2(x,A);var B=x.isub(A);return B.cmpn(0)<0&&B.iadd(this.m),B},ne.prototype.shl=function(x,A){return this._verify1(x),this.imod(x.ushln(A))},ne.prototype.imul=function(x,A){return this._verify2(x,A),this.imod(x.imul(A))},ne.prototype.mul=function(x,A){return this._verify2(x,A),this.imod(x.mul(A))},ne.prototype.isqr=function(x){return this.imul(x,x.clone())},ne.prototype.sqr=function(x){return this.mul(x,x)},ne.prototype.sqrt=function(x){if(x.isZero())return x.clone();var A=this.m.andln(3);if(n(A%2===1),A===3){var B=this.m.add(new s(1)).iushrn(2);return this.pow(x,B)}for(var z=this.m.subn(1),R=0;!z.isZero()&&z.andln(1)===0;)R++,z.iushrn(1);n(!z.isZero());var L=new s(1).toRed(this),q=L.redNeg(),N=this.m.subn(1).iushrn(1),I=this.m.bitLength();for(I=new s(2*I*I).toRed(this);this.pow(I,N).cmp(q)!==0;)I.redIAdd(q);for(var U=this.pow(I,z),re=this.pow(x,z.addn(1).iushrn(1)),M=this.pow(x,z),G=R;M.cmp(L)!==0;){for(var H=M,J=0;H.cmp(L)!==0;J++)H=H.redSqr();n(J=0;R--){for(var U=A.words[R],re=I-1;re>=0;re--){var M=U>>re&1;if(L!==z[0]&&(L=this.sqr(L)),M===0&&q===0){N=0;continue}q<<=1,q|=M,N++,!(N!==B&&(R!==0||re!==0))&&(L=this.mul(L,z[q]),N=0,q=0)}I=26}return L},ne.prototype.convertTo=function(x){var A=x.umod(this.m);return A===x?A.clone():A},ne.prototype.convertFrom=function(x){var A=x.clone();return A.red=null,A},s.mont=function(x){return new ce(x)};function ce(K){ne.call(this,K),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(ce,ne),ce.prototype.convertTo=function(x){return this.imod(x.ushln(this.shift))},ce.prototype.convertFrom=function(x){var A=this.imod(x.mul(this.rinv));return A.red=null,A},ce.prototype.imul=function(x,A){if(x.isZero()||A.isZero())return x.words[0]=0,x.length=1,x;var B=x.imul(A),z=B.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),R=B.isub(z).iushrn(this.shift),L=R;return R.cmp(this.m)>=0?L=R.isub(this.m):R.cmpn(0)<0&&(L=R.iadd(this.m)),L._forceRed(this)},ce.prototype.mul=function(x,A){if(x.isZero()||A.isZero())return new s(0)._forceRed(this);var B=x.mul(A),z=B.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),R=B.isub(z).iushrn(this.shift),L=R;return R.cmp(this.m)>=0?L=R.isub(this.m):R.cmpn(0)<0&&(L=R.iadd(this.m)),L._forceRed(this)},ce.prototype.invm=function(x){var A=this.imod(x._invmp(this.m).mul(this.r2));return A._forceRed(this)}})(t,Je)})(WT);var W2=WT.exports;const Ht=rs(W2),W2e="logger/5.7.0";let HF=!1,qF=!1;const V3={debug:1,default:2,info:2,warning:3,error:4,off:5};let WF=V3.default,kA=null;function V2e(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}const VF=V2e();var Wk;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(Wk||(Wk={}));var Pc;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(Pc||(Pc={}));const GF="0123456789abcdef";let Ee=class gi{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){const n=e.toLowerCase();V3[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(WF>V3[n])&&console.log.apply(console,r)}debug(...e){this._log(gi.levels.DEBUG,e)}info(...e){this._log(gi.levels.INFO,e)}warn(...e){this._log(gi.levels.WARNING,e)}makeError(e,r,n){if(qF)return this.makeError("censored error",r,{});r||(r=gi.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(c=>{const l=n[c];try{if(l instanceof Uint8Array){let u="";for(let f=0;f>4],u+=GF[l[f]&15];i.push(c+"=Uint8Array(0x"+u+")")}else i.push(c+"="+JSON.stringify(l))}catch{i.push(c+"="+JSON.stringify(n[c].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);const s=e;let o="";switch(r){case Pc.NUMERIC_FAULT:{o="NUMERIC_FAULT";const c=e;switch(c){case"overflow":case"underflow":case"division-by-zero":o+="-"+c;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result";break}break}case Pc.CALL_EXCEPTION:case Pc.INSUFFICIENT_FUNDS:case Pc.MISSING_NEW:case Pc.NONCE_EXPIRED:case Pc.REPLACEMENT_UNDERPRICED:case Pc.TRANSACTION_REPLACED:case Pc.UNPREDICTABLE_GAS_LIMIT:o=r;break}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),i.length&&(e+=" ("+i.join(", ")+")");const a=new Error(e);return a.reason=s,a.code=r,Object.keys(n).forEach(function(c){a[c]=n[c]}),a}throwError(e,r,n){throw this.makeError(e,r,n)}throwArgumentError(e,r,n){return this.throwError(e,gi.errors.INVALID_ARGUMENT,{argument:r,value:n})}assert(e,r,n,i){e||this.throwError(r,n,i)}assertArgument(e,r,n,i){e||this.throwArgumentError(r,n,i)}checkNormalize(e){VF&&this.throwError("platform missing String.prototype.normalize",gi.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:VF})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,gi.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,gi.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,n){n?n=": "+n:n="",er&&this.throwError("too many arguments"+n,gi.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",gi.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",gi.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",gi.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return kA||(kA=new gi(W2e)),kA}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",gi.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),HF){if(!e)return;this.globalLogger().throwError("error censorship permanent",gi.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}qF=!!e,HF=!!r}static setLogLevel(e){const r=V3[e.toLowerCase()];if(r==null){gi.globalLogger().warn("invalid log level - "+e);return}WF=r}static from(e){return new gi(e)}};Ee.errors=Pc;Ee.levels=Wk;const G2e="bytes/5.7.0",Dn=new Ee(G2e);function IY(t){return!!t.toHexString}function dg(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return dg(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function Zu(t){return Vt(t)&&!(t.length%2)||Ef(t)}function KF(t){return typeof t=="number"&&t==t&&t%1===0}function Ef(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!KF(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function Ae(t,e){if(e||(e={}),typeof t=="number"){Dn.checkSafeUint53(t,"invalid arrayify value");const r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),dg(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),IY(t)&&(t=t.toHexString()),Vt(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":Dn.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let i=0;iAe(i)),r=e.reduce((i,s)=>i+s.length,0),n=new Uint8Array(r);return e.reduce((i,s)=>(n.set(s,i),i+s.length),0),dg(n)}function Bl(t){let e=Ae(t);if(e.length===0)return e;let r=0;for(;re&&Dn.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),dg(r)}function Vt(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const IA="0123456789abcdef";function Se(t,e){if(e||(e={}),typeof t=="number"){Dn.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=IA[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),IY(t))return t.toHexString();if(Vt(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":Dn.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(Ef(t)){let r="0x";for(let n=0;n>4]+IA[i&15]}return r}return Dn.throwArgumentError("invalid hexlify value","value",t)}function Vl(t){if(typeof t!="string")t=Se(t);else if(!Vt(t)||t.length%2)return null;return(t.length-2)/2}function Fn(t,e,r){return typeof t!="string"?t=Se(t):(!Vt(t)||t.length%2)&&Dn.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function Hs(t){let e="0x";return t.forEach(r=>{e+=Se(r).substring(2)}),e}function Uc(t){const e=PY(Se(t,{hexPad:"left"}));return e==="0x"?"0x0":e}function PY(t){typeof t!="string"&&(t=Se(t)),Vt(t)||Dn.throwArgumentError("invalid hex string","value",t),t=t.substring(2);let e=0;for(;e2*e+2&&Dn.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function p1(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Zu(t)){let r=Ae(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=Se(r.slice(0,32)),e.s=Se(r.slice(32,64))):r.length===65?(e.r=Se(r.slice(0,32)),e.s=Se(r.slice(32,64)),e.v=r[64]):Dn.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:Dn.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=Se(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){const i=zy(Ae(e._vs),32);e._vs=Se(i);const s=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=s:e.recoveryParam!==s&&Dn.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;const o=Se(i);e.s==null?e.s=o:e.s!==o&&Dn.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?Dn.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{const i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&Dn.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!Vt(e.r)?Dn.throwArgumentError("signature missing or invalid r","signature",t):e.r=Hr(e.r,32),e.s==null||!Vt(e.s)?Dn.throwArgumentError("signature missing or invalid s","signature",t):e.s=Hr(e.s,32);const r=Ae(e.s);r[0]>=128&&Dn.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const n=Se(r);e._vs&&(Vt(e._vs)||Dn.throwArgumentError("signature invalid _vs","signature",t),e._vs=Hr(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&Dn.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function Vk(t){return t=p1(t),Se(zr([t.r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}const RY="bignumber/5.7.0";var Nb=Ht.BN;const Eu=new Ee(RY),PA={},JF=9007199254740991;function K2e(t){return t!=null&&(we.isBigNumber(t)||typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||Vt(t)||typeof t=="bigint"||Ef(t))}let QF=!1;class we{constructor(e,r){e!==PA&&Eu.throwError("cannot call constructor directly; use BigNumber.from",Ee.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return fo(or(this).fromTwos(e))}toTwos(e){return fo(or(this).toTwos(e))}abs(){return this._hex[0]==="-"?we.from(this._hex.substring(1)):this}add(e){return fo(or(this).add(or(e)))}sub(e){return fo(or(this).sub(or(e)))}div(e){return we.from(e).isZero()&&Aa("division-by-zero","div"),fo(or(this).div(or(e)))}mul(e){return fo(or(this).mul(or(e)))}mod(e){const r=or(e);return r.isNeg()&&Aa("division-by-zero","mod"),fo(or(this).umod(r))}pow(e){const r=or(e);return r.isNeg()&&Aa("negative-power","pow"),fo(or(this).pow(r))}and(e){const r=or(e);return(this.isNegative()||r.isNeg())&&Aa("unbound-bitwise-result","and"),fo(or(this).and(r))}or(e){const r=or(e);return(this.isNegative()||r.isNeg())&&Aa("unbound-bitwise-result","or"),fo(or(this).or(r))}xor(e){const r=or(e);return(this.isNegative()||r.isNeg())&&Aa("unbound-bitwise-result","xor"),fo(or(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&Aa("negative-width","mask"),fo(or(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Aa("negative-width","shl"),fo(or(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Aa("negative-width","shr"),fo(or(this).shrn(e))}eq(e){return or(this).eq(or(e))}lt(e){return or(this).lt(or(e))}lte(e){return or(this).lte(or(e))}gt(e){return or(this).gt(or(e))}gte(e){return or(this).gte(or(e))}isNegative(){return this._hex[0]==="-"}isZero(){return or(this).isZero()}toNumber(){try{return or(this).toNumber()}catch{Aa("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Eu.throwError("this platform does not support BigInt",Ee.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?QF||(QF=!0,Eu.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?Eu.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Ee.errors.UNEXPECTED_ARGUMENT,{}):Eu.throwError("BigNumber.toString does not accept parameters",Ee.errors.UNEXPECTED_ARGUMENT,{})),or(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof we)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new we(PA,Mb(e)):e.match(/^-?[0-9]+$/)?new we(PA,Mb(new Nb(e))):Eu.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&Aa("underflow","BigNumber.from",e),(e>=JF||e<=-JF)&&Aa("overflow","BigNumber.from",e),we.from(String(e));const r=e;if(typeof r=="bigint")return we.from(r.toString());if(Ef(r))return we.from(Se(r));if(r)if(r.toHexString){const n=r.toHexString();if(typeof n=="string")return we.from(n)}else{let n=r._hex;if(n==null&&r.type==="BigNumber"&&(n=r.hex),typeof n=="string"&&(Vt(n)||n[0]==="-"&&Vt(n.substring(1))))return we.from(n)}return Eu.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function Mb(t){if(typeof t!="string")return Mb(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&Eu.throwArgumentError("invalid hex","value",t),t=Mb(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function fo(t){return we.from(Mb(t))}function or(t){const e=we.from(t).toHexString();return e[0]==="-"?new Nb("-"+e.substring(3),16):new Nb(e.substring(2),16)}function Aa(t,e,r){const n={fault:t,operation:e};return r!=null&&(n.value=r),Eu.throwError(t,Ee.errors.NUMERIC_FAULT,n)}function J2e(t){return new Nb(t,36).toString(16)}function Q2e(t){return new Nb(t,16).toString(36)}const qs=new Ee(RY),Hy={},TY=we.from(0),OY=we.from(-1);function $Y(t,e,r,n){const i={fault:e,operation:r};return n!==void 0&&(i.value=n),qs.throwError(t,Ee.errors.NUMERIC_FAULT,i)}let qy="0";for(;qy.length<256;)qy+=qy;function VT(t){if(typeof t!="number")try{t=we.from(t).toNumber()}catch{}return typeof t=="number"&&t>=0&&t<=256&&!(t%1)?"1"+qy.substring(0,t):qs.throwArgumentError("invalid decimal size","decimals",t)}function G3(t,e){e==null&&(e=0);const r=VT(e);t=we.from(t);const n=t.lt(TY);n&&(t=t.mul(OY));let i=t.mod(r).toString();for(;i.length2&&qs.throwArgumentError("too many decimal points","value",t);let s=i[0],o=i[1];for(s||(s="0"),o||(o="0");o[o.length-1]==="0";)o=o.substring(0,o.length-1);for(o.length>r.length-1&&$Y("fractional component exceeds decimals","underflow","parseFixed"),o===""&&(o="0");o.lengthe[o]==null?c:(typeof e[o]!==a&&qs.throwArgumentError("invalid fixed format ("+o+" not "+a+")","format."+o,e[o]),e[o]);r=s("signed","boolean",r),n=s("width","number",n),i=s("decimals","number",i)}return n%8&&qs.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),i>80&&qs.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new hg(Hy,r,n,i)}}class qi{constructor(e,r,n,i){e!==Hy&&qs.throwError("cannot use FixedNumber constructor; use FixedNumber.from",Ee.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=r,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&qs.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const r=dl(this._value,this.format.decimals),n=dl(e._value,e.format.decimals);return qi.fromValue(r.add(n),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const r=dl(this._value,this.format.decimals),n=dl(e._value,e.format.decimals);return qi.fromValue(r.sub(n),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const r=dl(this._value,this.format.decimals),n=dl(e._value,e.format.decimals);return qi.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const r=dl(this._value,this.format.decimals),n=dl(e._value,e.format.decimals);return qi.fromValue(r.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=qi.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(r=r.subUnsafe(YF.toFormat(r.format))),r}ceiling(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=qi.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(r=r.addUnsafe(YF.toFormat(r.format))),r}round(e){e==null&&(e=0);const r=this.toString().split(".");if(r.length===1&&r.push("0"),(e<0||e>80||e%1)&&qs.throwArgumentError("invalid decimal count","decimals",e),r[1].length<=e)return this;const n=qi.from("1"+qy.substring(0,e),this.format),i=Y2e.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(i).floor().divUnsafe(n)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(e){if(e==null)return this._hex;e%8&&qs.throwArgumentError("invalid byte width","width",e);const r=we.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return Hr(r,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return qi.fromString(this._value,e)}static fromValue(e,r,n){return n==null&&r!=null&&!K2e(r)&&(n=r,r=null),r==null&&(r=0),n==null&&(n="fixed"),qi.fromString(G3(e,r),hg.from(n))}static fromString(e,r){r==null&&(r="fixed");const n=hg.from(r),i=dl(e,n.decimals);!n.signed&&i.lt(TY)&&$Y("unsigned value cannot be negative","overflow","value",e);let s=null;n.signed?s=i.toTwos(n.width).toHexString():(s=i.toHexString(),s=Hr(s,n.width/8));const o=G3(i,n.decimals);return new qi(Hy,s,o,n)}static fromBytes(e,r){r==null&&(r="fixed");const n=hg.from(r);if(Ae(e).length>n.width/8)throw new Error("overflow");let i=we.from(e);n.signed&&(i=i.fromTwos(n.width));const s=i.toTwos((n.signed?0:1)+n.width).toHexString(),o=G3(i,n.decimals);return new qi(Hy,s,o,n)}static from(e,r){if(typeof e=="string")return qi.fromString(e,r);if(Ef(e))return qi.fromBytes(e,r);try{return qi.fromValue(e,0,r)}catch(n){if(n.code!==Ee.errors.INVALID_ARGUMENT)throw n}return qs.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}}const YF=qi.from(1),Y2e=qi.from("0.5"),Z2e="properties/5.7.0";var X2e=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const o6=new Ee(Z2e);function Ie(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function Lc(t,e){for(let r=0;r<32;r++){if(t[e])return t[e];if(!t.prototype||typeof t.prototype!="object")break;t=Object.getPrototypeOf(t.prototype).constructor}return null}function Qr(t){return X2e(this,void 0,void 0,function*(){const e=Object.keys(t).map(n=>{const i=t[n];return Promise.resolve(i).then(s=>({key:n,value:s}))});return(yield Promise.all(e)).reduce((n,i)=>(n[i.key]=i.value,n),{})})}function GT(t,e){(!t||typeof t!="object")&&o6.throwArgumentError("invalid object","object",t),Object.keys(t).forEach(r=>{e[r]||o6.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)})}function dn(t){const e={};for(const r in t)e[r]=t[r];return e}const ewe={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function NY(t){if(t==null||ewe[typeof t])return!0;if(Array.isArray(t)||typeof t=="object"){if(!Object.isFrozen(t))return!1;const e=Object.keys(t);for(let r=0;rra(e)));if(typeof t=="object"){const e={};for(const r in t){const n=t[r];n!==void 0&&Ie(e,r,ra(n))}return e}return o6.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function ra(t){return twe(t)}class g1{constructor(e){for(const r in e)this[r]=ra(e[r])}}const V2="abi/5.7.0",hr=new Ee(V2),V0={};let ZF={calldata:!0,memory:!0,storage:!0},rwe={calldata:!0,memory:!0};function k5(t,e){if(t==="bytes"||t==="string"){if(ZF[e])return!0}else if(t==="address"){if(e==="payable")return!0}else if((t.indexOf("[")>=0||t==="tuple")&&rwe[e])return!0;return(ZF[e]||e==="payable")&&hr.throwArgumentError("invalid modifier","name",e),!1}function nwe(t,e){let r=t;function n(a){hr.throwArgumentError(`unexpected character at position ${a}`,"param",t)}t=t.replace(/\s/g," ");function i(a){let c={type:"",name:"",parent:a,state:{allowType:!0}};return e&&(c.indexed=!1),c}let s={type:"",name:"",state:{allowType:!0}},o=s;for(let a=0;aJSON.parse(i.format(e)))),JSON.stringify(n)}let r="";return this.baseType==="array"?(r+=this.arrayChildren.format(e),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):this.baseType==="tuple"?(e!==Cr.sighash&&(r+=this.type),r+="("+this.components.map(n=>n.format(e)).join(e===Cr.full?", ":",")+")"):r+=this.type,e!==Cr.sighash&&(this.indexed===!0&&(r+=" indexed"),e===Cr.full&&this.name&&(r+=" "+this.name)),r}static from(e,r){return typeof e=="string"?wi.fromString(e,r):wi.fromObject(e)}static fromObject(e){return wi.isParamType(e)?e:new wi(V0,{name:e.name||null,type:kp(e.type),indexed:e.indexed==null?null:!!e.indexed,components:e.components?e.components.map(wi.fromObject):null})}static fromString(e,r){function n(i){return wi.fromObject({name:i.name,type:i.type,indexed:i.indexed,components:i.components})}return n(nwe(e,!!r))}static isParamType(e){return!!(e!=null&&e._isParamType)}}function Db(t,e){return owe(t).map(r=>wi.fromString(r,e))}class Il{constructor(e,r){e!==V0&&hr.throwError("use a static from method",Ee.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),K3(this,r),this._isFragment=!0,Object.freeze(this)}static from(e){return Il.isFragment(e)?e:typeof e=="string"?Il.fromString(e):Il.fromObject(e)}static fromObject(e){if(Il.isFragment(e))return e;switch(e.type){case"function":return Dc.fromObject(e);case"event":return Cl.fromObject(e);case"constructor":return Mc.fromObject(e);case"error":return Du.fromObject(e);case"fallback":case"receive":return null}return hr.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return e=e.replace(/\s/g," "),e=e.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," "),e=e.trim(),e.split(" ")[0]==="event"?Cl.fromString(e.substring(5).trim()):e.split(" ")[0]==="function"?Dc.fromString(e.substring(8).trim()):e.split("(")[0].trim()==="constructor"?Mc.fromString(e.trim()):e.split(" ")[0]==="error"?Du.fromString(e.substring(5).trim()):hr.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!!(e&&e._isFragment)}}class Cl extends Il{format(e){if(e||(e=Cr.sighash),Cr[e]||hr.throwArgumentError("invalid format type","format",e),e===Cr.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==Cr.sighash&&(r+="event "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===Cr.full?", ":",")+") ",e!==Cr.sighash&&this.anonymous&&(r+="anonymous "),r.trim()}static from(e){return typeof e=="string"?Cl.fromString(e):Cl.fromObject(e)}static fromObject(e){if(Cl.isEventFragment(e))return e;e.type!=="event"&&hr.throwArgumentError("invalid event object","value",e);const r={name:Lb(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(wi.fromObject):[],type:"event"};return new Cl(V0,r)}static fromString(e){let r=e.match(Bb);r||hr.throwArgumentError("invalid event string","value",e);let n=!1;return r[3].split(" ").forEach(i=>{switch(i.trim()){case"anonymous":n=!0;break;case"":break;default:hr.warn("unknown modifier: "+i)}}),Cl.fromObject({name:r[1].trim(),anonymous:n,inputs:Db(r[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&e.type==="event"}}function MY(t,e){e.gas=null;let r=t.split("@");return r.length!==1?(r.length>2&&hr.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||hr.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=we.from(r[1]),r[0]):t}function DY(t,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",t.split(" ").forEach(r=>{switch(r.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+r)}})}function LY(t){let e={constant:!1,payable:!0,stateMutability:"payable"};return t.stateMutability!=null?(e.stateMutability=t.stateMutability,e.constant=e.stateMutability==="view"||e.stateMutability==="pure",t.constant!=null&&!!t.constant!==e.constant&&hr.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable=e.stateMutability==="payable",t.payable!=null&&!!t.payable!==e.payable&&hr.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",t)):t.payable!=null?(e.payable=!!t.payable,t.constant==null&&!e.payable&&t.type!=="constructor"&&hr.throwArgumentError("unable to determine stateMutability","value",t),e.constant=!!t.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&hr.throwArgumentError("cannot have constant payable function","value",t)):t.constant!=null?(e.constant=!!t.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):t.type!=="constructor"&&hr.throwArgumentError("unable to determine stateMutability","value",t),e}class Mc extends Il{format(e){if(e||(e=Cr.sighash),Cr[e]||hr.throwArgumentError("invalid format type","format",e),e===Cr.json)return JSON.stringify({type:"constructor",stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});e===Cr.sighash&&hr.throwError("cannot format a constructor for sighash",Ee.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let r="constructor("+this.inputs.map(n=>n.format(e)).join(e===Cr.full?", ":",")+") ";return this.stateMutability&&this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "),r.trim()}static from(e){return typeof e=="string"?Mc.fromString(e):Mc.fromObject(e)}static fromObject(e){if(Mc.isConstructorFragment(e))return e;e.type!=="constructor"&&hr.throwArgumentError("invalid constructor object","value",e);let r=LY(e);r.constant&&hr.throwArgumentError("constructor cannot be constant","value",e);const n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(wi.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?we.from(e.gas):null};return new Mc(V0,n)}static fromString(e){let r={type:"constructor"};e=MY(e,r);let n=e.match(Bb);return(!n||n[1].trim()!=="constructor")&&hr.throwArgumentError("invalid constructor string","value",e),r.inputs=Db(n[2].trim(),!1),DY(n[3].trim(),r),Mc.fromObject(r)}static isConstructorFragment(e){return e&&e._isFragment&&e.type==="constructor"}}class Dc extends Mc{format(e){if(e||(e=Cr.sighash),Cr[e]||hr.throwArgumentError("invalid format type","format",e),e===Cr.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e))),outputs:this.outputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==Cr.sighash&&(r+="function "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===Cr.full?", ":",")+") ",e!==Cr.sighash&&(this.stateMutability?this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "):this.constant&&(r+="view "),this.outputs&&this.outputs.length&&(r+="returns ("+this.outputs.map(n=>n.format(e)).join(", ")+") "),this.gas!=null&&(r+="@"+this.gas.toString()+" ")),r.trim()}static from(e){return typeof e=="string"?Dc.fromString(e):Dc.fromObject(e)}static fromObject(e){if(Dc.isFunctionFragment(e))return e;e.type!=="function"&&hr.throwArgumentError("invalid function object","value",e);let r=LY(e);const n={type:e.type,name:Lb(e.name),constant:r.constant,inputs:e.inputs?e.inputs.map(wi.fromObject):[],outputs:e.outputs?e.outputs.map(wi.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?we.from(e.gas):null};return new Dc(V0,n)}static fromString(e){let r={type:"function"};e=MY(e,r);let n=e.split(" returns ");n.length>2&&hr.throwArgumentError("invalid function string","value",e);let i=n[0].match(Bb);if(i||hr.throwArgumentError("invalid function signature","value",e),r.name=i[1].trim(),r.name&&Lb(r.name),r.inputs=Db(i[2],!1),DY(i[3].trim(),r),n.length>1){let s=n[1].match(Bb);(s[1].trim()!=""||s[3].trim()!="")&&hr.throwArgumentError("unexpected tokens","value",e),r.outputs=Db(s[2],!1)}else r.outputs=[];return Dc.fromObject(r)}static isFunctionFragment(e){return e&&e._isFragment&&e.type==="function"}}function XF(t){const e=t.format();return(e==="Error(string)"||e==="Panic(uint256)")&&hr.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",t),t}class Du extends Il{format(e){if(e||(e=Cr.sighash),Cr[e]||hr.throwArgumentError("invalid format type","format",e),e===Cr.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==Cr.sighash&&(r+="error "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===Cr.full?", ":",")+") ",r.trim()}static from(e){return typeof e=="string"?Du.fromString(e):Du.fromObject(e)}static fromObject(e){if(Du.isErrorFragment(e))return e;e.type!=="error"&&hr.throwArgumentError("invalid error object","value",e);const r={type:e.type,name:Lb(e.name),inputs:e.inputs?e.inputs.map(wi.fromObject):[]};return XF(new Du(V0,r))}static fromString(e){let r={type:"error"},n=e.match(Bb);return n||hr.throwArgumentError("invalid error signature","value",e),r.name=n[1].trim(),r.name&&Lb(r.name),r.inputs=Db(n[2],!1),XF(Du.fromObject(r))}static isErrorFragment(e){return e&&e._isFragment&&e.type==="error"}}function kp(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}const swe=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Lb(t){return(!t||!t.match(swe))&&hr.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}const Bb=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function owe(t){t=t.trim();let e=[],r="",n=0;for(let i=0;ithis.wordSize&&KT.throwError("value out-of-bounds",Ee.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:r.length}),r.length%this.wordSize&&(r=zr([this._padding.slice(r.length%this.wordSize),r])),r}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,r=>{this._data[e]=this._getValue(r)}}}class a6{constructor(e,r,n,i){Ie(this,"_data",Ae(e)),Ie(this,"wordSize",r||32),Ie(this,"_coerceFunc",n),Ie(this,"allowLoose",i),this._offset=0}get data(){return Se(this._data)}get consumed(){return this._offset}static coerce(e,r){let n=e.match("^u?int([0-9]+)$");return n&&parseInt(n[1])<=48&&(r=r.toNumber()),r}coerce(e,r){return this._coerceFunc?this._coerceFunc(e,r):a6.coerce(e,r)}_peekBytes(e,r,n){let i=Math.ceil(r/this.wordSize)*this.wordSize;return this._offset+i>this._data.length&&(this.allowLoose&&n&&this._offset+r<=this._data.length?i=r:KT.throwError("data out-of-bounds",Ee.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+i})),this._data.slice(this._offset,this._offset+i)}subReader(e){return new a6(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,r){let n=this._peekBytes(0,e,!!r);return this._offset+=n.length,n.slice(0,e)}readValue(){return we.from(this.readBytes(this.wordSize))}}var FY={exports:{}};/** + * [js-sha3]{@link https://github.com/emn178/js-sha3} + * + * @version 0.8.0 + * @author Chen, Yi-Cyuan [emn178@gmail.com] + * @copyright Chen, Yi-Cyuan 2015-2018 + * @license MIT + */(function(t){(function(){var e="input is invalid type",r="finalize already called",n=typeof window=="object",i=n?window:{};i.JS_SHA3_NO_WINDOW&&(n=!1);var s=!n&&typeof self=="object",o=!i.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;o?i=Je:s&&(i=self);var a=!i.JS_SHA3_NO_COMMON_JS&&!0&&t.exports,c=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",l="0123456789abcdef".split(""),u=[31,7936,2031616,520093696],f=[4,1024,262144,67108864],d=[1,256,65536,16777216],p=[6,1536,393216,100663296],g=[0,8,16,24],v=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],y=[224,256,384,512],b=[128,256],w=["hex","buffer","arrayBuffer","array","digest"],E={128:168,256:136};(i.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(M){return Object.prototype.toString.call(M)==="[object Array]"}),c&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(M){return typeof M=="object"&&M.buffer&&M.buffer.constructor===ArrayBuffer});for(var C=function(M,G,H){return function(J){return new I(M,G,M).update(J)[H]()}},S=function(M,G,H){return function(J,X){return new I(M,G,X).update(J)[H]()}},P=function(M,G,H){return function(J,X,D,F){return x["cshake"+M].update(J,X,D,F)[H]()}},_=function(M,G,H){return function(J,X,D,F){return x["kmac"+M].update(J,X,D,F)[H]()}},T=function(M,G,H,J){for(var X=0;X>5,this.byteCount=this.blockCount<<2,this.outputBlocks=H>>5,this.extraBytes=(H&31)>>3;for(var J=0;J<50;++J)this.s[J]=0}I.prototype.update=function(M){if(this.finalized)throw new Error(r);var G,H=typeof M;if(H!=="string"){if(H==="object"){if(M===null)throw new Error(e);if(c&&M.constructor===ArrayBuffer)M=new Uint8Array(M);else if(!Array.isArray(M)&&(!c||!ArrayBuffer.isView(M)))throw new Error(e)}else throw new Error(e);G=!0}for(var J=this.blocks,X=this.byteCount,D=M.length,F=this.blockCount,Y=0,ue=this.s,he,Ce;Y>2]|=M[Y]<>2]|=Ce<>2]|=(192|Ce>>6)<>2]|=(128|Ce&63)<=57344?(J[he>>2]|=(224|Ce>>12)<>2]|=(128|Ce>>6&63)<>2]|=(128|Ce&63)<>2]|=(240|Ce>>18)<>2]|=(128|Ce>>12&63)<>2]|=(128|Ce>>6&63)<>2]|=(128|Ce&63)<=X){for(this.start=he-X,this.block=J[F],he=0;he>8,H=M&255;H>0;)X.unshift(H),M=M>>8,H=M&255,++J;return G?X.push(J):X.unshift(J),this.update(X),X.length},I.prototype.encodeString=function(M){var G,H=typeof M;if(H!=="string"){if(H==="object"){if(M===null)throw new Error(e);if(c&&M.constructor===ArrayBuffer)M=new Uint8Array(M);else if(!Array.isArray(M)&&(!c||!ArrayBuffer.isView(M)))throw new Error(e)}else throw new Error(e);G=!0}var J=0,X=M.length;if(G)J=X;else for(var D=0;D=57344?J+=3:(F=65536+((F&1023)<<10|M.charCodeAt(++D)&1023),J+=4)}return J+=this.encode(J*8),this.update(M),J},I.prototype.bytepad=function(M,G){for(var H=this.encode(G),J=0;J>2]|=this.padding[G&3],this.lastByteIndex===this.byteCount)for(M[0]=M[H],G=1;G>4&15]+l[Y&15]+l[Y>>12&15]+l[Y>>8&15]+l[Y>>20&15]+l[Y>>16&15]+l[Y>>28&15]+l[Y>>24&15];D%M===0&&(re(G),X=0)}return J&&(Y=G[X],F+=l[Y>>4&15]+l[Y&15],J>1&&(F+=l[Y>>12&15]+l[Y>>8&15]),J>2&&(F+=l[Y>>20&15]+l[Y>>16&15])),F},I.prototype.arrayBuffer=function(){this.finalize();var M=this.blockCount,G=this.s,H=this.outputBlocks,J=this.extraBytes,X=0,D=0,F=this.outputBits>>3,Y;J?Y=new ArrayBuffer(H+1<<2):Y=new ArrayBuffer(F);for(var ue=new Uint32Array(Y);D>8&255,F[Y+2]=ue>>16&255,F[Y+3]=ue>>24&255;D%M===0&&re(G)}return J&&(Y=D<<2,ue=G[X],F[Y]=ue&255,J>1&&(F[Y+1]=ue>>8&255),J>2&&(F[Y+2]=ue>>16&255)),F};function U(M,G,H){I.call(this,M,G,H)}U.prototype=new I,U.prototype.finalize=function(){return this.encode(this.outputBits,!0),I.prototype.finalize.call(this)};var re=function(M){var G,H,J,X,D,F,Y,ue,he,Ce,Me,Oe,We,ot,ze,Le,et,He,Ge,Ye,qe,ee,j,W,ie,de,pe,be,je,Fe,Qe,kt,Ze,$t,Wn,Xt,rr,gr,dt,yt,mr,vt,ht,kr,_t,bt,Ir,wt,xt,vr,ft,Ct,Pr,yr,br,Rs,Wt,wr,cs,ls,us,fs,$n;for(J=0;J<48;J+=2)X=M[0]^M[10]^M[20]^M[30]^M[40],D=M[1]^M[11]^M[21]^M[31]^M[41],F=M[2]^M[12]^M[22]^M[32]^M[42],Y=M[3]^M[13]^M[23]^M[33]^M[43],ue=M[4]^M[14]^M[24]^M[34]^M[44],he=M[5]^M[15]^M[25]^M[35]^M[45],Ce=M[6]^M[16]^M[26]^M[36]^M[46],Me=M[7]^M[17]^M[27]^M[37]^M[47],Oe=M[8]^M[18]^M[28]^M[38]^M[48],We=M[9]^M[19]^M[29]^M[39]^M[49],G=Oe^(F<<1|Y>>>31),H=We^(Y<<1|F>>>31),M[0]^=G,M[1]^=H,M[10]^=G,M[11]^=H,M[20]^=G,M[21]^=H,M[30]^=G,M[31]^=H,M[40]^=G,M[41]^=H,G=X^(ue<<1|he>>>31),H=D^(he<<1|ue>>>31),M[2]^=G,M[3]^=H,M[12]^=G,M[13]^=H,M[22]^=G,M[23]^=H,M[32]^=G,M[33]^=H,M[42]^=G,M[43]^=H,G=F^(Ce<<1|Me>>>31),H=Y^(Me<<1|Ce>>>31),M[4]^=G,M[5]^=H,M[14]^=G,M[15]^=H,M[24]^=G,M[25]^=H,M[34]^=G,M[35]^=H,M[44]^=G,M[45]^=H,G=ue^(Oe<<1|We>>>31),H=he^(We<<1|Oe>>>31),M[6]^=G,M[7]^=H,M[16]^=G,M[17]^=H,M[26]^=G,M[27]^=H,M[36]^=G,M[37]^=H,M[46]^=G,M[47]^=H,G=Ce^(X<<1|D>>>31),H=Me^(D<<1|X>>>31),M[8]^=G,M[9]^=H,M[18]^=G,M[19]^=H,M[28]^=G,M[29]^=H,M[38]^=G,M[39]^=H,M[48]^=G,M[49]^=H,ot=M[0],ze=M[1],bt=M[11]<<4|M[10]>>>28,Ir=M[10]<<4|M[11]>>>28,be=M[20]<<3|M[21]>>>29,je=M[21]<<3|M[20]>>>29,ls=M[31]<<9|M[30]>>>23,us=M[30]<<9|M[31]>>>23,vt=M[40]<<18|M[41]>>>14,ht=M[41]<<18|M[40]>>>14,$t=M[2]<<1|M[3]>>>31,Wn=M[3]<<1|M[2]>>>31,Le=M[13]<<12|M[12]>>>20,et=M[12]<<12|M[13]>>>20,wt=M[22]<<10|M[23]>>>22,xt=M[23]<<10|M[22]>>>22,Fe=M[33]<<13|M[32]>>>19,Qe=M[32]<<13|M[33]>>>19,fs=M[42]<<2|M[43]>>>30,$n=M[43]<<2|M[42]>>>30,yr=M[5]<<30|M[4]>>>2,br=M[4]<<30|M[5]>>>2,Xt=M[14]<<6|M[15]>>>26,rr=M[15]<<6|M[14]>>>26,He=M[25]<<11|M[24]>>>21,Ge=M[24]<<11|M[25]>>>21,vr=M[34]<<15|M[35]>>>17,ft=M[35]<<15|M[34]>>>17,kt=M[45]<<29|M[44]>>>3,Ze=M[44]<<29|M[45]>>>3,W=M[6]<<28|M[7]>>>4,ie=M[7]<<28|M[6]>>>4,Rs=M[17]<<23|M[16]>>>9,Wt=M[16]<<23|M[17]>>>9,gr=M[26]<<25|M[27]>>>7,dt=M[27]<<25|M[26]>>>7,Ye=M[36]<<21|M[37]>>>11,qe=M[37]<<21|M[36]>>>11,Ct=M[47]<<24|M[46]>>>8,Pr=M[46]<<24|M[47]>>>8,kr=M[8]<<27|M[9]>>>5,_t=M[9]<<27|M[8]>>>5,de=M[18]<<20|M[19]>>>12,pe=M[19]<<20|M[18]>>>12,wr=M[29]<<7|M[28]>>>25,cs=M[28]<<7|M[29]>>>25,yt=M[38]<<8|M[39]>>>24,mr=M[39]<<8|M[38]>>>24,ee=M[48]<<14|M[49]>>>18,j=M[49]<<14|M[48]>>>18,M[0]=ot^~Le&He,M[1]=ze^~et&Ge,M[10]=W^~de&be,M[11]=ie^~pe&je,M[20]=$t^~Xt&gr,M[21]=Wn^~rr&dt,M[30]=kr^~bt&wt,M[31]=_t^~Ir&xt,M[40]=yr^~Rs&wr,M[41]=br^~Wt&cs,M[2]=Le^~He&Ye,M[3]=et^~Ge&qe,M[12]=de^~be&Fe,M[13]=pe^~je&Qe,M[22]=Xt^~gr&yt,M[23]=rr^~dt&mr,M[32]=bt^~wt&vr,M[33]=Ir^~xt&ft,M[42]=Rs^~wr&ls,M[43]=Wt^~cs&us,M[4]=He^~Ye&ee,M[5]=Ge^~qe&j,M[14]=be^~Fe&kt,M[15]=je^~Qe&Ze,M[24]=gr^~yt&vt,M[25]=dt^~mr&ht,M[34]=wt^~vr&Ct,M[35]=xt^~ft&Pr,M[44]=wr^~ls&fs,M[45]=cs^~us&$n,M[6]=Ye^~ee&ot,M[7]=qe^~j&ze,M[16]=Fe^~kt&W,M[17]=Qe^~Ze&ie,M[26]=yt^~vt&$t,M[27]=mr^~ht&Wn,M[36]=vr^~Ct&kr,M[37]=ft^~Pr&_t,M[46]=ls^~fs&yr,M[47]=us^~$n&br,M[8]=ee^~ot&Le,M[9]=j^~ze&et,M[18]=kt^~W&de,M[19]=Ze^~ie&pe,M[28]=vt^~$t&Xt,M[29]=ht^~Wn&rr,M[38]=Ct^~kr&bt,M[39]=Pr^~_t&Ir,M[48]=fs^~yr&Rs,M[49]=$n^~br&Wt,M[0]^=v[J],M[1]^=v[J+1]};if(a)t.exports=x;else for(B=0;B>=8;return e}function tj(t,e,r){let n=0;for(let i=0;ie+1+n&&vl.throwError("child data too short",Ee.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function UY(t,e){if(t.length===0&&vl.throwError("data too short",Ee.errors.BUFFER_OVERRUN,{}),t[e]>=248){const r=t[e]-247;e+1+r>t.length&&vl.throwError("data short segment too short",Ee.errors.BUFFER_OVERRUN,{});const n=tj(t,e+1,r);return e+1+r+n>t.length&&vl.throwError("data long segment too short",Ee.errors.BUFFER_OVERRUN,{}),rj(t,e,e+1+r,r+n)}else if(t[e]>=192){const r=t[e]-192;return e+1+r>t.length&&vl.throwError("data array too short",Ee.errors.BUFFER_OVERRUN,{}),rj(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;e+1+r>t.length&&vl.throwError("data array too short",Ee.errors.BUFFER_OVERRUN,{});const n=tj(t,e+1,r);e+1+r+n>t.length&&vl.throwError("data array too short",Ee.errors.BUFFER_OVERRUN,{});const i=Se(t.slice(e+1+r,e+1+r+n));return{consumed:1+r+n,result:i}}else if(t[e]>=128){const r=t[e]-128;e+1+r>t.length&&vl.throwError("data too short",Ee.errors.BUFFER_OVERRUN,{});const n=Se(t.slice(e+1,e+1+r));return{consumed:1+r,result:n}}return{consumed:1,result:Se(t[e])}}function s8(t){const e=Ae(t),r=UY(e,0);return r.consumed!==e.length&&vl.throwArgumentError("invalid rlp data","data",t),r.result}const uwe=Object.freeze(Object.defineProperty({__proto__:null,decode:s8,encode:G0},Symbol.toStringTag,{value:"Module"})),fwe="address/5.7.0",gd=new Ee(fwe);function nj(t){Vt(t,20)||gd.throwArgumentError("invalid address","address",t),t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=Ae(Tt(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const dwe=9007199254740991;function hwe(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const JT={};for(let t=0;t<10;t++)JT[String(t)]=String(t);for(let t=0;t<26;t++)JT[String.fromCharCode(65+t)]=String(10+t);const ij=Math.floor(hwe(dwe));function zY(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>JT[n]).join("");for(;e.length>=ij;){let n=e.substring(0,ij);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function qt(t){let e=null;if(typeof t!="string"&&gd.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=nj(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&gd.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==zY(t)&&gd.throwArgumentError("bad icap checksum","address",t),e=J2e(t.substring(4));e.length<40;)e="0"+e;e=nj("0x"+e)}else gd.throwArgumentError("invalid address","address",t);return e}function HY(t){try{return qt(t),!0}catch{}return!1}function pwe(t){let e=Q2e(qt(t).substring(2)).toUpperCase();for(;e.length<30;)e="0"+e;return"XE"+zY("XE00"+e)+e}function QT(t){let e=null;try{e=qt(t.from)}catch{gd.throwArgumentError("missing from address","transaction",t)}const r=Bl(Ae(we.from(t.nonce).toHexString()));return qt(Fn(Tt(G0([e,r])),12))}function gwe(t,e,r){return Vl(e)!==32&&gd.throwArgumentError("salt must be 32 bytes","salt",e),Vl(r)!==32&&gd.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),qt(Fn(Tt(zr(["0xff",qt(t),e,r])),12))}class mwe extends _f{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){try{r=qt(r)}catch(n){this._throwError(n.message,r)}return e.writeValue(r)}decode(e){return qt(Hr(e.readValue().toHexString(),20))}}class vwe extends _f{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,r){return this.coder.encode(e,r)}decode(e){return this.coder.decode(e)}}const Kp=new Ee(V2);function qY(t,e,r){let n=null;if(Array.isArray(r))n=r;else if(r&&typeof r=="object"){let c={};n=e.map(l=>{const u=l.localName;return u||Kp.throwError("cannot encode object for signature with missing names",Ee.errors.INVALID_ARGUMENT,{argument:"values",coder:l,value:r}),c[u]&&Kp.throwError("cannot encode object for signature with duplicate names",Ee.errors.INVALID_ARGUMENT,{argument:"values",coder:l,value:r}),c[u]=!0,r[u]})}else Kp.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&Kp.throwArgumentError("types/value length mismatch","tuple",r);let i=new Gk(t.wordSize),s=new Gk(t.wordSize),o=[];e.forEach((c,l)=>{let u=n[l];if(c.dynamic){let f=s.length;c.encode(s,u);let d=i.writeUpdatableValue();o.push(p=>{d(p+f)})}else c.encode(i,u)}),o.forEach(c=>{c(i.length)});let a=t.appendWriter(i);return a+=t.appendWriter(s),a}function WY(t,e){let r=[],n=t.subReader(0);e.forEach(s=>{let o=null;if(s.dynamic){let a=t.readValue(),c=n.subReader(a.toNumber());try{o=s.decode(c)}catch(l){if(l.code===Ee.errors.BUFFER_OVERRUN)throw l;o=l,o.baseType=s.name,o.name=s.localName,o.type=s.type}}else try{o=s.decode(t)}catch(a){if(a.code===Ee.errors.BUFFER_OVERRUN)throw a;o=a,o.baseType=s.name,o.name=s.localName,o.type=s.type}o!=null&&r.push(o)});const i=e.reduce((s,o)=>{const a=o.localName;return a&&(s[a]||(s[a]=0),s[a]++),s},{});e.forEach((s,o)=>{let a=s.localName;if(!a||i[a]!==1||(a==="length"&&(a="_length"),r[a]!=null))return;const c=r[o];c instanceof Error?Object.defineProperty(r,a,{enumerable:!0,get:()=>{throw c}}):r[a]=c});for(let s=0;s{throw o}})}return Object.freeze(r)}class ywe extends _f{constructor(e,r,n){const i=e.type+"["+(r>=0?r:"")+"]",s=r===-1||e.dynamic;super("array",i,n,s),this.coder=e,this.length=r}defaultValue(){const e=this.coder.defaultValue(),r=[];for(let n=0;ne._data.length&&Kp.throwError("insufficient data length",Ee.errors.BUFFER_OVERRUN,{length:e._data.length,count:r}));let n=[];for(let i=0;i>6===2;o++)s++;return s}return t===bo.OVERRUN?r.length-e-1:0}function Iwe(t,e,r,n,i){return t===bo.OVERLONG?(n.push(i),0):(n.push(65533),QY(t,e,r))}const YY=Object.freeze({error:kwe,ignore:QY,replace:Iwe});function YT(t,e){e==null&&(e=YY.error),t=Ae(t);const r=[];let n=0;for(;n>7)){r.push(i);continue}let s=null,o=null;if((i&224)===192)s=1,o=127;else if((i&240)===224)s=2,o=2047;else if((i&248)===240)s=3,o=65535;else{(i&192)===128?n+=e(bo.UNEXPECTED_CONTINUE,n-1,t,r):n+=e(bo.BAD_PREFIX,n-1,t,r);continue}if(n-1+s>=t.length){n+=e(bo.OVERRUN,n-1,t,r);continue}let a=i&(1<<8-s-1)-1;for(let c=0;c1114111){n+=e(bo.OUT_OF_RANGE,n-1-s,t,r,a);continue}if(a>=55296&&a<=57343){n+=e(bo.UTF16_SURROGATE,n-1-s,t,r,a);continue}if(a<=o){n+=e(bo.OVERLONG,n-1-s,t,r,a);continue}r.push(a)}}return r}function qr(t,e=Gl.current){e!=Gl.current&&(JY.checkNormalize(),t=t.normalize(e));let r=[];for(let n=0;n>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const s=t.charCodeAt(n);if(n>=t.length||(s&64512)!==56320)throw new Error("invalid utf-8 string");const o=65536+((i&1023)<<10)+(s&1023);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return Ae(r)}function RA(t){const e="0000"+t.toString(16);return"\\u"+e.substring(e.length-4)}function Pwe(t,e){return'"'+YT(t,e).map(r=>{if(r<256){switch(r){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(r>=32&&r<127)return String.fromCharCode(r)}return r<=65535?RA(r):(r-=65536,RA((r>>10&1023)+55296)+RA((r&1023)+56320))}).join("")+'"'}function Kk(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function Cf(t,e){return Kk(YT(t,e))}function l6(t,e=Gl.current){return YT(qr(t,e))}function Rwe(t){const e=qr(t);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return Se(zr([e,c6]).slice(0,32))}function Twe(t){const e=Ae(t);if(e.length!==32)throw new Error("invalid bytes32 - not 32 bytes long");if(e[31]!==0)throw new Error("invalid bytes32 string - no null terminator");let r=31;for(;e[r-1]===0;)r--;return Cf(e.slice(0,r))}function Owe(t){if(t.length%4!==0)throw new Error("bad data");let e=[];for(let r=0;r{let s=i.split(":");r+=parseInt(s[0],16),n[r]=e(s[1])}),n}function ZY(t){let e=0;return t.split(",").map(r=>{let n=r.split("-");n.length===1?n[1]="0":n[1]===""&&(n[1]="1");let i=e+parseInt(n[0],16);return e=parseInt(n[1],16),{l:i,h:e}})}function XT(t,e){let r=0;for(let n=0;n=r&&t<=r+i.h&&(t-r)%(i.d||1)===0){if(i.e&&i.e.indexOf(t-r)!==-1)continue;return i}}return null}const $we=ZY("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),Nwe="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(t=>parseInt(t,16)),Mwe=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],Dwe=ZT("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),Lwe=ZT("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),Bwe=ZT("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",Owe),Fwe=ZY("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function jwe(t){return t.reduce((e,r)=>(r.forEach(n=>{e.push(n)}),e),[])}function Uwe(t){return!!XT(t,$we)}function zwe(t){let e=XT(t,Mwe);if(e)return[t+e.s];let r=Dwe[t];if(r)return r;let n=Lwe[t];if(n)return[t+n[0]];let i=Bwe[t];return i||null}function Hwe(t){return!!XT(t,Fwe)}function qwe(t){if(t.match(/^[a-z0-9-]*$/i)&&t.length<=59)return t.toLowerCase();let e=l6(t);e=jwe(e.map(n=>{if(Nwe.indexOf(n)>=0)return[];if(n>=65024&&n<=65039)return[];let i=zwe(n);return i||[n]})),e=l6(Kk(e),Gl.NFKC),e.forEach(n=>{if(Hwe(n))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")}),e.forEach(n=>{if(Uwe(n))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")});let r=Kk(e);if(r.substring(0,1)==="-"||r.substring(2,4)==="--"||r.substring(r.length-1)==="-")throw new Error("invalid hyphen");return r}class Wwe extends VY{constructor(e){super("string",e)}defaultValue(){return""}encode(e,r){return super.encode(e,qr(r))}decode(e){return Cf(super.decode(e))}}class I5 extends _f{constructor(e,r){let n=!1;const i=[];e.forEach(o=>{o.dynamic&&(n=!0),i.push(o.type)});const s="tuple("+i.join(",")+")";super("tuple",s,r,n),this.coders=e}defaultValue(){const e=[];this.coders.forEach(n=>{e.push(n.defaultValue())});const r=this.coders.reduce((n,i)=>{const s=i.localName;return s&&(n[s]||(n[s]=0),n[s]++),n},{});return this.coders.forEach((n,i)=>{let s=n.localName;!s||r[s]!==1||(s==="length"&&(s="_length"),e[s]==null&&(e[s]=e[i]))}),Object.freeze(e)}encode(e,r){return qY(e,this.coders,r)}decode(e){return e.coerce(this.name,WY(e,this.coders))}}const P5=new Ee(V2),Vwe=new RegExp(/^bytes([0-9]*)$/),Gwe=new RegExp(/^(u?int)([0-9]*)$/);class eO{constructor(e){Ie(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new mwe(e.name);case"bool":return new bwe(e.name);case"string":return new Wwe(e.name);case"bytes":return new wwe(e.name);case"array":return new ywe(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new I5((e.components||[]).map(n=>this._getCoder(n)),e.name);case"":return new Ewe(e.name)}let r=e.type.match(Gwe);if(r){let n=parseInt(r[2]||"256");return(n===0||n>256||n%8!==0)&&P5.throwArgumentError("invalid "+r[1]+" bit length","param",e),new Swe(n/8,r[1]==="int",e.name)}if(r=e.type.match(Vwe),r){let n=parseInt(r[1]);return(n===0||n>32)&&P5.throwArgumentError("invalid bytes length","param",e),new xwe(n,e.name)}return P5.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,r){return new a6(e,this._getWordSize(),this.coerceFunc,r)}_getWriter(){return new Gk(this._getWordSize())}getDefaultValue(e){const r=e.map(i=>this._getCoder(wi.from(i)));return new I5(r,"_").defaultValue()}encode(e,r){e.length!==r.length&&P5.throwError("types/values length mismatch",Ee.errors.INVALID_ARGUMENT,{count:{types:e.length,values:r.length},value:{types:e,values:r}});const n=e.map(o=>this._getCoder(wi.from(o))),i=new I5(n,"_"),s=this._getWriter();return i.encode(s,r),s.data}decode(e,r,n){const i=e.map(o=>this._getCoder(wi.from(o)));return new I5(i,"_").decode(this._getReader(Ae(r),n))}}const Js=new eO;function md(t){return Tt(qr(t))}const XY="hash/5.7.0";function tO(t){t=atob(t);const e=[];for(let r=0;r0&&Array.isArray(a)?i(a,o-1):r.push(a)})};return i(t,e),r}function Jwe(t){const e={};for(let r=0;r>--c&1}const f=31,d=Math.pow(2,f),p=d>>>1,g=p>>1,v=d-1;let y=0;for(let S=0;S1;){let Z=P+_>>>1;S>>1|u(),T=T<<1^p,Q=(Q^p)<<1|p|1;w=T,E=1+Q-T}let C=n-4;return b.map(S=>{switch(S-C){case 3:return C+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return C+256+(t[a++]<<8|t[a++]);case 1:return C+t[a++];default:return S-1}})}function Ywe(t){let e=0;return()=>t[e++]}function Zwe(t){return Ywe(Qwe(t))}function Xwe(t){return t&1?~t>>1:t>>1}function exe(t,e){let r=Array(t);for(let n=0;ne[o]):r}function rxe(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(ixe(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(sxe(r,t))}return Jwe(eZ(e))}function nxe(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(r)}return e}function tZ(t,e,r){let n=Array(t).fill(void 0).map(()=>[]);for(let i=0;in[o].push(s));return n}function ixe(t,e){let r=1+e(),n=e(),i=nxe(e),s=tZ(i.length,1+t,e);return eZ(s.map((o,a)=>{const c=o[0],l=o.slice(1);return Array(i[a]).fill(void 0).map((u,f)=>{let d=f*n;return[c+f*r,l.map(p=>p+d)]})}))}function sxe(t,e){let r=1+e();return tZ(r,1+t,e).map(i=>[i[0],i.slice(1)])}function oxe(t){let e=u6(t).sort((n,i)=>n-i);return r();function r(){let n=[];for(;;){let l=u6(t,e);if(l.length==0)break;n.push({set:new Set(l),node:r()})}n.sort((l,u)=>u.set.size-l.set.size);let i=t(),s=i%3;i=i/3|0;let o=!!(i&1);i>>=1;let a=i==1,c=i==2;return{branches:n,valid:s,fe0f:o,save:a,check:c}}}function axe(){return Zwe(tO("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}const o8=axe(),cxe=new Set(u6(o8)),lxe=new Set(u6(o8)),uxe=rxe(o8),fxe=oxe(o8),oj=45,aj=95;function rZ(t){return l6(t)}function dxe(t){return t.filter(e=>e!=65039)}function nZ(t){for(let e of t.split(".")){let r=rZ(e);try{for(let n=r.lastIndexOf(aj)-1;n>=0;n--)if(r[n]!==aj)throw new Error("underscore only allowed at start");if(r.length>=4&&r.every(n=>n<128)&&r[2]===oj&&r[3]===oj)throw new Error("invalid label extension")}catch(n){throw new Error(`Invalid label "${e}": ${n.message}`)}}return t}function hxe(t){return nZ(pxe(t,dxe))}function pxe(t,e){let r=rZ(t).reverse(),n=[];for(;r.length;){let i=mxe(r);if(i){n.push(...e(i));continue}let s=r.pop();if(cxe.has(s)){n.push(s);continue}if(lxe.has(s))continue;let o=uxe[s];if(o){n.push(...o);continue}throw new Error(`Disallowed codepoint: 0x${s.toString(16).toUpperCase()}`)}return nZ(gxe(String.fromCodePoint(...n)))}function gxe(t){return t.normalize("NFC")}function mxe(t,e){var r;let n=fxe,i,s,o=[],a=t.length;for(e&&(e.length=0);a;){let c=t[--a];if(n=(r=n.branches.find(l=>l.set.has(c)))===null||r===void 0?void 0:r.node,!n)break;if(n.save)s=c;else if(n.check&&c===s)break;o.push(c),n.fe0f&&(o.push(65039),a>0&&t[a-1]==65039&&a--),n.valid&&(i=o.slice(),n.valid==2&&i.splice(1,1),e&&e.push(...t.slice(a).reverse()),t.length=a)}return i}const vxe=new Ee(XY),iZ=new Uint8Array(32);iZ.fill(0);function cj(t){if(t.length===0)throw new Error("invalid ENS name; empty component");return t}function nO(t){const e=qr(hxe(t)),r=[];if(t.length===0)return r;let n=0;for(let i=0;i=e.length)throw new Error("invalid ENS name; empty component");return r.push(cj(e.slice(n))),r}function yxe(t){try{return nO(t).length!==0}catch{}return!1}function Wy(t){typeof t!="string"&&vxe.throwArgumentError("invalid ENS name; not a string","name",t);let e=iZ;const r=nO(t);for(;r.length;)e=Tt(zr([e,Tt(r.pop())]));return Se(e)}function sZ(t){return Se(zr(nO(t).map(e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const r=new Uint8Array(e.length+1);return r.set(e,1),r[0]=r.length-1,r})))+"00"}const bxe=`Ethereum Signed Message: +`;function a8(t){return typeof t=="string"&&(t=qr(t)),Tt(zr([qr(bxe),qr(String(t.length)),t]))}var wxe=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const Cn=new Ee(XY),oZ=new Uint8Array(32);oZ.fill(0);const xxe=we.from(-1),aZ=we.from(0),cZ=we.from(1),Exe=we.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function _xe(t){const e=Ae(t),r=e.length%32;return r?Hs([e,oZ.slice(r)]):Se(e)}const Cxe=Hr(cZ.toHexString(),32),Sxe=Hr(aZ.toHexString(),32),lj={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},TA=["name","version","chainId","verifyingContract","salt"];function uj(t){return function(e){return typeof e!="string"&&Cn.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const Axe={name:uj("name"),version:uj("version"),chainId:function(t){try{return we.from(t).toString()}catch{}return Cn.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return qt(t).toLowerCase()}catch{}return Cn.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=Ae(t);if(e.length!==32)throw new Error("bad length");return Se(e)}catch{}return Cn.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function OA(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=e[1]==="",n=parseInt(e[2]||"256");(n%8!==0||n>256||e[2]&&e[2]!==String(n))&&Cn.throwArgumentError("invalid numeric width","type",t);const i=Exe.mask(r?n-1:n),s=r?i.add(cZ).mul(xxe):aZ;return function(o){const a=we.from(o);return(a.lt(s)||a.gt(i))&&Cn.throwArgumentError(`value out-of-bounds for ${t}`,"value",o),Hr(a.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return(r===0||r>32||e[1]!==String(r))&&Cn.throwArgumentError("invalid bytes width","type",t),function(n){return Ae(n).length!==r&&Cn.throwArgumentError(`invalid length for ${t}`,"value",n),_xe(n)}}}switch(t){case"address":return function(e){return Hr(qt(e),32)};case"bool":return function(e){return e?Cxe:Sxe};case"bytes":return function(e){return Tt(e)};case"string":return function(e){return md(e)}}return null}function fj(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}class oi{constructor(e){Ie(this,"types",Object.freeze(ra(e))),Ie(this,"_encoderCache",{}),Ie(this,"_types",{});const r={},n={},i={};Object.keys(e).forEach(a=>{r[a]={},n[a]=[],i[a]={}});for(const a in e){const c={};e[a].forEach(l=>{c[l.name]&&Cn.throwArgumentError(`duplicate variable name ${JSON.stringify(l.name)} in ${JSON.stringify(a)}`,"types",e),c[l.name]=!0;const u=l.type.match(/^([^\x5b]*)(\x5b|$)/)[1];u===a&&Cn.throwArgumentError(`circular type reference to ${JSON.stringify(u)}`,"types",e),!OA(u)&&(n[u]||Cn.throwArgumentError(`unknown type ${JSON.stringify(u)}`,"types",e),n[u].push(a),r[a][u]=!0)})}const s=Object.keys(n).filter(a=>n[a].length===0);s.length===0?Cn.throwArgumentError("missing primary type","types",e):s.length>1&&Cn.throwArgumentError(`ambiguous primary types or unused types: ${s.map(a=>JSON.stringify(a)).join(", ")}`,"types",e),Ie(this,"primaryType",s[0]);function o(a,c){c[a]&&Cn.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",e),c[a]=!0,Object.keys(r[a]).forEach(l=>{n[l]&&(o(l,c),Object.keys(c).forEach(u=>{i[u][l]=!0}))}),delete c[a]}o(this.primaryType,{});for(const a in i){const c=Object.keys(i[a]);c.sort(),this._types[a]=fj(a,e[a])+c.map(l=>fj(l,e[l])).join("")}}getEncoder(e){let r=this._encoderCache[e];return r||(r=this._encoderCache[e]=this._getEncoder(e)),r}_getEncoder(e){{const i=OA(e);if(i)return i}const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const i=r[1],s=this.getEncoder(i),o=parseInt(r[3]);return a=>{o>=0&&a.length!==o&&Cn.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",a);let c=a.map(s);return this._types[i]&&(c=c.map(Tt)),Tt(Hs(c))}}const n=this.types[e];if(n){const i=md(this._types[e]);return s=>{const o=n.map(({name:a,type:c})=>{const l=this.getEncoder(c)(s[a]);return this._types[c]?Tt(l):l});return o.unshift(i),Hs(o)}}return Cn.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const r=this._types[e];return r||Cn.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return Tt(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,n){if(OA(e))return n(e,r);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){const o=i[1],a=parseInt(i[3]);return a>=0&&r.length!==a&&Cn.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",r),r.map(c=>this._visit(o,c,n))}const s=this.types[e];return s?s.reduce((o,{name:a,type:c})=>(o[a]=this._visit(c,r[a],n),o),{}):Cn.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new oi(e)}static getPrimaryType(e){return oi.from(e).primaryType}static hashStruct(e,r,n){return oi.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){const i=lj[n];i||Cn.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>TA.indexOf(n.name)-TA.indexOf(i.name)),oi.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return Hs(["0x1901",oi.hashDomain(e),oi.from(r).hash(n)])}static hash(e,r,n){return Tt(oi.encode(e,r,n))}static resolveNames(e,r,n,i){return wxe(this,void 0,void 0,function*(){e=dn(e);const s={};e.verifyingContract&&!Vt(e.verifyingContract,20)&&(s[e.verifyingContract]="0x");const o=oi.from(r);o.visit(n,(a,c)=>(a==="address"&&!Vt(c,20)&&(s[c]="0x"),c));for(const a in s)s[a]=yield i(a);return e.verifyingContract&&s[e.verifyingContract]&&(e.verifyingContract=s[e.verifyingContract]),n=o.visit(n,(a,c)=>a==="address"&&s[c]?s[c]:c),{domain:e,value:n}})}static getPayload(e,r,n){oi.hashDomain(e);const i={},s=[];TA.forEach(c=>{const l=e[c];l!=null&&(i[c]=Axe[c](l),s.push({name:c,type:lj[c]}))});const o=oi.from(r),a=dn(r);return a.EIP712Domain?Cn.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):a.EIP712Domain=s,o.encode(n),{types:a,domain:i,primaryType:o.primaryType,message:o.visit(n,(c,l)=>{if(c.match(/^bytes(\d*)/))return Se(Ae(l));if(c.match(/^u?int/))return we.from(l).toString();switch(c){case"address":return l.toLowerCase();case"bool":return!!l;case"string":return typeof l!="string"&&Cn.throwArgumentError("invalid string","value",l),l}return Cn.throwArgumentError("unsupported type","type",c)})}}}const xn=new Ee(V2);class lZ extends g1{}class uZ extends g1{}class kxe extends g1{}class f6 extends g1{static isIndexed(e){return!!(e&&e._isIndexed)}}const Ixe={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function dj(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return r.error=e,r}class fi{constructor(e){let r=[];typeof e=="string"?r=JSON.parse(e):r=e,Ie(this,"fragments",r.map(n=>Il.from(n)).filter(n=>n!=null)),Ie(this,"_abiCoder",Lc(new.target,"getAbiCoder")()),Ie(this,"functions",{}),Ie(this,"errors",{}),Ie(this,"events",{}),Ie(this,"structs",{}),this.fragments.forEach(n=>{let i=null;switch(n.type){case"constructor":if(this.deploy){xn.warn("duplicate definition - constructor");return}Ie(this,"deploy",n);return;case"function":i=this.functions;break;case"event":i=this.events;break;case"error":i=this.errors;break;default:return}let s=n.format();if(i[s]){xn.warn("duplicate definition - "+s);return}i[s]=n}),this.deploy||Ie(this,"deploy",Mc.from({payable:!1,type:"constructor"})),Ie(this,"_isInterface",!0)}format(e){e||(e=Cr.full),e===Cr.sighash&&xn.throwArgumentError("interface does not support formatting sighash","format",e);const r=this.fragments.map(n=>n.format(e));return e===Cr.json?JSON.stringify(r.map(n=>JSON.parse(n))):r}static getAbiCoder(){return Js}static getAddress(e){return qt(e)}static getSighash(e){return Fn(md(e.format()),0,4)}static getEventTopic(e){return md(e.format())}getFunction(e){if(Vt(e)){for(const n in this.functions)if(e===this.getSighash(n))return this.functions[n];xn.throwArgumentError("no matching function","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.functions).filter(s=>s.split("(")[0]===n);return i.length===0?xn.throwArgumentError("no matching function","name",n):i.length>1&&xn.throwArgumentError("multiple matching functions","name",n),this.functions[i[0]]}const r=this.functions[Dc.fromString(e).format()];return r||xn.throwArgumentError("no matching function","signature",e),r}getEvent(e){if(Vt(e)){const n=e.toLowerCase();for(const i in this.events)if(n===this.getEventTopic(i))return this.events[i];xn.throwArgumentError("no matching event","topichash",n)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.events).filter(s=>s.split("(")[0]===n);return i.length===0?xn.throwArgumentError("no matching event","name",n):i.length>1&&xn.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}const r=this.events[Cl.fromString(e).format()];return r||xn.throwArgumentError("no matching event","signature",e),r}getError(e){if(Vt(e)){const n=Lc(this.constructor,"getSighash");for(const i in this.errors){const s=this.errors[i];if(e===n(s))return this.errors[i]}xn.throwArgumentError("no matching error","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.errors).filter(s=>s.split("(")[0]===n);return i.length===0?xn.throwArgumentError("no matching error","name",n):i.length>1&&xn.throwArgumentError("multiple matching errors","name",n),this.errors[i[0]]}const r=this.errors[Dc.fromString(e).format()];return r||xn.throwArgumentError("no matching error","signature",e),r}getSighash(e){if(typeof e=="string")try{e=this.getFunction(e)}catch(r){try{e=this.getError(e)}catch{throw r}}return Lc(this.constructor,"getSighash")(e)}getEventTopic(e){return typeof e=="string"&&(e=this.getEvent(e)),Lc(this.constructor,"getEventTopic")(e)}_decodeParams(e,r){return this._abiCoder.decode(e,r)}_encodeParams(e,r){return this._abiCoder.encode(e,r)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,r){typeof e=="string"&&(e=this.getError(e));const n=Ae(r);return Se(n.slice(0,4))!==this.getSighash(e)&&xn.throwArgumentError(`data signature does not match error ${e.name}.`,"data",Se(n)),this._decodeParams(e.inputs,n.slice(4))}encodeErrorResult(e,r){return typeof e=="string"&&(e=this.getError(e)),Se(zr([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionData(e,r){typeof e=="string"&&(e=this.getFunction(e));const n=Ae(r);return Se(n.slice(0,4))!==this.getSighash(e)&&xn.throwArgumentError(`data signature does not match function ${e.name}.`,"data",Se(n)),this._decodeParams(e.inputs,n.slice(4))}encodeFunctionData(e,r){return typeof e=="string"&&(e=this.getFunction(e)),Se(zr([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionResult(e,r){typeof e=="string"&&(e=this.getFunction(e));let n=Ae(r),i=null,s="",o=null,a=null,c=null;switch(n.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,n)}catch{}break;case 4:{const l=Se(n.slice(0,4)),u=Ixe[l];if(u)o=this._abiCoder.decode(u.inputs,n.slice(4)),a=u.name,c=u.signature,u.reason&&(i=o[0]),a==="Error"?s=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(o[0])}`:a==="Panic"&&(s=`; VM Exception while processing transaction: reverted with panic code ${o[0]}`);else try{const f=this.getError(l);o=this._abiCoder.decode(f.inputs,n.slice(4)),a=f.name,c=f.format()}catch{}break}}return xn.throwError("call revert exception"+s,Ee.errors.CALL_EXCEPTION,{method:e.format(),data:Se(r),errorArgs:o,errorName:a,errorSignature:c,reason:i})}encodeFunctionResult(e,r){return typeof e=="string"&&(e=this.getFunction(e)),Se(this._abiCoder.encode(e.outputs,r||[]))}encodeFilterTopics(e,r){typeof e=="string"&&(e=this.getEvent(e)),r.length>e.inputs.length&&xn.throwError("too many arguments for "+e.format(),Ee.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:r});let n=[];e.anonymous||n.push(this.getEventTopic(e));const i=(s,o)=>s.type==="string"?md(o):s.type==="bytes"?Tt(Se(o)):(s.type==="bool"&&typeof o=="boolean"&&(o=o?"0x01":"0x00"),s.type.match(/^u?int/)&&(o=we.from(o).toHexString()),s.type==="address"&&this._abiCoder.encode(["address"],[o]),Hr(Se(o),32));for(r.forEach((s,o)=>{let a=e.inputs[o];if(!a.indexed){s!=null&&xn.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+a.name,s);return}s==null?n.push(null):a.baseType==="array"||a.baseType==="tuple"?xn.throwArgumentError("filtering with tuples or arrays not supported","contract."+a.name,s):Array.isArray(s)?n.push(s.map(c=>i(a,c))):n.push(i(a,s))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,r){typeof e=="string"&&(e=this.getEvent(e));const n=[],i=[],s=[];return e.anonymous||n.push(this.getEventTopic(e)),r.length!==e.inputs.length&&xn.throwArgumentError("event arguments/values mismatch","values",r),e.inputs.forEach((o,a)=>{const c=r[a];if(o.indexed)if(o.type==="string")n.push(md(c));else if(o.type==="bytes")n.push(Tt(c));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");n.push(this._abiCoder.encode([o.type],[c]))}else i.push(o),s.push(c)}),{data:this._abiCoder.encode(i,s),topics:n}}decodeEventLog(e,r,n){if(typeof e=="string"&&(e=this.getEvent(e)),n!=null&&!e.anonymous){let d=this.getEventTopic(e);(!Vt(n[0],32)||n[0].toLowerCase()!==d)&&xn.throwError("fragment/topic mismatch",Ee.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:d,value:n[0]}),n=n.slice(1)}let i=[],s=[],o=[];e.inputs.forEach((d,p)=>{d.indexed?d.type==="string"||d.type==="bytes"||d.baseType==="tuple"||d.baseType==="array"?(i.push(wi.fromObject({type:"bytes32",name:d.name})),o.push(!0)):(i.push(d),o.push(!1)):(s.push(d),o.push(!1))});let a=n!=null?this._abiCoder.decode(i,zr(n)):null,c=this._abiCoder.decode(s,r,!0),l=[],u=0,f=0;e.inputs.forEach((d,p)=>{if(d.indexed)if(a==null)l[p]=new f6({_isIndexed:!0,hash:null});else if(o[p])l[p]=new f6({_isIndexed:!0,hash:a[f++]});else try{l[p]=a[f++]}catch(g){l[p]=g}else try{l[p]=c[u++]}catch(g){l[p]=g}if(d.name&&l[d.name]==null){const g=l[p];g instanceof Error?Object.defineProperty(l,d.name,{enumerable:!0,get:()=>{throw dj(`property ${JSON.stringify(d.name)}`,g)}}):l[d.name]=g}});for(let d=0;d{throw dj(`index ${d}`,p)}})}return Object.freeze(l)}parseTransaction(e){let r=this.getFunction(e.data.substring(0,10).toLowerCase());return r?new uZ({args:this._abiCoder.decode(r.inputs,"0x"+e.data.substring(10)),functionFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r),value:we.from(e.value||"0")}):null}parseLog(e){let r=this.getEvent(e.topics[0]);return!r||r.anonymous?null:new lZ({eventFragment:r,name:r.name,signature:r.format(),topic:this.getEventTopic(r),args:this.decodeEventLog(r,e.data,e.topics)})}parseError(e){const r=Se(e);let n=this.getError(r.substring(0,10).toLowerCase());return n?new kxe({args:this._abiCoder.decode(n.inputs,"0x"+r.substring(10)),errorFragment:n,name:n.name,signature:n.format(),sighash:this.getSighash(n)}):null}static isInterface(e){return!!(e&&e._isInterface)}}const Pxe="abstract-provider/5.7.0";var Rxe=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const Txe=new Ee(Pxe);class Oxe extends g1{static isForkEvent(e){return!!(e&&e._isForkEvent)}}class Sf{constructor(){Txe.checkAbstract(new.target,Sf),Ie(this,"_isProvider",!0)}getFeeData(){return Rxe(this,void 0,void 0,function*(){const{block:e,gasPrice:r}=yield Qr({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(o=>null)});let n=null,i=null,s=null;return e&&e.baseFeePerGas&&(n=e.baseFeePerGas,s=we.from("1500000000"),i=e.baseFeePerGas.mul(2).add(s)),{lastBaseFeePerGas:n,maxFeePerGas:i,maxPriorityFeePerGas:s,gasPrice:r}})}addListener(e,r){return this.on(e,r)}removeListener(e,r){return this.off(e,r)}static isProvider(e){return!!(e&&e._isProvider)}}const $xe="abstract-signer/5.7.0";var vc=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const Ra=new Ee($xe),Nxe=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],Mxe=[Ee.errors.INSUFFICIENT_FUNDS,Ee.errors.NONCE_EXPIRED,Ee.errors.REPLACEMENT_UNDERPRICED];let zd=class fZ{constructor(){Ra.checkAbstract(new.target,fZ),Ie(this,"_isSigner",!0)}getBalance(e){return vc(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return vc(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return vc(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const r=yield Qr(this.checkTransaction(e));return yield this.provider.estimateGas(r)})}call(e,r){return vc(this,void 0,void 0,function*(){this._checkProvider("call");const n=yield Qr(this.checkTransaction(e));return yield this.provider.call(n,r)})}sendTransaction(e){return vc(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");const r=yield this.populateTransaction(e),n=yield this.signTransaction(r);return yield this.provider.sendTransaction(n)})}getChainId(){return vc(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return vc(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return vc(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(e){return vc(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(const n in e)Nxe.indexOf(n)===-1&&Ra.throwArgumentError("invalid transaction key: "+n,"transaction",e);const r=dn(e);return r.from==null?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then(n=>(n[0].toLowerCase()!==n[1].toLowerCase()&&Ra.throwArgumentError("from address mismatch","transaction",e),n[0])),r}populateTransaction(e){return vc(this,void 0,void 0,function*(){const r=yield Qr(this.checkTransaction(e));r.to!=null&&(r.to=Promise.resolve(r.to).then(i=>vc(this,void 0,void 0,function*(){if(i==null)return null;const s=yield this.resolveName(i);return s==null&&Ra.throwArgumentError("provided ENS name resolves to null","tx.to",i),s})),r.to.catch(i=>{}));const n=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||n)?Ra.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e):(r.type===0||r.type===1)&&n&&Ra.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1)r.gasPrice==null&&(r.gasPrice=this.getGasPrice());else{const i=yield this.getFeeData();if(r.type==null)if(i.maxFeePerGas!=null&&i.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){const s=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=s,r.maxPriorityFeePerGas=s}else r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas);else i.gasPrice!=null?(n&&Ra.throwError("network does not support EIP-1559",Ee.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=i.gasPrice),r.type=0):Ra.throwError("failed to get consistent fee data",Ee.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else r.type===2&&(r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas))}return r.nonce==null&&(r.nonce=this.getTransactionCount("pending")),r.gasLimit==null&&(r.gasLimit=this.estimateGas(r).catch(i=>{if(Mxe.indexOf(i.code)>=0)throw i;return Ra.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Ee.errors.UNPREDICTABLE_GAS_LIMIT,{error:i,tx:r})})),r.chainId==null?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then(i=>(i[1]!==0&&i[0]!==i[1]&&Ra.throwArgumentError("chainId address mismatch","transaction",e),i[0])),yield Qr(r)})}_checkProvider(e){this.provider||Ra.throwError("missing provider",Ee.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!!(e&&e._isSigner)}};class iO extends zd{constructor(e,r){super(),Ie(this,"address",e),Ie(this,"provider",r||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,r){return Promise.resolve().then(()=>{Ra.throwError(e,Ee.errors.UNSUPPORTED_OPERATION,{operation:r})})}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,r,n){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new iO(this.address,e)}}var dZ={},ur={},G2=hZ;function hZ(t,e){if(!t)throw new Error(e||"Assertion failed")}hZ.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)};var Jk={exports:{}};typeof Object.create=="function"?Jk.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Jk.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}};var tc=Jk.exports,Dxe=G2,Lxe=tc;ur.inherits=Lxe;function Bxe(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function Fxe(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),i=0;i>6|192,r[n++]=s&63|128):Bxe(t,i)?(s=65536+((s&1023)<<10)+(t.charCodeAt(++i)&1023),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=s&63|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=s&63|128)}else for(i=0;i>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}ur.htonl=pZ;function Uxe(t,e){for(var r="",n=0;n>>0}return s}ur.join32=zxe;function Hxe(t,e){for(var r=new Array(t.length*4),n=0,i=0;n>>24,r[i+1]=s>>>16&255,r[i+2]=s>>>8&255,r[i+3]=s&255):(r[i+3]=s>>>24,r[i+2]=s>>>16&255,r[i+1]=s>>>8&255,r[i]=s&255)}return r}ur.split32=Hxe;function qxe(t,e){return t>>>e|t<<32-e}ur.rotr32=qxe;function Wxe(t,e){return t<>>32-e}ur.rotl32=Wxe;function Vxe(t,e){return t+e>>>0}ur.sum32=Vxe;function Gxe(t,e,r){return t+e+r>>>0}ur.sum32_3=Gxe;function Kxe(t,e,r,n){return t+e+r+n>>>0}ur.sum32_4=Kxe;function Jxe(t,e,r,n,i){return t+e+r+n+i>>>0}ur.sum32_5=Jxe;function Qxe(t,e,r,n){var i=t[e],s=t[e+1],o=n+s>>>0,a=(o>>0,t[e+1]=o}ur.sum64=Qxe;function Yxe(t,e,r,n){var i=e+n>>>0,s=(i>>0}ur.sum64_hi=Yxe;function Zxe(t,e,r,n){var i=e+n;return i>>>0}ur.sum64_lo=Zxe;function Xxe(t,e,r,n,i,s,o,a){var c=0,l=e;l=l+n>>>0,c+=l>>0,c+=l>>0,c+=l>>0}ur.sum64_4_hi=Xxe;function e5e(t,e,r,n,i,s,o,a){var c=e+n+s+a;return c>>>0}ur.sum64_4_lo=e5e;function t5e(t,e,r,n,i,s,o,a,c,l){var u=0,f=e;f=f+n>>>0,u+=f>>0,u+=f>>0,u+=f>>0,u+=f>>0}ur.sum64_5_hi=t5e;function r5e(t,e,r,n,i,s,o,a,c,l){var u=e+n+s+a+l;return u>>>0}ur.sum64_5_lo=r5e;function n5e(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}ur.rotr64_hi=n5e;function i5e(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}ur.rotr64_lo=i5e;function s5e(t,e,r){return t>>>r}ur.shr64_hi=s5e;function o5e(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}ur.shr64_lo=o5e;var _m={},hj=ur,a5e=G2;function c8(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}_m.BlockHash=c8;c8.prototype.update=function(e,r){if(e=hj.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var n=e.length%this._delta8;this.pending=e.slice(e.length-n,e.length),this.pending.length===0&&(this.pending=null),e=hj.join32(e,0,e.length-n,this.endian);for(var i=0;i>>24&255,i[s++]=e>>>16&255,i[s++]=e>>>8&255,i[s++]=e&255}else for(i[s++]=e&255,i[s++]=e>>>8&255,i[s++]=e>>>16&255,i[s++]=e>>>24&255,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,o=8;o>>3}nu.g0_256=d5e;function h5e(t){return Fl(t,17)^Fl(t,19)^t>>>10}nu.g1_256=h5e;var Ug=ur,p5e=_m,g5e=nu,$A=Ug.rotl32,jv=Ug.sum32,m5e=Ug.sum32_5,v5e=g5e.ft_1,wZ=p5e.BlockHash,y5e=[1518500249,1859775393,2400959708,3395469782];function Kl(){if(!(this instanceof Kl))return new Kl;wZ.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Ug.inherits(Kl,wZ);var b5e=Kl;Kl.blockSize=512;Kl.outSize=160;Kl.hmacStrength=80;Kl.padLength=64;Kl.prototype._update=function(e,r){for(var n=this.W,i=0;i<16;i++)n[i]=e[r+i];for(;ithis.blockSize&&(e=new this.Hash().update(e).digest()),o3e(e.length<=this.blockSize);for(var r=e.length;r>8,d=u&255;f?c.push(f,d):c.push(d)}return c}r.toArray=n;function i(o){return o.length===1?"0"+o:o}r.zero2=i;function s(o){for(var a="",c=0;c(d>>1)-1?v=(d>>1)-y:v=y,p.isubn(v)):v=0,f[g]=v,p.iushrn(1)}return f}r.getNAF=n;function i(c,l){var u=[[],[]];c=c.clone(),l=l.clone();for(var f=0,d=0,p;c.cmpn(-f)>0||l.cmpn(-d)>0;){var g=c.andln(3)+f&3,v=l.andln(3)+d&3;g===3&&(g=-1),v===3&&(v=-1);var y;g&1?(p=c.andln(7)+f&7,(p===3||p===5)&&v===2?y=-g:y=g):y=0,u[0].push(y);var b;v&1?(p=l.andln(7)+d&7,(p===3||p===5)&&g===2?b=-v:b=v):b=0,u[1].push(b),2*f===y+1&&(f=1-f),2*d===b+1&&(d=1-d),c.iushrn(1),l.iushrn(1)}return u}r.getJSF=i;function s(c,l,u){var f="_"+l;c.prototype[l]=function(){return this[f]!==void 0?this[f]:this[f]=u.call(this)}}r.cachedProperty=s;function o(c){return typeof c=="string"?r.toArray(c,"hex"):c}r.parseBytes=o;function a(c){return new Ht(c,"hex","le")}r.intFromLE=a}),d6=ua.getNAF,l3e=ua.getJSF,h6=ua.assert;function gh(t,e){this.type=t,this.p=new Ht(e.p,16),this.red=e.prime?Ht.red(e.prime):Ht.mont(this.p),this.zero=new Ht(0).toRed(this.red),this.one=new Ht(1).toRed(this.red),this.two=new Ht(2).toRed(this.red),this.n=e.n&&new Ht(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var m1=gh;gh.prototype.point=function(){throw new Error("Not implemented")};gh.prototype.validate=function(){throw new Error("Not implemented")};gh.prototype._fixedNafMul=function(e,r){h6(e.precomputed);var n=e._getDoubles(),i=d6(r,1,this._bitLength),s=(1<=a;l--)c=(c<<1)+i[l];o.push(c)}for(var u=this.jpoint(null,null,null),f=this.jpoint(null,null,null),d=s;d>0;d--){for(a=0;a=0;c--){for(var l=0;c>=0&&o[c]===0;c--)l++;if(c>=0&&l++,a=a.dblp(l),c<0)break;var u=o[c];h6(u!==0),e.type==="affine"?u>0?a=a.mixedAdd(s[u-1>>1]):a=a.mixedAdd(s[-u-1>>1].neg()):u>0?a=a.add(s[u-1>>1]):a=a.add(s[-u-1>>1].neg())}return e.type==="affine"?a.toP():a};gh.prototype._wnafMulAdd=function(e,r,n,i,s){var o=this._wnafT1,a=this._wnafT2,c=this._wnafT3,l=0,u,f,d;for(u=0;u=1;u-=2){var g=u-1,v=u;if(o[g]!==1||o[v]!==1){c[g]=d6(n[g],o[g],this._bitLength),c[v]=d6(n[v],o[v],this._bitLength),l=Math.max(c[g].length,l),l=Math.max(c[v].length,l);continue}var y=[r[g],null,null,r[v]];r[g].y.cmp(r[v].y)===0?(y[1]=r[g].add(r[v]),y[2]=r[g].toJ().mixedAdd(r[v].neg())):r[g].y.cmp(r[v].y.redNeg())===0?(y[1]=r[g].toJ().mixedAdd(r[v]),y[2]=r[g].add(r[v].neg())):(y[1]=r[g].toJ().mixedAdd(r[v]),y[2]=r[g].toJ().mixedAdd(r[v].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],w=l3e(n[g],n[v]);for(l=Math.max(w[0].length,l),c[g]=new Array(l),c[v]=new Array(l),f=0;f=0;u--){for(var _=0;u>=0;){var T=!0;for(f=0;f=0&&_++,S=S.dblp(_),u<0)break;for(f=0;f0?d=a[f][Q-1>>1]:Q<0&&(d=a[f][-Q-1>>1].neg()),d.type==="affine"?S=S.mixedAdd(d):S=S.add(d))}}for(u=0;u=Math.ceil((e.bitLength()+1)/r.step):!1};rc.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s=0&&(p=l,g=u),f.negative&&(f=f.neg(),d=d.neg()),p.negative&&(p=p.neg(),g=g.neg()),[{a:f,b:d},{a:p,b:g}]};nc.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],s=i.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=s.mul(n.a),c=o.mul(i.a),l=s.mul(n.b),u=o.mul(i.b),f=e.sub(a).sub(c),d=l.add(u).neg();return{k1:f,k2:d}};nc.prototype.pointFromX=function(e,r){e=new Ht(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var s=i.fromRed().isOdd();return(r&&!s||!r&&s)&&(i=i.redNeg()),this.point(e,i)};nc.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0};nc.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,o=0;o":""};Ui.prototype.isInfinity=function(){return this.inf};Ui.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};Ui.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),o=s.redSqr().redISub(this.x.redAdd(this.x)),a=s.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)};Ui.prototype.getX=function(){return this.x.fromRed()};Ui.prototype.getY=function(){return this.y.fromRed()};Ui.prototype.mul=function(e){return e=new Ht(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};Ui.prototype.mulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)};Ui.prototype.jmulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)};Ui.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};Ui.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=function(s){return s.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};Ui.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function ns(t,e,r,n){m1.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Ht(0)):(this.x=new Ht(e,16),this.y=new Ht(r,16),this.z=new Ht(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}oO(ns,m1.BasePoint);nc.prototype.jpoint=function(e,r,n){return new ns(this,e,r,n)};ns.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)};ns.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};ns.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),s=e.x.redMul(n),o=this.y.redMul(r.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),c=i.redSub(s),l=o.redSub(a);if(c.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var u=c.redSqr(),f=u.redMul(c),d=i.redMul(u),p=l.redSqr().redIAdd(f).redISub(d).redISub(d),g=l.redMul(d.redISub(p)).redISub(o.redMul(f)),v=this.z.redMul(e.z).redMul(c);return this.curve.jpoint(p,g,v)};ns.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),s=this.y,o=e.y.redMul(r).redMul(this.z),a=n.redSub(i),c=s.redSub(o);if(a.cmpn(0)===0)return c.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var l=a.redSqr(),u=l.redMul(a),f=n.redMul(l),d=c.redSqr().redIAdd(u).redISub(f).redISub(f),p=c.redMul(f.redISub(d)).redISub(s.redMul(u)),g=this.z.redMul(a);return this.curve.jpoint(d,p,g)};ns.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}};ns.prototype.inspect=function(){return this.isInfinity()?"":""};ns.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var J3=Am(function(t,e){var r=e;r.base=m1,r.short=f3e,r.mont=null,r.edwards=null}),Q3=Am(function(t,e){var r=e,n=ua.assert;function i(a){a.type==="short"?this.curve=new J3.short(a):a.type==="edwards"?this.curve=new J3.edwards(a):this.curve=new J3.mont(a),this.g=this.curve.g,this.n=this.curve.n,this.hash=a.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=i;function s(a,c){Object.defineProperty(r,a,{configurable:!0,enumerable:!0,get:function(){var l=new i(c);return Object.defineProperty(r,a,{configurable:!0,enumerable:!0,value:l}),l}})}s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:yo.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:yo.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:yo.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:yo.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:yo.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:yo.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:yo.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var o;try{o=null.crash()}catch{o=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:yo.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",o]})});function Hd(t){if(!(this instanceof Hd))return new Hd(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=Bc.toArray(t.entropy,t.entropyEnc||"hex"),r=Bc.toArray(t.nonce,t.nonceEnc||"hex"),n=Bc.toArray(t.pers,t.persEnc||"hex");sO(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var OZ=Hd;Hd.prototype._init=function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};Hd.prototype.generate=function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=Bc.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length"};var d3e=ua.assert;function l8(t,e){if(t instanceof l8)return t;this._importDER(t,e)||(d3e(t.r&&t.s,"Signature without r or s"),this.r=new Ht(t.r,16),this.s=new Ht(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var u8=l8;function h3e(){this.place=0}function DA(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,s=0,o=e.place;s>>=0;return i<=127?!1:(e.place=o,i)}function vj(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}l8.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=vj(r),n=vj(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];LA(i,r.length),i=i.concat(r),i.push(2),LA(i,n.length);var s=i.concat(n),o=[48];return LA(o,s.length),o=o.concat(s),ua.encode(o,e)};var p3e=function(){throw new Error("unsupported")},$Z=ua.assert;function Ja(t){if(!(this instanceof Ja))return new Ja(t);typeof t=="string"&&($Z(Object.prototype.hasOwnProperty.call(Q3,t),"Unknown curve "+t),t=Q3[t]),t instanceof Q3.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var g3e=Ja;Ja.prototype.keyPair=function(e){return new aO(this,e)};Ja.prototype.keyFromPrivate=function(e,r){return aO.fromPrivate(this,e,r)};Ja.prototype.keyFromPublic=function(e,r){return aO.fromPublic(this,e,r)};Ja.prototype.genKeyPair=function(e){e||(e={});for(var r=new OZ({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||p3e(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new Ht(2));;){var s=new Ht(r.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}};Ja.prototype._truncateToN=function(e,r){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};Ja.prototype.sign=function(e,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),e=this._truncateToN(new Ht(e,16));for(var s=this.n.byteLength(),o=r.getPrivate().toArray("be",s),a=e.toArray("be",s),c=new OZ({hash:this.hash,entropy:o,nonce:a,pers:i.pers,persEnc:i.persEnc||"utf8"}),l=this.n.sub(new Ht(1)),u=0;;u++){var f=i.k?i.k(u):new Ht(c.generate(this.n.byteLength()));if(f=this._truncateToN(f,!0),!(f.cmpn(1)<=0||f.cmp(l)>=0)){var d=this.g.mul(f);if(!d.isInfinity()){var p=d.getX(),g=p.umod(this.n);if(g.cmpn(0)!==0){var v=f.invm(this.n).mul(g.mul(r.getPrivate()).iadd(e));if(v=v.umod(this.n),v.cmpn(0)!==0){var y=(d.getY().isOdd()?1:0)|(p.cmp(g)!==0?2:0);return i.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),y^=1),new u8({r:g,s:v,recoveryParam:y})}}}}}};Ja.prototype.verify=function(e,r,n,i){e=this._truncateToN(new Ht(e,16)),n=this.keyFromPublic(n,i),r=new u8(r,"hex");var s=r.r,o=r.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a=o.invm(this.n),c=a.mul(e).umod(this.n),l=a.mul(s).umod(this.n),u;return this.curve._maxwellTrick?(u=this.g.jmulAdd(c,n.getPublic(),l),u.isInfinity()?!1:u.eqXToP(s)):(u=this.g.mulAdd(c,n.getPublic(),l),u.isInfinity()?!1:u.getX().umod(this.n).cmp(s)===0)};Ja.prototype.recoverPubKey=function(t,e,r,n){$Z((3&r)===r,"The recovery param is more than two bits"),e=new u8(e,n);var i=this.n,s=new Ht(t),o=e.r,a=e.s,c=r&1,l=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");l?o=this.curve.pointFromX(o.add(this.curve.n),c):o=this.curve.pointFromX(o,c);var u=e.r.invm(i),f=i.sub(s).mul(u).umod(i),d=a.mul(u).umod(i);return this.g.mulAdd(f,o,d)};Ja.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new u8(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(t,e,i)}catch{continue}if(s.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var m3e=Am(function(t,e){var r=e;r.version="6.5.4",r.utils=ua,r.rand=function(){throw new Error("unsupported")},r.curve=J3,r.curves=Q3,r.ec=g3e,r.eddsa=null}),v3e=m3e.ec;const y3e="signing-key/5.7.0",Xk=new Ee(y3e);let BA=null;function bl(){return BA||(BA=new v3e("secp256k1")),BA}class O0{constructor(e){Ie(this,"curve","secp256k1"),Ie(this,"privateKey",Se(e)),Vl(this.privateKey)!==32&&Xk.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=bl().keyFromPrivate(Ae(this.privateKey));Ie(this,"publicKey","0x"+r.getPublic(!1,"hex")),Ie(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),Ie(this,"_isSigningKey",!0)}_addPoint(e){const r=bl().keyFromPublic(Ae(this.publicKey)),n=bl().keyFromPublic(Ae(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const r=bl().keyFromPrivate(Ae(this.privateKey)),n=Ae(e);n.length!==32&&Xk.throwArgumentError("bad digest length","digest",e);const i=r.sign(n,{canonical:!0});return p1({recoveryParam:i.recoveryParam,r:Hr("0x"+i.r.toString(16),32),s:Hr("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const r=bl().keyFromPrivate(Ae(this.privateKey)),n=bl().keyFromPublic(Ae(cO(e)));return Hr("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function NZ(t,e){const r=p1(e),n={r:Ae(r.r),s:Ae(r.s)};return"0x"+bl().recoverPubKey(Ae(t),n,r.recoveryParam).encode("hex",!1)}function cO(t,e){const r=Ae(t);if(r.length===32){const n=new O0(r);return e?"0x"+bl().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}else{if(r.length===33)return e?Se(r):"0x"+bl().keyFromPublic(r).getPublic(!1,"hex");if(r.length===65)return e?"0x"+bl().keyFromPublic(r).getPublic(!0,"hex"):Se(r)}return Xk.throwArgumentError("invalid public or private key","key","[REDACTED]")}const b3e="transactions/5.7.0",_s=new Ee(b3e);var eI;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(eI||(eI={}));function lO(t){return t==="0x"?null:qt(t)}function xs(t){return t==="0x"?vn:we.from(t)}const w3e=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],x3e={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function Rd(t){const e=cO(t);return qt(Fn(Tt(Fn(e,1)),12))}function J0(t,e){return Rd(NZ(Ae(t),e))}function Go(t,e){const r=Bl(we.from(t).toHexString());return r.length>32&&_s.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function FA(t,e){return{address:qt(t),storageKeys:(e||[]).map((r,n)=>(Vl(r)!==32&&_s.throwArgumentError("invalid access list storageKey",`accessList[${t}:${n}]`,r),r.toLowerCase()))}}function v1(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(r.length>2&&_s.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${n}]`,r),FA(r[0],r[1])):FA(r.address,r.storageKeys));const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,s)=>(i[s]=!0,i),{});return FA(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function MZ(t){return v1(t).map(e=>[e.address,e.storageKeys])}function DZ(t,e){if(t.gasPrice!=null){const n=we.from(t.gasPrice),i=we.from(t.maxFeePerGas||0);n.eq(i)||_s.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:n,maxFeePerGas:i})}const r=[Go(t.chainId||0,"chainId"),Go(t.nonce||0,"nonce"),Go(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Go(t.maxFeePerGas||0,"maxFeePerGas"),Go(t.gasLimit||0,"gasLimit"),t.to!=null?qt(t.to):"0x",Go(t.value||0,"value"),t.data||"0x",MZ(t.accessList||[])];if(e){const n=p1(e);r.push(Go(n.recoveryParam,"recoveryParam")),r.push(Bl(n.r)),r.push(Bl(n.s))}return Hs(["0x02",G0(r)])}function LZ(t,e){const r=[Go(t.chainId||0,"chainId"),Go(t.nonce||0,"nonce"),Go(t.gasPrice||0,"gasPrice"),Go(t.gasLimit||0,"gasLimit"),t.to!=null?qt(t.to):"0x",Go(t.value||0,"value"),t.data||"0x",MZ(t.accessList||[])];if(e){const n=p1(e);r.push(Go(n.recoveryParam,"recoveryParam")),r.push(Bl(n.r)),r.push(Bl(n.s))}return Hs(["0x01",G0(r)])}function E3e(t,e){GT(t,x3e);const r=[];w3e.forEach(function(o){let a=t[o.name]||[];const c={};o.numeric&&(c.hexPad="left"),a=Ae(Se(a,c)),o.length&&a.length!==o.length&&a.length>0&&_s.throwArgumentError("invalid length for "+o.name,"transaction:"+o.name,a),o.maxLength&&(a=Bl(a),a.length>o.maxLength&&_s.throwArgumentError("invalid length for "+o.name,"transaction:"+o.name,a)),r.push(Se(a))});let n=0;if(t.chainId!=null?(n=t.chainId,typeof n!="number"&&_s.throwArgumentError("invalid transaction.chainId","transaction",t)):e&&!Zu(e)&&e.v>28&&(n=Math.floor((e.v-35)/2)),n!==0&&(r.push(Se(n)),r.push("0x"),r.push("0x")),!e)return G0(r);const i=p1(e);let s=27+i.recoveryParam;return n!==0?(r.pop(),r.pop(),r.pop(),s+=n*2+8,i.v>28&&i.v!==s&&_s.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e)):i.v!==s&&_s.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e),r.push(Se(s)),r.push(Bl(Ae(i.r))),r.push(Bl(Ae(i.s))),G0(r)}function tI(t,e){if(t.type==null||t.type===0)return t.accessList!=null&&_s.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",t),E3e(t,e);switch(t.type){case 1:return LZ(t,e);case 2:return DZ(t,e)}return _s.throwError(`unsupported transaction type: ${t.type}`,Ee.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:t.type})}function BZ(t,e,r){try{const n=xs(e[0]).toNumber();if(n!==0&&n!==1)throw new Error("bad recid");t.v=n}catch{_s.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=Hr(e[1],32),t.s=Hr(e[2],32);try{const n=Tt(r(t));t.from=J0(n,{r:t.r,s:t.s,recoveryParam:t.v})}catch{}}function _3e(t){const e=s8(t.slice(1));e.length!==9&&e.length!==12&&_s.throwArgumentError("invalid component count for transaction type: 2","payload",Se(t));const r=xs(e[2]),n=xs(e[3]),i={type:2,chainId:xs(e[0]).toNumber(),nonce:xs(e[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:xs(e[4]),to:lO(e[5]),value:xs(e[6]),data:e[7],accessList:v1(e[8])};return e.length===9||(i.hash=Tt(t),BZ(i,e.slice(9),DZ)),i}function C3e(t){const e=s8(t.slice(1));e.length!==8&&e.length!==11&&_s.throwArgumentError("invalid component count for transaction type: 1","payload",Se(t));const r={type:1,chainId:xs(e[0]).toNumber(),nonce:xs(e[1]).toNumber(),gasPrice:xs(e[2]),gasLimit:xs(e[3]),to:lO(e[4]),value:xs(e[5]),data:e[6],accessList:v1(e[7])};return e.length===8||(r.hash=Tt(t),BZ(r,e.slice(8),LZ)),r}function S3e(t){const e=s8(t);e.length!==9&&e.length!==6&&_s.throwArgumentError("invalid raw transaction","rawTransaction",t);const r={nonce:xs(e[0]).toNumber(),gasPrice:xs(e[1]),gasLimit:xs(e[2]),to:lO(e[3]),value:xs(e[4]),data:e[5],chainId:0};if(e.length===6)return r;try{r.v=we.from(e[6]).toNumber()}catch{return r}if(r.r=Hr(e[7],32),r.s=Hr(e[8],32),we.from(r.r).isZero()&&we.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let n=r.v-27;const i=e.slice(0,6);r.chainId!==0&&(i.push(Se(r.chainId)),i.push("0x"),i.push("0x"),n-=r.chainId*2+8);const s=Tt(G0(i));try{r.from=J0(s,{r:Se(r.r),s:Se(r.s),recoveryParam:n})}catch{}r.hash=Tt(t)}return r.type=null,r}function FZ(t){const e=Ae(t);if(e[0]>127)return S3e(e);switch(e[0]){case 1:return C3e(e);case 2:return _3e(e)}return _s.throwError(`unsupported transaction type: ${e[0]}`,Ee.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}const A3e="contracts/5.7.0";var Q0=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const Jn=new Ee(A3e);function p6(t,e){return Q0(this,void 0,void 0,function*(){const r=yield e;typeof r!="string"&&Jn.throwArgumentError("invalid address or ENS name","name",r);try{return qt(r)}catch{}t||Jn.throwError("a provider or signer is needed to resolve ENS names",Ee.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield t.resolveName(r);return n==null&&Jn.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n})}function Y3(t,e,r){return Q0(this,void 0,void 0,function*(){return Array.isArray(r)?yield Promise.all(r.map((n,i)=>Y3(t,Array.isArray(e)?e[i]:e[n.name],n))):r.type==="address"?yield p6(t,e):r.type==="tuple"?yield Y3(t,e,r.components):r.baseType==="array"?Array.isArray(e)?yield Promise.all(e.map(n=>Y3(t,n,r.arrayChildren))):Promise.reject(Jn.makeError("invalid value for array",Ee.errors.INVALID_ARGUMENT,{argument:"value",value:e})):e})}function f8(t,e,r){return Q0(this,void 0,void 0,function*(){let n={};r.length===e.inputs.length+1&&typeof r[r.length-1]=="object"&&(n=dn(r.pop())),Jn.checkArgumentCount(r.length,e.inputs.length,"passed to contract"),t.signer?n.from?n.from=Qr({override:p6(t.signer,n.from),signer:t.signer.getAddress()}).then(l=>Q0(this,void 0,void 0,function*(){return qt(l.signer)!==l.override&&Jn.throwError("Contract with a Signer cannot override from",Ee.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),l.override})):n.from=t.signer.getAddress():n.from&&(n.from=p6(t.provider,n.from));const i=yield Qr({args:Y3(t.signer||t.provider,r,e.inputs),address:t.resolvedAddress,overrides:Qr(n)||{}}),s=t.interface.encodeFunctionData(e,i.args),o={data:s,to:i.address},a=i.overrides;if(a.nonce!=null&&(o.nonce=we.from(a.nonce).toNumber()),a.gasLimit!=null&&(o.gasLimit=we.from(a.gasLimit)),a.gasPrice!=null&&(o.gasPrice=we.from(a.gasPrice)),a.maxFeePerGas!=null&&(o.maxFeePerGas=we.from(a.maxFeePerGas)),a.maxPriorityFeePerGas!=null&&(o.maxPriorityFeePerGas=we.from(a.maxPriorityFeePerGas)),a.from!=null&&(o.from=a.from),a.type!=null&&(o.type=a.type),a.accessList!=null&&(o.accessList=v1(a.accessList)),o.gasLimit==null&&e.gas!=null){let l=21e3;const u=Ae(s);for(let f=0;fn[l]!=null);return c.length&&Jn.throwError(`cannot override ${c.map(l=>JSON.stringify(l)).join(",")}`,Ee.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:c}),o})}function k3e(t,e){return function(...r){return f8(t,e,r)}}function I3e(t,e){const r=t.signer||t.provider;return function(...n){return Q0(this,void 0,void 0,function*(){r||Jn.throwError("estimate require a provider or signer",Ee.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield f8(t,e,n);return yield r.estimateGas(i)})}}function P3e(t,e){const r=e.wait.bind(e);e.wait=n=>r(n).then(i=>(i.events=i.logs.map(s=>{let o=ra(s),a=null;try{a=t.interface.parseLog(s)}catch{}return a&&(o.args=a.args,o.decode=(c,l)=>t.interface.decodeEventLog(a.eventFragment,c,l),o.event=a.name,o.eventSignature=a.signature),o.removeListener=()=>t.provider,o.getBlock=()=>t.provider.getBlock(i.blockHash),o.getTransaction=()=>t.provider.getTransaction(i.transactionHash),o.getTransactionReceipt=()=>Promise.resolve(i),o}),i))}function jZ(t,e,r){const n=t.signer||t.provider;return function(...i){return Q0(this,void 0,void 0,function*(){let s;if(i.length===e.inputs.length+1&&typeof i[i.length-1]=="object"){const c=dn(i.pop());c.blockTag!=null&&(s=yield c.blockTag),delete c.blockTag,i.push(c)}t.deployTransaction!=null&&(yield t._deployed(s));const o=yield f8(t,e,i),a=yield n.call(o,s);try{let c=t.interface.decodeFunctionResult(e,a);return r&&e.outputs.length===1&&(c=c[0]),c}catch(c){throw c.code===Ee.errors.CALL_EXCEPTION&&(c.address=t.address,c.args=i,c.transaction=o),c}})}}function R3e(t,e){return function(...r){return Q0(this,void 0,void 0,function*(){t.signer||Jn.throwError("sending a transaction requires a signer",Ee.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),t.deployTransaction!=null&&(yield t._deployed());const n=yield f8(t,e,r),i=yield t.signer.sendTransaction(n);return P3e(t,i),i})}}function yj(t,e,r){return e.constant?jZ(t,e,r):R3e(t,e)}function UZ(t){return t.address&&(t.topics==null||t.topics.length===0)?"*":(t.address||"*")+"@"+(t.topics?t.topics.map(e=>Array.isArray(e)?e.join("|"):e).join(":"):"")}class Fb{constructor(e,r){Ie(this,"tag",e),Ie(this,"filter",r),this._listeners=[]}addListener(e,r){this._listeners.push({listener:e,once:r})}removeListener(e){let r=!1;this._listeners=this._listeners.filter(n=>r||n.listener!==e?!0:(r=!0,!1))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map(e=>e.listener)}listenerCount(){return this._listeners.length}run(e){const r=this.listenerCount();return this._listeners=this._listeners.filter(n=>{const i=e.slice();return setTimeout(()=>{n.listener.apply(this,i)},0),!n.once}),r}prepareEvent(e){}getEmit(e){return[e]}}class T3e extends Fb{constructor(){super("error",null)}}class bj extends Fb{constructor(e,r,n,i){const s={address:e};let o=r.getEventTopic(n);i?(o!==i[0]&&Jn.throwArgumentError("topic mismatch","topics",i),s.topics=i.slice()):s.topics=[o],super(UZ(s),s),Ie(this,"address",e),Ie(this,"interface",r),Ie(this,"fragment",n)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(r,n)=>this.interface.decodeEventLog(this.fragment,r,n);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(r){e.args=null,e.decodeError=r}}getEmit(e){const r=BY(e.args);if(r.length)throw r[0].error;const n=(e.args||[]).slice();return n.push(e),n}}class wj extends Fb{constructor(e,r){super("*",{address:e}),Ie(this,"address",e),Ie(this,"interface",r)}prepareEvent(e){super.prepareEvent(e);try{const r=this.interface.parseLog(e);e.event=r.name,e.eventSignature=r.signature,e.decode=(n,i)=>this.interface.decodeEventLog(r.eventFragment,n,i),e.args=r.args}catch{}}}class O3e{constructor(e,r,n){Ie(this,"interface",Lc(new.target,"getInterface")(r)),n==null?(Ie(this,"provider",null),Ie(this,"signer",null)):zd.isSigner(n)?(Ie(this,"provider",n.provider||null),Ie(this,"signer",n)):Sf.isProvider(n)?(Ie(this,"provider",n),Ie(this,"signer",null)):Jn.throwArgumentError("invalid signer or provider","signerOrProvider",n),Ie(this,"callStatic",{}),Ie(this,"estimateGas",{}),Ie(this,"functions",{}),Ie(this,"populateTransaction",{}),Ie(this,"filters",{});{const o={};Object.keys(this.interface.events).forEach(a=>{const c=this.interface.events[a];Ie(this.filters,a,(...l)=>({address:this.address,topics:this.interface.encodeFilterTopics(c,l)})),o[c.name]||(o[c.name]=[]),o[c.name].push(a)}),Object.keys(o).forEach(a=>{const c=o[a];c.length===1?Ie(this.filters,a,this.filters[c[0]]):Jn.warn(`Duplicate definition of ${a} (${c.join(", ")})`)})}if(Ie(this,"_runningEvents",{}),Ie(this,"_wrappedEmits",{}),e==null&&Jn.throwArgumentError("invalid contract address or ENS name","addressOrName",e),Ie(this,"address",e),this.provider)Ie(this,"resolvedAddress",p6(this.provider,e));else try{Ie(this,"resolvedAddress",Promise.resolve(qt(e)))}catch{Jn.throwError("provider is required to use ENS name as contract address",Ee.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch(o=>{});const i={},s={};Object.keys(this.interface.functions).forEach(o=>{const a=this.interface.functions[o];if(s[o]){Jn.warn(`Duplicate ABI entry for ${JSON.stringify(o)}`);return}s[o]=!0;{const c=a.name;i[`%${c}`]||(i[`%${c}`]=[]),i[`%${c}`].push(o)}this[o]==null&&Ie(this,o,yj(this,a,!0)),this.functions[o]==null&&Ie(this.functions,o,yj(this,a,!1)),this.callStatic[o]==null&&Ie(this.callStatic,o,jZ(this,a,!0)),this.populateTransaction[o]==null&&Ie(this.populateTransaction,o,k3e(this,a)),this.estimateGas[o]==null&&Ie(this.estimateGas,o,I3e(this,a))}),Object.keys(i).forEach(o=>{const a=i[o];if(a.length>1)return;o=o.substring(1);const c=a[0];try{this[o]==null&&Ie(this,o,this[c])}catch{}this.functions[o]==null&&Ie(this.functions,o,this.functions[c]),this.callStatic[o]==null&&Ie(this.callStatic,o,this.callStatic[c]),this.populateTransaction[o]==null&&Ie(this.populateTransaction,o,this.populateTransaction[c]),this.estimateGas[o]==null&&Ie(this.estimateGas,o,this.estimateGas[c])})}static getContractAddress(e){return QT(e)}static getInterface(e){return fi.isInterface(e)?e:new fi(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then(()=>this):this._deployedPromise=this.provider.getCode(this.address,e).then(r=>(r==="0x"&&Jn.throwError("contract not deployed",Ee.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this))),this._deployedPromise}fallback(e){this.signer||Jn.throwError("sending a transactions require a signer",Ee.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const r=dn(e||{});return["from","to"].forEach(function(n){r[n]!=null&&Jn.throwError("cannot override "+n,Ee.errors.UNSUPPORTED_OPERATION,{operation:n})}),r.to=this.resolvedAddress,this.deployed().then(()=>this.signer.sendTransaction(r))}connect(e){typeof e=="string"&&(e=new iO(e,this.provider));const r=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&Ie(r,"deployTransaction",this.deployTransaction),r}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return f6.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if(typeof e=="string"){if(e==="error")return this._normalizeRunningEvent(new T3e);if(e==="event")return this._normalizeRunningEvent(new Fb("event",null));if(e==="*")return this._normalizeRunningEvent(new wj(this.address,this.interface));const r=this.interface.getEvent(e);return this._normalizeRunningEvent(new bj(this.address,this.interface,r))}if(e.topics&&e.topics.length>0){try{const n=e.topics[0];if(typeof n!="string")throw new Error("invalid topic");const i=this.interface.getEvent(n);return this._normalizeRunningEvent(new bj(this.address,this.interface,i,e.topics))}catch{}const r={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new Fb(UZ(r),r))}return this._normalizeRunningEvent(new wj(this.address,this.interface))}_checkRunningEvents(e){if(e.listenerCount()===0){delete this._runningEvents[e.tag];const r=this._wrappedEmits[e.tag];r&&e.filter&&(this.provider.off(e.filter,r),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,r,n){const i=ra(r);return i.removeListener=()=>{n&&(e.removeListener(n),this._checkRunningEvents(e))},i.getBlock=()=>this.provider.getBlock(r.blockHash),i.getTransaction=()=>this.provider.getTransaction(r.transactionHash),i.getTransactionReceipt=()=>this.provider.getTransactionReceipt(r.transactionHash),e.prepareEvent(i),i}_addEventListener(e,r,n){if(this.provider||Jn.throwError("events require a provider or a signer with a provider",Ee.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(r,n),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const i=s=>{let o=this._wrapEvent(e,s,r);if(o.decodeError==null)try{const a=e.getEmit(o);this.emit(e.filter,...a)}catch(a){o.decodeError=a.error}e.filter!=null&&this.emit("event",o),o.decodeError!=null&&this.emit("error",o.decodeError,o)};this._wrappedEmits[e.tag]=i,e.filter!=null&&this.provider.on(e.filter,i)}}queryFilter(e,r,n){const i=this._getRunningEvent(e),s=dn(i.filter);return typeof r=="string"&&Vt(r,32)?(n!=null&&Jn.throwArgumentError("cannot specify toBlock with blockhash","toBlock",n),s.blockHash=r):(s.fromBlock=r??0,s.toBlock=n??"latest"),this.provider.getLogs(s).then(o=>o.map(a=>this._wrapEvent(i,a,null)))}on(e,r){return this._addEventListener(this._getRunningEvent(e),r,!1),this}once(e,r){return this._addEventListener(this._getRunningEvent(e),r,!0),this}emit(e,...r){if(!this.provider)return!1;const n=this._getRunningEvent(e),i=n.run(r)>0;return this._checkRunningEvents(n),i}listenerCount(e){return this.provider?e==null?Object.keys(this._runningEvents).reduce((r,n)=>r+this._runningEvents[n].listenerCount(),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(e==null){const r=[];for(let n in this._runningEvents)this._runningEvents[n].listeners().forEach(i=>{r.push(i)});return r}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(e==null){for(const n in this._runningEvents){const i=this._runningEvents[n];i.removeAllListeners(),this._checkRunningEvents(i)}return this}const r=this._getRunningEvent(e);return r.removeAllListeners(),this._checkRunningEvents(r),this}off(e,r){if(!this.provider)return this;const n=this._getRunningEvent(e);return n.removeListener(r),this._checkRunningEvents(n),this}removeListener(e,r){return this.off(e,r)}}class km extends O3e{}class zZ{constructor(e){Ie(this,"alphabet",e),Ie(this,"base",e.length),Ie(this,"_alphabetMap",{}),Ie(this,"_leader",e.charAt(0));for(let r=0;r0;)n.push(o%this.base),o=o/this.base|0}let i="";for(let s=0;r[s]===0&&s=0;--s)i+=this.alphabet[n[s]];return i}decode(e){if(typeof e!="string")throw new TypeError("Expected String");let r=[];if(e.length===0)return new Uint8Array(r);r.push(0);for(let n=0;n>=8;for(;s>0;)r.push(s&255),s>>=8}for(let n=0;e[n]===this._leader&&n>24&255,c[e.length+1]=f>>16&255,c[e.length+2]=f>>8&255,c[e.length+3]=f&255;let d=Ae(jb(i,t,c));s||(s=d.length,u=new Uint8Array(s),o=Math.ceil(n/s),l=n-(o-1)*s),u.set(d);for(let v=1;v=256)throw new Error("Depth too large!");return _j(zr([this.privateKey!=null?"0x0488ADE4":"0x0488B21E",Se(this.depth),this.parentFingerprint,Hr(Se(this.index),4),this.chainCode,this.privateKey!=null?zr(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new Ko(ip,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let r=this.path;r&&(r+="/"+(e&~Ip));const n=new Uint8Array(37);if(e&Ip){if(!this.privateKey)throw new Error("cannot derive child of neutered node");n.set(Ae(this.privateKey),1),r&&(r+="'")}else n.set(Ae(this.publicKey));for(let f=24;f>=0;f-=8)n[33+(f>>3)]=e>>24-f&255;const i=Ae(jb(Wg.sha512,this.chainCode,n)),s=i.slice(0,32),o=i.slice(32);let a=null,c=null;this.privateKey?a=T5(we.from(s).add(this.privateKey).mod(U3e)):c=new O0(Se(s))._addPoint(this.publicKey);let l=r;const u=this.mnemonic;return u&&(l=Object.freeze({phrase:u.phrase,path:r,locale:u.locale||"en"})),new Ko(ip,a,c,this.fingerprint,T5(o),e,this.depth+1,l)}derivePath(e){const r=e.split("/");if(r.length===0||r[0]==="m"&&this.depth!==0)throw new Error("invalid path - "+e);r[0]==="m"&&r.shift();let n=this;for(let i=0;i=Ip)throw new Error("invalid path index - "+s);n=n._derive(Ip+o)}else if(s.match(/^[0-9]+$/)){const o=parseInt(s);if(o>=Ip)throw new Error("invalid path index - "+s);n=n._derive(o)}else throw new Error("invalid path component - "+s)}return n}static _fromSeed(e,r){const n=Ae(e);if(n.length<16||n.length>64)throw new Error("invalid seed");const i=Ae(jb(Wg.sha512,z3e,n));return new Ko(ip,T5(i.slice(0,32)),null,"0x00000000",T5(i.slice(32)),0,0,r)}static fromMnemonic(e,r,n){return n=fO(n),e=h8(d8(e,n),n),Ko._fromSeed(VZ(e,r),{phrase:e,path:"m",locale:n.locale})}static fromSeed(e){return Ko._fromSeed(e,null)}static fromExtendedKey(e){const r=qg.decode(e);(r.length!==82||_j(r.slice(0,78))!==e)&&Ub.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const n=r[4],i=Se(r.slice(5,9)),s=parseInt(Se(r.slice(9,13)).substring(2),16),o=Se(r.slice(13,45)),a=r.slice(45,78);switch(Se(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new Ko(ip,null,Se(a),i,o,s,n,null);case"0x0488ade4":case"0x04358394 ":if(a[0]!==0)break;return new Ko(ip,Se(a.slice(1)),null,i,o,s,n,null)}return Ub.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function VZ(t,e){e||(e="");const r=qr("mnemonic"+e,Gl.NFKD);return uO(qr(t,Gl.NFKD),r,2048,64,"sha512")}function d8(t,e){e=fO(e),Ub.checkNormalize();const r=e.split(t);if(r.length%3!==0)throw new Error("invalid mnemonic");const n=Ae(new Uint8Array(Math.ceil(11*r.length/8)));let i=0;for(let l=0;l>3]|=1<<7-i%8),i++}const s=32*r.length/3,o=r.length/3,a=WZ(o);if((Ae(tf(n.slice(0,s/8)))[0]&a)!==(n[n.length-1]&a))throw new Error("invalid checksum");return Se(n.slice(0,s/8))}function h8(t,e){if(e=fO(e),t=Ae(t),t.length%4!==0||t.length<16||t.length>32)throw new Error("invalid entropy");const r=[0];let n=11;for(let o=0;o8?(r[r.length-1]<<=8,r[r.length-1]|=t[o],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=t[o]>>8-n,r.push(t[o]&H3e(8-n)),n+=3);const i=t.length/4,s=Ae(tf(t))[0]&WZ(i);return r[r.length-1]<<=i,r[r.length-1]|=s>>8-i,e.join(r.map(o=>e.getWord(o)))}function q3e(t,e){try{return d8(t,e),!0}catch{}return!1}function W3e(t){return(typeof t!="number"||t<0||t>=Ip||t%1)&&Ub.throwArgumentError("invalid account index","index",t),`m/44'/60'/${t}'/0/0`}const V3e="random/5.7.0",rI=new Ee(V3e);function G3e(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}const Cj=G3e();let Z3=Cj.crypto||Cj.msCrypto;(!Z3||!Z3.getRandomValues)&&(rI.warn("WARNING: Missing strong random number source"),Z3={getRandomValues:function(t){return rI.throwError("no secure random source avaialble",Ee.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});function Pl(t){(t<=0||t>1024||t%1||t!=t)&&rI.throwArgumentError("invalid length","length",t);const e=new Uint8Array(t);return Z3.getRandomValues(e),Ae(e)}function GZ(t){t=t.slice();for(let e=t.length-1;e>0;e--){const r=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[r],t[r]=n}return t}var KZ={exports:{}};(function(t,e){(function(r){function n(N){return parseInt(N)===N}function i(N){if(!n(N.length))return!1;for(var I=0;I255)return!1;return!0}function s(N,I){if(N.buffer&&ArrayBuffer.isView(N)&&N.name==="Uint8Array")return I&&(N.slice?N=N.slice():N=Array.prototype.slice.call(N)),N;if(Array.isArray(N)){if(!i(N))throw new Error("Array contains invalid value: "+N);return new Uint8Array(N)}if(n(N.length)&&i(N))return new Uint8Array(N);throw new Error("unsupported array-like object")}function o(N){return new Uint8Array(N)}function a(N,I,U,re,M){(re!=null||M!=null)&&(N.slice?N=N.slice(re,M):N=Array.prototype.slice.call(N,re,M)),I.set(N,U)}var c=function(){function N(U){var re=[],M=0;for(U=encodeURI(U);M191&&G<224?(re.push(String.fromCharCode((G&31)<<6|U[M+1]&63)),M+=2):(re.push(String.fromCharCode((G&15)<<12|(U[M+1]&63)<<6|U[M+2]&63)),M+=3)}return re.join("")}return{toBytes:N,fromBytes:I}}(),l=function(){function N(re){for(var M=[],G=0;G>4]+I[H&15])}return M.join("")}return{toBytes:N,fromBytes:U}}(),u={16:10,24:12,32:14},f=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],d=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],p=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],g=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],v=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],y=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],b=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],w=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],E=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],C=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],S=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],P=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],_=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],T=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],Q=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function Z(N){for(var I=[],U=0;U>2,this._Ke[G][I%4]=M[I],this._Kd[N-G][I%4]=M[I];for(var H=0,J=re,X;J>16&255]<<24^d[X>>8&255]<<16^d[X&255]<<8^d[X>>24&255]^f[H]<<24,H+=1,re!=8)for(var I=1;I>8&255]<<8^d[X>>16&255]<<16^d[X>>24&255]<<24;for(var I=re/2+1;I>2,F=J%4,this._Ke[D][F]=M[I],this._Kd[N-D][F]=M[I++],J++}for(var D=1;D>24&255]^_[X>>16&255]^T[X>>8&255]^Q[X&255]},ne.prototype.encrypt=function(N){if(N.length!=16)throw new Error("invalid plaintext size (must be 16 bytes)");for(var I=this._Ke.length-1,U=[0,0,0,0],re=Z(N),M=0;M<4;M++)re[M]^=this._Ke[0][M];for(var G=1;G>24&255]^v[re[(M+1)%4]>>16&255]^y[re[(M+2)%4]>>8&255]^b[re[(M+3)%4]&255]^this._Ke[G][M];re=U.slice()}for(var H=o(16),J,M=0;M<4;M++)J=this._Ke[I][M],H[4*M]=(d[re[M]>>24&255]^J>>24)&255,H[4*M+1]=(d[re[(M+1)%4]>>16&255]^J>>16)&255,H[4*M+2]=(d[re[(M+2)%4]>>8&255]^J>>8)&255,H[4*M+3]=(d[re[(M+3)%4]&255]^J)&255;return H},ne.prototype.decrypt=function(N){if(N.length!=16)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var I=this._Kd.length-1,U=[0,0,0,0],re=Z(N),M=0;M<4;M++)re[M]^=this._Kd[0][M];for(var G=1;G>24&255]^E[re[(M+3)%4]>>16&255]^C[re[(M+2)%4]>>8&255]^S[re[(M+1)%4]&255]^this._Kd[G][M];re=U.slice()}for(var H=o(16),J,M=0;M<4;M++)J=this._Kd[I][M],H[4*M]=(p[re[M]>>24&255]^J>>24)&255,H[4*M+1]=(p[re[(M+3)%4]>>16&255]^J>>16)&255,H[4*M+2]=(p[re[(M+2)%4]>>8&255]^J>>8)&255,H[4*M+3]=(p[re[(M+1)%4]&255]^J)&255;return H};var ce=function(N){if(!(this instanceof ce))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new ne(N)};ce.prototype.encrypt=function(N){if(N=s(N),N.length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var I=o(N.length),U=o(16),re=0;re=0;--I)this._counter[I]=N%256,N=N>>8},B.prototype.setBytes=function(N){if(N=s(N,!0),N.length!=16)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=N},B.prototype.increment=function(){for(var N=15;N>=0;N--)if(this._counter[N]===255)this._counter[N]=0;else{this._counter[N]++;break}};var z=function(N,I){if(!(this instanceof z))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",I instanceof B||(I=new B(I)),this._counter=I,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new ne(N)};z.prototype.encrypt=function(N){for(var I=s(N,!0),U=0;U16)throw new Error("PKCS#7 padding byte out of range");for(var U=N.length-I,re=0;re=64;){let q=b,N=w,I=E,U=C,re=S,M=P,G=_,H=T,J,X,D,F,Y;for(X=0;X<16;X++)D=R+X*4,Q[X]=(z[D]&255)<<24|(z[D+1]&255)<<16|(z[D+2]&255)<<8|z[D+3]&255;for(X=16;X<64;X++)J=Q[X-2],F=(J>>>17|J<<32-17)^(J>>>19|J<<32-19)^J>>>10,J=Q[X-15],Y=(J>>>7|J<<32-7)^(J>>>18|J<<32-18)^J>>>3,Q[X]=(F+Q[X-7]|0)+(Y+Q[X-16]|0)|0;for(X=0;X<64;X++)F=(((re>>>6|re<<32-6)^(re>>>11|re<<32-11)^(re>>>25|re<<32-25))+(re&M^~re&G)|0)+(H+(y[X]+Q[X]|0)|0)|0,Y=((q>>>2|q<<32-2)^(q>>>13|q<<32-13)^(q>>>22|q<<32-22))+(q&N^q&I^N&I)|0,H=G,G=M,M=re,re=U+F|0,U=I,I=N,N=q,q=F+Y|0;b=b+q|0,w=w+N|0,E=E+I|0,C=C+U|0,S=S+re|0,P=P+M|0,_=_+G|0,T=T+H|0,R+=64,L-=64}}Z(v);let ne,ce=v.length%64,K=v.length/536870912|0,x=v.length<<3,A=ce<56?56:120,B=v.slice(v.length-ce,v.length);for(B.push(128),ne=ce+1;ne>>24&255),B.push(K>>>16&255),B.push(K>>>8&255),B.push(K>>>0&255),B.push(x>>>24&255),B.push(x>>>16&255),B.push(x>>>8&255),B.push(x>>>0&255),Z(B),[b>>>24&255,b>>>16&255,b>>>8&255,b>>>0&255,w>>>24&255,w>>>16&255,w>>>8&255,w>>>0&255,E>>>24&255,E>>>16&255,E>>>8&255,E>>>0&255,C>>>24&255,C>>>16&255,C>>>8&255,C>>>0&255,S>>>24&255,S>>>16&255,S>>>8&255,S>>>0&255,P>>>24&255,P>>>16&255,P>>>8&255,P>>>0&255,_>>>24&255,_>>>16&255,_>>>8&255,_>>>0&255,T>>>24&255,T>>>16&255,T>>>8&255,T>>>0&255]}function s(v,y,b){v=v.length<=64?v:i(v);const w=64+y.length+4,E=new Array(w),C=new Array(64);let S,P=[];for(S=0;S<64;S++)E[S]=54;for(S=0;S=w-4;T--){if(E[T]++,E[T]<=255)return;E[T]=0}}for(;b>=32;)_(),P=P.concat(i(C.concat(i(E)))),b-=32;return b>0&&(_(),P=P.concat(i(C.concat(i(E))).slice(0,b))),P}function o(v,y,b,w,E){let C;for(u(v,(2*b-1)*16,E,0,16),C=0;C<2*b;C++)l(v,C*16,E,16),c(E,w),u(E,0,v,y+C*16,16);for(C=0;C>>32-y}function c(v,y){u(v,0,y,0,16);for(let b=8;b>0;b-=2)y[4]^=a(y[0]+y[12],7),y[8]^=a(y[4]+y[0],9),y[12]^=a(y[8]+y[4],13),y[0]^=a(y[12]+y[8],18),y[9]^=a(y[5]+y[1],7),y[13]^=a(y[9]+y[5],9),y[1]^=a(y[13]+y[9],13),y[5]^=a(y[1]+y[13],18),y[14]^=a(y[10]+y[6],7),y[2]^=a(y[14]+y[10],9),y[6]^=a(y[2]+y[14],13),y[10]^=a(y[6]+y[2],18),y[3]^=a(y[15]+y[11],7),y[7]^=a(y[3]+y[15],9),y[11]^=a(y[7]+y[3],13),y[15]^=a(y[11]+y[7],18),y[1]^=a(y[0]+y[3],7),y[2]^=a(y[1]+y[0],9),y[3]^=a(y[2]+y[1],13),y[0]^=a(y[3]+y[2],18),y[6]^=a(y[5]+y[4],7),y[7]^=a(y[6]+y[5],9),y[4]^=a(y[7]+y[6],13),y[5]^=a(y[4]+y[7],18),y[11]^=a(y[10]+y[9],7),y[8]^=a(y[11]+y[10],9),y[9]^=a(y[8]+y[11],13),y[10]^=a(y[9]+y[8],18),y[12]^=a(y[15]+y[14],7),y[13]^=a(y[12]+y[15],9),y[14]^=a(y[13]+y[12],13),y[15]^=a(y[14]+y[13],18);for(let b=0;b<16;++b)v[b]+=y[b]}function l(v,y,b,w){for(let E=0;E=256)return!1}return!0}function d(v,y){if(typeof v!="number"||v%1)throw new Error("invalid "+y);return v}function p(v,y,b,w,E,C,S){if(b=d(b,"N"),w=d(w,"r"),E=d(E,"p"),C=d(C,"dkLen"),b===0||b&b-1)throw new Error("N must be power of 2");if(b>2147483647/128/w)throw new Error("N too large");if(w>2147483647/128/E)throw new Error("r too large");if(!f(v))throw new Error("password must be an array or buffer");if(v=Array.prototype.slice.call(v),!f(y))throw new Error("salt must be an array or buffer");y=Array.prototype.slice.call(y);let P=s(v,y,E*128*w);const _=new Uint32Array(E*32*w);for(let re=0;re<_.length;re++){const M=re*4;_[re]=(P[M+3]&255)<<24|(P[M+2]&255)<<16|(P[M+1]&255)<<8|(P[M+0]&255)<<0}const T=new Uint32Array(64*w),Q=new Uint32Array(32*w*b),Z=32*w,ne=new Uint32Array(16),ce=new Uint32Array(16),K=E*b*2;let x=0,A=null,B=!1,z=0,R=0,L,q;const N=S?parseInt(1e3/w):4294967295,I=typeof setImmediate<"u"?setImmediate:setTimeout,U=function(){if(B)return S(new Error("cancelled"),x/K);let re;switch(z){case 0:q=R*32*w,u(_,q,T,0,Z),z=1,L=0;case 1:re=b-L,re>N&&(re=N);for(let G=0;GN&&(re=N);for(let G=0;G>0&255),P.push(_[G]>>8&255),P.push(_[G]>>16&255),P.push(_[G]>>24&255);const M=s(v,P,C);return S&&S(null,1,M),M}S&&I(U)};if(!S)for(;;){const re=U();if(re!=null)return re}U()}const g={scrypt:function(v,y,b,w,E,C,S){return new Promise(function(P,_){let T=0;S&&S(0),p(v,y,b,w,E,C,function(Q,Z,ne){if(Q)_(Q);else if(ne)S&&T!==1&&S(1),P(new Uint8Array(ne));else if(S&&Z!==T)return T=Z,S(Z)})})},syncScrypt:function(v,y,b,w,E,C){return new Uint8Array(p(v,y,b,w,E,C))}};t.exports=g})()})(YZ);var X3e=YZ.exports;const gO=rs(X3e);var eEe=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const nI=new Ee(JZ);function Sj(t){return t!=null&&t.mnemonic&&t.mnemonic.phrase}class tEe extends g1{isKeystoreAccount(e){return!!(e&&e._isKeystoreAccount)}}function rEe(t,e,r){if(Qn(t,"crypto/cipher")==="aes-128-ctr"){const i=$0(Qn(t,"crypto/cipherparams/iv")),s=new Rl.Counter(i),o=new Rl.ModeOfOperation.ctr(e,s);return Ae(o.decrypt(r))}return null}function ZZ(t,e){const r=$0(Qn(t,"crypto/ciphertext"));if(Se(Tt(zr([e.slice(16,32),r]))).substring(2)!==Qn(t,"crypto/mac").toLowerCase())throw new Error("invalid password");const i=rEe(t,e.slice(0,16),r);i||nI.throwError("unsupported cipher",Ee.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});const s=e.slice(32,64),o=Rd(i);if(t.address){let c=t.address.toLowerCase();if(c.substring(0,2)!=="0x"&&(c="0x"+c),qt(c)!==o)throw new Error("address mismatch")}const a={_isKeystoreAccount:!0,address:o,privateKey:Se(i)};if(Qn(t,"x-ethers/version")==="0.1"){const c=$0(Qn(t,"x-ethers/mnemonicCiphertext")),l=$0(Qn(t,"x-ethers/mnemonicCounter")),u=new Rl.Counter(l),f=new Rl.ModeOfOperation.ctr(s,u),d=Qn(t,"x-ethers/path")||Vg,p=Qn(t,"x-ethers/locale")||"en",g=Ae(f.decrypt(c));try{const v=h8(g,p),y=Ko.fromMnemonic(v,null,p).derivePath(d);if(y.privateKey!=a.privateKey)throw new Error("mnemonic mismatch");a.mnemonic=y.mnemonic}catch(v){if(v.code!==Ee.errors.INVALID_ARGUMENT||v.argument!=="wordlist")throw v}}return new tEe(a)}function XZ(t,e,r,n,i){return Ae(uO(t,e,r,n,i))}function nEe(t,e,r,n,i){return Promise.resolve(XZ(t,e,r,n,i))}function eX(t,e,r,n,i){const s=dO(e),o=Qn(t,"crypto/kdf");if(o&&typeof o=="string"){const a=function(c,l){return nI.throwArgumentError("invalid key-derivation function parameters",c,l)};if(o.toLowerCase()==="scrypt"){const c=$0(Qn(t,"crypto/kdfparams/salt")),l=parseInt(Qn(t,"crypto/kdfparams/n")),u=parseInt(Qn(t,"crypto/kdfparams/r")),f=parseInt(Qn(t,"crypto/kdfparams/p"));(!l||!u||!f)&&a("kdf",o),l&l-1&&a("N",l);const d=parseInt(Qn(t,"crypto/kdfparams/dklen"));return d!==32&&a("dklen",d),n(s,c,l,u,f,64,i)}else if(o.toLowerCase()==="pbkdf2"){const c=$0(Qn(t,"crypto/kdfparams/salt"));let l=null;const u=Qn(t,"crypto/kdfparams/prf");u==="hmac-sha256"?l="sha256":u==="hmac-sha512"?l="sha512":a("prf",u);const f=parseInt(Qn(t,"crypto/kdfparams/c")),d=parseInt(Qn(t,"crypto/kdfparams/dklen"));return d!==32&&a("dklen",d),r(s,c,f,d,l)}}return nI.throwArgumentError("unsupported key-derivation function","kdf",o)}function iEe(t,e){const r=JSON.parse(t),n=eX(r,e,XZ,gO.syncScrypt);return ZZ(r,n)}function sEe(t,e,r){return eEe(this,void 0,void 0,function*(){const n=JSON.parse(t),i=yield eX(n,e,nEe,gO.scrypt,r);return ZZ(n,i)})}function oEe(t,e,r,n){try{if(qt(t.address)!==Rd(t.privateKey))throw new Error("address/privateKey mismatch");if(Sj(t)){const y=t.mnemonic;if(Ko.fromMnemonic(y.phrase,null,y.locale).derivePath(y.path||Vg).privateKey!=t.privateKey)throw new Error("mnemonic mismatch")}}catch(y){return Promise.reject(y)}typeof r=="function"&&!n&&(n=r,r={}),r||(r={});const i=Ae(t.privateKey),s=dO(e);let o=null,a=null,c=null;if(Sj(t)){const y=t.mnemonic;o=Ae(d8(y.phrase,y.locale||"en")),a=y.path||Vg,c=y.locale||"en"}let l=r.client;l||(l="ethers.js");let u=null;r.salt?u=Ae(r.salt):u=Pl(32);let f=null;if(r.iv){if(f=Ae(r.iv),f.length!==16)throw new Error("invalid iv")}else f=Pl(16);let d=null;if(r.uuid){if(d=Ae(r.uuid),d.length!==16)throw new Error("invalid uuid")}else d=Pl(16);let p=1<<17,g=8,v=1;return r.scrypt&&(r.scrypt.N&&(p=r.scrypt.N),r.scrypt.r&&(g=r.scrypt.r),r.scrypt.p&&(v=r.scrypt.p)),gO.scrypt(s,u,p,g,v,64,n).then(y=>{y=Ae(y);const b=y.slice(0,16),w=y.slice(16,32),E=y.slice(32,64),C=new Rl.Counter(f),S=new Rl.ModeOfOperation.ctr(b,C),P=Ae(S.encrypt(i)),_=Tt(zr([w,P])),T={address:t.address.substring(2).toLowerCase(),id:J3e(d),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:Se(f).substring(2)},ciphertext:Se(P).substring(2),kdf:"scrypt",kdfparams:{salt:Se(u).substring(2),n:p,dklen:32,p:v,r:g},mac:_.substring(2)}};if(o){const Q=Pl(16),Z=new Rl.Counter(Q),ne=new Rl.ModeOfOperation.ctr(E,Z),ce=Ae(ne.encrypt(o)),K=new Date,x=K.getUTCFullYear()+"-"+zv(K.getUTCMonth()+1,2)+"-"+zv(K.getUTCDate(),2)+"T"+zv(K.getUTCHours(),2)+"-"+zv(K.getUTCMinutes(),2)+"-"+zv(K.getUTCSeconds(),2)+".0Z";T["x-ethers"]={client:l,gethFilename:"UTC--"+x+"--"+T.address,mnemonicCounter:Se(Q).substring(2),mnemonicCiphertext:Se(ce).substring(2),path:a,locale:c,version:"0.1"}}return JSON.stringify(T)})}function aEe(t,e,r){if(hO(t)){r&&r(0);const n=QZ(t,e);return r&&r(1),Promise.resolve(n)}return pO(t)?sEe(t,e,r):Promise.reject(new Error("invalid JSON wallet"))}function cEe(t,e){if(hO(t))return QZ(t,e);if(pO(t))return iEe(t,e);throw new Error("invalid JSON wallet")}const lEe="wallet/5.7.0";var Aj=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const sp=new Ee(lEe);function uEe(t){return t!=null&&Vt(t.privateKey,32)&&t.address!=null}function fEe(t){const e=t.mnemonic;return e&&e.phrase}let dEe=class Pp extends zd{constructor(e,r){if(super(),uEe(e)){const n=new O0(e.privateKey);if(Ie(this,"_signingKey",()=>n),Ie(this,"address",Rd(this.publicKey)),this.address!==qt(e.address)&&sp.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),fEe(e)){const i=e.mnemonic;Ie(this,"_mnemonic",()=>({phrase:i.phrase,path:i.path||Vg,locale:i.locale||"en"}));const s=this.mnemonic,o=Ko.fromMnemonic(s.phrase,null,s.locale).derivePath(s.path);Rd(o.privateKey)!==this.address&&sp.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else Ie(this,"_mnemonic",()=>null)}else{if(O0.isSigningKey(e))e.curve!=="secp256k1"&&sp.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),Ie(this,"_signingKey",()=>e);else{typeof e=="string"&&e.match(/^[0-9a-f]*$/i)&&e.length===64&&(e="0x"+e);const n=new O0(e);Ie(this,"_signingKey",()=>n)}Ie(this,"_mnemonic",()=>null),Ie(this,"address",Rd(this.publicKey))}r&&!Sf.isProvider(r)&&sp.throwArgumentError("invalid provider","provider",r),Ie(this,"provider",r||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new Pp(this,e)}signTransaction(e){return Qr(e).then(r=>{r.from!=null&&(qt(r.from)!==this.address&&sp.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete r.from);const n=this._signingKey().signDigest(Tt(tI(r)));return tI(r,n)})}signMessage(e){return Aj(this,void 0,void 0,function*(){return Vk(this._signingKey().signDigest(a8(e)))})}_signTypedData(e,r,n){return Aj(this,void 0,void 0,function*(){const i=yield oi.resolveNames(e,r,n,s=>(this.provider==null&&sp.throwError("cannot resolve ENS names without a provider",Ee.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:s}),this.provider.resolveName(s)));return Vk(this._signingKey().signDigest(oi.hash(i.domain,r,i.value)))})}encrypt(e,r,n){if(typeof r=="function"&&!n&&(n=r,r={}),n&&typeof n!="function")throw new Error("invalid callback");return r||(r={}),oEe(this,e,r,n)}static createRandom(e){let r=Pl(16);e||(e={}),e.extraEntropy&&(r=Ae(Fn(Tt(zr([r,e.extraEntropy])),0,16)));const n=h8(r,e.locale);return Pp.fromMnemonic(n,e.path,e.locale)}static fromEncryptedJson(e,r,n){return aEe(e,r,n).then(i=>new Pp(i))}static fromEncryptedJsonSync(e,r){return new Pp(cEe(e,r))}static fromMnemonic(e,r,n){return r||(r=Vg),new Pp(Ko.fromMnemonic(e,null,n).derivePath(r))}};function tX(t,e){return J0(a8(t),e)}function hEe(t,e,r,n){return J0(oi.hash(t,e,r),n)}const pEe="networks/5.7.1",kj=new Ee(pEe);function gEe(t){return t&&typeof t.renetwork=="function"}function Ru(t){const e=function(r,n){n==null&&(n={});const i=[];if(r.InfuraProvider&&n.infura!=="-")try{i.push(new r.InfuraProvider(t,n.infura))}catch{}if(r.EtherscanProvider&&n.etherscan!=="-")try{i.push(new r.EtherscanProvider(t,n.etherscan))}catch{}if(r.AlchemyProvider&&n.alchemy!=="-")try{i.push(new r.AlchemyProvider(t,n.alchemy))}catch{}if(r.PocketProvider&&n.pocket!=="-"){const s=["goerli","ropsten","rinkeby","sepolia"];try{const o=new r.PocketProvider(t,n.pocket);o.network&&s.indexOf(o.network.name)===-1&&i.push(o)}catch{}}if(r.CloudflareProvider&&n.cloudflare!=="-")try{i.push(new r.CloudflareProvider(t))}catch{}if(r.AnkrProvider&&n.ankr!=="-")try{const s=["ropsten"],o=new r.AnkrProvider(t,n.ankr);o.network&&s.indexOf(o.network.name)===-1&&i.push(o)}catch{}if(i.length===0)return null;if(r.FallbackProvider){let s=1;return n.quorum!=null?s=n.quorum:t==="homestead"&&(s=2),new r.FallbackProvider(i,s)}return i[0]};return e.renetwork=function(r){return Ru(r)},e}function g6(t,e){const r=function(n,i){return n.JsonRpcProvider?new n.JsonRpcProvider(t,e):null};return r.renetwork=function(n){return g6(t,n)},r}const Ij={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:Ru("homestead")},Pj={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:Ru("ropsten")},Rj={chainId:63,name:"classicMordor",_defaultProvider:g6("https://www.ethercluster.com/mordor","classicMordor")},O5={unspecified:{chainId:0,name:"unspecified"},homestead:Ij,mainnet:Ij,morden:{chainId:2,name:"morden"},ropsten:Pj,testnet:Pj,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:Ru("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:Ru("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:Ru("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:Ru("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:g6("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:Rj,classicTestnet:Rj,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:g6("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:Ru("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:Ru("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function mEe(t){if(t==null)return null;if(typeof t=="number"){for(const n in O5){const i=O5[n];if(i.chainId===t)return{name:i.name,chainId:i.chainId,ensAddress:i.ensAddress||null,_defaultProvider:i._defaultProvider||null}}return{chainId:t,name:"unknown"}}if(typeof t=="string"){const n=O5[t];return n==null?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}const e=O5[t.name];if(!e)return typeof t.chainId!="number"&&kj.throwArgumentError("invalid network chainId","network",t),t;t.chainId!==0&&t.chainId!==e.chainId&&kj.throwArgumentError("network chainId mismatch","network",t);let r=t._defaultProvider||null;return r==null&&e._defaultProvider&&(gEe(e._defaultProvider)?r=e._defaultProvider.renetwork(t):r=e._defaultProvider),{name:t.name,chainId:e.chainId,ensAddress:t.ensAddress||e.ensAddress||null,_defaultProvider:r}}const vEe="web/5.7.1";var yEe=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};function bEe(t,e){return yEe(this,void 0,void 0,function*(){e==null&&(e={});const r={method:e.method||"GET",headers:e.headers||{},body:e.body||void 0};if(e.skipFetchSetup!==!0&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),e.fetchOptions!=null){const o=e.fetchOptions;o.mode&&(r.mode=o.mode),o.cache&&(r.cache=o.cache),o.credentials&&(r.credentials=o.credentials),o.redirect&&(r.redirect=o.redirect),o.referrer&&(r.referrer=o.referrer)}const n=yield fetch(t,r),i=yield n.arrayBuffer(),s={};return n.headers.forEach?n.headers.forEach((o,a)=>{s[a.toLowerCase()]=o}):n.headers.keys().forEach(o=>{s[o.toLowerCase()]=n.headers.get(o)}),{headers:s,statusCode:n.status,statusMessage:n.statusText,body:Ae(new Uint8Array(i))}})}var wEe=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const _c=new Ee(vEe);function Tj(t){return new Promise(e=>{setTimeout(e,t)})}function Gf(t,e){if(t==null)return null;if(typeof t=="string")return t;if(Zu(t)){if(e&&(e.split("/")[0]==="text"||e.split(";")[0].trim()==="application/json"))try{return Cf(t)}catch{}return Se(t)}return t}function xEe(t){return qr(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function rX(t,e,r){const n=typeof t=="object"&&t.throttleLimit!=null?t.throttleLimit:12;_c.assertArgument(n>0&&n%1===0,"invalid connection throttle limit","connection.throttleLimit",n);const i=typeof t=="object"?t.throttleCallback:null,s=typeof t=="object"&&typeof t.throttleSlotInterval=="number"?t.throttleSlotInterval:100;_c.assertArgument(s>0&&s%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",s);const o=typeof t=="object"?!!t.errorPassThrough:!1,a={};let c=null;const l={method:"GET"};let u=!1,f=2*60*1e3;if(typeof t=="string")c=t;else if(typeof t=="object"){if((t==null||t.url==null)&&_c.throwArgumentError("missing URL","connection.url",t),c=t.url,typeof t.timeout=="number"&&t.timeout>0&&(f=t.timeout),t.headers)for(const b in t.headers)a[b.toLowerCase()]={key:b,value:String(t.headers[b])},["if-none-match","if-modified-since"].indexOf(b.toLowerCase())>=0&&(u=!0);if(l.allowGzip=!!t.allowGzip,t.user!=null&&t.password!=null){c.substring(0,6)!=="https:"&&t.allowInsecureAuthentication!==!0&&_c.throwError("basic authentication requires a secure https url",Ee.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:t.user,password:"[REDACTED]"});const b=t.user+":"+t.password;a.authorization={key:"Authorization",value:"Basic "+rO(qr(b))}}t.skipFetchSetup!=null&&(l.skipFetchSetup=!!t.skipFetchSetup),t.fetchOptions!=null&&(l.fetchOptions=dn(t.fetchOptions))}const d=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),p=c?c.match(d):null;if(p)try{const b={statusCode:200,statusMessage:"OK",headers:{"content-type":p[1]||"text/plain"},body:p[2]?tO(p[3]):xEe(p[3])};let w=b.body;return r&&(w=r(b.body,b)),Promise.resolve(w)}catch(b){_c.throwError("processing response error",Ee.errors.SERVER_ERROR,{body:Gf(p[1],p[2]),error:b,requestBody:null,requestMethod:"GET",url:c})}e&&(l.method="POST",l.body=e,a["content-type"]==null&&(a["content-type"]={key:"Content-Type",value:"application/octet-stream"}),a["content-length"]==null&&(a["content-length"]={key:"Content-Length",value:String(e.length)}));const g={};Object.keys(a).forEach(b=>{const w=a[b];g[w.key]=w.value}),l.headers=g;const v=function(){let b=null;return{promise:new Promise(function(C,S){f&&(b=setTimeout(()=>{b!=null&&(b=null,S(_c.makeError("timeout",Ee.errors.TIMEOUT,{requestBody:Gf(l.body,g["content-type"]),requestMethod:l.method,timeout:f,url:c})))},f))}),cancel:function(){b!=null&&(clearTimeout(b),b=null)}}}(),y=function(){return wEe(this,void 0,void 0,function*(){for(let b=0;b=300)&&(v.cancel(),_c.throwError("bad response",Ee.errors.SERVER_ERROR,{status:w.statusCode,headers:w.headers,body:Gf(E,w.headers?w.headers["content-type"]:null),requestBody:Gf(l.body,g["content-type"]),requestMethod:l.method,url:c})),r)try{const C=yield r(E,w);return v.cancel(),C}catch(C){if(C.throttleRetry&&b{let a=null;if(s!=null)try{a=JSON.parse(Cf(s))}catch(c){_c.throwError("invalid JSON",Ee.errors.SERVER_ERROR,{body:s,error:c})}return r&&(a=r(a,o)),a},i=null;if(e!=null){i=qr(e);const s=typeof t=="string"?{url:t}:dn(t);s.headers?Object.keys(s.headers).filter(a=>a.toLowerCase()==="content-type").length!==0||(s.headers=dn(s.headers),s.headers["content-type"]="application/json"):s.headers={"content-type":"application/json"},t=s}return rX(t,i,n)}function vd(t,e){return e||(e={}),e=dn(e),e.floor==null&&(e.floor=0),e.ceiling==null&&(e.ceiling=1e4),e.interval==null&&(e.interval=250),new Promise(function(r,n){let i=null,s=!1;const o=()=>s?!1:(s=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout(()=>{o()&&n(new Error("timeout"))},e.timeout));const a=e.retryLimit;let c=0;function l(){return t().then(function(u){if(u!==void 0)o()&&r(u);else if(e.oncePoll)e.oncePoll.once("poll",l);else if(e.onceBlock)e.onceBlock.once("block",l);else if(!s){if(c++,c>a){o()&&n(new Error("retry limit reached"));return}let f=e.interval*parseInt(String(Math.random()*Math.pow(2,c)));fe.ceiling&&(f=e.ceiling),setTimeout(l,f)}return null},function(u){o()&&n(u)})}l()})}var m6="qpzry9x8gf2tvdw0s3jn54khce6mua7l",iI={};for(var $5=0;$5>25;return(t&33554431)<<5^-(e>>0&1)&996825010^-(e>>1&1)&642813549^-(e>>2&1)&513874426^-(e>>3&1)&1027748829^-(e>>4&1)&705979059}function nX(t){for(var e=1,r=0;r126)return"Invalid prefix ("+t+")";e=pg(e)^n>>5}for(e=pg(e),r=0;rr)throw new TypeError("Exceeds length limit");t=t.toLowerCase();var n=nX(t);if(typeof n=="string")throw new Error(n);for(var i=t+"1",s=0;s>5)throw new Error("Non 5-bit word");n=pg(n)^o,i+=m6.charAt(o)}for(s=0;s<6;++s)n=pg(n);for(n^=1,s=0;s<6;++s){var a=n>>(5-s)*5&31;i+=m6.charAt(a)}return i}function iX(t,e){if(e=e||90,t.length<8)return t+" too short";if(t.length>e)return"Exceeds length limit";var r=t.toLowerCase(),n=t.toUpperCase();if(t!==r&&t!==n)return"Mixed-case string "+t;t=r;var i=t.lastIndexOf("1");if(i===-1)return"No separator character for "+t;if(i===0)return"Missing prefix for "+t;var s=t.slice(0,i),o=t.slice(i+1);if(o.length<6)return"Data too short";var a=nX(s);if(typeof a=="string")return a;for(var c=[],l=0;l=o.length)&&c.push(f)}return a!==1?"Invalid checksum for "+t:{prefix:s,words:c}}function _Ee(){var t=iX.apply(null,arguments);if(typeof t=="object")return t}function CEe(t){var e=iX.apply(null,arguments);if(typeof e=="object")return e;throw new Error(e)}function p8(t,e,r,n){for(var i=0,s=0,o=(1<=r;)s-=r,a.push(i>>s&o);if(n)s>0&&a.push(i<=e)return"Excess padding";if(i<this.data(f,!0);return e.transaction={hash:o,type:l,accessList:it.allowNull(this.accessList.bind(this),null),blockHash:it.allowNull(o,null),blockNumber:it.allowNull(c,null),transactionIndex:it.allowNull(c,null),confirmations:it.allowNull(c,null),from:r,gasPrice:it.allowNull(n),maxPriorityFeePerGas:it.allowNull(n),maxFeePerGas:it.allowNull(n),gasLimit:n,to:it.allowNull(r,null),value:n,nonce:c,data:s,r:it.allowNull(this.uint256),s:it.allowNull(this.uint256),v:it.allowNull(c),creates:it.allowNull(r,null),raw:it.allowNull(s)},e.transactionRequest={from:it.allowNull(r),nonce:it.allowNull(c),gasLimit:it.allowNull(n),gasPrice:it.allowNull(n),maxPriorityFeePerGas:it.allowNull(n),maxFeePerGas:it.allowNull(n),to:it.allowNull(r),value:it.allowNull(n),data:it.allowNull(u),type:it.allowNull(c),accessList:it.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:c,blockNumber:c,transactionHash:o,address:r,topics:it.arrayOf(o),data:s,logIndex:c,blockHash:o},e.receipt={to:it.allowNull(this.address,null),from:it.allowNull(this.address,null),contractAddress:it.allowNull(r,null),transactionIndex:c,root:it.allowNull(a),gasUsed:n,logsBloom:it.allowNull(s),blockHash:o,transactionHash:o,logs:it.arrayOf(this.receiptLog.bind(this)),blockNumber:c,confirmations:it.allowNull(c,null),cumulativeGasUsed:n,effectiveGasPrice:it.allowNull(n),status:it.allowNull(c),type:l},e.block={hash:it.allowNull(o),parentHash:o,number:c,timestamp:c,nonce:it.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:it.allowNull(r),extraData:s,transactions:it.allowNull(it.arrayOf(o)),baseFeePerGas:it.allowNull(n)},e.blockWithTransactions=dn(e.block),e.blockWithTransactions.transactions=it.allowNull(it.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:it.allowNull(i,void 0),toBlock:it.allowNull(i,void 0),blockHash:it.allowNull(o,void 0),address:it.allowNull(r,void 0),topics:it.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:it.allowNull(c),blockHash:it.allowNull(o),transactionIndex:c,removed:it.allowNull(this.boolean.bind(this)),address:r,data:it.allowFalsish(s,"0x"),topics:it.arrayOf(o),transactionHash:o,logIndex:c},e}accessList(e){return v1(e||[])}number(e){return e==="0x"?0:we.from(e).toNumber()}type(e){return e==="0x"||e==null?0:we.from(e).toNumber()}bigNumber(e){return we.from(e)}boolean(e){if(typeof e=="boolean")return e;if(typeof e=="string"){if(e=e.toLowerCase(),e==="true")return!0;if(e==="false")return!1}throw new Error("invalid boolean - "+e)}hex(e,r){return typeof e=="string"&&(!r&&e.substring(0,2)!=="0x"&&(e="0x"+e),Vt(e))?e.toLowerCase():Hv.throwArgumentError("invalid hash","value",e)}data(e,r){const n=this.hex(e,r);if(n.length%2!==0)throw new Error("invalid data; odd-length - "+e);return n}address(e){return qt(e)}callAddress(e){if(!Vt(e,32))return null;const r=qt(Fn(e,12));return r===Rn?null:r}contractAddress(e){return QT(e)}blockTag(e){if(e==null)return"latest";if(e==="earliest")return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if(typeof e=="number"||Vt(e))return Uc(e);throw new Error("invalid blockTag")}hash(e,r){const n=this.hex(e,r);return Vl(n)!==32?Hv.throwArgumentError("invalid hash","value",e):n}difficulty(e){if(e==null)return null;const r=we.from(e);try{return r.toNumber()}catch{}return null}uint256(e){if(!Vt(e))throw new Error("invalid uint256");return Hr(e,32)}_block(e,r){e.author!=null&&e.miner==null&&(e.miner=e.author);const n=e._difficulty!=null?e._difficulty:e.difficulty,i=it.check(r,e);return i._difficulty=n==null?null:we.from(n),i}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return it.check(this.formats.transactionRequest,e)}transactionResponse(e){e.gas!=null&&e.gasLimit==null&&(e.gasLimit=e.gas),e.to&&we.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),e.input!=null&&e.data==null&&(e.data=e.input),e.to==null&&e.creates==null&&(e.creates=this.contractAddress(e)),(e.type===1||e.type===2)&&e.accessList==null&&(e.accessList=[]);const r=it.check(this.formats.transaction,e);if(e.chainId!=null){let n=e.chainId;Vt(n)&&(n=we.from(n).toNumber()),r.chainId=n}else{let n=e.networkId;n==null&&r.v==null&&(n=e.chainId),Vt(n)&&(n=we.from(n).toNumber()),typeof n!="number"&&r.v!=null&&(n=(r.v-35)/2,n<0&&(n=0),n=parseInt(n)),typeof n!="number"&&(n=0),r.chainId=n}return r.blockHash&&r.blockHash.replace(/0/g,"")==="x"&&(r.blockHash=null),r}transaction(e){return FZ(e)}receiptLog(e){return it.check(this.formats.receiptLog,e)}receipt(e){const r=it.check(this.formats.receipt,e);if(r.root!=null)if(r.root.length<=4){const n=we.from(r.root).toNumber();n===0||n===1?(r.status!=null&&r.status!==n&&Hv.throwArgumentError("alt-root-status/status mismatch","value",{root:r.root,status:r.status}),r.status=n,delete r.root):Hv.throwArgumentError("invalid alt-root-status","value.root",r.root)}else r.root.length!==66&&Hv.throwArgumentError("invalid root hash","value.root",r.root);return r.status!=null&&(r.byzantium=!0),r}topics(e){return Array.isArray(e)?e.map(r=>this.topics(r)):e!=null?this.hash(e,!0):null}filter(e){return it.check(this.formats.filter,e)}filterLog(e){return it.check(this.formats.filterLog,e)}static check(e,r){const n={};for(const i in e)try{const s=e[i](r[i]);s!==void 0&&(n[i]=s)}catch(s){throw s.checkKey=i,s.checkValue=r[i],s}return n}static allowNull(e,r){return function(n){return n==null?r:e(n)}}static allowFalsish(e,r){return function(n){return n?e(n):r}}static arrayOf(e){return function(r){if(!Array.isArray(r))throw new Error("not an array");const n=[];return r.forEach(function(i){n.push(e(i))}),n}}}function REe(t){return t&&typeof t.isCommunityResource=="function"}function $j(t){return REe(t)&&t.isCommunityResource()}var Ft=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const er=new Ee(Im),TEe=10;function Nj(t){return t==null?"null":(Vl(t)!==32&&er.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function Mj(t){for(t=t.slice();t.length>0&&t[t.length-1]==null;)t.pop();return t.map(e=>{if(Array.isArray(e)){const r={};e.forEach(i=>{r[Nj(i)]=!0});const n=Object.keys(r);return n.sort(),n.join("|")}else return Nj(e)}).join("&")}function OEe(t){return t===""?[]:t.split(/&/g).map(e=>{if(e==="")return[];const r=e.split("|").map(n=>n==="null"?null:n);return r.length===1?r[0]:r})}function op(t){if(typeof t=="string"){if(t=t.toLowerCase(),Vl(t)===32)return"tx:"+t;if(t.indexOf(":")===-1)return t}else{if(Array.isArray(t))return"filter:*:"+Mj(t);if(Oxe.isForkEvent(t))throw er.warn("not implemented"),new Error("not implemented");if(t&&typeof t=="object")return"filter:"+(t.address||"*")+":"+Mj(t.topics||[])}throw new Error("invalid event - "+t)}function qv(){return new Date().getTime()}function Dj(t){return new Promise(e=>{setTimeout(e,t)})}const $Ee=["block","network","pending","poll"];let NEe=class{constructor(e,r,n){Ie(this,"tag",e),Ie(this,"listener",r),Ie(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return e[0]!=="tx"?null:e[1]}get filter(){const e=this.tag.split(":");if(e[0]!=="filter")return null;const r=e[1],n=OEe(e[2]),i={};return n.length>0&&(i.topics=n),r&&r!=="*"&&(i.address=r),i}pollable(){return this.tag.indexOf(":")>=0||$Ee.indexOf(this.tag)>=0}};const MEe={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function UA(t){return Hr(we.from(t).toHexString(),32)}function Lj(t){return qg.encode(zr([t,Fn(tf(tf(t)),0,4)]))}const sX=new RegExp("^(ipfs)://(.*)$","i"),Bj=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),sX,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function X3(t,e){try{return Cf(zb(t,e))}catch{}return null}function zb(t,e){if(t==="0x")return null;const r=we.from(Fn(t,e,e+32)).toNumber(),n=we.from(Fn(t,r,r+32)).toNumber();return Fn(t,r+32,r+32+n)}function zA(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):er.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function Fj(t){const e=Ae(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function DEe(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}function oX(t){const e=[];let r=0;for(let n=0;nwe.from(e).eq(1)).catch(e=>{if(e.code===Ee.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e})),this._supportsEip2544}_fetch(e,r){return Ft(this,void 0,void 0,function*(){const n={to:this.address,ccipReadEnabled:!0,data:Hs([e,Wy(this.name),r||"0x"])};let i=!1;(yield this.supportsWildcard())&&(i=!0,n.data=Hs(["0x9061b923",oX([sZ(this.name),n.data])]));try{let s=yield this.provider.call(n);return Ae(s).length%32===4&&er.throwError("resolver threw error",Ee.errors.CALL_EXCEPTION,{transaction:n,data:s}),i&&(s=zb(s,0)),s}catch(s){if(s.code===Ee.errors.CALL_EXCEPTION)return null;throw s}})}_fetchBytes(e,r){return Ft(this,void 0,void 0,function*(){const n=yield this._fetch(e,r);return n!=null?zb(n,0):null})}_getAddress(e,r){const n=MEe[String(e)];if(n==null&&er.throwError(`unsupported coin type: ${e}`,Ee.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),n.ilk==="eth")return this.provider.formatter.address(r);const i=Ae(r);if(n.p2pkh!=null){const s=r.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return Lj(zr([[n.p2pkh],"0x"+s[2]]))}}if(n.p2sh!=null){const s=r.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return Lj(zr([[n.p2sh],"0x"+s[2]]))}}if(n.prefix!=null){const s=i[1];let o=i[0];if(o===0?s!==20&&s!==32&&(o=-1):o=-1,o>=0&&i.length===2+s&&s>=1&&s<=75){const a=Oj.toWords(i.slice(2));return a.unshift(o),Oj.encode(n.prefix,a)}}return null}getAddress(e){return Ft(this,void 0,void 0,function*(){if(e==null&&(e=60),e===60)try{const i=yield this._fetch("0x3b3b57de");return i==="0x"||i===c6?null:this.provider.formatter.callAddress(i)}catch(i){if(i.code===Ee.errors.CALL_EXCEPTION)return null;throw i}const r=yield this._fetchBytes("0xf1cb7e06",UA(e));if(r==null||r==="0x")return null;const n=this._getAddress(e,r);return n==null&&er.throwError("invalid or unsupported coin data",Ee.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:r}),n})}getAvatar(){return Ft(this,void 0,void 0,function*(){const e=[{type:"name",content:this.name}];try{const r=yield this.getText("avatar");if(r==null)return null;for(let n=0;no[c])}return er.throwError("invalid or unsupported content hash data",Ee.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})})}getText(e){return Ft(this,void 0,void 0,function*(){let r=qr(e);r=zr([UA(64),UA(r.length),r]),r.length%32!==0&&(r=zr([r,Hr("0x",32-e.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",Se(r));return n==null||n==="0x"?null:Cf(n)})}}let HA=null,LEe=1;class g8 extends Sf{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),Ie(this,"anyNetwork",e==="any"),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch(r=>{}),this._ready().catch(r=>{});else{const r=Lc(new.target,"getNetwork")(e);r?(Ie(this,"_network",r),this.emit("network",r,null)):er.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return Ft(this,void 0,void 0,function*(){if(this._network==null){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch{}e==null&&(e=yield this.detectNetwork()),e||er.throwError("no network detected",Ee.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=e:Ie(this,"_network",e),this.emit("network",e,null))}return this._network})}get ready(){return vd(()=>this._ready().then(e=>e,e=>{if(!(e.code===Ee.errors.NETWORK_ERROR&&e.event==="noNetwork"))throw e}))}static getFormatter(){return HA==null&&(HA=new it),HA}static getNetwork(e){return mEe(e??"homestead")}ccipReadFetch(e,r,n){return Ft(this,void 0,void 0,function*(){if(this.disableCcipRead||n.length===0)return null;const i=e.to.toLowerCase(),s=r.toLowerCase(),o=[];for(let a=0;a=0?null:JSON.stringify({data:s,sender:i}),f=yield J2({url:l,errorPassThrough:!0},u,(p,g)=>(p.status=g.statusCode,p));if(f.data)return f.data;const d=f.message||"unknown error";if(f.status>=400&&f.status<500)return er.throwError(`response not found during CCIP fetch: ${d}`,Ee.errors.SERVER_ERROR,{url:c,errorMessage:d});o.push(d)}return er.throwError(`error encountered during CCIP fetch: ${o.map(a=>JSON.stringify(a)).join(", ")}`,Ee.errors.SERVER_ERROR,{urls:n,errorMessages:o})})}_getInternalBlockNumber(e){return Ft(this,void 0,void 0,function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const i=this._internalBlockNumber;try{const s=yield i;if(qv()-s.respTime<=e)return s.blockNumber;break}catch{if(this._internalBlockNumber===i)break}}const r=qv(),n=Qr({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(i=>null,i=>i)}).then(({blockNumber:i,networkError:s})=>{if(s)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),s;const o=qv();return i=we.from(i).toNumber(),i{this._internalBlockNumber===n&&(this._internalBlockNumber=null)}),(yield n).blockNumber})}poll(){return Ft(this,void 0,void 0,function*(){const e=LEe++,r=[];let n=null;try{n=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(i){this.emit("error",i);return}if(this._setFastBlockNumber(n),this.emit("poll",e,n),n===this._lastBlockNumber){this.emit("didPoll",e);return}if(this._emitted.block===-2&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)er.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",er.makeError("network block skew detected",Ee.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(let i=this._emitted.block+1;i<=n;i++)this.emit("block",i);this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach(i=>{if(i==="block")return;const s=this._emitted[i];s!=="pending"&&n-s>12&&delete this._emitted[i]})),this._lastBlockNumber===-2&&(this._lastBlockNumber=n-1),this._events.forEach(i=>{switch(i.type){case"tx":{const s=i.hash;let o=this.getTransactionReceipt(s).then(a=>(!a||a.blockNumber==null||(this._emitted["t:"+s]=a.blockNumber,this.emit(s,a)),null)).catch(a=>{this.emit("error",a)});r.push(o);break}case"filter":{if(!i._inflight){i._inflight=!0,i._lastBlockNumber===-2&&(i._lastBlockNumber=n-1);const s=i.filter;s.fromBlock=i._lastBlockNumber+1,s.toBlock=n;const o=s.toBlock-this._maxFilterBlockRange;o>s.fromBlock&&(s.fromBlock=o),s.fromBlock<0&&(s.fromBlock=0);const a=this.getLogs(s).then(c=>{i._inflight=!1,c.length!==0&&c.forEach(l=>{l.blockNumber>i._lastBlockNumber&&(i._lastBlockNumber=l.blockNumber),this._emitted["b:"+l.blockHash]=l.blockNumber,this._emitted["t:"+l.transactionHash]=l.blockNumber,this.emit(s,l)})}).catch(c=>{this.emit("error",c),i._inflight=!1});r.push(a)}break}}}),this._lastBlockNumber=n,Promise.all(r).then(()=>{this.emit("didPoll",e)}).catch(i=>{this.emit("error",i)})})}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return Ft(this,void 0,void 0,function*(){return er.throwError("provider does not support network detection",Ee.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return Ft(this,void 0,void 0,function*(){const e=yield this._ready(),r=yield this.detectNetwork();if(e.chainId!==r.chainId){if(this.anyNetwork)return this._network=r,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",r,e),yield Dj(0),this._network;const n=er.makeError("underlying network changed",Ee.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:r});throw this.emit("error",n),n}return e})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(e=>{this._setFastBlockNumber(e)},e=>{}),this._fastBlockNumber!=null?this._fastBlockNumber:-1}get polling(){return this._poller!=null}set polling(e){e&&!this._poller?(this._poller=setInterval(()=>{this.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(()=>{this.poll(),this._bootstrapPoll=setTimeout(()=>{this._poller||this.poll(),this._bootstrapPoll=null},this.pollingInterval)},0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if(typeof e!="number"||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){const e=qv();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then(r=>((this._fastBlockNumber==null||r>this._fastBlockNumber)&&(this._fastBlockNumber=r),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(e){this._fastBlockNumber!=null&&ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,r,n){return Ft(this,void 0,void 0,function*(){return this._waitForTransaction(e,r??1,n||0,null)})}_waitForTransaction(e,r,n,i){return Ft(this,void 0,void 0,function*(){const s=yield this.getTransactionReceipt(e);return(s?s.confirmations:0)>=r?s:new Promise((o,a)=>{const c=[];let l=!1;const u=function(){return l?!0:(l=!0,c.forEach(d=>{d()}),!1)},f=d=>{d.confirmations{this.removeListener(e,f)}),i){let d=i.startBlock,p=null;const g=v=>Ft(this,void 0,void 0,function*(){l||(yield Dj(1e3),this.getTransactionCount(i.from).then(y=>Ft(this,void 0,void 0,function*(){if(!l){if(y<=i.nonce)d=v;else{{const b=yield this.getTransaction(e);if(b&&b.blockNumber!=null)return}for(p==null&&(p=d-3,p{l||this.once("block",g)}))});if(l)return;this.once("block",g),c.push(()=>{this.removeListener("block",g)})}if(typeof n=="number"&&n>0){const d=setTimeout(()=>{u()||a(er.makeError("timeout exceeded",Ee.errors.TIMEOUT,{timeout:n}))},n);d.unref&&d.unref(),c.push(()=>{clearTimeout(d)})}})})}getBlockNumber(){return Ft(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return Ft(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return we.from(e)}catch(r){return er.throwError("bad result from backend",Ee.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:r})}})}getBalance(e,r){return Ft(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield Qr({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getBalance",n);try{return we.from(i)}catch(s){return er.throwError("bad result from backend",Ee.errors.SERVER_ERROR,{method:"getBalance",params:n,result:i,error:s})}})}getTransactionCount(e,r){return Ft(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield Qr({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getTransactionCount",n);try{return we.from(i).toNumber()}catch(s){return er.throwError("bad result from backend",Ee.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:i,error:s})}})}getCode(e,r){return Ft(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield Qr({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getCode",n);try{return Se(i)}catch(s){return er.throwError("bad result from backend",Ee.errors.SERVER_ERROR,{method:"getCode",params:n,result:i,error:s})}})}getStorageAt(e,r,n){return Ft(this,void 0,void 0,function*(){yield this.getNetwork();const i=yield Qr({address:this._getAddress(e),blockTag:this._getBlockTag(n),position:Promise.resolve(r).then(o=>Uc(o))}),s=yield this.perform("getStorageAt",i);try{return Se(s)}catch(o){return er.throwError("bad result from backend",Ee.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:s,error:o})}})}_wrapTransaction(e,r,n){if(r!=null&&Vl(r)!==32)throw new Error("invalid response - sendTransaction");const i=e;return r!=null&&e.hash!==r&&er.throwError("Transaction hash mismatch from Provider.sendTransaction.",Ee.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:r}),i.wait=(s,o)=>Ft(this,void 0,void 0,function*(){s==null&&(s=1),o==null&&(o=0);let a;s!==0&&n!=null&&(a={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:n});const c=yield this._waitForTransaction(e.hash,s,o,a);return c==null&&s===0?null:(this._emitted["t:"+e.hash]=c.blockNumber,c.status===0&&er.throwError("transaction failed",Ee.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:c}),c)}),i}sendTransaction(e){return Ft(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Promise.resolve(e).then(s=>Se(s)),n=this.formatter.transaction(e);n.confirmations==null&&(n.confirmations=0);const i=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const s=yield this.perform("sendTransaction",{signedTransaction:r});return this._wrapTransaction(n,s,i)}catch(s){throw s.transaction=n,s.transactionHash=n.hash,s}})}_getTransactionRequest(e){return Ft(this,void 0,void 0,function*(){const r=yield e,n={};return["from","to"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?this._getAddress(s):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?we.from(s):null))}),["type"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s??null))}),r.accessList&&(n.accessList=this.formatter.accessList(r.accessList)),["data"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?Se(s):null))}),this.formatter.transactionRequest(yield Qr(n))})}_getFilter(e){return Ft(this,void 0,void 0,function*(){e=yield e;const r={};return e.address!=null&&(r.address=this._getAddress(e.address)),["blockHash","topics"].forEach(n=>{e[n]!=null&&(r[n]=e[n])}),["fromBlock","toBlock"].forEach(n=>{e[n]!=null&&(r[n]=this._getBlockTag(e[n]))}),this.formatter.filter(yield Qr(r))})}_call(e,r,n){return Ft(this,void 0,void 0,function*(){n>=TEe&&er.throwError("CCIP read exceeded maximum redirections",Ee.errors.SERVER_ERROR,{redirects:n,transaction:e});const i=e.to,s=yield this.perform("call",{transaction:e,blockTag:r});if(n>=0&&r==="latest"&&i!=null&&s.substring(0,10)==="0x556f1830"&&Vl(s)%32===4)try{const o=Fn(s,4),a=Fn(o,0,32);we.from(a).eq(i)||er.throwError("CCIP Read sender did not match",Ee.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s});const c=[],l=we.from(Fn(o,32,64)).toNumber(),u=we.from(Fn(o,l,l+32)).toNumber(),f=Fn(o,l+32);for(let b=0;bFt(this,void 0,void 0,function*(){const s=yield this.perform("getBlock",i);if(s==null)return i.blockHash!=null&&this._emitted["b:"+i.blockHash]==null||i.blockTag!=null&&n>this._emitted.block?null:void 0;if(r){let o=null;for(let c=0;cthis._wrapTransaction(c)),a}return this.formatter.block(s)}),{oncePoll:this})})}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return Ft(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return vd(()=>Ft(this,void 0,void 0,function*(){const n=yield this.perform("getTransaction",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;const i=this.formatter.transactionResponse(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}return this._wrapTransaction(i)}),{oncePoll:this})})}getTransactionReceipt(e){return Ft(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return vd(()=>Ft(this,void 0,void 0,function*(){const n=yield this.perform("getTransactionReceipt",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;if(n.blockHash==null)return;const i=this.formatter.receipt(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}return i}),{oncePoll:this})})}getLogs(e){return Ft(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Qr({filter:this._getFilter(e)}),n=yield this.perform("getLogs",r);return n.forEach(i=>{i.removed==null&&(i.removed=!1)}),it.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)})}getEtherPrice(){return Ft(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(e){return Ft(this,void 0,void 0,function*(){if(e=yield e,typeof e=="number"&&e<0){e%1&&er.throwArgumentError("invalid BlockTag","blockTag",e);let r=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return r+=e,r<0&&(r=0),this.formatter.blockTag(r)}return this.formatter.blockTag(e)})}getResolver(e){return Ft(this,void 0,void 0,function*(){let r=e;for(;;){if(r===""||r==="."||e!=="eth"&&r==="eth")return null;const n=yield this._getResolver(r,"getResolver");if(n!=null){const i=new sI(this,n,e);return r!==e&&!(yield i.supportsWildcard())?null:i}r=r.split(".").slice(1).join(".")}})}_getResolver(e,r){return Ft(this,void 0,void 0,function*(){r==null&&(r="ENS");const n=yield this.getNetwork();n.ensAddress||er.throwError("network does not support ENS",Ee.errors.UNSUPPORTED_OPERATION,{operation:r,network:n.name});try{const i=yield this.call({to:n.ensAddress,data:"0x0178b8bf"+Wy(e).substring(2)});return this.formatter.callAddress(i)}catch{}return null})}resolveName(e){return Ft(this,void 0,void 0,function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(n){if(Vt(e))throw n}typeof e!="string"&&er.throwArgumentError("invalid ENS name","name",e);const r=yield this.getResolver(e);return r?yield r.getAddress():null})}lookupAddress(e){return Ft(this,void 0,void 0,function*(){e=yield e,e=this.formatter.address(e);const r=e.substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"lookupAddress");if(n==null)return null;const i=X3(yield this.call({to:n,data:"0x691f3431"+Wy(r).substring(2)}),0);return(yield this.resolveName(i))!=e?null:i})}getAvatar(e){return Ft(this,void 0,void 0,function*(){let r=null;if(Vt(e)){const s=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",o=yield this._getResolver(s,"getAvatar");if(!o)return null;r=new sI(this,o,s);try{const a=yield r.getAvatar();if(a)return a.url}catch(a){if(a.code!==Ee.errors.CALL_EXCEPTION)throw a}try{const a=X3(yield this.call({to:o,data:"0x691f3431"+Wy(s).substring(2)}),0);r=yield this.getResolver(a)}catch(a){if(a.code!==Ee.errors.CALL_EXCEPTION)throw a;return null}}else if(r=yield this.getResolver(e),!r)return null;const n=yield r.getAvatar();return n==null?null:n.url})}perform(e,r){return er.throwError(e+" not implemented",Ee.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_stopEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_addEventListener(e,r,n){const i=new NEe(op(e),r,n);return this._events.push(i),this._startEvent(i),this}on(e,r){return this._addEventListener(e,r,!1)}once(e,r){return this._addEventListener(e,r,!0)}emit(e,...r){let n=!1,i=[],s=op(e);return this._events=this._events.filter(o=>o.tag!==s?!0:(setTimeout(()=>{o.listener.apply(this,r)},0),n=!0,o.once?(i.push(o),!1):!0)),i.forEach(o=>{this._stopEvent(o)}),n}listenerCount(e){if(!e)return this._events.length;let r=op(e);return this._events.filter(n=>n.tag===r).length}listeners(e){if(e==null)return this._events.map(n=>n.listener);let r=op(e);return this._events.filter(n=>n.tag===r).map(n=>n.listener)}off(e,r){if(r==null)return this.removeAllListeners(e);const n=[];let i=!1,s=op(e);return this._events=this._events.filter(o=>o.tag!==s||o.listener!=r||i?!0:(i=!0,n.push(o),!1)),n.forEach(o=>{this._stopEvent(o)}),this}removeAllListeners(e){let r=[];if(e==null)r=this._events,this._events=[];else{const n=op(e);this._events=this._events.filter(i=>i.tag!==n?!0:(r.push(i),!1))}return r.forEach(n=>{this._stopEvent(n)}),this}}var _u=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const ai=new Ee(Im),BEe=["call","estimateGas"];function Gy(t,e){if(t==null)return null;if(typeof t.message=="string"&&t.message.match("reverted")){const r=Vt(t.data)?t.data:null;if(!e||r)return{message:t.message,data:r}}if(typeof t=="object"){for(const r in t){const n=Gy(t[r],e);if(n)return n}return null}if(typeof t=="string")try{return Gy(JSON.parse(t),e)}catch{}return null}function aX(t,e,r){const n=r.transaction||r.signedTransaction;if(t==="call"){const s=Gy(e,!0);if(s)return s.data;ai.throwError("missing revert data in call exception; Transaction reverted without a reason string",Ee.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if(t==="estimateGas"){let s=Gy(e.body,!1);s==null&&(s=Gy(e,!1)),s&&ai.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Ee.errors.UNPREDICTABLE_GAS_LIMIT,{reason:s.message,method:t,transaction:n,error:e})}let i=e.message;throw e.code===Ee.errors.SERVER_ERROR&&e.error&&typeof e.error.message=="string"?i=e.error.message:typeof e.body=="string"?i=e.body:typeof e.responseText=="string"&&(i=e.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&ai.throwError("insufficient funds for intrinsic transaction cost",Ee.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),i.match(/nonce (is )?too low/i)&&ai.throwError("nonce has already been used",Ee.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&ai.throwError("replacement fee too low",Ee.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),i.match(/only replay-protected/i)&&ai.throwError("legacy pre-eip-155 transactions not supported",Ee.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),BEe.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&ai.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Ee.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function jj(t){return new Promise(function(e){setTimeout(e,t)})}function FEe(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function Wv(t){return t&&t.toLowerCase()}const oI={};class cX extends zd{constructor(e,r,n){if(super(),e!==oI)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");Ie(this,"provider",r),n==null&&(n=0),typeof n=="string"?(Ie(this,"_address",this.provider.formatter.address(n)),Ie(this,"_index",null)):typeof n=="number"?(Ie(this,"_index",n),Ie(this,"_address",null)):ai.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(e){return ai.throwError("cannot alter JSON-RPC Signer connection",Ee.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new jEe(oI,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(e=>(e.length<=this._index&&ai.throwError("unknown account #"+this._index,Ee.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index])))}sendUncheckedTransaction(e){e=dn(e);const r=this.getAddress().then(n=>(n&&(n=n.toLowerCase()),n));if(e.gasLimit==null){const n=dn(e);n.from=r,e.gasLimit=this.provider.estimateGas(n)}return e.to!=null&&(e.to=Promise.resolve(e.to).then(n=>_u(this,void 0,void 0,function*(){if(n==null)return null;const i=yield this.provider.resolveName(n);return i==null&&ai.throwArgumentError("provided ENS name resolves to null","tx.to",n),i}))),Qr({tx:Qr(e),sender:r}).then(({tx:n,sender:i})=>{n.from!=null?n.from.toLowerCase()!==i&&ai.throwArgumentError("from address mismatch","transaction",e):n.from=i;const s=this.provider.constructor.hexlifyTransaction(n,{from:!0});return this.provider.send("eth_sendTransaction",[s]).then(o=>o,o=>(typeof o.message=="string"&&o.message.match(/user denied/i)&&ai.throwError("user rejected transaction",Ee.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:n}),aX("sendTransaction",o,s)))})}signTransaction(e){return ai.throwError("signing transactions is unsupported",Ee.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return _u(this,void 0,void 0,function*(){const r=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),n=yield this.sendUncheckedTransaction(e);try{return yield vd(()=>_u(this,void 0,void 0,function*(){const i=yield this.provider.getTransaction(n);if(i!==null)return this.provider._wrapTransaction(i,n,r)}),{oncePoll:this.provider})}catch(i){throw i.transactionHash=n,i}})}signMessage(e){return _u(this,void 0,void 0,function*(){const r=typeof e=="string"?qr(e):e,n=yield this.getAddress();try{return yield this.provider.send("personal_sign",[Se(r),n.toLowerCase()])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&ai.throwError("user rejected signing",Ee.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:e}),i}})}_legacySignMessage(e){return _u(this,void 0,void 0,function*(){const r=typeof e=="string"?qr(e):e,n=yield this.getAddress();try{return yield this.provider.send("eth_sign",[n.toLowerCase(),Se(r)])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&ai.throwError("user rejected signing",Ee.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:e}),i}})}_signTypedData(e,r,n){return _u(this,void 0,void 0,function*(){const i=yield oi.resolveNames(e,r,n,o=>this.provider.resolveName(o)),s=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[s.toLowerCase(),JSON.stringify(oi.getPayload(i.domain,r,i.value))])}catch(o){throw typeof o.message=="string"&&o.message.match(/user denied/i)&&ai.throwError("user rejected signing",Ee.errors.ACTION_REJECTED,{action:"_signTypedData",from:s,messageData:{domain:i.domain,types:r,value:i.value}}),o}})}unlock(e){return _u(this,void 0,void 0,function*(){const r=this.provider,n=yield this.getAddress();return r.send("personal_unlockAccount",[n.toLowerCase(),e,null])})}}class jEe extends cX{sendTransaction(e){return this.sendUncheckedTransaction(e).then(r=>({hash:r,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:n=>this.provider.waitForTransaction(r,n)}))}}const UEe={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};let rf=class extends g8{constructor(e,r){let n=r;n==null&&(n=new Promise((i,s)=>{setTimeout(()=>{this.detectNetwork().then(o=>{i(o)},o=>{s(o)})},0)})),super(n),e||(e=Lc(this.constructor,"defaultUrl")()),typeof e=="string"?Ie(this,"connection",Object.freeze({url:e})):Ie(this,"connection",Object.freeze(dn(e))),this._nextId=42}get _cache(){return this._eventLoopCache==null&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(()=>{this._cache.detectNetwork=null},0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return _u(this,void 0,void 0,function*(){yield jj(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch{try{e=yield this.send("net_version",[])}catch{}}if(e!=null){const r=Lc(this.constructor,"getNetwork");try{return r(we.from(e).toNumber())}catch(n){return ai.throwError("could not detect network",Ee.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:n})}}return ai.throwError("could not detect network",Ee.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(e){return new cX(oI,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(e=>e.map(r=>this.formatter.address(r)))}send(e,r){const n={method:e,params:r,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:ra(n),provider:this});const i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];const s=J2(this.connection,JSON.stringify(n),FEe).then(o=>(this.emit("debug",{action:"response",request:n,response:o,provider:this}),o),o=>{throw this.emit("debug",{action:"response",error:o,request:n,provider:this}),o});return i&&(this._cache[e]=s,setTimeout(()=>{this._cache[e]=null},0)),s}prepareRequest(e,r){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[Wv(r.address),r.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[Wv(r.address),r.blockTag]];case"getCode":return["eth_getCode",[Wv(r.address),r.blockTag]];case"getStorageAt":return["eth_getStorageAt",[Wv(r.address),Hr(r.position,32),r.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[r.signedTransaction]];case"getBlock":return r.blockTag?["eth_getBlockByNumber",[r.blockTag,!!r.includeTransactions]]:r.blockHash?["eth_getBlockByHash",[r.blockHash,!!r.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[r.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[r.transactionHash]];case"call":return["eth_call",[Lc(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0}),r.blockTag]];case"estimateGas":return["eth_estimateGas",[Lc(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0})]];case"getLogs":return r.filter&&r.filter.address!=null&&(r.filter.address=Wv(r.filter.address)),["eth_getLogs",[r.filter]]}return null}perform(e,r){return _u(this,void 0,void 0,function*(){if(e==="call"||e==="estimateGas"){const i=r.transaction;if(i&&i.type!=null&&we.from(i.type).isZero()&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const s=yield this.getFeeData();s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null&&(r=dn(r),r.transaction=dn(i),delete r.transaction.type)}}const n=this.prepareRequest(e,r);n==null&&ai.throwError(e+" not implemented",Ee.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(n[0],n[1])}catch(i){return aX(e,i,r)}})}_startEvent(e){e.tag==="pending"&&this._startPending(),super._startEvent(e)}_startPending(){if(this._pendingFilter!=null)return;const e=this,r=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=r,r.then(function(n){function i(){e.send("eth_getFilterChanges",[n]).then(function(s){if(e._pendingFilter!=r)return null;let o=Promise.resolve();return s.forEach(function(a){e._emitted["t:"+a.toLowerCase()]="pending",o=o.then(function(){return e.getTransaction(a).then(function(c){return e.emit("pending",c),null})})}),o.then(function(){return jj(1e3)})}).then(function(){if(e._pendingFilter!=r){e.send("eth_uninstallFilter",[n]);return}return setTimeout(function(){i()},0),null}).catch(s=>{})}return i(),n}).catch(n=>{})}_stopEvent(e){e.tag==="pending"&&this.listenerCount("pending")===0&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,r){const n=dn(UEe);if(r)for(const s in r)r[s]&&(n[s]=!0);GT(e,n);const i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(s){if(e[s]==null)return;const o=Uc(we.from(e[s]));s==="gasLimit"&&(s="gas"),i[s]=o}),["from","to","data"].forEach(function(s){e[s]!=null&&(i[s]=Se(e[s]))}),e.accessList&&(i.accessList=v1(e.accessList)),i}};var zEe=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const HEe=new Ee(Im);class v6 extends rf{detectNetwork(){const e=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return zEe(this,void 0,void 0,function*(){let r=this.network;return r==null&&(r=yield e.detectNetwork.call(this),r||HEe.throwError("no network detected",Ee.errors.UNKNOWN_ERROR,{}),this._network==null&&(Ie(this,"_network",r),this.emit("network",r,null))),r})}}var y6=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const u0=new Ee(Im);function N5(){return new Date().getTime()}function Uj(t){let e=null;for(let r=0;re?null:(n+i)/2}function Jp(t){if(t===null)return"null";if(typeof t=="number"||typeof t=="boolean")return JSON.stringify(t);if(typeof t=="string")return t;if(we.isBigNumber(t))return t.toString();if(Array.isArray(t))return JSON.stringify(t.map(e=>Jp(e)));if(typeof t=="object"){const e=Object.keys(t);return e.sort(),"{"+e.map(r=>{let n=t[r];return typeof n=="function"?n="[function]":n=Jp(n),JSON.stringify(r)+":"+n}).join(",")+"}"}throw new Error("unknown value type: "+typeof t)}let qEe=1;function Hj(t){let e=null,r=null,n=new Promise(o=>{e=function(){r&&(clearTimeout(r),r=null),o()},r=setTimeout(e,t)});const i=o=>(n=n.then(o),n);function s(){return n}return{cancel:e,getPromise:s,wait:i}}const WEe=[Ee.errors.CALL_EXCEPTION,Ee.errors.INSUFFICIENT_FUNDS,Ee.errors.NONCE_EXPIRED,Ee.errors.REPLACEMENT_UNDERPRICED,Ee.errors.UNPREDICTABLE_GAS_LIMIT],VEe=["address","args","errorArgs","errorSignature","method","transaction"];function M5(t,e){const r={weight:t.weight};return Object.defineProperty(r,"provider",{get:()=>t.provider}),t.start&&(r.start=t.start),e&&(r.duration=e-t.start),t.done&&(t.error?r.error=t.error:r.result=t.result||null),r}function GEe(t,e){return function(r){const n={};r.forEach(s=>{const o=t(s.result);n[o]||(n[o]={count:0,result:s.result}),n[o].count++});const i=Object.keys(n);for(let s=0;s=e)return o.result}}}function KEe(t,e,r){let n=Jp;switch(e){case"getBlockNumber":return function(i){const s=i.map(a=>a.result);let o=zj(i.map(a=>a.result),2);if(o!=null)return o=Math.ceil(o),s.indexOf(o+1)>=0&&o++,o>=t._highestBlockNumber&&(t._highestBlockNumber=o),t._highestBlockNumber};case"getGasPrice":return function(i){const s=i.map(o=>o.result);return s.sort(),s[Math.floor(s.length/2)]};case"getEtherPrice":return function(i){return zj(i.map(s=>s.result))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":n=function(i){return i==null?null:(i=dn(i),i.confirmations=-1,Jp(i))};break;case"getBlock":r.includeTransactions?n=function(i){return i==null?null:(i=dn(i),i.transactions=i.transactions.map(s=>(s=dn(s),s.confirmations=-1,s)),Jp(i))}:n=function(i){return i==null?null:Jp(i)};break;default:throw new Error("unknown method: "+e)}return GEe(n,t.quorum)}function Vv(t,e){return y6(this,void 0,void 0,function*(){const r=t.provider;return r.blockNumber!=null&&r.blockNumber>=e||e===-1?r:vd(()=>new Promise((n,i)=>{setTimeout(function(){return r.blockNumber>=e?n(r):t.cancelled?n(null):n(void 0)},0)}),{oncePoll:r})})}function JEe(t,e,r,n){return y6(this,void 0,void 0,function*(){let i=t.provider;switch(r){case"getBlockNumber":case"getGasPrice":return i[r]();case"getEtherPrice":if(i.getEtherPrice)return i.getEtherPrice();break;case"getBalance":case"getTransactionCount":case"getCode":return n.blockTag&&Vt(n.blockTag)&&(i=yield Vv(t,e)),i[r](n.address,n.blockTag||"latest");case"getStorageAt":return n.blockTag&&Vt(n.blockTag)&&(i=yield Vv(t,e)),i.getStorageAt(n.address,n.position,n.blockTag||"latest");case"getBlock":return n.blockTag&&Vt(n.blockTag)&&(i=yield Vv(t,e)),i[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash);case"call":case"estimateGas":return n.blockTag&&Vt(n.blockTag)&&(i=yield Vv(t,e)),r==="call"&&n.blockTag?i[r](n.transaction,n.blockTag):i[r](n.transaction);case"getTransaction":case"getTransactionReceipt":return i[r](n.transactionHash);case"getLogs":{let s=n.filter;return(s.fromBlock&&Vt(s.fromBlock)||s.toBlock&&Vt(s.toBlock))&&(i=yield Vv(t,e)),i.getLogs(s)}}return u0.throwError("unknown method error",Ee.errors.UNKNOWN_ERROR,{method:r,params:n})})}class QEe extends g8{constructor(e,r){e.length===0&&u0.throwArgumentError("missing providers","providers",e);const n=e.map((o,a)=>{if(Sf.isProvider(o)){const u=$j(o)?2e3:750;return Object.freeze({provider:o,weight:1,stallTimeout:u,priority:1})}const c=dn(o);c.priority==null&&(c.priority=1),c.stallTimeout==null&&(c.stallTimeout=$j(o)?2e3:750),c.weight==null&&(c.weight=1);const l=c.weight;return(l%1||l>512||l<1)&&u0.throwArgumentError("invalid weight; must be integer in [1, 512]",`providers[${a}].weight`,l),Object.freeze(c)}),i=n.reduce((o,a)=>o+a.weight,0);r==null?r=i/2:r>i&&u0.throwArgumentError("quorum will always fail; larger than total weight","quorum",r);let s=Uj(n.map(o=>o.provider.network));s==null&&(s=new Promise((o,a)=>{setTimeout(()=>{this.detectNetwork().then(o,a)},0)})),super(s),Ie(this,"providerConfigs",Object.freeze(n)),Ie(this,"quorum",r),this._highestBlockNumber=-1}detectNetwork(){return y6(this,void 0,void 0,function*(){const e=yield Promise.all(this.providerConfigs.map(r=>r.provider.getNetwork()));return Uj(e)})}perform(e,r){return y6(this,void 0,void 0,function*(){if(e==="sendTransaction"){const c=yield Promise.all(this.providerConfigs.map(l=>l.provider.sendTransaction(r.signedTransaction).then(u=>u.hash,u=>u)));for(let l=0;lc.priority-l.priority);const s=this._highestBlockNumber;let o=0,a=!0;for(;;){const c=N5();let l=i.filter(p=>p.runner&&c-p.startp+g.weight,0);for(;l{p.staller=null}),p.runner=JEe(p,s,e,r).then(v=>{p.done=!0,p.result=v,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:g,backend:M5(p,N5()),request:{method:e,params:ra(r)},provider:this})},v=>{p.done=!0,p.error=v,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:g,backend:M5(p,N5()),request:{method:e,params:ra(r)},provider:this})}),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:g,backend:M5(p,null),request:{method:e,params:ra(r)},provider:this}),l+=p.weight}const u=[];i.forEach(p=>{p.done||!p.runner||(u.push(p.runner),p.staller&&u.push(p.staller.getPromise()))}),u.length&&(yield Promise.race(u));const f=i.filter(p=>p.done&&p.error==null);if(f.length>=this.quorum){const p=n(f);if(p!==void 0)return i.forEach(g=>{g.staller&&g.staller.cancel(),g.cancelled=!0}),p;a||(yield Hj(100).getPromise()),a=!1}const d=i.reduce((p,g)=>{if(!g.done||g.error==null)return p;const v=g.error.code;return WEe.indexOf(v)>=0&&(p[v]||(p[v]={error:g.error,weight:0}),p[v].weight+=g.weight),p},{});if(Object.keys(d).forEach(p=>{const g=d[p];if(g.weight{b.staller&&b.staller.cancel(),b.cancelled=!0});const v=g.error,y={};VEe.forEach(b=>{v[b]!=null&&(y[b]=v[b])}),u0.throwError(v.reason||v.message,p,y)}),i.filter(p=>!p.done).length===0)break}return i.forEach(c=>{c.staller&&c.staller.cancel(),c.cancelled=!0}),u0.throwError("failed to meet quorum",Ee.errors.SERVER_ERROR,{method:e,params:r,results:i.map(c=>M5(c)),provider:this})})}}const qj=new Ee(Im);let YEe=1;function Wj(t,e){const r="Web3LegacyFetcher";return function(n,i){const s={method:n,params:i,id:YEe++,jsonrpc:"2.0"};return new Promise((o,a)=>{this.emit("debug",{action:"request",fetcher:r,request:ra(s),provider:this}),e(s,(c,l)=>{if(c)return this.emit("debug",{action:"response",fetcher:r,error:c,request:s,provider:this}),a(c);if(this.emit("debug",{action:"response",fetcher:r,request:s,response:l,provider:this}),l.error){const u=new Error(l.error.message);return u.code=l.error.code,u.data=l.error.data,a(u)}o(l.result)})})}}function ZEe(t){return function(e,r){r==null&&(r=[]);const n={method:e,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:ra(n),provider:this}),t.request(n).then(i=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,response:i,provider:this}),i),i=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,error:i,provider:this}),i})}}class lX extends rf{constructor(e,r){e==null&&qj.throwArgumentError("missing provider","provider",e);let n=null,i=null,s=null;typeof e=="function"?(n="unknown:",i=e):(n=e.host||e.path||"",!n&&e.isMetaMask&&(n="metamask"),s=e,e.request?(n===""&&(n="eip-1193:"),i=ZEe(e)):e.sendAsync?i=Wj(e,e.sendAsync.bind(e)):e.send?i=Wj(e,e.send.bind(e)):qj.throwArgumentError("unsupported provider","provider",e),n||(n="unknown:")),super(n,r),Ie(this,"jsonRpcFetchFunc",i),Ie(this,"provider",s)}send(e,r){return this.jsonRpcFetchFunc(e,r)}}const XEe="solidity/5.7.0",e6e=new RegExp("^bytes([0-9]+)$"),t6e=new RegExp("^(u?int)([0-9]*)$"),r6e=new RegExp("^(.*)\\[([0-9]*)\\]$"),n6e="0000000000000000000000000000000000000000000000000000000000000000",Rp=new Ee(XEe);function uX(t,e,r){switch(t){case"address":return r?zy(e,32):Ae(e);case"string":return qr(e);case"bytes":return Ae(e);case"bool":return e=e?"0x01":"0x00",r?zy(e,32):Ae(e)}let n=t.match(t6e);if(n){let i=parseInt(n[2]||"256");return(n[2]&&String(i)!==n[2]||i%8!==0||i===0||i>256)&&Rp.throwArgumentError("invalid number type","type",t),r&&(i=256),e=we.from(e).toTwos(i),zy(e,i/8)}if(n=t.match(e6e),n){const i=parseInt(n[1]);return(String(i)!==n[1]||i===0||i>32)&&Rp.throwArgumentError("invalid bytes type","type",t),Ae(e).byteLength!==i&&Rp.throwArgumentError(`invalid value for ${t}`,"value",e),r?Ae((e+n6e).substring(0,66)):e}if(n=t.match(r6e),n&&Array.isArray(e)){const i=n[1];parseInt(n[2]||String(e.length))!=e.length&&Rp.throwArgumentError(`invalid array length for ${t}`,"value",e);const o=[];return e.forEach(function(a){o.push(uX(i,a,!0))}),zr(o)}return Rp.throwArgumentError("invalid type","type",t)}function Zt(t,e){t.length!=e.length&&Rp.throwArgumentError("wrong number of values; expected ${ types.length }","values",e);const r=[];return t.forEach(function(n,i){r.push(uX(n,e[i]))}),Se(zr(r))}function Td(t,e){return Tt(Zt(t,e))}function i6e(t,e){return tf(Zt(t,e))}const s6e="units/5.7.0",fX=new Ee(s6e),dX=["wei","kwei","mwei","gwei","szabo","finney","ether"];function o6e(t){const e=String(t).split(".");(e.length>2||!e[0].match(/^-?[0-9]*$/)||e[1]&&!e[1].match(/^[0-9]*$/)||t==="."||t==="-.")&&fX.throwArgumentError("invalid value","value",t);let r=e[0],n="";for(r.substring(0,1)==="-"&&(n="-",r=r.substring(1));r.substring(0,1)==="0";)r=r.substring(1);r===""&&(r="0");let i="";for(e.length===2&&(i="."+(e[1]||"0"));i.length>2&&i[i.length-1]==="0";)i=i.substring(0,i.length-1);const s=[];for(;r.length;)if(r.length<=3){s.unshift(r);break}else{const o=r.length-3;s.unshift(r.substring(o)),r=r.substring(0,o)}return n+s.join(",")+i}function Zn(t,e){if(typeof e=="string"){const r=dX.indexOf(e);r!==-1&&(e=3*r)}return G3(t,e??18)}function Gg(t,e){if(typeof t!="string"&&fX.throwArgumentError("value must be a string","value",t),typeof e=="string"){const r=dX.indexOf(e);r!==-1&&(e=3*r)}return dl(t,e??18)}function a6e(t){return Zn(t,18)}function c6e(t){return Gg(t,18)}const l6e=Object.freeze(Object.defineProperty({__proto__:null,AbiCoder:eO,ConstructorFragment:Mc,ErrorFragment:Du,EventFragment:Cl,FormatTypes:Cr,Fragment:Il,FunctionFragment:Dc,HDNode:Ko,Indexed:f6,Interface:fi,LogDescription:lZ,Logger:Ee,ParamType:wi,RLP:uwe,SigningKey:O0,get SupportedAlgorithm(){return Wg},TransactionDescription:uZ,get TransactionTypes(){return eI},get UnicodeNormalizationForm(){return Gl},Utf8ErrorFuncs:YY,get Utf8ErrorReason(){return bo},_TypedDataEncoder:oi,_fetchData:rX,_toEscapedUtf8String:Pwe,accessListify:v1,arrayify:Ae,base58:qg,base64:Kwe,checkProperties:GT,checkResultErrors:BY,commify:o6e,computeAddress:Rd,computeHmac:jb,computePublicKey:cO,concat:zr,deepCopy:ra,defaultAbiCoder:Js,defaultPath:Vg,defineReadOnly:Ie,dnsEncode:sZ,entropyToMnemonic:h8,fetchJson:J2,formatBytes32String:Rwe,formatEther:a6e,formatUnits:Zn,getAccountPath:W3e,getAddress:qt,getContractAddress:QT,getCreate2Address:gwe,getIcapAddress:pwe,getJsonWalletAddress:Z3e,getStatic:Lc,hashMessage:a8,hexConcat:Hs,hexDataLength:Vl,hexDataSlice:Fn,hexStripZeros:PY,hexValue:Uc,hexZeroPad:Hr,hexlify:Se,id:md,isAddress:HY,isBytes:Ef,isBytesLike:Zu,isHexString:Vt,isValidMnemonic:q3e,isValidName:yxe,joinSignature:Vk,keccak256:Tt,mnemonicToEntropy:d8,mnemonicToSeed:VZ,namehash:Wy,nameprep:qwe,parseBytes32String:Twe,parseEther:c6e,parseTransaction:FZ,parseUnits:Gg,poll:vd,randomBytes:Pl,recoverAddress:J0,recoverPublicKey:NZ,resolveProperties:Qr,ripemd160:HZ,serializeTransaction:tI,sha256:tf,sha512:M3e,shallowCopy:dn,shuffled:GZ,solidityKeccak256:Td,solidityPack:Zt,soliditySha256:i6e,splitSignature:p1,stripZeros:Bl,toUtf8Bytes:qr,toUtf8CodePoints:l6,toUtf8String:Cf,verifyMessage:tX,verifyTypedData:hEe,zeroPad:zy},Symbol.toStringTag,{value:"Module"})),hX="3.7.5",u6e=hX,f6e=typeof atob=="function",d6e=typeof btoa=="function",Pm=typeof Buffer=="function",Vj=typeof TextDecoder=="function"?new TextDecoder:void 0,Gj=typeof TextEncoder=="function"?new TextEncoder:void 0,h6e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Ay=Array.prototype.slice.call(h6e),D5=(t=>{let e={};return t.forEach((r,n)=>e[r]=n),e})(Ay),p6e=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Vi=String.fromCharCode.bind(String),Kj=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),pX=t=>t.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),gX=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),mX=t=>{let e,r,n,i,s="";const o=t.length%3;for(let a=0;a255||(n=t.charCodeAt(a++))>255||(i=t.charCodeAt(a++))>255)throw new TypeError("invalid character found");e=r<<16|n<<8|i,s+=Ay[e>>18&63]+Ay[e>>12&63]+Ay[e>>6&63]+Ay[e&63]}return o?s.slice(0,o-3)+"===".substring(o):s},mO=d6e?t=>btoa(t):Pm?t=>Buffer.from(t,"binary").toString("base64"):mX,aI=Pm?t=>Buffer.from(t).toString("base64"):t=>{let r=[];for(let n=0,i=t.length;ne?pX(aI(t)):aI(t),g6e=t=>{if(t.length<2){var e=t.charCodeAt(0);return e<128?t:e<2048?Vi(192|e>>>6)+Vi(128|e&63):Vi(224|e>>>12&15)+Vi(128|e>>>6&63)+Vi(128|e&63)}else{var e=65536+(t.charCodeAt(0)-55296)*1024+(t.charCodeAt(1)-56320);return Vi(240|e>>>18&7)+Vi(128|e>>>12&63)+Vi(128|e>>>6&63)+Vi(128|e&63)}},m6e=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,vX=t=>t.replace(m6e,g6e),Jj=Pm?t=>Buffer.from(t,"utf8").toString("base64"):Gj?t=>aI(Gj.encode(t)):t=>mO(vX(t)),gg=(t,e=!1)=>e?pX(Jj(t)):Jj(t),Qj=t=>gg(t,!0),v6e=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,y6e=t=>{switch(t.length){case 4:var e=(7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3),r=e-65536;return Vi((r>>>10)+55296)+Vi((r&1023)+56320);case 3:return Vi((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return Vi((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},yX=t=>t.replace(v6e,y6e),bX=t=>{if(t=t.replace(/\s+/g,""),!p6e.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(t.length&3));let e,r="",n,i;for(let s=0;s>16&255):i===64?Vi(e>>16&255,e>>8&255):Vi(e>>16&255,e>>8&255,e&255);return r},vO=f6e?t=>atob(gX(t)):Pm?t=>Buffer.from(t,"base64").toString("binary"):bX,wX=Pm?t=>Kj(Buffer.from(t,"base64")):t=>Kj(vO(t).split("").map(e=>e.charCodeAt(0))),xX=t=>wX(EX(t)),b6e=Pm?t=>Buffer.from(t,"base64").toString("utf8"):Vj?t=>Vj.decode(wX(t)):t=>yX(vO(t)),EX=t=>gX(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),cI=t=>b6e(EX(t)),w6e=t=>{if(typeof t!="string")return!1;const e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},_X=t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),CX=function(){const t=(e,r)=>Object.defineProperty(String.prototype,e,_X(r));t("fromBase64",function(){return cI(this)}),t("toBase64",function(e){return gg(this,e)}),t("toBase64URI",function(){return gg(this,!0)}),t("toBase64URL",function(){return gg(this,!0)}),t("toUint8Array",function(){return xX(this)})},SX=function(){const t=(e,r)=>Object.defineProperty(Uint8Array.prototype,e,_X(r));t("toBase64",function(e){return eE(this,e)}),t("toBase64URI",function(){return eE(this,!0)}),t("toBase64URL",function(){return eE(this,!0)})},x6e=()=>{CX(),SX()},Y0={version:hX,VERSION:u6e,atob:vO,atobPolyfill:bX,btoa:mO,btoaPolyfill:mX,fromBase64:cI,toBase64:gg,encode:gg,encodeURI:Qj,encodeURL:Qj,utob:vX,btou:yX,decode:cI,isValid:w6e,fromUint8Array:eE,toUint8Array:xX,extendString:CX,extendUint8Array:SX,extendBuiltins:x6e};var lI=function(){return lI=Object.assign||function(e){for(var r,n=1,i=arguments.length;n0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]0&&(i.types.Claims.push({name:"app",type:"string"}),i.message.app=this.claims.app),this.claims.iat&&this.claims.iat>0&&(i.types.Claims.push({name:"iat",type:"int64"}),i.message.iat=this.claims.iat),this.claims.exp&&this.claims.exp>0&&(i.types.Claims.push({name:"exp",type:"int64"}),i.message.exp=this.claims.exp),this.claims.n&&this.claims.n>0&&(i.types.Claims.push({name:"n",type:"uint64"}),i.message.n=this.claims.n),this.claims.typ&&this.claims.typ.length>0&&(i.types.Claims.push({name:"typ",type:"string"}),i.message.typ=this.claims.typ),this.claims.ogn&&this.claims.ogn.length>0&&(i.types.Claims.push({name:"ogn",type:"string"}),i.message.ogn=this.claims.ogn),this.claims.v&&this.claims.v.length>0&&(i.types.Claims.push({name:"v",type:"string"}),i.message.v=this.claims.v),i},t}(),_6e=function(t){if(t.app==="")return{ok:!1,err:new Error("claims: app is empty")};var e=Math.round(new Date().getTime()/1e3),r=5*60,n=60*60*24*365+r;return t.v===""?{ok:!1,err:new Error("claims: ethauth version is empty")}:t.iat&&t.iat!==0&&(t.iat>e+r||t.iate+n?{ok:!1,err:new Error("claims: token has expired")}:{ok:!0}},C6e=function(t,e,r){return f0(void 0,void 0,void 0,function(){var n,i;return d0(this,function(s){return n=r.messageDigest(),i=tX(n,r.signature),i.slice(0,2)==="0x"&&i.length===42&&i.toLowerCase()===r.address.toLowerCase()?[2,{isValid:!0,address:r.address}]:[2,{isValid:!1}]})})},S6e=function(t,e,r){return f0(void 0,void 0,void 0,function(){var n,i,s,o,a;return d0(this,function(c){switch(c.label){case 0:return!t||t===void 0?[2,{isValid:!1}]:(n=r.messageDigest(),[4,t.getCode(r.address)]);case 1:if(i=c.sent(),i==="0x"||i.length<=2)throw new Error("ValidateContractAccountProof failed. unable to fetch wallet contract code");return s=["function isValidSignature(bytes32, bytes) public view returns (bytes4)"],o=new km(r.address,s,t),[4,o.isValidSignature(n,Ae(r.signature))];case 2:return a=c.sent(),a===A6e?[2,{isValid:!0,address:r.address}]:[2,{isValid:!1}]}})})},A6e="0x1626ba7e",AX="1",uI="eth",k6e={name:"ETHAuth",version:AX},Hb=function(){function t(){for(var e=[],r=0;r0&&(c+="."+i.extra),[2,c]}})})},this.decodeProof=function(i,s){return s===void 0&&(s=!1),f0(n,void 0,void 0,function(){var o,a,c,l,u,f,d,p,g,v;return d0(this,function(y){switch(y.label){case 0:if(o=i.split("."),o.length<4||o.length>5)throw new Error("ethauth: invalid proof string");if(a=o[0],c=o[1],l=o[2],u=o[3],f=o[4],a!==uI)throw new Error("ethauth: not an ethauth proof");return d=Y0.decode(l),p=JSON.parse(d),g=new m8({address:c,claims:p,signature:u,extra:f}),[4,this.validateProof(g,s)];case 1:if(v=y.sent(),!v)throw new Error("ethauth: proof is invalid");return[2,g]}})})},this.validateProof=function(i,s){return s===void 0&&(s=!1),f0(n,void 0,void 0,function(){var o,a;return d0(this,function(c){switch(c.label){case 0:if(o=this.validateProofClaims(i),o.err)throw new Error("ethauth: proof claims are invalid ".concat(o.err));return s===!0?[3,2]:[4,this.validateProofSignature(i)];case 1:if(a=c.sent(),a!==!0)throw new Error("ethauth: proof signature is invalid");c.label=2;case 2:return[2,!0]}})})},this.validateProofSignature=function(i){return f0(n,void 0,void 0,function(){var s,c,o,a,c;return d0(this,function(l){switch(l.label){case 0:s=[],c=0,l.label=1;case 1:if(!(cY0.encode(t,!0),yO=t=>Y0.encode(JSON.stringify(t),!0),P6e=t=>{if(t!=null)return Y0.decode(t)},bO=t=>{if(t!=null)return JSON.parse(Y0.decode(t))};function kX(t){return t!=null&&(we.isBigNumber(t)||typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||Vt(t)||typeof t=="bigint"||Ef(t))}const wO=t=>Ae(Tt(typeof t=="string"?qr(t):t)),IX=(t,e,r)=>Zt(["string","uint256","address","bytes32"],["",e,t,r]),fI=(t,e,r)=>Tt(IX(t,e,r)),PX=()=>typeof window>"u"&&typeof process=="object",R6e=()=>!PX(),RX=t=>{const e=t.split(".");if(e.length!==3)throw new Error("invalid jwt");return JSON.parse(Y0.decode(e[1]))};function b6(){return b6=Object.assign?Object.assign.bind():function(t){for(var e=1;emt.configure(t),qb=(t,e,r)=>{const n={};return r&&r.length>0&&(n.Authorization=`BEARER ${r}`),e&&e.length>0&&(n["X-Access-Key"]=e),{url:t,headers:n,skipFetchSetup:!0,fetchOptions:{mode:"cors",cache:"force-cache",credentials:"same-origin",redirect:"follow",referrer:"client"}}};let O6e=class{constructor(){this.cache=void 0,this.cache=new Map}do(e,r,n,...i){e=`${e}:${Tt(qr(JSON.stringify(i,$6e)))}`;let s=this.cache.get(e);if(s&&s.expiration&&new Date>=s.expiration&&(s=void 0,this.cache.delete(e)),!s){const o={promise:n(...i)};r!==void 0&&(o.promise=o.promise.then(a=>(o.expiration=new Date(Date.now()+r),a))),s=o,this.cache.set(e,s)}return s.promise}};function $6e(t,e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).sort()):e}function xO(t,e){return function(...r){const n=Array.prototype.slice.call(r);return new Promise(async(i,s)=>{try{n.push((o,a)=>o?s(o):i(a)),await t.apply(e,n)}catch(o){s(o)}})}}function N6e(t,e){const r=encodeURIComponent(t),n=encodeURIComponent(JSON.stringify(e));return`${r}=${n}`}function M6e(t){const e=t.split("&"),r={};for(const n of e){const i=n.split("=");r[decodeURIComponent(i[0])]=JSON.parse(decodeURIComponent(i[1]))}return r}const EO=(t=0,e=Number.MAX_SAFE_INTEGER)=>(t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t),OX=t=>{if(!t||typeof t!="string")return"";const e=t.match(/[\d.]+/);return e&&e.length>0?e[0].trim():""},$X=t=>{if(!t||typeof t!="string")return"";const e=t.match(/[\w\s\d]+/);return e&&e.length>0?e[0].trim():""},NX=t=>{if(!t||typeof t!="string")return"";const e=t.match(/[\w\d.\-:\/]+/);return e&&e.length>0?e[0].trim():""},D6e=t=>new Promise(e=>{const r=setTimeout(()=>{clearTimeout(r),e()},t)}),MX=t=>{const e=b6({},t.types);return delete e.EIP712Domain,oi.hash(t.domain,e,t.message)},Q2=t=>Ae(MX(t)),{defineReadOnly:L6e,getStatic:B6e,resolveProperties:F6e,checkProperties:j6e,shallowCopy:U6e,deepCopy:z6e}=l6e,H6e=t=>t.replace(/([^:]\/)\/+/g,"$1"),q6e=Object.freeze(Object.defineProperty({__proto__:null,Logger:TX,PromiseCache:O6e,base64Decode:P6e,base64DecodeObject:bO,base64Encode:I6e,base64EncodeObject:yO,checkProperties:j6e,configureLogger:T6e,deepCopy:z6e,defineReadOnly:L6e,encodeMessageDigest:wO,encodeTypedDataDigest:Q2,encodeTypedDataHash:MX,getEthersConnectionInfo:qb,getRandomInt:EO,getStatic:B6e,isBigNumberish:kX,isBrowser:R6e,isNode:PX,jwtDecodeClaims:RX,logger:mt,packMessageData:IX,promisify:xO,queryStringFromObject:N6e,queryStringToObject:M6e,resolveProperties:F6e,sanitizeAlphanumeric:$X,sanitizeHost:NX,sanitizeNumberString:OX,shallowCopy:U6e,sleep:D6e,subDigestOf:fI,urlClean:H6e},Symbol.toStringTag,{value:"Module"}));function gn(){return gn=Object.assign?Object.assign.bind():function(t){for(var e=1;etypeof t=="number"?t:t.chainId?t.chainId:we.from(t).toNumber(),V6e=t=>{if(t)return DX(t)},LX=(t,e=!1,r=!1)=>{if(!t)throw new Error("invalid network config: empty config");const n=[];if(Array.isArray(t)?n.push(...t):n.push(t),n.length===0){if(e)throw new Error("invalid network config: empty config");return!1}const i=n.map(l=>l.chainId).sort(),s=i.filter((l,u)=>i.indexOf(l)!==u);if(s.length>0){if(e)throw new Error(`invalid network config: duplicate chainIds ${s}`);return!1}n.forEach(l=>l.name=l.name.toLowerCase());const o=n.map(l=>l.name).sort(),a=o.filter((l,u)=>o.indexOf(l)!==u);if(a.length>0){if(e)throw new Error(`invalid network config: duplicate network names ${a}`);return!1}let c=!1;for(let l=0;l(LX(t,!0,e),t),G6e=(t,e=!0)=>{const r=t.map(i=>i.chainId).sort(),n=r.filter((i,s)=>r.indexOf(i)!==s);if(n.length>0){if(e)throw new Error(`invalid network config: duplicate chainIds ${n}`);return!1}return!0},K6e=(t,e)=>{if(!(!t||!e)){if(!t.chainId&&!t.name)throw new Error("failed to update network config: source config is missing chainId or name");if(t.chainId!==e.chainId&&t.name!==e.name)throw new Error("failed to update network config: one of chainId or name must match");t.rpcUrl&&(e.rpcUrl=t.rpcUrl,e.provider=void 0),t.provider&&(e.provider=t.provider),t.relayer&&(e.relayer=t.relayer)}},FX=t=>BX(jX(t)),zc=(t,e)=>{if(typeof e=="string")if(e.startsWith("0x")){const r=we.from(e).toNumber();return t.find(n=>n.chainId===r)}else return t.find(r=>r.name===e||`${r.chainId}`===e);else{if(typeof e=="number")return t.find(r=>r.chainId===e);if(e.chainId)return t.find(r=>r.chainId===e.chainId);if(we.isBigNumber(e)){const r=e.toNumber();return t.find(n=>n.chainId===r)}else return}},J6e=(t,e)=>t?t.name===e||t.chainId===e:!1,Q6e=t=>{const e={};for(let r=0;r{if(!t)return[];const e=t.sort((n,i)=>n.chainId===i.chainId?0:n.chainIdn.isDefaultChain);return r>0&&e.splice(0,0,e.splice(r,1)[0]),e},v8=(t,e)=>typeof t=="string"?(e=e||{},t.replace(/\$\{\s*([$#@\-\d\w]+)\s*\}/gim,function(r,n){let i=e[n];return typeof i=="function"?i=i():i==null?i="":typeof i=="object"||typeof i=="symbol"?i=i.toString():i=i.valueOf(),i})):"",_O=t=>v8("https://${network}-indexer.sequence.app",{network:t}),UX=t=>v8("https://${network}-relayer.sequence.app",{network:t}),zX=t=>v8("https://nodes.sequence.app/${network}",{network:t});function CO(t){return zc(Kg,t)}function HX(t){return we.isBigNumber(t)?t:kX(t)?we.from(t):we.from(t.chainId)}const ri=t=>{const e=zX(t);return{rpcUrl:e,relayer:{url:UX(t),provider:{url:e}},indexerUrl:_O(t)}},Kg=FX([gn({},cn[$e.POLYGON],ri("polygon"),{isDefaultChain:!0,isAuthChain:!0}),gn({},cn[$e.MAINNET],ri("mainnet")),gn({},cn[$e.BSC],ri("bsc")),gn({},cn[$e.AVALANCHE],ri("avalanche")),gn({},cn[$e.ARBITRUM],ri("arbitrum")),gn({},cn[$e.ARBITRUM_NOVA],ri("arbitrum-nova")),gn({},cn[$e.OPTIMISM],ri("optimism")),gn({},cn[$e.OPTIMISM_SEPOLIA],ri("optimism-sepolia")),gn({},cn[$e.POLYGON_ZKEVM],ri("polygon-zkevm")),gn({},cn[$e.GNOSIS],ri("gnosis")),gn({},cn[$e.RINKEBY],ri("rinkeby"),{disabled:!0}),gn({},cn[$e.GOERLI],ri("goerli"),{disabled:!0}),gn({},cn[$e.SEPOLIA],ri("sepolia")),gn({},cn[$e.POLYGON_MUMBAI],ri("mumbai")),gn({},cn[$e.BSC_TESTNET],ri("bsc-testnet")),gn({},cn[$e.ARBITRUM_SEPOLIA],ri("arbitrum-sepolia")),gn({},cn[$e.BASE],ri("base")),gn({},cn[$e.BASE_SEPOLIA],ri("base-sepolia")),gn({},cn[$e.HOMEVERSE_TESTNET],ri("homeverse-testnet")),gn({},cn[$e.AVALANCHE_TESTNET],ri("avalanche-testnet")),gn({},cn[$e.HARDHAT],{rpcUrl:"http://localhost:8545",relayer:{url:"http://localhost:3000",provider:{url:"http://localhost:8545"}}}),gn({},cn[$e.HARDHAT_2],{rpcUrl:"http://localhost:9545",relayer:{url:"http://localhost:3000",provider:{url:"http://localhost:9545"}}})]),Jg="2.0";class SO{constructor(e,r){this.sender=void 0,this.handler=void 0,this.sender=r,e&&this.setMiddleware(e)}setMiddleware(e){this.handler=qX(e,this.sender.sendAsync)}sendAsync(e,r,n){try{this.handler(e,r,n)}catch(i){r(i,void 0)}}}const qX=(t,e)=>{if(t.length===0)return e;const r=i=>i.sendAsyncMiddleware?i.sendAsyncMiddleware:i;let n;n=r(t[t.length-1])(e);for(let i=t.length-2;i>=0;i--)n=r(t[i])(n);return n};function WX(t){return t!==void 0&&t.send!==void 0&&t.constructor.defaultUrl!==void 0&&t.detectNetwork!==void 0&&t.getSigner!==void 0&&t.perform!==void 0}function VX(t){return t!==void 0&&t.sendAsync!==void 0}let Y6e=0;class w6{constructor(e,r){this.send=void 0,this.request=void 0,this.defaultChainId=void 0,this.sendAsync=(n,i,s)=>{this.send(n.method,n.params,s||this.defaultChainId).then(o=>{i(void 0,{jsonrpc:"2.0",id:n.id,result:o})}).catch(o=>{i(o,void 0)})},this.defaultChainId=r,WX(e)?this.send=e.send.bind(e):VX(e)?this.send=(n,i,s)=>new Promise((o,a)=>{e.sendAsync({jsonrpc:Jg,id:++Y6e,method:n,params:i},(c,l)=>{c?a(c):o(l?l.result:void 0)},s||this.defaultChainId)}):this.send=e,this.request=(n,i)=>this.send(n.method,n.params,i)}}class Z6e{constructor(e){this.provider=e,this.sendAsync=(r,n)=>{this.provider.send(r.method,r.params).then(i=>{n(void 0,{jsonrpc:"2.0",id:r.id,result:i})}).catch(i=>{n(i,void 0)})},this.send=this.sendAsync}}class X6e{constructor(e){this.sendAsyncMiddleware=void 0,this.isAllowedFunc=void 0,e?this.isAllowedFunc=e:this.isAllowedFunc=r=>!0,this.sendAsyncMiddleware=dI(this.isAllowedFunc)}setIsAllowedFunc(e){this.isAllowedFunc=e,this.sendAsyncMiddleware=dI(this.isAllowedFunc)}}const dI=t=>e=>(r,n,i)=>{if(!t(r))throw new Error("allowProvider middleware precondition is unmet.");e(r,n,i)};class AO{constructor(e){this.cachableJsonRpcMethods=["net_version","eth_chainId","eth_accounts","sequence_getWalletContext","sequence_getNetworks"],this.cachableJsonRpcMethodsByBlock=["eth_call","eth_getCode"],this.cache=void 0,this.cacheByBlock=void 0,this.cacheByBlockResetLock=!1,this.onUpdateCallback=void 0,this.defaultChainId=void 0,this.sendAsyncMiddleware=r=>(n,i,s)=>{if(this.cachableJsonRpcMethods.includes(n.method)||this.cachableJsonRpcMethodsByBlock.includes(n.method)){const o=this.cacheKey(n.method,n.params,s||this.defaultChainId),a=this.getCacheValue(o);if(a&&a!==""){i(void 0,{jsonrpc:"2.0",id:n.id,result:a});return}}r(n,(o,a,c)=>{if((this.cachableJsonRpcMethods.includes(n.method)||this.cachableJsonRpcMethodsByBlock.includes(n.method))&&a&&a.result&&this.shouldCacheResponse(n,a)){const l=this.cacheKey(n.method,n.params,c||this.defaultChainId);this.cachableJsonRpcMethods.includes(n.method)?this.setCacheValue(l,a.result):this.setCacheByBlockValue(l,a.result)}i(o,a)},s||this.defaultChainId)},this.cacheKey=(r,n,i)=>{let s="";return i?s=`${i}:${r}:`:s=`:${r}:`,!n||n.length===0?s+"[]":s+JSON.stringify(n)},this.getCache=()=>this.cache,this.setCache=r=>{this.cache=r,this.onUpdateCallback&&this.onUpdateCallback()},this.getCacheValue=r=>{if(this.cache[r])return this.cache[r];if(this.cacheByBlock[r])return this.cacheByBlock[r]},this.setCacheValue=(r,n)=>{this.cache[r]=n,this.onUpdateCallback&&this.onUpdateCallback(r,n)},this.setCacheByBlockValue=(r,n)=>{this.cacheByBlock[r]=n,this.cacheByBlockResetLock||(this.cacheByBlockResetLock=!0,setTimeout(()=>{this.cacheByBlockResetLock=!1,this.cacheByBlock={}},1500))},this.shouldCacheResponse=(r,n)=>!(!n||!n.result||r.method==="eth_getCode"&&n.result.length<=2),this.clearCache=()=>{this.cache={},this.cacheByBlock={}},this.cache={},this.cacheByBlock={},this.defaultChainId=e==null?void 0:e.defaultChainId,e!=null&&e.blockCache?(e==null?void 0:e.blockCache)!==!0&&(this.cachableJsonRpcMethodsByBlock=e==null?void 0:e.blockCache):this.cachableJsonRpcMethodsByBlock=[]}onUpdate(e){this.onUpdateCallback=e}}class GX{constructor(e){this.options=void 0,this.sendAsyncMiddleware=r=>(n,i,s)=>{const{id:o,method:a}=n;switch(a){case"net_version":if(this.options.chainId){i(void 0,{jsonrpc:"2.0",id:o,result:`${this.options.chainId}`});return}break;case"eth_chainId":if(this.options.chainId){i(void 0,{jsonrpc:"2.0",id:o,result:Se(this.options.chainId)});return}break;case"eth_accounts":if(this.options.accountAddress){i(void 0,{jsonrpc:"2.0",id:o,result:[qt(this.options.accountAddress)]});return}break;case"sequence_getWalletContext":if(this.options.walletContext){i(void 0,{jsonrpc:"2.0",id:o,result:this.options.walletContext});return}break}r(n,i,s)},this.options=e}}const KX=t=>(e,r,n)=>{t(e,(i,s)=>{if(!i&&s&&s.error)throw typeof s.error=="string"?new Error(s.error):new Error(s.error.message);r(i,s)},n)},JX=t=>(e,r,n)=>{const i=n?` chainId:${n}`:"";mt.info(`[provider request]${i} id:${e.id} method:${e.method} params:`,e.params),t(e,(s,o)=>{s?mt.warn(`[provider response]${i} id:${e.id} method:${e.method} params:`,e.params,"error:",s):mt.info(`[provider response]${i} id:${e.id} method:${e.method} params:`,e.params,"response:",o),r(s,o)},n)},e_e=t=>e=>(r,n,i)=>{const s=t(r),{id:o,method:a}=r;switch(a){case"net_version":n(void 0,{jsonrpc:"2.0",id:o,result:`${s}`});return;case"eth_chainId":n(void 0,{jsonrpc:"2.0",id:o,result:Se(s)});return}e(r,n,i)},QX=["personal_sign","eth_sign","eth_signTypedData","eth_signTypedData_v4","eth_sendTransaction","eth_sendRawTransaction","sequence_sign","sequence_signTypedData_v4","sequence_getWalletContext","sequence_getWalletConfig","sequence_getWalletState","sequence_getNetworks","sequence_updateConfig","sequence_publishConfig","sequence_gasRefundOptions","sequence_getNonce","sequence_relay","eth_decrypt","eth_getEncryptionPublicKey","wallet_addEthereumChain","wallet_switchEthereumChain","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"];class t_e{constructor(e){this.provider=void 0,this.sendAsyncMiddleware=r=>(n,i,s)=>{if(QX.includes(n.method)){this.provider.sendAsync(n,i,s);return}r(n,i,s)},this.provider=e}}class r_e{constructor(e){this.privateJsonRpcMethods=["net_version","eth_chainId","eth_accounts",...QX],this.provider=void 0,this.rpcUrl=void 0,this.sendAsyncMiddleware=r=>(n,i)=>{if(this.provider&&!this.privateJsonRpcMethods.includes(n.method)){this.provider.send(n.method,n.params).then(s=>{i(void 0,{jsonrpc:"2.0",id:n.id,result:s})}).catch(s=>i(s));return}mt.debug("[public-provider] sending request to signer window",n.method),r(n,i)},e&&this.setRpcUrl(e)}getRpcUrl(){return this.rpcUrl}setRpcUrl(e){!e||e===""?(this.rpcUrl=void 0,this.provider=void 0):(this.rpcUrl=e,this.provider=new rf(e))}}class YX{constructor(){this.singleflightJsonRpcMethods=["eth_chainId","net_version","eth_call","eth_getCode","eth_blockNumber","eth_getBalance","eth_getStorageAt","eth_getTransactionCount","eth_getBlockTransactionCountByHash","eth_getBlockTransactionCountByNumber","eth_getUncleCountByBlockHash","eth_getUncleCountByBlockNumber","eth_getBlockByHash","eth_getBlockByNumber","eth_getTransactionByHash","eth_getTransactionByBlockHashAndIndex","eth_getTransactionByBlockNumberAndIndex","eth_getTransactionReceipt","eth_getUncleByBlockHashAndIndex","eth_getUncleByBlockNumberAndIndex","eth_getLogs"],this.inflight=void 0,this.sendAsyncMiddleware=e=>(r,n,i)=>{if(!this.singleflightJsonRpcMethods.includes(r.method)){e(r,n,i);return}const s=this.requestKey(r.method,r.params||[],i);if(!this.inflight[s])this.inflight[s]=[];else{this.inflight[s].push({id:r.id,callback:n});return}e(r,(o,a,c)=>{n(o,a);for(let l=0;l{let i="";return n?i=`${n}:${e}:`:i=`:${e}:`,!r||r.length===0?i+"[]":i+JSON.stringify(r)},this.inflight={}}}let n_e=class extends rf{constructor(e,r){super(e,r==null?void 0:r.chainId),this._chainId=void 0,this._sender=void 0,this.send=(a,c)=>this._sender.send(a,c),this.fetch=(a,c)=>{const l={method:a,params:c,id:this._nextId++,jsonrpc:"2.0"};return J2(this.connection,JSON.stringify(l),i_e).then(f=>f,f=>{throw f})};const n=r==null?void 0:r.chainId,i=r==null?void 0:r.middlewares,s=r==null?void 0:r.blockCache;this._chainId=n;const o=new SO(i??[new GX({chainId:n}),new YX,new AO({defaultChainId:n,blockCache:s})],new w6(this.fetch,n));this._sender=new w6(o,n)}async getNetwork(){const e=this._chainId;if(e){const r=cn[e],n=(r==null?void 0:r.name)||"",i=r==null?void 0:r.ensAddress;return{name:n,chainId:e,ensAddress:i}}else{const r=await this.send("eth_chainId",[]);return this._chainId=we.from(r).toNumber(),this.getNetwork()}}};function i_e(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}const s_e=Object.freeze(Object.defineProperty({__proto__:null,AllowProvider:X6e,CachedProvider:AO,ChainId:$e,EagerProvider:GX,JsonRpcExternalProvider:Z6e,JsonRpcProvider:n_e,JsonRpcRouter:SO,JsonRpcSender:w6,JsonRpcVersion:Jg,NetworkType:Ur,PublicProvider:r_e,SigningProvider:t_e,SingleflightMiddleware:YX,allNetworks:Kg,allowProviderMiddleware:dI,checkNetworkConfig:J6e,createJsonRpcMiddlewareStack:qX,ensureUniqueNetworks:G6e,ensureValidNetworks:BX,exceptionProviderMiddleware:KX,findNetworkConfig:zc,findSupportedNetwork:CO,getChainId:DX,indexerURL:_O,isJsonRpcHandler:VX,isJsonRpcProvider:WX,isNetworkConfig:W6e,isValidNetworkConfig:LX,loggingProviderMiddleware:JX,maybeChainId:V6e,networkProviderMiddleware:e_e,networks:cn,networksIndex:Q6e,nodesURL:zX,relayerURL:UX,sortNetworks:jX,stringTemplate:v8,toChainIdNumber:HX,updateNetworkConfig:K6e,validateAndSortNetworks:FX},Symbol.toStringTag,{value:"Module"}));function Yi(){return Yi=Object.assign?Object.assign.bind():function(t){for(var e=1;e{if(IO(i))return Zt(["uint8","uint8","address"],[N0.Address,i.weight,i.address]);if(i.isDynamic){const s=Ae(i.signature);return Zt(["uint8","uint8","address","uint16","bytes"],[N0.DynamicSignature,i.weight,i.address,s.length,s])}return Zt(["uint8","uint8","bytes"],[N0.EOASignature,i.weight,i.signature])});return Zt(["uint16",...new Array(n.length).fill("bytes")],[r,...n])}async function nee(t,e,r){const n=Y2(e),i=await Promise.all(t.signers.map(async s=>{if(IO(s))return s;if(s.isDynamic){if(!s.address)throw new Error("Dynamic signature part must have address");if(!kO(s.address,n,s.signature,r))throw new Error(`Invalid dynamic signature part ${s.address}`);return{address:s.address,weight:s.weight,signature:s.signature}}else return{address:Z2(n,s.signature),weight:s.weight,signature:s.signature}}));return{version:1,payload:e,subdigest:n,config:{version:1,threshold:t.threshold,signers:i}}}function Ky(t,e,r,n){if(r.length!==0)throw new Error("Explicit subdigests not supported on v1");let i=we.from(0);const s=t.signers.map(a=>{if(!e.has(a.address))return a;const c=e.get(a.address),l=Ae(c.signature);return i=i.add(a.weight),c.isDynamic||l.length!==66?Yi({},a,{isDynamic:!0,signature:c.signature,address:a.address}):Yi({},a,{isDynamic:!1,signature:c.signature})});return{encoded:PO({version:1,threshold:t.threshold,signers:s}),weight:i}}const RO={decode:t=>ree(t),encode:t=>PO(t),trim:async t=>t,supportsNoChainId:!0,recover:(t,e,r)=>nee(t,e,r),encodeSigners:(t,e,r,n)=>Ky(t,e,r),hasEnoughSigningPower:(t,e)=>{const{weight:r}=RO.encodeSigners(t,e,[],0);return r.gte(t.threshold)},chainSignatures:(t,e)=>{throw new Error("Signature chaining not supported on v1")},hashSetImageHash:function(t){throw new Error("Image hash not supported on v1")},signaturesOf(t){return t.signers.filter(e=>e.signature!==void 0).map(e=>({address:e.address,signature:e.signature}))},signaturesOfDecoded:function(t){return t.signers.map(e=>e.signature).filter(e=>e!==void 0)}};var p_e=Object.freeze({__proto__:null,SignaturePartType:N0,isAddressMember:IO,isUnrecoveredSignatureMember:eee,isUnrecoveredSignature:tee,decodeSignature:ree,encodeSignature:PO,recoverSignature:nee,encodeSigners:Ky,SignatureCoder:RO});const TO={isWalletConfig:t=>t.version===1&&t.threshold!==void 0&&t.signers!==void 0,imageHashOf:t=>t.signers.reduce((e,r)=>Tt(Js.encode(["bytes32","uint8","address"],[e,r.weight,r.address])),Zt(["uint256"],[t.threshold])),hasSubdigest:(t,e)=>!1,isComplete:t=>!0,checkpointOf:t=>we.from(0),signersOf:t=>t.signers.map(e=>({address:e.address,weight:we.from(e.weight).toNumber()})),fromSimple:t=>{if(!vn.eq(t.checkpoint))throw new Error("v1 wallet config does not support checkpoint");if(t.subdigests&&t.subdigests.length>0)throw new Error("v1 wallet config does not support subdigests");return{version:1,threshold:t.threshold,signers:t.signers}},update:{isKindUsed:!0,buildTransaction:(t,e,r,n)=>{const i=new fi([...ji.mainModule.abi,...ji.mainModuleUpgradable.abi]),s=[];return(!n||n==="first")&&s.push({to:t,data:i.encodeFunctionData(i.getFunction("updateImplementation"),[r.mainModuleUpgradable]),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}),s.push({to:t,data:i.encodeFunctionData(i.getFunction("updateImageHash"),[TO.imageHashOf(e)]),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}),{entrypoint:t,transactions:s}},decodeTransaction:function(t){throw new Error("Function not implemented.")}},toJSON:function(t){const e=t.signers.map(r=>({weight:we.from(r.weight).toString(),address:r.address}));return JSON.stringify({version:t.version,threshold:we.from(t.threshold).toString(),signers:e})},fromJSON:function(t){const e=JSON.parse(t),r=e.signers.map(n=>({weight:we.from(n.weight),address:n.address}));return{version:e.version,threshold:we.from(e.threshold),signers:r}},editConfig:function(t,e){var r;const n=t.signers.slice();if(e.checkpoint&&!vn.eq(e.checkpoint))throw new Error("v1 wallet config does not support checkpoint");if(e.add)for(const i of e.add)n.find(s=>s.address===i.address)||n.push({weight:i.weight,address:i.address});if(e.remove)for(const i of e.remove){const s=n.findIndex(o=>o.address===i);s>=0&&n.splice(s,1)}return{version:t.version,threshold:(r=e.threshold)!=null?r:t.threshold,signers:n}},buildStubSignature:function(t,e){const r=new Map;for(const[i,s]of e.entries()){r.set(i,{signature:s,isDynamic:!0});const{encoded:o,weight:a}=Ky(t,r,[]);if(a.gte(t.threshold))return o}const n=t.signers;for(const{address:i}of n.sort(({weight:s},{weight:o})=>we.from(s).sub(o).toNumber())){const s="0x4e82f02f388a12b5f9d29eaf2452dd040c0ee5804b4e504b4dd64e396c6c781f2c7624195acba242dd825bfd25a290912e3c230841fd55c9a734c4de8d9899451b02";r.set(i,{signature:s,isDynamic:!1});const{encoded:o,weight:a}=Ky(t,r,[]);if(a.gte(t.threshold))return o}return Ky(t,r,[]).encoded}};var g_e=Object.freeze({__proto__:null,ConfigCoder:TO});const iee=1,see={version:iee,factory:"0xf9D09D634Fb818b05149329C1dcCFAeA53639d96",guestModule:"0x02390F3E6E5FD1C6786CB78FD3027C117a9955A7",mainModule:"0xd01F11855bCcb95f88D7A48492F66410d4637313",mainModuleUpgradable:"0x7EFE6cE415956c5f80C6530cC6cc81b4808F6118",walletCreationCode:"0x603a600e3d39601a805130553df3363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3"};var Lu=Object.freeze({__proto__:null,config:g_e,signature:p_e,version:iee,DeployedWalletContext:see});const OO="0x8713a7c4465f6fbee2b6e9d6646d1d9f83fec929edfc4baf661f3c865bdd04d1";function oee(t){return Tt(aee(t))}function aee(t){return Zt(["bytes32","bytes32"],[OO,t])}function cee(t){const e=Ae(t);if(e.length===64&&Se(e.slice(0,32))===OO)return Se(e.slice(32,64))}function m_e(t){return cee(t)!==void 0}var v_e=Object.freeze({__proto__:null,SetImageHashPrefix:OO,hashSetImageHash:oee,messageSetImageHash:aee,decodeMessageSetImageHash:cee,isMessageSetImageHash:m_e});let Di=function(t){return t[t.Legacy=0]="Legacy",t[t.Dynamic=1]="Dynamic",t[t.NoChainIdDynamic=2]="NoChainIdDynamic",t[t.Chained=3]="Chained",t}({}),jn=function(t){return t[t.Signature=0]="Signature",t[t.Address=1]="Address",t[t.DynamicSignature=2]="DynamicSignature",t[t.Node=3]="Node",t[t.Branch=4]="Branch",t[t.Subdigest=5]="Subdigest",t[t.Nested=6]="Nested",t}({});const x6=66;function Z0(t){return t.left!==void 0&&t.right!==void 0}function Rm(t){return t.tree!==void 0}function X2(t){return t.unrecovered&&t.signature!==void 0&&t.isDynamic!==void 0}function E6(t){let e=Ae(t),r;const n=(i,s)=>i?i.right?{left:i,right:s}:{left:i.left,right:s}:{left:s};for(;e.length>0;){const i=e[0];switch(e=e.slice(1),i){case jn.Signature:{const s=e[0],o=Se(e.slice(1,x6+1));r=n(r,{signature:o,weight:s,unrecovered:!0,isDynamic:!1}),e=e.slice(x6+1)}break;case jn.Address:{const s=e[0],o=qt(Se(e.slice(1,21)));r=n(r,{address:o,weight:s}),e=e.slice(21)}break;case jn.DynamicSignature:{const s=e[0],o=qt(Se(e.slice(1,21))),a=e[21]<<16|e[22]<<8|e[23],c=Se(e.slice(24,24+a));r=n(r,{address:o,signature:c,weight:s,unrecovered:!0,isDynamic:!0}),e=e.slice(24+a)}break;case jn.Node:{const s=Se(e.slice(0,32));r=n(r,{nodeHash:s}),e=e.slice(32)}break;case jn.Branch:{const s=e[0]<<16|e[1]<<8|e[2],o=E6(e.slice(3,3+s));r=n(r,o),e=e.slice(3+s)}break;case jn.Subdigest:{const s=Se(e.slice(0,32));r=n(r,{subdigest:s}),e=e.slice(32)}break;case jn.Nested:{const s=e[0],o=e[1]<<8|e[2],a=e[3]<<16|e[4]<<8|e[5],c=E6(e.slice(6,6+a));r=n(r,{weight:s,threshold:o,tree:c}),e=e.slice(6+a)}break;default:throw new Error(`Unknown signature part type: ${i}: ${Se(e)}`)}}if(!r)throw new Error("Empty signature tree");return r.right?r:r.left}class lee extends Error{constructor(e){super(`Invalid signature leaf: ${JSON.stringify(e)}`),this.leaf=e}}async function M0(t,e,r){if(Z0(t)){const[n,i]=await Promise.all([M0(t.left,e,r),M0(t.right,e,r)]);return{left:n,right:i}}if(Rm(t))return{weight:t.weight,threshold:t.threshold,tree:await M0(t.tree,e,r)};if(X2(t))if(t.isDynamic){if(!t.address)throw new Error("Dynamic signature leaf without address");if(!await kO(t.address,e,t.signature,r))throw new lee(t);return{weight:t.weight,address:t.address,signature:t.signature,subdigest:e}}else return{weight:t.weight,address:Z2(e,t.signature),signature:t.signature,subdigest:e};return t}const ys={concat:(t,e)=>Zt(["bytes","bytes"],[t,e]),node:t=>Zt(["uint8","bytes32"],[jn.Node,t]),branch:t=>{const e=Ae(t);return Zt(["uint8","uint24","bytes"],[jn.Branch,e.length,e])},nested:(t,e,r)=>{const n=Ae(r);return Zt(["uint8","uint8","uint16","uint24","bytes"],[jn.Nested,t,e,n.length,n])},subdigest:t=>Zt(["uint8","bytes32"],[jn.Subdigest,t]),signature:(t,e)=>Zt(["uint8","uint8","bytes"],[jn.Signature,t,e]),dynamicSignature:(t,e,r)=>{const n=Ae(r);return Zt(["uint8","uint8","address","uint24","bytes"],[jn.DynamicSignature,t,e,n.length,n])},address:(t,e)=>Zt(["uint8","uint8","address"],[jn.Address,t,e])};function Jy(t,e,r,n,i={}){const s=Qy(t.tree,e,r,i);return we.from(n).isZero()?{encoded:Zt(["uint8","uint16","uint32","bytes"],[Di.NoChainIdDynamic,t.threshold,t.checkpoint,s.encoded]),weight:s.weight}:we.from(t.threshold).gt(255)?{encoded:Zt(["uint8","uint16","uint32","bytes"],[Di.Dynamic,t.threshold,t.checkpoint,s.encoded]),weight:s.weight}:{encoded:Zt(["uint8","uint8","uint32","bytes"],[Di.Legacy,t.threshold,t.checkpoint,s.encoded]),weight:s.weight}}function Qy(t,e,r,n={}){const i=!n.disableTrim;if(Wc(t)){const s=Qy(t.left,e,r),o=Qy(t.right,e,r),a=Gs(t.left),c=Gs(t.right);return i&&s.weight.eq(0)&&o.weight.eq(0)&&!a&&!c?{encoded:ys.node(Fa(t)),weight:vn}:i&&o.weight.eq(0)&&!c?{encoded:ys.concat(s.encoded,ys.node(Fa(t.right))),weight:s.weight}:i&&s.weight.eq(0)&&!a?{encoded:ys.concat(ys.node(Fa(t.left)),ys.branch(o.encoded)),weight:o.weight}:{encoded:ys.concat(s.encoded,ys.branch(o.encoded)),weight:s.weight.add(o.weight)}}if(kf(t)){const s=Qy(t.tree,e,r);return i&&s.weight.eq(0)?{encoded:ys.node(Fa(t)),weight:vn}:{encoded:ys.nested(t.weight,t.threshold,s.encoded),weight:s.weight}}if(If(t))return{encoded:ys.node(Fa(t)),weight:vn};if(Af(t)){const s=r.includes(t.subdigest);return{encoded:ys.subdigest(t.subdigest),weight:s?KY:vn}}if(Gs(t))if(e.has(t.address)){const o=e.get(t.address),a=o.signature;return n.forceDynamicEncoding||o.isDynamic?{encoded:ys.dynamicSignature(t.weight,t.address,a),weight:we.from(t.weight)}:{encoded:ys.signature(t.weight,a),weight:we.from(t.weight)}}else return{encoded:ys.address(t.weight,t.address),weight:vn};throw new Error(`Invalid topology - unknown error: ${JSON.stringify(t)}`)}function $O(t){return MO(t)?$O(t.suffix[t.suffix.length-1]):t.config}function NO(t){return t.type!==void 0&&t.decoded!==void 0&&t.version!==void 0&&t.version===2}function ew(t){return t.suffix!==void 0&&Array.isArray(t.suffix)&&t.suffix.every(NO)}function uee(t){return t.type!==void 0&&t.config!==void 0&&t.digest!==void 0&&t.version!==void 0&&t.version===2}function MO(t){return t.chain!==void 0&&Array.isArray(t.chain)&&t.chain.every(uee)}function y8(t){const e=Ae(t),r=e[0];switch(r){case Di.Legacy:return{version:2,type:Di.Legacy,decoded:tE(e)};case Di.Dynamic:return{version:2,type:Di.Dynamic,decoded:tE(e.slice(1))};case Di.NoChainIdDynamic:return{version:2,type:Di.NoChainIdDynamic,decoded:tE(e.slice(1))};case Di.Chained:return fee(e);default:throw new Error(`Invalid signature type: ${r}`)}}function tE(t){const e=Ae(t),r=e[0]<<8|e[1],n=e[2]<<24|e[3]<<16|e[4]<<8|e[5],i=E6(e.slice(6));return{threshold:r,checkpoint:n,tree:i}}function fee(t){const e=Ae(t),r=e[0];if(r!==Di.Chained)throw new Error(`Expected chained signature type: ${r}`);const n=[];let i=1;for(;iAe($d(s))),i=Zt(n.map(()=>["uint24","bytes"]).flat(),n.map(s=>[s.length,s]).flat());return Zt(["uint8","bytes"],[Di.Chained,i])}function $d(t){if(Zu(t))return Se(t);if(ew(t)||MO(t))return b8($d(t),(t.suffix||[]).map($d));const e=NO(t)?t.decoded:t.config;switch(t.type){case Di.Legacy:if(we.from(e.threshold).gt(255))throw new Error(`Legacy signature threshold is too large: ${e.threshold} (max 255)`);return hI(e);case Di.NoChainIdDynamic:case Di.Dynamic:return Zt(["uint8","bytes"],[t.type,hI(e)]);case Di.Chained:throw new Error("Unreachable code: Chained signature should be handled above");default:throw new Error(`Invalid signature type: ${t.type}`)}}function hI(t){return Zt(["uint16","uint32","bytes"],[t.threshold,t.checkpoint,Yy(t.tree)])}function Yy(t){if(Wc(t)||Z0(t)){const e=Ae(Yy(t.right)),r=Ae(Yy(t.left));return Wc(t.right)||Z0(t.right)?Zt(["bytes","uint8","uint24","bytes"],[r,jn.Branch,e.length,e]):Zt(["bytes","bytes"],[r,e])}if(kf(t)||Rm(t)){const e=Ae(Yy(t.tree));return Zt(["uint8","uint8","uint16","uint24","bytes"],[jn.Nested,t.weight,t.threshold,e.length,e])}if(X2(t)||Gs(t)&&t.signature!==void 0){const e=Ae(t.signature);if(t.isDynamic||e.length!==x6){if(!t.address)throw new Error("Dynamic signature leaf must have address");return Zt(["uint8","uint8","address","uint24","bytes"],[jn.DynamicSignature,t.weight,t.address,e.length,e])}else return Zt(["uint8","uint8","bytes"],[jn.Signature,t.weight,e])}if(Gs(t))return Zt(["uint8","uint8","address"],[jn.Address,t.weight,t.address]);if(If(t))return Zt(["uint8","bytes32"],[jn.Node,t.nodeHash]);if(Af(t))return Zt(["uint8","bytes32"],[jn.Subdigest,t.subdigest]);throw new Error(`Unknown signature tree type: ${t}`)}function Zy(t){return Wc(t)?[...Zy(t.left),...Zy(t.right)]:kf(t)?Zy(t.tree):Gs(t)&&t.signature?[{address:t.address,signature:t.signature}]:[]}function Xy(t){return Z0(t)?[...Xy(t.left),...Xy(t.right)]:Rm(t)?Xy(t.tree):X2(t)?[t.signature]:[]}function rE(t){return Z0(t)?[...rE(t.left),...rE(t.right)]:Rm(t)?rE(t.tree):Af(t)?[t.subdigest]:[]}async function _6(t){const e=typeof t=="string"?y8(t):t;if(ew(e)){const n=await Promise.all([_6(Yi({},e,{suffix:void 0})),...e.suffix.map(i=>_6(i))]);return b8(n[0],n.slice(1))}const{trimmed:r}=await eb(e.decoded.tree);return $d(Yi({},e,{decoded:Yi({},e.decoded,{tree:r})}))}async function eb(t,e=!0){if(Z0(t)){const[r,n]=await Promise.all([eb(t.left),eb(t.right)]);if(r.weight===0&&n.weight===0)try{const i=await M0(t,c6,void 0);return{weight:0,trimmed:{nodeHash:Fa(i)}}}catch{}else return{weight:r.weight+n.weight,trimmed:{left:r.trimmed,right:n.trimmed}}}if(Rm(t)){const r=await eb(t.tree);if(r.weight===0)try{const n=await M0(t,c6,void 0);return{weight:0,trimmed:{nodeHash:Fa(n)}}}catch{}return{weight:r.weight,trimmed:{weight:t.weight,threshold:t.threshold,tree:r.trimmed}}}return If(t)&&gee(t.nodeHash)?{weight:0,trimmed:Yi({},pee(t.nodeHash))}:X2(t)||Gs(t)&&t.signature!==void 0?{weight:we.from(t.weight).toNumber(),trimmed:t}:!e&&Af(t)?{weight:1/0,trimmed:t}:{weight:0,trimmed:t}}const w8={decode:t=>y8(t),encode:t=>$d(t),trim:t=>_6(t),supportsNoChainId:!0,recover:(t,e,r)=>DO(t,e,r),encodeSigners:(t,e,r,n)=>Jy(t,e,r,n),hasEnoughSigningPower:(t,e)=>{const{weight:r}=w8.encodeSigners(t,e,[],0);return r.gte(t.threshold)},chainSignatures:(t,e)=>{const r=e.reverse(),n=Zu(t)?t:$d(t),i=r.map(s=>Zu(s)?s:$d(s));return b8(n,i)},hashSetImageHash:function(t){return oee(t)},signaturesOf(t){return Zy(t.tree)},signaturesOfDecoded:function(t){return Xy(t.decoded.tree)}};var y_e=Object.freeze({__proto__:null,SignatureType:Di,SignaturePartType:jn,SignaturePartTypeLength:x6,isUnrecoveredNode:Z0,isUnrecoveredNestedLeaf:Rm,isUnrecoveredSignatureLeaf:X2,decodeSignatureTree:E6,InvalidSignatureLeafError:lee,recoverTopology:M0,partEncoder:ys,encodeSigners:Jy,encodeTree:Qy,deepestConfigOfSignature:$O,isUnrecoveredSignature:NO,isUnrecoveredChainedSignature:ew,isSignature:uee,isChainedSignature:MO,decodeSignature:y8,decodeSignatureBody:tE,decodeChainedSignature:fee,setImageHashStruct:dee,recoverSignature:DO,encodeChain:b8,encodeSignature:$d,encodeSignatureBody:hI,encodeSignatureTree:Yy,signaturesOf:Zy,signaturesOfDecoded:Xy,subdigestsOfDecoded:rE,trimSignature:_6,trimUnrecoveredTree:eb,SignatureCoder:w8});function Gs(t){return t.address!==void 0&&t.weight!==void 0}function Af(t){return t.subdigest!==void 0&&t.address===void 0}function tb(t){return Wc(t)?JSON.stringify({left:tb(t.left),right:tb(t.right)}):kf(t)?JSON.stringify({weight:we.from(t.weight).toString(),threshold:we.from(t.threshold).toString(),tree:tb(t.tree)}):Gs(t)?JSON.stringify({address:t.address,weight:we.from(t.weight).toString()}):JSON.stringify(t)}function rb(t){const e=typeof t=="string"?JSON.parse(t):t;return e.left!==void 0&&e.right!==void 0?{left:rb(e.left),right:rb(e.right)}:e.weight!==void 0&&e.threshold!==void 0&&e.tree!==void 0?{weight:we.from(e.weight),threshold:we.from(e.threshold),tree:rb(e.tree)}:e.address!==void 0&&e.weight!==void 0?{address:e.address,weight:we.from(e.weight)}:e}function kf(t){return t.tree!==void 0&&t.weight!==void 0&&t.threshold!==void 0}function If(t){return t.nodeHash!==void 0}function LO(t){return Gs(t)||Af(t)||kf(t)||If(t)}function Wc(t){return t.left!==void 0&&t.right!==void 0}function b_e(t){return Wc(t)||LO(t)}function hee(t){return Zt(["uint96","address"],[t.weight,t.address])}function pee(t){const e=Ae(t);if(e.length!==32)throw new Error("Invalid encoded string length");const r=we.from(e.slice(0,12)),n=qt(Se(e.slice(12)));return{weight:r,address:n}}function gee(t){const e=Ae(t);return e.length!==32?!1:e.slice(0,11).every(n=>n===0)}function Fa(t){if(Gs(t))return hee(t);if(Af(t))return Td(["string","bytes32"],[`Sequence static digest: +`,t.subdigest]);if(kf(t)){const e=Fa(t.tree);return Td(["string","bytes32","uint256","uint256"],[`Sequence nested config: +`,e,t.threshold,t.weight])}return If(t)?t.nodeHash:Td(["bytes32","bytes32"],[Fa(t.left),Fa(t.right)])}function w_e(t){const e=[];let r=t;for(;!LO(r);)e.unshift(r.right),r=r.left;return e.unshift(r),e}function x_e(t){return t.threshold!==void 0&&t.checkpoint!==void 0&&t.tree!==void 0&&t.version!==void 0&&t.version===2}function BO(t){return Td(["bytes32","uint256"],[Td(["bytes32","uint256"],[Fa(t.tree),t.threshold]),t.checkpoint])}function mee(t){return t.threshold!==void 0&&t.weight!==void 0&&t.members!==void 0}function mg(t){return Gs(t)||Af(t)?[t]:kf(t)?[{threshold:t.threshold,weight:t.weight,members:mg(t.tree)}]:If(t)?[]:[...mg(t.left),...mg(t.right)]}function pI(t){return If(t)?!0:Wc(t)?pI(t.left)||pI(t.right):!1}function E_e(t){return{threshold:t.threshold,checkpoint:t.checkpoint,members:mg(t.tree)}}const vee=(t,e)=>t.map(r=>mee(r)?{tree:e(r.members),threshold:r.threshold,weight:r.weight}:r);function FO(t){if(t.length===0)throw new Error("Empty members array");return vee(t,FO).reduce((r,n)=>({left:r,right:n}))}function jO(t){if(t.length===0)throw new Error("Empty members array");const e=vee(t,jO);for(let r=e.length;r>1;r=r/2)for(let n=0;n=r?e[n]=e[i]:e[n]={left:e[i],right:e[s]}}return e[0]}function UO(t){return t.length>8?jO(t):FO(t)}function yee(t,e=UO){return{version:2,threshold:t.threshold,checkpoint:t.checkpoint,tree:e(t.members)}}function C6(t,e){return Af(t)?t.subdigest===e:Wc(t)?C6(t.left,e)||C6(t.right,e):!1}function gI(t){const e=[t],r=new Set;for(;e.length>0;){const n=e.pop();kf(n)?e.push(n.tree):Wc(n)?(e.push(n.left),e.push(n.right)):Gs(n)&&r.add({address:n.address,weight:we.from(n.weight).toNumber()})}return Array.from(r)}function S6(t){return Wc(t)?S6(t.left)&&S6(t.right):!If(t)}const x8={isWalletConfig:t=>t.version===2&&t.threshold!==void 0&&t.tree!==void 0,imageHashOf:t=>BO(t),hasSubdigest:(t,e)=>C6(t.tree,e),checkpointOf:t=>we.from(t.checkpoint),signersOf:t=>gI(t.tree),fromSimple:t=>{var e;return yee(Yi({},t,{members:[...t.signers,...((e=t.subdigests)!=null?e:[]).map(r=>({subdigest:r}))]}))},isComplete:t=>S6(t.tree),update:{isKindUsed:!0,buildTransaction:(t,e,r,n)=>{const i=new fi(ji.mainModuleUpgradable.abi);return{entrypoint:t,transactions:[{to:t,data:i.encodeFunctionData(i.getFunction("updateImageHash"),[x8.imageHashOf(e)]),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}]}},decodeTransaction:function(t){var e,r,n,i;const s=new fi(ji.mainModuleUpgradable.abi);if(t.transactions.length!==1)throw new Error("Invalid transaction bundle, expected 1 transaction");const o=t.transactions[0].data;if(!o)throw new Error("Invalid transaction bundle, expected data");const a=s.decodeFunctionData(s.getFunction("updateImageHash"),o);if(!a)throw new Error("Invalid transaction bundle, expected valid data");if(t.transactions[0].to!==t.entrypoint)throw new Error("Invalid transaction bundle, expected to be sent to entrypoint");if(t.transactions[0].delegateCall)throw new Error("Invalid transaction bundle, expected not to be a delegateCall");if(!t.transactions[0].revertOnError)throw new Error("Invalid transaction bundle, expected revertOnError");if(!vn.eq((e=(r=t.transactions[0])==null?void 0:r.value)!=null?e:0))throw new Error("Invalid transaction bundle, expected value to be 0");if(!vn.eq((n=(i=t.transactions[0])==null?void 0:i.gasLimit)!=null?n:0))throw new Error("Invalid transaction bundle, expected value to be 0");return{address:t.entrypoint,newImageHash:a[0],kind:void 0}}},toJSON:function(t){return JSON.stringify({version:t.version,threshold:we.from(t.threshold).toString(),checkpoint:we.from(t.checkpoint).toString(),tree:tb(t.tree)})},fromJSON:function(t){const e=JSON.parse(t);return{version:e.version,threshold:we.from(e.threshold),checkpoint:we.from(e.checkpoint),tree:rb(e.tree)}},editConfig:function(t,e){var r,n;const i=mg(t.tree);if(e.add)for(const s of e.add)i.find(o=>Gs(o)&&o.address===s.address)||i.push({address:s.address,weight:s.weight});if(e.remove)for(const s of e.remove){const o=i.findIndex(a=>Gs(a)&&a.address===s);o>=0&&i.splice(o,1)}return{version:t.version,threshold:(r=e.threshold)!=null?r:t.threshold,checkpoint:(n=e.checkpoint)!=null?n:t.checkpoint,tree:UO(i)}},buildStubSignature:function(t,e){const r=new Map;for(const[i,s]of e.entries()){r.set(i,{signature:s,isDynamic:!0});const{encoded:o,weight:a}=Jy(t,r,[],0);if(a.gte(t.threshold))return o}const n=gI(t.tree);for(const{address:i}of n.sort(({weight:s},{weight:o})=>s-o)){const s="0x4e82f02f388a12b5f9d29eaf2452dd040c0ee5804b4e504b4dd64e396c6c781f2c7624195acba242dd825bfd25a290912e3c230841fd55c9a734c4de8d9899451b02";r.set(i,{signature:s,isDynamic:!1});const{encoded:o,weight:a}=Jy(t,r,[],0);if(a.gte(t.threshold))return o}return Jy(t,r,[],0).encoded}};var __e=Object.freeze({__proto__:null,isSignerLeaf:Gs,isSubdigestLeaf:Af,topologyToJSON:tb,topologyFromJSON:rb,isNestedLeaf:kf,isNodeLeaf:If,isLeaf:LO,isNode:Wc,isTopology:b_e,encodeSignerLeaf:hee,decodeSignerLeaf:pee,isEncodedSignerLeaf:gee,hashNode:Fa,leftFace:w_e,isWalletConfig:x_e,imageHash:BO,isSimpleNestedMember:mee,topologyToMembers:mg,hasUnknownNodes:pI,toSimpleWalletConfig:E_e,legacyTopologyBuilder:FO,merkleTopologyBuilder:jO,optimized2SignersTopologyBuilder:UO,toWalletConfig:yee,hasSubdigest:C6,signersOf:gI,isComplete:S6,ConfigCoder:x8}),C_e=Object.freeze({__proto__:null});const S_e={config:x8,signature:w8},bee=2,wee={version:bee,factory:"0xFaA5c0b14d1bED5C888Ca655B9a8A5911F78eF4A",guestModule:"0xfea230Ee243f88BC698dD8f1aE93F8301B6cdfaE",mainModule:"0xfBf8f1A5E00034762D928f46d438B947f5d4065d",mainModuleUpgradable:"0x4222dcA3974E39A8b41c411FeDDE9b09Ae14b911",walletCreationCode:"0x603a600e3d39601a805130553df3363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3"};var ir=Object.freeze({__proto__:null,config:__e,signature:y_e,context:C_e,chained:v_e,coders:S_e,version:bee,DeployedWalletContext:wee});function mI(t,e){const r=Tt(Zt(["bytes","bytes32"],[t.walletCreationCode,Hr(t.mainModule,32)])),n=Tt(Zt(["bytes1","address","bytes32","bytes32"],["0xff",t.factory,e,r]));return qt(Fn(n,12))}async function A_e(t,e,r,n,i,s){return(await Promise.all(Oee.map(async a=>{try{const c=a.signature.SignatureCoder.decode(Se(r)),l=await a.signature.SignatureCoder.recover(c,{address:t,digest:Se(e),chainId:n},i),u=a.config.ConfigCoder.imageHashOf(l.config);if(mI(s[a.version],u).toLowerCase()===t.toLowerCase())return!0;const d=await a.signature.SignatureCoder.recover(c,{address:t,digest:Se(e),chainId:n},i),p=a.config.ConfigCoder.imageHashOf(d.config);return mI(s[a.version],p).toLowerCase()===t.toLowerCase()}catch{}return!1}))).some(a=>a)}function k_e(t){const e=Object.keys(t).length;for(let r=1;r<=e;r++){const n=t[r];if(!n||n.version!==r)return!1}return!0}function I_e(t){const e=Object.keys(t).length;return t[e]}const P_e={1:see,2:wee};var R_e=Object.freeze({__proto__:null,addressOf:mI,isValidCounterfactual:A_e,isValidVersionedContext:k_e,latestContext:I_e,defaultContexts:P_e});const E8=`tuple( + bool delegateCall, + bool revertOnError, + uint256 gasLimit, + address target, + uint256 value, + bytes data +)[]`;function T_e(t,e,r,n){return Yi({},t,{chainId:r,intent:{id:n,wallet:e}})}function O_e(t){return Tt(Js.encode(["address","uint256","bytes32"],[t.intent.wallet,t.chainId,t.intent.id]))}function $_e(t){const e=Js.decode(["uint256",E8],t);if(e.length!==2||!e[0]||!e[1])throw new Error("Invalid meta transaction data");return[e[0],e[1]]}function xee(t,e){return Js.encode(["uint256",E8],[t,Wb(e)])}function Eee(t,e){return Tt(xee(t,e))}function N_e(t,e,r,n){return Y2({address:t,chainId:e,digest:Eee(r,n)})}function M_e(t,e,r){return Y2({address:t,chainId:e,digest:Tt(Js.encode(["string",E8],["guest:",Wb(r)]))})}function _ee(t,e){return e.map(r=>zO(t,r))}function zO(t,e){if(e.to&&e.to!==Rn)return{nonce:e.nonce,transaction:{delegateCall:!1,revertOnError:!1,gasLimit:e.gasLimit||0,to:e.to,value:e.value||0,data:e.data||"0x"}};{const r=new fi(ji.mainModule.abi),n=r.encodeFunctionData(r.getFunction("createContract"),[e.data]);return{nonce:e.nonce,transaction:{delegateCall:!1,revertOnError:!1,gasLimit:e.gasLimit,to:t,value:e.value||0,data:n}}}}function _8(t){return t.delegateCall!==void 0||t.revertOnError!==void 0}function Cee(t){return t.every(_8)}function Wb(t){return t.map(e=>{var r;return{delegateCall:e.delegateCall===!0,revertOnError:e.revertOnError===!0,gasLimit:e.gasLimit!==void 0?e.gasLimit:vn,target:(r=e.to)!=null?r:Rn,value:e.value!==void 0?e.value:vn,data:e.data!==void 0?e.data:[]}})}function D_e(t){return t.map(e=>({delegateCall:e.delegateCall,revertOnError:e.revertOnError,gasLimit:e.gasLimit,to:e.target,value:e.value,data:e.data}))}function L_e(t,e){const r=we.from(t),n=we.from(e),i=GY.pow(we.from(96));if(!n.div(i).eq(vn))throw new Error("Space already encoded");return n.add(r.mul(i))}function B_e(t){const e=we.from(t),r=GY.pow(we.from(96));return[e.div(r),e.mod(r)]}function F_e(t,e){return Array.isArray(e)?Cee(e)?e:_ee(t,e).map(n=>n.transaction):_8(e)?[e]:[zO(t,e).transaction]}function See(t){return t!==void 0&&t.entrypoint!==void 0&&t.chainId!==void 0&&t.transactions!==void 0&&t.nonce!==void 0&&t.intent!==void 0&&t.intent.id!==void 0&&t.intent.wallet!==void 0&&Array.isArray(t.transactions)&&t.transactions.reduce((e,r)=>e&&_8(r),!0)}function Aee(t){return t!==void 0&&t.signature!==void 0&&t.signature!==""&&See(t)}function j_e(t){const e=new fi(ji.mainModule.abi);return e.encodeFunctionData(e.getFunction("execute"),Aee(t)?[Wb(t.transactions),t.nonce,t.signature]:[Wb(t.transactions),0,[]])}const kee="0x61c2926c",Iee=`tuple( + bool delegateCall, + bool revertOnError, + uint256 gasLimit, + address target, + uint256 value, + bytes data +)[]`,vI=(t,e)=>{const r=[],n=new fi(ji.mainModule.abi);for(const i of e){const s=Ae(i.data||"0x");if(i.to===t&&Se(s.slice(0,4))===kee){const o=s.slice(4),a=Js.decode([Iee],o)[0];r.push(...vI(i.to,a.map(c=>Yi({},c,{to:c.target}))))}else try{const o=n.decodeFunctionData("execute",s)[0],a=vI(t,o.map(c=>Yi({},c,{to:c.target})));r.push(...a)}catch{r.push(i)}}return r};var U_e=Object.freeze({__proto__:null,MetaTransactionsType:E8,intendTransactionBundle:T_e,intendedTransactionID:O_e,unpackMetaTransactionsData:$_e,packMetaTransactionsData:xee,digestOfTransactions:Eee,subdigestOfTransactions:N_e,subdigestOfGuestModuleTransactions:M_e,toSequenceTransactions:_ee,toSequenceTransaction:zO,isSequenceTransaction:_8,hasSequenceTransactions:Cee,sequenceTxAbiEncode:Wb,fromTxAbiEncode:D_e,encodeNonce:L_e,decodeNonce:B_e,fromTransactionish:F_e,isTransactionBundle:See,isSignedTransactionBundle:Aee,encodeBundleExecData:j_e,selfExecuteSelector:kee,selfExecuteAbi:Iee,unwind:vI});const Pee="0x608060405234801561001057600080fd5b5060405161124a38038061124a83398101604081905261002f91610124565b600060405161003d906100dd565b604051809103906000f080158015610059573d6000803e3d6000fd5b5090506000816001600160a01b0316638f0684308686866040518463ffffffff1660e01b815260040161008e939291906101fb565b6020604051808303816000875af11580156100ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d19190610244565b9050806000526001601ff35b610fdc8061026e83390190565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561011b578181015183820152602001610103565b50506000910152565b60008060006060848603121561013957600080fd5b83516001600160a01b038116811461015057600080fd5b6020850151604086015191945092506001600160401b038082111561017457600080fd5b818601915086601f83011261018857600080fd5b81518181111561019a5761019a6100ea565b604051601f8201601f19908116603f011681019083821181831017156101c2576101c26100ea565b816040528281528960208487010111156101db57600080fd5b6101ec836020830160208801610100565b80955050505050509250925092565b60018060a01b0384168152826020820152606060408201526000825180606084015261022e816080850160208701610100565b601f01601f191691909101608001949350505050565b60006020828403121561025657600080fd5b8151801515811461026657600080fd5b939250505056fe608060405234801561001057600080fd5b50610fbc806100206000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c806376be4cea1161005057806376be4cea146100a65780638f068430146100b957806398ef1ed8146100cc57600080fd5b80631c6453271461006c5780633d787b6314610093575b600080fd5b61007f61007a366004610ad4565b6100df565b604051901515815260200160405180910390f35b61007f6100a1366004610ad4565b61023d565b61007f6100b4366004610b3e565b61031e565b61007f6100c7366004610ad4565b6108e1565b61007f6100da366004610ad4565b61096e565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea9061012890889088908890889088908190600401610bc3565b6020604051808303816000875af1925050508015610181575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261017e91810190610c45565b60015b610232573d8080156101af576040519150601f19603f3d011682016040523d82523d6000602084013e6101b4565b606091505b508051600181900361022757816000815181106101d3576101d3610c69565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f0100000000000000000000000000000000000000000000000000000000000000149250610235915050565b600092505050610235565b90505b949350505050565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea906102879088908890889088906001908990600401610bc3565b6020604051808303816000875af19250505080156102e0575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682019092526102dd91810190610c45565b60015b610232573d80801561030e576040519150601f19603f3d011682016040523d82523d6000602084013e610313565b606091505b506000915050610235565b600073ffffffffffffffffffffffffffffffffffffffff87163b6060827f64926492649264926492649264926492649264926492649264926492649264928888610369602082610c98565b610375928b9290610cd8565b61037e91610d02565b1490508015610484576000606089828a610399602082610c98565b926103a693929190610cd8565b8101906103b39190610e18565b955090925090508415806103c45750865b1561047d576000808373ffffffffffffffffffffffffffffffffffffffff16836040516103f19190610eb2565b6000604051808303816000865af19150503d806000811461042e576040519150601f19603f3d011682016040523d82523d6000602084013e610433565b606091505b50915091508161047a57806040517f9d0d6e2d0000000000000000000000000000000000000000000000000000000081526004016104719190610f18565b60405180910390fd5b50505b50506104be565b87878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509294505050505b80806104ca5750600083115b156106bb576040517f1626ba7e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8b1690631626ba7e90610523908c908690600401610f2b565b602060405180830381865afa92505050801561057a575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261057791810190610f44565b60015b61060f573d8080156105a8576040519150601f19603f3d011682016040523d82523d6000602084013e6105ad565b606091505b50851580156105bc5750600084115b156105db576105d08b8b8b8b8b600161031e565b9450505050506108d7565b806040517f6f2a95990000000000000000000000000000000000000000000000000000000081526004016104719190610f18565b7fffffffff0000000000000000000000000000000000000000000000000000000081167f1626ba7e000000000000000000000000000000000000000000000000000000001480158161065f575086155b801561066b5750600085115b1561068b5761067f8c8c8c8c8c600161031e565b955050505050506108d7565b841580156106965750825b80156106a0575087155b156106af57806000526001601ffd5b94506108d79350505050565b6041871461074b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f5369676e617475726556616c696461746f72237265636f7665725369676e657260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610471565b600061075a6020828a8c610cd8565b61076391610d02565b90506000610775604060208b8d610cd8565b61077e91610d02565b905060008a8a604081811061079557610795610c69565b919091013560f81c915050601b81148015906107b557508060ff16601c14155b15610842576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f5369676e617475726556616c696461746f723a20696e76616c6964207369676e60448201527f617475726520762076616c7565000000000000000000000000000000000000006064820152608401610471565b6040805160008152602081018083528e905260ff831691810191909152606081018490526080810183905273ffffffffffffffffffffffffffffffffffffffff8e169060019060a0016020604051602081039080840390855afa1580156108ad573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff161496505050505050505b9695505050505050565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea9061092b9088908890889088906001908990600401610bc3565b6020604051808303816000875af115801561094a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102329190610c45565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea906109b790889088908890889088908190600401610bc3565b6020604051808303816000875af1925050508015610a10575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252610a0d91810190610c45565b60015b610232573d808015610a3e576040519150601f19603f3d011682016040523d82523d6000602084013e610a43565b606091505b5080516001819003610a6257816000815181106101d3576101d3610c69565b8082fd5b73ffffffffffffffffffffffffffffffffffffffff81168114610a8857600080fd5b50565b60008083601f840112610a9d57600080fd5b50813567ffffffffffffffff811115610ab557600080fd5b602083019150836020828501011115610acd57600080fd5b9250929050565b60008060008060608587031215610aea57600080fd5b8435610af581610a66565b935060208501359250604085013567ffffffffffffffff811115610b1857600080fd5b610b2487828801610a8b565b95989497509550505050565b8015158114610a8857600080fd5b60008060008060008060a08789031215610b5757600080fd5b8635610b6281610a66565b955060208701359450604087013567ffffffffffffffff811115610b8557600080fd5b610b9189828a01610a8b565b9095509350506060870135610ba581610b30565b91506080870135610bb581610b30565b809150509295509295509295565b73ffffffffffffffffffffffffffffffffffffffff8716815285602082015260a060408201528360a0820152838560c0830137600060c085830181019190915292151560608201529015156080820152601f9092017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909101019392505050565b600060208284031215610c5757600080fd5b8151610c6281610b30565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b81810381811115610cd2577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b92915050565b60008085851115610ce857600080fd5b83861115610cf557600080fd5b5050820193919092039150565b80356020831015610cd2577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112610d7e57600080fd5b813567ffffffffffffffff80821115610d9957610d99610d3e565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715610ddf57610ddf610d3e565b81604052838152866020858801011115610df857600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600060608486031215610e2d57600080fd5b8335610e3881610a66565b9250602084013567ffffffffffffffff80821115610e5557600080fd5b610e6187838801610d6d565b93506040860135915080821115610e7757600080fd5b50610e8486828701610d6d565b9150509250925092565b60005b83811015610ea9578181015183820152602001610e91565b50506000910152565b60008251610ec4818460208701610e8e565b9190910192915050565b60008151808452610ee6816020860160208601610e8e565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610c626020830184610ece565b8281526040602082015260006102356040830184610ece565b600060208284031215610f5657600080fd5b81517fffffffff0000000000000000000000000000000000000000000000000000000081168114610c6257600080fdfea26469706673582212201a72aed4b15ffb05b6502997a9bb655992e06590bd26b336dfbb153d7ff6f34b64736f6c63430008120033",z_e="0x6492649264926492649264926492649264926492649264926492649264926492";async function Ree(t,e,r,n){return await t.call({data:zr([Pee,new eO().encode(["address","bytes32","bytes"],[e,r,n])])})==="0x01"}var H_e=Object.freeze({__proto__:null,EIP_6492_OFFCHAIN_DEPLOY_CODE:Pee,EIP_6492_SUFFIX:z_e,validateEIP6492Offchain:Ree});class q_e{constructor(e){this.provider=e,this.isDeployedCache=new Set}module(e){return new km(e,[...ji.mainModuleUpgradable.abi,...ji.mainModule.abi,...ji.erc1271.abi],this.provider)}async isDeployed(e){if(this.isDeployedCache.has(e))return!0;const n=(await this.provider.getCode(e).then(i=>Ae(i))).length!==0;return n&&this.isDeployedCache.add(e),n}async implementation(e){const r=Js.encode(["address"],[e]),n=await this.provider.getStorageAt(e,r).then(i=>Ae(i));if(n.length===20)return qt(Se(n));if(n.length===32)return Js.decode(["address"],n)[0]}async imageHash(e){try{return await this.module(e).imageHash()}catch{}}async nonce(e,r=0){try{return await this.module(e).readNonce(r)}catch(n){if(!await this.isDeployed(e))return 0;throw n}}async isValidSignature(e,r,n){return Ree(this.provider,e,r,n)}}var W_e=Object.freeze({__proto__:null,OnChainReader:q_e});function V_e(t){return t&&t.address&&t.digest&&t.chainId!==void 0&&t.config}var nt=Object.freeze({__proto__:null,config:o_e,signature:a_e,context:R_e,signer:h_e,EIP1271:u_e,transaction:U_e,reader:W_e,EIP6492:H_e,isWalletSignRequestMetadata:V_e});const yI=[{config:TO,signature:RO},{config:x8,signature:w8}];function Tee(t){const e=t-1;if(e<0||e>=yI.length)throw new Error(`No coder for version: ${t}`);return yI[e]}function G_e(t){return Tee(t)}var Gi=Object.freeze({__proto__:null,ALL_CODERS:yI,coderFor:Tee,genericCoderFor:G_e});const Oee=[Lu,ir],K_e=Object.freeze(Object.defineProperty({__proto__:null,allVersions:Oee,commons:nt,universal:Gi,v1:Lu,v2:ir},Symbol.toStringTag,{value:"Module"}));function J_e(t,e,r){for(let n=0;ne.version)&&(e=r);if(e===void 0)throw new Error("No migrations");return e}async getAllMigratePresignedTransaction(e){const{address:r,fromImageHash:n,fromVersion:i,chainId:s}=e;let o=n,a=i;const c=Object.values(this.contexts),l=[];for(let u=1;uAe(s).length===0))return Yj;if(!n.provider)throw new Error("signer.provider is not set, but is required");return n.provider.estimateGas({from:e,to:i.to,data:i.data,value:i.value})}))).map(i=>({executed:!0,succeeded:!0,gasUsed:we.from(i).toNumber(),gasLimit:we.from(i).toNumber()}))}async getNonce(e,r,n){if(!this.provider)throw new Error("provider is not set");if(await this.provider.getCode(e)==="0x")return 0;r===void 0&&(r=0);const s=await new km(e,ji.mainModule.abi,this.provider).readNonce(r,{blockTag:n});return nt.transaction.encodeNonce(r,s)}async wait(e,r,n=this.waitPollRate,i=5){var s=this;typeof e!="string"&&(e=nt.transaction.intendedTransactionID(e));let o=!1;const a=async function(u,f){let d=0;for(;!o;){try{return await u()}catch(p){if(d++,i!==void 0&&d>=i)throw mt.error(`giving up after ${d} failed attempts${f?`: ${f}`:""}`,p),p;mt.warn(`attempt #${d} failed${f?`: ${f}`:""}`,p)}n>0&&await new Promise(p=>setTimeout(p,n))}throw new Error(`timed out after ${d} failed attempts${f?`: ${f}`:""}`)},c=async function(){let u=s.fromBlockLog;if(u<0&&(u=await a(()=>s.provider.getBlockNumber(),"unable to get latest block number")+u),typeof e!="string")throw new Error("impossible");const f=e.replace("0x","");for(;!o;){const d=await a(()=>s.provider.getBlockNumber(),"unable to get latest block number"),p=await a(()=>s.provider.getLogs({fromBlock:Math.max(0,u-s.deltaBlocksLog),toBlock:d,topics:["0x1f180c27086c7a39ea2a7b25239d1ab92348f07ca7bb59d1438fcf527568f881"]}),`unable to get NonceChange logs for blocks ${Math.max(0,u-s.deltaBlocksLog)} to ${d}`);u=d;const v=(await Promise.all(p.map(y=>a(()=>s.provider.getTransactionReceipt(y.transactionHash),`unable to get receipt for transaction ${y.transactionHash}`)))).find(y=>y.logs.find(b=>b.topics.length===0&&b.data.replace("0x","")===f||b.topics.length===1&&b.topics[0]==="0x3dbd1590ea96dd3253a91f24e64e3a502e1225d602a5731357bc12643070ccd7"&&b.data.length>=64&&b.data.replace("0x","").startsWith(f)));if(v)return qd({receipt:v},await a(()=>s.provider.getTransaction(v.transactionHash),`unable to get transaction ${v.transactionHash}`));o||await new Promise(y=>setTimeout(y,n))}throw new Error(`Timeout waiting for transaction receipt ${e}`)};return r!==void 0?Promise.race([c(),new Promise((l,u)=>setTimeout(()=>{o=!0,u(`Timeout waiting for transaction receipt ${e}`)},r))]):c()}}function r8e(t){return t.signer!==void 0&&zd.isSigner(t.signer)}class n8e extends Lee{constructor(e){if(super(zd.isSigner(e)?{provider:e.provider}:qd({},e,{provider:e.signer.provider})),this.signer=void 0,this.txnOptions=void 0,this.signer=zd.isSigner(e)?e:e.signer,!this.signer.provider)throw new Error("Signer must have a provider")}async getFeeOptions(e,...r){return{options:[]}}async getFeeOptionsRaw(e,r,n){return{options:[]}}async gasRefundOptions(e,...r){const{options:n}=await this.getFeeOptions(e,...r);return n}setTransactionOptions(e){this.txnOptions=e}async relay(e,r,n=!0){r!==void 0&&mt.warn("LocalRelayer doesn't accept fee quotes");const i=nt.transaction.encodeBundleExecData(e),s=this.signer.sendTransaction(qd({to:e.entrypoint,data:i},this.txnOptions,{gasLimit:9e6}));if(n){const o=await s;return o.receipt=await o.wait(),o}else return s}}const i8e="v1",s8e="v0.4.0",o8e="950b00c821b56110c64d947312b9dea3e197e207";let yd=function(t){return t.UNKNOWN="UNKNOWN",t.DROPPED="DROPPED",t.QUEUED="QUEUED",t.SENT="SENT",t.SUCCEEDED="SUCCEEDED",t.PARTIALLY_FAILED="PARTIALLY_FAILED",t.FAILED="FAILED",t}({}),a8e=function(t){return t.SEND="SEND",t.RECEIVE="RECEIVE",t.BRIDGE_DEPOSIT="BRIDGE_DEPOSIT",t.BRIDGE_WITHDRAW="BRIDGE_WITHDRAW",t.BURN="BURN",t.UNKNOWN="UNKNOWN",t}({}),c8e=function(t){return t.UNKNOWN="UNKNOWN",t.ERC20_TOKEN="ERC20_TOKEN",t.ERC1155_TOKEN="ERC1155_TOKEN",t}({}),l8e=function(t){return t.DESC="DESC",t.ASC="ASC",t}({});class Bee{constructor(e,r){this.hostname=void 0,this.fetch=void 0,this.path="/rpc/Relayer/",this.ping=n=>this.fetch(this.url("Ping"),Fr({},n)).then(i=>jr(i).then(s=>({status:s.status}))),this.version=n=>this.fetch(this.url("Version"),Fr({},n)).then(i=>jr(i).then(s=>({version:s.version}))),this.runtimeStatus=n=>this.fetch(this.url("RuntimeStatus"),Fr({},n)).then(i=>jr(i).then(s=>({status:s.status}))),this.getSequenceContext=n=>this.fetch(this.url("GetSequenceContext"),Fr({},n)).then(i=>jr(i).then(s=>({data:s.data}))),this.getChainID=n=>this.fetch(this.url("GetChainID"),Fr({},n)).then(i=>jr(i).then(s=>({chainID:s.chainID}))),this.sendMetaTxn=(n,i)=>this.fetch(this.url("SendMetaTxn"),Fr(n,i)).then(s=>jr(s).then(o=>({status:o.status,txnHash:o.txnHash}))),this.getMetaTxnNonce=(n,i)=>this.fetch(this.url("GetMetaTxnNonce"),Fr(n,i)).then(s=>jr(s).then(o=>({nonce:o.nonce}))),this.getMetaTxnReceipt=(n,i)=>this.fetch(this.url("GetMetaTxnReceipt"),Fr(n,i)).then(s=>jr(s).then(o=>({receipt:o.receipt}))),this.simulate=(n,i)=>this.fetch(this.url("Simulate"),Fr(n,i)).then(s=>jr(s).then(o=>({results:o.results}))),this.updateMetaTxnGasLimits=(n,i)=>this.fetch(this.url("UpdateMetaTxnGasLimits"),Fr(n,i)).then(s=>jr(s).then(o=>({payload:o.payload}))),this.feeTokens=n=>this.fetch(this.url("FeeTokens"),Fr({},n)).then(i=>jr(i).then(s=>({isFeeRequired:s.isFeeRequired,tokens:s.tokens}))),this.feeOptions=(n,i)=>this.fetch(this.url("FeeOptions"),Fr(n,i)).then(s=>jr(s).then(o=>({options:o.options,quote:o.quote}))),this.getMetaTxnNetworkFeeOptions=(n,i)=>this.fetch(this.url("GetMetaTxnNetworkFeeOptions"),Fr(n,i)).then(s=>jr(s).then(o=>({options:o.options}))),this.sentTransactions=(n,i)=>this.fetch(this.url("SentTransactions"),Fr(n,i)).then(s=>jr(s).then(o=>({page:o.page,transactions:o.transactions}))),this.pendingTransactions=(n,i)=>this.fetch(this.url("PendingTransactions"),Fr(n,i)).then(s=>jr(s).then(o=>({page:o.page,transactions:o.transactions}))),this.getGasTank=(n,i)=>this.fetch(this.url("GetGasTank"),Fr(n,i)).then(s=>jr(s).then(o=>({gasTank:o.gasTank}))),this.addGasTank=(n,i)=>this.fetch(this.url("AddGasTank"),Fr(n,i)).then(s=>jr(s).then(o=>({status:o.status,gasTank:o.gasTank}))),this.updateGasTank=(n,i)=>this.fetch(this.url("UpdateGasTank"),Fr(n,i)).then(s=>jr(s).then(o=>({status:o.status,gasTank:o.gasTank}))),this.getGasSponsor=(n,i)=>this.fetch(this.url("GetGasSponsor"),Fr(n,i)).then(s=>jr(s).then(o=>({gasSponsor:o.gasSponsor}))),this.listGasSponsors=(n,i)=>this.fetch(this.url("ListGasSponsors"),Fr(n,i)).then(s=>jr(s).then(o=>({page:o.page,gasSponsors:o.gasSponsors}))),this.addGasSponsor=(n,i)=>this.fetch(this.url("AddGasSponsor"),Fr(n,i)).then(s=>jr(s).then(o=>({status:o.status,gasSponsor:o.gasSponsor}))),this.updateGasSponsor=(n,i)=>this.fetch(this.url("UpdateGasSponsor"),Fr(n,i)).then(s=>jr(s).then(o=>({status:o.status,gasSponsor:o.gasSponsor}))),this.removeGasSponsor=(n,i)=>this.fetch(this.url("RemoveGasSponsor"),Fr(n,i)).then(s=>jr(s).then(o=>({status:o.status}))),this.reportGasSponsorUsage=(n,i)=>this.fetch(this.url("ReportGasSponsorUsage"),Fr(n,i)).then(s=>jr(s).then(o=>({gasSponsorUsage:o.gasSponsorUsage}))),this.nextGasTankBalanceAdjustmentNonce=(n,i)=>this.fetch(this.url("NextGasTankBalanceAdjustmentNonce"),Fr(n,i)).then(s=>jr(s).then(o=>({nonce:o.nonce}))),this.adjustGasTankBalance=(n,i)=>this.fetch(this.url("AdjustGasTankBalance"),Fr(n,i)).then(s=>jr(s).then(o=>({status:o.status,adjustment:o.adjustment}))),this.getGasTankBalanceAdjustment=(n,i)=>this.fetch(this.url("GetGasTankBalanceAdjustment"),Fr(n,i)).then(s=>jr(s).then(o=>({adjustment:o.adjustment}))),this.listGasTankBalanceAdjustments=(n,i)=>this.fetch(this.url("ListGasTankBalanceAdjustments"),Fr(n,i)).then(s=>jr(s).then(o=>({page:o.page,adjustments:o.adjustments}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const Fr=(t={},e={})=>({method:"POST",headers:qd({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{})}),jr=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch{throw{code:"unknown",msg:`expecting JSON, got: ${e}`,status:t.status}}if(!t.ok)throw r;return r});var Qg=Object.freeze({__proto__:null,WebRPCVersion:i8e,WebRPCSchemaVersion:s8e,WebRPCSchemaHash:o8e,ETHTxnStatus:yd,TransferType:a8e,FeeTokenType:c8e,SortOrder:l8e,Relayer:Bee});const u8e=[yd.DROPPED,yd.SUCCEEDED,yd.PARTIALLY_FAILED,yd.FAILED],f8e=[yd.DROPPED,yd.PARTIALLY_FAILED,yd.FAILED];function d8e(t){return t.url!==void 0&&typeof t.url=="string"&&t.provider!==void 0&&Sf.isProvider(t.provider)}const h8e=typeof global=="object"?global.fetch:window.fetch;class Fee{constructor(e){if(this.options=e,this.service=void 0,this.provider=void 0,this._fetch=(r,n)=>{const i={},{jwtAuth:s,projectAccessKey:o}=this.options;return s&&s.length>0&&(i.Authorization=`BEARER ${s}`),o&&o.length>0&&(i["X-Access-Key"]=o),n.headers=qd({},n.headers,i),h8e(r,n)},this.service=new Bee(e.url,this._fetch),Sf.isProvider(e.provider))this.provider=e.provider;else{const{jwtAuth:r,projectAccessKey:n}=this.options,i=qb(e.provider.url,n,r);this.provider=new v6(i)}}async waitReceipt(e,r=1e3,n=5,i){typeof e!="string"&&(e=nt.transaction.intendedTransactionID(e)),mt.info(`[rpc-relayer/waitReceipt] waiting for ${e}`);let s=0;for(;i===void 0||!i();){try{const{receipt:o}=await this.service.getMetaTxnReceipt({metaTxID:e});if(o&&o.txnReceipt&&o.txnReceipt!=="null"&&u8e.includes(o.status))return{receipt:o}}catch(o){if(s++,s===n)throw o}(i===void 0||!i())&&await new Promise(o=>setTimeout(o,r))}throw new Error(`Cancelled waiting for transaction receipt ${e}`)}async simulate(e,...r){const i=Js.encode([nt.transaction.MetaTransactionsType],[nt.transaction.sequenceTxAbiEncode(r)]);return(await this.service.simulate({wallet:e,transactions:i})).results}async getFeeOptions(e,...r){const n=await this.service.feeTokens();if(n.isFeeRequired){const i=n.tokens.map(c=>c.symbol).join(", ");mt.info(`[rpc-relayer/getFeeOptions] relayer fees are required, accepted tokens are ${i}`);const s=await this.getNonce(e);if(!this.provider)throw mt.warn("[rpc-relayer/getFeeOptions] provider not set, needed for stub signature"),new Error("provider is not set");const{options:o,quote:a}=await this.service.feeOptions({wallet:e,to:e,data:nt.transaction.encodeBundleExecData({entrypoint:e,transactions:r,nonce:s})});return mt.info(`[rpc-relayer/getFeeOptions] got refund options ${JSON.stringify(o)}`),{options:o,quote:{_tag:"FeeQuote",_quote:a}}}else return mt.info("[rpc-relayer/getFeeOptions] relayer fees are not required"),{options:[]}}async getFeeOptionsRaw(e,r,n){const{options:i,quote:s}=await this.service.feeOptions({wallet:e,to:e,data:Se(r),simulate:n==null?void 0:n.simulate});return{options:i,quote:{_tag:"FeeQuote",_quote:s}}}async gasRefundOptions(e,...r){const{options:n}=await this.getFeeOptions(e,...r);return n}async getNonce(e,r){mt.info(`[rpc-relayer/getNonce] get nonce for wallet ${e} space: ${r}`);const n=r!==void 0?we.from(r).toHexString():void 0,i=await this.service.getMetaTxnNonce({walletContractAddress:e,space:n}),s=we.from(i.nonce),[o,a]=nt.transaction.decodeNonce(s);return mt.info(`[rpc-relayer/getNonce] got next nonce for wallet ${e} ${a} space: ${o}`),s}async relay(e,r,n=!0){var i=this;mt.info(`[rpc-relayer/relay] relaying signed meta-transactions ${JSON.stringify(e)} with quote ${JSON.stringify(r)}`);let s;if(r!==void 0&&(typeof r._quote=="string"?s=r._quote:mt.warn("[rpc-relayer/relay] ignoring invalid fee quote")),!this.provider)throw mt.warn("[rpc-relayer/relay] provider not set, failed relay"),new Error("provider is not set");const o=nt.transaction.encodeBundleExecData(e),a=await this.service.sendMetaTxn({call:{walletAddress:e.intent.wallet,contract:e.entrypoint,input:o},quote:s});if(mt.info(`[rpc-relayer/relay] got relay result ${JSON.stringify(a)}`),n)return this.wait(e.intent.id);{const c={hash:e.intent.id,confirmations:0,from:e.intent.wallet,wait:u=>Promise.reject(new Error("impossible"))},l=async function(f){var d;if(!i.provider)throw new Error("cannot wait for receipt, relayer has no provider set");const p=await i.wait(e.intent.id),g=(d=p.receipt)==null?void 0:d.transactionHash;if(!g)throw new Error("cannot wait for receipt, unknown native transaction hash");return Object.assign(c,p),i.provider.waitForTransaction(g,f)};return c.wait=l,c}}async wait(e,r,n=1e3,i=5){var s=this;let o=!1;const{receipt:a}=await(r!==void 0?Promise.race([this.waitReceipt(e,n,i,()=>o),new Promise((l,u)=>setTimeout(()=>{o=!0,u(`Timeout waiting for transaction receipt ${e}`)},r))]):this.waitReceipt(e,n,i));if(!a.txnReceipt||f8e.includes(a.status))throw new p8e(a);const c=JSON.parse(a.txnReceipt);return{blockHash:c.blockHash,blockNumber:we.from(c.blockNumber).toNumber(),confirmations:1,from:typeof e=="string"?void 0:e.intent.wallet,hash:c.transactionHash,raw:a.txnReceipt,receipt:c,wait:async function(l){return s.provider.waitForTransaction(c.transactionHash,l)}}}}class p8e{constructor(e){this.receipt=e}}function jee(t){return typeof t=="object"&&typeof t.simulate=="function"&&typeof t.getFeeOptions=="function"&&typeof t.gasRefundOptions=="function"&&typeof t.getNonce=="function"&&typeof t.relay=="function"&&typeof t.wait=="function"}const g8e=Object.freeze(Object.defineProperty({__proto__:null,LocalRelayer:n8e,ProviderRelayer:Lee,ProviderRelayerDefaults:Dee,RpcRelayer:Fee,RpcRelayerProto:Qg,isLocalRelayerOptions:r8e,isProviderRelayerOptions:t8e,isRelayer:jee,isRpcRelayerOptions:d8e,proto:Qg},Symbol.toStringTag,{value:"Module"}));function Uee(t){return t.getAddress!==void 0&&t.buildDeployTransaction!==void 0&&t.predecorateSignedTransactions!==void 0&&t.decorateTransactions!==void 0&&t.sign!==void 0&&t.notifyStatusChange!==void 0}class zee{constructor(e,r=!0){this.signer=e,this.eoa=r}getAddress(){return this.signer.getAddress()}async buildDeployTransaction(e){}async predecorateSignedTransactions(e){return[]}async decorateTransactions(e,r){return e}sign(e,r){return this.signer.signMessage(e)}notifyStatusChange(e,r,n){}suffix(){return[2]}}var _I=Object.freeze({__proto__:null,isSapientSigner:Uee,SignerWrapper:zee});let bd=function(t){return t[t.INITIAL=0]="INITIAL",t[t.SIGNING=1]="SIGNING",t[t.SIGNED=2]="SIGNED",t[t.ERROR=3]="ERROR",t}({});function Hee(t){return t===void 0||t.state===bd.INITIAL||t.state===bd.SIGNING}class C8{constructor(e,r=C8.randomTag()){this.tag=r,this.observers=[],this.signers=[],this.count=0,this.setSigners(e)}static randomTag(){return`default-${Se(Pl(8)).slice(2)}`}pullId(){return`${this.tag}-${this.count++}`}setSigners(e){this.signers=e.map(r=>Uee(r)?r:new zee(r))}async getSigners(){return Promise.all(this.signers.map(async function(e){return e.getAddress()}))}subscribe(e){return this.observers.push(e),()=>{this.observers=this.observers.filter(r=>r!==e)}}async notifyObservers(e,r,n){await Promise.all([...this.signers.map(async function(i){return i.notifyStatusChange(e,r,n)}),...this.observers.map(async function(i){return i(r,n)})])}async buildDeployTransaction(e){let r;for(const n of this.signers){const i=await n.buildDeployTransaction(e);r===void 0?r=i:i!=null&&i.transactions&&(r.transactions=i.transactions.concat(r.transactions))}return r}async predecorateSignedTransactions(e){const r=[];for(const n of this.signers)r.push(...await n.predecorateSignedTransactions(e??{}));return r}async decorateTransactions(e,r){for(const n of this.signers)e=await n.decorateTransactions(e,r??{});return e}signMessage(e){var r=this;const n=this.pullId();return new Promise(async function(i){const{message:s,metadata:o,callback:a,candidates:c}=e,l={ended:!1,message:s,signers:{}};let u=o??{};const f=v=>{u=v,r.notifyObservers(n,l,u)},d=()=>{try{r.notifyObservers(n,l,u);const v=Object.entries(l.signers).filter(([y,b])=>Hee(b));if(a&&a(l,f)||v.length===0){l.ended=!0,i(l),r.notifyObservers(n,l,u);return}}catch(v){console.error("Error while notifying observers",v)}};let p=r.signers;if(c){const v=await Promise.all(r.signers.map(async function(y){return y.getAddress()}));p=r.signers.filter((y,b)=>c.includes(v[b]))}const g=await Promise.allSettled(p.map(async function(v){const y=await v.getAddress();l.signers[y]={state:bd.SIGNING,request:v.sign(s,o??{}).then(b=>{const w=v.suffix();return l.signers[y]={state:bd.SIGNED,signature:b,suffix:w},d(),b}).catch(b=>{throw l.signers[y]={state:bd.ERROR,error:b},d(),b})}}));for(let v=0;vQr(e))):Qr(t)}const Xj=t=>{const e=new Map;for(const r of Object.keys(t.signers)){const n=t.signers[r];if(n.state===bd.SIGNED){const i=Ae(n.suffix),s=Zt(["bytes","bytes"],[n.signature,i]);e.set(r,{signature:s,isDynamic:i.length!==1||i[0]!==2})}}return e};class Vb extends zd{constructor(e){if(vn.eq(e.chainId)&&!e.coders.signature.supportsNoChainId)throw new Error(`Sequence version ${e.config.version} doesn't support chainId 0`);super(),this.context=void 0,this.config=void 0,this.address=void 0,this.chainId=void 0,this.provider=void 0,this.relayer=void 0,this.coders=void 0,this.orchestrator=void 0,this._reader=void 0,this.context=e.context,this.config=e.config,this.orchestrator=e.orchestrator,this.coders=e.coders,this.address=e.address,this.chainId=e.chainId,this.provider=e.provider,this.relayer=e.relayer,this._reader=e.reader}static newWallet(e){const r=nt.context.addressOf(e.context,e.coders.config.imageHashOf(e.config));return new Vb(sd({},e,{address:r}))}reader(){if(this._reader)return this._reader;if(!this.provider)throw new Error("Wallet status provider requires a provider");return new nt.reader.OnChainReader(this.provider)}setConfig(e){this.config=e}setOrchestrator(e){this.orchestrator=e}setAddress(e){this.address=e}getSigners(){return this.orchestrator.getSigners()}async getAddress(){return this.address}async decorateTransactions(e){const r=await this.orchestrator.decorateTransactions(e);if(await this.reader().isDeployed(this.address))return r;const n=[{to:r.entrypoint,data:nt.transaction.encodeBundleExecData(r),revertOnError:!0}],i=await this.buildDeployTransaction();return i&&n.unshift(...i.transactions),{entrypoint:this.context.guestModule,chainId:this.chainId,intent:r.intent,transactions:n}}async buildDeployTransaction(e){if(e!=null&&e.ignoreDeployed&&await this.reader().isDeployed(this.address))return;const r=this.coders.config.imageHashOf(this.config);if(nt.context.addressOf(this.context,r)!==this.address)throw new Error(`First address of config ${r} doesn't match wallet address ${this.address}`);const n=Vb.buildDeployTransaction(this.context,r);if(e!=null&&e.includeChildren){const i=await this.orchestrator.buildDeployTransaction(e);i&&(n.transactions=i.transactions.concat(n.transactions))}return n}async deploy(e){const r=await this.buildDeployTransaction(e);if(r!==void 0){if(!this.relayer)throw new Error("Wallet deploy requires a relayer");return this.relayer.relay(sd({},r,{chainId:this.chainId,intent:{id:Se(Pl(32)),wallet:this.address}}))}}static buildDeployTransaction(e,r){const n=new fi(ji.factory.abi);return{entrypoint:e.guestModule,transactions:[{to:e.factory,data:n.encodeFunctionData(n.getFunction("deploy"),[e.mainModule,r]),gasLimit:1e5,delegateCall:!1,revertOnError:!0,value:0}]}}async buildUpdateConfigurationTransaction(e){if(this.coders.config.update.isKindUsed){const r=await this.reader().implementation(this.address),n=r&&r===this.context.mainModuleUpgradable;return this.coders.config.update.buildTransaction(this.address,e,this.context,n?"later":"first")}return this.coders.config.update.buildTransaction(this.address,e,this.context)}async getNonce(e=0){const r=await this.reader().nonce(this.address,e);if(r===void 0)throw new Error("Unable to determine nonce");return r}async signDigest(e,r){const n=fI(this.address,this.chainId,e);if(this.coders.config.hasSubdigest(this.config,n))return this.coders.signature.encodeSigners(this.config,new Map,[n],this.chainId).encoded;const i=sd({},r,{digest:e,chainId:this.chainId,address:this.address,config:this.config}),s=Ae(n),o=await this.orchestrator.signMessage({candidates:this.coders.config.signersOf(this.config).map(c=>c.address),message:s,metadata:i,callback:(c,l)=>{const u=Xj(c),f=sd({},i,{parts:u});return l(f),this.coders.signature.hasEnoughSigningPower(this.config,u)}}),a=Xj(o);return this.coders.signature.encodeSigners(this.config,a,[],this.chainId).encoded}signMessage(e){return this.signDigest(Tt(e),{message:e})}signTransactionBundle(e){if(e.entrypoint!==this.address)throw new Error(`Invalid entrypoint: ${e.entrypoint} !== ${this.address}`);return this.signTransactions(e.transactions,e.nonce)}async fetchNonceOrSpace(e){let r;if(e&&e.space!==void 0)r=we.from(e.space);else{if(e===void 0)return this.randomNonce();if(e&&e.serial===!0)r=0;else return e}const n=await this.reader().nonce(this.address,r);if(n===void 0)throw new Error("Unable to determine nonce");return nt.transaction.encodeNonce(r,n)}randomNonce(){const e=we.from(Se(Pl(12)));return nt.transaction.encodeNonce(e,0)}async signTransactions(e,r,n){const i=await Zj(e),s=nt.transaction.fromTransactionish(this.address,i);s.length===0&&s.push({to:this.address,data:"0x",value:0,gasLimit:0,delegateCall:!1,revertOnError:!0});const o=await this.fetchNonceOrSpace(r),a=nt.transaction.digestOfTransactions(o,s),c=sd({digest:a,transactions:s},n),l=await this.signDigest(a,c);return{intent:{id:fI(this.address,this.chainId,a),wallet:this.address},chainId:this.chainId,transactions:s,entrypoint:this.address,nonce:o,signature:l}}async sendSignedTransaction(e,r){if(!this.relayer)throw new Error("Wallet sendTransaction requires a relayer");return this.relayer.relay(e,r)}async sendTransaction(e,r){let n;(r==null?void 0:r.nonce)!==void 0?n=r.nonce:r!=null&&r.serial?n={serial:!0}:n=this.randomNonce();const i=await this.signTransactions(e,n),s=await this.decorateTransactions(i);return this.sendSignedTransaction(s,r==null?void 0:r.quote)}async fillGasLimits(e){const r=await Zj(e),n=nt.transaction.fromTransactionish(this.address,r),i=this.relayer;if(!i)throw new Error("Wallet fillGasLimits requires a relayer");const s=await i.simulate(this.address,...n);return n.map((o,a)=>{const c=o.gasLimit?we.from(o.gasLimit).toNumber():s[a].gasLimit;return sd({},o,s[a],{gasLimit:c})})}connect(e,r){return this.provider=e,this.relayer=r,this}signTransaction(e){throw new Error("Method not implemented.")}}function Cu(){return Cu=Object.assign?Object.assign.bind():function(t){for(var e=1;ev8e(t[e])):!1}function b8e(t){if(!t)return[];const e=we.from(t.value);switch(t.token.type){case Qg.FeeTokenType.UNKNOWN:return[{delegateCall:!1,revertOnError:!0,gasLimit:t.gasLimit,to:t.to,value:e.toHexString(),data:[]}];case Qg.FeeTokenType.ERC20_TOKEN:if(!t.token.contractAddress)throw new Error("No contract address for ERC-20 fee option");return[{delegateCall:!1,revertOnError:!0,gasLimit:t.gasLimit,to:t.token.contractAddress,value:0,data:new fi([{constant:!1,inputs:[{type:"address"},{type:"uint256"}],name:"transfer",outputs:[],type:"function"}]).encodeFunctionData("transfer",[t.to,e.toHexString()])}];default:throw new Error(`Unhandled fee token type ${t.token.type}`)}}class w8e{constructor(e,r,n){this.account=e,this.chainId=r,this.options=n,this._isSigner=!0}get provider(){return this.account.providerFor(this.chainId)}async getAddress(){return this.account.address}signMessage(e){var r,n;return this.account.signMessage(e,this.chainId,(r=(n=this.options)==null?void 0:n.cantValidateBehavior)!=null?r:"throw")}async defaultSelectFee(e,r){if(r.length===0)return;const n=[{constant:!0,inputs:[{type:"address"}],name:"balanceOf",outputs:[{type:"uint256"}],type:"function"}];for(const i of r)if(i.token.type===Qg.FeeTokenType.UNKNOWN){if((await this.getBalance()).gte(we.from(i.value)))return i}else if(i.token.contractAddress&&i.token.type===Qg.FeeTokenType.ERC20_TOKEN&&(await new km(i.token.contractAddress,n,this.provider).balanceOf(this.account.address)).gte(we.from(i.value)))return i;throw new Error("No fee option available - not enough balance")}async sendTransaction(e,r){var n,i,s,o,a;const c=y8e(e)?await Qr(e):e,l=await this.account.prepareTransactions({txs:c,chainId:this.chainId,stubSignatureOverrides:(n=(i=this.options)==null?void 0:i.stubSignatureOverrides)!=null?n:new Map,simulateForFeeOptions:r==null?void 0:r.simulateForFeeOptions}),f=await((s=(o=this.options)==null?void 0:o.selectFee)!=null?s:this.defaultSelectFee.bind(this))(c,l.feeOptions),d=[...l.transactions,...b8e(f)];return this.account.sendTransaction(d,this.chainId,l.feeQuote,void 0,void 0,((a=this.options)==null?void 0:a.nonceSpace)!==void 0?{nonceSpace:this.options.nonceSpace}:void 0)}getBalance(e){return this.provider.getBalance(this.account.address,e)}call(e,r){return this.provider.call(e,r)}async resolveName(e){const r=await this.provider.resolveName(e);if(!r)throw new Error(`Could not resolve name ${e}`);return r}connect(e){throw new Error("Method not implemented.")}signTransaction(e){throw new Error("Method not implemented.")}getTransactionCount(e){throw new Error("Method not implemented.")}estimateGas(e){throw new Error("Method not implemented.")}getChainId(){return Promise.resolve(we.from(this.chainId).toNumber())}getGasPrice(){throw new Error("Method not implemented.")}getFeeData(){throw new Error("Method not implemented.")}checkTransaction(e){throw new Error("Method not implemented.")}populateTransaction(e){throw new Error("Method not implemented.")}_checkProvider(e){throw new Error("Method not implemented.")}}class x8e{async isDeployed(e){return!1}async implementation(e){}async imageHash(e){}async nonce(e,r){return vn}async isValidSignature(e,r,n){throw new Error("Method not supported.")}}class ju{constructor(e){this.address=void 0,this.networks=void 0,this.tracker=void 0,this.contexts=void 0,this.migrator=void 0,this.migrations=void 0,this.orchestrator=void 0,this.jwt=void 0,this.projectAccessKey=void 0,this.address=qt(e.address),this.contexts=e.contexts,this.tracker=e.tracker,this.networks=e.networks,this.orchestrator=e.orchestrator,this.jwt=e.jwt,this.projectAccessKey=e.projectAccessKey,this.migrations=e.migrations||EI.DefaultMigrations,this.migrator=new xI.Migrator(e.tracker,this.migrations,this.contexts)}getSigner(e,r){return new w8e(this,e,r)}static async new(e){var r;const i=new xI.Migrator(e.tracker,(r=e.migrations)!=null?r:EI.DefaultMigrations,e.contexts).lastMigration(),s=i.configCoder,o=s.fromSimple(e.config),a=s.imageHashOf(o),c=e.contexts[i.version],l=nt.context.addressOf(c,a);return await e.tracker.saveCounterfactualWallet({config:o,context:Object.values(e.contexts)}),new ju({address:l,tracker:e.tracker,contexts:e.contexts,networks:e.networks,orchestrator:e.orchestrator,migrations:e.migrations,projectAccessKey:e.projectAccessKey})}getAddress(){return Promise.resolve(this.address)}get version(){return this.migrator.lastMigration().version}get coders(){const e=this.migrator.lastMigration();return{signature:e.signatureCoder,config:e.configCoder}}network(e){const r=we.from(e),n=this.networks.find(i=>r.eq(i.chainId));if(!n)throw new Error(`Network not found for chainId ${e}`);return n}providerFor(e){const r=this.network(e);if(!r.provider&&!r.rpcUrl)throw new Error(`Provider not found for chainId ${e}`);return r.provider||new v6(qb(r.rpcUrl,this.projectAccessKey,this.jwt),{name:"",chainId:we.from(e).toNumber()})}reader(e){return vn.eq(e)?new x8e:new nt.reader.OnChainReader(this.providerFor(e))}relayer(e){const r=this.network(e);if(!r.relayer)throw new Error(`Relayer not found for chainId ${e}`);return jee(r.relayer)?r.relayer:new Fee(Cu({},r.relayer,{projectAccessKey:this.projectAccessKey,jwtAuth:this.jwt}))}setOrchestrator(e){this.orchestrator=e}setJwt(e){this.jwt=e}contextFor(e){const r=this.contexts[e];if(!r)throw new Error(`Context not found for version ${e}`);return r}walletForStatus(e,r){const n=Gi.coderFor(r.version);return this.walletFor(e,this.contextFor(r.version),r.config,n)}walletFor(e,r,n,i){const s=vn.eq(e);return new Vb({config:n,context:r,chainId:e,coders:i,relayer:s?void 0:this.relayer(e),address:this.address,orchestrator:this.orchestrator,reader:this.reader(e)})}async status(e,r=!1){var n=this;const i=this.reader(e).isDeployed(this.address),s=this.tracker.imageHashOfCounterfactualWallet({wallet:this.address}).then(S=>{if(!S)throw new Error(`Counterfactual imageHash not found for wallet ${this.address}`);return S}),o=s.then(S=>$ee.counterfactualVersion(this.address,S.imageHash,Object.values(this.contexts))),a=async function(){if(!await i)return o;const P=await n.reader(e).implementation(n.address);if(!P)throw new Error(`Implementation not found for wallet ${n.address}`);const _=Object.values(n.contexts);for(let T=0;T<_.length;T++)if(_[T].mainModule===P||_[T].mainModuleUpgradable===P)return _[T].version;throw new Error(`Version not found for implementation ${P}`)}(),c=async function(){const S=await n.reader(e).imageHash(n.address);if(S)return S;const P=await s;if(P)return P.imageHash;throw new Error(`On-chain imageHash not found for wallet ${n.address}`)}(),l=async function(){const S=await c,P=await n.tracker.configOfImageHash({imageHash:S});if(P)return P;throw new Error(`On-chain config not found for imageHash ${S}`)}(),u=await a,f=await c;let d=f,p=u,g=[];if(u!==this.version){const S=await this.migrator.getAllMigratePresignedTransaction({address:this.address,fromImageHash:f,fromVersion:u,chainId:e});d=S.lastImageHash,p=S.lastVersion,g=S.signedMigrations}const v=await this.tracker.loadPresignedConfiguration({wallet:this.address,fromImageHash:d,longestPath:r}),y=v&&v.length>0?v[v.length-1].nextImageHash:d,b=await this.tracker.configOfImageHash({imageHash:y});if(!b)throw new Error(`Config not found for imageHash ${y}`);const w=await i,E=await s,C=Gi.coderFor(p).config.checkpointOf(b);return{original:Cu({},E,{version:await o}),onChain:{imageHash:f,config:await l,version:u,deployed:w},fullyMigrated:p===this.version,signedMigrations:g,version:p,presignedConfigurations:v,imageHash:y,config:b,checkpoint:C,canOnchainValidate:u===this.version&&w}}mustBeFullyMigrated(e){if(!e.fullyMigrated)throw new Error(`Wallet ${this.address} is not fully migrated`)}async predecorateSignedTransactions(e,r){const n=await this.orchestrator.predecorateSignedTransactions({chainId:r}),i=await this.predecorateTransactions([],e,r);return nt.transaction.fromTransactionish(this.address,i).length>0&&n.push(await this.signTransactions(i,r)),n}async predecorateTransactions(e,r,n){if(r.onChain.imageHash!==r.imageHash){const s=await this.walletForStatus(n,r).buildUpdateConfigurationTransaction(r.config);return[Array.isArray(e)?e:[e],s.transactions].flat()}return e}async decorateTransactions(e,r,n){var i,s;if(!Array.isArray(e))return this.decorateTransactions([e],r,n);n=(i=n)!=null?i:e[0].chainId;const o=await this.buildBootstrapTransactions(r,n),a=o.transactions.length>0;if(!a&&e.length===1)return e[0];const{entrypoint:c}=a?o:e[0],l={entrypoint:c,chainId:n,intent:(s=e[0])==null?void 0:s.intent,transactions:[...o.transactions,...e.map(u=>({to:u.entrypoint,data:nt.transaction.encodeBundleExecData(u),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}))]};if(!r.onChain.deployed){const u=nt.transaction.subdigestOfGuestModuleTransactions(this.contexts[this.version].guestModule,n,l.transactions);l.intent===void 0?l.intent={id:u,wallet:this.address}:l.intent.id=u}return l}async decorateSignature(e,r){if(!r.presignedConfigurations||r.presignedConfigurations.length===0)return e;const n=this.coders.signature,i=r.presignedConfigurations.map(o=>o.signature),s=n.chainSignatures(e,i);return n.trim(s)}async publishWitness(){const e=Tt(qr(`This is a Sequence account woo! ${Date.now()}`)),r=await this.signDigest(e,0,!1),n=this.coders.signature.decode(r),i=this.coders.signature.signaturesOfDecoded(n);return this.tracker.saveWitnesses({wallet:this.address,digest:e,chainId:0,signatures:i})}async signDigest(e,r,n=!0,i="ignore",s){const o=vn.eq(r)?this.networks[0].chainId:r,a=await this.status(o);if(this.mustBeFullyMigrated(a),!a.canOnchainValidate&&i==="throw")throw new Error("Wallet cannot validate onchain");const l=await this.walletForStatus(r,a).signDigest(e,s),u=n?this.decorateSignature(l,a):l;if(!a.canOnchainValidate)switch(i){case"ignore":return u;case"eip6492":return this.buildEIP6492Signature(await u,a,r)}return u}buildOnChainSignature(e){const r=nt.signature.subdigestOf({digest:Se(e),chainId:0,address:this.address}),n=Se(r),i=this.coders.config.fromSimple({threshold:32768,checkpoint:0,signers:[],subdigests:[n]}),s=new fi(ji.mainModule.abi),o={entrypoint:this.address,transactions:[{to:this.address,data:s.encodeFunctionData("setExtraImageHash",[this.coders.config.imageHashOf(i),"57896044618658097711785492504343953926634992332820282019728792003956564819968"]),gasLimit:25e4}]};this.tracker.saveWalletConfig({config:i});const a=this.coders.signature.encodeSigners(i,new Map,[n],0).encoded;return{bundle:o,signature:a}}async buildEIP6492Signature(e,r,n){const i=await this.buildBootstrapTransactions(r,n);if(i.transactions.length===0)throw new Error("Cannot build EIP-6492 signature without bootstrap transactions");const s=Js.encode(["address","bytes","bytes"],[i.entrypoint,nt.transaction.encodeBundleExecData(i),e]);return Zt(["bytes","bytes32"],[s,nt.EIP6492.EIP_6492_SUFFIX])}async editConfig(e){const r=await this.status(0).then(i=>i.config),n=this.coders.config.editConfig(r,Cu({},e,{checkpoint:this.coders.config.checkpointOf(r).add(1)}));return this.updateConfig(n)}async updateConfig(e){if(!this.coders.config.isWalletConfig(e))throw new Error(`Invalid config for wallet ${this.address}`);const r=this.coders.config.imageHashOf(e),n=this.coders.signature.hashSetImageHash(r),i=await this.signDigest(n,0,!1);await this.tracker.savePresignedConfiguration({wallet:this.address,nextConfig:e,signature:i});const s=await this.tracker.configOfImageHash({imageHash:r,noCache:!0});if(!s||this.coders.config.imageHashOf(s)!==r)throw Error(`Reverse lookup failed for imageHash ${r}`)}async buildBootstrapTransactions(e,r){var n;const i=await this.orchestrator.buildDeployTransaction({chainId:r}),s=(n=i==null?void 0:i.transactions)!=null?n:[];if(!e.onChain.deployed){const c=Vb.buildDeployTransaction(e.original.context,e.original.imageHash);s.push(...c.transactions)}s.length,s.push(...e.signedMigrations.map(c=>({to:c.tx.entrypoint,data:nt.transaction.encodeBundleExecData(c.tx),value:0,gasLimit:0,revertOnError:!0,delegateCall:!1})));const o=e.signedMigrations.length>0?e.signedMigrations[0].tx.intent.id:nt.transaction.subdigestOfGuestModuleTransactions(this.contexts[this.version].guestModule,r,s),{guestModule:a}=this.contextFor(e.version);return{entrypoint:a,transactions:s,chainId:r,intent:{id:o,wallet:this.address}}}async bootstrapTransactions(e,r){const n=r||await this.status(e);return this.buildBootstrapTransactions(n,e)}async doBootstrap(e,r,n){const i=await this.bootstrapTransactions(e,n);return this.relayer(e).relay(Cu({},i,{chainId:e}),r)}signMessage(e,r,n="ignore"){return this.signDigest(Tt(e),r,!0,n)}async signTransactions(e,r,n,i){const s=n||await this.status(r);this.mustBeFullyMigrated(s);const o=this.walletForStatus(r,s),a={address:this.address,digest:"",chainId:r,config:{version:this.version},decorate:!0,cantValidateBehavior:"ignore"},c=i!=null&&i.serial?{serial:!0}:(i==null?void 0:i.nonceSpace)!==void 0?{space:i.nonceSpace}:void 0,l=await o.signTransactions(e,c,a);return Cu({},l,{signature:await this.decorateSignature(l.signature,s)})}async signMigrations(e,r){const n=await this.status(e);if(n.fullyMigrated)return!1;const i=this.walletForStatus(e,n),s=r(i.config),o=await this.migrator.signNextMigration(this.address,n.version,i,s);if(!o)return!1;await this.tracker.saveWalletConfig({config:s});const a=Gi.coderFor(s.version).config,c=a.imageHashOf(s),l=await this.tracker.configOfImageHash({imageHash:c,noCache:!0});if(!l||a.imageHashOf(l)!==c)throw Error(`Reverse lookup failed for imageHash ${c}`);return await this.tracker.saveMigration(this.address,o,this.contexts),!0}async signAllMigrations(e){var r=this;const n=[];return{signedMigrations:(await Promise.all(this.networks.map(async function(o){try{return await r.signMigrations(o.chainId,e)}catch(a){return console.warn(`Failed to sign migrations for chain ${o.chainId}`,a),n.push(o.chainId),null}}))).filter(o=>o!==null),failedChains:n}}async isMigratedAllChains(){var e=this;const r=[];return{migratedAllChains:(await Promise.all(this.networks.map(async function(s){try{return await e.status(s.chainId)}catch(o){return r.push(s.chainId),console.warn(`Failed to get status for chain ${s.chainId}`,o),{fullyMigrated:!0}}}))).every(s=>s.fullyMigrated),failedChains:r}}async sendSignedTransactions(e,r,n,i,s){if(!Array.isArray(e))return this.sendSignedTransactions([e],r,n,i,s);const o=i||await this.status(r);this.mustBeFullyMigrated(o);const a=await this.decorateTransactions(e,o,r);return s==null||s(a),this.relayer(r).relay(a,n)}async fillGasLimits(e,r,n){return this.walletForStatus(r,n||await this.status(r)).fillGasLimits(e)}async gasRefundQuotes(e,r,n,i,s){const o=i||await this.status(r),a=this.walletForStatus(r,o),c=await this.predecorateTransactions(e,o,r),l=nt.transaction.fromTransactionish(this.address,c),u=a.coders.config.buildStubSignature(a.config,n),f=Se(Pl(32)),d={chainId:r,intent:{id:f,wallet:this.address},signature:u,transactions:l,entrypoint:this.address,nonce:0},p=await this.decorateTransactions(d,o),g=nt.transaction.encodeBundleExecData(p),v=await this.relayer(r).getFeeOptionsRaw(p.entrypoint,g,s);return Cu({},v,{decorated:p})}async prepareTransactions(e){const r=await this.status(e.chainId),n=await this.fillGasLimits(e.txs,e.chainId,r),i=await this.gasRefundQuotes(n,e.chainId,e.stubSignatureOverrides,r,{simulate:e.simulateForFeeOptions}),s=nt.transaction.unwind(this.address,i.decorated.transactions);return{transactions:n,flatDecorated:s,feeOptions:i.options,feeQuote:i.quote}}async sendTransaction(e,r,n,i=!1,s,o){const a=await this.status(r),c=i?e:await this.predecorateTransactions(e,a,r),u=nt.transaction.fromTransactionish(this.address,c).length>0?await this.signTransactions(c,r,void 0,o):void 0,f=await this.orchestrator.predecorateSignedTransactions({chainId:r}),d=[];return u!==void 0&&u.transactions.length>0&&d.push(u),d.push(...f.filter(p=>p.transactions.length>0)),this.sendSignedTransactions(d,r,n,void 0,s)}async signTypedData(e,r,n,i,s="ignore"){const o=Q2({domain:e,types:r,message:n});return this.signDigest(o,i,!0,s)}async getSigners(){var e=this;const r=n=>n.length?n[n.length-1]:void 0;return(await Promise.all(this.networks.map(async function({chainId:n,name:i}){try{var s;const o=await e.status(n);let a=(s=r(o.presignedConfigurations))==null?void 0:s.nextImageHash;if(!a&&o.onChain.version!==o.version){const f=r(o.signedMigrations);if(f){const{toVersion:d,toConfig:p}=f;a=Gi.genericCoderFor(d).config.imageHashOf(p)}}a||(a=o.onChain.imageHash);const c=await e.tracker.configOfImageHash({imageHash:a});if(!c)throw new Error(`unable to find config for image hash ${a}`);return Gi.genericCoderFor(c.version).config.signersOf(c).map(f=>Cu({},f,{network:n}))}catch(o){return console.warn(`unable to get signers on network ${n} ${i}`,o),[]}}))).flat()}async getAllSigners(){var e=this;const r=[];return await Promise.all(this.networks.map(async function(n){const i=n.chainId,s=await e.status(i,!0),o=[s.onChain.imageHash,...s.onChain.version!==s.version?s.signedMigrations.map(a=>Gi.coderFor(a.toVersion).config.imageHashOf(a.toConfig)):[],...s.presignedConfigurations.map(a=>a.nextImageHash)];return Promise.all(o.map(async function(a,c){const l=c===o.length-1,u=await e.tracker.configOfImageHash({imageHash:a});if(!u){console.warn(`AllSigners may be incomplete, config not found for imageHash ${a}`);return}Gi.genericCoderFor(u.version).config.signersOf(u).forEach(p=>{const g=r.find(v=>v.address===p.address&&v.network===i);if(g&&l&&g.flaggedForRemoval){g.flaggedForRemoval=!1;return}g||r.push({address:p.address,weight:p.weight,network:i,flaggedForRemoval:!l})})}))})),r}}function E8e(t){return t instanceof ju}const _8e=Object.freeze(Object.defineProperty({__proto__:null,Account:ju,isAccount:E8e},Symbol.toStringTag,{value:"Module"}));function A6(){return A6=Object.assign?Object.assign.bind():function(t){for(var e=1;ethis.fetch(this.url("Ping"),Ii({},n)).then(i=>Pi(i).then(s=>({status:s.status}))),this.version=n=>this.fetch(this.url("Version"),Ii({},n)).then(i=>Pi(i).then(s=>({version:s.version}))),this.runtimeStatus=n=>this.fetch(this.url("RuntimeStatus"),Ii({},n)).then(i=>Pi(i).then(s=>({status:s.status}))),this.getChainID=n=>this.fetch(this.url("GetChainID"),Ii({},n)).then(i=>Pi(i).then(s=>({chainID:s.chainID}))),this.getEtherBalance=(n,i)=>this.fetch(this.url("GetEtherBalance"),Ii(n,i)).then(s=>Pi(s).then(o=>({balance:o.balance}))),this.getTokenBalances=(n,i)=>this.fetch(this.url("GetTokenBalances"),Ii(n,i)).then(s=>Pi(s).then(o=>({page:o.page,balances:o.balances}))),this.getTokenSupplies=(n,i)=>this.fetch(this.url("GetTokenSupplies"),Ii(n,i)).then(s=>Pi(s).then(o=>({page:o.page,contractType:o.contractType,tokenIDs:o.tokenIDs}))),this.getTokenSuppliesMap=(n,i)=>this.fetch(this.url("GetTokenSuppliesMap"),Ii(n,i)).then(s=>Pi(s).then(o=>({supplies:o.supplies}))),this.getBalanceUpdates=(n,i)=>this.fetch(this.url("GetBalanceUpdates"),Ii(n,i)).then(s=>Pi(s).then(o=>({page:o.page,balances:o.balances}))),this.getTransactionHistory=(n,i)=>this.fetch(this.url("GetTransactionHistory"),Ii(n,i)).then(s=>Pi(s).then(o=>({page:o.page,transactions:o.transactions}))),this.syncBalance=(n,i)=>this.fetch(this.url("SyncBalance"),Ii(n,i)).then(s=>Pi(s).then(o=>({}))),this.fetchTransactionReceipt=(n,i)=>this.fetch(this.url("FetchTransactionReceipt"),Ii(n,i)).then(s=>Pi(s).then(o=>({receipt:o.receipt}))),this.fetchTransactionReceiptWithFilter=(n,i)=>this.fetch(this.url("FetchTransactionReceiptWithFilter"),Ii(n,i)).then(s=>Pi(s).then(o=>({receipt:o.receipt}))),this.getAllWebhookListeners=(n,i)=>this.fetch(this.url("GetAllWebhookListeners"),Ii(n,i)).then(s=>Pi(s).then(o=>({listeners:o.listeners}))),this.getWebhookListener=(n,i)=>this.fetch(this.url("GetWebhookListener"),Ii(n,i)).then(s=>Pi(s).then(o=>({listener:o.listener}))),this.addWebhookListener=(n,i)=>this.fetch(this.url("AddWebhookListener"),Ii(n,i)).then(s=>Pi(s).then(o=>({status:o.status,listener:o.listener}))),this.updateWebhookListener=(n,i)=>this.fetch(this.url("UpdateWebhookListener"),Ii(n,i)).then(s=>Pi(s).then(o=>({status:o.status}))),this.removeWebhookListener=(n,i)=>this.fetch(this.url("RemoveWebhookListener"),Ii(n,i)).then(s=>Pi(s).then(o=>({status:o.status}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const Ii=(t={},e={})=>({method:"POST",headers:A6({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{})}),Pi=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch{throw{code:"unknown",msg:`expecting JSON, got: ${e}`,status:t.status}}if(!t.ok)throw r;return r}),eU=typeof global=="object"?global.fetch:window.fetch;class qO extends qee{constructor(e,r,n){super(e.endsWith("/")?e.slice(0,-1):e,eU),this.projectAccessKey=r,this.jwtAuth=n,this._fetch=(i,s)=>{const o={},a=this.jwtAuth,c=this.projectAccessKey;return a&&a.length>0&&(o.Authorization=`BEARER ${a}`),c&&c.length>0&&(o["X-Access-Key"]=c),s.headers=A6({},s.headers,o),eU(i,s)},this.fetch=this._fetch}}const O8e=Object.freeze(Object.defineProperty({__proto__:null,ContractType:HO,EventLogDataType:I8e,EventLogType:k8e,Indexer:qee,SequenceIndexer:qO,SortOrder:T8e,TransactionStatus:P8e,TransactionType:R8e,TxnTransferType:Sc,WebRPCSchemaHash:A8e,WebRPCSchemaVersion:S8e,WebRPCVersion:C8e},Symbol.toStringTag,{value:"Module"}));function k6(){return k6=Object.assign?Object.assign.bind():function(t){for(var e=1;ethis.fetch(this.url("Ping"),Ri({},n)).then(i=>Ti(i).then(s=>({status:s.status}))),this.version=n=>this.fetch(this.url("Version"),Ri({},n)).then(i=>Ti(i).then(s=>({version:s.version}))),this.runtimeStatus=n=>this.fetch(this.url("RuntimeStatus"),Ri({},n)).then(i=>Ti(i).then(s=>({status:s.status}))),this.getTokenMetadata=(n,i)=>this.fetch(this.url("GetTokenMetadata"),Ri(n,i)).then(s=>Ti(s).then(o=>({tokenMetadata:o.tokenMetadata}))),this.refreshTokenMetadata=(n,i)=>this.fetch(this.url("RefreshTokenMetadata"),Ri(n,i)).then(s=>Ti(s).then(o=>({status:o.status}))),this.getTokenMetadataBatch=(n,i)=>this.fetch(this.url("GetTokenMetadataBatch"),Ri(n,i)).then(s=>Ti(s).then(o=>({contractTokenMetadata:o.contractTokenMetadata}))),this.searchTokenMetadata=(n,i)=>this.fetch(this.url("SearchTokenMetadata"),Ri(n,i)).then(s=>Ti(s).then(o=>({page:o.page,tokenMetadata:o.tokenMetadata}))),this.searchTokenIDs=(n,i)=>this.fetch(this.url("SearchTokenIDs"),Ri(n,i)).then(s=>Ti(s).then(o=>({page:o.page,tokenIds:o.tokenIds}))),this.tokenCollectionFilters=(n,i)=>this.fetch(this.url("TokenCollectionFilters"),Ri(n,i)).then(s=>Ti(s).then(o=>({filters:o.filters}))),this.getContractInfo=(n,i)=>this.fetch(this.url("GetContractInfo"),Ri(n,i)).then(s=>Ti(s).then(o=>({contractInfo:o.contractInfo}))),this.getContractInfoBatch=(n,i)=>this.fetch(this.url("GetContractInfoBatch"),Ri(n,i)).then(s=>Ti(s).then(o=>({contractInfoMap:o.contractInfoMap}))),this.searchContractInfo=(n,i)=>this.fetch(this.url("SearchContractInfo"),Ri(n,i)).then(s=>Ti(s).then(o=>({contractInfoList:o.contractInfoList}))),this.searchContractInfoBatch=(n,i)=>this.fetch(this.url("SearchContractInfoBatch"),Ri(n,i)).then(s=>Ti(s).then(o=>({contractInfoByChain:o.contractInfoByChain}))),this.searchMetadata=(n,i)=>this.fetch(this.url("SearchMetadata"),Ri(n,i)).then(s=>Ti(s).then(o=>({tokenMetadata:o.tokenMetadata,contractInfo:o.contractInfo}))),this.projectSetTokenMetadata=(n,i)=>this.fetch(this.url("ProjectSetTokenMetadata"),Ri(n,i)).then(s=>Ti(s).then(o=>({ok:o.ok}))),this.getNiftyswapTokenQuantity=(n,i)=>this.fetch(this.url("GetNiftyswapTokenQuantity"),Ri(n,i)).then(s=>Ti(s).then(o=>({quantity:o.quantity}))),this.getNiftyswapUnitPrices=(n,i)=>this.fetch(this.url("GetNiftyswapUnitPrices"),Ri(n,i)).then(s=>Ti(s).then(o=>({prices:o.prices}))),this.getNiftyswapUnitPricesWithQuantities=(n,i)=>this.fetch(this.url("GetNiftyswapUnitPricesWithQuantities"),Ri(n,i)).then(s=>Ti(s).then(o=>({prices:o.prices}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const Ri=(t={},e={})=>({method:"POST",headers:k6({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{})}),Ti=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch{throw{code:"unknown",msg:`expecting JSON, got: ${e}`,status:t.status}}if(!t.ok)throw r;return r}),tU=typeof global=="object"?global.fetch:window.fetch;class WO extends Wee{constructor(e="https://metadata.sequence.app",r,n){super(e.endsWith("/")?e.slice(0,-1):e,tU),this.projectAccessKey=r,this.jwtAuth=n,this._fetch=(i,s)=>{const o={},a=this.jwtAuth,c=this.projectAccessKey;return a&&a.length>0&&(o.Authorization=`BEARER ${a}`),c&&c.length>0&&(o["X-Access-Key"]=c),s.headers=k6({},s.headers,o),tU(i,s)},this.fetch=this._fetch}}const j8e=Object.freeze(Object.defineProperty({__proto__:null,ContractType:D8e,Metadata:Wee,PropertyType:L8e,SequenceMetadata:WO,SortOrder:F8e,SwapType:B8e,WebRPCSchemaHash:M8e,WebRPCSchemaVersion:N8e,WebRPCVersion:$8e},Symbol.toStringTag,{value:"Module"}));function U8e(t,e){const r=t.replace("ipfs://ipfs/","").replace("ipfs://","");return t.startsWith("ipfs://")?`${e}${r}`:t}function z8e(t){return t.startsWith("ipfs://")}class H8e{constructor(e,r,n=1e3){this.provider=e,this.solver=r,this.window=n,this.pending=new Map}async runByEIP5719(e,r,n){const i=`${e}-${r}-${n}`,s=Date.now();if(this.pending.has(i)&&s-this.pending.get(i).timestamp10)throw new Error("EIP5719 - Too many tries");if(nt.signer.canRecover(n)){const c=nt.signer.recoverSigner(r,n);if(c&&c.toLowerCase()===t.toLowerCase())return n}try{if(await nt.signer.isValidSignature(t,r,n,e))return n}catch{}const o=await W8e(q8e(t,e).getAlternativeSignature(r));if(!o||o==="")throw new Error("EIP5719 - Invalid signature and no alternative signature");const a=Se(await(i||new V8e).resolve(o));if(!a||a==="")throw new Error("EIP5719 - Empty alternative signature");if(a===Se(n))throw new Error("EIP5719 - Alternative signature is invalid or the same");return Vee(t,e,r,a,i,s+1)}class V8e{constructor(e="https://cloudflare-ipfs.com/ipfs/"){var r=this;this.gateway=e,this.uri=n=>z8e(n)?U8e(n,this.gateway):n,this.resolve=async function(n){const i=r.uri(n),s=await fetch(i);if(!s.ok)throw new Error(`URISolverIPFS - Failed to fetch ${i}`);return await s.text()}}}const G8e=(t,e)=>e.some(r=>t instanceof r);let rU,nU;function K8e(){return rU||(rU=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function J8e(){return nU||(nU=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Gee=new WeakMap,CI=new WeakMap,Kee=new WeakMap,qA=new WeakMap,VO=new WeakMap;function Q8e(t){const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("success",s),t.removeEventListener("error",o)},s=()=>{r(Nd(t.result)),i()},o=()=>{n(t.error),i()};t.addEventListener("success",s),t.addEventListener("error",o)});return e.then(r=>{r instanceof IDBCursor&&Gee.set(r,t)}).catch(()=>{}),VO.set(e,t),e}function Y8e(t){if(CI.has(t))return;const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("complete",s),t.removeEventListener("error",o),t.removeEventListener("abort",o)},s=()=>{r(),i()},o=()=>{n(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",s),t.addEventListener("error",o),t.addEventListener("abort",o)});CI.set(t,e)}let SI={get(t,e,r){if(t instanceof IDBTransaction){if(e==="done")return CI.get(t);if(e==="objectStoreNames")return t.objectStoreNames||Kee.get(t);if(e==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return Nd(t[e])},set(t,e,r){return t[e]=r,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function Z8e(t){SI=t(SI)}function X8e(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...r){const n=t.call(WA(this),e,...r);return Kee.set(n,e.sort?e.sort():[e]),Nd(n)}:J8e().includes(t)?function(...e){return t.apply(WA(this),e),Nd(Gee.get(this))}:function(...e){return Nd(t.apply(WA(this),e))}}function eCe(t){return typeof t=="function"?X8e(t):(t instanceof IDBTransaction&&Y8e(t),G8e(t,K8e())?new Proxy(t,SI):t)}function Nd(t){if(t instanceof IDBRequest)return Q8e(t);if(qA.has(t))return qA.get(t);const e=eCe(t);return e!==t&&(qA.set(t,e),VO.set(e,t)),e}const WA=t=>VO.get(t);function tCe(t,e,{blocked:r,upgrade:n,blocking:i,terminated:s}={}){const o=indexedDB.open(t,e),a=Nd(o);return n&&o.addEventListener("upgradeneeded",c=>{n(Nd(o.result),c.oldVersion,c.newVersion,Nd(o.transaction),c)}),r&&o.addEventListener("blocked",c=>r(c.oldVersion,c.newVersion,c)),a.then(c=>{s&&c.addEventListener("close",()=>s()),i&&c.addEventListener("versionchange",l=>i(l.oldVersion,l.newVersion,l))}).catch(()=>{}),a}const rCe=["get","getKey","getAll","getAllKeys","count"],nCe=["put","add","delete","clear"],VA=new Map;function iU(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(VA.get(e))return VA.get(e);const r=e.replace(/FromIndex$/,""),n=e!==r,i=nCe.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(i||rCe.includes(r)))return;const s=async function(o,...a){const c=this.transaction(o,i?"readwrite":"readonly");let l=c.store;return n&&(l=l.index(a.shift())),(await Promise.all([l[r](...a),i&&c.done]))[0]};return VA.set(e,s),s}Z8e(t=>({...t,get:(e,r,n)=>iU(e,r)||t.get(e,r,n),has:(e,r)=>!!iU(e,r)||t.has(e,r)}));class iCe{constructor(){this.loadPresignedConfiguration=void 0,this.savePresignedConfiguration=void 0,this.saveWitnesses=void 0,this.configOfImageHash=void 0,this.saveWalletConfig=void 0,this.imageHashOfCounterfactualWallet=void 0,this.saveCounterfactualWallet=void 0,this.walletsOfSigner=void 0}}var sCe=Object.freeze({__proto__:null,ConfigTracker:iCe});class oCe{constructor(e){this.tracker=e}async loadPresignedConfiguration(e){return console.debug("? loadPresignedConfiguration"),Ms(e,"? "),Ms(await this.tracker.loadPresignedConfiguration(e),"! ")}savePresignedConfiguration(e){return console.debug("? savePresignedConfiguration"),Ms(e,"? "),this.tracker.savePresignedConfiguration(e)}saveWitnesses(e){return console.debug("? saveWitnesses"),Ms(e,"? "),this.tracker.saveWitnesses(e)}async configOfImageHash(e){return console.debug("? configOfImageHash"),Ms(e,"? "),Ms(await this.tracker.configOfImageHash(e),"! ")}saveWalletConfig(e){return console.debug("? saveWalletConfig"),Ms(e,"? "),this.tracker.saveWalletConfig(e)}async imageHashOfCounterfactualWallet(e){return console.debug("? imageHashOfCounterfactualWallet"),Ms(e,"? "),Ms(await this.tracker.imageHashOfCounterfactualWallet(e),"! ")}saveCounterfactualWallet(e){return console.debug("? saveCounterfactualWallet"),Ms(e,"? "),this.tracker.saveCounterfactualWallet(e)}async walletsOfSigner(e){return console.debug("? walletsOfSigner"),Ms(e,"? "),Ms(await this.tracker.walletsOfSigner(e),"! ")}async getMigration(e,r,n,i){return console.debug("? getMigration"),Ms({address:e,fromImageHash:r,fromVersion:n,chainId:i},"? "),Ms(await this.tracker.getMigration(e,r,n,i),"! ")}saveMigration(e,r,n){return console.debug("? saveMigration"),Ms({address:e,signed:r,contexts:n},"? "),this.tracker.saveMigration(e,r,n)}}function Ms(t,e=""){switch(t){case void 0:console.debug(e+"undefined");break;default:JSON.stringify(t,void 0,2).split(` +`).map(r=>e+r).forEach(r=>console.debug(r));break}return t}var aCe=Object.freeze({__proto__:null,DebugConfigTracker:oCe});function Wd(){return Wd=Object.assign?Object.assign.bind():function(t){for(var e=1;ePromise.resolve(this.configs[e]),this.saveConfig=(e,r)=>(this.configs[e]=r,Promise.resolve()),this.loadV2Node=e=>Promise.resolve(this.v2Nodes[e]),this.saveV2Node=(e,r)=>(this.v2Nodes[e]=r,Promise.resolve()),this.loadCounterfactualWallet=e=>Promise.resolve(this.counterfactualWallets[e]),this.saveCounterfactualWallet=(e,r,n)=>(this.counterfactualWallets[e]={imageHash:r,context:n},Promise.resolve()),this.loadPayloadOfSubdigest=e=>Promise.resolve(this.payloads[e]),this.savePayloadOfSubdigest=(e,r)=>(this.payloads[e]=r,Promise.resolve()),this.loadSubdigestsOfSigner=e=>Promise.resolve(Object.keys(this.signatures[e]||{})),this.loadSignatureOfSubdigest=(e,r)=>{var n;return Promise.resolve((n=this.signatures[e])==null?void 0:n[r])},this.saveSignatureOfSubdigest=(e,r,n)=>(this.signatures[e]||(this.signatures[e]={}),this.signatures[e][r]=n,Promise.resolve()),this.loadMigrationsSubdigest=(e,r,n)=>{var i;return Promise.resolve(((i=this.migrations[e])==null||(i=i[r])==null?void 0:i[n])||[])},this.saveMigrationsSubdigest=(e,r,n,i,s)=>(this.migrations[e]||(this.migrations[e]={}),this.migrations[e][r]||(this.migrations[e][r]={}),this.migrations[e][r][n]||(this.migrations[e][r][n]=[]),this.migrations[e][r][n].push({subdigest:i,toImageHash:s}),Promise.resolve())}}function vg(t){if(t===void 0)return;const e={};for(const r of Object.keys(t)){const n=t[r];n._isBigNumber===!0&&n._hex!==void 0&&typeof n._hex=="string"&&n._hex.length!==""?e[r]=we.from(n):Array.isArray(n)?e[r]=n.map(i=>vg(i)):typeof n=="object"&&n!==null?e[r]=vg(n):e[r]=n}return e}class cCe{constructor(e){var r=this;this.dbName=e,this._lazyDb=void 0,this.loadConfig=async function(n){return(await r.getDb()).get("configs",n).then(s=>vg(s))},this.saveConfig=async function(n,i){await(await r.getDb()).put("configs",i,n)},this.loadV2Node=async function(n){return(await r.getDb()).get("v2Nodes",n).then(s=>vg(s))},this.saveV2Node=async function(n,i){await(await r.getDb()).put("v2Nodes",i,n)},this.loadCounterfactualWallet=async function(n){return(await r.getDb()).get("counterfactualWallets",n)},this.saveCounterfactualWallet=async function(n,i,s){await(await r.getDb()).put("counterfactualWallets",{imageHash:i,context:s},n)},this.loadPayloadOfSubdigest=async function(n){return(await r.getDb()).get("payloads",n).then(s=>vg(s))},this.savePayloadOfSubdigest=async function(n,i){await(await r.getDb()).put("payloads",i,n)},this.loadSubdigestsOfSigner=async function(n){return(await(await r.getDb()).getAllKeysFromIndex("signatures","signer",IDBKeyRange.only(n))).map(o=>o.split("-")[0])},this.loadSignatureOfSubdigest=async function(n,i){const o=await(await r.getDb()).get("signatures",[i,n].join("-"));return o==null?void 0:o.signature},this.saveSignatureOfSubdigest=async function(n,i,s){await(await r.getDb()).put("signatures",{signature:s,signer:n},[i,n].join("-"))},this.loadMigrationsSubdigest=async function(n,i,s){return(await(await r.getDb()).getAllFromIndex("migrations","jump",IDBKeyRange.only([n,i,s]))).map(c=>({subdigest:c.subdigest,toImageHash:c.toImageHash}))},this.saveMigrationsSubdigest=async function(n,i,s,o,a){await(await r.getDb()).put("migrations",{wallet:n,fromVersion:i,toVersion:s,subdigest:o,toImageHash:a},o)}}async getDb(){if(this._lazyDb)return this._lazyDb;const e=this.dbName;return this._lazyDb=await tCe(e,1,{upgrade(r,n,i,s){console.log(`upgrading ${e} from ${n} to ${i} - ${s}`),n===0&&(r.createObjectStore("configs"),r.createObjectStore("v2Nodes"),r.createObjectStore("counterfactualWallets"),r.createObjectStore("payloads"),r.createObjectStore("signatures").createIndex("signer","signer",{unique:!1}),r.createObjectStore("migrations").createIndex("jump",["wallet","fromVersion","toVersion"]))}}),this._lazyDb}}function Qee(t){return t.left!==void 0&&t.right!==void 0}function Yee(t){return t.weight!==void 0&&t.threshold!==void 0&&t.tree!==void 0}function AI(t){return t.version===2&&t.threshold!==void 0&&t.checkpoint!==void 0&&t.tree!==void 0&&typeof t.tree=="string"}var lCe=Object.freeze({__proto__:null,isPlainNode:Qee,isPlainNested:Yee,isPlainV2Config:AI,MemoryTrackerStore:Jee,recreateBigNumbers:vg,IndexedDBStore:cCe});class GO{constructor(e,r=new Jee,n=!1){var i=this;this.provider=e,this.store=r,this.useEIP5719=n,this.cachedEIP5719=void 0,this.loadTopology=async function(s){const o=await i.store.loadV2Node(s);if(!o)return{nodeHash:s};if(Qee(o)){const[a,c]=await Promise.all([i.loadTopology(o.left),i.loadTopology(o.right)]);return{left:a,right:c}}return Yee(o)?{weight:we.from(o.weight),threshold:we.from(o.threshold),tree:await i.loadTopology(o.tree)}:o},this.saveTopology=async function(s){if(ir.config.isNodeLeaf(s))return;const o=ir.config.hashNode(s);if(ir.config.isNode(s)){const a=i.saveTopology(s.left),c=i.saveTopology(s.right),l=i.store.saveV2Node(o,{left:ir.config.hashNode(s.left),right:ir.config.hashNode(s.right)});await Promise.all([a,c,l]);return}if(ir.config.isNestedLeaf(s)){const a=i.saveTopology(s.tree),c=i.store.saveV2Node(o,{weight:we.from(s.weight).toString(),threshold:we.from(s.threshold).toString(),tree:ir.config.hashNode(s.tree)});await Promise.all([a,c]);return}if(ir.config.isSignerLeaf(s))return i.store.saveV2Node(o,{address:s.address,weight:s.weight});if(ir.config.isSubdigestLeaf(s))return i.store.saveV2Node(o,{subdigest:s.subdigest});throw new Error(`Unknown topology type: ${s}`)},this.saveWalletConfig=async function(s){const{config:o}=s;if(Lu.config.ConfigCoder.isWalletConfig(o)){const a=Lu.config.ConfigCoder.imageHashOf(o);return i.store.saveConfig(a,o)}if(ir.config.ConfigCoder.isWalletConfig(o)){const a=ir.config.ConfigCoder.imageHashOf(o);if(ir.config.isComplete(o.tree))return i.store.saveConfig(a,o)}},this.configOfImageHashCache={},this.configOfImageHash=async function(s){const{imageHash:o}=s;if(i.configOfImageHashCache[s.imageHash])return i.configOfImageHashCache[s.imageHash];const a=await i.store.loadConfig(o);if(a){if(a.version===1||a.version===2&&!AI(a))return i.configOfImageHashCache[s.imageHash]=a,a;if(AI(a)){const c={version:2,threshold:we.from(a.threshold),checkpoint:we.from(a.checkpoint),tree:await i.loadTopology(a.tree)};return i.configOfImageHashCache[s.imageHash]=c,c}throw new Error(`Unknown config type: ${a}`)}},this.saveCounterfactualWallet=async function(s){const{config:o,context:a}=s,c=Gi.genericCoderFor(o.version).config.imageHashOf(o);await Promise.all([i.saveWalletConfig({config:o}),...a.map(l=>{const u=nt.context.addressOf(l,c);return i.store.saveCounterfactualWallet(u,c,l)})])},this.imageHashOfCounterfactualWallet=async function(s){const{wallet:o}=s,a=await i.store.loadCounterfactualWallet(o);if(a)return{imageHash:a.imageHash,context:a.context}},this.savePayload=async function(s){const{payload:o}=s,a=nt.signature.subdigestOf(o);await i.store.savePayloadOfSubdigest(a,o)},this.payloadOfSubdigestCache={},this.payloadOfSubdigest=async function(s){if(i.payloadOfSubdigestCache[s.subdigest])return i.payloadOfSubdigestCache[s.subdigest];const{subdigest:o}=s,a=await i.store.loadPayloadOfSubdigest(o);return a&&(i.payloadOfSubdigestCache[o]=a),a},this.savePresignedConfiguration=async function(s){const o=ir.signature.SignatureCoder.decode(s.signature),a=Gi.genericCoderFor(s.nextConfig.version).config.imageHashOf(s.nextConfig),c=ir.chained.messageSetImageHash(a),l=Tt(c),u={message:c,address:s.wallet,chainId:0,digest:l},f=i.savePayload({payload:u}),d=i.saveWalletConfig({config:s.nextConfig}),p=await ir.signature.SignatureCoder.recover(o,u,i.provider),g=ir.signature.signaturesOf(p.config.tree);await Promise.all([f,d,i.saveWalletConfig({config:p.config}),...g.map(v=>i.store.saveSignatureOfSubdigest(v.address,p.subdigest,v.signature))])},this.loadPresignedConfiguration=async function(s){const{wallet:o,fromImageHash:a,longestPath:c}=s,l=await i.configOfImageHash({imageHash:a});if(!l||!ir.config.ConfigCoder.isWalletConfig(l))return[];const u=ir.config.signersOf(l.tree).map(E=>E.address),f=await Promise.all(u.map(E=>i.store.loadSubdigestsOfSigner(E))),d=[...new Set(f.flat())],g=(await Promise.all([...new Set(d)].map(async function(E){return Wd({},await i.payloadOfSubdigest({subdigest:E}),{subdigest:E})}))).filter(E=>(E==null?void 0:E.message)&&(E==null?void 0:E.address)&&E.address===o).map(E=>({payload:E,nextImageHash:ir.chained.decodeMessageSetImageHash(E.message)})).filter(E=>E==null?void 0:E.nextImageHash);let v;const b=(await Promise.all(g.map(async function({nextImageHash:E,payload:C}){const S=await i.configOfImageHash({imageHash:E});if(!S||!ir.config.isWalletConfig(S))return;const P=we.from(S.checkpoint);return{nextConfig:S,nextCheckpoint:P,nextImageHash:E,payload:C}}))).filter(E=>E!==void 0).filter(E=>E.nextCheckpoint.gt(l.checkpoint)).sort((E,C)=>E.nextCheckpoint.gt(C.nextCheckpoint)?c?1:-1:c?-1:1);for(const E of b){const{nextConfig:C,nextCheckpoint:S,nextImageHash:P,payload:_}=E;if(v){const Z=v.checkpoint;if(c){if(S.gte(Z))continue}else if(S.lte(Z))continue}const T=new Map((await Promise.all(u.map(async function(Z){const ne=await i.store.loadSignatureOfSubdigest(Z,_.subdigest);if(!ne)return[Z,void 0];const ce=Se(i.useEIP5719?await i.cachedEIP5719.runByEIP5719(Z,_.subdigest,ne):ne),K=nt.signer.tryRecoverSigner(_.subdigest,ce)!==Z;return[Z,{isDynamic:K,signature:ce}]}))).filter(Z=>!!Z[1]));if(T.size===0)continue;const Q=ir.signature.SignatureCoder.encodeSigners(l,T,[],0);Q.weight.lt(l.threshold)||(v={nextImageHash:P,checkpoint:we.from(C.checkpoint),signature:Q.encoded})}if(!v)return[];const w=await i.loadPresignedConfiguration({wallet:o,fromImageHash:v.nextImageHash,longestPath:c});return[{wallet:o,nextImageHash:v.nextImageHash,signature:v.signature},...w]},this.saveWitnesses=async function(s){const o={digest:s.digest,address:s.wallet,chainId:s.chainId},a=nt.signature.subdigestOf(o);await Promise.all([i.savePayload({payload:o}),...s.signatures.filter(c=>nt.signer.canRecover(c)).map(c=>{const l=nt.signer.recoverSigner(a,c);return i.store.saveSignatureOfSubdigest(l,a,c)})])},this.walletsOfSigner=async function(s){const o=await i.store.loadSubdigestsOfSigner(s.signer),a=await Promise.all(o.map(l=>i.payloadOfSubdigest({subdigest:l}))).then(l=>l.filter(u=>u!==void 0)),c=[];for(const l of a){const u=l.address;if(c.find(p=>p.wallet===u))continue;const f=nt.signature.subdigestOf(l),d=await i.store.loadSignatureOfSubdigest(s.signer,f);d&&c.push({wallet:u,proof:{digest:l.digest,chainId:we.from(l.chainId),signature:Se(d)}})}return c},this.cachedEIP5719=new H8e(e)}async saveMigration(e,r,n){const i=r.fromVersion;if(i!==1)throw new Error("Migration not supported");if(!ir.config.isWalletConfig(r.toConfig))throw new Error("Invalid to config");const{newImageHash:s,address:o}=Mee.v1v2.decodeTransaction(r.tx,n);if(o!==e)throw new Error("Invalid migration transaction - address");if(ir.config.ConfigCoder.imageHashOf(r.toConfig)!=s)throw new Error("Invalid migration transaction - config");const a=nt.transaction.packMetaTransactionsData(r.tx.nonce,r.tx.transactions),c=Tt(a),l={chainId:r.tx.chainId,message:a,address:e,digest:c},u=nt.signature.subdigestOf(l),f=this.savePayload({payload:l}),d=this.saveWalletConfig({config:r.toConfig}),p=Lu.signature.SignatureCoder.decode(r.tx.signature),g=await Lu.signature.SignatureCoder.recover(p,l,this.provider),v=Lu.signature.SignatureCoder.signaturesOf(g.config);await Promise.all([f,d,this.saveWalletConfig({config:g.config}),this.store.saveMigrationsSubdigest(e,i,i+1,u,s),...v.map(y=>this.store.saveSignatureOfSubdigest(y.address,g.subdigest,y.signature))])}async getMigration(e,r,n,i){var s=this;const[o,a]=await Promise.all([this.configOfImageHash({imageHash:r}),this.store.loadMigrationsSubdigest(e,n,n+1)]),c=Gi.coderFor(n);return!o||!c.config.isWalletConfig(o)?void 0:(await Promise.all(a.map(async function(u){const{subdigest:f,toImageHash:d}=u,p=await s.payloadOfSubdigest({subdigest:f});if(!p||!p.message||!we.from(i).eq(p.chainId))return;const g=c.config.signersOf(o).map(E=>E.address),v=new Map((await Promise.all(g.map(async function(E){const C=await s.store.loadSignatureOfSubdigest(E,f);if(!C)return[E,void 0];const S=Se(s.useEIP5719?await s.cachedEIP5719.runByEIP5719(E,f,C):C),P=nt.signer.tryRecoverSigner(f,S)!==E;return[E,{isDynamic:P,signature:S}]}))).filter(E=>!!E[1])),y=c.signature.encodeSigners(o,v,[],i);if(!y||y.weightu.filter(f=>f!==void 0)))[0]}updateProvider(e){this.provider=e}}var uCe=Object.freeze({__proto__:null,LocalConfigTracker:GO});let GA=function(t){return t.EIP712="EIP712",t.EthSign="EthSign",t.EIP1271="EIP1271",t}({});class fCe{constructor(e,r){this.hostname=void 0,this.fetch=void 0,this.path="/rpc/Sessions/",this.ping=n=>this.fetch(this.url("Ping"),bc({},n)).then(i=>wc(i).then(s=>({}))),this.config=(n,i)=>this.fetch(this.url("Config"),bc(n,i)).then(s=>wc(s).then(o=>({version:o.version,config:o.config}))),this.wallets=(n,i)=>this.fetch(this.url("Wallets"),bc(n,i)).then(s=>wc(s).then(o=>({wallets:o.wallets}))),this.deployHash=(n,i)=>this.fetch(this.url("DeployHash"),bc(n,i)).then(s=>wc(s).then(o=>({deployHash:o.deployHash,context:o.context}))),this.configUpdates=(n,i)=>this.fetch(this.url("ConfigUpdates"),bc(n,i)).then(s=>wc(s).then(o=>({updates:o.updates}))),this.migrations=(n,i)=>this.fetch(this.url("Migrations"),bc(n,i)).then(s=>wc(s).then(o=>({migrations:o.migrations}))),this.saveConfig=(n,i)=>this.fetch(this.url("SaveConfig"),bc(n,i)).then(s=>wc(s).then(o=>({}))),this.saveWallet=(n,i)=>this.fetch(this.url("SaveWallet"),bc(n,i)).then(s=>wc(s).then(o=>({}))),this.saveSignature=(n,i)=>this.fetch(this.url("SaveSignature"),bc(n,i)).then(s=>wc(s).then(o=>({}))),this.saveSignerSignatures=(n,i)=>this.fetch(this.url("SaveSignerSignatures"),bc(n,i)).then(s=>wc(s).then(o=>({}))),this.saveMigration=(n,i)=>this.fetch(this.url("SaveMigration"),bc(n,i)).then(s=>wc(s).then(o=>({}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const bc=(t={},e={})=>({method:"POST",headers:Wd({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{})}),wc=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch{throw{code:"unknown",msg:`expecting JSON, got: ${e}`,status:t.status}}if(!t.ok)throw r;return r});class dCe{constructor(e,r=!0){this.onlyRecoverable=r,this.sessions=void 0,this.sessions=new fCe(e,fetch)}async loadPresignedConfiguration(e){try{const{updates:r}=await this.sessions.configUpdates({wallet:e.wallet,fromImageHash:e.fromImageHash,allUpdates:e.longestPath});return r.map(({toImageHash:n,signature:i})=>({wallet:e.wallet,nextImageHash:n,signature:i}))}catch(r){if(KA(r))return[];throw r}}async savePresignedConfiguration(e){const r=e.nextConfig,n=Gi.genericCoderFor(r.version).config.imageHashOf(r),i=ir.signature.setImageHashStruct(n),s=Tt(i);await this.sessions.saveSignature({wallet:e.wallet,digest:s,chainID:"0",signature:e.signature,toConfig:L5(r)})}async saveWitnesses(e){let r=e.signatures;this.onlyRecoverable&&(r=r.filter(n=>nt.signer.canRecover(n))),await this.sessions.saveSignerSignatures({wallet:e.wallet,digest:e.digest,chainID:Qp(e.chainId),signatures:r})}async configOfImageHash(e){try{const{version:r,config:n}=await this.sessions.config(e);return hCe(r,n)}catch(r){if(KA(r))return;throw r}}async saveWalletConfig(e){const r=L5(e.config);await this.sessions.saveConfig({version:e.config.version,config:r})}async imageHashOfCounterfactualWallet(e){try{const{deployHash:r,context:n}=await this.sessions.deployHash(e);return{imageHash:r,context:n}}catch(r){if(KA(r))return;throw r}}async saveCounterfactualWallet(e){const r=L5(e.config);await this.sessions.saveWallet({version:e.config.version,deployConfig:r})}async walletsOfSigner(e){const{wallets:r}=await this.sessions.wallets(e);return Object.entries(r).map(([n,{digest:i,chainID:s,type:o,signature:a}])=>{switch(o){case GA.EIP712:a+=Se(nt.signer.SigType.EIP712).slice(2);break;case GA.EthSign:a+=Se(nt.signer.SigType.ETH_SIGN).slice(2);break;case GA.EIP1271:a+=Se(nt.signer.SigType.WALLET_BYTES32).slice(2);break}return{wallet:n,proof:{digest:i,signature:a,chainId:we.from(s)}}})}async getMigration(e,r,n,i){var s=this;const o=Qp(i),{migrations:a}=await this.sessions.migrations({wallet:e,fromVersion:n,fromImageHash:r,chainID:o}),c=async function(f){const d=a[f];if(d){const p=Object.keys(d).map(Number).sort((g,v)=>v-g);for(const g of p)for(const[v,y]of Object.entries(d[g]))try{const b=await s.configOfImageHash({imageHash:v});if(b)return{fromVersion:n,toVersion:g,toConfig:b,tx:{entrypoint:y.executor,transactions:y.transactions,nonce:y.nonce,signature:y.signature,chainId:f,intent:{id:nt.transaction.subdigestOfTransactions(e,f,y.nonce,y.transactions),wallet:e}}}}catch(b){console.error(b)}}},l=await c(o);if(l)return l;for(const u in a)if(u!==o){const f=await c(u);if(f)return f}}async saveMigration(e,r,n){await this.sessions.saveMigration({wallet:e,fromVersion:r.fromVersion,toVersion:r.toVersion,toConfig:L5(r.toConfig),executor:r.tx.entrypoint,transactions:r.tx.transactions.map(pCe),nonce:Qp(r.tx.nonce),signature:r.tx.signature,chainID:Qp(r.tx.chainId)})}}function L5(t){switch(t.version){case 1:if(Lu.config.ConfigCoder.isWalletConfig(t))return{threshold:_0(t.threshold),signers:t.signers.map(({weight:e,address:r})=>({weight:_0(e),address:r}))};throw new Error(`not a v${t.version} config: ${t}`);case 2:if(ir.config.ConfigCoder.isWalletConfig(t))return{threshold:_0(t.threshold),checkpoint:_0(t.checkpoint),tree:nE(t.tree)};throw new Error(`not a v${t.version} config: ${t}`);default:throw new Error(`unknown version ${t.version}`)}}function nE(t){return ir.config.isNode(t)?{left:nE(t.left),right:nE(t.right)}:ir.config.isSignerLeaf(t)?{weight:_0(t.weight),address:t.address}:ir.config.isNestedLeaf(t)?{weight:_0(t.weight),threshold:_0(t.threshold),tree:nE(t.tree)}:ir.config.isNodeLeaf(t)?{node:t.nodeHash}:Wd({},t)}function hCe(t,e){switch(t){case 1:return Wd({},e,{version:t});case 2:return Wd({},e,{version:t,tree:iE(e.tree)});default:throw new Error(`unknown version ${t}`)}}function iE(t){switch(typeof t){case"object":const e=Wd({},t);return e.left!==void 0&&(e.left=iE(e.left)),e.right!==void 0&&(e.right=iE(e.right)),e.tree!==void 0&&(e.tree=iE(e.tree)),e.node!==void 0&&(e.nodeHash=e.node,delete e.node),e;default:throw new Error(`v2 config tree ${t} is not an object`)}}function pCe(t){return{to:t.to,value:t.value!==void 0?Qp(t.value):void 0,data:t.data!==void 0?Se(t.data):void 0,gasLimit:t.gasLimit!==void 0?Qp(t.gasLimit):void 0,delegateCall:t.delegateCall,revertOnError:t.revertOnError}}function _0(t){return we.from(t).toNumber()}function Qp(t){return we.from(t).toString()}function KA(t){return typeof t=="object"&&t.status===404}var gCe=Object.freeze({__proto__:null,RemoteConfigTracker:dCe});function kI(t,e,r){return new Promise(n=>{let i=0;t.forEach(s=>s.then(o=>{r(o)?n(o):(i++,i===t.length&&n(e))}).catch(()=>{i++,i===t.length&&n(e)}))})}async function ky(t,e){return Promise.all(t.map(r=>r.catch(()=>e)))}class mCe{constructor(e){this.trackers=e}async configOfImageHash(e){const r=this.trackers.map(async function(a,c){return{res:await a.configOfImageHash(e),i:c}}),n=await kI(r,void 0,a=>(a==null?void 0:a.res)===void 0?!1:Gi.genericCoderFor(a.res.version).config.isComplete(a.res));if(n!=null&&n.res)return this.saveWalletConfig({config:n.res,skipTracker:n.i}),n.res;const i=new GO(void 0),s=await ky(r,void 0);for(const a of s)a!=null&&a.res&&await i.saveWalletConfig({config:a.res});const o=await i.configOfImageHash(e);return o&&this.saveWalletConfig({config:o}),o}async saveWalletConfig(e){await Promise.all(this.trackers.map((r,n)=>{if(n!==e.skipTracker)return r.saveWalletConfig(e)}))}async imageHashOfCounterfactualWallet(e){const r=await kI(this.trackers.map(n=>n.imageHashOfCounterfactualWallet(e)),void 0,n=>!!n);return r&&this.configOfImageHash({imageHash:r.imageHash}).then(n=>{n&&this.saveCounterfactualWallet({config:n,context:[r.context]})}),r}async saveCounterfactualWallet(e){await Promise.all(this.trackers.map((r,n)=>{if(n!==e.skipTracker)return r.saveCounterfactualWallet(e)}))}async walletsOfSigner(e){const r=await ky(this.trackers.map(o=>o.walletsOfSigner(e)),[]).then(o=>o.flat()),n={};for(const o of r)n[o.wallet]=o.proof;const i=Object.keys(n).map(o=>({wallet:o,proof:n[o]})),s=new Map;return i.forEach(({wallet:o,proof:{digest:a,chainId:c,signature:l}})=>{const u=`${o}-${a}-${c}`;let f=s.get(u);f||(f={wallet:o,digest:a,chainId:c,signatures:[]},s.set(u,f)),f.signatures.push(l)}),s.forEach(o=>this.saveWitnesses(o)),i}async saveWitnesses(e){await Promise.all(this.trackers.map(r=>r.saveWitnesses(e)))}async loadPresignedConfiguration(e){var r=this;const n=await ky(this.trackers.map(c=>c.loadPresignedConfiguration(e)),[]),s=(await ky(n.map(async function(c){const l=c[c.length-1],u=await r.configOfImageHash({imageHash:l.nextImageHash});if(u)return{checkpoint:Gi.genericCoderFor(u.version).config.checkpointOf(u),result:c}}),void 0)).reduce((c,l)=>l&&(!c||l.checkpoint.gt(c.checkpoint))?l:c);if(!s)return[];const o=new Map,a=c=>(o.has(c)||o.set(c,this.configOfImageHash({imageHash:c})),o.get(c));return s.result.forEach(async function(c){const l=await a(c.nextImageHash);l&&r.savePresignedConfiguration({wallet:e.wallet,nextConfig:l,signature:c.signature})}),s.result}async savePresignedConfiguration(e){await Promise.all(this.trackers.map(r=>r.savePresignedConfiguration(e)))}async getMigration(e,r,n,i){return(await Promise.all(this.trackers.map(o=>o.getMigration(e,r,n,i)))).find(o=>!!o)}async saveMigration(e,r,n){await Promise.all(this.trackers.map(i=>i.saveMigration(e,r,n)))}}class vCe{constructor(e,r,n){this.tracker=e,this.cache=r,this.contexts=n}async loadPresignedConfiguration(e){var r=this;const n=[this.tracker.loadPresignedConfiguration(e),this.cache.loadPresignedConfiguration(e)];let i;const[s,o]=await Promise.all(n);if(s.length>0&&o.length>0&&s[s.length-1].nextImageHash===o[o.length-1].nextImageHash)i=e.longestPath===!0?s.length>o.length?s:o:s.lengthf&&(!u||f.checkpoint.gt(u.checkpoint))?f:u))==null?void 0:c.result)!=null?a:[]}return i||[]}async savePresignedConfiguration(e){await Promise.all([this.tracker.savePresignedConfiguration(e),this.cache.savePresignedConfiguration(e)])}async configOfImageHash(e){if(e.noCache!==!0){const n=await this.cache.configOfImageHash(e);if(n)return n}const r=await this.tracker.configOfImageHash(e);return r&&await this.cache.saveWalletConfig({config:r}),r}async saveWalletConfig(e){await Promise.all([this.tracker.saveWalletConfig(e),this.cache.saveWalletConfig(e)])}async imageHashOfCounterfactualWallet(e){if(e.noCache!==!0){const n=await this.cache.imageHashOfCounterfactualWallet(e);if(n)return n}const r=await this.tracker.imageHashOfCounterfactualWallet(e);if(r){const n=await this.configOfImageHash({imageHash:r.imageHash});n&&await this.cache.saveCounterfactualWallet({config:n,context:[r.context]})}return r}async saveCounterfactualWallet(e){await Promise.all([this.tracker.saveCounterfactualWallet(e),this.cache.saveCounterfactualWallet(e)])}async walletsOfSigner(e){if(e.noCache)return this.tracker.walletsOfSigner(e);const r=await Promise.all([this.tracker.walletsOfSigner(e),this.cache.walletsOfSigner(e)]),n=new Map;for(const i of r)for(const s of i)n.set(s.wallet,s);return Array.from(n.values())}async saveWitnesses(e){await Promise.all([this.tracker.saveWitnesses(e),this.cache.saveWitnesses(e)])}async getMigration(e,r,n,i){const s=await this.cache.getMigration(e,r,n,i);if(s)return s;const o=await this.tracker.getMigration(e,r,n,i);return o&&await this.cache.saveMigration(e,o,this.contexts),o}async saveMigration(e,r,n){await Promise.all([this.tracker.saveMigration(e,r,n),this.cache.saveMigration(e,r,n)])}}class sU{constructor(){this.cache=void 0,this.cache=new Map}do(e,r,n,...i){e=`${e}:${Tt(qr(JSON.stringify(i,yCe)))}`;let s=this.cache.get(e);if(s&&s.expiration&&new Date>=s.expiration&&(s=void 0,this.cache.delete(e)),!s){const o={promise:n(...i)};r!==void 0&&(o.promise=o.promise.then(a=>(o.expiration=new Date(Date.now()+r),a))),s=o,this.cache.set(e,s)}return s.promise}}function yCe(t,e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).sort()):e}function bCe(t){return t instanceof Zee}class Zee{constructor(e,r=50,n=!1){this.tracker=e,this.window=r,this.verbose=n,this.cache=new sU}invalidateCache(){this.cache=new sU}configOfImageHash(e){return this.cache.do("configOfImageHash",this.window,r=>this.tracker.configOfImageHash(r),e)}getMigration(e,r,n,i){return this.cache.do("getMigration",this.window,(...s)=>this.tracker.getMigration(...s),e,r,n,i)}saveMigration(e,r,n){return this.cache.do("saveMigration",void 0,(...i)=>this.tracker.saveMigration(...i),e,r,n)}loadPresignedConfiguration(e){return this.cache.do("loadPresignedConfiguration",this.window,r=>this.tracker.loadPresignedConfiguration(r),e)}savePresignedConfiguration(e){return this.cache.do("savePresignedConfiguration",void 0,r=>this.tracker.savePresignedConfiguration(r),e)}saveWitnesses(e){return this.cache.do("saveWitnesses",void 0,r=>this.tracker.saveWitnesses(r),e)}saveWalletConfig(e){return this.cache.do("saveWalletConfig",void 0,r=>this.tracker.saveWalletConfig(r),e)}imageHashOfCounterfactualWallet(e){return this.cache.do("imageHashOfCounterfactualWallet",void 0,r=>this.tracker.imageHashOfCounterfactualWallet(r),e)}saveCounterfactualWallet(e){return this.cache.do("saveCounterfactualWallet",void 0,r=>this.tracker.saveCounterfactualWallet(r),e)}walletsOfSigner(e){return this.cache.do("walletsOfSigner",this.window,r=>this.tracker.walletsOfSigner(r),e)}updateProvider(e){this.tracker instanceof GO&&this.tracker.updateProvider(e)}}var KO=Object.freeze({__proto__:null,debug:aCe,local:uCe,remote:gCe,stores:lCe,raceUntil:kI,allSafe:ky,MultipleTracker:mCe,CachedTracker:vCe,isDedupedTracker:bCe,DedupedTracker:Zee});const wCe=Object.freeze(Object.defineProperty({__proto__:null,tracker:sCe,trackers:KO},Symbol.toStringTag,{value:"Module"})),Xee=60*60*24*7,xCe=60;class oU{constructor(e,r,n={},i){this.account=e,this.settings=r,this.status=n,this._initialAuthRequest=void 0,this.proofStrings=new Map,this.onAuthCallbacks=[],this.apiClient=void 0,this.metadataClient=void 0,this.indexerClients=new Map,this.projectAccessKey=void 0,this.projectAccessKey=i}now(){return Math.floor(Date.now()/1e3)}get expiration(){var e;return Math.max((e=this.settings.metadata.expiration)!=null?e:Xee,120)}onAuth(e){return this.onAuthCallbacks.push(e),()=>this.onAuthCallbacks=this.onAuthCallbacks.filter(r=>r!==e)}async dump(){return this.status.jwt?{jwt:{token:await this.status.jwt.token,expiration:this.status.jwt.expiration},metadata:this.status.metadata}:{metadata:this.settings.metadata}}auth(e=5){var r=this;return this._initialAuthRequest?this._initialAuthRequest:(this._initialAuthRequest=async function(){const n=r.settings.sequenceApiUrl;if(!n)throw Error("No sequence api url");let i;for(let s=1;;s++)try{i=(await r.getJWT(!0)).token;break}catch(o){if(s===e)throw console.error(`couldn't authenticate after ${e} attempts`,o),o}return new Uy(n,void 0,i)}(),this._initialAuthRequest)}async getJWT(e){var r=this;const n=this.settings.sequenceApiUrl;if(!n)throw Error("No sequence api url");if(this.status.jwt){const l=this.status.jwt,u=await l.token;if(this.now(){throw this.status.jwt=void 0,l}),expiration:o};return this.status.jwt=a,a.token.then(l=>{this.onAuthCallbacks.forEach(u=>{try{u({status:"fulfilled",value:l})}catch{}})}).catch(l=>{this.onAuthCallbacks.forEach(u=>{try{u({status:"rejected",reason:l})}catch{}})}),{token:await a.token,expiration:o}}getProofStringKey(){return`${this.account.address} - ${this.settings.metadata.name}`}async isProofStringValid(e){try{const r=new Hb,n=we.from(this.settings.sequenceApiChainId),i=zc(this.account.networks,n);if(!i)throw Error("No network found");return r.chainId=n.toNumber(),r.provider=new v6(qb(i.rpcUrl,this.projectAccessKey),{name:"",chainId:n.toNumber()}),await r.decodeProof(e),!0}catch{return!1}}async getAPIClient(e=!0){if(!this.apiClient){const r=this.settings.sequenceApiUrl;if(!r)throw Error("No sequence api url");const n=(await this.getJWT(e)).token;this.apiClient=new Uy(r,void 0,n)}return this.apiClient}async getMetadataClient(e=!0){if(!this.metadataClient){const r=(await this.getJWT(e)).token;this.metadataClient=new WO(this.settings.sequenceMetadataUrl,void 0,r)}return this.metadataClient}async getIndexerClient(e,r=!0){const n=zc(this.account.networks,e);if(!n)throw Error(`No network for chain ${e}`);if(!this.indexerClients.has(n.chainId))if(n.indexer)this.indexerClients.set(n.chainId,n.indexer);else if(n.indexerUrl){const i=(await this.getJWT(r)).token;this.indexerClients.set(n.chainId,new qO(n.indexerUrl,void 0,i))}else throw Error(`No indexer url for chain ${e}`);return this.indexerClients.get(n.chainId)}getProofString(e){if(this.proofStrings.has(e)){const c=this.proofStrings.get(e);if(this.now()(r.signature=c,n.encodeProof(r,!0))).catch(c=>{throw this.proofStrings.delete(e),c}),expiration:o};return this.proofStrings.set(e,a),a}}const ete=async(t,e,r)=>{const n=qt(await t.getAddress());if(!n||n===""||n==="0x")throw tte;const i=new m8;if(i.address=n,!r||!r.app||r.app==="")throw new JO("authorization options requires app to be set");i.claims.app=r.app,i.claims.ogn=r.origin,i.claims.n=r.nonce,i.setExpiryIn(r.expiry?Math.max(r.expiry,200):Xee);const s=i.messageTypedData(),o=HX(e);i.signature=await(t instanceof ju?t.signTypedData(s.domain,s.types,s.message,o,"eip6492"):t.signTypedData(s.domain,s.types,s.message,o));const c=await new Hb().encodeProof(i,!0);return{typedData:s,proofString:c}};class JO extends Error{constructor(e){super(e),this.name="AuthError"}}const tte=new JO("auth error: account address is empty");function h0(){return h0=Object.assign?Object.assign.bind():function(t){for(var e=1;eZ.wallet));let T;if(_){if(f==null||f(_),T=new ju({address:_,tracker:E,networks:w,contexts:b,orchestrator:v,projectAccessKey:y}),l&&l.length>0){let Z=await T.status(S);if(Z.original.version!==Z.version||T.version!==Z.version){const{migratedAllChains:K,failedChains:x}=await T.isMigratedAllChains();if(x.some(A=>II.includes(A)))throw Error(`Failed to fetch account status on ${x.join(", ")}`);if(!K){if(g&&!await g(T))throw Error("Migration cancelled, cannot open session");const{failedChains:A}=await T.signAllMigrations(p||(z=>z));if(A.some(z=>II.includes(z)))throw Error(`Failed to sign migrations on ${A.join(", ")}`);KO.isDedupedTracker(E)&&E.invalidateCache();let B;if([B,Z]=await Promise.all([T.isMigratedAllChains().then(z=>z.migratedAllChains),T.status(S)]),!B)throw Error("Failed to migrate account")}}Z.onChain.version!==Z.version&&await T.doBootstrap(S,void 0,Z);const ne=Z.config,ce=T.coders.config.editConfig(ne,{add:l,threshold:c});if(T.coders.config.imageHashOf(ne)!==T.coders.config.imageHashOf(ce)){const K=T.coders.config.editConfig(ce,{checkpoint:T.coders.config.checkpointOf(ne).add(1)});await T.updateConfig(K)}}}else{if(!l||l.length===0)throw Error("Cannot create new account without signers");if(!c)throw Error("Cannot create new account without threshold");if(T=await ju.new({config:{threshold:c,checkpoint:0,signers:l},tracker:E,contexts:b,orchestrator:v,networks:w,projectAccessKey:y}),f==null||f(T.address),await T.publishWitness(),!(await E.walletsOfSigner({signer:a,noCache:!0})).some(ne=>ne.wallet===T.address))throw Error("Account not found on tracker")}let Q;return C&&(Q=new oU(T,C),Q.auth(),Q.onAuth(Z=>{Z.status==="fulfilled"&&T.setJwt(Z.value)})),new oE(w,b,T,Q)}static async load(e){const{dump:r,settings:n,editConfigOnMigration:i,onMigration:s,orchestrator:o}=e,{contexts:a,networks:c,tracker:l,services:u}=h0({},sE,n);let f;if(rte(r)){var d,p,g;const C=r.config.address||nt.context.addressOf(a[1],Lu.config.ConfigCoder.imageHashOf(h0({},r.config,{version:1}))),S=((d=(p=r.jwt)==null?void 0:p.expiration)!=null?d:0)P.migratedAllChains)){if(s&&!await s(f))throw Error("Migration cancelled, cannot open session");if(console.log("Migrating account..."),await f.signAllMigrations(i),!await f.isMigratedAllChains().then(P=>P.migratedAllChains))throw Error("Failed to migrate account")}}else if(nte(r)){var v,y,b;const C=((v=(y=r.jwt)==null?void 0:y.expiration)!=null?v:0)async(n,i,s)=>{const o=s.messageDigest();return{isValid:await t(i).isValidSignature(s.address,o,s.signature)}},CCe=Object.freeze(Object.defineProperty({__proto__:null,AuthError:JO,CRITICAL_CHAINS:II,ErrAccountIsRequired:tte,Session:ECe,SessionSettingsDefault:sE,ValidateSequenceWalletProof:_Ce,isSessionDumpV1:rte,isSessionDumpV2:nte,signAuthorization:ete},Symbol.toStringTag,{value:"Module"}));function I6(){return I6=Object.assign?Object.assign.bind():function(t){for(var e=1;ethis.fetch(this.url("Ping"),Ds({},n)).then(i=>Ls(i).then(s=>({status:s.status}))),this.version=n=>this.fetch(this.url("Version"),Ds({},n)).then(i=>Ls(i).then(s=>({version:s.version}))),this.runtimeStatus=n=>this.fetch(this.url("RuntimeStatus"),Ds({},n)).then(i=>Ls(i).then(s=>({status:s.status}))),this.getSignerConfig=(n,i)=>this.fetch(this.url("GetSignerConfig"),Ds(n,i)).then(s=>Ls(s).then(o=>({signerConfig:o.signerConfig}))),this.sign=(n,i)=>this.fetch(this.url("Sign"),Ds(n,i)).then(s=>Ls(s).then(o=>({sig:o.sig}))),this.signWith=(n,i)=>this.fetch(this.url("SignWith"),Ds(n,i)).then(s=>Ls(s).then(o=>({sig:o.sig}))),this.authMethods=(n,i)=>this.fetch(this.url("AuthMethods"),Ds(n,i)).then(s=>Ls(s).then(o=>({methods:o.methods,active:o.active}))),this.setPIN=(n,i)=>this.fetch(this.url("SetPIN"),Ds(n,i)).then(s=>Ls(s).then(o=>({}))),this.resetPIN=(n,i)=>this.fetch(this.url("ResetPIN"),Ds(n,i)).then(s=>Ls(s).then(o=>({}))),this.createTOTP=(n,i)=>this.fetch(this.url("CreateTOTP"),Ds(n,i)).then(s=>Ls(s).then(o=>({uri:o.uri}))),this.commitTOTP=(n,i)=>this.fetch(this.url("CommitTOTP"),Ds(n,i)).then(s=>Ls(s).then(o=>({codes:o.codes}))),this.resetTOTP=(n,i)=>this.fetch(this.url("ResetTOTP"),Ds(n,i)).then(s=>Ls(s).then(o=>({}))),this.reset2FA=(n,i)=>this.fetch(this.url("Reset2FA"),Ds(n,i)).then(s=>Ls(s).then(o=>({}))),this.recoveryCodes=(n,i)=>this.fetch(this.url("RecoveryCodes"),Ds(n,i)).then(s=>Ls(s).then(o=>({codes:o.codes}))),this.resetRecoveryCodes=(n,i)=>this.fetch(this.url("ResetRecoveryCodes"),Ds(n,i)).then(s=>Ls(s).then(o=>({codes:o.codes}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const Ds=(t={},e={})=>({method:"POST",headers:I6({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{})}),Ls=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch{throw{code:"unknown",msg:`expecting JSON, got: ${e}`,status:t.status}}if(!t.ok)throw r;return r}),ACe=typeof global=="object"?global.fetch:window.fetch;class kCe{constructor(e,r,n=!1){this.address=e,this.url=r,this.appendSuffix=n,this.guard=void 0,this.guard=new SCe(r,ACe)}async getAddress(){return this.address}async buildDeployTransaction(e){}async predecorateSignedTransactions(e){return[]}async decorateTransactions(e,r){return e}async sign(e,r){var n;if(!nt.isWalletSignRequestMetadata(r))throw new Error("expected sequence signature request metadata");const i=r.guardTotpCode,s=Gi.genericCoderFor(r.config.version),{encoded:o}=s.signature.encodeSigners(r.config,(n=r.parts)!=null?n:new Map,[],r.chainId);return(await this.guard.signWith({signer:this.address,request:{msg:Se(e),auxData:this.packMsgAndSig(r.address,r.digest,o,r.chainId),chainId:we.from(r.chainId).toNumber()},token:i?{id:P6.TOTP,token:i}:void 0})).sig}notifyStatusChange(e,r,n){}async getAuthMethods(e){let r;if("jwt"in e)r=await this.guard.authMethods({},{Authorization:`BEARER ${e.jwt}`});else{const n=await aU(e);r=await this.guard.authMethods({proof:{wallet:n.walletAddress,timestamp:n.timestamp.getTime(),signer:n.signerAddress,signature:n.signature}})}return I6({},r,{methods:r.methods.map(ICe)})}async setPin(e,r){const n=await Gv(r);e===void 0?await this.guard.resetPIN({timestamp:n.timestamp.getTime(),signature:n.signature},{Authorization:`BEARER ${r.jwt}`}):await this.guard.setPIN({pin:e,timestamp:n.timestamp.getTime(),signature:n.signature},{Authorization:`BEARER ${r.jwt}`})}resetPin(e){return this.setPin(void 0,e)}async createTotp(e){const r=await Gv(e),{uri:n}=await this.guard.createTOTP({timestamp:r.timestamp.getTime(),signature:r.signature},{Authorization:`BEARER ${e.jwt}`});return new URL(n)}async commitTotp(e,r){const{codes:n}=await this.guard.commitTOTP({token:e},{Authorization:`BEARER ${r}`});return n}async resetTotp(e){const r=await Gv(e);await this.guard.resetTOTP({timestamp:r.timestamp.getTime(),signature:r.signature},{Authorization:`BEARER ${e.jwt}`})}async reset2fa(e,r){if("jwt"in r)await this.guard.reset2FA({code:e},{Authorization:`BEARER ${r.jwt}`});else{const n=await aU(r);await this.guard.reset2FA({code:e,proof:{wallet:n.walletAddress,timestamp:n.timestamp.getTime(),signer:n.signerAddress,signature:n.signature}})}}async getRecoveryCodes(e){const r=await Gv(e),{codes:n}=await this.guard.recoveryCodes({timestamp:r.timestamp.getTime(),signature:r.signature},{Authorization:`BEARER ${e.jwt}`});return n}async resetRecoveryCodes(e){const r=await Gv(e),{codes:n}=await this.guard.resetRecoveryCodes({timestamp:r.timestamp.getTime(),signature:r.signature},{Authorization:`BEARER ${e.jwt}`});return n}packMsgAndSig(e,r,n,i){return Js.encode(["address","uint256","bytes","bytes"],[e,i,r,n])}suffix(){return this.appendSuffix?[3]:[]}}let P6=function(t){return t.PIN="PIN",t.TOTP="TOTP",t}({});function ICe(t){switch(t){case P6.PIN:case P6.TOTP:return t;default:throw new Error(`unknown auth method '${t}'`)}}function PCe(t){return"signerAddress"in t&&typeof t.signerAddress=="string"}async function aU(t){if(PCe(t))return t;{const e=_I.isSapientSigner(t.signer)?t.signer:new _I.SignerWrapper(t.signer),r=await e.getAddress(),n=new Date,i=ite(t.walletAddress,n),s=Q2(i);return{walletAddress:t.walletAddress,timestamp:n,signerAddress:r,signature:Se(await e.sign(s,{}))}}}async function Gv(t){if("wallet"in t){var e;const r=new Date,n=ste(r),i=await t.wallet.signTypedData(n.domain,n.types,n.message,(e=n.domain.chainId)!=null?e:1,"eip6492");return{jwt:t.jwt,timestamp:r,signature:i}}else return t}function ite(t,e){return{domain:ote,types:{AuthMethods:[{name:"wallet",type:"address"},{name:"timestamp",type:"string"}]},message:{wallet:qt(t),timestamp:ate(e)}}}function ste(t){return{domain:ote,types:{AuthUpdate:[{name:"timestamp",type:"string"}]},message:{timestamp:ate(t)}}}const ote={name:"Sequence Guard",version:"1",chainId:1};function ate(t){return t.toUTCString().replace("GMT","UTC")}const RCe=Object.freeze(Object.defineProperty({__proto__:null,AuthMethod:P6,GuardSigner:kCe,getAuthUpdateProofTypedData:ste,getOwnershipProofTypedData:ite},Symbol.toStringTag,{value:"Module"}));function R6(){return R6=Object.assign?Object.assign.bind():function(t){for(var e=1;e{this.queue.length>0&&(this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(this.run,this.options.timeWindow))},this.handle=(n,i,s)=>{if(this.batchableJsonRpcMethods.find(o=>o===i.method)){this.queue.push({request:i,callback:s,next:n}),this.options.verbose&&console.log("Scheduling call",i.method),this.scheduleExecution();return}return this.options.verbose&&console.log("Forwarded call",i.method),n(i,s)},this.run=async function(){r.options.verbose&&console.log("Processing multicall");const n=Math.min(r.options.batchSize,r.queue.length);if(n===0){r.options.verbose&&console.log("Skip multicall, empty queue");return}if(n===1){r.forward(r.queue[0]),r.queue=[],r.options.verbose&&console.log("Skip multicall, single item");return}r.options.verbose&&console.log("Resolving",n);var a=r.queue.slice(0,n);r.queue=n===r.queue.length?[]:r.queue.slice(n),r.options.verbose&&console.log("Updated queue",r.queue.length),r.queue.length!==0&&(r.options.verbose&&console.log("Scheduling next batch"),r.scheduleExecution());const i=a[0].next;let s;var[a,c]=cU(a,p=>{try{if(p.next!==i)return!1;switch(p.request.method){case vi.ethCall:if(p.request.params[0].from||p.request.params[0].gasPrice||p.request.params[0].value)return!1;case vi.ethGetBalance:case vi.ethGetCode:const g=OCe(p.request.params[1]);if(s===void 0&&(s=g),!$Ce(g,s))return!1}return!0}catch{return!1}});if(c.length!==0&&(r.options.verbose&&console.log("Forwarding incompatible calls",c.length),r.forward(c),a.length===0)){r.options.verbose&&console.log("Skip multicall, all calls are incompatible");return}let o=a.map(p=>{try{switch(p.request.method){case vi.ethCall:return{delegateCall:!1,revertOnError:!1,target:p.request.params[0].to,data:p.request.params[0].data,gasLimit:p.request.params[0].gas?p.request.params[0].gas:0,value:0};case vi.ethGetCode:return{delegateCall:!1,revertOnError:!1,target:r.options.contract,gasLimit:0,value:0,data:r.multicallInterface.encodeFunctionData(r.multicallInterface.getFunction("callCode"),[p.request.params[0]])};case vi.ethGetBalance:return{delegateCall:!1,revertOnError:!1,target:r.options.contract,gasLimit:0,value:0,data:r.multicallInterface.encodeFunctionData(r.multicallInterface.getFunction("callBalanceOf"),[p.request.params[0]])};default:return null}}catch{return null}});var[a,c]=cU(a,(p,g)=>o[g]!==void 0);if(o=o.filter(p=>p),c.length!==0&&(r.options.verbose&&console.log("Forwarding calls on error",c.length),r.forward(c),a.length===0)){r.options.verbose&&console.log("Skip multicall, all calls had encoding errors");return}let l;try{r.options.verbose&&console.log("Encoding multicall"),l=r.multicallInterface.encodeFunctionData(r.multicallInterface.getFunction("multiCall"),[o])}catch(p){r.options.verbose&&console.warn("Error encoding multicall, forwarding one by one",p),r.forward(a);return}const u=EO(),f=await TCe(xO(i)({id:u,jsonrpc:Jg,method:vi.ethCall,params:[{to:r.options.contract,value:0,data:l},we.isBigNumber(s)?s.toNumber():s]}),p=>({jsonrpc:Jg,id:u,result:void 0,error:p}));if(f.error)return r.options.verbose&&console.warn("Error calling multicall, forwarding one by one",f.error),r.forward(a);let d;try{d=r.multicallInterface.decodeFunctionResult(r.multicallInterface.getFunction("multiCall"),f.result)}catch(p){r.options.verbose&&console.warn("Error decoding multicall result, forwarding one by one",p),r.forward(a);return}r.options.verbose&&console.log("Got response for",a.length),a.forEach((p,g)=>{if(!d[0][g])r.options.verbose&&console.warn(`Multicall error for ${p.request.method} not found`),r.forward(p);else switch(p.request.method){case vi.ethCall:p.callback(void 0,{jsonrpc:p.request.jsonrpc,id:p.request.id,result:d[1][g]});break;case vi.ethGetCode:p.callback(void 0,{jsonrpc:p.request.jsonrpc,id:p.request.id,result:Js.decode(["bytes"],d[1][g])[0]});break;case vi.ethGetBalance:p.callback(void 0,{jsonrpc:p.request.jsonrpc,id:p.request.id,result:Js.decode(["uint256"],d[1][g])[0]});break}})},this.options=e?R6({},qa.DefaultOptions,e):qa.DefaultOptions,this.options.batchSize<=0)throw new Error(`Invalid batch size of ${this.options.batchSize}`)}forward(e){Array.isArray(e)?e.forEach(r=>r.next(r.request,r.callback)):e.next(e.request,e.callback)}static isMulticall(e){return e&&e.handle!==void 0&&e.conf!==void 0&&qa.isMulticallOptions(e.options)}static isMulticallOptions(e){return e!==void 0&&e.batchSize!==void 0&&e.timeWindow!==void 0&&e.contract!==void 0}}qa.DefaultOptions=R6({},NCe);const cte=["getNetwork","getBlockNumber","getGasPrice","getTransactionCount","getStorageAt","sendTransaction","estimateGas","getBlock","getTransaction","getTransactionReceipt","getLogs","emit","litenerCount","addListener","removeListener","waitForTransaction","detectNetwork","getBlockWithTransactions"];class MCe extends g8{constructor(e,r){var n;super(e.getNetwork()),n=this,this.provider=e,this.multicall=void 0,this.getResolver=async function(i){const s=n.provider;if(s.getResolver){const o=await s.getResolver(await i);return o?new sI(n,o.address,o.name):null}return s.getResolver(await i)},this.next=async function(i,s){try{switch(i.method){case vi.ethCall:n.callback(i,s,await n.provider.call(i.params[0],i.params[1]));break;case vi.ethGetCode:n.callback(i,s,await n.provider.getCode(i.params[0],i.params[1]));break;case vi.ethGetBalance:n.callback(i,s,await n.provider.getBalance(i.params[0],i.params[1]));break}}catch(o){n.callback(i,s,void 0,o)}},this.listenerCount=e.listenerCount.bind(e),this.multicall=qa.isMulticall(r)?r:new qa(r),cte.forEach(i=>{e[i]!==void 0&&(this[i]=(...s)=>e[i](...s))})}callback(e,r,n,i){r(i,{jsonrpc:Jg,id:e.id,result:n,error:i})}async call(e,r){return this.rpcCall(vi.ethCall,e,r)}async getCode(e,r){return this.rpcCall(vi.ethGetCode,e,r)}async getBalance(e,r){return this.rpcCall(vi.ethGetBalance,e,r)}async rpcCall(e,...r){const n=EO();return(await xO(this.multicall.handle)(this.next,{jsonrpc:Jg,id:n,method:e,params:r})).result}}class DCe{constructor(e,r){if(this.provider=e,this.multicall=void 0,this.multicall=qa.isMulticall(r)?r:new qa(r),e.send){const n=async function(s,o){e.send(s,o)};this.send=(i,s)=>{this.multicall.handle(n,i,s)}}if(e.sendAsync){const n=async function(s,o){e.sendAsync(s,o)};this.sendAsync=(i,s)=>{this.multicall.handle(n,i,s)}}}get isMetaMask(){return this.provider.isMetaMask}get isStatus(){return this.provider.isStatus}}const LCe=t=>e=>{const r=qa.isMulticall(t)?t:new qa(t);return(n,i)=>r.handle(e,n,i)};var BCe=Object.freeze({__proto__:null,ProxyMethods:cte,MulticallProvider:MCe,MulticallExternalProvider:DCe,multicallMiddleware:LCe});const FCe=Object.freeze(Object.defineProperty({__proto__:null,Multicall:qa,providers:BCe},Symbol.toStringTag,{value:"Module"}));var lte={exports:{}};/*! + * EventEmitter2 + * https://github.com/hij1nx/EventEmitter2 + * + * Copyright (c) 2013 hij1nx + * Licensed under the MIT license. + */(function(t,e){(function(r){var n=Object.hasOwnProperty,i=Array.isArray?Array.isArray:function(L){return Object.prototype.toString.call(L)==="[object Array]"},s=10,o=typeof process=="object"&&typeof process.nextTick=="function",a=typeof Symbol=="function",c=typeof Reflect=="object",l=typeof setImmediate=="function",u=l?setImmediate:setTimeout,f=a?c&&typeof Reflect.ownKeys=="function"?Reflect.ownKeys:function(R){var L=Object.getOwnPropertyNames(R);return L.push.apply(L,Object.getOwnPropertySymbols(R)),L}:Object.keys;function d(){this._events={},this._conf&&p.call(this,this._conf)}function p(R){R&&(this._conf=R,R.delimiter&&(this.delimiter=R.delimiter),R.maxListeners!==r&&(this._maxListeners=R.maxListeners),R.wildcard&&(this.wildcard=R.wildcard),R.newListener&&(this._newListener=R.newListener),R.removeListener&&(this._removeListener=R.removeListener),R.verboseMemoryLeak&&(this.verboseMemoryLeak=R.verboseMemoryLeak),R.ignoreErrors&&(this.ignoreErrors=R.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function g(R,L){var q="(node) warning: possible EventEmitter memory leak detected. "+R+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(q+=" Event name: "+L+"."),typeof process<"u"&&process.emitWarning){var N=new Error(q);N.name="MaxListenersExceededWarning",N.emitter=this,N.count=R,process.emitWarning(N)}else console.error(q),console.trace&&console.trace()}var v=function(R,L,q){var N=arguments.length;switch(N){case 0:return[];case 1:return[R];case 2:return[R,L];case 3:return[R,L,q];default:for(var I=new Array(N);N--;)I[N]=arguments[N];return I}};function y(R,L){for(var q={},N,I=R.length,U=L?L.length:0,re=0;re0;)R=U[G],re.call(M,R,q[R]);this._listeners={},this._listenersCount=0,H()}}});function w(R,L,q,N){var I=Object.assign({},L);if(!R)return I;if(typeof R!="object")throw TypeError("options must be an object");var U=Object.keys(R),re=U.length,M,G,H;function J(D){throw Error('Invalid "'+M+'" option value'+(D?". Reason: "+D:""))}for(var X=0;X0;)if(M===R[G])return U;re(L)}}var S=C(["function"]),P=C(["object","function"]);function _(R,L,q){var N,I,U=0,re,M=new R(function(G,H,J){q=w(q,{timeout:0,overload:!1},{timeout:function(Y,ue){return Y*=1,(typeof Y!="number"||Y<0||!Number.isFinite(Y))&&ue("timeout must be a positive number"),Y}}),N=!q.overload&&typeof R.prototype.cancel=="function"&&typeof J=="function";function X(){I&&(I=null),U&&(clearTimeout(U),U=0)}var D=function(Y){X(),G(Y)},F=function(Y){X(),H(Y)};N?L(D,F,J):(I=[function(Y){F(Y||Error("canceled"))}],L(D,F,function(Y){if(re)throw Error("Unable to subscribe on cancel event asynchronously");if(typeof Y!="function")throw TypeError("onCancel callback must be a function");I.push(Y)}),re=!0),q.timeout>0&&(U=setTimeout(function(){var Y=Error("timeout");Y.code="ETIMEDOUT",U=0,M.cancel(Y),H(Y)},q.timeout))});return N||(M.cancel=function(G){if(I){for(var H=I.length,J=1;J0;)F=We[M],F!=="_listeners"&&(ot=Q(R,L,q[F],N+1,I),ot&&(D?D.push.apply(D,ot):D=ot));return D}else if(Me==="**"){for(Ce=N+1===I||N+2===I&&Oe==="*",Ce&&q._listeners&&(D=Q(R,L,q,I,I)),We=f(q),M=We.length;M-- >0;)F=We[M],F!=="_listeners"&&(F==="*"||F==="**"?(q[F]._listeners&&!Ce&&(ot=Q(R,L,q[F],I,I),ot&&(D?D.push.apply(D,ot):D=ot)),ot=Q(R,L,q[F],N,I)):F===Oe?ot=Q(R,L,q[F],N+2,I):ot=Q(R,L,q[F],N,I),ot&&(D?D.push.apply(D,ot):D=ot));return D}else q[Me]&&(D=Q(R,L,q[Me],N+1,I));if(Y=q["*"],Y&&Q(R,L,Y,N+1,I),ue=q["**"],ue)if(N0;)F=We[M],F!=="_listeners"&&(F===Oe?Q(R,L,ue[F],N+2,I):F===Me?Q(R,L,ue[F],N+1,I):(he={},he[F]=ue[F],Q(R,L,{"**":he},N+1,I)));else ue._listeners?Q(R,L,ue,I,I):ue["*"]&&ue["*"]._listeners&&Q(R,L,ue["*"],I,I);return D}function Z(R,L,q){var N=0,I=0,U,re=this.delimiter,M=re.length,G;if(typeof R=="string")if((U=R.indexOf(re))!==-1){G=new Array(5);do G[N++]=R.slice(I,U),I=U+M;while((U=R.indexOf(re,I))!==-1);G[N++]=R.slice(I)}else G=[R],N=1;else G=R,N=R.length;if(N>1){for(U=0;U+10&&H._listeners.length>this._maxListeners&&(H._listeners.warned=!0,g.call(this,H._listeners.length,J))):H._listeners=L,!0;return!0}function ne(R,L,q,N){for(var I=f(R),U=I.length,re,M,G,H=R._listeners,J;U-- >0;)M=I[U],re=R[M],M==="_listeners"?G=q:G=q?q.concat(M):[M],J=N||typeof M=="symbol",H&&L.push(J?G:G.join(this.delimiter)),typeof re=="object"&&ne.call(this,re,L,G,J);return L}function ce(R){for(var L=f(R),q=L.length,N,I,U;q-- >0;)I=L[q],N=R[I],N&&(U=!0,I!=="_listeners"&&!ce(N)&&delete R[I]);return U}function K(R,L,q){this.emitter=R,this.event=L,this.listener=q}K.prototype.off=function(){return this.emitter.off(this.event,this.listener),this};function x(R,L,q){if(q===!0)I=!0;else if(q===!1)N=!0;else{if(!q||typeof q!="object")throw TypeError("options should be an object or true");var N=q.async,I=q.promisify,U=q.nextTick,re=q.objectify}if(N||U||I){var M=L,G=L._origin||L;if(U&&!o)throw Error("process.nextTick is not supported");I===r&&(I=L.constructor.name==="AsyncFunction"),L=function(){var H=arguments,J=this,X=this.event;return I?U?Promise.resolve():new Promise(function(D){u(D)}).then(function(){return J.event=X,M.apply(J,H)}):(U?process.nextTick:u)(function(){J.event=X,M.apply(J,H)})},L._async=!0,L._origin=G}return[L,re?new K(this,R,L):this]}function A(R){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,p.call(this,R)}A.EventEmitter2=A,A.prototype.listenTo=function(R,L,q){if(typeof R!="object")throw TypeError("target musts be an object");var N=this;q=w(q,{on:r,off:r,reducers:r},{on:S,off:S,reducers:P});function I(U){if(typeof U!="object")throw TypeError("events must be an object");var re=q.reducers,M=T.call(N,R),G;M===-1?G=new b(N,R,q):G=N._observers[M];for(var H=f(U),J=H.length,X,D=typeof re=="function",F=0;F0;)I=q[N],(!R||I._target===R)&&(I.unsubscribe(L),U=!0);return U},A.prototype.delimiter=".",A.prototype.setMaxListeners=function(R){R!==r&&(this._maxListeners=R,this._conf||(this._conf={}),this._conf.maxListeners=R)},A.prototype.getMaxListeners=function(){return this._maxListeners},A.prototype.event="",A.prototype.once=function(R,L,q){return this._once(R,L,!1,q)},A.prototype.prependOnceListener=function(R,L,q){return this._once(R,L,!0,q)},A.prototype._once=function(R,L,q,N){return this._many(R,1,L,q,N)},A.prototype.many=function(R,L,q,N){return this._many(R,L,q,!1,N)},A.prototype.prependMany=function(R,L,q,N){return this._many(R,L,q,!0,N)},A.prototype._many=function(R,L,q,N,I){var U=this;if(typeof q!="function")throw new Error("many only accepts instances of Function");function re(){return--L===0&&U.off(R,re),q.apply(this,arguments)}return re._origin=q,this._on(R,re,N,I)},A.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||d.call(this);var R=arguments[0],L,q=this.wildcard,N,I,U,re,M;if(R==="newListener"&&!this._newListener&&!this._events.newListener)return!1;if(q&&(L=R,R!=="newListener"&&R!=="removeListener"&&typeof R=="object")){if(I=R.length,a){for(U=0;U3)for(N=new Array(G-1),re=1;re3)for(I=new Array(H-1),M=1;M0&&this._events[R].length>this._maxListeners&&(this._events[R].warned=!0,g.call(this,this._events[R].length,R))):this._events[R]=L,I)},A.prototype.off=function(R,L){if(typeof L!="function")throw new Error("removeListener only takes instances of Function");var q,N=[];if(this.wildcard){var I=typeof R=="string"?R.split(this.delimiter):R.slice();if(N=Q.call(this,null,I,this.listenerTree,0),!N)return this}else{if(!this._events[R])return this;q=this._events[R],N.push({_listeners:q})}for(var U=0;U0){for(N=this._all,L=0,q=N.length;L0;)N=L[q[U]],typeof N=="function"?I.push(N):I.push.apply(I,N);return I}else{if(this.wildcard){if(re=this.listenerTree,!re)return[];var M=[],G=typeof R=="string"?R.split(this.delimiter):R.slice();return Q.call(this,M,G,re,0),M}return L?(N=L[R],N?typeof N=="function"?[N]:N:[]):[]}},A.prototype.eventNames=function(R){var L=this._events;return this.wildcard?ne.call(this,this.listenerTree,[],null,R):L?f(L):[]},A.prototype.listenerCount=function(R){return this.listeners(R).length},A.prototype.hasListeners=function(R){if(this.wildcard){var L=[],q=typeof R=="string"?R.split(this.delimiter):R.slice();return Q.call(this,L,q,this.listenerTree,0),L.length>0}var N=this._events,I=this._all;return!!(I&&I.length||N&&(R===r?f(N).length:N[R]))},A.prototype.listenersAny=function(){return this._all?this._all:[]},A.prototype.waitFor=function(R,L){var q=this,N=typeof L;return N==="number"?L={timeout:L}:N==="function"&&(L={filter:L}),L=w(L,{timeout:0,filter:r,handleError:!1,Promise,overload:!1},{filter:S,Promise:E}),_(L.Promise,function(I,U,re){function M(){var G=L.filter;if(!(G&&!G.apply(q,arguments)))if(q.off(R,M),L.handleError){var H=arguments[0];H?U(H):I(v.apply(null,arguments).slice(1))}else I(v.apply(null,arguments))}re(function(){q.off(R,M)}),q._on(R,M,!1)},{timeout:L.timeout,overload:L.overload})};function B(R,L,q){q=w(q,{Promise,timeout:0,overload:!1},{Promise:E});var N=q.Promise;return _(N,function(I,U,re){var M;if(typeof R.addEventListener=="function"){M=function(){I(v.apply(null,arguments))},re(function(){R.removeEventListener(L,M)}),R.addEventListener(L,M,{once:!0});return}var G=function(){H&&R.removeListener("error",H),I(v.apply(null,arguments))},H;L!=="error"&&(H=function(J){R.removeListener(L,G),U(J)},R.once("error",H)),re(function(){H&&R.removeListener("error",H),R.removeListener(L,G)}),R.once(L,G)},{timeout:q.timeout,overload:q.overload})}var z=A.prototype;Object.defineProperties(A,{defaultMaxListeners:{get:function(){return z._maxListeners},set:function(R){if(typeof R!="number"||R<0||Number.isNaN(R))throw TypeError("n must be a non-negative number");z._maxListeners=R},enumerable:!0},once:{value:B,writable:!0,configurable:!0}}),Object.defineProperties(z,{_maxListeners:{value:s,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),typeof r=="function"&&r.amd?r(function(){return A}):t.exports=A})()})(lte);var S8=lte.exports;function lU(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function ute(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function T6(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function fte(t,e){ute(t);const r=e.outputLen;if(t.lengtht instanceof Uint8Array,jCe=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),JA=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),ol=(t,e)=>t<<32-e|t>>>e,UCe=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!UCe)throw new Error("Non little-endian hardware is not supported");const zCe=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function HCe(t){if(!dte(t))throw new Error("Uint8Array expected");let e="";for(let r=0;rt().update(QO(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function WCe(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,l=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+l,a,n)}class VCe extends hte{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=JA(this.buffer)}update(e){T6(this);const{view:r,buffer:n,blockLen:i}=this;e=QO(e);const s=e.length;for(let o=0;oi-o&&(this.process(n,0),o=0);for(let f=o;fu.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;ft&e^~t&r,KCe=(t,e,r)=>t&e^t&r^e&r,JCe=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Kf=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Jf=new Uint32Array(64);class QCe extends VCe{constructor(){super(64,32,8,!1),this.A=Kf[0]|0,this.B=Kf[1]|0,this.C=Kf[2]|0,this.D=Kf[3]|0,this.E=Kf[4]|0,this.F=Kf[5]|0,this.G=Kf[6]|0,this.H=Kf[7]|0}get(){const{A:e,B:r,C:n,D:i,E:s,F:o,G:a,H:c}=this;return[e,r,n,i,s,o,a,c]}set(e,r,n,i,s,o,a,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,r){for(let f=0;f<16;f++,r+=4)Jf[f]=e.getUint32(r,!1);for(let f=16;f<64;f++){const d=Jf[f-15],p=Jf[f-2],g=ol(d,7)^ol(d,18)^d>>>3,v=ol(p,17)^ol(p,19)^p>>>10;Jf[f]=v+Jf[f-7]+g+Jf[f-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:c,G:l,H:u}=this;for(let f=0;f<64;f++){const d=ol(a,6)^ol(a,11)^ol(a,25),p=u+d+GCe(a,c,l)+JCe[f]+Jf[f]|0,v=(ol(n,2)^ol(n,13)^ol(n,22))+KCe(n,i,s)|0;u=l,l=c,c=a,a=o+p|0,o=s,s=i,i=n,n=p+v|0}n=n+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,l=l+this.G|0,u=u+this.H|0,this.set(n,i,s,o,a,c,l,u)}roundClean(){Jf.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const YCe=pte(()=>new QCe);var ZCe=class{constructor(t,e){Rr(this,"hostname");Rr(this,"fetch");Rr(this,"path","/rpc/Databeat/");Rr(this,"ping",(t,e)=>this.fetch(this.url("Ping"),Kv({},t,e)).then(r=>Jv(r).then(n=>({status:n.status})),r=>{throw Tp.new({cause:`fetch(): ${r.message||""}`})}));Rr(this,"version",(t,e)=>this.fetch(this.url("Version"),Kv({},t,e)).then(r=>Jv(r).then(n=>({version:n.version})),r=>{throw Tp.new({cause:`fetch(): ${r.message||""}`})}));Rr(this,"runtimeStatus",(t,e)=>this.fetch(this.url("RuntimeStatus"),Kv({},t,e)).then(r=>Jv(r).then(n=>({status:n.status})),r=>{throw Tp.new({cause:`fetch(): ${r.message||""}`})}));Rr(this,"tick",(t,e,r)=>this.fetch(this.url("Tick"),Kv(t,e,r)).then(n=>Jv(n).then(i=>({ok:i.ok})),n=>{throw Tp.new({cause:`fetch(): ${n.message||""}`})}));Rr(this,"rawEvents",(t,e,r)=>this.fetch(this.url("RawEvents"),Kv(t,e,r)).then(n=>Jv(n).then(i=>({ok:i.ok})),n=>{throw Tp.new({cause:`fetch(): ${n.message||""}`})}));this.hostname=t,this.fetch=(r,n)=>e(r,n)}url(t){return this.hostname+this.path+t}},Kv=(t={},e={},r=null)=>({method:"POST",headers:{...e,"Content-Type":"application/json"},body:JSON.stringify(t||{}),signal:r}),Jv=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch(n){let i="";throw n instanceof Error&&(i=n.message),xte.new({status:t.status,cause:`JSON.parse(): ${i}: response text: ${e}`})}if(!t.ok){const n=typeof r.code=="number"?r.code:0;throw(g4e[n]||Si).new(r)}return r}),Si=class gte extends Error{constructor(r,n,i,s,o){super(i);Rr(this,"name");Rr(this,"code");Rr(this,"message");Rr(this,"status");Rr(this,"cause");Rr(this,"msg");this.name=r||"WebrpcError",this.code=typeof n=="number"?n:0,this.message=i||`endpoint error ${this.code}`,this.msg=this.message,this.status=typeof s=="number"?s:0,this.cause=o,Object.setPrototypeOf(this,gte.prototype)}static new(r){return new this(r.error,r.code,r.message||r.msg,r.status,r.cause)}},XCe=class mte extends Si{constructor(e="WebrpcEndpoint",r=0,n="endpoint error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,mte.prototype)}},Tp=class vte extends Si{constructor(e="WebrpcRequestFailed",r=-1,n="request failed",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,vte.prototype)}},e4e=class yte extends Si{constructor(e="WebrpcBadRoute",r=-2,n="bad route",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,yte.prototype)}},t4e=class bte extends Si{constructor(e="WebrpcBadMethod",r=-3,n="bad method",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,bte.prototype)}},r4e=class wte extends Si{constructor(e="WebrpcBadRequest",r=-4,n="bad request",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,wte.prototype)}},xte=class Ete extends Si{constructor(e="WebrpcBadResponse",r=-5,n="bad response",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Ete.prototype)}},n4e=class _te extends Si{constructor(e="WebrpcServerPanic",r=-6,n="server panic",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,_te.prototype)}},i4e=class Cte extends Si{constructor(e="WebrpcInternalError",r=-7,n="internal error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Cte.prototype)}},s4e=class Ste extends Si{constructor(e="WebrpcClientDisconnected",r=-8,n="client disconnected",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Ste.prototype)}},o4e=class Ate extends Si{constructor(e="WebrpcStreamLost",r=-9,n="stream lost",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Ate.prototype)}},a4e=class kte extends Si{constructor(e="WebrpcStreamFinished",r=-10,n="stream finished",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,kte.prototype)}},c4e=class Ite extends Si{constructor(e="Unauthorized",r=1e3,n="Unauthorized access",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Ite.prototype)}},l4e=class Pte extends Si{constructor(e="PermissionDenied",r=2e3,n="Permission denied",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Pte.prototype)}},u4e=class Rte extends Si{constructor(e="SessionExpired",r=2001,n="Session expired",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Rte.prototype)}},f4e=class Tte extends Si{constructor(e="NotFound",r=3e3,n="Resource not found",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Tte.prototype)}},d4e=class Ote extends Si{constructor(e="InvalidAppKey",r=4e3,n="Invalid app key",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Ote.prototype)}},h4e=class $te extends Si{constructor(e="QueryFailed",r=4001,n="DB query failed",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,$te.prototype)}},p4e=class Nte extends Si{constructor(e="InvalidProjectId",r=4002,n="Invalid project id",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Nte.prototype)}},g4e={0:XCe,[-1]:Tp,[-2]:e4e,[-3]:t4e,[-4]:r4e,[-5]:xte,[-6]:n4e,[-7]:i4e,[-8]:s4e,[-9]:o4e,[-10]:a4e,1e3:c4e,2e3:l4e,2001:u4e,3e3:f4e,4e3:d4e,4001:h4e,4002:p4e},uU=typeof global=="object"?global.fetch:window.fetch,m4e=class extends ZCe{constructor(e,r){super(e.endsWith("/")?e.slice(0,-1):e,uU);Rr(this,"_fetch",(e,r)=>{var n;if(this.auth){let i={};((n=this.auth.jwt)==null?void 0:n.length)>0&&(i.Authorization=`BEARER ${this.auth.jwt}`),this.auth.headers&&(i={...i,...this.auth.headers}),r.headers={...r.headers,...i}}return uU(e,r)});this.auth=r,this.fetch=this._fetch}},fU=150,Gh={defaultEnabled:!0,noop:!1,privacy:{userIdHash:!0,userAgentSalt:!1},userIdentTracking:!1,strictMode:!1,flushInterval:500,initProps:()=>({})},v4e=class{constructor(t,e,r){Rr(this,"rpc");Rr(this,"auth");Rr(this,"options");Rr(this,"enabled");Rr(this,"ident");Rr(this,"userId");Rr(this,"sessionId");Rr(this,"allowUserTracking");Rr(this,"projectId");Rr(this,"queue");Rr(this,"flushTimeout");Rr(this,"defaultProps");Rr(this,"previousPageKey");Rr(this,"ts");Rr(this,"flush",async()=>{if(this.flushTimeout!==null&&(clearTimeout(this.flushTimeout),this.flushTimeout=null),!this.enabled||this.options.noop||this.options.strictMode&&!this.allowUserTracking||this.queue.length===0)return;const t=this.dedupedQueue();this.queue=[];try{await this.rpc.tick({events:t})}catch(e){console.warn(`databeat flush failed: ${e}`)}});Rr(this,"dedupedQueue",()=>{const t=new Map;for(let e=0;efU&&(this.queue=this.queue.splice(this.queue.length-fU)),this.enabled&&(e&&e.flush?await this.flush():this.flushTimeout===null&&(this.flushTimeout=setTimeout(()=>{this.flush()},this.options.flushInterval)))}trackView(t={}){const e={...this.defaultProps,...t},r=hU(),n=`${r}:${JSON.stringify(e)}:${this.userId}:${this.sessionId}`;this.previousPageKey!==n&&(this.previousPageKey=n,this.track({event:"VIEW",source:r,props:e}))}isEnabled(){return this.enabled}isAnon(){return this.ident===0}getIdent(){return this.ident}getUserId(){return this.userId}getSessionId(){return this.sessionId}getStorageTS(){if(this.ts)return this.ts;const t=PI();if(!(t==null||t.id===null))return this.ts=t.ts,this.ts}enable(){if(!Mte(this.auth)){this.enabled=!1;return}Uu()&&(this.enabled=!0,this.ts=ap({on:this.enabled,id:this.userId,it:this.ident,ut:this.allowUserTracking}),this.identify())}disable(){Uu()&&(this.enabled=!1,this.ts=ap({on:this.enabled,id:this.userId,it:this.ident,ut:this.allowUserTracking}))}},Uu=()=>typeof window=="object"&&typeof window.localStorage=="object"&&typeof window.localStorage.getItem=="function"&&typeof window.localStorage.setItem=="function",dU=(t,e)=>{if(!Mte(e))return!1;if(!Uu())return!0;const r=PI();return r===null?t??!0:r.on},Mte=t=>{var e;return!!(((e=t==null?void 0:t.jwt)==null?void 0:e.length)>0||t!=null&&t.headers&&Object.keys(t.headers).length>0)},hU=()=>{try{return window.location.pathname}catch{return""}},y4e=()=>{if(!Uu())return{};const t=new URL(window.location.href).searchParams,e={};return e.origin=window.location.origin,t.get("ref")&&t.get("ref")!==""&&(e.ref=t.get("ref")||""),t.get("source")&&t.get("source")!==""&&(e.source=t.get("source")||""),t.get("utm_source")&&t.get("utm_source")!==""&&(e.utmSource=t.get("utm_source")||""),t.get("utm_campaign")&&t.get("utm_campaign")!==""&&(e.utmCampaign=t.get("utm_campaign")||""),t.get("utm_medium")&&t.get("utm_medium")!==""&&(e.utmMedium=t.get("utm_medium")||""),t.get("utm_content")&&t.get("utm_content")!==""&&(e.utmContent=t.get("utm_content")||""),t.get("utm_term")&&t.get("utm_term")!==""&&(e.utmTerm=t.get("utm_term")||""),document.referrer&&document.referrer!==""&&(e.referrer=document.referrer),e},O6="_dbeat",PI=()=>{try{return JSON.parse(window.localStorage.getItem(O6))}catch{return null}},ap=t=>{try{return t.ts||(t.ts=Math.floor(Date.now()/1e3)),window.localStorage.setItem(O6,JSON.stringify(t)),t.ts}catch{return}},b4e=(t,e,r)=>{if(!t||t===null||t==="")return{userId:`${Math.floor(Math.random()*1e14)}`,ident:0};if(r.userIdentTracking&&e)return{userId:t,ident:2};if(r.privacy.userIdHash===!0||!r.userIdentTracking||!e)return Uu()&&r.privacy.userAgentSalt===!0&&(t=t+":"+navigator.userAgent),r.privacy.extraSalt&&r.privacy.extraSalt.length>0&&(t=t+":"+r.privacy.extraSalt),{userId:HCe(YCe(t)).substring(0,50),ident:1};throw new Error("invalid configuration")},w4e=()=>{if(Uu()&&typeof window.sessionStorage=="object"&&typeof window.sessionStorage.getItem=="function"&&typeof window.sessionStorage.setItem=="function"){const e=window.sessionStorage.getItem(O6);if(e&&e.length>0)return e;{const r=pU(16);return window.sessionStorage.setItem(O6,r),r}}else return pU(16)},pU=t=>{let e="";for(let r=0;r++x4e;class rw{constructor(){var e=this;this.pendingMessageRequests=[],this.responseCallbacks=new Map,this.state=void 0,this.confirmationOnly=!1,this.events=new S8.EventEmitter2,this.openPayload=void 0,this.connectPayload=void 0,this.accountsChangedPayload=void 0,this.networksPayload=void 0,this.walletContextPayload=void 0,this._sessionId=void 0,this._init=void 0,this._registered=void 0,this.sendAsync=async function(r,n,i){e.state===Na.CLOSED&&(e.confirmationOnly=!0),e.openWallet(void 0,{type:"jsonRpcRequest",method:r.method},i);try{e.isOpened()||await e.waitUntilOpened();const s=await e.sendMessageRequest({idx:Fte(),type:ar.MESSAGE,data:r,chainId:i});n(void 0,s.data)}catch(s){n(s)}},this.sendMessageRequest=async function(r){return new Promise((n,i)=>{(!r.idx||r.idx<=0)&&r.type!=="init"&&i(new Error("message idx not set"));const s=(a,c)=>{if(a)i(a);else if(c)n(c);else throw new Error("no valid response to return")},o=r.idx;e.responseCallbacks.get(o)?i(new Error("duplicate message idx, should never happen")):e.responseCallbacks.set(o,s),e.isOpened()?e.sendMessage(r):(mt.debug("pushing to pending requests",r),e.pendingMessageRequests.push(r))})},this.waitUntilOpened=async function(r=YO){let n=!1;return Promise.race([new Promise((i,s)=>{const o=setTimeout(()=>{clearTimeout(o),n||(e.state=Na.CLOSED,e.events.emit("close",{code:1005,message:"opening wallet timed out"})),s(new Error("opening wallet timed out"))},r)}),new Promise(i=>{if(e.isOpened()){var s;n=!0,i((s=e.openPayload)==null?void 0:s.session);return}e.events.once("open",o=>{e.openPayload=o,n=!0,i(o.session)})})])},this.waitUntilConnected=async function(){await e.waitUntilOpened();const r=new Promise(i=>{if(e.connectPayload){i(e.connectPayload);return}e.events.once("connect",s=>{e.connectPayload=s,i(s)})}),n=new Promise((i,s)=>{e.events.once("close",o=>{s(o?new Error(`wallet closed due to ${JSON.stringify(o)}`):new Error("user closed the wallet"))})});return Promise.race([r,n])},this.state=Na.CLOSED,this._registered=!1,this._init=un.NIL}get registered(){return this._registered}register(){throw new Error("abstract method")}unregister(){throw new Error("abstract method")}openWallet(e,r,n){throw new Error("abstract method")}closeWallet(){throw new Error("abstract method")}isOpened(){return this.registered&&this.state===Na.OPENED}isConnected(){var e;const r=(e=this.openPayload)==null?void 0:e.session;return this.registered&&r!==void 0&&!!r.accountAddress&&r.accountAddress.length===42&&!!r.networks&&r.networks.length>0}handleMessage(e){var r=this;if(e.type===ar.INIT){mt.debug("MessageProvider, received INIT message",e);const{nonce:c}=e.data;if(!c||c.length==0){mt.error("invalid init nonce");return}this._init=un.OK,this.sendMessage({idx:-1,type:ar.INIT,data:{sessionId:this._sessionId,nonce:c}})}if(this._init!==un.OK)return;mt.debug("RECEIVED MESSAGE FROM WALLET",e.idx,e);const n=e.idx,i=this.responseCallbacks.get(n);if(n&&this.responseCallbacks.delete(n),e.type===ar.OPEN&&!this.isOpened()){var s,o;if(this._sessionId&&this._sessionId!==((s=e.data)==null?void 0:s.sessionId)){mt.debug("open event received from wallet, but does not match sessionId",this._sessionId);return}if((o=e.data)!=null&&o.error){var a;const c=new Error(`opening wallet failed: received ${(a=e.data)==null?void 0:a.error}`);throw mt.error(c),this.close(),c}this.state=Na.OPENED,this.openPayload=e.data,this.events.emit("open",this.openPayload),this.pendingMessageRequests.length!==0&&this.pendingMessageRequests.splice(0,this.pendingMessageRequests.length).forEach(async function(l){r.sendMessage(l)});return}if(e.type===ar.MESSAGE){if(this.confirmationOnly&&setTimeout(()=>{this.responseCallbacks.size===0&&this.closeWallet()},500),!i)throw new Error("impossible state");if(i){this.events.emit("message",e),i(e.data.error,e);return}}if(e.type===ar.ACCOUNTS_CHANGED){this.accountsChangedPayload={accounts:[]},e.data&&e.data.length>0?(this.accountsChangedPayload={accounts:[qt(e.data[0])],origin:e.origin},this.events.emit("accountsChanged",this.accountsChangedPayload.accounts,this.accountsChangedPayload.origin)):this.events.emit("accountsChanged",[],e.origin);return}if(e.type===ar.CHAIN_CHANGED){this.events.emit("chainChanged",e.data,e.origin);return}if(e.type===ar.NETWORKS){this.networksPayload=e.data,this.events.emit("networks",this.networksPayload);return}if(e.type===ar.WALLET_CONTEXT){this.walletContextPayload=e.data,this.events.emit("walletContext",this.walletContextPayload);return}e.type===ar.CLOSE&&this.state!==Na.CLOSED&&this.close(e.data),e.type===ar.CONNECT&&(this.connectPayload=e.data,this.events.emit("connect",this.connectPayload)),e.type===ar.DISCONNECT&&this.isConnected()&&(this.events.emit("disconnect",e.data,e.origin),this.close())}sendMessage(e){throw new Error("abstract method")}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}emit(e,...r){return this.events.emit(e,...r)}close(e){this.state!==Na.CLOSED&&(this.state=Na.CLOSED,this.confirmationOnly=!1,this._sessionId=void 0,mt.info("closing wallet and flushing!"),this.pendingMessageRequests.length=0,this.responseCallbacks.forEach(r=>{r(Eo({},new Error("wallet closed"),{code:4001}))}),this.responseCallbacks.clear(),this.connectPayload=void 0,this.openPayload=void 0,this.accountsChangedPayload=void 0,this.networksPayload=void 0,this.walletContextPayload=void 0,this.events.emit("close",e))}}function E4e(t){return _4e.some(e=>e.predicate(t))}const _4e=[{name:"Decentraland Exception",predicate:S4e},{name:"0x v3 Exception",predicate:A4e}],C4e=/^Decentraland Login\nEphemeral address: 0x[a-fA-F0-9]{40}\nExpiration: (\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)((-(\d{2}):(\d{2})|Z)?)$/;function S4e(t){try{const e=Cf(t);return C4e.test(e)}catch{return!1}}function A4e(t){const e=new fi(k4e);try{return e.decodeFunctionData("OrderWithHash",t),!0}catch{return!1}}const k4e=[{inputs:[{components:[{internalType:"address",name:"makerAddress",type:"address"},{internalType:"address",name:"takerAddress",type:"address"},{internalType:"address",name:"feeRecipientAddress",type:"address"},{internalType:"address",name:"senderAddress",type:"address"},{internalType:"uint256",name:"makerAssetAmount",type:"uint256"},{internalType:"uint256",name:"takerAssetAmount",type:"uint256"},{internalType:"uint256",name:"makerFee",type:"uint256"},{internalType:"uint256",name:"takerFee",type:"uint256"},{internalType:"uint256",name:"expirationTimeSeconds",type:"uint256"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes",name:"makerAssetData",type:"bytes"},{internalType:"bytes",name:"takerAssetData",type:"bytes"},{internalType:"bytes",name:"makerFeeAssetData",type:"bytes"},{internalType:"bytes",name:"takerFeeAssetData",type:"bytes"}],internalType:"struct IEIP1271Data.Order",name:"order",type:"tuple"},{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderWithHash",outputs:[],stateMutability:"pure",type:"function"}],aE=qr(`Ethereum Signed Message: +`),jte=t=>Ef(t)||Vt(t)?Ae(t):qr(t),A8=t=>{const e=jte(t);return E4e(e)?e:zr([aE,qr(String(e.length)),e])},I4e=t=>{if(JSON.stringify(t.slice(0,aE.length))!==JSON.stringify(aE))return t;const e=t.slice(aE.length),r=String(e.length).length;let n,i;try{i=Number(Cf(e.slice(0,r)))}catch{i=Number(Se(e.slice(0,r)))}return i>e.length||!Number.isInteger(i)?n=r-1:n=r,e.slice(n)},Yg=async(t,e,r,n)=>new nt.reader.OnChainReader(n).isValidSignature(t,e,r),Ute=async(t,e,r,n)=>{const i=A8(e),s=wO(i);return Yg(t,s,r,n)},zte=(t,e,r,n)=>Yg(t,Q2(e),r,n),$6=()=>window.location.protocol==="chrome-extension:"||window.location.protocol==="moz-extension:",Hte=()=>!!navigator.userAgent.match(/UnitySequence/i),qte=t=>t.onChain.deployed&&t.fullyMigrated;class Wte{constructor(){this.callbacks=[],this.store={}}getItem(e){return this.store[e]||null}setItem(e,r){this.store[e]=r,this.callbacks.filter(n=>n.key===e).forEach(n=>n.cb(r))}removeItem(e){delete this.store[e]}onItemChange(e,r){return this.callbacks.push({key:e,cb:r}),()=>{this.callbacks=this.callbacks.filter(n=>n.cb!==r)}}}class Gb{static isAvailable(){return typeof window=="object"&&typeof window.localStorage=="object"}constructor(){if(this.callbacks=[],!Gb.isAvailable())throw new Error("LocalStorage is not available");window.addEventListener("storage",e=>{const{key:r}=e;this.callbacks.filter(i=>i.key===r).forEach(i=>i.cb(this.getItem(r)))})}getItem(e){return window.localStorage.getItem(e)}setItem(e,r){window.localStorage.setItem(e,r),this.callbacks.filter(n=>n.key===e).forEach(n=>n.cb(r))}removeItem(e){window.localStorage.removeItem(e),this.callbacks.filter(r=>r.key===e).forEach(r=>r.cb(null))}onItemChange(e,r){return this.callbacks.push({key:e,cb:r}),()=>{this.callbacks=this.callbacks.filter(n=>n.cb!==r)}}}function N6(){return Gb.isAvailable()?new Gb:new Wte}async function Vte(t){return Array.isArray(t)?Promise.all(t.map(e=>Qr(e))):Qr(t)}const gU="@sequence.transportSession";class nw{constructor(e){var r=this;this.walletRequestHandler=void 0,this._sessionId=void 0,this._registered=void 0,this._init=void 0,this._initNonce=void 0,this._initCallback=void 0,this.appOrigin=void 0,this.sendAsync=async function(n,i,s){throw new Error("abstract method")},this.handleMessage=async function(n){const i=n;if(r._init!==un.OK){if(i.type===ar.INIT)if(r.isValidInitAck(n))r._initCallback&&r._initCallback();else{r._initCallback&&r._initCallback("invalid init");return}return}switch(i.type){case ar.OPEN:{if(r._init!==un.OK)return;const s={sessionId:i.data.sessionId,intent:i.data.intent,networkId:i.data.networkId};await r.open(s);return}case ar.CLOSE:return r._init!==un.OK,void 0;case ar.MESSAGE:{const s=await r.walletRequestHandler.sendMessageRequest(i);r.sendMessage(s),s.data.error;return}default:mt.error(`unexpected payload type ${i.type}`)}},this.sendMessageRequest=async function(n){return r.walletRequestHandler.sendMessageRequest(n)},this.open=async function({sessionId:n,intent:i,networkId:s}){n&&(r._sessionId=OX(n),r.saveTransportSession({sessionId:n,intent:i,networkId:s})),r.walletRequestHandler.setOpenIntent(i),await r.init();let o;try{if(s){const a=CO(s);if(a)o=a.chainId;else throw new Error(`unknown network ${s}`)}else o=r.walletRequestHandler.defaultChainId()}catch(a){console.error(a)}if(i&&i.type==="connect"&&i.options){const a=i.options,c=a;if(r.appOrigin&&c!=null&&c.origin){if(!$6()&&c.origin!==r.appOrigin)throw new Error("origin is invalid")}else!r.appOrigin&&c!=null&&c.origin?a.origin=NX(c.origin):r.appOrigin&&(a.origin=r.appOrigin);a.app&&(a.app=$X(a.app)),a.networkId?s=a.networkId:s&&(a.networkId=s),r.walletRequestHandler.setConnectOptions(a)}else r.walletRequestHandler.setConnectOptions(void 0);if(await r.walletRequestHandler.getAccount(),await r.walletRequestHandler.isSignedIn())if(i&&i.type==="connect"){(!o||o<=0)&&console.log("Failed to set default network on open"),r.notifyOpen({sessionId:r._sessionId});try{const a=await r.walletRequestHandler.promptConnect(i.options);a.connected&&r.walletRequestHandler.notifyConnect(a)}catch(a){mt.warn("promptConnect not connected:",a)}finally{(!i.options||i.options.keepWalletOpened!==!0)&&r.notifyClose()}}else{if(!o||o<=0)return r.notifyOpen({sessionId:r._sessionId,error:`failed to open wallet on network ${s}`}),!1;r.notifyOpen({sessionId:r._sessionId,chainId:`${o}`,session:await r.walletRequestHandler.walletSession(o)})}else return r.notifyOpen({sessionId:r._sessionId}),!0;return!0},this.saveTransportSession=n=>{N6().setItem(gU,JSON.stringify(n))},this.getCachedTransportSession=async function(){const n=N6().getItem(gU);try{return n?JSON.parse(n):null}catch{return console.error(`unable to parse transport session: ${n}`),null}},this.walletRequestHandler=e,this._init=un.NIL,this.walletRequestHandler.on("connect",n=>{this.registered&&this.notifyConnect(n)}),this.walletRequestHandler.on("disconnect",(n,i)=>{this.registered&&this.notifyDisconnect(n,i)}),this.walletRequestHandler.on("accountsChanged",(n,i)=>{this.registered&&this.notifyAccountsChanged(n,i)}),this.walletRequestHandler.on("networks",n=>{this.registered&&(this.notifyNetworks(n),!n||n.length===0?this.notifyChainChanged("0x0"):this.notifyChainChanged(Uc(n.find(i=>i.isDefaultChain).chainId)))}),this.walletRequestHandler.on("chainChanged",(n,i)=>{this.notifyChainChanged(n,i)}),this.walletRequestHandler.on("walletContext",n=>{!this.registered||!n||this.notifyWalletContext(n)}),this.walletRequestHandler.on("close",n=>{this.registered&&this.notifyClose(n)})}get registered(){return this._registered}register(){throw new Error("abstract method")}unregister(){throw new Error("abstract method")}sendMessage(e){throw new Error("abstract method")}notifyOpen(e){const{chainId:r,sessionId:n,session:i,error:s}=e;this.sendMessage({idx:-1,type:ar.OPEN,data:{chainId:r,sessionId:n,session:i,error:s}})}notifyClose(e){this.sendMessage({idx:-1,type:ar.CLOSE,data:e?{error:e}:null})}notifyConnect(e){this.sendMessage({idx:-1,type:ar.CONNECT,data:e})}notifyDisconnect(e,r){this.sendMessage({idx:-1,type:ar.DISCONNECT,data:e?{error:e}:null,origin:r})}notifyAccountsChanged(e,r){this.sendMessage({idx:-1,type:ar.ACCOUNTS_CHANGED,data:e,origin:r})}notifyChainChanged(e,r){this.sendMessage({idx:-1,type:ar.CHAIN_CHANGED,data:e,origin:r})}notifyNetworks(e){this.sendMessage({idx:-1,type:ar.NETWORKS,data:e})}notifyWalletContext(e){this.sendMessage({idx:-1,type:ar.WALLET_CONTEXT,data:e})}isValidInitAck(e){if(this._init===un.OK)return mt.warn("isValidInitAck, already in init'd state, so inquiry is invalid."),!1;if(e.type!==ar.INIT)return mt.warn("isValidInitAck, invalid message type, expecting init"),!1;const{sessionId:r,nonce:n}=e.data;return!r||r.length===0||!n||n.length===0?(mt.error("invalid init ack"),!1):r!==this._sessionId||n!==this._initNonce?(mt.error("invalid init ack match"),!1):!0}init(){return new Promise((e,r)=>{if(this._init===un.OK){e();return}if(this._init!==un.NIL||this._initCallback){r("transport init is in progress");return}const n=setTimeout(()=>{mt.warn("transport init timed out"),this._initCallback&&this._initCallback("transport init timed out")},YO/2);this._initCallback=i=>{this._initCallback=void 0,clearTimeout(n),i?r(i):(this._init=un.OK,e())},this._initNonce=`${performance.now()}`,this.sendMessage({idx:-1,type:ar.INIT,data:{nonce:this._initNonce}}),this._init=un.SENT_NONCE})}}class P4e{constructor(){this.app=void 0,this.wallet=void 0;const e=new RI,r=new RI;e.conn=r,r.conn=e,this.app=e,this.wallet=r}}class RI{constructor(){this.conn=void 0,this.events=new S8.EventEmitter2,this.handleMessage=e=>{throw new Error("ProxyMessageChannelPort is not registered")},this.sendMessage=e=>{this.conn.handleMessage(e),e.type==="open"&&this.events.emit("open",e),e.type==="close"&&this.events.emit("close",e),e.type==="connect"&&this.events.emit("connect",e),e.type==="disconnect"&&this.events.emit("disconnect",e)}}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}}class Gte extends rw{constructor(e){if(super(),this.port=void 0,this.register=()=>{this.port.handleMessage=r=>{this.handleMessage(r)},this.on("open",(...r)=>{this.port.events.emit("open",...r)}),this.on("close",(...r)=>{this.port.events.emit("close",...r)}),this.on("connect",(...r)=>{this.port.events.emit("connect",...r)}),this.on("disconnect",(...r)=>{this.port.events.emit("disconnect",...r)}),this._registered=!0},this.unregister=()=>{this._registered=!1,this.closeWallet(),this.events.removeAllListeners(),this.port.handleMessage=void 0},this.openWallet=(r,n,i)=>{if(this.state===Na.CLOSED){this.state=Na.OPENING;const s=`${performance.now()}`;this._sessionId=s,this.sendMessage({idx:-1,type:ar.OPEN,data:{path:r,intent:n,networkId:i,sessionId:s}})}},this.state=Na.CLOSED,this.port=e,!e)throw new Error("port argument cannot be empty");this._init=un.OK}closeWallet(){this.sendMessage({idx:-1,type:ar.CLOSE,data:null}),this.close()}sendMessage(e){if(!e.idx)throw new Error("message idx is empty");this.port.sendMessage(e)}}class R4e extends nw{constructor(e,r){super(e),this.port=void 0,this.port=r,this._init=un.OK}register(){this.port.handleMessage=e=>{this.handleMessage(e)},this._registered=!0}async restoreSession(){const e=await this.getCachedTransportSession();e&&this.open(e)}unregister(){this.port.handleMessage=void 0,this._registered=!1}sendMessage(e){this.port.sendMessage(e)}}function Kte(t){var e;if((e=window.ue)!=null&&e.sequencewallettransport&&!window.logsOverriddenForUnreal){var r;const n=(r=window.ue)==null?void 0:r.sequencewallettransport;console.log=(...i)=>{n.logfromjs(`${t}: ${QA(i)}`)},console.warn=(...i)=>{n.warnfromjs(`${t}: ${QA(i)}`)},console.error=(...i)=>{n.errorfromjs(`${t}: ${QA(i)}`)},window.logsOverriddenForUnreal=!0}}function QA(t){return t.map(e=>typeof e=="object"?e instanceof Error?e.message:JSON.stringify(e):String(e)).join(" ")}let cp;class Jte extends rw{constructor(e){super(),this.walletURL=void 0,this.register=()=>{var r;Kte("dapp"),cp&&(cp.unregister(),cp=this),(r=window.ue)!=null&&r.sequencewallettransport&&(window.ue.sequencewallettransport.onmessagefromwallet=this.onUnrealCallback),cp=this,this._registered=!0,console.log("registering transport!")},this.unregister=()=>{var r;this._registered=!1,this.closeWallet(),cp===this&&(cp=void 0),((r=window.ue)==null||(r=r.sequencewallettransport)==null?void 0:r.onmessagefromwallet)===this.onUnrealCallback&&delete window.ue.sequencewallettransport.onmessagefromwallet,this.events.removeAllListeners()},this.openWallet=(r,n,i)=>{if(this.isOpened()){console.log("wallet already open!");return}console.log("opening wallet!");const s=new URL(this.walletURL.href),o=new tw;r&&(s.pathname=r.toLowerCase()),this._init=un.NIL,this._sessionId=`${performance.now()}`,o.set("sid",this._sessionId),n&&o.set("intent",yO(n)),i&&o.set("net",`${i}`),s.search=o.toString(),console.log("opening wallet to",s.href),window.open(s.href)},this.onUnrealCallback=r=>{if(!r)throw new Error("ProviderMessage object is empty");this.handleMessage(r)},this.walletURL=new URL(e)}closeWallet(){this.close()}sendMessage(e){var r;const n=typeof e!="string"?JSON.stringify(e):e;console.log("Sending message to wallet:",n),(r=window.ue)==null||(r=r.sequencewallettransport)==null||r.sendmessagetowallet(n)}}class T4e extends nw{constructor(e){super(e),this.onMessageFromUnreal=r=>{mt.debug("RECEIVED MESSAGE",r),this.handleMessage(r)},this.getUnrealTransportSession=r=>{const n=new tw(r);return{sessionId:n.get("sid"),networkId:n.get("net"),intent:bO(n.get("intent"))}},this._init=un.NIL}async register(e){var r;if(((r=window.ue)==null?void 0:r.sequencewallettransport)===void 0)return;Kte("wallet");const{search:n}=new URL(e||window.location.href);let i=this.getUnrealTransportSession(n);if(!!i.sessionId||(i=await this.getCachedTransportSession()),!i){mt.error("unreal session is undefined");return}window.ue.sequencewallettransport.onmessagefromsequencejs=this.onMessageFromUnreal,this._registered=!0,this.open(i).then(o=>{if(!o){var a;const c=`failed to open to network ${(a=i)==null?void 0:a.networkId}`;mt.error(c),this.notifyClose({message:c}),window.close()}}).catch(o=>{var a;const c=`failed to open to network ${(a=i)==null?void 0:a.networkId}, due to: ${o}`;mt.error(c),this.notifyClose({message:c}),window.close()})}unregister(){var e;((e=window.ue)==null||(e=e.sequencewallettransport)==null?void 0:e.onmessagefromsequencejs)===this.onMessageFromUnreal&&delete window.ue.sequencewallettransport.onmessagefromsequencejs,this._registered=!1}sendMessage(e){var r;if(e.type!==ar.INIT&&this._init!==un.OK){mt.error("impossible state, should not be calling postMessage until inited");return}const n=JSON.stringify(e);(r=window.ue)==null||(r=r.sequencewallettransport)==null||r.sendmessagetosequencejs(n)}}const ZO="sequence-extension-message-handler";class O4e extends nw{constructor(e,r){super(e),this.runtime=r,this.port=void 0,this._init=un.OK}register(){this._registered=!0,this.port=this.runtime.connect({name:ZO})}sendMessage(e){mt.info("[ExtensionMessageHandler send]",e),this.port.postMessage(e)}}class Qte extends rw{constructor(e){super(),this.register=()=>{this._registered=!0},e.onConnect.addListener(r=>{r.name===ZO&&(this._init=un.OK,r.onMessage.addListener(n=>{this.handleMessage(n)}))})}sendMessage(e){}unregister(){}openWallet(e,r,n){}closeWallet(){}}class $4e extends S8.EventEmitter2{constructor(e){var r;super(),r=this,this.stream=e,this.responseCallbacks=new Map,this._messageIdx=0,this.nextMessageIdx=()=>++this._messageIdx,this.handleMessage=n=>{if(!n.type||!n.data)return;mt.info("[received message]",n);const i=n.idx,s=this.responseCallbacks.get(i);switch(i&&this.responseCallbacks.delete(i),n.type){case ar.MESSAGE:if(s)this.emit(ar.MESSAGE,n),s(n.data.error,n);else throw new Error("impossible state");break;case ar.DISCONNECT:case ar.ACCOUNTS_CHANGED:case ar.CHAIN_CHANGED:this.emit(n.type,n.data);break;default:console.error("unknown message type",n);break}},this.sendMessageRequest=async function(n){return new Promise((i,s)=>{(!n.idx||n.idx<=0)&&s(new Error("message idx not set"));const o=(c,l)=>{if(c)s(c);else if(l)i(l);else throw new Error("no valid response to return")},{idx:a}=n;r.responseCallbacks.get(a)?s(new Error("duplicate message idx, should never happen")):r.responseCallbacks.set(a,o),r.sendMessage(n)})},this.stream.on("data",this.handleMessage)}sendMessage(e){this.stream.writable||console.error("window post message stream is not writable"),this.stream.write(e)}}let lp;class Yte extends rw{constructor(e){super(),this.walletURL=void 0,this.walletWindow=void 0,this.register=()=>{lp&&(lp.unregister(),lp=this),window.addEventListener("message",this.onWindowEvent),lp=this,this.on("open",()=>{const r=this.walletWindow,n=setInterval(()=>{r&&r.closed&&(clearInterval(n),this.close())},500)}),this.on("close",()=>{this.walletWindow&&(this.walletWindow.close(),this.walletWindow=null)}),this._registered=!0},this.unregister=()=>{this._registered=!1,this.closeWallet(),lp===this&&(lp=void 0),window.removeEventListener("message",this.onWindowEvent),this.events.removeAllListeners()},this.openWallet=(r,n,i)=>{if(this.walletWindow&&this.isOpened()){this.walletWindow.focus();return}const s=new URL(this.walletURL.href),o=new tw;r&&r!==""&&(s.pathname=r.toLowerCase()),this._init=un.NIL,this._sessionId=`${performance.now()}`,o.set("sid",this._sessionId),n&&(n.type==="connect"&&(n.options||(n.options={app:window.location.origin}),!$6()&&!Hte()&&n.options&&(n.options.origin=window.location.origin)),o.set("intent",yO(n))),i&&o.set("net",`${i}`);let a,c;$6()?(a=[450,750],c=[Math.abs(window.screen.width/2-a[0]/2),Math.abs(window.screen.height/2-a[1]/2)]):(a=[450,750],c=[Math.abs(window.screenX+window.innerWidth/2-a[0]/2),Math.abs(window.screenY+window.innerHeight/2-a[1]/2)]);const l=`toolbar=0,location=0,menubar=0,scrollbars=yes,status=yes,width=${a[0]},height=${a[1]},left=${c[0]},top=${c[1]}`;s.search=o.toString(),this.walletWindow=window.open(s.href,"sequence.app",l)},this.onWindowEvent=r=>{if(r.origin!==this.walletURL.origin)return;let n;try{n=JSON.parse(r.data)}catch{return}if(!n)throw new Error("ProviderMessage object is empty");this.handleMessage(n)},this.walletURL=new URL(e)}closeWallet(){var e;this.close(),(e=this.walletWindow)==null||e.close()}sendMessage(e){if(!this.walletWindow){mt.warn("WindowMessageProvider: sendMessage failed as walletWindow is unavailable");return}const r=typeof e!="string"?JSON.stringify(e):e;this.walletWindow.postMessage(r,this.walletURL.origin)}}class N4e extends nw{constructor(e){var r;super(e),r=this,this.parentWindow=void 0,this._isPopup=!1,this.onWindowEvent=async function(n){if(!n.origin||n.origin===""||r.appOrigin&&n.origin!==r.appOrigin)return;let i;try{i=JSON.parse(n.data)}catch{return}if(mt.debug("RECEIVED MESSAGE",i),r._init!==un.OK&&r.isValidInitAck(i)&&(r.appOrigin=n.origin),r._init===un.OK&&(!r.appOrigin||r.appOrigin.length<8)){mt.error("impossible state, init.OK and appOrigin required");return}r.handleMessage(i)},this.getWindowTransportSession=n=>{const i=new tw(n);return{sessionId:i.get("sid"),networkId:i.get("net"),intent:bO(i.get("intent"))}},this._init=un.NIL}async register(e){const r=parent.window.opener!==null;if(this._isPopup=r,r!==!0)return;const{pathname:n,search:i}=new URL(e||window.location.href);let s=this.getWindowTransportSession(i);if(!!s.sessionId||(s=await this.getCachedTransportSession()),!s){mt.error("window session is undefined");return}this.parentWindow=parent.window.opener,window.addEventListener("message",this.onWindowEvent,!1),this._registered=!0,this.open(s).then(a=>{if(!a){var c;const l=`failed to open to network ${(c=s)==null?void 0:c.networkId}`;mt.error(l),this.notifyClose({message:l}),window.close()}}).catch(a=>{var c;const l=`failed to open to network ${(c=s)==null?void 0:c.networkId}, due to: ${a}`;mt.error(l),this.notifyClose({message:l}),window.close()})}unregister(){window.removeEventListener("message",this.onWindowEvent),this._registered=!1}sendMessage(e){const r=JSON.stringify(e);e.type===ar.INIT?this.postMessage(r,!0):this.postMessage(r)}get isPopup(){return this._isPopup}postMessage(e,r=!1){if(r!==!0&&this._init!==un.OK){mt.error("impossible state, should not be calling postMessage until inited");return}r?this.parentWindow.postMessage(e,"*"):this.appOrigin&&this.appOrigin.length>4?this.parentWindow.postMessage(e,this.appOrigin):mt.error("unable to postMessage as parentOrigin is invalid")}}function Zte(t){return t&&typeof t=="object"&&(t.windowTransport&&typeof t.windowTransport=="object"||t.proxyTransport&&typeof t.proxyTransport=="object"||t.extensionTransport&&typeof t.extensionTransport=="object"||t.unrealTransport&&typeof t.unrealTransport=="object")&&(t.windowTransport&&t.windowTransport.enabled||t.proxyTransport&&t.proxyTransport.enabled||t.extensionTransport&&t.extensionTransport.enabled||t.unrealTransport&&t.unrealTransport.enabled)}class k8{constructor(...e){var r=this;this.messageProviders=void 0,this.provider=void 0,this.register=()=>{if(this.messageProviders.length===1){this.provider=this.messageProviders[0],this.provider.register();return}this.messageProviders.forEach(n=>{n.register(),n.once("open",()=>{this.provider||(this.provider=n,this.messageProviders.forEach(i=>{this.provider!==i&&i.unregister()}))})})},this.unregister=()=>{this.messageProviders.forEach(n=>n.unregister()),this.provider=void 0},this.openWallet=(n,i,s)=>{if(this.provider){this.provider.openWallet(n,i,s);return}this.messageProviders.forEach(o=>o.openWallet(n,i,s))},this.sendAsync=async function(n,i,s){if(r.provider){r.provider.sendAsync(n,i,s);return}throw new Error("impossible state, wallet must be opened first")},this.sendMessageRequest=async function(n){if(r.provider)return r.provider.sendMessageRequest(n);throw new Error("impossible state, wallet must be opened first")},this.waitUntilOpened=async function(){return r.provider?r.provider.waitUntilOpened():Promise.race(r.messageProviders.map(n=>n.waitUntilOpened()))},this.waitUntilConnected=async function(){if(r.provider)return r.provider.waitUntilConnected();throw new Error("impossible state, wallet must be opened first")},this.messageProviders=e,this.provider=void 0}static new(e){var r,n,i,s;const o=new k8;if((r=e.windowTransport)!=null&&r.enabled&&typeof window=="object"&&e.walletAppURL){const a=new Yte(e.walletAppURL);o.add(a)}if((n=e.proxyTransport)!=null&&n.enabled){const a=new Gte(e.proxyTransport.appPort);o.add(a)}if((i=e.extensionTransport)!=null&&i.enabled){const a=new Qte(e.extensionTransport.runtime);o.add(a)}if((s=e.unrealTransport)!=null&&s.enabled&&e.windowTransport&&e.walletAppURL){const a=new Jte(e.walletAppURL);o.add(a)}return o.register(),o}add(...e){this.messageProviders.push(...e)}closeWallet(){this.provider&&this.provider.closeWallet()}isOpened(){return this.provider?this.provider.isOpened():!1}isConnected(){return this.provider?this.provider.isConnected():!1}on(e,r){if(this.provider){this.provider.on(e,r);return}this.messageProviders.forEach(n=>{n.on(e,r)})}once(e,r){if(this.provider){this.provider.once(e,r);return}this.messageProviders.forEach(n=>{n.once(e,r)})}emit(e,...r){if(this.provider)return this.provider.emit(e,...r);for(let n=0;nL4e(t,i))}function L4e(t,e){if(e.to.toLowerCase()===t.toLowerCase()&&e.data){const r=Ae(e.data);if(r.length>=4&&!B4e(r))throw new Error("self calls are forbidden")}if(e.delegateCall)throw new Error("delegate calls are forbidden")}function B4e(t){const e=new fi(ji.mainModule.abi);try{return e.decodeFunctionData("createContract",t),!0}catch{return!1}}const F4e=1e4;class j4e{constructor(e,r,n){var i=this;this.account=void 0,this.signerReadyCallbacks=[],this.prompter=void 0,this.networks=void 0,this._openIntent=void 0,this._connectOptions=void 0,this.events=new S8.EventEmitter2,this.onConnectOptionsChange=void 0,this.promptConnect=async function(s){if(!s&&!i._connectOptions)throw new Error("prompter connect options are empty");if(!i.prompter)return i.connect(s);const o=await i.prompter.promptConnect(s||i._connectOptions).catch(c=>({connected:!1})),a=o;return a.connected&&!a.session&&(a.session=await i.walletSession(s==null?void 0:s.networkId)),o},this.sendAsync=async function(s,o,a){const c={jsonrpc:"2.0",id:s.id,result:null};await i.getAccount();try{var l;if((!i.account||i.account===null)&&!U4e.includes(s.method))throw Bte;const f=i.account;if(!f)throw new Error("WalletRequestHandler: wallet account is not configured");const d=(l=i.account)==null?void 0:l.providerFor(a??i.defaultChainId());if(!d)throw new Error(`WalletRequestHandler: wallet provider is not configured for chainId ${a}`);const p=d instanceof rf?d:void 0;switch(s.method){case"net_version":{if(!p)throw new Error("Account provider doesn't support send method");const g=await p.send("net_version",[]);c.result=g;break}case"eth_chainId":{if(!p)throw new Error("Account provider doesn't support send method");const g=await p.send("eth_chainId",[]);c.result=g;break}case"eth_accounts":{const g=f.address;c.result=[g];break}case"eth_getBalance":{const[g,v]=s.params,y=await d.getBalance(g,v);c.result=y.toHexString();break}case"sequence_sign":case"personal_sign":case"eth_sign":{let g;switch(s.method){case"sequence_sign":case"personal_sign":{const[w,E]=s.params;g=w;break}case"eth_sign":{const[w,E]=s.params;g=E;break}}let v="";const y=A8(g),b=s.method==="sequence_sign";if(i.prompter===null?v=await f.signMessage(y,a??i.defaultChainId(),b?"eip6492":"ignore"):v=await i.prompter.promptSignMessage({chainId:a,message:y,eip6492:b},i.connectOptions),v&&v.length>0)c.result=v;else throw new Error("declined by user");break}case"sequence_signTypedData_v4":case"eth_signTypedData":case"eth_signTypedData_v4":{const[g,v]=s.params;let y;if(typeof v=="string")try{y=JSON.parse(v)}catch(E){console.warn("walletRequestHandler: error parsing typedData",E)}else y=v;if(!y||!y.domain||!y.types||!y.message)throw new Error("invalid typedData object");let b="";const w=s.method==="sequence_signTypedData_v4";if(i.prompter===null?b=await f.signTypedData(y.domain,y.types,y.message,a??i.defaultChainId(),w?"eip6492":"ignore"):b=await i.prompter.promptSignMessage({chainId:a,typedData:y,eip6492:w},i.connectOptions),b&&b.length>0)c.result=b;else throw new Error("declined by user");break}case"eth_sendTransaction":{const g=D4e(s.params[0]).map(y=>("gas"in y&&y.gasLimit===void 0&&(y.gasLimit=y.gas,delete y.gas),y));mU(f.address,g);let v="";if(i.prompter===null){var u;const y=await f.sendTransaction(g,a??i.defaultChainId());v=(u=y==null?void 0:y.hash)!=null?u:""}else v=await i.prompter.promptSendTransaction(g,a,i.connectOptions);if(v)c.result=v;else throw new Error("declined by user");break}case"eth_signTransaction":{const[g]=s.params;if(qt(g.from)!==f.address)throw new Error("sender address does not match wallet");mU(f.address,g),i.prompter===null?c.result=await f.signTransactions(g,a??i.defaultChainId()):c.result=await i.prompter.promptSignTransaction(g,a,i.connectOptions);break}case"eth_sendRawTransaction":{if(nt.transaction.isSignedTransactionBundle(s.params[0])){const g=we.from(s.params[0].chainId).toNumber(),v=await f.relayer(g).relay(s.params[0]);c.result=v.hash}else{const g=await d.sendTransaction(s.params[0]);c.result=g.hash}break}case"eth_getTransactionCount":{const g=qt(s.params[0]),v=s.params[1],y=await d.getTransactionCount(g,v);c.result=we.from(y).toHexString();break}case"eth_blockNumber":{c.result=await d.getBlockNumber();break}case"eth_getBlockByNumber":{c.result=await d.getBlock(s.params[0]);break}case"eth_getBlockByHash":{c.result=await d.getBlock(s.params[0]);break}case"eth_getTransactionByHash":{c.result=await d.getTransaction(s.params[0]);break}case"eth_call":{const[g,v]=s.params;c.result=await d.call(g,v);break}case"eth_getCode":{const[g,v]=s.params;c.result=await d.getCode(g,v);break}case"eth_estimateGas":{const[g]=s.params;c.result=await d.estimateGas(g);break}case"eth_gasPrice":{const g=await d.getGasPrice();c.result=g.toHexString();break}case"wallet_switchEthereumChain":{const[g]=s.params;if(!g.chainId||g.chainId.length===0)throw new Error("invalid chainId");const v=we.from(g.chainId);i.setDefaultChainId(v.toNumber()),c.result=null;break}case"sequence_getWalletContext":{c.result=f.contexts;break}case"sequence_getWalletConfig":{const[g]=s.params;g?c.result=[(await f.status(g)).onChain.config]:c.result=await Promise.all(f.networks.map(async function(v){return(await f.status(v.chainId)).onChain.config}));break}case"sequence_getWalletState":{const[g]=s.params;g?c.result=[vU(g,await f.status(g))]:c.result=await Promise.all(f.networks.map(async function(v){const y=await f.status(v.chainId);return vU(v.chainId,y)}));break}case"sequence_getNetworks":{c.result=await i.getNetworks(!0);break}case"sequence_isSequence":{c.result=!0;break}case"sequence_updateConfig":throw new Error("sequence_updateConfig method is not allowed from a dapp");case"sequence_publishConfig":throw new Error("sequence_publishConfig method is not allowed from a dapp");case"sequence_gasRefundOptions":break;case"sequence_getNonce":break;case"sequence_relay":break;case"sequence_setDefaultNetwork":{const[g]=s.params;if(!g)throw new Error("invalid request, method argument defaultChainId cannot be empty");i.setDefaultChainId(g),c.result=await i.getNetworks(!0);break}default:{if(!p)throw new Error("Account provider doesn't support send method");const g=await p.send(s.method,s.params);c.result=g}}}catch(f){mt.error(f),c.result=null,c.error=Eo({},new Error(f),{code:4001})}o(void 0,c)},this.isSignedIn=async function(){return await i.signerReady(),!!i.account},this.getAccount=async function(){if(await i.signerReady(),i.account===void 0)throw new Error("signerReady failed resolve");return i.account},this.account=e,this.prompter=r,this.networks=n}defaultChainId(){var e,r;return(e=(r=this.prompter)==null?void 0:r.getDefaultChainId())!=null?e:this.networks[0].chainId}async signIn(e,r={}){this.setAccount(e);const{connect:n,defaultNetworkId:i}=r;if(n){const a=this._connectOptions;let c;if(this.prompter!==null){var s;c=await((s=this.prompter)==null?void 0:s.promptSignInConnect(a))}else c=await this.connect(a);this.notifyConnect(c),(!a||a.keepWalletOpened!==!0)&&this.notifyClose()}if(i&&this.defaultChainId()!==i){var o;await((o=this.prompter)==null?void 0:o.promptChangeNetwork(i))}}signOut(){this.account&&this.notifyDisconnect(),this.setAccount(null)}signerReset(){this.account=void 0}signerReady(e=F4e){return new Promise((r,n)=>{this.account!==void 0?r():(setTimeout(()=>{this.account===void 0&&(this.signerReadyCallbacks=[],n("signerReady timed out"))},e),this.signerReadyCallbacks.push(r))})}async connect(e){var r,n;if(!this.account)return{connected:!1,chainId:"0x0",error:"unable to connect without signed in account"};const i=(r=(n=e==null?void 0:e.networkId)!=null?n:this.defaultChainId())!=null?r:$e.MAINNET,s=CO(i).chainId,o={connected:!0,chainId:Uc(s)};if(e&&e.authorize){const a={app:e.app,origin:e.origin,expiry:e.expiry,nonce:e.authorizeNonce};try{o.proof=await ete(this.account,s,a)}catch(c){return mt.warn(`connect, signAuthorization failed for options: ${JSON.stringify(e)}, due to: ${c.message}`),{connected:!1,chainId:"0x0",error:`signAuthorization failed: ${c.message}`}}}return o.session=this.walletSession(s),o}sendMessageRequest(e){return new Promise(r=>{this.sendAsync(e.data,(n,i)=>{const s=Eo({},e,{data:i});r(s)},e.chainId)})}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}async getAddress(){var e,r;return(e=(r=this.account)==null?void 0:r.address)!=null?e:""}get openIntent(){return this._openIntent}setOpenIntent(e){this._openIntent=e}get connectOptions(){return this._connectOptions}setConnectOptions(e){var r;this._connectOptions=e,(r=this.onConnectOptionsChange)==null||r.call(this,e)}async setDefaultChainId(e){var r;return await((r=this.prompter)==null?void 0:r.promptChangeNetwork(e)),this.defaultChainId()}async getNetworks(e){return this.account?e?this.account.networks.map(r=>{const n=Eo({},r);return n.provider=void 0,n.relayer=void 0,n}):this.account.networks:(mt.warn("signer not set: getNetworks is returning an empty list"),[])}walletSession(e){if(!this.account)return;const r={walletContext:this.account.contexts,accountAddress:this.account.address,networks:this.account.networks.map(i=>Eo({},i,{provider:void 0,relayer:void 0}))};if(e){const i=zc(r.networks,e);if(i){var n;(n=r.networks)==null||n.forEach(s=>delete s.isDefaultChain),i.isDefaultChain=!0}}return r}notifyConnect(e,r){var n;if(console.log("emit connect",e),this.events.emit("connect",e),(n=e.session)!=null&&n.accountAddress){var i;this.events.emit("accountsChanged",[(i=e.session)==null?void 0:i.accountAddress],r)}}notifyDisconnect(e){this.events.emit("accountsChanged",[],e),this.events.emit("disconnect",void 0,e)}notifyChainChanged(e,r){this.events.emit("chainChanged",Uc(e),r)}async notifyNetworks(e){const r=e||await this.getNetworks(!0);if(this.events.emit("networks",r),r.length>0){const n=r.find(i=>i.chainId===this.defaultChainId());n&&this.events.emit("chainChanged",Uc(n.chainId))}else this.events.emit("chainChanged","0x0")}async notifyWalletContext(){if(!this.account){mt.warn("signer not set: skipping to notify wallet context");return}const e=this.account.contexts;this.events.emit("walletContext",e)}notifyClose(e){this.events.emit("close",e)}setAccount(e){if(this.account=e,e!==void 0){for(let r=0;rc.canOnchainValidate||c.original.version===2&&n,o=await r.status(i);if(s(o))return!0;if(await e.promptConfirmWalletDeploy(i,this.connectOptions)){const c=await r.status(i);return s(c)?!0:(mt.error("WalletRequestHandler: result for promptConfirmWalletDeploy is not correct"),!1)}return!1}}function vU(t,e){return{context:e.original.context,config:e.onChain.config,address:nt.context.addressOf(e.original.context,e.original.imageHash),chainId:t,deployed:e.onChain.deployed,imageHash:e.imageHash,lastImageHash:e.onChain.imageHash,published:!0,status:e}}const U4e=["net_version","eth_chainId","eth_getBalance","eth_getTransactionCount","eth_blockNumber","eth_getBlockByNumber","eth_getBlockByHash","eth_getTransactionByHash","eth_getCode","eth_estimateGas","eth_gasPrice","sequence_getWalletContext","sequence_getNetworks","sequence_setDefaultNetwork"];class Tm{get utils(){return this.provider.utils}constructor(e,r){this.client=e,this.provider=r,this.singleNetworkSigners={},this._isSigner=!0,this._isSequenceSigner=!0}async getAddress(){return this.client.getAddress()}connect(e){if(!Om.is(e))throw new Error("SequenceSigner can only be connected to a SequenceProvider");return new Tm(this.client,e)}getSigner(e){if(!e)return this;const r=this.provider.toChainId(e);return this.singleNetworkSigners[r]||(this.singleNetworkSigners[r]=new XO(this.client,this.provider,r)),this.singleNetworkSigners[r]}useChainId(e){return this.provider.toChainId(e)||this.client.getChainId()}async signMessage(e,r){const{eip6492:n=!0}=r||{},i=this.useChainId(r==null?void 0:r.chainId);return this.client.signMessage(e,{eip6492:n,chainId:i})}async signTypedData(e,r,n,i){const{eip6492:s=!0}=i||{},o=this.useChainId(i==null?void 0:i.chainId);return this.client.signTypedData({domain:e,types:r,message:n},{eip6492:s,chainId:o})}getProvider(e){return this.provider.getProvider(e)}async sendTransaction(e,r){const n=this.useChainId(r==null?void 0:r.chainId),i=await Vte(e),s=await this.client.sendTransaction(i,{chainId:n}),o=this.getProvider(n);try{return await vd(async function(){const a=await o.getTransaction(s);return a?o._wrapTransaction(a,s):void 0},{onceBlock:o})}catch(a){throw a.transactionHash=s,a}}async getWalletConfig(e){const r=this.useChainId(e);return this.client.getOnchainWalletConfig({chainId:r})}getNetworks(){return this.client.getNetworks()}async getBalance(e,r){return this.getProvider(r==null?void 0:r.chainId).getBalance(this.getAddress(),e)}async estimateGas(e,r){return this.getProvider(r==null?void 0:r.chainId).estimateGas(e)}async call(e,r,n){return this.getProvider(n==null?void 0:n.chainId).call(e,r)}getChainId(){return Promise.resolve(this.client.getChainId())}async getGasPrice(e){return this.getProvider(e==null?void 0:e.chainId).getGasPrice()}async getFeeData(e){return this.getProvider(e==null?void 0:e.chainId).getFeeData()}async resolveName(e){const r=await this.provider.resolveName(e);if(r===null)throw new Error(`ENS name not found: ${e}`);return r}_checkProvider(e){}populateTransaction(e){throw new Error("SequenceSigner does not support populateTransaction")}checkTransaction(e){throw new Error("SequenceSigner does not support checkTransaction")}getTransactionCount(e){throw new Error("SequenceSigner does not support getTransactionCount")}signTransaction(e){throw new Error("SequenceWallet does not support signTransaction, use sendTransaction instead.")}static is(e){return e&&typeof e=="object"&&e._isSequenceSigner===!0}}class XO extends Tm{constructor(e,r,n){super(e,r.getProvider(n)),this.chainId=n,this._isSingleNetworkSequenceSigner=!0}_useChainId(e){const r=this.provider.toChainId(e);if(r&&r!==this.chainId)throw new Error(`This signer only supports the network ${this.chainId}, but ${r} was requested.`);return r||this.provider.toChainId(this.chainId)}useChainId(e){return this._useChainId(e)}getChainId(){return Promise.resolve(this.provider.toChainId(this.chainId))}getProvider(e){return super.getProvider(this._useChainId(e))}getSigner(e){if(this._useChainId(e)!==this.chainId)throw new Error("Unreachable code");return this}static is(e){return e&&typeof e=="object"&&e._isSingleNetworkSequenceSigner===!0}}class z4e{constructor(e){if(this.signer=e,XO.is(e))throw new Error("WalletUtils does not support SingleNetworkSequenceSigner")}signMessage(e,r,n){return this.signer.signMessage(e,{chainId:r,eip6492:n})}signTypedData(e,r,n,i,s){return this.signer.signTypedData(e,r,n,{chainId:i,eip6492:s})}async isValidSignature(e,r,n,i){return Yg(e,r,n,this.signer.getProvider(i))}async isValidMessageSignature(e,r,n,i){const s=this.signer.getProvider(i),o=A8(r),a=wO(o);return Yg(e,a,n,s)}isValidTypedDataSignature(e,r,n,i){return this.isValidSignature(e,Q2(r),n,i)}}class Om extends g8{constructor(e,r,n=Kg){super(e.getChainId()),this.client=e,this.providerFor=r,this.networks=n,this.singleNetworkProviders={},this._isSequenceProvider=!0,this.utils=void 0,this.signer=void 0,e.onConnect(i=>{this.emit("connect",i)}),e.onDisconnect(i=>{this.emit("disconnect",i)}),e.onDefaultChainIdChanged(i=>{this.emit("chainChanged",i)}),e.onAccountsChanged(i=>{this.emit("accountsChanged",i)}),this.signer=new Tm(this.client,this),this.utils=new z4e(this.signer)}getSigner(e){return this.signer.getSigner(e)}connect(e){return this.client.connect(e)}disconnect(){return this.client.disconnect()}isConnected(){return this.client.isConnected()}getSession(){return this.client.getSession()}listAccounts(){return[this.client.getAddress()]}getAddress(){return this.client.getAddress()}getNetworks(){return this.client.getNetworks()}getChainId(){return this.client.getChainId()}setDefaultChainId(e){return this.client.setDefaultChainId(this.toChainId(e))}isOpened(){return this.client.isOpened()}closeWallet(){return this.client.closeWallet()}getWalletContext(){return this.client.getWalletContext()}async getWalletConfig(e){const r=await this.useChainId(e);return this.client.getOnchainWalletConfig({chainId:r})}authorize(e){return this.client.connect(Eo({},e,{authorize:!0}))}async openWallet(e,r){return await this.client.openWallet(e,r),!0}toChainId(e){if(e===void 0)return;const r=zc(this.networks,e);if(!r)throw new Error(`Unsupported network ${e}`);return r.chainId}async useChainId(e){return this.toChainId(e)||this.client.getChainId()}getProvider(e){if(!e)return this;const r=this.toChainId(e);return this.singleNetworkProviders[r]||(this.singleNetworkProviders[r]=new ere(this.client,this.providerFor,r)),this.singleNetworkProviders[r]}async _getSubprovider(e){const r=await this.useChainId(e),n=this.providerFor(r);if(!n)throw new Error(`Unsupported network ${r}`);return n}async perform(e,r){var n;if(e==="eth_chainId")return Uc(await this.useChainId());if(e==="eth_accounts")return[this.client.getAddress()];if(e==="wallet_switchEthereumChain"){const o=r[0],a=Xte(o);return this.setDefaultChainId(a)}if(e==="eth_sendTransaction"||e==="eth_sign"||e==="eth_signTypedData"||e==="eth_signTypedData_v4"||e==="personal_sign"||e==="sequence_sign"||e==="sequence_signTypedData_v4")return this.client.send({method:e,params:r},this.getChainId());const i=await this._getSubprovider(),s=(n=i.prepareRequest(e,r))!=null?n:[e,r];return i.send(s[0],s[1])}send(e,r){return this.perform(e,r)}request(e){return this.perform(e.method,e.params)}async detectNetwork(){const e=this.client.getChainId(),r=zc(this.networks,e);if(!r)throw new Error(`Unknown network ${e}`);return r}async waitForTransaction(e,r,n,i){return(await this._getSubprovider(i==null?void 0:i.chainId)).waitForTransaction(e,r,n)}async getBlockNumber(e){return(await this._getSubprovider(e==null?void 0:e.chainId)).getBlockNumber()}async getGasPrice(e){return(await this._getSubprovider(e==null?void 0:e.chainId)).getGasPrice()}async getBalance(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).getBalance(e,r)}async getTransactionCount(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).getTransactionCount(e,r)}async getCode(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).getCode(e,r)}async getStorageAt(e,r,n,i){return(await this._getSubprovider(i==null?void 0:i.chainId)).getStorageAt(e,r,n)}async call(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).call(e,r)}async estimateGas(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).estimateGas(e)}async getBlock(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).getBlock(e)}async getTransaction(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).getTransaction(e)}async getLogs(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).getLogs(e)}async supportsENS(){return(await this.getNetworks()).some(r=>r.chainId===1)}async getResolver(e){return await this.supportsENS()?(await this._getSubprovider(1)).getResolver(e):null}async resolveName(e){return HY(await e)?e:await this.supportsENS()?(await this._getSubprovider(1)).resolveName(e):null}async lookupAddress(e){return await this.supportsENS()?(await this._getSubprovider(1)).lookupAddress(e):null}async getAvatar(e){return await this.supportsENS()?(await this._getSubprovider(1)).getAvatar(e):null}}Om.is=t=>t&&typeof t=="object"&&t._isSequenceProvider===!0;function Xte(t){return typeof t=="object"?Xte(t.chainId):we.from(t).toNumber()}class ere extends Om{constructor(e,r,n){super(e,r),this.chainId=n,this._isSingleNetworkSequenceProvider=!0}_useChainId(e){const r=this.toChainId(e);if(r&&r!==this.chainId)throw new Error(`This provider only supports the network ${this.chainId}, but ${r} was requested.`);return r||super.toChainId(this.chainId)}useChainId(e){return Promise.resolve(this._useChainId(e))}getChainId(){return super.toChainId(this.chainId)}async getNetwork(){const e=await this.client.getNetworks(),r=zc(e,this.chainId);if(!r)throw new Error(`Unsupported network ${this.chainId}`);return r}getProvider(e){if(this._useChainId(e)!==this.chainId)throw new Error("Unreachable code");return this}getSigner(e){return super.getSigner(this._useChainId(e))}setDefaultChainId(e){throw new Error(`This provider only supports the network ${this.chainId}; use the parent provider to switch networks.`)}static is(e){return e&&typeof e=="object"&&e._isSingleNetworkSequenceProvider===!0}}class H4e extends v4e{}const q4e=(t,e)=>{e||(e="https://nodes.sequence.app");const r=!t,n={};return t&&(n.headers={"X-Access-Key":t}),new H4e(e,n,{noop:r,defaultEnabled:!0,privacy:{userIdHash:!0,userAgentSalt:!1},initProps:()=>Uu()?{origin:window.location.origin}:{}})};var W4e={name:"@0xsequence/provider",version:"1.8.2",description:"provider sub-package for Sequence",repository:"https://github.com/0xsequence/sequence.js/tree/master/packages/provider",source:"src/index.ts",main:"dist/0xsequence-provider.cjs.js",module:"dist/0xsequence-provider.esm.js",author:"Horizon Blockchain Games",license:"Apache-2.0",scripts:{test:"pnpm test:concurrently 'pnpm test:run'","test:run":"pnpm test:file tests/**/*.spec.ts","test:file":"NODE_OPTIONS='--import tsx' mocha --timeout 30000",typecheck:"tsc --noEmit","test:concurrently":"concurrently -k --success first 'pnpm start:hardhat1' 'pnpm start:hardhat2'","start:hardhat1":"pnpm start:hardhat1:verbose > /dev/null 2>&1","start:hardhat2":"pnpm start:hardhat2:verbose > /dev/null 2>&1","start:hardhat1:verbose":"hardhat node --config hardhat1.config.js --hostname 0.0.0.0 --port 9595","start:hardhat2:verbose":"hardhat node --config hardhat2.config.js --hostname 0.0.0.0 --port 8595"},dependencies:{"@0xsequence/abi":"workspace:*","@0xsequence/account":"workspace:*","@0xsequence/auth":"workspace:*","@0xsequence/core":"workspace:*","@0xsequence/migration":"workspace:*","@0xsequence/network":"workspace:*","@0xsequence/relayer":"workspace:*","@0xsequence/utils":"workspace:*","@0xsequence/wallet":"workspace:*","@databeat/tracker":"^0.8.1",eventemitter2:"^6.4.5","webextension-polyfill":"^0.10.0"},peerDependencies:{ethers:">=5.5 < 6"},devDependencies:{"@types/webextension-polyfill":"^0.10.0",ethers:"^5.7.2",hardhat:"^2.12.2"},files:["src","dist"]};class D0{constructor(e){this.store=e}connectedSession(){const e=this.getSession();if(e&&e.accountAddress&&e.walletContext&&e.networks)return{accountAddress:e.accountAddress,walletContext:e.walletContext,networks:e.networks};throw new Error("Sequence session not connected")}hasSession(){var e;return((e=this.getSession())==null?void 0:e.accountAddress)!==void 0}setSession(e){return this.store.setItem(D0.SESSION_LOCALSTORE_KEY,JSON.stringify(e))}getSession(){const e=this.store.getItem(D0.SESSION_LOCALSTORE_KEY);if(e)return JSON.parse(e)}async clearSession(){return this.store.removeItem(D0.SESSION_LOCALSTORE_KEY)}}D0.SESSION_LOCALSTORE_KEY="@sequence.session";class L0{constructor(e,r=1){this.store=e,this.startingChainId=r,this.callbacks=[],e.onItemChange(L0.SESSION_CHAIN_ID_KEY,n=>{if(n){const i=parseInt(n);this.callbacks.forEach(s=>s(i))}})}onDefaultChainIdChanged(e){return this.callbacks.push(e),()=>{this.callbacks=this.callbacks.filter(r=>r!==e)}}setDefaultChainId(e){e!==this.getDefaultChainId()&&this.store.setItem(L0.SESSION_CHAIN_ID_KEY,e.toString())}getDefaultChainId(){const e=this.store.getItem(L0.SESSION_CHAIN_ID_KEY);return!e||e.length===0?this.startingChainId:parseInt(e)}}L0.SESSION_CHAIN_ID_KEY="@sequence.session.defaultChainId";class e${constructor(e,r,n){var i,s;if(this.session=void 0,this.defaultChainId=void 0,this.callbacks={},this.transport=void 0,this.defaultEIP6492=void 0,this.projectAccessKey=void 0,this.analytics=void 0,Zte(e))this.transport=k8.new(e);else if(Dte(e))this.transport=e;else throw new Error("Invalid transport");const o=n==null?void 0:n.defaultChainId;if(this.defaultEIP6492=(i=n==null?void 0:n.defaultEIP6492)!=null?i:!1,this.session=new D0(r),this.defaultChainId=new L0(r,o),this.transport.on("accountsChanged",l=>{var u;l.length>1&&console.warn("SequenceClient: wallet-webapp returned more than one account"),(u=this.callbacks.accountsChanged)==null||u.forEach(f=>f(l))}),this.transport.on("connect",l=>{var u;const f=Uc(this.getChainId());(u=this.callbacks.connect)==null||u.forEach(d=>d(Eo({},l,{chainId:f})))}),this.transport.on("disconnect",(l,u)=>{var f;(f=this.callbacks.disconnect)==null||f.forEach(d=>d(l,u))}),this.transport.on("networks",l=>{var u;(u=this.callbacks.networks)==null||u.forEach(f=>f(l))}),this.transport.on("walletContext",l=>{var u;(u=this.callbacks.walletContext)==null||u.forEach(f=>f(l))}),this.transport.on("open",l=>{var u;(u=this.callbacks.open)==null||u.forEach(f=>f(l))}),this.transport.on("close",()=>{var l;(l=this.callbacks.close)==null||l.forEach(u=>u())}),this.transport.on("chainChanged",(l,u)=>{var f;(f=this.callbacks.chainChanged)==null||f.forEach(d=>d(l,u))}),this.defaultChainId.onDefaultChainIdChanged(l=>{var u;const f=Uc(l);(u=this.callbacks.chainChanged)==null||u.forEach(d=>d(f))}),n!=null&&n.projectAccessKey&&(this.projectAccessKey=n.projectAccessKey),this.projectAccessKey&&n!=null&&n.analytics&&(this.analytics=q4e(this.projectAccessKey)),(s=this.session.getSession())!=null&&s.accountAddress){var a,c;(a=this.analytics)==null||a.identify((c=this.session.getSession())==null?void 0:c.accountAddress)}}registerCallback(e,r){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(r),()=>{this.callbacks[e]=this.callbacks[e].filter(n=>n!==r)}}onOpen(e){return this.registerCallback("open",e)}onClose(e){return this.registerCallback("close",e)}onConnect(e){return this.registerCallback("connect",e)}onDisconnect(e){return this.registerCallback("disconnect",e)}onNetworks(e){return this.registerCallback("networks",e)}onAccountsChanged(e){return this.registerCallback("accountsChanged",e)}onWalletContext(e){return this.registerCallback("walletContext",e)}onChainChanged(e){return this.registerCallback("chainChanged",e)}onDefaultChainIdChanged(e){return this.registerCallback("chainChanged",e)}getChainId(){return this.defaultChainId.getDefaultChainId()}setDefaultChainId(e){return this.defaultChainId.setDefaultChainId(e)}async openWallet(e,r){return this.transport.openWallet(e,r,this.getChainId()),await this.transport.waitUntilOpened(),this.isOpened()}closeWallet(){return this.transport.closeWallet()}isOpened(){return this.transport.isOpened()}isConnected(){return this.session.hasSession()}getSession(){return this.session.getSession()}getAddress(){return this.session.connectedSession().accountAddress}async connect(e){if((e==null?void 0:e.authorizeVersion)===void 0&&(e.authorizeVersion=2),(e==null?void 0:e.refresh)===!0&&this.disconnect(),e.projectAccessKey=this.projectAccessKey,e&&e.authorize){if(!e.app)throw new Error("connecting with 'authorize' option also requires 'app' to be set");e.authorizeVersion===void 0&&(e.authorizeVersion=2)}await this.openWallet(void 0,{type:"connect",options:Eo({},e,{networkId:this.getChainId(),clientVersion:W4e.version})});const r=await this.transport.waitUntilConnected().catch(s=>s instanceof Error?{connected:!1,error:s.message}:{connected:!1,error:JSON.stringify(s)});if(r.chainId&&(r.chainId=we.from(r.chainId).toString()),r.connected){var n;if(!r.session)throw new Error("impossible state, connect response is missing session");if(this.session.setSession(r.session),(n=r.session)!=null&&n.accountAddress){var i;(i=this.analytics)==null||i.identify(r.session.accountAddress)}}return r}disconnect(){var e;return this.isOpened()&&this.closeWallet(),(e=this.analytics)==null||e.reset(),this.session.clearSession()}send(e,r){return e.method=this.mapSignMethod(e.method),new Promise((n,i)=>{this.transport.sendAsync(e,(s,o)=>{s?i(s):o===void 0?i(new Error(`Got undefined response for request: ${e}`)):typeof o=="object"&&o.error?i(o.error):typeof o=="object"&&o.result?n(o.result):i(new Error(`Got invalid response for request: ${e}`))},r||this.getChainId())})}async getNetworks(e){const r=this.session.connectedSession();return e&&(r.networks=await this.send({method:"sequence_getNetworks"}),this.session.setSession(r)),r.networks}signMethod(e){return(e==null?void 0:e.eip6492)===void 0?"personal_sign":e.eip6492?"sequence_sign":"legacy_sign"}signTypedDataMethod(e){return(e==null?void 0:e.eip6492)===void 0?"eth_signTypedData_v4":e.eip6492?"sequence_signTypedData_v4":"legacy_signTypedData_v4"}mapSignMethod(e){return e==="personal_sign"?this.defaultEIP6492?"sequence_sign":"personal_sign":e==="eth_signTypedData_v4"?this.defaultEIP6492?"sequence_signTypedData_v4":"eth_signTypedData_v4":e==="legacy_sign"?"personal_sign":e==="legacy_signTypedData_v4"?"eth_signTypedData_v4":e}async signMessage(e,r){var n;const i=this.signMethod(r);return(n=this.analytics)==null||n.track({event:"SIGN_MESSAGE_REQUEST",props:{chainId:`${(r==null?void 0:r.chainId)||this.getChainId()}`}}),this.send({method:i,params:[e,this.getAddress()]},r==null?void 0:r.chainId)}async signTypedData(e,r){var n;const i=this.signTypedDataMethod(r),s=oi.getPayload(e.domain,e.types,e.message);return(n=this.analytics)==null||n.track({event:"SIGN_TYPED_DATA_REQUEST",props:{chainId:`${(r==null?void 0:r.chainId)||this.getChainId()}`}}),this.send({method:i,params:[this.getAddress(),s]},(r==null?void 0:r.chainId)||e.domain.chainId&&we.from(e.domain.chainId).toNumber()||this.getChainId())}async sendTransaction(e,r){var n;const i=Array.isArray(e)?e:[e],s=M4e(i);return(n=this.analytics)==null||n.track({event:"SEND_TRANSACTION_REQUEST",props:{chainId:`${(r==null?void 0:r.chainId)||this.getChainId()}`}}),this.send({method:"eth_sendTransaction",params:[s]},r==null?void 0:r.chainId)}async getWalletContext(){return this.send({method:"sequence_getWalletContext"})}async getOnchainWalletConfig(e){const r=await this.send({method:"sequence_getWalletConfig",params:[(e==null?void 0:e.chainId)||this.getChainId()]},e==null?void 0:e.chainId);return Array.isArray(r)?r[0]:r}}const TI={transports:{walletAppURL:"https://sequence.app",windowTransport:{enabled:!0},proxyTransport:{enabled:!1}},defaultNetwork:1,analytics:!0};let Tl;const tre=(t,e)=>{var r,n,i;if(!t||typeof t!="string")throw new Error("Please pass a projectAccessKey in initWallet.");if(Tl)return Tl;const s=Eo({},TI,e,{transports:Eo({},TI.transports,e==null?void 0:e.transports)}),o={},a=(r=(n=s.networks)==null?void 0:n.filter(p=>{p.rpcUrl!==void 0&&p.chainId!==void 0&&Kg.find(g=>g.chainId===p.chainId)}))!=null?r:[],c=Kg.map(p=>{var g;const v=(g=s.networks)==null?void 0:g.find(y=>y.chainId===p.chainId);return v?Eo({},p,v):p}).concat(a).map(p=>(p.rpcUrl=p.rpcUrl+`/${t}`,p)),l=p=>{if(!o[p]){var g;const v=(g=c.find(w=>w.chainId===p))==null?void 0:g.rpcUrl;if(!v)throw new Error(`no rpcUrl found for chainId: ${p}`);const y=new rf(v),b=new SO([JX,KX,new AO],new w6(y));o[p]=new lX(b,p)}return o[p]},u=s.defaultNetwork?(i=zc(c,s.defaultNetwork))==null?void 0:i.chainId:void 0;if(!u&&s.defaultNetwork)throw new Error(`defaultNetwork not found for chainId: ${s.defaultNetwork}`);const f=s.localStorage||N6(),d=new e$(s.transports,f,{defaultChainId:u,defaultEIP6492:s.defaultEIP6492,projectAccessKey:t,analytics:s.analytics});return Tl=new Om(d,l),Tl},rre=()=>{Tl&&(Tl.client.closeWallet(),Tl.client.transport.unregister(),Tl=void 0)},nre=()=>{if(!Tl)throw new Error("Wallet has not been initialized, call sequence.initWallet(config) first.");return Tl},V4e=Object.freeze(Object.defineProperty({__proto__:null,BaseInjectedTransport:$4e,BaseProviderTransport:rw,BaseWalletTransport:nw,CHANNEL_ID:ZO,DefaultChainIdTracker:L0,DefaultProviderConfig:TI,ErrSignedInRequired:Bte,EventType:ar,ExtensionMessageHandler:O4e,ExtensionMessageProvider:Qte,InitState:un,LocalStorage:Gb,MemoryItemStore:Wte,MuxMessageProvider:k8,OpenState:Na,PROVIDER_OPEN_TIMEOUT:YO,ProviderError:Lte,ProxyMessageChannel:P4e,ProxyMessageChannelPort:RI,ProxyMessageHandler:R4e,ProxyMessageProvider:Gte,SequenceClient:e$,SequenceClientSession:D0,SequenceProvider:Om,SequenceSigner:Tm,SingleNetworkSequenceProvider:ere,SingleNetworkSequenceSigner:XO,UnrealMessageHandler:T4e,UnrealMessageProvider:Jte,WalletRequestHandler:j4e,WindowMessageHandler:N4e,WindowMessageProvider:Yte,WindowSessionParams:tw,getWallet:nre,initWallet:tre,isBrowserExtension:$6,isMuxTransportTemplate:Zte,isProviderTransport:Dte,isUnityPlugin:Hte,isValidMessageSignature:Ute,isValidSignature:Yg,isValidTypedDataSignature:zte,isWalletUpToDate:qte,messageToBytes:jte,nextMessageIdx:Fte,prefixEIP191Message:A8,resolveArrayProperties:Vte,trimEIP191Prefix:I4e,unregisterWallet:rre,useBestStore:N6},Symbol.toStringTag,{value:"Module"}));function Is(t,e){return e.forEach(function(r){r&&typeof r!="string"&&!Array.isArray(r)&&Object.keys(r).forEach(function(n){if(n!=="default"&&!(n in t)){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}})}),Object.freeze(t)}var G4e=Is({__proto__:null},[M2e]),K4e=Is({__proto__:null},[z2e]),J4e=Is({__proto__:null},[CCe]),Q4e=Is({__proto__:null},[RCe]),Y4e=Is({__proto__:null},[O8e]),Z4e=Is({__proto__:null},[j8e]),X4e=Is({__proto__:null},[FCe]),eSe=Is({__proto__:null},[s_e]),tSe=Is({__proto__:null},[V4e]),rSe=Is({__proto__:null},[g8e]);const nSe=nt.transaction;var iSe=Object.freeze({__proto__:null,transactions:nSe}),sSe=Is({__proto__:null,isValidSignature:Yg,isValidMessageSignature:Ute,isValidTypedDataSignature:zte,isWalletUpToDate:qte},[q6e]),oSe=Is({__proto__:null},[K_e]),aSe=Is({__proto__:null},[m8e]),cSe=Is({__proto__:null},[wCe]),lSe=Is({__proto__:null},[e8e]),uSe=Is({__proto__:null},[_8e]),Zg=Object.freeze({__proto__:null,abi:G4e,api:K4e,auth:J4e,guard:Q4e,indexer:Y4e,metadata:Z4e,multicall:X4e,network:eSe,provider:tSe,relayer:rSe,transactions:iSe,utils:sSe,core:oSe,signhub:aSe,sessions:cSe,migration:lSe,account:uSe,initWallet:tre,getWallet:nre,unregisterWallet:rre,SequenceProvider:Om,SequenceClient:e$,SequenceSigner:Tm});const ire="%[a-f0-9]{2}",yU=new RegExp("("+ire+")|([^%]+?)","gi"),bU=new RegExp("("+ire+")+","gi");function OI(t,e){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;e=e||1;const r=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],OI(r),OI(n))}function fSe(t){try{return decodeURIComponent(t)}catch{let e=t.match(yU)||[];for(let r=1;rt==null,mSe=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),$I=Symbol("encodeFragmentIdentifier");function vSe(t){switch(t.arrayFormat){case"index":return e=>(r,n)=>{const i=r.length;return n===void 0||t.skipNull&&n===null||t.skipEmptyString&&n===""?r:n===null?[...r,[si(e,t),"[",i,"]"].join("")]:[...r,[si(e,t),"[",si(i,t),"]=",si(n,t)].join("")]};case"bracket":return e=>(r,n)=>n===void 0||t.skipNull&&n===null||t.skipEmptyString&&n===""?r:n===null?[...r,[si(e,t),"[]"].join("")]:[...r,[si(e,t),"[]=",si(n,t)].join("")];case"colon-list-separator":return e=>(r,n)=>n===void 0||t.skipNull&&n===null||t.skipEmptyString&&n===""?r:n===null?[...r,[si(e,t),":list="].join("")]:[...r,[si(e,t),":list=",si(n,t)].join("")];case"comma":case"separator":case"bracket-separator":{const e=t.arrayFormat==="bracket-separator"?"[]=":"=";return r=>(n,i)=>i===void 0||t.skipNull&&i===null||t.skipEmptyString&&i===""?n:(i=i===null?"":i,n.length===0?[[si(r,t),e,si(i,t)].join("")]:[[n,si(i,t)].join(t.arrayFormatSeparator)])}default:return e=>(r,n)=>n===void 0||t.skipNull&&n===null||t.skipEmptyString&&n===""?r:n===null?[...r,si(e,t)]:[...r,[si(e,t),"=",si(n,t)].join("")]}}function ySe(t){let e;switch(t.arrayFormat){case"index":return(r,n,i)=>{if(e=/\[(\d*)]$/.exec(r),r=r.replace(/\[\d*]$/,""),!e){i[r]=n;return}i[r]===void 0&&(i[r]={}),i[r][e[1]]=n};case"bracket":return(r,n,i)=>{if(e=/(\[])$/.exec(r),r=r.replace(/\[]$/,""),!e){i[r]=n;return}if(i[r]===void 0){i[r]=[n];return}i[r]=[...i[r],n]};case"colon-list-separator":return(r,n,i)=>{if(e=/(:list)$/.exec(r),r=r.replace(/:list$/,""),!e){i[r]=n;return}if(i[r]===void 0){i[r]=[n];return}i[r]=[...i[r],n]};case"comma":case"separator":return(r,n,i)=>{const s=typeof n=="string"&&n.includes(t.arrayFormatSeparator),o=typeof n=="string"&&!s&&Tu(n,t).includes(t.arrayFormatSeparator);n=o?Tu(n,t):n;const a=s||o?n.split(t.arrayFormatSeparator).map(c=>Tu(c,t)):n===null?n:Tu(n,t);i[r]=a};case"bracket-separator":return(r,n,i)=>{const s=/(\[])$/.test(r);if(r=r.replace(/\[]$/,""),!s){i[r]=n&&Tu(n,t);return}const o=n===null?[]:n.split(t.arrayFormatSeparator).map(a=>Tu(a,t));if(i[r]===void 0){i[r]=o;return}i[r]=[...i[r],...o]};default:return(r,n,i)=>{if(i[r]===void 0){i[r]=n;return}i[r]=[...[i[r]].flat(),n]}}}function ore(t){if(typeof t!="string"||t.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function si(t,e){return e.encode?e.strict?mSe(t):encodeURIComponent(t):t}function Tu(t,e){return e.decode?hSe(t):t}function are(t){return Array.isArray(t)?t.sort():typeof t=="object"?are(Object.keys(t)).sort((e,r)=>Number(e)-Number(r)).map(e=>t[e]):t}function cre(t){const e=t.indexOf("#");return e!==-1&&(t=t.slice(0,e)),t}function bSe(t){let e="";const r=t.indexOf("#");return r!==-1&&(e=t.slice(r)),e}function wU(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&typeof t=="string"&&t.trim()!==""?t=Number(t):e.parseBooleans&&t!==null&&(t.toLowerCase()==="true"||t.toLowerCase()==="false")&&(t=t.toLowerCase()==="true"),t}function t$(t){t=cre(t);const e=t.indexOf("?");return e===-1?"":t.slice(e+1)}function r$(t,e){e={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...e},ore(e.arrayFormatSeparator);const r=ySe(e),n=Object.create(null);if(typeof t!="string"||(t=t.trim().replace(/^[?#&]/,""),!t))return n;for(const i of t.split("&")){if(i==="")continue;const s=e.decode?i.replace(/\+/g," "):i;let[o,a]=sre(s,"=");o===void 0&&(o=s),a=a===void 0?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?a:Tu(a,e),r(Tu(o,e),a,n)}for(const[i,s]of Object.entries(n))if(typeof s=="object"&&s!==null)for(const[o,a]of Object.entries(s))s[o]=wU(a,e);else n[i]=wU(s,e);return e.sort===!1?n:(e.sort===!0?Object.keys(n).sort():Object.keys(n).sort(e.sort)).reduce((i,s)=>{const o=n[s];return o&&typeof o=="object"&&!Array.isArray(o)?i[s]=are(o):i[s]=o,i},Object.create(null))}function lre(t,e){if(!t)return"";e={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...e},ore(e.arrayFormatSeparator);const r=o=>e.skipNull&&gSe(t[o])||e.skipEmptyString&&t[o]==="",n=vSe(e),i={};for(const[o,a]of Object.entries(t))r(o)||(i[o]=a);const s=Object.keys(i);return e.sort!==!1&&s.sort(e.sort),s.map(o=>{const a=t[o];return a===void 0?"":a===null?si(o,e):Array.isArray(a)?a.length===0&&e.arrayFormat==="bracket-separator"?si(o,e)+"[]":a.reduce(n(o),[]).join("&"):si(o,e)+"="+si(a,e)}).filter(o=>o.length>0).join("&")}function ure(t,e){var i;e={decode:!0,...e};let[r,n]=sre(t,"#");return r===void 0&&(r=t),{url:((i=r==null?void 0:r.split("?"))==null?void 0:i[0])??"",query:r$(t$(t),e),...e&&e.parseFragmentIdentifier&&n?{fragmentIdentifier:Tu(n,e)}:{}}}function fre(t,e){e={encode:!0,strict:!0,[$I]:!0,...e};const r=cre(t.url).split("?")[0]||"",n=t$(t.url),i={...r$(n,{sort:!1}),...t.query};let s=lre(i,e);s&&(s=`?${s}`);let o=bSe(t.url);if(t.fragmentIdentifier){const a=new URL(r);a.hash=t.fragmentIdentifier,o=e[$I]?a.hash:`#${t.fragmentIdentifier}`}return`${r}${s}${o}`}function dre(t,e,r){r={parseFragmentIdentifier:!0,[$I]:!1,...r};const{url:n,query:i,fragmentIdentifier:s}=ure(t,r);return fre({url:n,query:pSe(i,e),fragmentIdentifier:s},r)}function wSe(t,e,r){const n=Array.isArray(e)?i=>!e.includes(i):(i,s)=>!e(i,s);return dre(t,n,r)}const hre=Object.freeze(Object.defineProperty({__proto__:null,exclude:wSe,extract:t$,parse:r$,parseUrl:ure,pick:dre,stringify:lre,stringifyUrl:fre},Symbol.toStringTag,{value:"Module"})),n$=$.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),I8=$.createContext({});function xSe(){return $.useContext(I8).visualElement}const iw=$.createContext(null),P8=typeof document<"u",M6=P8?$.useLayoutEffect:$.useEffect,pre=$.createContext({strict:!1});function ESe(t,e,r,n){const i=xSe(),s=$.useContext(pre),o=$.useContext(iw),a=$.useContext(n$).reducedMotion,c=$.useRef();n=n||s.renderer,!c.current&&n&&(c.current=n(t,{visualState:e,parent:i,props:r,presenceId:o?o.id:void 0,blockInitialAnimation:o?o.initial===!1:!1,reducedMotionConfig:a}));const l=c.current;return M6(()=>{l&&l.render()}),(window.HandoffAppearAnimations?M6:$.useEffect)(()=>{l&&l.animationState&&l.animationState.animateChanges()}),l}function Yp(t){return typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function _Se(t,e,r){return $.useCallback(n=>{n&&t.mount&&t.mount(n),e&&(n?e.mount(n):e.unmount()),r&&(typeof r=="function"?r(n):Yp(r)&&(r.current=n))},[e])}function Kb(t){return typeof t=="string"||Array.isArray(t)}function R8(t){return typeof t=="object"&&typeof t.start=="function"}const CSe=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function T8(t){return R8(t.animate)||CSe.some(e=>Kb(t[e]))}function gre(t){return!!(T8(t)||t.variants)}function SSe(t,e){if(T8(t)){const{initial:r,animate:n}=t;return{initial:r===!1||Kb(r)?r:void 0,animate:Kb(n)?n:void 0}}return t.inherit!==!1?e:{}}function ASe(t){const{initial:e,animate:r}=SSe(t,$.useContext(I8));return $.useMemo(()=>({initial:e,animate:r}),[xU(e),xU(r)])}function xU(t){return Array.isArray(t)?t.join(" "):t}const gu=t=>({isEnabled:e=>t.some(r=>!!e[r])}),Jb={measureLayout:gu(["layout","layoutId","drag"]),animation:gu(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:gu(["exit"]),drag:gu(["drag","dragControls"]),focus:gu(["whileFocus"]),hover:gu(["whileHover","onHoverStart","onHoverEnd"]),tap:gu(["whileTap","onTap","onTapStart","onTapCancel"]),pan:gu(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:gu(["whileInView","onViewportEnter","onViewportLeave"])};function kSe(t){for(const e in t)e==="projectionNodeConstructor"?Jb.projectionNodeConstructor=t[e]:Jb[e].Component=t[e]}function O8(t){const e=$.useRef(null);return e.current===null&&(e.current=t()),e.current}const nb={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let ISe=1;function PSe(){return O8(()=>{if(nb.hasEverUpdated)return ISe++})}const i$=$.createContext({});class RSe extends O.Component{getSnapshotBeforeUpdate(){const{visualElement:e,props:r}=this.props;return e&&e.setProps(r),null}componentDidUpdate(){}render(){return this.props.children}}const mre=$.createContext({}),TSe=Symbol.for("motionComponentSymbol");function OSe({preloadedFeatures:t,createVisualElement:e,projectionNodeConstructor:r,useRender:n,useVisualState:i,Component:s}){t&&kSe(t);function o(c,l){const u={...$.useContext(n$),...c,layoutId:$Se(c)},{isStatic:f}=u;let d=null;const p=ASe(c),g=f?void 0:PSe(),v=i(c,f);if(!f&&P8){p.visualElement=ESe(s,v,u,e);const y=$.useContext(pre).strict,b=$.useContext(mre);p.visualElement&&(d=p.visualElement.loadFeatures(u,y,t,g,r||Jb.projectionNodeConstructor,b))}return $.createElement(RSe,{visualElement:p.visualElement,props:u},d,$.createElement(I8.Provider,{value:p},n(s,c,g,_Se(v,p.visualElement,l),v,f,p.visualElement)))}const a=$.forwardRef(o);return a[TSe]=s,a}function $Se({layoutId:t}){const e=$.useContext(i$).id;return e&&t!==void 0?e+"-"+t:t}function NSe(t){function e(n,i={}){return OSe(t(n,i))}if(typeof Proxy>"u")return e;const r=new Map;return new Proxy(e,{get:(n,i)=>(r.has(i)||r.set(i,e(i)),r.get(i))})}const MSe=["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 s$(t){return typeof t!="string"||t.includes("-")?!1:!!(MSe.indexOf(t)>-1||/[A-Z]/.test(t))}const D6={};function DSe(t){Object.assign(D6,t)}const L6=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],$m=new Set(L6);function vre(t,{layout:e,layoutId:r}){return $m.has(t)||t.startsWith("origin")||(e||r!==void 0)&&(!!D6[t]||t==="opacity")}const Oo=t=>!!(t!=null&&t.getVelocity),LSe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},BSe=(t,e)=>L6.indexOf(t)-L6.indexOf(e);function FSe({transform:t,transformKeys:e},{enableHardwareAcceleration:r=!0,allowTransformNone:n=!0},i,s){let o="";e.sort(BSe);for(const a of e)o+=`${LSe[a]||a}(${t[a]}) `;return r&&!t.z&&(o+="translateZ(0)"),o=o.trim(),s?o=s(t,i?"":o):n&&i&&(o="none"),o}function yre(t){return t.startsWith("--")}const jSe=(t,e)=>e&&typeof t=="number"?e.transform(t):t,Xg=(t,e,r)=>Math.min(Math.max(r,t),e),y1={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},ib={...y1,transform:t=>Xg(0,1,t)},B5={...y1,default:1},sb=t=>Math.round(t*1e5)/1e5,Qb=/(-)?([\d]*\.?[\d])+/g,NI=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,USe=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function sw(t){return typeof t=="string"}const ow=t=>({test:e=>sw(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Zf=ow("deg"),zl=ow("%"),It=ow("px"),zSe=ow("vh"),HSe=ow("vw"),EU={...zl,parse:t=>zl.parse(t)/100,transform:t=>zl.transform(t*100)},_U={...y1,transform:Math.round},bre={borderWidth:It,borderTopWidth:It,borderRightWidth:It,borderBottomWidth:It,borderLeftWidth:It,borderRadius:It,radius:It,borderTopLeftRadius:It,borderTopRightRadius:It,borderBottomRightRadius:It,borderBottomLeftRadius:It,width:It,maxWidth:It,height:It,maxHeight:It,size:It,top:It,right:It,bottom:It,left:It,padding:It,paddingTop:It,paddingRight:It,paddingBottom:It,paddingLeft:It,margin:It,marginTop:It,marginRight:It,marginBottom:It,marginLeft:It,rotate:Zf,rotateX:Zf,rotateY:Zf,rotateZ:Zf,scale:B5,scaleX:B5,scaleY:B5,scaleZ:B5,skew:Zf,skewX:Zf,skewY:Zf,distance:It,translateX:It,translateY:It,translateZ:It,x:It,y:It,z:It,perspective:It,transformPerspective:It,opacity:ib,originX:EU,originY:EU,originZ:It,zIndex:_U,fillOpacity:ib,strokeOpacity:ib,numOctaves:_U};function o$(t,e,r,n){const{style:i,vars:s,transform:o,transformKeys:a,transformOrigin:c}=t;a.length=0;let l=!1,u=!1,f=!0;for(const d in e){const p=e[d];if(yre(d)){s[d]=p;continue}const g=bre[d],v=jSe(p,g);if($m.has(d)){if(l=!0,o[d]=v,a.push(d),!f)continue;p!==(g.default||0)&&(f=!1)}else d.startsWith("origin")?(u=!0,c[d]=v):i[d]=v}if(e.transform||(l||n?i.transform=FSe(t,r,f,n):i.transform&&(i.transform="none")),u){const{originX:d="50%",originY:p="50%",originZ:g=0}=c;i.transformOrigin=`${d} ${p} ${g}`}}const a$=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function wre(t,e,r){for(const n in e)!Oo(e[n])&&!vre(n,r)&&(t[n]=e[n])}function qSe({transformTemplate:t},e,r){return $.useMemo(()=>{const n=a$();return o$(n,e,{enableHardwareAcceleration:!r},t),Object.assign({},n.vars,n.style)},[e])}function WSe(t,e,r){const n=t.style||{},i={};return wre(i,n,t),Object.assign(i,qSe(t,e,r)),t.transformValues?t.transformValues(i):i}function VSe(t,e,r){const n={},i=WSe(t,e,r);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),n.style=i,n}const GSe=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","viewport"]);function B6(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||GSe.has(t)}let xre=t=>!B6(t);function KSe(t){t&&(xre=e=>e.startsWith("on")?!B6(e):t(e))}try{KSe(require("@emotion/is-prop-valid").default)}catch{}function JSe(t,e,r){const n={};for(const i in t)i==="values"&&typeof t.values=="object"||(xre(i)||r===!0&&B6(i)||!e&&!B6(i)||t.draggable&&i.startsWith("onDrag"))&&(n[i]=t[i]);return n}function CU(t,e,r){return typeof t=="string"?t:It.transform(e+r*t)}function QSe(t,e,r){const n=CU(e,t.x,t.width),i=CU(r,t.y,t.height);return`${n} ${i}`}const YSe={offset:"stroke-dashoffset",array:"stroke-dasharray"},ZSe={offset:"strokeDashoffset",array:"strokeDasharray"};function XSe(t,e,r=1,n=0,i=!0){t.pathLength=1;const s=i?YSe:ZSe;t[s.offset]=It.transform(-n);const o=It.transform(e),a=It.transform(r);t[s.array]=`${o} ${a}`}function c$(t,{attrX:e,attrY:r,originX:n,originY:i,pathLength:s,pathSpacing:o=1,pathOffset:a=0,...c},l,u,f){if(o$(t,c,l,f),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:d,style:p,dimensions:g}=t;d.transform&&(g&&(p.transform=d.transform),delete d.transform),g&&(n!==void 0||i!==void 0||p.transform)&&(p.transformOrigin=QSe(g,n!==void 0?n:.5,i!==void 0?i:.5)),e!==void 0&&(d.x=e),r!==void 0&&(d.y=r),s!==void 0&&XSe(d,s,o,a,!1)}const Ere=()=>({...a$(),attrs:{}}),l$=t=>typeof t=="string"&&t.toLowerCase()==="svg";function eAe(t,e,r,n){const i=$.useMemo(()=>{const s=Ere();return c$(s,e,{enableHardwareAcceleration:!1},l$(n),t.transformTemplate),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};wre(s,t.style,t),i.style={...s,...i.style}}return i}function tAe(t=!1){return(r,n,i,s,{latestValues:o},a)=>{const l=(s$(r)?eAe:VSe)(n,o,a,r),f={...JSe(n,typeof r=="string",t),...l,ref:s},{children:d}=n,p=$.useMemo(()=>Oo(d)?d.get():d,[d]);return i&&(f["data-projection-id"]=i),$.createElement(r,{...f,children:p})}}const u$=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function _re(t,{style:e,vars:r},n,i){Object.assign(t.style,e,i&&i.getProjectionStyles(n));for(const s in r)t.style.setProperty(s,r[s])}const Cre=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 Sre(t,e,r,n){_re(t,e,void 0,n);for(const i in e.attrs)t.setAttribute(Cre.has(i)?i:u$(i),e.attrs[i])}function f$(t,e){const{style:r}=t,n={};for(const i in r)(Oo(r[i])||e.style&&Oo(e.style[i])||vre(i,t))&&(n[i]=r[i]);return n}function Are(t,e){const r=f$(t,e);for(const n in t)if(Oo(t[n])||Oo(e[n])){const i=n==="x"||n==="y"?"attr"+n.toUpperCase():n;r[i]=t[n]}return r}function d$(t,e,r,n={},i={}){return typeof e=="function"&&(e=e(r!==void 0?r:t.custom,n,i)),typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"&&(e=e(r!==void 0?r:t.custom,n,i)),e}const F6=t=>Array.isArray(t),rAe=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),nAe=t=>F6(t)?t[t.length-1]||0:t;function cE(t){const e=Oo(t)?t.get():t;return rAe(e)?e.toValue():e}function iAe({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:r},n,i,s){const o={latestValues:sAe(n,i,s,t),renderState:e()};return r&&(o.mount=a=>r(n,a,o)),o}const kre=t=>(e,r)=>{const n=$.useContext(I8),i=$.useContext(iw),s=()=>iAe(t,e,n,i);return r?s():O8(s)};function sAe(t,e,r,n){const i={},s=n(t,{});for(const d in s)i[d]=cE(s[d]);let{initial:o,animate:a}=t;const c=T8(t),l=gre(t);e&&l&&!c&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let u=r?r.initial===!1:!1;u=u||o===!1;const f=u?a:o;return f&&typeof f!="boolean"&&!R8(f)&&(Array.isArray(f)?f:[f]).forEach(p=>{const g=d$(t,p);if(!g)return;const{transitionEnd:v,transition:y,...b}=g;for(const w in b){let E=b[w];if(Array.isArray(E)){const C=u?E.length-1:0;E=E[C]}E!==null&&(i[w]=E)}for(const w in v)i[w]=v[w]}),i}const oAe={useVisualState:kre({scrapeMotionValuesFromProps:Are,createRenderState:Ere,onMount:(t,e,{renderState:r,latestValues:n})=>{try{r.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{r.dimensions={x:0,y:0,width:0,height:0}}c$(r,n,{enableHardwareAcceleration:!1},l$(e.tagName),t.transformTemplate),Sre(e,r)}})},aAe={useVisualState:kre({scrapeMotionValuesFromProps:f$,createRenderState:a$})};function cAe(t,{forwardMotionProps:e=!1},r,n,i){return{...s$(t)?oAe:aAe,preloadedFeatures:r,useRender:tAe(e),createVisualElement:n,projectionNodeConstructor:i,Component:t}}var tn;(function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.InView="whileInView",t.Exit="exit"})(tn||(tn={}));function $8(t,e,r,n={passive:!0}){return t.addEventListener(e,r,n),()=>t.removeEventListener(e,r)}function MI(t,e,r,n){$.useEffect(()=>{const i=t.current;if(r&&i)return $8(i,e,r,n)},[t,e,r,n])}function lAe({whileFocus:t,visualElement:e}){const{animationState:r}=e,n=$.useCallback(()=>{r&&r.setActive(tn.Focus,!0)},[r]),i=$.useCallback(()=>{r&&r.setActive(tn.Focus,!1)},[r]);MI(e,"focus",t?n:void 0),MI(e,"blur",t?i:void 0)}const Ire=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function h$(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}const Pre=t=>e=>Ire(e)&&t(e,h$(e));function yg(t,e,r,n){return $8(t,e,Pre(r),n)}function j6(t,e,r,n){return MI(t,e,r&&Pre(r),n)}function Rre(t){let e=null;return()=>{const r=()=>{e=null};return e===null?(e=t,r):!1}}const SU=Rre("dragHorizontal"),AU=Rre("dragVertical");function Tre(t){let e=!1;if(t==="y")e=AU();else if(t==="x")e=SU();else{const r=SU(),n=AU();r&&n?e=()=>{r(),n()}:(r&&r(),n&&n())}return e}function Ore(){const t=Tre(!0);return t?(t(),!1):!0}function kU(t,e,r,n){return(i,s)=>{i.type==="touch"||Ore()||(r&&t.animationState&&t.animationState.setActive(tn.Hover,e),n&&n(i,s))}}function uAe({onHoverStart:t,onHoverEnd:e,whileHover:r,visualElement:n}){j6(n,"pointerenter",$.useMemo(()=>t||r?kU(n,!0,!!r,t):void 0,[t,!!r,n]),{passive:!t}),j6(n,"pointerleave",$.useMemo(()=>e||r?kU(n,!1,!!r,e):void 0,[t,!!r,n]),{passive:!e})}const $re=(t,e)=>e?t===e?!0:$re(t,e.parentElement):!1;function p$(t){return $.useEffect(()=>()=>t(),[])}const fAe=(t,e)=>r=>e(t(r)),N8=(...t)=>t.reduce(fAe);function dAe({onTap:t,onTapStart:e,onTapCancel:r,whileTap:n,visualElement:i,...s}){const o=t||e||r||n,a=$.useRef(!1),c=$.useRef(null),l={passive:!(e||t||r||s.onPointerDown)};function u(){c.current&&c.current(),c.current=null}function f(){return u(),a.current=!1,i.getProps().whileTap&&i.animationState&&i.animationState.setActive(tn.Tap,!1),!Ore()}function d(v,y){var b,w,E,C;f()&&($re(i.current,v.target)?(C=(E=i.getProps()).onTap)===null||C===void 0||C.call(E,v,y):(w=(b=i.getProps()).onTapCancel)===null||w===void 0||w.call(b,v,y))}function p(v,y){var b,w;f()&&((w=(b=i.getProps()).onTapCancel)===null||w===void 0||w.call(b,v,y))}const g=$.useCallback((v,y)=>{var b;if(u(),a.current)return;a.current=!0,c.current=N8(yg(window,"pointerup",d,l),yg(window,"pointercancel",p,l));const w=i.getProps();w.whileTap&&i.animationState&&i.animationState.setActive(tn.Tap,!0),(b=w.onTapStart)===null||b===void 0||b.call(w,v,y)},[!!e,i]);j6(i,"pointerdown",o?g:void 0,l),p$(u)}const DI=new WeakMap,YA=new WeakMap,hAe=t=>{const e=DI.get(t.target);e&&e(t)},pAe=t=>{t.forEach(hAe)};function gAe({root:t,...e}){const r=t||document;YA.has(r)||YA.set(r,{});const n=YA.get(r),i=JSON.stringify(e);return n[i]||(n[i]=new IntersectionObserver(pAe,{root:t,...e})),n[i]}function mAe(t,e,r){const n=gAe(e);return DI.set(t,r),n.observe(t),()=>{DI.delete(t),n.unobserve(t)}}function vAe({visualElement:t,whileInView:e,onViewportEnter:r,onViewportLeave:n,viewport:i={}}){const s=$.useRef({hasEnteredView:!1,isInView:!1});let o=!!(e||r||n);i.once&&s.current.hasEnteredView&&(o=!1),(typeof IntersectionObserver>"u"?wAe:bAe)(o,s.current,t,i)}const yAe={some:0,all:1};function bAe(t,e,r,{root:n,margin:i,amount:s="some",once:o}){$.useEffect(()=>{if(!t||!r.current)return;const a={root:n==null?void 0:n.current,rootMargin:i,threshold:typeof s=="number"?s:yAe[s]},c=l=>{const{isIntersecting:u}=l;if(e.isInView===u||(e.isInView=u,o&&!u&&e.hasEnteredView))return;u&&(e.hasEnteredView=!0),r.animationState&&r.animationState.setActive(tn.InView,u);const f=r.getProps(),d=u?f.onViewportEnter:f.onViewportLeave;d&&d(l)};return mAe(r.current,a,c)},[t,n,i,s])}function wAe(t,e,r,{fallback:n=!0}){$.useEffect(()=>{!t||!n||requestAnimationFrame(()=>{e.hasEnteredView=!0;const{onViewportEnter:i}=r.getProps();i&&i(null),r.animationState&&r.animationState.setActive(tn.InView,!0)})},[t])}const wd=t=>e=>(t(e),null),xAe={inView:wd(vAe),tap:wd(dAe),focus:wd(lAe),hover:wd(uAe)};function Nre(){const t=$.useContext(iw);if(t===null)return[!0,null];const{isPresent:e,onExitComplete:r,register:n}=t,i=$.useId();return $.useEffect(()=>n(i),[]),!e&&r?[!1,()=>r&&r(i)]:[!0]}function Mre(t,e){if(!Array.isArray(e))return!1;const r=e.length;if(r!==t.length)return!1;for(let n=0;n/^\-?\d*\.?\d+$/.test(t),_Ae=t=>/^0[^.\s]+$/.test(t),qu={delta:0,timestamp:0},Dre=1/60*1e3,CAe=typeof performance<"u"?()=>performance.now():()=>Date.now(),Lre=typeof window<"u"?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(CAe()),Dre);function SAe(t){let e=[],r=[],n=0,i=!1,s=!1;const o=new WeakSet,a={schedule:(c,l=!1,u=!1)=>{const f=u&&i,d=f?e:r;return l&&o.add(c),d.indexOf(c)===-1&&(d.push(c),f&&i&&(n=e.length)),c},cancel:c=>{const l=r.indexOf(c);l!==-1&&r.splice(l,1),o.delete(c)},process:c=>{if(i){s=!0;return}if(i=!0,[e,r]=[r,e],r.length=0,n=e.length,n)for(let l=0;l(t[e]=SAe(()=>Yb=!0),t),{}),As=aw.reduce((t,e)=>{const r=M8[e];return t[e]=(n,i=!1,s=!1)=>(Yb||IAe(),r.schedule(n,i,s)),t},{}),Vd=aw.reduce((t,e)=>(t[e]=M8[e].cancel,t),{}),ZA=aw.reduce((t,e)=>(t[e]=()=>M8[e].process(qu),t),{}),kAe=t=>M8[t].process(qu),Bre=t=>{Yb=!1,qu.delta=LI?Dre:Math.max(Math.min(t-qu.timestamp,AAe),1),qu.timestamp=t,BI=!0,aw.forEach(kAe),BI=!1,Yb&&(LI=!1,Lre(Bre))},IAe=()=>{Yb=!0,LI=!0,BI||Lre(Bre)};function g$(t,e){t.indexOf(e)===-1&&t.push(e)}function m$(t,e){const r=t.indexOf(e);r>-1&&t.splice(r,1)}let v$=class{constructor(){this.subscriptions=[]}add(e){return g$(this.subscriptions,e),()=>m$(this.subscriptions,e)}notify(e,r,n){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,r,n);else for(let s=0;s!isNaN(parseFloat(t));class RAe{constructor(e,r={}){this.version="8.5.5",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(n,i=!0)=>{this.prev=this.current,this.current=n;const{delta:s,timestamp:o}=qu;this.lastUpdated!==o&&(this.timeDelta=s,this.lastUpdated=o,As.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>As.postRender(this.velocityCheck),this.velocityCheck=({timestamp:n})=>{n!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=e,this.canTrackVelocity=PAe(this.current),this.owner=r.owner}onChange(e){return this.on("change",e)}on(e,r){this.events[e]||(this.events[e]=new v$);const n=this.events[e].add(r);return e==="change"?()=>{n(),As.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,r){this.passiveEffect=e,this.stopPassiveEffect=r}set(e,r=!0){!r||!this.passiveEffect?this.updateAndNotify(e,r):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,r,n){this.set(r),this.prev=e,this.timeDelta=n}jump(e){this.updateAndNotify(e),this.prev=e,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?y$(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=e(r)||null,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(){this.animation=null}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function em(t,e){return new RAe(t,e)}const b$=(t,e)=>r=>!!(sw(r)&&USe.test(r)&&r.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(r,e)),Fre=(t,e,r)=>n=>{if(!sw(n))return n;const[i,s,o,a]=n.match(Qb);return{[t]:parseFloat(i),[e]:parseFloat(s),[r]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},TAe=t=>Xg(0,255,t),XA={...y1,transform:t=>Math.round(TAe(t))},C0={test:b$("rgb","red"),parse:Fre("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:n=1})=>"rgba("+XA.transform(t)+", "+XA.transform(e)+", "+XA.transform(r)+", "+sb(ib.transform(n))+")"};function OAe(t){let e="",r="",n="",i="";return t.length>5?(e=t.substring(1,3),r=t.substring(3,5),n=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),r=t.substring(2,3),n=t.substring(3,4),i=t.substring(4,5),e+=e,r+=r,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}const FI={test:b$("#"),parse:OAe,transform:C0.transform},Zp={test:b$("hsl","hue"),parse:Fre("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:n=1})=>"hsla("+Math.round(t)+", "+zl.transform(sb(e))+", "+zl.transform(sb(r))+", "+sb(ib.transform(n))+")"},js={test:t=>C0.test(t)||FI.test(t)||Zp.test(t),parse:t=>C0.test(t)?C0.parse(t):Zp.test(t)?Zp.parse(t):FI.parse(t),transform:t=>sw(t)?t:t.hasOwnProperty("red")?C0.transform(t):Zp.transform(t)},jre="${c}",Ure="${n}";function $Ae(t){var e,r;return isNaN(t)&&sw(t)&&(((e=t.match(Qb))===null||e===void 0?void 0:e.length)||0)+(((r=t.match(NI))===null||r===void 0?void 0:r.length)||0)>0}function U6(t){typeof t=="number"&&(t=`${t}`);const e=[];let r=0,n=0;const i=t.match(NI);i&&(r=i.length,t=t.replace(NI,jre),e.push(...i.map(js.parse)));const s=t.match(Qb);return s&&(n=s.length,t=t.replace(Qb,Ure),e.push(...s.map(y1.parse))),{values:e,numColors:r,numNumbers:n,tokenised:t}}function zre(t){return U6(t).values}function Hre(t){const{values:e,numColors:r,tokenised:n}=U6(t),i=e.length;return s=>{let o=n;for(let a=0;atypeof t=="number"?0:t;function MAe(t){const e=zre(t);return Hre(t)(e.map(NAe))}const Gd={test:$Ae,parse:zre,createTransformer:Hre,getAnimatableNone:MAe},DAe=new Set(["brightness","contrast","saturate","opacity"]);function LAe(t){const[e,r]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[n]=r.match(Qb)||[];if(!n)return t;const i=r.replace(n,"");let s=DAe.has(e)?1:0;return n!==r&&(s*=100),e+"("+s+i+")"}const BAe=/([a-z-]*)\(.*?\)/g,jI={...Gd,getAnimatableNone:t=>{const e=t.match(BAe);return e?e.map(LAe).join(" "):t}},FAe={...bre,color:js,backgroundColor:js,outlineColor:js,fill:js,stroke:js,borderColor:js,borderTopColor:js,borderRightColor:js,borderBottomColor:js,borderLeftColor:js,filter:jI,WebkitFilter:jI},w$=t=>FAe[t];function x$(t,e){var r;let n=w$(t);return n!==jI&&(n=Gd),(r=n.getAnimatableNone)===null||r===void 0?void 0:r.call(n,e)}const qre=t=>e=>e.test(t),jAe={test:t=>t==="auto",parse:t=>t},Wre=[y1,It,zl,Zf,HSe,zSe,jAe],Qv=t=>Wre.find(qre(t)),UAe=[...Wre,js,Gd],zAe=t=>UAe.find(qre(t));function HAe(t){const e={};return t.values.forEach((r,n)=>e[n]=r.get()),e}function qAe(t){const e={};return t.values.forEach((r,n)=>e[n]=r.getVelocity()),e}function D8(t,e,r){const n=t.getProps();return d$(n,e,r!==void 0?r:n.custom,HAe(t),qAe(t))}function WAe(t,e,r){t.hasValue(e)?t.getValue(e).set(r):t.addValue(e,em(r))}function VAe(t,e){const r=D8(t,e);let{transitionEnd:n={},transition:i={},...s}=r?t.makeTargetAnimatable(r,!1):{};s={...s,...n};for(const o in s){const a=nAe(s[o]);WAe(t,o,a)}}function GAe(t,e,r){var n,i;const s=Object.keys(e).filter(a=>!t.hasValue(a)),o=s.length;if(o)for(let a=0;at*1e3,XAe={current:!1},E$=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,_$=t=>e=>1-t(1-e),C$=t=>t*t,e9e=_$(C$),S$=E$(C$),zn=(t,e,r)=>-r*t+r*e+t;function e9(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function t9e({hue:t,saturation:e,lightness:r,alpha:n}){t/=360,e/=100,r/=100;let i=0,s=0,o=0;if(!e)i=s=o=r;else{const a=r<.5?r*(1+e):r+e-r*e,c=2*r-a;i=e9(c,a,t+1/3),s=e9(c,a,t),o=e9(c,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:n}}const t9=(t,e,r)=>{const n=t*t;return Math.sqrt(Math.max(0,r*(e*e-n)+n))},r9e=[FI,C0,Zp],n9e=t=>r9e.find(e=>e.test(t));function IU(t){const e=n9e(t);let r=e.parse(t);return e===Zp&&(r=t9e(r)),r}const Vre=(t,e)=>{const r=IU(t),n=IU(e),i={...r};return s=>(i.red=t9(r.red,n.red,s),i.green=t9(r.green,n.green,s),i.blue=t9(r.blue,n.blue,s),i.alpha=zn(r.alpha,n.alpha,s),C0.transform(i))};function Gre(t,e){return typeof t=="number"?r=>zn(t,e,r):js.test(t)?Vre(t,e):Jre(t,e)}const Kre=(t,e)=>{const r=[...t],n=r.length,i=t.map((s,o)=>Gre(s,e[o]));return s=>{for(let o=0;o{const r={...t,...e},n={};for(const i in r)t[i]!==void 0&&e[i]!==void 0&&(n[i]=Gre(t[i],e[i]));return i=>{for(const s in n)r[s]=n[s](i);return r}},Jre=(t,e)=>{const r=Gd.createTransformer(e),n=U6(t),i=U6(e);return n.numColors===i.numColors&&n.numNumbers>=i.numNumbers?N8(Kre(n.values,i.values),r):o=>`${o>0?e:t}`},q6=(t,e,r)=>{const n=e-t;return n===0?1:(r-t)/n},PU=(t,e)=>r=>zn(t,e,r);function s9e(t){return typeof t=="number"?PU:typeof t=="string"?js.test(t)?Vre:Jre:Array.isArray(t)?Kre:typeof t=="object"?i9e:PU}function o9e(t,e,r){const n=[],i=r||s9e(t[0]),s=t.length-1;for(let o=0;ot[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const o=o9e(e,n,i),a=o.length,c=l=>{let u=0;if(a>1)for(;uc(Xg(t[0],t[s-1],l)):c}const A$=t=>t,Yre=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,a9e=1e-7,c9e=12;function l9e(t,e,r,n,i){let s,o,a=0;do o=e+(r-e)/2,s=Yre(o,n,i)-t,s>0?r=o:e=o;while(Math.abs(s)>a9e&&++al9e(s,0,1,t,r);return s=>s===0||s===1?s:Yre(i(s),e,n)}const Xre=t=>1-Math.sin(Math.acos(t)),k$=_$(Xre),u9e=E$(k$),ene=Zre(.33,1.53,.69,.99),I$=_$(ene),f9e=E$(I$),d9e=t=>(t*=2)<1?.5*I$(t):.5*(2-Math.pow(2,-10*(t-1))),h9e={linear:A$,easeIn:C$,easeInOut:S$,easeOut:e9e,circIn:Xre,circInOut:u9e,circOut:k$,backIn:I$,backInOut:f9e,backOut:ene,anticipate:d9e},RU=t=>{if(Array.isArray(t)){H6(t.length===4);const[e,r,n,i]=t;return Zre(e,r,n,i)}else if(typeof t=="string")return h9e[t];return t},p9e=t=>Array.isArray(t)&&typeof t[0]!="number";function g9e(t,e){return t.map(()=>e||S$).splice(0,t.length-1)}function m9e(t){const e=t.length;return t.map((r,n)=>n!==0?n/(e-1):0)}function v9e(t,e){return t.map(r=>r*e)}function UI({keyframes:t,ease:e=S$,times:r,duration:n=300}){t=[...t];const i=p9e(e)?e.map(RU):RU(e),s={done:!1,value:t[0]},o=v9e(r&&r.length===t.length?r:m9e(t),n);function a(){return Qre(o,t,{ease:Array.isArray(i)?i:g9e(t,i)})}let c=a();return{next:l=>(s.value=c(l),s.done=l>=n,s),flipTarget:()=>{t.reverse(),c=a()}}}const r9=.001,y9e=.01,TU=10,b9e=.05,w9e=1;function x9e({duration:t=800,bounce:e=.25,velocity:r=0,mass:n=1}){let i,s;ZAe(t<=TU*1e3);let o=1-e;o=Xg(b9e,w9e,o),t=Xg(y9e,TU,t/1e3),o<1?(i=l=>{const u=l*o,f=u*t,d=u-r,p=zI(l,o),g=Math.exp(-f);return r9-d/p*g},s=l=>{const f=l*o*t,d=f*r+r,p=Math.pow(o,2)*Math.pow(l,2)*t,g=Math.exp(-f),v=zI(Math.pow(l,2),o);return(-i(l)+r9>0?-1:1)*((d-p)*g)/v}):(i=l=>{const u=Math.exp(-l*t),f=(l-r)*t+1;return-r9+u*f},s=l=>{const u=Math.exp(-l*t),f=(r-l)*(t*t);return u*f});const a=5/t,c=_9e(i,s,a);if(t=t*1e3,isNaN(c))return{stiffness:100,damping:10,duration:t};{const l=Math.pow(c,2)*n;return{stiffness:l,damping:o*2*Math.sqrt(n*l),duration:t}}}const E9e=12;function _9e(t,e,r){let n=r;for(let i=1;it[r]!==void 0)}function A9e(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!OU(t,S9e)&&OU(t,C9e)){const r=x9e(t);e={...e,...r,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}const k9e=5;function tne({keyframes:t,restDelta:e,restSpeed:r,...n}){let i=t[0],s=t[t.length-1];const o={done:!1,value:i},{stiffness:a,damping:c,mass:l,velocity:u,duration:f,isResolvedFromDuration:d}=A9e(n);let p=I9e,g=u?-(u/1e3):0;const v=c/(2*Math.sqrt(a*l));function y(){const b=s-i,w=Math.sqrt(a/l)/1e3,E=Math.abs(b)<5;if(r||(r=E?.01:2),e||(e=E?.005:.5),v<1){const C=zI(w,v);p=S=>{const P=Math.exp(-v*w*S);return s-P*((g+v*w*b)/C*Math.sin(C*S)+b*Math.cos(C*S))}}else if(v===1)p=C=>s-Math.exp(-w*C)*(b+(g+w*b)*C);else{const C=w*Math.sqrt(v*v-1);p=S=>{const P=Math.exp(-v*w*S),_=Math.min(C*S,300);return s-P*((g+v*w*b)*Math.sinh(_)+C*b*Math.cosh(_))/C}}}return y(),{next:b=>{const w=p(b);if(d)o.done=b>=f;else{let E=g;if(b!==0)if(v<1){const P=Math.max(0,b-k9e);E=y$(w-p(P),b-P)}else E=0;const C=Math.abs(E)<=r,S=Math.abs(s-w)<=e;o.done=C&&S}return o.value=o.done?s:w,o},flipTarget:()=>{g=-g,[i,s]=[s,i],y()}}}tne.needsInterpolation=(t,e)=>typeof t=="string"||typeof e=="string";const I9e=t=>0;function P9e({keyframes:t=[0],velocity:e=0,power:r=.8,timeConstant:n=350,restDelta:i=.5,modifyTarget:s}){const o=t[0],a={done:!1,value:o};let c=r*e;const l=o+c,u=s===void 0?l:s(l);return u!==l&&(c=u-o),{next:f=>{const d=-c*Math.exp(-f/n);return a.done=!(d>i||d<-i),a.value=a.done?u:u+d,a},flipTarget:()=>{}}}const R9e={decay:P9e,keyframes:UI,tween:UI,spring:tne};function rne(t,e,r=0){return t-e-r}function T9e(t,e=0,r=0,n=!0){return n?rne(e+-t,e,r):e-(t-e)+r}function O9e(t,e,r,n){return n?t>=e+r:t<=-r}const $9e=t=>{const e=({delta:r})=>t(r);return{start:()=>As.update(e,!0),stop:()=>Vd.update(e)}};function W6({duration:t,driver:e=$9e,elapsed:r=0,repeat:n=0,repeatType:i="loop",repeatDelay:s=0,keyframes:o,autoplay:a=!0,onPlay:c,onStop:l,onComplete:u,onRepeat:f,onUpdate:d,type:p="keyframes",...g}){var v,y;const b=r;let w,E=0,C=t,S=!1,P=!0,_;const T=R9e[o.length>2?"keyframes":p]||UI,Q=o[0],Z=o[o.length-1];let ne={done:!1,value:Q};!((y=(v=T).needsInterpolation)===null||y===void 0)&&y.call(v,Q,Z)&&(_=Qre([0,100],[Q,Z],{clamp:!1}),o=[0,100]);const ce=T({...g,duration:t,keyframes:o});function K(){E++,i==="reverse"?(P=E%2===0,r=T9e(r,C,s,P)):(r=rne(r,C,s),i==="mirror"&&ce.flipTarget()),S=!1,f&&f()}function x(){w&&w.stop(),u&&u()}function A(z){P||(z=-z),r+=z,S||(ne=ce.next(Math.max(0,r)),_&&(ne.value=_(ne.value)),S=P?ne.done:r<=0),d&&d(ne.value),S&&(E===0&&(C=C!==void 0?C:r),E{l&&l(),w&&w.stop()},set currentTime(z){r=b,A(z)},sample:z=>{r=b;const R=t&&typeof t=="number"?Math.max(t*.5,50):50;let L=0;for(A(0);L<=z;){const q=z-L;A(Math.min(q,R)),L+=R}return ne}}}function N9e(t){return!t||Array.isArray(t)||typeof t=="string"&&nne[t]}const Iy=([t,e,r,n])=>`cubic-bezier(${t}, ${e}, ${r}, ${n})`,nne={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Iy([0,.65,.55,1]),circOut:Iy([.55,0,1,.45]),backIn:Iy([.31,.01,.66,-.59]),backOut:Iy([.33,1.53,.69,.99])};function M9e(t){if(t)return Array.isArray(t)?Iy(t):nne[t]}function D9e(t,e,r,{delay:n=0,duration:i,repeat:s=0,repeatType:o="loop",ease:a,times:c}={}){return t.animate({[e]:r,offset:c},{delay:n,duration:i,easing:M9e(a),fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}const $U={waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate")},n9={},ine={};for(const t in $U)ine[t]=()=>(n9[t]===void 0&&(n9[t]=$U[t]()),n9[t]);function L9e(t,{repeat:e,repeatType:r="loop"}){const n=e&&r!=="loop"&&e%2===1?0:t.length-1;return t[n]}const B9e=new Set(["opacity"]),F5=10;function F9e(t,e,{onUpdate:r,onComplete:n,...i}){if(!(ine.waapi()&&B9e.has(e)&&!i.repeatDelay&&i.repeatType!=="mirror"&&i.damping!==0))return!1;let{keyframes:o,duration:a=300,elapsed:c=0,ease:l}=i;if(i.type==="spring"||!N9e(i.ease)){if(i.repeat===1/0)return;const f=W6({...i,elapsed:0});let d={done:!1,value:o[0]};const p=[];let g=0;for(;!d.done&&g<2e4;)d=f.sample(g),p.push(d.value),g+=F5;o=p,a=g-F5,l="linear"}const u=D9e(t.owner.current,e,o,{...i,delay:-c,duration:a,ease:l});return u.onfinish=()=>{t.set(L9e(o,i)),As.update(()=>u.cancel()),n&&n()},{get currentTime(){return u.currentTime||0},set currentTime(f){u.currentTime=f},stop:()=>{const{currentTime:f}=u;if(f){const d=W6({...i,autoplay:!1});t.setWithVelocity(d.sample(f-F5).value,d.sample(f).value,F5)}As.update(()=>u.cancel())}}}function sne(t,e){const r=performance.now(),n=({timestamp:i})=>{const s=i-r;s>=e&&(Vd.read(n),t(s-e))};return As.read(n,!0),()=>Vd.read(n)}function j9e({keyframes:t,elapsed:e,onUpdate:r,onComplete:n}){const i=()=>{r&&r(t[t.length-1]),n&&n()};return e?{stop:sne(i,-e)}:i()}function U9e({keyframes:t,velocity:e=0,min:r,max:n,power:i=.8,timeConstant:s=750,bounceStiffness:o=500,bounceDamping:a=10,restDelta:c=1,modifyTarget:l,driver:u,onUpdate:f,onComplete:d,onStop:p}){const g=t[0];let v;function y(C){return r!==void 0&&Cn}function b(C){return r===void 0?n:n===void 0||Math.abs(r-C){var P;f==null||f(S),(P=C.onUpdate)===null||P===void 0||P.call(C,S)},onComplete:d,onStop:p})}function E(C){w({type:"spring",stiffness:o,damping:a,restDelta:c,...C})}if(y(g))E({velocity:e,keyframes:[g,b(g)]});else{let C=i*e+g;typeof l<"u"&&(C=l(C));const S=b(C),P=S===r?-1:1;let _,T;const Q=Z=>{_=T,T=Z,e=y$(Z-_,qu.delta),(P===1&&Z>S||P===-1&&Zv==null?void 0:v.stop()}}const Kh=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),j5=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),i9=()=>({type:"keyframes",ease:"linear",duration:.3}),z9e={type:"keyframes",duration:.8},NU={x:Kh,y:Kh,z:Kh,rotate:Kh,rotateX:Kh,rotateY:Kh,rotateZ:Kh,scaleX:j5,scaleY:j5,scale:j5,opacity:i9,backgroundColor:i9,color:i9,default:j5},H9e=(t,{keyframes:e})=>e.length>2?z9e:(NU[t]||NU.default)(e[1]),HI=(t,e)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&Gd.test(e)&&!e.startsWith("url("));function q9e({when:t,delay:e,delayChildren:r,staggerChildren:n,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:c,elapsed:l,...u}){return!!Object.keys(u).length}function MU(t){return t===0||typeof t=="string"&&parseFloat(t)===0&&t.indexOf(" ")===-1}function DU(t){return typeof t=="number"?0:x$("",t)}function one(t,e){return t[e]||t.default||t}function W9e(t,e,r,n){const i=HI(e,r);let s=n.from!==void 0?n.from:t.get();return s==="none"&&i&&typeof r=="string"?s=x$(e,r):MU(s)&&typeof r=="string"?s=DU(r):!Array.isArray(r)&&MU(r)&&typeof s=="string"&&(r=DU(s)),Array.isArray(r)?(r[0]===null&&(r[0]=s),r):[s,r]}const P$=(t,e,r,n={})=>i=>{const s=one(n,t)||{},o=s.delay||n.delay||0;let{elapsed:a=0}=n;a=a-lE(o);const c=W9e(e,t,r,s),l=c[0],u=c[c.length-1],f=HI(t,l),d=HI(t,u);let p={keyframes:c,velocity:e.getVelocity(),...s,elapsed:a,onUpdate:y=>{e.set(y),s.onUpdate&&s.onUpdate(y)},onComplete:()=>{i(),s.onComplete&&s.onComplete()}};if(!f||!d||XAe.current||s.type===!1)return j9e(p);if(s.type==="inertia")return U9e(p);q9e(s)||(p={...p,...H9e(t,p)}),p.duration&&(p.duration=lE(p.duration)),p.repeatDelay&&(p.repeatDelay=lE(p.repeatDelay));const g=e.owner,v=g&&g.current;if(g&&v instanceof HTMLElement&&!(g!=null&&g.getProps().onUpdate)){const y=F9e(e,t,p);if(y)return y}return W6(p)};function V9e(t,e,r={}){t.notify("AnimationStart",e);let n;if(Array.isArray(e)){const i=e.map(s=>qI(t,s,r));n=Promise.all(i)}else if(typeof e=="string")n=qI(t,e,r);else{const i=typeof e=="function"?D8(t,e,r.custom):e;n=ane(t,i,r)}return n.then(()=>t.notify("AnimationComplete",e))}function qI(t,e,r={}){var n;const i=D8(t,e,r.custom);let{transition:s=t.getDefaultTransition()||{}}=i||{};r.transitionOverride&&(s=r.transitionOverride);const o=i?()=>ane(t,i,r):()=>Promise.resolve(),a=!((n=t.variantChildren)===null||n===void 0)&&n.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:d}=s;return G9e(t,e,u+l,f,d,r)}:()=>Promise.resolve(),{when:c}=s;if(c){const[l,u]=c==="beforeChildren"?[o,a]:[a,o];return l().then(u)}else return Promise.all([o(),a(r.delay)])}function ane(t,e,{delay:r=0,transitionOverride:n,type:i}={}){var s;let{transition:o=t.getDefaultTransition(),transitionEnd:a,...c}=t.makeTargetAnimatable(e);const l=t.getValue("willChange");n&&(o=n);const u=[],f=i&&((s=t.animationState)===null||s===void 0?void 0:s.getState()[i]);for(const d in c){const p=t.getValue(d),g=c[d];if(!p||g===void 0||f&&J9e(f,d))continue;const v={delay:r,elapsed:0,...o};if(window.HandoffAppearAnimations&&!p.hasAnimated){const b=t.getProps()[YAe];b&&(v.elapsed=window.HandoffAppearAnimations(b,d,p,As))}let y=p.start(P$(d,p,g,t.shouldReduceMotion&&$m.has(d)?{type:!1}:v));z6(l)&&(l.add(d),y=y.then(()=>l.remove(d))),u.push(y)}return Promise.all(u).then(()=>{a&&VAe(t,a)})}function G9e(t,e,r=0,n=0,i=1,s){const o=[],a=(t.variantChildren.size-1)*n,c=i===1?(l=0)=>l*n:(l=0)=>a-l*n;return Array.from(t.variantChildren).sort(K9e).forEach((l,u)=>{l.notify("AnimationStart",e),o.push(qI(l,e,{...s,delay:r+c(u)}).then(()=>l.notify("AnimationComplete",e)))}),Promise.all(o)}function K9e(t,e){return t.sortNodePosition(e)}function J9e({protectedKeys:t,needsAnimating:e},r){const n=t.hasOwnProperty(r)&&e[r]!==!0;return e[r]=!1,n}const R$=[tn.Animate,tn.InView,tn.Focus,tn.Hover,tn.Tap,tn.Drag,tn.Exit],Q9e=[...R$].reverse(),Y9e=R$.length;function Z9e(t){return e=>Promise.all(e.map(({animation:r,options:n})=>V9e(t,r,n)))}function X9e(t){let e=Z9e(t);const r=t7e();let n=!0;const i=(c,l)=>{const u=D8(t,l);if(u){const{transition:f,transitionEnd:d,...p}=u;c={...c,...p,...d}}return c};function s(c){e=c(t)}function o(c,l){const u=t.getProps(),f=t.getVariantContext(!0)||{},d=[],p=new Set;let g={},v=1/0;for(let b=0;bv&&S;const Z=Array.isArray(C)?C:[C];let ne=Z.reduce(i,{});P===!1&&(ne={});const{prevResolvedValues:ce={}}=E,K={...ce,...ne},x=A=>{Q=!0,p.delete(A),E.needsAnimating[A]=!0};for(const A in K){const B=ne[A],z=ce[A];g.hasOwnProperty(A)||(B!==z?F6(B)&&F6(z)?!Mre(B,z)||T?x(A):E.protectedKeys[A]=!0:B!==void 0?x(A):p.add(A):B!==void 0&&p.has(A)?x(A):E.protectedKeys[A]=!0)}E.prevProp=C,E.prevResolvedValues=ne,E.isActive&&(g={...g,...ne}),n&&t.blockInitialAnimation&&(Q=!1),Q&&!_&&d.push(...Z.map(A=>({animation:A,options:{type:w,...c}})))}if(p.size){const b={};p.forEach(w=>{const E=t.getBaseTarget(w);E!==void 0&&(b[w]=E)}),d.push({animation:b})}let y=!!d.length;return n&&u.initial===!1&&!t.manuallyAnimateOnMount&&(y=!1),n=!1,y?e(d):Promise.resolve()}function a(c,l,u){var f;if(r[c].isActive===l)return Promise.resolve();(f=t.variantChildren)===null||f===void 0||f.forEach(p=>{var g;return(g=p.animationState)===null||g===void 0?void 0:g.setActive(c,l)}),r[c].isActive=l;const d=o(u,c);for(const p in r)r[p].protectedKeys={};return d}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>r}}function e7e(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Mre(e,t):!1}function Jh(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function t7e(){return{[tn.Animate]:Jh(!0),[tn.InView]:Jh(),[tn.Hover]:Jh(),[tn.Tap]:Jh(),[tn.Drag]:Jh(),[tn.Focus]:Jh(),[tn.Exit]:Jh()}}const r7e={animation:wd(({visualElement:t,animate:e})=>{t.animationState||(t.animationState=X9e(t)),R8(e)&&$.useEffect(()=>e.subscribe(t),[e])}),exit:wd(t=>{const{custom:e,visualElement:r}=t,[n,i]=Nre(),s=$.useContext(iw);$.useEffect(()=>{r.isPresent=n;const o=r.animationState&&r.animationState.setActive(tn.Exit,!n,{custom:s&&s.custom||e});o&&!n&&o.then(i)},[n])})},LU=(t,e)=>Math.abs(t-e);function n7e(t,e){const r=LU(t.x,e.x),n=LU(t.y,e.y);return Math.sqrt(r**2+n**2)}class cne{constructor(e,r,{transformPagePoint:n}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const l=o9(this.lastMoveEventInfo,this.history),u=this.startEvent!==null,f=n7e(l.offset,{x:0,y:0})>=3;if(!u&&!f)return;const{point:d}=l,{timestamp:p}=qu;this.history.push({...d,timestamp:p});const{onStart:g,onMove:v}=this.handlers;u||(g&&g(this.lastMoveEvent,l),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,l)},this.handlePointerMove=(l,u)=>{this.lastMoveEvent=l,this.lastMoveEventInfo=s9(u,this.transformPagePoint),As.update(this.updatePoint,!0)},this.handlePointerUp=(l,u)=>{if(this.end(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const{onEnd:f,onSessionEnd:d}=this.handlers,p=o9(l.type==="pointercancel"?this.lastMoveEventInfo:s9(u,this.transformPagePoint),this.history);this.startEvent&&f&&f(l,p),d&&d(l,p)},!Ire(e))return;this.handlers=r,this.transformPagePoint=n;const i=h$(e),s=s9(i,this.transformPagePoint),{point:o}=s,{timestamp:a}=qu;this.history=[{...o,timestamp:a}];const{onSessionStart:c}=r;c&&c(e,o9(s,this.history)),this.removeListeners=N8(yg(window,"pointermove",this.handlePointerMove),yg(window,"pointerup",this.handlePointerUp),yg(window,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Vd.update(this.updatePoint)}}function s9(t,e){return e?{point:e(t.point)}:t}function BU(t,e){return{x:t.x-e.x,y:t.y-e.y}}function o9({point:t},e){return{point:t,delta:BU(t,lne(e)),offset:BU(t,i7e(e)),velocity:s7e(e,.1)}}function i7e(t){return t[0]}function lne(t){return t[t.length-1]}function s7e(t,e){if(t.length<2)return{x:0,y:0};let r=t.length-1,n=null;const i=lne(t);for(;r>=0&&(n=t[r],!(i.timestamp-n.timestamp>lE(e)));)r--;if(!n)return{x:0,y:0};const s=(i.timestamp-n.timestamp)/1e3;if(s===0)return{x:0,y:0};const o={x:(i.x-n.x)/s,y:(i.y-n.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function aa(t){return t.max-t.min}function WI(t,e=0,r=.01){return Math.abs(t-e)<=r}function FU(t,e,r,n=.5){t.origin=n,t.originPoint=zn(e.min,e.max,t.origin),t.scale=aa(r)/aa(e),(WI(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=zn(r.min,r.max,t.origin)-t.originPoint,(WI(t.translate)||isNaN(t.translate))&&(t.translate=0)}function ob(t,e,r,n){FU(t.x,e.x,r.x,n==null?void 0:n.originX),FU(t.y,e.y,r.y,n==null?void 0:n.originY)}function jU(t,e,r){t.min=r.min+e.min,t.max=t.min+aa(e)}function o7e(t,e,r){jU(t.x,e.x,r.x),jU(t.y,e.y,r.y)}function UU(t,e,r){t.min=e.min-r.min,t.max=t.min+aa(e)}function ab(t,e,r){UU(t.x,e.x,r.x),UU(t.y,e.y,r.y)}function a7e(t,{min:e,max:r},n){return e!==void 0&&tr&&(t=n?zn(r,t,n.max):Math.min(t,r)),t}function zU(t,e,r){return{min:e!==void 0?t.min+e:void 0,max:r!==void 0?t.max+r-(t.max-t.min):void 0}}function c7e(t,{top:e,left:r,bottom:n,right:i}){return{x:zU(t.x,r,i),y:zU(t.y,e,n)}}function HU(t,e){let r=e.min-t.min,n=e.max-t.max;return e.max-e.minn?r=q6(e.min,e.max-n,t.min):n>i&&(r=q6(t.min,t.max-i,e.min)),Xg(0,1,r)}function f7e(t,e){const r={};return e.min!==void 0&&(r.min=e.min-t.min),e.max!==void 0&&(r.max=e.max-t.min),r}const VI=.35;function d7e(t=VI){return t===!1?t=0:t===!0&&(t=VI),{x:qU(t,"left","right"),y:qU(t,"top","bottom")}}function qU(t,e,r){return{min:WU(t,e),max:WU(t,r)}}function WU(t,e){return typeof t=="number"?t:t[e]||0}const VU=()=>({translate:0,scale:1,origin:0,originPoint:0}),cb=()=>({x:VU(),y:VU()}),GU=()=>({min:0,max:0}),mi=()=>({x:GU(),y:GU()});function gl(t){return[t("x"),t("y")]}function une({top:t,left:e,right:r,bottom:n}){return{x:{min:e,max:r},y:{min:t,max:n}}}function h7e({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function p7e(t,e){if(!e)return t;const r=e({x:t.left,y:t.top}),n=e({x:t.right,y:t.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}function a9(t){return t===void 0||t===1}function GI({scale:t,scaleX:e,scaleY:r}){return!a9(t)||!a9(e)||!a9(r)}function o0(t){return GI(t)||fne(t)||t.z||t.rotate||t.rotateX||t.rotateY}function fne(t){return KU(t.x)||KU(t.y)}function KU(t){return t&&t!=="0%"}function V6(t,e,r){const n=t-r,i=e*n;return r+i}function JU(t,e,r,n,i){return i!==void 0&&(t=V6(t,i,n)),V6(t,r,n)+e}function KI(t,e=0,r=1,n,i){t.min=JU(t.min,e,r,n,i),t.max=JU(t.max,e,r,n,i)}function dne(t,{x:e,y:r}){KI(t.x,e.translate,e.scale,e.originPoint),KI(t.y,r.translate,r.scale,r.originPoint)}function g7e(t,e,r,n=!1){var i,s;const o=r.length;if(!o)return;e.x=e.y=1;let a,c;for(let l=0;l1.0000000000001||t<.999999999999?t:1}function od(t,e){t.min=t.min+e,t.max=t.max+e}function YU(t,e,[r,n,i]){const s=e[i]!==void 0?e[i]:.5,o=zn(t.min,t.max,s);KI(t,e[r],e[n],o,e.scale)}const m7e=["x","scaleX","originX"],v7e=["y","scaleY","originY"];function Xp(t,e){YU(t.x,e,m7e),YU(t.y,e,v7e)}function hne(t,e){return une(p7e(t.getBoundingClientRect(),e))}function y7e(t,e,r){const n=hne(t,r),{scroll:i}=e;return i&&(od(n.x,i.offset.x),od(n.y,i.offset.y)),n}const b7e=new WeakMap;class w7e{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=mi(),this.visualElement=e}start(e,{snapToCursor:r=!1}={}){if(this.visualElement.isPresent===!1)return;const n=a=>{this.stopAnimation(),r&&this.snapToCursor(h$(a,"page").point)},i=(a,c)=>{var l;const{drag:u,dragPropagation:f,onDragStart:d}=this.getProps();u&&!f&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Tre(u),!this.openGlobalLock)||(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),gl(p=>{var g,v;let y=this.getAxisMotionValue(p).get()||0;if(zl.test(y)){const b=(v=(g=this.visualElement.projection)===null||g===void 0?void 0:g.layout)===null||v===void 0?void 0:v.layoutBox[p];b&&(y=aa(b)*(parseFloat(y)/100))}this.originPoint[p]=y}),d==null||d(a,c),(l=this.visualElement.animationState)===null||l===void 0||l.setActive(tn.Drag,!0))},s=(a,c)=>{const{dragPropagation:l,dragDirectionLock:u,onDirectionLock:f,onDrag:d}=this.getProps();if(!l&&!this.openGlobalLock)return;const{offset:p}=c;if(u&&this.currentDirection===null){this.currentDirection=x7e(p),this.currentDirection!==null&&(f==null||f(this.currentDirection));return}this.updateAxis("x",c.point,p),this.updateAxis("y",c.point,p),this.visualElement.render(),d==null||d(a,c)},o=(a,c)=>this.stop(a,c);this.panSession=new cne(e,{onSessionStart:n,onStart:i,onMove:s,onSessionEnd:o},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(e,r){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:i}=r;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s==null||s(e,r)}cancel(){var e,r;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),(e=this.panSession)===null||e===void 0||e.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),(r=this.visualElement.animationState)===null||r===void 0||r.setActive(tn.Drag,!1)}updateAxis(e,r,n){const{drag:i}=this.getProps();if(!n||!U5(e,i,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(o=a7e(o,this.constraints[e],this.elastic[e])),s.set(o)}resolveConstraints(){const{dragConstraints:e,dragElastic:r}=this.getProps(),{layout:n}=this.visualElement.projection||{},i=this.constraints;e&&Yp(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&n?this.constraints=c7e(n.layoutBox,e):this.constraints=!1,this.elastic=d7e(r),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&gl(s=>{this.getAxisMotionValue(s)&&(this.constraints[s]=f7e(n.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:r}=this.getProps();if(!e||!Yp(e))return!1;const n=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=y7e(n,i.root,this.visualElement.getTransformPagePoint());let o=l7e(i.layout.layoutBox,s);if(r){const a=r(h7e(o));this.hasMutatedConstraints=!!a,a&&(o=une(a))}return o}startAnimation(e){const{drag:r,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=gl(u=>{if(!U5(u,r,this.currentDirection))return;let f=(c==null?void 0:c[u])||{};o&&(f={min:0,max:0});const d=i?200:1e6,p=i?40:1e7,g={type:"inertia",velocity:n?e[u]:0,bounceStiffness:d,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(u,g)});return Promise.all(l).then(a)}startAxisValueAnimation(e,r){const n=this.getAxisMotionValue(e);return n.start(P$(e,n,0,r))}stopAnimation(){gl(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){var r;const n="_drag"+e.toUpperCase(),i=this.visualElement.getProps()[n];return i||this.visualElement.getValue(e,((r=this.visualElement.getProps().initial)===null||r===void 0?void 0:r[e])||0)}snapToCursor(e){gl(r=>{const{drag:n}=this.getProps();if(!U5(r,n,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(r);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[r];s.set(e[r]-zn(o,a,.5))}})}scalePositionWithinConstraints(){var e;if(!this.visualElement.current)return;const{drag:r,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!Yp(n)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};gl(a=>{const c=this.getAxisMotionValue(a);if(c){const l=c.get();s[a]=u7e({min:l,max:l},this.constraints[a])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",(e=i.root)===null||e===void 0||e.updateScroll(),i.updateLayout(),this.resolveConstraints(),gl(a=>{if(!U5(a,r,null))return;const c=this.getAxisMotionValue(a),{min:l,max:u}=this.constraints[a];c.set(zn(l,u,s[a]))})}addListeners(){var e;if(!this.visualElement.current)return;b7e.set(this.visualElement,this);const r=this.visualElement.current,n=yg(r,"pointerdown",l=>{const{drag:u,dragListener:f=!0}=this.getProps();u&&f&&this.start(l)}),i=()=>{const{dragConstraints:l}=this.getProps();Yp(l)&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,o=s.addEventListener("measure",i);s&&!s.layout&&((e=s.root)===null||e===void 0||e.updateScroll(),s.updateLayout()),i();const a=$8(window,"resize",()=>this.scalePositionWithinConstraints()),c=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(gl(f=>{const d=this.getAxisMotionValue(f);d&&(this.originPoint[f]+=l[f].translate,d.set(d.get()+l[f].translate))}),this.visualElement.render())});return()=>{a(),n(),o(),c==null||c()}}getProps(){const e=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=VI,dragMomentum:a=!0}=e;return{...e,drag:r,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function U5(t,e,r){return(e===!0||e===t)&&(r===null||r===t)}function x7e(t,e=10){let r=null;return Math.abs(t.y)>e?r="y":Math.abs(t.x)>e&&(r="x"),r}function E7e(t){const{dragControls:e,visualElement:r}=t,n=O8(()=>new w7e(r));$.useEffect(()=>e&&e.subscribe(n),[n,e]),$.useEffect(()=>n.addListeners(),[n])}function _7e({onPan:t,onPanStart:e,onPanEnd:r,onPanSessionStart:n,visualElement:i}){const s=t||e||r||n,o=$.useRef(null),{transformPagePoint:a}=$.useContext(n$),c={onSessionStart:n,onStart:e,onMove:t,onEnd:(u,f)=>{o.current=null,r&&r(u,f)}};$.useEffect(()=>{o.current!==null&&o.current.updateHandlers(c)});function l(u){o.current=new cne(u,c,{transformPagePoint:a})}j6(i,"pointerdown",s&&l),p$(()=>o.current&&o.current.end())}const C7e={pan:wd(_7e),drag:wd(E7e)};function JI(t){return typeof t=="string"&&t.startsWith("var(--")}const pne=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function S7e(t){const e=pne.exec(t);if(!e)return[,];const[,r,n]=e;return[r,n]}function QI(t,e,r=1){const[n,i]=S7e(t);if(!n)return;const s=window.getComputedStyle(e).getPropertyValue(n);return s?s.trim():JI(i)?QI(i,e,r+1):i}function A7e(t,{...e},r){const n=t.current;if(!(n instanceof Element))return{target:e,transitionEnd:r};r&&(r={...r}),t.values.forEach(i=>{const s=i.get();if(!JI(s))return;const o=QI(s,n);o&&i.set(o)});for(const i in e){const s=e[i];if(!JI(s))continue;const o=QI(s,n);o&&(e[i]=o,r&&r[i]===void 0&&(r[i]=s))}return{target:e,transitionEnd:r}}const k7e=new Set(["width","height","top","left","right","bottom","x","y"]),gne=t=>k7e.has(t),I7e=t=>Object.keys(t).some(gne),ZU=t=>t===y1||t===It;var XU;(function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"})(XU||(XU={}));const ez=(t,e)=>parseFloat(t.split(", ")[e]),tz=(t,e)=>(r,{transform:n})=>{if(n==="none"||!n)return 0;const i=n.match(/^matrix3d\((.+)\)$/);if(i)return ez(i[1],e);{const s=n.match(/^matrix\((.+)\)$/);return s?ez(s[1],t):0}},P7e=new Set(["x","y","z"]),R7e=L6.filter(t=>!P7e.has(t));function T7e(t){const e=[];return R7e.forEach(r=>{const n=t.getValue(r);n!==void 0&&(e.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),e.length&&t.render(),e}const rz={width:({x:t},{paddingLeft:e="0",paddingRight:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),height:({y:t},{paddingTop:e="0",paddingBottom:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:tz(4,13),y:tz(5,14)},O7e=(t,e,r)=>{const n=e.measureViewportBox(),i=e.current,s=getComputedStyle(i),{display:o}=s,a={};o==="none"&&e.setStaticValue("display",t.display||"block"),r.forEach(l=>{a[l]=rz[l](n,s)}),e.render();const c=e.measureViewportBox();return r.forEach(l=>{const u=e.getValue(l);u&&u.jump(a[l]),t[l]=rz[l](c,s)}),t},$7e=(t,e,r={},n={})=>{e={...e},n={...n};const i=Object.keys(e).filter(gne);let s=[],o=!1;const a=[];if(i.forEach(c=>{const l=t.getValue(c);if(!t.hasValue(c))return;let u=r[c],f=Qv(u);const d=e[c];let p;if(F6(d)){const g=d.length,v=d[0]===null?1:0;u=d[v],f=Qv(u);for(let y=v;y=0?window.pageYOffset:null,l=O7e(e,t,a);return s.length&&s.forEach(([u,f])=>{t.getValue(u).set(f)}),t.render(),P8&&c!==null&&window.scrollTo({top:c}),{target:l,transitionEnd:n}}else return{target:e,transitionEnd:n}};function N7e(t,e,r,n){return I7e(e)?$7e(t,e,r,n):{target:e,transitionEnd:n}}const M7e=(t,e,r,n)=>{const i=A7e(t,e,n);return e=i.target,n=i.transitionEnd,N7e(t,e,r,n)},YI={current:null},mne={current:!1};function D7e(){if(mne.current=!0,!!P8)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>YI.current=t.matches;t.addListener(e),e()}else YI.current=!1}function L7e(t,e,r){const{willChange:n}=e;for(const i in e){const s=e[i],o=r[i];if(Oo(s))t.addValue(i,s),z6(n)&&n.add(i);else if(Oo(o))t.addValue(i,em(s,{owner:t})),z6(n)&&n.remove(i);else if(o!==s)if(t.hasValue(i)){const a=t.getValue(i);!a.hasAnimated&&a.set(s)}else{const a=t.getStaticValue(i);t.addValue(i,em(a!==void 0?a:s,{owner:t}))}}for(const i in r)e[i]===void 0&&t.removeValue(i);return e}const vne=Object.keys(Jb),B7e=vne.length,nz=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class F7e{constructor({parent:e,props:r,reducedMotionConfig:n,visualState:i},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,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.scheduleRender=()=>As.render(this.render,!1,!0);const{latestValues:o,renderState:a}=i;this.latestValues=o,this.baseTarget={...o},this.initialValues=r.initial?{...o}:{},this.renderState=a,this.parent=e,this.props=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=n,this.options=s,this.isControllingVariants=T8(r),this.isVariantNode=gre(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:c,...l}=this.scrapeMotionValuesFromProps(r,{});for(const u in l){const f=l[u];o[u]!==void 0&&Oo(f)&&(f.set(o[u],!1),z6(c)&&c.add(u))}}scrapeMotionValuesFromProps(e,r){return{}}mount(e){var r;this.current=e,this.projection&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=(r=this.parent)===null||r===void 0?void 0:r.addVariantChild(this)),this.values.forEach((n,i)=>this.bindToMotionValue(i,n)),mne.current||D7e(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:YI.current,this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var e,r,n;(e=this.projection)===null||e===void 0||e.unmount(),Vd.update(this.notifyUpdate),Vd.render(this.render),this.valueSubscriptions.forEach(i=>i()),(r=this.removeFromVariantTree)===null||r===void 0||r.call(this),(n=this.parent)===null||n===void 0||n.children.delete(this);for(const i in this.events)this.events[i].clear();this.current=null}bindToMotionValue(e,r){const n=$m.has(e),i=r.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&As.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),s=r.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,()=>{i(),s()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}loadFeatures({children:e,...r},n,i,s,o,a){const c=[];for(let l=0;lthis.scheduleRender(),animationType:typeof u=="string"?u:"both",initialPromotionConfig:a,layoutScroll:p,layoutRoot:g})}return c}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):mi()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,r){this.latestValues[e]=r}makeTargetAnimatable(e,r=!0){return this.makeTargetAnimatableFromInstance(e,this.props,r)}setProps(e){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender();const r=this.props;this.props=e;for(let n=0;nn.variantChildren.delete(e)}addValue(e,r){r!==this.values.get(e)&&(this.removeValue(e),this.bindToMotionValue(e,r)),this.values.set(e,r),this.latestValues[e]=r.get()}removeValue(e){var r;this.values.delete(e),(r=this.valueSubscriptions.get(e))===null||r===void 0||r(),this.valueSubscriptions.delete(e),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,r){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&r!==void 0&&(n=em(r,{owner:this}),this.addValue(e,n)),n}readValue(e){return this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.readValueFromInstance(this.current,e,this.options)}setBaseTarget(e,r){this.baseTarget[e]=r}getBaseTarget(e){var r;const{initial:n}=this.props,i=typeof n=="string"||typeof n=="object"?(r=d$(this.props,n))===null||r===void 0?void 0:r[e]:void 0;if(n&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!Oo(s)?s:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,r){return this.events[e]||(this.events[e]=new v$),this.events[e].add(r)}notify(e,...r){var n;(n=this.events[e])===null||n===void 0||n.notify(...r)}}const yne=["initial",...R$],j7e=yne.length;class bne extends F7e{sortInstanceNodePosition(e,r){return e.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(e,r){var n;return(n=e.style)===null||n===void 0?void 0:n[r]}removeValueFromRenderState(e,{vars:r,style:n}){delete r[e],delete n[e]}makeTargetAnimatableFromInstance({transition:e,transitionEnd:r,...n},{transformValues:i},s){let o=JAe(n,e||{},this);if(i&&(r&&(r=i(r)),n&&(n=i(n)),o&&(o=i(o))),s){GAe(this,n,o);const a=M7e(this,n,o,r);r=a.transitionEnd,n=a.target}return{transition:e,transitionEnd:r,...n}}}function U7e(t){return window.getComputedStyle(t)}class z7e extends bne{readValueFromInstance(e,r){if($m.has(r)){const n=w$(r);return n&&n.default||0}else{const n=U7e(e),i=(yre(r)?n.getPropertyValue(r):n[r])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:r}){return hne(e,r)}build(e,r,n,i){o$(e,r,n,i.transformTemplate)}scrapeMotionValuesFromProps(e,r){return f$(e,r)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Oo(e)&&(this.childSubscription=e.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}renderInstance(e,r,n,i){_re(e,r,n,i)}}class H7e extends bne{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(e,r){return e[r]}readValueFromInstance(e,r){var n;return $m.has(r)?((n=w$(r))===null||n===void 0?void 0:n.default)||0:(r=Cre.has(r)?r:u$(r),e.getAttribute(r))}measureInstanceViewportBox(){return mi()}scrapeMotionValuesFromProps(e,r){return Are(e,r)}build(e,r,n,i){c$(e,r,n,this.isSVGTag,i.transformTemplate)}renderInstance(e,r,n,i){Sre(e,r,n,i)}mount(e){this.isSVGTag=l$(e.tagName),super.mount(e)}}const q7e=(t,e)=>s$(t)?new H7e(e,{enableHardwareAcceleration:!1}):new z7e(e,{enableHardwareAcceleration:!0});function iz(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Yv={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(It.test(t))t=parseFloat(t);else return t;const r=iz(t,e.target.x),n=iz(t,e.target.y);return`${r}% ${n}%`}},sz="_$css",W7e={correct:(t,{treeScale:e,projectionDelta:r})=>{const n=t,i=t.includes("var("),s=[];i&&(t=t.replace(pne,p=>(s.push(p),sz)));const o=Gd.parse(t);if(o.length>5)return n;const a=Gd.createTransformer(t),c=typeof o[0]!="number"?1:0,l=r.x.scale*e.x,u=r.y.scale*e.y;o[0+c]/=l,o[1+c]/=u;const f=zn(l,u,.5);typeof o[2+c]=="number"&&(o[2+c]/=f),typeof o[3+c]=="number"&&(o[3+c]/=f);let d=a(o);if(i){let p=0;d=d.replace(sz,()=>{const g=s[p];return p++,g})}return d}};class V7e extends O.Component{componentDidMount(){const{visualElement:e,layoutGroup:r,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=e;DSe(K7e),s&&(r.group&&r.group.add(s),n&&n.register&&i&&n.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),nb.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:r,visualElement:n,drag:i,isPresent:s}=this.props,o=n.projection;return o&&(o.isPresent=s,i||e.layoutDependency!==r||r===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?o.promote():o.relegate()||As.postRender(()=>{var a;!((a=o.getStack())===null||a===void 0)&&a.members.length||this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),!e.currentAnimation&&e.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:e,layoutGroup:r,switchLayoutGroup:n}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),r!=null&&r.group&&r.group.remove(i),n!=null&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e==null||e()}render(){return null}}function G7e(t){const[e,r]=Nre(),n=$.useContext(i$);return O.createElement(V7e,{...t,layoutGroup:n,switchLayoutGroup:$.useContext(mre),isPresent:e,safeToRemove:r})}const K7e={borderRadius:{...Yv,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Yv,borderTopRightRadius:Yv,borderBottomLeftRadius:Yv,borderBottomRightRadius:Yv,boxShadow:W7e},J7e={measureLayout:G7e};function Q7e(t,e,r={}){const n=Oo(t)?t:em(t);return n.start(P$("",n,e,r)),{stop:()=>n.stop(),isAnimating:()=>n.isAnimating()}}const wne=["TopLeft","TopRight","BottomLeft","BottomRight"],Y7e=wne.length,oz=t=>typeof t=="string"?parseFloat(t):t,az=t=>typeof t=="number"||It.test(t);function Z7e(t,e,r,n,i,s){i?(t.opacity=zn(0,r.opacity!==void 0?r.opacity:1,X7e(n)),t.opacityExit=zn(e.opacity!==void 0?e.opacity:1,0,eke(n))):s&&(t.opacity=zn(e.opacity!==void 0?e.opacity:1,r.opacity!==void 0?r.opacity:1,n));for(let o=0;one?1:r(q6(t,e,n))}function lz(t,e){t.min=e.min,t.max=e.max}function xc(t,e){lz(t.x,e.x),lz(t.y,e.y)}function uz(t,e,r,n,i){return t-=e,t=V6(t,1/r,n),i!==void 0&&(t=V6(t,1/i,n)),t}function tke(t,e=0,r=1,n=.5,i,s=t,o=t){if(zl.test(e)&&(e=parseFloat(e),e=zn(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=zn(s.min,s.max,n);t===s&&(a-=e),t.min=uz(t.min,e,r,a,i),t.max=uz(t.max,e,r,a,i)}function fz(t,e,[r,n,i],s,o){tke(t,e[r],e[n],e[i],e.scale,s,o)}const rke=["x","scaleX","originX"],nke=["y","scaleY","originY"];function dz(t,e,r,n){fz(t.x,e,rke,r==null?void 0:r.x,n==null?void 0:n.x),fz(t.y,e,nke,r==null?void 0:r.y,n==null?void 0:n.y)}function hz(t){return t.translate===0&&t.scale===1}function Ene(t){return hz(t.x)&&hz(t.y)}function _ne(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}function pz(t){return aa(t.x)/aa(t.y)}class ike{constructor(){this.members=[]}add(e){g$(this.members,e),e.scheduleRender()}remove(e){if(m$(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(e){const r=this.members.findIndex(i=>e===i);if(r===0)return!1;let n;for(let i=r;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){n=s;break}}return n?(this.promote(n),!0):!1}promote(e,r){var n;const i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.instance&&i.scheduleRender(),e.scheduleRender(),e.resumeFrom=i,r&&(e.resumeFrom.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),!((n=e.root)===null||n===void 0)&&n.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:s}=e.options;s===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var r,n,i,s,o;(n=(r=e.options).onExitComplete)===null||n===void 0||n.call(r),(o=(i=e.resumingFrom)===null||i===void 0?void 0:(s=i.options).onExitComplete)===null||o===void 0||o.call(s)})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function gz(t,e,r){let n="";const i=t.x.translate/e.x,s=t.y.translate/e.y;if((i||s)&&(n=`translate3d(${i}px, ${s}px, 0) `),(e.x!==1||e.y!==1)&&(n+=`scale(${1/e.x}, ${1/e.y}) `),r){const{rotate:c,rotateX:l,rotateY:u}=r;c&&(n+=`rotate(${c}deg) `),l&&(n+=`rotateX(${l}deg) `),u&&(n+=`rotateY(${u}deg) `)}const o=t.x.scale*e.x,a=t.y.scale*e.y;return(o!==1||a!==1)&&(n+=`scale(${o}, ${a})`),n||"none"}const ske=(t,e)=>t.depth-e.depth;class oke{constructor(){this.children=[],this.isDirty=!1}add(e){g$(this.children,e),this.isDirty=!0}remove(e){m$(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(ske),this.isDirty=!1,this.children.forEach(e)}}const mz=["","X","Y","Z"],vz=1e3;let ake=0;function Cne({attachResizeListener:t,defaultParent:e,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(o,a={},c=e==null?void 0:e()){this.id=ake++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isTransformDirty=!1,this.isProjectionDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(uke),this.nodes.forEach(hke),this.nodes.forEach(pke)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=o,this.latestValues=a,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0,o&&this.root.registerPotentialNode(o,this);for(let l=0;lthis.root.updateBlockedByResize=!1;t(o,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=sne(p,250),nb.hasAnimatedSinceResize&&(nb.hasAnimatedSinceResize=!1,this.nodes.forEach(bz))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&f&&(l||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:p,hasRelativeTargetChanged:g,layout:v})=>{var y,b,w,E,C;if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const S=(b=(y=this.options.transition)!==null&&y!==void 0?y:f.getDefaultTransition())!==null&&b!==void 0?b:bke,{onLayoutAnimationStart:P,onLayoutAnimationComplete:_}=f.getProps(),T=!this.targetLayout||!_ne(this.targetLayout,v)||g,Q=!p&&g;if(this.options.layoutRoot||!((w=this.resumeFrom)===null||w===void 0)&&w.instance||Q||p&&(T||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,Q);const Z={...one(S,"layout"),onPlay:P,onComplete:_};(f.shouldReduceMotion||this.options.layoutRoot)&&(Z.delay=0,Z.type=!1),this.startAnimation(Z)}else!p&&this.animationProgress===0&&bz(this),this.isLead()&&((C=(E=this.options).onExitComplete)===null||C===void 0||C.call(E));this.targetLayout=v})}unmount(){var o,a;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),(o=this.getStack())===null||o===void 0||o.remove(this),(a=this.parent)===null||a===void 0||a.children.delete(this),this.instance=void 0,Vd.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var o;return this.isAnimationBlocked||((o=this.parent)===null||o===void 0?void 0:o.isTreeAnimationBlocked())||!1}startUpdate(){var o;this.isUpdateBlocked()||(this.isUpdating=!0,(o=this.nodes)===null||o===void 0||o.forEach(gke),this.animationId++)}getTransformTemplate(){var o;return(o=this.options.visualElement)===null||o===void 0?void 0:o.getProps().transformTemplate}willUpdate(o=!0){var a,c,l;if(this.root.isUpdateBlocked()){(c=(a=this.options).onExitComplete)===null||c===void 0||c.call(a);return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){var o;if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c{var E;const C=w/1e3;wz(p.x,o.x,C),wz(p.y,o.y,C),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(!((E=this.relativeParent)===null||E===void 0)&&E.layout)&&(ab(g,this.layout.layoutBox,this.relativeParent.layout.layoutBox),vke(this.relativeTarget,this.relativeTargetOrigin,g,C)),v&&(this.animationValues=d,Z7e(d,f,this.latestValues,C,b,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=C},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,c;this.notifyListeners("animationStart"),(a=this.currentAnimation)===null||a===void 0||a.stop(),this.resumingFrom&&((c=this.resumingFrom.currentAnimation)===null||c===void 0||c.stop()),this.pendingAnimation&&(Vd.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=As.update(()=>{nb.hasAnimatedSinceResize=!0,this.currentAnimation=Q7e(0,vz,{...o,onUpdate:l=>{var u;this.mixTargetDelta(l),(u=o.onUpdate)===null||u===void 0||u.call(o,l)},onComplete:()=>{var l;(l=o.onComplete)===null||l===void 0||l.call(o),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var o;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),(o=this.getStack())===null||o===void 0||o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var o;this.currentAnimation&&((o=this.mixTargetDelta)===null||o===void 0||o.call(this,vz),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:c,layout:l,latestValues:u}=o;if(!(!a||!c||!l)){if(this!==o&&this.layout&&l&&Sne(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||mi();const f=aa(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+f;const d=aa(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+d}xc(a,c),Xp(a,u),ob(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){var c,l,u;this.sharedNodes.has(o)||this.sharedNodes.set(o,new ike),this.sharedNodes.get(o).add(a),a.promote({transition:(c=a.options.initialPromotionConfig)===null||c===void 0?void 0:c.transition,preserveFollowOpacity:(u=(l=a.options.initialPromotionConfig)===null||l===void 0?void 0:l.shouldPreserveFollowOpacity)===null||u===void 0?void 0:u.call(l,a)})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.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 l=this.getStack();l&&l.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}resetRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:c}=o;if((c.rotate||c.rotateX||c.rotateY||c.rotateZ)&&(a=!0),!a)return;const l={};for(let u=0;u{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(yz),this.root.sharedNodes.clear()}}}function cke(t){t.updateLayout()}function lke(t){var e,r,n;const i=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&i&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:o}=t.layout,{animationType:a}=t.options,c=i.source!==t.layout.source;a==="size"?gl(p=>{const g=c?i.measuredBox[p]:i.layoutBox[p],v=aa(g);g.min=s[p].min,g.max=g.min+v}):Sne(a,i.layoutBox,s)&&gl(p=>{const g=c?i.measuredBox[p]:i.layoutBox[p],v=aa(s[p]);g.max=g.min+v});const l=cb();ob(l,s,i.layoutBox);const u=cb();c?ob(u,t.applyTransform(o,!0),i.measuredBox):ob(u,s,i.layoutBox);const f=!Ene(l);let d=!1;if(!t.resumeFrom){const p=t.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:g,layout:v}=p;if(g&&v){const y=mi();ab(y,i.layoutBox,g.layoutBox);const b=mi();ab(b,s,v.layoutBox),_ne(y,b)||(d=!0),p.options.layoutRoot&&(t.relativeTarget=b,t.relativeTargetOrigin=y,t.relativeParent=p)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:i,delta:u,layoutDelta:l,hasLayoutChanged:f,hasRelativeTargetChanged:d})}else t.isLead()&&((n=(r=t.options).onExitComplete)===null||n===void 0||n.call(r));t.options.transition=void 0}function uke(t){t.isProjectionDirty||(t.isProjectionDirty=!!(t.parent&&t.parent.isProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=!!(t.parent&&t.parent.isTransformDirty))}function fke(t){t.clearSnapshot()}function yz(t){t.clearMeasurements()}function dke(t){const{visualElement:e}=t.options;e!=null&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function bz(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function hke(t){t.resolveTargetDelta()}function pke(t){t.calcProjection()}function gke(t){t.resetRotation()}function mke(t){t.removeLeadSnapshot()}function wz(t,e,r){t.translate=zn(e.translate,0,r),t.scale=zn(e.scale,1,r),t.origin=e.origin,t.originPoint=e.originPoint}function xz(t,e,r,n){t.min=zn(e.min,r.min,n),t.max=zn(e.max,r.max,n)}function vke(t,e,r,n){xz(t.x,e.x,r.x,n),xz(t.y,e.y,r.y,n)}function yke(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const bke={duration:.45,ease:[.4,0,.1,1]};function wke(t,e){let r=t.root;for(let s=t.path.length-1;s>=0;s--)if(t.path[s].instance){r=t.path[s];break}const i=(r&&r!==t.root?r.instance:document).querySelector(`[data-projection-id="${e}"]`);i&&t.mount(i,!0)}function Ez(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function xke(t){Ez(t.x),Ez(t.y)}function Sne(t,e,r){return t==="position"||t==="preserve-aspect"&&!WI(pz(e),pz(r),.2)}const Eke=Cne({attachResizeListener:(t,e)=>$8(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),c9={current:void 0},_ke=Cne({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!c9.current){const t=new Eke(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),c9.current=t}return c9.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Cke={...r7e,...xAe,...C7e,...J7e},Zb=NSe((t,e)=>cAe(t,e,Cke,q7e,_ke));function Ane(){const t=$.useRef(!1);return M6(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function Ske(){const t=Ane(),[e,r]=$.useState(0),n=$.useCallback(()=>{t.current&&r(e+1)},[e]);return[$.useCallback(()=>As.postRender(n),[n]),e]}class Ake extends $.Component{getSnapshotBeforeUpdate(e){const r=this.props.childRef.current;if(r&&e.isPresent&&!this.props.isPresent){const n=this.props.sizeRef.current;n.height=r.offsetHeight||0,n.width=r.offsetWidth||0,n.top=r.offsetTop,n.left=r.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function kke({children:t,isPresent:e}){const r=$.useId(),n=$.useRef(null),i=$.useRef({width:0,height:0,top:0,left:0});return $.useInsertionEffect(()=>{const{width:s,height:o,top:a,left:c}=i.current;if(e||!n.current||!s||!o)return;n.current.dataset.motionPopId=r;const l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule(` + [data-motion-pop-id="${r}"] { + position: absolute !important; + width: ${s}px !important; + height: ${o}px !important; + top: ${a}px !important; + left: ${c}px !important; + } + `),()=>{document.head.removeChild(l)}},[e]),$.createElement(Ake,{isPresent:e,childRef:n,sizeRef:i},$.cloneElement(t,{ref:n}))}const l9=({children:t,initial:e,isPresent:r,onExitComplete:n,custom:i,presenceAffectsLayout:s,mode:o})=>{const a=O8(Ike),c=$.useId(),l=$.useMemo(()=>({id:c,initial:e,isPresent:r,custom:i,onExitComplete:u=>{a.set(u,!0);for(const f of a.values())if(!f)return;n&&n()},register:u=>(a.set(u,!1),()=>a.delete(u))}),s?void 0:[r]);return $.useMemo(()=>{a.forEach((u,f)=>a.set(f,!1))},[r]),$.useEffect(()=>{!r&&!a.size&&n&&n()},[r]),o==="popLayout"&&(t=$.createElement(kke,{isPresent:r},t)),$.createElement(iw.Provider,{value:l},t)};function Ike(){return new Map}const Op=t=>t.key||"";function Pke(t,e){t.forEach(r=>{const n=Op(r);e.set(n,r)})}function Rke(t){const e=[];return $.Children.forEach(t,r=>{$.isValidElement(r)&&e.push(r)}),e}const L8=({children:t,custom:e,initial:r=!0,onExitComplete:n,exitBeforeEnter:i,presenceAffectsLayout:s=!0,mode:o="sync"})=>{i&&(o="wait");let[a]=Ske();const c=$.useContext(i$).forceRender;c&&(a=c);const l=Ane(),u=Rke(t);let f=u;const d=new Set,p=$.useRef(f),g=$.useRef(new Map).current,v=$.useRef(!0);if(M6(()=>{v.current=!1,Pke(u,g),p.current=f}),p$(()=>{v.current=!0,g.clear(),d.clear()}),v.current)return $.createElement($.Fragment,null,f.map(E=>$.createElement(l9,{key:Op(E),isPresent:!0,initial:r?void 0:!1,presenceAffectsLayout:s,mode:o},E)));f=[...f];const y=p.current.map(Op),b=u.map(Op),w=y.length;for(let E=0;E{if(b.indexOf(E)!==-1)return;const C=g.get(E);if(!C)return;const S=y.indexOf(E),P=()=>{g.delete(E),d.delete(E);const _=p.current.findIndex(T=>T.key===E);if(p.current.splice(_,1),!d.size){if(p.current=u,l.current===!1)return;a(),n&&n()}};f.splice(S,0,$.createElement(l9,{key:Op(C),isPresent:!1,onExitComplete:P,custom:e,presenceAffectsLayout:s,mode:o},C))}),f=f.map(E=>{const C=E.key;return d.has(C)?E:$.createElement(l9,{key:Op(E),isPresent:!0,presenceAffectsLayout:s,mode:o},E)}),$.createElement($.Fragment,null,d.size?f:f.map(E=>$.cloneElement(E)))};var ZI=function(t,e){return ZI=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},ZI(t,e)};function kne(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");ZI(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var ja=function(){return ja=Object.assign||function(e){for(var r,n=1,i=arguments.length;n=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function Pne(t,e){return function(r,n){e(r,n,t)}}function Tke(t,e,r,n,i,s){function o(b){if(b!==void 0&&typeof b!="function")throw new TypeError("Function expected");return b}for(var a=n.kind,c=a==="getter"?"get":a==="setter"?"set":"value",l=!e&&t?n.static?t:t.prototype:null,u=e||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),f,d=!1,p=r.length-1;p>=0;p--){var g={};for(var v in n)g[v]=v==="access"?{}:n[v];for(var v in n.access)g.access[v]=n.access[v];g.addInitializer=function(b){if(d)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(b||null))};var y=(0,r[p])(a==="accessor"?{get:u.get,set:u.set}:u[c],g);if(a==="accessor"){if(y===void 0)continue;if(y===null||typeof y!="object")throw new TypeError("Object expected");(f=o(y.get))&&(u.get=f),(f=o(y.set))&&(u.set=f),(f=o(y.init))&&i.unshift(f)}else(f=o(y))&&(a==="field"?i.unshift(f):u[c]=f)}l&&Object.defineProperty(l,n.name,u),d=!0}function Oke(t,e,r){for(var n=arguments.length>2,i=0;i0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function T$(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function Nne(){for(var t=[],e=0;e1||a(d,p)})})}function a(d,p){try{c(n[d](p))}catch(g){f(s[0][3],g)}}function c(d){d.value instanceof tm?Promise.resolve(d.value.v).then(l,u):f(s[0][2],d)}function l(d){a("next",d)}function u(d){a("throw",d)}function f(d,p){d(p),s.shift(),s.length&&a(s[0][0],s[0][1])}}function Lne(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=t[i]?function(o){return(r=!r)?{value:tm(t[i](o)),done:!1}:s?s(o):o}:s}}function Bne(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof G6=="function"?G6(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function Fne(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var Mke=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function jne(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&F8(e,t,r);return Mke(e,t),e}function Une(t){return t&&t.__esModule?t:{default:t}}function zne(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function Hne(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function qne(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function Wne(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose]}if(typeof n!="function")throw new TypeError("Object not disposable.");t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}var Dke=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};function Vne(t){function e(n){t.error=t.hasError?new Dke(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}function r(){for(;t.stack.length;){var n=t.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(r,function(s){return e(s),r()})}catch(s){e(s)}}if(t.hasError)throw t.error}return r()}const Lke={__extends:kne,__assign:ja,__rest:B8,__decorate:Ine,__param:Pne,__metadata:Rne,__awaiter:Tne,__generator:One,__createBinding:F8,__exportStar:$ne,__values:G6,__read:T$,__spread:Nne,__spreadArrays:Mne,__spreadArray:O$,__await:tm,__asyncGenerator:Dne,__asyncDelegator:Lne,__asyncValues:Bne,__makeTemplateObject:Fne,__importStar:jne,__importDefault:Une,__classPrivateFieldGet:zne,__classPrivateFieldSet:Hne,__classPrivateFieldIn:qne,__addDisposableResource:Wne,__disposeResources:Vne},Bke=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:Wne,get __assign(){return ja},__asyncDelegator:Lne,__asyncGenerator:Dne,__asyncValues:Bne,__await:tm,__awaiter:Tne,__classPrivateFieldGet:zne,__classPrivateFieldIn:qne,__classPrivateFieldSet:Hne,__createBinding:F8,__decorate:Ine,__disposeResources:Vne,__esDecorate:Tke,__exportStar:$ne,__extends:kne,__generator:One,__importDefault:Une,__importStar:jne,__makeTemplateObject:Fne,__metadata:Rne,__param:Pne,__propKey:$ke,__read:T$,__rest:B8,__runInitializers:Oke,__setFunctionName:Nke,__spread:Nne,__spreadArray:O$,__spreadArrays:Mne,__values:G6,default:Lke},Symbol.toStringTag,{value:"Module"})),Gne={black:"#000000",white:"#ffffff",inherit:"inherit",transparent:"transparent",positive:"#1FC266",negative:"#C2501F",info:"#0076CC",warning:"#F4B03E",gradientBackdrop:`linear-gradient( + 243.18deg, + rgba(86, 52, 189, 0.85) 0%, + rgba(49, 41, 223, 0.85) 63.54%, + rgba(7, 98, 149, 0.85) 100% + )`,gradientPrimary:"linear-gradient(89.69deg, #4411E1 0.27%, #7537F9 99.73%)",gradientSecondary:"linear-gradient(32.51deg, #951990 -15.23%, #3A35B1 48.55%, #20A8B0 100%)",arbitrumDark:"#212D44",arbitrumLight:"#93D4FF",avalanceDark:"#810C0C",avalanceLight:"#FF8080",bscDark:"#584508",bscLight:"#FCCF43",ethereumDark:"#132362",ethereumLight:"#AABBFF",gnosisDark:"#084246",gnosisLight:"#8CF6FD",polygonDark:"#350881",polygonLight:"#C7A6FF"},Fke={...Gne,text100:"rgba(255, 255, 255, 1)",text80:"rgba(255, 255, 255, 0.8)",text50:"rgba(255, 255, 255, 0.5)",textInverse100:"rgba(0, 0, 0, 1)",backgroundPrimary:"rgba(0, 0, 0, 1)",backgroundSecondary:"rgba(255, 255, 255, 0.1)",backgroundContrast:"rgba(0, 0, 0, 0.5)",backgroundMuted:"rgba(255, 255, 255, 0.05)",backgroundControl:"rgba(255, 255, 255, 0.25)",backgroundInverse:"rgba(255, 255, 255, 1)",backgroundBackdrop:"rgba(34, 34, 34, 0.9)",backgroundOverlay:"rgba(0, 0, 0, 0.7)",backgroundRaised:"rgba(54, 54, 54, 0.7)",buttonGlass:"rgba(255, 255, 255, 0.15)",buttonEmphasis:"rgba(0, 0, 0, 0.5)",buttonInverse:"rgba(255, 255, 255, 0.8)",borderNormal:"rgba(255, 255, 255, 0.25)",borderFocus:"rgba(255, 255, 255, 0.5)"},jke={...Gne,text100:"rgba(0, 0, 0, 1)",text80:"rgba(0, 0, 0, 0.8)",text50:"rgba(0, 0, 0, 0.5)",textInverse100:"rgba(255, 255, 255, 1)",backgroundPrimary:"rgba(244, 244, 244, 1)",backgroundSecondary:"rgba(0, 0, 0, 0.1)",backgroundContrast:"rgba(244, 244, 244, 0.5)",backgroundMuted:"rgba(0, 0, 0, 0.05)",backgroundControl:"rgba(0, 0, 0, 0.25)",backgroundInverse:"rgba(0, 0, 0, 1)",backgroundBackdrop:"rgba(221, 221, 221, 0.9)",backgroundOverlay:"rgba(244, 244, 244, 0.7)",backgroundRaised:"rgba(192, 192, 192, 0.7)",buttonGlass:"rgba(0, 0, 0, 0.15)",buttonEmphasis:"rgba(255, 255, 255, 0.5)",buttonInverse:"rgba(0, 0, 0, 0.8)",borderNormal:"rgba(0, 0, 0, 0.25)",borderFocus:"rgba(0, 0, 0, 0.5)"},Uke={dark:Fke,light:jke},zke={inherit:{fontFamily:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit",fontWeight:"inherit"},xlarge:{fontFamily:"body",fontSize:"xlarge",lineHeight:"9",letterSpacing:"none",fontWeight:"bold"},large:{fontFamily:"body",fontSize:"large",lineHeight:"7",letterSpacing:"normal",fontWeight:"semibold"},medium:{fontFamily:"body",fontSize:"medium",lineHeight:"6",letterSpacing:"normal",fontWeight:"bold"},normal:{fontFamily:"body",fontSize:"normal",lineHeight:"5",letterSpacing:"wide",fontWeight:"normal"},small:{fontFamily:"body",fontSize:"small",lineHeight:"4",letterSpacing:"wide",fontWeight:"medium"},xsmall:{fontFamily:"body",fontSize:"xsmall",lineHeight:"4",letterSpacing:"wide",fontWeight:"bold"},code:{fontFamily:"mono",fontSize:"normal",lineHeight:"5",letterSpacing:"none",fontWeight:"normal"}},_z={sm:0,md:480,lg:769,xl:1281};var Cz={colors:{black:"var(--colors-black)",white:"var(--colors-white)",inherit:"var(--colors-inherit)",transparent:"var(--colors-transparent)",positive:"var(--colors-positive)",negative:"var(--colors-negative)",info:"var(--colors-info)",warning:"var(--colors-warning)",gradientBackdrop:"var(--colors-gradient-backdrop)",gradientPrimary:"var(--colors-gradient-primary)",gradientSecondary:"var(--colors-gradient-secondary)",arbitrumDark:"var(--colors-arbitrum-dark)",arbitrumLight:"var(--colors-arbitrum-light)",avalanceDark:"var(--colors-avalance-dark)",avalanceLight:"var(--colors-avalance-light)",bscDark:"var(--colors-bsc-dark)",bscLight:"var(--colors-bsc-light)",ethereumDark:"var(--colors-ethereum-dark)",ethereumLight:"var(--colors-ethereum-light)",gnosisDark:"var(--colors-gnosis-dark)",gnosisLight:"var(--colors-gnosis-light)",polygonDark:"var(--colors-polygon-dark)",polygonLight:"var(--colors-polygon-light)",text100:"var(--colors-text100)",text80:"var(--colors-text80)",text50:"var(--colors-text50)",textInverse100:"var(--colors-text-inverse100)",backgroundPrimary:"var(--colors-background-primary)",backgroundSecondary:"var(--colors-background-secondary)",backgroundContrast:"var(--colors-background-contrast)",backgroundMuted:"var(--colors-background-muted)",backgroundControl:"var(--colors-background-control)",backgroundInverse:"var(--colors-background-inverse)",backgroundBackdrop:"var(--colors-background-backdrop)",backgroundOverlay:"var(--colors-background-overlay)",backgroundRaised:"var(--colors-background-raised)",buttonGlass:"var(--colors-button-glass)",buttonEmphasis:"var(--colors-button-emphasis)",buttonInverse:"var(--colors-button-inverse)",borderNormal:"var(--colors-border-normal)",borderFocus:"var(--colors-border-focus)"}},ut={blur:{blur:"var(--blur-blur)",none:"var(--blur-none)"},borderWidths:{none:"var(--border-widths-none)",thin:"var(--border-widths-thin)",thick:"var(--border-widths-thick)"},fonts:{inherit:"var(--fonts-inherit)",body:"var(--fonts-body)",mono:"var(--fonts-mono)"},fontSizes:{inherit:"var(--font-sizes-inherit)",xsmall:"var(--font-sizes-xsmall)",small:"var(--font-sizes-small)",normal:"var(--font-sizes-normal)",medium:"var(--font-sizes-medium)",large:"var(--font-sizes-large)",xlarge:"var(--font-sizes-xlarge)"},fontWeights:{inherit:"var(--font-weights-inherit)",normal:"var(--font-weights-normal)",medium:"var(--font-weights-medium)",semibold:"var(--font-weights-semibold)",bold:"var(--font-weights-bold)"},letterSpacings:{inherit:"var(--letter-spacings-inherit)",none:"var(--letter-spacings-none)",normal:"var(--letter-spacings-normal)",wide:"var(--letter-spacings-wide)"},lineHeights:{4:"var(--line-heights-4)",5:"var(--line-heights-5)",6:"var(--line-heights-6)",7:"var(--line-heights-7)",9:"var(--line-heights-9)",inherit:"var(--line-heights-inherit)"},opacity:{0:"var(--opacity-0)",50:"var(--opacity-50)",80:"var(--opacity-80)",100:"var(--opacity-100)"},radii:{none:"var(--radii-none)",xs:"var(--radii-xs)",sm:"var(--radii-sm)",md:"var(--radii-md)",lg:"var(--radii-lg)",circle:"var(--radii-circle)"},space:{0:"var(--space-0)",1:"var(--space-1)",2:"var(--space-2)",3:"var(--space-3)",4:"var(--space-4)",5:"var(--space-5)",6:"var(--space-6)",7:"var(--space-7)",8:"var(--space-8)",9:"var(--space-9)",10:"var(--space-10)",12:"var(--space-12)",14:"var(--space-14)",16:"var(--space-16)","0.25":"var(--space-0_25)","0.5":"var(--space-0_5)","1.5":"var(--space-1_5)"},colors:{black:"var(--colors-black)",white:"var(--colors-white)",inherit:"var(--colors-inherit)",transparent:"var(--colors-transparent)",positive:"var(--colors-positive)",negative:"var(--colors-negative)",info:"var(--colors-info)",warning:"var(--colors-warning)",gradientBackdrop:"var(--colors-gradient-backdrop)",gradientPrimary:"var(--colors-gradient-primary)",gradientSecondary:"var(--colors-gradient-secondary)",arbitrumDark:"var(--colors-arbitrum-dark)",arbitrumLight:"var(--colors-arbitrum-light)",avalanceDark:"var(--colors-avalance-dark)",avalanceLight:"var(--colors-avalance-light)",bscDark:"var(--colors-bsc-dark)",bscLight:"var(--colors-bsc-light)",ethereumDark:"var(--colors-ethereum-dark)",ethereumLight:"var(--colors-ethereum-light)",gnosisDark:"var(--colors-gnosis-dark)",gnosisLight:"var(--colors-gnosis-light)",polygonDark:"var(--colors-polygon-dark)",polygonLight:"var(--colors-polygon-light)",text100:"var(--colors-text100)",text80:"var(--colors-text80)",text50:"var(--colors-text50)",textInverse100:"var(--colors-text-inverse100)",backgroundPrimary:"var(--colors-background-primary)",backgroundSecondary:"var(--colors-background-secondary)",backgroundContrast:"var(--colors-background-contrast)",backgroundMuted:"var(--colors-background-muted)",backgroundControl:"var(--colors-background-control)",backgroundInverse:"var(--colors-background-inverse)",backgroundBackdrop:"var(--colors-background-backdrop)",backgroundOverlay:"var(--colors-background-overlay)",backgroundRaised:"var(--colors-background-raised)",buttonGlass:"var(--colors-button-glass)",buttonEmphasis:"var(--colors-button-emphasis)",buttonInverse:"var(--colors-button-inverse)",borderNormal:"var(--colors-border-normal)",borderFocus:"var(--colors-border-focus)"}};function Hke(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function qke(t){var e=Hke(t,"string");return typeof e=="symbol"?e:String(e)}function Wke(t,e,r){return e=qke(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Sz(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function u9(t){for(var e=1;efunction(){for(var e=arguments.length,r=new Array(e),n=0;nc.styles)),s=Object.keys(i),o=s.filter(c=>"mappings"in i[c]),a=c=>{var l=[],u={},f=u9({},c),d=!1;for(var p of o){var g=c[p];if(g!=null){var v=i[p];d=!0;for(var y of v.mappings)u[y]=g,f[y]==null&&delete f[y]}}var b=d?u9(u9({},u),f):c,w=function(){var P=b[E],_=i[E];try{if(_.mappings)return"continue";if(typeof P=="string"||typeof P=="number")l.push(_.values[P].defaultClass);else if(Array.isArray(P))for(var T=0;Tt,Kke=function(){return Vke(Gke)(...arguments)},Kne=Kke({conditions:{defaultCondition:"sm",conditionNames:["sm","md","lg","xl"],responsiveArray:void 0},styles:{borderWidth:{mappings:["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth"]},borderRadius:{mappings:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderLeftRadius:{mappings:["borderBottomLeftRadius","borderTopLeftRadius"]},borderRightRadius:{mappings:["borderBottomRightRadius","borderTopRightRadius"]},borderTopRadius:{mappings:["borderTopLeftRadius","borderTopRightRadius"]},borderBottomRadius:{mappings:["borderBottomLeftRadius","borderBottomRightRadius"]},margin:{mappings:["marginTop","marginBottom","marginLeft","marginRight"]},marginX:{mappings:["marginLeft","marginRight"]},marginY:{mappings:["marginTop","marginBottom"]},overflow:{mappings:["overflowX","overflowY"]},padding:{mappings:["paddingTop","paddingBottom","paddingLeft","paddingRight"]},paddingX:{mappings:["paddingLeft","paddingRight"]},paddingY:{mappings:["paddingTop","paddingBottom"]},placeItems:{mappings:["justifyContent","alignItems"]},inset:{mappings:["top","bottom","left","right"]},width:{values:{0:{conditions:{sm:"fyvr10",md:"fyvr11",lg:"fyvr12",xl:"fyvr13"},defaultClass:"fyvr10"},1:{conditions:{sm:"fyvr14",md:"fyvr15",lg:"fyvr16",xl:"fyvr17"},defaultClass:"fyvr14"},2:{conditions:{sm:"fyvr18",md:"fyvr19",lg:"fyvr1a",xl:"fyvr1b"},defaultClass:"fyvr18"},3:{conditions:{sm:"fyvr1c",md:"fyvr1d",lg:"fyvr1e",xl:"fyvr1f"},defaultClass:"fyvr1c"},4:{conditions:{sm:"fyvr1g",md:"fyvr1h",lg:"fyvr1i",xl:"fyvr1j"},defaultClass:"fyvr1g"},5:{conditions:{sm:"fyvr1k",md:"fyvr1l",lg:"fyvr1m",xl:"fyvr1n"},defaultClass:"fyvr1k"},6:{conditions:{sm:"fyvr1o",md:"fyvr1p",lg:"fyvr1q",xl:"fyvr1r"},defaultClass:"fyvr1o"},7:{conditions:{sm:"fyvr1s",md:"fyvr1t",lg:"fyvr1u",xl:"fyvr1v"},defaultClass:"fyvr1s"},8:{conditions:{sm:"fyvr1w",md:"fyvr1x",lg:"fyvr1y",xl:"fyvr1z"},defaultClass:"fyvr1w"},9:{conditions:{sm:"fyvr110",md:"fyvr111",lg:"fyvr112",xl:"fyvr113"},defaultClass:"fyvr110"},10:{conditions:{sm:"fyvr114",md:"fyvr115",lg:"fyvr116",xl:"fyvr117"},defaultClass:"fyvr114"},12:{conditions:{sm:"fyvr118",md:"fyvr119",lg:"fyvr11a",xl:"fyvr11b"},defaultClass:"fyvr118"},14:{conditions:{sm:"fyvr11c",md:"fyvr11d",lg:"fyvr11e",xl:"fyvr11f"},defaultClass:"fyvr11c"},16:{conditions:{sm:"fyvr11g",md:"fyvr11h",lg:"fyvr11i",xl:"fyvr11j"},defaultClass:"fyvr11g"},"0.25":{conditions:{sm:"fyvr11k",md:"fyvr11l",lg:"fyvr11m",xl:"fyvr11n"},defaultClass:"fyvr11k"},"0.5":{conditions:{sm:"fyvr11o",md:"fyvr11p",lg:"fyvr11q",xl:"fyvr11r"},defaultClass:"fyvr11o"},"1.5":{conditions:{sm:"fyvr11s",md:"fyvr11t",lg:"fyvr11u",xl:"fyvr11v"},defaultClass:"fyvr11s"},none:{conditions:{sm:"fyvr11w",md:"fyvr11x",lg:"fyvr11y",xl:"fyvr11z"},defaultClass:"fyvr11w"},px:{conditions:{sm:"fyvr120",md:"fyvr121",lg:"fyvr122",xl:"fyvr123"},defaultClass:"fyvr120"},auto:{conditions:{sm:"fyvr124",md:"fyvr125",lg:"fyvr126",xl:"fyvr127"},defaultClass:"fyvr124"},full:{conditions:{sm:"fyvr128",md:"fyvr129",lg:"fyvr12a",xl:"fyvr12b"},defaultClass:"fyvr128"},"1/2":{conditions:{sm:"fyvr12c",md:"fyvr12d",lg:"fyvr12e",xl:"fyvr12f"},defaultClass:"fyvr12c"},"1/3":{conditions:{sm:"fyvr12g",md:"fyvr12h",lg:"fyvr12i",xl:"fyvr12j"},defaultClass:"fyvr12g"},"2/3":{conditions:{sm:"fyvr12k",md:"fyvr12l",lg:"fyvr12m",xl:"fyvr12n"},defaultClass:"fyvr12k"},"1/4":{conditions:{sm:"fyvr12o",md:"fyvr12p",lg:"fyvr12q",xl:"fyvr12r"},defaultClass:"fyvr12o"},"3/4":{conditions:{sm:"fyvr12s",md:"fyvr12t",lg:"fyvr12u",xl:"fyvr12v"},defaultClass:"fyvr12s"},fit:{conditions:{sm:"fyvr12w",md:"fyvr12x",lg:"fyvr12y",xl:"fyvr12z"},defaultClass:"fyvr12w"},max:{conditions:{sm:"fyvr130",md:"fyvr131",lg:"fyvr132",xl:"fyvr133"},defaultClass:"fyvr130"},min:{conditions:{sm:"fyvr134",md:"fyvr135",lg:"fyvr136",xl:"fyvr137"},defaultClass:"fyvr134"},vw:{conditions:{sm:"fyvr138",md:"fyvr139",lg:"fyvr13a",xl:"fyvr13b"},defaultClass:"fyvr138"},vh:{conditions:{sm:"fyvr13c",md:"fyvr13d",lg:"fyvr13e",xl:"fyvr13f"},defaultClass:"fyvr13c"}}},height:{values:{0:{conditions:{sm:"fyvr13g",md:"fyvr13h",lg:"fyvr13i",xl:"fyvr13j"},defaultClass:"fyvr13g"},1:{conditions:{sm:"fyvr13k",md:"fyvr13l",lg:"fyvr13m",xl:"fyvr13n"},defaultClass:"fyvr13k"},2:{conditions:{sm:"fyvr13o",md:"fyvr13p",lg:"fyvr13q",xl:"fyvr13r"},defaultClass:"fyvr13o"},3:{conditions:{sm:"fyvr13s",md:"fyvr13t",lg:"fyvr13u",xl:"fyvr13v"},defaultClass:"fyvr13s"},4:{conditions:{sm:"fyvr13w",md:"fyvr13x",lg:"fyvr13y",xl:"fyvr13z"},defaultClass:"fyvr13w"},5:{conditions:{sm:"fyvr140",md:"fyvr141",lg:"fyvr142",xl:"fyvr143"},defaultClass:"fyvr140"},6:{conditions:{sm:"fyvr144",md:"fyvr145",lg:"fyvr146",xl:"fyvr147"},defaultClass:"fyvr144"},7:{conditions:{sm:"fyvr148",md:"fyvr149",lg:"fyvr14a",xl:"fyvr14b"},defaultClass:"fyvr148"},8:{conditions:{sm:"fyvr14c",md:"fyvr14d",lg:"fyvr14e",xl:"fyvr14f"},defaultClass:"fyvr14c"},9:{conditions:{sm:"fyvr14g",md:"fyvr14h",lg:"fyvr14i",xl:"fyvr14j"},defaultClass:"fyvr14g"},10:{conditions:{sm:"fyvr14k",md:"fyvr14l",lg:"fyvr14m",xl:"fyvr14n"},defaultClass:"fyvr14k"},12:{conditions:{sm:"fyvr14o",md:"fyvr14p",lg:"fyvr14q",xl:"fyvr14r"},defaultClass:"fyvr14o"},14:{conditions:{sm:"fyvr14s",md:"fyvr14t",lg:"fyvr14u",xl:"fyvr14v"},defaultClass:"fyvr14s"},16:{conditions:{sm:"fyvr14w",md:"fyvr14x",lg:"fyvr14y",xl:"fyvr14z"},defaultClass:"fyvr14w"},"0.25":{conditions:{sm:"fyvr150",md:"fyvr151",lg:"fyvr152",xl:"fyvr153"},defaultClass:"fyvr150"},"0.5":{conditions:{sm:"fyvr154",md:"fyvr155",lg:"fyvr156",xl:"fyvr157"},defaultClass:"fyvr154"},"1.5":{conditions:{sm:"fyvr158",md:"fyvr159",lg:"fyvr15a",xl:"fyvr15b"},defaultClass:"fyvr158"},none:{conditions:{sm:"fyvr15c",md:"fyvr15d",lg:"fyvr15e",xl:"fyvr15f"},defaultClass:"fyvr15c"},px:{conditions:{sm:"fyvr15g",md:"fyvr15h",lg:"fyvr15i",xl:"fyvr15j"},defaultClass:"fyvr15g"},auto:{conditions:{sm:"fyvr15k",md:"fyvr15l",lg:"fyvr15m",xl:"fyvr15n"},defaultClass:"fyvr15k"},full:{conditions:{sm:"fyvr15o",md:"fyvr15p",lg:"fyvr15q",xl:"fyvr15r"},defaultClass:"fyvr15o"},"1/2":{conditions:{sm:"fyvr15s",md:"fyvr15t",lg:"fyvr15u",xl:"fyvr15v"},defaultClass:"fyvr15s"},"1/3":{conditions:{sm:"fyvr15w",md:"fyvr15x",lg:"fyvr15y",xl:"fyvr15z"},defaultClass:"fyvr15w"},"2/3":{conditions:{sm:"fyvr160",md:"fyvr161",lg:"fyvr162",xl:"fyvr163"},defaultClass:"fyvr160"},"1/4":{conditions:{sm:"fyvr164",md:"fyvr165",lg:"fyvr166",xl:"fyvr167"},defaultClass:"fyvr164"},"3/4":{conditions:{sm:"fyvr168",md:"fyvr169",lg:"fyvr16a",xl:"fyvr16b"},defaultClass:"fyvr168"},fit:{conditions:{sm:"fyvr16c",md:"fyvr16d",lg:"fyvr16e",xl:"fyvr16f"},defaultClass:"fyvr16c"},max:{conditions:{sm:"fyvr16g",md:"fyvr16h",lg:"fyvr16i",xl:"fyvr16j"},defaultClass:"fyvr16g"},min:{conditions:{sm:"fyvr16k",md:"fyvr16l",lg:"fyvr16m",xl:"fyvr16n"},defaultClass:"fyvr16k"},vw:{conditions:{sm:"fyvr16o",md:"fyvr16p",lg:"fyvr16q",xl:"fyvr16r"},defaultClass:"fyvr16o"},vh:{conditions:{sm:"fyvr16s",md:"fyvr16t",lg:"fyvr16u",xl:"fyvr16v"},defaultClass:"fyvr16s"}}},maxWidth:{values:{0:{conditions:{sm:"fyvr16w",md:"fyvr16x",lg:"fyvr16y",xl:"fyvr16z"},defaultClass:"fyvr16w"},1:{conditions:{sm:"fyvr170",md:"fyvr171",lg:"fyvr172",xl:"fyvr173"},defaultClass:"fyvr170"},2:{conditions:{sm:"fyvr174",md:"fyvr175",lg:"fyvr176",xl:"fyvr177"},defaultClass:"fyvr174"},3:{conditions:{sm:"fyvr178",md:"fyvr179",lg:"fyvr17a",xl:"fyvr17b"},defaultClass:"fyvr178"},4:{conditions:{sm:"fyvr17c",md:"fyvr17d",lg:"fyvr17e",xl:"fyvr17f"},defaultClass:"fyvr17c"},5:{conditions:{sm:"fyvr17g",md:"fyvr17h",lg:"fyvr17i",xl:"fyvr17j"},defaultClass:"fyvr17g"},6:{conditions:{sm:"fyvr17k",md:"fyvr17l",lg:"fyvr17m",xl:"fyvr17n"},defaultClass:"fyvr17k"},7:{conditions:{sm:"fyvr17o",md:"fyvr17p",lg:"fyvr17q",xl:"fyvr17r"},defaultClass:"fyvr17o"},8:{conditions:{sm:"fyvr17s",md:"fyvr17t",lg:"fyvr17u",xl:"fyvr17v"},defaultClass:"fyvr17s"},9:{conditions:{sm:"fyvr17w",md:"fyvr17x",lg:"fyvr17y",xl:"fyvr17z"},defaultClass:"fyvr17w"},10:{conditions:{sm:"fyvr180",md:"fyvr181",lg:"fyvr182",xl:"fyvr183"},defaultClass:"fyvr180"},12:{conditions:{sm:"fyvr184",md:"fyvr185",lg:"fyvr186",xl:"fyvr187"},defaultClass:"fyvr184"},14:{conditions:{sm:"fyvr188",md:"fyvr189",lg:"fyvr18a",xl:"fyvr18b"},defaultClass:"fyvr188"},16:{conditions:{sm:"fyvr18c",md:"fyvr18d",lg:"fyvr18e",xl:"fyvr18f"},defaultClass:"fyvr18c"},"0.25":{conditions:{sm:"fyvr18g",md:"fyvr18h",lg:"fyvr18i",xl:"fyvr18j"},defaultClass:"fyvr18g"},"0.5":{conditions:{sm:"fyvr18k",md:"fyvr18l",lg:"fyvr18m",xl:"fyvr18n"},defaultClass:"fyvr18k"},"1.5":{conditions:{sm:"fyvr18o",md:"fyvr18p",lg:"fyvr18q",xl:"fyvr18r"},defaultClass:"fyvr18o"},none:{conditions:{sm:"fyvr18s",md:"fyvr18t",lg:"fyvr18u",xl:"fyvr18v"},defaultClass:"fyvr18s"},px:{conditions:{sm:"fyvr18w",md:"fyvr18x",lg:"fyvr18y",xl:"fyvr18z"},defaultClass:"fyvr18w"},auto:{conditions:{sm:"fyvr190",md:"fyvr191",lg:"fyvr192",xl:"fyvr193"},defaultClass:"fyvr190"},full:{conditions:{sm:"fyvr194",md:"fyvr195",lg:"fyvr196",xl:"fyvr197"},defaultClass:"fyvr194"},"1/2":{conditions:{sm:"fyvr198",md:"fyvr199",lg:"fyvr19a",xl:"fyvr19b"},defaultClass:"fyvr198"},"1/3":{conditions:{sm:"fyvr19c",md:"fyvr19d",lg:"fyvr19e",xl:"fyvr19f"},defaultClass:"fyvr19c"},"2/3":{conditions:{sm:"fyvr19g",md:"fyvr19h",lg:"fyvr19i",xl:"fyvr19j"},defaultClass:"fyvr19g"},"1/4":{conditions:{sm:"fyvr19k",md:"fyvr19l",lg:"fyvr19m",xl:"fyvr19n"},defaultClass:"fyvr19k"},"3/4":{conditions:{sm:"fyvr19o",md:"fyvr19p",lg:"fyvr19q",xl:"fyvr19r"},defaultClass:"fyvr19o"},fit:{conditions:{sm:"fyvr19s",md:"fyvr19t",lg:"fyvr19u",xl:"fyvr19v"},defaultClass:"fyvr19s"},max:{conditions:{sm:"fyvr19w",md:"fyvr19x",lg:"fyvr19y",xl:"fyvr19z"},defaultClass:"fyvr19w"},min:{conditions:{sm:"fyvr1a0",md:"fyvr1a1",lg:"fyvr1a2",xl:"fyvr1a3"},defaultClass:"fyvr1a0"},vw:{conditions:{sm:"fyvr1a4",md:"fyvr1a5",lg:"fyvr1a6",xl:"fyvr1a7"},defaultClass:"fyvr1a4"},vh:{conditions:{sm:"fyvr1a8",md:"fyvr1a9",lg:"fyvr1aa",xl:"fyvr1ab"},defaultClass:"fyvr1a8"}}},maxHeight:{values:{0:{conditions:{sm:"fyvr1ac",md:"fyvr1ad",lg:"fyvr1ae",xl:"fyvr1af"},defaultClass:"fyvr1ac"},1:{conditions:{sm:"fyvr1ag",md:"fyvr1ah",lg:"fyvr1ai",xl:"fyvr1aj"},defaultClass:"fyvr1ag"},2:{conditions:{sm:"fyvr1ak",md:"fyvr1al",lg:"fyvr1am",xl:"fyvr1an"},defaultClass:"fyvr1ak"},3:{conditions:{sm:"fyvr1ao",md:"fyvr1ap",lg:"fyvr1aq",xl:"fyvr1ar"},defaultClass:"fyvr1ao"},4:{conditions:{sm:"fyvr1as",md:"fyvr1at",lg:"fyvr1au",xl:"fyvr1av"},defaultClass:"fyvr1as"},5:{conditions:{sm:"fyvr1aw",md:"fyvr1ax",lg:"fyvr1ay",xl:"fyvr1az"},defaultClass:"fyvr1aw"},6:{conditions:{sm:"fyvr1b0",md:"fyvr1b1",lg:"fyvr1b2",xl:"fyvr1b3"},defaultClass:"fyvr1b0"},7:{conditions:{sm:"fyvr1b4",md:"fyvr1b5",lg:"fyvr1b6",xl:"fyvr1b7"},defaultClass:"fyvr1b4"},8:{conditions:{sm:"fyvr1b8",md:"fyvr1b9",lg:"fyvr1ba",xl:"fyvr1bb"},defaultClass:"fyvr1b8"},9:{conditions:{sm:"fyvr1bc",md:"fyvr1bd",lg:"fyvr1be",xl:"fyvr1bf"},defaultClass:"fyvr1bc"},10:{conditions:{sm:"fyvr1bg",md:"fyvr1bh",lg:"fyvr1bi",xl:"fyvr1bj"},defaultClass:"fyvr1bg"},12:{conditions:{sm:"fyvr1bk",md:"fyvr1bl",lg:"fyvr1bm",xl:"fyvr1bn"},defaultClass:"fyvr1bk"},14:{conditions:{sm:"fyvr1bo",md:"fyvr1bp",lg:"fyvr1bq",xl:"fyvr1br"},defaultClass:"fyvr1bo"},16:{conditions:{sm:"fyvr1bs",md:"fyvr1bt",lg:"fyvr1bu",xl:"fyvr1bv"},defaultClass:"fyvr1bs"},"0.25":{conditions:{sm:"fyvr1bw",md:"fyvr1bx",lg:"fyvr1by",xl:"fyvr1bz"},defaultClass:"fyvr1bw"},"0.5":{conditions:{sm:"fyvr1c0",md:"fyvr1c1",lg:"fyvr1c2",xl:"fyvr1c3"},defaultClass:"fyvr1c0"},"1.5":{conditions:{sm:"fyvr1c4",md:"fyvr1c5",lg:"fyvr1c6",xl:"fyvr1c7"},defaultClass:"fyvr1c4"},none:{conditions:{sm:"fyvr1c8",md:"fyvr1c9",lg:"fyvr1ca",xl:"fyvr1cb"},defaultClass:"fyvr1c8"},px:{conditions:{sm:"fyvr1cc",md:"fyvr1cd",lg:"fyvr1ce",xl:"fyvr1cf"},defaultClass:"fyvr1cc"},auto:{conditions:{sm:"fyvr1cg",md:"fyvr1ch",lg:"fyvr1ci",xl:"fyvr1cj"},defaultClass:"fyvr1cg"},full:{conditions:{sm:"fyvr1ck",md:"fyvr1cl",lg:"fyvr1cm",xl:"fyvr1cn"},defaultClass:"fyvr1ck"},"1/2":{conditions:{sm:"fyvr1co",md:"fyvr1cp",lg:"fyvr1cq",xl:"fyvr1cr"},defaultClass:"fyvr1co"},"1/3":{conditions:{sm:"fyvr1cs",md:"fyvr1ct",lg:"fyvr1cu",xl:"fyvr1cv"},defaultClass:"fyvr1cs"},"2/3":{conditions:{sm:"fyvr1cw",md:"fyvr1cx",lg:"fyvr1cy",xl:"fyvr1cz"},defaultClass:"fyvr1cw"},"1/4":{conditions:{sm:"fyvr1d0",md:"fyvr1d1",lg:"fyvr1d2",xl:"fyvr1d3"},defaultClass:"fyvr1d0"},"3/4":{conditions:{sm:"fyvr1d4",md:"fyvr1d5",lg:"fyvr1d6",xl:"fyvr1d7"},defaultClass:"fyvr1d4"},fit:{conditions:{sm:"fyvr1d8",md:"fyvr1d9",lg:"fyvr1da",xl:"fyvr1db"},defaultClass:"fyvr1d8"},max:{conditions:{sm:"fyvr1dc",md:"fyvr1dd",lg:"fyvr1de",xl:"fyvr1df"},defaultClass:"fyvr1dc"},min:{conditions:{sm:"fyvr1dg",md:"fyvr1dh",lg:"fyvr1di",xl:"fyvr1dj"},defaultClass:"fyvr1dg"},vw:{conditions:{sm:"fyvr1dk",md:"fyvr1dl",lg:"fyvr1dm",xl:"fyvr1dn"},defaultClass:"fyvr1dk"},vh:{conditions:{sm:"fyvr1do",md:"fyvr1dp",lg:"fyvr1dq",xl:"fyvr1dr"},defaultClass:"fyvr1do"}}},minWidth:{values:{0:{conditions:{sm:"fyvr1ds",md:"fyvr1dt",lg:"fyvr1du",xl:"fyvr1dv"},defaultClass:"fyvr1ds"},1:{conditions:{sm:"fyvr1dw",md:"fyvr1dx",lg:"fyvr1dy",xl:"fyvr1dz"},defaultClass:"fyvr1dw"},2:{conditions:{sm:"fyvr1e0",md:"fyvr1e1",lg:"fyvr1e2",xl:"fyvr1e3"},defaultClass:"fyvr1e0"},3:{conditions:{sm:"fyvr1e4",md:"fyvr1e5",lg:"fyvr1e6",xl:"fyvr1e7"},defaultClass:"fyvr1e4"},4:{conditions:{sm:"fyvr1e8",md:"fyvr1e9",lg:"fyvr1ea",xl:"fyvr1eb"},defaultClass:"fyvr1e8"},5:{conditions:{sm:"fyvr1ec",md:"fyvr1ed",lg:"fyvr1ee",xl:"fyvr1ef"},defaultClass:"fyvr1ec"},6:{conditions:{sm:"fyvr1eg",md:"fyvr1eh",lg:"fyvr1ei",xl:"fyvr1ej"},defaultClass:"fyvr1eg"},7:{conditions:{sm:"fyvr1ek",md:"fyvr1el",lg:"fyvr1em",xl:"fyvr1en"},defaultClass:"fyvr1ek"},8:{conditions:{sm:"fyvr1eo",md:"fyvr1ep",lg:"fyvr1eq",xl:"fyvr1er"},defaultClass:"fyvr1eo"},9:{conditions:{sm:"fyvr1es",md:"fyvr1et",lg:"fyvr1eu",xl:"fyvr1ev"},defaultClass:"fyvr1es"},10:{conditions:{sm:"fyvr1ew",md:"fyvr1ex",lg:"fyvr1ey",xl:"fyvr1ez"},defaultClass:"fyvr1ew"},12:{conditions:{sm:"fyvr1f0",md:"fyvr1f1",lg:"fyvr1f2",xl:"fyvr1f3"},defaultClass:"fyvr1f0"},14:{conditions:{sm:"fyvr1f4",md:"fyvr1f5",lg:"fyvr1f6",xl:"fyvr1f7"},defaultClass:"fyvr1f4"},16:{conditions:{sm:"fyvr1f8",md:"fyvr1f9",lg:"fyvr1fa",xl:"fyvr1fb"},defaultClass:"fyvr1f8"},"0.25":{conditions:{sm:"fyvr1fc",md:"fyvr1fd",lg:"fyvr1fe",xl:"fyvr1ff"},defaultClass:"fyvr1fc"},"0.5":{conditions:{sm:"fyvr1fg",md:"fyvr1fh",lg:"fyvr1fi",xl:"fyvr1fj"},defaultClass:"fyvr1fg"},"1.5":{conditions:{sm:"fyvr1fk",md:"fyvr1fl",lg:"fyvr1fm",xl:"fyvr1fn"},defaultClass:"fyvr1fk"},none:{conditions:{sm:"fyvr1fo",md:"fyvr1fp",lg:"fyvr1fq",xl:"fyvr1fr"},defaultClass:"fyvr1fo"},px:{conditions:{sm:"fyvr1fs",md:"fyvr1ft",lg:"fyvr1fu",xl:"fyvr1fv"},defaultClass:"fyvr1fs"},auto:{conditions:{sm:"fyvr1fw",md:"fyvr1fx",lg:"fyvr1fy",xl:"fyvr1fz"},defaultClass:"fyvr1fw"},full:{conditions:{sm:"fyvr1g0",md:"fyvr1g1",lg:"fyvr1g2",xl:"fyvr1g3"},defaultClass:"fyvr1g0"},"1/2":{conditions:{sm:"fyvr1g4",md:"fyvr1g5",lg:"fyvr1g6",xl:"fyvr1g7"},defaultClass:"fyvr1g4"},"1/3":{conditions:{sm:"fyvr1g8",md:"fyvr1g9",lg:"fyvr1ga",xl:"fyvr1gb"},defaultClass:"fyvr1g8"},"2/3":{conditions:{sm:"fyvr1gc",md:"fyvr1gd",lg:"fyvr1ge",xl:"fyvr1gf"},defaultClass:"fyvr1gc"},"1/4":{conditions:{sm:"fyvr1gg",md:"fyvr1gh",lg:"fyvr1gi",xl:"fyvr1gj"},defaultClass:"fyvr1gg"},"3/4":{conditions:{sm:"fyvr1gk",md:"fyvr1gl",lg:"fyvr1gm",xl:"fyvr1gn"},defaultClass:"fyvr1gk"},fit:{conditions:{sm:"fyvr1go",md:"fyvr1gp",lg:"fyvr1gq",xl:"fyvr1gr"},defaultClass:"fyvr1go"},max:{conditions:{sm:"fyvr1gs",md:"fyvr1gt",lg:"fyvr1gu",xl:"fyvr1gv"},defaultClass:"fyvr1gs"},min:{conditions:{sm:"fyvr1gw",md:"fyvr1gx",lg:"fyvr1gy",xl:"fyvr1gz"},defaultClass:"fyvr1gw"},vw:{conditions:{sm:"fyvr1h0",md:"fyvr1h1",lg:"fyvr1h2",xl:"fyvr1h3"},defaultClass:"fyvr1h0"},vh:{conditions:{sm:"fyvr1h4",md:"fyvr1h5",lg:"fyvr1h6",xl:"fyvr1h7"},defaultClass:"fyvr1h4"}}},minHeight:{values:{0:{conditions:{sm:"fyvr1h8",md:"fyvr1h9",lg:"fyvr1ha",xl:"fyvr1hb"},defaultClass:"fyvr1h8"},1:{conditions:{sm:"fyvr1hc",md:"fyvr1hd",lg:"fyvr1he",xl:"fyvr1hf"},defaultClass:"fyvr1hc"},2:{conditions:{sm:"fyvr1hg",md:"fyvr1hh",lg:"fyvr1hi",xl:"fyvr1hj"},defaultClass:"fyvr1hg"},3:{conditions:{sm:"fyvr1hk",md:"fyvr1hl",lg:"fyvr1hm",xl:"fyvr1hn"},defaultClass:"fyvr1hk"},4:{conditions:{sm:"fyvr1ho",md:"fyvr1hp",lg:"fyvr1hq",xl:"fyvr1hr"},defaultClass:"fyvr1ho"},5:{conditions:{sm:"fyvr1hs",md:"fyvr1ht",lg:"fyvr1hu",xl:"fyvr1hv"},defaultClass:"fyvr1hs"},6:{conditions:{sm:"fyvr1hw",md:"fyvr1hx",lg:"fyvr1hy",xl:"fyvr1hz"},defaultClass:"fyvr1hw"},7:{conditions:{sm:"fyvr1i0",md:"fyvr1i1",lg:"fyvr1i2",xl:"fyvr1i3"},defaultClass:"fyvr1i0"},8:{conditions:{sm:"fyvr1i4",md:"fyvr1i5",lg:"fyvr1i6",xl:"fyvr1i7"},defaultClass:"fyvr1i4"},9:{conditions:{sm:"fyvr1i8",md:"fyvr1i9",lg:"fyvr1ia",xl:"fyvr1ib"},defaultClass:"fyvr1i8"},10:{conditions:{sm:"fyvr1ic",md:"fyvr1id",lg:"fyvr1ie",xl:"fyvr1if"},defaultClass:"fyvr1ic"},12:{conditions:{sm:"fyvr1ig",md:"fyvr1ih",lg:"fyvr1ii",xl:"fyvr1ij"},defaultClass:"fyvr1ig"},14:{conditions:{sm:"fyvr1ik",md:"fyvr1il",lg:"fyvr1im",xl:"fyvr1in"},defaultClass:"fyvr1ik"},16:{conditions:{sm:"fyvr1io",md:"fyvr1ip",lg:"fyvr1iq",xl:"fyvr1ir"},defaultClass:"fyvr1io"},"0.25":{conditions:{sm:"fyvr1is",md:"fyvr1it",lg:"fyvr1iu",xl:"fyvr1iv"},defaultClass:"fyvr1is"},"0.5":{conditions:{sm:"fyvr1iw",md:"fyvr1ix",lg:"fyvr1iy",xl:"fyvr1iz"},defaultClass:"fyvr1iw"},"1.5":{conditions:{sm:"fyvr1j0",md:"fyvr1j1",lg:"fyvr1j2",xl:"fyvr1j3"},defaultClass:"fyvr1j0"},none:{conditions:{sm:"fyvr1j4",md:"fyvr1j5",lg:"fyvr1j6",xl:"fyvr1j7"},defaultClass:"fyvr1j4"},px:{conditions:{sm:"fyvr1j8",md:"fyvr1j9",lg:"fyvr1ja",xl:"fyvr1jb"},defaultClass:"fyvr1j8"},auto:{conditions:{sm:"fyvr1jc",md:"fyvr1jd",lg:"fyvr1je",xl:"fyvr1jf"},defaultClass:"fyvr1jc"},full:{conditions:{sm:"fyvr1jg",md:"fyvr1jh",lg:"fyvr1ji",xl:"fyvr1jj"},defaultClass:"fyvr1jg"},"1/2":{conditions:{sm:"fyvr1jk",md:"fyvr1jl",lg:"fyvr1jm",xl:"fyvr1jn"},defaultClass:"fyvr1jk"},"1/3":{conditions:{sm:"fyvr1jo",md:"fyvr1jp",lg:"fyvr1jq",xl:"fyvr1jr"},defaultClass:"fyvr1jo"},"2/3":{conditions:{sm:"fyvr1js",md:"fyvr1jt",lg:"fyvr1ju",xl:"fyvr1jv"},defaultClass:"fyvr1js"},"1/4":{conditions:{sm:"fyvr1jw",md:"fyvr1jx",lg:"fyvr1jy",xl:"fyvr1jz"},defaultClass:"fyvr1jw"},"3/4":{conditions:{sm:"fyvr1k0",md:"fyvr1k1",lg:"fyvr1k2",xl:"fyvr1k3"},defaultClass:"fyvr1k0"},fit:{conditions:{sm:"fyvr1k4",md:"fyvr1k5",lg:"fyvr1k6",xl:"fyvr1k7"},defaultClass:"fyvr1k4"},max:{conditions:{sm:"fyvr1k8",md:"fyvr1k9",lg:"fyvr1ka",xl:"fyvr1kb"},defaultClass:"fyvr1k8"},min:{conditions:{sm:"fyvr1kc",md:"fyvr1kd",lg:"fyvr1ke",xl:"fyvr1kf"},defaultClass:"fyvr1kc"},vw:{conditions:{sm:"fyvr1kg",md:"fyvr1kh",lg:"fyvr1ki",xl:"fyvr1kj"},defaultClass:"fyvr1kg"},vh:{conditions:{sm:"fyvr1kk",md:"fyvr1kl",lg:"fyvr1km",xl:"fyvr1kn"},defaultClass:"fyvr1kk"}}},top:{values:{0:{conditions:{sm:"fyvr1ko",md:"fyvr1kp",lg:"fyvr1kq",xl:"fyvr1kr"},defaultClass:"fyvr1ko"},1:{conditions:{sm:"fyvr1ks",md:"fyvr1kt",lg:"fyvr1ku",xl:"fyvr1kv"},defaultClass:"fyvr1ks"},2:{conditions:{sm:"fyvr1kw",md:"fyvr1kx",lg:"fyvr1ky",xl:"fyvr1kz"},defaultClass:"fyvr1kw"},3:{conditions:{sm:"fyvr1l0",md:"fyvr1l1",lg:"fyvr1l2",xl:"fyvr1l3"},defaultClass:"fyvr1l0"},4:{conditions:{sm:"fyvr1l4",md:"fyvr1l5",lg:"fyvr1l6",xl:"fyvr1l7"},defaultClass:"fyvr1l4"},5:{conditions:{sm:"fyvr1l8",md:"fyvr1l9",lg:"fyvr1la",xl:"fyvr1lb"},defaultClass:"fyvr1l8"},6:{conditions:{sm:"fyvr1lc",md:"fyvr1ld",lg:"fyvr1le",xl:"fyvr1lf"},defaultClass:"fyvr1lc"},7:{conditions:{sm:"fyvr1lg",md:"fyvr1lh",lg:"fyvr1li",xl:"fyvr1lj"},defaultClass:"fyvr1lg"},8:{conditions:{sm:"fyvr1lk",md:"fyvr1ll",lg:"fyvr1lm",xl:"fyvr1ln"},defaultClass:"fyvr1lk"},9:{conditions:{sm:"fyvr1lo",md:"fyvr1lp",lg:"fyvr1lq",xl:"fyvr1lr"},defaultClass:"fyvr1lo"},10:{conditions:{sm:"fyvr1ls",md:"fyvr1lt",lg:"fyvr1lu",xl:"fyvr1lv"},defaultClass:"fyvr1ls"},12:{conditions:{sm:"fyvr1lw",md:"fyvr1lx",lg:"fyvr1ly",xl:"fyvr1lz"},defaultClass:"fyvr1lw"},14:{conditions:{sm:"fyvr1m0",md:"fyvr1m1",lg:"fyvr1m2",xl:"fyvr1m3"},defaultClass:"fyvr1m0"},16:{conditions:{sm:"fyvr1m4",md:"fyvr1m5",lg:"fyvr1m6",xl:"fyvr1m7"},defaultClass:"fyvr1m4"},"0.25":{conditions:{sm:"fyvr1m8",md:"fyvr1m9",lg:"fyvr1ma",xl:"fyvr1mb"},defaultClass:"fyvr1m8"},"0.5":{conditions:{sm:"fyvr1mc",md:"fyvr1md",lg:"fyvr1me",xl:"fyvr1mf"},defaultClass:"fyvr1mc"},"1.5":{conditions:{sm:"fyvr1mg",md:"fyvr1mh",lg:"fyvr1mi",xl:"fyvr1mj"},defaultClass:"fyvr1mg"},auto:{conditions:{sm:"fyvr1mk",md:"fyvr1ml",lg:"fyvr1mm",xl:"fyvr1mn"},defaultClass:"fyvr1mk"}}},bottom:{values:{0:{conditions:{sm:"fyvr1mo",md:"fyvr1mp",lg:"fyvr1mq",xl:"fyvr1mr"},defaultClass:"fyvr1mo"},1:{conditions:{sm:"fyvr1ms",md:"fyvr1mt",lg:"fyvr1mu",xl:"fyvr1mv"},defaultClass:"fyvr1ms"},2:{conditions:{sm:"fyvr1mw",md:"fyvr1mx",lg:"fyvr1my",xl:"fyvr1mz"},defaultClass:"fyvr1mw"},3:{conditions:{sm:"fyvr1n0",md:"fyvr1n1",lg:"fyvr1n2",xl:"fyvr1n3"},defaultClass:"fyvr1n0"},4:{conditions:{sm:"fyvr1n4",md:"fyvr1n5",lg:"fyvr1n6",xl:"fyvr1n7"},defaultClass:"fyvr1n4"},5:{conditions:{sm:"fyvr1n8",md:"fyvr1n9",lg:"fyvr1na",xl:"fyvr1nb"},defaultClass:"fyvr1n8"},6:{conditions:{sm:"fyvr1nc",md:"fyvr1nd",lg:"fyvr1ne",xl:"fyvr1nf"},defaultClass:"fyvr1nc"},7:{conditions:{sm:"fyvr1ng",md:"fyvr1nh",lg:"fyvr1ni",xl:"fyvr1nj"},defaultClass:"fyvr1ng"},8:{conditions:{sm:"fyvr1nk",md:"fyvr1nl",lg:"fyvr1nm",xl:"fyvr1nn"},defaultClass:"fyvr1nk"},9:{conditions:{sm:"fyvr1no",md:"fyvr1np",lg:"fyvr1nq",xl:"fyvr1nr"},defaultClass:"fyvr1no"},10:{conditions:{sm:"fyvr1ns",md:"fyvr1nt",lg:"fyvr1nu",xl:"fyvr1nv"},defaultClass:"fyvr1ns"},12:{conditions:{sm:"fyvr1nw",md:"fyvr1nx",lg:"fyvr1ny",xl:"fyvr1nz"},defaultClass:"fyvr1nw"},14:{conditions:{sm:"fyvr1o0",md:"fyvr1o1",lg:"fyvr1o2",xl:"fyvr1o3"},defaultClass:"fyvr1o0"},16:{conditions:{sm:"fyvr1o4",md:"fyvr1o5",lg:"fyvr1o6",xl:"fyvr1o7"},defaultClass:"fyvr1o4"},"0.25":{conditions:{sm:"fyvr1o8",md:"fyvr1o9",lg:"fyvr1oa",xl:"fyvr1ob"},defaultClass:"fyvr1o8"},"0.5":{conditions:{sm:"fyvr1oc",md:"fyvr1od",lg:"fyvr1oe",xl:"fyvr1of"},defaultClass:"fyvr1oc"},"1.5":{conditions:{sm:"fyvr1og",md:"fyvr1oh",lg:"fyvr1oi",xl:"fyvr1oj"},defaultClass:"fyvr1og"},auto:{conditions:{sm:"fyvr1ok",md:"fyvr1ol",lg:"fyvr1om",xl:"fyvr1on"},defaultClass:"fyvr1ok"}}},left:{values:{0:{conditions:{sm:"fyvr1oo",md:"fyvr1op",lg:"fyvr1oq",xl:"fyvr1or"},defaultClass:"fyvr1oo"},1:{conditions:{sm:"fyvr1os",md:"fyvr1ot",lg:"fyvr1ou",xl:"fyvr1ov"},defaultClass:"fyvr1os"},2:{conditions:{sm:"fyvr1ow",md:"fyvr1ox",lg:"fyvr1oy",xl:"fyvr1oz"},defaultClass:"fyvr1ow"},3:{conditions:{sm:"fyvr1p0",md:"fyvr1p1",lg:"fyvr1p2",xl:"fyvr1p3"},defaultClass:"fyvr1p0"},4:{conditions:{sm:"fyvr1p4",md:"fyvr1p5",lg:"fyvr1p6",xl:"fyvr1p7"},defaultClass:"fyvr1p4"},5:{conditions:{sm:"fyvr1p8",md:"fyvr1p9",lg:"fyvr1pa",xl:"fyvr1pb"},defaultClass:"fyvr1p8"},6:{conditions:{sm:"fyvr1pc",md:"fyvr1pd",lg:"fyvr1pe",xl:"fyvr1pf"},defaultClass:"fyvr1pc"},7:{conditions:{sm:"fyvr1pg",md:"fyvr1ph",lg:"fyvr1pi",xl:"fyvr1pj"},defaultClass:"fyvr1pg"},8:{conditions:{sm:"fyvr1pk",md:"fyvr1pl",lg:"fyvr1pm",xl:"fyvr1pn"},defaultClass:"fyvr1pk"},9:{conditions:{sm:"fyvr1po",md:"fyvr1pp",lg:"fyvr1pq",xl:"fyvr1pr"},defaultClass:"fyvr1po"},10:{conditions:{sm:"fyvr1ps",md:"fyvr1pt",lg:"fyvr1pu",xl:"fyvr1pv"},defaultClass:"fyvr1ps"},12:{conditions:{sm:"fyvr1pw",md:"fyvr1px",lg:"fyvr1py",xl:"fyvr1pz"},defaultClass:"fyvr1pw"},14:{conditions:{sm:"fyvr1q0",md:"fyvr1q1",lg:"fyvr1q2",xl:"fyvr1q3"},defaultClass:"fyvr1q0"},16:{conditions:{sm:"fyvr1q4",md:"fyvr1q5",lg:"fyvr1q6",xl:"fyvr1q7"},defaultClass:"fyvr1q4"},"0.25":{conditions:{sm:"fyvr1q8",md:"fyvr1q9",lg:"fyvr1qa",xl:"fyvr1qb"},defaultClass:"fyvr1q8"},"0.5":{conditions:{sm:"fyvr1qc",md:"fyvr1qd",lg:"fyvr1qe",xl:"fyvr1qf"},defaultClass:"fyvr1qc"},"1.5":{conditions:{sm:"fyvr1qg",md:"fyvr1qh",lg:"fyvr1qi",xl:"fyvr1qj"},defaultClass:"fyvr1qg"},auto:{conditions:{sm:"fyvr1qk",md:"fyvr1ql",lg:"fyvr1qm",xl:"fyvr1qn"},defaultClass:"fyvr1qk"}}},right:{values:{0:{conditions:{sm:"fyvr1qo",md:"fyvr1qp",lg:"fyvr1qq",xl:"fyvr1qr"},defaultClass:"fyvr1qo"},1:{conditions:{sm:"fyvr1qs",md:"fyvr1qt",lg:"fyvr1qu",xl:"fyvr1qv"},defaultClass:"fyvr1qs"},2:{conditions:{sm:"fyvr1qw",md:"fyvr1qx",lg:"fyvr1qy",xl:"fyvr1qz"},defaultClass:"fyvr1qw"},3:{conditions:{sm:"fyvr1r0",md:"fyvr1r1",lg:"fyvr1r2",xl:"fyvr1r3"},defaultClass:"fyvr1r0"},4:{conditions:{sm:"fyvr1r4",md:"fyvr1r5",lg:"fyvr1r6",xl:"fyvr1r7"},defaultClass:"fyvr1r4"},5:{conditions:{sm:"fyvr1r8",md:"fyvr1r9",lg:"fyvr1ra",xl:"fyvr1rb"},defaultClass:"fyvr1r8"},6:{conditions:{sm:"fyvr1rc",md:"fyvr1rd",lg:"fyvr1re",xl:"fyvr1rf"},defaultClass:"fyvr1rc"},7:{conditions:{sm:"fyvr1rg",md:"fyvr1rh",lg:"fyvr1ri",xl:"fyvr1rj"},defaultClass:"fyvr1rg"},8:{conditions:{sm:"fyvr1rk",md:"fyvr1rl",lg:"fyvr1rm",xl:"fyvr1rn"},defaultClass:"fyvr1rk"},9:{conditions:{sm:"fyvr1ro",md:"fyvr1rp",lg:"fyvr1rq",xl:"fyvr1rr"},defaultClass:"fyvr1ro"},10:{conditions:{sm:"fyvr1rs",md:"fyvr1rt",lg:"fyvr1ru",xl:"fyvr1rv"},defaultClass:"fyvr1rs"},12:{conditions:{sm:"fyvr1rw",md:"fyvr1rx",lg:"fyvr1ry",xl:"fyvr1rz"},defaultClass:"fyvr1rw"},14:{conditions:{sm:"fyvr1s0",md:"fyvr1s1",lg:"fyvr1s2",xl:"fyvr1s3"},defaultClass:"fyvr1s0"},16:{conditions:{sm:"fyvr1s4",md:"fyvr1s5",lg:"fyvr1s6",xl:"fyvr1s7"},defaultClass:"fyvr1s4"},"0.25":{conditions:{sm:"fyvr1s8",md:"fyvr1s9",lg:"fyvr1sa",xl:"fyvr1sb"},defaultClass:"fyvr1s8"},"0.5":{conditions:{sm:"fyvr1sc",md:"fyvr1sd",lg:"fyvr1se",xl:"fyvr1sf"},defaultClass:"fyvr1sc"},"1.5":{conditions:{sm:"fyvr1sg",md:"fyvr1sh",lg:"fyvr1si",xl:"fyvr1sj"},defaultClass:"fyvr1sg"},auto:{conditions:{sm:"fyvr1sk",md:"fyvr1sl",lg:"fyvr1sm",xl:"fyvr1sn"},defaultClass:"fyvr1sk"}}},paddingTop:{values:{0:{conditions:{sm:"fyvr1so",md:"fyvr1sp",lg:"fyvr1sq",xl:"fyvr1sr"},defaultClass:"fyvr1so"},1:{conditions:{sm:"fyvr1ss",md:"fyvr1st",lg:"fyvr1su",xl:"fyvr1sv"},defaultClass:"fyvr1ss"},2:{conditions:{sm:"fyvr1sw",md:"fyvr1sx",lg:"fyvr1sy",xl:"fyvr1sz"},defaultClass:"fyvr1sw"},3:{conditions:{sm:"fyvr1t0",md:"fyvr1t1",lg:"fyvr1t2",xl:"fyvr1t3"},defaultClass:"fyvr1t0"},4:{conditions:{sm:"fyvr1t4",md:"fyvr1t5",lg:"fyvr1t6",xl:"fyvr1t7"},defaultClass:"fyvr1t4"},5:{conditions:{sm:"fyvr1t8",md:"fyvr1t9",lg:"fyvr1ta",xl:"fyvr1tb"},defaultClass:"fyvr1t8"},6:{conditions:{sm:"fyvr1tc",md:"fyvr1td",lg:"fyvr1te",xl:"fyvr1tf"},defaultClass:"fyvr1tc"},7:{conditions:{sm:"fyvr1tg",md:"fyvr1th",lg:"fyvr1ti",xl:"fyvr1tj"},defaultClass:"fyvr1tg"},8:{conditions:{sm:"fyvr1tk",md:"fyvr1tl",lg:"fyvr1tm",xl:"fyvr1tn"},defaultClass:"fyvr1tk"},9:{conditions:{sm:"fyvr1to",md:"fyvr1tp",lg:"fyvr1tq",xl:"fyvr1tr"},defaultClass:"fyvr1to"},10:{conditions:{sm:"fyvr1ts",md:"fyvr1tt",lg:"fyvr1tu",xl:"fyvr1tv"},defaultClass:"fyvr1ts"},12:{conditions:{sm:"fyvr1tw",md:"fyvr1tx",lg:"fyvr1ty",xl:"fyvr1tz"},defaultClass:"fyvr1tw"},14:{conditions:{sm:"fyvr1u0",md:"fyvr1u1",lg:"fyvr1u2",xl:"fyvr1u3"},defaultClass:"fyvr1u0"},16:{conditions:{sm:"fyvr1u4",md:"fyvr1u5",lg:"fyvr1u6",xl:"fyvr1u7"},defaultClass:"fyvr1u4"},"0.25":{conditions:{sm:"fyvr1u8",md:"fyvr1u9",lg:"fyvr1ua",xl:"fyvr1ub"},defaultClass:"fyvr1u8"},"0.5":{conditions:{sm:"fyvr1uc",md:"fyvr1ud",lg:"fyvr1ue",xl:"fyvr1uf"},defaultClass:"fyvr1uc"},"1.5":{conditions:{sm:"fyvr1ug",md:"fyvr1uh",lg:"fyvr1ui",xl:"fyvr1uj"},defaultClass:"fyvr1ug"}}},paddingBottom:{values:{0:{conditions:{sm:"fyvr1uk",md:"fyvr1ul",lg:"fyvr1um",xl:"fyvr1un"},defaultClass:"fyvr1uk"},1:{conditions:{sm:"fyvr1uo",md:"fyvr1up",lg:"fyvr1uq",xl:"fyvr1ur"},defaultClass:"fyvr1uo"},2:{conditions:{sm:"fyvr1us",md:"fyvr1ut",lg:"fyvr1uu",xl:"fyvr1uv"},defaultClass:"fyvr1us"},3:{conditions:{sm:"fyvr1uw",md:"fyvr1ux",lg:"fyvr1uy",xl:"fyvr1uz"},defaultClass:"fyvr1uw"},4:{conditions:{sm:"fyvr1v0",md:"fyvr1v1",lg:"fyvr1v2",xl:"fyvr1v3"},defaultClass:"fyvr1v0"},5:{conditions:{sm:"fyvr1v4",md:"fyvr1v5",lg:"fyvr1v6",xl:"fyvr1v7"},defaultClass:"fyvr1v4"},6:{conditions:{sm:"fyvr1v8",md:"fyvr1v9",lg:"fyvr1va",xl:"fyvr1vb"},defaultClass:"fyvr1v8"},7:{conditions:{sm:"fyvr1vc",md:"fyvr1vd",lg:"fyvr1ve",xl:"fyvr1vf"},defaultClass:"fyvr1vc"},8:{conditions:{sm:"fyvr1vg",md:"fyvr1vh",lg:"fyvr1vi",xl:"fyvr1vj"},defaultClass:"fyvr1vg"},9:{conditions:{sm:"fyvr1vk",md:"fyvr1vl",lg:"fyvr1vm",xl:"fyvr1vn"},defaultClass:"fyvr1vk"},10:{conditions:{sm:"fyvr1vo",md:"fyvr1vp",lg:"fyvr1vq",xl:"fyvr1vr"},defaultClass:"fyvr1vo"},12:{conditions:{sm:"fyvr1vs",md:"fyvr1vt",lg:"fyvr1vu",xl:"fyvr1vv"},defaultClass:"fyvr1vs"},14:{conditions:{sm:"fyvr1vw",md:"fyvr1vx",lg:"fyvr1vy",xl:"fyvr1vz"},defaultClass:"fyvr1vw"},16:{conditions:{sm:"fyvr1w0",md:"fyvr1w1",lg:"fyvr1w2",xl:"fyvr1w3"},defaultClass:"fyvr1w0"},"0.25":{conditions:{sm:"fyvr1w4",md:"fyvr1w5",lg:"fyvr1w6",xl:"fyvr1w7"},defaultClass:"fyvr1w4"},"0.5":{conditions:{sm:"fyvr1w8",md:"fyvr1w9",lg:"fyvr1wa",xl:"fyvr1wb"},defaultClass:"fyvr1w8"},"1.5":{conditions:{sm:"fyvr1wc",md:"fyvr1wd",lg:"fyvr1we",xl:"fyvr1wf"},defaultClass:"fyvr1wc"}}},paddingLeft:{values:{0:{conditions:{sm:"fyvr1wg",md:"fyvr1wh",lg:"fyvr1wi",xl:"fyvr1wj"},defaultClass:"fyvr1wg"},1:{conditions:{sm:"fyvr1wk",md:"fyvr1wl",lg:"fyvr1wm",xl:"fyvr1wn"},defaultClass:"fyvr1wk"},2:{conditions:{sm:"fyvr1wo",md:"fyvr1wp",lg:"fyvr1wq",xl:"fyvr1wr"},defaultClass:"fyvr1wo"},3:{conditions:{sm:"fyvr1ws",md:"fyvr1wt",lg:"fyvr1wu",xl:"fyvr1wv"},defaultClass:"fyvr1ws"},4:{conditions:{sm:"fyvr1ww",md:"fyvr1wx",lg:"fyvr1wy",xl:"fyvr1wz"},defaultClass:"fyvr1ww"},5:{conditions:{sm:"fyvr1x0",md:"fyvr1x1",lg:"fyvr1x2",xl:"fyvr1x3"},defaultClass:"fyvr1x0"},6:{conditions:{sm:"fyvr1x4",md:"fyvr1x5",lg:"fyvr1x6",xl:"fyvr1x7"},defaultClass:"fyvr1x4"},7:{conditions:{sm:"fyvr1x8",md:"fyvr1x9",lg:"fyvr1xa",xl:"fyvr1xb"},defaultClass:"fyvr1x8"},8:{conditions:{sm:"fyvr1xc",md:"fyvr1xd",lg:"fyvr1xe",xl:"fyvr1xf"},defaultClass:"fyvr1xc"},9:{conditions:{sm:"fyvr1xg",md:"fyvr1xh",lg:"fyvr1xi",xl:"fyvr1xj"},defaultClass:"fyvr1xg"},10:{conditions:{sm:"fyvr1xk",md:"fyvr1xl",lg:"fyvr1xm",xl:"fyvr1xn"},defaultClass:"fyvr1xk"},12:{conditions:{sm:"fyvr1xo",md:"fyvr1xp",lg:"fyvr1xq",xl:"fyvr1xr"},defaultClass:"fyvr1xo"},14:{conditions:{sm:"fyvr1xs",md:"fyvr1xt",lg:"fyvr1xu",xl:"fyvr1xv"},defaultClass:"fyvr1xs"},16:{conditions:{sm:"fyvr1xw",md:"fyvr1xx",lg:"fyvr1xy",xl:"fyvr1xz"},defaultClass:"fyvr1xw"},"0.25":{conditions:{sm:"fyvr1y0",md:"fyvr1y1",lg:"fyvr1y2",xl:"fyvr1y3"},defaultClass:"fyvr1y0"},"0.5":{conditions:{sm:"fyvr1y4",md:"fyvr1y5",lg:"fyvr1y6",xl:"fyvr1y7"},defaultClass:"fyvr1y4"},"1.5":{conditions:{sm:"fyvr1y8",md:"fyvr1y9",lg:"fyvr1ya",xl:"fyvr1yb"},defaultClass:"fyvr1y8"}}},paddingRight:{values:{0:{conditions:{sm:"fyvr1yc",md:"fyvr1yd",lg:"fyvr1ye",xl:"fyvr1yf"},defaultClass:"fyvr1yc"},1:{conditions:{sm:"fyvr1yg",md:"fyvr1yh",lg:"fyvr1yi",xl:"fyvr1yj"},defaultClass:"fyvr1yg"},2:{conditions:{sm:"fyvr1yk",md:"fyvr1yl",lg:"fyvr1ym",xl:"fyvr1yn"},defaultClass:"fyvr1yk"},3:{conditions:{sm:"fyvr1yo",md:"fyvr1yp",lg:"fyvr1yq",xl:"fyvr1yr"},defaultClass:"fyvr1yo"},4:{conditions:{sm:"fyvr1ys",md:"fyvr1yt",lg:"fyvr1yu",xl:"fyvr1yv"},defaultClass:"fyvr1ys"},5:{conditions:{sm:"fyvr1yw",md:"fyvr1yx",lg:"fyvr1yy",xl:"fyvr1yz"},defaultClass:"fyvr1yw"},6:{conditions:{sm:"fyvr1z0",md:"fyvr1z1",lg:"fyvr1z2",xl:"fyvr1z3"},defaultClass:"fyvr1z0"},7:{conditions:{sm:"fyvr1z4",md:"fyvr1z5",lg:"fyvr1z6",xl:"fyvr1z7"},defaultClass:"fyvr1z4"},8:{conditions:{sm:"fyvr1z8",md:"fyvr1z9",lg:"fyvr1za",xl:"fyvr1zb"},defaultClass:"fyvr1z8"},9:{conditions:{sm:"fyvr1zc",md:"fyvr1zd",lg:"fyvr1ze",xl:"fyvr1zf"},defaultClass:"fyvr1zc"},10:{conditions:{sm:"fyvr1zg",md:"fyvr1zh",lg:"fyvr1zi",xl:"fyvr1zj"},defaultClass:"fyvr1zg"},12:{conditions:{sm:"fyvr1zk",md:"fyvr1zl",lg:"fyvr1zm",xl:"fyvr1zn"},defaultClass:"fyvr1zk"},14:{conditions:{sm:"fyvr1zo",md:"fyvr1zp",lg:"fyvr1zq",xl:"fyvr1zr"},defaultClass:"fyvr1zo"},16:{conditions:{sm:"fyvr1zs",md:"fyvr1zt",lg:"fyvr1zu",xl:"fyvr1zv"},defaultClass:"fyvr1zs"},"0.25":{conditions:{sm:"fyvr1zw",md:"fyvr1zx",lg:"fyvr1zy",xl:"fyvr1zz"},defaultClass:"fyvr1zw"},"0.5":{conditions:{sm:"fyvr1100",md:"fyvr1101",lg:"fyvr1102",xl:"fyvr1103"},defaultClass:"fyvr1100"},"1.5":{conditions:{sm:"fyvr1104",md:"fyvr1105",lg:"fyvr1106",xl:"fyvr1107"},defaultClass:"fyvr1104"}}},marginTop:{values:{0:{conditions:{sm:"fyvr1108",md:"fyvr1109",lg:"fyvr110a",xl:"fyvr110b"},defaultClass:"fyvr1108"},1:{conditions:{sm:"fyvr110c",md:"fyvr110d",lg:"fyvr110e",xl:"fyvr110f"},defaultClass:"fyvr110c"},2:{conditions:{sm:"fyvr110g",md:"fyvr110h",lg:"fyvr110i",xl:"fyvr110j"},defaultClass:"fyvr110g"},3:{conditions:{sm:"fyvr110k",md:"fyvr110l",lg:"fyvr110m",xl:"fyvr110n"},defaultClass:"fyvr110k"},4:{conditions:{sm:"fyvr110o",md:"fyvr110p",lg:"fyvr110q",xl:"fyvr110r"},defaultClass:"fyvr110o"},5:{conditions:{sm:"fyvr110s",md:"fyvr110t",lg:"fyvr110u",xl:"fyvr110v"},defaultClass:"fyvr110s"},6:{conditions:{sm:"fyvr110w",md:"fyvr110x",lg:"fyvr110y",xl:"fyvr110z"},defaultClass:"fyvr110w"},7:{conditions:{sm:"fyvr1110",md:"fyvr1111",lg:"fyvr1112",xl:"fyvr1113"},defaultClass:"fyvr1110"},8:{conditions:{sm:"fyvr1114",md:"fyvr1115",lg:"fyvr1116",xl:"fyvr1117"},defaultClass:"fyvr1114"},9:{conditions:{sm:"fyvr1118",md:"fyvr1119",lg:"fyvr111a",xl:"fyvr111b"},defaultClass:"fyvr1118"},10:{conditions:{sm:"fyvr111c",md:"fyvr111d",lg:"fyvr111e",xl:"fyvr111f"},defaultClass:"fyvr111c"},12:{conditions:{sm:"fyvr111g",md:"fyvr111h",lg:"fyvr111i",xl:"fyvr111j"},defaultClass:"fyvr111g"},14:{conditions:{sm:"fyvr111k",md:"fyvr111l",lg:"fyvr111m",xl:"fyvr111n"},defaultClass:"fyvr111k"},16:{conditions:{sm:"fyvr111o",md:"fyvr111p",lg:"fyvr111q",xl:"fyvr111r"},defaultClass:"fyvr111o"},"0.25":{conditions:{sm:"fyvr111s",md:"fyvr111t",lg:"fyvr111u",xl:"fyvr111v"},defaultClass:"fyvr111s"},"0.5":{conditions:{sm:"fyvr111w",md:"fyvr111x",lg:"fyvr111y",xl:"fyvr111z"},defaultClass:"fyvr111w"},"1.5":{conditions:{sm:"fyvr1120",md:"fyvr1121",lg:"fyvr1122",xl:"fyvr1123"},defaultClass:"fyvr1120"},auto:{conditions:{sm:"fyvr1124",md:"fyvr1125",lg:"fyvr1126",xl:"fyvr1127"},defaultClass:"fyvr1124"}}},marginBottom:{values:{0:{conditions:{sm:"fyvr1128",md:"fyvr1129",lg:"fyvr112a",xl:"fyvr112b"},defaultClass:"fyvr1128"},1:{conditions:{sm:"fyvr112c",md:"fyvr112d",lg:"fyvr112e",xl:"fyvr112f"},defaultClass:"fyvr112c"},2:{conditions:{sm:"fyvr112g",md:"fyvr112h",lg:"fyvr112i",xl:"fyvr112j"},defaultClass:"fyvr112g"},3:{conditions:{sm:"fyvr112k",md:"fyvr112l",lg:"fyvr112m",xl:"fyvr112n"},defaultClass:"fyvr112k"},4:{conditions:{sm:"fyvr112o",md:"fyvr112p",lg:"fyvr112q",xl:"fyvr112r"},defaultClass:"fyvr112o"},5:{conditions:{sm:"fyvr112s",md:"fyvr112t",lg:"fyvr112u",xl:"fyvr112v"},defaultClass:"fyvr112s"},6:{conditions:{sm:"fyvr112w",md:"fyvr112x",lg:"fyvr112y",xl:"fyvr112z"},defaultClass:"fyvr112w"},7:{conditions:{sm:"fyvr1130",md:"fyvr1131",lg:"fyvr1132",xl:"fyvr1133"},defaultClass:"fyvr1130"},8:{conditions:{sm:"fyvr1134",md:"fyvr1135",lg:"fyvr1136",xl:"fyvr1137"},defaultClass:"fyvr1134"},9:{conditions:{sm:"fyvr1138",md:"fyvr1139",lg:"fyvr113a",xl:"fyvr113b"},defaultClass:"fyvr1138"},10:{conditions:{sm:"fyvr113c",md:"fyvr113d",lg:"fyvr113e",xl:"fyvr113f"},defaultClass:"fyvr113c"},12:{conditions:{sm:"fyvr113g",md:"fyvr113h",lg:"fyvr113i",xl:"fyvr113j"},defaultClass:"fyvr113g"},14:{conditions:{sm:"fyvr113k",md:"fyvr113l",lg:"fyvr113m",xl:"fyvr113n"},defaultClass:"fyvr113k"},16:{conditions:{sm:"fyvr113o",md:"fyvr113p",lg:"fyvr113q",xl:"fyvr113r"},defaultClass:"fyvr113o"},"0.25":{conditions:{sm:"fyvr113s",md:"fyvr113t",lg:"fyvr113u",xl:"fyvr113v"},defaultClass:"fyvr113s"},"0.5":{conditions:{sm:"fyvr113w",md:"fyvr113x",lg:"fyvr113y",xl:"fyvr113z"},defaultClass:"fyvr113w"},"1.5":{conditions:{sm:"fyvr1140",md:"fyvr1141",lg:"fyvr1142",xl:"fyvr1143"},defaultClass:"fyvr1140"},auto:{conditions:{sm:"fyvr1144",md:"fyvr1145",lg:"fyvr1146",xl:"fyvr1147"},defaultClass:"fyvr1144"}}},marginLeft:{values:{0:{conditions:{sm:"fyvr1148",md:"fyvr1149",lg:"fyvr114a",xl:"fyvr114b"},defaultClass:"fyvr1148"},1:{conditions:{sm:"fyvr114c",md:"fyvr114d",lg:"fyvr114e",xl:"fyvr114f"},defaultClass:"fyvr114c"},2:{conditions:{sm:"fyvr114g",md:"fyvr114h",lg:"fyvr114i",xl:"fyvr114j"},defaultClass:"fyvr114g"},3:{conditions:{sm:"fyvr114k",md:"fyvr114l",lg:"fyvr114m",xl:"fyvr114n"},defaultClass:"fyvr114k"},4:{conditions:{sm:"fyvr114o",md:"fyvr114p",lg:"fyvr114q",xl:"fyvr114r"},defaultClass:"fyvr114o"},5:{conditions:{sm:"fyvr114s",md:"fyvr114t",lg:"fyvr114u",xl:"fyvr114v"},defaultClass:"fyvr114s"},6:{conditions:{sm:"fyvr114w",md:"fyvr114x",lg:"fyvr114y",xl:"fyvr114z"},defaultClass:"fyvr114w"},7:{conditions:{sm:"fyvr1150",md:"fyvr1151",lg:"fyvr1152",xl:"fyvr1153"},defaultClass:"fyvr1150"},8:{conditions:{sm:"fyvr1154",md:"fyvr1155",lg:"fyvr1156",xl:"fyvr1157"},defaultClass:"fyvr1154"},9:{conditions:{sm:"fyvr1158",md:"fyvr1159",lg:"fyvr115a",xl:"fyvr115b"},defaultClass:"fyvr1158"},10:{conditions:{sm:"fyvr115c",md:"fyvr115d",lg:"fyvr115e",xl:"fyvr115f"},defaultClass:"fyvr115c"},12:{conditions:{sm:"fyvr115g",md:"fyvr115h",lg:"fyvr115i",xl:"fyvr115j"},defaultClass:"fyvr115g"},14:{conditions:{sm:"fyvr115k",md:"fyvr115l",lg:"fyvr115m",xl:"fyvr115n"},defaultClass:"fyvr115k"},16:{conditions:{sm:"fyvr115o",md:"fyvr115p",lg:"fyvr115q",xl:"fyvr115r"},defaultClass:"fyvr115o"},"0.25":{conditions:{sm:"fyvr115s",md:"fyvr115t",lg:"fyvr115u",xl:"fyvr115v"},defaultClass:"fyvr115s"},"0.5":{conditions:{sm:"fyvr115w",md:"fyvr115x",lg:"fyvr115y",xl:"fyvr115z"},defaultClass:"fyvr115w"},"1.5":{conditions:{sm:"fyvr1160",md:"fyvr1161",lg:"fyvr1162",xl:"fyvr1163"},defaultClass:"fyvr1160"},auto:{conditions:{sm:"fyvr1164",md:"fyvr1165",lg:"fyvr1166",xl:"fyvr1167"},defaultClass:"fyvr1164"}}},marginRight:{values:{0:{conditions:{sm:"fyvr1168",md:"fyvr1169",lg:"fyvr116a",xl:"fyvr116b"},defaultClass:"fyvr1168"},1:{conditions:{sm:"fyvr116c",md:"fyvr116d",lg:"fyvr116e",xl:"fyvr116f"},defaultClass:"fyvr116c"},2:{conditions:{sm:"fyvr116g",md:"fyvr116h",lg:"fyvr116i",xl:"fyvr116j"},defaultClass:"fyvr116g"},3:{conditions:{sm:"fyvr116k",md:"fyvr116l",lg:"fyvr116m",xl:"fyvr116n"},defaultClass:"fyvr116k"},4:{conditions:{sm:"fyvr116o",md:"fyvr116p",lg:"fyvr116q",xl:"fyvr116r"},defaultClass:"fyvr116o"},5:{conditions:{sm:"fyvr116s",md:"fyvr116t",lg:"fyvr116u",xl:"fyvr116v"},defaultClass:"fyvr116s"},6:{conditions:{sm:"fyvr116w",md:"fyvr116x",lg:"fyvr116y",xl:"fyvr116z"},defaultClass:"fyvr116w"},7:{conditions:{sm:"fyvr1170",md:"fyvr1171",lg:"fyvr1172",xl:"fyvr1173"},defaultClass:"fyvr1170"},8:{conditions:{sm:"fyvr1174",md:"fyvr1175",lg:"fyvr1176",xl:"fyvr1177"},defaultClass:"fyvr1174"},9:{conditions:{sm:"fyvr1178",md:"fyvr1179",lg:"fyvr117a",xl:"fyvr117b"},defaultClass:"fyvr1178"},10:{conditions:{sm:"fyvr117c",md:"fyvr117d",lg:"fyvr117e",xl:"fyvr117f"},defaultClass:"fyvr117c"},12:{conditions:{sm:"fyvr117g",md:"fyvr117h",lg:"fyvr117i",xl:"fyvr117j"},defaultClass:"fyvr117g"},14:{conditions:{sm:"fyvr117k",md:"fyvr117l",lg:"fyvr117m",xl:"fyvr117n"},defaultClass:"fyvr117k"},16:{conditions:{sm:"fyvr117o",md:"fyvr117p",lg:"fyvr117q",xl:"fyvr117r"},defaultClass:"fyvr117o"},"0.25":{conditions:{sm:"fyvr117s",md:"fyvr117t",lg:"fyvr117u",xl:"fyvr117v"},defaultClass:"fyvr117s"},"0.5":{conditions:{sm:"fyvr117w",md:"fyvr117x",lg:"fyvr117y",xl:"fyvr117z"},defaultClass:"fyvr117w"},"1.5":{conditions:{sm:"fyvr1180",md:"fyvr1181",lg:"fyvr1182",xl:"fyvr1183"},defaultClass:"fyvr1180"},auto:{conditions:{sm:"fyvr1184",md:"fyvr1185",lg:"fyvr1186",xl:"fyvr1187"},defaultClass:"fyvr1184"}}},gap:{values:{0:{conditions:{sm:"fyvr1188",md:"fyvr1189",lg:"fyvr118a",xl:"fyvr118b"},defaultClass:"fyvr1188"},1:{conditions:{sm:"fyvr118c",md:"fyvr118d",lg:"fyvr118e",xl:"fyvr118f"},defaultClass:"fyvr118c"},2:{conditions:{sm:"fyvr118g",md:"fyvr118h",lg:"fyvr118i",xl:"fyvr118j"},defaultClass:"fyvr118g"},3:{conditions:{sm:"fyvr118k",md:"fyvr118l",lg:"fyvr118m",xl:"fyvr118n"},defaultClass:"fyvr118k"},4:{conditions:{sm:"fyvr118o",md:"fyvr118p",lg:"fyvr118q",xl:"fyvr118r"},defaultClass:"fyvr118o"},5:{conditions:{sm:"fyvr118s",md:"fyvr118t",lg:"fyvr118u",xl:"fyvr118v"},defaultClass:"fyvr118s"},6:{conditions:{sm:"fyvr118w",md:"fyvr118x",lg:"fyvr118y",xl:"fyvr118z"},defaultClass:"fyvr118w"},7:{conditions:{sm:"fyvr1190",md:"fyvr1191",lg:"fyvr1192",xl:"fyvr1193"},defaultClass:"fyvr1190"},8:{conditions:{sm:"fyvr1194",md:"fyvr1195",lg:"fyvr1196",xl:"fyvr1197"},defaultClass:"fyvr1194"},9:{conditions:{sm:"fyvr1198",md:"fyvr1199",lg:"fyvr119a",xl:"fyvr119b"},defaultClass:"fyvr1198"},10:{conditions:{sm:"fyvr119c",md:"fyvr119d",lg:"fyvr119e",xl:"fyvr119f"},defaultClass:"fyvr119c"},12:{conditions:{sm:"fyvr119g",md:"fyvr119h",lg:"fyvr119i",xl:"fyvr119j"},defaultClass:"fyvr119g"},14:{conditions:{sm:"fyvr119k",md:"fyvr119l",lg:"fyvr119m",xl:"fyvr119n"},defaultClass:"fyvr119k"},16:{conditions:{sm:"fyvr119o",md:"fyvr119p",lg:"fyvr119q",xl:"fyvr119r"},defaultClass:"fyvr119o"},"0.25":{conditions:{sm:"fyvr119s",md:"fyvr119t",lg:"fyvr119u",xl:"fyvr119v"},defaultClass:"fyvr119s"},"0.5":{conditions:{sm:"fyvr119w",md:"fyvr119x",lg:"fyvr119y",xl:"fyvr119z"},defaultClass:"fyvr119w"},"1.5":{conditions:{sm:"fyvr11a0",md:"fyvr11a1",lg:"fyvr11a2",xl:"fyvr11a3"},defaultClass:"fyvr11a0"}}},borderBottomWidth:{values:{none:{conditions:{sm:"fyvr11a4",md:"fyvr11a5",lg:"fyvr11a6",xl:"fyvr11a7"},defaultClass:"fyvr11a4"},thin:{conditions:{sm:"fyvr11a8",md:"fyvr11a9",lg:"fyvr11aa",xl:"fyvr11ab"},defaultClass:"fyvr11a8"},thick:{conditions:{sm:"fyvr11ac",md:"fyvr11ad",lg:"fyvr11ae",xl:"fyvr11af"},defaultClass:"fyvr11ac"}}},borderLeftWidth:{values:{none:{conditions:{sm:"fyvr11ag",md:"fyvr11ah",lg:"fyvr11ai",xl:"fyvr11aj"},defaultClass:"fyvr11ag"},thin:{conditions:{sm:"fyvr11ak",md:"fyvr11al",lg:"fyvr11am",xl:"fyvr11an"},defaultClass:"fyvr11ak"},thick:{conditions:{sm:"fyvr11ao",md:"fyvr11ap",lg:"fyvr11aq",xl:"fyvr11ar"},defaultClass:"fyvr11ao"}}},borderRightWidth:{values:{none:{conditions:{sm:"fyvr11as",md:"fyvr11at",lg:"fyvr11au",xl:"fyvr11av"},defaultClass:"fyvr11as"},thin:{conditions:{sm:"fyvr11aw",md:"fyvr11ax",lg:"fyvr11ay",xl:"fyvr11az"},defaultClass:"fyvr11aw"},thick:{conditions:{sm:"fyvr11b0",md:"fyvr11b1",lg:"fyvr11b2",xl:"fyvr11b3"},defaultClass:"fyvr11b0"}}},borderTopWidth:{values:{none:{conditions:{sm:"fyvr11b4",md:"fyvr11b5",lg:"fyvr11b6",xl:"fyvr11b7"},defaultClass:"fyvr11b4"},thin:{conditions:{sm:"fyvr11b8",md:"fyvr11b9",lg:"fyvr11ba",xl:"fyvr11bb"},defaultClass:"fyvr11b8"},thick:{conditions:{sm:"fyvr11bc",md:"fyvr11bd",lg:"fyvr11be",xl:"fyvr11bf"},defaultClass:"fyvr11bc"}}},borderBottomLeftRadius:{values:{none:{conditions:{sm:"fyvr11bg",md:"fyvr11bh",lg:"fyvr11bi",xl:"fyvr11bj"},defaultClass:"fyvr11bg"},xs:{conditions:{sm:"fyvr11bk",md:"fyvr11bl",lg:"fyvr11bm",xl:"fyvr11bn"},defaultClass:"fyvr11bk"},sm:{conditions:{sm:"fyvr11bo",md:"fyvr11bp",lg:"fyvr11bq",xl:"fyvr11br"},defaultClass:"fyvr11bo"},md:{conditions:{sm:"fyvr11bs",md:"fyvr11bt",lg:"fyvr11bu",xl:"fyvr11bv"},defaultClass:"fyvr11bs"},lg:{conditions:{sm:"fyvr11bw",md:"fyvr11bx",lg:"fyvr11by",xl:"fyvr11bz"},defaultClass:"fyvr11bw"},circle:{conditions:{sm:"fyvr11c0",md:"fyvr11c1",lg:"fyvr11c2",xl:"fyvr11c3"},defaultClass:"fyvr11c0"}}},borderBottomRightRadius:{values:{none:{conditions:{sm:"fyvr11c4",md:"fyvr11c5",lg:"fyvr11c6",xl:"fyvr11c7"},defaultClass:"fyvr11c4"},xs:{conditions:{sm:"fyvr11c8",md:"fyvr11c9",lg:"fyvr11ca",xl:"fyvr11cb"},defaultClass:"fyvr11c8"},sm:{conditions:{sm:"fyvr11cc",md:"fyvr11cd",lg:"fyvr11ce",xl:"fyvr11cf"},defaultClass:"fyvr11cc"},md:{conditions:{sm:"fyvr11cg",md:"fyvr11ch",lg:"fyvr11ci",xl:"fyvr11cj"},defaultClass:"fyvr11cg"},lg:{conditions:{sm:"fyvr11ck",md:"fyvr11cl",lg:"fyvr11cm",xl:"fyvr11cn"},defaultClass:"fyvr11ck"},circle:{conditions:{sm:"fyvr11co",md:"fyvr11cp",lg:"fyvr11cq",xl:"fyvr11cr"},defaultClass:"fyvr11co"}}},borderTopLeftRadius:{values:{none:{conditions:{sm:"fyvr11cs",md:"fyvr11ct",lg:"fyvr11cu",xl:"fyvr11cv"},defaultClass:"fyvr11cs"},xs:{conditions:{sm:"fyvr11cw",md:"fyvr11cx",lg:"fyvr11cy",xl:"fyvr11cz"},defaultClass:"fyvr11cw"},sm:{conditions:{sm:"fyvr11d0",md:"fyvr11d1",lg:"fyvr11d2",xl:"fyvr11d3"},defaultClass:"fyvr11d0"},md:{conditions:{sm:"fyvr11d4",md:"fyvr11d5",lg:"fyvr11d6",xl:"fyvr11d7"},defaultClass:"fyvr11d4"},lg:{conditions:{sm:"fyvr11d8",md:"fyvr11d9",lg:"fyvr11da",xl:"fyvr11db"},defaultClass:"fyvr11d8"},circle:{conditions:{sm:"fyvr11dc",md:"fyvr11dd",lg:"fyvr11de",xl:"fyvr11df"},defaultClass:"fyvr11dc"}}},borderTopRightRadius:{values:{none:{conditions:{sm:"fyvr11dg",md:"fyvr11dh",lg:"fyvr11di",xl:"fyvr11dj"},defaultClass:"fyvr11dg"},xs:{conditions:{sm:"fyvr11dk",md:"fyvr11dl",lg:"fyvr11dm",xl:"fyvr11dn"},defaultClass:"fyvr11dk"},sm:{conditions:{sm:"fyvr11do",md:"fyvr11dp",lg:"fyvr11dq",xl:"fyvr11dr"},defaultClass:"fyvr11do"},md:{conditions:{sm:"fyvr11ds",md:"fyvr11dt",lg:"fyvr11du",xl:"fyvr11dv"},defaultClass:"fyvr11ds"},lg:{conditions:{sm:"fyvr11dw",md:"fyvr11dx",lg:"fyvr11dy",xl:"fyvr11dz"},defaultClass:"fyvr11dw"},circle:{conditions:{sm:"fyvr11e0",md:"fyvr11e1",lg:"fyvr11e2",xl:"fyvr11e3"},defaultClass:"fyvr11e0"}}},fontSize:{values:{inherit:{conditions:{sm:"fyvr11e4",md:"fyvr11e5",lg:"fyvr11e6",xl:"fyvr11e7"},defaultClass:"fyvr11e4"},xsmall:{conditions:{sm:"fyvr11e8",md:"fyvr11e9",lg:"fyvr11ea",xl:"fyvr11eb"},defaultClass:"fyvr11e8"},small:{conditions:{sm:"fyvr11ec",md:"fyvr11ed",lg:"fyvr11ee",xl:"fyvr11ef"},defaultClass:"fyvr11ec"},normal:{conditions:{sm:"fyvr11eg",md:"fyvr11eh",lg:"fyvr11ei",xl:"fyvr11ej"},defaultClass:"fyvr11eg"},medium:{conditions:{sm:"fyvr11ek",md:"fyvr11el",lg:"fyvr11em",xl:"fyvr11en"},defaultClass:"fyvr11ek"},large:{conditions:{sm:"fyvr11eo",md:"fyvr11ep",lg:"fyvr11eq",xl:"fyvr11er"},defaultClass:"fyvr11eo"},xlarge:{conditions:{sm:"fyvr11es",md:"fyvr11et",lg:"fyvr11eu",xl:"fyvr11ev"},defaultClass:"fyvr11es"}}},fontWeight:{values:{inherit:{conditions:{sm:"fyvr11ew",md:"fyvr11ex",lg:"fyvr11ey",xl:"fyvr11ez"},defaultClass:"fyvr11ew"},normal:{conditions:{sm:"fyvr11f0",md:"fyvr11f1",lg:"fyvr11f2",xl:"fyvr11f3"},defaultClass:"fyvr11f0"},medium:{conditions:{sm:"fyvr11f4",md:"fyvr11f5",lg:"fyvr11f6",xl:"fyvr11f7"},defaultClass:"fyvr11f4"},semibold:{conditions:{sm:"fyvr11f8",md:"fyvr11f9",lg:"fyvr11fa",xl:"fyvr11fb"},defaultClass:"fyvr11f8"},bold:{conditions:{sm:"fyvr11fc",md:"fyvr11fd",lg:"fyvr11fe",xl:"fyvr11ff"},defaultClass:"fyvr11fc"}}},letterSpacing:{values:{inherit:{conditions:{sm:"fyvr11fg",md:"fyvr11fh",lg:"fyvr11fi",xl:"fyvr11fj"},defaultClass:"fyvr11fg"},none:{conditions:{sm:"fyvr11fk",md:"fyvr11fl",lg:"fyvr11fm",xl:"fyvr11fn"},defaultClass:"fyvr11fk"},normal:{conditions:{sm:"fyvr11fo",md:"fyvr11fp",lg:"fyvr11fq",xl:"fyvr11fr"},defaultClass:"fyvr11fo"},wide:{conditions:{sm:"fyvr11fs",md:"fyvr11ft",lg:"fyvr11fu",xl:"fyvr11fv"},defaultClass:"fyvr11fs"}}},lineHeight:{values:{4:{conditions:{sm:"fyvr11fw",md:"fyvr11fx",lg:"fyvr11fy",xl:"fyvr11fz"},defaultClass:"fyvr11fw"},5:{conditions:{sm:"fyvr11g0",md:"fyvr11g1",lg:"fyvr11g2",xl:"fyvr11g3"},defaultClass:"fyvr11g0"},6:{conditions:{sm:"fyvr11g4",md:"fyvr11g5",lg:"fyvr11g6",xl:"fyvr11g7"},defaultClass:"fyvr11g4"},7:{conditions:{sm:"fyvr11g8",md:"fyvr11g9",lg:"fyvr11ga",xl:"fyvr11gb"},defaultClass:"fyvr11g8"},9:{conditions:{sm:"fyvr11gc",md:"fyvr11gd",lg:"fyvr11ge",xl:"fyvr11gf"},defaultClass:"fyvr11gc"},inherit:{conditions:{sm:"fyvr11gg",md:"fyvr11gh",lg:"fyvr11gi",xl:"fyvr11gj"},defaultClass:"fyvr11gg"}}},textAlign:{values:{center:{conditions:{sm:"fyvr11gk",md:"fyvr11gl",lg:"fyvr11gm",xl:"fyvr11gn"},defaultClass:"fyvr11gk"},left:{conditions:{sm:"fyvr11go",md:"fyvr11gp",lg:"fyvr11gq",xl:"fyvr11gr"},defaultClass:"fyvr11go"},right:{conditions:{sm:"fyvr11gs",md:"fyvr11gt",lg:"fyvr11gu",xl:"fyvr11gv"},defaultClass:"fyvr11gs"}}},display:{values:{block:{conditions:{sm:"fyvr11gw",md:"fyvr11gx",lg:"fyvr11gy",xl:"fyvr11gz"},defaultClass:"fyvr11gw"},flex:{conditions:{sm:"fyvr11h0",md:"fyvr11h1",lg:"fyvr11h2",xl:"fyvr11h3"},defaultClass:"fyvr11h0"},grid:{conditions:{sm:"fyvr11h4",md:"fyvr11h5",lg:"fyvr11h6",xl:"fyvr11h7"},defaultClass:"fyvr11h4"},"inline-block":{conditions:{sm:"fyvr11h8",md:"fyvr11h9",lg:"fyvr11ha",xl:"fyvr11hb"},defaultClass:"fyvr11h8"},"inline-flex":{conditions:{sm:"fyvr11hc",md:"fyvr11hd",lg:"fyvr11he",xl:"fyvr11hf"},defaultClass:"fyvr11hc"},none:{conditions:{sm:"fyvr11hg",md:"fyvr11hh",lg:"fyvr11hi",xl:"fyvr11hj"},defaultClass:"fyvr11hg"},contents:{conditions:{sm:"fyvr11hk",md:"fyvr11hl",lg:"fyvr11hm",xl:"fyvr11hn"},defaultClass:"fyvr11hk"}}},position:{values:{absolute:{conditions:{sm:"fyvr11ho",md:"fyvr11hp",lg:"fyvr11hq",xl:"fyvr11hr"},defaultClass:"fyvr11ho"},fixed:{conditions:{sm:"fyvr11hs",md:"fyvr11ht",lg:"fyvr11hu",xl:"fyvr11hv"},defaultClass:"fyvr11hs"},relative:{conditions:{sm:"fyvr11hw",md:"fyvr11hx",lg:"fyvr11hy",xl:"fyvr11hz"},defaultClass:"fyvr11hw"},sticky:{conditions:{sm:"fyvr11i0",md:"fyvr11i1",lg:"fyvr11i2",xl:"fyvr11i3"},defaultClass:"fyvr11i0"}}},flexDirection:{values:{column:{conditions:{sm:"fyvr11i4",md:"fyvr11i5",lg:"fyvr11i6",xl:"fyvr11i7"},defaultClass:"fyvr11i4"},"column-reverse":{conditions:{sm:"fyvr11i8",md:"fyvr11i9",lg:"fyvr11ia",xl:"fyvr11ib"},defaultClass:"fyvr11i8"},row:{conditions:{sm:"fyvr11ic",md:"fyvr11id",lg:"fyvr11ie",xl:"fyvr11if"},defaultClass:"fyvr11ic"},"row-reverse":{conditions:{sm:"fyvr11ig",md:"fyvr11ih",lg:"fyvr11ii",xl:"fyvr11ij"},defaultClass:"fyvr11ig"}}},flexShrink:{values:{0:{conditions:{sm:"fyvr11ik",md:"fyvr11il",lg:"fyvr11im",xl:"fyvr11in"},defaultClass:"fyvr11ik"},1:{conditions:{sm:"fyvr11io",md:"fyvr11ip",lg:"fyvr11iq",xl:"fyvr11ir"},defaultClass:"fyvr11io"}}},flexGrow:{values:{0:{conditions:{sm:"fyvr11is",md:"fyvr11it",lg:"fyvr11iu",xl:"fyvr11iv"},defaultClass:"fyvr11is"},1:{conditions:{sm:"fyvr11iw",md:"fyvr11ix",lg:"fyvr11iy",xl:"fyvr11iz"},defaultClass:"fyvr11iw"}}},flexWrap:{values:{nowrap:{conditions:{sm:"fyvr11j0",md:"fyvr11j1",lg:"fyvr11j2",xl:"fyvr11j3"},defaultClass:"fyvr11j0"},wrap:{conditions:{sm:"fyvr11j4",md:"fyvr11j5",lg:"fyvr11j6",xl:"fyvr11j7"},defaultClass:"fyvr11j4"},"wrap-reverse":{conditions:{sm:"fyvr11j8",md:"fyvr11j9",lg:"fyvr11ja",xl:"fyvr11jb"},defaultClass:"fyvr11j8"}}},justifyContent:{values:{"flex-start":{conditions:{sm:"fyvr11jc",md:"fyvr11jd",lg:"fyvr11je",xl:"fyvr11jf"},defaultClass:"fyvr11jc"},center:{conditions:{sm:"fyvr11jg",md:"fyvr11jh",lg:"fyvr11ji",xl:"fyvr11jj"},defaultClass:"fyvr11jg"},"flex-end":{conditions:{sm:"fyvr11jk",md:"fyvr11jl",lg:"fyvr11jm",xl:"fyvr11jn"},defaultClass:"fyvr11jk"},stretch:{conditions:{sm:"fyvr11jo",md:"fyvr11jp",lg:"fyvr11jq",xl:"fyvr11jr"},defaultClass:"fyvr11jo"},"space-around":{conditions:{sm:"fyvr11js",md:"fyvr11jt",lg:"fyvr11ju",xl:"fyvr11jv"},defaultClass:"fyvr11js"},"space-between":{conditions:{sm:"fyvr11jw",md:"fyvr11jx",lg:"fyvr11jy",xl:"fyvr11jz"},defaultClass:"fyvr11jw"},"space-evenly":{conditions:{sm:"fyvr11k0",md:"fyvr11k1",lg:"fyvr11k2",xl:"fyvr11k3"},defaultClass:"fyvr11k0"}}},justifySelf:{values:{"flex-start":{conditions:{sm:"fyvr11k4",md:"fyvr11k5",lg:"fyvr11k6",xl:"fyvr11k7"},defaultClass:"fyvr11k4"},center:{conditions:{sm:"fyvr11k8",md:"fyvr11k9",lg:"fyvr11ka",xl:"fyvr11kb"},defaultClass:"fyvr11k8"},"flex-end":{conditions:{sm:"fyvr11kc",md:"fyvr11kd",lg:"fyvr11ke",xl:"fyvr11kf"},defaultClass:"fyvr11kc"},stretch:{conditions:{sm:"fyvr11kg",md:"fyvr11kh",lg:"fyvr11ki",xl:"fyvr11kj"},defaultClass:"fyvr11kg"}}},alignItems:{values:{"flex-start":{conditions:{sm:"fyvr11kk",md:"fyvr11kl",lg:"fyvr11km",xl:"fyvr11kn"},defaultClass:"fyvr11kk"},center:{conditions:{sm:"fyvr11ko",md:"fyvr11kp",lg:"fyvr11kq",xl:"fyvr11kr"},defaultClass:"fyvr11ko"},"flex-end":{conditions:{sm:"fyvr11ks",md:"fyvr11kt",lg:"fyvr11ku",xl:"fyvr11kv"},defaultClass:"fyvr11ks"},stretch:{conditions:{sm:"fyvr11kw",md:"fyvr11kx",lg:"fyvr11ky",xl:"fyvr11kz"},defaultClass:"fyvr11kw"},baseline:{conditions:{sm:"fyvr11l0",md:"fyvr11l1",lg:"fyvr11l2",xl:"fyvr11l3"},defaultClass:"fyvr11l0"}}},alignSelf:{values:{"flex-start":{conditions:{sm:"fyvr11l4",md:"fyvr11l5",lg:"fyvr11l6",xl:"fyvr11l7"},defaultClass:"fyvr11l4"},center:{conditions:{sm:"fyvr11l8",md:"fyvr11l9",lg:"fyvr11la",xl:"fyvr11lb"},defaultClass:"fyvr11l8"},"flex-end":{conditions:{sm:"fyvr11lc",md:"fyvr11ld",lg:"fyvr11le",xl:"fyvr11lf"},defaultClass:"fyvr11lc"},stretch:{conditions:{sm:"fyvr11lg",md:"fyvr11lh",lg:"fyvr11li",xl:"fyvr11lj"},defaultClass:"fyvr11lg"},baseline:{conditions:{sm:"fyvr11lk",md:"fyvr11ll",lg:"fyvr11lm",xl:"fyvr11ln"},defaultClass:"fyvr11lk"}}},overflowX:{values:{auto:{conditions:{sm:"fyvr11lo",md:"fyvr11lp",lg:"fyvr11lq",xl:"fyvr11lr"},defaultClass:"fyvr11lo"},hidden:{conditions:{sm:"fyvr11ls",md:"fyvr11lt",lg:"fyvr11lu",xl:"fyvr11lv"},defaultClass:"fyvr11ls"},scroll:{conditions:{sm:"fyvr11lw",md:"fyvr11lx",lg:"fyvr11ly",xl:"fyvr11lz"},defaultClass:"fyvr11lw"},visible:{conditions:{sm:"fyvr11m0",md:"fyvr11m1",lg:"fyvr11m2",xl:"fyvr11m3"},defaultClass:"fyvr11m0"}}},overflowY:{values:{auto:{conditions:{sm:"fyvr11m4",md:"fyvr11m5",lg:"fyvr11m6",xl:"fyvr11m7"},defaultClass:"fyvr11m4"},hidden:{conditions:{sm:"fyvr11m8",md:"fyvr11m9",lg:"fyvr11ma",xl:"fyvr11mb"},defaultClass:"fyvr11m8"},scroll:{conditions:{sm:"fyvr11mc",md:"fyvr11md",lg:"fyvr11me",xl:"fyvr11mf"},defaultClass:"fyvr11mc"},visible:{conditions:{sm:"fyvr11mg",md:"fyvr11mh",lg:"fyvr11mi",xl:"fyvr11mj"},defaultClass:"fyvr11mg"}}},visibility:{values:{hidden:{conditions:{sm:"fyvr11mk",md:"fyvr11ml",lg:"fyvr11mm",xl:"fyvr11mn"},defaultClass:"fyvr11mk"},visible:{conditions:{sm:"fyvr11mo",md:"fyvr11mp",lg:"fyvr11mq",xl:"fyvr11mr"},defaultClass:"fyvr11mo"}}}}},{conditions:void 0,styles:{backdropFilter:{values:{blur:{defaultClass:"fyvr11ms"},none:{defaultClass:"fyvr11mt"}}},fontFamily:{values:{inherit:{defaultClass:"fyvr11mu"},body:{defaultClass:"fyvr11mv"},mono:{defaultClass:"fyvr11mw"}}},textOverflow:{values:{ellipsis:{defaultClass:"fyvr11mx"},clip:{defaultClass:"fyvr11my"}}},textTransform:{values:{capitalize:{defaultClass:"fyvr11mz"},lowercase:{defaultClass:"fyvr11n0"},uppercase:{defaultClass:"fyvr11n1"}}},userSelect:{values:{none:{defaultClass:"fyvr11n2"},text:{defaultClass:"fyvr11n3"},all:{defaultClass:"fyvr11n4"},auto:{defaultClass:"fyvr11n5"}}},whiteSpace:{values:{normal:{defaultClass:"fyvr11n6"},nowrap:{defaultClass:"fyvr11n7"},initial:{defaultClass:"fyvr11n8"},inherit:{defaultClass:"fyvr11n9"}}},wordBreak:{values:{"break-word":{defaultClass:"fyvr11na"}}},wordWrap:{values:{normal:{defaultClass:"fyvr11nb"},"break-word":{defaultClass:"fyvr11nc"},initial:{defaultClass:"fyvr11nd"},inherit:{defaultClass:"fyvr11ne"}}},zIndex:{values:{0:{defaultClass:"fyvr11nf"},1:{defaultClass:"fyvr11ng"},10:{defaultClass:"fyvr11nh"},20:{defaultClass:"fyvr11ni"},30:{defaultClass:"fyvr11nj"},40:{defaultClass:"fyvr11nk"},50:{defaultClass:"fyvr11nl"},"-1":{defaultClass:"fyvr11nm"},auto:{defaultClass:"fyvr11nn"}}},aspectRatio:{values:{"1/1":{defaultClass:"fyvr11no"},"16/9":{defaultClass:"fyvr11np"},"4/3":{defaultClass:"fyvr11nq"},"3/1":{defaultClass:"fyvr11nr"},auto:{defaultClass:"fyvr11ns"}}}}},{conditions:{defaultCondition:"base",conditionNames:["base","active","disabled","focus","hover","checked"],responsiveArray:void 0},styles:{borderColor:{mappings:["borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]},borderStyle:{mappings:["borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle"]},focusRing:{mappings:["boxShadow","outline"]},background:{values:{black:{conditions:{base:"fyvr11nt",active:"fyvr11nu",disabled:"fyvr11nv",focus:"fyvr11nw",hover:"fyvr11nx",checked:"fyvr11ny"},defaultClass:"fyvr11nt"},white:{conditions:{base:"fyvr11nz",active:"fyvr11o0",disabled:"fyvr11o1",focus:"fyvr11o2",hover:"fyvr11o3",checked:"fyvr11o4"},defaultClass:"fyvr11nz"},inherit:{conditions:{base:"fyvr11o5",active:"fyvr11o6",disabled:"fyvr11o7",focus:"fyvr11o8",hover:"fyvr11o9",checked:"fyvr11oa"},defaultClass:"fyvr11o5"},transparent:{conditions:{base:"fyvr11ob",active:"fyvr11oc",disabled:"fyvr11od",focus:"fyvr11oe",hover:"fyvr11of",checked:"fyvr11og"},defaultClass:"fyvr11ob"},positive:{conditions:{base:"fyvr11oh",active:"fyvr11oi",disabled:"fyvr11oj",focus:"fyvr11ok",hover:"fyvr11ol",checked:"fyvr11om"},defaultClass:"fyvr11oh"},negative:{conditions:{base:"fyvr11on",active:"fyvr11oo",disabled:"fyvr11op",focus:"fyvr11oq",hover:"fyvr11or",checked:"fyvr11os"},defaultClass:"fyvr11on"},info:{conditions:{base:"fyvr11ot",active:"fyvr11ou",disabled:"fyvr11ov",focus:"fyvr11ow",hover:"fyvr11ox",checked:"fyvr11oy"},defaultClass:"fyvr11ot"},warning:{conditions:{base:"fyvr11oz",active:"fyvr11p0",disabled:"fyvr11p1",focus:"fyvr11p2",hover:"fyvr11p3",checked:"fyvr11p4"},defaultClass:"fyvr11oz"},gradientBackdrop:{conditions:{base:"fyvr11p5",active:"fyvr11p6",disabled:"fyvr11p7",focus:"fyvr11p8",hover:"fyvr11p9",checked:"fyvr11pa"},defaultClass:"fyvr11p5"},gradientPrimary:{conditions:{base:"fyvr11pb",active:"fyvr11pc",disabled:"fyvr11pd",focus:"fyvr11pe",hover:"fyvr11pf",checked:"fyvr11pg"},defaultClass:"fyvr11pb"},gradientSecondary:{conditions:{base:"fyvr11ph",active:"fyvr11pi",disabled:"fyvr11pj",focus:"fyvr11pk",hover:"fyvr11pl",checked:"fyvr11pm"},defaultClass:"fyvr11ph"},arbitrumDark:{conditions:{base:"fyvr11pn",active:"fyvr11po",disabled:"fyvr11pp",focus:"fyvr11pq",hover:"fyvr11pr",checked:"fyvr11ps"},defaultClass:"fyvr11pn"},arbitrumLight:{conditions:{base:"fyvr11pt",active:"fyvr11pu",disabled:"fyvr11pv",focus:"fyvr11pw",hover:"fyvr11px",checked:"fyvr11py"},defaultClass:"fyvr11pt"},avalanceDark:{conditions:{base:"fyvr11pz",active:"fyvr11q0",disabled:"fyvr11q1",focus:"fyvr11q2",hover:"fyvr11q3",checked:"fyvr11q4"},defaultClass:"fyvr11pz"},avalanceLight:{conditions:{base:"fyvr11q5",active:"fyvr11q6",disabled:"fyvr11q7",focus:"fyvr11q8",hover:"fyvr11q9",checked:"fyvr11qa"},defaultClass:"fyvr11q5"},bscDark:{conditions:{base:"fyvr11qb",active:"fyvr11qc",disabled:"fyvr11qd",focus:"fyvr11qe",hover:"fyvr11qf",checked:"fyvr11qg"},defaultClass:"fyvr11qb"},bscLight:{conditions:{base:"fyvr11qh",active:"fyvr11qi",disabled:"fyvr11qj",focus:"fyvr11qk",hover:"fyvr11ql",checked:"fyvr11qm"},defaultClass:"fyvr11qh"},ethereumDark:{conditions:{base:"fyvr11qn",active:"fyvr11qo",disabled:"fyvr11qp",focus:"fyvr11qq",hover:"fyvr11qr",checked:"fyvr11qs"},defaultClass:"fyvr11qn"},ethereumLight:{conditions:{base:"fyvr11qt",active:"fyvr11qu",disabled:"fyvr11qv",focus:"fyvr11qw",hover:"fyvr11qx",checked:"fyvr11qy"},defaultClass:"fyvr11qt"},gnosisDark:{conditions:{base:"fyvr11qz",active:"fyvr11r0",disabled:"fyvr11r1",focus:"fyvr11r2",hover:"fyvr11r3",checked:"fyvr11r4"},defaultClass:"fyvr11qz"},gnosisLight:{conditions:{base:"fyvr11r5",active:"fyvr11r6",disabled:"fyvr11r7",focus:"fyvr11r8",hover:"fyvr11r9",checked:"fyvr11ra"},defaultClass:"fyvr11r5"},polygonDark:{conditions:{base:"fyvr11rb",active:"fyvr11rc",disabled:"fyvr11rd",focus:"fyvr11re",hover:"fyvr11rf",checked:"fyvr11rg"},defaultClass:"fyvr11rb"},polygonLight:{conditions:{base:"fyvr11rh",active:"fyvr11ri",disabled:"fyvr11rj",focus:"fyvr11rk",hover:"fyvr11rl",checked:"fyvr11rm"},defaultClass:"fyvr11rh"},text100:{conditions:{base:"fyvr11rn",active:"fyvr11ro",disabled:"fyvr11rp",focus:"fyvr11rq",hover:"fyvr11rr",checked:"fyvr11rs"},defaultClass:"fyvr11rn"},text80:{conditions:{base:"fyvr11rt",active:"fyvr11ru",disabled:"fyvr11rv",focus:"fyvr11rw",hover:"fyvr11rx",checked:"fyvr11ry"},defaultClass:"fyvr11rt"},text50:{conditions:{base:"fyvr11rz",active:"fyvr11s0",disabled:"fyvr11s1",focus:"fyvr11s2",hover:"fyvr11s3",checked:"fyvr11s4"},defaultClass:"fyvr11rz"},textInverse100:{conditions:{base:"fyvr11s5",active:"fyvr11s6",disabled:"fyvr11s7",focus:"fyvr11s8",hover:"fyvr11s9",checked:"fyvr11sa"},defaultClass:"fyvr11s5"},backgroundPrimary:{conditions:{base:"fyvr11sb",active:"fyvr11sc",disabled:"fyvr11sd",focus:"fyvr11se",hover:"fyvr11sf",checked:"fyvr11sg"},defaultClass:"fyvr11sb"},backgroundSecondary:{conditions:{base:"fyvr11sh",active:"fyvr11si",disabled:"fyvr11sj",focus:"fyvr11sk",hover:"fyvr11sl",checked:"fyvr11sm"},defaultClass:"fyvr11sh"},backgroundContrast:{conditions:{base:"fyvr11sn",active:"fyvr11so",disabled:"fyvr11sp",focus:"fyvr11sq",hover:"fyvr11sr",checked:"fyvr11ss"},defaultClass:"fyvr11sn"},backgroundMuted:{conditions:{base:"fyvr11st",active:"fyvr11su",disabled:"fyvr11sv",focus:"fyvr11sw",hover:"fyvr11sx",checked:"fyvr11sy"},defaultClass:"fyvr11st"},backgroundControl:{conditions:{base:"fyvr11sz",active:"fyvr11t0",disabled:"fyvr11t1",focus:"fyvr11t2",hover:"fyvr11t3",checked:"fyvr11t4"},defaultClass:"fyvr11sz"},backgroundInverse:{conditions:{base:"fyvr11t5",active:"fyvr11t6",disabled:"fyvr11t7",focus:"fyvr11t8",hover:"fyvr11t9",checked:"fyvr11ta"},defaultClass:"fyvr11t5"},backgroundBackdrop:{conditions:{base:"fyvr11tb",active:"fyvr11tc",disabled:"fyvr11td",focus:"fyvr11te",hover:"fyvr11tf",checked:"fyvr11tg"},defaultClass:"fyvr11tb"},backgroundOverlay:{conditions:{base:"fyvr11th",active:"fyvr11ti",disabled:"fyvr11tj",focus:"fyvr11tk",hover:"fyvr11tl",checked:"fyvr11tm"},defaultClass:"fyvr11th"},backgroundRaised:{conditions:{base:"fyvr11tn",active:"fyvr11to",disabled:"fyvr11tp",focus:"fyvr11tq",hover:"fyvr11tr",checked:"fyvr11ts"},defaultClass:"fyvr11tn"},buttonGlass:{conditions:{base:"fyvr11tt",active:"fyvr11tu",disabled:"fyvr11tv",focus:"fyvr11tw",hover:"fyvr11tx",checked:"fyvr11ty"},defaultClass:"fyvr11tt"},buttonEmphasis:{conditions:{base:"fyvr11tz",active:"fyvr11u0",disabled:"fyvr11u1",focus:"fyvr11u2",hover:"fyvr11u3",checked:"fyvr11u4"},defaultClass:"fyvr11tz"},buttonInverse:{conditions:{base:"fyvr11u5",active:"fyvr11u6",disabled:"fyvr11u7",focus:"fyvr11u8",hover:"fyvr11u9",checked:"fyvr11ua"},defaultClass:"fyvr11u5"},borderNormal:{conditions:{base:"fyvr11ub",active:"fyvr11uc",disabled:"fyvr11ud",focus:"fyvr11ue",hover:"fyvr11uf",checked:"fyvr11ug"},defaultClass:"fyvr11ub"},borderFocus:{conditions:{base:"fyvr11uh",active:"fyvr11ui",disabled:"fyvr11uj",focus:"fyvr11uk",hover:"fyvr11ul",checked:"fyvr11um"},defaultClass:"fyvr11uh"}}},borderBottomColor:{values:{black:{conditions:{base:"fyvr11un",active:"fyvr11uo",disabled:"fyvr11up",focus:"fyvr11uq",hover:"fyvr11ur",checked:"fyvr11us"},defaultClass:"fyvr11un"},white:{conditions:{base:"fyvr11ut",active:"fyvr11uu",disabled:"fyvr11uv",focus:"fyvr11uw",hover:"fyvr11ux",checked:"fyvr11uy"},defaultClass:"fyvr11ut"},inherit:{conditions:{base:"fyvr11uz",active:"fyvr11v0",disabled:"fyvr11v1",focus:"fyvr11v2",hover:"fyvr11v3",checked:"fyvr11v4"},defaultClass:"fyvr11uz"},transparent:{conditions:{base:"fyvr11v5",active:"fyvr11v6",disabled:"fyvr11v7",focus:"fyvr11v8",hover:"fyvr11v9",checked:"fyvr11va"},defaultClass:"fyvr11v5"},positive:{conditions:{base:"fyvr11vb",active:"fyvr11vc",disabled:"fyvr11vd",focus:"fyvr11ve",hover:"fyvr11vf",checked:"fyvr11vg"},defaultClass:"fyvr11vb"},negative:{conditions:{base:"fyvr11vh",active:"fyvr11vi",disabled:"fyvr11vj",focus:"fyvr11vk",hover:"fyvr11vl",checked:"fyvr11vm"},defaultClass:"fyvr11vh"},info:{conditions:{base:"fyvr11vn",active:"fyvr11vo",disabled:"fyvr11vp",focus:"fyvr11vq",hover:"fyvr11vr",checked:"fyvr11vs"},defaultClass:"fyvr11vn"},warning:{conditions:{base:"fyvr11vt",active:"fyvr11vu",disabled:"fyvr11vv",focus:"fyvr11vw",hover:"fyvr11vx",checked:"fyvr11vy"},defaultClass:"fyvr11vt"},gradientBackdrop:{conditions:{base:"fyvr11vz",active:"fyvr11w0",disabled:"fyvr11w1",focus:"fyvr11w2",hover:"fyvr11w3",checked:"fyvr11w4"},defaultClass:"fyvr11vz"},gradientPrimary:{conditions:{base:"fyvr11w5",active:"fyvr11w6",disabled:"fyvr11w7",focus:"fyvr11w8",hover:"fyvr11w9",checked:"fyvr11wa"},defaultClass:"fyvr11w5"},gradientSecondary:{conditions:{base:"fyvr11wb",active:"fyvr11wc",disabled:"fyvr11wd",focus:"fyvr11we",hover:"fyvr11wf",checked:"fyvr11wg"},defaultClass:"fyvr11wb"},arbitrumDark:{conditions:{base:"fyvr11wh",active:"fyvr11wi",disabled:"fyvr11wj",focus:"fyvr11wk",hover:"fyvr11wl",checked:"fyvr11wm"},defaultClass:"fyvr11wh"},arbitrumLight:{conditions:{base:"fyvr11wn",active:"fyvr11wo",disabled:"fyvr11wp",focus:"fyvr11wq",hover:"fyvr11wr",checked:"fyvr11ws"},defaultClass:"fyvr11wn"},avalanceDark:{conditions:{base:"fyvr11wt",active:"fyvr11wu",disabled:"fyvr11wv",focus:"fyvr11ww",hover:"fyvr11wx",checked:"fyvr11wy"},defaultClass:"fyvr11wt"},avalanceLight:{conditions:{base:"fyvr11wz",active:"fyvr11x0",disabled:"fyvr11x1",focus:"fyvr11x2",hover:"fyvr11x3",checked:"fyvr11x4"},defaultClass:"fyvr11wz"},bscDark:{conditions:{base:"fyvr11x5",active:"fyvr11x6",disabled:"fyvr11x7",focus:"fyvr11x8",hover:"fyvr11x9",checked:"fyvr11xa"},defaultClass:"fyvr11x5"},bscLight:{conditions:{base:"fyvr11xb",active:"fyvr11xc",disabled:"fyvr11xd",focus:"fyvr11xe",hover:"fyvr11xf",checked:"fyvr11xg"},defaultClass:"fyvr11xb"},ethereumDark:{conditions:{base:"fyvr11xh",active:"fyvr11xi",disabled:"fyvr11xj",focus:"fyvr11xk",hover:"fyvr11xl",checked:"fyvr11xm"},defaultClass:"fyvr11xh"},ethereumLight:{conditions:{base:"fyvr11xn",active:"fyvr11xo",disabled:"fyvr11xp",focus:"fyvr11xq",hover:"fyvr11xr",checked:"fyvr11xs"},defaultClass:"fyvr11xn"},gnosisDark:{conditions:{base:"fyvr11xt",active:"fyvr11xu",disabled:"fyvr11xv",focus:"fyvr11xw",hover:"fyvr11xx",checked:"fyvr11xy"},defaultClass:"fyvr11xt"},gnosisLight:{conditions:{base:"fyvr11xz",active:"fyvr11y0",disabled:"fyvr11y1",focus:"fyvr11y2",hover:"fyvr11y3",checked:"fyvr11y4"},defaultClass:"fyvr11xz"},polygonDark:{conditions:{base:"fyvr11y5",active:"fyvr11y6",disabled:"fyvr11y7",focus:"fyvr11y8",hover:"fyvr11y9",checked:"fyvr11ya"},defaultClass:"fyvr11y5"},polygonLight:{conditions:{base:"fyvr11yb",active:"fyvr11yc",disabled:"fyvr11yd",focus:"fyvr11ye",hover:"fyvr11yf",checked:"fyvr11yg"},defaultClass:"fyvr11yb"},text100:{conditions:{base:"fyvr11yh",active:"fyvr11yi",disabled:"fyvr11yj",focus:"fyvr11yk",hover:"fyvr11yl",checked:"fyvr11ym"},defaultClass:"fyvr11yh"},text80:{conditions:{base:"fyvr11yn",active:"fyvr11yo",disabled:"fyvr11yp",focus:"fyvr11yq",hover:"fyvr11yr",checked:"fyvr11ys"},defaultClass:"fyvr11yn"},text50:{conditions:{base:"fyvr11yt",active:"fyvr11yu",disabled:"fyvr11yv",focus:"fyvr11yw",hover:"fyvr11yx",checked:"fyvr11yy"},defaultClass:"fyvr11yt"},textInverse100:{conditions:{base:"fyvr11yz",active:"fyvr11z0",disabled:"fyvr11z1",focus:"fyvr11z2",hover:"fyvr11z3",checked:"fyvr11z4"},defaultClass:"fyvr11yz"},backgroundPrimary:{conditions:{base:"fyvr11z5",active:"fyvr11z6",disabled:"fyvr11z7",focus:"fyvr11z8",hover:"fyvr11z9",checked:"fyvr11za"},defaultClass:"fyvr11z5"},backgroundSecondary:{conditions:{base:"fyvr11zb",active:"fyvr11zc",disabled:"fyvr11zd",focus:"fyvr11ze",hover:"fyvr11zf",checked:"fyvr11zg"},defaultClass:"fyvr11zb"},backgroundContrast:{conditions:{base:"fyvr11zh",active:"fyvr11zi",disabled:"fyvr11zj",focus:"fyvr11zk",hover:"fyvr11zl",checked:"fyvr11zm"},defaultClass:"fyvr11zh"},backgroundMuted:{conditions:{base:"fyvr11zn",active:"fyvr11zo",disabled:"fyvr11zp",focus:"fyvr11zq",hover:"fyvr11zr",checked:"fyvr11zs"},defaultClass:"fyvr11zn"},backgroundControl:{conditions:{base:"fyvr11zt",active:"fyvr11zu",disabled:"fyvr11zv",focus:"fyvr11zw",hover:"fyvr11zx",checked:"fyvr11zy"},defaultClass:"fyvr11zt"},backgroundInverse:{conditions:{base:"fyvr11zz",active:"fyvr1200",disabled:"fyvr1201",focus:"fyvr1202",hover:"fyvr1203",checked:"fyvr1204"},defaultClass:"fyvr11zz"},backgroundBackdrop:{conditions:{base:"fyvr1205",active:"fyvr1206",disabled:"fyvr1207",focus:"fyvr1208",hover:"fyvr1209",checked:"fyvr120a"},defaultClass:"fyvr1205"},backgroundOverlay:{conditions:{base:"fyvr120b",active:"fyvr120c",disabled:"fyvr120d",focus:"fyvr120e",hover:"fyvr120f",checked:"fyvr120g"},defaultClass:"fyvr120b"},backgroundRaised:{conditions:{base:"fyvr120h",active:"fyvr120i",disabled:"fyvr120j",focus:"fyvr120k",hover:"fyvr120l",checked:"fyvr120m"},defaultClass:"fyvr120h"},buttonGlass:{conditions:{base:"fyvr120n",active:"fyvr120o",disabled:"fyvr120p",focus:"fyvr120q",hover:"fyvr120r",checked:"fyvr120s"},defaultClass:"fyvr120n"},buttonEmphasis:{conditions:{base:"fyvr120t",active:"fyvr120u",disabled:"fyvr120v",focus:"fyvr120w",hover:"fyvr120x",checked:"fyvr120y"},defaultClass:"fyvr120t"},buttonInverse:{conditions:{base:"fyvr120z",active:"fyvr1210",disabled:"fyvr1211",focus:"fyvr1212",hover:"fyvr1213",checked:"fyvr1214"},defaultClass:"fyvr120z"},borderNormal:{conditions:{base:"fyvr1215",active:"fyvr1216",disabled:"fyvr1217",focus:"fyvr1218",hover:"fyvr1219",checked:"fyvr121a"},defaultClass:"fyvr1215"},borderFocus:{conditions:{base:"fyvr121b",active:"fyvr121c",disabled:"fyvr121d",focus:"fyvr121e",hover:"fyvr121f",checked:"fyvr121g"},defaultClass:"fyvr121b"}}},borderBottomStyle:{values:{solid:{conditions:{base:"fyvr121h",active:"fyvr121i",disabled:"fyvr121j",focus:"fyvr121k",hover:"fyvr121l",checked:"fyvr121m"},defaultClass:"fyvr121h"},dashed:{conditions:{base:"fyvr121n",active:"fyvr121o",disabled:"fyvr121p",focus:"fyvr121q",hover:"fyvr121r",checked:"fyvr121s"},defaultClass:"fyvr121n"},dotted:{conditions:{base:"fyvr121t",active:"fyvr121u",disabled:"fyvr121v",focus:"fyvr121w",hover:"fyvr121x",checked:"fyvr121y"},defaultClass:"fyvr121t"}}},borderLeftColor:{values:{black:{conditions:{base:"fyvr121z",active:"fyvr1220",disabled:"fyvr1221",focus:"fyvr1222",hover:"fyvr1223",checked:"fyvr1224"},defaultClass:"fyvr121z"},white:{conditions:{base:"fyvr1225",active:"fyvr1226",disabled:"fyvr1227",focus:"fyvr1228",hover:"fyvr1229",checked:"fyvr122a"},defaultClass:"fyvr1225"},inherit:{conditions:{base:"fyvr122b",active:"fyvr122c",disabled:"fyvr122d",focus:"fyvr122e",hover:"fyvr122f",checked:"fyvr122g"},defaultClass:"fyvr122b"},transparent:{conditions:{base:"fyvr122h",active:"fyvr122i",disabled:"fyvr122j",focus:"fyvr122k",hover:"fyvr122l",checked:"fyvr122m"},defaultClass:"fyvr122h"},positive:{conditions:{base:"fyvr122n",active:"fyvr122o",disabled:"fyvr122p",focus:"fyvr122q",hover:"fyvr122r",checked:"fyvr122s"},defaultClass:"fyvr122n"},negative:{conditions:{base:"fyvr122t",active:"fyvr122u",disabled:"fyvr122v",focus:"fyvr122w",hover:"fyvr122x",checked:"fyvr122y"},defaultClass:"fyvr122t"},info:{conditions:{base:"fyvr122z",active:"fyvr1230",disabled:"fyvr1231",focus:"fyvr1232",hover:"fyvr1233",checked:"fyvr1234"},defaultClass:"fyvr122z"},warning:{conditions:{base:"fyvr1235",active:"fyvr1236",disabled:"fyvr1237",focus:"fyvr1238",hover:"fyvr1239",checked:"fyvr123a"},defaultClass:"fyvr1235"},gradientBackdrop:{conditions:{base:"fyvr123b",active:"fyvr123c",disabled:"fyvr123d",focus:"fyvr123e",hover:"fyvr123f",checked:"fyvr123g"},defaultClass:"fyvr123b"},gradientPrimary:{conditions:{base:"fyvr123h",active:"fyvr123i",disabled:"fyvr123j",focus:"fyvr123k",hover:"fyvr123l",checked:"fyvr123m"},defaultClass:"fyvr123h"},gradientSecondary:{conditions:{base:"fyvr123n",active:"fyvr123o",disabled:"fyvr123p",focus:"fyvr123q",hover:"fyvr123r",checked:"fyvr123s"},defaultClass:"fyvr123n"},arbitrumDark:{conditions:{base:"fyvr123t",active:"fyvr123u",disabled:"fyvr123v",focus:"fyvr123w",hover:"fyvr123x",checked:"fyvr123y"},defaultClass:"fyvr123t"},arbitrumLight:{conditions:{base:"fyvr123z",active:"fyvr1240",disabled:"fyvr1241",focus:"fyvr1242",hover:"fyvr1243",checked:"fyvr1244"},defaultClass:"fyvr123z"},avalanceDark:{conditions:{base:"fyvr1245",active:"fyvr1246",disabled:"fyvr1247",focus:"fyvr1248",hover:"fyvr1249",checked:"fyvr124a"},defaultClass:"fyvr1245"},avalanceLight:{conditions:{base:"fyvr124b",active:"fyvr124c",disabled:"fyvr124d",focus:"fyvr124e",hover:"fyvr124f",checked:"fyvr124g"},defaultClass:"fyvr124b"},bscDark:{conditions:{base:"fyvr124h",active:"fyvr124i",disabled:"fyvr124j",focus:"fyvr124k",hover:"fyvr124l",checked:"fyvr124m"},defaultClass:"fyvr124h"},bscLight:{conditions:{base:"fyvr124n",active:"fyvr124o",disabled:"fyvr124p",focus:"fyvr124q",hover:"fyvr124r",checked:"fyvr124s"},defaultClass:"fyvr124n"},ethereumDark:{conditions:{base:"fyvr124t",active:"fyvr124u",disabled:"fyvr124v",focus:"fyvr124w",hover:"fyvr124x",checked:"fyvr124y"},defaultClass:"fyvr124t"},ethereumLight:{conditions:{base:"fyvr124z",active:"fyvr1250",disabled:"fyvr1251",focus:"fyvr1252",hover:"fyvr1253",checked:"fyvr1254"},defaultClass:"fyvr124z"},gnosisDark:{conditions:{base:"fyvr1255",active:"fyvr1256",disabled:"fyvr1257",focus:"fyvr1258",hover:"fyvr1259",checked:"fyvr125a"},defaultClass:"fyvr1255"},gnosisLight:{conditions:{base:"fyvr125b",active:"fyvr125c",disabled:"fyvr125d",focus:"fyvr125e",hover:"fyvr125f",checked:"fyvr125g"},defaultClass:"fyvr125b"},polygonDark:{conditions:{base:"fyvr125h",active:"fyvr125i",disabled:"fyvr125j",focus:"fyvr125k",hover:"fyvr125l",checked:"fyvr125m"},defaultClass:"fyvr125h"},polygonLight:{conditions:{base:"fyvr125n",active:"fyvr125o",disabled:"fyvr125p",focus:"fyvr125q",hover:"fyvr125r",checked:"fyvr125s"},defaultClass:"fyvr125n"},text100:{conditions:{base:"fyvr125t",active:"fyvr125u",disabled:"fyvr125v",focus:"fyvr125w",hover:"fyvr125x",checked:"fyvr125y"},defaultClass:"fyvr125t"},text80:{conditions:{base:"fyvr125z",active:"fyvr1260",disabled:"fyvr1261",focus:"fyvr1262",hover:"fyvr1263",checked:"fyvr1264"},defaultClass:"fyvr125z"},text50:{conditions:{base:"fyvr1265",active:"fyvr1266",disabled:"fyvr1267",focus:"fyvr1268",hover:"fyvr1269",checked:"fyvr126a"},defaultClass:"fyvr1265"},textInverse100:{conditions:{base:"fyvr126b",active:"fyvr126c",disabled:"fyvr126d",focus:"fyvr126e",hover:"fyvr126f",checked:"fyvr126g"},defaultClass:"fyvr126b"},backgroundPrimary:{conditions:{base:"fyvr126h",active:"fyvr126i",disabled:"fyvr126j",focus:"fyvr126k",hover:"fyvr126l",checked:"fyvr126m"},defaultClass:"fyvr126h"},backgroundSecondary:{conditions:{base:"fyvr126n",active:"fyvr126o",disabled:"fyvr126p",focus:"fyvr126q",hover:"fyvr126r",checked:"fyvr126s"},defaultClass:"fyvr126n"},backgroundContrast:{conditions:{base:"fyvr126t",active:"fyvr126u",disabled:"fyvr126v",focus:"fyvr126w",hover:"fyvr126x",checked:"fyvr126y"},defaultClass:"fyvr126t"},backgroundMuted:{conditions:{base:"fyvr126z",active:"fyvr1270",disabled:"fyvr1271",focus:"fyvr1272",hover:"fyvr1273",checked:"fyvr1274"},defaultClass:"fyvr126z"},backgroundControl:{conditions:{base:"fyvr1275",active:"fyvr1276",disabled:"fyvr1277",focus:"fyvr1278",hover:"fyvr1279",checked:"fyvr127a"},defaultClass:"fyvr1275"},backgroundInverse:{conditions:{base:"fyvr127b",active:"fyvr127c",disabled:"fyvr127d",focus:"fyvr127e",hover:"fyvr127f",checked:"fyvr127g"},defaultClass:"fyvr127b"},backgroundBackdrop:{conditions:{base:"fyvr127h",active:"fyvr127i",disabled:"fyvr127j",focus:"fyvr127k",hover:"fyvr127l",checked:"fyvr127m"},defaultClass:"fyvr127h"},backgroundOverlay:{conditions:{base:"fyvr127n",active:"fyvr127o",disabled:"fyvr127p",focus:"fyvr127q",hover:"fyvr127r",checked:"fyvr127s"},defaultClass:"fyvr127n"},backgroundRaised:{conditions:{base:"fyvr127t",active:"fyvr127u",disabled:"fyvr127v",focus:"fyvr127w",hover:"fyvr127x",checked:"fyvr127y"},defaultClass:"fyvr127t"},buttonGlass:{conditions:{base:"fyvr127z",active:"fyvr1280",disabled:"fyvr1281",focus:"fyvr1282",hover:"fyvr1283",checked:"fyvr1284"},defaultClass:"fyvr127z"},buttonEmphasis:{conditions:{base:"fyvr1285",active:"fyvr1286",disabled:"fyvr1287",focus:"fyvr1288",hover:"fyvr1289",checked:"fyvr128a"},defaultClass:"fyvr1285"},buttonInverse:{conditions:{base:"fyvr128b",active:"fyvr128c",disabled:"fyvr128d",focus:"fyvr128e",hover:"fyvr128f",checked:"fyvr128g"},defaultClass:"fyvr128b"},borderNormal:{conditions:{base:"fyvr128h",active:"fyvr128i",disabled:"fyvr128j",focus:"fyvr128k",hover:"fyvr128l",checked:"fyvr128m"},defaultClass:"fyvr128h"},borderFocus:{conditions:{base:"fyvr128n",active:"fyvr128o",disabled:"fyvr128p",focus:"fyvr128q",hover:"fyvr128r",checked:"fyvr128s"},defaultClass:"fyvr128n"}}},borderLeftStyle:{values:{solid:{conditions:{base:"fyvr128t",active:"fyvr128u",disabled:"fyvr128v",focus:"fyvr128w",hover:"fyvr128x",checked:"fyvr128y"},defaultClass:"fyvr128t"},dashed:{conditions:{base:"fyvr128z",active:"fyvr1290",disabled:"fyvr1291",focus:"fyvr1292",hover:"fyvr1293",checked:"fyvr1294"},defaultClass:"fyvr128z"},dotted:{conditions:{base:"fyvr1295",active:"fyvr1296",disabled:"fyvr1297",focus:"fyvr1298",hover:"fyvr1299",checked:"fyvr129a"},defaultClass:"fyvr1295"}}},borderRightColor:{values:{black:{conditions:{base:"fyvr129b",active:"fyvr129c",disabled:"fyvr129d",focus:"fyvr129e",hover:"fyvr129f",checked:"fyvr129g"},defaultClass:"fyvr129b"},white:{conditions:{base:"fyvr129h",active:"fyvr129i",disabled:"fyvr129j",focus:"fyvr129k",hover:"fyvr129l",checked:"fyvr129m"},defaultClass:"fyvr129h"},inherit:{conditions:{base:"fyvr129n",active:"fyvr129o",disabled:"fyvr129p",focus:"fyvr129q",hover:"fyvr129r",checked:"fyvr129s"},defaultClass:"fyvr129n"},transparent:{conditions:{base:"fyvr129t",active:"fyvr129u",disabled:"fyvr129v",focus:"fyvr129w",hover:"fyvr129x",checked:"fyvr129y"},defaultClass:"fyvr129t"},positive:{conditions:{base:"fyvr129z",active:"fyvr12a0",disabled:"fyvr12a1",focus:"fyvr12a2",hover:"fyvr12a3",checked:"fyvr12a4"},defaultClass:"fyvr129z"},negative:{conditions:{base:"fyvr12a5",active:"fyvr12a6",disabled:"fyvr12a7",focus:"fyvr12a8",hover:"fyvr12a9",checked:"fyvr12aa"},defaultClass:"fyvr12a5"},info:{conditions:{base:"fyvr12ab",active:"fyvr12ac",disabled:"fyvr12ad",focus:"fyvr12ae",hover:"fyvr12af",checked:"fyvr12ag"},defaultClass:"fyvr12ab"},warning:{conditions:{base:"fyvr12ah",active:"fyvr12ai",disabled:"fyvr12aj",focus:"fyvr12ak",hover:"fyvr12al",checked:"fyvr12am"},defaultClass:"fyvr12ah"},gradientBackdrop:{conditions:{base:"fyvr12an",active:"fyvr12ao",disabled:"fyvr12ap",focus:"fyvr12aq",hover:"fyvr12ar",checked:"fyvr12as"},defaultClass:"fyvr12an"},gradientPrimary:{conditions:{base:"fyvr12at",active:"fyvr12au",disabled:"fyvr12av",focus:"fyvr12aw",hover:"fyvr12ax",checked:"fyvr12ay"},defaultClass:"fyvr12at"},gradientSecondary:{conditions:{base:"fyvr12az",active:"fyvr12b0",disabled:"fyvr12b1",focus:"fyvr12b2",hover:"fyvr12b3",checked:"fyvr12b4"},defaultClass:"fyvr12az"},arbitrumDark:{conditions:{base:"fyvr12b5",active:"fyvr12b6",disabled:"fyvr12b7",focus:"fyvr12b8",hover:"fyvr12b9",checked:"fyvr12ba"},defaultClass:"fyvr12b5"},arbitrumLight:{conditions:{base:"fyvr12bb",active:"fyvr12bc",disabled:"fyvr12bd",focus:"fyvr12be",hover:"fyvr12bf",checked:"fyvr12bg"},defaultClass:"fyvr12bb"},avalanceDark:{conditions:{base:"fyvr12bh",active:"fyvr12bi",disabled:"fyvr12bj",focus:"fyvr12bk",hover:"fyvr12bl",checked:"fyvr12bm"},defaultClass:"fyvr12bh"},avalanceLight:{conditions:{base:"fyvr12bn",active:"fyvr12bo",disabled:"fyvr12bp",focus:"fyvr12bq",hover:"fyvr12br",checked:"fyvr12bs"},defaultClass:"fyvr12bn"},bscDark:{conditions:{base:"fyvr12bt",active:"fyvr12bu",disabled:"fyvr12bv",focus:"fyvr12bw",hover:"fyvr12bx",checked:"fyvr12by"},defaultClass:"fyvr12bt"},bscLight:{conditions:{base:"fyvr12bz",active:"fyvr12c0",disabled:"fyvr12c1",focus:"fyvr12c2",hover:"fyvr12c3",checked:"fyvr12c4"},defaultClass:"fyvr12bz"},ethereumDark:{conditions:{base:"fyvr12c5",active:"fyvr12c6",disabled:"fyvr12c7",focus:"fyvr12c8",hover:"fyvr12c9",checked:"fyvr12ca"},defaultClass:"fyvr12c5"},ethereumLight:{conditions:{base:"fyvr12cb",active:"fyvr12cc",disabled:"fyvr12cd",focus:"fyvr12ce",hover:"fyvr12cf",checked:"fyvr12cg"},defaultClass:"fyvr12cb"},gnosisDark:{conditions:{base:"fyvr12ch",active:"fyvr12ci",disabled:"fyvr12cj",focus:"fyvr12ck",hover:"fyvr12cl",checked:"fyvr12cm"},defaultClass:"fyvr12ch"},gnosisLight:{conditions:{base:"fyvr12cn",active:"fyvr12co",disabled:"fyvr12cp",focus:"fyvr12cq",hover:"fyvr12cr",checked:"fyvr12cs"},defaultClass:"fyvr12cn"},polygonDark:{conditions:{base:"fyvr12ct",active:"fyvr12cu",disabled:"fyvr12cv",focus:"fyvr12cw",hover:"fyvr12cx",checked:"fyvr12cy"},defaultClass:"fyvr12ct"},polygonLight:{conditions:{base:"fyvr12cz",active:"fyvr12d0",disabled:"fyvr12d1",focus:"fyvr12d2",hover:"fyvr12d3",checked:"fyvr12d4"},defaultClass:"fyvr12cz"},text100:{conditions:{base:"fyvr12d5",active:"fyvr12d6",disabled:"fyvr12d7",focus:"fyvr12d8",hover:"fyvr12d9",checked:"fyvr12da"},defaultClass:"fyvr12d5"},text80:{conditions:{base:"fyvr12db",active:"fyvr12dc",disabled:"fyvr12dd",focus:"fyvr12de",hover:"fyvr12df",checked:"fyvr12dg"},defaultClass:"fyvr12db"},text50:{conditions:{base:"fyvr12dh",active:"fyvr12di",disabled:"fyvr12dj",focus:"fyvr12dk",hover:"fyvr12dl",checked:"fyvr12dm"},defaultClass:"fyvr12dh"},textInverse100:{conditions:{base:"fyvr12dn",active:"fyvr12do",disabled:"fyvr12dp",focus:"fyvr12dq",hover:"fyvr12dr",checked:"fyvr12ds"},defaultClass:"fyvr12dn"},backgroundPrimary:{conditions:{base:"fyvr12dt",active:"fyvr12du",disabled:"fyvr12dv",focus:"fyvr12dw",hover:"fyvr12dx",checked:"fyvr12dy"},defaultClass:"fyvr12dt"},backgroundSecondary:{conditions:{base:"fyvr12dz",active:"fyvr12e0",disabled:"fyvr12e1",focus:"fyvr12e2",hover:"fyvr12e3",checked:"fyvr12e4"},defaultClass:"fyvr12dz"},backgroundContrast:{conditions:{base:"fyvr12e5",active:"fyvr12e6",disabled:"fyvr12e7",focus:"fyvr12e8",hover:"fyvr12e9",checked:"fyvr12ea"},defaultClass:"fyvr12e5"},backgroundMuted:{conditions:{base:"fyvr12eb",active:"fyvr12ec",disabled:"fyvr12ed",focus:"fyvr12ee",hover:"fyvr12ef",checked:"fyvr12eg"},defaultClass:"fyvr12eb"},backgroundControl:{conditions:{base:"fyvr12eh",active:"fyvr12ei",disabled:"fyvr12ej",focus:"fyvr12ek",hover:"fyvr12el",checked:"fyvr12em"},defaultClass:"fyvr12eh"},backgroundInverse:{conditions:{base:"fyvr12en",active:"fyvr12eo",disabled:"fyvr12ep",focus:"fyvr12eq",hover:"fyvr12er",checked:"fyvr12es"},defaultClass:"fyvr12en"},backgroundBackdrop:{conditions:{base:"fyvr12et",active:"fyvr12eu",disabled:"fyvr12ev",focus:"fyvr12ew",hover:"fyvr12ex",checked:"fyvr12ey"},defaultClass:"fyvr12et"},backgroundOverlay:{conditions:{base:"fyvr12ez",active:"fyvr12f0",disabled:"fyvr12f1",focus:"fyvr12f2",hover:"fyvr12f3",checked:"fyvr12f4"},defaultClass:"fyvr12ez"},backgroundRaised:{conditions:{base:"fyvr12f5",active:"fyvr12f6",disabled:"fyvr12f7",focus:"fyvr12f8",hover:"fyvr12f9",checked:"fyvr12fa"},defaultClass:"fyvr12f5"},buttonGlass:{conditions:{base:"fyvr12fb",active:"fyvr12fc",disabled:"fyvr12fd",focus:"fyvr12fe",hover:"fyvr12ff",checked:"fyvr12fg"},defaultClass:"fyvr12fb"},buttonEmphasis:{conditions:{base:"fyvr12fh",active:"fyvr12fi",disabled:"fyvr12fj",focus:"fyvr12fk",hover:"fyvr12fl",checked:"fyvr12fm"},defaultClass:"fyvr12fh"},buttonInverse:{conditions:{base:"fyvr12fn",active:"fyvr12fo",disabled:"fyvr12fp",focus:"fyvr12fq",hover:"fyvr12fr",checked:"fyvr12fs"},defaultClass:"fyvr12fn"},borderNormal:{conditions:{base:"fyvr12ft",active:"fyvr12fu",disabled:"fyvr12fv",focus:"fyvr12fw",hover:"fyvr12fx",checked:"fyvr12fy"},defaultClass:"fyvr12ft"},borderFocus:{conditions:{base:"fyvr12fz",active:"fyvr12g0",disabled:"fyvr12g1",focus:"fyvr12g2",hover:"fyvr12g3",checked:"fyvr12g4"},defaultClass:"fyvr12fz"}}},borderRightStyle:{values:{solid:{conditions:{base:"fyvr12g5",active:"fyvr12g6",disabled:"fyvr12g7",focus:"fyvr12g8",hover:"fyvr12g9",checked:"fyvr12ga"},defaultClass:"fyvr12g5"},dashed:{conditions:{base:"fyvr12gb",active:"fyvr12gc",disabled:"fyvr12gd",focus:"fyvr12ge",hover:"fyvr12gf",checked:"fyvr12gg"},defaultClass:"fyvr12gb"},dotted:{conditions:{base:"fyvr12gh",active:"fyvr12gi",disabled:"fyvr12gj",focus:"fyvr12gk",hover:"fyvr12gl",checked:"fyvr12gm"},defaultClass:"fyvr12gh"}}},borderTopColor:{values:{black:{conditions:{base:"fyvr12gn",active:"fyvr12go",disabled:"fyvr12gp",focus:"fyvr12gq",hover:"fyvr12gr",checked:"fyvr12gs"},defaultClass:"fyvr12gn"},white:{conditions:{base:"fyvr12gt",active:"fyvr12gu",disabled:"fyvr12gv",focus:"fyvr12gw",hover:"fyvr12gx",checked:"fyvr12gy"},defaultClass:"fyvr12gt"},inherit:{conditions:{base:"fyvr12gz",active:"fyvr12h0",disabled:"fyvr12h1",focus:"fyvr12h2",hover:"fyvr12h3",checked:"fyvr12h4"},defaultClass:"fyvr12gz"},transparent:{conditions:{base:"fyvr12h5",active:"fyvr12h6",disabled:"fyvr12h7",focus:"fyvr12h8",hover:"fyvr12h9",checked:"fyvr12ha"},defaultClass:"fyvr12h5"},positive:{conditions:{base:"fyvr12hb",active:"fyvr12hc",disabled:"fyvr12hd",focus:"fyvr12he",hover:"fyvr12hf",checked:"fyvr12hg"},defaultClass:"fyvr12hb"},negative:{conditions:{base:"fyvr12hh",active:"fyvr12hi",disabled:"fyvr12hj",focus:"fyvr12hk",hover:"fyvr12hl",checked:"fyvr12hm"},defaultClass:"fyvr12hh"},info:{conditions:{base:"fyvr12hn",active:"fyvr12ho",disabled:"fyvr12hp",focus:"fyvr12hq",hover:"fyvr12hr",checked:"fyvr12hs"},defaultClass:"fyvr12hn"},warning:{conditions:{base:"fyvr12ht",active:"fyvr12hu",disabled:"fyvr12hv",focus:"fyvr12hw",hover:"fyvr12hx",checked:"fyvr12hy"},defaultClass:"fyvr12ht"},gradientBackdrop:{conditions:{base:"fyvr12hz",active:"fyvr12i0",disabled:"fyvr12i1",focus:"fyvr12i2",hover:"fyvr12i3",checked:"fyvr12i4"},defaultClass:"fyvr12hz"},gradientPrimary:{conditions:{base:"fyvr12i5",active:"fyvr12i6",disabled:"fyvr12i7",focus:"fyvr12i8",hover:"fyvr12i9",checked:"fyvr12ia"},defaultClass:"fyvr12i5"},gradientSecondary:{conditions:{base:"fyvr12ib",active:"fyvr12ic",disabled:"fyvr12id",focus:"fyvr12ie",hover:"fyvr12if",checked:"fyvr12ig"},defaultClass:"fyvr12ib"},arbitrumDark:{conditions:{base:"fyvr12ih",active:"fyvr12ii",disabled:"fyvr12ij",focus:"fyvr12ik",hover:"fyvr12il",checked:"fyvr12im"},defaultClass:"fyvr12ih"},arbitrumLight:{conditions:{base:"fyvr12in",active:"fyvr12io",disabled:"fyvr12ip",focus:"fyvr12iq",hover:"fyvr12ir",checked:"fyvr12is"},defaultClass:"fyvr12in"},avalanceDark:{conditions:{base:"fyvr12it",active:"fyvr12iu",disabled:"fyvr12iv",focus:"fyvr12iw",hover:"fyvr12ix",checked:"fyvr12iy"},defaultClass:"fyvr12it"},avalanceLight:{conditions:{base:"fyvr12iz",active:"fyvr12j0",disabled:"fyvr12j1",focus:"fyvr12j2",hover:"fyvr12j3",checked:"fyvr12j4"},defaultClass:"fyvr12iz"},bscDark:{conditions:{base:"fyvr12j5",active:"fyvr12j6",disabled:"fyvr12j7",focus:"fyvr12j8",hover:"fyvr12j9",checked:"fyvr12ja"},defaultClass:"fyvr12j5"},bscLight:{conditions:{base:"fyvr12jb",active:"fyvr12jc",disabled:"fyvr12jd",focus:"fyvr12je",hover:"fyvr12jf",checked:"fyvr12jg"},defaultClass:"fyvr12jb"},ethereumDark:{conditions:{base:"fyvr12jh",active:"fyvr12ji",disabled:"fyvr12jj",focus:"fyvr12jk",hover:"fyvr12jl",checked:"fyvr12jm"},defaultClass:"fyvr12jh"},ethereumLight:{conditions:{base:"fyvr12jn",active:"fyvr12jo",disabled:"fyvr12jp",focus:"fyvr12jq",hover:"fyvr12jr",checked:"fyvr12js"},defaultClass:"fyvr12jn"},gnosisDark:{conditions:{base:"fyvr12jt",active:"fyvr12ju",disabled:"fyvr12jv",focus:"fyvr12jw",hover:"fyvr12jx",checked:"fyvr12jy"},defaultClass:"fyvr12jt"},gnosisLight:{conditions:{base:"fyvr12jz",active:"fyvr12k0",disabled:"fyvr12k1",focus:"fyvr12k2",hover:"fyvr12k3",checked:"fyvr12k4"},defaultClass:"fyvr12jz"},polygonDark:{conditions:{base:"fyvr12k5",active:"fyvr12k6",disabled:"fyvr12k7",focus:"fyvr12k8",hover:"fyvr12k9",checked:"fyvr12ka"},defaultClass:"fyvr12k5"},polygonLight:{conditions:{base:"fyvr12kb",active:"fyvr12kc",disabled:"fyvr12kd",focus:"fyvr12ke",hover:"fyvr12kf",checked:"fyvr12kg"},defaultClass:"fyvr12kb"},text100:{conditions:{base:"fyvr12kh",active:"fyvr12ki",disabled:"fyvr12kj",focus:"fyvr12kk",hover:"fyvr12kl",checked:"fyvr12km"},defaultClass:"fyvr12kh"},text80:{conditions:{base:"fyvr12kn",active:"fyvr12ko",disabled:"fyvr12kp",focus:"fyvr12kq",hover:"fyvr12kr",checked:"fyvr12ks"},defaultClass:"fyvr12kn"},text50:{conditions:{base:"fyvr12kt",active:"fyvr12ku",disabled:"fyvr12kv",focus:"fyvr12kw",hover:"fyvr12kx",checked:"fyvr12ky"},defaultClass:"fyvr12kt"},textInverse100:{conditions:{base:"fyvr12kz",active:"fyvr12l0",disabled:"fyvr12l1",focus:"fyvr12l2",hover:"fyvr12l3",checked:"fyvr12l4"},defaultClass:"fyvr12kz"},backgroundPrimary:{conditions:{base:"fyvr12l5",active:"fyvr12l6",disabled:"fyvr12l7",focus:"fyvr12l8",hover:"fyvr12l9",checked:"fyvr12la"},defaultClass:"fyvr12l5"},backgroundSecondary:{conditions:{base:"fyvr12lb",active:"fyvr12lc",disabled:"fyvr12ld",focus:"fyvr12le",hover:"fyvr12lf",checked:"fyvr12lg"},defaultClass:"fyvr12lb"},backgroundContrast:{conditions:{base:"fyvr12lh",active:"fyvr12li",disabled:"fyvr12lj",focus:"fyvr12lk",hover:"fyvr12ll",checked:"fyvr12lm"},defaultClass:"fyvr12lh"},backgroundMuted:{conditions:{base:"fyvr12ln",active:"fyvr12lo",disabled:"fyvr12lp",focus:"fyvr12lq",hover:"fyvr12lr",checked:"fyvr12ls"},defaultClass:"fyvr12ln"},backgroundControl:{conditions:{base:"fyvr12lt",active:"fyvr12lu",disabled:"fyvr12lv",focus:"fyvr12lw",hover:"fyvr12lx",checked:"fyvr12ly"},defaultClass:"fyvr12lt"},backgroundInverse:{conditions:{base:"fyvr12lz",active:"fyvr12m0",disabled:"fyvr12m1",focus:"fyvr12m2",hover:"fyvr12m3",checked:"fyvr12m4"},defaultClass:"fyvr12lz"},backgroundBackdrop:{conditions:{base:"fyvr12m5",active:"fyvr12m6",disabled:"fyvr12m7",focus:"fyvr12m8",hover:"fyvr12m9",checked:"fyvr12ma"},defaultClass:"fyvr12m5"},backgroundOverlay:{conditions:{base:"fyvr12mb",active:"fyvr12mc",disabled:"fyvr12md",focus:"fyvr12me",hover:"fyvr12mf",checked:"fyvr12mg"},defaultClass:"fyvr12mb"},backgroundRaised:{conditions:{base:"fyvr12mh",active:"fyvr12mi",disabled:"fyvr12mj",focus:"fyvr12mk",hover:"fyvr12ml",checked:"fyvr12mm"},defaultClass:"fyvr12mh"},buttonGlass:{conditions:{base:"fyvr12mn",active:"fyvr12mo",disabled:"fyvr12mp",focus:"fyvr12mq",hover:"fyvr12mr",checked:"fyvr12ms"},defaultClass:"fyvr12mn"},buttonEmphasis:{conditions:{base:"fyvr12mt",active:"fyvr12mu",disabled:"fyvr12mv",focus:"fyvr12mw",hover:"fyvr12mx",checked:"fyvr12my"},defaultClass:"fyvr12mt"},buttonInverse:{conditions:{base:"fyvr12mz",active:"fyvr12n0",disabled:"fyvr12n1",focus:"fyvr12n2",hover:"fyvr12n3",checked:"fyvr12n4"},defaultClass:"fyvr12mz"},borderNormal:{conditions:{base:"fyvr12n5",active:"fyvr12n6",disabled:"fyvr12n7",focus:"fyvr12n8",hover:"fyvr12n9",checked:"fyvr12na"},defaultClass:"fyvr12n5"},borderFocus:{conditions:{base:"fyvr12nb",active:"fyvr12nc",disabled:"fyvr12nd",focus:"fyvr12ne",hover:"fyvr12nf",checked:"fyvr12ng"},defaultClass:"fyvr12nb"}}},borderTopStyle:{values:{solid:{conditions:{base:"fyvr12nh",active:"fyvr12ni",disabled:"fyvr12nj",focus:"fyvr12nk",hover:"fyvr12nl",checked:"fyvr12nm"},defaultClass:"fyvr12nh"},dashed:{conditions:{base:"fyvr12nn",active:"fyvr12no",disabled:"fyvr12np",focus:"fyvr12nq",hover:"fyvr12nr",checked:"fyvr12ns"},defaultClass:"fyvr12nn"},dotted:{conditions:{base:"fyvr12nt",active:"fyvr12nu",disabled:"fyvr12nv",focus:"fyvr12nw",hover:"fyvr12nx",checked:"fyvr12ny"},defaultClass:"fyvr12nt"}}},color:{values:{black:{conditions:{base:"fyvr12nz",active:"fyvr12o0",disabled:"fyvr12o1",focus:"fyvr12o2",hover:"fyvr12o3",checked:"fyvr12o4"},defaultClass:"fyvr12nz"},white:{conditions:{base:"fyvr12o5",active:"fyvr12o6",disabled:"fyvr12o7",focus:"fyvr12o8",hover:"fyvr12o9",checked:"fyvr12oa"},defaultClass:"fyvr12o5"},inherit:{conditions:{base:"fyvr12ob",active:"fyvr12oc",disabled:"fyvr12od",focus:"fyvr12oe",hover:"fyvr12of",checked:"fyvr12og"},defaultClass:"fyvr12ob"},transparent:{conditions:{base:"fyvr12oh",active:"fyvr12oi",disabled:"fyvr12oj",focus:"fyvr12ok",hover:"fyvr12ol",checked:"fyvr12om"},defaultClass:"fyvr12oh"},positive:{conditions:{base:"fyvr12on",active:"fyvr12oo",disabled:"fyvr12op",focus:"fyvr12oq",hover:"fyvr12or",checked:"fyvr12os"},defaultClass:"fyvr12on"},negative:{conditions:{base:"fyvr12ot",active:"fyvr12ou",disabled:"fyvr12ov",focus:"fyvr12ow",hover:"fyvr12ox",checked:"fyvr12oy"},defaultClass:"fyvr12ot"},info:{conditions:{base:"fyvr12oz",active:"fyvr12p0",disabled:"fyvr12p1",focus:"fyvr12p2",hover:"fyvr12p3",checked:"fyvr12p4"},defaultClass:"fyvr12oz"},warning:{conditions:{base:"fyvr12p5",active:"fyvr12p6",disabled:"fyvr12p7",focus:"fyvr12p8",hover:"fyvr12p9",checked:"fyvr12pa"},defaultClass:"fyvr12p5"},gradientBackdrop:{conditions:{base:"fyvr12pb",active:"fyvr12pc",disabled:"fyvr12pd",focus:"fyvr12pe",hover:"fyvr12pf",checked:"fyvr12pg"},defaultClass:"fyvr12pb"},gradientPrimary:{conditions:{base:"fyvr12ph",active:"fyvr12pi",disabled:"fyvr12pj",focus:"fyvr12pk",hover:"fyvr12pl",checked:"fyvr12pm"},defaultClass:"fyvr12ph"},gradientSecondary:{conditions:{base:"fyvr12pn",active:"fyvr12po",disabled:"fyvr12pp",focus:"fyvr12pq",hover:"fyvr12pr",checked:"fyvr12ps"},defaultClass:"fyvr12pn"},arbitrumDark:{conditions:{base:"fyvr12pt",active:"fyvr12pu",disabled:"fyvr12pv",focus:"fyvr12pw",hover:"fyvr12px",checked:"fyvr12py"},defaultClass:"fyvr12pt"},arbitrumLight:{conditions:{base:"fyvr12pz",active:"fyvr12q0",disabled:"fyvr12q1",focus:"fyvr12q2",hover:"fyvr12q3",checked:"fyvr12q4"},defaultClass:"fyvr12pz"},avalanceDark:{conditions:{base:"fyvr12q5",active:"fyvr12q6",disabled:"fyvr12q7",focus:"fyvr12q8",hover:"fyvr12q9",checked:"fyvr12qa"},defaultClass:"fyvr12q5"},avalanceLight:{conditions:{base:"fyvr12qb",active:"fyvr12qc",disabled:"fyvr12qd",focus:"fyvr12qe",hover:"fyvr12qf",checked:"fyvr12qg"},defaultClass:"fyvr12qb"},bscDark:{conditions:{base:"fyvr12qh",active:"fyvr12qi",disabled:"fyvr12qj",focus:"fyvr12qk",hover:"fyvr12ql",checked:"fyvr12qm"},defaultClass:"fyvr12qh"},bscLight:{conditions:{base:"fyvr12qn",active:"fyvr12qo",disabled:"fyvr12qp",focus:"fyvr12qq",hover:"fyvr12qr",checked:"fyvr12qs"},defaultClass:"fyvr12qn"},ethereumDark:{conditions:{base:"fyvr12qt",active:"fyvr12qu",disabled:"fyvr12qv",focus:"fyvr12qw",hover:"fyvr12qx",checked:"fyvr12qy"},defaultClass:"fyvr12qt"},ethereumLight:{conditions:{base:"fyvr12qz",active:"fyvr12r0",disabled:"fyvr12r1",focus:"fyvr12r2",hover:"fyvr12r3",checked:"fyvr12r4"},defaultClass:"fyvr12qz"},gnosisDark:{conditions:{base:"fyvr12r5",active:"fyvr12r6",disabled:"fyvr12r7",focus:"fyvr12r8",hover:"fyvr12r9",checked:"fyvr12ra"},defaultClass:"fyvr12r5"},gnosisLight:{conditions:{base:"fyvr12rb",active:"fyvr12rc",disabled:"fyvr12rd",focus:"fyvr12re",hover:"fyvr12rf",checked:"fyvr12rg"},defaultClass:"fyvr12rb"},polygonDark:{conditions:{base:"fyvr12rh",active:"fyvr12ri",disabled:"fyvr12rj",focus:"fyvr12rk",hover:"fyvr12rl",checked:"fyvr12rm"},defaultClass:"fyvr12rh"},polygonLight:{conditions:{base:"fyvr12rn",active:"fyvr12ro",disabled:"fyvr12rp",focus:"fyvr12rq",hover:"fyvr12rr",checked:"fyvr12rs"},defaultClass:"fyvr12rn"},text100:{conditions:{base:"fyvr12rt",active:"fyvr12ru",disabled:"fyvr12rv",focus:"fyvr12rw",hover:"fyvr12rx",checked:"fyvr12ry"},defaultClass:"fyvr12rt"},text80:{conditions:{base:"fyvr12rz",active:"fyvr12s0",disabled:"fyvr12s1",focus:"fyvr12s2",hover:"fyvr12s3",checked:"fyvr12s4"},defaultClass:"fyvr12rz"},text50:{conditions:{base:"fyvr12s5",active:"fyvr12s6",disabled:"fyvr12s7",focus:"fyvr12s8",hover:"fyvr12s9",checked:"fyvr12sa"},defaultClass:"fyvr12s5"},textInverse100:{conditions:{base:"fyvr12sb",active:"fyvr12sc",disabled:"fyvr12sd",focus:"fyvr12se",hover:"fyvr12sf",checked:"fyvr12sg"},defaultClass:"fyvr12sb"},backgroundPrimary:{conditions:{base:"fyvr12sh",active:"fyvr12si",disabled:"fyvr12sj",focus:"fyvr12sk",hover:"fyvr12sl",checked:"fyvr12sm"},defaultClass:"fyvr12sh"},backgroundSecondary:{conditions:{base:"fyvr12sn",active:"fyvr12so",disabled:"fyvr12sp",focus:"fyvr12sq",hover:"fyvr12sr",checked:"fyvr12ss"},defaultClass:"fyvr12sn"},backgroundContrast:{conditions:{base:"fyvr12st",active:"fyvr12su",disabled:"fyvr12sv",focus:"fyvr12sw",hover:"fyvr12sx",checked:"fyvr12sy"},defaultClass:"fyvr12st"},backgroundMuted:{conditions:{base:"fyvr12sz",active:"fyvr12t0",disabled:"fyvr12t1",focus:"fyvr12t2",hover:"fyvr12t3",checked:"fyvr12t4"},defaultClass:"fyvr12sz"},backgroundControl:{conditions:{base:"fyvr12t5",active:"fyvr12t6",disabled:"fyvr12t7",focus:"fyvr12t8",hover:"fyvr12t9",checked:"fyvr12ta"},defaultClass:"fyvr12t5"},backgroundInverse:{conditions:{base:"fyvr12tb",active:"fyvr12tc",disabled:"fyvr12td",focus:"fyvr12te",hover:"fyvr12tf",checked:"fyvr12tg"},defaultClass:"fyvr12tb"},backgroundBackdrop:{conditions:{base:"fyvr12th",active:"fyvr12ti",disabled:"fyvr12tj",focus:"fyvr12tk",hover:"fyvr12tl",checked:"fyvr12tm"},defaultClass:"fyvr12th"},backgroundOverlay:{conditions:{base:"fyvr12tn",active:"fyvr12to",disabled:"fyvr12tp",focus:"fyvr12tq",hover:"fyvr12tr",checked:"fyvr12ts"},defaultClass:"fyvr12tn"},backgroundRaised:{conditions:{base:"fyvr12tt",active:"fyvr12tu",disabled:"fyvr12tv",focus:"fyvr12tw",hover:"fyvr12tx",checked:"fyvr12ty"},defaultClass:"fyvr12tt"},buttonGlass:{conditions:{base:"fyvr12tz",active:"fyvr12u0",disabled:"fyvr12u1",focus:"fyvr12u2",hover:"fyvr12u3",checked:"fyvr12u4"},defaultClass:"fyvr12tz"},buttonEmphasis:{conditions:{base:"fyvr12u5",active:"fyvr12u6",disabled:"fyvr12u7",focus:"fyvr12u8",hover:"fyvr12u9",checked:"fyvr12ua"},defaultClass:"fyvr12u5"},buttonInverse:{conditions:{base:"fyvr12ub",active:"fyvr12uc",disabled:"fyvr12ud",focus:"fyvr12ue",hover:"fyvr12uf",checked:"fyvr12ug"},defaultClass:"fyvr12ub"},borderNormal:{conditions:{base:"fyvr12uh",active:"fyvr12ui",disabled:"fyvr12uj",focus:"fyvr12uk",hover:"fyvr12ul",checked:"fyvr12um"},defaultClass:"fyvr12uh"},borderFocus:{conditions:{base:"fyvr12un",active:"fyvr12uo",disabled:"fyvr12up",focus:"fyvr12uq",hover:"fyvr12ur",checked:"fyvr12us"},defaultClass:"fyvr12un"}}},cursor:{values:{default:{conditions:{base:"fyvr12ut",active:"fyvr12uu",disabled:"fyvr12uv",focus:"fyvr12uw",hover:"fyvr12ux",checked:"fyvr12uy"},defaultClass:"fyvr12ut"},pointer:{conditions:{base:"fyvr12uz",active:"fyvr12v0",disabled:"fyvr12v1",focus:"fyvr12v2",hover:"fyvr12v3",checked:"fyvr12v4"},defaultClass:"fyvr12uz"},text:{conditions:{base:"fyvr12v5",active:"fyvr12v6",disabled:"fyvr12v7",focus:"fyvr12v8",hover:"fyvr12v9",checked:"fyvr12va"},defaultClass:"fyvr12v5"}}},opacity:{values:{0:{conditions:{base:"fyvr12vb",active:"fyvr12vc",disabled:"fyvr12vd",focus:"fyvr12ve",hover:"fyvr12vf",checked:"fyvr12vg"},defaultClass:"fyvr12vb"},50:{conditions:{base:"fyvr12vh",active:"fyvr12vi",disabled:"fyvr12vj",focus:"fyvr12vk",hover:"fyvr12vl",checked:"fyvr12vm"},defaultClass:"fyvr12vh"},80:{conditions:{base:"fyvr12vn",active:"fyvr12vo",disabled:"fyvr12vp",focus:"fyvr12vq",hover:"fyvr12vr",checked:"fyvr12vs"},defaultClass:"fyvr12vn"},100:{conditions:{base:"fyvr12vt",active:"fyvr12vu",disabled:"fyvr12vv",focus:"fyvr12vw",hover:"fyvr12vx",checked:"fyvr12vy"},defaultClass:"fyvr12vt"}}},pointerEvents:{values:{none:{conditions:{base:"fyvr12vz",active:"fyvr12w0",disabled:"fyvr12w1",focus:"fyvr12w2",hover:"fyvr12w3",checked:"fyvr12w4"},defaultClass:"fyvr12vz"},auto:{conditions:{base:"fyvr12w5",active:"fyvr12w6",disabled:"fyvr12w7",focus:"fyvr12w8",hover:"fyvr12w9",checked:"fyvr12wa"},defaultClass:"fyvr12w5"}}},outline:{values:{none:{conditions:{base:"fyvr12wb",active:"fyvr12wc",disabled:"fyvr12wd",focus:"fyvr12we",hover:"fyvr12wf",checked:"fyvr12wg"},defaultClass:"fyvr12wb"}}},boxShadow:{values:{none:{conditions:{base:"fyvr12wh",active:"fyvr12wi",disabled:"fyvr12wj",focus:"fyvr12wk",hover:"fyvr12wl",checked:"fyvr12wm"},defaultClass:"fyvr12wh"}}}}});const Jke=["alignItems","alignSelf","flexDirection","gap","justifyContent","justifySelf","placeItems"],XI=t=>(t.display||(t.display=Object.keys(t).some(e=>Jke.includes(e))?"flex":void 0),Kne(t));XI.properties=Kne.properties;function Jne(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e{const{as:r="div",sx:n={},className:i,...s}=t,o={},a={};for(const l in s)XI.properties.has(l)?o[l]=s[l]:a[l]=s[l];const c=XI({...o,...n});return $.createElement(r,{className:fa(c,i),...a,ref:e})});var Qne={exports:{}},Zv={};/** + * @license React + * react-jsx-runtime.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Az;function Qke(){if(Az)return Zv;Az=1;var t=O,e=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(a,c,l){var u,f={},d=null,p=null;l!==void 0&&(d=""+l),c.key!==void 0&&(d=""+c.key),c.ref!==void 0&&(p=c.ref);for(u in c)n.call(c,u)&&!s.hasOwnProperty(u)&&(f[u]=c[u]);if(a&&a.defaultProps)for(u in c=a.defaultProps,c)f[u]===void 0&&(f[u]=c[u]);return{$$typeof:e,type:a,key:d,ref:p,props:f,_owner:i.current}}return Zv.Fragment=r,Zv.jsx=o,Zv.jsxs=o,Zv}Qne.exports=Qke();var me=Qne.exports;function Yke(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Zke(t){var e=Yke(t,"string");return typeof e=="symbol"?e:String(e)}function Xke(t,e,r){return e=Zke(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function kz(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Iz(t){for(var e=1;e{for(var n of Object.keys(t)){var i;if(t[n]!==((i=e[n])!==null&&i!==void 0?i:r[n]))return!1}return!0},On=t=>{var e=r=>{var n=t.defaultClassName,i=Iz(Iz({},t.defaultVariants),r);for(var s in i){var o,a=(o=i[s])!==null&&o!==void 0?o:t.defaultVariants[s];if(a!=null){var c=a;typeof c=="boolean"&&(c=c===!0?"true":"false");var l=t.variantClassNames[s][c];l&&(n+=" "+l)}}for(var[u,f]of t.compoundVariants)eIe(u,i,t.defaultVariants)&&(n+=" "+f);return n};return e.variants=()=>Object.keys(t.variantClassNames),e.classNames={get base(){return t.defaultClassName.split(" ")[0]},get variants(){return Pz(t.variantClassNames,r=>Pz(r,n=>n.split(" ")[0]))}},e};On({defaultClassName:"_2q9vfj7",variantClassNames:{variant:{info:"fyvr11ot",warning:"fyvr11oz",success:"fyvr11oh",error:"fyvr11on"},size:{sm:"_1qxj1ib9 fyvr11mv fyvr11ec fyvr11fw fyvr11fs fyvr11f4 fyvr1wo fyvr1yk fyvr13w fyvr1e8",md:"_1qxj1ib9 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 fyvr1ws fyvr1yo fyvr140 fyvr1ec",lg:"_1qxj1ib9 fyvr11mv fyvr11ek fyvr11g4 fyvr11fo fyvr11fc fyvr1ww fyvr1ys fyvr144 fyvr1eg"}},defaultVariants:{},compoundVariants:[]});const Xb=t=>{const{color:e="backgroundMuted",marginY:r="4",...n}=t;return me.jsx(ae,{as:"hr",marginY:r,background:e,height:"px",borderWidth:"none",...n})};var tIe=On({defaultClassName:"_1qxj1ib9",variantClassNames:{variant:{inherit:"fyvr11mu fyvr11e4 fyvr11gg fyvr11fg fyvr11ew",xlarge:"fyvr11mv fyvr11es fyvr11gc fyvr11fk fyvr11fc",large:"fyvr11mv fyvr11eo fyvr11g8 fyvr11fo fyvr11f8",medium:"fyvr11mv fyvr11ek fyvr11g4 fyvr11fo fyvr11fc",normal:"fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0",small:"fyvr11mv fyvr11ec fyvr11fw fyvr11fs fyvr11f4",xsmall:"fyvr11mv fyvr11e8 fyvr11fw fyvr11fs fyvr11fc",code:"fyvr11mw fyvr11eg fyvr11g0 fyvr11fk fyvr11f0"},ellipsis:{true:"fyvr11ls fyvr11m8 fyvr11n7 fyvr11mx"},italic:{true:"_1qxj1ibj"},underline:{true:"_1qxj1ibk"},uppercase:{true:"_1qxj1ibl"},capitalize:{true:"_1qxj1ibm"},hidden:{true:"_1qxj1ibn"}},defaultVariants:{},compoundVariants:[]});const Pe=$.forwardRef((t,e)=>{const{as:r="span",variant:n="inherit",className:i,hidden:s,italic:o,underline:a,children:c,ellipsis:l,uppercase:u,capitalize:f,...d}=t,p=zke[n];return me.jsx(ae,{as:r,className:fa(i,tIe({hidden:s,ellipsis:l,italic:o,underline:a,uppercase:u,capitalize:f})),ref:e,...p,...d,children:c})});var rIe=On({defaultClassName:"_140wn8ng fyvr11ls fyvr11m8 fyvr11n7 fyvr11ko fyvr11h0",variantClassNames:{variant:{base:"_140wn8nh",feature:"_140wn8ni fyvr11ph fyvr12o5",primary:"fyvr11pb fyvr12o5",glass:"fyvr11tt fyvr12rt",emphasis:"fyvr11tz fyvr12rt",raised:"fyvr11tn fyvr12rt",danger:"fyvr11on fyvr12o5",text:"_140wn8no _1qxj1ib9 fyvr11mv fyvr11ec fyvr11fw fyvr11fs fyvr11f4 fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr11ob fyvr12s5"},shape:{circle:"fyvr11dc fyvr11e0 fyvr11c0 fyvr11co",square:"fyvr11d0 fyvr11do fyvr11bo fyvr11cc"},disabled:{true:"fyvr12ut fyvr12vh",false:"fyvr12uz fyvr12vt fyvr12vr"},size:{xs:"_140wn8nt _1qxj1ib9 fyvr11mv fyvr11e8 fyvr11fw fyvr11fs fyvr11fc fyvr1ws fyvr1yo",sm:"_140wn8nu _1qxj1ib9 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 fyvr1ww fyvr1ys",md:"_140wn8nv _1qxj1ib9 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 fyvr1x0 fyvr1yw",lg:"_140wn8nw _1qxj1ib9 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 fyvr1x0 fyvr1yw"},iconOnly:{true:"_140wn8nx"},hasLeftIcon:{true:"_140wn8ny"},hasRightIcon:{true:"_140wn8nz"},activeOutline:{light:"_140wn8n10",bold:"_140wn8n11"}},defaultVariants:{},compoundVariants:[[{iconOnly:!0,size:"xs"},"_140wn8n12"],[{iconOnly:!0,size:"sm"},"_140wn8n13"],[{iconOnly:!0,size:"md"},"_140wn8n14"],[{iconOnly:!0,size:"lg"},"_140wn8n15"],[{iconOnly:!1,hasLeftIcon:!0,size:"xs"},"_140wn8n16"],[{iconOnly:!1,hasLeftIcon:!0,size:"sm"},"_140wn8n17"],[{iconOnly:!1,hasLeftIcon:!0,size:"md"},"_140wn8n18"],[{iconOnly:!1,hasRightIcon:!0,size:"xs"},"_140wn8n19"],[{iconOnly:!1,hasRightIcon:!0,size:"sm"},"_140wn8n1a"],[{iconOnly:!1,hasRightIcon:!0,size:"md"},"_140wn8n1b"]]});const Sr=$.forwardRef((t,e)=>{const{as:r="button",activeOutline:n,className:i,disabled:s=!1,display:o="inline-flex",fontWeight:a="bold",pending:c=!1,label:l,leftIcon:u,rightIcon:f,size:d="md",variant:p="glass",width:g="fit",shape:v="circle",type:y="button",...b}=t,w=u!==void 0&&l!==void 0,E=f!==void 0&&l!==void 0,C=u!==void 0&&l===void 0,S=d==="xs"?"xs":"sm";return me.jsx(ae,{as:r,className:fa(i,rIe({activeOutline:n,disabled:s||c,hasLeftIcon:w,hasRightIcon:E,iconOnly:C,size:p==="text"?void 0:d,shape:p==="text"?void 0:v,variant:p})),disabled:s||c,display:o,fontWeight:a,ref:e,type:y,width:g,...b,children:C?me.jsx(u,{size:S}):me.jsxs(ae,{width:"full",height:"full",justifyContent:"space-between",alignItems:"center",gap:d==="xs"?"1":"2",children:[me.jsxs(ae,{justifyContent:"flex-start",alignItems:"center",gap:d==="xs"?"1":"2",children:[u&&me.jsx(u,{size:S}),me.jsx(Pe,{children:l})]}),f&&me.jsx(f,{size:S})]})})});var nIe=On({defaultClassName:"rhmai63",variantClassNames:{clickable:{true:"fyvr12vr fyvr12uz"},disabled:{true:"rhmai65"},outlined:{true:"fyvr11a8 fyvr11ak fyvr11aw fyvr11b8 fyvr12n5 fyvr12ft fyvr1215 fyvr128h fyvr12nh fyvr12g5 fyvr121h fyvr128t"},blur:{true:"fyvr11ms"}},defaultVariants:{},compoundVariants:[]});const Yl=$.forwardRef((t,e)=>{const{className:r,children:n,clickable:i,outlined:s,disabled:o,blur:a,width:c="full",...l}=t;return me.jsx(ae,{className:fa(r,nIe({clickable:i,outlined:s,disabled:o,blur:a})),background:s?"transparent":"backgroundSecondary",overflow:"hidden",borderRadius:"md",padding:"4",width:c,ref:e,...l,children:n})});function Zr(){return Zr=Object.assign?Object.assign.bind():function(t){for(var e=1;et.forEach(r=>iIe(r,e))}function hn(...t){return $.useCallback(Yne(...t),t)}function Ps(t,e=[]){let r=[];function n(s,o){const a=$.createContext(o),c=r.length;r=[...r,o];function l(f){const{scope:d,children:p,...g}=f,v=(d==null?void 0:d[t][c])||a,y=$.useMemo(()=>g,Object.values(g));return $.createElement(v.Provider,{value:y},p)}function u(f,d){const p=(d==null?void 0:d[t][c])||a,g=$.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return l.displayName=s+"Provider",[l,u]}const i=()=>{const s=r.map(o=>$.createContext(o));return function(a){const c=(a==null?void 0:a[t])||s;return $.useMemo(()=>({[`__scope${t}`]:{...a,[t]:c}}),[a,c])}};return i.scopeName=t,[n,sIe(i,...e)]}function sIe(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=n.reduce((a,{useScope:c,scopeName:l})=>{const f=c(s)[`__scope${l}`];return{...a,...f}},{});return $.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return r.scopeName=e.scopeName,r}function Pt(t,e,{checkForDefaultPrevented:r=!0}={}){return function(i){if(t==null||t(i),r===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function Qa(t){const e=$.useRef(t);return $.useEffect(()=>{e.current=t}),$.useMemo(()=>(...r)=>{var n;return(n=e.current)===null||n===void 0?void 0:n.call(e,...r)},[])}function Kd({prop:t,defaultProp:e,onChange:r=()=>{}}){const[n,i]=oIe({defaultProp:e,onChange:r}),s=t!==void 0,o=s?t:n,a=Qa(r),c=$.useCallback(l=>{if(s){const f=typeof l=="function"?l(t):l;f!==t&&a(f)}else i(l)},[s,t,i,a]);return[o,c]}function oIe({defaultProp:t,onChange:e}){const r=$.useState(t),[n]=r,i=$.useRef(n),s=Qa(e);return $.useEffect(()=>{i.current!==n&&(s(n),i.current=n)},[n,i,s]),r}function j8(t){const e=$.useRef({value:t,previous:t});return $.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}const Ya=globalThis!=null&&globalThis.document?$.useLayoutEffect:()=>{};function U8(t){const[e,r]=$.useState(void 0);return Ya(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const c=s.borderBoxSize,l=Array.isArray(c)?c[0]:c;o=l.inlineSize,a=l.blockSize}else o=t.offsetWidth,a=t.offsetHeight;r({width:o,height:a})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}function aIe(t,e){return $.useReducer((r,n)=>{const i=e[r][n];return i??r},t)}const mh=t=>{const{present:e,children:r}=t,n=cIe(e),i=typeof r=="function"?r({present:n.isPresent}):$.Children.only(r),s=hn(n.ref,i.ref);return typeof r=="function"||n.isPresent?$.cloneElement(i,{ref:s}):null};mh.displayName="Presence";function cIe(t){const[e,r]=$.useState(),n=$.useRef({}),i=$.useRef(t),s=$.useRef("none"),o=t?"mounted":"unmounted",[a,c]=aIe(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return $.useEffect(()=>{const l=z5(n.current);s.current=a==="mounted"?l:"none"},[a]),Ya(()=>{const l=n.current,u=i.current;if(u!==t){const d=s.current,p=z5(l);t?c("MOUNT"):p==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(u&&d!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,c]),Ya(()=>{if(e){const l=f=>{const p=z5(n.current).includes(f.animationName);f.target===e&&p&&Gc.flushSync(()=>c("ANIMATION_END"))},u=f=>{f.target===e&&(s.current=z5(n.current))};return e.addEventListener("animationstart",u),e.addEventListener("animationcancel",l),e.addEventListener("animationend",l),()=>{e.removeEventListener("animationstart",u),e.removeEventListener("animationcancel",l),e.removeEventListener("animationend",l)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:$.useCallback(l=>{l&&(n.current=getComputedStyle(l)),r(l)},[])}}function z5(t){return(t==null?void 0:t.animationName)||"none"}function jt(){return jt=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{children:r,...n}=t,i=$.Children.toArray(r),s=i.find(uIe);if(s){const o=s.props.children,a=i.map(c=>c===s?$.Children.count(o)>1?$.Children.only(null):$.isValidElement(o)?o.props.children:null:c);return $.createElement(eP,jt({},n,{ref:e}),$.isValidElement(o)?$.cloneElement(o,void 0,a):null)}return $.createElement(eP,jt({},n,{ref:e}),r)});rm.displayName="Slot";const eP=$.forwardRef((t,e)=>{const{children:r,...n}=t;return $.isValidElement(r)?$.cloneElement(r,{...fIe(n,r.props),ref:e?Yne(e,r.ref):r.ref}):$.Children.count(r)>1?$.Children.only(null):null});eP.displayName="SlotClone";const lIe=({children:t})=>$.createElement($.Fragment,null,t);function uIe(t){return $.isValidElement(t)&&t.type===lIe}function fIe(t,e){const r={...e};for(const n in e){const i=t[n],s=e[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...a)=>{s(...a),i(...a)}:i&&(r[n]=i):n==="style"?r[n]={...i,...s}:n==="className"&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...t,...r}}const dIe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],pr=dIe.reduce((t,e)=>{const r=$.forwardRef((n,i)=>{const{asChild:s,...o}=n,a=s?rm:e;return $.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),$.createElement(a,Zr({},o,{ref:i}))});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function $$(t,e){t&&Gc.flushSync(()=>t.dispatchEvent(e))}const Zne="Checkbox",[hIe,xyt]=Ps(Zne),[pIe,gIe]=hIe(Zne),mIe=$.forwardRef((t,e)=>{const{__scopeCheckbox:r,name:n,checked:i,defaultChecked:s,required:o,disabled:a,value:c="on",onCheckedChange:l,...u}=t,[f,d]=$.useState(null),p=hn(e,E=>d(E)),g=$.useRef(!1),v=f?!!f.closest("form"):!0,[y=!1,b]=Kd({prop:i,defaultProp:s,onChange:l}),w=$.useRef(y);return $.useEffect(()=>{const E=f==null?void 0:f.form;if(E){const C=()=>b(w.current);return E.addEventListener("reset",C),()=>E.removeEventListener("reset",C)}},[f,b]),$.createElement(pIe,{scope:r,state:y,disabled:a},$.createElement(pr.button,Zr({type:"button",role:"checkbox","aria-checked":B0(y)?"mixed":y,"aria-required":o,"data-state":Xne(y),"data-disabled":a?"":void 0,disabled:a,value:c},u,{ref:p,onKeyDown:Pt(t.onKeyDown,E=>{E.key==="Enter"&&E.preventDefault()}),onClick:Pt(t.onClick,E=>{b(C=>B0(C)?!0:!C),v&&(g.current=E.isPropagationStopped(),g.current||E.stopPropagation())})})),v&&$.createElement(bIe,{control:f,bubbles:!g.current,name:n,value:c,checked:y,required:o,disabled:a,style:{transform:"translateX(-100%)"}}))}),vIe="CheckboxIndicator",yIe=$.forwardRef((t,e)=>{const{__scopeCheckbox:r,forceMount:n,...i}=t,s=gIe(vIe,r);return $.createElement(mh,{present:n||B0(s.state)||s.state===!0},$.createElement(pr.span,Zr({"data-state":Xne(s.state),"data-disabled":s.disabled?"":void 0},i,{ref:e,style:{pointerEvents:"none",...t.style}})))}),bIe=t=>{const{control:e,checked:r,bubbles:n=!0,...i}=t,s=$.useRef(null),o=j8(r),a=U8(e);return $.useEffect(()=>{const c=s.current,l=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(l,"checked").set;if(o!==r&&f){const d=new Event("click",{bubbles:n});c.indeterminate=B0(r),f.call(c,B0(r)?!1:r),c.dispatchEvent(d)}},[o,r,n]),$.createElement("input",Zr({type:"checkbox","aria-hidden":!0,defaultChecked:B0(r)?!1:r},i,{tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function B0(t){return t==="indeterminate"}function Xne(t){return B0(t)?"indeterminate":t?"checked":"unchecked"}const wIe=mIe,xIe=yIe;var EIe=On({defaultClassName:"_43lu9r4",variantClassNames:{labelLocation:{top:"fyvr11kw fyvr11i4 fyvr118k fyvr11h0",left:"_43lu9r6 fyvr11ko fyvr11ic fyvr118k fyvr11h0",right:"_43lu9r7 fyvr11ko fyvr11ic fyvr118k fyvr11h0",hidden:"fyvr1188 fyvr11h0"}},defaultVariants:{},compoundVariants:[]});const b1=t=>{const{id:e,label:r,description:n,labelLocation:i="top",children:s,...o}=t,a=()=>r||n?me.jsxs(ae,{flexDirection:"column",gap:"0.5",children:[r&&me.jsx(Pe,{variant:"small",color:"text100",hidden:i==="hidden",children:r}),n&&me.jsx(Pe,{variant:"small",color:"text50",hidden:i==="hidden",children:n})]}):null;return me.jsxs(ae,{as:"label",className:EIe({labelLocation:i}),htmlFor:e,...o,children:[["left","top","hidden"].includes(i)&&a(),s,i==="right"&&a()]})};var qn=On({defaultClassName:"_1dizidw0",variantClassNames:{size:{xs:"_1dizidw1",sm:"_1dizidw2",md:"_1dizidw3",lg:"_1dizidw4",xl:"_1dizidw5"}},defaultVariants:{},compoundVariants:[]});const _Ie=t=>me.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:me.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M11.168 9.25V2.929h-1.5V9.25h-6.32v1.5h6.32v6.321h1.5V10.75h6.321v-1.5h-6.32Z",clipRule:"evenodd"})}),CIe=({size:t="sm",...e})=>me.jsx(ae,{as:_Ie,className:qn({size:t}),...e}),SIe=t=>me.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:me.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m10.888 14.47 1.06 1.06L17.48 10l-5.53-5.53-1.06 1.06 3.719 3.72H4.418v1.5h10.19l-3.72 3.72Z",clipRule:"evenodd"})}),tP=({size:t="sm",...e})=>me.jsx(ae,{as:SIe,className:qn({size:t}),...e}),AIe=t=>me.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:me.jsx("path",{stroke:"currentColor",strokeWidth:1.5,d:"m4.304 10.232 4.263 4.79 7.13-11.238"})}),Nm=({size:t="sm",...e})=>me.jsx(ae,{as:AIe,className:qn({size:t}),...e}),kIe=t=>me.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:me.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m3.888 7.53 1.06-1.06 5.47 5.47 5.47-5.47 1.06 1.06-6.53 6.53-6.53-6.53Z",clipRule:"evenodd"})}),eie=({size:t="sm",...e})=>me.jsx(ae,{as:kIe,className:qn({size:t}),...e}),IIe=t=>me.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:me.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m12.888 3.47 1.06 1.06L8.48 10l5.47 5.47-1.061 1.06L6.358 10l6.53-6.53Z",clipRule:"evenodd"})}),z8=({size:t="sm",...e})=>me.jsx(ae,{as:IIe,className:qn({size:t}),...e}),PIe=t=>me.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:me.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m7.949 16.53-1.061-1.06 5.47-5.47-5.47-5.47 1.06-1.06L14.48 10l-6.53 6.53Z",clipRule:"evenodd"})}),Wu=({size:t="sm",...e})=>me.jsx(ae,{as:PIe,className:qn({size:t}),...e}),RIe=t=>me.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:me.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m10.418 11.06 4.47 4.47 1.06-1.06L11.48 10l4.47-4.47-1.06-1.06-4.47 4.47-4.47-4.47-1.06 1.06L9.357 10l-4.47 4.47 1.06 1.06 4.47-4.47Z",clipRule:"evenodd"})}),w1=({size:t="sm",...e})=>me.jsx(ae,{as:RIe,className:qn({size:t}),...e}),TIe=t=>me.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:me.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M14.918 4.5h-6V6h4.5v6.5h1.5v-8Zm-1.5 9.5v3h-9V6h3V3h9v11h-3Zm-7.5 1.5v-8h6v8h-6Z",clipRule:"evenodd"})}),H8=({size:t="sm",...e})=>me.jsx(ae,{as:TIe,className:qn({size:t}),...e}),OIe=t=>me.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:me.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M5 6.714 3.618 3.547H2.5L4.158 7.02H2.98v.69h1.494v.663H2.981v.69h1.494v1.484h1.036V9.063h1.46v-.69h-1.46v-.66l.001-.003h1.46v-.69h-1.13L7.5 3.547H6.383L5 6.714Zm4.747 8.232v-.788a2.887 2.887 0 0 1-1.04-.249 2.04 2.04 0 0 1-.863-.727 2.213 2.213 0 0 1-.344-1.125h1.017c.02.26.098.476.236.65.14.171.319.299.535.383.144.054.297.09.46.109V10.81l-.319-.093c-.538-.157-.964-.388-1.28-.693-.312-.304-.469-.707-.469-1.209 0-.415.105-.777.315-1.086.21-.31.495-.55.853-.72.273-.133.573-.215.9-.246v-.817h.537v.81c.365.023.692.106.981.249.35.17.626.406.827.706.201.298.306.64.315 1.027h-.978a1.04 1.04 0 0 0-.433-.774 1.47 1.47 0 0 0-.712-.264v2.253l.283.079c.214.056.434.132.659.228a2.6 2.6 0 0 1 .627.38c.192.157.347.351.466.583.12.232.18.51.18.834 0 .407-.098.77-.295 1.086a2.006 2.006 0 0 1-.85.749c-.304.15-.66.239-1.07.265v.79h-.538Zm1.024-1.877c-.148.064-.31.106-.486.128v-2.23c.216.064.41.136.584.218.193.089.345.201.457.337.113.136.17.31.17.524 0 .234-.065.44-.194.615-.129.174-.306.31-.531.408ZM9.747 7.706v2.095a4.605 4.605 0 0 1-.246-.086 2.195 2.195 0 0 1-.4-.207 1.038 1.038 0 0 1-.299-.313.847.847 0 0 1-.111-.443.94.94 0 0 1 .164-.545c.112-.162.268-.288.47-.38.126-.059.267-.099.422-.12Zm7.677 10.086h-4.9v-.897h.34a.342.342 0 0 0 .29-.186c.068-.117.114-.254.137-.411.023-.16.032-.304.028-.432l-.027-.779H12.5v-.896h.76l-.043-1.262c-.018-.472.073-.866.273-1.183.203-.317.473-.555.809-.715.335-.16.697-.24 1.084-.24.346 0 .656.056.931.166.278.11.511.26.7.452.191.188.328.404.41.647.081.243.097.498.048.766l-1.01-.156c.023-.22-.014-.403-.11-.55a.891.891 0 0 0-.395-.33 1.31 1.31 0 0 0-1.102.024c-.177.09-.322.227-.434.411-.11.185-.164.42-.164.708l.048 1.261h1.649v.897H14.34l.029.752c.014.29-.025.55-.116.78-.04.1-.096.193-.166.276h3.337v.897Z",clipRule:"evenodd"})}),$Ie=({size:t="sm",...e})=>me.jsx(ae,{as:OIe,className:qn({size:t}),...e}),NIe=t=>me.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:me.jsx("path",{fill:"currentColor",d:"m5.285 12.883 6.53-6.53 2.254 2.253-6.531 6.531-2.878.618.625-2.872ZM14.674 8.001l-2.253-2.253 1.502-1.503L16.176 6.5 14.674 8Z"})}),MIe=({size:t="sm",...e})=>me.jsx(ae,{as:NIe,className:qn({size:t}),...e}),DIe=t=>me.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:[me.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeWidth:1.5,d:"M10.906 8.966c1.459 1.316 1.459 3.45 0 4.765l-2.53 2.282c-1.459 1.316-3.824 1.316-5.282 0-1.459-1.315-1.459-3.449 0-4.764l1.265-1.142"}),me.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeWidth:1.5,d:"M8.094 11c-1.459-1.316-1.459-3.449 0-4.765l2.53-2.282c1.459-1.316 3.823-1.316 5.282 0s1.459 3.449 0 4.765l-1.265 1.14"})]}),LIe=({size:t="sm",...e})=>me.jsx(ae,{as:DIe,className:qn({size:t}),...e}),BIe=t=>me.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:me.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M15.918 14.994v.752A7.003 7.003 0 0 1 6.968 5.05a7.003 7.003 0 0 1 8.95-.796v.752a4.979 4.979 0 0 0-3.293 1.459 5 5 0 0 0 3.293 8.53Zm-4.353-.398c.329.329.684.615 1.059.859a5.5 5.5 0 1 1 0-10.91 6.5 6.5 0 0 0-1.06 10.051Z",clipRule:"evenodd"})}),FIe=({size:t="sm",...e})=>me.jsx(ae,{as:BIe,className:qn({size:t}),...e}),jIe=t=>me.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:me.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M13.283 6.175a4.643 4.643 0 1 0-6.566 6.567l-.708.707a5.644 5.644 0 1 1 7.982 0l-.708-.707a4.644 4.644 0 0 0 0-6.567Zm-5.097 1.47a2.565 2.565 0 0 1 3.628 3.627l.707.707a3.565 3.565 0 1 0-5.042 0l.707-.707a2.565 2.565 0 0 1 0-3.627ZM10 10.959a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm0 .667-1.5 6h3l-1.5-6Z",clipRule:"evenodd"})}),UIe=({size:t="sm",...e})=>me.jsx(ae,{as:jIe,className:qn({size:t}),...e}),zIe=t=>me.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:me.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M6.418 3.6h-2.5v2.5h2.5V3.6Zm0-1.5h1.5v5.5h-5.5V2.1h4Zm0 12h-2.5v2.5h2.5v-2.5Zm0-1.5h1.5v5.5h-5.5v-5.5h4Zm8-9h2.5v2.5h-2.5V3.6Zm4-1.5h-5.5v5.5h5.5V2.1Zm-1.5 12h-2.5v2.5h2.5v-2.5Zm0-1.5h1.5v5.5h-5.5v-5.5h4ZM9.668 2.1v7.25h-7.25v1.5h8.75V2.1h-1.5Zm1.5 10.5v5.5h-1.5v-5.5h1.5Zm1.75-1.75h5.5v-1.5h-5.5v1.5Z",clipRule:"evenodd"})}),HIe=({size:t="sm",...e})=>me.jsx(ae,{as:zIe,className:qn({size:t}),...e}),qIe=t=>me.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:me.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M13.918 9.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm-.677 4.383a5.5 5.5 0 1 1 1.06-1.06l2.648 2.647-1.061 1.06-2.647-2.647Z",clipRule:"evenodd"})}),q8=({size:t="sm",...e})=>me.jsx(ae,{as:qIe,className:qn({size:t}),...e}),WIe=t=>me.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:me.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M11.529 15.925 9.419 11 4.493 8.89 2.418 8l2.142-.714 11.08-3.693L17.418 3l-.593 1.779-3.693 11.08L12.418 18l-.89-2.075Zm-1.71-6.386L6.635 8.175l6.82-2.273-3.638 3.637Zm1.06 1.061 1.364 3.183 2.273-6.82L10.88 10.6Z",clipRule:"evenodd"})}),W8=({size:t="sm",...e})=>me.jsx(ae,{as:WIe,className:qn({size:t}),...e}),VIe=t=>me.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:me.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12.775 5.204a5.465 5.465 0 0 0-1.341-.537L11 2.5H9l-.443 2.214c-.444.128-.866.31-1.257.54L5.404 3.99 3.99 5.404l1.283 1.925c-.212.38-.38.787-.497 1.216L2.5 9v2l2.276.455c.118.429.285.836.497 1.216L3.99 14.596l1.414 1.414L7.3 14.746c.391.23.813.412 1.257.54L9 17.5h2l.434-2.167c.474-.12.925-.302 1.341-.537l1.821 1.214 1.414-1.414-1.195-1.793c.253-.427.45-.891.581-1.382L17.5 11V9l-2.104-.42a5.467 5.467 0 0 0-.581-1.383l1.195-1.793-1.414-1.414-1.82 1.214Zm-.59 2.692a2.976 2.976 0 1 0-4.208 4.208 2.976 2.976 0 0 0 4.209-4.208Z",clipRule:"evenodd"})}),tie=({size:t="sm",...e})=>me.jsx(ae,{as:VIe,className:qn({size:t}),...e}),GIe=t=>me.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:[me.jsx("path",{fill:"currentColor",d:"M4 6.234a.5.5 0 0 0-.5.5v8a.5.5 0 0 0 .5.5h8a.5.5 0 0 0 .5-.5V10.5L14 9v5.734a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h5.769l-1.516 1.5H4Z"}),me.jsx("path",{stroke:"currentColor",strokeWidth:1.25,d:"M11 3h5v5"}),me.jsx("path",{stroke:"currentColor",strokeWidth:1.5,d:"m16 3-8 8"})]}),KIe=({size:t="sm",...e})=>me.jsx(ae,{as:GIe,className:qn({size:t}),...e}),JIe=t=>me.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:me.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.418 3.25h-5.75v13.5h5.75v-1.5h-4.25V4.75h4.25v-1.5Zm4.53 11.28-1.06-1.06 2.72-2.72h-8.19v-1.5h8.19l-2.72-2.72 1.06-1.06L18.48 10l-4.53 4.53Z",clipRule:"evenodd"})}),rie=({size:t="sm",...e})=>me.jsx(ae,{as:JIe,className:qn({size:t}),...e}),QIe=t=>me.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:me.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M16.539 10.75H4.298v-1.5h12.24v1.5Z",clipRule:"evenodd"})}),YIe=({size:t="sm",...e})=>me.jsx(ae,{as:QIe,className:qn({size:t}),...e}),ZIe=t=>me.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:[me.jsx("path",{fill:"currentColor",d:"M4.633 10.75a5.878 5.878 0 0 1 .008-1.5H2.202v1.5h2.431ZM5.814 6.456A5.854 5.854 0 0 1 6.88 5.401L5.139 3.66l-1.06 1.06 1.735 1.736ZM4.078 15.28l1.711-1.711c.306.398.662.755 1.058 1.063L5.14 16.34l-1.06-1.06ZM9.668 15.802v2.414h1.5V15.8a5.876 5.876 0 0 1-1.5.003ZM13.98 14.623l1.718 1.717 1.06-1.06-1.721-1.723c-.305.4-.66.758-1.056 1.066ZM16.184 10.75h2.45v-1.5h-2.457a5.882 5.882 0 0 1 .007 1.5ZM15.012 6.467l1.747-1.747-1.061-1.06-1.75 1.75c.399.305.756.66 1.064 1.057ZM11.168 4.258V1.784h-1.5v2.472a5.875 5.875 0 0 1 1.5.002Z"}),me.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M10.418 12.504a2.504 2.504 0 1 0 0-5.008 2.504 2.504 0 0 0 0 5.008Zm0 1.5a4.004 4.004 0 1 0 0-8.008 4.004 4.004 0 0 0 0 8.008Z",clipRule:"evenodd"})]}),XIe=({size:t="sm",...e})=>me.jsx(ae,{as:ZIe,className:qn({size:t}),...e}),ePe=t=>me.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:me.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m12.28 2.856-6.71 8.887h4.134l-1.424 6.2 6.887-8.71h-4.322l1.435-6.377Z",clipRule:"evenodd"})}),nie=({size:t="sm",...e})=>me.jsx(ae,{as:ePe,className:qn({size:t}),...e});var tPe=On({defaultClassName:"_1c9x66f1 fyvr11a8 fyvr11ak fyvr11aw fyvr11b8 fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr12nb fyvr12fz fyvr121b fyvr128n fyvr12nh fyvr12g5 fyvr121h fyvr128t fyvr11h0 fyvr11ko fyvr11jg fyvr12vt fyvr12vr fyvr12vj fyvr12uz fyvr12uv",variantClassNames:{size:{sm:"_1c9x66f2",lg:"_1c9x66f3"}},defaultVariants:{},compoundVariants:[]}),rPe=On({defaultClassName:"_1c9x66f5 fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr12rt fyvr11rz",variantClassNames:{size:{sm:"_1c9x66f6",lg:"_1c9x66f7"}},defaultVariants:{},compoundVariants:[]});const nPe=({size:t="sm"})=>me.jsx(xIe,{className:rPe({size:t}),children:me.jsx(Nm,{size:t})});$.forwardRef((t,e)=>{const{disabled:r=!1,id:n,name:i,label:s="",labelLocation:o="left",size:a="sm",...c}=t;return me.jsx(b1,{disabled:r,display:"flex",id:n??i,label:s,labelLocation:o,whiteSpace:"nowrap",children:me.jsx(wIe,{className:tPe({size:a}),disabled:r,id:n??i,name:i,ref:e,...c,children:me.jsx(nPe,{})})})});O.createContext(null);const iPe=EJ["useId".toString()]||(()=>{});let sPe=0;function Md(t){const[e,r]=$.useState(iPe());return Ya(()=>{t||r(n=>n??String(sPe++))},[t]),t||(e?`radix-${e}`:"")}const iie="Collapsible",[oPe,Eyt]=Ps(iie);oPe(iie);function V8(t){const e=t+"CollectionProvider",[r,n]=Ps(e),[i,s]=r(e,{collectionRef:{current:null},itemMap:new Map}),o=p=>{const{scope:g,children:v}=p,y=O.useRef(null),b=O.useRef(new Map).current;return O.createElement(i,{scope:g,itemMap:b,collectionRef:y},v)},a=t+"CollectionSlot",c=O.forwardRef((p,g)=>{const{scope:v,children:y}=p,b=s(a,v),w=hn(g,b.collectionRef);return O.createElement(rm,{ref:w},y)}),l=t+"CollectionItemSlot",u="data-radix-collection-item",f=O.forwardRef((p,g)=>{const{scope:v,children:y,...b}=p,w=O.useRef(null),E=hn(g,w),C=s(l,v);return O.useEffect(()=>(C.itemMap.set(w,{ref:w,...b}),()=>void C.itemMap.delete(w))),O.createElement(rm,{[u]:"",ref:E},y)});function d(p){const g=s(t+"CollectionConsumer",p);return O.useCallback(()=>{const y=g.collectionRef.current;if(!y)return[];const b=Array.from(y.querySelectorAll(`[${u}]`));return Array.from(g.itemMap.values()).sort((C,S)=>b.indexOf(C.ref.current)-b.indexOf(S.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:o,Slot:c,ItemSlot:f},d,n]}const aPe=$.createContext(void 0);function G8(t){const e=$.useContext(aPe);return t||e||"ltr"}function cPe(t,e=globalThis==null?void 0:globalThis.document){const r=Qa(t);$.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)},[r,e])}const rP="dismissableLayer.update",lPe="dismissableLayer.pointerDownOutside",uPe="dismissableLayer.focusOutside";let Rz;const fPe=$.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),N$=$.forwardRef((t,e)=>{var r;const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:c,...l}=t,u=$.useContext(fPe),[f,d]=$.useState(null),p=(r=f==null?void 0:f.ownerDocument)!==null&&r!==void 0?r:globalThis==null?void 0:globalThis.document,[,g]=$.useState({}),v=hn(e,T=>d(T)),y=Array.from(u.layers),[b]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),w=y.indexOf(b),E=f?y.indexOf(f):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,S=E>=w,P=dPe(T=>{const Q=T.target,Z=[...u.branches].some(ne=>ne.contains(Q));!S||Z||(s==null||s(T),a==null||a(T),T.defaultPrevented||c==null||c())},p),_=hPe(T=>{const Q=T.target;[...u.branches].some(ne=>ne.contains(Q))||(o==null||o(T),a==null||a(T),T.defaultPrevented||c==null||c())},p);return cPe(T=>{E===u.layers.size-1&&(i==null||i(T),!T.defaultPrevented&&c&&(T.preventDefault(),c()))},p),$.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Rz=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),Tz(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Rz)}},[f,p,n,u]),$.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),Tz())},[f,u]),$.useEffect(()=>{const T=()=>g({});return document.addEventListener(rP,T),()=>document.removeEventListener(rP,T)},[]),$.createElement(pr.div,jt({},l,{ref:v,style:{pointerEvents:C?S?"auto":"none":void 0,...t.style},onFocusCapture:Pt(t.onFocusCapture,_.onFocusCapture),onBlurCapture:Pt(t.onBlurCapture,_.onBlurCapture),onPointerDownCapture:Pt(t.onPointerDownCapture,P.onPointerDownCapture)}))});function dPe(t,e=globalThis==null?void 0:globalThis.document){const r=Qa(t),n=$.useRef(!1),i=$.useRef(()=>{});return $.useEffect(()=>{const s=a=>{if(a.target&&!n.current){let c=function(){sie(lPe,r,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=c,e.addEventListener("click",i.current,{once:!0})):c()}else e.removeEventListener("click",i.current);n.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function hPe(t,e=globalThis==null?void 0:globalThis.document){const r=Qa(t),n=$.useRef(!1);return $.useEffect(()=>{const i=s=>{s.target&&!n.current&&sie(uPe,r,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Tz(){const t=new CustomEvent(rP);document.dispatchEvent(t)}function sie(t,e,r,{discrete:n}){const i=r.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&i.addEventListener(t,e,{once:!0}),n?$$(i,s):i.dispatchEvent(s)}const pPe=N$;let f9=0;function oie(){$.useEffect(()=>{var t,e;const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(t=r[0])!==null&&t!==void 0?t:Oz()),document.body.insertAdjacentElement("beforeend",(e=r[1])!==null&&e!==void 0?e:Oz()),f9++,()=>{f9===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),f9--}},[])}function Oz(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}const d9="focusScope.autoFocusOnMount",h9="focusScope.autoFocusOnUnmount",$z={bubbles:!1,cancelable:!0},aie=$.forwardRef((t,e)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=t,[a,c]=$.useState(null),l=Qa(i),u=Qa(s),f=$.useRef(null),d=hn(e,v=>c(v)),p=$.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;$.useEffect(()=>{if(n){let v=function(E){if(p.paused||!a)return;const C=E.target;a.contains(C)?f.current=C:Xf(f.current,{select:!0})},y=function(E){if(p.paused||!a)return;const C=E.relatedTarget;C!==null&&(a.contains(C)||Xf(f.current,{select:!0}))},b=function(E){if(document.activeElement===document.body)for(const S of E)S.removedNodes.length>0&&Xf(a)};document.addEventListener("focusin",v),document.addEventListener("focusout",y);const w=new MutationObserver(b);return a&&w.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",y),w.disconnect()}}},[n,a,p.paused]),$.useEffect(()=>{if(a){Mz.add(p);const v=document.activeElement;if(!a.contains(v)){const b=new CustomEvent(d9,$z);a.addEventListener(d9,l),a.dispatchEvent(b),b.defaultPrevented||(gPe(wPe(cie(a)),{select:!0}),document.activeElement===v&&Xf(a))}return()=>{a.removeEventListener(d9,l),setTimeout(()=>{const b=new CustomEvent(h9,$z);a.addEventListener(h9,u),a.dispatchEvent(b),b.defaultPrevented||Xf(v??document.body,{select:!0}),a.removeEventListener(h9,u),Mz.remove(p)},0)}}},[a,l,u,p]);const g=$.useCallback(v=>{if(!r&&!n||p.paused)return;const y=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,b=document.activeElement;if(y&&b){const w=v.currentTarget,[E,C]=mPe(w);E&&C?!v.shiftKey&&b===C?(v.preventDefault(),r&&Xf(E,{select:!0})):v.shiftKey&&b===E&&(v.preventDefault(),r&&Xf(C,{select:!0})):b===w&&v.preventDefault()}},[r,n,p.paused]);return $.createElement(pr.div,jt({tabIndex:-1},o,{ref:d,onKeyDown:g}))});function gPe(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(Xf(n,{select:e}),document.activeElement!==r)return}function mPe(t){const e=cie(t),r=Nz(e,t),n=Nz(e.reverse(),t);return[r,n]}function cie(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function Nz(t,e){for(const r of t)if(!vPe(r,{upTo:e}))return r}function vPe(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function yPe(t){return t instanceof HTMLInputElement&&"select"in t}function Xf(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&yPe(t)&&e&&t.select()}}const Mz=bPe();function bPe(){let t=[];return{add(e){const r=t[0];e!==r&&(r==null||r.pause()),t=Dz(t,e),t.unshift(e)},remove(e){var r;t=Dz(t,e),(r=t[0])===null||r===void 0||r.resume()}}}function Dz(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function wPe(t){return t.filter(e=>e.tagName!=="A")}const xPe=["top","right","bottom","left"],Jd=Math.min,Jo=Math.max,K6=Math.round,H5=Math.floor,Qd=t=>({x:t,y:t}),EPe={left:"right",right:"left",bottom:"top",top:"bottom"},_Pe={start:"end",end:"start"};function nP(t,e,r){return Jo(t,Jd(e,r))}function nf(t,e){return typeof t=="function"?t(e):t}function sf(t){return t.split("-")[0]}function Mm(t){return t.split("-")[1]}function M$(t){return t==="x"?"y":"x"}function D$(t){return t==="y"?"height":"width"}function Dm(t){return["top","bottom"].includes(sf(t))?"y":"x"}function L$(t){return M$(Dm(t))}function CPe(t,e,r){r===void 0&&(r=!1);const n=Mm(t),i=L$(t),s=D$(i);let o=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=J6(o)),[o,J6(o)]}function SPe(t){const e=J6(t);return[iP(t),e,iP(e)]}function iP(t){return t.replace(/start|end/g,e=>_Pe[e])}function APe(t,e,r){const n=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return r?e?i:n:e?n:i;case"left":case"right":return e?s:o;default:return[]}}function kPe(t,e,r,n){const i=Mm(t);let s=APe(sf(t),r==="start",n);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(iP)))),s}function J6(t){return t.replace(/left|right|bottom|top/g,e=>EPe[e])}function IPe(t){return{top:0,right:0,bottom:0,left:0,...t}}function lie(t){return typeof t!="number"?IPe(t):{top:t,right:t,bottom:t,left:t}}function Q6(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function Lz(t,e,r){let{reference:n,floating:i}=t;const s=Dm(e),o=L$(e),a=D$(o),c=sf(e),l=s==="y",u=n.x+n.width/2-i.width/2,f=n.y+n.height/2-i.height/2,d=n[a]/2-i[a]/2;let p;switch(c){case"top":p={x:u,y:n.y-i.height};break;case"bottom":p={x:u,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:f};break;case"left":p={x:n.x-i.width,y:f};break;default:p={x:n.x,y:n.y}}switch(Mm(e)){case"start":p[o]-=d*(r&&l?-1:1);break;case"end":p[o]+=d*(r&&l?-1:1);break}return p}const PPe=async(t,e,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:o}=r,a=s.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(e));let l=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=Lz(l,n,c),d=n,p={},g=0;for(let v=0;v({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:i,rects:s,platform:o,elements:a,middlewareData:c}=e,{element:l,padding:u=0}=nf(t,e)||{};if(l==null)return{};const f=lie(u),d={x:r,y:n},p=L$(i),g=D$(p),v=await o.getDimensions(l),y=p==="y",b=y?"top":"left",w=y?"bottom":"right",E=y?"clientHeight":"clientWidth",C=s.reference[g]+s.reference[p]-d[p]-s.floating[g],S=d[p]-s.reference[p],P=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l));let _=P?P[E]:0;(!_||!await(o.isElement==null?void 0:o.isElement(P)))&&(_=a.floating[E]||s.floating[g]);const T=C/2-S/2,Q=_/2-v[g]/2-1,Z=Jd(f[b],Q),ne=Jd(f[w],Q),ce=Z,K=_-v[g]-ne,x=_/2-v[g]/2+T,A=nP(ce,x,K),B=!c.arrow&&Mm(i)!=null&&x!=A&&s.reference[g]/2-(xce<=0)){var Q,Z;const ce=(((Q=s.flip)==null?void 0:Q.index)||0)+1,K=S[ce];if(K)return{data:{index:ce,overflows:T},reset:{placement:K}};let x=(Z=T.filter(A=>A.overflows[0]<=0).sort((A,B)=>A.overflows[1]-B.overflows[1])[0])==null?void 0:Z.placement;if(!x)switch(p){case"bestFit":{var ne;const A=(ne=T.map(B=>[B.placement,B.overflows.filter(z=>z>0).reduce((z,R)=>z+R,0)]).sort((B,z)=>B[1]-z[1])[0])==null?void 0:ne[0];A&&(x=A);break}case"initialPlacement":x=a;break}if(i!==x)return{reset:{placement:x}}}return{}}}};function Fz(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function jz(t){return xPe.some(e=>t[e]>=0)}const TPe=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...i}=nf(t,e);switch(n){case"referenceHidden":{const s=await e2(e,{...i,elementContext:"reference"}),o=Fz(s,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:jz(o)}}}case"escaped":{const s=await e2(e,{...i,altBoundary:!0}),o=Fz(s,r.floating);return{data:{escapedOffsets:o,escaped:jz(o)}}}default:return{}}}}};async function OPe(t,e){const{placement:r,platform:n,elements:i}=t,s=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=sf(r),a=Mm(r),c=Dm(r)==="y",l=["left","top"].includes(o)?-1:1,u=s&&c?-1:1,f=nf(e,t);let{mainAxis:d,crossAxis:p,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof g=="number"&&(p=a==="end"?g*-1:g),c?{x:p*u,y:d*l}:{x:d*l,y:p*u}}const $Pe=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){const{x:r,y:n}=e,i=await OPe(e,t);return{x:r+i.x,y:n+i.y,data:i}}}},NPe=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:y=>{let{x:b,y:w}=y;return{x:b,y:w}}},...c}=nf(t,e),l={x:r,y:n},u=await e2(e,c),f=Dm(sf(i)),d=M$(f);let p=l[d],g=l[f];if(s){const y=d==="y"?"top":"left",b=d==="y"?"bottom":"right",w=p+u[y],E=p-u[b];p=nP(w,p,E)}if(o){const y=f==="y"?"top":"left",b=f==="y"?"bottom":"right",w=g+u[y],E=g-u[b];g=nP(w,g,E)}const v=a.fn({...e,[d]:p,[f]:g});return{...v,data:{x:v.x-r,y:v.y-n}}}}},MPe=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=nf(t,e),u={x:r,y:n},f=Dm(i),d=M$(f);let p=u[d],g=u[f];const v=nf(a,e),y=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const E=d==="y"?"height":"width",C=s.reference[d]-s.floating[E]+y.mainAxis,S=s.reference[d]+s.reference[E]-y.mainAxis;pS&&(p=S)}if(l){var b,w;const E=d==="y"?"width":"height",C=["top","left"].includes(sf(i)),S=s.reference[f]-s.floating[E]+(C&&((b=o.offset)==null?void 0:b[f])||0)+(C?0:y.crossAxis),P=s.reference[f]+s.reference[E]+(C?0:((w=o.offset)==null?void 0:w[f])||0)-(C?y.crossAxis:0);gP&&(g=P)}return{[d]:p,[f]:g}}}},DPe=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:r,rects:n,platform:i,elements:s}=e,{apply:o=()=>{},...a}=nf(t,e),c=await e2(e,a),l=sf(r),u=Mm(r),f=Dm(r)==="y",{width:d,height:p}=n.floating;let g,v;l==="top"||l==="bottom"?(g=l,v=u===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(v=l,g=u==="end"?"top":"bottom");const y=p-c[g],b=d-c[v],w=!e.middlewareData.shift;let E=y,C=b;if(f){const P=d-c.left-c.right;C=u||w?Jd(b,P):P}else{const P=p-c.top-c.bottom;E=u||w?Jd(y,P):P}if(w&&!u){const P=Jo(c.left,0),_=Jo(c.right,0),T=Jo(c.top,0),Q=Jo(c.bottom,0);f?C=d-2*(P!==0||_!==0?P+_:Jo(c.left,c.right)):E=p-2*(T!==0||Q!==0?T+Q:Jo(c.top,c.bottom))}await o({...e,availableWidth:C,availableHeight:E});const S=await i.getDimensions(s.floating);return d!==S.width||p!==S.height?{reset:{rects:!0}}:{}}}};function Yd(t){return uie(t)?(t.nodeName||"").toLowerCase():"#document"}function na(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Pf(t){var e;return(e=(uie(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function uie(t){return t instanceof Node||t instanceof na(t).Node}function of(t){return t instanceof Element||t instanceof na(t).Element}function Zl(t){return t instanceof HTMLElement||t instanceof na(t).HTMLElement}function Uz(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof na(t).ShadowRoot}function cw(t){const{overflow:e,overflowX:r,overflowY:n,display:i}=Za(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!["inline","contents"].includes(i)}function LPe(t){return["table","td","th"].includes(Yd(t))}function B$(t){const e=F$(),r=Za(t);return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function BPe(t){let e=nm(t);for(;Zl(e)&&!K8(e);){if(B$(e))return e;e=nm(e)}return null}function F$(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function K8(t){return["html","body","#document"].includes(Yd(t))}function Za(t){return na(t).getComputedStyle(t)}function J8(t){return of(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function nm(t){if(Yd(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Uz(t)&&t.host||Pf(t);return Uz(e)?e.host:e}function fie(t){const e=nm(t);return K8(e)?t.ownerDocument?t.ownerDocument.body:t.body:Zl(e)&&cw(e)?e:fie(e)}function t2(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const i=fie(t),s=i===((n=t.ownerDocument)==null?void 0:n.body),o=na(i);return s?e.concat(o,o.visualViewport||[],cw(i)?i:[],o.frameElement&&r?t2(o.frameElement):[]):e.concat(i,t2(i,[],r))}function die(t){const e=Za(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=Zl(t),s=i?t.offsetWidth:r,o=i?t.offsetHeight:n,a=K6(r)!==s||K6(n)!==o;return a&&(r=s,n=o),{width:r,height:n,$:a}}function j$(t){return of(t)?t:t.contextElement}function bg(t){const e=j$(t);if(!Zl(e))return Qd(1);const r=e.getBoundingClientRect(),{width:n,height:i,$:s}=die(e);let o=(s?K6(r.width):r.width)/n,a=(s?K6(r.height):r.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const FPe=Qd(0);function hie(t){const e=na(t);return!F$()||!e.visualViewport?FPe:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function jPe(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==na(t)?!1:e}function X0(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const i=t.getBoundingClientRect(),s=j$(t);let o=Qd(1);e&&(n?of(n)&&(o=bg(n)):o=bg(t));const a=jPe(s,r,n)?hie(s):Qd(0);let c=(i.left+a.x)/o.x,l=(i.top+a.y)/o.y,u=i.width/o.x,f=i.height/o.y;if(s){const d=na(s),p=n&&of(n)?na(n):n;let g=d.frameElement;for(;g&&n&&p!==d;){const v=bg(g),y=g.getBoundingClientRect(),b=Za(g),w=y.left+(g.clientLeft+parseFloat(b.paddingLeft))*v.x,E=y.top+(g.clientTop+parseFloat(b.paddingTop))*v.y;c*=v.x,l*=v.y,u*=v.x,f*=v.y,c+=w,l+=E,g=na(g).frameElement}}return Q6({width:u,height:f,x:c,y:l})}function UPe(t){let{rect:e,offsetParent:r,strategy:n}=t;const i=Zl(r),s=Pf(r);if(r===s)return e;let o={scrollLeft:0,scrollTop:0},a=Qd(1);const c=Qd(0);if((i||!i&&n!=="fixed")&&((Yd(r)!=="body"||cw(s))&&(o=J8(r)),Zl(r))){const l=X0(r);a=bg(r),c.x=l.x+r.clientLeft,c.y=l.y+r.clientTop}return{width:e.width*a.x,height:e.height*a.y,x:e.x*a.x-o.scrollLeft*a.x+c.x,y:e.y*a.y-o.scrollTop*a.y+c.y}}function zPe(t){return Array.from(t.getClientRects())}function pie(t){return X0(Pf(t)).left+J8(t).scrollLeft}function HPe(t){const e=Pf(t),r=J8(t),n=t.ownerDocument.body,i=Jo(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=Jo(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+pie(t);const a=-r.scrollTop;return Za(n).direction==="rtl"&&(o+=Jo(e.clientWidth,n.clientWidth)-i),{width:i,height:s,x:o,y:a}}function qPe(t,e){const r=na(t),n=Pf(t),i=r.visualViewport;let s=n.clientWidth,o=n.clientHeight,a=0,c=0;if(i){s=i.width,o=i.height;const l=F$();(!l||l&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:s,height:o,x:a,y:c}}function WPe(t,e){const r=X0(t,!0,e==="fixed"),n=r.top+t.clientTop,i=r.left+t.clientLeft,s=Zl(t)?bg(t):Qd(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,c=i*s.x,l=n*s.y;return{width:o,height:a,x:c,y:l}}function zz(t,e,r){let n;if(e==="viewport")n=qPe(t,r);else if(e==="document")n=HPe(Pf(t));else if(of(e))n=WPe(e,r);else{const i=hie(t);n={...e,x:e.x-i.x,y:e.y-i.y}}return Q6(n)}function gie(t,e){const r=nm(t);return r===e||!of(r)||K8(r)?!1:Za(r).position==="fixed"||gie(r,e)}function VPe(t,e){const r=e.get(t);if(r)return r;let n=t2(t,[],!1).filter(a=>of(a)&&Yd(a)!=="body"),i=null;const s=Za(t).position==="fixed";let o=s?nm(t):t;for(;of(o)&&!K8(o);){const a=Za(o),c=B$(o);!c&&a.position==="fixed"&&(i=null),(s?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||cw(o)&&!c&&gie(t,o))?n=n.filter(u=>u!==o):i=a,o=nm(o)}return e.set(t,n),n}function GPe(t){let{element:e,boundary:r,rootBoundary:n,strategy:i}=t;const o=[...r==="clippingAncestors"?VPe(e,this._c):[].concat(r),n],a=o[0],c=o.reduce((l,u)=>{const f=zz(e,u,i);return l.top=Jo(f.top,l.top),l.right=Jd(f.right,l.right),l.bottom=Jd(f.bottom,l.bottom),l.left=Jo(f.left,l.left),l},zz(e,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function KPe(t){return die(t)}function JPe(t,e,r){const n=Zl(e),i=Pf(e),s=r==="fixed",o=X0(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const c=Qd(0);if(n||!n&&!s)if((Yd(e)!=="body"||cw(i))&&(a=J8(e)),n){const l=X0(e,!0,s,e);c.x=l.x+e.clientLeft,c.y=l.y+e.clientTop}else i&&(c.x=pie(i));return{x:o.left+a.scrollLeft-c.x,y:o.top+a.scrollTop-c.y,width:o.width,height:o.height}}function Hz(t,e){return!Zl(t)||Za(t).position==="fixed"?null:e?e(t):t.offsetParent}function mie(t,e){const r=na(t);if(!Zl(t))return r;let n=Hz(t,e);for(;n&&LPe(n)&&Za(n).position==="static";)n=Hz(n,e);return n&&(Yd(n)==="html"||Yd(n)==="body"&&Za(n).position==="static"&&!B$(n))?r:n||BPe(t)||r}const QPe=async function(t){let{reference:e,floating:r,strategy:n}=t;const i=this.getOffsetParent||mie,s=this.getDimensions;return{reference:JPe(e,await i(r),n),floating:{x:0,y:0,...await s(r)}}};function YPe(t){return Za(t).direction==="rtl"}const ZPe={convertOffsetParentRelativeRectToViewportRelativeRect:UPe,getDocumentElement:Pf,getClippingRect:GPe,getOffsetParent:mie,getElementRects:QPe,getClientRects:zPe,getDimensions:KPe,getScale:bg,isElement:of,isRTL:YPe};function XPe(t,e){let r=null,n;const i=Pf(t);function s(){clearTimeout(n),r&&r.disconnect(),r=null}function o(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const{left:l,top:u,width:f,height:d}=t.getBoundingClientRect();if(a||e(),!f||!d)return;const p=H5(u),g=H5(i.clientWidth-(l+f)),v=H5(i.clientHeight-(u+d)),y=H5(l),w={rootMargin:-p+"px "+-g+"px "+-v+"px "+-y+"px",threshold:Jo(0,Jd(1,c))||1};let E=!0;function C(S){const P=S[0].intersectionRatio;if(P!==c){if(!E)return o();P?o(!1,P):n=setTimeout(()=>{o(!1,1e-7)},100)}E=!1}try{r=new IntersectionObserver(C,{...w,root:i.ownerDocument})}catch{r=new IntersectionObserver(C,w)}r.observe(t)}return o(!0),s}function eRe(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,l=j$(t),u=i||s?[...l?t2(l):[],...t2(e)]:[];u.forEach(b=>{i&&b.addEventListener("scroll",r,{passive:!0}),s&&b.addEventListener("resize",r)});const f=l&&a?XPe(l,r):null;let d=-1,p=null;o&&(p=new ResizeObserver(b=>{let[w]=b;w&&w.target===l&&p&&(p.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{p&&p.observe(e)})),r()}),l&&!c&&p.observe(l),p.observe(e));let g,v=c?X0(t):null;c&&y();function y(){const b=X0(t);v&&(b.x!==v.x||b.y!==v.y||b.width!==v.width||b.height!==v.height)&&r(),v=b,g=requestAnimationFrame(y)}return r(),()=>{u.forEach(b=>{i&&b.removeEventListener("scroll",r),s&&b.removeEventListener("resize",r)}),f&&f(),p&&p.disconnect(),p=null,c&&cancelAnimationFrame(g)}}const tRe=(t,e,r)=>{const n=new Map,i={platform:ZPe,...r},s={...i.platform,_c:n};return PPe(t,e,{...i,platform:s})},rRe=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:i}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?Bz({element:n.current,padding:i}).fn(r):{}:n?Bz({element:n,padding:i}).fn(r):{}}}};var uE=typeof document<"u"?$.useLayoutEffect:$.useEffect;function Y6(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!Y6(t[n],e[n]))return!1;return!0}if(i=Object.keys(t),r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){const s=i[n];if(!(s==="_owner"&&t.$$typeof)&&!Y6(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function vie(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function qz(t,e){const r=vie(t);return Math.round(e*r)/r}function Wz(t){const e=$.useRef(t);return uE(()=>{e.current=t}),e}function nRe(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:c,open:l}=t,[u,f]=$.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[d,p]=$.useState(n);Y6(d,n)||p(n);const[g,v]=$.useState(null),[y,b]=$.useState(null),w=$.useCallback(B=>{B!=P.current&&(P.current=B,v(B))},[v]),E=$.useCallback(B=>{B!==_.current&&(_.current=B,b(B))},[b]),C=s||g,S=o||y,P=$.useRef(null),_=$.useRef(null),T=$.useRef(u),Q=Wz(c),Z=Wz(i),ne=$.useCallback(()=>{if(!P.current||!_.current)return;const B={placement:e,strategy:r,middleware:d};Z.current&&(B.platform=Z.current),tRe(P.current,_.current,B).then(z=>{const R={...z,isPositioned:!0};ce.current&&!Y6(T.current,R)&&(T.current=R,Gc.flushSync(()=>{f(R)}))})},[d,e,r,Z]);uE(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(B=>({...B,isPositioned:!1})))},[l]);const ce=$.useRef(!1);uE(()=>(ce.current=!0,()=>{ce.current=!1}),[]),uE(()=>{if(C&&(P.current=C),S&&(_.current=S),C&&S){if(Q.current)return Q.current(C,S,ne);ne()}},[C,S,ne,Q]);const K=$.useMemo(()=>({reference:P,floating:_,setReference:w,setFloating:E}),[w,E]),x=$.useMemo(()=>({reference:C,floating:S}),[C,S]),A=$.useMemo(()=>{const B={position:r,left:0,top:0};if(!x.floating)return B;const z=qz(x.floating,u.x),R=qz(x.floating,u.y);return a?{...B,transform:"translate("+z+"px, "+R+"px)",...vie(x.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:z,top:R}},[r,a,x.floating,u.x,u.y]);return $.useMemo(()=>({...u,update:ne,refs:K,elements:x,floatingStyles:A}),[u,ne,K,x,A])}const yie="Popper",[bie,Lm]=Ps(yie),[iRe,wie]=bie(yie),sRe=t=>{const{__scopePopper:e,children:r}=t,[n,i]=$.useState(null);return $.createElement(iRe,{scope:e,anchor:n,onAnchorChange:i},r)},oRe="PopperAnchor",aRe=$.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...i}=t,s=wie(oRe,r),o=$.useRef(null),a=hn(e,o);return $.useEffect(()=>{s.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:$.createElement(pr.div,jt({},i,{ref:a}))}),xie="PopperContent",[cRe,_yt]=bie(xie),lRe=$.forwardRef((t,e)=>{var r,n,i,s,o,a,c,l;const{__scopePopper:u,side:f="bottom",sideOffset:d=0,align:p="center",alignOffset:g=0,arrowPadding:v=0,avoidCollisions:y=!0,collisionBoundary:b=[],collisionPadding:w=0,sticky:E="partial",hideWhenDetached:C=!1,updatePositionStrategy:S="optimized",onPlaced:P,..._}=t,T=wie(xie,u),[Q,Z]=$.useState(null),ne=hn(e,Ce=>Z(Ce)),[ce,K]=$.useState(null),x=U8(ce),A=(r=x==null?void 0:x.width)!==null&&r!==void 0?r:0,B=(n=x==null?void 0:x.height)!==null&&n!==void 0?n:0,z=f+(p!=="center"?"-"+p:""),R=typeof w=="number"?w:{top:0,right:0,bottom:0,left:0,...w},L=Array.isArray(b)?b:[b],q=L.length>0,N={padding:R,boundary:L.filter(uRe),altBoundary:q},{refs:I,floatingStyles:U,placement:re,isPositioned:M,middlewareData:G}=nRe({strategy:"fixed",placement:z,whileElementsMounted:(...Ce)=>eRe(...Ce,{animationFrame:S==="always"}),elements:{reference:T.anchor},middleware:[$Pe({mainAxis:d+B,alignmentAxis:g}),y&&NPe({mainAxis:!0,crossAxis:!1,limiter:E==="partial"?MPe():void 0,...N}),y&&RPe({...N}),DPe({...N,apply:({elements:Ce,rects:Me,availableWidth:Oe,availableHeight:We})=>{const{width:ot,height:ze}=Me.reference,Le=Ce.floating.style;Le.setProperty("--radix-popper-available-width",`${Oe}px`),Le.setProperty("--radix-popper-available-height",`${We}px`),Le.setProperty("--radix-popper-anchor-width",`${ot}px`),Le.setProperty("--radix-popper-anchor-height",`${ze}px`)}}),ce&&rRe({element:ce,padding:v}),fRe({arrowWidth:A,arrowHeight:B}),C&&TPe({strategy:"referenceHidden",...N})]}),[H,J]=Eie(re),X=Qa(P);Ya(()=>{M&&(X==null||X())},[M,X]);const D=(i=G.arrow)===null||i===void 0?void 0:i.x,F=(s=G.arrow)===null||s===void 0?void 0:s.y,Y=((o=G.arrow)===null||o===void 0?void 0:o.centerOffset)!==0,[ue,he]=$.useState();return Ya(()=>{Q&&he(window.getComputedStyle(Q).zIndex)},[Q]),$.createElement("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:M?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ue,"--radix-popper-transform-origin":[(a=G.transformOrigin)===null||a===void 0?void 0:a.x,(c=G.transformOrigin)===null||c===void 0?void 0:c.y].join(" ")},dir:t.dir},$.createElement(cRe,{scope:u,placedSide:H,onArrowChange:K,arrowX:D,arrowY:F,shouldHideArrow:Y},$.createElement(pr.div,jt({"data-side":H,"data-align":J},_,{ref:ne,style:{..._.style,animation:M?void 0:"none",opacity:(l=G.hide)!==null&&l!==void 0&&l.referenceHidden?0:void 0}}))))});function uRe(t){return t!==null}const fRe=t=>({name:"transformOrigin",options:t,fn(e){var r,n,i,s,o;const{placement:a,rects:c,middlewareData:l}=e,f=((r=l.arrow)===null||r===void 0?void 0:r.centerOffset)!==0,d=f?0:t.arrowWidth,p=f?0:t.arrowHeight,[g,v]=Eie(a),y={start:"0%",center:"50%",end:"100%"}[v],b=((n=(i=l.arrow)===null||i===void 0?void 0:i.x)!==null&&n!==void 0?n:0)+d/2,w=((s=(o=l.arrow)===null||o===void 0?void 0:o.y)!==null&&s!==void 0?s:0)+p/2;let E="",C="";return g==="bottom"?(E=f?y:`${b}px`,C=`${-p}px`):g==="top"?(E=f?y:`${b}px`,C=`${c.floating.height+p}px`):g==="right"?(E=`${-p}px`,C=f?y:`${w}px`):g==="left"&&(E=`${c.floating.width+p}px`,C=f?y:`${w}px`),{data:{x:E,y:C}}}});function Eie(t){const[e,r="center"]=t.split("-");return[e,r]}const dRe=sRe,hRe=aRe,pRe=lRe,_ie=$.forwardRef((t,e)=>{var r;const{container:n=globalThis==null||(r=globalThis.document)===null||r===void 0?void 0:r.body,...i}=t;return n?v2e.createPortal($.createElement(pr.div,jt({},i,{ref:e})),n):null}),p9="rovingFocusGroup.onEntryFocus",gRe={bubbles:!1,cancelable:!0},U$="RovingFocusGroup",[sP,Cie,mRe]=V8(U$),[vRe,Bm]=Ps(U$,[mRe]),[yRe,bRe]=vRe(U$),wRe=$.forwardRef((t,e)=>$.createElement(sP.Provider,{scope:t.__scopeRovingFocusGroup},$.createElement(sP.Slot,{scope:t.__scopeRovingFocusGroup},$.createElement(xRe,Zr({},t,{ref:e}))))),xRe=$.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:l,...u}=t,f=$.useRef(null),d=hn(e,f),p=G8(s),[g=null,v]=Kd({prop:o,defaultProp:a,onChange:c}),[y,b]=$.useState(!1),w=Qa(l),E=Cie(r),C=$.useRef(!1),[S,P]=$.useState(0);return $.useEffect(()=>{const _=f.current;if(_)return _.addEventListener(p9,w),()=>_.removeEventListener(p9,w)},[w]),$.createElement(yRe,{scope:r,orientation:n,dir:p,loop:i,currentTabStopId:g,onItemFocus:$.useCallback(_=>v(_),[v]),onItemShiftTab:$.useCallback(()=>b(!0),[]),onFocusableItemAdd:$.useCallback(()=>P(_=>_+1),[]),onFocusableItemRemove:$.useCallback(()=>P(_=>_-1),[])},$.createElement(pr.div,Zr({tabIndex:y||S===0?-1:0,"data-orientation":n},u,{ref:d,style:{outline:"none",...t.style},onMouseDown:Pt(t.onMouseDown,()=>{C.current=!0}),onFocus:Pt(t.onFocus,_=>{const T=!C.current;if(_.target===_.currentTarget&&T&&!y){const Q=new CustomEvent(p9,gRe);if(_.currentTarget.dispatchEvent(Q),!Q.defaultPrevented){const Z=E().filter(A=>A.focusable),ne=Z.find(A=>A.active),ce=Z.find(A=>A.id===g),x=[ne,ce,...Z].filter(Boolean).map(A=>A.ref.current);Sie(x)}}C.current=!1}),onBlur:Pt(t.onBlur,()=>b(!1))})))}),ERe="RovingFocusGroupItem",_Re=$.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:s,...o}=t,a=Md(),c=s||a,l=bRe(ERe,r),u=l.currentTabStopId===c,f=Cie(r),{onFocusableItemAdd:d,onFocusableItemRemove:p}=l;return $.useEffect(()=>{if(n)return d(),()=>p()},[n,d,p]),$.createElement(sP.ItemSlot,{scope:r,id:c,focusable:n,active:i},$.createElement(pr.span,Zr({tabIndex:u?0:-1,"data-orientation":l.orientation},o,{ref:e,onMouseDown:Pt(t.onMouseDown,g=>{n?l.onItemFocus(c):g.preventDefault()}),onFocus:Pt(t.onFocus,()=>l.onItemFocus(c)),onKeyDown:Pt(t.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey){l.onItemShiftTab();return}if(g.target!==g.currentTarget)return;const v=ARe(g,l.orientation,l.dir);if(v!==void 0){g.preventDefault();let b=f().filter(w=>w.focusable).map(w=>w.ref.current);if(v==="last")b.reverse();else if(v==="prev"||v==="next"){v==="prev"&&b.reverse();const w=b.indexOf(g.currentTarget);b=l.loop?kRe(b,w+1):b.slice(w+1)}setTimeout(()=>Sie(b))}})})))}),CRe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function SRe(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function ARe(t,e,r){const n=SRe(t.key,r);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return CRe[n]}function Sie(t){const e=document.activeElement;for(const r of t)if(r===e||(r.focus(),document.activeElement!==e))return}function kRe(t,e){return t.map((r,n)=>t[(e+n)%t.length])}const Aie=wRe,z$=_Re;var IRe=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},up=new WeakMap,q5=new WeakMap,W5={},g9=0,kie=function(t){return t&&(t.host||kie(t.parentNode))},PRe=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=kie(r);return n&&t.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},RRe=function(t,e,r,n){var i=PRe(e,Array.isArray(t)?t:[t]);W5[r]||(W5[r]=new WeakMap);var s=W5[r],o=[],a=new Set,c=new Set(i),l=function(f){!f||a.has(f)||(a.add(f),l(f.parentNode))};i.forEach(l);var u=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(d){if(a.has(d))u(d);else{var p=d.getAttribute(n),g=p!==null&&p!=="false",v=(up.get(d)||0)+1,y=(s.get(d)||0)+1;up.set(d,v),s.set(d,y),o.push(d),v===1&&g&&q5.set(d,!0),y===1&&d.setAttribute(r,"true"),g||d.setAttribute(n,"true")}})};return u(e),a.clear(),g9++,function(){o.forEach(function(f){var d=up.get(f)-1,p=s.get(f)-1;up.set(f,d),s.set(f,p),d||(q5.has(f)||f.removeAttribute(n),q5.delete(f)),p||f.removeAttribute(r)}),g9--,g9||(up=new WeakMap,up=new WeakMap,q5=new WeakMap,W5={})}},Iie=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),i=e||IRe(t);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live]"))),RRe(n,i,r,"aria-hidden")):function(){return null}},Sl=function(){return Sl=Object.assign||function(e){for(var r,n=1,i=arguments.length;n"u")return GRe;var e=KRe(t),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}},QRe=Oie(),YRe=function(t,e,r,n){var i=t.left,s=t.top,o=t.right,a=t.gap;return r===void 0&&(r="margin"),` + .`.concat(ORe,` { + overflow: hidden `).concat(n,`; + padding-right: `).concat(a,"px ").concat(n,`; + } + body { + overflow: hidden `).concat(n,`; + overscroll-behavior: contain; + `).concat([e&&"position: relative ".concat(n,";"),r==="margin"&&` + padding-left: `.concat(i,`px; + padding-top: `).concat(s,`px; + padding-right: `).concat(o,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(a,"px ").concat(n,`; + `),r==="padding"&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),` + } + + .`).concat(fE,` { + right: `).concat(a,"px ").concat(n,`; + } + + .`).concat(dE,` { + margin-right: `).concat(a,"px ").concat(n,`; + } + + .`).concat(fE," .").concat(fE,` { + right: 0 `).concat(n,`; + } + + .`).concat(dE," .").concat(dE,` { + margin-right: 0 `).concat(n,`; + } + + body { + `).concat($Re,": ").concat(a,`px; + } +`)},ZRe=function(t){var e=t.noRelative,r=t.noImportant,n=t.gapMode,i=n===void 0?"margin":n,s=$.useMemo(function(){return JRe(i)},[i]);return $.createElement(QRe,{styles:YRe(s,!e,i,r?"":"!important")})},oP=!1;if(typeof window<"u")try{var V5=Object.defineProperty({},"passive",{get:function(){return oP=!0,!0}});window.addEventListener("test",V5,V5),window.removeEventListener("test",V5,V5)}catch{oP=!1}var fp=oP?{passive:!1}:!1,XRe=function(t){return t.tagName==="TEXTAREA"},$ie=function(t,e){var r=window.getComputedStyle(t);return r[e]!=="hidden"&&!(r.overflowY===r.overflowX&&!XRe(t)&&r[e]==="visible")},eTe=function(t){return $ie(t,"overflowY")},tTe=function(t){return $ie(t,"overflowX")},Vz=function(t,e){var r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var n=Nie(t,r);if(n){var i=Mie(t,r),s=i[1],o=i[2];if(s>o)return!0}r=r.parentNode}while(r&&r!==document.body);return!1},rTe=function(t){var e=t.scrollTop,r=t.scrollHeight,n=t.clientHeight;return[e,r,n]},nTe=function(t){var e=t.scrollLeft,r=t.scrollWidth,n=t.clientWidth;return[e,r,n]},Nie=function(t,e){return t==="v"?eTe(e):tTe(e)},Mie=function(t,e){return t==="v"?rTe(e):nTe(e)},iTe=function(t,e){return t==="h"&&e==="rtl"?-1:1},sTe=function(t,e,r,n,i){var s=iTe(t,window.getComputedStyle(e).direction),o=s*n,a=r.target,c=e.contains(a),l=!1,u=o>0,f=0,d=0;do{var p=Mie(t,a),g=p[0],v=p[1],y=p[2],b=v-y-s*g;(g||b)&&Nie(t,a)&&(f+=b,d+=g),a=a.parentNode}while(!c&&a!==document.body||c&&(e.contains(a)||e===a));return(u&&(i&&f===0||!i&&o>f)||!u&&(i&&d===0||!i&&-o>d))&&(l=!0),l},G5=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Gz=function(t){return[t.deltaX,t.deltaY]},Kz=function(t){return t&&"current"in t?t.current:t},oTe=function(t,e){return t[0]===e[0]&&t[1]===e[1]},aTe=function(t){return` + .block-interactivity-`.concat(t,` {pointer-events: none;} + .allow-interactivity-`).concat(t,` {pointer-events: all;} +`)},cTe=0,dp=[];function lTe(t){var e=$.useRef([]),r=$.useRef([0,0]),n=$.useRef(),i=$.useState(cTe++)[0],s=$.useState(function(){return Oie()})[0],o=$.useRef(t);$.useEffect(function(){o.current=t},[t]),$.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var v=TRe([t.lockRef.current],(t.shards||[]).map(Kz),!0).filter(Boolean);return v.forEach(function(y){return y.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),v.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var a=$.useCallback(function(v,y){if("touches"in v&&v.touches.length===2)return!o.current.allowPinchZoom;var b=G5(v),w=r.current,E="deltaX"in v?v.deltaX:w[0]-b[0],C="deltaY"in v?v.deltaY:w[1]-b[1],S,P=v.target,_=Math.abs(E)>Math.abs(C)?"h":"v";if("touches"in v&&_==="h"&&P.type==="range")return!1;var T=Vz(_,P);if(!T)return!0;if(T?S=_:(S=_==="v"?"h":"v",T=Vz(_,P)),!T)return!1;if(!n.current&&"changedTouches"in v&&(E||C)&&(n.current=S),!S)return!0;var Q=n.current||S;return sTe(Q,y,v,Q==="h"?E:C,!0)},[]),c=$.useCallback(function(v){var y=v;if(!(!dp.length||dp[dp.length-1]!==s)){var b="deltaY"in y?Gz(y):G5(y),w=e.current.filter(function(S){return S.name===y.type&&S.target===y.target&&oTe(S.delta,b)})[0];if(w&&w.should){y.cancelable&&y.preventDefault();return}if(!w){var E=(o.current.shards||[]).map(Kz).filter(Boolean).filter(function(S){return S.contains(y.target)}),C=E.length>0?a(y,E[0]):!o.current.noIsolation;C&&y.cancelable&&y.preventDefault()}}},[]),l=$.useCallback(function(v,y,b,w){var E={name:v,delta:y,target:b,should:w};e.current.push(E),setTimeout(function(){e.current=e.current.filter(function(C){return C!==E})},1)},[]),u=$.useCallback(function(v){r.current=G5(v),n.current=void 0},[]),f=$.useCallback(function(v){l(v.type,Gz(v),v.target,a(v,t.lockRef.current))},[]),d=$.useCallback(function(v){l(v.type,G5(v),v.target,a(v,t.lockRef.current))},[]);$.useEffect(function(){return dp.push(s),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:d}),document.addEventListener("wheel",c,fp),document.addEventListener("touchmove",c,fp),document.addEventListener("touchstart",u,fp),function(){dp=dp.filter(function(v){return v!==s}),document.removeEventListener("wheel",c,fp),document.removeEventListener("touchmove",c,fp),document.removeEventListener("touchstart",u,fp)}},[]);var p=t.removeScrollBar,g=t.inert;return $.createElement($.Fragment,null,g?$.createElement(s,{styles:aTe(i)}):null,p?$.createElement(ZRe,{gapMode:"margin"}):null)}const uTe=jRe(Tie,lTe);var Die=$.forwardRef(function(t,e){return $.createElement(Q8,Sl({},t,{ref:e,sideCar:uTe}))});Die.classNames=Q8.classNames;const Lie=Die,fTe=["Enter"," "],Y8="Menu",[dTe,Cyt,hTe]=V8(Y8),[x1,Bie]=Ps(Y8,[hTe,Lm,Bm]);Lm();const pTe=Bm();x1(Y8);const[Syt,gTe]=x1(Y8),mTe="MenuPortal";x1(mTe,{forceMount:void 0});const vTe="MenuContent",[Ayt,Fie]=x1(vTe),aP="MenuItem",Jz="menu.itemSelect",jie=$.forwardRef((t,e)=>{const{disabled:r=!1,onSelect:n,...i}=t,s=$.useRef(null),o=gTe(aP,t.__scopeMenu),a=Fie(aP,t.__scopeMenu),c=hn(e,s),l=$.useRef(!1),u=()=>{const f=s.current;if(!r&&f){const d=new CustomEvent(Jz,{bubbles:!0,cancelable:!0});f.addEventListener(Jz,p=>n==null?void 0:n(p),{once:!0}),$$(f,d),d.defaultPrevented?l.current=!1:o.onClose()}};return $.createElement(yTe,jt({},i,{ref:c,disabled:r,onClick:Pt(t.onClick,u),onPointerDown:f=>{var d;(d=t.onPointerDown)===null||d===void 0||d.call(t,f),l.current=!0},onPointerUp:Pt(t.onPointerUp,f=>{var d;l.current||(d=f.currentTarget)===null||d===void 0||d.click()}),onKeyDown:Pt(t.onKeyDown,f=>{const d=a.searchRef.current!=="";r||d&&f.key===" "||fTe.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})}))}),yTe=$.forwardRef((t,e)=>{const{__scopeMenu:r,disabled:n=!1,textValue:i,...s}=t,o=Fie(aP,r),a=pTe(r),c=$.useRef(null),l=hn(e,c),[u,f]=$.useState(!1),[d,p]=$.useState("");return $.useEffect(()=>{const g=c.current;if(g){var v;p(((v=g.textContent)!==null&&v!==void 0?v:"").trim())}},[s.children]),$.createElement(dTe.ItemSlot,{scope:r,disabled:n,textValue:i??d},$.createElement(z$,jt({asChild:!0},a,{focusable:!n}),$.createElement(pr.div,jt({role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0},s,{ref:l,onPointerMove:Pt(t.onPointerMove,Qz(g=>{n?o.onItemLeave(g):(o.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus())})),onPointerLeave:Pt(t.onPointerLeave,Qz(g=>o.onItemLeave(g))),onFocus:Pt(t.onFocus,()=>f(!0)),onBlur:Pt(t.onBlur,()=>f(!1))}))))}),bTe=$.forwardRef((t,e)=>{const{checked:r=!1,onCheckedChange:n,...i}=t;return $.createElement(zie,{scope:t.__scopeMenu,checked:r},$.createElement(jie,jt({role:"menuitemcheckbox","aria-checked":Z6(r)?"mixed":r},i,{ref:e,"data-state":H$(r),onSelect:Pt(i.onSelect,()=>n==null?void 0:n(Z6(r)?!0:!r),{checkForDefaultPrevented:!1})})))}),wTe="MenuRadioGroup",[kyt,xTe]=x1(wTe,{value:void 0,onValueChange:()=>{}}),ETe="MenuRadioItem",_Te=$.forwardRef((t,e)=>{const{value:r,...n}=t,i=xTe(ETe,t.__scopeMenu),s=r===i.value;return $.createElement(zie,{scope:t.__scopeMenu,checked:s},$.createElement(jie,jt({role:"menuitemradio","aria-checked":s},n,{ref:e,"data-state":H$(s),onSelect:Pt(n.onSelect,()=>{var o;return(o=i.onValueChange)===null||o===void 0?void 0:o.call(i,r)},{checkForDefaultPrevented:!1})})))}),Uie="MenuItemIndicator",[zie,CTe]=x1(Uie,{checked:!1}),STe=$.forwardRef((t,e)=>{const{__scopeMenu:r,forceMount:n,...i}=t,s=CTe(Uie,r);return $.createElement(mh,{present:n||Z6(s.checked)||s.checked===!0},$.createElement(pr.span,jt({},i,{ref:e,"data-state":H$(s.checked)})))}),ATe="MenuSub";x1(ATe);function Z6(t){return t==="indeterminate"}function H$(t){return Z6(t)?"indeterminate":t?"checked":"unchecked"}function Qz(t){return e=>e.pointerType==="mouse"?t(e):void 0}const kTe=bTe,ITe=_Te,PTe=STe,Hie="DropdownMenu",[RTe,Iyt]=Ps(Hie,[Bie]),q$=Bie();RTe(Hie);const TTe=$.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=q$(r);return $.createElement(kTe,jt({},i,n,{ref:e}))}),OTe=$.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=q$(r);return $.createElement(ITe,jt({},i,n,{ref:e}))}),$Te=$.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=q$(r);return $.createElement(PTe,jt({},i,n,{ref:e}))}),NTe=TTe,MTe=OTe,qie=$Te;var Wie="_1k2mbvi5",Vie="_1k2mbvi4 fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr1x4 fyvr1yk fyvr1ss fyvr1uo fyvr12wk fyvr12we fyvr11h0 fyvr11ko fyvr11jw fyvr12uz fyvr11n2 fyvr11hw fyvr12rz";const DTe=({children:t})=>me.jsx(qie,{className:Wie,children:t});$.forwardRef(({className:t,children:e,...r},n)=>me.jsxs(NTe,{className:fa(Vie,t),...r,ref:n,children:[me.jsx(DTe,{children:me.jsx(Nm,{size:"xs"})}),me.jsx(Pe,{variant:"small",children:e})]}));$.forwardRef(({className:t,children:e,...r},n)=>me.jsxs(MTe,{className:fa(Vie,t),...r,ref:n,children:[me.jsx(qie,{className:Wie,children:me.jsx(Pe,{children:"•"})}),me.jsx(Pe,{variant:"small",children:e})]}));const af=$.forwardRef((t,e)=>{const{icon:r,size:n="md",...i}=t;return me.jsx(Sr,{leftIcon:r,size:n,flexShrink:"0",ref:e,...i})}),LTe=(...t)=>e=>t.forEach(r=>{r&&(typeof r=="function"?r(e):r.current=e)});var BTe="fyvr12wh fyvr12wb fyvr11ho fyvr12vb fyvr1ko fyvr1oo fyvr1mo fyvr1qo",FTe="_1hq71vk1 _1qxj1ib9 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 fyvr11a8 fyvr11ak fyvr11aw fyvr11b8 fyvr1t4 fyvr1v0 fyvr1ww fyvr1ys fyvr12n5 fyvr12ft fyvr1215 fyvr128h fyvr12nn fyvr12gb fyvr121n fyvr128z fyvr11ko fyvr11hc fyvr11ic fyvr11jc fyvr1g0 fyvr11hw",jTe=On({defaultClassName:"_1hq71vk5",variantClassNames:{borderRadius:{xs:"fyvr11cw fyvr11dk fyvr11bk fyvr11c8",sm:"fyvr11d0 fyvr11do fyvr11bo fyvr11cc",md:"fyvr11d4 fyvr11ds fyvr11bs fyvr11cg"}},defaultVariants:{},compoundVariants:[]});const UTe={png:".png,image/png",jpeg:".jpeg,image/jpeg",jpg:".jpg,image/jpg",images:"image/*",pdf:".pdf,application/pdf"};$.forwardRef((t,e)=>{const{borderRadius:r="md",description:n,disabled:i=!1,id:s,label:o="",labelLocation:a="hidden",name:c,onValueChange:l,placeholder:u="Upload a file",validExtensions:f,...d}=t,p=$.useRef(null),g=LTe(p,e),[v,y]=$.useState(null),b=E=>{const C=E.currentTarget.files;if(!C||!C[0])return;const S=C[0],P=S.name,_=S.size/1e3;y({name:P,size:_,extension:P.split(".").pop()??""}),l==null||l(S)},w=f.map(E=>UTe[E]).join(",");return me.jsx(b1,{description:n,disabled:i,display:"grid",id:s??c,label:o,labelLocation:a,children:me.jsx(ae,{width:"full",children:me.jsxs(ae,{justifyContent:v?"space-between":"flex-start",color:v?"text100":"text50",className:fa(FTe,jTe({borderRadius:r})),children:[v?me.jsxs(ae,{flexDirection:"row",gap:"2",alignItems:"baseline",children:[me.jsx(Pe,{children:v.name}),me.jsxs(Pe,{color:"text50",variant:"xsmall",children:[v.size.toFixed(2)," kb"]})]}):me.jsx(Pe,{children:u}),me.jsx(ae,{accept:w,as:"input",className:BTe,cursor:v?"text":"pointer",disabled:i||!!v,id:s??c,name:c,onChange:b,ref:g,type:"file",...d}),v&&me.jsx(af,{cursor:"pointer",icon:w1,size:"xs",onClick:E=>{var C;E.preventDefault(),E.stopPropagation(),(C=p.current)!=null&&C.value&&(p.current.value=""),l==null||l(null),y(null)},zIndex:"10"})]})})})});var zTe=On({defaultClassName:"_1bhyzin0",variantClassNames:{size:{xs:"_1bhyzin1",sm:"_1bhyzin2",md:"_1bhyzin3",lg:"_1bhyzin4",xl:"_1bhyzin5"}},defaultVariants:{},compoundVariants:[]});const cP=1e3,wg=64,y9=wg/2,b9=(t,e=cP)=>t%e/(cP/wg),a0=(t,e=0)=>{let r=3735928559^e,n=1103547991^e;for(let i=0,s;i>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),4294967296*(2097151&n)+(r>>>0)},HTe=(t,e,r)=>{const n=Math.random().toString(36).slice(2,12),i=t%360,s=(t+120)%360,o=r%360;return{id:a0(n),a:`hsl(${i}deg 100% 40%)`,b:`hsl(${s}deg 100% 50%)`,c:`hsl(${o}deg 100% 50%)`}},qTe=(t,e)=>{const r=[];for(let n=0;n{const s=wg/10+b9(n.r,cP*1.5/(i+1));return{...HTe(n.a,n.b,n.c),x:b9(n.x),y:b9(n.y),r:s}})},lw=$.memo(t=>{const{className:e,address:r,size:n="md",complexity:i=1,...s}=t,o=qTe(r,i);return me.jsxs(ae,{as:"svg",className:fa(e,zTe({size:n})),viewBox:`0 0 ${wg} ${wg}`,version:"1.1",flexShrink:"0",borderRadius:"circle",overflow:"hidden",xmlns:"http://www.w3.org/2000/svg",...s,children:[me.jsxs("defs",{children:[me.jsx("clipPath",{id:"circle-clip",children:me.jsx("circle",{cx:y9,cy:y9,r:y9})}),me.jsxs("filter",{id:"blur",x:"-10%",y:"-10%",width:"120%",height:"120%",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[me.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),me.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),me.jsx("feGaussianBlur",{stdDeviation:wg/10,result:"effect1_foregroundBlur"})]}),me.jsxs("linearGradient",{id:`gradient-background-${o[0].id}`,x1:"0",y1:"0",x2:"1",y2:"1",children:[me.jsx("stop",{offset:"0",stopColor:o[0].c}),me.jsx("stop",{offset:"1",stopColor:o[0].a})]}),o.map(a=>me.jsxs($.Fragment,{children:[me.jsxs("radialGradient",{id:`gradient-primary-${a.id}`,children:[me.jsx("stop",{offset:"0",stopColor:a.a}),me.jsx("stop",{offset:"1",stopColor:a.b})]}),me.jsxs("radialGradient",{id:`gradient-secondary-${a.id}`,children:[me.jsx("stop",{offset:"0",stopColor:a.c}),me.jsx("stop",{offset:"1",stopColor:a.b})]})]},a.id))]}),me.jsxs("g",{clipPath:"url(#circle-clip)",children:[me.jsx("rect",{width:"100%",height:"100%",fill:`url(#gradient-background-${o[0].id})`}),me.jsx("g",{filter:"url(#blur)",children:o.map(a=>me.jsxs($.Fragment,{children:[me.jsx("circle",{fill:`url(#gradient-primary-${a.id})`,cx:a.x,cy:a.y,r:a.r}),me.jsx("circle",{fill:`url(#gradient-secondary-${a.id})`,cx:a.y,cy:a.x,r:a.r/2})]},a.id))})]})]})}),Hn=t=>{const{disableAnimation:e=!1,onLoad:r,...n}=t,[i,s]=$.useState(!1),o=a=>{s(!0),r==null||r(a)};return me.jsx(ae,{as:Zb.img,initial:e?void 0:{opacity:0},animate:e?void 0:{opacity:i?1:0},transition:{duration:.2},onLoad:e?void 0:o,...n})},Gie="Dialog",[Kie,Pyt]=Ps(Gie),[WTe,vh]=Kie(Gie),VTe=t=>{const{__scopeDialog:e,children:r,open:n,defaultOpen:i,onOpenChange:s,modal:o=!0}=t,a=$.useRef(null),c=$.useRef(null),[l=!1,u]=Kd({prop:n,defaultProp:i,onChange:s});return $.createElement(WTe,{scope:e,triggerRef:a,contentRef:c,contentId:Md(),titleId:Md(),descriptionId:Md(),open:l,onOpenChange:u,onOpenToggle:$.useCallback(()=>u(f=>!f),[u]),modal:o},r)},Jie="DialogPortal",[GTe,Qie]=Kie(Jie,{forceMount:void 0}),KTe=t=>{const{__scopeDialog:e,forceMount:r,children:n,container:i}=t,s=vh(Jie,e);return $.createElement(GTe,{scope:e,forceMount:r},$.Children.map(n,o=>$.createElement(mh,{present:r||s.open},$.createElement(_ie,{asChild:!0,container:i},o))))},lP="DialogOverlay",JTe=$.forwardRef((t,e)=>{const r=Qie(lP,t.__scopeDialog),{forceMount:n=r.forceMount,...i}=t,s=vh(lP,t.__scopeDialog);return s.modal?$.createElement(mh,{present:n||s.open},$.createElement(QTe,jt({},i,{ref:e}))):null}),QTe=$.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=vh(lP,r);return $.createElement(Lie,{as:rm,allowPinchZoom:!0,shards:[i.contentRef]},$.createElement(pr.div,jt({"data-state":Zie(i.open)},n,{ref:e,style:{pointerEvents:"auto",...n.style}})))}),r2="DialogContent",YTe=$.forwardRef((t,e)=>{const r=Qie(r2,t.__scopeDialog),{forceMount:n=r.forceMount,...i}=t,s=vh(r2,t.__scopeDialog);return $.createElement(mh,{present:n||s.open},s.modal?$.createElement(ZTe,jt({},i,{ref:e})):$.createElement(XTe,jt({},i,{ref:e})))}),ZTe=$.forwardRef((t,e)=>{const r=vh(r2,t.__scopeDialog),n=$.useRef(null),i=hn(e,r.contentRef,n);return $.useEffect(()=>{const s=n.current;if(s)return Iie(s)},[]),$.createElement(Yie,jt({},t,{ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Pt(t.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=r.triggerRef.current)===null||o===void 0||o.focus()}),onPointerDownOutside:Pt(t.onPointerDownOutside,s=>{const o=s.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&s.preventDefault()}),onFocusOutside:Pt(t.onFocusOutside,s=>s.preventDefault())}))}),XTe=$.forwardRef((t,e)=>{const r=vh(r2,t.__scopeDialog),n=$.useRef(!1),i=$.useRef(!1);return $.createElement(Yie,jt({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o;if((o=t.onCloseAutoFocus)===null||o===void 0||o.call(t,s),!s.defaultPrevented){var a;n.current||(a=r.triggerRef.current)===null||a===void 0||a.focus(),s.preventDefault()}n.current=!1,i.current=!1},onInteractOutside:s=>{var o,a;(o=t.onInteractOutside)===null||o===void 0||o.call(t,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const c=s.target;((a=r.triggerRef.current)===null||a===void 0?void 0:a.contains(c))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}}))}),Yie=$.forwardRef((t,e)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=t,a=vh(r2,r),c=$.useRef(null),l=hn(e,c);return oie(),$.createElement($.Fragment,null,$.createElement(aie,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:s},$.createElement(N$,jt({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Zie(a.open)},o,{ref:l,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),eOe="DialogClose",tOe=$.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=vh(eOe,r);return $.createElement(pr.button,jt({type:"button"},n,{ref:e,onClick:Pt(t.onClick,()=>i.onOpenChange(!1))}))});function Zie(t){return t?"open":"closed"}const rOe=VTe,nOe=KTe,iOe=JTe,sOe=YTe,oOe=tOe;var aOe=On({defaultClassName:"_1vqx0w94",variantClassNames:{shadows:{true:"_1vqx0w95",false:"_1vqx0w96"},direction:{vertical:"_1vqx0w97",horizontal:"_1vqx0w98"}},defaultVariants:{},compoundVariants:[]}),cOe=On({defaultClassName:"_1vqx0w91 fyvr128 fyvr15o",variantClassNames:{direction:{vertical:"_1vqx0w92",horizontal:"_1vqx0w93"}},defaultVariants:{},compoundVariants:[]});const Xie=t=>{const{children:e,shadows:r=!0,direction:n="vertical",contentProps:i,...s}=t;return me.jsx(ae,{className:aOe({direction:n,shadows:r}),position:"relative",width:"full",height:"full",...s,children:me.jsx(ae,{className:cOe({direction:n}),background:"backgroundPrimary",...i,children:e})})};function lOe(t){var e=t.match(/^var\((.*)\)$/);return e?e[1]:t}function uOe(t,e){var r=t;for(var n of e){if(!(n in r))throw new Error("Path ".concat(e.join(" -> ")," does not exist in object"));r=r[n]}return r}function ese(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],n=t.constructor();for(var i in t){var s=t[i],o=[...r,i];typeof s=="string"||typeof s=="number"||s==null?n[i]=e(s,o):typeof s=="object"&&!Array.isArray(s)?n[i]=ese(s,e,o):console.warn('Skipping invalid key "'.concat(o.join("."),'". Should be a string, number, null or object. Received: "').concat(Array.isArray(s)?"Array":typeof s,'"'))}return n}function Yz(t,e,r){t.style.setProperty(lOe(e),r)}function Zz(t,e,r){if(typeof r=="object"){var n=e;ese(r,(o,a)=>{Yz(t,uOe(n,a),String(o))})}else{var i=e;for(var s in i)Yz(t,s,i[s])}}const W$=["dark","light"],fOe="dark",dOe="data-theme",Xz="@sequence.theme",hOe=t=>W$.includes(t),pOe=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),tse=t=>t?`${Xz}.${t}`:Xz,gOe=t=>{const e=localStorage.getItem(tse(t));return e&&W$.includes(e)?e:fOe},rse=$.createContext(null),Z8=t=>{const[e,r]=$.useState(t.theme||gOe(t.scope));$.useEffect(()=>{/Mac/.test(window.navigator.userAgent)&&window.document.documentElement.classList.add("is-apple")},[]),$.useEffect(()=>{t.theme&&r(t.theme)},[t.theme]),$.useEffect(()=>{const i=document.querySelector(t.root||":root");i&&(hOe(e)?(i.setAttribute(dOe,e),Zz(i,Cz,{colors:Uke[e]})):pOe(e)&&Zz(i,Cz,{colors:e}))},[e,t.root]);const n=$.useMemo(()=>({theme:e,root:t.root,setTheme:i=>{W$.includes(i)&&(localStorage.setItem(tse(t.scope),i),r(i))}}),[e,t.root,t.scope]);return me.jsx(rse.Provider,{value:n,children:t.children})},uw=()=>{const t=$.useContext(rse);if(!t)throw new Error("useTheme must be used within a ThemeProvider");return t};var mOe="fyvr110o fyvr112o fyvr114o fyvr116o fyvr11ho fyvr1qo fyvr1ko fyvr11ni",vOe=On({defaultClassName:"_5b32m95 fyvr11d8 fyvr11dw fyvr11bg fyvr11by fyvr11c4 fyvr11cm fyvr11ls fyvr11m8 fyvr12wk fyvr12we fyvr11h0 fyvr11i4 fyvr11hs fyvr11sb fyvr1mo fyvr1om",variantClassNames:{size:{sm:"_5b32m96",lg:"_5b32m97"},autoHeight:{true:"_5b32m98"}},defaultVariants:{},compoundVariants:[[{autoHeight:!0,size:"lg"},"_5b32m99"]]}),yOe="fyvr11hs fyvr1ko fyvr1oo fyvr1qo fyvr1mo",bOe="fyvr11jg fyvr11ko fyvr11h0 fyvr11hs fyvr11ni fyvr1ko fyvr1oo fyvr1qo fyvr1mo";const V$=t=>{const{autoHeight:e=!1,backdropColor:r="backgroundBackdrop",children:n,disableAnimation:i=!1,isDismissible:s=!0,onClose:o,scroll:a=!0,size:c="lg",overlayProps:l,contentProps:u}=t,{root:f}=uw(),d=document.querySelector(f||"body");return me.jsx(rOe,{modal:!0,defaultOpen:!0,onOpenChange:o,children:me.jsx(nOe,{forceMount:!0,container:d,children:me.jsxs(ae,{className:bOe,children:[me.jsx(ae,{as:iOe,asChild:!0,background:r,className:yOe,forceMount:!0,children:me.jsx(Zb.div,{initial:i?!1:{opacity:0},animate:i?!1:{opacity:1},exit:i?void 0:{opacity:0},transition:{type:"tween",ease:"linear"},...l},"modal-overlay")}),me.jsx(sOe,{asChild:!0,className:vOe({autoHeight:e,size:c}),forceMount:!0,onEscapeKeyDown:p=>{s?o==null||o():p.preventDefault()},onInteractOutside:p=>{s||p.preventDefault()},children:me.jsxs(Zb.div,{initial:i?!1:{y:"100%",opacity:c==="sm"?0:1},animate:i?!1:{y:0,opacity:1},exit:i?void 0:{y:"100%",opacity:c==="sm"?0:1},transition:{type:"tween",ease:"easeOut"},...u,children:[a?me.jsx(Xie,{children:n}):n,s&&me.jsx(oOe,{asChild:!0,children:me.jsx(af,{icon:w1,backdropFilter:"blur",size:"xs",className:mOe,"aria-label":"Close"})})]},"modal-content")})]})})})};var wOe=On({defaultClassName:"_1acm19ya fyvr1t4 fyvr1v0 fyvr12wh fyvr12wb fyvr11gw fyvr128 fyvr15o",variantClassNames:{numeric:{false:"_1qxj1ib9 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0",true:"_1qxj1ib9 fyvr11mv fyvr11eo fyvr11g8 fyvr11fo fyvr11f8"}},defaultVariants:{},compoundVariants:[]}),xOe="_1acm19y1 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg fyvr1ww fyvr1ys fyvr11hc fyvr11ko fyvr11ob fyvr12rt fyvr1g0 fyvr118g",EOe=On({defaultClassName:"_1acm19y5",variantClassNames:{borderRadius:{xs:"fyvr11cw fyvr11dk fyvr11bk fyvr11c8",sm:"fyvr11d0 fyvr11do fyvr11bo fyvr11cc",md:"fyvr11d4 fyvr11ds fyvr11bs fyvr11cg"}},defaultVariants:{},compoundVariants:[]});const yh=$.forwardRef((t,e)=>{const{as:r="input",autoComplete:n="off",borderRadius:i="md",description:s,disabled:o=!1,id:a,label:c="",labelLocation:l="hidden",leftIcon:u,rightIcon:f,name:d,controls:p,type:g="text",numeric:v=!1,...y}=t;return me.jsx(b1,{description:s,disabled:o,display:"grid",id:a??d,label:c,labelLocation:l,children:me.jsx(ae,{width:"full",children:me.jsxs(ae,{className:fa(xOe,EOe({borderRadius:i})),children:[u&&me.jsx(u,{size:"sm"}),me.jsx(ae,{as:r,autoComplete:n,spellCheck:"false",className:wOe({numeric:v}),disabled:o,id:a??d,name:d,ref:e,type:g,...y}),f&&me.jsx(f,{size:"sm"}),p]})})})}),_Oe=RegExp("^\\d*(?:\\\\[.])?\\d*$");function COe(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const nse=$.forwardRef((t,e)=>{const{name:r="amount",placeholder:n,onChange:i,onBlur:s,...o}=t,a=l=>{let{value:u}=l.target;u=u.replace(/,/g,"."),u.startsWith(".")&&(u="0"+u),u.startsWith("0")&&(u=u.replace(/^0+(?=\d)/,"")),(u===""||_Oe.test(COe(u)))&&(i==null||i({...l,target:{...l.target,value:u}}))},c=l=>{const{value:u}=l.target;let f=u;f.endsWith(".")&&(f=f.slice(0,-1)),f.endsWith(".0")&&(f=f.slice(0,-2)),f==="0"&&(f=""),s==null||s(l),f!==u&&(i==null||i({...l,target:{...l.target,value:f}}))};return me.jsx(yh,{name:r,onChange:a,onBlur:c,inputMode:"decimal",autoComplete:"off",autoCorrect:"off",type:"text",pattern:"^[0-9]*[.,]?[0-9]*$",placeholder:n||"0",minLength:1,maxLength:79,spellCheck:"false",numeric:!0,ref:e,...o})});On({defaultClassName:"dtv8gt1",variantClassNames:{size:{sm:"dtv8gt2",normal:"dtv8gt3",md:"dtv8gt4",lg:"dtv8gt5",xl:"dtv8gt6"}},defaultVariants:{},compoundVariants:[]});const ise="Progress",X8=100,[SOe,Ryt]=Ps(ise),[AOe,Tyt]=SOe(ise),kOe=$.forwardRef((t,e)=>{const{__scopeProgress:r,value:n,max:i,getValueLabel:s=IOe,...o}=t,a=uP(i)?i:X8,c=sse(n,a)?n:null,l=X6(c)?s(c,a):void 0;return $.createElement(AOe,{scope:r,value:c,max:a},$.createElement(pr.div,Zr({"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":X6(c)?c:void 0,"aria-valuetext":l,role:"progressbar","data-state":POe(c,a),"data-value":c??void 0,"data-max":a},o,{ref:e})))});kOe.propTypes={max(t,e,r){const n=t[e],i=String(n);return n&&!uP(n)?new Error(ROe(i,r)):null},value(t,e,r){const n=t[e],i=String(n),s=uP(t.max)?t.max:X8;return n!=null&&!sse(n,s)?new Error(TOe(i,r)):null}};function IOe(t,e){return`${Math.round(t/e*100)}%`}function POe(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function X6(t){return typeof t=="number"}function uP(t){return X6(t)&&!isNaN(t)&&t>0}function sse(t,e){return X6(t)&&!isNaN(t)&&t<=e&&t>=0}function ROe(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${X8}\`.`}function TOe(t,e){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${e}\`. The \`value\` prop must be: + - a positive number + - less than the value passed to \`max\` (or ${X8} if no \`max\` prop is set) + - \`null\` if the progress is indeterminate. + +Defaulting to \`null\`.`}const ose="Radio",[OOe,ase]=Ps(ose),[$Oe,NOe]=OOe(ose),MOe=$.forwardRef((t,e)=>{const{__scopeRadio:r,name:n,checked:i=!1,required:s,disabled:o,value:a="on",onCheck:c,...l}=t,[u,f]=$.useState(null),d=hn(e,v=>f(v)),p=$.useRef(!1),g=u?!!u.closest("form"):!0;return $.createElement($Oe,{scope:r,checked:i,disabled:o},$.createElement(pr.button,Zr({type:"button",role:"radio","aria-checked":i,"data-state":cse(i),"data-disabled":o?"":void 0,disabled:o,value:a},l,{ref:d,onClick:Pt(t.onClick,v=>{i||c==null||c(),g&&(p.current=v.isPropagationStopped(),p.current||v.stopPropagation())})})),g&&$.createElement(BOe,{control:u,bubbles:!p.current,name:n,value:a,checked:i,required:s,disabled:o,style:{transform:"translateX(-100%)"}}))}),DOe="RadioIndicator",LOe=$.forwardRef((t,e)=>{const{__scopeRadio:r,forceMount:n,...i}=t,s=NOe(DOe,r);return $.createElement(mh,{present:n||s.checked},$.createElement(pr.span,Zr({"data-state":cse(s.checked),"data-disabled":s.disabled?"":void 0},i,{ref:e})))}),BOe=t=>{const{control:e,checked:r,bubbles:n=!0,...i}=t,s=$.useRef(null),o=j8(r),a=U8(e);return $.useEffect(()=>{const c=s.current,l=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(l,"checked").set;if(o!==r&&f){const d=new Event("click",{bubbles:n});f.call(c,r),c.dispatchEvent(d)}},[o,r,n]),$.createElement("input",Zr({type:"radio","aria-hidden":!0,defaultChecked:r},i,{tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function cse(t){return t?"checked":"unchecked"}const FOe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],lse="RadioGroup",[jOe,Oyt]=Ps(lse,[Bm,ase]),use=Bm(),fse=ase(),[UOe,zOe]=jOe(lse),HOe=$.forwardRef((t,e)=>{const{__scopeRadioGroup:r,name:n,defaultValue:i,value:s,required:o=!1,disabled:a=!1,orientation:c,dir:l,loop:u=!0,onValueChange:f,...d}=t,p=use(r),g=G8(l),[v,y]=Kd({prop:s,defaultProp:i,onChange:f});return $.createElement(UOe,{scope:r,name:n,required:o,disabled:a,value:v,onValueChange:y},$.createElement(Aie,Zr({asChild:!0},p,{orientation:c,dir:g,loop:u}),$.createElement(pr.div,Zr({role:"radiogroup","aria-required":o,"aria-orientation":c,"data-disabled":a?"":void 0,dir:g},d,{ref:e}))))}),qOe="RadioGroupItem",WOe=$.forwardRef((t,e)=>{const{__scopeRadioGroup:r,disabled:n,...i}=t,s=zOe(qOe,r),o=s.disabled||n,a=use(r),c=fse(r),l=$.useRef(null),u=hn(e,l),f=s.value===i.value,d=$.useRef(!1);return $.useEffect(()=>{const p=v=>{FOe.includes(v.key)&&(d.current=!0)},g=()=>d.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",g),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",g)}},[]),$.createElement(z$,Zr({asChild:!0},a,{focusable:!o,active:f}),$.createElement(MOe,Zr({disabled:o,required:s.required,checked:f},c,i,{name:s.name,ref:u,onCheck:()=>s.onValueChange(i.value),onKeyDown:Pt(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:Pt(i.onFocus,()=>{var p;d.current&&((p=l.current)===null||p===void 0||p.click())})})))}),VOe=$.forwardRef((t,e)=>{const{__scopeRadioGroup:r,...n}=t,i=fse(r);return $.createElement(LOe,Zr({},i,n,{ref:e}))}),GOe=HOe,KOe=WOe,JOe=VOe;var QOe=On({defaultClassName:"io59uy8 io59uy7 fyvr11h0 fyvr11ko fyvr11jg fyvr11hw fyvr128 fyvr15o fyvr12rt",variantClassNames:{size:{sm:"io59uy9",lg:"io59uya"}},defaultVariants:{},compoundVariants:[]}),YOe=On({defaultClassName:"io59uy3 fyvr11dc fyvr11e0 fyvr11c0 fyvr11co fyvr12nb fyvr12fz fyvr121b fyvr128n fyvr12nh fyvr12g5 fyvr121h fyvr128t fyvr11ob fyvr12uz fyvr12uv fyvr12vj",variantClassNames:{size:{sm:"io59uy4 fyvr11a8 fyvr11ak fyvr11aw fyvr11b8",lg:"io59uy5 fyvr11ac fyvr11ao fyvr11b0 fyvr11bc"}},defaultVariants:{},compoundVariants:[]});const ZOe=t=>{const{id:e,label:r,size:n="sm",value:i,disabled:s}=t;return me.jsx(ae,{alignItems:"center",children:me.jsx(b1,{disabled:s,display:"flex",id:e,label:r,labelLocation:"right",children:me.jsx(KOe,{className:YOe({size:n}),value:i,id:e,disabled:s,children:me.jsx(JOe,{className:QOe({size:n})})})})})};$.forwardRef((t,e)=>{const{flexDirection:r="column",disabled:n=!1,gap:i="2",name:s,options:o,size:a="sm",...c}=t;return me.jsx(GOe,{disabled:n,name:s,ref:e,...c,children:me.jsx(ae,{flexDirection:r,gap:i,children:o.map(({label:l,value:u,disabled:f})=>me.jsx(ZOe,{id:`${s}-${u}`,label:l,size:a,value:u,disabled:f},u))})})});function eH(t,[e,r]){return Math.min(r,Math.max(e,t))}const dse=$.forwardRef((t,e)=>$.createElement(pr.span,jt({},t,{ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}))),XOe=[" ","Enter","ArrowUp","ArrowDown"],e$e=[" ","Enter"],eC="Select",[tC,G$,t$e]=V8(eC),[Fm,$yt]=Ps(eC,[t$e,Lm]),K$=Lm(),[r$e,E1]=Fm(eC),[n$e,i$e]=Fm(eC),s$e=t=>{const{__scopeSelect:e,children:r,open:n,defaultOpen:i,onOpenChange:s,value:o,defaultValue:a,onValueChange:c,dir:l,name:u,autoComplete:f,disabled:d,required:p}=t,g=K$(e),[v,y]=$.useState(null),[b,w]=$.useState(null),[E,C]=$.useState(!1),S=G8(l),[P=!1,_]=Kd({prop:n,defaultProp:i,onChange:s}),[T,Q]=Kd({prop:o,defaultProp:a,onChange:c}),Z=$.useRef(null),ne=v?!!v.closest("form"):!0,[ce,K]=$.useState(new Set),x=Array.from(ce).map(A=>A.props.value).join(";");return $.createElement(dRe,g,$.createElement(r$e,{required:p,scope:e,trigger:v,onTriggerChange:y,valueNode:b,onValueNodeChange:w,valueNodeHasChildren:E,onValueNodeHasChildrenChange:C,contentId:Md(),value:T,onValueChange:Q,open:P,onOpenChange:_,dir:S,triggerPointerDownPosRef:Z,disabled:d},$.createElement(tC.Provider,{scope:e},$.createElement(n$e,{scope:t.__scopeSelect,onNativeOptionAdd:$.useCallback(A=>{K(B=>new Set(B).add(A))},[]),onNativeOptionRemove:$.useCallback(A=>{K(B=>{const z=new Set(B);return z.delete(A),z})},[])},r)),ne?$.createElement(gse,{key:x,"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:f,value:T,onChange:A=>Q(A.target.value),disabled:d},T===void 0?$.createElement("option",{value:""}):null,Array.from(ce)):null))},o$e="SelectTrigger",a$e=$.forwardRef((t,e)=>{const{__scopeSelect:r,disabled:n=!1,...i}=t,s=K$(r),o=E1(o$e,r),a=o.disabled||n,c=hn(e,o.onTriggerChange),l=G$(r),[u,f,d]=mse(g=>{const v=l().filter(w=>!w.disabled),y=v.find(w=>w.value===o.value),b=vse(v,g,y);b!==void 0&&o.onValueChange(b.value)}),p=()=>{a||(o.onOpenChange(!0),d())};return $.createElement(hRe,jt({asChild:!0},s),$.createElement(pr.button,jt({type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":pse(o.value)?"":void 0},i,{ref:c,onClick:Pt(i.onClick,g=>{g.currentTarget.focus()}),onPointerDown:Pt(i.onPointerDown,g=>{const v=g.target;v.hasPointerCapture(g.pointerId)&&v.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&(p(),o.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)},g.preventDefault())}),onKeyDown:Pt(i.onKeyDown,g=>{const v=u.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&f(g.key),!(v&&g.key===" ")&&XOe.includes(g.key)&&(p(),g.preventDefault())})})))}),c$e="SelectValue",l$e=$.forwardRef((t,e)=>{const{__scopeSelect:r,className:n,style:i,children:s,placeholder:o="",...a}=t,c=E1(c$e,r),{onValueNodeHasChildrenChange:l}=c,u=s!==void 0,f=hn(e,c.onValueNodeChange);return Ya(()=>{l(u)},[l,u]),$.createElement(pr.span,jt({},a,{ref:f,style:{pointerEvents:"none"}}),pse(c.value)?$.createElement($.Fragment,null,o):s)}),u$e=$.forwardRef((t,e)=>{const{__scopeSelect:r,children:n,...i}=t;return $.createElement(pr.span,jt({"aria-hidden":!0},i,{ref:e}),n||"▼")}),im="SelectContent",f$e=$.forwardRef((t,e)=>{const r=E1(im,t.__scopeSelect),[n,i]=$.useState();if(Ya(()=>{i(new DocumentFragment)},[]),!r.open){const s=n;return s?Gc.createPortal($.createElement(hse,{scope:t.__scopeSelect},$.createElement(tC.Slot,{scope:t.__scopeSelect},$.createElement("div",null,t.children))),s):null}return $.createElement(d$e,jt({},t,{ref:e}))}),Su=10,[hse,rC]=Fm(im),d$e=$.forwardRef((t,e)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:o,side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:f,collisionBoundary:d,collisionPadding:p,sticky:g,hideWhenDetached:v,avoidCollisions:y,...b}=t,w=E1(im,r),[E,C]=$.useState(null),[S,P]=$.useState(null),_=hn(e,H=>C(H)),[T,Q]=$.useState(null),[Z,ne]=$.useState(null),ce=G$(r),[K,x]=$.useState(!1),A=$.useRef(!1);$.useEffect(()=>{if(E)return Iie(E)},[E]),oie();const B=$.useCallback(H=>{const[J,...X]=ce().map(Y=>Y.ref.current),[D]=X.slice(-1),F=document.activeElement;for(const Y of H)if(Y===F||(Y==null||Y.scrollIntoView({block:"nearest"}),Y===J&&S&&(S.scrollTop=0),Y===D&&S&&(S.scrollTop=S.scrollHeight),Y==null||Y.focus(),document.activeElement!==F))return},[ce,S]),z=$.useCallback(()=>B([T,E]),[B,T,E]);$.useEffect(()=>{K&&z()},[K,z]);const{onOpenChange:R,triggerPointerDownPosRef:L}=w;$.useEffect(()=>{if(E){let H={x:0,y:0};const J=D=>{var F,Y,ue,he;H={x:Math.abs(Math.round(D.pageX)-((F=(Y=L.current)===null||Y===void 0?void 0:Y.x)!==null&&F!==void 0?F:0)),y:Math.abs(Math.round(D.pageY)-((ue=(he=L.current)===null||he===void 0?void 0:he.y)!==null&&ue!==void 0?ue:0))}},X=D=>{H.x<=10&&H.y<=10?D.preventDefault():E.contains(D.target)||R(!1),document.removeEventListener("pointermove",J),L.current=null};return L.current!==null&&(document.addEventListener("pointermove",J),document.addEventListener("pointerup",X,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",J),document.removeEventListener("pointerup",X,{capture:!0})}}},[E,R,L]),$.useEffect(()=>{const H=()=>R(!1);return window.addEventListener("blur",H),window.addEventListener("resize",H),()=>{window.removeEventListener("blur",H),window.removeEventListener("resize",H)}},[R]);const[q,N]=mse(H=>{const J=ce().filter(F=>!F.disabled),X=J.find(F=>F.ref.current===document.activeElement),D=vse(J,H,X);D&&setTimeout(()=>D.ref.current.focus())}),I=$.useCallback((H,J,X)=>{const D=!A.current&&!X;(w.value!==void 0&&w.value===J||D)&&(Q(H),D&&(A.current=!0))},[w.value]),U=$.useCallback(()=>E==null?void 0:E.focus(),[E]),re=$.useCallback((H,J,X)=>{const D=!A.current&&!X;(w.value!==void 0&&w.value===J||D)&&ne(H)},[w.value]),M=n==="popper"?tH:h$e,G=M===tH?{side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:f,collisionBoundary:d,collisionPadding:p,sticky:g,hideWhenDetached:v,avoidCollisions:y}:{};return $.createElement(hse,{scope:r,content:E,viewport:S,onViewportChange:P,itemRefCallback:I,selectedItem:T,onItemLeave:U,itemTextRefCallback:re,focusSelectedItem:z,selectedItemText:Z,position:n,isPositioned:K,searchRef:q},$.createElement(Lie,{as:rm,allowPinchZoom:!0},$.createElement(aie,{asChild:!0,trapped:w.open,onMountAutoFocus:H=>{H.preventDefault()},onUnmountAutoFocus:Pt(i,H=>{var J;(J=w.trigger)===null||J===void 0||J.focus({preventScroll:!0}),H.preventDefault()})},$.createElement(N$,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:H=>H.preventDefault(),onDismiss:()=>w.onOpenChange(!1)},$.createElement(M,jt({role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:H=>H.preventDefault()},b,G,{onPlaced:()=>x(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:Pt(b.onKeyDown,H=>{const J=H.ctrlKey||H.altKey||H.metaKey;if(H.key==="Tab"&&H.preventDefault(),!J&&H.key.length===1&&N(H.key),["ArrowUp","ArrowDown","Home","End"].includes(H.key)){let D=ce().filter(F=>!F.disabled).map(F=>F.ref.current);if(["ArrowUp","End"].includes(H.key)&&(D=D.slice().reverse()),["ArrowUp","ArrowDown"].includes(H.key)){const F=H.target,Y=D.indexOf(F);D=D.slice(Y+1)}setTimeout(()=>B(D)),H.preventDefault()}})}))))))}),h$e=$.forwardRef((t,e)=>{const{__scopeSelect:r,onPlaced:n,...i}=t,s=E1(im,r),o=rC(im,r),[a,c]=$.useState(null),[l,u]=$.useState(null),f=hn(e,_=>u(_)),d=G$(r),p=$.useRef(!1),g=$.useRef(!0),{viewport:v,selectedItem:y,selectedItemText:b,focusSelectedItem:w}=o,E=$.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&l&&v&&y&&b){const _=s.trigger.getBoundingClientRect(),T=l.getBoundingClientRect(),Q=s.valueNode.getBoundingClientRect(),Z=b.getBoundingClientRect();if(s.dir!=="rtl"){const F=Z.left-T.left,Y=Q.left-F,ue=_.left-Y,he=_.width+ue,Ce=Math.max(he,T.width),Me=window.innerWidth-Su,Oe=eH(Y,[Su,Me-Ce]);a.style.minWidth=he+"px",a.style.left=Oe+"px"}else{const F=T.right-Z.right,Y=window.innerWidth-Q.right-F,ue=window.innerWidth-_.right-Y,he=_.width+ue,Ce=Math.max(he,T.width),Me=window.innerWidth-Su,Oe=eH(Y,[Su,Me-Ce]);a.style.minWidth=he+"px",a.style.right=Oe+"px"}const ne=d(),ce=window.innerHeight-Su*2,K=v.scrollHeight,x=window.getComputedStyle(l),A=parseInt(x.borderTopWidth,10),B=parseInt(x.paddingTop,10),z=parseInt(x.borderBottomWidth,10),R=parseInt(x.paddingBottom,10),L=A+B+K+R+z,q=Math.min(y.offsetHeight*5,L),N=window.getComputedStyle(v),I=parseInt(N.paddingTop,10),U=parseInt(N.paddingBottom,10),re=_.top+_.height/2-Su,M=ce-re,G=y.offsetHeight/2,H=y.offsetTop+G,J=A+B+H,X=L-J;if(J<=re){const F=y===ne[ne.length-1].ref.current;a.style.bottom="0px";const Y=l.clientHeight-v.offsetTop-v.offsetHeight,ue=Math.max(M,G+(F?U:0)+Y+z),he=J+ue;a.style.height=he+"px"}else{const F=y===ne[0].ref.current;a.style.top="0px";const ue=Math.max(re,A+v.offsetTop+(F?I:0)+G)+X;a.style.height=ue+"px",v.scrollTop=J-re+v.offsetTop}a.style.margin=`${Su}px 0`,a.style.minHeight=q+"px",a.style.maxHeight=ce+"px",n==null||n(),requestAnimationFrame(()=>p.current=!0)}},[d,s.trigger,s.valueNode,a,l,v,y,b,s.dir,n]);Ya(()=>E(),[E]);const[C,S]=$.useState();Ya(()=>{l&&S(window.getComputedStyle(l).zIndex)},[l]);const P=$.useCallback(_=>{_&&g.current===!0&&(E(),w==null||w(),g.current=!1)},[E,w]);return $.createElement(p$e,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:p,onScrollButtonChange:P},$.createElement("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C}},$.createElement(pr.div,jt({},i,{ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}}))))}),tH=$.forwardRef((t,e)=>{const{__scopeSelect:r,align:n="start",collisionPadding:i=Su,...s}=t,o=K$(r);return $.createElement(pRe,jt({},o,s,{ref:e,align:n,collisionPadding:i,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[p$e,g$e]=Fm(im,{}),rH="SelectViewport",m$e=$.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,i=rC(rH,r),s=g$e(rH,r),o=hn(e,i.onViewportChange),a=$.useRef(0);return $.createElement($.Fragment,null,$.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),$.createElement(tC.Slot,{scope:r},$.createElement(pr.div,jt({"data-radix-select-viewport":"",role:"presentation"},n,{ref:o,style:{position:"relative",flex:1,overflow:"auto",...n.style},onScroll:Pt(n.onScroll,c=>{const l=c.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:f}=s;if(f!=null&&f.current&&u){const d=Math.abs(a.current-l.scrollTop);if(d>0){const p=window.innerHeight-Su*2,g=parseFloat(u.style.minHeight),v=parseFloat(u.style.height),y=Math.max(g,v);if(y0?E:0,u.style.justifyContent="flex-end")}}}a.current=l.scrollTop})}))))}),v$e="SelectGroup",[y$e,Nyt]=Fm(v$e),b$e=$.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,i=Md();return $.createElement(y$e,{scope:r,id:i},$.createElement(pr.div,jt({role:"group","aria-labelledby":i},n,{ref:e})))}),fP="SelectItem",[w$e,x$e]=Fm(fP),E$e=$.forwardRef((t,e)=>{const{__scopeSelect:r,value:n,disabled:i=!1,textValue:s,...o}=t,a=E1(fP,r),c=rC(fP,r),l=a.value===n,[u,f]=$.useState(s??""),[d,p]=$.useState(!1),g=hn(e,b=>{var w;return(w=c.itemRefCallback)===null||w===void 0?void 0:w.call(c,b,n,i)}),v=Md(),y=()=>{i||(a.onValueChange(n),a.onOpenChange(!1))};if(n==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return $.createElement(w$e,{scope:r,value:n,disabled:i,textId:v,isSelected:l,onItemTextChange:$.useCallback(b=>{f(w=>{var E;return w||((E=b==null?void 0:b.textContent)!==null&&E!==void 0?E:"").trim()})},[])},$.createElement(tC.ItemSlot,{scope:r,value:n,disabled:i,textValue:u},$.createElement(pr.div,jt({role:"option","aria-labelledby":v,"data-highlighted":d?"":void 0,"aria-selected":l&&d,"data-state":l?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1},o,{ref:g,onFocus:Pt(o.onFocus,()=>p(!0)),onBlur:Pt(o.onBlur,()=>p(!1)),onPointerUp:Pt(o.onPointerUp,y),onPointerMove:Pt(o.onPointerMove,b=>{if(i){var w;(w=c.onItemLeave)===null||w===void 0||w.call(c)}else b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Pt(o.onPointerLeave,b=>{if(b.currentTarget===document.activeElement){var w;(w=c.onItemLeave)===null||w===void 0||w.call(c)}}),onKeyDown:Pt(o.onKeyDown,b=>{var w;((w=c.searchRef)===null||w===void 0?void 0:w.current)!==""&&b.key===" "||(e$e.includes(b.key)&&y(),b.key===" "&&b.preventDefault())})}))))}),K5="SelectItemText",_$e=$.forwardRef((t,e)=>{const{__scopeSelect:r,className:n,style:i,...s}=t,o=E1(K5,r),a=rC(K5,r),c=x$e(K5,r),l=i$e(K5,r),[u,f]=$.useState(null),d=hn(e,b=>f(b),c.onItemTextChange,b=>{var w;return(w=a.itemTextRefCallback)===null||w===void 0?void 0:w.call(a,b,c.value,c.disabled)}),p=u==null?void 0:u.textContent,g=$.useMemo(()=>$.createElement("option",{key:c.value,value:c.value,disabled:c.disabled},p),[c.disabled,c.value,p]),{onNativeOptionAdd:v,onNativeOptionRemove:y}=l;return Ya(()=>(v(g),()=>y(g)),[v,y,g]),$.createElement($.Fragment,null,$.createElement(pr.span,jt({id:c.textId},s,{ref:d})),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Gc.createPortal(s.children,o.valueNode):null)});function pse(t){return t===""||t===void 0}const gse=$.forwardRef((t,e)=>{const{value:r,...n}=t,i=$.useRef(null),s=hn(e,i),o=j8(r);return $.useEffect(()=>{const a=i.current,c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==r&&u){const f=new Event("change",{bubbles:!0});u.call(a,r),a.dispatchEvent(f)}},[o,r]),$.createElement(dse,{asChild:!0},$.createElement("select",jt({},n,{ref:s,defaultValue:r})))});gse.displayName="BubbleSelect";function mse(t){const e=Qa(t),r=$.useRef(""),n=$.useRef(0),i=$.useCallback(o=>{const a=r.current+o;e(a),function c(l){r.current=l,window.clearTimeout(n.current),l!==""&&(n.current=window.setTimeout(()=>c(""),1e3))}(a)},[e]),s=$.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return $.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,i,s]}function vse(t,e,r){const i=e.length>1&&Array.from(e).every(l=>l===e[0])?e[0]:e,s=r?t.indexOf(r):-1;let o=C$e(t,Math.max(s,0));i.length===1&&(o=o.filter(l=>l!==r));const c=o.find(l=>l.textValue.toLowerCase().startsWith(i.toLowerCase()));return c!==r?c:void 0}function C$e(t,e){return t.map((r,n)=>t[(e+n)%t.length])}const S$e=s$e,A$e=a$e,k$e=l$e,I$e=u$e,P$e=f$e,R$e=m$e,T$e=b$e,O$e=E$e,$$e=_$e;var N$e="gohwuma fyvr11d0 fyvr11do fyvr11bo fyvr11cc fyvr11ls fyvr11m8 fyvr11ms fyvr11tt fyvr12rt fyvr11nj",M$e="gohwume _1qxj1ib9 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 fyvr1ww fyvr1ys fyvr1t0 fyvr1uw fyvr12wk fyvr12wl fyvr12we fyvr12wf fyvr11h0 fyvr11jw fyvr11ko fyvr12uz fyvr12uv fyvr12rt fyvr12vt fyvr12vj",D$e="gohwum1 _1qxj1ib9 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 fyvr1t4 fyvr1v0 fyvr1ww fyvr1ys fyvr11ko fyvr11ob fyvr11hc fyvr11f4 fyvr12rt fyvr118c fyvr11jw fyvr11n2 fyvr12uz",L$e=On({defaultClassName:"gohwum5",variantClassNames:{borderRadius:{xs:"fyvr11cw fyvr11dk fyvr11bk fyvr11c8",sm:"fyvr11d0 fyvr11do fyvr11bo fyvr11cc",md:"fyvr11d4 fyvr11ds fyvr11bs fyvr11cg"}},defaultVariants:{},compoundVariants:[]});const B$e=$.forwardRef(({children:t,className:e,...r},n)=>me.jsx(O$e,{className:fa(M$e,e),...r,ref:n,children:me.jsx($$e,{children:t})}));$.forwardRef((t,e)=>{const{borderRadius:r="md",disabled:n=!1,id:i,label:s="",description:o,labelLocation:a="hidden",name:c,options:l,placeholder:u,...f}=t;return me.jsx(b1,{disabled:n,display:"grid",id:i??c,label:s,labelLocation:a,description:o,whiteSpace:"nowrap",children:me.jsxs(S$e,{disabled:n,name:c,...f,children:[me.jsxs(A$e,{id:i??c,className:fa(D$e,L$e({borderRadius:r})),ref:e,children:[me.jsx(k$e,{placeholder:u}),me.jsx(ae,{as:I$e,display:"inline-flex",children:me.jsx(eie,{})})]}),me.jsx(P$e,{className:N$e,children:me.jsx(R$e,{children:me.jsx(T$e,{children:l.map(({value:d,label:p,...g})=>me.jsx(B$e,{value:d,...g,children:p},d))})})})]})})});$.forwardRef((t,e)=>{const{controls:r,onChange:n,placeholder:i="Search",name:s="search",value:o,...a}=t,c=o?me.jsx(af,{icon:w1,size:"xs",onClick:()=>n==null?void 0:n({target:{value:""}})}):void 0;return me.jsx(yh,{ref:e,name:s,leftIcon:q8,controls:r||c,placeholder:i,value:o,onChange:l=>n==null?void 0:n(l),...a})});var F$e=On({defaultClassName:"en4abt1",variantClassNames:{size:{sm:"en4abt2",md:"en4abt3",lg:"en4abt4"}},defaultVariants:{},compoundVariants:[]});const J$=$.forwardRef((t,e)=>{const{size:r="md",...n}=t;return me.jsx(ae,{className:F$e({size:r}),color:"text50",ref:e,...n,children:me.jsxs("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",children:[me.jsx("circle",{cx:"12",cy:"12",fill:"none",r:"10.5",strokeDasharray:"42",strokeLinecap:"round"}),me.jsx("circle",{cx:"12",cy:"12",fill:"none",opacity:"0.25",r:"10.5",strokeLinecap:"round"})]})})});$.forwardRef(({children:t},e)=>me.jsx(ae,{ref:e,width:"fit",height:"fit",onClick:r=>{r.preventDefault(),r.stopPropagation()},onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),r.stopPropagation())},children:t}));const yse="Switch",[j$e,Myt]=Ps(yse),[U$e,z$e]=j$e(yse),H$e=$.forwardRef((t,e)=>{const{__scopeSwitch:r,name:n,checked:i,defaultChecked:s,required:o,disabled:a,value:c="on",onCheckedChange:l,...u}=t,[f,d]=$.useState(null),p=hn(e,w=>d(w)),g=$.useRef(!1),v=f?!!f.closest("form"):!0,[y=!1,b]=Kd({prop:i,defaultProp:s,onChange:l});return $.createElement(U$e,{scope:r,checked:y,disabled:a},$.createElement(pr.button,Zr({type:"button",role:"switch","aria-checked":y,"aria-required":o,"data-state":bse(y),"data-disabled":a?"":void 0,disabled:a,value:c},u,{ref:p,onClick:Pt(t.onClick,w=>{b(E=>!E),v&&(g.current=w.isPropagationStopped(),g.current||w.stopPropagation())})})),v&&$.createElement(V$e,{control:f,bubbles:!g.current,name:n,value:c,checked:y,required:o,disabled:a,style:{transform:"translateX(-100%)"}}))}),q$e="SwitchThumb",W$e=$.forwardRef((t,e)=>{const{__scopeSwitch:r,...n}=t,i=z$e(q$e,r);return $.createElement(pr.span,Zr({"data-state":bse(i.checked),"data-disabled":i.disabled?"":void 0},n,{ref:e}))}),V$e=t=>{const{control:e,checked:r,bubbles:n=!0,...i}=t,s=$.useRef(null),o=j8(r),a=U8(e);return $.useEffect(()=>{const c=s.current,l=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(l,"checked").set;if(o!==r&&f){const d=new Event("click",{bubbles:n});f.call(c,r),c.dispatchEvent(d)}},[o,r,n]),$.createElement("input",Zr({type:"checkbox","aria-hidden":!0,defaultChecked:r},i,{tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function bse(t){return t?"checked":"unchecked"}const G$e=H$e,K$e=W$e;var J$e="_1lp2u8e1 fyvr11dc fyvr11e0 fyvr11c0 fyvr11co fyvr1ss fyvr1uo fyvr1wk fyvr1yg fyvr11sz fyvr11hw fyvr12uz",Q$e="_1lp2u8e3 fyvr11dc fyvr11e0 fyvr11c0 fyvr11co fyvr11ho fyvr1ko fyvr1oo fyvr1k fyvr140 fyvr11nz";const nH=t=>{const{disabled:e,label:r,labelLocation:n="left",description:i,id:s,name:o,...a}=t;return me.jsx(b1,{disabled:e,display:"flex",id:s??o,label:r,labelLocation:n,description:i,whiteSpace:"nowrap",children:me.jsx(G$e,{className:J$e,disabled:e,...a,children:me.jsx(ae,{position:"relative",width:"full",height:"full",children:me.jsx(K$e,{className:Q$e})})})})};On({defaultClassName:"nwwh3z7",variantClassNames:{variant:{pill:"nwwh3z8",line:"nwwh3z9 fyvr11g0"},active:{true:"fyvr12vx",false:"nwwh3zb"},disabled:{true:"fyvr12vh"}},defaultVariants:{},compoundVariants:[[{active:!0,variant:"pill"},"fyvr11u5 fyvr12sb"],[{active:!1,variant:"pill"},"fyvr11ob fyvr12rz"],[{active:!0,variant:"line"},"fyvr12rt"],[{active:!1,variant:"line"},"fyvr12rz"]]});const wse="Tabs",[Y$e,Dyt]=Ps(wse,[Bm]),xse=Bm(),[Z$e,Q$]=Y$e(wse),X$e=$.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,onValueChange:i,defaultValue:s,orientation:o="horizontal",dir:a,activationMode:c="automatic",...l}=t,u=G8(a),[f,d]=Kd({prop:n,onChange:i,defaultProp:s});return $.createElement(Z$e,{scope:r,baseId:Md(),value:f,onValueChange:d,orientation:o,dir:u,activationMode:c},$.createElement(pr.div,Zr({dir:u,"data-orientation":o},l,{ref:e})))}),eNe="TabsList",tNe=$.forwardRef((t,e)=>{const{__scopeTabs:r,loop:n=!0,...i}=t,s=Q$(eNe,r),o=xse(r);return $.createElement(Aie,Zr({asChild:!0},o,{orientation:s.orientation,dir:s.dir,loop:n}),$.createElement(pr.div,Zr({role:"tablist","aria-orientation":s.orientation},i,{ref:e})))}),rNe="TabsTrigger",nNe=$.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,disabled:i=!1,...s}=t,o=Q$(rNe,r),a=xse(r),c=Ese(o.baseId,n),l=_se(o.baseId,n),u=n===o.value;return $.createElement(z$,Zr({asChild:!0},a,{focusable:!i,active:u}),$.createElement(pr.button,Zr({type:"button",role:"tab","aria-selected":u,"aria-controls":l,"data-state":u?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c},s,{ref:e,onMouseDown:Pt(t.onMouseDown,f=>{!i&&f.button===0&&f.ctrlKey===!1?o.onValueChange(n):f.preventDefault()}),onKeyDown:Pt(t.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&o.onValueChange(n)}),onFocus:Pt(t.onFocus,()=>{const f=o.activationMode!=="manual";!u&&!i&&f&&o.onValueChange(n)})})))}),iNe="TabsContent",sNe=$.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,forceMount:i,children:s,...o}=t,a=Q$(iNe,r),c=Ese(a.baseId,n),l=_se(a.baseId,n),u=n===a.value,f=$.useRef(u);return $.useEffect(()=>{const d=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(d)},[]),$.createElement(mh,{present:i||u},({present:d})=>$.createElement(pr.div,Zr({"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":c,hidden:!d,id:l,tabIndex:0},o,{ref:e,style:{...t.style,animationDuration:f.current?"0s":void 0}}),d&&s))});function Ese(t,e){return`${t}-trigger-${e}`}function _se(t,e){return`${t}-content-${e}`}const oNe=X$e,aNe=tNe,cNe=nNe;var lNe="_10c8o0n1 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg fyvr11h0 fyvr11hw fyvr128 fyvr11sh fyvr14o",uNe="_10c8o0n5 fyvr11d0 fyvr11do fyvr11bo fyvr11cc fyvr11ho fyvr1ko fyvr1oo fyvr14c fyvr11tt fyvr12vz",fNe="_10c8o0n3 fyvr11d0 fyvr11do fyvr11bo fyvr11cc fyvr12wh fyvr12wb fyvr128 fyvr15o fyvr12uz fyvr11hw fyvr11ob fyvr11n2 fyvr12rz";const dNe=t=>{const{tabs:e,value:r}=t;if(!e.length)return null;const n=100/e.length,i=e.findIndex(s=>s.value===r);return me.jsxs(aNe,{className:lNe,style:{outline:void 0},children:[me.jsx(ae,{display:"flex",position:"absolute",inset:"2",height:"8",children:me.jsx("div",{className:uNe,style:{width:`${n}%`,transform:`translateX(${i*100}%)`}})}),e.map(s=>me.jsx(cNe,{className:fNe,value:s.value,children:me.jsx(Pe,{variant:"normal",fontWeight:"bold",children:s.label})},s.value))]})},hNe=oNe,iH=sNe;var pNe="_1qxj1ib9 fyvr11mv fyvr11e8 fyvr11fw fyvr11fs fyvr11fc fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr1wo fyvr1yk fyvr1ss fyvr1uo fyvr11hc fyvr118c fyvr11n7";$.forwardRef((t,e)=>{const{icon:r,label:n,...i}=t;return me.jsxs(ae,{className:pNe,ref:e,background:"buttonGlass",...i,children:[r&&me.jsx(r,{size:"xs"}),me.jsx(Pe,{children:n})]})});const gNe="ToastProvider",[mNe,Lyt,vNe]=V8("Toast"),[Cse,Byt]=Ps("Toast",[vNe]),[Fyt,Sse]=Cse(gNe),sH="toast.viewportPause",oH="toast.viewportResume",nC="Toast",yNe="toast.swipeStart",bNe="toast.swipeMove",wNe="toast.swipeCancel",xNe="toast.swipeEnd",[ENe,_Ne]=Cse(nC,{onClose(){}}),CNe=$.forwardRef((t,e)=>{const{__scopeToast:r,type:n="foreground",duration:i,open:s,onClose:o,onEscapeKeyDown:a,onPause:c,onResume:l,onSwipeStart:u,onSwipeMove:f,onSwipeCancel:d,onSwipeEnd:p,...g}=t,v=Sse(nC,r),[y,b]=$.useState(null),w=hn(e,x=>b(x)),E=$.useRef(null),C=$.useRef(null),S=i||v.duration,P=$.useRef(0),_=$.useRef(S),T=$.useRef(0),{onToastAdd:Q,onToastRemove:Z}=v,ne=Qa(()=>{var x;(y==null?void 0:y.contains(document.activeElement))&&((x=v.viewport)===null||x===void 0||x.focus()),o()}),ce=$.useCallback(x=>{!x||x===1/0||(window.clearTimeout(T.current),P.current=new Date().getTime(),T.current=window.setTimeout(ne,x))},[ne]);$.useEffect(()=>{const x=v.viewport;if(x){const A=()=>{ce(_.current),l==null||l()},B=()=>{const z=new Date().getTime()-P.current;_.current=_.current-z,window.clearTimeout(T.current),c==null||c()};return x.addEventListener(sH,B),x.addEventListener(oH,A),()=>{x.removeEventListener(sH,B),x.removeEventListener(oH,A)}}},[v.viewport,S,c,l,ce]),$.useEffect(()=>{s&&!v.isClosePausedRef.current&&ce(S)},[s,S,v.isClosePausedRef,ce]),$.useEffect(()=>(Q(),()=>Z()),[Q,Z]);const K=$.useMemo(()=>y?kse(y):null,[y]);return v.viewport?$.createElement($.Fragment,null,K&&$.createElement(SNe,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0},K),$.createElement(ENe,{scope:r,onClose:ne},Gc.createPortal($.createElement(mNe.ItemSlot,{scope:r},$.createElement(pPe,{asChild:!0,onEscapeKeyDown:Pt(a,()=>{v.isFocusedToastEscapeKeyDownRef.current||ne(),v.isFocusedToastEscapeKeyDownRef.current=!1})},$.createElement(pr.li,jt({role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":v.swipeDirection},g,{ref:w,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:Pt(t.onKeyDown,x=>{x.key==="Escape"&&(a==null||a(x.nativeEvent),x.nativeEvent.defaultPrevented||(v.isFocusedToastEscapeKeyDownRef.current=!0,ne()))}),onPointerDown:Pt(t.onPointerDown,x=>{x.button===0&&(E.current={x:x.clientX,y:x.clientY})}),onPointerMove:Pt(t.onPointerMove,x=>{if(!E.current)return;const A=x.clientX-E.current.x,B=x.clientY-E.current.y,z=!!C.current,R=["left","right"].includes(v.swipeDirection),L=["left","up"].includes(v.swipeDirection)?Math.min:Math.max,q=R?L(0,A):0,N=R?0:L(0,B),I=x.pointerType==="touch"?10:2,U={x:q,y:N},re={originalEvent:x,delta:U};z?(C.current=U,J5(bNe,f,re,{discrete:!1})):aH(U,v.swipeDirection,I)?(C.current=U,J5(yNe,u,re,{discrete:!1}),x.target.setPointerCapture(x.pointerId)):(Math.abs(A)>I||Math.abs(B)>I)&&(E.current=null)}),onPointerUp:Pt(t.onPointerUp,x=>{const A=C.current,B=x.target;if(B.hasPointerCapture(x.pointerId)&&B.releasePointerCapture(x.pointerId),C.current=null,E.current=null,A){const z=x.currentTarget,R={originalEvent:x,delta:A};aH(A,v.swipeDirection,v.swipeThreshold)?J5(xNe,p,R,{discrete:!0}):J5(wNe,d,R,{discrete:!0}),z.addEventListener("click",L=>L.preventDefault(),{once:!0})}})})))),v.viewport))):null});CNe.propTypes={type(t){if(t.type&&!["foreground","background"].includes(t.type)){const e=`Invalid prop \`type\` supplied to \`${nC}\`. Expected \`foreground | background\`.`;return new Error(e)}return null}};const SNe=t=>{const{__scopeToast:e,children:r,...n}=t,i=Sse(nC,e),[s,o]=$.useState(!1),[a,c]=$.useState(!1);return RNe(()=>o(!0)),$.useEffect(()=>{const l=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(l)},[]),a?null:$.createElement(_ie,{asChild:!0},$.createElement(dse,n,s&&$.createElement($.Fragment,null,i.label," ",r)))},ANe="ToastAction",kNe=$.forwardRef((t,e)=>{const{altText:r,...n}=t;return r?$.createElement(Ase,{altText:r,asChild:!0},$.createElement(PNe,jt({},n,{ref:e}))):null});kNe.propTypes={altText(t){return t.altText?null:new Error(`Missing prop \`altText\` expected on \`${ANe}\``)}};const INe="ToastClose",PNe=$.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t,i=_Ne(INe,r);return $.createElement(Ase,{asChild:!0},$.createElement(pr.button,jt({type:"button"},n,{ref:e,onClick:Pt(t.onClick,i.onClose)})))}),Ase=$.forwardRef((t,e)=>{const{__scopeToast:r,altText:n,...i}=t;return $.createElement(pr.div,jt({"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0},i,{ref:e}))});function kse(t){const e=[];return Array.from(t.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&e.push(n.textContent),TNe(n)){const i=n.ariaHidden||n.hidden||n.style.display==="none",s=n.dataset.radixToastAnnounceExclude==="";if(!i)if(s){const o=n.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...kse(n))}}),e}function J5(t,e,r,{discrete:n}){const i=r.originalEvent.currentTarget,s=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});e&&i.addEventListener(t,e,{once:!0}),n?$$(i,s):i.dispatchEvent(s)}const aH=(t,e,r=0)=>{const n=Math.abs(t.x),i=Math.abs(t.y),s=n>i;return e==="left"||e==="right"?s&&n>r:!s&&i>r};function RNe(t=()=>{}){const e=Qa(t);Ya(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[e])}function TNe(t){return t.nodeType===t.ELEMENT_NODE}On({defaultClassName:"_6wut8v3",variantClassNames:{variant:{normal:"_6wut8v4",success:"_6wut8v5",error:"_6wut8v6"}},defaultVariants:{},compoundVariants:[]});$.createContext(null);var ONe="_15pztn2",$Ne="_15pztn1 _1qxj1ib9 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg fyvr1t4 fyvr1v0 fyvr1ww fyvr1ys fyvr11ko fyvr11ob fyvr12rt fyvr128 fyvr11h0";$.forwardRef((t,e)=>{const{as:r="textarea",autoComplete:n="off",borderRadius:i="md",description:s,disabled:o=!1,id:a,label:c="",labelLocation:l="hidden",name:u,rows:f,resize:d=!1,...p}=t;return me.jsx(b1,{description:s,disabled:o,display:"grid",id:a??u,label:c,labelLocation:l,children:me.jsx(ae,{as:r,autoComplete:n,spellCheck:"false",className:fa($Ne,d&&ONe),disabled:o,id:a??u,name:u,ref:e,rows:f,borderRadius:i,...p})})});var NNe="bnrrebg fyvr11dc fyvr11e0 fyvr11c0 fyvr11co fyvr11ls fyvr11m8 fyvr11jg fyvr11ko fyvr11sh fyvr128 fyvr15o fyvr11h0",MNe="bnrrebe",DNe=On({defaultClassName:"bnrreb5 fyvr11ls fyvr11m8 fyvr11jg fyvr11ko fyvr11h0",variantClassNames:{size:{xs:"bnrreb6",sm:"bnrreb7",md:"bnrreb8",lg:"bnrreb9"},borderRadius:{circle:"fyvr11dc fyvr11e0 fyvr11c0 fyvr11co",lg:"fyvr11d8 fyvr11dw fyvr11bw fyvr11ck",md:"fyvr11d4 fyvr11ds fyvr11bs fyvr11cg",sm:"fyvr11d0 fyvr11do fyvr11bo fyvr11cc"}},defaultVariants:{},compoundVariants:[]});$.memo(t=>{const{borderRadius:e="circle",className:r,disableAnimation:n=!1,style:i,src:s,symbol:o,size:a="md",...c}=t;return me.jsx(ae,{className:fa(r,DNe({borderRadius:e,size:a})),style:i,flexShrink:"0",...c,children:s?me.jsx(Hn,{className:MNe,disableAnimation:n,src:s}):me.jsx(Pe,{className:NNe,variant:"normal",fontWeight:"medium",color:"text50",uppercase:!0,children:o==null?void 0:o.replace(/\s/,"").slice(0,4)})})});const[iC,jyt]=Ps("Tooltip",[Lm]);Lm();const LNe="TooltipProvider";iC(LNe);const Ise="Tooltip";iC(Ise);const BNe="TooltipPortal";iC(BNe,{forceMount:void 0});iC(Ise,{isInside:!1});const FNe=(t,e={})=>{const r=new Map().set("isMobile",`@media screen and (max-width: ${_z.lg-1}px)`).set("isDesktop",`@media screen and (min-width: ${_z.lg}px)`);if(!t.startsWith("@media")){const c=r.get(t);if(!c||c==="")throw new Error(`useMediaQuery failed to get breakpoint from theme for: ${t}`);t=c}const n=t.replace(/^@media( ?)/m,""),i=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:s=!1}=e,[o,a]=$.useState(()=>i?window.matchMedia(n).matches:s);return $.useEffect(()=>{let c=!0;if(!i)return;const l=window.matchMedia(n),u=()=>{c&&a(l.matches)};return u(),l.addListener(u),()=>{c=!1,l.removeListener(u)}},[n,i]),o},jNe="2.5.0",UNe=t=>t,Y$=t=>t,zNe=()=>`viem@${jNe}`;let Ue=class dP extends Error{constructor(e,r={}){var s;super(),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ViemError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:zNe()});const n=r.cause instanceof dP?r.cause.details:(s=r.cause)!=null&&s.message?r.cause.message:r.details,i=r.cause instanceof dP&&r.cause.docsPath||r.docsPath;this.message=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...i?[`Docs: https://viem.sh${i}${r.docsSlug?`#${r.docsSlug}`:""}`]:[],...n?[`Details: ${n}`]:[],`Version: ${this.version}`].join(` +`),r.cause&&(this.cause=r.cause),this.details=n,this.docsPath=i,this.metaMessages=r.metaMessages,this.shortMessage=e}walk(e){return Pse(this,e)}};function Pse(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t?Pse(t.cause,e):e?null:t}class HNe extends Ue{constructor({max:e,min:r,signed:n,size:i,value:s}){super(`Number "${s}" is not in safe ${i?`${i*8}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${r} to ${e})`:`(above ${r})`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntegerOutOfRangeError"})}}class qNe extends Ue{constructor(e){super(`Bytes value "${e}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidBytesBooleanError"})}}class WNe extends Ue{constructor(e){super(`Hex value "${e}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidHexBooleanError"})}}class VNe extends Ue{constructor({givenSize:e,maxSize:r}){super(`Size cannot exceed ${r} bytes. Given size: ${e} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeOverflowError"})}}class Rse extends Ue{constructor({offset:e,position:r,size:n}){super(`Slice ${r==="start"?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${n}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SliceOffsetOutOfBoundsError"})}}class Tse extends Ue{constructor({size:e,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${r}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeExceedsPaddingSizeError"})}}function jm(t,{dir:e,size:r=32}={}){return typeof t=="string"?Dd(t,{dir:e,size:r}):GNe(t,{dir:e,size:r})}function Dd(t,{dir:e,size:r=32}={}){if(r===null)return t;const n=t.replace("0x","");if(n.length>r*2)throw new Tse({size:Math.ceil(n.length/2),targetSize:r,type:"hex"});return`0x${n[e==="right"?"padEnd":"padStart"](r*2,"0")}`}function GNe(t,{dir:e,size:r=32}={}){if(r===null)return t;if(t.length>r)throw new Tse({size:t.length,targetSize:r,type:"bytes"});const n=new Uint8Array(r);for(let i=0;i=mu.zero&&t<=mu.nine)return t-mu.zero;if(t>=mu.A&&t<=mu.F)return t-(mu.A-10);if(t>=mu.a&&t<=mu.f)return t-(mu.a-10)}function fw(t,e={}){let r=t;e.size&&(ic(r,{size:e.size}),r=jm(r,{dir:"right",size:e.size}));let n=r.slice(2);n.length%2&&(n=`0${n}`);const i=n.length/2,s=new Uint8Array(i);for(let o=0,a=0;oe)throw new VNe({givenSize:_i(t),maxSize:e})}function lH(t,e){const r=typeof e=="string"?{to:e}:e,n=r.to;return n==="number"?cf(t,r):n==="bigint"?dw(t,r):n==="string"?ZNe(t,r):n==="boolean"?YNe(t,r):fw(t,r)}function dw(t,e={}){const{signed:r}=e;e.size&&ic(t,{size:e.size});const n=BigInt(t);if(!r)return n;const i=(t.length-2)/2,s=(1n<e.toString(16).padStart(2,"0"));function Rf(t,e={}){return typeof t=="number"||typeof t=="bigint"?Mt(t,e):typeof t=="string"?Z$(t,e):typeof t=="boolean"?Ose(t,e):Vc(t,e)}function Ose(t,e={}){const r=`0x${Number(t)}`;return typeof e.size=="number"?(ic(r,{size:e.size}),jm(r,{size:e.size})):r}function Vc(t,e={}){let r="";for(let i=0;is||ia):void 0}]},{retryCount:0})}function lf(t,{includeName:e=!1}={}){if(t.type!=="function"&&t.type!=="event"&&t.type!=="error")throw new pMe(t.type);return`${t.name}(${sC(t.inputs,{includeName:e})})`}function sC(t,{includeName:e=!1}={}){return t?t.map(r=>rMe(r,{includeName:e})).join(e?", ":","):""}function rMe(t,{includeName:e}){return t.type.startsWith("tuple")?`(${sC(t.components,{includeName:e})})${t.type.slice(5)}`:t.type+(e&&t.name?` ${t.name}`:"")}class nMe extends Ue{constructor({docsPath:e}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(` +`),{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorNotFoundError"})}}class uH extends Ue{constructor({docsPath:e}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(` +`),{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorParamsNotFoundError"})}}class $se extends Ue{constructor({data:e,params:r,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join(` +`),{metaMessages:[`Params: (${sC(r,{includeName:!0})})`,`Data: ${e} (${n} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e,this.params=r,this.size=n}}class oC extends Ue{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingZeroDataError"})}}class iMe extends Ue{constructor({expectedLength:e,givenLength:r,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${e}`,`Given length: ${r}`].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingArrayLengthMismatchError"})}}class sMe extends Ue{constructor({expectedSize:e,value:r}){super(`Size of bytes "${r}" (bytes${_i(r)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingBytesSizeMismatchError"})}}class oMe extends Ue{constructor({expectedLength:e,givenLength:r}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${r}`].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingLengthMismatchError"})}}class Nse extends Ue{constructor(e,{docsPath:r}){super([`Encoded error signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${e}.`].join(` +`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}}class aMe extends Ue{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureEmptyTopicsError"})}}class Mse extends Ue{constructor(e,{docsPath:r}){super([`Encoded event signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${e}.`].join(` +`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureNotFoundError"})}}class fH extends Ue{constructor(e,{docsPath:r}={}){super([`Event ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(` +`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventNotFoundError"})}}class e_ extends Ue{constructor(e,{docsPath:r}={}){super([`Function ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(` +`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionNotFoundError"})}}class cMe extends Ue{constructor(e,{docsPath:r}){super([`Function "${e}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(` +`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionOutputsNotFoundError"})}}class lMe extends Ue{constructor(e,r){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${lf(e.abiItem)}\`, and`,`\`${r.type}\` in \`${lf(r.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItemAmbiguityError"})}}class uMe extends Ue{constructor({expectedSize:e,givenSize:r}){super(`Expected bytes${e}, got bytes${r}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BytesSizeMismatchError"})}}class n2 extends Ue{constructor({abiItem:e,data:r,params:n,size:i}){super([`Data size of ${i} bytes is too small for non-indexed event parameters.`].join(` +`),{metaMessages:[`Params: (${sC(n,{includeName:!0})})`,`Data: ${r} (${i} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e,this.data=r,this.params=n,this.size=i}}class aC extends Ue{constructor({abiItem:e,param:r}){super([`Expected a topic for indexed event parameter${r.name?` "${r.name}"`:""} on event "${lf(e,{includeName:!0})}".`].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e}}class fMe extends Ue{constructor(e,{docsPath:r}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(` +`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiEncodingType"})}}class dMe extends Ue{constructor(e,{docsPath:r}){super([`Type "${e}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(` +`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiDecodingType"})}}class hMe extends Ue{constructor(e){super([`Value "${e}" is not a valid array.`].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidArrayError"})}}class pMe extends Ue{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidDefinitionTypeError"})}}function uf(t){return typeof t[0]=="string"?X$(t):gMe(t)}function gMe(t){let e=0;for(const i of t)e+=i.length;const r=new Uint8Array(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function X$(t){return`0x${t.reduce((e,r)=>e+r.replace("0x",""),"")}`}class i2 extends Ue{constructor({address:e}){super(`Address "${e}" is invalid.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAddressError"})}}const mMe=/^0x[a-fA-F0-9]{40}$/;function Zd(t){return mMe.test(t)}function t_(t,e,r,{strict:n}={}){return Xl(t,{strict:!1})?vMe(t,e,r,{strict:n}):Bse(t,e,r,{strict:n})}function Dse(t,e){if(typeof e=="number"&&e>0&&e>_i(t)-1)throw new Rse({offset:e,position:"start",size:_i(t)})}function Lse(t,e,r){if(typeof e=="number"&&typeof r=="number"&&_i(t)!==r-e)throw new Rse({offset:r,position:"end",size:_i(t)})}function Bse(t,e,r,{strict:n}={}){Dse(t,e);const i=t.slice(e,r);return n&&Lse(i,e,r),i}function vMe(t,e,r,{strict:n}={}){Dse(t,e);const i=`0x${t.replace("0x","").slice((e??0)*2,(r??t.length)*2)}`;return n&&Lse(i,e,r),i}function hw(t,e){if(t.length!==e.length)throw new oMe({expectedLength:t.length,givenLength:e.length});const r=yMe({params:t,values:e}),n=tN(r);return n.length===0?"0x":n}function yMe({params:t,values:e}){const r=[];for(let n=0;n0?uf([a,o]):a}}if(i)return{dynamic:!0,encoded:o}}return{dynamic:!1,encoded:uf(s.map(({encoded:o})=>o))}}function xMe(t,{param:e}){const[,r]=e.type.split("bytes"),n=_i(t);if(!r){let i=t;return n%32!==0&&(i=Dd(i,{dir:"right",size:Math.ceil((t.length-2)/2/32)*32})),{dynamic:!0,encoded:uf([Dd(Mt(n,{size:32})),i])}}if(n!==parseInt(r))throw new sMe({expectedSize:parseInt(r),value:t});return{dynamic:!1,encoded:Dd(t,{dir:"right"})}}function EMe(t){return{dynamic:!1,encoded:Dd(Ose(t))}}function _Me(t,{signed:e}){return{dynamic:!1,encoded:Mt(t,{size:32,signed:e})}}function CMe(t){const e=Z$(t),r=Math.ceil(_i(e)/32),n=[];for(let i=0;ii))}}function rN(t){const e=t.match(/^(.*)\[(\d+)?\]$/);return e?[e[2]?Number(e[2]):null,e[1]]:void 0}const w9="/docs/contract/encodeDeployData";function Fse(t){const{abi:e,args:r,bytecode:n}=t;if(!r||r.length===0)return n;const i=e.find(o=>"type"in o&&o.type==="constructor");if(!i)throw new nMe({docsPath:w9});if(!("inputs"in i))throw new uH({docsPath:w9});if(!i.inputs||i.inputs.length===0)throw new uH({docsPath:w9});const s=hw(i.inputs,r);return X$([n,s])}function da(t){return typeof t=="string"?{address:t,type:"json-rpc"}:t}class cC extends Ue{constructor({docsPath:e}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the WalletClient."].join(` +`),{docsPath:e,docsSlug:"account"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountNotFoundError"})}}class hP extends Ue{constructor({blockNumber:e,chain:r,contract:n}){super(`Chain "${r.name}" does not support contract "${n.name}".`,{metaMessages:["This could be due to any of the following:",...e&&n.blockCreated&&n.blockCreated>e?[`- The contract "${n.name}" was not deployed until block ${n.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${n.name}" configured.`]]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDoesNotSupportContract"})}}class AMe extends Ue{constructor({chain:e,currentChainId:r}){super(`The current chain of the wallet (id: ${r}) does not match the target chain for the transaction (id: ${e.id} – ${e.name}).`,{metaMessages:[`Current Chain ID: ${r}`,`Expected Chain ID: ${e.id} – ${e.name}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainMismatchError"})}}class kMe extends Ue{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotFoundError"})}}class jse extends Ue{constructor(){super("No chain was provided to the Client."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ClientChainNotConfiguredError"})}}function Use({chain:t,currentChainId:e}){if(!t)throw new kMe;if(e!==t.id)throw new AMe({chain:t,currentChainId:e})}const IMe={gwei:9,wei:18},PMe={ether:-9,wei:9};function zse(t,e){let r=t.toString();const n=r.startsWith("-");n&&(r=r.slice(1)),r=r.padStart(e,"0");let[i,s]=[r.slice(0,r.length-e),r.slice(r.length-e)];return s=s.replace(/(0+)$/,""),`${n?"-":""}${i||"0"}${s?`.${s}`:""}`}function Po(t,e="wei"){return zse(t,PMe[e])}class eg extends Ue{constructor({cause:e,message:r}={}){var i;const n=(i=r==null?void 0:r.replace("execution reverted: ",""))==null?void 0:i.replace("execution reverted","");super(`Execution reverted ${n?`with reason: ${n}`:"for an unknown reason"}.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ExecutionRevertedError"})}}Object.defineProperty(eg,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(eg,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class r_ extends Ue{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${Po(r)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooHigh"})}}Object.defineProperty(r_,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class pP extends Ue{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${Po(r)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooLow"})}}Object.defineProperty(pP,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class gP extends Ue{constructor({cause:e,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}is higher than the next one expected.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooHighError"})}}Object.defineProperty(gP,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class mP extends Ue{constructor({cause:e,nonce:r}={}){super([`Nonce provided for the transaction ${r?`(${r}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(` +`),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooLowError"})}}Object.defineProperty(mP,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class vP extends Ue{constructor({cause:e,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}exceeds the maximum allowed nonce.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceMaxValueError"})}}Object.defineProperty(vP,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class yP extends Ue{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(` +`),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InsufficientFundsError"})}}Object.defineProperty(yP,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds/});class bP extends Ue{constructor({cause:e,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooHighError"})}}Object.defineProperty(bP,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class wP extends Ue{constructor({cause:e,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction is too low.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooLowError"})}}Object.defineProperty(wP,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class xP extends Ue{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionTypeNotSupportedError"})}}Object.defineProperty(xP,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class n_ extends Ue{constructor({cause:e,maxPriorityFeePerGas:r,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${r?` = ${Po(r)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${Po(n)} gwei`:""}).`].join(` +`),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TipAboveFeeCapError"})}}Object.defineProperty(n_,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class lC extends Ue{constructor({cause:e}){super(`An error occurred while executing: ${e==null?void 0:e.shortMessage}`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownNodeError"})}}function nN(t,e="wei"){return zse(t,IMe[e])}function pw(t){const e=Object.entries(t).map(([n,i])=>i===void 0||i===!1?null:[n,i]).filter(Boolean),r=e.reduce((n,[i])=>Math.max(n,i.length),0);return e.map(([n,i])=>` ${`${n}:`.padEnd(r+1)} ${i}`).join(` +`)}class RMe extends Ue{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeConflictError"})}}class TMe extends Ue{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",pw(e),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- a Legacy Transaction with `gasPrice`"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSerializableTransactionError"})}}class OMe extends Ue{constructor(e,{account:r,docsPath:n,chain:i,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d}){var g;const p=pw({chain:i&&`${i==null?void 0:i.name} (id: ${i==null?void 0:i.id})`,from:r==null?void 0:r.address,to:f,value:typeof d<"u"&&`${nN(d)} ${((g=i==null?void 0:i.nativeCurrency)==null?void 0:g.symbol)||"ETH"}`,data:s,gas:o,gasPrice:typeof a<"u"&&`${Po(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${Po(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${Po(l)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Request Arguments:",p].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionExecutionError"}),this.cause=e}}class Hse extends Ue{constructor({blockHash:e,blockNumber:r,blockTag:n,hash:i,index:s}){let o="Transaction";n&&s!==void 0&&(o=`Transaction at block time "${n}" at index "${s}"`),e&&s!==void 0&&(o=`Transaction at block hash "${e}" at index "${s}"`),r&&s!==void 0&&(o=`Transaction at block number "${r}" at index "${s}"`),i&&(o=`Transaction with hash "${i}"`),super(`${o} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionNotFoundError"})}}class qse extends Ue{constructor({hash:e}){super(`Transaction receipt with hash "${e}" could not be found. The Transaction may not be processed on a block yet.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionReceiptNotFoundError"})}}class $Me extends Ue{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WaitForTransactionReceiptTimeoutError"})}}const Ro=(t,e,r)=>JSON.stringify(t,(n,i)=>{const s=typeof i=="bigint"?i.toString():i;return typeof e=="function"?e(n,s):s},r);class lb extends Ue{constructor({body:e,details:r,headers:n,status:i,url:s}){super("HTTP request failed.",{details:r,metaMessages:[i&&`Status: ${i}`,`URL: ${Y$(s)}`,e&&`Request body: ${Ro(e)}`].filter(Boolean)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"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=n,this.status=i,this.url=s}}class iN extends Ue{constructor({body:e,error:r,url:n}){super("RPC Request failed.",{cause:r,details:r.message,metaMessages:[`URL: ${Y$(n)}`,`Request body: ${Ro(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=r.code}}class dH extends Ue{constructor({body:e,url:r}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${Y$(r)}`,`Request body: ${Ro(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TimeoutError"})}}const NMe=-1;class No extends Ue{constructor(e,{code:r,docsPath:n,metaMessages:i,shortMessage:s}){super(s,{cause:e,docsPath:n,metaMessages:i||(e==null?void 0:e.metaMessages)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=e.name,this.code=e instanceof iN?e.code:r??NMe}}class Um extends No{constructor(e,r){super(e,r),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderRpcError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=r.data}}class s2 extends No{constructor(e){super(e,{code:s2.code,shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ParseRpcError"})}}Object.defineProperty(s2,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class o2 extends No{constructor(e){super(e,{code:o2.code,shortMessage:"JSON is not a valid request object."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidRequestRpcError"})}}Object.defineProperty(o2,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class a2 extends No{constructor(e){super(e,{code:a2.code,shortMessage:"The method does not exist / is not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotFoundRpcError"})}}Object.defineProperty(a2,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class c2 extends No{constructor(e){super(e,{code:c2.code,shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(` +`)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParamsRpcError"})}}Object.defineProperty(c2,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class t1 extends No{constructor(e){super(e,{code:t1.code,shortMessage:"An internal error was received."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InternalRpcError"})}}Object.defineProperty(t1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class r1 extends No{constructor(e){super(e,{code:r1.code,shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(` +`)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidInputRpcError"})}}Object.defineProperty(r1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class l2 extends No{constructor(e){super(e,{code:l2.code,shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(l2,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class Bd extends No{constructor(e){super(e,{code:Bd.code,shortMessage:"Requested resource not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceUnavailableRpcError"})}}Object.defineProperty(Bd,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class u2 extends No{constructor(e){super(e,{code:u2.code,shortMessage:"Transaction creation failed."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionRejectedRpcError"})}}Object.defineProperty(u2,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class f2 extends No{constructor(e){super(e,{code:f2.code,shortMessage:"Method is not implemented."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotSupportedRpcError"})}}Object.defineProperty(f2,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class sm extends No{constructor(e){super(e,{code:sm.code,shortMessage:"Request exceeds defined limit."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"LimitExceededRpcError"})}}Object.defineProperty(sm,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class d2 extends No{constructor(e){super(e,{code:d2.code,shortMessage:"Version of JSON-RPC protocol is not supported."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"JsonRpcVersionUnsupportedError"})}}Object.defineProperty(d2,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class en extends Um{constructor(e){super(e,{code:en.code,shortMessage:"User rejected the request."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UserRejectedRequestError"})}}Object.defineProperty(en,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class h2 extends Um{constructor(e){super(e,{code:h2.code,shortMessage:"The requested method and/or account has not been authorized by the user."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnauthorizedProviderError"})}}Object.defineProperty(h2,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class p2 extends Um{constructor(e){super(e,{code:p2.code,shortMessage:"The Provider does not support the requested method."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnsupportedProviderMethodError"})}}Object.defineProperty(p2,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class g2 extends Um{constructor(e){super(e,{code:g2.code,shortMessage:"The Provider is disconnected from all chains."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderDisconnectedError"})}}Object.defineProperty(g2,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class m2 extends Um{constructor(e){super(e,{code:m2.code,shortMessage:"The Provider is not connected to the requested chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDisconnectedError"})}}Object.defineProperty(m2,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class Xa extends Um{constructor(e){super(e,{code:Xa.code,shortMessage:"An error occurred when attempting to switch chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainError"})}}Object.defineProperty(Xa,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class MMe extends No{constructor(e){super(e,{shortMessage:"An unknown RPC error occurred."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownRpcError"})}}function sN(t,e){const r=(t.details||"").toLowerCase(),n=t instanceof Ue?t.walk(i=>i.code===eg.code):t;return n instanceof Ue?new eg({cause:t,message:n.details}):eg.nodeMessage.test(r)?new eg({cause:t,message:t.details}):r_.nodeMessage.test(r)?new r_({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):pP.nodeMessage.test(r)?new pP({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):gP.nodeMessage.test(r)?new gP({cause:t,nonce:e==null?void 0:e.nonce}):mP.nodeMessage.test(r)?new mP({cause:t,nonce:e==null?void 0:e.nonce}):vP.nodeMessage.test(r)?new vP({cause:t,nonce:e==null?void 0:e.nonce}):yP.nodeMessage.test(r)?new yP({cause:t}):bP.nodeMessage.test(r)?new bP({cause:t,gas:e==null?void 0:e.gas}):wP.nodeMessage.test(r)?new wP({cause:t,gas:e==null?void 0:e.gas}):xP.nodeMessage.test(r)?new xP({cause:t}):n_.nodeMessage.test(r)?new n_({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas,maxPriorityFeePerGas:e==null?void 0:e.maxPriorityFeePerGas}):new lC({cause:t})}function DMe(t,{docsPath:e,...r}){const n=(()=>{const i=sN(t,r);return i instanceof lC?t:i})();return new OMe(n,{docsPath:e,...r})}function oN(t,{format:e}){if(!e)return{};const r={};function n(s){const o=Object.keys(s);for(const a of o)a in t&&(r[a]=t[a]),s[a]&&typeof s[a]=="object"&&!Array.isArray(s[a])&&n(s[a])}const i=e(t||{});return n(i),r}const LMe={legacy:"0x0",eip2930:"0x1",eip1559:"0x2"};function uC(t){return{...t,gas:typeof t.gas<"u"?Mt(t.gas):void 0,gasPrice:typeof t.gasPrice<"u"?Mt(t.gasPrice):void 0,maxFeePerGas:typeof t.maxFeePerGas<"u"?Mt(t.maxFeePerGas):void 0,maxPriorityFeePerGas:typeof t.maxPriorityFeePerGas<"u"?Mt(t.maxPriorityFeePerGas):void 0,nonce:typeof t.nonce<"u"?Mt(t.nonce):void 0,type:typeof t.type<"u"?LMe[t.type]:void 0,value:typeof t.value<"u"?Mt(t.value):void 0}}function Rt(t,e,r){return n=>{var i;return((i=t[e.name||r])==null?void 0:i.call(t,n))??e(t,n)}}function gw(t){const{account:e,gasPrice:r,maxFeePerGas:n,maxPriorityFeePerGas:i,to:s}=t,o=e?da(e):void 0;if(o&&!Zd(o.address))throw new i2({address:o.address});if(s&&!Zd(s))throw new i2({address:s});if(typeof r<"u"&&(typeof n<"u"||typeof i<"u"))throw new RMe;if(n&&n>2n**256n-1n)throw new r_({maxFeePerGas:n});if(i&&n&&i>n)throw new n_({maxFeePerGas:n,maxPriorityFeePerGas:i})}async function v2(t){const e=await t.request({method:"eth_chainId"});return cf(e)}class BMe extends Ue{constructor(){super("`baseFeeMultiplier` must be greater than 1."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseFeeScalarError"})}}class aN extends Ue{constructor(){super("Chain does not support EIP-1559 fees."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip1559FeesNotSupportedError"})}}class FMe extends Ue{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${Po(e)} gwei).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MaxFeePerGasTooLowError"})}}class Wse extends Ue{constructor({blockHash:e,blockNumber:r}){let n="Block";e&&(n=`Block at hash "${e}"`),r&&(n=`Block at number "${r}"`),super(`${n} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlockNotFoundError"})}}const Vse={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559"};function Gse(t){const e={...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,chainId:t.chainId?cf(t.chainId):void 0,gas:t.gas?BigInt(t.gas):void 0,gasPrice:t.gasPrice?BigInt(t.gasPrice):void 0,maxFeePerGas:t.maxFeePerGas?BigInt(t.maxFeePerGas):void 0,maxPriorityFeePerGas:t.maxPriorityFeePerGas?BigInt(t.maxPriorityFeePerGas):void 0,nonce:t.nonce?cf(t.nonce):void 0,to:t.to?t.to:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,type:t.type?Vse[t.type]:void 0,typeHex:t.type?t.type:void 0,value:t.value?BigInt(t.value):void 0,v:t.v?BigInt(t.v):void 0};return e.yParity=(()=>{if(t.yParity)return Number(t.yParity);if(typeof e.v=="bigint"){if(e.v===0n||e.v===27n)return 0;if(e.v===1n||e.v===28n)return 1;if(e.v>=35n)return e.v%2n===0n?1:0}})(),e.type==="legacy"&&(delete e.accessList,delete e.maxFeePerGas,delete e.maxPriorityFeePerGas,delete e.yParity),e.type==="eip2930"&&(delete e.maxFeePerGas,delete e.maxPriorityFeePerGas),e}function Kse(t){var r;const e=(r=t.transactions)==null?void 0:r.map(n=>typeof n=="string"?n:Gse(n));return{...t,baseFeePerGas:t.baseFeePerGas?BigInt(t.baseFeePerGas):null,difficulty:t.difficulty?BigInt(t.difficulty):void 0,gasLimit:t.gasLimit?BigInt(t.gasLimit):void 0,gasUsed:t.gasUsed?BigInt(t.gasUsed):void 0,hash:t.hash?t.hash:null,logsBloom:t.logsBloom?t.logsBloom:null,nonce:t.nonce?t.nonce:null,number:t.number?BigInt(t.number):null,size:t.size?BigInt(t.size):void 0,timestamp:t.timestamp?BigInt(t.timestamp):void 0,transactions:e,totalDifficulty:t.totalDifficulty?BigInt(t.totalDifficulty):null}}async function Xd(t,{blockHash:e,blockNumber:r,blockTag:n,includeTransactions:i}={}){var u,f,d;const s=n??"latest",o=i??!1,a=r!==void 0?Mt(r):void 0;let c=null;if(e?c=await t.request({method:"eth_getBlockByHash",params:[e,o]}):c=await t.request({method:"eth_getBlockByNumber",params:[a||s,o]}),!c)throw new Wse({blockHash:e,blockNumber:r});return(((d=(f=(u=t.chain)==null?void 0:u.formatters)==null?void 0:f.block)==null?void 0:d.format)||Kse)(c)}async function cN(t){const e=await t.request({method:"eth_gasPrice"});return BigInt(e)}async function jMe(t,e){return Jse(t,e)}async function Jse(t,e){var s,o,a;const{block:r,chain:n=t.chain,request:i}=e||{};if(typeof((s=n==null?void 0:n.fees)==null?void 0:s.defaultPriorityFee)=="function"){const c=r||await Rt(t,Xd,"getBlock")({});return n.fees.defaultPriorityFee({block:c,client:t,request:i})}if(typeof((o=n==null?void 0:n.fees)==null?void 0:o.defaultPriorityFee)<"u")return(a=n==null?void 0:n.fees)==null?void 0:a.defaultPriorityFee;try{const c=await t.request({method:"eth_maxPriorityFeePerGas"});return dw(c)}catch{const[c,l]=await Promise.all([r?Promise.resolve(r):Rt(t,Xd,"getBlock")({}),Rt(t,cN,"getGasPrice")({})]);if(typeof c.baseFeePerGas!="bigint")throw new aN;const u=l-c.baseFeePerGas;return u<0n?0n:u}}async function UMe(t,e){return EP(t,e)}async function EP(t,e){var d,p;const{block:r,chain:n=t.chain,request:i,type:s="eip1559"}=e||{},o=await(async()=>{var g,v;return typeof((g=n==null?void 0:n.fees)==null?void 0:g.baseFeeMultiplier)=="function"?n.fees.baseFeeMultiplier({block:r,client:t,request:i}):((v=n==null?void 0:n.fees)==null?void 0:v.baseFeeMultiplier)??1.2})();if(o<1)throw new BMe;const c=10**(((d=o.toString().split(".")[1])==null?void 0:d.length)??0),l=g=>g*BigInt(Math.ceil(o*c))/BigInt(c),u=r||await Rt(t,Xd,"getBlock")({});if(typeof((p=n==null?void 0:n.fees)==null?void 0:p.estimateFeesPerGas)=="function")return n.fees.estimateFeesPerGas({block:r,client:t,multiply:l,request:i,type:s});if(s==="eip1559"){if(typeof u.baseFeePerGas!="bigint")throw new aN;const g=typeof(i==null?void 0:i.maxPriorityFeePerGas)=="bigint"?i.maxPriorityFeePerGas:await Jse(t,{block:u,chain:n,request:i}),v=l(u.baseFeePerGas);return{maxFeePerGas:(i==null?void 0:i.maxFeePerGas)??v+g,maxPriorityFeePerGas:g}}return{gasPrice:(i==null?void 0:i.gasPrice)??l(await Rt(t,cN,"getGasPrice")({}))}}class zMe extends Ue{constructor(e,{account:r,docsPath:n,chain:i,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d}){var g;const p=pw({from:r==null?void 0:r.address,to:f,value:typeof d<"u"&&`${nN(d)} ${((g=i==null?void 0:i.nativeCurrency)==null?void 0:g.symbol)||"ETH"}`,data:s,gas:o,gasPrice:typeof a<"u"&&`${Po(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${Po(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${Po(l)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",p].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EstimateGasExecutionError"}),this.cause=e}}function HMe(t,{docsPath:e,...r}){const n=(()=>{const i=sN(t,r);return i instanceof lC?t:i})();return new zMe(n,{docsPath:e,...r})}async function lN(t,e){var i,s,o;const r=e.account??t.account,n=r?da(r):void 0;try{const{accessList:a,blockNumber:c,blockTag:l,data:u,gas:f,gasPrice:d,maxFeePerGas:p,maxPriorityFeePerGas:g,nonce:v,to:y,value:b,...w}=(n==null?void 0:n.type)==="local"?await fC(t,e):e,C=(c?Mt(c):void 0)||l;gw(e);const S=(o=(s=(i=t.chain)==null?void 0:i.formatters)==null?void 0:s.transactionRequest)==null?void 0:o.format,_=(S||uC)({...oN(w,{format:S}),from:n==null?void 0:n.address,accessList:a,data:u,gas:f,gasPrice:d,maxFeePerGas:p,maxPriorityFeePerGas:g,nonce:v,to:y,value:b}),T=await t.request({method:"eth_estimateGas",params:C?[_,C]:[_]});return BigInt(T)}catch(a){throw HMe(a,{...e,account:n,chain:t.chain})}}async function Qse(t,{address:e,blockTag:r="latest",blockNumber:n}){const i=await t.request({method:"eth_getTransactionCount",params:[e,n?Mt(n):r]});return cf(i)}function qMe(t){if(t.type)return t.type;if(typeof t.maxFeePerGas<"u"||typeof t.maxPriorityFeePerGas<"u")return"eip1559";if(typeof t.gasPrice<"u")return typeof t.accessList<"u"?"eip2930":"legacy";throw new TMe({transaction:t})}async function fC(t,e){const{account:r=t.account,chain:n,gas:i,nonce:s,parameters:o=["fees","gas","nonce","type"],type:a}=e,c=r?da(r):void 0,l=await Rt(t,Xd,"getBlock")({blockTag:"latest"}),u={...e,...c?{from:c==null?void 0:c.address}:{}};if(o.includes("nonce")&&typeof s>"u"&&c&&(u.nonce=await Rt(t,Qse,"getTransactionCount")({address:c.address,blockTag:"pending"})),(o.includes("fees")||o.includes("type"))&&typeof a>"u")try{u.type=qMe(u)}catch{u.type=typeof l.baseFeePerGas=="bigint"?"eip1559":"legacy"}if(o.includes("fees"))if(u.type==="eip1559"){const{maxFeePerGas:f,maxPriorityFeePerGas:d}=await EP(t,{block:l,chain:n,request:u});if(typeof e.maxPriorityFeePerGas>"u"&&e.maxFeePerGas&&e.maxFeePerGas"u"&&(u.gas=await Rt(t,lN,"estimateGas")({...u,account:c?{address:c.address,type:"json-rpc"}:void 0})),gw(u),delete u.parameters,u}async function uN(t,{serializedTransaction:e}){return t.request({method:"eth_sendRawTransaction",params:[e]},{retryCount:0})}async function fN(t,e){var v,y,b,w;const{account:r=t.account,chain:n=t.chain,accessList:i,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d,...p}=e;if(!r)throw new cC({docsPath:"/docs/actions/wallet/sendTransaction"});const g=da(r);try{gw(e);let E;if(n!==null&&(E=await Rt(t,v2,"getChainId")({}),Use({currentChainId:E,chain:n})),g.type==="local"){const _=await Rt(t,fC,"prepareTransactionRequest")({account:g,accessList:i,chain:n,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d,...p});E||(E=await Rt(t,v2,"getChainId")({}));const T=(v=n==null?void 0:n.serializers)==null?void 0:v.transaction,Q=await g.signTransaction({..._,chainId:E},{serializer:T});return await Rt(t,uN,"sendRawTransaction")({serializedTransaction:Q})}const C=(w=(b=(y=t.chain)==null?void 0:y.formatters)==null?void 0:b.transactionRequest)==null?void 0:w.format,P=(C||uC)({...oN(p,{format:C}),accessList:i,data:s,from:g.address,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d});return await t.request({method:"eth_sendTransaction",params:[P]},{retryCount:0})}catch(E){throw DMe(E,{...e,account:g,chain:e.chain||void 0})}}function WMe(t,e){const{abi:r,args:n,bytecode:i,...s}=e,o=Fse({abi:r,args:n,bytecode:i});return fN(t,{...s,data:o})}const _P=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],Yse=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"},{inputs:[],name:"ResolverNotContract",type:"error"},{inputs:[{name:"returnData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{components:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"errors",type:"tuple[]"}],name:"HttpError",type:"error"}],Zse=[...Yse,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]},{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],VMe=[...Yse,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]},{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],hH=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],pH=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],GMe=[{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"}],Q5=BigInt(2**32-1),gH=BigInt(32);function KMe(t,e=!1){return e?{h:Number(t&Q5),l:Number(t>>gH&Q5)}:{h:Number(t>>gH&Q5)|0,l:Number(t&Q5)|0}}function JMe(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;it<>>32-r,YMe=(t,e,r)=>e<>>32-r,ZMe=(t,e,r)=>e<>>64-r,XMe=(t,e,r)=>t<>>64-r,[Xse,eoe,toe]=[[],[],[]],eDe=BigInt(0),Xv=BigInt(1),tDe=BigInt(2),rDe=BigInt(7),nDe=BigInt(256),iDe=BigInt(113);for(let t=0,e=Xv,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],Xse.push(2*(5*n+r)),eoe.push((t+1)*(t+2)/2%64);let i=eDe;for(let s=0;s<7;s++)e=(e<>rDe)*iDe)%nDe,e&tDe&&(i^=Xv<<(Xv<r>32?ZMe(t,e,r):QMe(t,e,r),vH=(t,e,r)=>r>32?XMe(t,e,r):YMe(t,e,r);function aDe(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,l=r[c],u=r[c+1],f=mH(l,u,1)^r[a],d=vH(l,u,1)^r[a+1];for(let p=0;p<50;p+=10)t[o+p]^=f,t[o+p+1]^=d}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=eoe[o],c=mH(i,s,a),l=vH(i,s,a),u=Xse[o];i=t[u],s=t[u+1],t[u]=c,t[u+1]=l}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=sDe[n],t[1]^=oDe[n]}r.fill(0)}let cDe=class roe extends hte{constructor(e,r,n,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,lU(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=jCe(this.state)}keccak(){aDe(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){T6(this);const{blockLen:r,state:n}=this;e=QO(e);const i=e.length;for(let s=0;s=n&&this.keccak();const o=Math.min(n-this.posOut,s-i);e.set(r.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 lU(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(fte(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,this.state.fill(0)}_cloneInto(e){const{blockLen:r,suffix:n,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new roe(r,n,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=n,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}};const lDe=(t,e,r)=>pte(()=>new cDe(e,t,r)),uDe=lDe(1,136,256/8);function _o(t,e){const r=e||"hex",n=uDe(Xl(t,{strict:!1})?e1(t):t);return r==="bytes"?n:Rf(n)}function dN(t,e){const r=e?`${e}${t.toLowerCase()}`:t.substring(2).toLowerCase(),n=_o(Vu(r),"bytes"),i=(e?r.substring(`${e}0x`.length):r).split("");for(let s=0;s<40;s+=2)n[s>>1]>>4>=8&&i[s]&&(i[s]=i[s].toUpperCase()),(n[s>>1]&15)>=8&&i[s+1]&&(i[s+1]=i[s+1].toUpperCase());return`0x${i.join("")}`}function Co(t,e){if(!Zd(t))throw new i2({address:t});return dN(t,e)}class yH extends Ue{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NegativeOffsetError"})}}class noe extends Ue{constructor({length:e,position:r}){super(`Position \`${r}\` is out of bounds (\`0 < position < ${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PositionOutOfBoundsError"})}}class fDe extends Ue{constructor({count:e,limit:r}){super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RecursiveReadLimitExceededError"})}}const dDe={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:1/0,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new fDe({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(t){if(t<0||t>this.bytes.length-1)throw new noe({length:this.bytes.length,position:t})},decrementPosition(t){if(t<0)throw new yH({offset:t});const e=this.position-t;this.assertPosition(e),this.position=e},getReadCount(t){return this.positionReadCount.get(t||this.position)||0},incrementPosition(t){if(t<0)throw new yH({offset:t});const e=this.position+t;this.assertPosition(e),this.position=e},inspectByte(t){const e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectBytes(t,e){const r=e??this.position;return this.assertPosition(r+t-1),this.bytes.subarray(r,r+t)},inspectUint8(t){const e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectUint16(t){const e=t??this.position;return this.assertPosition(e+1),this.dataView.getUint16(e)},inspectUint24(t){const e=t??this.position;return this.assertPosition(e+2),(this.dataView.getUint16(e)<<8)+this.dataView.getUint8(e+2)},inspectUint32(t){const e=t??this.position;return this.assertPosition(e+3),this.dataView.getUint32(e)},pushByte(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushBytes(t){this.assertPosition(this.position+t.length-1),this.bytes.set(t,this.position),this.position+=t.length},pushUint8(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushUint16(t){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,t),this.position+=2},pushUint24(t){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,t>>8),this.dataView.setUint8(this.position+2,t&255),this.position+=3},pushUint32(t){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,t),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const t=this.inspectByte();return this.position++,t},readBytes(t,e){this.assertReadLimit(),this._touch();const r=this.inspectBytes(t);return this.position+=e??t,r},readUint8(){this.assertReadLimit(),this._touch();const t=this.inspectUint8();return this.position+=1,t},readUint16(){this.assertReadLimit(),this._touch();const t=this.inspectUint16();return this.position+=2,t},readUint24(){this.assertReadLimit(),this._touch();const t=this.inspectUint24();return this.position+=3,t},readUint32(){this.assertReadLimit(),this._touch();const t=this.inspectUint32();return this.position+=4,t},setPosition(t){const e=this.position;return this.assertPosition(t),this.position=t,()=>this.position=e},_touch(){if(this.recursiveReadLimit===1/0)return;const t=this.getReadCount();this.positionReadCount.set(this.position,t+1),t>0&&this.recursiveReadCount++}};function hDe(t,{recursiveReadLimit:e=8192}={}){const r=Object.create(dDe);return r.bytes=t,r.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=e,r}function pDe(t,e={}){typeof e.size<"u"&&ic(t,{size:e.size});const r=Vc(t,e);return dw(r,e)}function gDe(t,e={}){let r=t;if(typeof e.size<"u"&&(ic(r,{size:e.size}),r=Ld(r)),r.length>1||r[0]>1)throw new qNe(r);return!!r[0]}function Gu(t,e={}){typeof e.size<"u"&&ic(t,{size:e.size});const r=Vc(t,e);return cf(r,e)}function mDe(t,e={}){let r=t;return typeof e.size<"u"&&(ic(r,{size:e.size}),r=Ld(r,{dir:"right"})),new TextDecoder().decode(r)}function dC(t,e){const r=typeof e=="string"?fw(e):e,n=hDe(r);if(_i(r)===0&&t.length>0)throw new oC;if(_i(e)&&_i(e)<32)throw new $se({data:typeof e=="string"?e:Vc(e),params:t,size:_i(e)});let i=0;const s=[];for(let o=0;o48?pDe(i,{signed:r}):Gu(i,{signed:r}),32]}function EDe(t,e,{staticPosition:r}){const n=e.components.length===0||e.components.some(({name:o})=>!o),i=n?[]:{};let s=0;if(y2(e)){const o=Gu(t.readBytes(CP)),a=r+o;for(let c=0;c(\[(\d*)\])*)$/;function SP(t){let e=t.type;if(wH.test(t.type)&&"components"in t){e="(";const r=t.components.length;for(let i=0;i_o(e1(t));function kDe(t){return ADe(t)}function IDe(t){let e=!0,r="",n=0,i="",s=!1;for(let o=0;o{const e=(()=>typeof t=="string"?t:SDe(t))();return IDe(e)};function ioe(t){return kDe(PDe(t))}const hN=ioe,pN=t=>t_(ioe(t),0,4);function mw(t){const{abi:e,args:r=[],name:n}=t,i=Xl(n,{strict:!1}),s=e.filter(a=>i?a.type==="function"?pN(a)===n:a.type==="event"?hN(a)===n:!1:"name"in a&&a.name===n);if(s.length===0)return;if(s.length===1)return s[0];let o;for(const a of s){if(!("inputs"in a))continue;if(!r||r.length===0){if(!a.inputs||a.inputs.length===0)return a;continue}if(!a.inputs||a.inputs.length===0||a.inputs.length!==r.length)continue;if(r.every((l,u)=>{const f="inputs"in a&&a.inputs[u];return f?AP(l,f):!1})){if(o&&"inputs"in o&&o.inputs){const l=soe(a.inputs,o.inputs,r);if(l)throw new lMe({abiItem:a,type:l[0]},{abiItem:o,type:l[1]})}o=a}}return o||s[0]}function AP(t,e){const r=typeof t,n=e.type;switch(n){case"address":return Zd(t);case"bool":return r==="boolean";case"function":return r==="string";case"string":return r==="string";default:return n==="tuple"&&"components"in e?Object.values(e.components).every((i,s)=>AP(Object.values(t)[s],i)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(n)?r==="number"||r==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(n)?r==="string"||t instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(n)?Array.isArray(t)&&t.every(i=>AP(i,{...e,type:n.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function soe(t,e,r){for(const n in t){const i=t[n],s=e[n];if(i.type==="tuple"&&s.type==="tuple"&&"components"in i&&"components"in s)return soe(i.components,s.components,r[n]);const o=[i.type,s.type];if((()=>o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")||o.includes("address")&&o.includes("bytes")?Zd(r[n]):!1)())return o}}const x9="/docs/contract/decodeFunctionResult";function zm(t){const{abi:e,args:r,functionName:n,data:i}=t;let s=e[0];if(n){const a=mw({abi:e,args:r,name:n});if(!a)throw new e_(n,{docsPath:x9});s=a}if(s.type!=="function")throw new e_(void 0,{docsPath:x9});if(!s.outputs)throw new cMe(s.name,{docsPath:x9});const o=dC(s.outputs,i);if(o&&o.length>1)return o;if(o&&o.length===1)return o[0]}const xH="/docs/contract/encodeFunctionData";function bh(t){const{abi:e,args:r,functionName:n}=t;let i=e[0];if(n){const c=mw({abi:e,args:r,name:n});if(!c)throw new e_(n,{docsPath:xH});i=c}if(i.type!=="function")throw new e_(void 0,{docsPath:xH});const s=lf(i),o=pN(s),a="inputs"in i&&i.inputs?hw(i.inputs,r??[]):void 0;return X$([o,a??"0x"])}function Hm({blockNumber:t,chain:e,contract:r}){var i;const n=(i=e==null?void 0:e.contracts)==null?void 0:i[r];if(!n)throw new hP({chain:e,contract:{name:r}});if(t&&n.blockCreated&&n.blockCreated>t)throw new hP({blockNumber:t,chain:e,contract:{name:r,blockCreated:n.blockCreated}});return n.address}const ooe={1:"An `assert` condition failed.",17:"Arithmic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},RDe={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},TDe={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function ODe(t){const{abi:e,data:r}=t,n=t_(r,0,4);if(n==="0x")throw new oC;const s=[...e||[],RDe,TDe].find(o=>o.type==="error"&&n===pN(lf(o)));if(!s)throw new Nse(n,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:s,args:"inputs"in s&&s.inputs&&s.inputs.length>0?dC(s.inputs,t_(r,4)):void 0,errorName:s.name}}function aoe({abiItem:t,args:e,includeFunctionName:r=!0,includeName:n=!1}){if("name"in t&&"inputs"in t&&t.inputs)return`${r?t.name:""}(${t.inputs.map((i,s)=>`${n&&i.name?`${i.name}: `:""}${typeof e[s]=="object"?Ro(e[s]):e[s]}`).join(", ")})`}class coe extends Ue{constructor(e,{account:r,docsPath:n,chain:i,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d}){var v;const p=r?da(r):void 0,g=pw({from:p==null?void 0:p.address,to:f,value:typeof d<"u"&&`${nN(d)} ${((v=i==null?void 0:i.nativeCurrency)==null?void 0:v.symbol)||"ETH"}`,data:s,gas:o,gasPrice:typeof a<"u"&&`${Po(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${Po(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${Po(l)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",g].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CallExecutionError"}),this.cause=e}}class $De extends Ue{constructor(e,{abi:r,args:n,contractAddress:i,docsPath:s,functionName:o,sender:a}){const c=mw({abi:r,args:n,name:o}),l=c?aoe({abiItem:c,args:n,includeFunctionName:!1,includeName:!1}):void 0,u=c?lf(c,{includeName:!0}):void 0,f=pw({address:i&&UNe(i),function:u,args:l&&l!=="()"&&`${[...Array((o==null?void 0:o.length)??0).keys()].map(()=>" ").join("")}${l}`,sender:a});super(e.shortMessage||`An unknown error occurred while executing the contract function "${o}".`,{cause:e,docsPath:s,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Contract Call:",f].filter(Boolean)}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionExecutionError"}),this.abi=r,this.args=n,this.cause=e,this.contractAddress=i,this.functionName=o,this.sender=a}}class kP extends Ue{constructor({abi:e,data:r,functionName:n,message:i}){let s,o,a,c;if(r&&r!=="0x")try{o=ODe({abi:e,data:r});const{abiItem:u,errorName:f,args:d}=o;if(f==="Error")c=d[0];else if(f==="Panic"){const[p]=d;c=ooe[p]}else{const p=u?lf(u,{includeName:!0}):void 0,g=u&&d?aoe({abiItem:u,args:d,includeFunctionName:!1,includeName:!1}):void 0;a=[p?`Error: ${p}`:"",g&&g!=="()"?` ${[...Array((f==null?void 0:f.length)??0).keys()].map(()=>" ").join("")}${g}`:""]}}catch(u){s=u}else i&&(c=i);let l;s instanceof Nse&&(l=s.signature,a=[`Unable to decode signature "${l}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${l}.`]),super(c&&c!=="execution reverted"||l?[`The contract function "${n}" reverted with the following ${l?"signature":"reason"}:`,c||l].join(` +`):`The contract function "${n}" reverted.`,{cause:s,metaMessages:a}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=o,this.reason=c,this.signature=l}}class NDe extends Ue{constructor({functionName:e}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${e}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionZeroDataError"})}}class gN extends Ue{constructor({data:e,message:r}){super(r||""),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RawContractError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}function mN(t,e){var n,i,s,o,a,c;if(!(t instanceof Ue))return!1;const r=t.walk(l=>l instanceof kP);return r instanceof kP?!!(((n=r.data)==null?void 0:n.errorName)==="ResolverNotFound"||((i=r.data)==null?void 0:i.errorName)==="ResolverWildcardNotSupported"||((s=r.data)==null?void 0:s.errorName)==="ResolverNotContract"||((o=r.data)==null?void 0:o.errorName)==="ResolverError"||((a=r.data)==null?void 0:a.errorName)==="HttpError"||(c=r.reason)!=null&&c.includes("Wildcard on non-extended resolvers is not supported")||e==="reverse"&&r.reason===ooe[50]):!1}function loe(t){if(t.length!==66||t.indexOf("[")!==0||t.indexOf("]")!==65)return null;const e=`0x${t.slice(1,65)}`;return Xl(e)?e:null}function hE(t){let e=new Uint8Array(32).fill(0);if(!t)return Vc(e);const r=t.split(".");for(let n=r.length-1;n>=0;n-=1){const i=loe(r[n]),s=i?e1(i):_o(Vu(r[n]),"bytes");e=_o(uf([e,s]),"bytes")}return Vc(e)}function MDe(t){return`[${t.slice(2)}]`}function DDe(t){const e=new Uint8Array(32).fill(0);return t?loe(t)||_o(Vu(t)):Vc(e)}function hC(t){const e=t.replace(/^\.|\.$/gm,"");if(e.length===0)return new Uint8Array(1);const r=new Uint8Array(Vu(e).byteLength+2);let n=0;const i=e.split(".");for(let s=0;s255&&(o=Vu(MDe(DDe(i[s])))),r[n]=o.length,r.set(o,n+1),n+=o.length+1}return r.byteLength!==n+1?r.slice(0,n+1):r}const LDe=3;function b2(t,{abi:e,address:r,args:n,docsPath:i,functionName:s,sender:o}){const{code:a,data:c,message:l,shortMessage:u}=t instanceof gN?t:t instanceof Ue?t.walk(d=>"data"in d)||t.walk():{},f=(()=>t instanceof oC?new NDe({functionName:s}):[LDe,t1.code].includes(a)&&(c||l||u)?new kP({abi:e,data:typeof c=="object"?c.data:c,functionName:s,message:u??l}):t)();return new $De(f,{abi:e,args:n,contractAddress:r,docsPath:i,functionName:s,sender:o})}const BDe="modulepreload",FDe=function(t,e){return new URL(t,e).href},EH={},uoe=function(e,r,n){if(!r||r.length===0)return e();const i=document.getElementsByTagName("link");return Promise.all(r.map(s=>{if(s=FDe(s,n),s in EH)return;EH[s]=!0;const o=s.endsWith(".css"),a=o?'[rel="stylesheet"]':"";if(!!n)for(let u=i.length-1;u>=0;u--){const f=i[u];if(f.href===s&&(!o||f.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${s}"]${a}`))return;const l=document.createElement("link");if(l.rel=o?"stylesheet":BDe,o||(l.as="script",l.crossOrigin=""),l.href=s,document.head.appendChild(l),o)return new Promise((u,f)=>{l.addEventListener("load",u),l.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>e()).catch(s=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s})},jDe="0x82ad56cb";function UDe(t,{docsPath:e,...r}){const n=(()=>{const i=sN(t,r);return i instanceof lC?t:i})();return new coe(n,{docsPath:e,...r})}const E9=new Map;function foe({fn:t,id:e,shouldSplitBatch:r,wait:n=0,sort:i}){const s=async()=>{const u=c();o();const f=u.map(({args:d})=>d);f.length!==0&&t(f).then(d=>{var p;i&&Array.isArray(d)&&d.sort(i);for(let g=0;g{var p;for(let g=0;gE9.delete(e),a=()=>c().map(({args:u})=>u),c=()=>E9.get(e)||[],l=u=>E9.set(e,[...c(),u]);return{flush:o,async schedule(u){const f={},d=new Promise((v,y)=>{f.resolve=v,f.reject=y});return(r==null?void 0:r([...a(),u]))&&s(),c().length>0?(l({args:u,pendingPromise:f}),d):(l({args:u,pendingPromise:f}),setTimeout(s,n),d)}}}async function pC(t,e){var b,w,E,C;const{account:r=t.account,batch:n=!!((b=t.batch)!=null&&b.multicall),blockNumber:i,blockTag:s="latest",accessList:o,data:a,gas:c,gasPrice:l,maxFeePerGas:u,maxPriorityFeePerGas:f,nonce:d,to:p,value:g,...v}=e,y=r?da(r):void 0;try{gw(e);const P=(i?Mt(i):void 0)||s,_=(C=(E=(w=t.chain)==null?void 0:w.formatters)==null?void 0:E.transactionRequest)==null?void 0:C.format,Q=(_||uC)({...oN(v,{format:_}),from:y==null?void 0:y.address,accessList:o,data:a,gas:c,gasPrice:l,maxFeePerGas:u,maxPriorityFeePerGas:f,nonce:d,to:p,value:g});if(n&&zDe({request:Q}))try{return await HDe(t,{...Q,blockNumber:i,blockTag:s})}catch(ne){if(!(ne instanceof jse)&&!(ne instanceof hP))throw ne}const Z=await t.request({method:"eth_call",params:P?[Q,P]:[Q]});return Z==="0x"?{data:void 0}:{data:Z}}catch(S){const P=qDe(S),{offchainLookup:_,offchainLookupSignature:T}=await uoe(()=>import("./ccip-a862e884.js"),[],import.meta.url);if((P==null?void 0:P.slice(0,10))===T&&p)return{data:await _(t,{data:P,to:p})};throw UDe(S,{...e,account:y,chain:t.chain})}}function zDe({request:t}){const{data:e,to:r,...n}=t;return!(!e||e.startsWith(jDe)||!r||Object.values(n).filter(i=>typeof i<"u").length>0)}async function HDe(t,e){var v;const{batchSize:r=1024,wait:n=0}=typeof((v=t.batch)==null?void 0:v.multicall)=="object"?t.batch.multicall:{},{blockNumber:i,blockTag:s="latest",data:o,multicallAddress:a,to:c}=e;let l=a;if(!l){if(!t.chain)throw new jse;l=Hm({blockNumber:i,chain:t.chain,contract:"multicall3"})}const f=(i?Mt(i):void 0)||s,{schedule:d}=foe({id:`${t.uid}.${f}`,wait:n,shouldSplitBatch(y){return y.reduce((w,{data:E})=>w+(E.length-2),0)>r*2},fn:async y=>{const b=y.map(C=>({allowFailure:!0,callData:C.data,target:C.to})),w=bh({abi:_P,args:[b],functionName:"aggregate3"}),E=await t.request({method:"eth_call",params:[{data:w,to:l},f]});return zm({abi:_P,args:[b],functionName:"aggregate3",data:E||"0x"})}}),[{returnData:p,success:g}]=await d({data:o,to:c});if(!g)throw new gN({data:p});return p==="0x"?{data:void 0}:{data:p}}function qDe(t){if(!(t instanceof Ue))return;const e=t.walk();return typeof e.data=="object"?e.data.data:e.data}async function eh(t,e){const{abi:r,address:n,args:i,functionName:s,...o}=e,a=bh({abi:r,args:i,functionName:s});try{const{data:c}=await Rt(t,pC,"call")({...o,data:a,to:n});return zm({abi:r,args:i,functionName:s,data:c||"0x"})}catch(c){throw b2(c,{abi:r,address:n,args:i,docsPath:"/docs/contract/readContract",functionName:s})}}async function WDe(t,{blockNumber:e,blockTag:r,coinType:n,name:i,gatewayUrls:s,strict:o,universalResolverAddress:a}){let c=a;if(!c){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");c=Hm({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const l=bh({abi:pH,functionName:"addr",...n!=null?{args:[hE(i),BigInt(n)]}:{args:[hE(i)]}}),u={address:c,abi:Zse,functionName:"resolve",args:[Rf(hC(i)),l],blockNumber:e,blockTag:r},f=Rt(t,eh,"readContract"),d=s?await f({...u,args:[...u.args,s]}):await f(u);if(d[0]==="0x")return null;const p=zm({abi:pH,args:n!=null?[hE(i),BigInt(n)]:void 0,functionName:"addr",data:d[0]});return p==="0x"||Ld(p)==="0x00"?null:p}catch(l){if(o)throw l;if(mN(l,"resolve"))return null;throw l}}class VDe extends Ue{constructor({data:e}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidMetadataError"})}}class ty extends Ue{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidNftUriError"})}}class vN extends Ue{constructor({uri:e}){super(`Unable to resolve ENS avatar URI "${e}". The URI may be malformed, invalid, or does not respond with a valid image.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUriResolutionError"})}}class GDe extends Ue{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUnsupportedNamespaceError"})}}const KDe=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,JDe=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?[\w\-.]+))?(?\/.*)?$/,QDe=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,YDe=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function ZDe(t){try{const e=await fetch(t,{method:"HEAD"});if(e.status===200){const r=e.headers.get("content-type");return r==null?void 0:r.startsWith("image/")}return!1}catch(e){return typeof e=="object"&&typeof e.response<"u"||!globalThis.hasOwnProperty("Image")?!1:new Promise(r=>{const n=new Image;n.onload=()=>{r(!0)},n.onerror=()=>{r(!1)},n.src=t})}}function _H(t,e){return t?t.endsWith("/")?t.slice(0,-1):t:e}function doe({uri:t,gatewayUrls:e}){const r=QDe.test(t);if(r)return{uri:t,isOnChain:!0,isEncoded:r};const n=_H(e==null?void 0:e.ipfs,"https://ipfs.io"),i=_H(e==null?void 0:e.arweave,"https://arweave.net"),s=t.match(KDe),{protocol:o,subpath:a,target:c,subtarget:l=""}=(s==null?void 0:s.groups)||{},u=o==="ipns:/"||a==="ipns/",f=o==="ipfs:/"||a==="ipfs/"||JDe.test(t);if(t.startsWith("http")&&!u&&!f){let p=t;return e!=null&&e.arweave&&(p=t.replace(/https:\/\/arweave.net/g,e==null?void 0:e.arweave)),{uri:p,isOnChain:!1,isEncoded:!1}}if((u||f)&&c)return{uri:`${n}/${u?"ipns":"ipfs"}/${c}${l}`,isOnChain:!1,isEncoded:!1};if(o==="ar:/"&&c)return{uri:`${i}/${c}${l||""}`,isOnChain:!1,isEncoded:!1};let d=t.replace(YDe,"");if(d.startsWith("i.json());return await yN({gatewayUrls:t,uri:hoe(r)})}catch{throw new vN({uri:e})}}async function yN({gatewayUrls:t,uri:e}){const{uri:r,isOnChain:n}=doe({uri:e,gatewayUrls:t});if(n||await ZDe(r))return r;throw new vN({uri:e})}function eLe(t){let e=t;e.startsWith("did:nft:")&&(e=e.replace("did:nft:","").replace(/_/g,"/"));const[r,n,i]=e.split("/"),[s,o]=r.split(":"),[a,c]=n.split(":");if(!s||s.toLowerCase()!=="eip155")throw new ty({reason:"Only EIP-155 supported"});if(!o)throw new ty({reason:"Chain ID not found"});if(!c)throw new ty({reason:"Contract address not found"});if(!i)throw new ty({reason:"Token ID not found"});if(!a)throw new ty({reason:"ERC namespace not found"});return{chainID:parseInt(o),namespace:a.toLowerCase(),contractAddress:c,tokenID:i}}async function tLe(t,{nft:e}){if(e.namespace==="erc721")return eh(t,{address:e.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(e.tokenID)]});if(e.namespace==="erc1155")return eh(t,{address:e.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(e.tokenID)]});throw new GDe({namespace:e.namespace})}async function rLe(t,{gatewayUrls:e,record:r}){return/eip155:/i.test(r)?nLe(t,{gatewayUrls:e,record:r}):yN({uri:r,gatewayUrls:e})}async function nLe(t,{gatewayUrls:e,record:r}){const n=eLe(r),i=await tLe(t,{nft:n}),{uri:s,isOnChain:o,isEncoded:a}=doe({uri:i,gatewayUrls:e});if(o&&(s.includes("data:application/json;base64,")||s.startsWith("{"))){const l=a?atob(s.replace("data:application/json;base64,","")):s,u=JSON.parse(l);return yN({uri:hoe(u),gatewayUrls:e})}let c=n.tokenID;return n.namespace==="erc1155"&&(c=c.replace("0x","").padStart(64,"0")),XDe({gatewayUrls:e,uri:s.replace(/(?:0x)?{id}/,c)})}async function poe(t,{blockNumber:e,blockTag:r,name:n,key:i,gatewayUrls:s,strict:o,universalResolverAddress:a}){let c=a;if(!c){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");c=Hm({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const l={address:c,abi:Zse,functionName:"resolve",args:[Rf(hC(n)),bh({abi:hH,functionName:"text",args:[hE(n),i]})],blockNumber:e,blockTag:r},u=Rt(t,eh,"readContract"),f=s?await u({...l,args:[...l.args,s]}):await u(l);if(f[0]==="0x")return null;const d=zm({abi:hH,functionName:"text",data:f[0]});return d===""?null:d}catch(l){if(o)throw l;if(mN(l,"resolve"))return null;throw l}}async function iLe(t,{blockNumber:e,blockTag:r,assetGatewayUrls:n,name:i,gatewayUrls:s,strict:o,universalResolverAddress:a}){const c=await Rt(t,poe,"getEnsText")({blockNumber:e,blockTag:r,key:"avatar",name:i,universalResolverAddress:a,gatewayUrls:s,strict:o});if(!c)return null;try{return await rLe(t,{record:c,gatewayUrls:n})}catch{return null}}async function sLe(t,{address:e,blockNumber:r,blockTag:n,gatewayUrls:i,strict:s,universalResolverAddress:o}){let a=o;if(!a){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");a=Hm({blockNumber:r,chain:t.chain,contract:"ensUniversalResolver"})}const c=`${e.toLowerCase().substring(2)}.addr.reverse`;try{const l={address:a,abi:VMe,functionName:"reverse",args:[Rf(hC(c))],blockNumber:r,blockTag:n},u=Rt(t,eh,"readContract"),[f,d]=i?await u({...l,args:[...l.args,i]}):await u(l);return e.toLowerCase()!==d.toLowerCase()?null:f}catch(l){if(s)throw l;if(mN(l,"reverse"))return null;throw l}}async function oLe(t,{blockNumber:e,blockTag:r,name:n,universalResolverAddress:i}){let s=i;if(!s){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");s=Hm({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}const[o]=await Rt(t,eh,"readContract")({address:s,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[Rf(hC(n))],blockNumber:e,blockTag:r});return o}function gC(t,{method:e}){var n,i;const r={};return t.transport.type==="fallback"&&((i=(n=t.transport).onResponse)==null||i.call(n,({method:s,response:o,status:a,transport:c})=>{a==="success"&&e===s&&(r[o]=c.request)})),s=>r[s]||t.request}async function aLe(t){const e=gC(t,{method:"eth_newBlockFilter"}),r=await t.request({method:"eth_newBlockFilter"});return{id:r,request:e(r),type:"block"}}class cLe extends Ue{constructor(e){super(`Filter type "${e}" is not supported.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FilterTypeNotSupportedError"})}}const CH="/docs/contract/encodeEventTopics";function vw(t){var c;const{abi:e,eventName:r,args:n}=t;let i=e[0];if(r){const l=mw({abi:e,name:r});if(!l)throw new fH(r,{docsPath:CH});i=l}if(i.type!=="event")throw new fH(void 0,{docsPath:CH});const s=lf(i),o=hN(s);let a=[];if(n&&"inputs"in i){const l=(c=i.inputs)==null?void 0:c.filter(f=>"indexed"in f&&f.indexed),u=Array.isArray(n)?n:Object.values(n).length>0?(l==null?void 0:l.map(f=>n[f.name]))??[]:[];u.length>0&&(a=(l==null?void 0:l.map((f,d)=>Array.isArray(u[d])?u[d].map((p,g)=>SH({param:f,value:u[d][g]})):u[d]?SH({param:f,value:u[d]}):null))??[])}return[o,...a]}function SH({param:t,value:e}){if(t.type==="string"||t.type==="bytes")return _o(e1(e));if(t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/))throw new cLe(t.type);return hw([t],[e])}async function goe(t,e){const{address:r,abi:n,args:i,eventName:s,fromBlock:o,strict:a,toBlock:c}=e,l=gC(t,{method:"eth_newFilter"}),u=s?vw({abi:n,args:i,eventName:s}):void 0,f=await t.request({method:"eth_newFilter",params:[{address:r,fromBlock:typeof o=="bigint"?Mt(o):o,toBlock:typeof c=="bigint"?Mt(c):c,topics:u}]});return{abi:n,args:i,eventName:s,id:f,request:l(f),strict:!!a,type:"event"}}async function moe(t,{address:e,args:r,event:n,events:i,fromBlock:s,strict:o,toBlock:a}={}){const c=i??(n?[n]:void 0),l=gC(t,{method:"eth_newFilter"});let u=[];c&&(u=[c.flatMap(d=>vw({abi:[d],eventName:d.name,args:r}))],n&&(u=u[0]));const f=await t.request({method:"eth_newFilter",params:[{address:e,fromBlock:typeof s=="bigint"?Mt(s):s,toBlock:typeof a=="bigint"?Mt(a):a,...u.length?{topics:u}:{}}]});return{abi:c,args:r,eventName:n?n.name:void 0,fromBlock:s,id:f,request:l(f),strict:!!o,toBlock:a,type:"event"}}async function voe(t){const e=gC(t,{method:"eth_newPendingTransactionFilter"}),r=await t.request({method:"eth_newPendingTransactionFilter"});return{id:r,request:e(r),type:"transaction"}}async function lLe(t,e){const{abi:r,address:n,args:i,functionName:s,...o}=e,a=bh({abi:r,args:i,functionName:s});try{return await Rt(t,lN,"estimateGas")({data:a,to:n,...o})}catch(c){const l=o.account?da(o.account):void 0;throw b2(c,{abi:r,address:n,args:i,docsPath:"/docs/contract/estimateContractGas",functionName:s,sender:l==null?void 0:l.address})}}async function uLe(t,{address:e,blockNumber:r,blockTag:n="latest"}){const i=r?Mt(r):void 0,s=await t.request({method:"eth_getBalance",params:[e,i||n]});return BigInt(s)}const fLe=new Map,dLe=new Map;function hLe(t){const e=(i,s)=>({clear:()=>s.delete(i),get:()=>s.get(i),set:o=>s.set(i,o)}),r=e(t,fLe),n=e(t,dLe);return{clear:()=>{r.clear(),n.clear()},promise:r,response:n}}async function pLe(t,{cacheKey:e,cacheTime:r=1/0}){const n=hLe(e),i=n.response.get();if(i&&r>0&&new Date().getTime()-i.created.getTime()`blockNumber.${t}`;async function yw(t,{cacheTime:e=t.cacheTime}={}){const r=await pLe(()=>t.request({method:"eth_blockNumber"}),{cacheKey:gLe(t.uid),cacheTime:e});return BigInt(r)}async function mLe(t,{blockHash:e,blockNumber:r,blockTag:n="latest"}={}){const i=r!==void 0?Mt(r):void 0;let s;return e?s=await t.request({method:"eth_getBlockTransactionCountByHash",params:[e]}):s=await t.request({method:"eth_getBlockTransactionCountByNumber",params:[i||n]}),cf(s)}async function vLe(t,{address:e,blockNumber:r,blockTag:n="latest"}){const i=r!==void 0?Mt(r):void 0,s=await t.request({method:"eth_getCode",params:[e,i||n]});if(s!=="0x")return s}const AH="/docs/contract/decodeEventLog";function bN(t){const{abi:e,data:r,strict:n,topics:i}=t,s=n??!0,[o,...a]=i;if(!o)throw new aMe({docsPath:AH});const c=e.find(v=>v.type==="event"&&o===hN(lf(v)));if(!(c&&"name"in c)||c.type!=="event")throw new Mse(o,{docsPath:AH});const{name:l,inputs:u}=c,f=u==null?void 0:u.some(v=>!("name"in v&&v.name));let d=f?[]:{};const p=u.filter(v=>"indexed"in v&&v.indexed);for(let v=0;v!("indexed"in v&&v.indexed));if(g.length>0){if(r&&r!=="0x")try{const v=dC(g,r);if(v)if(f)d=[...d,...v];else for(let y=0;y0?d:void 0}}function yLe({param:t,value:e}){return t.type==="string"||t.type==="bytes"||t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/)?e:(dC([t],e)||[])[0]}async function bLe(t,e){const{abi:r,address:n,args:i,dataSuffix:s,functionName:o,...a}=e,c=a.account?da(a.account):t.account,l=bh({abi:r,args:i,functionName:o});try{const{data:u}=await Rt(t,pC,"call")({batch:!1,data:`${l}${s?s.replace("0x",""):""}`,to:n,...a,account:c}),f=zm({abi:r,args:i,functionName:o,data:u||"0x"}),d=r.filter(p=>"name"in p&&p.name===e.functionName);return{result:f,request:{abi:d,address:n,args:i,dataSuffix:s,functionName:o,...a,account:c}}}catch(u){throw b2(u,{abi:r,address:n,args:i,docsPath:"/docs/contract/simulateContract",functionName:o,sender:c==null?void 0:c.address})}}function th(t,{args:e,eventName:r}={}){return{...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,logIndex:t.logIndex?Number(t.logIndex):null,transactionHash:t.transactionHash?t.transactionHash:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,...r?{args:e,eventName:r}:{}}}const _9=new Map,kH=new Map;let wLe=0;function qm(t,e,r){const n=++wLe,i=()=>_9.get(t)||[],s=()=>{const u=i();_9.set(t,u.filter(f=>f.id!==n))},o=()=>{const u=kH.get(t);i().length===1&&u&&u(),s()},a=i();if(_9.set(t,[...a,{id:n,fns:e}]),a&&a.length>0)return o;const c={};for(const u in e)c[u]=(...f)=>{var p,g;const d=i();if(d.length!==0)for(const v of d)(g=(p=v.fns)[u])==null||g.call(p,...f)};const l=r(c);return typeof l=="function"&&kH.set(t,l),o}async function IP(t){return new Promise(e=>setTimeout(e,t))}function bw(t,{emitOnBegin:e,initialWaitTime:r,interval:n}){let i=!0;const s=()=>i=!1;return(async()=>{let a;e&&(a=await t({unpoll:s}));const c=await(r==null?void 0:r(a))??n;await IP(c);const l=async()=>{i&&(await t({unpoll:s}),await IP(n),l())};l()})(),s}async function mC(t,{filter:e}){const r="strict"in e&&e.strict,n=await e.request({method:"eth_getFilterChanges",params:[e.id]});if(typeof n[0]=="string")return n;const i=n.map(s=>th(s));return!("abi"in e)||!e.abi?i:xN({abi:e.abi,logs:i,strict:r})}async function vC(t,{filter:e}){return e.request({method:"eth_uninstallFilter",params:[e.id]})}function xLe(t,e){const{abi:r,address:n,args:i,batch:s=!0,eventName:o,onError:a,onLogs:c,poll:l,pollingInterval:u=t.pollingInterval,strict:f}=e;return(typeof l<"u"?l:t.transport.type!=="webSocket")?(()=>{const v=Ro(["watchContractEvent",n,i,s,t.uid,o,u]),y=f??!1;return qm(v,{onLogs:c,onError:a},b=>{let w,E,C=!1;const S=bw(async()=>{var P;if(!C){try{E=await Rt(t,goe,"createContractEventFilter")({abi:r,address:n,args:i,eventName:o,strict:y})}catch{}C=!0;return}try{let _;if(E)_=await Rt(t,mC,"getFilterChanges")({filter:E});else{const T=await Rt(t,yw,"getBlockNumber")({});w&&w!==T?_=await Rt(t,Ooe,"getContractEvents")({abi:r,address:n,args:i,eventName:o,fromBlock:w+1n,toBlock:T,strict:y}):_=[],w=T}if(_.length===0)return;if(s)b.onLogs(_);else for(const T of _)b.onLogs([T])}catch(_){E&&_ instanceof r1&&(C=!1),(P=b.onError)==null||P.call(b,_)}},{emitOnBegin:!0,interval:u});return async()=>{E&&await Rt(t,vC,"uninstallFilter")({filter:E}),S()}})})():(()=>{let v=!0,y=()=>v=!1;return(async()=>{try{const b=o?vw({abi:r,eventName:o,args:i}):[],{unsubscribe:w}=await t.transport.subscribe({params:["logs",{address:n,topics:b}],onData(E){var S;if(!v)return;const C=E.result;try{const{eventName:P,args:_}=bN({abi:r,data:C.data,topics:C.topics,strict:f}),T=th(C,{args:_,eventName:P});c([T])}catch(P){let _,T;if(P instanceof n2||P instanceof aC){if(f)return;_=P.abiItem.name,T=(S=P.abiItem.inputs)==null?void 0:S.some(Z=>!("name"in Z&&Z.name))}const Q=th(C,{args:T?[]:{},eventName:_});c([Q])}},onError(E){a==null||a(E)}});y=w,v||y()}catch(b){a==null||a(b)}})(),y})()}async function ELe(t,e){const{abi:r,address:n,args:i,dataSuffix:s,functionName:o,...a}=e,c=bh({abi:r,args:i,functionName:o});return Rt(t,fN,"sendTransaction")({data:`${c}${s?s.replace("0x",""):""}`,to:n,...a})}const PP=256;let Y5=PP,Z5;function _Le(t=11){if(!Z5||Y5+t>PP*2){Z5="",Y5=0;for(let e=0;e{const b=y(v);for(const E in p)delete b[E];const w={...v,...b};return Object.assign(w,{extend:g(w)})}}return Object.assign(p,{extend:g(p)})}function i_(t,{delay:e=100,retryCount:r=2,shouldRetry:n=()=>!0}={}){return new Promise((i,s)=>{const o=async({count:a=0}={})=>{const c=async({error:l})=>{const u=typeof e=="function"?e({count:a,error:l}):e;u&&await IP(u),o({count:a+1})};try{const l=await t();i(l)}catch(l){if(a{const{retryDelay:i=150,retryCount:s=3}={...e,...n};return i_(async()=>{try{return await t(r)}catch(o){const a=o;switch(a.code){case s2.code:throw new s2(a);case o2.code:throw new o2(a);case a2.code:throw new a2(a);case c2.code:throw new c2(a);case t1.code:throw new t1(a);case r1.code:throw new r1(a);case l2.code:throw new l2(a);case Bd.code:throw new Bd(a);case u2.code:throw new u2(a);case f2.code:throw new f2(a);case sm.code:throw new sm(a);case d2.code:throw new d2(a);case en.code:throw new en(a);case h2.code:throw new h2(a);case p2.code:throw new p2(a);case g2.code:throw new g2(a);case m2.code:throw new m2(a);case Xa.code:throw new Xa(a);case 5e3:throw new en(a);default:throw o instanceof Ue?o:new MMe(a)}}},{delay:({count:o,error:a})=>{var c;if(a&&a instanceof lb){const l=(c=a==null?void 0:a.headers)==null?void 0:c.get("Retry-After");if(l!=null&&l.match(/\d/))return parseInt(l)*1e3}return~~(1<SLe(o)})}}function SLe(t){return"code"in t&&typeof t.code=="number"?t.code===-1||t.code===sm.code||t.code===t1.code:t instanceof lb&&t.status?t.status===403||t.status===408||t.status===413||t.status===429||t.status===500||t.status===502||t.status===503||t.status===504:!0}function boe({key:t,name:e,request:r,retryCount:n=3,retryDelay:i=150,timeout:s,type:o},a){return{config:{key:t,name:e,request:r,retryCount:n,retryDelay:i,timeout:s,type:o},request:CLe(r,{retryCount:n,retryDelay:i}),value:a}}function woe(t,e={}){const{key:r="custom",name:n="Custom Provider",retryDelay:i}=e;return({retryCount:s})=>boe({key:r,name:n,request:t.request.bind(t),retryCount:e.retryCount??s,retryDelay:i,type:"custom"})}class ALe extends Ue{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro"})}}function xoe(t,{errorInstance:e=new Error("timed out"),timeout:r,signal:n}){return new Promise((i,s)=>{(async()=>{let o;try{const a=new AbortController;r>0&&(o=setTimeout(()=>{n?a.abort():s(e)},r)),i(await t({signal:a==null?void 0:a.signal}))}catch(a){a.name==="AbortError"&&s(e),s(a)}finally{clearTimeout(o)}})()})}function kLe(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const IH=kLe();function Eoe(t,e={}){return{async request(r){var l;const{body:n,fetchOptions:i={},timeout:s=e.timeout??1e4}=r,{headers:o,method:a,signal:c}={...e.fetchOptions,...i};try{const u=await xoe(async({signal:d})=>await fetch(t,{...i,body:Array.isArray(n)?Ro(n.map(g=>({jsonrpc:"2.0",id:g.id??IH.take(),...g}))):Ro({jsonrpc:"2.0",id:n.id??IH.take(),...n}),headers:{...o,"Content-Type":"application/json"},method:a||"POST",signal:c||(s>0?d:void 0)}),{errorInstance:new dH({body:n,url:t}),timeout:s,signal:!0});let f;if((l=u.headers.get("Content-Type"))!=null&&l.startsWith("application/json")?f=await u.json():f=await u.text(),!u.ok)throw new lb({body:n,details:Ro(f.error)||u.statusText,headers:u.headers,status:u.status,url:t});return f}catch(u){throw u instanceof lb||u instanceof dH?u:new lb({body:n,details:u.message,url:t})}}}}function ILe(t,e={}){const{batch:r,fetchOptions:n,key:i="http",name:s="HTTP JSON-RPC",retryDelay:o}=e;return({chain:a,retryCount:c,timeout:l})=>{const{batchSize:u=1e3,wait:f=0}=typeof r=="object"?r:{},d=e.retryCount??c,p=l??e.timeout??1e4,g=t||(a==null?void 0:a.rpcUrls.default.http[0]);if(!g)throw new ALe;const v=Eoe(g,{fetchOptions:n,timeout:p});return boe({key:i,name:s,async request({method:y,params:b}){const w={method:y,params:b},{schedule:E}=foe({id:`${t}`,wait:f,shouldSplitBatch(_){return _.length>u},fn:_=>v.request({body:_}),sort:(_,T)=>_.id-T.id}),C=async _=>r?E(_):[await v.request({body:_})],[{error:S,result:P}]=await C(w);if(S)throw new iN({body:w,error:S,url:g});return P},retryCount:d,retryDelay:o,timeout:p,type:"http"},{fetchOptions:n,url:g})}}function PLe(t){var e;return{baseFeePerGas:t.baseFeePerGas.map(r=>BigInt(r)),gasUsedRatio:t.gasUsedRatio,oldestBlock:BigInt(t.oldestBlock),reward:(e=t.reward)==null?void 0:e.map(r=>r.map(n=>BigInt(n)))}}async function RLe(t,{blockCount:e,blockNumber:r,blockTag:n="latest",rewardPercentiles:i}){const s=r?Mt(r):void 0,o=await t.request({method:"eth_feeHistory",params:[Mt(e),s||n,i]});return PLe(o)}async function TLe(t,{filter:e}){const r=e.strict??!1,i=(await e.request({method:"eth_getFilterLogs",params:[e.id]})).map(s=>th(s));return e.abi?xN({abi:e.abi,logs:i,strict:r}):i}function _oe(t){return{formatters:void 0,fees:void 0,serializers:void 0,...t}}const OLe=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,$Le=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function NLe(t,{body:e,onError:r,onResponse:n}){return t.request({body:e,onError:r,onResponse:n}),t}async function MLe(t,{body:e,timeout:r=1e4}){return t.requestAsync({body:e,timeout:r})}const DLe={http(t,e){return Eoe(t).request(e)},webSocket:NLe,webSocketAsync:MLe};function LLe(t){const{domain:e={},message:r,primaryType:n}=t,i={EIP712Domain:Poe({domain:e}),...t.types};Ioe({domain:e,message:r,primaryType:n,types:i});const s=["0x1901"];return e&&s.push(BLe({domain:e,types:i})),n!=="EIP712Domain"&&s.push(Coe({data:r,primaryType:n,types:i})),_o(uf(s))}function BLe({domain:t,types:e}){return Coe({data:t,primaryType:"EIP712Domain",types:e})}function Coe({data:t,primaryType:e,types:r}){const n=Soe({data:t,primaryType:e,types:r});return _o(n)}function Soe({data:t,primaryType:e,types:r}){const n=[{type:"bytes32"}],i=[FLe({primaryType:e,types:r})];for(const s of r[e]){const[o,a]=koe({types:r,name:s.name,type:s.type,value:t[s.name]});n.push(o),i.push(a)}return hw(n,i)}function FLe({primaryType:t,types:e}){const r=Rf(jLe({primaryType:t,types:e}));return _o(r)}function jLe({primaryType:t,types:e}){let r="";const n=Aoe({primaryType:t,types:e});n.delete(t);const i=[t,...Array.from(n).sort()];for(const s of i)r+=`${s}(${e[s].map(({name:o,type:a})=>`${a} ${o}`).join(",")})`;return r}function Aoe({primaryType:t,types:e},r=new Set){const n=t.match(/^\w*/u),i=n==null?void 0:n[0];if(r.has(i)||e[i]===void 0)return r;r.add(i);for(const s of e[i])Aoe({primaryType:s.type,types:e},r);return r}function koe({types:t,name:e,type:r,value:n}){if(t[r]!==void 0)return[{type:"bytes32"},_o(Soe({data:n,primaryType:r,types:t}))];if(r==="bytes")return n=`0x${(n.length%2?"0":"")+n.slice(2)}`,[{type:"bytes32"},_o(n)];if(r==="string")return[{type:"bytes32"},_o(Rf(n))];if(r.lastIndexOf("]")===r.length-1){const i=r.slice(0,r.lastIndexOf("[")),s=n.map(o=>koe({name:e,type:i,types:t,value:o}));return[{type:"bytes32"},_o(hw(s.map(([o])=>o),s.map(([,o])=>o)))]}return[{type:r},n]}function Ioe(t){const{domain:e,message:r,primaryType:n,types:i}=t,s=(o,a)=>{for(const c of o){const{name:l,type:u}=c,f=a[l],d=u.match($Le);if(d&&(typeof f=="number"||typeof f=="bigint")){const[v,y,b]=d;Mt(f,{signed:y==="int",size:parseInt(b)/8})}if(u==="address"&&typeof f=="string"&&!Zd(f))throw new i2({address:f});const p=u.match(OLe);if(p){const[v,y]=p;if(y&&_i(f)!==parseInt(y))throw new uMe({expectedSize:parseInt(y),givenSize:_i(f)})}const g=i[u];g&&s(g,f)}};if(i.EIP712Domain&&e&&s(i.EIP712Domain,e),n!=="EIP712Domain"){const o=i[n];s(o,r)}}function Poe({domain:t}){return[typeof(t==null?void 0:t.name)=="string"&&{name:"name",type:"string"},(t==null?void 0:t.version)&&{name:"version",type:"string"},typeof(t==null?void 0:t.chainId)=="number"&&{name:"chainId",type:"uint256"},(t==null?void 0:t.verifyingContract)&&{name:"verifyingContract",type:"address"},(t==null?void 0:t.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}const ULe={"0x0":"reverted","0x1":"success"};function zLe(t){return{...t,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,contractAddress:t.contractAddress?t.contractAddress:null,cumulativeGasUsed:t.cumulativeGasUsed?BigInt(t.cumulativeGasUsed):null,effectiveGasPrice:t.effectiveGasPrice?BigInt(t.effectiveGasPrice):null,gasUsed:t.gasUsed?BigInt(t.gasUsed):null,logs:t.logs?t.logs.map(e=>th(e)):null,to:t.to?t.to:null,transactionIndex:t.transactionIndex?cf(t.transactionIndex):null,status:t.status?ULe[t.status]:null,type:t.type?Vse[t.type]||t.type:null}}const HLe=`Ethereum Signed Message: +`;function qLe(t,e){const r=(()=>typeof t=="string"?Vu(t):t.raw instanceof Uint8Array?t.raw:e1(t.raw))(),n=Vu(`${HLe}${r.length}`);return _o(uf([n,r]),e)}function WLe(t){return t.map(e=>({...e,value:BigInt(e.value)}))}function VLe(t){return{...t,balance:t.balance?BigInt(t.balance):void 0,nonce:t.nonce?cf(t.nonce):void 0,storageProof:t.storageProof?WLe(t.storageProof):void 0}}async function GLe(t,{address:e,blockNumber:r,blockTag:n,storageKeys:i}){const s=n??"latest",o=r!==void 0?Mt(r):void 0,a=await t.request({method:"eth_getProof",params:[e,i,o||s]});return VLe(a)}async function KLe(t,{address:e,blockNumber:r,blockTag:n="latest",slot:i}){const s=r!==void 0?Mt(r):void 0;return await t.request({method:"eth_getStorageAt",params:[e,i,s||n]})}async function wN(t,{blockHash:e,blockNumber:r,blockTag:n,hash:i,index:s}){var u,f,d;const o=n||"latest",a=r!==void 0?Mt(r):void 0;let c=null;if(i?c=await t.request({method:"eth_getTransactionByHash",params:[i]}):e?c=await t.request({method:"eth_getTransactionByBlockHashAndIndex",params:[e,Mt(s)]}):(a||o)&&(c=await t.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[a||o,Mt(s)]})),!c)throw new Hse({blockHash:e,blockNumber:r,blockTag:o,hash:i,index:s});return(((d=(f=(u=t.chain)==null?void 0:u.formatters)==null?void 0:f.transaction)==null?void 0:d.format)||Gse)(c)}async function JLe(t,{hash:e,transactionReceipt:r}){const[n,i]=await Promise.all([Rt(t,yw,"getBlockNumber")({}),e?Rt(t,wN,"getBlockNumber")({hash:e}):void 0]),s=(r==null?void 0:r.blockNumber)||(i==null?void 0:i.blockNumber);return s?n-s+1n:0n}async function RP(t,{hash:e}){var i,s,o;const r=await t.request({method:"eth_getTransactionReceipt",params:[e]});if(!r)throw new qse({hash:e});return(((o=(s=(i=t.chain)==null?void 0:i.formatters)==null?void 0:s.transactionReceipt)==null?void 0:o.format)||zLe)(r)}async function QLe(t,e){var v;const{allowFailure:r=!0,batchSize:n,blockNumber:i,blockTag:s,multicallAddress:o}=e,a=e.contracts,c=n??(typeof((v=t.batch)==null?void 0:v.multicall)=="object"&&t.batch.multicall.batchSize||1024);let l=o;if(!l){if(!t.chain)throw new Error("client chain not configured. multicallAddress is required.");l=Hm({blockNumber:i,chain:t.chain,contract:"multicall3"})}const u=[[]];let f=0,d=0;for(let y=0;y0&&d>c&&u[f].length>0&&(f++,d=(S.length-2)/2,u[f]=[]),u[f]=[...u[f],{allowFailure:!0,callData:S,target:w}]}catch(S){const P=b2(S,{abi:b,address:w,args:E,docsPath:"/docs/contract/multicall",functionName:C});if(!r)throw P;u[f]=[...u[f],{allowFailure:!0,callData:"0x",target:w}]}}const p=await Promise.allSettled(u.map(y=>Rt(t,eh,"readContract")({abi:_P,address:l,args:[y],blockNumber:i,blockTag:s,functionName:"aggregate3"}))),g=[];for(let y=0;y{const f=Ro(["watchBlockNumber",t.uid,e,r,o]);return qm(f,{onBlockNumber:n,onError:i},d=>bw(async()=>{var p;try{const g=await Rt(t,yw,"getBlockNumber")({cacheTime:0});if(c){if(g===c)return;if(g-c>1&&r)for(let v=c+1n;vc)&&(d.onBlockNumber(g,c),c=g)}catch(g){(p=d.onError)==null||p.call(d,g)}},{emitOnBegin:e,interval:o}))})():(()=>{let f=!0,d=()=>f=!1;return(async()=>{try{const{unsubscribe:p}=await t.transport.subscribe({params:["newHeads"],onData(g){var y;if(!f)return;const v=dw((y=g.result)==null?void 0:y.number);n(v,c),c=v},onError(g){i==null||i(g)}});d=p,f||d()}catch(p){i==null||i(p)}})(),d})()}async function rBe(t,{confirmations:e=1,hash:r,onReplaced:n,pollingInterval:i=t.pollingInterval,timeout:s}){const o=Ro(["waitForTransactionReceipt",t.uid,r]);let a,c,l,u=!1;return new Promise((f,d)=>{s&&setTimeout(()=>d(new $Me({hash:r})),s);const p=qm(o,{onReplaced:n,resolve:f,reject:d},g=>{const v=Rt(t,Toe,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:i,async onBlockNumber(y){if(u)return;let b=y;const w=E=>{v(),E(),p()};try{if(l){if(e>1&&(!l.blockNumber||b-l.blockNumber+1ng.resolve(l));return}if(a||(u=!0,await i_(async()=>{a=await Rt(t,wN,"getTransaction")({hash:r}),a.blockNumber&&(b=a.blockNumber)},{delay:({count:E})=>~~(1<1&&(!l.blockNumber||b-l.blockNumber+1ng.resolve(l))}catch(E){if(E instanceof Hse||E instanceof qse){if(!a){u=!1;return}try{c=a,u=!0;const C=await i_(()=>Rt(t,Xd,"getBlock")({blockNumber:b,includeTransactions:!0}),{delay:({count:_})=>~~(1<<_)*200,retryCount:6,shouldRetry:({error:_})=>_ instanceof Wse});u=!1;const S=C.transactions.find(({from:_,nonce:T})=>_===c.from&&T===c.nonce);if(!S||(l=await Rt(t,RP,"getTransactionReceipt")({hash:S.hash}),e>1&&(!l.blockNumber||b-l.blockNumber+1n{var _;(_=g.onReplaced)==null||_.call(g,{reason:P,replacedTransaction:c,transaction:S,transactionReceipt:l}),g.resolve(l)})}catch(C){w(()=>g.reject(C))}}else w(()=>g.reject(E))}}})})})}function nBe(t,{blockTag:e="latest",emitMissed:r=!1,emitOnBegin:n=!1,onBlock:i,onError:s,includeTransactions:o,poll:a,pollingInterval:c=t.pollingInterval}){const l=typeof a<"u"?a:t.transport.type!=="webSocket",u=o??!1;let f;return l?(()=>{const g=Ro(["watchBlocks",t.uid,r,n,u,c]);return qm(g,{onBlock:i,onError:s},v=>bw(async()=>{var y;try{const b=await Rt(t,Xd,"getBlock")({blockTag:e,includeTransactions:u});if(b.number&&(f!=null&&f.number)){if(b.number===f.number)return;if(b.number-f.number>1&&r)for(let w=(f==null?void 0:f.number)+1n;wf.number)&&(v.onBlock(b,f),f=b)}catch(b){(y=v.onError)==null||y.call(v,b)}},{emitOnBegin:n,interval:c}))})():(()=>{let g=!0,v=()=>g=!1;return(async()=>{try{const{unsubscribe:y}=await t.transport.subscribe({params:["newHeads"],onData(b){var C,S,P;if(!g)return;const E=(((P=(S=(C=t.chain)==null?void 0:C.formatters)==null?void 0:S.block)==null?void 0:P.format)||Kse)(b.result);i(E,f),f=E},onError(b){s==null||s(b)}});v=y,g||v()}catch(y){s==null||s(y)}})(),v})()}function iBe(t,{address:e,args:r,batch:n=!0,event:i,events:s,onError:o,onLogs:a,poll:c,pollingInterval:l=t.pollingInterval,strict:u}){const f=typeof c<"u"?c:t.transport.type!=="webSocket",d=u??!1;return f?(()=>{const v=Ro(["watchEvent",e,r,n,t.uid,i,l]);return qm(v,{onLogs:a,onError:o},y=>{let b,w,E=!1;const C=bw(async()=>{var S;if(!E){try{w=await Rt(t,moe,"createEventFilter")({address:e,args:r,event:i,events:s,strict:d})}catch{}E=!0;return}try{let P;if(w)P=await Rt(t,mC,"getFilterChanges")({filter:w});else{const _=await Rt(t,yw,"getBlockNumber")({});b&&b!==_?P=await Rt(t,EN,"getLogs")({address:e,args:r,event:i,events:s,fromBlock:b+1n,toBlock:_}):P=[],b=_}if(P.length===0)return;if(n)y.onLogs(P);else for(const _ of P)y.onLogs([_])}catch(P){w&&P instanceof r1&&(E=!1),(S=y.onError)==null||S.call(y,P)}},{emitOnBegin:!0,interval:l});return async()=>{w&&await Rt(t,vC,"uninstallFilter")({filter:w}),C()}})})():(()=>{let v=!0,y=()=>v=!1;return(async()=>{try{const b=s??(i?[i]:void 0);let w=[];b&&(w=[b.flatMap(C=>vw({abi:[C],eventName:C.name,args:r}))],i&&(w=w[0]));const{unsubscribe:E}=await t.transport.subscribe({params:["logs",{address:e,topics:w}],onData(C){var P;if(!v)return;const S=C.result;try{const{eventName:_,args:T}=bN({abi:b??[],data:S.data,topics:S.topics,strict:d}),Q=th(S,{args:T,eventName:_});a([Q])}catch(_){let T,Q;if(_ instanceof n2||_ instanceof aC){if(u)return;T=_.abiItem.name,Q=(P=_.abiItem.inputs)==null?void 0:P.some(ne=>!("name"in ne&&ne.name))}const Z=th(S,{args:Q?[]:{},eventName:T});a([Z])}},onError(C){o==null||o(C)}});y=E,v||y()}catch(b){o==null||o(b)}})(),y})()}function sBe(t,{batch:e=!0,onError:r,onTransactions:n,poll:i,pollingInterval:s=t.pollingInterval}){return(typeof i<"u"?i:t.transport.type!=="webSocket")?(()=>{const l=Ro(["watchPendingTransactions",t.uid,e,s]);return qm(l,{onTransactions:n,onError:r},u=>{let f;const d=bw(async()=>{var p;try{if(!f)try{f=await Rt(t,voe,"createPendingTransactionFilter")({});return}catch(v){throw d(),v}const g=await Rt(t,mC,"getFilterChanges")({filter:f});if(g.length===0)return;if(e)u.onTransactions(g);else for(const v of g)u.onTransactions([v])}catch(g){(p=u.onError)==null||p.call(u,g)}},{emitOnBegin:!0,interval:s});return async()=>{f&&await Rt(t,vC,"uninstallFilter")({filter:f}),d()}})})():(()=>{let l=!0,u=()=>l=!1;return(async()=>{try{const{unsubscribe:f}=await t.transport.subscribe({params:["newPendingTransactions"],onData(d){if(!l)return;const p=d.result;n([p])},onError(d){r==null||r(d)}});u=f,l||u()}catch(f){r==null||r(f)}})(),u})()}function oBe(t){return{call:e=>pC(t,e),createBlockFilter:()=>aLe(t),createContractEventFilter:e=>goe(t,e),createEventFilter:e=>moe(t,e),createPendingTransactionFilter:()=>voe(t),estimateContractGas:e=>lLe(t,e),estimateGas:e=>lN(t,e),getBalance:e=>uLe(t,e),getBlock:e=>Xd(t,e),getBlockNumber:e=>yw(t,e),getBlockTransactionCount:e=>mLe(t,e),getBytecode:e=>vLe(t,e),getChainId:()=>v2(t),getContractEvents:e=>Ooe(t,e),getEnsAddress:e=>WDe(t,e),getEnsAvatar:e=>iLe(t,e),getEnsName:e=>sLe(t,e),getEnsResolver:e=>oLe(t,e),getEnsText:e=>poe(t,e),getFeeHistory:e=>RLe(t,e),estimateFeesPerGas:e=>UMe(t,e),getFilterChanges:e=>mC(t,e),getFilterLogs:e=>TLe(t,e),getGasPrice:()=>cN(t),getLogs:e=>EN(t,e),getProof:e=>GLe(t,e),estimateMaxPriorityFeePerGas:e=>jMe(t,e),getStorageAt:e=>KLe(t,e),getTransaction:e=>wN(t,e),getTransactionConfirmations:e=>JLe(t,e),getTransactionCount:e=>Qse(t,e),getTransactionReceipt:e=>RP(t,e),multicall:e=>QLe(t,e),prepareTransactionRequest:e=>fC(t,e),readContract:e=>eh(t,e),sendRawTransaction:e=>uN(t,e),simulateContract:e=>bLe(t,e),verifyMessage:e=>eBe(t,e),verifyTypedData:e=>tBe(t,e),uninstallFilter:e=>vC(t,e),waitForTransactionReceipt:e=>rBe(t,e),watchBlocks:e=>nBe(t,e),watchBlockNumber:e=>Toe(t,e),watchContractEvent:e=>xLe(t,e),watchEvent:e=>iBe(t,e),watchPendingTransactions:e=>sBe(t,e)}}async function aBe(t){var r;return((r=t.account)==null?void 0:r.type)==="local"?[t.account.address]:(await t.request({method:"eth_accounts"})).map(n=>dN(n))}async function cBe(t){return await t.request({method:"wallet_getPermissions"})}async function lBe(t){return(await t.request({method:"eth_requestAccounts"},{retryCount:0})).map(r=>Co(r))}async function uBe(t,e){return t.request({method:"wallet_requestPermissions",params:[e]},{retryCount:0})}async function fBe(t,{account:e=t.account,message:r}){if(!e)throw new cC({docsPath:"/docs/actions/wallet/signMessage"});const n=da(e);if(n.type==="local")return n.signMessage({message:r});const i=(()=>typeof r=="string"?Z$(r):r.raw instanceof Uint8Array?Rf(r.raw):r.raw)();return t.request({method:"personal_sign",params:[i,n.address]},{retryCount:0})}async function dBe(t,e){var l,u,f,d;const{account:r=t.account,chain:n=t.chain,...i}=e;if(!r)throw new cC({docsPath:"/docs/actions/wallet/signTransaction"});const s=da(r);gw({account:s,...e});const o=await Rt(t,v2,"getChainId")({});n!==null&&Use({currentChainId:o,chain:n});const a=(n==null?void 0:n.formatters)||((l=t.chain)==null?void 0:l.formatters),c=((u=a==null?void 0:a.transactionRequest)==null?void 0:u.format)||uC;return s.type==="local"?s.signTransaction({...i,chainId:o},{serializer:(d=(f=t.chain)==null?void 0:f.serializers)==null?void 0:d.transaction}):await t.request({method:"eth_signTransaction",params:[{...c(i),chainId:Mt(o),from:s.address}]},{retryCount:0})}async function hBe(t,e){const{account:r=t.account,domain:n,message:i,primaryType:s}=e;if(!r)throw new cC({docsPath:"/docs/actions/wallet/signTypedData"});const o=da(r),a={EIP712Domain:Poe({domain:n}),...e.types};if(Ioe({domain:n,message:i,primaryType:s,types:a}),o.type==="local")return o.signTypedData({domain:n,message:i,primaryType:s,types:a});const c=Ro({domain:n??{},message:i,primaryType:s,types:a},(l,u)=>Xl(u)?u.toLowerCase():u);return t.request({method:"eth_signTypedData_v4",params:[o.address,c]},{retryCount:0})}async function pBe(t,{id:e}){await t.request({method:"wallet_switchEthereumChain",params:[{chainId:Mt(e)}]},{retryCount:0})}async function gBe(t,e){return await t.request({method:"wallet_watchAsset",params:e},{retryCount:0})}function PH(t){return{addChain:e=>tMe(t,e),deployContract:e=>WMe(t,e),getAddresses:()=>aBe(t),getChainId:()=>v2(t),getPermissions:()=>cBe(t),prepareTransactionRequest:e=>fC(t,e),requestAddresses:()=>lBe(t),requestPermissions:e=>uBe(t,e),sendRawTransaction:e=>uN(t,e),sendTransaction:e=>fN(t,e),signMessage:e=>fBe(t,e),signTransaction:e=>dBe(t,e),signTypedData:e=>hBe(t,e),switchChain:e=>pBe(t,e),watchAsset:e=>gBe(t,e),writeContract:e=>ELe(t,e)}}function xN({abi:t,eventName:e,logs:r,strict:n=!0}){return r.map(i=>{var s;try{const o=bN({...i,abi:t,strict:n});return e&&!e.includes(o.eventName)?null:{...o,...i}}catch(o){let a,c;if(o instanceof Mse)return null;if(o instanceof n2||o instanceof aC){if(n)return null;a=o.abiItem.name,c=(s=o.abiItem.inputs)==null?void 0:s.some(l=>!("name"in l&&l.name))}return{...i,args:c?[]:{},eventName:a}}}).filter(Boolean)}async function EN(t,{address:e,blockHash:r,fromBlock:n,toBlock:i,event:s,events:o,args:a,strict:c}={}){const l=c??!1,u=o??(s?[s]:void 0);let f=[];u&&(f=[u.flatMap(g=>vw({abi:[g],eventName:g.name,args:a}))],s&&(f=f[0]));let d;r?d=await t.request({method:"eth_getLogs",params:[{address:e,topics:f,blockHash:r}]}):d=await t.request({method:"eth_getLogs",params:[{address:e,topics:f,fromBlock:typeof n=="bigint"?Mt(n):n,toBlock:typeof i=="bigint"?Mt(i):i}]});const p=d.map(g=>th(g));return u?xN({abi:u,logs:p,strict:l}):p}async function Ooe(t,e){const{abi:r,address:n,args:i,blockHash:s,eventName:o,fromBlock:a,toBlock:c,strict:l}=e,u=o?mw({abi:r,name:o}):void 0,f=u?void 0:r.filter(d=>d.type==="event");return Rt(t,EN,"getLogs")({address:n,args:i,blockHash:s,event:u,events:f,fromBlock:a,toBlock:c,strict:l})}function mBe(t){const e=r=>t(r.detail);return window.addEventListener("eip6963:announceProvider",e),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",e)}function vBe(){const t=new Set;let e=[];const r=()=>mBe(i=>{e.some(({info:s})=>s.uuid===i.info.uuid)||(e=[...e,i],t.forEach(s=>s(e,{added:[i]})))});let n=r();return{_listeners(){return t},clear(){t.forEach(i=>i([],{removed:[...e]})),e=[]},destroy(){this.clear(),t.clear(),n()},findProvider({rdns:i}){return e.find(s=>s.info.rdns===i)},getProviders(){return e},reset(){this.clear(),n(),n=r()},subscribe(i,{emitImmediately:s}={}){return t.add(i),s&&i(e,{added:e}),()=>t.delete(i)}}}const yBe=t=>(e,r,n)=>{const i=n.subscribe;return n.subscribe=(o,a,c)=>{let l=o;if(a){const u=(c==null?void 0:c.equalityFn)||Object.is;let f=o(n.getState());l=d=>{const p=o(d);if(!u(f,p)){const g=f;a(f=p,g)}},c!=null&&c.fireImmediately&&a(f,f)}return i(l)},t(e,r,n)},bBe=yBe;function wBe(t,e){let r;try{r=t()}catch{return}return{getItem:i=>{var s;const o=c=>c===null?null:JSON.parse(c,e==null?void 0:e.reviver),a=(s=r.getItem(i))!=null?s:null;return a instanceof Promise?a.then(o):o(a)},setItem:(i,s)=>r.setItem(i,JSON.stringify(s,e==null?void 0:e.replacer)),removeItem:i=>r.removeItem(i)}}const w2=t=>e=>{try{const r=t(e);return r instanceof Promise?r:{then(n){return w2(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return w2(n)(r)}}}},xBe=(t,e)=>(r,n,i)=>{let s={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:y=>y,version:0,merge:(y,b)=>({...b,...y}),...e},o=!1;const a=new Set,c=new Set;let l;try{l=s.getStorage()}catch{}if(!l)return t((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),r(...y)},n,i);const u=w2(s.serialize),f=()=>{const y=s.partialize({...n()});let b;const w=u({state:y,version:s.version}).then(E=>l.setItem(s.name,E)).catch(E=>{b=E});if(b)throw b;return w},d=i.setState;i.setState=(y,b)=>{d(y,b),f()};const p=t((...y)=>{r(...y),f()},n,i);let g;const v=()=>{var y;if(!l)return;o=!1,a.forEach(w=>w(n()));const b=((y=s.onRehydrateStorage)==null?void 0:y.call(s,n()))||void 0;return w2(l.getItem.bind(l))(s.name).then(w=>{if(w)return s.deserialize(w)}).then(w=>{if(w)if(typeof w.version=="number"&&w.version!==s.version){if(s.migrate)return s.migrate(w.state,w.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return w.state}).then(w=>{var E;return g=s.merge(w,(E=n())!=null?E:p),r(g,!0),f()}).then(()=>{b==null||b(g,void 0),o=!0,c.forEach(w=>w(g))}).catch(w=>{b==null||b(void 0,w)})};return i.persist={setOptions:y=>{s={...s,...y},y.getStorage&&(l=y.getStorage())},clearStorage:()=>{l==null||l.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>v(),hasHydrated:()=>o,onHydrate:y=>(a.add(y),()=>{a.delete(y)}),onFinishHydration:y=>(c.add(y),()=>{c.delete(y)})},v(),g||p},EBe=(t,e)=>(r,n,i)=>{let s={storage:wBe(()=>localStorage),partialize:v=>v,version:0,merge:(v,y)=>({...y,...v}),...e},o=!1;const a=new Set,c=new Set;let l=s.storage;if(!l)return t((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),r(...v)},n,i);const u=()=>{const v=s.partialize({...n()});return l.setItem(s.name,{state:v,version:s.version})},f=i.setState;i.setState=(v,y)=>{f(v,y),u()};const d=t((...v)=>{r(...v),u()},n,i);let p;const g=()=>{var v,y;if(!l)return;o=!1,a.forEach(w=>{var E;return w((E=n())!=null?E:d)});const b=((y=s.onRehydrateStorage)==null?void 0:y.call(s,(v=n())!=null?v:d))||void 0;return w2(l.getItem.bind(l))(s.name).then(w=>{if(w)if(typeof w.version=="number"&&w.version!==s.version){if(s.migrate)return s.migrate(w.state,w.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return w.state}).then(w=>{var E;return p=s.merge(w,(E=n())!=null?E:d),r(p,!0),u()}).then(()=>{b==null||b(p,void 0),p=n(),o=!0,c.forEach(w=>w(p))}).catch(w=>{b==null||b(void 0,w)})};return i.persist={setOptions:v=>{s={...s,...v},v.storage&&(l=v.storage)},clearStorage:()=>{l==null||l.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>g(),hasHydrated:()=>o,onHydrate:v=>(a.add(v),()=>{a.delete(v)}),onFinishHydration:v=>(c.add(v),()=>{c.delete(v)})},s.skipHydration||g(),p||d},_Be=(t,e)=>"getStorage"in e||"serialize"in e||"deserialize"in e?xBe(t,e):EBe(t,e),CBe=_Be,RH=t=>{let e;const r=new Set,n=(c,l)=>{const u=typeof c=="function"?c(e):c;if(!Object.is(u,e)){const f=e;e=l??typeof u!="object"?u:Object.assign({},e,u),r.forEach(d=>d(e,f))}},i=()=>e,a={setState:n,getState:i,subscribe:c=>(r.add(c),()=>r.delete(c)),destroy:()=>{r.clear()}};return e=t(n,i,a),a},TH=t=>t?RH(t):RH;var $oe={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(c,l,u){this.fn=c,this.context=l,this.once=u||!1}function s(c,l,u,f,d){if(typeof u!="function")throw new TypeError("The listener must be a function");var p=new i(u,f||c,d),g=r?r+l:l;return c._events[g]?c._events[g].fn?c._events[g]=[c._events[g],p]:c._events[g].push(p):(c._events[g]=p,c._eventsCount++),c}function o(c,l){--c._eventsCount===0?c._events=new n:delete c._events[l]}function a(){this._events=new n,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],u,f;if(this._eventsCount===0)return l;for(f in u=this._events)e.call(u,f)&&l.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(u)):l},a.prototype.listeners=function(l){var u=r?r+l:l,f=this._events[u];if(!f)return[];if(f.fn)return[f.fn];for(var d=0,p=f.length,g=new Array(p);d{let i=n;return(i==null?void 0:i.__type)==="bigint"&&(i=BigInt(i.value)),(i==null?void 0:i.__type)==="Map"&&(i=new Map(i.value)),(e==null?void 0:e(r,i))??i})}function OH(t,e){return t.slice(0,e).join(".")||"."}function $H(t,e){const{length:r}=t;for(let n=0;n{let o=s;return typeof o=="bigint"&&(o={__type:"bigint",value:s.toString()}),o instanceof Map&&(o={__type:"Map",value:Array.from(s.entries())}),(e==null?void 0:e(i,o))??o},n),r??void 0)}function TBe(t){const{deserialize:e=IBe,key:r="wagmi",serialize:n=RBe,storage:i=Moe}=t;function s(o){return o instanceof Promise?o.then(a=>a).catch(()=>null):o}return{...i,key:r,async getItem(o,a){const c=i.getItem(`${r}.${o}`),l=await s(c);return l?e(l)??null:a??null},async setItem(o,a){const c=`${r}.${o}`;a===null?await s(i.removeItem(c)):await s(i.setItem(c,n(a)))},async removeItem(o){await s(i.removeItem(`${r}.${o}`))}}}const Moe={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};const pE="2.6.2",OBe=()=>`@wagmi/core@${pE}`;var Doe=globalThis&&globalThis.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},s_,Loe;let wh=class TP extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return OBe()}constructor(e,r={}){var s;super(),s_.add(this),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiCoreError"});const n=r.cause instanceof TP?r.cause.details:(s=r.cause)!=null&&s.message?r.cause.message:r.details,i=r.cause instanceof TP&&r.cause.docsPath||r.docsPath;this.message=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...i?[`Docs: ${this.docsBaseUrl}${i}.html${r.docsSlug?`#${r.docsSlug}`:""}`]:[],...n?[`Details: ${n}`]:[],`Version: ${this.version}`].join(` +`),r.cause&&(this.cause=r.cause),this.details=n,this.docsPath=i,this.metaMessages=r.metaMessages,this.shortMessage=e}walk(e){return Doe(this,s_,"m",Loe).call(this,this,e)}};s_=new WeakSet,Loe=function t(e,r){return r!=null&&r(e)?e:e.cause?Doe(this,s_,"m",t).call(this,e.cause,r):e};class n1 extends wh{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}class $Be extends wh{constructor(){super("Connector already connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAlreadyConnectedError"})}}class Boe extends wh{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class NBe extends wh{constructor({address:e,connector:r}){super(`Account "${e}" not found for connector "${r.name}".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAccountNotFoundError"})}}class l0 extends wh{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}class MBe extends wh{constructor({connector:e}){super(`"${e.name}" does not support programmatic chain switching.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainNotSupportedError"})}}function Fd(t){if(typeof t=="string")return Number.parseInt(t,t.trim().substring(0,2)==="0x"?16:10);if(typeof t=="bigint")return Number(t);if(typeof t=="number")return t;throw new Error(`Cannot normalize chainId "${t}" of type "${typeof t}"`)}const DBe={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(t){return t!=null&&t.coinbaseWalletExtension?t.coinbaseWalletExtension:gE(t,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(t){return gE(t,e=>{if(!e.isMetaMask||e.isBraveWallet&&!e._events&&!e._state)return!1;const r=["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPortal","isRabby","isTokenPocket","isTokenary","isZerion"];for(const n of r)if(e[n])return!1;return!0})}},phantom:{id:"phantom",name:"Phantom",provider(t){var e,r;return(e=t==null?void 0:t.phantom)!=null&&e.ethereum?(r=t.phantom)==null?void 0:r.ethereum:gE(t,"isPhantom")}}};yC.type="injected";function yC(t={}){const{shimDisconnect:e=!0,unstable_shimAsyncInject:r}=t;function n(){const i=t.target;if(typeof i=="function"){const s=i();if(s)return s}return typeof i=="object"?i:typeof i=="string"?{...DBe[i]??{id:i,name:`${i[0].toUpperCase()}${i.slice(1)}`,provider:`is${i[0].toUpperCase()}${i.slice(1)}`}}:{id:"injected",name:"Injected",provider(s){return s==null?void 0:s.ethereum}}}return i=>({get icon(){return n().icon},get id(){return n().id},get name(){return n().name},type:yC.type,async setup(){const s=await this.getProvider();s&&t.target&&s.on("connect",this.onConnect.bind(this))},async connect({chainId:s,isReconnecting:o}={}){var l,u,f,d,p,g;const a=await this.getProvider();if(!a)throw new l0;let c=null;if(!o&&(c=await this.getAccounts().catch(()=>null),!!(c!=null&&c.length)))try{c=(d=(f=(u=(l=(await a.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0])==null?void 0:l.caveats)==null?void 0:u[0])==null?void 0:f.value)==null?void 0:d.map(b=>Co(b))}catch(y){const b=y;if(b.code===en.code)throw new en(b);if(b.code===Bd.code)throw b}try{c!=null&&c.length||(c=(await a.request({method:"eth_requestAccounts"})).map(b=>Co(b))),a.removeListener("connect",this.onConnect.bind(this)),a.on("accountsChanged",this.onAccountsChanged.bind(this)),a.on("chainChanged",this.onChainChanged),a.on("disconnect",this.onDisconnect.bind(this));let v=await this.getChainId();if(s&&v!==s){const y=await this.switchChain({chainId:s}).catch(b=>{if(b.code===en.code)throw b;return{id:v}});v=(y==null?void 0:y.id)??v}return e&&(await((p=i.storage)==null?void 0:p.removeItem(`${this.id}.disconnected`)),t.target||await((g=i.storage)==null?void 0:g.setItem("injected.connected",!0))),{accounts:c,chainId:v}}catch(v){const y=v;throw y.code===en.code?new en(y):y.code===Bd.code?new Bd(y):y}},async disconnect(){var o,a;const s=await this.getProvider();if(!s)throw new l0;s.removeListener("accountsChanged",this.onAccountsChanged.bind(this)),s.removeListener("chainChanged",this.onChainChanged),s.removeListener("disconnect",this.onDisconnect.bind(this)),s.on("connect",this.onConnect.bind(this)),e&&(await((o=i.storage)==null?void 0:o.setItem(`${this.id}.disconnected`,!0)),t.target||await((a=i.storage)==null?void 0:a.removeItem("injected.connected")))},async getAccounts(){const s=await this.getProvider();if(!s)throw new l0;return(await s.request({method:"eth_accounts"})).map(a=>Co(a))},async getChainId(){const s=await this.getProvider();if(!s)throw new l0;const o=await s.request({method:"eth_chainId"});return Fd(o)},async getProvider(){if(typeof window>"u")return;const s=n();return typeof s.provider=="function"?s.provider(window):typeof s.provider=="string"?gE(window,s.provider):s.provider},async isAuthorized(){var s,o;try{if(e&&await((s=i.storage)==null?void 0:s.getItem(`${this.id}.disconnected`))||!t.target&&!await((o=i.storage)==null?void 0:o.getItem("injected.connected")))return!1;if(!await this.getProvider()){if(r!==void 0&&r!==!1){const u=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",u),!!await this.getProvider()),f=typeof r=="number"?r:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(p=>window.addEventListener("ethereum#initialized",()=>p(u()),{once:!0}))]:[],new Promise(p=>setTimeout(()=>p(u()),f))]))return!0}throw new l0}return!!(await i_(()=>xoe(()=>this.getAccounts(),{timeout:100}))).length}catch{return!1}},async switchChain({chainId:s}){var c,l,u;const o=await this.getProvider();if(!o)throw new l0;const a=i.chains.find(f=>f.id===s);if(!a)throw new Xa(new n1);try{return await Promise.all([o.request({method:"wallet_switchEthereumChain",params:[{chainId:Mt(s)}]}),new Promise(f=>i.emitter.once("change",({chainId:d})=>{d===s&&f()}))]),a}catch(f){const d=f;if(d.code===4902||((l=(c=d==null?void 0:d.data)==null?void 0:c.originalError)==null?void 0:l.code)===4902)try{const{default:p,...g}=a.blockExplorers??{};let v=[];if(p&&(v=[p.url,...Object.values(g).map(b=>b.url)]),await o.request({method:"wallet_addEthereumChain",params:[{chainId:Mt(s),chainName:a.name,nativeCurrency:a.nativeCurrency,rpcUrls:[((u=a.rpcUrls.default)==null?void 0:u.http[0])??""],blockExplorerUrls:v}]}),await this.getChainId()!==s)throw new en(new Error("User rejected switch after adding network."));return a}catch(p){throw new en(p)}throw d.code===en.code?new en(d):new Xa(d)}},async onAccountsChanged(s){var o;if(s.length===0)this.onDisconnect();else if(i.emitter.listenerCount("connect")){const a=(await this.getChainId()).toString();this.onConnect({chainId:a}),e&&await((o=i.storage)==null?void 0:o.removeItem(`${this.id}.disconnected`))}else i.emitter.emit("change",{accounts:s.map(a=>Co(a))})},onChainChanged(s){const o=Fd(s);i.emitter.emit("change",{chainId:o})},async onConnect(s){const o=await this.getAccounts();if(o.length===0)return;const a=Fd(s.chainId);i.emitter.emit("connect",{accounts:o,chainId:a});const c=await this.getProvider();c&&(c.removeListener("connect",this.onConnect.bind(this)),c.on("accountsChanged",this.onAccountsChanged.bind(this)),c.on("chainChanged",this.onChainChanged),c.on("disconnect",this.onDisconnect.bind(this)))},async onDisconnect(s){const o=await this.getProvider();s&&s.code===1013&&o&&(await this.getAccounts()).length||(i.emitter.emit("disconnect"),o&&(o.removeListener("accountsChanged",this.onAccountsChanged.bind(this)),o.removeListener("chainChanged",this.onChainChanged),o.removeListener("disconnect",this.onDisconnect.bind(this)),o.on("connect",this.onConnect.bind(this))))}})}function gE(t,e){function r(i){return typeof e=="function"?e(i):typeof e=="string"?i[e]:!0}const n=t.ethereum;if(n!=null&&n.providers)return n.providers.find(i=>r(i));if(n&&r(n))return n}const OP=256;let X5=OP,e3;function LBe(t=11){if(!e3||X5+t>OP*2){e3="",X5=0;for(let e=0;e[...o.connectors??[],...s?[]:(a==null?void 0:a.getProviders().map(u))??[]].map(l));function l(C){var _;const S=kBe(LBe()),P={...C({emitter:S,chains:e,storage:n}),emitter:S,uid:S.uid};return S.on("connect",w),(_=P.setup)==null||_.call(P),P}function u(C){const{info:S}=C,P=C.provider;return yC({target:{...S,id:S.rdns,provider:P}})}const f=new Map;function d(C={}){const S=C.chainId??y.getState().chainId,P=e.find(T=>T.id===S);if(C.chainId&&!P)throw new n1;{const T=f.get(y.getState().chainId);if(T&&!P)return T;if(!P)throw new n1}{const T=f.get(S);if(T)return T}let _;if(o.client)_=o.client({chain:P});else{const T=P.id,Q={},Z=Object.entries(o);for(const[ne,ce]of Z)ne==="client"||ne==="connectors"||ne==="transports"||(typeof ce=="object"?Q[ne]=ce[T]:Q[ne]=ce);_=yoe({...Q,chain:P,batch:Q.batch??{multicall:!0},transport:ne=>o.transports[T]({...ne,connectors:c})})}return f.set(S,_),_}const p={chainId:e[0].id,connections:new Map,current:void 0,status:"disconnected"};let g;const v="0.0.0-canary-";pE.startsWith(v)?g=parseInt(pE.replace(v,"")):g=parseInt(pE.split(".")[0]??"0");const y=TH(bBe(n?CBe(()=>p,{migrate(C,S){if(S===g)return C;const P=C&&typeof C=="object"&&"chainId"in C&&typeof C.chainId=="number"?C.chainId:p.chainId;return{...p,chainId:P}},name:"store",partialize(C){return{connections:{__type:"Map",value:Array.from(C.connections.entries()).map(([S,P])=>{const{id:_,name:T,type:Q,uid:Z}=P.connector;return[S,{...P,connector:{id:_,name:T,type:Q,uid:Z}}]})},chainId:C.chainId,current:C.current}},skipHydration:s,storage:n,version:g}):()=>p));i&&y.subscribe(({connections:C,current:S})=>{var P;return S?(P=C.get(S))==null?void 0:P.chainId:void 0},C=>{if(e.some(P=>P.id===C))return y.setState(P=>({...P,chainId:C??P.chainId}))}),a==null||a.subscribe(C=>{const S=new Map;for(const _ of c.getState())S.set(_.id,!0);const P=[];for(const _ of C){const T=l(u(_));S.has(T.id)||P.push(T)}c.setState(_=>[..._,...P],!0)});function b(C){y.setState(S=>{const P=S.connections.get(C.uid);return{...S,connections:new Map(S.connections).set(C.uid,{accounts:C.accounts??P.accounts,chainId:C.chainId??P.chainId,connector:P.connector})}})}function w(C){y.getState().status==="connecting"||y.getState().status==="reconnecting"||y.setState(S=>{const P=c.getState().find(_=>_.uid===C.uid);return P?{...S,connections:new Map(S.connections).set(C.uid,{accounts:C.accounts,chainId:C.chainId,connector:P}),current:C.uid,status:"connected"}:S})}function E(C){y.setState(S=>{const P=S.connections.get(C.uid);if(P&&(P.connector.emitter.off("change",b),P.connector.emitter.off("disconnect",E),P.connector.emitter.on("connect",w)),S.connections.delete(C.uid),S.connections.size===0)return{...S,connections:new Map,current:void 0,status:"disconnected"};const _=S.connections.values().next().value;return{...S,connections:new Map(S.connections),current:_.connector.uid}})}return{chains:e,get connectors(){return c.getState()},storage:n,getClient:d,get state(){return y.getState()},setState(C){let S;typeof C=="function"?S=C(y.getState()):S=C,typeof S!="object"&&(S=p),Object.keys(p).some(_=>!(_ in S))&&(S=p),y.setState(S,!0)},subscribe(C,S,P){return y.subscribe(C,S,P?{...P,fireImmediately:P.emitImmediately}:void 0)},_internal:{mipd:a,store:y,ssr:!!s,syncConnectedChain:i,transports:o.transports,connectors:{providerDetailToConnector:u,setup:l,setState:C=>c.setState(typeof C=="function"?C(c.getState()):C,!0),subscribe:C=>c.subscribe(C)},events:{change:b,connect:w,disconnect:E}}}}async function FBe(t,e){var n;let r;if(typeof e.connector=="function"?r=t._internal.connectors.setup(e.connector):r=e.connector,r.uid===t.state.current)throw new $Be;try{t.setState(o=>({...o,status:"connecting"})),r.emitter.emit("message",{type:"connecting"});const i=await r.connect({chainId:e.chainId}),s=i.accounts;return r.emitter.off("connect",t._internal.events.connect),r.emitter.on("change",t._internal.events.change),r.emitter.on("disconnect",t._internal.events.disconnect),await((n=t.storage)==null?void 0:n.setItem("recentConnectorId",r.id)),t.setState(o=>({...o,connections:new Map(o.connections).set(r.uid,{accounts:s,chainId:i.chainId,connector:r}),current:r.uid,status:"connected"})),{accounts:s,chainId:i.chainId}}catch(i){throw t.setState(s=>({...s,status:s.current?"connected":"disconnected"})),i}}async function jBe(t,e={}){var i,s;let r;if(e.connector)r=e.connector;else{const{connections:o,current:a}=t.state,c=o.get(a);r=c==null?void 0:c.connector}const n=t.state.connections;r&&(await r.disconnect(),r.emitter.off("change",t._internal.events.change),r.emitter.off("disconnect",t._internal.events.disconnect),r.emitter.on("connect",t._internal.events.connect),n.delete(r.uid)),t.setState(o=>{if(n.size===0)return{...o,connections:new Map,current:void 0,status:"disconnected"};const a=n.values().next().value;return{...o,connections:new Map(n),current:a.connector.uid}});{const o=t.state.current;if(!o)return;const a=(i=t.state.connections.get(o))==null?void 0:i.connector;if(!a)return;await((s=t.storage)==null?void 0:s.setItem("recentConnectorId",a.id))}}async function UBe(t,e={}){let r;if(e.connector){const{connector:c}=e,[l,u]=await Promise.all([c.getAccounts(),c.getChainId()]);r={accounts:l,chainId:u,connector:c}}else r=t.state.connections.get(t.state.current);if(!r)throw new Boe;const n=e.chainId??r.chainId,i=r.connector;if(i.getClient)return i.getClient({chainId:n});const s=da(e.account??r.accounts[0]),o=t.chains.find(c=>c.id===n),a=await r.connector.getProvider({chainId:n});if(e.account&&!r.accounts.includes(s.address))throw new NBe({address:s.address,connector:i});return yoe({account:s,chain:o,name:"Connector Client",transport:c=>woe(a)({...c,retryCount:0})})}function _N(t){const e=t.state.current,r=t.state.connections.get(e),n=r==null?void 0:r.accounts,i=n==null?void 0:n[0],s=t.chains.find(a=>a.id===(r==null?void 0:r.chainId)),o=t.state.status;switch(o){case"connected":return{address:i,addresses:n,chain:s,chainId:r==null?void 0:r.chainId,connector:r==null?void 0:r.connector,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:o};case"reconnecting":return{address:i,addresses:n,chain:s,chainId:r==null?void 0:r.chainId,connector:r==null?void 0:r.connector,isConnected:!!i,isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:o};case"connecting":return{address:i,addresses:n,chain:s,chainId:r==null?void 0:r.chainId,connector:r==null?void 0:r.connector,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:o};case"disconnected":return{address:void 0,addresses:void 0,chain:void 0,chainId:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:o}}}function NH(t){return t.state.chainId}function zBe(t,e={}){let r;try{r=t.getClient(e)}catch{}return r}function rh(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;let r,n;if(Array.isArray(t)&&Array.isArray(e)){if(r=t.length,r!==e.length)return!1;for(n=r;n--!==0;)if(!rh(t[n],e[n]))return!1;return!0}if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();const i=Object.keys(t);if(r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){const s=i[n];if(s&&!rh(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}let t3=[];function $P(t){const e=[...t.state.connections.values()];return t.state.status==="reconnecting"||rh(t3,e)?t3:(t3=e,e)}let C9=[];function MH(t){const e=t.connectors;return rh(C9,e)?C9:(C9=e,e)}function NP(t,e={}){const r=zBe(t,e);return r==null?void 0:r.extend(oBe)}async function HBe(t,e={}){const r=await UBe(t,e);return r.extend(PH),r.extend(PH)}let S9=!1;async function qBe(t,e={}){var l,u;if(S9)return[];S9=!0,t.setState(f=>({...f,status:f.current?"reconnecting":"connecting"}));const r=[];if((l=e.connectors)!=null&&l.length)for(const f of e.connectors){let d;typeof f=="function"?d=t._internal.connectors.setup(f):d=f,r.push(d)}else r.push(...t.connectors);const n=await((u=t.storage)==null?void 0:u.getItem("recentConnectorId")),i={};for(const[,f]of t.state.connections)i[f.connector.id]=1;n&&(i[n]=0);const s=Object.keys(i).length>0?[...r].sort((f,d)=>(i[f.id]??10)-(i[d.id]??10)):r;let o=!1;const a=[],c=[];for(const f of s){const d=await f.getProvider();if(!d||c.some(v=>v===d)||!await f.isAuthorized())continue;const g=await f.connect({isReconnecting:!0}).catch(()=>null);g&&(f.emitter.off("connect",t._internal.events.connect),f.emitter.on("change",t._internal.events.change),f.emitter.on("disconnect",t._internal.events.disconnect),t.setState(v=>{const y=new Map(o?v.connections:new Map).set(f.uid,{accounts:g.accounts,chainId:g.chainId,connector:f});return{...v,current:o?v.current:f.uid,connections:y}}),a.push({accounts:g.accounts,chainId:g.chainId,connector:f}),c.push(d),o=!0)}return o?t.setState(f=>({...f,status:"connected"})):t.setState(f=>({...f,connections:new Map,current:void 0,status:"disconnected"})),S9=!1,a}async function WBe(t,e){var s;const{chainId:r}=e,n=t.state.connections.get(((s=e.connector)==null?void 0:s.uid)??t.state.current);if(n){const o=n.connector;if(!o.switchChain)throw new MBe({connector:o});return await o.switchChain({chainId:r})}const i=t.chains.find(o=>o.id===r);if(!i)throw new n1;return t.setState(o=>({...o,chainId:r})),i}function Foe(t,e){const{onChange:r}=e;return t.subscribe(()=>_N(t),r,{equalityFn(n,i){const{connector:s,...o}=n,{connector:a,...c}=i;return rh(o,c)&&(s==null?void 0:s.id)===(a==null?void 0:a.id)&&(s==null?void 0:s.uid)===(a==null?void 0:a.uid)}})}function VBe(t,e){const{onChange:r}=e;return t.subscribe(n=>n.chainId,r)}function GBe(t,e){const{onChange:r}=e;return t.subscribe(()=>$P(t),r,{equalityFn:rh})}function KBe(t,e){const{onChange:r}=e;return t._internal.connectors.subscribe((n,i)=>{r(Object.values(n),i)})}function JBe(t,e){const{onChange:r}=e;return t.subscribe(()=>NP(t),r,{equalityFn(n,i){return(n==null?void 0:n.uid)===(i==null?void 0:i.uid)}})}CN.type="mock";function CN(t){const e=t.features??{};let r=!1,n;return i=>({id:"mock",name:"Mock Connector",type:CN.type,async setup(){n=i.chains[0].id},async connect({chainId:s}={}){if(e.connectError)throw typeof e.connectError=="boolean"?new en(new Error("Failed to connect.")):e.connectError;const a=await(await this.getProvider()).request({method:"eth_requestAccounts"});let c=await this.getChainId();return s&&c!==s&&(c=(await this.switchChain({chainId:s})).id),r=!0,{accounts:a,chainId:c}},async disconnect(){r=!1},async getAccounts(){if(!r)throw new Boe;return(await(await this.getProvider()).request({method:"eth_accounts"})).map(a=>Co(a))},async getChainId(){const o=await(await this.getProvider()).request({method:"eth_chainId"});return lH(o,"number")},async isAuthorized(){return!e.reconnect||!r?!1:!!(await this.getAccounts()).length},async switchChain({chainId:s}){const o=await this.getProvider(),a=i.chains.find(c=>c.id===s);if(!a)throw new Xa(new n1);return await o.request({method:"wallet_switchEthereumChain",params:[{chainId:Mt(s)}]}),a},onAccountsChanged(s){s.length===0?this.onDisconnect():i.emitter.emit("change",{accounts:s.map(o=>Co(o))})},onChainChanged(s){const o=Fd(s);i.emitter.emit("change",{chainId:o})},async onDisconnect(s){i.emitter.emit("disconnect"),r=!1},async getProvider({chainId:s}={}){const a=(i.chains.find(l=>l.id===s)??i.chains[0]).rpcUrls.default.http[0];return woe({request:async({method:l,params:u})=>{if(l==="eth_chainId")return Mt(n);if(l==="eth_requestAccounts")return t.accounts;if(l==="eth_signTypedData_v4"&&e.signTypedDataError)throw typeof e.signTypedDataError=="boolean"?new en(new Error("Failed to sign typed data.")):e.signTypedDataError;if(l==="wallet_switchEthereumChain"){if(e.switchChainError)throw typeof e.switchChainError=="boolean"?new en(new Error("Failed to switch chain.")):e.switchChainError;n=lH(u[0].chainId,"number"),this.onChainChanged(n.toString());return}if(l==="personal_sign"){if(e.signMessageError)throw typeof e.signMessageError=="boolean"?new en(new Error("Failed to sign message.")):e.signMessageError;l="eth_sign",u=[u[1],u[0]]}const f={method:l,params:u},{error:d,result:p}=await DLe.http(a,{body:f});if(d)throw new iN({body:f,error:d,url:a});return p}})({retryCount:0})}})}function QBe(t,e){const{initialState:r,reconnectOnMount:n}=e;return r&&t.setState({...r,connections:n?r.connections:new Map,status:n?"reconnecting":"disconnected"}),{async onMount(){var i;if(t._internal.ssr){await t._internal.store.persist.rehydrate();const s=(i=t._internal.mipd)==null?void 0:i.getProviders().map(t._internal.connectors.providerDetailToConnector).map(t._internal.connectors.setup);t._internal.connectors.setState(o=>[...o,...s??[]])}n?qBe(t):t.storage&&t.setState(s=>({...s,connections:new Map}))}}}const YBe=$.createContext(void 0),ZBe="2.5.4",XBe=()=>`wagmi@${ZBe}`;let eFe=class extends wh{constructor(){super(...arguments),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiError"})}get docsBaseUrl(){return"https://wagmi.sh/react"}get version(){return XBe()}},tFe=class extends eFe{constructor(){super("`useConfig` must be used within `WagmiProvider`.",{docsPath:"https://wagmi.sh/react/api/WagmiProvider"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiProviderNotFoundError"})}};function SN(t={}){const e=t.config??$.useContext(YBe);if(!e)throw new tFe;return e}var joe={exports:{}},Uoe={},zoe={exports:{}},Hoe={};/** + * @license React + * use-sync-external-store-shim.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var om=$;function rFe(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var nFe=typeof Object.is=="function"?Object.is:rFe,iFe=om.useState,sFe=om.useEffect,oFe=om.useLayoutEffect,aFe=om.useDebugValue;function cFe(t,e){var r=e(),n=iFe({inst:{value:r,getSnapshot:e}}),i=n[0].inst,s=n[1];return oFe(function(){i.value=r,i.getSnapshot=e,A9(i)&&s({inst:i})},[t,r,e]),sFe(function(){return A9(i)&&s({inst:i}),t(function(){A9(i)&&s({inst:i})})},[t]),aFe(r),r}function A9(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!nFe(t,r)}catch{return!0}}function lFe(t,e){return e()}var uFe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?lFe:cFe;Hoe.useSyncExternalStore=om.useSyncExternalStore!==void 0?om.useSyncExternalStore:uFe;zoe.exports=Hoe;var qoe=zoe.exports;/** + * @license React + * use-sync-external-store-shim/with-selector.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var bC=$,fFe=qoe;function dFe(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var hFe=typeof Object.is=="function"?Object.is:dFe,pFe=fFe.useSyncExternalStore,gFe=bC.useRef,mFe=bC.useEffect,vFe=bC.useMemo,yFe=bC.useDebugValue;Uoe.useSyncExternalStoreWithSelector=function(t,e,r,n,i){var s=gFe(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=vFe(function(){function c(p){if(!l){if(l=!0,u=p,p=n(p),i!==void 0&&o.hasValue){var g=o.value;if(i(g,p))return f=g}return f=p}if(g=f,hFe(u,p))return g;var v=n(p);return i!==void 0&&i(g,v)?g:(u=p,f=v)}var l=!1,u,f,d=r===void 0?null:r;return[function(){return c(e())},d===null?void 0:function(){return c(d())}]},[e,r,n,i]);var a=pFe(t,s[0],s[1]);return mFe(function(){o.hasValue=!0,o.value=a},[a]),yFe(a),a};joe.exports=Uoe;var AN=joe.exports;const k9=t=>typeof t=="object"&&!Array.isArray(t);function bFe(t,e,r=e,n=rh){const i=$.useRef([]),s=AN.useSyncExternalStoreWithSelector(t,e,r,o=>o,(o,a)=>{if(k9(o)&&k9(a)&&i.current.length){for(const c of i.current)if(!n(o[c],a[c]))return!1;return!0}return n(o,a)});if(k9(s)){const o={...s};return Object.defineProperties(o,Object.entries(o).reduce((a,[c,l])=>({...a,[c]:{configurable:!1,enumerable:!0,get:()=>(i.current.includes(c)||i.current.push(c),l)}}),{})),o}return s}function Woe(t={}){const e=SN(t);return bFe(r=>Foe(e,{onChange:r}),()=>_N(e))}let Wm=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){const r={listener:e};return this.listeners.add(r),this.onSubscribe(),()=>{this.listeners.delete(r),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};const x2=typeof window>"u"||"Deno"in window;function Ma(){}function wFe(t,e){return typeof t=="function"?t(e):t}function MP(t){return typeof t=="number"&&t>=0&&t!==1/0}function Voe(t,e){return Math.max(t+(e||0)-Date.now(),0)}function tg(t,e,r){return ww(t)?typeof e=="function"?{...r,queryKey:t,queryFn:e}:{...e,queryKey:t}:t}function xFe(t,e,r){return ww(t)?typeof e=="function"?{...r,mutationKey:t,mutationFn:e}:{...e,mutationKey:t}:typeof t=="function"?{...e,mutationFn:t}:{...t}}function ad(t,e,r){return ww(t)?[{...e,queryKey:t},r]:[t||{},e]}function DH(t,e){const{type:r="all",exact:n,fetchStatus:i,predicate:s,queryKey:o,stale:a}=t;if(ww(o)){if(n){if(e.queryHash!==kN(o,e.options))return!1}else if(!o_(e.queryKey,o))return!1}if(r!=="all"){const c=e.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||typeof i<"u"&&i!==e.state.fetchStatus||s&&!s(e))}function LH(t,e){const{exact:r,fetching:n,predicate:i,mutationKey:s}=t;if(ww(s)){if(!e.options.mutationKey)return!1;if(r){if(S0(e.options.mutationKey)!==S0(s))return!1}else if(!o_(e.options.mutationKey,s))return!1}return!(typeof n=="boolean"&&e.state.status==="loading"!==n||i&&!i(e))}function kN(t,e){return((e==null?void 0:e.queryKeyHashFn)||S0)(t)}function S0(t){return JSON.stringify(t,(e,r)=>DP(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function o_(t,e){return Goe(t,e)}function Goe(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(r=>!Goe(t[r],e[r])):!1}function Koe(t,e){if(t===e)return t;const r=BH(t)&&BH(e);if(r||DP(t)&&DP(e)){const n=r?t.length:Object.keys(t).length,i=r?e:Object.keys(e),s=i.length,o=r?[]:{};let a=0;for(let c=0;c"u")return!0;const r=e.prototype;return!(!FH(r)||!r.hasOwnProperty("isPrototypeOf"))}function FH(t){return Object.prototype.toString.call(t)==="[object Object]"}function ww(t){return Array.isArray(t)}function Joe(t){return new Promise(e=>{setTimeout(e,t)})}function jH(t){Joe(0).then(t)}function EFe(){if(typeof AbortController=="function")return new AbortController}function LP(t,e,r){return r.isDataEqual!=null&&r.isDataEqual(t,e)?t:typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?Koe(t,e):e}class _Fe extends Wm{constructor(){super(),this.setup=e=>{if(!x2&&window.addEventListener){const r=()=>e();return window.addEventListener("visibilitychange",r,!1),window.addEventListener("focus",r,!1),()=>{window.removeEventListener("visibilitychange",r),window.removeEventListener("focus",r)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var e;(e=this.cleanup)==null||e.call(this),this.cleanup=void 0}}setEventListener(e){var r;this.setup=e,(r=this.cleanup)==null||r.call(this),this.cleanup=e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()})}setFocused(e){this.focused!==e&&(this.focused=e,this.onFocus())}onFocus(){this.listeners.forEach(({listener:e})=>{e()})}isFocused(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)}}const c_=new _Fe,UH=["online","offline"];class CFe extends Wm{constructor(){super(),this.setup=e=>{if(!x2&&window.addEventListener){const r=()=>e();return UH.forEach(n=>{window.addEventListener(n,r,!1)}),()=>{UH.forEach(n=>{window.removeEventListener(n,r)})}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var e;(e=this.cleanup)==null||e.call(this),this.cleanup=void 0}}setEventListener(e){var r;this.setup=e,(r=this.cleanup)==null||r.call(this),this.cleanup=e(n=>{typeof n=="boolean"?this.setOnline(n):this.onOnline()})}setOnline(e){this.online!==e&&(this.online=e,this.onOnline())}onOnline(){this.listeners.forEach(({listener:e})=>{e()})}isOnline(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine}}const l_=new CFe;function SFe(t){return Math.min(1e3*2**t,3e4)}function wC(t){return(t??"online")==="online"?l_.isOnline():!0}class Qoe{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}}function mE(t){return t instanceof Qoe}function Yoe(t){let e=!1,r=0,n=!1,i,s,o;const a=new Promise((y,b)=>{s=y,o=b}),c=y=>{n||(p(new Qoe(y)),t.abort==null||t.abort())},l=()=>{e=!0},u=()=>{e=!1},f=()=>!c_.isFocused()||t.networkMode!=="always"&&!l_.isOnline(),d=y=>{n||(n=!0,t.onSuccess==null||t.onSuccess(y),i==null||i(),s(y))},p=y=>{n||(n=!0,t.onError==null||t.onError(y),i==null||i(),o(y))},g=()=>new Promise(y=>{i=b=>{const w=n||!f();return w&&y(b),w},t.onPause==null||t.onPause()}).then(()=>{i=void 0,n||t.onContinue==null||t.onContinue()}),v=()=>{if(n)return;let y;try{y=t.fn()}catch(b){y=Promise.reject(b)}Promise.resolve(y).then(d).catch(b=>{var w,E;if(n)return;const C=(w=t.retry)!=null?w:3,S=(E=t.retryDelay)!=null?E:SFe,P=typeof S=="function"?S(r,b):S,_=C===!0||typeof C=="number"&&r{if(f())return g()}).then(()=>{e?p(b):v()})})};return wC(t.networkMode)?v():g().then(v),{promise:a,cancel:c,continue:()=>(i==null?void 0:i())?a:Promise.resolve(),cancelRetry:l,continueRetry:u}}const IN=console;function AFe(){let t=[],e=0,r=u=>{u()},n=u=>{u()};const i=u=>{let f;e++;try{f=u()}finally{e--,e||a()}return f},s=u=>{e?t.push(u):jH(()=>{r(u)})},o=u=>(...f)=>{s(()=>{u(...f)})},a=()=>{const u=t;t=[],u.length&&jH(()=>{n(()=>{u.forEach(f=>{r(f)})})})};return{batch:i,batchCalls:o,schedule:s,setNotifyFunction:u=>{r=u},setBatchNotifyFunction:u=>{n=u}}}const Un=AFe();class Zoe{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),MP(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(e){this.cacheTime=Math.max(this.cacheTime||0,e??(x2?1/0:5*60*1e3))}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class kFe extends Zoe{constructor(e){super(),this.abortSignalConsumed=!1,this.defaultOptions=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.cache=e.cache,this.logger=e.logger||IN,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.initialState=e.state||IFe(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(e){this.options={...this.defaultOptions,...e},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.cache.remove(this)}setData(e,r){const n=LP(this.state.data,e,this.options);return this.dispatch({data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(e,r){this.dispatch({type:"setState",state:e,setStateOptions:r})}cancel(e){var r;const n=this.promise;return(r=this.retryer)==null||r.cancel(e),n?n.then(Ma).catch(Ma):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(e=>e.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(e=>e.getCurrentResult().isStale)}isStaleByTime(e=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!Voe(this.state.dataUpdatedAt,e)}onFocus(){var e;const r=this.observers.find(n=>n.shouldFetchOnWindowFocus());r&&r.refetch({cancelRefetch:!1}),(e=this.retryer)==null||e.continue()}onOnline(){var e;const r=this.observers.find(n=>n.shouldFetchOnReconnect());r&&r.refetch({cancelRefetch:!1}),(e=this.retryer)==null||e.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(r=>r!==e),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(e,r){var n,i;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&r!=null&&r.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var s;return(s=this.retryer)==null||s.continueRetry(),this.promise}}if(e&&this.setOptions(e),!this.options.queryFn){const p=this.observers.find(g=>g.options.queryFn);p&&this.setOptions(p.options)}const o=EFe(),a={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},c=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>{if(o)return this.abortSignalConsumed=!0,o.signal}})};c(a);const l=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(a)):Promise.reject("Missing queryFn for queryKey '"+this.options.queryHash+"'"),u={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:l};if(c(u),(n=this.options.behavior)==null||n.onFetch(u),this.revertState=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==((i=u.fetchOptions)==null?void 0:i.meta)){var f;this.dispatch({type:"fetch",meta:(f=u.fetchOptions)==null?void 0:f.meta})}const d=p=>{if(mE(p)&&p.silent||this.dispatch({type:"error",error:p}),!mE(p)){var g,v,y,b;(g=(v=this.cache.config).onError)==null||g.call(v,p,this),(y=(b=this.cache.config).onSettled)==null||y.call(b,this.state.data,p,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=Yoe({fn:u.fetchFn,abort:o==null?void 0:o.abort.bind(o),onSuccess:p=>{var g,v,y,b;if(typeof p>"u"){d(new Error(this.queryHash+" data is undefined"));return}this.setData(p),(g=(v=this.cache.config).onSuccess)==null||g.call(v,p,this),(y=(b=this.cache.config).onSettled)==null||y.call(b,p,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:d,onFail:(p,g)=>{this.dispatch({type:"failed",failureCount:p,error:g})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(e){const r=n=>{var i,s;switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:(i=e.meta)!=null?i:null,fetchStatus:wC(this.options.networkMode)?"fetching":"paused",...!n.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:(s=e.dataUpdatedAt)!=null?s:Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=e.error;return mE(o)&&o.revert&&this.revertState?{...this.revertState,fetchStatus:"idle"}:{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=r(this.state),Un.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate(e)}),this.cache.notify({query:this,type:"updated",action:e})})}}function IFe(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,r=typeof e<"u",n=r?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"loading",fetchStatus:"idle"}}class PFe extends Wm{constructor(e){super(),this.config=e||{},this.queries=[],this.queriesMap={}}build(e,r,n){var i;const s=r.queryKey,o=(i=r.queryHash)!=null?i:kN(s,r);let a=this.get(o);return a||(a=new kFe({cache:this,logger:e.getLogger(),queryKey:s,queryHash:o,options:e.defaultQueryOptions(r),state:n,defaultOptions:e.getQueryDefaults(s)}),this.add(a)),a}add(e){this.queriesMap[e.queryHash]||(this.queriesMap[e.queryHash]=e,this.queries.push(e),this.notify({type:"added",query:e}))}remove(e){const r=this.queriesMap[e.queryHash];r&&(e.destroy(),this.queries=this.queries.filter(n=>n!==e),r===e&&delete this.queriesMap[e.queryHash],this.notify({type:"removed",query:e}))}clear(){Un.batch(()=>{this.queries.forEach(e=>{this.remove(e)})})}get(e){return this.queriesMap[e]}getAll(){return this.queries}find(e,r){const[n]=ad(e,r);return typeof n.exact>"u"&&(n.exact=!0),this.queries.find(i=>DH(n,i))}findAll(e,r){const[n]=ad(e,r);return Object.keys(n).length>0?this.queries.filter(i=>DH(n,i)):this.queries}notify(e){Un.batch(()=>{this.listeners.forEach(({listener:r})=>{r(e)})})}onFocus(){Un.batch(()=>{this.queries.forEach(e=>{e.onFocus()})})}onOnline(){Un.batch(()=>{this.queries.forEach(e=>{e.onOnline()})})}}class RFe extends Zoe{constructor(e){super(),this.defaultOptions=e.defaultOptions,this.mutationId=e.mutationId,this.mutationCache=e.mutationCache,this.logger=e.logger||IN,this.observers=[],this.state=e.state||Xoe(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options={...this.defaultOptions,...e},this.updateCacheTime(this.options.cacheTime)}get meta(){return this.options.meta}setState(e){this.dispatch({type:"setState",state:e})}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.observers=this.observers.filter(r=>r!==e),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.observers.length||(this.state.status==="loading"?this.scheduleGc():this.mutationCache.remove(this))}continue(){var e,r;return(e=(r=this.retryer)==null?void 0:r.continue())!=null?e:this.execute()}async execute(){const e=()=>{var _;return this.retryer=Yoe({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(T,Q)=>{this.dispatch({type:"failed",failureCount:T,error:Q})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:(_=this.options.retry)!=null?_:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},r=this.state.status==="loading";try{var n,i,s,o,a,c,l,u;if(!r){var f,d,p,g;this.dispatch({type:"loading",variables:this.options.variables}),await((f=(d=this.mutationCache.config).onMutate)==null?void 0:f.call(d,this.state.variables,this));const T=await((p=(g=this.options).onMutate)==null?void 0:p.call(g,this.state.variables));T!==this.state.context&&this.dispatch({type:"loading",context:T,variables:this.state.variables})}const _=await e();return await((n=(i=this.mutationCache.config).onSuccess)==null?void 0:n.call(i,_,this.state.variables,this.state.context,this)),await((s=(o=this.options).onSuccess)==null?void 0:s.call(o,_,this.state.variables,this.state.context)),await((a=(c=this.mutationCache.config).onSettled)==null?void 0:a.call(c,_,null,this.state.variables,this.state.context,this)),await((l=(u=this.options).onSettled)==null?void 0:l.call(u,_,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:_}),_}catch(_){try{var v,y,b,w,E,C,S,P;throw await((v=(y=this.mutationCache.config).onError)==null?void 0:v.call(y,_,this.state.variables,this.state.context,this)),await((b=(w=this.options).onError)==null?void 0:b.call(w,_,this.state.variables,this.state.context)),await((E=(C=this.mutationCache.config).onSettled)==null?void 0:E.call(C,void 0,_,this.state.variables,this.state.context,this)),await((S=(P=this.options).onSettled)==null?void 0:S.call(P,void 0,_,this.state.variables,this.state.context)),_}finally{this.dispatch({type:"error",error:_})}}}dispatch(e){const r=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"loading":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!wC(this.options.networkMode),status:"loading",variables:e.variables};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"};case"setState":return{...n,...e.state}}};this.state=r(this.state),Un.batch(()=>{this.observers.forEach(n=>{n.onMutationUpdate(e)}),this.mutationCache.notify({mutation:this,type:"updated",action:e})})}}function Xoe(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class TFe extends Wm{constructor(e){super(),this.config=e||{},this.mutations=[],this.mutationId=0}build(e,r,n){const i=new RFe({mutationCache:this,logger:e.getLogger(),mutationId:++this.mutationId,options:e.defaultMutationOptions(r),state:n,defaultOptions:r.mutationKey?e.getMutationDefaults(r.mutationKey):void 0});return this.add(i),i}add(e){this.mutations.push(e),this.notify({type:"added",mutation:e})}remove(e){this.mutations=this.mutations.filter(r=>r!==e),this.notify({type:"removed",mutation:e})}clear(){Un.batch(()=>{this.mutations.forEach(e=>{this.remove(e)})})}getAll(){return this.mutations}find(e){return typeof e.exact>"u"&&(e.exact=!0),this.mutations.find(r=>LH(e,r))}findAll(e){return this.mutations.filter(r=>LH(e,r))}notify(e){Un.batch(()=>{this.listeners.forEach(({listener:r})=>{r(e)})})}resumePausedMutations(){var e;return this.resuming=((e=this.resuming)!=null?e:Promise.resolve()).then(()=>{const r=this.mutations.filter(n=>n.state.isPaused);return Un.batch(()=>r.reduce((n,i)=>n.then(()=>i.continue().catch(Ma)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function BP(){return{onFetch:t=>{t.fetchFn=()=>{var e,r,n,i,s,o;const a=(e=t.fetchOptions)==null||(r=e.meta)==null?void 0:r.refetchPage,c=(n=t.fetchOptions)==null||(i=n.meta)==null?void 0:i.fetchMore,l=c==null?void 0:c.pageParam,u=(c==null?void 0:c.direction)==="forward",f=(c==null?void 0:c.direction)==="backward",d=((s=t.state.data)==null?void 0:s.pages)||[],p=((o=t.state.data)==null?void 0:o.pageParams)||[];let g=p,v=!1;const y=P=>{Object.defineProperty(P,"signal",{enumerable:!0,get:()=>{var _;if((_=t.signal)!=null&&_.aborted)v=!0;else{var T;(T=t.signal)==null||T.addEventListener("abort",()=>{v=!0})}return t.signal}})},b=t.options.queryFn||(()=>Promise.reject("Missing queryFn for queryKey '"+t.options.queryHash+"'")),w=(P,_,T,Q)=>(g=Q?[_,...g]:[...g,_],Q?[T,...P]:[...P,T]),E=(P,_,T,Q)=>{if(v)return Promise.reject("Cancelled");if(typeof T>"u"&&!_&&P.length)return Promise.resolve(P);const Z={queryKey:t.queryKey,pageParam:T,meta:t.options.meta};y(Z);const ne=b(Z);return Promise.resolve(ne).then(K=>w(P,T,K,Q))};let C;if(!d.length)C=E([]);else if(u){const P=typeof l<"u",_=P?l:FP(t.options,d);C=E(d,P,_)}else if(f){const P=typeof l<"u",_=P?l:eae(t.options,d);C=E(d,P,_,!0)}else{g=[];const P=typeof t.options.getNextPageParam>"u";C=(a&&d[0]?a(d[0],0,d):!0)?E([],P,p[0]):Promise.resolve(w([],p[0],d[0]));for(let T=1;T{if(a&&d[T]?a(d[T],T,d):!0){const ne=P?p[T]:FP(t.options,Q);return E(Q,P,ne)}return Promise.resolve(w(Q,p[T],d[T]))})}return C.then(P=>({pages:P,pageParams:g}))}}}}function FP(t,e){return t.getNextPageParam==null?void 0:t.getNextPageParam(e[e.length-1],e)}function eae(t,e){return t.getPreviousPageParam==null?void 0:t.getPreviousPageParam(e[0],e)}function OFe(t,e){if(t.getNextPageParam&&Array.isArray(e)){const r=FP(t,e);return typeof r<"u"&&r!==null&&r!==!1}}function $Fe(t,e){if(t.getPreviousPageParam&&Array.isArray(e)){const r=eae(t,e);return typeof r<"u"&&r!==null&&r!==!1}}class PN{constructor(e={}){this.queryCache=e.queryCache||new PFe,this.mutationCache=e.mutationCache||new TFe,this.logger=e.logger||IN,this.defaultOptions=e.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=c_.subscribe(()=>{c_.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=l_.subscribe(()=>{l_.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var e,r;this.mountCount--,this.mountCount===0&&((e=this.unsubscribeFocus)==null||e.call(this),this.unsubscribeFocus=void 0,(r=this.unsubscribeOnline)==null||r.call(this),this.unsubscribeOnline=void 0)}isFetching(e,r){const[n]=ad(e,r);return n.fetchStatus="fetching",this.queryCache.findAll(n).length}isMutating(e){return this.mutationCache.findAll({...e,fetching:!0}).length}getQueryData(e,r){var n;return(n=this.queryCache.find(e,r))==null?void 0:n.state.data}ensureQueryData(e,r,n){const i=tg(e,r,n),s=this.getQueryData(i.queryKey);return s?Promise.resolve(s):this.fetchQuery(i)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:r,state:n})=>{const i=n.data;return[r,i]})}setQueryData(e,r,n){const i=this.queryCache.find(e),s=i==null?void 0:i.state.data,o=wFe(r,s);if(typeof o>"u")return;const a=tg(e),c=this.defaultQueryOptions(a);return this.queryCache.build(this,c).setData(o,{...n,manual:!0})}setQueriesData(e,r,n){return Un.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,r,n)]))}getQueryState(e,r){var n;return(n=this.queryCache.find(e,r))==null?void 0:n.state}removeQueries(e,r){const[n]=ad(e,r),i=this.queryCache;Un.batch(()=>{i.findAll(n).forEach(s=>{i.remove(s)})})}resetQueries(e,r,n){const[i,s]=ad(e,r,n),o=this.queryCache,a={type:"active",...i};return Un.batch(()=>(o.findAll(i).forEach(c=>{c.reset()}),this.refetchQueries(a,s)))}cancelQueries(e,r,n){const[i,s={}]=ad(e,r,n);typeof s.revert>"u"&&(s.revert=!0);const o=Un.batch(()=>this.queryCache.findAll(i).map(a=>a.cancel(s)));return Promise.all(o).then(Ma).catch(Ma)}invalidateQueries(e,r,n){const[i,s]=ad(e,r,n);return Un.batch(()=>{var o,a;if(this.queryCache.findAll(i).forEach(l=>{l.invalidate()}),i.refetchType==="none")return Promise.resolve();const c={...i,type:(o=(a=i.refetchType)!=null?a:i.type)!=null?o:"active"};return this.refetchQueries(c,s)})}refetchQueries(e,r,n){const[i,s]=ad(e,r,n),o=Un.batch(()=>this.queryCache.findAll(i).filter(c=>!c.isDisabled()).map(c=>{var l;return c.fetch(void 0,{...s,cancelRefetch:(l=s==null?void 0:s.cancelRefetch)!=null?l:!0,meta:{refetchPage:i.refetchPage}})}));let a=Promise.all(o).then(Ma);return s!=null&&s.throwOnError||(a=a.catch(Ma)),a}fetchQuery(e,r,n){const i=tg(e,r,n),s=this.defaultQueryOptions(i);typeof s.retry>"u"&&(s.retry=!1);const o=this.queryCache.build(this,s);return o.isStaleByTime(s.staleTime)?o.fetch(s):Promise.resolve(o.state.data)}prefetchQuery(e,r,n){return this.fetchQuery(e,r,n).then(Ma).catch(Ma)}fetchInfiniteQuery(e,r,n){const i=tg(e,r,n);return i.behavior=BP(),this.fetchQuery(i)}prefetchInfiniteQuery(e,r,n){return this.fetchInfiniteQuery(e,r,n).then(Ma).catch(Ma)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(e){this.defaultOptions=e}setQueryDefaults(e,r){const n=this.queryDefaults.find(i=>S0(e)===S0(i.queryKey));n?n.defaultOptions=r:this.queryDefaults.push({queryKey:e,defaultOptions:r})}getQueryDefaults(e){if(!e)return;const r=this.queryDefaults.find(n=>o_(e,n.queryKey));return r==null?void 0:r.defaultOptions}setMutationDefaults(e,r){const n=this.mutationDefaults.find(i=>S0(e)===S0(i.mutationKey));n?n.defaultOptions=r:this.mutationDefaults.push({mutationKey:e,defaultOptions:r})}getMutationDefaults(e){if(!e)return;const r=this.mutationDefaults.find(n=>o_(e,n.mutationKey));return r==null?void 0:r.defaultOptions}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const r={...this.defaultOptions.queries,...this.getQueryDefaults(e==null?void 0:e.queryKey),...e,_defaulted:!0};return!r.queryHash&&r.queryKey&&(r.queryHash=kN(r.queryKey,r)),typeof r.refetchOnReconnect>"u"&&(r.refetchOnReconnect=r.networkMode!=="always"),typeof r.useErrorBoundary>"u"&&(r.useErrorBoundary=!!r.suspense),r}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...this.defaultOptions.mutations,...this.getMutationDefaults(e==null?void 0:e.mutationKey),...e,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}class tae extends Wm{constructor(e,r){super(),this.client=e,this.options=r,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(r)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.currentQuery.addObserver(this),zH(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return jP(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return jP(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(e,r){const n=this.options,i=this.currentQuery;if(this.options=this.client.defaultQueryOptions(e),a_(n,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=n.queryKey),this.updateQuery();const s=this.hasListeners();s&&HH(this.currentQuery,i,this.options,n)&&this.executeFetch(),this.updateResult(r),s&&(this.currentQuery!==i||this.options.enabled!==n.enabled||this.options.staleTime!==n.staleTime)&&this.updateStaleTimeout();const o=this.computeRefetchInterval();s&&(this.currentQuery!==i||this.options.enabled!==n.enabled||o!==this.currentRefetchInterval)&&this.updateRefetchInterval(o)}getOptimisticResult(e){const r=this.client.getQueryCache().build(this.client,e),n=this.createResult(r,e);return MFe(this,n,e)&&(this.currentResult=n,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),n}getCurrentResult(){return this.currentResult}trackResult(e){const r={};return Object.keys(e).forEach(n=>{Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(n),e[n])})}),r}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:e,...r}={}){return this.fetch({...r,meta:{refetchPage:e}})}fetchOptimistic(e){const r=this.client.defaultQueryOptions(e),n=this.client.getQueryCache().build(this.client,r);return n.isFetchingOptimistic=!0,n.fetch().then(()=>this.createResult(n,r))}fetch(e){var r;return this.executeFetch({...e,cancelRefetch:(r=e.cancelRefetch)!=null?r:!0}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(e){this.updateQuery();let r=this.currentQuery.fetch(this.options,e);return e!=null&&e.throwOnError||(r=r.catch(Ma)),r}updateStaleTimeout(){if(this.clearStaleTimeout(),x2||this.currentResult.isStale||!MP(this.options.staleTime))return;const r=Voe(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},r)}computeRefetchInterval(){var e;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(e=this.options.refetchInterval)!=null?e:!1}updateRefetchInterval(e){this.clearRefetchInterval(),this.currentRefetchInterval=e,!(x2||this.options.enabled===!1||!MP(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||c_.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(e,r){const n=this.currentQuery,i=this.options,s=this.currentResult,o=this.currentResultState,a=this.currentResultOptions,c=e!==n,l=c?e.state:this.currentQueryInitialState,u=c?this.currentResult:this.previousQueryResult,{state:f}=e;let{dataUpdatedAt:d,error:p,errorUpdatedAt:g,fetchStatus:v,status:y}=f,b=!1,w=!1,E;if(r._optimisticResults){const T=this.hasListeners(),Q=!T&&zH(e,r),Z=T&&HH(e,n,r,i);(Q||Z)&&(v=wC(e.options.networkMode)?"fetching":"paused",d||(y="loading")),r._optimisticResults==="isRestoring"&&(v="idle")}if(r.keepPreviousData&&!f.dataUpdatedAt&&u!=null&&u.isSuccess&&y!=="error")E=u.data,d=u.dataUpdatedAt,y=u.status,b=!0;else if(r.select&&typeof f.data<"u")if(s&&f.data===(o==null?void 0:o.data)&&r.select===this.selectFn)E=this.selectResult;else try{this.selectFn=r.select,E=r.select(f.data),E=LP(s==null?void 0:s.data,E,r),this.selectResult=E,this.selectError=null}catch(T){this.selectError=T}else E=f.data;if(typeof r.placeholderData<"u"&&typeof E>"u"&&y==="loading"){let T;if(s!=null&&s.isPlaceholderData&&r.placeholderData===(a==null?void 0:a.placeholderData))T=s.data;else if(T=typeof r.placeholderData=="function"?r.placeholderData():r.placeholderData,r.select&&typeof T<"u")try{T=r.select(T),this.selectError=null}catch(Q){this.selectError=Q}typeof T<"u"&&(y="success",E=LP(s==null?void 0:s.data,T,r),w=!0)}this.selectError&&(p=this.selectError,E=this.selectResult,g=Date.now(),y="error");const C=v==="fetching",S=y==="loading",P=y==="error";return{status:y,fetchStatus:v,isLoading:S,isSuccess:y==="success",isError:P,isInitialLoading:S&&C,data:E,dataUpdatedAt:d,error:p,errorUpdatedAt:g,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>l.dataUpdateCount||f.errorUpdateCount>l.errorUpdateCount,isFetching:C,isRefetching:C&&!S,isLoadingError:P&&f.dataUpdatedAt===0,isPaused:v==="paused",isPlaceholderData:w,isPreviousData:b,isRefetchError:P&&f.dataUpdatedAt!==0,isStale:RN(e,r),refetch:this.refetch,remove:this.remove}}updateResult(e){const r=this.currentResult,n=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,a_(n,r))return;this.currentResult=n;const i={cache:!0},s=()=>{if(!r)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!this.trackedProps.size)return!0;const c=new Set(a??this.trackedProps);return this.options.useErrorBoundary&&c.add("error"),Object.keys(this.currentResult).some(l=>{const u=l;return this.currentResult[u]!==r[u]&&c.has(u)})};(e==null?void 0:e.listeners)!==!1&&s()&&(i.listeners=!0),this.notify({...i,...e})}updateQuery(){const e=this.client.getQueryCache().build(this.client,this.options);if(e===this.currentQuery)return;const r=this.currentQuery;this.currentQuery=e,this.currentQueryInitialState=e.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(r==null||r.removeObserver(this),e.addObserver(this))}onQueryUpdate(e){const r={};e.type==="success"?r.onSuccess=!e.manual:e.type==="error"&&!mE(e.error)&&(r.onError=!0),this.updateResult(r),this.hasListeners()&&this.updateTimers()}notify(e){Un.batch(()=>{if(e.onSuccess){var r,n,i,s;(r=(n=this.options).onSuccess)==null||r.call(n,this.currentResult.data),(i=(s=this.options).onSettled)==null||i.call(s,this.currentResult.data,null)}else if(e.onError){var o,a,c,l;(o=(a=this.options).onError)==null||o.call(a,this.currentResult.error),(c=(l=this.options).onSettled)==null||c.call(l,void 0,this.currentResult.error)}e.listeners&&this.listeners.forEach(({listener:u})=>{u(this.currentResult)}),e.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function NFe(t,e){return e.enabled!==!1&&!t.state.dataUpdatedAt&&!(t.state.status==="error"&&e.retryOnMount===!1)}function zH(t,e){return NFe(t,e)||t.state.dataUpdatedAt>0&&jP(t,e,e.refetchOnMount)}function jP(t,e,r){if(e.enabled!==!1){const n=typeof r=="function"?r(t):r;return n==="always"||n!==!1&&RN(t,e)}return!1}function HH(t,e,r,n){return r.enabled!==!1&&(t!==e||n.enabled===!1)&&(!r.suspense||t.state.status!=="error")&&RN(t,r)}function RN(t,e){return t.isStaleByTime(e.staleTime)}function MFe(t,e,r){return r.keepPreviousData?!1:r.placeholderData!==void 0?e.isPlaceholderData:!a_(t.getCurrentResult(),e)}class DFe extends tae{constructor(e,r){super(e,r)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e,r){super.setOptions({...e,behavior:BP()},r)}getOptimisticResult(e){return e.behavior=BP(),super.getOptimisticResult(e)}fetchNextPage({pageParam:e,...r}={}){return this.fetch({...r,meta:{fetchMore:{direction:"forward",pageParam:e}}})}fetchPreviousPage({pageParam:e,...r}={}){return this.fetch({...r,meta:{fetchMore:{direction:"backward",pageParam:e}}})}createResult(e,r){var n,i,s,o,a,c;const{state:l}=e,u=super.createResult(e,r),{isFetching:f,isRefetching:d}=u,p=f&&((n=l.fetchMeta)==null||(i=n.fetchMore)==null?void 0:i.direction)==="forward",g=f&&((s=l.fetchMeta)==null||(o=s.fetchMore)==null?void 0:o.direction)==="backward";return{...u,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:OFe(r,(a=l.data)==null?void 0:a.pages),hasPreviousPage:$Fe(r,(c=l.data)==null?void 0:c.pages),isFetchingNextPage:p,isFetchingPreviousPage:g,isRefetching:d&&!p&&!g}}}let LFe=class extends Wm{constructor(e,r){super(),this.client=e,this.setOptions(r),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){var r;const n=this.options;this.options=this.client.defaultMutationOptions(e),a_(n,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this}),(r=this.currentMutation)==null||r.setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners()){var e;(e=this.currentMutation)==null||e.removeObserver(this)}}onMutationUpdate(e){this.updateResult();const r={listeners:!0};e.type==="success"?r.onSuccess=!0:e.type==="error"&&(r.onError=!0),this.notify(r)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(e,r){return this.mutateOptions=r,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:typeof e<"u"?e:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){const e=this.currentMutation?this.currentMutation.state:Xoe(),r={...e,isLoading:e.status==="loading",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset};this.currentResult=r}notify(e){Un.batch(()=>{if(this.mutateOptions&&this.hasListeners()){if(e.onSuccess){var r,n,i,s;(r=(n=this.mutateOptions).onSuccess)==null||r.call(n,this.currentResult.data,this.currentResult.variables,this.currentResult.context),(i=(s=this.mutateOptions).onSettled)==null||i.call(s,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)}else if(e.onError){var o,a,c,l;(o=(a=this.mutateOptions).onError)==null||o.call(a,this.currentResult.error,this.currentResult.variables,this.currentResult.context),(c=(l=this.mutateOptions).onSettled)==null||c.call(l,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context)}}e.listeners&&this.listeners.forEach(({listener:u})=>{u(this.currentResult)})})}};function BFe(t){return JSON.stringify(t,(e,r)=>FFe(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):typeof r=="bigint"?r.toString():r)}function FFe(t){if(!qH(t))return!1;const e=t.constructor;if(typeof e>"u")return!0;const r=e.prototype;return!(!qH(r)||!r.hasOwnProperty("isPrototypeOf"))}function qH(t){return Object.prototype.toString.call(t)==="[object Object]"}function jFe(t){const{_defaulted:e,behavior:r,gcTime:n,initialData:i,initialDataUpdatedAt:s,maxPages:o,meta:a,networkMode:c,queryFn:l,queryHash:u,queryKey:f,queryKeyHashFn:d,retry:p,retryDelay:g,structuralSharing:v,getPreviousPageParam:y,getNextPageParam:b,initialPageParam:w,_optimisticResults:E,enabled:C,notifyOnChangeProps:S,placeholderData:P,refetchInterval:_,refetchIntervalInBackground:T,refetchOnMount:Q,refetchOnReconnect:Z,refetchOnWindowFocus:ne,retryOnMount:ce,select:K,staleTime:x,suspense:A,throwOnError:B,config:z,connector:R,query:L,...q}=t;return q}function UFe(t){return{mutationFn(e){return FBe(t,e)},mutationKey:["connect"]}}function zFe(t){return{mutationFn(e){return jBe(t,e)},mutationKey:["disconnect"]}}function HFe(t,e={}){return{gcTime:0,async queryFn({queryKey:r}){const{connector:n}=e,{connectorUid:i,scopeKey:s,...o}=r[1];return HBe(t,{...o,connector:n})},queryKey:qFe(e)}}function qFe(t={}){const{connector:e,...r}=t;return["walletClient",{...jFe(r),connectorUid:e==null?void 0:e.uid}]}function WFe(t){return{mutationFn(e){return WBe(t,e)},mutationKey:["switchChain"]}}var VFe=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};function WH(t){return JSON.stringify(t,(e,r)=>KFe(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function GFe(t,e){if(t&&!e||e&&!t)return!1;for(const r in t)if(t[r]!==e[r])return!1;return!0}function KFe(t){if(!VH(t))return!1;const e=t.constructor;if(typeof e>"u")return!0;const r=e.prototype;return!(!VH(r)||!r.hasOwnProperty("isPrototypeOf"))}function VH(t){return Object.prototype.toString.call(t)==="[object Object]"}function JFe(){let t=[],e=0,r=d=>{d()},n=d=>{d()},i=d=>setTimeout(d,0);const s=d=>{i=d},o=d=>{let p;e++;try{p=d()}finally{e--,e||l()}return p},a=d=>{e?t.push(d):i(()=>{r(d)})},c=d=>(...p)=>{a(()=>{d(...p)})},l=()=>{const d=t;t=[],d.length&&i(()=>{n(()=>{d.forEach(p=>{r(p)})})})};return{batch:o,batchCalls:c,schedule:a,setNotifyFunction:d=>{r=d},setBatchNotifyFunction:d=>{n=d},setScheduler:s}}var rae=JFe();function QFe(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var dd,Nu,Wo,Mu,$g,vE,F2,UP,dJ,YFe=(dJ=class extends VFe{constructor(r,n){super();Wh(this,$g);Wh(this,F2);Wh(this,dd,void 0);Wh(this,Nu,void 0);Wh(this,Wo,void 0);Wh(this,Mu,void 0);Vh(this,Nu,void 0),Vh(this,dd,r),this.setOptions(n),this.bindMethods(),rp(this,$g,vE).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var i;const n=this.options;this.options=Mn(this,dd).defaultMutationOptions(r),GFe(n,this.options)||Mn(this,dd).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Mn(this,Wo),observer:this}),(i=Mn(this,Wo))==null||i.setOptions(this.options),n!=null&&n.mutationKey&&this.options.mutationKey&&WH(n.mutationKey)!==WH(this.options.mutationKey)&&this.reset()}onUnsubscribe(){var r;this.hasListeners()||(r=Mn(this,Wo))==null||r.removeObserver(this)}onMutationUpdate(r){rp(this,$g,vE).call(this),rp(this,F2,UP).call(this,r)}getCurrentResult(){return Mn(this,Nu)}reset(){var r;(r=Mn(this,Wo))==null||r.removeObserver(this),Vh(this,Wo,void 0),rp(this,$g,vE).call(this),rp(this,F2,UP).call(this)}mutate(r,n){var i;return Vh(this,Mu,n),(i=Mn(this,Wo))==null||i.removeObserver(this),Vh(this,Wo,Mn(this,dd).getMutationCache().build(Mn(this,dd),this.options)),Mn(this,Wo).addObserver(this),Mn(this,Wo).execute(r)}},dd=new WeakMap,Nu=new WeakMap,Wo=new WeakMap,Mu=new WeakMap,$g=new WeakSet,vE=function(){var n;const r=((n=Mn(this,Wo))==null?void 0:n.state)??QFe();Vh(this,Nu,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},F2=new WeakSet,UP=function(r){rae.batch(()=>{var n,i,s,o,a,c,l,u;if(Mn(this,Mu)&&this.hasListeners()){const f=Mn(this,Nu).variables,d=Mn(this,Nu).context;(r==null?void 0:r.type)==="success"?((i=(n=Mn(this,Mu)).onSuccess)==null||i.call(n,r.data,f,d),(o=(s=Mn(this,Mu)).onSettled)==null||o.call(s,r.data,null,f,d)):(r==null?void 0:r.type)==="error"&&((c=(a=Mn(this,Mu)).onError)==null||c.call(a,r.error,f,d),(u=(l=Mn(this,Mu)).onSettled)==null||u.call(l,void 0,r.error,f,d))}this.listeners.forEach(f=>{f(Mn(this,Nu))})})},dJ),ZFe=$.createContext(void 0),XFe=t=>{const e=$.useContext(ZFe);if(t)return t;if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e};function eje(t,e){return typeof t=="function"?t(...e):!!t}function tje(t,e){const r=XFe(e),[n]=$.useState(()=>new YFe(r,t));$.useEffect(()=>{n.setOptions(t)},[n,t]);const i=$.useSyncExternalStore($.useCallback(o=>n.subscribe(rae.batchCalls(o)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),s=$.useCallback((o,a)=>{n.mutate(o,a).catch(rje)},[n]);if(i.error&&eje(n.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}function rje(){}function nje(t={}){const e=SN(t);return $.useSyncExternalStore(r=>KBe(e,{onChange:r}),()=>MH(e),()=>MH(e))}function nae(t={}){const{mutation:e}=t,r=SN(t),n=nje({config:r}),i=UFe(r),{mutate:s,mutateAsync:o,...a}=tje({...e,...i});return $.useEffect(()=>r.subscribe(({status:c})=>c,(c,l)=>{l==="connected"&&c==="disconnected"&&a.reset()}),[r,a]),{...a,connect:s,connectAsync:o,connectors:n}}var iae={},E2={},xC={};Object.defineProperty(xC,"__esModule",{value:!0});xC.walletLogo=void 0;const ije=(t,e)=>{let r;switch(t){case"standard":return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};xC.walletLogo=ije;var EC={};Object.defineProperty(EC,"__esModule",{value:!0});EC.LINK_API_URL=void 0;EC.LINK_API_URL="https://www.walletlink.org";var st={},xw={},ff={};Object.defineProperty(ff,"__esModule",{value:!0});ff.errorValues=ff.standardErrorCodes=void 0;ff.standardErrorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}};ff.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}};var _C={},CC={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.serialize=t.getErrorCode=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=ff,r="Unspecified error message.";t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(d,p=r){if(d&&Number.isInteger(d)){const g=d.toString();if(u(e.errorValues,g))return e.errorValues[g].message;if(c(d))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return p}t.getMessageFromCode=n;function i(d){if(!Number.isInteger(d))return!1;const p=d.toString();return!!(e.errorValues[p]||c(d))}t.isValidCode=i;function s(d){var p;if(typeof d=="number")return d;if(o(d))return(p=d.code)!==null&&p!==void 0?p:d.errorCode}t.getErrorCode=s;function o(d){return typeof d=="object"&&d!==null&&(typeof d.code=="number"||typeof d.errorCode=="number")}function a(d,{shouldIncludeStack:p=!1}={}){const g={};if(d&&typeof d=="object"&&!Array.isArray(d)&&u(d,"code")&&i(d.code)){const v=d;g.code=v.code,v.message&&typeof v.message=="string"?(g.message=v.message,u(v,"data")&&(g.data=v.data)):(g.message=n(g.code),g.data={originalError:l(d)})}else g.code=e.standardErrorCodes.rpc.internal,g.message=f(d,"message")?d.message:r,g.data={originalError:l(d)};return p&&(g.stack=f(d,"stack")?d.stack:void 0),g}t.serialize=a;function c(d){return d>=-32099&&d<=-32e3}function l(d){return d&&typeof d=="object"&&!Array.isArray(d)?Object.assign({},d):d}function u(d,p){return Object.prototype.hasOwnProperty.call(d,p)}function f(d,p){return typeof d=="object"&&d!==null&&p in d&&typeof d[p]=="string"}})(CC);Object.defineProperty(_C,"__esModule",{value:!0});_C.standardErrors=void 0;const Hi=ff,sae=CC;_C.standardErrors={rpc:{parse:t=>ka(Hi.standardErrorCodes.rpc.parse,t),invalidRequest:t=>ka(Hi.standardErrorCodes.rpc.invalidRequest,t),invalidParams:t=>ka(Hi.standardErrorCodes.rpc.invalidParams,t),methodNotFound:t=>ka(Hi.standardErrorCodes.rpc.methodNotFound,t),internal:t=>ka(Hi.standardErrorCodes.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return ka(e,t)},invalidInput:t=>ka(Hi.standardErrorCodes.rpc.invalidInput,t),resourceNotFound:t=>ka(Hi.standardErrorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>ka(Hi.standardErrorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>ka(Hi.standardErrorCodes.rpc.transactionRejected,t),methodNotSupported:t=>ka(Hi.standardErrorCodes.rpc.methodNotSupported,t),limitExceeded:t=>ka(Hi.standardErrorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>hp(Hi.standardErrorCodes.provider.userRejectedRequest,t),unauthorized:t=>hp(Hi.standardErrorCodes.provider.unauthorized,t),unsupportedMethod:t=>hp(Hi.standardErrorCodes.provider.unsupportedMethod,t),disconnected:t=>hp(Hi.standardErrorCodes.provider.disconnected,t),chainDisconnected:t=>hp(Hi.standardErrorCodes.provider.chainDisconnected,t),unsupportedChain:t=>hp(Hi.standardErrorCodes.provider.unsupportedChain,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:r,data:n}=t;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new cae(e,r,n)}}};function ka(t,e){const[r,n]=oae(e);return new aae(t,r||(0,sae.getMessageFromCode)(t),n)}function hp(t,e){const[r,n]=oae(e);return new cae(t,r||(0,sae.getMessageFromCode)(t),n)}function oae(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:r}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}let aae=class extends Error{constructor(e,r,n){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=e,n!==void 0&&(this.data=n)}},cae=class extends aae{constructor(e,r,n){if(!sje(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,r,n)}};function sje(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}var SC={},Vm={};Object.defineProperty(Vm,"__esModule",{value:!0});Vm.isErrorResponse=void 0;function oje(t){return t.errorMessage!==void 0}Vm.isErrorResponse=oje;var Gm={};Object.defineProperty(Gm,"__esModule",{value:!0});Gm.LIB_VERSION=void 0;Gm.LIB_VERSION="3.9.1";Object.defineProperty(SC,"__esModule",{value:!0});SC.serializeError=void 0;const aje=Vm,cje=Gm,lje=ff,uje=CC;function fje(t,e){const r=(0,uje.serialize)(dje(t),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",cje.LIB_VERSION),n.searchParams.set("code",r.code.toString());const i=hje(r.data,e);return i&&n.searchParams.set("method",i),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}SC.serializeError=fje;function dje(t){return typeof t=="string"?{message:t,code:lje.standardErrorCodes.rpc.internal}:(0,aje.isErrorResponse)(t)?Object.assign(Object.assign({},t),{message:t.errorMessage,code:t.errorCode,data:{method:t.method}}):t}function hje(t,e){const r=t==null?void 0:t.method;if(r)return r;if(e!==void 0){if(typeof e=="string")return e;if(Array.isArray(e)){if(e.length>0)return e[0].method}else return e.method}}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.standardErrors=t.standardErrorCodes=t.serializeError=t.getMessageFromCode=t.getErrorCode=void 0;const e=ff;Object.defineProperty(t,"standardErrorCodes",{enumerable:!0,get:function(){return e.standardErrorCodes}});const r=_C;Object.defineProperty(t,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=SC;Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const i=CC;Object.defineProperty(t,"getErrorCode",{enumerable:!0,get:function(){return i.getErrorCode}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return i.getMessageFromCode}})})(xw);var xi={};Object.defineProperty(xi,"__esModule",{value:!0});xi.ProviderType=xi.RegExpString=xi.IntNumber=xi.BigIntString=xi.AddressString=xi.HexString=xi.OpaqueType=void 0;function Ew(){return t=>t}xi.OpaqueType=Ew;xi.HexString=Ew();xi.AddressString=Ew();xi.BigIntString=Ew();function pje(t){return Math.floor(t)}xi.IntNumber=pje;xi.RegExpString=Ew();var GH;(function(t){t.CoinbaseWallet="CoinbaseWallet",t.MetaMask="MetaMask",t.Unselected=""})(GH||(xi.ProviderType=GH={}));var gje=Je&&Je.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(st,"__esModule",{value:!0});st.isMobileWeb=st.getLocation=st.isInIFrame=st.createQrUrl=st.getFavicon=st.range=st.isBigNumber=st.ensureParsedJSONObject=st.ensureBN=st.ensureRegExpString=st.ensureIntNumber=st.ensureBuffer=st.ensureAddressString=st.ensureEvenLengthHexString=st.ensureHexString=st.isHexString=st.prepend0x=st.strip0x=st.has0xPrefix=st.hexStringFromIntNumber=st.intNumberFromHexString=st.bigIntStringFromBN=st.hexStringFromBuffer=st.hexStringToUint8Array=st.uint8ArrayToHex=st.randomBytesHex=void 0;const fd=gje(W2),_1=xw,Wa=xi,lae=/^[0-9]*$/,uae=/^[a-f0-9]*$/;function mje(t){return fae(crypto.getRandomValues(new Uint8Array(t)))}st.randomBytesHex=mje;function fae(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}st.uint8ArrayToHex=fae;function vje(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>parseInt(e,16)))}st.hexStringToUint8Array=vje;function yje(t,e=!1){const r=t.toString("hex");return(0,Wa.HexString)(e?`0x${r}`:r)}st.hexStringFromBuffer=yje;function bje(t){return(0,Wa.BigIntString)(t.toString(10))}st.bigIntStringFromBN=bje;function wje(t){return(0,Wa.IntNumber)(new fd.default(Cw(t,!1),16).toNumber())}st.intNumberFromHexString=wje;function xje(t){return(0,Wa.HexString)(`0x${new fd.default(t).toString(16)}`)}st.hexStringFromIntNumber=xje;function TN(t){return t.startsWith("0x")||t.startsWith("0X")}st.has0xPrefix=TN;function AC(t){return TN(t)?t.slice(2):t}st.strip0x=AC;function dae(t){return TN(t)?`0x${t.slice(2)}`:`0x${t}`}st.prepend0x=dae;function _w(t){if(typeof t!="string")return!1;const e=AC(t).toLowerCase();return uae.test(e)}st.isHexString=_w;function hae(t,e=!1){if(typeof t=="string"){const r=AC(t).toLowerCase();if(uae.test(r))return(0,Wa.HexString)(e?`0x${r}`:r)}throw _1.standardErrors.rpc.invalidParams(`"${String(t)}" is not a hexadecimal string`)}st.ensureHexString=hae;function Cw(t,e=!1){let r=hae(t,!1);return r.length%2===1&&(r=(0,Wa.HexString)(`0${r}`)),e?(0,Wa.HexString)(`0x${r}`):r}st.ensureEvenLengthHexString=Cw;function Eje(t){if(typeof t=="string"){const e=AC(t).toLowerCase();if(_w(e)&&e.length===40)return(0,Wa.AddressString)(dae(e))}throw _1.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(t)}`)}st.ensureAddressString=Eje;function _je(t){if(Buffer.isBuffer(t))return t;if(typeof t=="string"){if(_w(t)){const e=Cw(t,!1);return Buffer.from(e,"hex")}return Buffer.from(t,"utf8")}throw _1.standardErrors.rpc.invalidParams(`Not binary data: ${String(t)}`)}st.ensureBuffer=_je;function pae(t){if(typeof t=="number"&&Number.isInteger(t))return(0,Wa.IntNumber)(t);if(typeof t=="string"){if(lae.test(t))return(0,Wa.IntNumber)(Number(t));if(_w(t))return(0,Wa.IntNumber)(new fd.default(Cw(t,!1),16).toNumber())}throw _1.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}st.ensureIntNumber=pae;function Cje(t){if(t instanceof RegExp)return(0,Wa.RegExpString)(t.toString());throw _1.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(t)}`)}st.ensureRegExpString=Cje;function Sje(t){if(t!==null&&(fd.default.isBN(t)||gae(t)))return new fd.default(t.toString(10),10);if(typeof t=="number")return new fd.default(pae(t));if(typeof t=="string"){if(lae.test(t))return new fd.default(t,10);if(_w(t))return new fd.default(Cw(t,!1),16)}throw _1.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}st.ensureBN=Sje;function Aje(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw _1.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(t)}`)}st.ensureParsedJSONObject=Aje;function gae(t){if(t==null||typeof t.constructor!="function")return!1;const{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}st.isBigNumber=gae;function kje(t,e){return Array.from({length:e-t},(r,n)=>t+n)}st.range=kje;function Ije(){const t=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:r}=document.location,n=t?t.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?e+n:`${e}//${r}${n}`}st.getFavicon=Ije;function Pje(t,e,r,n,i,s){const o=n?"parent-id":"id",a=new URLSearchParams({[o]:t,secret:e,server:r,v:i,chainId:s.toString()}).toString();return`${r}/#/link?${a}`}st.createQrUrl=Pje;function mae(){try{return window.frameElement!==null}catch{return!1}}st.isInIFrame=mae;function Rje(){try{return mae()&&window.top?window.top.location:window.location}catch{return window.location}}st.getLocation=Rje;function Tje(){var t;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((t=window==null?void 0:window.navigator)===null||t===void 0?void 0:t.userAgent)}st.isMobileWeb=Tje;var kC={};Object.defineProperty(kC,"__esModule",{value:!0});kC.ScopedLocalStorage=void 0;class Oje{constructor(e){this.scope=e}setItem(e,r){localStorage.setItem(this.scopedKey(e),r)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),r=[];for(let n=0;nlocalStorage.removeItem(n))}scopedKey(e){return`${this.scope}:${e}`}}kC.ScopedLocalStorage=Oje;var am={},Sw={},Aw={},Km={};Object.defineProperty(Km,"__esModule",{value:!0});Km.EVENTS=void 0;Km.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",METHOD_NOT_IMPLEMENTED:"walletlink_sdk.method_not_implemented",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var za={};Object.defineProperty(za,"__esModule",{value:!0});za.RelayAbstract=za.APP_VERSION_KEY=za.LOCAL_STORAGE_ADDRESSES_KEY=za.WALLET_USER_NAME_KEY=void 0;const KH=xw;za.WALLET_USER_NAME_KEY="walletUsername";za.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";za.APP_VERSION_KEY="AppVersion";class $je{async makeEthereumJSONRPCRequest(e,r){if(!r)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(r,{method:"POST",body:JSON.stringify(e),mode:"cors",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{if(!n)throw KH.standardErrors.rpc.parse({});const i=n,{error:s}=i;if(s)throw(0,KH.serializeError)(s,e.method);return i})}}za.RelayAbstract=$je;var Jm={},vae={exports:{}},zP={exports:{}},kw={},IC={};IC.byteLength=Dje;IC.toByteArray=Bje;IC.fromByteArray=Uje;var Al=[],$a=[],Nje=typeof Uint8Array<"u"?Uint8Array:Array,I9="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var pp=0,Mje=I9.length;pp0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function Dje(t){var e=yae(t),r=e[0],n=e[1];return(r+n)*3/4-n}function Lje(t,e,r){return(e+r)*3/4-r}function Bje(t){var e,r=yae(t),n=r[0],i=r[1],s=new Nje(Lje(t,n,i)),o=0,a=i>0?n-4:n,c;for(c=0;c>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=$a[t.charCodeAt(c)]<<2|$a[t.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=$a[t.charCodeAt(c)]<<10|$a[t.charCodeAt(c+1)]<<4|$a[t.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function Fje(t){return Al[t>>18&63]+Al[t>>12&63]+Al[t>>6&63]+Al[t&63]}function jje(t,e,r){for(var n,i=[],s=e;sa?a:o+s));return n===1?(e=t[r-1],i.push(Al[e>>2]+Al[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Al[e>>10]+Al[e>>4&63]+Al[e<<2&63]+"=")),i.join("")}var ON={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ON.read=function(t,e,r,n,i){var s,o,a=i*8-n-1,c=(1<>1,u=-7,f=r?i-1:0,d=r?-1:1,p=t[e+f];for(f+=d,s=p&(1<<-u)-1,p>>=-u,u+=a;u>0;s=s*256+t[e+f],f+=d,u-=8);for(o=s&(1<<-u)-1,s>>=-u,u+=n;u>0;o=o*256+t[e+f],f+=d,u-=8);if(s===0)s=1-l;else{if(s===c)return o?NaN:(p?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-l}return(p?-1:1)*o*Math.pow(2,s-n)};ON.write=function(t,e,r,n,i,s){var o,a,c,l=s*8-i-1,u=(1<>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:s-1,g=n?1:-1,v=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=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+f>=1?e+=d/c:e+=d*Math.pow(2,1-f),e*c>=2&&(o++,c/=2),o+f>=u?(a=0,o=u):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;t[r+p]=a&255,p+=g,a/=256,i-=8);for(o=o<0;t[r+p]=o&255,p+=g,o/=256,l-=8);t[r+p-g]|=v*128};/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */(function(t){const e=IC,r=ON,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=a,t.SlowBuffer=w,t.INSPECT_MAX_BYTES=50;const i=2147483647;t.kMaxLength=i,a.TYPED_ARRAY_SUPPORT=s(),!a.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 s(){try{const ee=new Uint8Array(1),j={foo:function(){return 42}};return Object.setPrototypeOf(j,Uint8Array.prototype),Object.setPrototypeOf(ee,j),ee.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function o(ee){if(ee>i)throw new RangeError('The value "'+ee+'" is invalid for option "size"');const j=new Uint8Array(ee);return Object.setPrototypeOf(j,a.prototype),j}function a(ee,j,W){if(typeof ee=="number"){if(typeof j=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return f(ee)}return c(ee,j,W)}a.poolSize=8192;function c(ee,j,W){if(typeof ee=="string")return d(ee,j);if(ArrayBuffer.isView(ee))return g(ee);if(ee==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ee);if(et(ee,ArrayBuffer)||ee&&et(ee.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(et(ee,SharedArrayBuffer)||ee&&et(ee.buffer,SharedArrayBuffer)))return v(ee,j,W);if(typeof ee=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const ie=ee.valueOf&&ee.valueOf();if(ie!=null&&ie!==ee)return a.from(ie,j,W);const de=y(ee);if(de)return de;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof ee[Symbol.toPrimitive]=="function")return a.from(ee[Symbol.toPrimitive]("string"),j,W);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ee)}a.from=function(ee,j,W){return c(ee,j,W)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function l(ee){if(typeof ee!="number")throw new TypeError('"size" argument must be of type number');if(ee<0)throw new RangeError('The value "'+ee+'" is invalid for option "size"')}function u(ee,j,W){return l(ee),ee<=0?o(ee):j!==void 0?typeof W=="string"?o(ee).fill(j,W):o(ee).fill(j):o(ee)}a.alloc=function(ee,j,W){return u(ee,j,W)};function f(ee){return l(ee),o(ee<0?0:b(ee)|0)}a.allocUnsafe=function(ee){return f(ee)},a.allocUnsafeSlow=function(ee){return f(ee)};function d(ee,j){if((typeof j!="string"||j==="")&&(j="utf8"),!a.isEncoding(j))throw new TypeError("Unknown encoding: "+j);const W=E(ee,j)|0;let ie=o(W);const de=ie.write(ee,j);return de!==W&&(ie=ie.slice(0,de)),ie}function p(ee){const j=ee.length<0?0:b(ee.length)|0,W=o(j);for(let ie=0;ie=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return ee|0}function w(ee){return+ee!=ee&&(ee=0),a.alloc(+ee)}a.isBuffer=function(j){return j!=null&&j._isBuffer===!0&&j!==a.prototype},a.compare=function(j,W){if(et(j,Uint8Array)&&(j=a.from(j,j.offset,j.byteLength)),et(W,Uint8Array)&&(W=a.from(W,W.offset,W.byteLength)),!a.isBuffer(j)||!a.isBuffer(W))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(j===W)return 0;let ie=j.length,de=W.length;for(let pe=0,be=Math.min(ie,de);pede.length?(a.isBuffer(be)||(be=a.from(be)),be.copy(de,pe)):Uint8Array.prototype.set.call(de,be,pe);else if(a.isBuffer(be))be.copy(de,pe);else throw new TypeError('"list" argument must be an Array of Buffers');pe+=be.length}return de};function E(ee,j){if(a.isBuffer(ee))return ee.length;if(ArrayBuffer.isView(ee)||et(ee,ArrayBuffer))return ee.byteLength;if(typeof ee!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof ee);const W=ee.length,ie=arguments.length>2&&arguments[2]===!0;if(!ie&&W===0)return 0;let de=!1;for(;;)switch(j){case"ascii":case"latin1":case"binary":return W;case"utf8":case"utf-8":return Oe(ee).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return W*2;case"hex":return W>>>1;case"base64":return ze(ee).length;default:if(de)return ie?-1:Oe(ee).length;j=(""+j).toLowerCase(),de=!0}}a.byteLength=E;function C(ee,j,W){let ie=!1;if((j===void 0||j<0)&&(j=0),j>this.length||((W===void 0||W>this.length)&&(W=this.length),W<=0)||(W>>>=0,j>>>=0,W<=j))return"";for(ee||(ee="utf8");;)switch(ee){case"hex":return L(this,j,W);case"utf8":case"utf-8":return x(this,j,W);case"ascii":return z(this,j,W);case"latin1":case"binary":return R(this,j,W);case"base64":return K(this,j,W);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return q(this,j,W);default:if(ie)throw new TypeError("Unknown encoding: "+ee);ee=(ee+"").toLowerCase(),ie=!0}}a.prototype._isBuffer=!0;function S(ee,j,W){const ie=ee[j];ee[j]=ee[W],ee[W]=ie}a.prototype.swap16=function(){const j=this.length;if(j%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let W=0;WW&&(j+=" ... "),""},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(j,W,ie,de,pe){if(et(j,Uint8Array)&&(j=a.from(j,j.offset,j.byteLength)),!a.isBuffer(j))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof j);if(W===void 0&&(W=0),ie===void 0&&(ie=j?j.length:0),de===void 0&&(de=0),pe===void 0&&(pe=this.length),W<0||ie>j.length||de<0||pe>this.length)throw new RangeError("out of range index");if(de>=pe&&W>=ie)return 0;if(de>=pe)return-1;if(W>=ie)return 1;if(W>>>=0,ie>>>=0,de>>>=0,pe>>>=0,this===j)return 0;let be=pe-de,je=ie-W;const Fe=Math.min(be,je),Qe=this.slice(de,pe),kt=j.slice(W,ie);for(let Ze=0;Ze2147483647?W=2147483647:W<-2147483648&&(W=-2147483648),W=+W,He(W)&&(W=de?0:ee.length-1),W<0&&(W=ee.length+W),W>=ee.length){if(de)return-1;W=ee.length-1}else if(W<0)if(de)W=0;else return-1;if(typeof j=="string"&&(j=a.from(j,ie)),a.isBuffer(j))return j.length===0?-1:_(ee,j,W,ie,de);if(typeof j=="number")return j=j&255,typeof Uint8Array.prototype.indexOf=="function"?de?Uint8Array.prototype.indexOf.call(ee,j,W):Uint8Array.prototype.lastIndexOf.call(ee,j,W):_(ee,[j],W,ie,de);throw new TypeError("val must be string, number or Buffer")}function _(ee,j,W,ie,de){let pe=1,be=ee.length,je=j.length;if(ie!==void 0&&(ie=String(ie).toLowerCase(),ie==="ucs2"||ie==="ucs-2"||ie==="utf16le"||ie==="utf-16le")){if(ee.length<2||j.length<2)return-1;pe=2,be/=2,je/=2,W/=2}function Fe(kt,Ze){return pe===1?kt[Ze]:kt.readUInt16BE(Ze*pe)}let Qe;if(de){let kt=-1;for(Qe=W;Qebe&&(W=be-je),Qe=W;Qe>=0;Qe--){let kt=!0;for(let Ze=0;Zede&&(ie=de)):ie=de;const pe=j.length;ie>pe/2&&(ie=pe/2);let be;for(be=0;be>>0,isFinite(ie)?(ie=ie>>>0,de===void 0&&(de="utf8")):(de=ie,ie=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const pe=this.length-W;if((ie===void 0||ie>pe)&&(ie=pe),j.length>0&&(ie<0||W<0)||W>this.length)throw new RangeError("Attempt to write outside buffer bounds");de||(de="utf8");let be=!1;for(;;)switch(de){case"hex":return T(this,j,W,ie);case"utf8":case"utf-8":return Q(this,j,W,ie);case"ascii":case"latin1":case"binary":return Z(this,j,W,ie);case"base64":return ne(this,j,W,ie);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ce(this,j,W,ie);default:if(be)throw new TypeError("Unknown encoding: "+de);de=(""+de).toLowerCase(),be=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function K(ee,j,W){return j===0&&W===ee.length?e.fromByteArray(ee):e.fromByteArray(ee.slice(j,W))}function x(ee,j,W){W=Math.min(ee.length,W);const ie=[];let de=j;for(;de239?4:pe>223?3:pe>191?2:1;if(de+je<=W){let Fe,Qe,kt,Ze;switch(je){case 1:pe<128&&(be=pe);break;case 2:Fe=ee[de+1],(Fe&192)===128&&(Ze=(pe&31)<<6|Fe&63,Ze>127&&(be=Ze));break;case 3:Fe=ee[de+1],Qe=ee[de+2],(Fe&192)===128&&(Qe&192)===128&&(Ze=(pe&15)<<12|(Fe&63)<<6|Qe&63,Ze>2047&&(Ze<55296||Ze>57343)&&(be=Ze));break;case 4:Fe=ee[de+1],Qe=ee[de+2],kt=ee[de+3],(Fe&192)===128&&(Qe&192)===128&&(kt&192)===128&&(Ze=(pe&15)<<18|(Fe&63)<<12|(Qe&63)<<6|kt&63,Ze>65535&&Ze<1114112&&(be=Ze))}}be===null?(be=65533,je=1):be>65535&&(be-=65536,ie.push(be>>>10&1023|55296),be=56320|be&1023),ie.push(be),de+=je}return B(ie)}const A=4096;function B(ee){const j=ee.length;if(j<=A)return String.fromCharCode.apply(String,ee);let W="",ie=0;for(;ieie)&&(W=ie);let de="";for(let pe=j;peie&&(j=ie),W<0?(W+=ie,W<0&&(W=0)):W>ie&&(W=ie),WW)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(j,W,ie){j=j>>>0,W=W>>>0,ie||N(j,W,this.length);let de=this[j],pe=1,be=0;for(;++be>>0,W=W>>>0,ie||N(j,W,this.length);let de=this[j+--W],pe=1;for(;W>0&&(pe*=256);)de+=this[j+--W]*pe;return de},a.prototype.readUint8=a.prototype.readUInt8=function(j,W){return j=j>>>0,W||N(j,1,this.length),this[j]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(j,W){return j=j>>>0,W||N(j,2,this.length),this[j]|this[j+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(j,W){return j=j>>>0,W||N(j,2,this.length),this[j]<<8|this[j+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(j,W){return j=j>>>0,W||N(j,4,this.length),(this[j]|this[j+1]<<8|this[j+2]<<16)+this[j+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(j,W){return j=j>>>0,W||N(j,4,this.length),this[j]*16777216+(this[j+1]<<16|this[j+2]<<8|this[j+3])},a.prototype.readBigUInt64LE=Ye(function(j){j=j>>>0,ue(j,"offset");const W=this[j],ie=this[j+7];(W===void 0||ie===void 0)&&he(j,this.length-8);const de=W+this[++j]*2**8+this[++j]*2**16+this[++j]*2**24,pe=this[++j]+this[++j]*2**8+this[++j]*2**16+ie*2**24;return BigInt(de)+(BigInt(pe)<>>0,ue(j,"offset");const W=this[j],ie=this[j+7];(W===void 0||ie===void 0)&&he(j,this.length-8);const de=W*2**24+this[++j]*2**16+this[++j]*2**8+this[++j],pe=this[++j]*2**24+this[++j]*2**16+this[++j]*2**8+ie;return(BigInt(de)<>>0,W=W>>>0,ie||N(j,W,this.length);let de=this[j],pe=1,be=0;for(;++be=pe&&(de-=Math.pow(2,8*W)),de},a.prototype.readIntBE=function(j,W,ie){j=j>>>0,W=W>>>0,ie||N(j,W,this.length);let de=W,pe=1,be=this[j+--de];for(;de>0&&(pe*=256);)be+=this[j+--de]*pe;return pe*=128,be>=pe&&(be-=Math.pow(2,8*W)),be},a.prototype.readInt8=function(j,W){return j=j>>>0,W||N(j,1,this.length),this[j]&128?(255-this[j]+1)*-1:this[j]},a.prototype.readInt16LE=function(j,W){j=j>>>0,W||N(j,2,this.length);const ie=this[j]|this[j+1]<<8;return ie&32768?ie|4294901760:ie},a.prototype.readInt16BE=function(j,W){j=j>>>0,W||N(j,2,this.length);const ie=this[j+1]|this[j]<<8;return ie&32768?ie|4294901760:ie},a.prototype.readInt32LE=function(j,W){return j=j>>>0,W||N(j,4,this.length),this[j]|this[j+1]<<8|this[j+2]<<16|this[j+3]<<24},a.prototype.readInt32BE=function(j,W){return j=j>>>0,W||N(j,4,this.length),this[j]<<24|this[j+1]<<16|this[j+2]<<8|this[j+3]},a.prototype.readBigInt64LE=Ye(function(j){j=j>>>0,ue(j,"offset");const W=this[j],ie=this[j+7];(W===void 0||ie===void 0)&&he(j,this.length-8);const de=this[j+4]+this[j+5]*2**8+this[j+6]*2**16+(ie<<24);return(BigInt(de)<>>0,ue(j,"offset");const W=this[j],ie=this[j+7];(W===void 0||ie===void 0)&&he(j,this.length-8);const de=(W<<24)+this[++j]*2**16+this[++j]*2**8+this[++j];return(BigInt(de)<>>0,W||N(j,4,this.length),r.read(this,j,!0,23,4)},a.prototype.readFloatBE=function(j,W){return j=j>>>0,W||N(j,4,this.length),r.read(this,j,!1,23,4)},a.prototype.readDoubleLE=function(j,W){return j=j>>>0,W||N(j,8,this.length),r.read(this,j,!0,52,8)},a.prototype.readDoubleBE=function(j,W){return j=j>>>0,W||N(j,8,this.length),r.read(this,j,!1,52,8)};function I(ee,j,W,ie,de,pe){if(!a.isBuffer(ee))throw new TypeError('"buffer" argument must be a Buffer instance');if(j>de||jee.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(j,W,ie,de){if(j=+j,W=W>>>0,ie=ie>>>0,!de){const je=Math.pow(2,8*ie)-1;I(this,j,W,ie,je,0)}let pe=1,be=0;for(this[W]=j&255;++be>>0,ie=ie>>>0,!de){const je=Math.pow(2,8*ie)-1;I(this,j,W,ie,je,0)}let pe=ie-1,be=1;for(this[W+pe]=j&255;--pe>=0&&(be*=256);)this[W+pe]=j/be&255;return W+ie},a.prototype.writeUint8=a.prototype.writeUInt8=function(j,W,ie){return j=+j,W=W>>>0,ie||I(this,j,W,1,255,0),this[W]=j&255,W+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(j,W,ie){return j=+j,W=W>>>0,ie||I(this,j,W,2,65535,0),this[W]=j&255,this[W+1]=j>>>8,W+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(j,W,ie){return j=+j,W=W>>>0,ie||I(this,j,W,2,65535,0),this[W]=j>>>8,this[W+1]=j&255,W+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(j,W,ie){return j=+j,W=W>>>0,ie||I(this,j,W,4,4294967295,0),this[W+3]=j>>>24,this[W+2]=j>>>16,this[W+1]=j>>>8,this[W]=j&255,W+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(j,W,ie){return j=+j,W=W>>>0,ie||I(this,j,W,4,4294967295,0),this[W]=j>>>24,this[W+1]=j>>>16,this[W+2]=j>>>8,this[W+3]=j&255,W+4};function U(ee,j,W,ie,de){Y(j,ie,de,ee,W,7);let pe=Number(j&BigInt(4294967295));ee[W++]=pe,pe=pe>>8,ee[W++]=pe,pe=pe>>8,ee[W++]=pe,pe=pe>>8,ee[W++]=pe;let be=Number(j>>BigInt(32)&BigInt(4294967295));return ee[W++]=be,be=be>>8,ee[W++]=be,be=be>>8,ee[W++]=be,be=be>>8,ee[W++]=be,W}function re(ee,j,W,ie,de){Y(j,ie,de,ee,W,7);let pe=Number(j&BigInt(4294967295));ee[W+7]=pe,pe=pe>>8,ee[W+6]=pe,pe=pe>>8,ee[W+5]=pe,pe=pe>>8,ee[W+4]=pe;let be=Number(j>>BigInt(32)&BigInt(4294967295));return ee[W+3]=be,be=be>>8,ee[W+2]=be,be=be>>8,ee[W+1]=be,be=be>>8,ee[W]=be,W+8}a.prototype.writeBigUInt64LE=Ye(function(j,W=0){return U(this,j,W,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=Ye(function(j,W=0){return re(this,j,W,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(j,W,ie,de){if(j=+j,W=W>>>0,!de){const Fe=Math.pow(2,8*ie-1);I(this,j,W,ie,Fe-1,-Fe)}let pe=0,be=1,je=0;for(this[W]=j&255;++pe>0)-je&255;return W+ie},a.prototype.writeIntBE=function(j,W,ie,de){if(j=+j,W=W>>>0,!de){const Fe=Math.pow(2,8*ie-1);I(this,j,W,ie,Fe-1,-Fe)}let pe=ie-1,be=1,je=0;for(this[W+pe]=j&255;--pe>=0&&(be*=256);)j<0&&je===0&&this[W+pe+1]!==0&&(je=1),this[W+pe]=(j/be>>0)-je&255;return W+ie},a.prototype.writeInt8=function(j,W,ie){return j=+j,W=W>>>0,ie||I(this,j,W,1,127,-128),j<0&&(j=255+j+1),this[W]=j&255,W+1},a.prototype.writeInt16LE=function(j,W,ie){return j=+j,W=W>>>0,ie||I(this,j,W,2,32767,-32768),this[W]=j&255,this[W+1]=j>>>8,W+2},a.prototype.writeInt16BE=function(j,W,ie){return j=+j,W=W>>>0,ie||I(this,j,W,2,32767,-32768),this[W]=j>>>8,this[W+1]=j&255,W+2},a.prototype.writeInt32LE=function(j,W,ie){return j=+j,W=W>>>0,ie||I(this,j,W,4,2147483647,-2147483648),this[W]=j&255,this[W+1]=j>>>8,this[W+2]=j>>>16,this[W+3]=j>>>24,W+4},a.prototype.writeInt32BE=function(j,W,ie){return j=+j,W=W>>>0,ie||I(this,j,W,4,2147483647,-2147483648),j<0&&(j=4294967295+j+1),this[W]=j>>>24,this[W+1]=j>>>16,this[W+2]=j>>>8,this[W+3]=j&255,W+4},a.prototype.writeBigInt64LE=Ye(function(j,W=0){return U(this,j,W,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=Ye(function(j,W=0){return re(this,j,W,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function M(ee,j,W,ie,de,pe){if(W+ie>ee.length)throw new RangeError("Index out of range");if(W<0)throw new RangeError("Index out of range")}function G(ee,j,W,ie,de){return j=+j,W=W>>>0,de||M(ee,j,W,4),r.write(ee,j,W,ie,23,4),W+4}a.prototype.writeFloatLE=function(j,W,ie){return G(this,j,W,!0,ie)},a.prototype.writeFloatBE=function(j,W,ie){return G(this,j,W,!1,ie)};function H(ee,j,W,ie,de){return j=+j,W=W>>>0,de||M(ee,j,W,8),r.write(ee,j,W,ie,52,8),W+8}a.prototype.writeDoubleLE=function(j,W,ie){return H(this,j,W,!0,ie)},a.prototype.writeDoubleBE=function(j,W,ie){return H(this,j,W,!1,ie)},a.prototype.copy=function(j,W,ie,de){if(!a.isBuffer(j))throw new TypeError("argument should be a Buffer");if(ie||(ie=0),!de&&de!==0&&(de=this.length),W>=j.length&&(W=j.length),W||(W=0),de>0&&de=this.length)throw new RangeError("Index out of range");if(de<0)throw new RangeError("sourceEnd out of bounds");de>this.length&&(de=this.length),j.length-W>>0,ie=ie===void 0?this.length:ie>>>0,j||(j=0);let pe;if(typeof j=="number")for(pe=W;pe2**32?de=D(String(W)):typeof W=="bigint"&&(de=String(W),(W>BigInt(2)**BigInt(32)||W<-(BigInt(2)**BigInt(32)))&&(de=D(de)),de+="n"),ie+=` It must be ${j}. Received ${de}`,ie},RangeError);function D(ee){let j="",W=ee.length;const ie=ee[0]==="-"?1:0;for(;W>=ie+4;W-=3)j=`_${ee.slice(W-3,W)}${j}`;return`${ee.slice(0,W)}${j}`}function F(ee,j,W){ue(j,"offset"),(ee[j]===void 0||ee[j+W]===void 0)&&he(j,ee.length-(W+1))}function Y(ee,j,W,ie,de,pe){if(ee>W||ee3?j===0||j===BigInt(0)?je=`>= 0${be} and < 2${be} ** ${(pe+1)*8}${be}`:je=`>= -(2${be} ** ${(pe+1)*8-1}${be}) and < 2 ** ${(pe+1)*8-1}${be}`:je=`>= ${j}${be} and <= ${W}${be}`,new J.ERR_OUT_OF_RANGE("value",je,ee)}F(ie,de,pe)}function ue(ee,j){if(typeof ee!="number")throw new J.ERR_INVALID_ARG_TYPE(j,"number",ee)}function he(ee,j,W){throw Math.floor(ee)!==ee?(ue(ee,W),new J.ERR_OUT_OF_RANGE(W||"offset","an integer",ee)):j<0?new J.ERR_BUFFER_OUT_OF_BOUNDS:new J.ERR_OUT_OF_RANGE(W||"offset",`>= ${W?1:0} and <= ${j}`,ee)}const Ce=/[^+/0-9A-Za-z-_]/g;function Me(ee){if(ee=ee.split("=")[0],ee=ee.trim().replace(Ce,""),ee.length<2)return"";for(;ee.length%4!==0;)ee=ee+"=";return ee}function Oe(ee,j){j=j||1/0;let W;const ie=ee.length;let de=null;const pe=[];for(let be=0;be55295&&W<57344){if(!de){if(W>56319){(j-=3)>-1&&pe.push(239,191,189);continue}else if(be+1===ie){(j-=3)>-1&&pe.push(239,191,189);continue}de=W;continue}if(W<56320){(j-=3)>-1&&pe.push(239,191,189),de=W;continue}W=(de-55296<<10|W-56320)+65536}else de&&(j-=3)>-1&&pe.push(239,191,189);if(de=null,W<128){if((j-=1)<0)break;pe.push(W)}else if(W<2048){if((j-=2)<0)break;pe.push(W>>6|192,W&63|128)}else if(W<65536){if((j-=3)<0)break;pe.push(W>>12|224,W>>6&63|128,W&63|128)}else if(W<1114112){if((j-=4)<0)break;pe.push(W>>18|240,W>>12&63|128,W>>6&63|128,W&63|128)}else throw new Error("Invalid code point")}return pe}function We(ee){const j=[];for(let W=0;W>8,de=W%256,pe.push(de),pe.push(ie);return pe}function ze(ee){return e.toByteArray(Me(ee))}function Le(ee,j,W,ie){let de;for(de=0;de=j.length||de>=ee.length);++de)j[de+W]=ee[de];return de}function et(ee,j){return ee instanceof j||ee!=null&&ee.constructor!=null&&ee.constructor.name!=null&&ee.constructor.name===j.name}function He(ee){return ee!==ee}const Ge=function(){const ee="0123456789abcdef",j=new Array(256);for(let W=0;W<16;++W){const ie=W*16;for(let de=0;de<16;++de)j[ie+de]=ee[W]+ee[de]}return j}();function Ye(ee){return typeof BigInt>"u"?qe:ee}function qe(){throw new Error("BigInt not supported")}})(kw);/*! safe-buffer. MIT License. Feross Aboukhadijeh */(function(t,e){var r=kw,n=r.Buffer;function i(o,a){for(var c in o)a[c]=o[c]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,e),e.Buffer=s);function s(o,a,c){return n(o,a,c)}s.prototype=Object.create(n.prototype),i(n,s),s.from=function(o,a,c){if(typeof o=="number")throw new TypeError("Argument must not be a number");return n(o,a,c)},s.alloc=function(o,a,c){if(typeof o!="number")throw new TypeError("Argument must be a number");var l=n(o);return a!==void 0?typeof c=="string"?l.fill(a,c):l.fill(a):l.fill(0),l},s.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return n(o)},s.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(o)}})(zP,zP.exports);var xh=zP.exports,bae=xh.Buffer;function PC(t,e){this._block=bae.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}PC.prototype.update=function(t,e){typeof t=="string"&&(e=e||"utf8",t=bae.from(t,e));for(var r=this._block,n=this._blockSize,i=t.length,s=this._len,o=0;o=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(r&4294967295)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var s=this._hash();return t?s.toString(t):s};PC.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var Qm=PC,zje=tc,wae=Qm,Hje=xh.Buffer,qje=[1518500249,1859775393,-1894007588,-899497514],Wje=new Array(80);function Iw(){this.init(),this._w=Wje,wae.call(this,64,56)}zje(Iw,wae);Iw.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Vje(t){return t<<5|t>>>27}function Gje(t){return t<<30|t>>>2}function Kje(t,e,r,n){return t===0?e&r|~e&n:t===2?e&r|e&n|r&n:e^r^n}Iw.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=0;a<16;++a)e[a]=t.readInt32BE(a*4);for(;a<80;++a)e[a]=e[a-3]^e[a-8]^e[a-14]^e[a-16];for(var c=0;c<80;++c){var l=~~(c/20),u=Vje(r)+Kje(l,n,i,s)+o+e[c]+qje[l]|0;o=s,s=i,i=Gje(n),n=r,r=u}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0};Iw.prototype._hash=function(){var t=Hje.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};var Jje=Iw,Qje=tc,xae=Qm,Yje=xh.Buffer,Zje=[1518500249,1859775393,-1894007588,-899497514],Xje=new Array(80);function Pw(){this.init(),this._w=Xje,xae.call(this,64,56)}Qje(Pw,xae);Pw.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function eUe(t){return t<<1|t>>>31}function tUe(t){return t<<5|t>>>27}function rUe(t){return t<<30|t>>>2}function nUe(t,e,r,n){return t===0?e&r|~e&n:t===2?e&r|e&n|r&n:e^r^n}Pw.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=0;a<16;++a)e[a]=t.readInt32BE(a*4);for(;a<80;++a)e[a]=eUe(e[a-3]^e[a-8]^e[a-14]^e[a-16]);for(var c=0;c<80;++c){var l=~~(c/20),u=tUe(r)+nUe(l,n,i,s)+o+e[c]+Zje[l]|0;o=s,s=i,i=rUe(n),n=r,r=u}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0};Pw.prototype._hash=function(){var t=Yje.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};var iUe=Pw,sUe=tc,Eae=Qm,oUe=xh.Buffer,aUe=[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],cUe=new Array(64);function Rw(){this.init(),this._w=cUe,Eae.call(this,64,56)}sUe(Rw,Eae);Rw.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function lUe(t,e,r){return r^t&(e^r)}function uUe(t,e,r){return t&e|r&(t|e)}function fUe(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function dUe(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function hUe(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}function pUe(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10}Rw.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=this._f|0,c=this._g|0,l=this._h|0,u=0;u<16;++u)e[u]=t.readInt32BE(u*4);for(;u<64;++u)e[u]=pUe(e[u-2])+e[u-7]+hUe(e[u-15])+e[u-16]|0;for(var f=0;f<64;++f){var d=l+dUe(o)+lUe(o,a,c)+aUe[f]+e[f]|0,p=fUe(r)+uUe(r,n,i)|0;l=c,c=a,a=o,o=s+d|0,s=i,i=n,n=r,r=d+p|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0,this._f=a+this._f|0,this._g=c+this._g|0,this._h=l+this._h|0};Rw.prototype._hash=function(){var t=oUe.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t};var _ae=Rw,gUe=tc,mUe=_ae,vUe=Qm,yUe=xh.Buffer,bUe=new Array(64);function RC(){this.init(),this._w=bUe,vUe.call(this,64,56)}gUe(RC,mUe);RC.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};RC.prototype._hash=function(){var t=yUe.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t};var wUe=RC,xUe=tc,Cae=Qm,EUe=xh.Buffer,JH=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],_Ue=new Array(160);function Tw(){this.init(),this._w=_Ue,Cae.call(this,128,112)}xUe(Tw,Cae);Tw.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function QH(t,e,r){return r^t&(e^r)}function YH(t,e,r){return t&e|r&(t|e)}function ZH(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function XH(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function CUe(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function SUe(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function AUe(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function kUe(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function Oi(t,e){return t>>>0>>0?1:0}Tw.prototype._update=function(t){for(var e=this._w,r=this._ah|0,n=this._bh|0,i=this._ch|0,s=this._dh|0,o=this._eh|0,a=this._fh|0,c=this._gh|0,l=this._hh|0,u=this._al|0,f=this._bl|0,d=this._cl|0,p=this._dl|0,g=this._el|0,v=this._fl|0,y=this._gl|0,b=this._hl|0,w=0;w<32;w+=2)e[w]=t.readInt32BE(w*4),e[w+1]=t.readInt32BE(w*4+4);for(;w<160;w+=2){var E=e[w-30],C=e[w-15*2+1],S=CUe(E,C),P=SUe(C,E);E=e[w-2*2],C=e[w-2*2+1];var _=AUe(E,C),T=kUe(C,E),Q=e[w-7*2],Z=e[w-7*2+1],ne=e[w-16*2],ce=e[w-16*2+1],K=P+Z|0,x=S+Q+Oi(K,P)|0;K=K+T|0,x=x+_+Oi(K,T)|0,K=K+ce|0,x=x+ne+Oi(K,ce)|0,e[w]=x,e[w+1]=K}for(var A=0;A<160;A+=2){x=e[A],K=e[A+1];var B=YH(r,n,i),z=YH(u,f,d),R=ZH(r,u),L=ZH(u,r),q=XH(o,g),N=XH(g,o),I=JH[A],U=JH[A+1],re=QH(o,a,c),M=QH(g,v,y),G=b+N|0,H=l+q+Oi(G,b)|0;G=G+M|0,H=H+re+Oi(G,M)|0,G=G+U|0,H=H+I+Oi(G,U)|0,G=G+K|0,H=H+x+Oi(G,K)|0;var J=L+z|0,X=R+B+Oi(J,L)|0;l=c,b=y,c=a,y=v,a=o,v=g,g=p+G|0,o=s+H+Oi(g,p)|0,s=i,p=d,i=n,d=f,n=r,f=u,u=G+J|0,r=H+X+Oi(u,G)|0}this._al=this._al+u|0,this._bl=this._bl+f|0,this._cl=this._cl+d|0,this._dl=this._dl+p|0,this._el=this._el+g|0,this._fl=this._fl+v|0,this._gl=this._gl+y|0,this._hl=this._hl+b|0,this._ah=this._ah+r+Oi(this._al,u)|0,this._bh=this._bh+n+Oi(this._bl,f)|0,this._ch=this._ch+i+Oi(this._cl,d)|0,this._dh=this._dh+s+Oi(this._dl,p)|0,this._eh=this._eh+o+Oi(this._el,g)|0,this._fh=this._fh+a+Oi(this._fl,v)|0,this._gh=this._gh+c+Oi(this._gl,y)|0,this._hh=this._hh+l+Oi(this._hl,b)|0};Tw.prototype._hash=function(){var t=EUe.allocUnsafe(64);function e(r,n,i){t.writeInt32BE(r,i),t.writeInt32BE(n,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t};var Sae=Tw,IUe=tc,PUe=Sae,RUe=Qm,TUe=xh.Buffer,OUe=new Array(160);function TC(){this.init(),this._w=OUe,RUe.call(this,128,112)}IUe(TC,PUe);TC.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};TC.prototype._hash=function(){var t=TUe.allocUnsafe(48);function e(r,n,i){t.writeInt32BE(r,i),t.writeInt32BE(n,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t};var $Ue=TC,C1=vae.exports=function(e){e=e.toLowerCase();var r=C1[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r};C1.sha=Jje;C1.sha1=iUe;C1.sha224=wUe;C1.sha256=_ae;C1.sha384=$Ue;C1.sha512=Sae;var NUe=vae.exports;Object.defineProperty(Jm,"__esModule",{value:!0});Jm.Session=void 0;const eq=NUe,tq=st,rq="session:id",nq="session:secret",iq="session:linked";class $N{constructor(e,r,n,i){this._storage=e,this._id=r||(0,tq.randomBytesHex)(16),this._secret=n||(0,tq.randomBytesHex)(32),this._key=new eq.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(e){const r=e.getItem(rq),n=e.getItem(iq),i=e.getItem(nq);return r&&i?new $N(e,r,i,n==="1"):null}static hash(e){return new eq.sha256().update(e).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this._storage.setItem(rq,this._id),this._storage.setItem(nq,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(iq,this._linked?"1":"0")}}Jm.Session=$N;var OC={},$C={};Object.defineProperty($C,"__esModule",{value:!0});$C.Cipher=void 0;const r3=st;class MUe{constructor(e){this.secret=e}async encrypt(e){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),i=await crypto.subtle.importKey("raw",(0,r3.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=new TextEncoder,o=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},i,s.encode(e)),a=16,c=o.slice(o.byteLength-a),l=o.slice(0,o.byteLength-a),u=new Uint8Array(c),f=new Uint8Array(l),d=new Uint8Array([...n,...u,...f]);return(0,r3.uint8ArrayToHex)(d)}async decrypt(e){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");return new Promise((n,i)=>{(async function(){const s=await crypto.subtle.importKey("raw",(0,r3.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),o=(0,r3.hexStringToUint8Array)(e),a=o.slice(0,12),c=o.slice(12,28),l=o.slice(28),u=new Uint8Array([...l,...c]),f={name:"AES-GCM",iv:new Uint8Array(a)};try{const d=await window.crypto.subtle.decrypt(f,s,u),p=new TextDecoder;n(p.decode(d))}catch(d){i(d)}})()})}}$C.Cipher=MUe;var NC={};Object.defineProperty(NC,"__esModule",{value:!0});NC.WalletLinkHTTP=void 0;class DUe{constructor(e,r,n){this.linkAPIUrl=e,this.sessionId=r;const i=`${r}:${n}`;this.auth=`Basic ${btoa(i)}`}async markUnseenEventsAsSeen(e){return Promise.all(e.map(r=>fetch(`${this.linkAPIUrl}/events/${r.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(r=>console.error("Unabled to mark event as failed:",r))}async fetchUnseenEvents(){var e;const r=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(r.ok){const{events:n,error:i}=await r.json();if(i)throw new Error(`Check unseen events failed: ${i}`);const s=(e=n==null?void 0:n.filter(o=>o.event==="Web3Response").map(o=>({type:"Event",sessionId:this.sessionId,eventId:o.id,event:o.event,data:o.data})))!==null&&e!==void 0?e:[];return this.markUnseenEventsAsSeen(s),s}throw new Error(`Check unseen events failed: ${r.status}`)}}NC.WalletLinkHTTP=DUe;var cm={};Object.defineProperty(cm,"__esModule",{value:!0});cm.WalletLinkWebSocket=cm.ConnectionState=void 0;var rg;(function(t){t[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED"})(rg||(cm.ConnectionState=rg={}));class LUe{setConnectionStateListener(e){this.connectionStateListener=e}setIncomingDataListener(e){this.incomingDataListener=e}constructor(e,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.pendingData=[],this.url=e.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((e,r)=>{var n;let i;try{this.webSocket=i=new this.WebSocketClass(this.url)}catch(s){r(s);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,rg.CONNECTING),i.onclose=s=>{var o;this.clearWebSocket(),r(new Error(`websocket error ${s.code}: ${s.reason}`)),(o=this.connectionStateListener)===null||o===void 0||o.call(this,rg.DISCONNECTED)},i.onopen=s=>{var o;e(),(o=this.connectionStateListener)===null||o===void 0||o.call(this,rg.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(c=>this.sendData(c)),this.pendingData=[])},i.onmessage=s=>{var o,a;if(s.data==="h")(o=this.incomingDataListener)===null||o===void 0||o.call(this,{type:"Heartbeat"});else try{const c=JSON.parse(s.data);(a=this.incomingDataListener)===null||a===void 0||a.call(this,c)}catch{}}})}disconnect(){var e;const{webSocket:r}=this;if(r){this.clearWebSocket(),(e=this.connectionStateListener)===null||e===void 0||e.call(this,rg.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{r.close()}catch{}}}sendData(e){const{webSocket:r}=this;if(!r){this.pendingData.push(e),this.connect();return}r.send(e)}clearWebSocket(){const{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}}cm.WalletLinkWebSocket=LUe;Object.defineProperty(OC,"__esModule",{value:!0});OC.WalletLinkConnection=void 0;const gp=xi,BUe=$C,al=Km,sq=za,mp=Jm,FUe=NC,n3=cm,oq=1e4,jUe=6e4;class UUe{constructor({session:e,linkAPIUrl:r,listener:n,diagnostic:i,WebSocketClass:s=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,gp.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=a=>{if(!a)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",l=>a.JsonRpcUrl&&this.handleChainUpdated(l,a.JsonRpcUrl)]]).forEach((l,u)=>{const f=a[u];f!==void 0&&l(f)})},this.handleDestroyed=a=>{var c,l;a==="1"&&((c=this.listener)===null||c===void 0||c.resetAndReload(),(l=this.diagnostic)===null||l===void 0||l.log(al.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:mp.Session.hash(this.session.id)}))},this.handleAccountUpdated=async a=>{var c,l;try{const u=await this.cipher.decrypt(a);(c=this.listener)===null||c===void 0||c.accountUpdated(u)}catch{(l=this.diagnostic)===null||l===void 0||l.log(al.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(a,c)=>{var l,u;try{const f=await this.cipher.decrypt(c);(l=this.listener)===null||l===void 0||l.metadataUpdated(a,f)}catch{(u=this.diagnostic)===null||u===void 0||u.log(al.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:a})}},this.handleWalletUsernameUpdated=async a=>{this.handleMetadataUpdated(sq.WALLET_USER_NAME_KEY,a)},this.handleAppVersionUpdated=async a=>{this.handleMetadataUpdated(sq.APP_VERSION_KEY,a)},this.handleChainUpdated=async(a,c)=>{var l,u;try{const f=await this.cipher.decrypt(a),d=await this.cipher.decrypt(c);(l=this.listener)===null||l===void 0||l.chainUpdated(f,d)}catch{(u=this.diagnostic)===null||u===void 0||u.log(al.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=e,this.cipher=new BUe.Cipher(e.secret),this.diagnostic=i,this.listener=n;const o=new n3.WalletLinkWebSocket(`${r}/rpc`,s);o.setConnectionStateListener(async a=>{var c;(c=this.diagnostic)===null||c===void 0||c.log(al.EVENTS.CONNECTED_STATE_CHANGE,{state:a,sessionIdHash:mp.Session.hash(e.id)});let l=!1;switch(a){case n3.ConnectionState.DISCONNECTED:if(!this.destroyed){const u=async()=>{await new Promise(f=>setTimeout(f,5e3)),this.destroyed||o.connect().catch(()=>{u()})};u()}break;case n3.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),l=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},oq),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case n3.ConnectionState.CONNECTING:break}this.connected!==l&&(this.connected=l)}),o.setIncomingDataListener(a=>{var c,l,u;switch(a.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const f=a.type==="IsLinkedOK"?a.linked:void 0;(c=this.diagnostic)===null||c===void 0||c.log(al.EVENTS.LINKED,{sessionIdHash:mp.Session.hash(e.id),linked:f,type:a.type,onlineGuests:a.onlineGuests}),this.linked=f||a.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(l=this.diagnostic)===null||l===void 0||l.log(al.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:mp.Session.hash(e.id),metadata_keys:a&&a.metadata?Object.keys(a.metadata):void 0}),this.handleSessionMetadataUpdated(a.metadata);break}case"Event":{this.handleIncomingEvent(a);break}}a.id!==void 0&&((u=this.requestResolutions.get(a.id))===null||u===void 0||u(a))}),this.ws=o,this.http=new FUe.WalletLinkHTTP(r,e.id,e.key)}connect(){var e;if(this.destroyed)throw new Error("instance is destroyed");(e=this.diagnostic)===null||e===void 0||e.log(al.EVENTS.STARTED_CONNECTING,{sessionIdHash:mp.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var e;this.destroyed=!0,this.ws.disconnect(),(e=this.diagnostic)===null||e===void 0||e.log(al.EVENTS.DISCONNECTED,{sessionIdHash:mp.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(e){var r,n;this._connected=e,e&&((r=this.onceConnected)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.connectedUpdated(e)}setOnceConnected(e){return new Promise(r=>{this.connected?e().then(r):this.onceConnected=()=>{e().then(r),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(e){var r,n;this._linked=e,e&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(e)}setOnceLinked(e){return new Promise(r=>{this.linked?e().then(r):this.onceLinked=()=>{e().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(e){var r,n;if(!(e.type!=="Event"||e.event!=="Web3Response"))try{const i=await this.cipher.decrypt(e.data),s=JSON.parse(i);if(s.type!=="WEB3_RESPONSE")return;(r=this.listener)===null||r===void 0||r.handleWeb3ResponseMessage(s)}catch{(n=this.diagnostic)===null||n===void 0||n.log(al.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(e=>setTimeout(e,250));try{await this.fetchUnseenEventsAPI()}catch(e){console.error("Unable to check for unseen events",e)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(r=>this.handleIncomingEvent(r))}async setSessionMetadata(e,r){const n={type:"SetSessionConfig",id:(0,gp.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[e]:r}};return this.setOnceConnected(async()=>{const i=await this.makeRequest(n);if(i.type==="Fail")throw new Error(i.error||"failed to set session metadata")})}async publishEvent(e,r,n=!1){const i=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),s={type:"PublishEvent",id:(0,gp.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:e,data:i,callWebhook:n};return this.setOnceLinked(async()=>{const o=await this.makeRequest(s);if(o.type==="Fail")throw new Error(o.error||"failed to publish event");return o.eventId})}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>oq*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(e,r=jUe){const n=e.id;this.sendData(e);let i;return Promise.race([new Promise((s,o)=>{i=window.setTimeout(()=>{o(new Error(`request ${n} timed out`))},r)}),new Promise(s=>{this.requestResolutions.set(n,o=>{clearTimeout(i),s(o),this.requestResolutions.delete(n)})})])}async authenticate(){const e={type:"HostSession",id:(0,gp.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(e);if(r.type==="Fail")throw new Error(r.error||"failed to authentcate")}sendIsLinked(){const e={type:"IsLinked",id:(0,gp.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}sendGetSessionConfig(){const e={type:"GetSessionConfig",id:(0,gp.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}}OC.WalletLinkConnection=UUe;var Ow={},$w={},NN={};Object.defineProperty(NN,"__esModule",{value:!0});NN.default=(()=>'@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}')();var zUe=Je&&Je.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty($w,"__esModule",{value:!0});$w.injectCssReset=void 0;const HUe=zUe(NN);function qUe(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(HUe.default)),document.documentElement.appendChild(t)}$w.injectCssReset=qUe;var MC={},Nw,Ot,Aae,kae,p0,aq,Iae,HP,Pae,_2={},Rae=[],WUe=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,DC=Array.isArray;function zu(t,e){for(var r in e)t[r]=e[r];return t}function Tae(t){var e=t.parentNode;e&&e.removeChild(t)}function qP(t,e,r){var n,i,s,o={};for(s in e)s=="key"?n=e[s]:s=="ref"?i=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?Nw.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)o[s]===void 0&&(o[s]=t.defaultProps[s]);return ub(t,o,n,i,null)}function ub(t,e,r,n,i){var s={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++Aae,__i:-1,__u:0};return i==null&&Ot.vnode!=null&&Ot.vnode(s),s}function VUe(){return{current:null}}function Mw(t){return t.children}function fb(t,e){this.props=t,this.context=e}function lm(t,e){if(e==null)return t.__?lm(t.__,t.__i+1):null;for(var r;ee&&p0.sort(HP));u_.__r=0}function $ae(t,e,r,n,i,s,o,a,c,l,u){var f,d,p,g,v,y=n&&n.__k||Rae,b=e.length;for(r.__d=c,GUe(r,e,y),c=r.__d,f=0;f0?ub(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=t,i.__b=t.__b+1,a=KUe(i,r,o=n+f,u),i.__i=a,s=null,a!==-1&&(u--,(s=r[a])&&(s.__u|=131072)),s==null||s.__v===null?(a==-1&&f--,typeof i.type!="function"&&(i.__u|=65536)):a!==o&&(a===o+1?f++:a>o?u>c-o?f+=a-o:f--:f=a(c!=null&&!(131072&c.__u)?1:0))for(;o>=0||a=0){if((c=e[o])&&!(131072&c.__u)&&i==c.key&&s===c.type)return o;o--}if(a2&&(a.children=arguments.length>3?Nw.call(arguments,2):r),ub(t.type,a,n||t.key,i||t.ref,null)}function ZUe(t,e){var r={__c:e="__cC"+Pae++,__:t,Consumer:function(n,i){return n.children(i)},Provider:function(n){var i,s;return this.getChildContext||(i=[],(s={})[e]=this,this.getChildContext=function(){return s},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&i.some(function(a){a.__e=!0,WP(a)})},this.sub=function(o){i.push(o);var a=o.componentWillUnmount;o.componentWillUnmount=function(){i.splice(i.indexOf(o),1),a&&a.call(o)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}Nw=Rae.slice,Ot={__e:function(t,e,r,n){for(var i,s,o;e=e.__;)if((i=e.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(t)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,n||{}),o=i.__d),o)return i.__E=i}catch(a){t=a}throw t}},Aae=0,kae=function(t){return t!=null&&t.constructor==null},fb.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=zu({},this.state),typeof t=="function"&&(t=t(zu({},r),this.props)),t&&zu(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),WP(this))},fb.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),WP(this))},fb.prototype.render=Mw,p0=[],Iae=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,HP=function(t,e){return t.__v.__b-e.__v.__b},u_.__r=0,Pae=0;const XUe=Object.freeze(Object.defineProperty({__proto__:null,Component:fb,Fragment:Mw,cloneElement:YUe,createContext:ZUe,createElement:qP,createRef:VUe,h:qP,hydrate:Bae,get isValidElement(){return kae},get options(){return Ot},render:Lae,toChildArray:Mae},Symbol.toStringTag,{value:"Module"})),Mo=wf(XUe);var LC={};function Fae(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e=r.__.length&&r.__.push({__V:yE}),r.__[t]}function Uae(t){return um=1,zae(qae,t)}function zae(t,e,r){var n=S1(df++,2);if(n.t=t,!n.__c&&(n.__=[r?r(e):qae(void 0,e),function(a){var c=n.__N?n.__N[0]:n.__[0],l=n.t(c,a);c!==l&&(n.__N=[l,n.__[1]],n.__c.setState({}))}],n.__c=Yr,!Yr.u)){var i=function(a,c,l){if(!n.__c.__H)return!0;var u=n.__c.__H.__.filter(function(d){return d.__c});if(u.every(function(d){return!d.__N}))return!s||s.call(this,a,c,l);var f=!1;return u.forEach(function(d){if(d.__N){var p=d.__[0];d.__=d.__N,d.__N=void 0,p!==d.__[0]&&(f=!0)}}),!(!f&&n.__c.props===a)&&(!s||s.call(this,a,c,l))};Yr.u=!0;var s=Yr.shouldComponentUpdate,o=Yr.componentWillUpdate;Yr.componentWillUpdate=function(a,c,l){if(this.__e){var u=s;s=void 0,i(a,c,l),s=u}o&&o.call(this,a,c,l)},Yr.shouldComponentUpdate=i}return n.__N||n.__}function tze(t,e){var r=S1(df++,3);!Ot.__s&&BN(r.__H,e)&&(r.__=t,r.i=e,Yr.__H.__h.push(r))}function Hae(t,e){var r=S1(df++,4);!Ot.__s&&BN(r.__H,e)&&(r.__=t,r.i=e,Yr.__h.push(r))}function rze(t){return um=5,LN(function(){return{current:t}},[])}function nze(t,e,r){um=6,Hae(function(){return typeof t=="function"?(t(e()),function(){return t(null)}):t?(t.current=e(),function(){return t.current=null}):void 0},r==null?r:r.concat(t))}function LN(t,e){var r=S1(df++,7);return BN(r.__H,e)?(r.__V=t(),r.i=e,r.__h=t,r.__V):r.__}function ize(t,e){return um=8,LN(function(){return t},e)}function sze(t){var e=Yr.context[t.__c],r=S1(df++,9);return r.c=t,e?(r.__==null&&(r.__=!0,e.sub(Yr)),e.props.value):t.__}function oze(t,e){Ot.useDebugValue&&Ot.useDebugValue(e?e(t):t)}function aze(t){var e=S1(df++,10),r=Uae();return e.__=t,Yr.componentDidCatch||(Yr.componentDidCatch=function(n,i){e.__&&e.__(n,i),r[1](n)}),[r[0],function(){r[1](void 0)}]}function cze(){var t=S1(df++,11);if(!t.__){for(var e=Yr.__v;e!==null&&!e.__m&&e.__!==null;)e=e.__;var r=e.__m||(e.__m=[0,0]);t.__="P"+r[0]+"-"+r[1]++}return t.__}function lze(){for(var t;t=jae.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(bE),t.__H.__h.forEach(GP),t.__H.__h=[]}catch(e){t.__H.__h=[],Ot.__e(e,t.__v)}}Ot.__b=function(t){Yr=null,hq&&hq(t)},Ot.__r=function(t){pq&&pq(t),df=0;var e=(Yr=t.__c).__H;e&&(P9===Yr?(e.__h=[],Yr.__h=[],e.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=yE,r.__N=r.i=void 0})):(e.__h.forEach(bE),e.__h.forEach(GP),e.__h=[],df=0)),P9=Yr},Ot.diffed=function(t){gq&&gq(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(jae.push(e)!==1&&dq===Ot.requestAnimationFrame||((dq=Ot.requestAnimationFrame)||uze)(lze)),e.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==yE&&(r.__=r.__V),r.i=void 0,r.__V=yE})),P9=Yr=null},Ot.__c=function(t,e){e.some(function(r){try{r.__h.forEach(bE),r.__h=r.__h.filter(function(n){return!n.__||GP(n)})}catch(n){e.some(function(i){i.__h&&(i.__h=[])}),e=[],Ot.__e(n,r.__v)}}),mq&&mq(t,e)},Ot.unmount=function(t){vq&&vq(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{bE(n)}catch(i){e=i}}),r.__H=void 0,e&&Ot.__e(e,r.__v))};var yq=typeof requestAnimationFrame=="function";function uze(t){var e,r=function(){clearTimeout(n),yq&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,100);yq&&(e=requestAnimationFrame(r))}function bE(t){var e=Yr,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),Yr=e}function GP(t){var e=Yr;t.__c=t.__(),Yr=e}function BN(t,e){return!t||t.length!==e.length||e.some(function(r,n){return r!==t[n]})}function qae(t,e){return typeof e=="function"?e(t):e}const fze=Object.freeze(Object.defineProperty({__proto__:null,useCallback:ize,useContext:sze,useDebugValue:oze,useEffect:tze,useErrorBoundary:aze,useId:cze,useImperativeHandle:nze,useLayoutEffect:Hae,useMemo:LN,useReducer:zae,useRef:rze,useState:Uae},Symbol.toStringTag,{value:"Module"})),BC=wf(fze);var fm={},FC={};Object.defineProperty(FC,"__esModule",{value:!0});FC.CloseIcon=void 0;const bq=Mo;function dze(t){return(0,bq.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),(0,bq.h)("path",{d:"M13.7677 13L12.3535 14.4142L18.3535 20.4142L12.3535 26.4142L13.7677 27.8284L19.7677 21.8284L25.7677 27.8284L27.1819 26.4142L21.1819 20.4142L27.1819 14.4142L25.7677 13L19.7677 19L13.7677 13Z"}))}FC.CloseIcon=dze;var jC={};Object.defineProperty(jC,"__esModule",{value:!0});jC.CoinbaseWalletRound=void 0;const s3=Mo;function hze(t){return(0,s3.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),(0,s3.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,s3.h)("path",{d:"M23.8521 14.0003C23.8521 19.455 19.455 23.8521 14.0003 23.8521C8.54559 23.8521 4.14844 19.455 4.14844 14.0003C4.14844 8.54559 8.54559 4.14844 14.0003 4.14844C19.455 4.14844 23.8521 8.54559 23.8521 14.0003Z",fill:"white"}),(0,s3.h)("path",{d:"M11.1855 12.5042C11.1855 12.0477 11.1855 11.7942 11.2835 11.642C11.3814 11.4899 11.4793 11.3377 11.6261 11.287C11.8219 11.1855 12.0178 11.1855 12.5073 11.1855H15.4934C15.983 11.1855 16.1788 11.1855 16.3746 11.287C16.5215 11.3884 16.6683 11.4899 16.7173 11.642C16.8152 11.8449 16.8152 12.0477 16.8152 12.5042V15.4965C16.8152 15.953 16.8152 16.2066 16.7173 16.3587C16.6194 16.5109 16.5215 16.663 16.3746 16.7137C16.1788 16.8152 15.983 16.8152 15.4934 16.8152H12.5073C12.0178 16.8152 11.8219 16.8152 11.6261 16.7137C11.4793 16.6123 11.3324 16.5109 11.2835 16.3587C11.1855 16.1558 11.1855 15.953 11.1855 15.4965V12.5042Z",fill:"#0052FF"}))}jC.CoinbaseWalletRound=hze;var UC={};Object.defineProperty(UC,"__esModule",{value:!0});UC.QRCodeIcon=void 0;const ny=Mo;function pze(t){return(0,ny.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t),(0,ny.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,ny.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,ny.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,ny.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}UC.QRCodeIcon=pze;var zC={};function Wae(t){this.mode=qo.MODE_8BIT_BYTE,this.data=t,this.parsedData=[];for(var e=0,r=this.data.length;e65536?(n[0]=240|(i&1835008)>>>18,n[1]=128|(i&258048)>>>12,n[2]=128|(i&4032)>>>6,n[3]=128|i&63):i>2048?(n[0]=224|(i&61440)>>>12,n[1]=128|(i&4032)>>>6,n[2]=128|i&63):i>128?(n[0]=192|(i&1984)>>>6,n[1]=128|i&63):n[0]=i,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}Wae.prototype={getLength:function(t){return this.parsedData.length},write:function(t){for(var e=0,r=this.parsedData.length;e=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=Ol.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(t,e){for(var r=-1;r<=7;r++)if(!(t+r<=-1||this.moduleCount<=t+r))for(var n=-1;n<=7;n++)e+n<=-1||this.moduleCount<=e+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[t+r][e+n]=!0:this.modules[t+r][e+n]=!1)},getBestMaskPattern:function(){for(var t=0,e=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=_n.getLostPoint(this);(r==0||t>n)&&(t=n,e=r)}return e},createMovieClip:function(t,e,r){var n=t.createEmptyMovieClip(e,r),i=1;this.make();for(var s=0;s>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!t&&(e>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(t,e){for(var r=this.errorCorrectLevel<<3|e,n=_n.getBCHTypeInfo(r),i=0;i<15;i++){var s=!t&&(n>>i&1)==1;i<6?this.modules[i][8]=s:i<8?this.modules[i+1][8]=s:this.modules[this.moduleCount-15+i][8]=s}for(var i=0;i<15;i++){var s=!t&&(n>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=s:i<9?this.modules[8][15-i-1+1]=s:this.modules[8][15-i-1]=s}this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var r=-1,n=this.moduleCount-1,i=7,s=0,o=this.moduleCount-1;o>0;o-=2)for(o==6&&o--;;){for(var a=0;a<2;a++)if(this.modules[n][o-a]==null){var c=!1;s>>i&1)==1);var l=_n.getMask(e,n,o-a);l&&(c=!c),this.modules[n][o-a]=c,i--,i==-1&&(s++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};Ol.PAD0=236;Ol.PAD1=17;Ol.createData=function(t,e,r){for(var n=kl.getRSBlocks(t,e),i=new Vae,s=0;sa*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+a*8+")");for(i.getLengthInBits()+4<=a*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=a*8||(i.put(Ol.PAD0,8),i.getLengthInBits()>=a*8));)i.put(Ol.PAD1,8);return Ol.createBytes(i,n)};Ol.createBytes=function(t,e){for(var r=0,n=0,i=0,s=new Array(e.length),o=new Array(e.length),a=0;a=0?p.get(g):0}}for(var v=0,u=0;u=0;)e^=_n.G15<<_n.getBCHDigit(e)-_n.getBCHDigit(_n.G15);return(t<<10|e)^_n.G15_MASK},getBCHTypeNumber:function(t){for(var e=t<<12;_n.getBCHDigit(e)-_n.getBCHDigit(_n.G18)>=0;)e^=_n.G18<<_n.getBCHDigit(e)-_n.getBCHDigit(_n.G18);return t<<12|e},getBCHDigit:function(t){for(var e=0;t!=0;)e++,t>>>=1;return e},getPatternPosition:function(t){return _n.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,r){switch(t){case Qf.PATTERN000:return(e+r)%2==0;case Qf.PATTERN001:return e%2==0;case Qf.PATTERN010:return r%3==0;case Qf.PATTERN011:return(e+r)%3==0;case Qf.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2==0;case Qf.PATTERN101:return e*r%2+e*r%3==0;case Qf.PATTERN110:return(e*r%2+e*r%3)%2==0;case Qf.PATTERN111:return(e*r%3+(e+r)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new Eg([1],0),r=0;r5&&(r+=3+s-5)}for(var n=0;n=256;)t-=255;return Li.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var Ki=0;Ki<8;Ki++)Li.EXP_TABLE[Ki]=1<>>7-t%8&1)==1},put:function(t,e){for(var r=0;r>>e-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var R9=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function Gae(t){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof t=="string"&&(t={content:t}),t)for(var e in t)this.options[e]=t[e];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function r(c){switch(c){case"L":return xd.L;case"M":return xd.M;case"Q":return xd.Q;case"H":return xd.H;default:throw new Error("Unknwon error correction level: "+c)}}function n(c,l){for(var u=i(c),f=1,d=0,p=0,g=R9.length;p<=g;p++){var v=R9[p];if(!v)throw new Error("Content too long: expected "+d+" but got "+u);switch(l){case"L":d=v[0];break;case"M":d=v[1];break;case"Q":d=v[2];break;case"H":d=v[3];break;default:throw new Error("Unknwon error correction level: "+l)}if(u<=d)break;f++}if(f>R9.length)throw new Error("Content too long");return f}function i(c){var l=encodeURI(c).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return l.length+(l.length!=c?3:0)}var s=this.options.content,o=n(s,this.options.ecl),a=r(this.options.ecl);this.qrcode=new Ol(o,a),this.qrcode.addData(s),this.qrcode.make()}Gae.prototype.svg=function(t){var e=this.options||{},r=this.qrcode.modules;typeof t>"u"&&(t={container:e.container||"svg"});for(var n=typeof e.pretty<"u"?!!e.pretty:!0,i=n?" ":"",s=n?`\r +`:"",o=e.width,a=e.height,c=r.length,l=o/(c+2*e.padding),u=a/(c+2*e.padding),f=typeof e.join<"u"?!!e.join:!1,d=typeof e.swap<"u"?!!e.swap:!1,p=typeof e.xmlDeclaration<"u"?!!e.xmlDeclaration:!0,g=typeof e.predefined<"u"?!!e.predefined:!1,v=g?i+''+s:"",y=i+''+s,b="",w="",E=0;E'+s:b+=i+''+s}}f&&(b=i+'');let ne="";if(this.options.image!==void 0&&this.options.image.svg){const K=o*this.options.image.width/100,x=a*this.options.image.height/100,A=o/2-K/2,B=a/2-x/2;ne+=``,ne+=this.options.image.svg+s,ne+=""}var ce="";switch(t.container){case"svg":p&&(ce+=''+s),ce+=''+s,ce+=v+y+b,ce+=ne,ce+="";break;case"svg-viewbox":p&&(ce+=''+s),ce+=''+s,ce+=v+y+b,ce+=ne,ce+="";break;case"g":ce+=''+s,ce+=v+y+b,ce+=ne,ce+="";break;default:ce+=(v+y+b+ne).replace(/^\s+/,"");break}return ce};var gze=Gae,mze=Je&&Je.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(zC,"__esModule",{value:!0});zC.QRCode=void 0;const vze=Mo,wq=BC,yze=mze(gze),bze=t=>{const[e,r]=(0,wq.useState)("");return(0,wq.useEffect)(()=>{var n,i;const s=new yze.default({content:t.content,background:t.bgColor||"#ffffff",color:t.fgColor||"#000000",container:"svg",ecl:"M",width:(n=t.width)!==null&&n!==void 0?n:256,height:(i=t.height)!==null&&i!==void 0?i:256,padding:0,image:t.image}),o=Buffer.from(s.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${o}`)},[t.bgColor,t.content,t.fgColor,t.height,t.image,t.width]),e?(0,vze.h)("img",{src:e,alt:"QR Code"}):null};zC.QRCode=bze;var HC={},FN={};Object.defineProperty(FN,"__esModule",{value:!0});FN.default=(()=>".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}")();var wze=Je&&Je.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(HC,"__esModule",{value:!0});HC.Spinner=void 0;const o3=Mo,xze=wze(FN),Eze=t=>{var e;const r=(e=t.size)!==null&&e!==void 0?e:64,n=t.color||"#000";return(0,o3.h)("div",{class:"-cbwsdk-spinner"},(0,o3.h)("style",null,xze.default),(0,o3.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,o3.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};HC.Spinner=Eze;var jN={};Object.defineProperty(jN,"__esModule",{value:!0});jN.default=(()=>".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer;border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}")();var Kae=Je&&Je.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fm,"__esModule",{value:!0});fm.CoinbaseWalletSteps=fm.ConnectContent=void 0;const F0=Kae(Dw),Er=Mo,_ze=st,Cze=Gm,Sze=FC,Aze=jC,kze=UC,Ize=zC,Pze=HC,Rze=Kae(jN),T9={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:Jae},Tze=t=>t==="light"?"#FFFFFF":"#0A0B0D";function Oze(t){const{theme:e}=t,r=(0,_ze.createQrUrl)(t.sessionId,t.sessionSecret,t.linkAPIUrl,t.isParentConnection,t.version,t.chainId),n=T9.steps;return(0,Er.h)("div",{"data-testid":"connect-content",className:(0,F0.default)("-cbwsdk-connect-content",e)},(0,Er.h)("style",null,Rze.default),(0,Er.h)("div",{className:"-cbwsdk-connect-content-header"},(0,Er.h)("h2",{className:(0,F0.default)("-cbwsdk-connect-content-heading",e)},"Scan to connect with our mobile app"),t.onCancel&&(0,Er.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:t.onCancel},(0,Er.h)(Sze.CloseIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Er.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,Er.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,Er.h)($ze,{title:T9.title,description:T9.description,theme:e})),(0,Er.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,Er.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,Er.h)(Ize.QRCode,{content:r,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,Er.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:Cze.LIB_VERSION}),(0,Er.h)("input",{type:"hidden",value:r})),(0,Er.h)(n,{theme:e}),!t.isConnected&&(0,Er.h)("div",{"data-testid":"connecting-spinner",className:(0,F0.default)("-cbwsdk-connect-content-qr-connecting",e)},(0,Er.h)(Pze.Spinner,{size:36,color:e==="dark"?"#FFF":"#000"}),(0,Er.h)("p",null,"Connecting...")))))}fm.ConnectContent=Oze;function $ze({title:t,description:e,theme:r}){return(0,Er.h)("div",{className:(0,F0.default)("-cbwsdk-connect-item",r)},(0,Er.h)("div",null,(0,Er.h)(Aze.CoinbaseWalletRound,null)),(0,Er.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,Er.h)("h3",{className:"-cbwsdk-connect-item-title"},t),(0,Er.h)("p",{className:"-cbwsdk-connect-item-description"},e)))}function Jae({theme:t}){return(0,Er.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,Er.h)("li",{className:(0,F0.default)("-cbwsdk-wallet-steps-item",t)},(0,Er.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,Er.h)("li",{className:(0,F0.default)("-cbwsdk-wallet-steps-item",t)},(0,Er.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,Er.h)("span",null,"Tap ",(0,Er.h)("strong",null,"Scan")," "),(0,Er.h)("span",{className:(0,F0.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,Er.h)(kze.QRCodeIcon,{fill:Tze(t)})))))}fm.CoinbaseWalletSteps=Jae;var qC={},WC={};Object.defineProperty(WC,"__esModule",{value:!0});WC.ArrowLeftIcon=void 0;const xq=Mo;function Nze(t){return(0,xq.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},t),(0,xq.h)("path",{d:"M8.60675 0.155884L7.37816 1.28209L12.7723 7.16662H0V8.83328H12.6548L6.82149 14.6666L8 15.8451L15.8201 8.02501L8.60675 0.155884Z"}))}WC.ArrowLeftIcon=Nze;var VC={};Object.defineProperty(VC,"__esModule",{value:!0});VC.LaptopIcon=void 0;const O9=Mo;function Mze(t){return(0,O9.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,O9.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,O9.h)("path",{d:"M13.4001 10.2002H0.600098C0.600098 11.0838 1.31644 11.8002 2.2001 11.8002H11.8001C12.6838 11.8002 13.4001 11.0838 13.4001 10.2002Z"}))}VC.LaptopIcon=Mze;var GC={};Object.defineProperty(GC,"__esModule",{value:!0});GC.SafeIcon=void 0;const Eq=Mo;function Dze(t){return(0,Eq.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,Eq.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.600098 0.600098V11.8001H13.4001V0.600098H0.600098ZM7.0001 9.2001C5.3441 9.2001 4.0001 7.8561 4.0001 6.2001C4.0001 4.5441 5.3441 3.2001 7.0001 3.2001C8.6561 3.2001 10.0001 4.5441 10.0001 6.2001C10.0001 7.8561 8.6561 9.2001 7.0001 9.2001ZM0.600098 12.6001H3.8001V13.4001H0.600098V12.6001ZM10.2001 12.6001H13.4001V13.4001H10.2001V12.6001ZM8.8001 6.2001C8.8001 7.19421 7.99421 8.0001 7.0001 8.0001C6.00598 8.0001 5.2001 7.19421 5.2001 6.2001C5.2001 5.20598 6.00598 4.4001 7.0001 4.4001C7.99421 4.4001 8.8001 5.20598 8.8001 6.2001Z"}))}GC.SafeIcon=Dze;var UN={};Object.defineProperty(UN,"__esModule",{value:!0});UN.default=(()=>".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}")();var Qae=Je&&Je.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(qC,"__esModule",{value:!0});qC.TryExtensionContent=void 0;const Qh=Qae(Dw),ni=Mo,$9=BC,Lze=WC,Bze=VC,Fze=GC,jze=Qae(UN);function Uze({theme:t}){const[e,r]=(0,$9.useState)(!1),n=(0,$9.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,$9.useCallback)(()=>{e?window.location.reload():(n(),r(!0))},[n,e]);return(0,ni.h)("div",{class:(0,Qh.default)("-cbwsdk-try-extension",t)},(0,ni.h)("style",null,jze.default),(0,ni.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,ni.h)("h3",{class:(0,Qh.default)("-cbwsdk-try-extension-heading",t)},"Or try the Coinbase Wallet browser extension"),(0,ni.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,ni.h)("button",{class:(0,Qh.default)("-cbwsdk-try-extension-cta",t),onClick:i},e?"Refresh":"Install"),(0,ni.h)("div",null,!e&&(0,ni.h)(Lze.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:t==="light"?"#0052FF":"#588AF5"})))),(0,ni.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,ni.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,ni.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,ni.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,ni.h)("span",{class:(0,Qh.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,ni.h)(Bze.LaptopIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,ni.h)("div",{class:(0,Qh.default)("-cbwsdk-try-extension-list-item-copy",t)},"Connect with dapps with just one click on your desktop browser")),(0,ni.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,ni.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,ni.h)("span",{class:(0,Qh.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,ni.h)(Fze.SafeIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,ni.h)("div",{class:(0,Qh.default)("-cbwsdk-try-extension-list-item-copy",t)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}qC.TryExtensionContent=Uze;var zN={};Object.defineProperty(zN,"__esModule",{value:!0});zN.default=(()=>".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}")();var Yae=Je&&Je.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(LC,"__esModule",{value:!0});LC.ConnectDialog=void 0;const N9=Yae(Dw),Yh=Mo,M9=BC,zze=fm,Hze=qC,qze=Yae(zN),Wze=t=>{const{isOpen:e,darkMode:r}=t,[n,i]=(0,M9.useState)(!e),[s,o]=(0,M9.useState)(!e);(0,M9.useEffect)(()=>{const c=[window.setTimeout(()=>{o(!e)},10)];return e?i(!1):c.push(window.setTimeout(()=>{i(!0)},360)),()=>{c.forEach(window.clearTimeout)}},[e]);const a=r?"dark":"light";return(0,Yh.h)("div",{class:(0,N9.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,Yh.h)("style",null,qze.default),(0,Yh.h)("div",{class:(0,N9.default)("-cbwsdk-connect-dialog-backdrop",a,s&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,Yh.h)("div",{class:"-cbwsdk-connect-dialog"},(0,Yh.h)("div",{class:(0,N9.default)("-cbwsdk-connect-dialog-box",s&&"-cbwsdk-connect-dialog-box-hidden")},t.connectDisabled?null:(0,Yh.h)(zze.ConnectContent,{theme:a,version:t.version,sessionId:t.sessionId,sessionSecret:t.sessionSecret,linkAPIUrl:t.linkAPIUrl,isConnected:t.isConnected,isParentConnection:t.isParentConnection,chainId:t.chainId,onCancel:t.onCancel}),(0,Yh.h)(Hze.TryExtensionContent,{theme:a}))))};LC.ConnectDialog=Wze;Object.defineProperty(MC,"__esModule",{value:!0});MC.LinkFlow=void 0;const D9=Mo,Vze=LC;class Gze{constructor(e){this.connected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=e.darkMode,this.version=e.version,this.sessionId=e.sessionId,this.sessionSecret=e.sessionSecret,this.linkAPIUrl=e.linkAPIUrl,this.isParentConnection=e.isParentConnection}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",e.appendChild(this.root),this.render()}setConnected(e){this.connected!==e&&(this.connected=e,this.render())}setChainId(e){this.chainId!==e&&(this.chainId=e,this.render())}detach(){var e;this.root&&((0,D9.render)(null,this.root),(e=this.root.parentElement)===null||e===void 0||e.removeChild(this.root))}setConnectDisabled(e){this.connectDisabled=e}open(e){this.isOpen=!0,this.onCancel=e.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){this.root&&(0,D9.render)((0,D9.h)(Vze.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.connected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)}}MC.LinkFlow=Gze;var HN={},qN={};Object.defineProperty(qN,"__esModule",{value:!0});qN.default=(()=>".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}")();(function(t){var e=Je&&Je.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(t,"__esModule",{value:!0}),t.SnackbarInstance=t.SnackbarContainer=t.Snackbar=void 0;const r=e(Dw),n=Mo,i=BC,s=e(qN),o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",a="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class c{constructor(d){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=d.darkMode}attach(d){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",d.appendChild(this.root),this.render()}presentItem(d){const p=this.nextItemKey++;return this.items.set(p,d),this.render(),()=>{this.items.delete(p),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(t.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([d,p])=>(0,n.h)(t.SnackbarInstance,Object.assign({},p,{key:d}))))),this.root)}}t.Snackbar=c;const l=f=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,n.h)("style",null,s.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},f.children));t.SnackbarContainer=l;const u=({autoExpand:f,message:d,menuItems:p})=>{const[g,v]=(0,i.useState)(!0),[y,b]=(0,i.useState)(f??!1);(0,i.useEffect)(()=>{const E=[window.setTimeout(()=>{v(!1)},1),window.setTimeout(()=>{b(!0)},1e4)];return()=>{E.forEach(window.clearTimeout)}});const w=()=>{b(!y)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",g&&"-cbwsdk-snackbar-instance-hidden",y&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:w},(0,n.h)("img",{src:o,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},d),(0,n.h)("div",{class:"-gear-container"},!y&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:a,class:"-gear-icon",title:"Expand"}))),p&&p.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},p.map((E,C)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",E.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:E.onClick,key:C},(0,n.h)("svg",{width:E.svgWidth,height:E.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":E.defaultFillRule,"clip-rule":E.defaultClipRule,d:E.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",E.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},E.info)))))};t.SnackbarInstance=u})(HN);Object.defineProperty(Ow,"__esModule",{value:!0});Ow.WalletLinkRelayUI=void 0;const Kze=$w,Jze=MC,Qze=HN;class Yze{constructor(e){this.standalone=null,this.attached=!1,this.snackbar=new Qze.Snackbar({darkMode:e.darkMode}),this.linkFlow=new Jze.LinkFlow({darkMode:e.darkMode,version:e.version,sessionId:e.session.id,sessionSecret:e.session.secret,linkAPIUrl:e.linkAPIUrl,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",e.appendChild(r),this.linkFlow.attach(r),this.snackbar.attach(r),this.attached=!0,(0,Kze.injectCssReset)()}setConnected(e){this.linkFlow.setConnected(e)}setChainId(e){this.linkFlow.setChainId(e)}setConnectDisabled(e){this.linkFlow.setConnectDisabled(e)}addEthereumChain(){}watchAsset(){}switchEthereumChain(){}requestEthereumAccounts(e){this.linkFlow.open({onCancel:e.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}showConnecting(e){let r;return e.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:r={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(r)}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(e){this.standalone=e}isStandalone(){var e;return(e=this.standalone)!==null&&e!==void 0?e:!1}}Ow.WalletLinkRelayUI=Yze;Object.defineProperty(Aw,"__esModule",{value:!0});Aw.WalletLinkRelay=void 0;const vp=xw,Zze=xi,En=st,Zh=Km,_q=za,Yf=Jm,Xze=OC,Xh=Vm,eHe=Ow;class Ou extends _q.RelayAbstract{constructor(e){var r;super(),this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.linkedUpdated=o=>{var a;this.isLinked=o;const c=this.storage.getItem(_q.LOCAL_STORAGE_ADDRESSES_KEY);if(o&&(this.session.linked=o),this.isUnlinkedErrorState=!1,c){const l=c.split(" "),u=this.storage.getItem("IsStandaloneSigning")==="true";if(l[0]!==""&&!o&&this.session.linked&&!u){this.isUnlinkedErrorState=!0;const f=this.getSessionIdHash();(a=this.diagnostic)===null||a===void 0||a.log(Zh.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:f})}}},this.metadataUpdated=(o,a)=>{this.storage.setItem(o,a)},this.chainUpdated=(o,a)=>{this.chainCallbackParams.chainId===o&&this.chainCallbackParams.jsonRpcUrl===a||(this.chainCallbackParams={chainId:o,jsonRpcUrl:a},this.chainCallback&&this.chainCallback(o,a))},this.accountUpdated=o=>{this.accountsCallback&&this.accountsCallback([o]),Ou.accountRequestCallbackIds.size>0&&(Array.from(Ou.accountRequestCallbackIds.values()).forEach(a=>{const c={type:"WEB3_RESPONSE",id:a,response:{method:"requestEthereumAccounts",result:[o]}};this.invokeCallback(Object.assign(Object.assign({},c),{id:a}))}),Ou.accountRequestCallbackIds.clear())},this.connectedUpdated=o=>{this.ui.setConnected(o)},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage,this.options=e;const{session:n,ui:i,connection:s}=this.subscribe();this._session=n,this.connection=s,this.relayEventManager=e.relayEventManager,this.diagnostic=e.diagnosticLogger,this._reloadOnDisconnect=(r=e.reloadOnDisconnect)!==null&&r!==void 0?r:!0,this.ui=i}subscribe(){const e=Yf.Session.load(this.storage)||new Yf.Session(this.storage).save(),{linkAPIUrl:r,diagnostic:n}=this,i=new Xze.WalletLinkConnection({session:e,linkAPIUrl:r,diagnostic:n,listener:this}),{version:s,darkMode:o}=this.options,a=this.options.uiConstructor({linkAPIUrl:r,version:s,darkMode:o,session:e});return i.connect(),{session:e,ui:a,connection:i}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(e=>setTimeout(()=>e(null),1e3))]).then(()=>{var e,r;const n=this.ui.isStandalone();(e=this.diagnostic)===null||e===void 0||e.log(Zh.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const i=Yf.Session.load(this.storage);if((i==null?void 0:i.id)===this._session.id?this.storage.clear():i&&((r=this.diagnostic)===null||r===void 0||r.log(Zh.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:Yf.Session.hash(i.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);const{session:s,ui:o,connection:a}=this.subscribe();this._session=s,this.connection=a,this.ui=o,n&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.attachUI()}).catch(e=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(Zh.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${e}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(e,r){this.appName=e,this.appLogoUrl=r}getStorageItem(e){return this.storage.getItem(e)}get session(){return this._session}setStorageItem(e,r){this.storage.setItem(e,r)}signEthereumMessage(e,r,n,i){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,En.hexStringFromBuffer)(e,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(e,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,En.hexStringFromBuffer)(e,!0),signature:(0,En.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,En.bigIntStringFromBN)(e.weiValue),data:(0,En.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,En.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,En.bigIntStringFromBN)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,En.bigIntStringFromBN)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,En.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,En.bigIntStringFromBN)(e.weiValue),data:(0,En.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,En.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,En.bigIntStringFromBN)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,En.bigIntStringFromBN)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,En.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,En.hexStringFromBuffer)(e,!0),chainId:r}})}scanQRCode(e){return this.sendRequest({method:"scanQRCode",params:{regExp:e}})}getQRCodeUrl(){return(0,En.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(e,r){return this.sendRequest({method:"generic",params:{action:r,data:e}})}sendGenericMessage(e){return this.sendRequest(e)}sendRequest(e){let r=null;const n=(0,En.randomBytesHex)(8),i=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,o),r==null||r()};return{promise:new Promise((o,a)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,c=>{if(r==null||r(),(0,Xh.isErrorResponse)(c))return a(new Error(c.errorMessage));o(c)}),this.ui.isStandalone()?this.sendRequestStandalone(n,e):this.publishWeb3RequestEvent(n,e)}),cancel:i}}setConnectDisabled(e){this.ui.setConnectDisabled(e)}setAccountsCallback(e){this.accountsCallback=e}setChainCallback(e){this.chainCallback=e}setDappDefaultChainCallback(e){this.dappDefaultChain=e,this.ui instanceof eHe.WalletLinkRelayUI&&this.ui.setChainId(e)}publishWeb3RequestEvent(e,r){var n;const i={type:"WEB3_REQUEST",id:e,request:r},s=Yf.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(Zh.EVENTS.WEB3_REQUEST,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Yf.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()}),this.publishEvent("Web3Request",i,!0).then(o=>{var a;(a=this.diagnostic)===null||a===void 0||a.log(Zh.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Yf.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()})}).catch(o=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i.id,response:{method:r.method,errorMessage:o.message}})})}publishWeb3RequestCanceledEvent(e){const r={type:"WEB3_REQUEST_CANCELED",id:e};this.publishEvent("Web3RequestCanceled",r,!1).then()}publishEvent(e,r,n){return this.connection.publishEvent(e,r,n)}handleWeb3ResponseMessage(e){var r;const{response:n}=e;if((r=this.diagnostic)===null||r===void 0||r.log(Zh.EVENTS.WEB3_RESPONSE,{eventId:e.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),n.method==="requestEthereumAccounts"){Ou.accountRequestCallbackIds.forEach(i=>this.invokeCallback(Object.assign(Object.assign({},e),{id:i}))),Ou.accountRequestCallbackIds.clear();return}this.invokeCallback(e)}handleErrorResponse(e,r,n,i){var s;const o=(s=n==null?void 0:n.message)!==null&&s!==void 0?s:(0,vp.getMessageFromCode)(i);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:e,response:{method:r,errorMessage:o,errorCode:i}})}invokeCallback(e){const r=this.relayEventManager.callbacks.get(e.id);r&&(r(e.response),this.relayEventManager.callbacks.delete(e.id))}requestEthereumAccounts(){const e={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=(0,En.randomBytesHex)(8),n=s=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,e.method,s)};return{promise:new Promise((s,o)=>{if(this.relayEventManager.callbacks.set(r,a=>{if(this.ui.hideRequestEthereumAccounts(),(0,Xh.isErrorResponse)(a))return o(new Error(a.errorMessage));s(a)}),this.ui.inlineAccountsResponse()){const a=c=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:r,response:{method:"requestEthereumAccounts",result:c}})};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:a})}else{const a=vp.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(a)})}Ou.accountRequestCallbackIds.add(r),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(r,e)}),cancel:n}}selectProvider(e){const r={method:"selectProvider",params:{providerOptions:e}},n=(0,En.randomBytesHex)(8),i=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,o)},s=new Promise((o,a)=>{this.relayEventManager.callbacks.set(n,u=>{if((0,Xh.isErrorResponse)(u))return a(new Error(u.errorMessage));o(u)});const c=u=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:Zze.ProviderType.Unselected}})},l=u=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:u}})};this.ui.selectProvider&&this.ui.selectProvider({onApprove:l,onCancel:c,providerOptions:e})});return{cancel:i,promise:s}}watchAsset(e,r,n,i,s,o){const a={method:"watchAsset",params:{type:e,options:{address:r,symbol:n,decimals:i,image:s},chainId:o}};let c=null;const l=(0,En.randomBytesHex)(8),u=d=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,a.method,d),c==null||c()};this.ui.inlineWatchAsset()||(c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:u,onResetConnection:this.resetAndReload}));const f=new Promise((d,p)=>{this.relayEventManager.callbacks.set(l,y=>{if(c==null||c(),(0,Xh.isErrorResponse)(y))return p(new Error(y.errorMessage));d(y)});const g=y=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:l,response:{method:"watchAsset",result:!1}})},v=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:l,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:v,onCancel:g,type:e,address:r,symbol:n,decimals:i,image:s,chainId:o}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(l,a)});return{cancel:u,promise:f}}addEthereumChain(e,r,n,i,s,o){const a={method:"addEthereumChain",params:{chainId:e,rpcUrls:r,blockExplorerUrls:i,chainName:s,iconUrls:n,nativeCurrency:o}};let c=null;const l=(0,En.randomBytesHex)(8),u=d=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,a.method,d),c==null||c()};return this.ui.inlineAddEthereumChain(e)||(c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:u,onResetConnection:this.resetAndReload})),{promise:new Promise((d,p)=>{this.relayEventManager.callbacks.set(l,y=>{if(c==null||c(),(0,Xh.isErrorResponse)(y))return p(new Error(y.errorMessage));d(y)});const g=y=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:l,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},v=y=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:l,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:y}}})};this.ui.inlineAddEthereumChain(e)&&this.ui.addEthereumChain({onCancel:g,onApprove:v,chainId:a.params.chainId,rpcUrls:a.params.rpcUrls,blockExplorerUrls:a.params.blockExplorerUrls,chainName:a.params.chainName,iconUrls:a.params.iconUrls,nativeCurrency:a.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(e)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(l,a)}),cancel:u}}switchEthereumChain(e,r){const n={method:"switchEthereumChain",params:Object.assign({chainId:e},{address:r})},i=(0,En.randomBytesHex)(8),s=a=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,n.method,a)};return{promise:new Promise((a,c)=>{this.relayEventManager.callbacks.set(i,f=>{if((0,Xh.isErrorResponse)(f)&&f.errorCode)return c(vp.standardErrors.provider.custom({code:f.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,Xh.isErrorResponse)(f))return c(new Error(f.errorMessage));a(f)});const l=f=>{var d;if(f){const p=(d=(0,vp.getErrorCode)(f))!==null&&d!==void 0?d:vp.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(i,"switchEthereumChain",f instanceof Error?f:vp.standardErrors.provider.unsupportedChain(e),p)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},u=f=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:f}}})};this.ui.switchEthereumChain({onCancel:l,onApprove:u,chainId:n.params.chainId,address:n.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(i,n)}),cancel:s}}inlineAddEthereumChain(e){return this.ui.inlineAddEthereumChain(e)}getSessionIdHash(){return Yf.Session.hash(this._session.id)}sendRequestStandalone(e,r){const n=s=>{this.handleErrorResponse(e,r.method,s)},i=s=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:e,response:s})};switch(r.method){case"signEthereumMessage":this.ui.signEthereumMessage({request:r,onSuccess:i,onCancel:n});break;case"signEthereumTransaction":this.ui.signEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case"submitEthereumTransaction":this.ui.submitEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case"ethereumAddressFromSignedMessage":this.ui.ethereumAddressFromSignedMessage({request:r,onSuccess:i});break;default:n();break}}}Aw.WalletLinkRelay=Ou;Ou.accountRequestCallbackIds=new Set;var Lw={},KC={},Zae={};(function(t){var e=Je&&Je.__createBinding||(Object.create?function(n,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(n,o,a)}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=Je&&Je.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(HN,t)})(Zae);var WN={};Object.defineProperty(WN,"__esModule",{value:!0});WN.default=(()=>".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}")();var Xae=Je&&Je.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(KC,"__esModule",{value:!0});KC.RedirectDialog=void 0;const tHe=Xae(Dw),yl=Mo,rHe=$w,nHe=Zae,iHe=Xae(WN);class sHe{constructor(){this.root=null}attach(){const e=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",e.appendChild(this.root),(0,rHe.injectCssReset)()}present(e){this.render(e)}clear(){this.render(null)}render(e){this.root&&((0,yl.render)(null,this.root),e&&(0,yl.render)((0,yl.h)(oHe,Object.assign({},e,{onDismiss:()=>{this.clear()}})),this.root))}}KC.RedirectDialog=sHe;const oHe=({title:t,buttonText:e,darkMode:r,onButtonClick:n,onDismiss:i})=>{const s=r?"dark":"light";return(0,yl.h)(nHe.SnackbarContainer,{darkMode:r},(0,yl.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,yl.h)("style",null,iHe.default),(0,yl.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:i}),(0,yl.h)("div",{class:(0,tHe.default)("-cbwsdk-redirect-dialog-box",s)},(0,yl.h)("p",null,t),(0,yl.h)("button",{onClick:n},e))))};Object.defineProperty(Lw,"__esModule",{value:!0});Lw.MobileRelayUI=void 0;const aHe=KC;class cHe{constructor(e){this.attached=!1,this.darkMode=!1,this.openedWindow=null,this.redirectDialog=new aHe.RedirectDialog,this.darkMode=e.darkMode}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}setConnected(e){}closeOpenedWindow(){var e;(e=this.openedWindow)===null||e===void 0||e.close(),this.openedWindow=null}redirectToCoinbaseWallet(e){const r=new URL("https://go.cb-w.com/walletlink");r.searchParams.append("redirect_url",window.location.href),e&&r.searchParams.append("wl_url",e),this.openedWindow=window.open(r.href,"cbw-opener"),this.openedWindow&&setTimeout(()=>this.closeOpenedWindow(),5e3)}openCoinbaseWalletDeeplink(e){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",darkMode:this.darkMode,onButtonClick:()=>{this.redirectToCoinbaseWallet(e)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(e)},99)}showConnecting(e){return()=>{this.closeOpenedWindow(),this.redirectDialog.clear()}}hideRequestEthereumAccounts(){this.closeOpenedWindow(),this.redirectDialog.clear()}requestEthereumAccounts(){}addEthereumChain(){}watchAsset(){}selectProvider(){}switchEthereumChain(){}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}reloadUI(){}setStandalone(){}setConnectDisabled(){}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}isStandalone(){return!1}}Lw.MobileRelayUI=cHe;Object.defineProperty(Sw,"__esModule",{value:!0});Sw.MobileRelay=void 0;const lHe=st,uHe=Aw,Cq=Lw;class fHe extends uHe.WalletLinkRelay{constructor(e){var r;super(e),this._enableMobileWalletLink=(r=e.enableMobileWalletLink)!==null&&r!==void 0?r:!1}requestEthereumAccounts(){return this._enableMobileWalletLink?super.requestEthereumAccounts():{promise:new Promise(()=>{const e=(0,lHe.getLocation)();e.href=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(e.href)}`}),cancel:()=>{}}}publishWeb3RequestEvent(e,r){if(super.publishWeb3RequestEvent(e,r),!(this._enableMobileWalletLink&&this.ui instanceof Cq.MobileRelayUI))return;let n=!1;switch(r.method){case"requestEthereumAccounts":case"connectAndSignIn":n=!0,this.ui.openCoinbaseWalletDeeplink(this.getQRCodeUrl());break;case"switchEthereumChain":return;default:n=!0,this.ui.openCoinbaseWalletDeeplink();break}n&&window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0})}handleWeb3ResponseMessage(e){super.handleWeb3ResponseMessage(e),this._enableMobileWalletLink&&this.ui instanceof Cq.MobileRelayUI&&this.ui.closeOpenedWindow()}connectAndSignIn(e){if(!this._enableMobileWalletLink)throw new Error("connectAndSignIn is supported only when enableMobileWalletLink is on");return this.sendRequest({method:"connectAndSignIn",params:{appName:this.appName,appLogoUrl:this.appLogoUrl,domain:window.location.hostname,aud:window.location.href,version:"1",type:"eip4361",nonce:e.nonce,iat:new Date().toISOString(),chainId:`eip155:${this.dappDefaultChain}`,statement:e.statement,resources:e.resources}})}}Sw.MobileRelay=fHe;var KP={exports:{}},VN={exports:{}},_g=typeof Reflect=="object"?Reflect:null,Sq=_g&&typeof _g.apply=="function"?_g.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},wE;_g&&typeof _g.ownKeys=="function"?wE=_g.ownKeys:Object.getOwnPropertySymbols?wE=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:wE=function(e){return Object.getOwnPropertyNames(e)};function dHe(t){console&&console.warn&&console.warn(t)}var ece=Number.isNaN||function(e){return e!==e};function Wr(){Wr.init.call(this)}VN.exports=Wr;VN.exports.once=mHe;Wr.EventEmitter=Wr;Wr.prototype._events=void 0;Wr.prototype._eventsCount=0;Wr.prototype._maxListeners=void 0;var Aq=10;function JC(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(Wr,"defaultMaxListeners",{enumerable:!0,get:function(){return Aq},set:function(t){if(typeof t!="number"||t<0||ece(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Aq=t}});Wr.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};Wr.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||ece(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function tce(t){return t._maxListeners===void 0?Wr.defaultMaxListeners:t._maxListeners}Wr.prototype.getMaxListeners=function(){return tce(this)};Wr.prototype.emit=function(e){for(var r=[],n=1;n0&&(o=r[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var c=s[e];if(c===void 0)return!1;if(typeof c=="function")Sq(c,this,r);else for(var l=c.length,u=oce(c,l),n=0;n0&&o.length>i&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=o.length,dHe(a)}return t}Wr.prototype.addListener=function(e,r){return rce(this,e,r,!1)};Wr.prototype.on=Wr.prototype.addListener;Wr.prototype.prependListener=function(e,r){return rce(this,e,r,!0)};function hHe(){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 nce(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=hHe.bind(n);return i.listener=r,n.wrapFn=i,i}Wr.prototype.once=function(e,r){return JC(r),this.on(e,nce(this,e,r)),this};Wr.prototype.prependOnceListener=function(e,r){return JC(r),this.prependListener(e,nce(this,e,r)),this};Wr.prototype.removeListener=function(e,r){var n,i,s,o,a;if(JC(r),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===r||n[o].listener===r){a=n[o].listener,s=o;break}if(s<0)return this;s===0?n.shift():pHe(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,a||r)}return this};Wr.prototype.off=Wr.prototype.removeListener;Wr.prototype.removeAllListeners=function(e){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var s=Object.keys(n),o;for(i=0;i=0;i--)this.removeListener(e,r[i]);return this};function ice(t,e,r){var n=t._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?gHe(i):oce(i,i.length)}Wr.prototype.listeners=function(e){return ice(this,e,!0)};Wr.prototype.rawListeners=function(e){return ice(this,e,!1)};Wr.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):sce.call(t,e)};Wr.prototype.listenerCount=sce;function sce(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}Wr.prototype.eventNames=function(){return this._eventsCount>0?wE(this._events):[]};function oce(t,e){for(var r=new Array(e),n=0;n0?this.tail.next=b:this.head=b,this.tail=b,++this.length}},{key:"unshift",value:function(y){var b={data:y,next:this.head};this.length===0&&(this.tail=b),this.head=b,++this.length}},{key:"shift",value:function(){if(this.length!==0){var y=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,y}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(y){if(this.length===0)return"";for(var b=this.head,w=""+b.data;b=b.next;)w+=y+b.data;return w}},{key:"concat",value:function(y){if(this.length===0)return l.alloc(0);for(var b=l.allocUnsafe(y>>>0),w=this.head,E=0;w;)p(w.data,b,E),E+=w.data.length,w=w.next;return b}},{key:"consume",value:function(y,b){var w;return yC.length?C.length:y;if(S===C.length?E+=C:E+=C.slice(0,y),y-=S,y===0){S===C.length?(++w,b.next?this.head=b.next:this.head=this.tail=null):(this.head=b,b.data=C.slice(S));break}++w}return this.length-=w,E}},{key:"_getBuffer",value:function(y){var b=l.allocUnsafe(y),w=this.head,E=1;for(w.data.copy(b),y-=w.data.length;w=w.next;){var C=w.data,S=y>C.length?C.length:y;if(C.copy(b,b.length-y,0,S),y-=S,y===0){S===C.length?(++E,w.next?this.head=w.next:this.head=this.tail=null):(this.head=w,w.data=C.slice(S));break}++E}return this.length-=E,b}},{key:d,value:function(y,b){return f(this,e(e({},b),{},{depth:0,customInspect:!1}))}}]),g}(),L9}function bHe(t,e){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(JP,this,t)):process.nextTick(JP,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(s){!e&&s?r._writableState?r._writableState.errorEmitted?process.nextTick(xE,r):(r._writableState.errorEmitted=!0,process.nextTick(Iq,r,s)):process.nextTick(Iq,r,s):e?(process.nextTick(xE,r),e(s)):process.nextTick(xE,r)}),this)}function Iq(t,e){JP(t,e),xE(t)}function xE(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function wHe(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function JP(t,e){t.emit("error",e)}function xHe(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}var lce={destroy:bHe,undestroy:wHe,errorOrDestroy:xHe},A1={};function EHe(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var uce={};function sc(t,e,r){r||(r=Error);function n(s,o,a){return typeof e=="string"?e:e(s,o,a)}var i=function(s){EHe(o,s);function o(a,c,l){return s.call(this,n(a,c,l))||this}return o}(r);i.prototype.name=r.name,i.prototype.code=t,uce[t]=i}function Pq(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map(function(n){return String(n)}),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:r===2?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}else return"of ".concat(e," ").concat(String(t))}function _He(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function CHe(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function SHe(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}sc("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);sc("ERR_INVALID_ARG_TYPE",function(t,e,r){var n;typeof e=="string"&&_He(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";var i;if(CHe(t," argument"))i="The ".concat(t," ").concat(n," ").concat(Pq(e,"type"));else{var s=SHe(t,".")?"property":"argument";i='The "'.concat(t,'" ').concat(s," ").concat(n," ").concat(Pq(e,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);sc("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");sc("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});sc("ERR_STREAM_PREMATURE_CLOSE","Premature close");sc("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});sc("ERR_MULTIPLE_CALLBACK","Callback called multiple times");sc("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");sc("ERR_STREAM_WRITE_AFTER_END","write after end");sc("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);sc("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);sc("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");A1.codes=uce;var AHe=A1.codes.ERR_INVALID_OPT_VALUE;function kHe(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function IHe(t,e,r,n){var i=kHe(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var s=n?r:"highWaterMark";throw new AHe(s,i)}return Math.floor(i)}return t.objectMode?16:16*1024}var fce={getHighWaterMark:IHe},PHe=RHe;function RHe(t,e){if(B9("noDeprecation"))return t;var r=!1;function n(){if(!r){if(B9("throwDeprecation"))throw new Error(e);B9("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}return n}function B9(t){try{if(!Je.localStorage)return!1}catch{return!1}var e=Je.localStorage[t];return e==null?!1:String(e).toLowerCase()==="true"}var F9,Rq;function dce(){if(Rq)return F9;Rq=1,F9=T;function t(G){var H=this;this.next=null,this.entry=null,this.finish=function(){M(H,G)}}var e;T.WritableState=P;var r={deprecate:PHe},n=cce,i=kw.Buffer,s=(typeof Je<"u"?Je:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function o(G){return i.from(G)}function a(G){return i.isBuffer(G)||G instanceof s}var c=lce,l=fce,u=l.getHighWaterMark,f=A1.codes,d=f.ERR_INVALID_ARG_TYPE,p=f.ERR_METHOD_NOT_IMPLEMENTED,g=f.ERR_MULTIPLE_CALLBACK,v=f.ERR_STREAM_CANNOT_PIPE,y=f.ERR_STREAM_DESTROYED,b=f.ERR_STREAM_NULL_VALUES,w=f.ERR_STREAM_WRITE_AFTER_END,E=f.ERR_UNKNOWN_ENCODING,C=c.errorOrDestroy;tc(T,n);function S(){}function P(G,H,J){e=e||dm(),G=G||{},typeof J!="boolean"&&(J=H instanceof e),this.objectMode=!!G.objectMode,J&&(this.objectMode=this.objectMode||!!G.writableObjectMode),this.highWaterMark=u(this,G,"writableHighWaterMark",J),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var X=G.decodeStrings===!1;this.decodeStrings=!X,this.defaultEncoding=G.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(D){B(H,D)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=G.emitClose!==!1,this.autoDestroy=!!G.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}P.prototype.getBuffer=function(){for(var H=this.bufferedRequest,J=[];H;)J.push(H),H=H.next;return J},function(){try{Object.defineProperty(P.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var _;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(_=Function.prototype[Symbol.hasInstance],Object.defineProperty(T,Symbol.hasInstance,{value:function(H){return _.call(this,H)?!0:this!==T?!1:H&&H._writableState instanceof P}})):_=function(H){return H instanceof this};function T(G){e=e||dm();var H=this instanceof e;if(!H&&!_.call(T,this))return new T(G);this._writableState=new P(G,this,H),this.writable=!0,G&&(typeof G.write=="function"&&(this._write=G.write),typeof G.writev=="function"&&(this._writev=G.writev),typeof G.destroy=="function"&&(this._destroy=G.destroy),typeof G.final=="function"&&(this._final=G.final)),n.call(this)}T.prototype.pipe=function(){C(this,new v)};function Q(G,H){var J=new w;C(G,J),process.nextTick(H,J)}function Z(G,H,J,X){var D;return J===null?D=new b:typeof J!="string"&&!H.objectMode&&(D=new d("chunk",["string","Buffer"],J)),D?(C(G,D),process.nextTick(X,D),!1):!0}T.prototype.write=function(G,H,J){var X=this._writableState,D=!1,F=!X.objectMode&&a(G);return F&&!i.isBuffer(G)&&(G=o(G)),typeof H=="function"&&(J=H,H=null),F?H="buffer":H||(H=X.defaultEncoding),typeof J!="function"&&(J=S),X.ending?Q(this,J):(F||Z(this,X,G,J))&&(X.pendingcb++,D=ce(this,X,F,G,H,J)),D},T.prototype.cork=function(){this._writableState.corked++},T.prototype.uncork=function(){var G=this._writableState;G.corked&&(G.corked--,!G.writing&&!G.corked&&!G.bufferProcessing&&G.bufferedRequest&&L(this,G))},T.prototype.setDefaultEncoding=function(H){if(typeof H=="string"&&(H=H.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((H+"").toLowerCase())>-1))throw new E(H);return this._writableState.defaultEncoding=H,this},Object.defineProperty(T.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function ne(G,H,J){return!G.objectMode&&G.decodeStrings!==!1&&typeof H=="string"&&(H=i.from(H,J)),H}Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function ce(G,H,J,X,D,F){if(!J){var Y=ne(H,X,D);X!==Y&&(J=!0,D="buffer",X=Y)}var ue=H.objectMode?1:X.length;H.length+=ue;var he=H.length>5===6?2:b>>4===14?3:b>>3===30?4:b>>6===2?-1:-2}function o(b,w,E){var C=w.length-1;if(C=0?(S>0&&(b.lastNeed=S-1),S):--C=0?(S>0&&(b.lastNeed=S-2),S):--C=0?(S>0&&(S===2?S=0:b.lastNeed=S-3),S):0))}function a(b,w,E){if((w[0]&192)!==128)return b.lastNeed=0,"�";if(b.lastNeed>1&&w.length>1){if((w[1]&192)!==128)return b.lastNeed=1,"�";if(b.lastNeed>2&&w.length>2&&(w[2]&192)!==128)return b.lastNeed=2,"�"}}function c(b){var w=this.lastTotal-this.lastNeed,E=a(this,b);if(E!==void 0)return E;if(this.lastNeed<=b.length)return b.copy(this.lastChar,w,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);b.copy(this.lastChar,w,0,b.length),this.lastNeed-=b.length}function l(b,w){var E=o(this,b,w);if(!this.lastNeed)return b.toString("utf8",w);this.lastTotal=E;var C=b.length-(E-this.lastNeed);return b.copy(this.lastChar,0,C),b.toString("utf8",w,C)}function u(b){var w=b&&b.length?this.write(b):"";return this.lastNeed?w+"�":w}function f(b,w){if((b.length-w)%2===0){var E=b.toString("utf16le",w);if(E){var C=E.charCodeAt(E.length-1);if(C>=55296&&C<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=b[b.length-2],this.lastChar[1]=b[b.length-1],E.slice(0,-1)}return E}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=b[b.length-1],b.toString("utf16le",w,b.length-1)}function d(b){var w=b&&b.length?this.write(b):"";if(this.lastNeed){var E=this.lastTotal-this.lastNeed;return w+this.lastChar.toString("utf16le",0,E)}return w}function p(b,w){var E=(b.length-w)%3;return E===0?b.toString("base64",w):(this.lastNeed=3-E,this.lastTotal=3,E===1?this.lastChar[0]=b[b.length-1]:(this.lastChar[0]=b[b.length-2],this.lastChar[1]=b[b.length-1]),b.toString("base64",w,b.length-E))}function g(b){var w=b&&b.length?this.write(b):"";return this.lastNeed?w+this.lastChar.toString("base64",0,3-this.lastNeed):w}function v(b){return b.toString(this.encoding)}function y(b){return b&&b.length?this.write(b):""}return U9}var Nq=A1.codes.ERR_STREAM_PREMATURE_CLOSE;function THe(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i0)if(typeof Y!="string"&&!Me.objectMode&&Object.getPrototypeOf(Y)!==n.prototype&&(Y=s(Y)),he)Me.endEmitted?S(F,new b):ne(F,Me,Y,!0);else if(Me.ended)S(F,new v);else{if(Me.destroyed)return!1;Me.reading=!1,Me.decoder&&!ue?(Y=Me.decoder.write(Y),Me.objectMode||Y.length!==0?ne(F,Me,Y,!1):L(F,Me)):ne(F,Me,Y,!1)}else he||(Me.reading=!1,L(F,Me))}return!Me.ended&&(Me.length=K?F=K:(F--,F|=F>>>1,F|=F>>>2,F|=F>>>4,F|=F>>>8,F|=F>>>16,F++),F}function A(F,Y){return F<=0||Y.length===0&&Y.ended?0:Y.objectMode?1:F!==F?Y.flowing&&Y.length?Y.buffer.head.data.length:Y.length:(F>Y.highWaterMark&&(Y.highWaterMark=x(F)),F<=Y.length?F:Y.ended?Y.length:(Y.needReadable=!0,0))}Q.prototype.read=function(F){c("read",F),F=parseInt(F,10);var Y=this._readableState,ue=F;if(F!==0&&(Y.emittedReadable=!1),F===0&&Y.needReadable&&((Y.highWaterMark!==0?Y.length>=Y.highWaterMark:Y.length>0)||Y.ended))return c("read: emitReadable",Y.length,Y.ended),Y.length===0&&Y.ended?J(this):z(this),null;if(F=A(F,Y),F===0&&Y.ended)return Y.length===0&&J(this),null;var he=Y.needReadable;c("need readable",he),(Y.length===0||Y.length-F0?Ce=H(F,Y):Ce=null,Ce===null?(Y.needReadable=Y.length<=Y.highWaterMark,F=0):(Y.length-=F,Y.awaitDrain=0),Y.length===0&&(Y.ended||(Y.needReadable=!0),ue!==F&&Y.ended&&J(this)),Ce!==null&&this.emit("data",Ce),Ce};function B(F,Y){if(c("onEofChunk"),!Y.ended){if(Y.decoder){var ue=Y.decoder.end();ue&&ue.length&&(Y.buffer.push(ue),Y.length+=Y.objectMode?1:ue.length)}Y.ended=!0,Y.sync?z(F):(Y.needReadable=!1,Y.emittedReadable||(Y.emittedReadable=!0,R(F)))}}function z(F){var Y=F._readableState;c("emitReadable",Y.needReadable,Y.emittedReadable),Y.needReadable=!1,Y.emittedReadable||(c("emitReadable",Y.flowing),Y.emittedReadable=!0,process.nextTick(R,F))}function R(F){var Y=F._readableState;c("emitReadable_",Y.destroyed,Y.length,Y.ended),!Y.destroyed&&(Y.length||Y.ended)&&(F.emit("readable"),Y.emittedReadable=!1),Y.needReadable=!Y.flowing&&!Y.ended&&Y.length<=Y.highWaterMark,G(F)}function L(F,Y){Y.readingMore||(Y.readingMore=!0,process.nextTick(q,F,Y))}function q(F,Y){for(;!Y.reading&&!Y.ended&&(Y.length1&&D(he.pipes,F)!==-1)&&!ze&&(c("false write response, pause",he.awaitDrain),he.awaitDrain++),ue.pause())}function He(ee){c("onerror",ee),qe(),F.removeListener("error",He),e(F,"error")===0&&S(F,ee)}_(F,"error",He);function Ge(){F.removeListener("finish",Ye),qe()}F.once("close",Ge);function Ye(){c("onfinish"),F.removeListener("close",Ge),qe()}F.once("finish",Ye);function qe(){c("unpipe"),ue.unpipe(F)}return F.emit("pipe",ue),he.flowing||(c("pipe resume"),ue.resume()),F};function N(F){return function(){var ue=F._readableState;c("pipeOnDrain",ue.awaitDrain),ue.awaitDrain&&ue.awaitDrain--,ue.awaitDrain===0&&e(F,"data")&&(ue.flowing=!0,G(F))}}Q.prototype.unpipe=function(F){var Y=this._readableState,ue={hasUnpiped:!1};if(Y.pipesCount===0)return this;if(Y.pipesCount===1)return F&&F!==Y.pipes?this:(F||(F=Y.pipes),Y.pipes=null,Y.pipesCount=0,Y.flowing=!1,F&&F.emit("unpipe",this,ue),this);if(!F){var he=Y.pipes,Ce=Y.pipesCount;Y.pipes=null,Y.pipesCount=0,Y.flowing=!1;for(var Me=0;Me0,he.flowing!==!1&&this.resume()):F==="readable"&&!he.endEmitted&&!he.readableListening&&(he.readableListening=he.needReadable=!0,he.flowing=!1,he.emittedReadable=!1,c("on readable",he.length,he.reading),he.length?z(this):he.reading||process.nextTick(U,this)),ue},Q.prototype.addListener=Q.prototype.on,Q.prototype.removeListener=function(F,Y){var ue=r.prototype.removeListener.call(this,F,Y);return F==="readable"&&process.nextTick(I,this),ue},Q.prototype.removeAllListeners=function(F){var Y=r.prototype.removeAllListeners.apply(this,arguments);return(F==="readable"||F===void 0)&&process.nextTick(I,this),Y};function I(F){var Y=F._readableState;Y.readableListening=F.listenerCount("readable")>0,Y.resumeScheduled&&!Y.paused?Y.flowing=!0:F.listenerCount("data")>0&&F.resume()}function U(F){c("readable nexttick read 0"),F.read(0)}Q.prototype.resume=function(){var F=this._readableState;return F.flowing||(c("resume"),F.flowing=!F.readableListening,re(this,F)),F.paused=!1,this};function re(F,Y){Y.resumeScheduled||(Y.resumeScheduled=!0,process.nextTick(M,F,Y))}function M(F,Y){c("resume",Y.reading),Y.reading||F.read(0),Y.resumeScheduled=!1,F.emit("resume"),G(F),Y.flowing&&!Y.reading&&F.read(0)}Q.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function G(F){var Y=F._readableState;for(c("flow",Y.flowing);Y.flowing&&F.read()!==null;);}Q.prototype.wrap=function(F){var Y=this,ue=this._readableState,he=!1;F.on("end",function(){if(c("wrapped end"),ue.decoder&&!ue.ended){var Oe=ue.decoder.end();Oe&&Oe.length&&Y.push(Oe)}Y.push(null)}),F.on("data",function(Oe){if(c("wrapped data"),ue.decoder&&(Oe=ue.decoder.write(Oe)),!(ue.objectMode&&Oe==null)&&!(!ue.objectMode&&(!Oe||!Oe.length))){var We=Y.push(Oe);We||(he=!0,F.pause())}});for(var Ce in F)this[Ce]===void 0&&typeof F[Ce]=="function"&&(this[Ce]=function(We){return function(){return F[We].apply(F,arguments)}}(Ce));for(var Me=0;Me=Y.length?(Y.decoder?ue=Y.buffer.join(""):Y.buffer.length===1?ue=Y.buffer.first():ue=Y.buffer.concat(Y.length),Y.buffer.clear()):ue=Y.buffer.consume(F,Y.decoder),ue}function J(F){var Y=F._readableState;c("endReadable",Y.endEmitted),Y.endEmitted||(Y.ended=!0,process.nextTick(X,Y,F))}function X(F,Y){if(c("endReadableNT",F.endEmitted,F.length),!F.endEmitted&&F.length===0&&(F.endEmitted=!0,Y.readable=!1,Y.emit("end"),F.autoDestroy)){var ue=Y._writableState;(!ue||ue.autoDestroy&&ue.finished)&&Y.destroy()}}typeof Symbol=="function"&&(Q.from=function(F,Y){return C===void 0&&(C=MHe()),C(Q,F,Y)});function D(F,Y){for(var ue=0,he=F.length;ue0;return GHe(o,c,l,function(u){i||(i=u),u&&s.forEach(jq),!c&&(s.forEach(jq),n(i))})});return e.reduce(KHe)}var YHe=QHe;(function(t,e){e=t.exports=pce(),e.Stream=e,e.Readable=e,e.Writable=dce(),e.Duplex=dm(),e.Transform=gce,e.PassThrough=zHe,e.finished=KN,e.pipeline=YHe})(KP,KP.exports);var yce=KP.exports;const{Transform:ZHe}=yce;var XHe=t=>class bce extends ZHe{constructor(r,n,i,s,o){super(o),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._hashBitLength=s,this._options=o,this._state=new t,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(o){s=o}i(s)}_flush(r){let n=null;try{this.push(this.digest())}catch(i){n=i}r(n)}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}digest(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let n=this._state.squeeze(this._hashBitLength/8);return r!==void 0&&(n=n.toString(r)),this._resetState(),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new bce(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:eqe}=yce;var tqe=t=>class wce extends eqe{constructor(r,n,i,s){super(s),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._options=s,this._state=new t,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(o){s=o}i(s)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}squeeze(r,n){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let i=this._state.squeeze(r);return n!==void 0&&(i=i.toString(n)),i}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new wce(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const rqe=XHe,nqe=tqe;var iqe=function(t){const e=rqe(t),r=nqe(t);return function(n,i){switch(typeof n=="string"?n.toLowerCase():n){case"keccak224":return new e(1152,448,null,224,i);case"keccak256":return new e(1088,512,null,256,i);case"keccak384":return new e(832,768,null,384,i);case"keccak512":return new e(576,1024,null,512,i);case"sha3-224":return new e(1152,448,6,224,i);case"sha3-256":return new e(1088,512,6,256,i);case"sha3-384":return new e(832,768,6,384,i);case"sha3-512":return new e(576,1024,6,512,i);case"shake128":return new r(1344,256,31,i);case"shake256":return new r(1088,512,31,i);default:throw new Error("Invald algorithm: "+n)}}},xce={};const Uq=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];xce.p1600=function(t){for(let e=0;e<24;++e){const r=t[0]^t[10]^t[20]^t[30]^t[40],n=t[1]^t[11]^t[21]^t[31]^t[41],i=t[2]^t[12]^t[22]^t[32]^t[42],s=t[3]^t[13]^t[23]^t[33]^t[43],o=t[4]^t[14]^t[24]^t[34]^t[44],a=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],l=t[7]^t[17]^t[27]^t[37]^t[47],u=t[8]^t[18]^t[28]^t[38]^t[48],f=t[9]^t[19]^t[29]^t[39]^t[49];let d=u^(i<<1|s>>>31),p=f^(s<<1|i>>>31);const g=t[0]^d,v=t[1]^p,y=t[10]^d,b=t[11]^p,w=t[20]^d,E=t[21]^p,C=t[30]^d,S=t[31]^p,P=t[40]^d,_=t[41]^p;d=r^(o<<1|a>>>31),p=n^(a<<1|o>>>31);const T=t[2]^d,Q=t[3]^p,Z=t[12]^d,ne=t[13]^p,ce=t[22]^d,K=t[23]^p,x=t[32]^d,A=t[33]^p,B=t[42]^d,z=t[43]^p;d=i^(c<<1|l>>>31),p=s^(l<<1|c>>>31);const R=t[4]^d,L=t[5]^p,q=t[14]^d,N=t[15]^p,I=t[24]^d,U=t[25]^p,re=t[34]^d,M=t[35]^p,G=t[44]^d,H=t[45]^p;d=o^(u<<1|f>>>31),p=a^(f<<1|u>>>31);const J=t[6]^d,X=t[7]^p,D=t[16]^d,F=t[17]^p,Y=t[26]^d,ue=t[27]^p,he=t[36]^d,Ce=t[37]^p,Me=t[46]^d,Oe=t[47]^p;d=c^(r<<1|n>>>31),p=l^(n<<1|r>>>31);const We=t[8]^d,ot=t[9]^p,ze=t[18]^d,Le=t[19]^p,et=t[28]^d,He=t[29]^p,Ge=t[38]^d,Ye=t[39]^p,qe=t[48]^d,ee=t[49]^p,j=g,W=v,ie=b<<4|y>>>28,de=y<<4|b>>>28,pe=w<<3|E>>>29,be=E<<3|w>>>29,je=S<<9|C>>>23,Fe=C<<9|S>>>23,Qe=P<<18|_>>>14,kt=_<<18|P>>>14,Ze=T<<1|Q>>>31,$t=Q<<1|T>>>31,Wn=ne<<12|Z>>>20,Xt=Z<<12|ne>>>20,rr=ce<<10|K>>>22,gr=K<<10|ce>>>22,dt=A<<13|x>>>19,yt=x<<13|A>>>19,mr=B<<2|z>>>30,vt=z<<2|B>>>30,ht=L<<30|R>>>2,kr=R<<30|L>>>2,_t=q<<6|N>>>26,bt=N<<6|q>>>26,Ir=U<<11|I>>>21,wt=I<<11|U>>>21,xt=re<<15|M>>>17,vr=M<<15|re>>>17,ft=H<<29|G>>>3,Ct=G<<29|H>>>3,Pr=J<<28|X>>>4,yr=X<<28|J>>>4,br=F<<23|D>>>9,Rs=D<<23|F>>>9,Wt=Y<<25|ue>>>7,wr=ue<<25|Y>>>7,cs=he<<21|Ce>>>11,ls=Ce<<21|he>>>11,us=Oe<<24|Me>>>8,fs=Me<<24|Oe>>>8,$n=We<<27|ot>>>5,no=ot<<27|We>>>5,cc=ze<<20|Le>>>12,io=Le<<20|ze>>>12,lc=He<<7|et>>>25,uc=et<<7|He>>>25,so=Ge<<8|Ye>>>24,ma=Ye<<8|Ge>>>24,va=qe<<14|ee>>>18,di=ee<<14|qe>>>18;t[0]=j^~Wn&Ir,t[1]=W^~Xt&wt,t[10]=Pr^~cc&pe,t[11]=yr^~io&be,t[20]=Ze^~_t&Wt,t[21]=$t^~bt&wr,t[30]=$n^~ie&rr,t[31]=no^~de&gr,t[40]=ht^~br&lc,t[41]=kr^~Rs&uc,t[2]=Wn^~Ir&cs,t[3]=Xt^~wt&ls,t[12]=cc^~pe&dt,t[13]=io^~be&yt,t[22]=_t^~Wt&so,t[23]=bt^~wr&ma,t[32]=ie^~rr&xt,t[33]=de^~gr&vr,t[42]=br^~lc&je,t[43]=Rs^~uc&Fe,t[4]=Ir^~cs&va,t[5]=wt^~ls&di,t[14]=pe^~dt&ft,t[15]=be^~yt&Ct,t[24]=Wt^~so&Qe,t[25]=wr^~ma&kt,t[34]=rr^~xt&us,t[35]=gr^~vr&fs,t[44]=lc^~je&mr,t[45]=uc^~Fe&vt,t[6]=cs^~va&j,t[7]=ls^~di&W,t[16]=dt^~ft&Pr,t[17]=yt^~Ct&yr,t[26]=so^~Qe&Ze,t[27]=ma^~kt&$t,t[36]=xt^~us&$n,t[37]=vr^~fs&no,t[46]=je^~mr&ht,t[47]=Fe^~vt&kr,t[8]=va^~j&Wn,t[9]=di^~W&Xt,t[18]=ft^~Pr&cc,t[19]=Ct^~yr&io,t[28]=Qe^~Ze&_t,t[29]=kt^~$t&bt,t[38]=us^~$n&ie,t[39]=fs^~no&de,t[48]=mr^~ht&br,t[49]=vt^~kr&Rs,t[0]^=Uq[e*2],t[1]^=Uq[e*2+1]}};const f_=xce;function Ym(){this.state=[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],this.blockSize=null,this.count=0,this.squeezing=!1}Ym.prototype.initialize=function(t,e){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=t/8,this.count=0,this.squeezing=!1};Ym.prototype.absorb=function(t){for(let e=0;e>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(f_.p1600(this.state),this.count=0);return e};Ym.prototype.copy=function(t){for(let e=0;e<50;++e)t.state[e]=this.state[e];t.blockSize=this.blockSize,t.count=this.count,t.squeezing=this.squeezing};var sqe=Ym,oqe=iqe(sqe);const aqe=oqe,cqe=W2;function Ece(t){return Buffer.allocUnsafe(t).fill(0)}function _ce(t,e,r){const n=Ece(e);return t=ZC(t),r?t.length"u")throw new Error("Not an array?");if(r=Ice(t),r!=="dynamic"&&r!==0&&e.length>r)throw new Error("Elements exceed array size: "+r);i=[],t=t.slice(0,t.lastIndexOf("[")),typeof e=="string"&&(e=JSON.parse(e));for(s in e)i.push(ml(t,e[s]));if(r==="dynamic"){var o=ml("uint256",e.length);i.unshift(o)}return Buffer.concat(i)}else{if(t==="bytes")return e=new Buffer(e),i=Buffer.concat([ml("uint256",e.length),e]),e.length%32!==0&&(i=Buffer.concat([i,i1.zeros(32-e.length%32)])),i;if(t.startsWith("bytes")){if(r=Cg(t),r<1||r>32)throw new Error("Invalid bytes width: "+r);return i1.setLengthRight(e,32)}else if(t.startsWith("uint")){if(r=Cg(t),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);if(n=g0(e),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(Buffer,"be",32)}else if(t.startsWith("int")){if(r=Cg(t),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);if(n=g0(e),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(Buffer,"be",32)}else if(t.startsWith("ufixed")){if(r=zq(t),n=g0(e),n<0)throw new Error("Supplied ufixed is negative");return ml("uint256",n.mul(new A0(2).pow(new A0(r[1]))))}else if(t.startsWith("fixed"))return r=zq(t),ml("int256",g0(e).mul(new A0(2).pow(new A0(r[1]))))}throw new Error("Unsupported or invalid type: "+t)}function hqe(t){return t==="string"||t==="bytes"||Ice(t)==="dynamic"}function pqe(t){return t.lastIndexOf("]")===t.length-1}function gqe(t,e){var r=[],n=[],i=32*t.length;for(var s in t){var o=kce(t[s]),a=e[s],c=ml(o,a);hqe(o)?(r.push(ml("uint256",i)),n.push(c),i+=c.length):r.push(c)}return Buffer.concat(r.concat(n))}function Pce(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var r,n,i=[],s=0;s32)throw new Error("Invalid bytes width: "+r);i.push(i1.setLengthRight(a,r))}else if(o.startsWith("uint")){if(r=Cg(o),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);if(n=g0(a),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());i.push(n.toArrayLike(Buffer,"be",r/8))}else if(o.startsWith("int")){if(r=Cg(o),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);if(n=g0(a),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());i.push(n.toTwos(r).toArrayLike(Buffer,"be",r/8))}else throw new Error("Unsupported or invalid type: "+o)}return Buffer.concat(i)}function mqe(t,e){return i1.keccak(Pce(t,e))}var vqe={rawEncode:gqe,solidityPack:Pce,soliditySHA3:mqe};const Ac=Ace,db=vqe,Rce={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},V9={encodeData(t,e,r,n=!0){const i=["bytes32"],s=[this.hashType(t,r)];if(n){const o=(a,c,l)=>{if(r[c]!==void 0)return["bytes32",l==null?"0x0000000000000000000000000000000000000000000000000000000000000000":Ac.keccak(this.encodeData(c,l,r,n))];if(l===void 0)throw new Error(`missing value for field ${a} of type ${c}`);if(c==="bytes")return["bytes32",Ac.keccak(l)];if(c==="string")return typeof l=="string"&&(l=Buffer.from(l,"utf8")),["bytes32",Ac.keccak(l)];if(c.lastIndexOf("]")===c.length-1){const u=c.slice(0,c.lastIndexOf("[")),f=l.map(d=>o(a,u,d));return["bytes32",Ac.keccak(db.rawEncode(f.map(([d])=>d),f.map(([,d])=>d)))]}return[c,l]};for(const a of r[t]){const[c,l]=o(a.name,a.type,e[a.name]);i.push(c),s.push(l)}}else for(const o of r[t]){let a=e[o.name];if(a!==void 0)if(o.type==="bytes")i.push("bytes32"),a=Ac.keccak(a),s.push(a);else if(o.type==="string")i.push("bytes32"),typeof a=="string"&&(a=Buffer.from(a,"utf8")),a=Ac.keccak(a),s.push(a);else if(r[o.type]!==void 0)i.push("bytes32"),a=Ac.keccak(this.encodeData(o.type,a,r,n)),s.push(a);else{if(o.type.lastIndexOf("]")===o.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(o.type),s.push(a)}}return db.rawEncode(i,s)},encodeType(t,e){let r="",n=this.findTypeDependencies(t,e).filter(i=>i!==t);n=[t].concat(n.sort());for(const i of n){if(!e[i])throw new Error("No type definition specified: "+i);r+=i+"("+e[i].map(({name:o,type:a})=>a+" "+o).join(",")+")"}return r},findTypeDependencies(t,e,r=[]){if(t=t.match(/^\w*/)[0],r.includes(t)||e[t]===void 0)return r;r.push(t);for(const n of e[t])for(const i of this.findTypeDependencies(n.type,e,r))!r.includes(i)&&r.push(i);return r},hashStruct(t,e,r,n=!0){return Ac.keccak(this.encodeData(t,e,r,n))},hashType(t,e){return Ac.keccak(this.encodeType(t,e))},sanitizeData(t){const e={};for(const r in Rce.properties)t[r]&&(e[r]=t[r]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash(t,e=!0){const r=this.sanitizeData(t),n=[Buffer.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,e)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,e)),Ac.keccak(Buffer.concat(n))}};var yqe={TYPED_MESSAGE_SCHEMA:Rce,TypedDataUtils:V9,hashForSignTypedDataLegacy:function(t){return bqe(t.data)},hashForSignTypedData_v3:function(t){return V9.hash(t.data,!1)},hashForSignTypedData_v4:function(t){return V9.hash(t.data)}};function bqe(t){const e=new Error("Expect argument to be non-empty array");if(typeof t!="object"||!t.length)throw e;const r=t.map(function(s){return s.type==="bytes"?Ac.toBuffer(s.value):s.value}),n=t.map(function(s){return s.type}),i=t.map(function(s){if(!s.name)throw e;return s.type+" "+s.name});return db.soliditySHA3(["bytes32","bytes32"],[db.soliditySHA3(new Array(t.length).fill("string"),i),db.soliditySHA3(n,r)])}var hm={};Object.defineProperty(hm,"__esModule",{value:!0});hm.filterFromParam=hm.FilterPolyfill=void 0;const $p=xi,Fs=st,wqe=5*60*1e3,m0={jsonrpc:"2.0",id:0};class xqe{constructor(e){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,$p.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=e}async newFilter(e){const r=Tce(e),n=this.makeFilterId(),i=await this.setInitialCursorPosition(n,r.fromBlock);return console.info(`Installing new log filter(${n}):`,r,"initial cursor position:",i),this.logFilters.set(n,r),this.setFilterTimeout(n),(0,Fs.hexStringFromIntNumber)(n)}async newBlockFilter(){const e=this.makeFilterId(),r=await this.setInitialCursorPosition(e,"latest");return console.info(`Installing new block filter (${e}) with initial cursor position:`,r),this.blockFilters.add(e),this.setFilterTimeout(e),(0,Fs.hexStringFromIntNumber)(e)}async newPendingTransactionFilter(){const e=this.makeFilterId(),r=await this.setInitialCursorPosition(e,"latest");return console.info(`Installing new block filter (${e}) with initial cursor position:`,r),this.pendingTransactionFilters.add(e),this.setFilterTimeout(e),(0,Fs.hexStringFromIntNumber)(e)}uninstallFilter(e){const r=(0,Fs.intNumberFromHexString)(e);return console.info(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(e){const r=(0,Fs.intNumberFromHexString)(e);return this.timeouts.has(r)&&this.setFilterTimeout(r),this.logFilters.has(r)?this.getLogFilterChanges(r):this.blockFilters.has(r)?this.getBlockFilterChanges(r):this.pendingTransactionFilters.has(r)?this.getPendingTransactionFilterChanges(r):Promise.resolve(a3())}async getFilterLogs(e){const r=(0,Fs.intNumberFromHexString)(e),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},m0),{method:"eth_getLogs",params:[Hq(n)]})):a3()}makeFilterId(){return(0,$p.IntNumber)(++this.nextFilterId)}sendAsyncPromise(e){return new Promise((r,n)=>{this.provider.sendAsync(e,(i,s)=>{if(i)return n(i);if(Array.isArray(s)||s==null)return n(new Error(`unexpected response received: ${JSON.stringify(s)}`));r(s)})})}deleteFilter(e){console.info(`Deleting filter (${e})`),this.logFilters.delete(e),this.blockFilters.delete(e),this.pendingTransactionFilters.delete(e),this.cursors.delete(e),this.timeouts.delete(e)}async getLogFilterChanges(e){const r=this.logFilters.get(e),n=this.cursors.get(e);if(!n||!r)return a3();const i=await this.getCurrentBlockHeight(),s=r.toBlock==="latest"?i:r.toBlock;if(n>i||n>Number(r.toBlock))return c3();console.info(`Fetching logs from ${n} to ${s} for filter ${e}`);const o=await this.sendAsyncPromise(Object.assign(Object.assign({},m0),{method:"eth_getLogs",params:[Hq(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:s}))]}));if(Array.isArray(o.result)){const a=o.result.map(l=>(0,Fs.intNumberFromHexString)(l.blockNumber||"0x0")),c=Math.max(...a);if(c&&c>n){const l=(0,$p.IntNumber)(c+1);console.info(`Moving cursor position for filter (${e}) from ${n} to ${l}`),this.cursors.set(e,l)}}return o}async getBlockFilterChanges(e){const r=this.cursors.get(e);if(!r)return a3();const n=await this.getCurrentBlockHeight();if(r>n)return c3();console.info(`Fetching blocks from ${r} to ${n} for filter (${e})`);const i=(await Promise.all((0,Fs.range)(r,n+1).map(o=>this.getBlockHashByNumber((0,$p.IntNumber)(o))))).filter(o=>!!o),s=(0,$p.IntNumber)(r+i.length);return console.info(`Moving cursor position for filter (${e}) from ${r} to ${s}`),this.cursors.set(e,s),Object.assign(Object.assign({},m0),{result:i})}async getPendingTransactionFilterChanges(e){return Promise.resolve(c3())}async setInitialCursorPosition(e,r){const n=await this.getCurrentBlockHeight(),i=typeof r=="number"&&r>n?r:n;return this.cursors.set(e,i),i}setFilterTimeout(e){const r=this.timeouts.get(e);r&&window.clearTimeout(r);const n=window.setTimeout(()=>{console.info(`Filter (${e}) timed out`),this.deleteFilter(e)},wqe);this.timeouts.set(e,n)}async getCurrentBlockHeight(){const e=new Date;if(e.getTime()-this.lastFetchTimestamp.getTime()>this.REQUEST_THROTTLE_INTERVAL){this.lastFetchTimestamp=e;const r=await this._getCurrentBlockHeight();this.currentBlockHeight=r,this.resolvers.forEach(n=>n(r)),this.resolvers=[]}return this.currentBlockHeight?this.currentBlockHeight:new Promise(r=>this.resolvers.push(r))}async _getCurrentBlockHeight(){const{result:e}=await this.sendAsyncPromise(Object.assign(Object.assign({},m0),{method:"eth_blockNumber",params:[]}));return(0,Fs.intNumberFromHexString)((0,Fs.ensureHexString)(e))}async getBlockHashByNumber(e){const r=await this.sendAsyncPromise(Object.assign(Object.assign({},m0),{method:"eth_getBlockByNumber",params:[(0,Fs.hexStringFromIntNumber)(e),!1]}));return r.result&&typeof r.result.hash=="string"?(0,Fs.ensureHexString)(r.result.hash):null}}hm.FilterPolyfill=xqe;function Tce(t){return{fromBlock:qq(t.fromBlock),toBlock:qq(t.toBlock),addresses:t.address===void 0?null:Array.isArray(t.address)?t.address:[t.address],topics:t.topics||[]}}hm.filterFromParam=Tce;function Hq(t){const e={fromBlock:Wq(t.fromBlock),toBlock:Wq(t.toBlock),topics:t.topics};return t.addresses!==null&&(e.address=t.addresses),e}function qq(t){if(t===void 0||t==="latest"||t==="pending")return"latest";if(t==="earliest")return(0,$p.IntNumber)(0);if((0,Fs.isHexString)(t))return(0,Fs.intNumberFromHexString)(t);throw new Error(`Invalid block option: ${String(t)}`)}function Wq(t){return t==="latest"?t:(0,Fs.hexStringFromIntNumber)(t)}function a3(){return Object.assign(Object.assign({},m0),{error:{code:-32e3,message:"filter not found"}})}function c3(){return Object.assign(Object.assign({},m0),{result:[]})}var XC={},Oce={},e4={},JN=Eqe;function Eqe(t){t=t||{};var e=t.max||Number.MAX_SAFE_INTEGER,r=typeof t.start<"u"?t.start:Math.floor(Math.random()*e);return function(){return r=r%e,r++}}const Vq=(t,e)=>function(){const r=e.promiseModule,n=new Array(arguments.length);for(let i=0;i{e.errorFirst?n.push(function(o,a){if(e.multiArgs){const c=new Array(arguments.length-1);for(let l=1;l{e=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},e);const r=i=>{const s=o=>typeof o=="string"?i===o:o.test(i);return e.include?e.include.some(s):!e.exclude.some(s)};let n;typeof t=="function"?n=function(){return e.excludeMain?t.apply(this,arguments):Vq(t,e).apply(this,arguments)}:n=Object.create(Object.getPrototypeOf(t));for(const i in t){const s=t[i];n[i]=typeof s=="function"&&r(i)?Vq(s,e):s}return n},Bw={},Fw={};Object.defineProperty(Fw,"__esModule",{value:!0});const Cqe=is;function Gq(t,e,r){try{Reflect.apply(t,e,r)}catch(n){setTimeout(()=>{throw n})}}function Sqe(t){const e=t.length,r=new Array(e);for(let n=0;n0&&([o]=r),o instanceof Error)throw o;const a=new Error(`Unhandled error.${o?` (${o.message})`:""}`);throw a.context=o,a}const s=i[e];if(s===void 0)return!1;if(typeof s=="function")Gq(s,this,r);else{const o=s.length,a=Sqe(s);for(let c=0;ct+e,Kq=["sync","latest"];class Tqe extends Iqe.default{constructor(e){super(),this._blockResetDuration=e.blockResetDuration||20*Pqe,this._usePastBlocks=e.usePastBlocks||!1,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(r=>this.once("latest",r))}removeAllListeners(e){return e?super.removeAllListeners(e):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(e){Kq.includes(e)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return Kq.map(e=>this.listenerCount(e)).reduce(Rqe)}_shouldUseNewBlock(e){const r=this._currentBlock;if(!r)return!0;const n=Jq(e),i=Jq(r);return this._usePastBlocks&&ni}_newPotentialLatest(e){this._shouldUseNewBlock(e)&&this._setCurrentBlock(e)}_setCurrentBlock(e){const r=this._currentBlock;this._currentBlock=e,this.emit("latest",e),this.emit("sync",{oldBlock:r,newBlock:e})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}Bw.BaseBlockTracker=Tqe;function Jq(t){return Number.parseInt(t,16)}var $ce={},Nce={},Zi={};class Mce extends TypeError{constructor(e,r){let n;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=()=>n??(n=[e,...r()])}}function Oqe(t){return Va(t)&&typeof t[Symbol.iterator]=="function"}function Va(t){return typeof t=="object"&&t!=null}function Qq(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function Ci(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function $qe(t){const{done:e,value:r}=t.next();return e?void 0:r}function Nqe(t,e,r,n){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:i,branch:s}=e,{type:o}=r,{refinement:a,message:c=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${Ci(n)}\``}=t;return{value:n,type:o,refinement:a,key:i[i.length-1],path:i,branch:s,...t,message:c}}function*QP(t,e,r,n){Oqe(t)||(t=[t]);for(const i of t){const s=Nqe(i,e,r,n);s&&(yield s)}}function*QN(t,e,r={}){const{path:n=[],branch:i=[t],coerce:s=!1,mask:o=!1}=r,a={path:n,branch:i};if(s&&(t=e.coercer(t,a),o&&e.type!=="type"&&Va(e.schema)&&Va(t)&&!Array.isArray(t)))for(const l in t)e.schema[l]===void 0&&delete t[l];let c="valid";for(const l of e.validator(t,a))l.explanation=r.message,c="not_valid",yield[l,void 0];for(let[l,u,f]of e.entries(t,a)){const d=QN(u,f,{path:l===void 0?n:[...n,l],branch:l===void 0?i:[...i,u],coerce:s,mask:o,message:r.message});for(const p of d)p[0]?(c=p[0].refinement!=null?"not_refined":"not_valid",yield[p[0],void 0]):s&&(u=p[1],l===void 0?t=u:t instanceof Map?t.set(l,u):t instanceof Set?t.add(u):Va(t)&&(u!==void 0||l in t)&&(t[l]=u))}if(c!=="not_valid")for(const l of e.refiner(t,a))l.explanation=r.message,c="not_refined",yield[l,void 0];c==="valid"&&(yield[void 0,t])}class Xn{constructor(e){const{type:r,schema:n,validator:i,refiner:s,coercer:o=c=>c,entries:a=function*(){}}=e;this.type=r,this.schema=n,this.entries=a,this.coercer=o,i?this.validator=(c,l)=>{const u=i(c,l);return QP(u,l,this,c)}:this.validator=()=>[],s?this.refiner=(c,l)=>{const u=s(c,l);return QP(u,l,this,c)}:this.refiner=()=>[]}assert(e,r){return Dce(e,this,r)}create(e,r){return Lce(e,this,r)}is(e){return YN(e,this)}mask(e,r){return Bce(e,this,r)}validate(e,r={}){return Zm(e,this,r)}}function Dce(t,e,r){const n=Zm(t,e,{message:r});if(n[0])throw n[0]}function Lce(t,e,r){const n=Zm(t,e,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function Bce(t,e,r){const n=Zm(t,e,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function YN(t,e){return!Zm(t,e)[0]}function Zm(t,e,r={}){const n=QN(t,e,r),i=$qe(n);return i[0]?[new Mce(i[0],function*(){for(const o of n)o[0]&&(yield o[0])}),void 0]:[void 0,i[1]]}function Mqe(...t){const e=t[0].type==="type",r=t.map(i=>i.schema),n=Object.assign({},...r);return e?XN(n):jw(n)}function Do(t,e){return new Xn({type:t,schema:null,validator:e})}function Dqe(t,e){return new Xn({...t,refiner:(r,n)=>r===void 0||t.refiner(r,n),validator(r,n){return r===void 0?!0:(e(r,n),t.validator(r,n))}})}function Lqe(t){return new Xn({type:"dynamic",schema:null,*entries(e,r){yield*t(e,r).entries(e,r)},validator(e,r){return t(e,r).validator(e,r)},coercer(e,r){return t(e,r).coercer(e,r)},refiner(e,r){return t(e,r).refiner(e,r)}})}function Bqe(t){let e;return new Xn({type:"lazy",schema:null,*entries(r,n){e??(e=t()),yield*e.entries(r,n)},validator(r,n){return e??(e=t()),e.validator(r,n)},coercer(r,n){return e??(e=t()),e.coercer(r,n)},refiner(r,n){return e??(e=t()),e.refiner(r,n)}})}function Fqe(t,e){const{schema:r}=t,n={...r};for(const i of e)delete n[i];switch(t.type){case"type":return XN(n);default:return jw(n)}}function jqe(t){const e=t instanceof Xn?{...t.schema}:{...t};for(const r in e)e[r]=Fce(e[r]);return jw(e)}function Uqe(t,e){const{schema:r}=t,n={};for(const i of e)n[i]=r[i];return jw(n)}function zqe(t,e){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),Do(t,e)}function Hqe(){return Do("any",()=>!0)}function qqe(t){return new Xn({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[r,n]of e.entries())yield[r,n,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${Ci(e)}`}})}function Wqe(){return Do("bigint",t=>typeof t=="bigint")}function Vqe(){return Do("boolean",t=>typeof t=="boolean")}function Gqe(){return Do("date",t=>t instanceof Date&&!isNaN(t.getTime())||`Expected a valid \`Date\` object, but received: ${Ci(t)}`)}function Kqe(t){const e={},r=t.map(n=>Ci(n)).join();for(const n of t)e[n]=n;return new Xn({type:"enums",schema:e,validator(n){return t.includes(n)||`Expected one of \`${r}\`, but received: ${Ci(n)}`}})}function Jqe(){return Do("func",t=>typeof t=="function"||`Expected a function, but received: ${Ci(t)}`)}function Qqe(t){return Do("instance",e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${Ci(e)}`)}function Yqe(){return Do("integer",t=>typeof t=="number"&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${Ci(t)}`)}function Zqe(t){return new Xn({type:"intersection",schema:null,*entries(e,r){for(const n of t)yield*n.entries(e,r)},*validator(e,r){for(const n of t)yield*n.validator(e,r)},*refiner(e,r){for(const n of t)yield*n.refiner(e,r)}})}function Xqe(t){const e=Ci(t),r=typeof t;return new Xn({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(n){return n===t||`Expected the literal \`${e}\`, but received: ${Ci(n)}`}})}function eWe(t,e){return new Xn({type:"map",schema:null,*entries(r){if(t&&e&&r instanceof Map)for(const[n,i]of r.entries())yield[n,n,t],yield[n,i,e]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${Ci(r)}`}})}function ZN(){return Do("never",()=>!1)}function tWe(t){return new Xn({...t,validator:(e,r)=>e===null||t.validator(e,r),refiner:(e,r)=>e===null||t.refiner(e,r)})}function rWe(){return Do("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${Ci(t)}`)}function jw(t){const e=t?Object.keys(t):[],r=ZN();return new Xn({type:"object",schema:t||null,*entries(n){if(t&&Va(n)){const i=new Set(Object.keys(n));for(const s of e)i.delete(s),yield[s,n[s],t[s]];for(const s of i)yield[s,n[s],r]}},validator(n){return Va(n)||`Expected an object, but received: ${Ci(n)}`},coercer(n){return Va(n)?{...n}:n}})}function Fce(t){return new Xn({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function nWe(t,e){return new Xn({type:"record",schema:null,*entries(r){if(Va(r))for(const n in r){const i=r[n];yield[n,n,t],yield[n,i,e]}},validator(r){return Va(r)||`Expected an object, but received: ${Ci(r)}`}})}function iWe(){return Do("regexp",t=>t instanceof RegExp)}function sWe(t){return new Xn({type:"set",schema:null,*entries(e){if(t&&e instanceof Set)for(const r of e)yield[r,r,t]},coercer(e){return e instanceof Set?new Set(e):e},validator(e){return e instanceof Set||`Expected a \`Set\` object, but received: ${Ci(e)}`}})}function jce(){return Do("string",t=>typeof t=="string"||`Expected a string, but received: ${Ci(t)}`)}function oWe(t){const e=ZN();return new Xn({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(t.length,r.length);for(let i=0;ir.type).join(" | ");return new Xn({type:"union",schema:null,coercer(r){for(const n of t){const[i,s]=n.validate(r,{coerce:!0});if(!i)return s}return r},validator(r,n){const i=[];for(const s of t){const[...o]=QN(r,s,n),[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: ${Ci(r)}`,...i]}})}function Uce(){return Do("unknown",()=>!0)}function eM(t,e,r){return new Xn({...t,coercer:(n,i)=>YN(n,e)?t.coercer(r(n,i),i):t.coercer(n,i)})}function cWe(t,e,r={}){return eM(t,Uce(),n=>{const i=typeof e=="function"?e():e;if(n===void 0)return i;if(!r.strict&&Qq(n)&&Qq(i)){const s={...n};let o=!1;for(const a in i)s[a]===void 0&&(s[a]=i[a],o=!0);if(o)return s}return n})}function lWe(t){return eM(t,jce(),e=>e.trim())}function uWe(t){return k1(t,"empty",e=>{const r=zce(e);return r===0||`Expected an empty ${t.type} but received one with a size of \`${r}\``})}function zce(t){return t instanceof Map||t instanceof Set?t.size:t.length}function fWe(t,e,r={}){const{exclusive:n}=r;return k1(t,"max",i=>n?in?i>e:i>=e||`Expected a ${t.type} greater than ${n?"":"or equal to "}${e} but received \`${i}\``)}function hWe(t){return k1(t,"nonempty",e=>zce(e)>0||`Expected a nonempty ${t.type} but received an empty one`)}function pWe(t,e){return k1(t,"pattern",r=>e.test(r)||`Expected a ${t.type} matching \`/${e.source}/\` but received "${r}"`)}function gWe(t,e,r=e){const n=`Expected a ${t.type}`,i=e===r?`of \`${e}\``:`between \`${e}\` and \`${r}\``;return k1(t,"size",s=>{if(typeof s=="number"||s instanceof Date)return e<=s&&s<=r||`${n} ${i} but received \`${s}\``;if(s instanceof Map||s instanceof Set){const{size:o}=s;return e<=o&&o<=r||`${n} with a size ${i} but received one with a size of \`${o}\``}else{const{length:o}=s;return e<=o&&o<=r||`${n} with a length ${i} but received one with a length of \`${o}\``}})}function k1(t,e,r){return new Xn({...t,*refiner(n,i){yield*t.refiner(n,i);const s=r(n,i),o=QP(s,i,t,n);for(const a of o)yield{...a,refinement:e}}})}const mWe=Object.freeze(Object.defineProperty({__proto__:null,Struct:Xn,StructError:Mce,any:Hqe,array:qqe,assert:Dce,assign:Mqe,bigint:Wqe,boolean:Vqe,coerce:eM,create:Lce,date:Gqe,defaulted:cWe,define:Do,deprecated:Dqe,dynamic:Lqe,empty:uWe,enums:Kqe,func:Jqe,instance:Qqe,integer:Yqe,intersection:Zqe,is:YN,lazy:Bqe,literal:Xqe,map:eWe,mask:Bce,max:fWe,min:dWe,never:ZN,nonempty:hWe,nullable:tWe,number:rWe,object:jw,omit:Fqe,optional:Fce,partial:jqe,pattern:pWe,pick:Uqe,record:nWe,refine:k1,regexp:iWe,set:sWe,size:gWe,string:jce,struct:zqe,trimmed:lWe,tuple:oWe,type:XN,union:aWe,unknown:Uce,validate:Zm},Symbol.toStringTag,{value:"Module"})),I1=wf(mWe);Object.defineProperty(Zi,"__esModule",{value:!0});Zi.assertExhaustive=Zi.assertStruct=Zi.assert=Zi.AssertionError=void 0;const vWe=I1;function yWe(t){return typeof t=="object"&&t!==null&&"message"in t}function bWe(t){var e,r;return typeof((r=(e=t==null?void 0:t.prototype)===null||e===void 0?void 0:e.constructor)===null||r===void 0?void 0:r.name)=="string"}function wWe(t){const e=yWe(t)?t.message:String(t);return e.endsWith(".")?e.slice(0,-1):e}function Hce(t,e){return bWe(t)?new t({message:e}):t({message:e})}class tM extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}Zi.AssertionError=tM;function xWe(t,e="Assertion failed.",r=tM){if(!t)throw e instanceof Error?e:Hce(r,e)}Zi.assert=xWe;function EWe(t,e,r="Assertion failed",n=tM){try{(0,vWe.assert)(t,e)}catch(i){throw Hce(n,`${r}: ${wWe(i)}.`)}}Zi.assertStruct=EWe;function _We(t){throw new Error("Invalid branch reached. Should be detected during compilation.")}Zi.assertExhaustive=_We;var Uw={};Object.defineProperty(Uw,"__esModule",{value:!0});Uw.base64=void 0;const CWe=I1,SWe=Zi,AWe=(t,e={})=>{var r,n;const i=(r=e.paddingRequired)!==null&&r!==void 0?r:!1,s=(n=e.characterSet)!==null&&n!==void 0?n:"base64";let o;s==="base64"?o=String.raw`[A-Za-z0-9+\/]`:((0,SWe.assert)(s==="base64url"),o=String.raw`[-_A-Za-z0-9]`);let a;return i?a=new RegExp(`^(?:${o}{4})*(?:${o}{3}=|${o}{2}==)?$`,"u"):a=new RegExp(`^(?:${o}{4})*(?:${o}{2,3}|${o}{3}=|${o}{2}==)?$`,"u"),(0,CWe.pattern)(t,a)};Uw.base64=AWe;var _r={},zw={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.remove0x=t.add0x=t.assertIsStrictHexString=t.assertIsHexString=t.isStrictHexString=t.isHexString=t.StrictHexStruct=t.HexStruct=void 0;const e=I1,r=Zi;t.HexStruct=(0,e.pattern)((0,e.string)(),/^(?:0x)?[0-9a-f]+$/iu),t.StrictHexStruct=(0,e.pattern)((0,e.string)(),/^0x[0-9a-f]+$/iu);function n(l){return(0,e.is)(l,t.HexStruct)}t.isHexString=n;function i(l){return(0,e.is)(l,t.StrictHexStruct)}t.isStrictHexString=i;function s(l){(0,r.assert)(n(l),"Value must be a hexadecimal string.")}t.assertIsHexString=s;function o(l){(0,r.assert)(i(l),'Value must be a hexadecimal string, starting with "0x".')}t.assertIsStrictHexString=o;function a(l){return l.startsWith("0x")?l:l.startsWith("0X")?`0x${l.substring(2)}`:`0x${l}`}t.add0x=a;function c(l){return l.startsWith("0x")||l.startsWith("0X")?l.substring(2):l}t.remove0x=c})(zw);Object.defineProperty(_r,"__esModule",{value:!0});_r.createDataView=_r.concatBytes=_r.valueToBytes=_r.stringToBytes=_r.numberToBytes=_r.signedBigIntToBytes=_r.bigIntToBytes=_r.hexToBytes=_r.bytesToString=_r.bytesToNumber=_r.bytesToSignedBigInt=_r.bytesToBigInt=_r.bytesToHex=_r.assertIsBytes=_r.isBytes=void 0;const Xo=Zi,YP=zw,Yq=48,Zq=58,Xq=87;function kWe(){const t=[];return()=>{if(t.length===0)for(let e=0;e<256;e++)t.push(e.toString(16).padStart(2,"0"));return t}}const IWe=kWe();function rM(t){return t instanceof Uint8Array}_r.isBytes=rM;function Xm(t){(0,Xo.assert)(rM(t),"Value must be a Uint8Array.")}_r.assertIsBytes=Xm;function qce(t){if(Xm(t),t.length===0)return"0x";const e=IWe(),r=new Array(t.length);for(let n=0;n=BigInt(0),"Value must be a non-negative bigint.");const e=t.toString(16);return t4(e)}_r.bigIntToBytes=Vce;function OWe(t,e){(0,Xo.assert)(e>0);const r=t>>BigInt(31);return!((~t&r)+(t&~r)>>BigInt(e*8+-1))}function $We(t,e){(0,Xo.assert)(typeof t=="bigint","Value must be a bigint."),(0,Xo.assert)(typeof e=="number","Byte length must be a number."),(0,Xo.assert)(e>0,"Byte length must be greater than 0."),(0,Xo.assert)(OWe(t,e),"Byte length is too small to represent the given value.");let r=t;const n=new Uint8Array(e);for(let i=0;i>=BigInt(8);return n.reverse()}_r.signedBigIntToBytes=$We;function Gce(t){(0,Xo.assert)(typeof t=="number","Value must be a number."),(0,Xo.assert)(t>=0,"Value must be a non-negative number."),(0,Xo.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToBytes` instead.");const e=t.toString(16);return t4(e)}_r.numberToBytes=Gce;function Kce(t){return(0,Xo.assert)(typeof t=="string","Value must be a string."),new TextEncoder().encode(t)}_r.stringToBytes=Kce;function Jce(t){if(typeof t=="bigint")return Vce(t);if(typeof t=="number")return Gce(t);if(typeof t=="string")return t.startsWith("0x")?t4(t):Kce(t);if(rM(t))return t;throw new TypeError(`Unsupported value type: "${typeof t}".`)}_r.valueToBytes=Jce;function NWe(t){const e=new Array(t.length);let r=0;for(let i=0;ie.call(r,n,i,this))}get(e){return zs(this,Ec,"f").get(e)}has(e){return zs(this,Ec,"f").has(e)}keys(){return zs(this,Ec,"f").keys()}values(){return zs(this,Ec,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([e,r])=>`${String(e)} => ${String(r)}`).join(", ")} `:""}}`}}pm.FrozenMap=nM;class iM{constructor(e){cl.set(this,void 0),Zce(this,cl,new Set(e),"f"),Object.freeze(this)}get size(){return zs(this,cl,"f").size}[(cl=new WeakMap,Symbol.iterator)](){return zs(this,cl,"f")[Symbol.iterator]()}entries(){return zs(this,cl,"f").entries()}forEach(e,r){return zs(this,cl,"f").forEach((n,i,s)=>e.call(r,n,i,this))}has(e){return zs(this,cl,"f").has(e)}keys(){return zs(this,cl,"f").keys()}values(){return zs(this,cl,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(e=>String(e)).join(", ")} `:""}}`}}pm.FrozenSet=iM;Object.freeze(nM);Object.freeze(nM.prototype);Object.freeze(iM);Object.freeze(iM.prototype);var Xce={};Object.defineProperty(Xce,"__esModule",{value:!0});var ele={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getJsonRpcIdValidator=t.assertIsJsonRpcError=t.isJsonRpcError=t.assertIsJsonRpcFailure=t.isJsonRpcFailure=t.assertIsJsonRpcSuccess=t.isJsonRpcSuccess=t.assertIsJsonRpcResponse=t.isJsonRpcResponse=t.assertIsPendingJsonRpcResponse=t.isPendingJsonRpcResponse=t.JsonRpcResponseStruct=t.JsonRpcFailureStruct=t.JsonRpcSuccessStruct=t.PendingJsonRpcResponseStruct=t.assertIsJsonRpcRequest=t.isJsonRpcRequest=t.assertIsJsonRpcNotification=t.isJsonRpcNotification=t.JsonRpcNotificationStruct=t.JsonRpcRequestStruct=t.JsonRpcParamsStruct=t.JsonRpcErrorStruct=t.JsonRpcIdStruct=t.JsonRpcVersionStruct=t.jsonrpc2=t.getJsonSize=t.isValidJson=t.JsonStruct=t.UnsafeJsonStruct=void 0;const e=I1,r=Zi,n=()=>(0,e.define)("finite number",S=>(0,e.is)(S,(0,e.number)())&&Number.isFinite(S));t.UnsafeJsonStruct=(0,e.union)([(0,e.literal)(null),(0,e.boolean)(),n(),(0,e.string)(),(0,e.array)((0,e.lazy)(()=>t.UnsafeJsonStruct)),(0,e.record)((0,e.string)(),(0,e.lazy)(()=>t.UnsafeJsonStruct))]),t.JsonStruct=(0,e.define)("Json",(S,P)=>{function _(T,Q){const ne=[...Q.validator(T,P)];return ne.length>0?ne:!0}try{const T=_(S,t.UnsafeJsonStruct);return T!==!0?T:_(JSON.parse(JSON.stringify(S)),t.UnsafeJsonStruct)}catch(T){return T instanceof RangeError?"Circular reference detected":!1}});function i(S){return(0,e.is)(S,t.JsonStruct)}t.isValidJson=i;function s(S){(0,r.assertStruct)(S,t.JsonStruct,"Invalid JSON value");const P=JSON.stringify(S);return new TextEncoder().encode(P).byteLength}t.getJsonSize=s,t.jsonrpc2="2.0",t.JsonRpcVersionStruct=(0,e.literal)(t.jsonrpc2),t.JsonRpcIdStruct=(0,e.nullable)((0,e.union)([(0,e.number)(),(0,e.string)()])),t.JsonRpcErrorStruct=(0,e.object)({code:(0,e.integer)(),message:(0,e.string)(),data:(0,e.optional)(t.JsonStruct),stack:(0,e.optional)((0,e.string)())}),t.JsonRpcParamsStruct=(0,e.optional)((0,e.union)([(0,e.record)((0,e.string)(),t.JsonStruct),(0,e.array)(t.JsonStruct)])),t.JsonRpcRequestStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,method:(0,e.string)(),params:t.JsonRpcParamsStruct}),t.JsonRpcNotificationStruct=(0,e.omit)(t.JsonRpcRequestStruct,["id"]);function o(S){return(0,e.is)(S,t.JsonRpcNotificationStruct)}t.isJsonRpcNotification=o;function a(S,P){(0,r.assertStruct)(S,t.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",P)}t.assertIsJsonRpcNotification=a;function c(S){return(0,e.is)(S,t.JsonRpcRequestStruct)}t.isJsonRpcRequest=c;function l(S,P){(0,r.assertStruct)(S,t.JsonRpcRequestStruct,"Invalid JSON-RPC request",P)}t.assertIsJsonRpcRequest=l,t.PendingJsonRpcResponseStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:(0,e.optional)((0,e.unknown)()),error:(0,e.optional)(t.JsonRpcErrorStruct)}),t.JsonRpcSuccessStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:t.JsonStruct}),t.JsonRpcFailureStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,error:t.JsonRpcErrorStruct}),t.JsonRpcResponseStruct=(0,e.union)([t.JsonRpcSuccessStruct,t.JsonRpcFailureStruct]);function u(S){return(0,e.is)(S,t.PendingJsonRpcResponseStruct)}t.isPendingJsonRpcResponse=u;function f(S,P){(0,r.assertStruct)(S,t.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",P)}t.assertIsPendingJsonRpcResponse=f;function d(S){return(0,e.is)(S,t.JsonRpcResponseStruct)}t.isJsonRpcResponse=d;function p(S,P){(0,r.assertStruct)(S,t.JsonRpcResponseStruct,"Invalid JSON-RPC response",P)}t.assertIsJsonRpcResponse=p;function g(S){return(0,e.is)(S,t.JsonRpcSuccessStruct)}t.isJsonRpcSuccess=g;function v(S,P){(0,r.assertStruct)(S,t.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",P)}t.assertIsJsonRpcSuccess=v;function y(S){return(0,e.is)(S,t.JsonRpcFailureStruct)}t.isJsonRpcFailure=y;function b(S,P){(0,r.assertStruct)(S,t.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",P)}t.assertIsJsonRpcFailure=b;function w(S){return(0,e.is)(S,t.JsonRpcErrorStruct)}t.isJsonRpcError=w;function E(S,P){(0,r.assertStruct)(S,t.JsonRpcErrorStruct,"Invalid JSON-RPC error",P)}t.assertIsJsonRpcError=E;function C(S){const{permitEmptyString:P,permitFractions:_,permitNull:T}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},S);return Z=>!!(typeof Z=="number"&&(_||Number.isInteger(Z))||typeof Z=="string"&&(P||Z.length>0)||T&&Z===null)}t.getJsonRpcIdValidator=C})(ele);var tle={};Object.defineProperty(tle,"__esModule",{value:!0});var gm={},ZP={exports:{}},G9,tW;function VWe(){if(tW)return G9;tW=1;var t=1e3,e=t*60,r=e*60,n=r*24,i=n*7,s=n*365.25;G9=function(u,f){f=f||{};var d=typeof u;if(d==="string"&&u.length>0)return o(u);if(d==="number"&&isFinite(u))return f.long?c(u):a(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function o(u){if(u=String(u),!(u.length>100)){var f=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(u);if(f){var d=parseFloat(f[1]),p=(f[2]||"ms").toLowerCase();switch(p){case"years":case"year":case"yrs":case"yr":case"y":return d*s;case"weeks":case"week":case"w":return d*i;case"days":case"day":case"d":return d*n;case"hours":case"hour":case"hrs":case"hr":case"h":return d*r;case"minutes":case"minute":case"mins":case"min":case"m":return d*e;case"seconds":case"second":case"secs":case"sec":case"s":return d*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return d;default:return}}}}function a(u){var f=Math.abs(u);return f>=n?Math.round(u/n)+"d":f>=r?Math.round(u/r)+"h":f>=e?Math.round(u/e)+"m":f>=t?Math.round(u/t)+"s":u+"ms"}function c(u){var f=Math.abs(u);return f>=n?l(u,f,n,"day"):f>=r?l(u,f,r,"hour"):f>=e?l(u,f,e,"minute"):f>=t?l(u,f,t,"second"):u+" ms"}function l(u,f,d,p){var g=f>=d*1.5;return Math.round(u/d)+" "+p+(g?"s":"")}return G9}function GWe(t){r.debug=r,r.default=r,r.coerce=c,r.disable=s,r.enable=i,r.enabled=o,r.humanize=VWe(),r.destroy=l,Object.keys(t).forEach(u=>{r[u]=t[u]}),r.names=[],r.skips=[],r.formatters={};function e(u){let f=0;for(let d=0;d{if(P==="%%")return"%";C++;const T=r.formatters[_];if(typeof T=="function"){const Q=y[C];P=T.call(b,Q),y.splice(C,1),C--}return P}),r.formatArgs.call(b,y),(b.log||r.log).apply(b,y)}return v.namespace=u,v.useColors=r.useColors(),v.color=r.selectColor(u),v.extend=n,v.destroy=r.destroy,Object.defineProperty(v,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(p!==r.namespaces&&(p=r.namespaces,g=r.enabled(u)),g),set:y=>{d=y}}),typeof r.init=="function"&&r.init(v),v}function n(u,f){const d=r(this.namespace+(typeof f>"u"?":":f)+u);return d.log=this.log,d}function i(u){r.save(u),r.namespaces=u,r.names=[],r.skips=[];let f;const d=(typeof u=="string"?u:"").split(/[\s,]+/),p=d.length;for(f=0;f"-"+f)].join(",");return r.enable(""),u}function o(u){if(u[u.length-1]==="*")return!0;let f,d;for(f=0,d=r.skips.length;f{let c=!1;return()=>{c||(c=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function n(c){if(c[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+c[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const l="color: "+this.color;c.splice(1,0,l,"color: inherit");let u=0,f=0;c[0].replace(/%[a-zA-Z%]/g,d=>{d!=="%%"&&(u++,d==="%c"&&(f=u))}),c.splice(f,0,l)}e.log=console.debug||console.log||(()=>{});function i(c){try{c?e.storage.setItem("debug",c):e.storage.removeItem("debug")}catch{}}function s(){let c;try{c=e.storage.getItem("debug")}catch{}return!c&&typeof process<"u"&&"env"in process&&(c={}.DEBUG),c}function o(){try{return localStorage}catch{}}t.exports=KWe(e);const{formatters:a}=t.exports;a.j=function(c){try{return JSON.stringify(c)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}})(ZP,ZP.exports);var JWe=ZP.exports,QWe=Je&&Je.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(gm,"__esModule",{value:!0});gm.createModuleLogger=gm.createProjectLogger=void 0;const YWe=QWe(JWe),ZWe=(0,YWe.default)("metamask");function XWe(t){return ZWe.extend(t)}gm.createProjectLogger=XWe;function eVe(t,e){return t.extend(e)}gm.createModuleLogger=eVe;var rle={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.calculateNumberSize=t.calculateStringSize=t.isASCII=t.isPlainObject=t.ESCAPE_CHARACTERS_REGEXP=t.JsonSize=t.hasProperty=t.isObject=t.isNullOrUndefined=t.isNonEmptyArray=void 0;function e(l){return Array.isArray(l)&&l.length>0}t.isNonEmptyArray=e;function r(l){return l==null}t.isNullOrUndefined=r;function n(l){return!!l&&typeof l=="object"&&!Array.isArray(l)}t.isObject=n;const i=(l,u)=>Object.hasOwnProperty.call(l,u);t.hasProperty=i,function(l){l[l.Null=4]="Null",l[l.Comma=1]="Comma",l[l.Wrapper=1]="Wrapper",l[l.True=4]="True",l[l.False=5]="False",l[l.Quote=1]="Quote",l[l.Colon=1]="Colon",l[l.Date=24]="Date"}(t.JsonSize||(t.JsonSize={})),t.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function s(l){if(typeof l!="object"||l===null)return!1;try{let u=l;for(;Object.getPrototypeOf(u)!==null;)u=Object.getPrototypeOf(u);return Object.getPrototypeOf(l)===u}catch{return!1}}t.isPlainObject=s;function o(l){return l.charCodeAt(0)<=127}t.isASCII=o;function a(l){var u;return l.split("").reduce((d,p)=>o(p)?d+1:d+2,0)+((u=l.match(t.ESCAPE_CHARACTERS_REGEXP))!==null&&u!==void 0?u:[]).length}t.calculateStringSize=a;function c(l){return l.toString().length}t.calculateNumberSize=c})(rle);var Nl={};Object.defineProperty(Nl,"__esModule",{value:!0});Nl.hexToBigInt=Nl.hexToNumber=Nl.bigIntToHex=Nl.numberToHex=void 0;const Sg=Zi,S2=zw,tVe=t=>((0,Sg.assert)(typeof t=="number","Value must be a number."),(0,Sg.assert)(t>=0,"Value must be a non-negative number."),(0,Sg.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,S2.add0x)(t.toString(16)));Nl.numberToHex=tVe;const rVe=t=>((0,Sg.assert)(typeof t=="bigint","Value must be a bigint."),(0,Sg.assert)(t>=0,"Value must be a non-negative bigint."),(0,S2.add0x)(t.toString(16)));Nl.bigIntToHex=rVe;const nVe=t=>{(0,S2.assertIsHexString)(t);const e=parseInt(t,16);return(0,Sg.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `hexToBigInt` instead."),e};Nl.hexToNumber=nVe;const iVe=t=>((0,S2.assertIsHexString)(t),BigInt((0,S2.add0x)(t)));Nl.hexToBigInt=iVe;var nle={};Object.defineProperty(nle,"__esModule",{value:!0});var ile={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.timeSince=t.inMilliseconds=t.Duration=void 0,function(s){s[s.Millisecond=1]="Millisecond",s[s.Second=1e3]="Second",s[s.Minute=6e4]="Minute",s[s.Hour=36e5]="Hour",s[s.Day=864e5]="Day",s[s.Week=6048e5]="Week",s[s.Year=31536e6]="Year"}(t.Duration||(t.Duration={}));const e=s=>Number.isInteger(s)&&s>=0,r=(s,o)=>{if(!e(s))throw new Error(`"${o}" must be a non-negative integer. Received: "${s}".`)};function n(s,o){return r(s,"count"),s*o}t.inMilliseconds=n;function i(s){return r(s,"timestamp"),Date.now()-s}t.timeSince=i})(ile);var sle={};Object.defineProperty(sle,"__esModule",{value:!0});var ole={},XP={exports:{}};const sVe="2.0.0",ale=256,oVe=Number.MAX_SAFE_INTEGER||9007199254740991,aVe=16,cVe=ale-6,lVe=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var i4={MAX_LENGTH:ale,MAX_SAFE_COMPONENT_LENGTH:aVe,MAX_SAFE_BUILD_LENGTH:cVe,MAX_SAFE_INTEGER:oVe,RELEASE_TYPES:lVe,SEMVER_SPEC_VERSION:sVe,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const uVe=typeof process=="object"&&process.env&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};var s4=uVe;(function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=i4,s=s4;e=t.exports={};const o=e.re=[],a=e.safeRe=[],c=e.src=[],l=e.t={};let u=0;const f="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",i],[f,n]],p=v=>{for(const[y,b]of d)v=v.split(`${y}*`).join(`${y}{0,${b}}`).split(`${y}+`).join(`${y}{1,${b}}`);return v},g=(v,y,b)=>{const w=p(y),E=u++;s(v,E,y),l[v]=E,c[E]=y,o[E]=new RegExp(y,b?"g":void 0),a[E]=new RegExp(w,b?"g":void 0)};g("NUMERICIDENTIFIER","0|[1-9]\\d*"),g("NUMERICIDENTIFIERLOOSE","\\d+"),g("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),g("MAINVERSION",`(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})`),g("MAINVERSIONLOOSE",`(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASEIDENTIFIER",`(?:${c[l.NUMERICIDENTIFIER]}|${c[l.NONNUMERICIDENTIFIER]})`),g("PRERELEASEIDENTIFIERLOOSE",`(?:${c[l.NUMERICIDENTIFIERLOOSE]}|${c[l.NONNUMERICIDENTIFIER]})`),g("PRERELEASE",`(?:-(${c[l.PRERELEASEIDENTIFIER]}(?:\\.${c[l.PRERELEASEIDENTIFIER]})*))`),g("PRERELEASELOOSE",`(?:-?(${c[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[l.PRERELEASEIDENTIFIERLOOSE]})*))`),g("BUILDIDENTIFIER",`${f}+`),g("BUILD",`(?:\\+(${c[l.BUILDIDENTIFIER]}(?:\\.${c[l.BUILDIDENTIFIER]})*))`),g("FULLPLAIN",`v?${c[l.MAINVERSION]}${c[l.PRERELEASE]}?${c[l.BUILD]}?`),g("FULL",`^${c[l.FULLPLAIN]}$`),g("LOOSEPLAIN",`[v=\\s]*${c[l.MAINVERSIONLOOSE]}${c[l.PRERELEASELOOSE]}?${c[l.BUILD]}?`),g("LOOSE",`^${c[l.LOOSEPLAIN]}$`),g("GTLT","((?:<|>)?=?)"),g("XRANGEIDENTIFIERLOOSE",`${c[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),g("XRANGEIDENTIFIER",`${c[l.NUMERICIDENTIFIER]}|x|X|\\*`),g("XRANGEPLAIN",`[v=\\s]*(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:${c[l.PRERELEASE]})?${c[l.BUILD]}?)?)?`),g("XRANGEPLAINLOOSE",`[v=\\s]*(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:${c[l.PRERELEASELOOSE]})?${c[l.BUILD]}?)?)?`),g("XRANGE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAIN]}$`),g("XRANGELOOSE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAINLOOSE]}$`),g("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),g("COERCERTL",c[l.COERCE],!0),g("LONETILDE","(?:~>?)"),g("TILDETRIM",`(\\s*)${c[l.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",g("TILDE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAIN]}$`),g("TILDELOOSE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAINLOOSE]}$`),g("LONECARET","(?:\\^)"),g("CARETTRIM",`(\\s*)${c[l.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",g("CARET",`^${c[l.LONECARET]}${c[l.XRANGEPLAIN]}$`),g("CARETLOOSE",`^${c[l.LONECARET]}${c[l.XRANGEPLAINLOOSE]}$`),g("COMPARATORLOOSE",`^${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]})$|^$`),g("COMPARATOR",`^${c[l.GTLT]}\\s*(${c[l.FULLPLAIN]})$|^$`),g("COMPARATORTRIM",`(\\s*)${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]}|${c[l.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",g("HYPHENRANGE",`^\\s*(${c[l.XRANGEPLAIN]})\\s+-\\s+(${c[l.XRANGEPLAIN]})\\s*$`),g("HYPHENRANGELOOSE",`^\\s*(${c[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[l.XRANGEPLAINLOOSE]})\\s*$`),g("STAR","(<|>)?=?\\s*\\*"),g("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),g("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(XP,XP.exports);var Hw=XP.exports;const fVe=Object.freeze({loose:!0}),dVe=Object.freeze({}),hVe=t=>t?typeof t!="object"?fVe:t:dVe;var sM=hVe;const rW=/^[0-9]+$/,cle=(t,e)=>{const r=rW.test(t),n=rW.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:tcle(e,t);var lle={compareIdentifiers:cle,rcompareIdentifiers:pVe};const l3=s4,{MAX_LENGTH:nW,MAX_SAFE_INTEGER:u3}=i4,{safeRe:iW,t:sW}=Hw,gVe=sM,{compareIdentifiers:yp}=lle;let mVe=class hl{constructor(e,r){if(r=gVe(r),e instanceof hl){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>nW)throw new TypeError(`version is longer than ${nW} characters`);l3("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=e.trim().match(r.loose?iW[sW.LOOSE]:iW[sW.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>u3||this.major<0)throw new TypeError("Invalid major version");if(this.minor>u3||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>u3||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const s=+i;if(s>=0&&s=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let s=[r,i];n===!1&&(s=[r]),yp(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var Xs=mVe;const oW=Xs,vVe=(t,e,r=!1)=>{if(t instanceof oW)return t;try{return new oW(t,e)}catch(n){if(!r)return null;throw n}};var ev=vVe;const yVe=ev,bVe=(t,e)=>{const r=yVe(t,e);return r?r.version:null};var wVe=bVe;const xVe=ev,EVe=(t,e)=>{const r=xVe(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};var _Ve=EVe;const aW=Xs,CVe=(t,e,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new aW(t instanceof aW?t.version:t,r).inc(e,n,i).version}catch{return null}};var SVe=CVe;const cW=ev,AVe=(t,e)=>{const r=cW(t,null,!0),n=cW(e,null,!0),i=r.compare(n);if(i===0)return null;const s=i>0,o=s?r:n,a=s?n:r,c=!!o.prerelease.length;if(!!a.prerelease.length&&!c)return!a.patch&&!a.minor?"major":o.patch?"patch":o.minor?"minor":"major";const u=c?"pre":"";return r.major!==n.major?u+"major":r.minor!==n.minor?u+"minor":r.patch!==n.patch?u+"patch":"prerelease"};var kVe=AVe;const IVe=Xs,PVe=(t,e)=>new IVe(t,e).major;var RVe=PVe;const TVe=Xs,OVe=(t,e)=>new TVe(t,e).minor;var $Ve=OVe;const NVe=Xs,MVe=(t,e)=>new NVe(t,e).patch;var DVe=MVe;const LVe=ev,BVe=(t,e)=>{const r=LVe(t,e);return r&&r.prerelease.length?r.prerelease:null};var FVe=BVe;const lW=Xs,jVe=(t,e,r)=>new lW(t,r).compare(new lW(e,r));var Kc=jVe;const UVe=Kc,zVe=(t,e,r)=>UVe(e,t,r);var HVe=zVe;const qVe=Kc,WVe=(t,e)=>qVe(t,e,!0);var VVe=WVe;const uW=Xs,GVe=(t,e,r)=>{const n=new uW(t,r),i=new uW(e,r);return n.compare(i)||n.compareBuild(i)};var oM=GVe;const KVe=oM,JVe=(t,e)=>t.sort((r,n)=>KVe(r,n,e));var QVe=JVe;const YVe=oM,ZVe=(t,e)=>t.sort((r,n)=>YVe(n,r,e));var XVe=ZVe;const eGe=Kc,tGe=(t,e,r)=>eGe(t,e,r)>0;var o4=tGe;const rGe=Kc,nGe=(t,e,r)=>rGe(t,e,r)<0;var aM=nGe;const iGe=Kc,sGe=(t,e,r)=>iGe(t,e,r)===0;var ule=sGe;const oGe=Kc,aGe=(t,e,r)=>oGe(t,e,r)!==0;var fle=aGe;const cGe=Kc,lGe=(t,e,r)=>cGe(t,e,r)>=0;var cM=lGe;const uGe=Kc,fGe=(t,e,r)=>uGe(t,e,r)<=0;var lM=fGe;const dGe=ule,hGe=fle,pGe=o4,gGe=cM,mGe=aM,vGe=lM,yGe=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return dGe(t,r,n);case"!=":return hGe(t,r,n);case">":return pGe(t,r,n);case">=":return gGe(t,r,n);case"<":return mGe(t,r,n);case"<=":return vGe(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};var dle=yGe;const bGe=Xs,wGe=ev,{safeRe:f3,t:d3}=Hw,xGe=(t,e)=>{if(t instanceof bGe)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(f3[d3.COERCE]);else{let n;for(;(n=f3[d3.COERCERTL].exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||n.index+n[0].length!==r.index+r[0].length)&&(r=n),f3[d3.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;f3[d3.COERCERTL].lastIndex=-1}return r===null?null:wGe(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,e)};var EGe=xGe,K9,fW;function _Ge(){return fW||(fW=1,K9=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),K9}var CGe=Tr;Tr.Node=s1;Tr.create=Tr;function Tr(t){var e=this;if(e instanceof Tr||(e=new Tr),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach=="function")t.forEach(function(i){e.push(i)});else if(arguments.length>0)for(var r=0,n=arguments.length;r1)r=e;else if(this.head)n=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;n!==null;i++)r=t(r,n.value,i),n=n.next;return r};Tr.prototype.reduceReverse=function(t,e){var r,n=this.tail;if(arguments.length>1)r=e;else if(this.tail)n=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;n!==null;i--)r=t(r,n.value,i),n=n.prev;return r};Tr.prototype.toArray=function(){for(var t=new Array(this.length),e=0,r=this.head;r!==null;e++)t[e]=r.value,r=r.next;return t};Tr.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,r=this.tail;r!==null;e++)t[e]=r.value,r=r.prev;return t};Tr.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new Tr;if(ethis.length&&(e=this.length);for(var n=0,i=this.head;i!==null&&nthis.length&&(e=this.length);for(var n=this.length,i=this.tail;i!==null&&n>e;n--)i=i.prev;for(;i!==null&&n>t;n--,i=i.prev)r.push(i.value);return r};Tr.prototype.splice=function(t,e,...r){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var n=0,i=this.head;i!==null&&n1;class PGe{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");this[v0]=e.max||1/0;const r=e.length||J9;if(this[bp]=typeof r!="function"?J9:r,this[hb]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[k0]=e.maxAge||0,this[Au]=e.dispose,this[dW]=e.noDisposeOnSet||!1,this[hle]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[v0]=e||1/0,iy(this)}get max(){return this[v0]}set allowStale(e){this[hb]=!!e}get allowStale(){return this[hb]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[k0]=e,iy(this)}get maxAge(){return this[k0]}set lengthCalculator(e){typeof e!="function"&&(e=J9),e!==this[bp]&&(this[bp]=e,this[$u]=0,this[Ni].forEach(r=>{r.length=this[bp](r.value,r.key),this[$u]+=r.length})),iy(this)}get lengthCalculator(){return this[bp]}get length(){return this[$u]}get itemCount(){return this[Ni].length}rforEach(e,r){r=r||this;for(let n=this[Ni].tail;n!==null;){const i=n.prev;hW(this,e,n,r),n=i}}forEach(e,r){r=r||this;for(let n=this[Ni].head;n!==null;){const i=n.next;hW(this,e,n,r),n=i}}keys(){return this[Ni].toArray().map(e=>e.key)}values(){return this[Ni].toArray().map(e=>e.value)}reset(){this[Au]&&this[Ni]&&this[Ni].length&&this[Ni].forEach(e=>this[Au](e.key,e.value)),this[kc]=new Map,this[Ni]=new IGe,this[$u]=0}dump(){return this[Ni].map(e=>d_(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[Ni]}set(e,r,n){if(n=n||this[k0],n&&typeof n!="number")throw new TypeError("maxAge must be a number");const i=n?Date.now():0,s=this[bp](r,e);if(this[kc].has(e)){if(s>this[v0])return Ag(this,this[kc].get(e)),!1;const c=this[kc].get(e).value;return this[Au]&&(this[dW]||this[Au](e,c.value)),c.now=i,c.maxAge=n,c.value=r,this[$u]+=s-c.length,c.length=s,this.get(e),iy(this),!0}const o=new RGe(e,r,s,i,n);return o.length>this[v0]?(this[Au]&&this[Au](e,r),!1):(this[$u]+=o.length,this[Ni].unshift(o),this[kc].set(e,this[Ni].head),iy(this),!0)}has(e){if(!this[kc].has(e))return!1;const r=this[kc].get(e).value;return!d_(this,r)}get(e){return Q9(this,e,!0)}peek(e){return Q9(this,e,!1)}pop(){const e=this[Ni].tail;return e?(Ag(this,e),e.value):null}del(e){Ag(this,this[kc].get(e))}load(e){this.reset();const r=Date.now();for(let n=e.length-1;n>=0;n--){const i=e[n],s=i.e||0;if(s===0)this.set(i.k,i.v);else{const o=s-r;o>0&&this.set(i.k,i.v,o)}}}prune(){this[kc].forEach((e,r)=>Q9(this,r,!1))}}const Q9=(t,e,r)=>{const n=t[kc].get(e);if(n){const i=n.value;if(d_(t,i)){if(Ag(t,n),!t[hb])return}else r&&(t[hle]&&(n.value.now=Date.now()),t[Ni].unshiftNode(n));return i.value}},d_=(t,e)=>{if(!e||!e.maxAge&&!t[k0])return!1;const r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t[k0]&&r>t[k0]},iy=t=>{if(t[$u]>t[v0])for(let e=t[Ni].tail;t[$u]>t[v0]&&e!==null;){const r=e.prev;Ag(t,e),e=r}},Ag=(t,e)=>{if(e){const r=e.value;t[Au]&&t[Au](r.key,r.value),t[$u]-=r.length,t[kc].delete(r.key),t[Ni].removeNode(e)}};class RGe{constructor(e,r,n,i,s){this.key=e,this.value=r,this.length=n,this.now=i,this.maxAge=s||0}}const hW=(t,e,r,n)=>{let i=r.value;d_(t,i)&&(Ag(t,r),t[hb]||(i=void 0)),i&&e.call(n,i.value,i.key,t)};var TGe=PGe,Y9,pW;function Jc(){if(pW)return Y9;pW=1;class t{constructor(x,A){if(A=n(A),x instanceof t)return x.loose===!!A.loose&&x.includePrerelease===!!A.includePrerelease?x:new t(x.raw,A);if(x instanceof i)return this.raw=x.value,this.set=[[x]],this.format(),this;if(this.options=A,this.loose=!!A.loose,this.includePrerelease=!!A.includePrerelease,this.raw=x.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(B=>this.parseRange(B.trim())).filter(B=>B.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const B=this.set[0];if(this.set=this.set.filter(z=>!g(z[0])),this.set.length===0)this.set=[B];else if(this.set.length>1){for(const z of this.set)if(z.length===1&&v(z[0])){this.set=[z];break}}}this.format()}format(){return this.range=this.set.map(x=>x.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(x){const B=((this.options.includePrerelease&&d)|(this.options.loose&&p))+":"+x,z=r.get(B);if(z)return z;const R=this.options.loose,L=R?a[c.HYPHENRANGELOOSE]:a[c.HYPHENRANGE];x=x.replace(L,ne(this.options.includePrerelease)),s("hyphen replace",x),x=x.replace(a[c.COMPARATORTRIM],l),s("comparator trim",x),x=x.replace(a[c.TILDETRIM],u),s("tilde trim",x),x=x.replace(a[c.CARETTRIM],f),s("caret trim",x);let q=x.split(" ").map(re=>b(re,this.options)).join(" ").split(/\s+/).map(re=>Z(re,this.options));R&&(q=q.filter(re=>(s("loose invalid filter",re,this.options),!!re.match(a[c.COMPARATORLOOSE])))),s("range list",q);const N=new Map,I=q.map(re=>new i(re,this.options));for(const re of I){if(g(re))return[re];N.set(re.value,re)}N.size>1&&N.has("")&&N.delete("");const U=[...N.values()];return r.set(B,U),U}intersects(x,A){if(!(x instanceof t))throw new TypeError("a Range is required");return this.set.some(B=>y(B,A)&&x.set.some(z=>y(z,A)&&B.every(R=>z.every(L=>R.intersects(L,A)))))}test(x){if(!x)return!1;if(typeof x=="string")try{x=new o(x,this.options)}catch{return!1}for(let A=0;AK.value==="<0.0.0-0",v=K=>K.value==="",y=(K,x)=>{let A=!0;const B=K.slice();let z=B.pop();for(;A&&B.length;)A=B.every(R=>z.intersects(R,x)),z=B.pop();return A},b=(K,x)=>(s("comp",K,x),K=S(K,x),s("caret",K),K=E(K,x),s("tildes",K),K=_(K,x),s("xrange",K),K=Q(K,x),s("stars",K),K),w=K=>!K||K.toLowerCase()==="x"||K==="*",E=(K,x)=>K.trim().split(/\s+/).map(A=>C(A,x)).join(" "),C=(K,x)=>{const A=x.loose?a[c.TILDELOOSE]:a[c.TILDE];return K.replace(A,(B,z,R,L,q)=>{s("tilde",K,B,z,R,L,q);let N;return w(z)?N="":w(R)?N=`>=${z}.0.0 <${+z+1}.0.0-0`:w(L)?N=`>=${z}.${R}.0 <${z}.${+R+1}.0-0`:q?(s("replaceTilde pr",q),N=`>=${z}.${R}.${L}-${q} <${z}.${+R+1}.0-0`):N=`>=${z}.${R}.${L} <${z}.${+R+1}.0-0`,s("tilde return",N),N})},S=(K,x)=>K.trim().split(/\s+/).map(A=>P(A,x)).join(" "),P=(K,x)=>{s("caret",K,x);const A=x.loose?a[c.CARETLOOSE]:a[c.CARET],B=x.includePrerelease?"-0":"";return K.replace(A,(z,R,L,q,N)=>{s("caret",K,z,R,L,q,N);let I;return w(R)?I="":w(L)?I=`>=${R}.0.0${B} <${+R+1}.0.0-0`:w(q)?R==="0"?I=`>=${R}.${L}.0${B} <${R}.${+L+1}.0-0`:I=`>=${R}.${L}.0${B} <${+R+1}.0.0-0`:N?(s("replaceCaret pr",N),R==="0"?L==="0"?I=`>=${R}.${L}.${q}-${N} <${R}.${L}.${+q+1}-0`:I=`>=${R}.${L}.${q}-${N} <${R}.${+L+1}.0-0`:I=`>=${R}.${L}.${q}-${N} <${+R+1}.0.0-0`):(s("no pr"),R==="0"?L==="0"?I=`>=${R}.${L}.${q}${B} <${R}.${L}.${+q+1}-0`:I=`>=${R}.${L}.${q}${B} <${R}.${+L+1}.0-0`:I=`>=${R}.${L}.${q} <${+R+1}.0.0-0`),s("caret return",I),I})},_=(K,x)=>(s("replaceXRanges",K,x),K.split(/\s+/).map(A=>T(A,x)).join(" ")),T=(K,x)=>{K=K.trim();const A=x.loose?a[c.XRANGELOOSE]:a[c.XRANGE];return K.replace(A,(B,z,R,L,q,N)=>{s("xRange",K,B,z,R,L,q,N);const I=w(R),U=I||w(L),re=U||w(q),M=re;return z==="="&&M&&(z=""),N=x.includePrerelease?"-0":"",I?z===">"||z==="<"?B="<0.0.0-0":B="*":z&&M?(U&&(L=0),q=0,z===">"?(z=">=",U?(R=+R+1,L=0,q=0):(L=+L+1,q=0)):z==="<="&&(z="<",U?R=+R+1:L=+L+1),z==="<"&&(N="-0"),B=`${z+R}.${L}.${q}${N}`):U?B=`>=${R}.0.0${N} <${+R+1}.0.0-0`:re&&(B=`>=${R}.${L}.0${N} <${R}.${+L+1}.0-0`),s("xRange return",B),B})},Q=(K,x)=>(s("replaceStars",K,x),K.trim().replace(a[c.STAR],"")),Z=(K,x)=>(s("replaceGTE0",K,x),K.trim().replace(a[x.includePrerelease?c.GTE0PRE:c.GTE0],"")),ne=K=>(x,A,B,z,R,L,q,N,I,U,re,M,G)=>(w(B)?A="":w(z)?A=`>=${B}.0.0${K?"-0":""}`:w(R)?A=`>=${B}.${z}.0${K?"-0":""}`:L?A=`>=${A}`:A=`>=${A}${K?"-0":""}`,w(I)?N="":w(U)?N=`<${+I+1}.0.0-0`:w(re)?N=`<${I}.${+U+1}.0-0`:M?N=`<=${I}.${U}.${re}-${M}`:K?N=`<${I}.${U}.${+re+1}-0`:N=`<=${N}`,`${A} ${N}`.trim()),ce=(K,x,A)=>{for(let B=0;B0){const z=K[B].semver;if(z.major===x.major&&z.minor===x.minor&&z.patch===x.patch)return!0}return!1}return!0};return Y9}var Z9,gW;function a4(){if(gW)return Z9;gW=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(u,f){if(f=r(f),u instanceof e){if(u.loose===!!f.loose)return u;u=u.value}u=u.trim().split(/\s+/).join(" "),o("comparator",u,f),this.options=f,this.loose=!!f.loose,this.parse(u),this.semver===t?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(u){const f=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],d=u.match(f);if(!d)throw new TypeError(`Invalid comparator: ${u}`);this.operator=d[1]!==void 0?d[1]:"",this.operator==="="&&(this.operator=""),d[2]?this.semver=new a(d[2],this.options.loose):this.semver=t}toString(){return this.value}test(u){if(o("Comparator.test",u,this.options.loose),this.semver===t||u===t)return!0;if(typeof u=="string")try{u=new a(u,this.options)}catch{return!1}return s(u,this.operator,this.semver,this.options)}intersects(u,f){if(!(u instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(u.value,f).test(this.value):u.operator===""?u.value===""?!0:new c(this.value,f).test(u.semver):(f=r(f),f.includePrerelease&&(this.value==="<0.0.0-0"||u.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||u.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&u.operator.startsWith(">")||this.operator.startsWith("<")&&u.operator.startsWith("<")||this.semver.version===u.semver.version&&this.operator.includes("=")&&u.operator.includes("=")||s(this.semver,"<",u.semver,f)&&this.operator.startsWith(">")&&u.operator.startsWith("<")||s(this.semver,">",u.semver,f)&&this.operator.startsWith("<")&&u.operator.startsWith(">")))}}Z9=e;const r=sM,{safeRe:n,t:i}=Hw,s=dle,o=s4,a=Xs,c=Jc();return Z9}const OGe=Jc(),$Ge=(t,e,r)=>{try{e=new OGe(e,r)}catch{return!1}return e.test(t)};var c4=$Ge;const NGe=Jc(),MGe=(t,e)=>new NGe(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var DGe=MGe;const LGe=Xs,BGe=Jc(),FGe=(t,e,r)=>{let n=null,i=null,s=null;try{s=new BGe(e,r)}catch{return null}return t.forEach(o=>{s.test(o)&&(!n||i.compare(o)===-1)&&(n=o,i=new LGe(n,r))}),n};var jGe=FGe;const UGe=Xs,zGe=Jc(),HGe=(t,e,r)=>{let n=null,i=null,s=null;try{s=new zGe(e,r)}catch{return null}return t.forEach(o=>{s.test(o)&&(!n||i.compare(o)===1)&&(n=o,i=new UGe(n,r))}),n};var qGe=HGe;const X9=Xs,WGe=Jc(),mW=o4,VGe=(t,e)=>{t=new WGe(t,e);let r=new X9("0.0.0");if(t.test(r)||(r=new X9("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n{const a=new X9(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||mW(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!r||mW(r,s))&&(r=s)}return r&&t.test(r)?r:null};var GGe=VGe;const KGe=Jc(),JGe=(t,e)=>{try{return new KGe(t,e).range||"*"}catch{return null}};var QGe=JGe;const YGe=Xs,ple=a4(),{ANY:ZGe}=ple,XGe=Jc(),eKe=c4,vW=o4,yW=aM,tKe=lM,rKe=cM,nKe=(t,e,r,n)=>{t=new YGe(t,n),e=new XGe(e,n);let i,s,o,a,c;switch(r){case">":i=vW,s=tKe,o=yW,a=">",c=">=";break;case"<":i=yW,s=rKe,o=vW,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(eKe(t,e,n))return!1;for(let l=0;l{p.semver===ZGe&&(p=new ple(">=0.0.0")),f=f||p,d=d||p,i(p.semver,f.semver,n)?f=p:o(p.semver,d.semver,n)&&(d=p)}),f.operator===a||f.operator===c||(!d.operator||d.operator===a)&&s(t,d.semver))return!1;if(d.operator===c&&o(t,d.semver))return!1}return!0};var uM=nKe;const iKe=uM,sKe=(t,e,r)=>iKe(t,e,">",r);var oKe=sKe;const aKe=uM,cKe=(t,e,r)=>aKe(t,e,"<",r);var lKe=cKe;const bW=Jc(),uKe=(t,e,r)=>(t=new bW(t,r),e=new bW(e,r),t.intersects(e,r));var fKe=uKe;const dKe=c4,hKe=Kc;var pKe=(t,e,r)=>{const n=[];let i=null,s=null;const o=t.sort((u,f)=>hKe(u,f,r));for(const u of o)dKe(u,e,r)?(s=u,i||(i=u)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);const a=[];for(const[u,f]of n)u===f?a.push(u):!f&&u===o[0]?a.push("*"):f?u===o[0]?a.push(`<=${f}`):a.push(`${u} - ${f}`):a.push(`>=${u}`);const c=a.join(" || "),l=typeof e.raw=="string"?e.raw:String(e);return c.length{if(t===e)return!0;t=new wW(t,r),e=new wW(e,r);let n=!1;e:for(const i of t.set){for(const s of e.set){const o=vKe(i,s,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},mKe=[new fM(">=0.0.0-0")],xW=[new fM(">=0.0.0")],vKe=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===e7){if(e.length===1&&e[0].semver===e7)return!0;r.includePrerelease?t=mKe:t=xW}if(e.length===1&&e[0].semver===e7){if(r.includePrerelease)return!0;e=xW}const n=new Set;let i,s;for(const p of t)p.operator===">"||p.operator===">="?i=EW(i,p,r):p.operator==="<"||p.operator==="<="?s=_W(s,p,r):n.add(p.semver);if(n.size>1)return null;let o;if(i&&s){if(o=dM(i.semver,s.semver,r),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(const p of n){if(i&&!sy(p,String(i),r)||s&&!sy(p,String(s),r))return null;for(const g of e)if(!sy(p,String(g),r))return!1;return!0}let a,c,l,u,f=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,d=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;f&&f.prerelease.length===1&&s.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(const p of e){if(u=u||p.operator===">"||p.operator===">=",l=l||p.operator==="<"||p.operator==="<=",i){if(d&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===d.major&&p.semver.minor===d.minor&&p.semver.patch===d.patch&&(d=!1),p.operator===">"||p.operator===">="){if(a=EW(i,p,r),a===p&&a!==i)return!1}else if(i.operator===">="&&!sy(i.semver,String(p),r))return!1}if(s){if(f&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===f.major&&p.semver.minor===f.minor&&p.semver.patch===f.patch&&(f=!1),p.operator==="<"||p.operator==="<="){if(c=_W(s,p,r),c===p&&c!==s)return!1}else if(s.operator==="<="&&!sy(s.semver,String(p),r))return!1}if(!p.operator&&(s||i)&&o!==0)return!1}return!(i&&l&&!s&&o!==0||s&&u&&!i&&o!==0||d||f)},EW=(t,e,r)=>{if(!t)return e;const n=dM(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},_W=(t,e,r)=>{if(!t)return e;const n=dM(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};var yKe=gKe;const t7=Hw,CW=i4,bKe=Xs,SW=lle,wKe=ev,xKe=wVe,EKe=_Ve,_Ke=SVe,CKe=kVe,SKe=RVe,AKe=$Ve,kKe=DVe,IKe=FVe,PKe=Kc,RKe=HVe,TKe=VVe,OKe=oM,$Ke=QVe,NKe=XVe,MKe=o4,DKe=aM,LKe=ule,BKe=fle,FKe=cM,jKe=lM,UKe=dle,zKe=EGe,HKe=a4(),qKe=Jc(),WKe=c4,VKe=DGe,GKe=jGe,KKe=qGe,JKe=GGe,QKe=QGe,YKe=uM,ZKe=oKe,XKe=lKe,eJe=fKe,tJe=pKe,rJe=yKe;var nJe={parse:wKe,valid:xKe,clean:EKe,inc:_Ke,diff:CKe,major:SKe,minor:AKe,patch:kKe,prerelease:IKe,compare:PKe,rcompare:RKe,compareLoose:TKe,compareBuild:OKe,sort:$Ke,rsort:NKe,gt:MKe,lt:DKe,eq:LKe,neq:BKe,gte:FKe,lte:jKe,cmp:UKe,coerce:zKe,Comparator:HKe,Range:qKe,satisfies:WKe,toComparators:VKe,maxSatisfying:GKe,minSatisfying:KKe,minVersion:JKe,validRange:QKe,outside:YKe,gtr:ZKe,ltr:XKe,intersects:eJe,simplifyRange:tJe,subset:rJe,SemVer:bKe,re:t7.re,src:t7.src,tokens:t7.t,SEMVER_SPEC_VERSION:CW.SEMVER_SPEC_VERSION,RELEASE_TYPES:CW.RELEASE_TYPES,compareIdentifiers:SW.compareIdentifiers,rcompareIdentifiers:SW.rcompareIdentifiers};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.satisfiesVersionRange=t.gtRange=t.gtVersion=t.assertIsSemVerRange=t.assertIsSemVerVersion=t.isValidSemVerRange=t.isValidSemVerVersion=t.VersionRangeStruct=t.VersionStruct=void 0;const e=nJe,r=I1,n=Zi;t.VersionStruct=(0,r.refine)((0,r.string)(),"Version",f=>(0,e.valid)(f)===null?`Expected SemVer version, got "${f}"`:!0),t.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",f=>(0,e.validRange)(f)===null?`Expected SemVer range, got "${f}"`:!0);function i(f){return(0,r.is)(f,t.VersionStruct)}t.isValidSemVerVersion=i;function s(f){return(0,r.is)(f,t.VersionRangeStruct)}t.isValidSemVerRange=s;function o(f){(0,n.assertStruct)(f,t.VersionStruct)}t.assertIsSemVerVersion=o;function a(f){(0,n.assertStruct)(f,t.VersionRangeStruct)}t.assertIsSemVerRange=a;function c(f,d){return(0,e.gt)(f,d)}t.gtVersion=c;function l(f,d){return(0,e.gtr)(f,d)}t.gtRange=l;function u(f,d){return(0,e.satisfies)(f,d,{includePrerelease:!0})}t.satisfiesVersionRange=u})(ole);(function(t){var e=Je&&Je.__createBinding||(Object.create?function(n,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(n,o,a)}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=Je&&Je.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(Zi,t),r(Uw,t),r(_r,t),r(r4,t),r($l,t),r(pm,t),r(Xce,t),r(zw,t),r(ele,t),r(tle,t),r(gm,t),r(rle,t),r(Nl,t),r(nle,t),r(ile,t),r(sle,t),r(ole,t)})(Nce);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createModuleLogger=t.projectLogger=void 0;const e=Nce;Object.defineProperty(t,"createModuleLogger",{enumerable:!0,get:function(){return e.createModuleLogger}}),t.projectLogger=(0,e.createProjectLogger)("eth-block-tracker")})($ce);var gle=Je&&Je.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e4,"__esModule",{value:!0});e4.PollingBlockTracker=void 0;const iJe=gle(JN),sJe=gle(_qe),oJe=Bw,AW=$ce,kW=(0,AW.createModuleLogger)(AW.projectLogger,"polling-block-tracker"),aJe=(0,iJe.default)(),cJe=1e3;class lJe extends oJe.BaseBlockTracker{constructor(e={}){var r;if(!e.provider)throw new Error("PollingBlockTracker - no provider specified.");super(Object.assign(Object.assign({},e),{blockResetDuration:(r=e.blockResetDuration)!==null&&r!==void 0?r:e.pollingInterval})),this._provider=e.provider,this._pollingInterval=e.pollingInterval||20*cJe,this._retryTimeout=e.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=e.keepEventLoopActive===void 0?!0:e.keepEventLoopActive,this._setSkipCacheFlag=e.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var e;this._isRunning;)try{await this._updateLatestBlock();const r=IW(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await r}catch(r){const n=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block: +${(e=r.stack)!==null&&e!==void 0?e:r}`);try{this.emit("error",n)}catch{console.error(n)}const i=IW(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await i}}async _updateLatestBlock(){const e=await this._fetchLatestBlock();this._newPotentialLatest(e)}async _fetchLatestBlock(){const e={jsonrpc:"2.0",id:aJe(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(e.skipCache=!0),kW("Making request",e);const r=await(0,sJe.default)(n=>this._provider.sendAsync(e,n))();if(kW("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block: +${r.error.message}`);return r.result}}e4.PollingBlockTracker=lJe;function IW(t,e){return new Promise(r=>{const n=setTimeout(r,t);n.unref&&e&&n.unref()})}var l4={},uJe=Je&&Je.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(l4,"__esModule",{value:!0});l4.SubscribeBlockTracker=void 0;const fJe=uJe(JN),dJe=Bw,hJe=(0,fJe.default)();class pJe extends dJe.BaseBlockTracker{constructor(e={}){if(!e.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(e),this._provider=e.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const e=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(e)}catch(e){this.emit("error",e)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(e){this.emit("error",e)}}_call(e,...r){return new Promise((n,i)=>{this._provider.sendAsync({id:hJe(),method:e,params:r,jsonrpc:"2.0"},(s,o)=>{s?i(s):n(o.result)})})}_handleSubData(e,r){var n;r.method==="eth_subscription"&&((n=r.params)===null||n===void 0?void 0:n.subscription)===this._subscriptionId&&this._newPotentialLatest(r.params.result.number)}}l4.SubscribeBlockTracker=pJe;(function(t){var e=Je&&Je.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s),Object.defineProperty(n,o,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=Je&&Je.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(e4,t),r(l4,t)})(Oce);var hM={},u4={},qw={};Object.defineProperty(qw,"__esModule",{value:!0});qw.getUniqueId=void 0;const mle=4294967295;let r7=Math.floor(Math.random()*mle);function gJe(){return r7=(r7+1)%mle,r7}qw.getUniqueId=gJe;Object.defineProperty(u4,"__esModule",{value:!0});u4.createIdRemapMiddleware=void 0;const mJe=qw;function vJe(){return(t,e,r,n)=>{const i=t.id,s=mJe.getUniqueId();t.id=s,e.id=s,r(o=>{t.id=i,e.id=i,o()})}}u4.createIdRemapMiddleware=vJe;var f4={};Object.defineProperty(f4,"__esModule",{value:!0});f4.createAsyncMiddleware=void 0;function yJe(t){return async(e,r,n,i)=>{let s;const o=new Promise(u=>{s=u});let a=null,c=!1;const l=async()=>{c=!0,n(u=>{a=u,s()}),await o};try{await t(e,r,l),c?(await o,a(null)):i(null)}catch(u){a?a(u):i(u)}}}f4.createAsyncMiddleware=yJe;var d4={};Object.defineProperty(d4,"__esModule",{value:!0});d4.createScaffoldMiddleware=void 0;function bJe(t){return(e,r,n,i)=>{const s=t[e.method];return s===void 0?n():typeof s=="function"?s(e,r,n,i):(r.result=s,i())}}d4.createScaffoldMiddleware=bJe;var Ww={},pM={};Object.defineProperty(pM,"__esModule",{value:!0});const wJe=is;function PW(t,e,r){try{Reflect.apply(t,e,r)}catch(n){setTimeout(()=>{throw n})}}function xJe(t){const e=t.length,r=new Array(e);for(let n=0;n0&&([o]=r),o instanceof Error)throw o;const a=new Error(`Unhandled error.${o?` (${o.message})`:""}`);throw a.context=o,a}const s=i[e];if(s===void 0)return!1;if(typeof s=="function")PW(s,this,r);else{const o=s.length,a=xJe(s);for(let c=0;c"u"&&(n=ble()),eR(t,"",0,[],void 0,0,n);var i;try{I0.length===0?i=JSON.stringify(t,e,r):i=JSON.stringify(t,xle(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;o1.length!==0;){var s=o1.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function kg(t,e,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:t}),o1.push([n,r,e,i])):I0.push([e,r,t]):(n[r]=t,o1.push([n,r,e]))}function eR(t,e,r,n,i,s,o){s+=1;var a;if(typeof t=="object"&&t!==null){for(a=0;ao.depthLimit){kg(h_,t,e,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){kg(h_,t,e,i);return}if(n.push(t),Array.isArray(t))for(a=0;ae?1:0}function wle(t,e,r,n){typeof n>"u"&&(n=ble());var i=tR(t,"",0,[],void 0,0,n)||t,s;try{I0.length===0?s=JSON.stringify(i,e,r):s=JSON.stringify(i,xle(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;o1.length!==0;){var o=o1.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return s}function tR(t,e,r,n,i,s,o){s+=1;var a;if(typeof t=="object"&&t!==null){for(a=0;ao.depthLimit){kg(h_,t,e,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){kg(h_,t,e,i);return}if(n.push(t),Array.isArray(t))for(a=0;a0)for(var n=0;n=1e3&&t<=4999}function IJe(t,e){if(e!=="[Circular]")return e}var gM={},ih={};Object.defineProperty(ih,"__esModule",{value:!0});ih.errorValues=ih.errorCodes=void 0;ih.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};ih.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=ih,r=nh,n=e.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:n,message:o(n)};t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function o(d,p=i){if(Number.isInteger(d)){const g=d.toString();if(f(e.errorValues,g))return e.errorValues[g].message;if(l(d))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return p}t.getMessageFromCode=o;function a(d){if(!Number.isInteger(d))return!1;const p=d.toString();return!!(e.errorValues[p]||l(d))}t.isValidCode=a;function c(d,{fallbackError:p=s,shouldIncludeStack:g=!1}={}){var v,y;if(!p||!Number.isInteger(p.code)||typeof p.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(d instanceof r.EthereumRpcError)return d.serialize();const b={};if(d&&typeof d=="object"&&!Array.isArray(d)&&f(d,"code")&&a(d.code)){const E=d;b.code=E.code,E.message&&typeof E.message=="string"?(b.message=E.message,f(E,"data")&&(b.data=E.data)):(b.message=o(b.code),b.data={originalError:u(d)})}else{b.code=p.code;const E=(v=d)===null||v===void 0?void 0:v.message;b.message=E&&typeof E=="string"?E:p.message,b.data={originalError:u(d)}}const w=(y=d)===null||y===void 0?void 0:y.stack;return g&&d&&w&&typeof w=="string"&&(b.stack=w),b}t.serializeError=c;function l(d){return d>=-32099&&d<=-32e3}function u(d){return d&&typeof d=="object"&&!Array.isArray(d)?Object.assign({},d):d}function f(d,p){return Object.prototype.hasOwnProperty.call(d,p)}})(gM);var h4={};Object.defineProperty(h4,"__esModule",{value:!0});h4.ethErrors=void 0;const mM=nh,_le=gM,ms=ih;h4.ethErrors={rpc:{parse:t=>Ia(ms.errorCodes.rpc.parse,t),invalidRequest:t=>Ia(ms.errorCodes.rpc.invalidRequest,t),invalidParams:t=>Ia(ms.errorCodes.rpc.invalidParams,t),methodNotFound:t=>Ia(ms.errorCodes.rpc.methodNotFound,t),internal:t=>Ia(ms.errorCodes.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Ia(e,t)},invalidInput:t=>Ia(ms.errorCodes.rpc.invalidInput,t),resourceNotFound:t=>Ia(ms.errorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>Ia(ms.errorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>Ia(ms.errorCodes.rpc.transactionRejected,t),methodNotSupported:t=>Ia(ms.errorCodes.rpc.methodNotSupported,t),limitExceeded:t=>Ia(ms.errorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>oy(ms.errorCodes.provider.userRejectedRequest,t),unauthorized:t=>oy(ms.errorCodes.provider.unauthorized,t),unsupportedMethod:t=>oy(ms.errorCodes.provider.unsupportedMethod,t),disconnected:t=>oy(ms.errorCodes.provider.disconnected,t),chainDisconnected:t=>oy(ms.errorCodes.provider.chainDisconnected,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:r,data:n}=t;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new mM.EthereumProviderError(e,r,n)}}};function Ia(t,e){const[r,n]=Cle(e);return new mM.EthereumRpcError(t,r||_le.getMessageFromCode(t),n)}function oy(t,e){const[r,n]=Cle(e);return new mM.EthereumProviderError(t,r||_le.getMessageFromCode(t),n)}function Cle(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:r}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageFromCode=t.serializeError=t.EthereumProviderError=t.EthereumRpcError=t.ethErrors=t.errorCodes=void 0;const e=nh;Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return e.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return e.EthereumProviderError}});const r=gM;Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=h4;Object.defineProperty(t,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=ih;Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(vle);var PJe=Je&&Je.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ww,"__esModule",{value:!0});Ww.JsonRpcEngine=void 0;const RJe=PJe(pM),Pa=vle;class ku extends RJe.default{constructor(){super(),this._middleware=[]}push(e){this._middleware.push(e)}handle(e,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(e)?r?this._handleBatch(e,r):this._handleBatch(e):r?this._handle(e,r):this._promiseHandle(e)}asMiddleware(){return async(e,r,n,i)=>{try{const[s,o,a]=await ku._runAllMiddleware(e,r,this._middleware);return o?(await ku._runReturnHandlers(a),i(s)):n(async c=>{try{await ku._runReturnHandlers(a)}catch(l){return c(l)}return c()})}catch(s){return i(s)}}}async _handleBatch(e,r){try{const n=await Promise.all(e.map(this._promiseHandle.bind(this)));return r?r(null,n):n}catch(n){if(r)return r(n);throw n}}_promiseHandle(e){return new Promise(r=>{this._handle(e,(n,i)=>{r(i)})})}async _handle(e,r){if(!e||Array.isArray(e)||typeof e!="object"){const o=new Pa.EthereumRpcError(Pa.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof e}`,{request:e});return r(o,{id:void 0,jsonrpc:"2.0",error:o})}if(typeof e.method!="string"){const o=new Pa.EthereumRpcError(Pa.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof e.method}`,{request:e});return r(o,{id:e.id,jsonrpc:"2.0",error:o})}const n=Object.assign({},e),i={id:n.id,jsonrpc:n.jsonrpc};let s=null;try{await this._processRequest(n,i)}catch(o){s=o}return s&&(delete i.result,i.error||(i.error=Pa.serializeError(s))),r(s,i)}async _processRequest(e,r){const[n,i,s]=await ku._runAllMiddleware(e,r,this._middleware);if(ku._checkForCompletion(e,r,i),await ku._runReturnHandlers(s),n)throw n}static async _runAllMiddleware(e,r,n){const i=[];let s=null,o=!1;for(const a of n)if([s,o]=await ku._runMiddleware(e,r,a,i),o)break;return[s,o,i.reverse()]}static _runMiddleware(e,r,n,i){return new Promise(s=>{const o=c=>{const l=c||r.error;l&&(r.error=Pa.serializeError(l)),s([l,!0])},a=c=>{r.error?o(r.error):(c&&(typeof c!="function"&&o(new Pa.EthereumRpcError(Pa.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof c}" for request: +${n7(e)}`,{request:e})),i.push(c)),s([null,!1]))};try{n(e,r,a,o)}catch(c){o(c)}})}static async _runReturnHandlers(e){for(const r of e)await new Promise((n,i)=>{r(s=>s?i(s):n())})}static _checkForCompletion(e,r,n){if(!("result"in r)&&!("error"in r))throw new Pa.EthereumRpcError(Pa.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request: +${n7(e)}`,{request:e});if(!n)throw new Pa.EthereumRpcError(Pa.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request: +${n7(e)}`,{request:e})}}Ww.JsonRpcEngine=ku;function n7(t){return JSON.stringify(t,null,2)}var p4={};Object.defineProperty(p4,"__esModule",{value:!0});p4.mergeMiddleware=void 0;const TJe=Ww;function OJe(t){const e=new TJe.JsonRpcEngine;return t.forEach(r=>e.push(r)),e.asMiddleware()}p4.mergeMiddleware=OJe;(function(t){var e=Je&&Je.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s),Object.defineProperty(n,o,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=Je&&Je.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(u4,t),r(f4,t),r(d4,t),r(qw,t),r(Ww,t),r(p4,t)})(hM);var Sle={},vM={};const yM=wf(Bke);var g4={};Object.defineProperty(g4,"__esModule",{value:!0});var RW=yM,$Je=function(){function t(e){if(this._maxConcurrency=e,this._queue=[],e<=0)throw new Error("semaphore must be initialized to a positive value");this._value=e}return t.prototype.acquire=function(){var e=this,r=this.isLocked(),n=new Promise(function(i){return e._queue.push(i)});return r||this._dispatch(),n},t.prototype.runExclusive=function(e){return RW.__awaiter(this,void 0,void 0,function(){var r,n,i;return RW.__generator(this,function(s){switch(s.label){case 0:return[4,this.acquire()];case 1:r=s.sent(),n=r[0],i=r[1],s.label=2;case 2:return s.trys.push([2,,4,5]),[4,e(n)];case 3:return[2,s.sent()];case 4:return i(),[7];case 5:return[2]}})})},t.prototype.isLocked=function(){return this._value<=0},t.prototype.release=function(){if(this._maxConcurrency>1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var e=this._currentReleaser;this._currentReleaser=void 0,e()}},t.prototype._dispatch=function(){var e=this,r=this._queue.shift();if(r){var n=!1;this._currentReleaser=function(){n||(n=!0,e._value++,e._dispatch())},r([this._value--,this._currentReleaser])}},t}();g4.default=$Je;Object.defineProperty(vM,"__esModule",{value:!0});var TW=yM,NJe=g4,MJe=function(){function t(){this._semaphore=new NJe.default(1)}return t.prototype.acquire=function(){return TW.__awaiter(this,void 0,void 0,function(){var e,r;return TW.__generator(this,function(n){switch(n.label){case 0:return[4,this._semaphore.acquire()];case 1:return e=n.sent(),r=e[1],[2,r]}})})},t.prototype.runExclusive=function(e){return this._semaphore.runExclusive(function(){return e()})},t.prototype.isLocked=function(){return this._semaphore.isLocked()},t.prototype.release=function(){this._semaphore.release()},t}();vM.default=MJe;var m4={};Object.defineProperty(m4,"__esModule",{value:!0});m4.withTimeout=void 0;var h3=yM;function DJe(t,e,r){var n=this;return r===void 0&&(r=new Error("timeout")),{acquire:function(){return new Promise(function(i,s){return h3.__awaiter(n,void 0,void 0,function(){var o,a,c;return h3.__generator(this,function(l){switch(l.label){case 0:return o=!1,setTimeout(function(){o=!0,s(r)},e),[4,t.acquire()];case 1:return a=l.sent(),o?(c=Array.isArray(a)?a[1]:a,c()):i(a),[2]}})})})},runExclusive:function(i){return h3.__awaiter(this,void 0,void 0,function(){var s,o;return h3.__generator(this,function(a){switch(a.label){case 0:s=function(){},a.label=1;case 1:return a.trys.push([1,,7,8]),[4,this.acquire()];case 2:return o=a.sent(),Array.isArray(o)?(s=o[1],[4,i(o[0])]):[3,4];case 3:return[2,a.sent()];case 4:return s=o,[4,i()];case 5:return[2,a.sent()];case 6:return[3,8];case 7:return s(),[7];case 8:return[2]}})})},release:function(){t.release()},isLocked:function(){return t.isLocked()}}}m4.withTimeout=DJe;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.withTimeout=t.Semaphore=t.Mutex=void 0;var e=vM;Object.defineProperty(t,"Mutex",{enumerable:!0,get:function(){return e.default}});var r=g4;Object.defineProperty(t,"Semaphore",{enumerable:!0,get:function(){return r.default}});var n=m4;Object.defineProperty(t,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}})})(Sle);var LJe=FJe,BJe=Object.prototype.hasOwnProperty;function FJe(){for(var t={},e=0;efunction(...i){const s=e.promiseModule;return new s((o,a)=>{e.multiArgs?i.push((...l)=>{e.errorFirst?l[0]?a(l):(l.shift(),o(l)):o(l)}):e.errorFirst?i.push((l,u)=>{l?a(l):o(u)}):i.push(o),Reflect.apply(t,this===r?n:this,i)})},$W=new WeakMap;var qJe=(t,e)=>{e={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...e};const r=typeof t;if(!(t!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${t===null?"null":r}\``);const n=(o,a)=>{let c=$W.get(o);if(c||(c={},$W.set(o,c)),a in c)return c[a];const l=g=>typeof g=="string"||typeof a=="symbol"?a===g:g.test(a),u=Reflect.getOwnPropertyDescriptor(o,a),f=u===void 0||u.writable||u.configurable,p=(e.include?e.include.some(l):!e.exclude.some(l))&&f;return c[a]=p,p},i=new WeakMap,s=new Proxy(t,{apply(o,a,c){const l=i.get(o);if(l)return Reflect.apply(l,a,c);const u=e.excludeMain?o:OW(o,e,s,o);return i.set(o,u),Reflect.apply(u,a,c)},get(o,a){const c=o[a];if(!n(o,a)||c===Function.prototype[a])return c;const l=i.get(c);if(l)return l;if(typeof c=="function"){const u=OW(c,e,s,o);return i.set(c,u),u}return c}});return s};const WJe=Fw.default;let VJe=class extends WJe{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(e){this.updates=this.updates.concat(e),e.forEach(r=>this.emit("update",r))}addInitialResults(e){}getChangesAndClear(){const e=this.updates;return this.updates=[],e}};var bM=VJe;const GJe=bM;let KJe=class extends GJe{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(e){this.allResults=this.allResults.concat(e),super.addResults(e)}addInitialResults(e){this.allResults=this.allResults.concat(e),super.addInitialResults(e)}getAllResults(){return this.allResults}};var JJe=KJe,Gw={minBlockRef:QJe,maxBlockRef:YJe,sortBlockRefs:wM,bnToHex:ZJe,blockRefIsNumber:XJe,hexToInt:p_,incrementHexInt:eQe,intToHex:Ale,unsafeRandomBytes:tQe};function QJe(...t){return wM(t)[0]}function YJe(...t){const e=wM(t);return e[e.length-1]}function wM(t){return t.sort((e,r)=>e==="latest"||r==="earliest"?1:r==="latest"||e==="earliest"?-1:p_(e)-p_(r))}function ZJe(t){return"0x"+t.toString(16)}function XJe(t){return t&&!["earliest","latest","pending"].includes(t)}function p_(t){return t==null?t:Number.parseInt(t,16)}function eQe(t){if(t==null)return t;const e=p_(t);return Ale(e+1)}function Ale(t){if(t==null)return t;let e=t.toString(16);return e.length%2&&(e="0"+e),"0x"+e}function tQe(t){let e="0x";for(let r=0;rn.toLowerCase()))}async initialize({currentBlock:e}){let r=this.params.fromBlock;["latest","pending"].includes(r)&&(r=e),r==="earliest"&&(r="0x0"),this.params.fromBlock=r;const n=oQe(this.params.toBlock,e),i=Object.assign({},this.params,{toBlock:n}),s=await this._fetchLogs(i);this.addInitialResults(s)}async update({oldBlock:e,newBlock:r}){const n=r;let i;e?i=sQe(e):i=r;const s=Object.assign({},this.params,{fromBlock:i,toBlock:n}),a=(await this._fetchLogs(s)).filter(c=>this.matchLog(c));this.addResults(a)}async _fetchLogs(e){return await nQe(n=>this.ethQuery.getLogs(e,n))()}matchLog(e){if(p3(this.params.fromBlock)>=p3(e.blockNumber)||aQe(this.params.toBlock)&&p3(this.params.toBlock)<=p3(e.blockNumber))return!1;const r=e.address&&e.address.toLowerCase();return this.params.address&&r&&!this.params.address.includes(r)?!1:this.params.topics.every((i,s)=>{let o=e.topics[s];if(!o)return!1;o=o.toLowerCase();let a=Array.isArray(i)?i:[i];return a.includes(null)?!0:(a=a.map(u=>u.toLowerCase()),a.includes(o))})}};var lQe=cQe,xM=uQe;async function uQe({provider:t,fromBlock:e,toBlock:r}){e||(e=r);const n=MW(e),s=MW(r)-n+1,o=Array(s).fill().map((c,l)=>n+l).map(fQe);let a=await Promise.all(o.map(c=>hQe(t,"eth_getBlockByNumber",[c,!1])));return a=a.filter(c=>c!==null),a}function MW(t){return t==null?t:Number.parseInt(t,16)}function fQe(t){return t==null?t:"0x"+t.toString(16)}function dQe(t,e){return new Promise((r,n)=>{t.sendAsync(e,(i,s)=>{i?n(i):s.error?n(s.error):s.result?r(s.result):n(new Error("Result was empty"))})})}async function hQe(t,e,r){for(let n=0;n<3;n++)try{return await dQe(t,{id:1,jsonrpc:"2.0",method:e,params:r})}catch(i){console.error(`provider.sendAsync failed: ${i.stack||i.message||i}`)}return null}const pQe=bM,gQe=xM,{incrementHexInt:mQe}=Gw;let vQe=class extends pQe{constructor({provider:e,params:r}){super(),this.type="block",this.provider=e}async update({oldBlock:e,newBlock:r}){const n=r,i=mQe(e),o=(await gQe({provider:this.provider,fromBlock:i,toBlock:n})).map(a=>a.hash);this.addResults(o)}};var yQe=vQe;const bQe=bM,wQe=xM,{incrementHexInt:xQe}=Gw;let EQe=class extends bQe{constructor({provider:e}){super(),this.type="tx",this.provider=e}async update({oldBlock:e}){const r=e,n=xQe(e),i=await wQe({provider:this.provider,fromBlock:n,toBlock:r}),s=[];for(const o of i)s.push(...o.transactions);this.addResults(s)}};var _Qe=EQe;const CQe=Sle.Mutex,{createAsyncMiddleware:SQe,createScaffoldMiddleware:AQe}=hM,kQe=lQe,IQe=yQe,PQe=_Qe,{intToHex:kle,hexToInt:i7}=Gw;var RQe=TQe;function TQe({blockTracker:t,provider:e}){let r=0,n={};const i=new CQe,s=OQe({mutex:i}),o=AQe({eth_newFilter:s(s7(c)),eth_newBlockFilter:s(s7(l)),eth_newPendingTransactionFilter:s(s7(u)),eth_uninstallFilter:s(EE(p)),eth_getFilterChanges:s(EE(f)),eth_getFilterLogs:s(EE(d))}),a=async({oldBlock:w,newBlock:E})=>{if(n.length===0)return;const C=await i.acquire();try{await Promise.all(wp(n).map(async S=>{try{await S.update({oldBlock:w,newBlock:E})}catch(P){console.error(P)}}))}catch(S){console.error(S)}C()};return o.newLogFilter=c,o.newBlockFilter=l,o.newPendingTransactionFilter=u,o.uninstallFilter=p,o.getFilterChanges=f,o.getFilterLogs=d,o.destroy=()=>{y()},o;async function c(w){const E=new kQe({provider:e,params:w});return await g(E),E}async function l(){const w=new IQe({provider:e});return await g(w),w}async function u(){const w=new PQe({provider:e});return await g(w),w}async function f(w){const E=i7(w),C=n[E];if(!C)throw new Error(`No filter for index "${E}"`);return C.getChangesAndClear()}async function d(w){const E=i7(w),C=n[E];if(!C)throw new Error(`No filter for index "${E}"`);let S=[];return C.type==="log"&&(S=C.getAllResults()),S}async function p(w){const E=i7(w),S=!!n[E];return S&&await v(E),S}async function g(w){const E=wp(n).length,C=await t.getLatestBlock();await w.initialize({currentBlock:C}),r++,n[r]=w,w.id=r,w.idHex=kle(r);const S=wp(n).length;return b({prevFilterCount:E,newFilterCount:S}),r}async function v(w){const E=wp(n).length;delete n[w];const C=wp(n).length;b({prevFilterCount:E,newFilterCount:C})}async function y(){const w=wp(n).length;n={},b({prevFilterCount:w,newFilterCount:0})}function b({prevFilterCount:w,newFilterCount:E}){if(w===0&&E>0){t.on("sync",a);return}if(w>0&&E===0){t.removeListener("sync",a);return}}}function s7(t){return EE(async(...e)=>{const r=await t(...e);return kle(r.id)})}function EE(t){return SQe(async(e,r)=>{const n=await t.apply(null,e.params);r.result=n})}function OQe({mutex:t}){return e=>async(r,n,i,s)=>{(await t.acquire())(),e(r,n,i,s)}}function wp(t,e){const r=[];for(let n in t)r.push(t[n]);return r}const $Qe=Fw.default,{createAsyncMiddleware:DW,createScaffoldMiddleware:NQe}=hM,MQe=RQe,{unsafeRandomBytes:DQe,incrementHexInt:LQe}=Gw,BQe=xM;var FQe=jQe;function jQe({blockTracker:t,provider:e}){const r={},n=MQe({blockTracker:t,provider:e});let i=!1;const s=new $Qe,o=NQe({eth_subscribe:DW(a),eth_unsubscribe:DW(c)});return o.destroy=u,{events:s,middleware:o};async function a(f,d){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const p=f.params[0],g=DQe(16);let v;switch(p){case"newHeads":v=y({subId:g});break;case"logs":const w=f.params[1],E=await n.newLogFilter(w);v=b({subId:g,filter:E});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${p}"`)}r[g]=v,d.result=g;return;function y({subId:w}){const E={type:p,destroy:async()=>{t.removeListener("sync",E.update)},update:async({oldBlock:C,newBlock:S})=>{const P=S,_=LQe(C);(await BQe({provider:e,fromBlock:_,toBlock:P})).map(UQe).filter(Z=>Z!==null).forEach(Z=>{l(w,Z)})}};return t.on("sync",E.update),E}function b({subId:w,filter:E}){return E.on("update",S=>l(w,S)),{type:p,destroy:async()=>await n.uninstallFilter(E.idHex)}}}async function c(f,d){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const p=f.params[0],g=r[p];if(!g){d.result=!1;return}delete r[p],await g.destroy(),d.result=!0}function l(f,d){s.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:f,result:d}})}function u(){s.removeAllListeners();for(const f in r)r[f].destroy(),delete r[f];i=!0}}function UQe(t){return t==null?null:{hash:t.hash,parentHash:t.parentHash,sha3Uncles:t.sha3Uncles,miner:t.miner,stateRoot:t.stateRoot,transactionsRoot:t.transactionsRoot,receiptsRoot:t.receiptsRoot,logsBloom:t.logsBloom,difficulty:t.difficulty,number:t.number,gasLimit:t.gasLimit,gasUsed:t.gasUsed,nonce:t.nonce,mixHash:t.mixHash,timestamp:t.timestamp,extraData:t.extraData}}Object.defineProperty(XC,"__esModule",{value:!0});XC.SubscriptionManager=void 0;const zQe=Oce,HQe=FQe,LW=()=>{};class qQe{constructor(e){const r=new zQe.PollingBlockTracker({provider:e,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:n,middleware:i}=HQe({blockTracker:r,provider:e});this.events=n,this.subscriptionMiddleware=i}async handleRequest(e){const r={};return await this.subscriptionMiddleware(e,r,LW,LW),r}destroy(){this.subscriptionMiddleware.destroy()}}XC.SubscriptionManager=qQe;var Ile=Je&&Je.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(am,"__esModule",{value:!0});am.CoinbaseWalletProvider=void 0;const WQe=Ile(W2),VQe=Noe,xr=xw,Qt=st,GQe=Sw,BW=za,g3=Jm,Ho=Vm,o7=Ile(yqe),ay=Km,KQe=hm,JQe=XC,FW="DefaultChainId",jW="DefaultJsonRpcUrl";class QQe extends VQe.EventEmitter{constructor(e){var r,n;super(),this._filterPolyfill=new KQe.FilterPolyfill(this),this._subscriptionManager=new JQe.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=e.chainId,this._jsonRpcUrlFromOpts=e.jsonRpcUrl,this._overrideIsMetaMask=e.overrideIsMetaMask,this._relayProvider=e.relayProvider,this._storage=e.storage,this._relayEventManager=e.relayEventManager,this.diagnostic=e.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=(r=e.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this.isCoinbaseBrowser=(n=e.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this.qrUrl=e.qrUrl;const i=this.getChainId(),s=(0,Qt.prepend0x)(i.toString(16));this.emit("connect",{chainIdStr:s});const o=this._storage.getItem(BW.LOCAL_STORAGE_ADDRESSES_KEY);if(o){const a=o.split(" ");a[0]!==""&&(this._addresses=a.map(c=>(0,Qt.ensureAddressString)(c)),this.emit("accountsChanged",a))}this._subscriptionManager.events.on("notification",a=>{this.emit("message",{type:a.method,data:a.params})}),this._isAuthorized()&&this.initializeRelay(),window.addEventListener("message",a=>{var c;if(!(a.origin!==location.origin||a.source!==window)&&a.data.type==="walletLinkMessage"&&a.data.data.action==="dappChainSwitched"){const l=a.data.data.chainId,u=(c=a.data.data.jsonRpcUrl)!==null&&c!==void 0?c:this.jsonRpcUrl;this.updateProviderInfo(u,Number(l))}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,Qt.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var e;return(e=this._storage.getItem(jW))!==null&&e!==void 0?e:this._jsonRpcUrlFromOpts}set jsonRpcUrl(e){this._storage.setItem(jW,e)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(e,r){this.isCoinbaseBrowser||(this._chainIdFromOpts=r,this._jsonRpcUrlFromOpts=e),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(e,r){this.jsonRpcUrl=e;const n=this.getChainId();this._storage.setItem(FW,r.toString(10)),((0,Qt.ensureIntNumber)(r)!==n||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(e,r,n,i,s,o){const c=await(await this.initializeRelay()).watchAsset(e,r,n,i,s,o==null?void 0:o.toString()).promise;return(0,Ho.isErrorResponse)(c)?!1:!!c.result}async addEthereumChain(e,r,n,i,s,o){var a,c;if((0,Qt.ensureIntNumber)(e)===this.getChainId())return!1;const l=await this.initializeRelay(),u=l.inlineAddEthereumChain(e.toString());!this._isAuthorized()&&!u&&await l.requestEthereumAccounts().promise;const f=await l.addEthereumChain(e.toString(),r,s,n,i,o).promise;return(0,Ho.isErrorResponse)(f)?!1:(((a=f.result)===null||a===void 0?void 0:a.isApproved)===!0&&this.updateProviderInfo(r[0],e),((c=f.result)===null||c===void 0?void 0:c.isApproved)===!0)}async switchEthereumChain(e){const n=await(await this.initializeRelay()).switchEthereumChain(e.toString(10),this.selectedAddress||void 0).promise;if((0,Ho.isErrorResponse)(n)){if(!n.errorCode)return;throw n.errorCode===xr.standardErrorCodes.provider.unsupportedChain?xr.standardErrors.provider.unsupportedChain():xr.standardErrors.provider.custom({message:n.errorMessage,code:n.errorCode})}const i=n.result;i.isApproved&&i.rpcUrl.length>0&&this.updateProviderInfo(i.rpcUrl,e)}setAppInfo(e,r){this.initializeRelay().then(n=>n.setAppInfo(e,r))}async enable(){var e;return(e=this.diagnostic)===null||e===void 0||e.log(ay.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?g3.Session.hash(this._relay.session.id):void 0}),this._isAuthorized()?[...this._addresses]:await this.send("eth_requestAccounts")}async close(){(await this.initializeRelay()).resetAndReload()}send(e,r){try{const n=this._send(e,r);if(n instanceof Promise)return n.catch(i=>{throw(0,xr.serializeError)(i,e)})}catch(n){throw(0,xr.serializeError)(n,e)}}_send(e,r){if(typeof e=="string"){const i=e,s=Array.isArray(r)?r:r!==void 0?[r]:[],o={jsonrpc:"2.0",id:0,method:i,params:s};return this._sendRequestAsync(o).then(a=>a.result)}if(typeof r=="function"){const i=e,s=r;return this._sendAsync(i,s)}if(Array.isArray(e))return e.map(s=>this._sendRequest(s));const n=e;return this._sendRequest(n)}async sendAsync(e,r){try{return this._sendAsync(e,r).catch(n=>{throw(0,xr.serializeError)(n,e)})}catch(n){return Promise.reject((0,xr.serializeError)(n,e))}}async _sendAsync(e,r){if(typeof r!="function")throw new Error("callback is required");if(Array.isArray(e)){const i=r;this._sendMultipleRequestsAsync(e).then(s=>i(null,s)).catch(s=>i(s,null));return}const n=r;return this._sendRequestAsync(e).then(i=>n(null,i)).catch(i=>n(i,null))}async request(e){try{return this._request(e).catch(r=>{throw(0,xr.serializeError)(r,e.method)})}catch(r){return Promise.reject((0,xr.serializeError)(r,e.method))}}async _request(e){if(!e||typeof e!="object"||Array.isArray(e))throw xr.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:e});const{method:r,params:n}=e;if(typeof r!="string"||r.length===0)throw xr.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:e});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw xr.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:e});const i=n===void 0?[]:n,s=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:r,params:i,jsonrpc:"2.0",id:s})).result}async scanQRCode(e){const n=await(await this.initializeRelay()).scanQRCode((0,Qt.ensureRegExpString)(e)).promise;if((0,Ho.isErrorResponse)(n))throw(0,xr.serializeError)(n.errorMessage,"scanQRCode");if(typeof n.result!="string")throw(0,xr.serializeError)("result was not a string","scanQRCode");return n.result}async genericRequest(e,r){const i=await(await this.initializeRelay()).genericRequest(e,r).promise;if((0,Ho.isErrorResponse)(i))throw(0,xr.serializeError)(i.errorMessage,"generic");if(typeof i.result!="string")throw(0,xr.serializeError)("result was not a string","generic");return i.result}async connectAndSignIn(e){var r;(r=this.diagnostic)===null||r===void 0||r.log(ay.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::connectAndSignIn",sessionIdHash:this._relay?g3.Session.hash(this._relay.session.id):void 0});let n;try{const s=await this.initializeRelay();if(!(s instanceof GQe.MobileRelay))throw new Error("connectAndSignIn is only supported on mobile");if(n=await s.connectAndSignIn(e).promise,(0,Ho.isErrorResponse)(n))throw new Error(n.errorMessage)}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?xr.standardErrors.provider.userRejectedRequest("User denied account authorization"):s}if(!n.result)throw new Error("accounts received is empty");const{accounts:i}=n.result;return this._setAddresses(i),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),n.result}async selectProvider(e){const n=await(await this.initializeRelay()).selectProvider(e).promise;if((0,Ho.isErrorResponse)(n))throw(0,xr.serializeError)(n.errorMessage,"selectProvider");if(typeof n.result!="string")throw(0,xr.serializeError)("result was not a string","selectProvider");return n.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(e){const r={jsonrpc:"2.0",id:e.id},{method:n}=e;if(r.result=this._handleSynchronousMethods(e),r.result===void 0)throw new Error(`Coinbase Wallet does not support calling ${n} synchronously without a callback. Please provide a callback parameter to call ${n} asynchronously.`);return r}_setAddresses(e,r){if(!Array.isArray(e))throw new Error("addresses is not an array");const n=e.map(i=>(0,Qt.ensureAddressString)(i));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(BW.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" ")))}_sendRequestAsync(e){return new Promise((r,n)=>{try{const i=this._handleSynchronousMethods(e);if(i!==void 0)return r({jsonrpc:"2.0",id:e.id,result:i});const s=this._handleAsynchronousFilterMethods(e);if(s!==void 0){s.then(a=>r(Object.assign(Object.assign({},a),{id:e.id}))).catch(a=>n(a));return}const o=this._handleSubscriptionMethods(e);if(o!==void 0){o.then(a=>r({jsonrpc:"2.0",id:e.id,result:a.result})).catch(a=>n(a));return}}catch(i){return n(i)}this._handleAsynchronousMethods(e).then(i=>i&&r(Object.assign(Object.assign({},i),{id:e.id}))).catch(i=>n(i))})}_sendMultipleRequestsAsync(e){return Promise.all(e.map(r=>this._sendRequestAsync(r)))}_handleSynchronousMethods(e){const{method:r}=e,n=e.params||[];switch(r){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"eth_uninstallFilter":return this._eth_uninstallFilter(n);case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(e){const{method:r}=e,n=e.params||[];switch(r){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(n);case"eth_ecRecover":return this._eth_ecRecover(n);case"personal_sign":return this._personal_sign(n);case"personal_ecRecover":return this._personal_ecRecover(n);case"eth_signTransaction":return this._eth_signTransaction(n);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(n);case"eth_sendTransaction":return this._eth_sendTransaction(n);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(n);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(n);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(n);case"cbWallet_arbitrary":return this._cbwallet_arbitrary(n);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(n);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(n);case"wallet_watchAsset":return this._wallet_watchAsset(n)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(e,this.jsonRpcUrl).catch(s=>{var o;throw(s.code===xr.standardErrorCodes.rpc.methodNotFound||s.code===xr.standardErrorCodes.rpc.methodNotSupported)&&((o=this.diagnostic)===null||o===void 0||o.log(ay.EVENTS.METHOD_NOT_IMPLEMENTED,{method:e.method,sessionIdHash:this._relay?g3.Session.hash(this._relay.session.id):void 0})),s})}_handleAsynchronousFilterMethods(e){const{method:r}=e,n=e.params||[];switch(r){case"eth_newFilter":return this._eth_newFilter(n);case"eth_newBlockFilter":return this._eth_newBlockFilter();case"eth_newPendingTransactionFilter":return this._eth_newPendingTransactionFilter();case"eth_getFilterChanges":return this._eth_getFilterChanges(n);case"eth_getFilterLogs":return this._eth_getFilterLogs(n)}}_handleSubscriptionMethods(e){switch(e.method){case"eth_subscribe":case"eth_unsubscribe":return this._subscriptionManager.handleRequest(e)}}_isKnownAddress(e){try{const r=(0,Qt.ensureAddressString)(e);return this._addresses.map(i=>(0,Qt.ensureAddressString)(i)).includes(r)}catch{}return!1}_ensureKnownAddress(e){var r;if(!this._isKnownAddress(e))throw(r=this.diagnostic)===null||r===void 0||r.log(ay.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const r=e.from?(0,Qt.ensureAddressString)(e.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);const n=e.to?(0,Qt.ensureAddressString)(e.to):null,i=e.value!=null?(0,Qt.ensureBN)(e.value):new WQe.default(0),s=e.data?(0,Qt.ensureBuffer)(e.data):Buffer.alloc(0),o=e.nonce!=null?(0,Qt.ensureIntNumber)(e.nonce):null,a=e.gasPrice!=null?(0,Qt.ensureBN)(e.gasPrice):null,c=e.maxFeePerGas!=null?(0,Qt.ensureBN)(e.maxFeePerGas):null,l=e.maxPriorityFeePerGas!=null?(0,Qt.ensureBN)(e.maxPriorityFeePerGas):null,u=e.gas!=null?(0,Qt.ensureBN)(e.gas):null,f=e.chainId?(0,Qt.ensureIntNumber)(e.chainId):this.getChainId();return{fromAddress:r,toAddress:n,weiValue:i,data:s,nonce:o,gasPriceInWei:a,maxFeePerGas:c,maxPriorityFeePerGas:l,gasLimit:u,chainId:f}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw xr.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw xr.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(e,r,n,i){this._ensureKnownAddress(r);try{const o=await(await this.initializeRelay()).signEthereumMessage(e,r,n,i).promise;if((0,Ho.isErrorResponse)(o))throw new Error(o.errorMessage);return{jsonrpc:"2.0",id:0,result:o.result}}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?xr.standardErrors.provider.userRejectedRequest("User denied message signature"):s}}async _ethereumAddressFromSignedMessage(e,r,n){const s=await(await this.initializeRelay()).ethereumAddressFromSignedMessage(e,r,n).promise;if((0,Ho.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,Qt.hexStringFromIntNumber)(this.getChainId())}getChainId(){const e=this._storage.getItem(FW);if(!e)return(0,Qt.ensureIntNumber)(this._chainIdFromOpts);const r=parseInt(e,10);return(0,Qt.ensureIntNumber)(r)}async _eth_requestAccounts(){var e;if((e=this.diagnostic)===null||e===void 0||e.log(ay.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?g3.Session.hash(this._relay.session.id):void 0}),this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let r;try{if(r=await(await this.initializeRelay()).requestEthereumAccounts().promise,(0,Ho.isErrorResponse)(r))throw new Error(r.errorMessage)}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?xr.standardErrors.provider.userRejectedRequest("User denied account authorization"):n}if(!r.result)throw new Error("accounts received is empty");return this._setAddresses(r.result),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(e){this._requireAuthorization();const r=(0,Qt.ensureAddressString)(e[0]),n=(0,Qt.ensureBuffer)(e[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(e){const r=(0,Qt.ensureBuffer)(e[0]),n=(0,Qt.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(e){this._requireAuthorization();const r=(0,Qt.ensureBuffer)(e[0]),n=(0,Qt.ensureAddressString)(e[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(e){const r=(0,Qt.ensureBuffer)(e[0]),n=(0,Qt.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(r,n,!0)}async _eth_signTransaction(e){this._requireAuthorization();const r=this._prepareTransactionParams(e[0]||{});try{const i=await(await this.initializeRelay()).signEthereumTransaction(r).promise;if((0,Ho.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?xr.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(e){const r=(0,Qt.ensureBuffer)(e[0]),i=await(await this.initializeRelay()).submitEthereumTransaction(r,this.getChainId()).promise;if((0,Ho.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}async _eth_sendTransaction(e){this._requireAuthorization();const r=this._prepareTransactionParams(e[0]||{});try{const i=await(await this.initializeRelay()).signAndSubmitEthereumTransaction(r).promise;if((0,Ho.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?xr.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(e){this._requireAuthorization();const r=(0,Qt.ensureParsedJSONObject)(e[0]),n=(0,Qt.ensureAddressString)(e[1]);this._ensureKnownAddress(n);const i=o7.default.hashForSignTypedDataLegacy({data:r}),s=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,s)}async _eth_signTypedData_v3(e){this._requireAuthorization();const r=(0,Qt.ensureAddressString)(e[0]),n=(0,Qt.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);const i=o7.default.hashForSignTypedData_v3({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _eth_signTypedData_v4(e){this._requireAuthorization();const r=(0,Qt.ensureAddressString)(e[0]),n=(0,Qt.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);const i=o7.default.hashForSignTypedData_v4({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _cbwallet_arbitrary(e){const r=e[0],n=e[1];if(typeof n!="string")throw new Error("parameter must be a string");if(typeof r!="object"||r===null)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(r,n)}}async _wallet_addEthereumChain(e){var r,n,i,s;const o=e[0];if(((r=o.rpcUrls)===null||r===void 0?void 0:r.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!o.chainName||o.chainName.trim()==="")throw xr.standardErrors.rpc.invalidParams("chainName is a required field");if(!o.nativeCurrency)throw xr.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const a=parseInt(o.chainId,16);return await this.addEthereumChain(a,(n=o.rpcUrls)!==null&&n!==void 0?n:[],(i=o.blockExplorerUrls)!==null&&i!==void 0?i:[],o.chainName,(s=o.iconUrls)!==null&&s!==void 0?s:[],o.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(e){const r=e[0];return await this.switchEthereumChain(parseInt(r.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(e){const r=Array.isArray(e)?e[0]:e;if(!r.type)throw xr.standardErrors.rpc.invalidParams("Type is required");if((r==null?void 0:r.type)!=="ERC20")throw xr.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!(r!=null&&r.options))throw xr.standardErrors.rpc.invalidParams("Options are required");if(!(r!=null&&r.options.address))throw xr.standardErrors.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:i,symbol:s,image:o,decimals:a}=r.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(r.type,i,s,a,o,n)}}_eth_uninstallFilter(e){const r=(0,Qt.ensureHexString)(e[0]);return this._filterPolyfill.uninstallFilter(r)}async _eth_newFilter(e){const r=e[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(r)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(e){const r=(0,Qt.ensureHexString)(e[0]);return this._filterPolyfill.getFilterChanges(r)}_eth_getFilterLogs(e){const r=(0,Qt.ensureHexString)(e[0]);return this._filterPolyfill.getFilterLogs(r)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(e=>(e.setAccountsCallback((r,n)=>this._setAddresses(r,n)),e.setChainCallback((r,n)=>{this.updateProviderInfo(n,parseInt(r,10))}),e.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=e,e))}}am.CoinbaseWalletProvider=QQe;var v4={};Object.defineProperty(v4,"__esModule",{value:!0});v4.RelayEventManager=void 0;const YQe=st;class ZQe{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,r=(0,YQe.prepend0x)(e.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),e}}v4.RelayEventManager=ZQe;Object.defineProperty(E2,"__esModule",{value:!0});E2.CoinbaseWalletSDK=void 0;const XQe=xC,eYe=EC,UW=st,tYe=kC,rYe=am,nYe=Sw,iYe=Lw,sYe=v4,oYe=Ow,aYe=Aw,Ple=Gm;class y4{constructor(e){var r,n,i;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const s=e.linkAPIUrl||eYe.LINK_API_URL;typeof e.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=e.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(r=e.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this._overrideIsCoinbaseBrowser=(n=e.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this._diagnosticLogger=e.diagnosticLogger,this._reloadOnDisconnect=(i=e.reloadOnDisconnect)!==null&&i!==void 0?i:!0;const o=new URL(s),a=`${o.protocol}//${o.host}`;if(this._storage=new tYe.ScopedLocalStorage(`-walletlink:${a}`),this._storage.setItem("version",y4.VERSION),this.walletExtension||this.coinbaseBrowser)return;this._relayEventManager=new sYe.RelayEventManager;const c=(0,UW.isMobileWeb)(),l=e.uiConstructor||(f=>c?new iYe.MobileRelayUI(f):new oYe.WalletLinkRelayUI(f)),u={linkAPIUrl:s,version:Ple.LIB_VERSION,darkMode:!!e.darkMode,uiConstructor:l,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect,enableMobileWalletLink:e.enableMobileWalletLink};this._relay=c?new nYe.MobileRelay(u):new aYe.WalletLinkRelay(u),this.setAppInfo(e.appName,e.appLogoUrl),!e.headlessMode&&this._relay.attachUI()}makeWeb3Provider(e="",r=1){const n=this.walletExtension;if(n)return this.isCipherProvider(n)||n.setProviderInfo(e,r),this._reloadOnDisconnect===!1&&typeof n.disableReloadOnDisconnect=="function"&&n.disableReloadOnDisconnect(),n;const i=this.coinbaseBrowser;if(i)return i;const s=this._relay;if(!s||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return e||s.setConnectDisabled(!0),new rYe.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(s),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:e,chainId:r,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(e,r){var n;this._appName=e||"DApp",this._appLogoUrl=r||(0,UW.getFavicon)();const i=this.walletExtension;i?this.isCipherProvider(i)||i.setAppInfo(this._appName,this._appLogoUrl):(n=this._relay)===null||n===void 0||n.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var e;const r=this===null||this===void 0?void 0:this.walletExtension;r?r.close():(e=this._relay)===null||e===void 0||e.resetAndReload()}getQrUrl(){var e,r;return(r=(e=this._relay)===null||e===void 0?void 0:e.getQRCodeUrl())!==null&&r!==void 0?r:null}getCoinbaseWalletLogo(e,r=240){return(0,XQe.walletLogo)(e,r)}get walletExtension(){var e;return(e=window.coinbaseWalletExtension)!==null&&e!==void 0?e:window.walletLinkExtension}get coinbaseBrowser(){var e,r;try{const n=(e=window.ethereum)!==null&&e!==void 0?e:(r=window.top)===null||r===void 0?void 0:r.ethereum;return n&&"isCoinbaseBrowser"in n&&n.isCoinbaseBrowser?n:void 0}catch{return}}isCipherProvider(e){return typeof e.isCipher=="boolean"&&e.isCipher}}E2.CoinbaseWalletSDK=y4;y4.VERSION=Ple.LIB_VERSION;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletProvider=t.CoinbaseWalletSDK=void 0;const e=E2,r=am;var n=E2;Object.defineProperty(t,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return n.CoinbaseWalletSDK}});var i=am;Object.defineProperty(t,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return i.CoinbaseWalletProvider}}),t.default=e.CoinbaseWalletSDK,typeof window<"u"&&(window.CoinbaseWalletSDK=e.CoinbaseWalletSDK,window.CoinbaseWalletProvider=r.CoinbaseWalletProvider,window.WalletLink=e.CoinbaseWalletSDK,window.WalletLinkProvider=r.CoinbaseWalletProvider)})(iae);EM.type="coinbaseWallet";function EM(t){let r,n;return i=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",type:EM.type,async connect({chainId:s}={}){try{const o=await this.getProvider(),a=(await o.request({method:"eth_requestAccounts"})).map(l=>Co(l));o.on("accountsChanged",this.onAccountsChanged),o.on("chainChanged",this.onChainChanged),o.on("disconnect",this.onDisconnect.bind(this));let c=await this.getChainId();if(s&&c!==s){const l=await this.switchChain({chainId:s}).catch(u=>{if(u.code===en.code)throw u;return{id:c}});c=(l==null?void 0:l.id)??c}return{accounts:a,chainId:c}}catch(o){throw/(user closed modal|accounts received is empty|user denied account)/i.test(o.message)?new en(o):o}},async disconnect(){const s=await this.getProvider();s.removeListener("accountsChanged",this.onAccountsChanged),s.removeListener("chainChanged",this.onChainChanged),s.removeListener("disconnect",this.onDisconnect.bind(this)),s.disconnect(),s.close()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(o=>Co(o))},async getChainId(){const s=await this.getProvider();return Fd(s.chainId)},async getProvider(){var s;if(!n){r=new iae.CoinbaseWalletSDK({reloadOnDisconnect:!1,...t});const o=(s=r.walletExtension)==null?void 0:s.getChainId(),a=i.chains.find(u=>t.chainId?u.id===t.chainId:u.id===o)||i.chains[0],c=t.chainId||(a==null?void 0:a.id),l=t.jsonRpcUrl||(a==null?void 0:a.rpcUrls.default.http[0]);n=r.makeWeb3Provider(l,c)}return n},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({chainId:s}){var l,u;const o=i.chains.find(f=>f.id===s);if(!o)throw new Xa(new n1);const a=await this.getProvider(),c=Mt(o.id);try{return await a.request({method:"wallet_switchEthereumChain",params:[{chainId:c}]}),o}catch(f){if(f.code===4902)try{return await a.request({method:"wallet_addEthereumChain",params:[{chainId:c,chainName:o.name,nativeCurrency:o.nativeCurrency,rpcUrls:[((l=o.rpcUrls.default)==null?void 0:l.http[0])??""],blockExplorerUrls:[(u=o.blockExplorers)==null?void 0:u.default.url]}]}),o}catch(d){throw new en(d)}throw new Xa(f)}},onAccountsChanged(s){s.length===0?i.emitter.emit("disconnect"):i.emitter.emit("change",{accounts:s.map(o=>Co(o))})},onChainChanged(s){const o=Fd(s);i.emitter.emit("change",{chainId:o})},async onDisconnect(s){i.emitter.emit("disconnect");const o=await this.getProvider();o.removeListener("accountsChanged",this.onAccountsChanged),o.removeListener("chainChanged",this.onChainChanged),o.removeListener("disconnect",this.onDisconnect.bind(this))}})}var _M={},b4={},Gt={},Rle={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(a,c){var l=a>>>16&65535,u=a&65535,f=c>>>16&65535,d=c&65535;return u*d+(l*d+u*f<<16>>>0)|0}t.mul=Math.imul||e;function r(a,c){return a+c|0}t.add=r;function n(a,c){return a-c|0}t.sub=n;function i(a,c){return a<>>32-c}t.rotl=i;function s(a,c){return a<<32-c|a>>>c}t.rotr=s;function o(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a}t.isInteger=Number.isInteger||o,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(a){return t.isInteger(a)&&a>=-t.MAX_SAFE_INTEGER&&a<=t.MAX_SAFE_INTEGER}})(Rle);Object.defineProperty(Gt,"__esModule",{value:!0});var Tle=Rle;function cYe(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}Gt.readInt16BE=cYe;function lYe(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}Gt.readUint16BE=lYe;function uYe(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}Gt.readInt16LE=uYe;function fYe(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}Gt.readUint16LE=fYe;function Ole(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}Gt.writeUint16BE=Ole;Gt.writeInt16BE=Ole;function $le(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}Gt.writeUint16LE=$le;Gt.writeInt16LE=$le;function rR(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}Gt.readInt32BE=rR;function nR(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}Gt.readUint32BE=nR;function iR(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}Gt.readInt32LE=iR;function sR(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}Gt.readUint32LE=sR;function g_(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}Gt.writeUint32BE=g_;Gt.writeInt32BE=g_;function m_(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}Gt.writeUint32LE=m_;Gt.writeInt32LE=m_;function dYe(t,e){e===void 0&&(e=0);var r=rR(t,e),n=rR(t,e+4);return r*4294967296+n-(n>>31)*4294967296}Gt.readInt64BE=dYe;function hYe(t,e){e===void 0&&(e=0);var r=nR(t,e),n=nR(t,e+4);return r*4294967296+n}Gt.readUint64BE=hYe;function pYe(t,e){e===void 0&&(e=0);var r=iR(t,e),n=iR(t,e+4);return n*4294967296+r-(r>>31)*4294967296}Gt.readInt64LE=pYe;function gYe(t,e){e===void 0&&(e=0);var r=sR(t,e),n=sR(t,e+4);return n*4294967296+r}Gt.readUint64LE=gYe;function Nle(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),g_(t/4294967296>>>0,e,r),g_(t>>>0,e,r+4),e}Gt.writeUint64BE=Nle;Gt.writeInt64BE=Nle;function Mle(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),m_(t>>>0,e,r),m_(t/4294967296>>>0,e,r+4),e}Gt.writeUint64LE=Mle;Gt.writeInt64LE=Mle;function mYe(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,s=t/8+r-1;s>=r;s--)n+=e[s]*i,i*=256;return n}Gt.readUintBE=mYe;function vYe(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,s=r;s=n;s--)r[s]=e/i&255,i*=256;return r}Gt.writeUintBE=yYe;function bYe(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!Tle.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,s=n;s>>32-16|A<<16,ne=ne+A|0,_^=ne,_=_>>>32-12|_<<12,C=C+T|0,B^=C,B=B>>>32-16|B<<16,ce=ce+B|0,T^=ce,T=T>>>32-12|T<<12,S=S+Q|0,z^=S,z=z>>>32-16|z<<16,K=K+z|0,Q^=K,Q=Q>>>32-12|Q<<12,P=P+Z|0,R^=P,R=R>>>32-16|R<<16,x=x+R|0,Z^=x,Z=Z>>>32-12|Z<<12,S=S+Q|0,z^=S,z=z>>>32-8|z<<8,K=K+z|0,Q^=K,Q=Q>>>32-7|Q<<7,P=P+Z|0,R^=P,R=R>>>32-8|R<<8,x=x+R|0,Z^=x,Z=Z>>>32-7|Z<<7,C=C+T|0,B^=C,B=B>>>32-8|B<<8,ce=ce+B|0,T^=ce,T=T>>>32-7|T<<7,E=E+_|0,A^=E,A=A>>>32-8|A<<8,ne=ne+A|0,_^=ne,_=_>>>32-7|_<<7,E=E+T|0,R^=E,R=R>>>32-16|R<<16,K=K+R|0,T^=K,T=T>>>32-12|T<<12,C=C+Q|0,A^=C,A=A>>>32-16|A<<16,x=x+A|0,Q^=x,Q=Q>>>32-12|Q<<12,S=S+Z|0,B^=S,B=B>>>32-16|B<<16,ne=ne+B|0,Z^=ne,Z=Z>>>32-12|Z<<12,P=P+_|0,z^=P,z=z>>>32-16|z<<16,ce=ce+z|0,_^=ce,_=_>>>32-12|_<<12,S=S+Z|0,B^=S,B=B>>>32-8|B<<8,ne=ne+B|0,Z^=ne,Z=Z>>>32-7|Z<<7,P=P+_|0,z^=P,z=z>>>32-8|z<<8,ce=ce+z|0,_^=ce,_=_>>>32-7|_<<7,C=C+Q|0,A^=C,A=A>>>32-8|A<<8,x=x+A|0,Q^=x,Q=Q>>>32-7|Q<<7,E=E+T|0,R^=E,R=R>>>32-8|R<<8,K=K+R|0,T^=K,T=T>>>32-7|T<<7;vs.writeUint32LE(E+n|0,t,0),vs.writeUint32LE(C+i|0,t,4),vs.writeUint32LE(S+s|0,t,8),vs.writeUint32LE(P+o|0,t,12),vs.writeUint32LE(_+a|0,t,16),vs.writeUint32LE(T+c|0,t,20),vs.writeUint32LE(Q+l|0,t,24),vs.writeUint32LE(Z+u|0,t,28),vs.writeUint32LE(ne+f|0,t,32),vs.writeUint32LE(ce+d|0,t,36),vs.writeUint32LE(K+p|0,t,40),vs.writeUint32LE(x+g|0,t,44),vs.writeUint32LE(A+v|0,t,48),vs.writeUint32LE(B+y|0,t,52),vs.writeUint32LE(z+b|0,t,56),vs.writeUint32LE(R+w|0,t,60)}function Dle(t,e,r,n,i){if(i===void 0&&(i=0),t.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}var Lle={},Eh={};Object.defineProperty(Eh,"__esModule",{value:!0});function $Ye(t,e,r){return~(t-1)&e|t-1&r}Eh.select=$Ye;function NYe(t,e){return(t|0)-(e|0)-1>>>31&1}Eh.lessOrEqual=NYe;function Ble(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n>>8}Eh.compare=Ble;function MYe(t,e){return t.length===0||e.length===0?!1:Ble(t,e)!==0}Eh.equal=MYe;(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Eh,r=ha;t.DIGEST_LENGTH=16;var n=function(){function o(a){this.digestLength=t.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var c=a[0]|a[1]<<8;this._r[0]=c&8191;var l=a[2]|a[3]<<8;this._r[1]=(c>>>13|l<<3)&8191;var u=a[4]|a[5]<<8;this._r[2]=(l>>>10|u<<6)&7939;var f=a[6]|a[7]<<8;this._r[3]=(u>>>7|f<<9)&8191;var d=a[8]|a[9]<<8;this._r[4]=(f>>>4|d<<12)&255,this._r[5]=d>>>1&8190;var p=a[10]|a[11]<<8;this._r[6]=(d>>>14|p<<2)&8191;var g=a[12]|a[13]<<8;this._r[7]=(p>>>11|g<<5)&8065;var v=a[14]|a[15]<<8;this._r[8]=(g>>>8|v<<8)&8191,this._r[9]=v>>>5&127,this._pad[0]=a[16]|a[17]<<8,this._pad[1]=a[18]|a[19]<<8,this._pad[2]=a[20]|a[21]<<8,this._pad[3]=a[22]|a[23]<<8,this._pad[4]=a[24]|a[25]<<8,this._pad[5]=a[26]|a[27]<<8,this._pad[6]=a[28]|a[29]<<8,this._pad[7]=a[30]|a[31]<<8}return o.prototype._blocks=function(a,c,l){for(var u=this._fin?0:2048,f=this._h[0],d=this._h[1],p=this._h[2],g=this._h[3],v=this._h[4],y=this._h[5],b=this._h[6],w=this._h[7],E=this._h[8],C=this._h[9],S=this._r[0],P=this._r[1],_=this._r[2],T=this._r[3],Q=this._r[4],Z=this._r[5],ne=this._r[6],ce=this._r[7],K=this._r[8],x=this._r[9];l>=16;){var A=a[c+0]|a[c+1]<<8;f+=A&8191;var B=a[c+2]|a[c+3]<<8;d+=(A>>>13|B<<3)&8191;var z=a[c+4]|a[c+5]<<8;p+=(B>>>10|z<<6)&8191;var R=a[c+6]|a[c+7]<<8;g+=(z>>>7|R<<9)&8191;var L=a[c+8]|a[c+9]<<8;v+=(R>>>4|L<<12)&8191,y+=L>>>1&8191;var q=a[c+10]|a[c+11]<<8;b+=(L>>>14|q<<2)&8191;var N=a[c+12]|a[c+13]<<8;w+=(q>>>11|N<<5)&8191;var I=a[c+14]|a[c+15]<<8;E+=(N>>>8|I<<8)&8191,C+=I>>>5|u;var U=0,re=U;re+=f*S,re+=d*(5*x),re+=p*(5*K),re+=g*(5*ce),re+=v*(5*ne),U=re>>>13,re&=8191,re+=y*(5*Z),re+=b*(5*Q),re+=w*(5*T),re+=E*(5*_),re+=C*(5*P),U+=re>>>13,re&=8191;var M=U;M+=f*P,M+=d*S,M+=p*(5*x),M+=g*(5*K),M+=v*(5*ce),U=M>>>13,M&=8191,M+=y*(5*ne),M+=b*(5*Z),M+=w*(5*Q),M+=E*(5*T),M+=C*(5*_),U+=M>>>13,M&=8191;var G=U;G+=f*_,G+=d*P,G+=p*S,G+=g*(5*x),G+=v*(5*K),U=G>>>13,G&=8191,G+=y*(5*ce),G+=b*(5*ne),G+=w*(5*Z),G+=E*(5*Q),G+=C*(5*T),U+=G>>>13,G&=8191;var H=U;H+=f*T,H+=d*_,H+=p*P,H+=g*S,H+=v*(5*x),U=H>>>13,H&=8191,H+=y*(5*K),H+=b*(5*ce),H+=w*(5*ne),H+=E*(5*Z),H+=C*(5*Q),U+=H>>>13,H&=8191;var J=U;J+=f*Q,J+=d*T,J+=p*_,J+=g*P,J+=v*S,U=J>>>13,J&=8191,J+=y*(5*x),J+=b*(5*K),J+=w*(5*ce),J+=E*(5*ne),J+=C*(5*Z),U+=J>>>13,J&=8191;var X=U;X+=f*Z,X+=d*Q,X+=p*T,X+=g*_,X+=v*P,U=X>>>13,X&=8191,X+=y*S,X+=b*(5*x),X+=w*(5*K),X+=E*(5*ce),X+=C*(5*ne),U+=X>>>13,X&=8191;var D=U;D+=f*ne,D+=d*Z,D+=p*Q,D+=g*T,D+=v*_,U=D>>>13,D&=8191,D+=y*P,D+=b*S,D+=w*(5*x),D+=E*(5*K),D+=C*(5*ce),U+=D>>>13,D&=8191;var F=U;F+=f*ce,F+=d*ne,F+=p*Z,F+=g*Q,F+=v*T,U=F>>>13,F&=8191,F+=y*_,F+=b*P,F+=w*S,F+=E*(5*x),F+=C*(5*K),U+=F>>>13,F&=8191;var Y=U;Y+=f*K,Y+=d*ce,Y+=p*ne,Y+=g*Z,Y+=v*Q,U=Y>>>13,Y&=8191,Y+=y*T,Y+=b*_,Y+=w*P,Y+=E*S,Y+=C*(5*x),U+=Y>>>13,Y&=8191;var ue=U;ue+=f*x,ue+=d*K,ue+=p*ce,ue+=g*ne,ue+=v*Z,U=ue>>>13,ue&=8191,ue+=y*Q,ue+=b*T,ue+=w*_,ue+=E*P,ue+=C*S,U+=ue>>>13,ue&=8191,U=(U<<2)+U|0,U=U+re|0,re=U&8191,U=U>>>13,M+=U,f=re,d=M,p=G,g=H,v=J,y=X,b=D,w=F,E=Y,C=ue,c+=16,l-=16}this._h[0]=f,this._h[1]=d,this._h[2]=p,this._h[3]=g,this._h[4]=v,this._h[5]=y,this._h[6]=b,this._h[7]=w,this._h[8]=E,this._h[9]=C},o.prototype.finish=function(a,c){c===void 0&&(c=0);var l=new Uint16Array(10),u,f,d,p;if(this._leftover){for(p=this._leftover,this._buffer[p++]=1;p<16;p++)this._buffer[p]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(u=this._h[1]>>>13,this._h[1]&=8191,p=2;p<10;p++)this._h[p]+=u,u=this._h[p]>>>13,this._h[p]&=8191;for(this._h[0]+=u*5,u=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=u,u=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=u,l[0]=this._h[0]+5,u=l[0]>>>13,l[0]&=8191,p=1;p<10;p++)l[p]=this._h[p]+u,u=l[p]>>>13,l[p]&=8191;for(l[9]-=8192,f=(u^1)-1,p=0;p<10;p++)l[p]&=f;for(f=~f,p=0;p<10;p++)this._h[p]=this._h[p]&f|l[p];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,d=this._h[0]+this._pad[0],this._h[0]=d&65535,p=1;p<8;p++)d=(this._h[p]+this._pad[p]|0)+(d>>>16)|0,this._h[p]=d&65535;return a[c+0]=this._h[0]>>>0,a[c+1]=this._h[0]>>>8,a[c+2]=this._h[1]>>>0,a[c+3]=this._h[1]>>>8,a[c+4]=this._h[2]>>>0,a[c+5]=this._h[2]>>>8,a[c+6]=this._h[3]>>>0,a[c+7]=this._h[3]>>>8,a[c+8]=this._h[4]>>>0,a[c+9]=this._h[4]>>>8,a[c+10]=this._h[5]>>>0,a[c+11]=this._h[5]>>>8,a[c+12]=this._h[6]>>>0,a[c+13]=this._h[6]>>>8,a[c+14]=this._h[7]>>>0,a[c+15]=this._h[7]>>>8,this._finished=!0,this},o.prototype.update=function(a){var c=0,l=a.length,u;if(this._leftover){u=16-this._leftover,u>l&&(u=l);for(var f=0;f=16&&(u=l-l%16,this._blocks(a,c,u),c+=u,l-=u),l){for(var f=0;f16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var p=new Uint8Array(16);p.set(l,p.length-l.length);var g=new Uint8Array(32);e.stream(this._key,p,g,4);var v=u.length+this.tagLength,y;if(d){if(d.length!==v)throw new Error("ChaCha20Poly1305: incorrect destination length");y=d}else y=new Uint8Array(v);return e.streamXOR(this._key,p,u,y,4),this._authenticate(y.subarray(y.length-this.tagLength,y.length),g,y.subarray(0,y.length-this.tagLength),f),n.wipe(p),y},c.prototype.open=function(l,u,f,d){if(l.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(u.length0&&p.update(o.subarray(d.length%16))),p.update(f),f.length%16>0&&p.update(o.subarray(f.length%16));var g=new Uint8Array(8);d&&i.writeUint64LE(d.length,g),p.update(g),i.writeUint64LE(f.length,g),p.update(g);for(var v=p.digest(),y=0;ythis.blockSize?this._inner.update(r).finish(n).clean():n.set(r);for(var i=0;i1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},t.prototype.expand=function(e){for(var r=new Uint8Array(e),n=0;n256)throw new Error("randomString charset is too long");let d="";const p=u.length,g=256-256%p;for(;l>0;){const v=i(Math.ceil(l*256/g),f);for(let y=0;y0;y++){const b=v[y];b0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=c[u++],l--;this._bufferLength===this.blockSize&&(s(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(l>=this.blockSize&&(u=s(this._temp,this._state,c,u,l),l%=this.blockSize);l>0;)this._buffer[this._bufferLength++]=c[u++],l--;return this},a.prototype.finish=function(c){if(!this._finished){var l=this._bytesHashed,u=this._bufferLength,f=l/536870912|0,d=l<<3,p=l%64<56?64:128;this._buffer[u]=128;for(var g=u+1;g0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},a.prototype.restoreState=function(c){return this._state.set(c.state),this._bufferLength=c.bufferLength,c.buffer&&this._buffer.set(c.buffer),this._bytesHashed=c.bytesHashed,this._finished=!1,this},a.prototype.cleanSavedState=function(c){r.wipe(c.state),c.buffer&&r.wipe(c.buffer),c.bufferLength=0,c.bytesHashed=0},a}();t.SHA256=n;var i=new Int32Array([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]);function s(a,c,l,u,f){for(;f>=64;){for(var d=c[0],p=c[1],g=c[2],v=c[3],y=c[4],b=c[5],w=c[6],E=c[7],C=0;C<16;C++){var S=u+C*4;a[C]=e.readUint32BE(l,S)}for(var C=16;C<64;C++){var P=a[C-2],_=(P>>>17|P<<32-17)^(P>>>19|P<<32-19)^P>>>10;P=a[C-15];var T=(P>>>7|P<<32-7)^(P>>>18|P<<32-18)^P>>>3;a[C]=(_+a[C-7]|0)+(T+a[C-16]|0)}for(var C=0;C<64;C++){var _=(((y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7))+(y&b^~y&w)|0)+(E+(i[C]+a[C]|0)|0)|0,T=((d>>>2|d<<32-2)^(d>>>13|d<<32-13)^(d>>>22|d<<32-22))+(d&p^d&g^p&g)|0;E=w,w=b,b=y,y=v+_|0,v=g,g=p,p=d,d=_+T|0}c[0]+=d,c[1]+=p,c[2]+=g,c[3]+=v,c[4]+=y,c[5]+=b,c[6]+=w,c[7]+=E,u+=64,f-=64}return u}function o(a){var c=new n;c.update(a);var l=c.digest();return c.clean(),l}t.hash=o})(_4);var SM={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.sharedKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.scalarMultBase=t.scalarMult=t.SHARED_KEY_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=void 0;const e=tv,r=ha;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n(C){const S=new Float64Array(16);if(C)for(let P=0;P>16&1),P[Z-1]&=65535;P[15]=_[15]-32767-(P[14]>>16&1);const Q=P[15]>>16&1;P[14]&=65535,a(_,P,1-Q)}for(let T=0;T<16;T++)C[2*T]=_[T]&255,C[2*T+1]=_[T]>>8}function l(C,S){for(let P=0;P<16;P++)C[P]=S[2*P]+(S[2*P+1]<<8);C[15]&=32767}function u(C,S,P){for(let _=0;_<16;_++)C[_]=S[_]+P[_]}function f(C,S,P){for(let _=0;_<16;_++)C[_]=S[_]-P[_]}function d(C,S,P){let _,T,Q=0,Z=0,ne=0,ce=0,K=0,x=0,A=0,B=0,z=0,R=0,L=0,q=0,N=0,I=0,U=0,re=0,M=0,G=0,H=0,J=0,X=0,D=0,F=0,Y=0,ue=0,he=0,Ce=0,Me=0,Oe=0,We=0,ot=0,ze=P[0],Le=P[1],et=P[2],He=P[3],Ge=P[4],Ye=P[5],qe=P[6],ee=P[7],j=P[8],W=P[9],ie=P[10],de=P[11],pe=P[12],be=P[13],je=P[14],Fe=P[15];_=S[0],Q+=_*ze,Z+=_*Le,ne+=_*et,ce+=_*He,K+=_*Ge,x+=_*Ye,A+=_*qe,B+=_*ee,z+=_*j,R+=_*W,L+=_*ie,q+=_*de,N+=_*pe,I+=_*be,U+=_*je,re+=_*Fe,_=S[1],Z+=_*ze,ne+=_*Le,ce+=_*et,K+=_*He,x+=_*Ge,A+=_*Ye,B+=_*qe,z+=_*ee,R+=_*j,L+=_*W,q+=_*ie,N+=_*de,I+=_*pe,U+=_*be,re+=_*je,M+=_*Fe,_=S[2],ne+=_*ze,ce+=_*Le,K+=_*et,x+=_*He,A+=_*Ge,B+=_*Ye,z+=_*qe,R+=_*ee,L+=_*j,q+=_*W,N+=_*ie,I+=_*de,U+=_*pe,re+=_*be,M+=_*je,G+=_*Fe,_=S[3],ce+=_*ze,K+=_*Le,x+=_*et,A+=_*He,B+=_*Ge,z+=_*Ye,R+=_*qe,L+=_*ee,q+=_*j,N+=_*W,I+=_*ie,U+=_*de,re+=_*pe,M+=_*be,G+=_*je,H+=_*Fe,_=S[4],K+=_*ze,x+=_*Le,A+=_*et,B+=_*He,z+=_*Ge,R+=_*Ye,L+=_*qe,q+=_*ee,N+=_*j,I+=_*W,U+=_*ie,re+=_*de,M+=_*pe,G+=_*be,H+=_*je,J+=_*Fe,_=S[5],x+=_*ze,A+=_*Le,B+=_*et,z+=_*He,R+=_*Ge,L+=_*Ye,q+=_*qe,N+=_*ee,I+=_*j,U+=_*W,re+=_*ie,M+=_*de,G+=_*pe,H+=_*be,J+=_*je,X+=_*Fe,_=S[6],A+=_*ze,B+=_*Le,z+=_*et,R+=_*He,L+=_*Ge,q+=_*Ye,N+=_*qe,I+=_*ee,U+=_*j,re+=_*W,M+=_*ie,G+=_*de,H+=_*pe,J+=_*be,X+=_*je,D+=_*Fe,_=S[7],B+=_*ze,z+=_*Le,R+=_*et,L+=_*He,q+=_*Ge,N+=_*Ye,I+=_*qe,U+=_*ee,re+=_*j,M+=_*W,G+=_*ie,H+=_*de,J+=_*pe,X+=_*be,D+=_*je,F+=_*Fe,_=S[8],z+=_*ze,R+=_*Le,L+=_*et,q+=_*He,N+=_*Ge,I+=_*Ye,U+=_*qe,re+=_*ee,M+=_*j,G+=_*W,H+=_*ie,J+=_*de,X+=_*pe,D+=_*be,F+=_*je,Y+=_*Fe,_=S[9],R+=_*ze,L+=_*Le,q+=_*et,N+=_*He,I+=_*Ge,U+=_*Ye,re+=_*qe,M+=_*ee,G+=_*j,H+=_*W,J+=_*ie,X+=_*de,D+=_*pe,F+=_*be,Y+=_*je,ue+=_*Fe,_=S[10],L+=_*ze,q+=_*Le,N+=_*et,I+=_*He,U+=_*Ge,re+=_*Ye,M+=_*qe,G+=_*ee,H+=_*j,J+=_*W,X+=_*ie,D+=_*de,F+=_*pe,Y+=_*be,ue+=_*je,he+=_*Fe,_=S[11],q+=_*ze,N+=_*Le,I+=_*et,U+=_*He,re+=_*Ge,M+=_*Ye,G+=_*qe,H+=_*ee,J+=_*j,X+=_*W,D+=_*ie,F+=_*de,Y+=_*pe,ue+=_*be,he+=_*je,Ce+=_*Fe,_=S[12],N+=_*ze,I+=_*Le,U+=_*et,re+=_*He,M+=_*Ge,G+=_*Ye,H+=_*qe,J+=_*ee,X+=_*j,D+=_*W,F+=_*ie,Y+=_*de,ue+=_*pe,he+=_*be,Ce+=_*je,Me+=_*Fe,_=S[13],I+=_*ze,U+=_*Le,re+=_*et,M+=_*He,G+=_*Ge,H+=_*Ye,J+=_*qe,X+=_*ee,D+=_*j,F+=_*W,Y+=_*ie,ue+=_*de,he+=_*pe,Ce+=_*be,Me+=_*je,Oe+=_*Fe,_=S[14],U+=_*ze,re+=_*Le,M+=_*et,G+=_*He,H+=_*Ge,J+=_*Ye,X+=_*qe,D+=_*ee,F+=_*j,Y+=_*W,ue+=_*ie,he+=_*de,Ce+=_*pe,Me+=_*be,Oe+=_*je,We+=_*Fe,_=S[15],re+=_*ze,M+=_*Le,G+=_*et,H+=_*He,J+=_*Ge,X+=_*Ye,D+=_*qe,F+=_*ee,Y+=_*j,ue+=_*W,he+=_*ie,Ce+=_*de,Me+=_*pe,Oe+=_*be,We+=_*je,ot+=_*Fe,Q+=38*M,Z+=38*G,ne+=38*H,ce+=38*J,K+=38*X,x+=38*D,A+=38*F,B+=38*Y,z+=38*ue,R+=38*he,L+=38*Ce,q+=38*Me,N+=38*Oe,I+=38*We,U+=38*ot,T=1,_=Q+T+65535,T=Math.floor(_/65536),Q=_-T*65536,_=Z+T+65535,T=Math.floor(_/65536),Z=_-T*65536,_=ne+T+65535,T=Math.floor(_/65536),ne=_-T*65536,_=ce+T+65535,T=Math.floor(_/65536),ce=_-T*65536,_=K+T+65535,T=Math.floor(_/65536),K=_-T*65536,_=x+T+65535,T=Math.floor(_/65536),x=_-T*65536,_=A+T+65535,T=Math.floor(_/65536),A=_-T*65536,_=B+T+65535,T=Math.floor(_/65536),B=_-T*65536,_=z+T+65535,T=Math.floor(_/65536),z=_-T*65536,_=R+T+65535,T=Math.floor(_/65536),R=_-T*65536,_=L+T+65535,T=Math.floor(_/65536),L=_-T*65536,_=q+T+65535,T=Math.floor(_/65536),q=_-T*65536,_=N+T+65535,T=Math.floor(_/65536),N=_-T*65536,_=I+T+65535,T=Math.floor(_/65536),I=_-T*65536,_=U+T+65535,T=Math.floor(_/65536),U=_-T*65536,_=re+T+65535,T=Math.floor(_/65536),re=_-T*65536,Q+=T-1+37*(T-1),T=1,_=Q+T+65535,T=Math.floor(_/65536),Q=_-T*65536,_=Z+T+65535,T=Math.floor(_/65536),Z=_-T*65536,_=ne+T+65535,T=Math.floor(_/65536),ne=_-T*65536,_=ce+T+65535,T=Math.floor(_/65536),ce=_-T*65536,_=K+T+65535,T=Math.floor(_/65536),K=_-T*65536,_=x+T+65535,T=Math.floor(_/65536),x=_-T*65536,_=A+T+65535,T=Math.floor(_/65536),A=_-T*65536,_=B+T+65535,T=Math.floor(_/65536),B=_-T*65536,_=z+T+65535,T=Math.floor(_/65536),z=_-T*65536,_=R+T+65535,T=Math.floor(_/65536),R=_-T*65536,_=L+T+65535,T=Math.floor(_/65536),L=_-T*65536,_=q+T+65535,T=Math.floor(_/65536),q=_-T*65536,_=N+T+65535,T=Math.floor(_/65536),N=_-T*65536,_=I+T+65535,T=Math.floor(_/65536),I=_-T*65536,_=U+T+65535,T=Math.floor(_/65536),U=_-T*65536,_=re+T+65535,T=Math.floor(_/65536),re=_-T*65536,Q+=T-1+37*(T-1),C[0]=Q,C[1]=Z,C[2]=ne,C[3]=ce,C[4]=K,C[5]=x,C[6]=A,C[7]=B,C[8]=z,C[9]=R,C[10]=L,C[11]=q,C[12]=N,C[13]=I,C[14]=U,C[15]=re}function p(C,S){d(C,S,S)}function g(C,S){const P=n();for(let _=0;_<16;_++)P[_]=S[_];for(let _=253;_>=0;_--)p(P,P),_!==2&&_!==4&&d(P,P,S);for(let _=0;_<16;_++)C[_]=P[_]}function v(C,S){const P=new Uint8Array(32),_=new Float64Array(80),T=n(),Q=n(),Z=n(),ne=n(),ce=n(),K=n();for(let z=0;z<31;z++)P[z]=C[z];P[31]=C[31]&127|64,P[0]&=248,l(_,S);for(let z=0;z<16;z++)Q[z]=_[z];T[0]=ne[0]=1;for(let z=254;z>=0;--z){const R=P[z>>>3]>>>(z&7)&1;a(T,Q,R),a(Z,ne,R),u(ce,T,Z),f(T,T,Z),u(Z,Q,ne),f(Q,Q,ne),p(ne,ce),p(K,T),d(T,Z,T),d(Z,Q,ce),u(ce,T,Z),f(T,T,Z),p(Q,T),f(Z,ne,K),d(T,Z,s),u(T,T,ne),d(Z,Z,T),d(T,ne,K),d(ne,Q,_),p(Q,ce),a(T,Q,R),a(Z,ne,R)}for(let z=0;z<16;z++)_[z+16]=T[z],_[z+32]=Z[z],_[z+48]=Q[z],_[z+64]=ne[z];const x=_.subarray(32),A=_.subarray(16);g(x,x),d(A,A,x);const B=new Uint8Array(32);return c(B,A),B}t.scalarMult=v;function y(C){return v(C,i)}t.scalarMultBase=y;function b(C){if(C.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const S=new Uint8Array(C);return{publicKey:y(S),secretKey:S}}t.generateKeyPairFromSeed=b;function w(C){const S=(0,e.randomBytes)(32,C),P=b(S);return(0,r.wipe)(S),P}t.generateKeyPair=w;function E(C,S,P=!1){if(C.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(S.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const _=v(C,S);if(P){let T=0;for(let Q=0;Q<_.length;Q++)T|=_[Q];if(T===0)throw new Error("X25519: invalid shared key")}return _}t.sharedKey=E})(SM);function AM(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function Ule(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?AM(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function aR(t,e){e||(e=t.reduce((i,s)=>i+s.length,0));const r=Ule(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return AM(r)}function JYe(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,C=new Uint8Array(E);b!==w;){for(var S=g[b],P=0,_=E-1;(S!==0||P>>0,C[_]=S%a>>>0,S=S/a>>>0;if(S!==0)throw new Error("Non-zero carry");y=P,b++}for(var T=E-y;T!==E&&C[T]===0;)T++;for(var Q=c.repeat(v);T>>0,E=new Uint8Array(w);g[v];){var C=r[g.charCodeAt(v)];if(C===255)return;for(var S=0,P=w-1;(C!==0||S>>0,E[P]=C%256>>>0,C=C/256>>>0;if(C!==0)throw new Error("Non-zero carry");b=S,v++}if(g[v]!==" "){for(var _=w-b;_!==w&&E[_]===0;)_++;for(var T=new Uint8Array(y+(w-_)),Q=y;_!==w;)T[Q++]=E[_++];return T}}}function p(g){var v=d(g);if(v)return v;throw new Error(`Non-${e} character`)}return{encode:f,decodeUnsafe:d,decode:p}}var QYe=JYe,YYe=QYe;const ZYe=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},XYe=t=>new TextEncoder().encode(t),eZe=t=>new TextDecoder().decode(t);class tZe{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class rZe{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}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 zle(this,e)}}class nZe{constructor(e){this.decoders=e}or(e){return zle(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const zle=(t,e)=>new nZe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class iZe{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new tZe(e,r,n),this.decoder=new rZe(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const C4=({name:t,prefix:e,encode:r,decode:n})=>new iZe(t,e,r,n),Jw=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=YYe(r,e);return C4({prefix:t,name:e,encode:n,decode:s=>ZYe(i(s))})},sZe=(t,e,r,n)=>{const i={};for(let u=0;u=8&&(a-=8,o[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},oZe=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<C4({prefix:e,name:t,encode(i){return oZe(i,n,r)},decode(i){return sZe(i,n,r,t)}}),aZe=C4({prefix:"\0",name:"identity",encode:t=>eZe(t),decode:t=>XYe(t)}),cZe=Object.freeze(Object.defineProperty({__proto__:null,identity:aZe},Symbol.toStringTag,{value:"Module"})),lZe=ss({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),uZe=Object.freeze(Object.defineProperty({__proto__:null,base2:lZe},Symbol.toStringTag,{value:"Module"})),fZe=ss({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),dZe=Object.freeze(Object.defineProperty({__proto__:null,base8:fZe},Symbol.toStringTag,{value:"Module"})),hZe=Jw({prefix:"9",name:"base10",alphabet:"0123456789"}),pZe=Object.freeze(Object.defineProperty({__proto__:null,base10:hZe},Symbol.toStringTag,{value:"Module"})),gZe=ss({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),mZe=ss({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),vZe=Object.freeze(Object.defineProperty({__proto__:null,base16:gZe,base16upper:mZe},Symbol.toStringTag,{value:"Module"})),yZe=ss({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),bZe=ss({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),wZe=ss({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),xZe=ss({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),EZe=ss({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),_Ze=ss({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),CZe=ss({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),SZe=ss({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),AZe=ss({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),kZe=Object.freeze(Object.defineProperty({__proto__:null,base32:yZe,base32hex:EZe,base32hexpad:CZe,base32hexpadupper:SZe,base32hexupper:_Ze,base32pad:wZe,base32padupper:xZe,base32upper:bZe,base32z:AZe},Symbol.toStringTag,{value:"Module"})),IZe=Jw({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),PZe=Jw({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),RZe=Object.freeze(Object.defineProperty({__proto__:null,base36:IZe,base36upper:PZe},Symbol.toStringTag,{value:"Module"})),TZe=Jw({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),OZe=Jw({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),$Ze=Object.freeze(Object.defineProperty({__proto__:null,base58btc:TZe,base58flickr:OZe},Symbol.toStringTag,{value:"Module"})),NZe=ss({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),MZe=ss({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),DZe=ss({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),LZe=ss({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),BZe=Object.freeze(Object.defineProperty({__proto__:null,base64:NZe,base64pad:MZe,base64url:DZe,base64urlpad:LZe},Symbol.toStringTag,{value:"Module"})),Hle=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),FZe=Hle.reduce((t,e,r)=>(t[r]=e,t),[]),jZe=Hle.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function UZe(t){return t.reduce((e,r)=>(e+=FZe[r],e),"")}function zZe(t){const e=[];for(const r of t){const n=jZe[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const HZe=C4({prefix:"🚀",name:"base256emoji",encode:UZe,decode:zZe}),qZe=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:HZe},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const WW={...cZe,...uZe,...dZe,...pZe,...vZe,...kZe,...RZe,...$Ze,...BZe,...qZe};function qle(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const VW=qle("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),a7=qle("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);const e=Ule(t.length);for(let r=0;r"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new JZe:typeof navigator<"u"?QW(navigator.userAgent):rXe()}function eXe(t){return t!==""&&ZZe.reduce(function(e,r){var n=r[0],i=r[1];if(e)return e;var s=i.exec(t);return!!s&&[n,s]},!1)}function QW(t){var e=eXe(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new KZe;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function aXe(t,e){return function(r,n){e(r,n,t)}}function cXe(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function lXe(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})}function uXe(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,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(l){return function(u){return c([l,u])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Vle(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function hXe(){for(var t=[],e=0;e1||a(d,p)})})}function a(d,p){try{c(n[d](p))}catch(g){f(s[0][3],g)}}function c(d){d.value instanceof k2?Promise.resolve(d.value.v).then(l,u):f(s[0][2],d)}function l(d){a("next",d)}function u(d){a("throw",d)}function f(d,p){d(p),s.shift(),s.length&&a(s[0][0],s[0][1])}}function mXe(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=t[i]?function(o){return(r=!r)?{value:k2(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function vXe(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof uR=="function"?uR(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function yXe(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function bXe(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function wXe(t){return t&&t.__esModule?t:{default:t}}function xXe(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function EXe(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}const _Xe=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return lR},__asyncDelegator:mXe,__asyncGenerator:gXe,__asyncValues:vXe,__await:k2,__awaiter:lXe,__classPrivateFieldGet:xXe,__classPrivateFieldSet:EXe,__createBinding:fXe,__decorate:oXe,__exportStar:dXe,__extends:iXe,__generator:uXe,__importDefault:wXe,__importStar:bXe,__makeTemplateObject:yXe,__metadata:cXe,__param:aXe,__read:Vle,__rest:sXe,__spread:hXe,__spreadArrays:pXe,__values:uR},Symbol.toStringTag,{value:"Module"})),iu=wf(_Xe);var c7={},cy={},YW;function CXe(){if(YW)return cy;YW=1,Object.defineProperty(cy,"__esModule",{value:!0}),cy.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return cy.delay=t,cy}var e0={},l7={},t0={},ZW;function SXe(){return ZW||(ZW=1,Object.defineProperty(t0,"__esModule",{value:!0}),t0.ONE_THOUSAND=t0.ONE_HUNDRED=void 0,t0.ONE_HUNDRED=100,t0.ONE_THOUSAND=1e3),t0}var u7={},XW;function AXe(){return XW||(XW=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=t.ONE_MINUTE*5,t.TEN_MINUTES=t.ONE_MINUTE*10,t.THIRTY_MINUTES=t.ONE_MINUTE*30,t.SIXTY_MINUTES=t.ONE_MINUTE*60,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=t.ONE_HOUR*3,t.SIX_HOURS=t.ONE_HOUR*6,t.TWELVE_HOURS=t.ONE_HOUR*12,t.TWENTY_FOUR_HOURS=t.ONE_HOUR*24,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=t.ONE_DAY*3,t.FIVE_DAYS=t.ONE_DAY*5,t.SEVEN_DAYS=t.ONE_DAY*7,t.THIRTY_DAYS=t.ONE_DAY*30,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=t.ONE_WEEK*2,t.THREE_WEEKS=t.ONE_WEEK*3,t.FOUR_WEEKS=t.ONE_WEEK*4,t.ONE_YEAR=t.ONE_DAY*365}(u7)),u7}var eV;function Gle(){return eV||(eV=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=iu;e.__exportStar(SXe(),t),e.__exportStar(AXe(),t)}(l7)),l7}var tV;function kXe(){if(tV)return e0;tV=1,Object.defineProperty(e0,"__esModule",{value:!0}),e0.fromMiliseconds=e0.toMiliseconds=void 0;const t=Gle();function e(n){return n*t.ONE_THOUSAND}e0.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return e0.fromMiliseconds=r,e0}var rV;function IXe(){return rV||(rV=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=iu;e.__exportStar(CXe(),t),e.__exportStar(kXe(),t)}(c7)),c7}var xp={},nV;function PXe(){if(nV)return xp;nV=1,Object.defineProperty(xp,"__esModule",{value:!0}),xp.Watch=void 0;class t{constructor(){this.timestamps=new Map}start(r){if(this.timestamps.has(r))throw new Error(`Watch already started for label: ${r}`);this.timestamps.set(r,{started:Date.now()})}stop(r){const n=this.get(r);if(typeof n.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const i=Date.now()-n.started;this.timestamps.set(r,{started:n.started,elapsed:i})}get(r){const n=this.timestamps.get(r);if(typeof n>"u")throw new Error(`No timestamp found for label: ${r}`);return n}elapsed(r){const n=this.get(r);return n.elapsed||Date.now()-n.started}}return xp.Watch=t,xp.default=t,xp}var f7={},ly={},iV;function RXe(){if(iV)return ly;iV=1,Object.defineProperty(ly,"__esModule",{value:!0}),ly.IWatch=void 0;class t{}return ly.IWatch=t,ly}var sV;function TXe(){return sV||(sV=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),iu.__exportStar(RXe(),t)}(f7)),f7}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=iu;e.__exportStar(IXe(),t),e.__exportStar(PXe(),t),e.__exportStar(TXe(),t),e.__exportStar(Gle(),t)})(lt);var Xr={};Object.defineProperty(Xr,"__esModule",{value:!0});Xr.getLocalStorage=Xr.getLocalStorageOrThrow=Xr.getCrypto=Xr.getCryptoOrThrow=Kle=Xr.getLocation=Xr.getLocationOrThrow=IM=Xr.getNavigator=Xr.getNavigatorOrThrow=kM=Xr.getDocument=Xr.getDocumentOrThrow=Xr.getFromWindowOrThrow=Xr.getFromWindow=void 0;function P1(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}Xr.getFromWindow=P1;function rv(t){const e=P1(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}Xr.getFromWindowOrThrow=rv;function OXe(){return rv("document")}Xr.getDocumentOrThrow=OXe;function $Xe(){return P1("document")}var kM=Xr.getDocument=$Xe;function NXe(){return rv("navigator")}Xr.getNavigatorOrThrow=NXe;function MXe(){return P1("navigator")}var IM=Xr.getNavigator=MXe;function DXe(){return rv("location")}Xr.getLocationOrThrow=DXe;function LXe(){return P1("location")}var Kle=Xr.getLocation=LXe;function BXe(){return rv("crypto")}Xr.getCryptoOrThrow=BXe;function FXe(){return P1("crypto")}Xr.getCrypto=FXe;function jXe(){return rv("localStorage")}Xr.getLocalStorageOrThrow=jXe;function UXe(){return P1("localStorage")}Xr.getLocalStorage=UXe;var PM={};Object.defineProperty(PM,"__esModule",{value:!0});var Jle=PM.getWindowMetadata=void 0;const oV=Xr;function zXe(){let t,e;try{t=oV.getDocumentOrThrow(),e=oV.getLocationOrThrow()}catch{return null}function r(){const f=t.getElementsByTagName("link"),d=[];for(let p=0;p-1){const y=g.getAttribute("href");if(y)if(y.toLowerCase().indexOf("https:")===-1&&y.toLowerCase().indexOf("http:")===-1&&y.indexOf("//")!==0){let b=e.protocol+"//"+e.host;if(y.indexOf("/")===0)b+=y;else{const w=e.pathname.split("/");w.pop();const E=w.join("/");b+=E+"/"+y}d.push(b)}else if(y.indexOf("//")===0){const b=e.protocol+y;d.push(b)}else d.push(y)}}return d}function n(...f){const d=t.getElementsByTagName("meta");for(let p=0;pg.getAttribute(y)).filter(y=>y?f.includes(y):!1);if(v.length&&v){const y=g.getAttribute("content");if(y)return y}}return""}function i(){let f=n("name","og:site_name","og:title","twitter:title");return f||(f=t.title),f}function s(){return n("description","og:description","twitter:description","keywords")}const o=i(),a=s(),c=e.origin,l=r();return{description:a,url:c,icons:l,name:o}}Jle=PM.getWindowMetadata=zXe;var I2={},HXe=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),Qle="%[a-f0-9]{2}",aV=new RegExp("("+Qle+")|([^%]+?)","gi"),cV=new RegExp("("+Qle+")+","gi");function fR(t,e){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;e=e||1;var r=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],fR(r),fR(n))}function qXe(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(aV)||[],r=1;r{if(!(typeof t=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[t];const r=t.indexOf(e);return r===-1?[t]:[t.slice(0,r),t.slice(r+e.length)]},KXe=function(t,e){for(var r={},n=Object.keys(t),i=Array.isArray(e),s=0;sw==null,o=Symbol("encodeFragmentIdentifier");function a(w){switch(w.arrayFormat){case"index":return E=>(C,S)=>{const P=C.length;return S===void 0||w.skipNull&&S===null||w.skipEmptyString&&S===""?C:S===null?[...C,[u(E,w),"[",P,"]"].join("")]:[...C,[u(E,w),"[",u(P,w),"]=",u(S,w)].join("")]};case"bracket":return E=>(C,S)=>S===void 0||w.skipNull&&S===null||w.skipEmptyString&&S===""?C:S===null?[...C,[u(E,w),"[]"].join("")]:[...C,[u(E,w),"[]=",u(S,w)].join("")];case"colon-list-separator":return E=>(C,S)=>S===void 0||w.skipNull&&S===null||w.skipEmptyString&&S===""?C:S===null?[...C,[u(E,w),":list="].join("")]:[...C,[u(E,w),":list=",u(S,w)].join("")];case"comma":case"separator":case"bracket-separator":{const E=w.arrayFormat==="bracket-separator"?"[]=":"=";return C=>(S,P)=>P===void 0||w.skipNull&&P===null||w.skipEmptyString&&P===""?S:(P=P===null?"":P,S.length===0?[[u(C,w),E,u(P,w)].join("")]:[[S,u(P,w)].join(w.arrayFormatSeparator)])}default:return E=>(C,S)=>S===void 0||w.skipNull&&S===null||w.skipEmptyString&&S===""?C:S===null?[...C,u(E,w)]:[...C,[u(E,w),"=",u(S,w)].join("")]}}function c(w){let E;switch(w.arrayFormat){case"index":return(C,S,P)=>{if(E=/\[(\d*)\]$/.exec(C),C=C.replace(/\[\d*\]$/,""),!E){P[C]=S;return}P[C]===void 0&&(P[C]={}),P[C][E[1]]=S};case"bracket":return(C,S,P)=>{if(E=/(\[\])$/.exec(C),C=C.replace(/\[\]$/,""),!E){P[C]=S;return}if(P[C]===void 0){P[C]=[S];return}P[C]=[].concat(P[C],S)};case"colon-list-separator":return(C,S,P)=>{if(E=/(:list)$/.exec(C),C=C.replace(/:list$/,""),!E){P[C]=S;return}if(P[C]===void 0){P[C]=[S];return}P[C]=[].concat(P[C],S)};case"comma":case"separator":return(C,S,P)=>{const _=typeof S=="string"&&S.includes(w.arrayFormatSeparator),T=typeof S=="string"&&!_&&f(S,w).includes(w.arrayFormatSeparator);S=T?f(S,w):S;const Q=_||T?S.split(w.arrayFormatSeparator).map(Z=>f(Z,w)):S===null?S:f(S,w);P[C]=Q};case"bracket-separator":return(C,S,P)=>{const _=/(\[\])$/.test(C);if(C=C.replace(/\[\]$/,""),!_){P[C]=S&&f(S,w);return}const T=S===null?[]:S.split(w.arrayFormatSeparator).map(Q=>f(Q,w));if(P[C]===void 0){P[C]=T;return}P[C]=[].concat(P[C],T)};default:return(C,S,P)=>{if(P[C]===void 0){P[C]=S;return}P[C]=[].concat(P[C],S)}}}function l(w){if(typeof w!="string"||w.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function u(w,E){return E.encode?E.strict?e(w):encodeURIComponent(w):w}function f(w,E){return E.decode?r(w):w}function d(w){return Array.isArray(w)?w.sort():typeof w=="object"?d(Object.keys(w)).sort((E,C)=>Number(E)-Number(C)).map(E=>w[E]):w}function p(w){const E=w.indexOf("#");return E!==-1&&(w=w.slice(0,E)),w}function g(w){let E="";const C=w.indexOf("#");return C!==-1&&(E=w.slice(C)),E}function v(w){w=p(w);const E=w.indexOf("?");return E===-1?"":w.slice(E+1)}function y(w,E){return E.parseNumbers&&!Number.isNaN(Number(w))&&typeof w=="string"&&w.trim()!==""?w=Number(w):E.parseBooleans&&w!==null&&(w.toLowerCase()==="true"||w.toLowerCase()==="false")&&(w=w.toLowerCase()==="true"),w}function b(w,E){E=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},E),l(E.arrayFormatSeparator);const C=c(E),S=Object.create(null);if(typeof w!="string"||(w=w.trim().replace(/^[?#&]/,""),!w))return S;for(const P of w.split("&")){if(P==="")continue;let[_,T]=n(E.decode?P.replace(/\+/g," "):P,"=");T=T===void 0?null:["comma","separator","bracket-separator"].includes(E.arrayFormat)?T:f(T,E),C(f(_,E),T,S)}for(const P of Object.keys(S)){const _=S[P];if(typeof _=="object"&&_!==null)for(const T of Object.keys(_))_[T]=y(_[T],E);else S[P]=y(_,E)}return E.sort===!1?S:(E.sort===!0?Object.keys(S).sort():Object.keys(S).sort(E.sort)).reduce((P,_)=>{const T=S[_];return T&&typeof T=="object"&&!Array.isArray(T)?P[_]=d(T):P[_]=T,P},Object.create(null))}t.extract=v,t.parse=b,t.stringify=(w,E)=>{if(!w)return"";E=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},E),l(E.arrayFormatSeparator);const C=T=>E.skipNull&&s(w[T])||E.skipEmptyString&&w[T]==="",S=a(E),P={};for(const T of Object.keys(w))C(T)||(P[T]=w[T]);const _=Object.keys(P);return E.sort!==!1&&_.sort(E.sort),_.map(T=>{const Q=w[T];return Q===void 0?"":Q===null?u(T,E):Array.isArray(Q)?Q.length===0&&E.arrayFormat==="bracket-separator"?u(T,E)+"[]":Q.reduce(S(T),[]).join("&"):u(T,E)+"="+u(Q,E)}).filter(T=>T.length>0).join("&")},t.parseUrl=(w,E)=>{E=Object.assign({decode:!0},E);const[C,S]=n(w,"#");return Object.assign({url:C.split("?")[0]||"",query:b(v(w),E)},E&&E.parseFragmentIdentifier&&S?{fragmentIdentifier:f(S,E)}:{})},t.stringifyUrl=(w,E)=>{E=Object.assign({encode:!0,strict:!0,[o]:!0},E);const C=p(w.url).split("?")[0]||"",S=t.extract(w.url),P=t.parse(S,{sort:!1}),_=Object.assign(P,w.query);let T=t.stringify(_,E);T&&(T=`?${T}`);let Q=g(w.url);return w.fragmentIdentifier&&(Q=`#${E[o]?u(w.fragmentIdentifier,E):w.fragmentIdentifier}`),`${C}${T}${Q}`},t.pick=(w,E,C)=>{C=Object.assign({parseFragmentIdentifier:!0,[o]:!1},C);const{url:S,query:P,fragmentIdentifier:_}=t.parseUrl(w,C);return t.stringifyUrl({url:S,query:i(P,E),fragmentIdentifier:_},C)},t.exclude=(w,E,C)=>{const S=Array.isArray(E)?P=>!E.includes(P):(P,_)=>!E(P,_);return t.pick(w,S,C)}})(I2);const JXe={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe"}},QXe=":";function YXe(t){const[e,r]=t.split(QXe);return{namespace:e,reference:r}}function ZXe(t,e=[]){const r=[];return Object.keys(t).forEach(n=>{if(e.length&&!e.includes(n))return;const i=t[n];r.push(...i.accounts)}),r}function Yle(t,e){return t.includes(":")?[t]:e.chains||[]}const Zle="base10",Ks="base16",dR="base64pad",RM="utf8",Xle=0,R1=1,XXe=0,lV=1,hR=12,TM=32;function eet(){const t=SM.generateKeyPair();return{privateKey:Qs(t.secretKey,Ks),publicKey:Qs(t.publicKey,Ks)}}function pR(){const t=tv.randomBytes(TM);return Qs(t,Ks)}function tet(t,e){const r=SM.sharedKey(So(t,Ks),So(e,Ks),!0),n=new UYe(_4.SHA256,r).expand(TM);return Qs(n,Ks)}function ret(t){const e=_4.hash(So(t,Ks));return Qs(e,Ks)}function Ig(t){const e=_4.hash(So(t,RM));return Qs(e,Ks)}function net(t){return So(`${t}`,Zle)}function Qw(t){return Number(Qs(t,Zle))}function iet(t){const e=net(typeof t.type<"u"?t.type:Xle);if(Qw(e)===R1&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?So(t.senderPublicKey,Ks):void 0,n=typeof t.iv<"u"?So(t.iv,Ks):tv.randomBytes(hR),i=new _M.ChaCha20Poly1305(So(t.symKey,Ks)).seal(n,So(t.message,RM));return oet({type:e,sealed:i,iv:n,senderPublicKey:r})}function set(t){const e=new _M.ChaCha20Poly1305(So(t.symKey,Ks)),{sealed:r,iv:n}=v_(t.encoded),i=e.open(n,r);if(i===null)throw new Error("Failed to decrypt");return Qs(i,RM)}function oet(t){if(Qw(t.type)===R1){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Qs(aR([t.type,t.senderPublicKey,t.iv,t.sealed]),dR)}return Qs(aR([t.type,t.iv,t.sealed]),dR)}function v_(t){const e=So(t,dR),r=e.slice(XXe,lV),n=lV;if(Qw(r)===R1){const a=n+TM,c=a+hR,l=e.slice(n,a),u=e.slice(a,c),f=e.slice(c);return{type:r,sealed:f,iv:u,senderPublicKey:l}}const i=n+hR,s=e.slice(n,i),o=e.slice(i);return{type:r,sealed:o,iv:s}}function aet(t,e){const r=v_(t);return eue({type:Qw(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?Qs(r.senderPublicKey,Ks):void 0,receiverPublicKey:e==null?void 0:e.receiverPublicKey})}function eue(t){const e=(t==null?void 0:t.type)||Xle;if(e===R1){if(typeof(t==null?void 0:t.senderPublicKey)>"u")throw new Error("missing sender public key");if(typeof(t==null?void 0:t.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:t==null?void 0:t.senderPublicKey,receiverPublicKey:t==null?void 0:t.receiverPublicKey}}function uV(t){return t.type===R1&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}var cet=Object.defineProperty,fV=Object.getOwnPropertySymbols,uet=Object.prototype.hasOwnProperty,fet=Object.prototype.propertyIsEnumerable,dV=(t,e,r)=>e in t?cet(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,hV=(t,e)=>{for(var r in e||(e={}))uet.call(e,r)&&dV(t,r,e[r]);if(fV)for(var r of fV(e))fet.call(e,r)&&dV(t,r,e[r]);return t};const det="ReactNative",ea={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},het="js";function OM(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function nv(){return!kM()&&!!IM()&&navigator.product===det}function iv(){return!OM()&&!!IM()&&!!kM()}function Yw(){return nv()?ea.reactNative:OM()?ea.node:iv()?ea.browser:ea.unknown}function pet(){var t;try{return nv()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(t=global.Application)==null?void 0:t.applicationId:void 0}catch{return}}function get(t,e){let r=I2.parse(t);return r=hV(hV({},r),e),t=I2.stringify(r),t}function met(){return Jle()||{name:"",description:"",url:"",icons:[""]}}function vet(){if(Yw()===ea.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:r,Version:n}=global.Platform;return[r,n].join("-")}const t=XZe();if(t===null)return"unknown";const e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return t.type==="browser"?[e,t.name,t.version].join("-"):[e,t.version].join("-")}function yet(){var t;const e=Yw();return e===ea.browser?[e,((t=Kle())==null?void 0:t.host)||"unknown"].join(":"):e}function bet(t,e,r){const n=vet(),i=yet();return[[t,e].join("-"),[het,r].join("-"),n,i].join("/")}function wet({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:s,useOnCloseEvent:o,bundleId:a}){const c=r.split("?"),l=bet(t,e,n),u={auth:i,ua:l,projectId:s,useOnCloseEvent:o||void 0,origin:a||void 0},f=get(c[1]||"",u);return c[0]+"?"+f}function P0(t,e){return t.filter(r=>e.includes(r)).length===t.length}function tue(t){return Object.fromEntries(t.entries())}function rue(t){return new Map(Object.entries(t))}function Np(t=lt.FIVE_MINUTES,e){const r=lt.toMiliseconds(t||lt.FIVE_MINUTES);let n,i,s;return{resolve:o=>{s&&n&&(clearTimeout(s),n(o))},reject:o=>{s&&i&&(clearTimeout(s),i(o))},done:()=>new Promise((o,a)=>{s=setTimeout(()=>{a(new Error(e))},r),n=o,i=a})}}function P2(t,e,r){return new Promise(async(n,i)=>{const s=setTimeout(()=>i(new Error(r)),e);try{const o=await t;n(o)}catch(o){i(o)}clearTimeout(s)})}function nue(t,e){if(typeof e=="string"&&e.startsWith(`${t}:`))return e;if(t.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(t.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: ${t}`)}function xet(t){return nue("topic",t)}function Eet(t){return nue("id",t)}function iue(t){const[e,r]=t.split(":"),n={id:void 0,topic:void 0};if(e==="topic"&&typeof r=="string")n.topic=r;else if(e==="id"&&Number.isInteger(Number(r)))n.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return n}function Oc(t,e){return lt.fromMiliseconds((e||Date.now())+lt.toMiliseconds(t))}function cd(t){return Date.now()>=lt.toMiliseconds(t)}function ii(t,e){return`${t}${e?`:${e}`:""}`}function d7(t=[],e=[]){return[...new Set([...t,...e])]}async function _et({id:t,topic:e,wcDeepLink:r}){try{if(!r)return;const n=typeof r=="string"?JSON.parse(r):r;let i=n==null?void 0:n.href;if(typeof i!="string")return;i.endsWith("/")&&(i=i.slice(0,-1));const s=`${i}/wc?requestId=${t}&sessionTopic=${e}`,o=Yw();o===ea.browser?s.startsWith("https://")?window.open(s,"_blank","noreferrer noopener"):window.open(s,"_self","noreferrer noopener"):o===ea.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(s)}catch(n){console.error(n)}}async function Cet(t,e){try{return await t.getItem(e)||(iv()?localStorage.getItem(e):void 0)}catch(r){console.error(r)}}const Aet="irn";function gR(t){return(t==null?void 0:t.relay)||{protocol:Aet}}function _E(t){const e=JXe[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var ket=Object.defineProperty,pV=Object.getOwnPropertySymbols,Iet=Object.prototype.hasOwnProperty,Pet=Object.prototype.propertyIsEnumerable,gV=(t,e,r)=>e in t?ket(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ret=(t,e)=>{for(var r in e||(e={}))Iet.call(e,r)&&gV(t,r,e[r]);if(pV)for(var r of pV(e))Pet.call(e,r)&&gV(t,r,e[r]);return t};function Tet(t,e="-"){const r={},n="relay"+e;return Object.keys(t).forEach(i=>{if(i.startsWith(n)){const s=i.replace(n,""),o=t[i];r[s]=o}}),r}function mV(t){t=t.includes("wc://")?t.replace("wc://",""):t,t=t.includes("wc:")?t.replace("wc:",""):t;const e=t.indexOf(":"),r=t.indexOf("?")!==-1?t.indexOf("?"):void 0,n=t.substring(0,e),i=t.substring(e+1,r).split("@"),s=typeof r<"u"?t.substring(r):"",o=I2.parse(s);return{protocol:n,topic:Oet(i[0]),version:parseInt(i[1],10),symKey:o.symKey,relay:Tet(o)}}function Oet(t){return t.startsWith("//")?t.substring(2):t}function $et(t,e="-"){const r="relay",n={};return Object.keys(t).forEach(i=>{const s=r+e+i;t[i]&&(n[s]=t[i])}),n}function Net(t){return`${t.protocol}:${t.topic}@${t.version}?`+I2.stringify(Ret({symKey:t.symKey},$et(t.relay)))}function sv(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function Met(t){const e=[];return Object.values(t).forEach(r=>{e.push(...sv(r.accounts))}),e}function Det(t,e){const r=[];return Object.values(t).forEach(n=>{sv(n.accounts).includes(e)&&r.push(...n.methods)}),r}function Let(t,e){const r=[];return Object.values(t).forEach(n=>{sv(n.accounts).includes(e)&&r.push(...n.events)}),r}function Bet(t,e){const r=CE(t,e);if(r)throw new Error(r.message);const n={};for(const[i,s]of Object.entries(t))n[i]={methods:s.methods,events:s.events,chains:s.accounts.map(o=>`${o.split(":")[0]}:${o.split(":")[1]}`)};return n}function $M(t){return t.includes(":")}function Py(t){return $M(t)?t.split(":")[0]:t}const Fet={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}},jet={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 Ve(t,e){const{message:r,code:n}=jet[t];return{message:e?`${r} ${e}`:r,code:n}}function Bn(t,e){const{message:r,code:n}=Fet[t];return{message:e?`${r} ${e}`:r,code:n}}function eu(t,e){return Array.isArray(t)?typeof e<"u"&&t.length?t.every(e):!0:!1}function Pg(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function Ws(t){return typeof t>"u"}function Bi(t,e){return e&&Ws(t)?!0:typeof t=="string"&&!!t.trim().length}function NM(t,e){return e&&Ws(t)?!0:typeof t=="number"&&!isNaN(t)}function Uet(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let s=!0;return P0(i,n)?(n.forEach(o=>{const{accounts:a,methods:c,events:l}=t.namespaces[o],u=sv(a),f=r[o];(!P0(Yle(o,f),u)||!P0(f.methods,c)||!P0(f.events,l))&&(s=!1)}),s):!1}function y_(t){return Bi(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function zet(t){if(Bi(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&y_(r)}}return!1}function Het(t){if(Bi(t,!1))try{return typeof new URL(t)<"u"}catch{return!1}return!1}function qet(t){var e;return(e=t==null?void 0:t.proposer)==null?void 0:e.publicKey}function Wet(t){return t==null?void 0:t.topic}function Vet(t,e){let r=null;return Bi(t==null?void 0:t.publicKey,!1)||(r=Ve("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function vV(t){let e=!0;return eu(t)?t.length&&(e=t.every(r=>Bi(r,!1))):e=!1,e}function Get(t,e,r){let n=null;return eu(e)&&e.length?e.forEach(i=>{n||y_(i)||(n=Bn("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):y_(t)||(n=Bn("UNSUPPORTED_CHAINS",`${r}, 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"] }`)),n}function Ket(t,e,r){let n=null;return Object.entries(t).forEach(([i,s])=>{if(n)return;const o=Get(i,Yle(i,s),`${e} ${r}`);o&&(n=o)}),n}function Jet(t,e){let r=null;return eu(t)?t.forEach(n=>{r||zet(n)||(r=Bn("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=Bn("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function Qet(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=Jet(n==null?void 0:n.accounts,`${e} namespace`);i&&(r=i)}),r}function Yet(t,e){let r=null;return vV(t==null?void 0:t.methods)?vV(t==null?void 0:t.events)||(r=Bn("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=Bn("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function sue(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=Yet(n,`${e}, namespace`);i&&(r=i)}),r}function Zet(t,e,r){let n=null;if(t&&Pg(t)){const i=sue(t,e);i&&(n=i);const s=Ket(t,e,r);s&&(n=s)}else n=Ve("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function CE(t,e){let r=null;if(t&&Pg(t)){const n=sue(t,e);n&&(r=n);const i=Qet(t,e);i&&(r=i)}else r=Ve("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function oue(t){return Bi(t.protocol,!0)}function Xet(t,e){let r=!1;return e&&!t?r=!0:t&&eu(t)&&t.length&&t.forEach(n=>{r=oue(n)}),r}function ett(t){return typeof t=="number"}function go(t){return typeof t<"u"&&typeof t!==null}function ttt(t){return!(!t||typeof t!="object"||!t.code||!NM(t.code,!1)||!t.message||!Bi(t.message,!1))}function rtt(t){return!(Ws(t)||!Bi(t.method,!1))}function ntt(t){return!(Ws(t)||Ws(t.result)&&Ws(t.error)||!NM(t.id,!1)||!Bi(t.jsonrpc,!1))}function itt(t){return!(Ws(t)||!Bi(t.name,!1))}function yV(t,e){return!(!y_(e)||!Met(t).includes(e))}function stt(t,e,r){return Bi(r,!1)?Det(t,e).includes(r):!1}function ott(t,e,r){return Bi(r,!1)?Let(t,e).includes(r):!1}function bV(t,e,r){let n=null;const i=att(t),s=ctt(e),o=Object.keys(i),a=Object.keys(s),c=wV(Object.keys(t)),l=wV(Object.keys(e)),u=c.filter(f=>!l.includes(f));return u.length&&(n=Ve("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces. + Required: ${u.toString()} + Received: ${Object.keys(e).toString()}`)),P0(o,a)||(n=Ve("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces. + Required: ${o.toString()} + Approved: ${a.toString()}`)),Object.keys(e).forEach(f=>{if(!f.includes(":")||n)return;const d=sv(e[f].accounts);d.includes(f)||(n=Ve("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${f} + Required: ${f} + Approved: ${d.toString()}`))}),o.forEach(f=>{n||(P0(i[f].methods,s[f].methods)?P0(i[f].events,s[f].events)||(n=Ve("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${f}`)):n=Ve("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${f}`))}),n}function att(t){const e={};return Object.keys(t).forEach(r=>{var n;r.includes(":")?e[r]=t[r]:(n=t[r].chains)==null||n.forEach(i=>{e[i]={methods:t[r].methods,events:t[r].events}})}),e}function wV(t){return[...new Set(t.map(e=>e.includes(":")?e.split(":")[0]:e))]}function ctt(t){const e={};return Object.keys(t).forEach(r=>{if(r.includes(":"))e[r]=t[r];else{const n=sv(t[r].accounts);n==null||n.forEach(i=>{e[i]={accounts:t[r].accounts.filter(s=>s.includes(`${i}:`)),methods:t[r].methods,events:t[r].events}})}}),e}function ltt(t,e){return NM(t,!1)&&t<=e.max&&t>=e.min}function xV(){const t=Yw();return new Promise(e=>{switch(t){case ea.browser:e(utt());break;case ea.reactNative:e(ftt());break;case ea.node:e(dtt());break;default:e(!0)}})}function utt(){return iv()&&(navigator==null?void 0:navigator.onLine)}async function ftt(){if(nv()&&typeof global<"u"&&global!=null&&global.NetInfo){const t=await(global==null?void 0:global.NetInfo.fetch());return t==null?void 0:t.isConnected}return!0}function dtt(){return!0}function htt(t){switch(Yw()){case ea.browser:ptt(t);break;case ea.reactNative:gtt(t);break}}function ptt(t){!nv()&&iv()&&(window.addEventListener("online",()=>t(!0)),window.addEventListener("offline",()=>t(!1)))}function gtt(t){nv()&&typeof global<"u"&&global!=null&&global.NetInfo&&(global==null||global.NetInfo.addEventListener(e=>t(e==null?void 0:e.isConnected)))}const h7={};let m3=class{static get(e){return h7[e]}static set(e,r){h7[e]=r}static delete(e){delete h7[e]}};const mtt=/"(?:_|\\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*:/,vtt=/"(?: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*:/,ytt=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function btt(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){wtt(t);return}return e}function wtt(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function v3(t,e={}){if(typeof t!="string")return t;const r=t.trim();if(t[0]==='"'&&t.at(-1)==='"'&&!t.includes("\\"))return r.slice(1,-1);if(r.length<=9){const n=r.toLowerCase();if(n==="true")return!0;if(n==="false")return!1;if(n==="undefined")return;if(n==="null")return null;if(n==="nan")return Number.NaN;if(n==="infinity")return Number.POSITIVE_INFINITY;if(n==="-infinity")return Number.NEGATIVE_INFINITY}if(!ytt.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(mtt.test(t)||vtt.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,btt)}return JSON.parse(t)}catch(n){if(e.strict)throw n;return t}}function xtt(t){return!t||typeof t.then!="function"?Promise.resolve(t):t}function $i(t,...e){try{return xtt(t(...e))}catch(r){return Promise.reject(r)}}function Ett(t){const e=typeof t;return t===null||e!=="object"&&e!=="function"}function _tt(t){const e=Object.getPrototypeOf(t);return!e||e.isPrototypeOf(Object)}function SE(t){if(Ett(t))return String(t);if(_tt(t)||Array.isArray(t))return JSON.stringify(t);if(typeof t.toJSON=="function")return SE(t.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function aue(){if(typeof Buffer===void 0)throw new TypeError("[unstorage] Buffer is not supported!")}const mR="base64:";function Ctt(t){if(typeof t=="string")return t;aue();const e=Buffer.from(t).toString("base64");return mR+e}function Stt(t){return typeof t!="string"||!t.startsWith(mR)?t:(aue(),Buffer.from(t.slice(mR.length),"base64"))}function po(t){return t?t.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function Att(...t){return po(t.join(":"))}function y3(t){return t=po(t),t?t+":":""}const ktt="memory",Itt=()=>{const t=new Map;return{name:ktt,options:{},hasItem(e){return t.has(e)},getItem(e){return t.get(e)??null},getItemRaw(e){return t.get(e)??null},setItem(e,r){t.set(e,r)},setItemRaw(e,r){t.set(e,r)},removeItem(e){t.delete(e)},getKeys(){return Array.from(t.keys())},clear(){t.clear()},dispose(){t.clear()}}};function Ptt(t={}){const e={mounts:{"":t.driver||Itt()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=l=>{for(const u of e.mountpoints)if(l.startsWith(u))return{base:u,relativeKey:l.slice(u.length),driver:e.mounts[u]};return{base:"",relativeKey:l,driver:e.mounts[""]}},n=(l,u)=>e.mountpoints.filter(f=>f.startsWith(l)||u&&l.startsWith(f)).map(f=>({relativeBase:l.length>f.length?l.slice(f.length):void 0,mountpoint:f,driver:e.mounts[f]})),i=(l,u)=>{if(e.watching){u=po(u);for(const f of e.watchListeners)f(l,u)}},s=async()=>{if(!e.watching){e.watching=!0;for(const l in e.mounts)e.unwatch[l]=await EV(e.mounts[l],i,l)}},o=async()=>{if(e.watching){for(const l in e.unwatch)await e.unwatch[l]();e.unwatch={},e.watching=!1}},a=(l,u,f)=>{const d=new Map,p=g=>{let v=d.get(g.base);return v||(v={driver:g.driver,base:g.base,items:[]},d.set(g.base,v)),v};for(const g of l){const v=typeof g=="string",y=po(v?g:g.key),b=v?void 0:g.value,w=v||!g.options?u:{...u,...g.options},E=r(y);p(E).items.push({key:y,value:b,relativeKey:E.relativeKey,options:w})}return Promise.all([...d.values()].map(g=>f(g))).then(g=>g.flat())},c={hasItem(l,u={}){l=po(l);const{relativeKey:f,driver:d}=r(l);return $i(d.hasItem,f,u)},getItem(l,u={}){l=po(l);const{relativeKey:f,driver:d}=r(l);return $i(d.getItem,f,u).then(p=>v3(p))},getItems(l,u){return a(l,u,f=>f.driver.getItems?$i(f.driver.getItems,f.items.map(d=>({key:d.relativeKey,options:d.options})),u).then(d=>d.map(p=>({key:Att(f.base,p.key),value:v3(p.value)}))):Promise.all(f.items.map(d=>$i(f.driver.getItem,d.relativeKey,d.options).then(p=>({key:d.key,value:v3(p)})))))},getItemRaw(l,u={}){l=po(l);const{relativeKey:f,driver:d}=r(l);return d.getItemRaw?$i(d.getItemRaw,f,u):$i(d.getItem,f,u).then(p=>Stt(p))},async setItem(l,u,f={}){if(u===void 0)return c.removeItem(l);l=po(l);const{relativeKey:d,driver:p}=r(l);p.setItem&&(await $i(p.setItem,d,SE(u),f),p.watch||i("update",l))},async setItems(l,u){await a(l,u,async f=>{f.driver.setItems&&await $i(f.driver.setItems,f.items.map(d=>({key:d.relativeKey,value:SE(d.value),options:d.options})),u),f.driver.setItem&&await Promise.all(f.items.map(d=>$i(f.driver.setItem,d.relativeKey,SE(d.value),d.options)))})},async setItemRaw(l,u,f={}){if(u===void 0)return c.removeItem(l,f);l=po(l);const{relativeKey:d,driver:p}=r(l);if(p.setItemRaw)await $i(p.setItemRaw,d,u,f);else if(p.setItem)await $i(p.setItem,d,Ctt(u),f);else return;p.watch||i("update",l)},async removeItem(l,u={}){typeof u=="boolean"&&(u={removeMeta:u}),l=po(l);const{relativeKey:f,driver:d}=r(l);d.removeItem&&(await $i(d.removeItem,f,u),(u.removeMeta||u.removeMata)&&await $i(d.removeItem,f+"$",u),d.watch||i("remove",l))},async getMeta(l,u={}){typeof u=="boolean"&&(u={nativeOnly:u}),l=po(l);const{relativeKey:f,driver:d}=r(l),p=Object.create(null);if(d.getMeta&&Object.assign(p,await $i(d.getMeta,f,u)),!u.nativeOnly){const g=await $i(d.getItem,f+"$",u).then(v=>v3(v));g&&typeof g=="object"&&(typeof g.atime=="string"&&(g.atime=new Date(g.atime)),typeof g.mtime=="string"&&(g.mtime=new Date(g.mtime)),Object.assign(p,g))}return p},setMeta(l,u,f={}){return this.setItem(l+"$",u,f)},removeMeta(l,u={}){return this.removeItem(l+"$",u)},async getKeys(l,u={}){l=y3(l);const f=n(l,!0);let d=[];const p=[];for(const g of f){const y=(await $i(g.driver.getKeys,g.relativeBase,u)).map(b=>g.mountpoint+po(b)).filter(b=>!d.some(w=>b.startsWith(w)));p.push(...y),d=[g.mountpoint,...d.filter(b=>!b.startsWith(g.mountpoint))]}return l?p.filter(g=>g.startsWith(l)&&!g.endsWith("$")):p.filter(g=>!g.endsWith("$"))},async clear(l,u={}){l=y3(l),await Promise.all(n(l,!1).map(async f=>{if(f.driver.clear)return $i(f.driver.clear,f.relativeBase,u);if(f.driver.removeItem){const d=await f.driver.getKeys(f.relativeBase||"",u);return Promise.all(d.map(p=>f.driver.removeItem(p,u)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(l=>_V(l)))},async watch(l){return await s(),e.watchListeners.push(l),async()=>{e.watchListeners=e.watchListeners.filter(u=>u!==l),e.watchListeners.length===0&&await o()}},async unwatch(){e.watchListeners=[],await o()},mount(l,u){if(l=y3(l),l&&e.mounts[l])throw new Error(`already mounted at ${l}`);return l&&(e.mountpoints.push(l),e.mountpoints.sort((f,d)=>d.length-f.length)),e.mounts[l]=u,e.watching&&Promise.resolve(EV(u,i,l)).then(f=>{e.unwatch[l]=f}).catch(console.error),c},async unmount(l,u=!0){l=y3(l),!(!l||!e.mounts[l])&&(e.watching&&l in e.unwatch&&(e.unwatch[l](),delete e.unwatch[l]),u&&await _V(e.mounts[l]),e.mountpoints=e.mountpoints.filter(f=>f!==l),delete e.mounts[l])},getMount(l=""){l=po(l)+":";const u=r(l);return{driver:u.driver,base:u.base}},getMounts(l="",u={}){return l=po(l),n(l,u.parents).map(d=>({driver:d.driver,base:d.mountpoint}))}};return c}function EV(t,e,r){return t.watch?t.watch((n,i)=>e(n,r+i)):()=>{}}async function _V(t){typeof t.dispose=="function"&&await $i(t.dispose)}function T1(t){return new Promise((e,r)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>r(t.error)})}function cue(t,e){const r=indexedDB.open(t);r.onupgradeneeded=()=>r.result.createObjectStore(e);const n=T1(r);return(i,s)=>n.then(o=>s(o.transaction(e,i).objectStore(e)))}let p7;function Zw(){return p7||(p7=cue("keyval-store","keyval")),p7}function CV(t,e=Zw()){return e("readonly",r=>T1(r.get(t)))}function Rtt(t,e,r=Zw()){return r("readwrite",n=>(n.put(e,t),T1(n.transaction)))}function Ttt(t,e=Zw()){return e("readwrite",r=>(r.delete(t),T1(r.transaction)))}function Ott(t=Zw()){return t("readwrite",e=>(e.clear(),T1(e.transaction)))}function $tt(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},T1(t.transaction)}function Ntt(t=Zw()){return t("readonly",e=>{if(e.getAllKeys)return T1(e.getAllKeys());const r=[];return $tt(e,n=>r.push(n.key)).then(()=>r)})}const Mtt=t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r),Dtt=t=>{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,r=t.replace(e,'$1"$2n"$3');return JSON.parse(r,(n,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function Xw(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return Dtt(t)}catch{return t}}function a1(t){return typeof t=="string"?t:Mtt(t)||""}const Ltt="idb-keyval";var Btt=(t={})=>{const e=t.base&&t.base.length>0?`${t.base}:`:"",r=i=>e+i;let n;return t.dbName&&t.storeName&&(n=cue(t.dbName,t.storeName)),{name:Ltt,options:t,async hasItem(i){return!(typeof await CV(r(i),n)>"u")},async getItem(i){return await CV(r(i),n)??null},setItem(i,s){return Rtt(r(i),s,n)},removeItem(i){return Ttt(r(i),n)},getKeys(){return Ntt(n)},clear(){return Ott(n)}}};const Ftt="WALLET_CONNECT_V2_INDEXED_DB",jtt="keyvaluestorage";let Utt=class{constructor(){this.indexedDb=Ptt({driver:Btt({dbName:Ftt,storeName:jtt})})}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 r=await this.indexedDb.getItem(e);if(r!==null)return r}async setItem(e,r){await this.indexedDb.setItem(e,a1(r))}async removeItem(e){await this.indexedDb.removeItem(e)}};var g7=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},AE={exports:{}};(function(){let t;function e(){}t=e,t.prototype.getItem=function(r){return this.hasOwnProperty(r)?String(this[r]):null},t.prototype.setItem=function(r,n){this[r]=String(n)},t.prototype.removeItem=function(r){delete this[r]},t.prototype.clear=function(){const r=this;Object.keys(r).forEach(function(n){r[n]=void 0,delete r[n]})},t.prototype.key=function(r){return r=r||0,Object.keys(this)[r]},t.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof g7<"u"&&g7.localStorage?AE.exports=g7.localStorage:typeof window<"u"&&window.localStorage?AE.exports=window.localStorage:AE.exports=new e})();function ztt(t){var e;return[t[0],Xw((e=t[1])!=null?e:"")]}class Htt{constructor(){this.localStorage=AE.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(ztt)}async getItem(e){const r=this.localStorage.getItem(e);if(r!==null)return Xw(r)}async setItem(e,r){this.localStorage.setItem(e,a1(r))}async removeItem(e){this.localStorage.removeItem(e)}}const qtt="wc_storage_version",SV=1,Wtt=async(t,e,r)=>{const n=qtt,i=await e.getItem(n);if(i&&i>=SV){r(e);return}const s=await t.getKeys();if(!s.length){r(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 l=await t.getItem(a);await e.setItem(a,l),o.push(a)}}await e.setItem(n,SV),r(e),Vtt(t,o)},Vtt=async(t,e)=>{e.length&&e.forEach(async r=>{await t.removeItem(r)})};let Gtt=class{constructor(){this.initialized=!1,this.setInitialized=r=>{this.storage=r,this.initialized=!0};const e=new Htt;this.storage=e;try{const r=new Utt;Wtt(e,r,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,r){return await this.initialize(),this.storage.setItem(e,r)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{const r=setInterval(()=>{this.initialized&&(clearInterval(r),e())},20)})}};var ov={},uy={},m7={},fy={};let O1=class{};const Ktt=Object.freeze(Object.defineProperty({__proto__:null,IEvents:O1},Symbol.toStringTag,{value:"Module"})),Jtt=wf(Ktt);var AV;function Qtt(){if(AV)return fy;AV=1,Object.defineProperty(fy,"__esModule",{value:!0}),fy.IHeartBeat=void 0;const t=Jtt;class e extends t.IEvents{constructor(n){super()}}return fy.IHeartBeat=e,fy}var kV;function lue(){return kV||(kV=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),iu.__exportStar(Qtt(),t)}(m7)),m7}var v7={},r0={},IV;function Ytt(){if(IV)return r0;IV=1,Object.defineProperty(r0,"__esModule",{value:!0}),r0.HEARTBEAT_EVENTS=r0.HEARTBEAT_INTERVAL=void 0;const t=lt;return r0.HEARTBEAT_INTERVAL=t.FIVE_SECONDS,r0.HEARTBEAT_EVENTS={pulse:"heartbeat_pulse"},r0}var PV;function uue(){return PV||(PV=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),iu.__exportStar(Ytt(),t)}(v7)),v7}var RV;function Ztt(){if(RV)return uy;RV=1,Object.defineProperty(uy,"__esModule",{value:!0}),uy.HeartBeat=void 0;const t=iu,e=is,r=lt,n=lue(),i=uue();class s extends n.IHeartBeat{constructor(a){super(a),this.events=new e.EventEmitter,this.interval=i.HEARTBEAT_INTERVAL,this.interval=(a==null?void 0:a.interval)||i.HEARTBEAT_INTERVAL}static init(a){return t.__awaiter(this,void 0,void 0,function*(){const c=new s(a);return yield c.init(),c})}init(){return t.__awaiter(this,void 0,void 0,function*(){yield this.initialize()})}stop(){clearInterval(this.intervalRef)}on(a,c){this.events.on(a,c)}once(a,c){this.events.once(a,c)}off(a,c){this.events.off(a,c)}removeListener(a,c){this.events.removeListener(a,c)}initialize(){return t.__awaiter(this,void 0,void 0,function*(){this.intervalRef=setInterval(()=>this.pulse(),r.toMiliseconds(this.interval))})}pulse(){this.events.emit(i.HEARTBEAT_EVENTS.pulse)}}return uy.HeartBeat=s,uy}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=iu;e.__exportStar(Ztt(),t),e.__exportStar(lue(),t),e.__exportStar(uue(),t)})(ov);var cr={},y7,TV;function Xtt(){if(TV)return y7;TV=1;function t(r){try{return JSON.stringify(r)}catch{return'"[Circular]"'}}y7=e;function e(r,n,i){var s=i&&i.stringify||t,o=1;if(typeof r=="object"&&r!==null){var a=n.length+o;if(a===1)return r;var c=new Array(a);c[0]=s(r);for(var l=1;l-1?p:0,r.charCodeAt(v+1)){case 100:case 102:if(d>=u||n[d]==null)break;p=u||n[d]==null)break;p=u||n[d]===void 0)break;p",p=v+2,v++;break}f+=s(n[d]),p=v+2,v++;break;case 115:if(d>=u)break;p-1&&(ne=!1);const ce=["error","fatal","warn","info","debug","trace"];typeof T=="function"&&(T.error=T.fatal=T.warn=T.info=T.debug=T.trace=T),P.enabled===!1&&(P.level="silent");const K=P.level||"info",x=Object.create(T);x.log||(x.log=y),Object.defineProperty(x,"levelVal",{get:B}),Object.defineProperty(x,"level",{get:z,set:R});const A={transmit:_,serialize:Z,asObject:P.browser.asObject,levels:ce,timestamp:p(P)};x.levels=i.levels,x.level=K,x.setMaxListeners=x.getMaxListeners=x.emit=x.addListener=x.on=x.prependListener=x.once=x.prependOnceListener=x.removeListener=x.removeAllListeners=x.listeners=x.listenerCount=x.eventNames=x.write=x.flush=y,x.serializers=Q,x._serialize=Z,x._stdErrSerialize=ne,x.child=L,_&&(x._logEvent=f());function B(){return this.level==="silent"?1/0:this.levels.values[this.level]}function z(){return this._level}function R(q){if(q!=="silent"&&!this.levels.values[q])throw Error("unknown level "+q);this._level=q,s(A,x,"error","log"),s(A,x,"fatal","error"),s(A,x,"warn","error"),s(A,x,"info","log"),s(A,x,"debug","log"),s(A,x,"trace","log")}function L(q,N){if(!q)throw new Error("missing bindings for child Pino");N=N||{},Z&&q.serializers&&(N.serializers=q.serializers);const I=N.serializers;if(Z&&I){var U=Object.assign({},Q,I),re=P.browser.serialize===!0?Object.keys(U):Z;delete q.serializers,c([q],re,U,this._stdErrSerialize)}function M(G){this._childLevel=(G._childLevel|0)+1,this.error=l(G,q,"error"),this.fatal=l(G,q,"fatal"),this.warn=l(G,q,"warn"),this.info=l(G,q,"info"),this.debug=l(G,q,"debug"),this.trace=l(G,q,"trace"),U&&(this.serializers=U,this._serialize=re),_&&(this._logEvent=f([].concat(G._logEvent.bindings,q)))}return M.prototype=this,new M(this)}return x}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=r,i.stdTimeFunctions=Object.assign({},{nullTime:b,epochTime:w,unixTime:E,isoTime:C});function s(P,_,T,Q){const Z=Object.getPrototypeOf(_);_[T]=_.levelVal>_.levels.values[T]?y:Z[T]?Z[T]:e[T]||e[Q]||y,o(P,_,T)}function o(P,_,T){!P.transmit&&_[T]===y||(_[T]=function(Q){return function(){const ne=P.timestamp(),ce=new Array(arguments.length),K=Object.getPrototypeOf&&Object.getPrototypeOf(this)===e?e:this;for(var x=0;x-1&&ne in T&&(P[Z][ne]=T[ne](P[Z][ne]))}function l(P,_,T){return function(){const Q=new Array(1+arguments.length);Q[0]=_;for(var Z=1;Z"u"?l=r(a,c):l=a.bindings().context||"",l}Bs.getLoggerContext=i;function s(a,c,l=t.PINO_CUSTOM_CONTEXT_KEY){const u=i(a,l);return u.trim()?`${u}/${c}`:c}Bs.formatChildLoggerContext=s;function o(a,c,l=t.PINO_CUSTOM_CONTEXT_KEY){const u=s(a,c,l),f=a.child({context:u});return n(f,u,l)}return Bs.generateChildLogger=o,Bs}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.pino=void 0;const e=iu,r=e.__importDefault(ert());Object.defineProperty(t,"pino",{enumerable:!0,get:function(){return r.default}}),e.__exportStar(fue(),t),e.__exportStar(trt(),t)})(cr);let rrt=class extends O1{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}},nrt=class extends O1{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}},irt=class{constructor(e,r){this.logger=e,this.core=r}},srt=class extends O1{constructor(e,r){super(),this.relayer=e,this.logger=r}},ort=class extends O1{constructor(e){super()}},art=class{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}};class crt extends O1{constructor(e,r){super(),this.relayer=e,this.logger=r}}let lrt=class extends O1{constructor(e,r){super(),this.core=e,this.logger=r}},urt=class{constructor(e,r){this.projectId=e,this.logger=r}},frt=class{constructor(e,r){this.projectId=e,this.logger=r}},drt=class{constructor(e){this.opts=e,this.protocol="wc",this.version=2}},hrt=class{constructor(e){this.client=e}};var MM={},due={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Gt,r=ha;t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var n=function(){function a(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return a.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},a.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},a.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._tempHi),r.wipe(this._tempLo),this.reset()},a.prototype.update=function(c,l){if(l===void 0&&(l=c.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var u=0;if(this._bytesHashed+=l,this._bufferLength>0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=c[u++],l--;this._bufferLength===this.blockSize&&(s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(l>=this.blockSize&&(u=s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,c,u,l),l%=this.blockSize);l>0;)this._buffer[this._bufferLength++]=c[u++],l--;return this},a.prototype.finish=function(c){if(!this._finished){var l=this._bytesHashed,u=this._bufferLength,f=l/536870912|0,d=l<<3,p=l%128<112?128:256;this._buffer[u]=128;for(var g=u+1;g0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},a.prototype.restoreState=function(c){return this._stateHi.set(c.stateHi),this._stateLo.set(c.stateLo),this._bufferLength=c.bufferLength,c.buffer&&this._buffer.set(c.buffer),this._bytesHashed=c.bytesHashed,this._finished=!1,this},a.prototype.cleanSavedState=function(c){r.wipe(c.stateHi),r.wipe(c.stateLo),c.buffer&&r.wipe(c.buffer),c.bufferLength=0,c.bytesHashed=0},a}();t.SHA512=n;var i=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function s(a,c,l,u,f,d,p){for(var g=l[0],v=l[1],y=l[2],b=l[3],w=l[4],E=l[5],C=l[6],S=l[7],P=u[0],_=u[1],T=u[2],Q=u[3],Z=u[4],ne=u[5],ce=u[6],K=u[7],x,A,B,z,R,L,q,N;p>=128;){for(var I=0;I<16;I++){var U=8*I+d;a[I]=e.readUint32BE(f,U),c[I]=e.readUint32BE(f,U+4)}for(var I=0;I<80;I++){var re=g,M=v,G=y,H=b,J=w,X=E,D=C,F=S,Y=P,ue=_,he=T,Ce=Q,Me=Z,Oe=ne,We=ce,ot=K;if(x=S,A=K,R=A&65535,L=A>>>16,q=x&65535,N=x>>>16,x=(w>>>14|Z<<32-14)^(w>>>18|Z<<32-18)^(Z>>>41-32|w<<32-(41-32)),A=(Z>>>14|w<<32-14)^(Z>>>18|w<<32-18)^(w>>>41-32|Z<<32-(41-32)),R+=A&65535,L+=A>>>16,q+=x&65535,N+=x>>>16,x=w&E^~w&C,A=Z&ne^~Z&ce,R+=A&65535,L+=A>>>16,q+=x&65535,N+=x>>>16,x=i[I*2],A=i[I*2+1],R+=A&65535,L+=A>>>16,q+=x&65535,N+=x>>>16,x=a[I%16],A=c[I%16],R+=A&65535,L+=A>>>16,q+=x&65535,N+=x>>>16,L+=R>>>16,q+=L>>>16,N+=q>>>16,B=q&65535|N<<16,z=R&65535|L<<16,x=B,A=z,R=A&65535,L=A>>>16,q=x&65535,N=x>>>16,x=(g>>>28|P<<32-28)^(P>>>34-32|g<<32-(34-32))^(P>>>39-32|g<<32-(39-32)),A=(P>>>28|g<<32-28)^(g>>>34-32|P<<32-(34-32))^(g>>>39-32|P<<32-(39-32)),R+=A&65535,L+=A>>>16,q+=x&65535,N+=x>>>16,x=g&v^g&y^v&y,A=P&_^P&T^_&T,R+=A&65535,L+=A>>>16,q+=x&65535,N+=x>>>16,L+=R>>>16,q+=L>>>16,N+=q>>>16,F=q&65535|N<<16,ot=R&65535|L<<16,x=H,A=Ce,R=A&65535,L=A>>>16,q=x&65535,N=x>>>16,x=B,A=z,R+=A&65535,L+=A>>>16,q+=x&65535,N+=x>>>16,L+=R>>>16,q+=L>>>16,N+=q>>>16,H=q&65535|N<<16,Ce=R&65535|L<<16,v=re,y=M,b=G,w=H,E=J,C=X,S=D,g=F,_=Y,T=ue,Q=he,Z=Ce,ne=Me,ce=Oe,K=We,P=ot,I%16===15)for(var U=0;U<16;U++)x=a[U],A=c[U],R=A&65535,L=A>>>16,q=x&65535,N=x>>>16,x=a[(U+9)%16],A=c[(U+9)%16],R+=A&65535,L+=A>>>16,q+=x&65535,N+=x>>>16,B=a[(U+1)%16],z=c[(U+1)%16],x=(B>>>1|z<<32-1)^(B>>>8|z<<32-8)^B>>>7,A=(z>>>1|B<<32-1)^(z>>>8|B<<32-8)^(z>>>7|B<<32-7),R+=A&65535,L+=A>>>16,q+=x&65535,N+=x>>>16,B=a[(U+14)%16],z=c[(U+14)%16],x=(B>>>19|z<<32-19)^(z>>>61-32|B<<32-(61-32))^B>>>6,A=(z>>>19|B<<32-19)^(B>>>61-32|z<<32-(61-32))^(z>>>6|B<<32-6),R+=A&65535,L+=A>>>16,q+=x&65535,N+=x>>>16,L+=R>>>16,q+=L>>>16,N+=q>>>16,a[U]=q&65535|N<<16,c[U]=R&65535|L<<16}x=g,A=P,R=A&65535,L=A>>>16,q=x&65535,N=x>>>16,x=l[0],A=u[0],R+=A&65535,L+=A>>>16,q+=x&65535,N+=x>>>16,L+=R>>>16,q+=L>>>16,N+=q>>>16,l[0]=g=q&65535|N<<16,u[0]=P=R&65535|L<<16,x=v,A=_,R=A&65535,L=A>>>16,q=x&65535,N=x>>>16,x=l[1],A=u[1],R+=A&65535,L+=A>>>16,q+=x&65535,N+=x>>>16,L+=R>>>16,q+=L>>>16,N+=q>>>16,l[1]=v=q&65535|N<<16,u[1]=_=R&65535|L<<16,x=y,A=T,R=A&65535,L=A>>>16,q=x&65535,N=x>>>16,x=l[2],A=u[2],R+=A&65535,L+=A>>>16,q+=x&65535,N+=x>>>16,L+=R>>>16,q+=L>>>16,N+=q>>>16,l[2]=y=q&65535|N<<16,u[2]=T=R&65535|L<<16,x=b,A=Q,R=A&65535,L=A>>>16,q=x&65535,N=x>>>16,x=l[3],A=u[3],R+=A&65535,L+=A>>>16,q+=x&65535,N+=x>>>16,L+=R>>>16,q+=L>>>16,N+=q>>>16,l[3]=b=q&65535|N<<16,u[3]=Q=R&65535|L<<16,x=w,A=Z,R=A&65535,L=A>>>16,q=x&65535,N=x>>>16,x=l[4],A=u[4],R+=A&65535,L+=A>>>16,q+=x&65535,N+=x>>>16,L+=R>>>16,q+=L>>>16,N+=q>>>16,l[4]=w=q&65535|N<<16,u[4]=Z=R&65535|L<<16,x=E,A=ne,R=A&65535,L=A>>>16,q=x&65535,N=x>>>16,x=l[5],A=u[5],R+=A&65535,L+=A>>>16,q+=x&65535,N+=x>>>16,L+=R>>>16,q+=L>>>16,N+=q>>>16,l[5]=E=q&65535|N<<16,u[5]=ne=R&65535|L<<16,x=C,A=ce,R=A&65535,L=A>>>16,q=x&65535,N=x>>>16,x=l[6],A=u[6],R+=A&65535,L+=A>>>16,q+=x&65535,N+=x>>>16,L+=R>>>16,q+=L>>>16,N+=q>>>16,l[6]=C=q&65535|N<<16,u[6]=ce=R&65535|L<<16,x=S,A=K,R=A&65535,L=A>>>16,q=x&65535,N=x>>>16,x=l[7],A=u[7],R+=A&65535,L+=A>>>16,q+=x&65535,N+=x>>>16,L+=R>>>16,q+=L>>>16,N+=q>>>16,l[7]=S=q&65535|N<<16,u[7]=K=R&65535|L<<16,d+=128,p-=128}return d}function o(a){var c=new n;c.update(a);var l=c.digest();return c.clean(),l}t.hash=o})(due);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.convertSecretKeyToX25519=t.convertPublicKeyToX25519=t.verify=t.sign=t.extractPublicKeyFromSecretKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.SEED_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=t.SIGNATURE_LENGTH=void 0;const e=tv,r=due,n=ha;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function i(H){const J=new Float64Array(16);if(H)for(let X=0;X>16&1),X[ue-1]&=65535;X[15]=D[15]-32767-(X[14]>>16&1);const Y=X[15]>>16&1;X[14]&=65535,v(D,X,1-Y)}for(let F=0;F<16;F++)H[2*F]=D[F]&255,H[2*F+1]=D[F]>>8}function b(H,J){let X=0;for(let D=0;D<32;D++)X|=H[D]^J[D];return(1&X-1>>>8)-1}function w(H,J){const X=new Uint8Array(32),D=new Uint8Array(32);return y(X,H),y(D,J),b(X,D)}function E(H){const J=new Uint8Array(32);return y(J,H),J[0]&1}function C(H,J){for(let X=0;X<16;X++)H[X]=J[2*X]+(J[2*X+1]<<8);H[15]&=32767}function S(H,J,X){for(let D=0;D<16;D++)H[D]=J[D]+X[D]}function P(H,J,X){for(let D=0;D<16;D++)H[D]=J[D]-X[D]}function _(H,J,X){let D,F,Y=0,ue=0,he=0,Ce=0,Me=0,Oe=0,We=0,ot=0,ze=0,Le=0,et=0,He=0,Ge=0,Ye=0,qe=0,ee=0,j=0,W=0,ie=0,de=0,pe=0,be=0,je=0,Fe=0,Qe=0,kt=0,Ze=0,$t=0,Wn=0,Xt=0,rr=0,gr=X[0],dt=X[1],yt=X[2],mr=X[3],vt=X[4],ht=X[5],kr=X[6],_t=X[7],bt=X[8],Ir=X[9],wt=X[10],xt=X[11],vr=X[12],ft=X[13],Ct=X[14],Pr=X[15];D=J[0],Y+=D*gr,ue+=D*dt,he+=D*yt,Ce+=D*mr,Me+=D*vt,Oe+=D*ht,We+=D*kr,ot+=D*_t,ze+=D*bt,Le+=D*Ir,et+=D*wt,He+=D*xt,Ge+=D*vr,Ye+=D*ft,qe+=D*Ct,ee+=D*Pr,D=J[1],ue+=D*gr,he+=D*dt,Ce+=D*yt,Me+=D*mr,Oe+=D*vt,We+=D*ht,ot+=D*kr,ze+=D*_t,Le+=D*bt,et+=D*Ir,He+=D*wt,Ge+=D*xt,Ye+=D*vr,qe+=D*ft,ee+=D*Ct,j+=D*Pr,D=J[2],he+=D*gr,Ce+=D*dt,Me+=D*yt,Oe+=D*mr,We+=D*vt,ot+=D*ht,ze+=D*kr,Le+=D*_t,et+=D*bt,He+=D*Ir,Ge+=D*wt,Ye+=D*xt,qe+=D*vr,ee+=D*ft,j+=D*Ct,W+=D*Pr,D=J[3],Ce+=D*gr,Me+=D*dt,Oe+=D*yt,We+=D*mr,ot+=D*vt,ze+=D*ht,Le+=D*kr,et+=D*_t,He+=D*bt,Ge+=D*Ir,Ye+=D*wt,qe+=D*xt,ee+=D*vr,j+=D*ft,W+=D*Ct,ie+=D*Pr,D=J[4],Me+=D*gr,Oe+=D*dt,We+=D*yt,ot+=D*mr,ze+=D*vt,Le+=D*ht,et+=D*kr,He+=D*_t,Ge+=D*bt,Ye+=D*Ir,qe+=D*wt,ee+=D*xt,j+=D*vr,W+=D*ft,ie+=D*Ct,de+=D*Pr,D=J[5],Oe+=D*gr,We+=D*dt,ot+=D*yt,ze+=D*mr,Le+=D*vt,et+=D*ht,He+=D*kr,Ge+=D*_t,Ye+=D*bt,qe+=D*Ir,ee+=D*wt,j+=D*xt,W+=D*vr,ie+=D*ft,de+=D*Ct,pe+=D*Pr,D=J[6],We+=D*gr,ot+=D*dt,ze+=D*yt,Le+=D*mr,et+=D*vt,He+=D*ht,Ge+=D*kr,Ye+=D*_t,qe+=D*bt,ee+=D*Ir,j+=D*wt,W+=D*xt,ie+=D*vr,de+=D*ft,pe+=D*Ct,be+=D*Pr,D=J[7],ot+=D*gr,ze+=D*dt,Le+=D*yt,et+=D*mr,He+=D*vt,Ge+=D*ht,Ye+=D*kr,qe+=D*_t,ee+=D*bt,j+=D*Ir,W+=D*wt,ie+=D*xt,de+=D*vr,pe+=D*ft,be+=D*Ct,je+=D*Pr,D=J[8],ze+=D*gr,Le+=D*dt,et+=D*yt,He+=D*mr,Ge+=D*vt,Ye+=D*ht,qe+=D*kr,ee+=D*_t,j+=D*bt,W+=D*Ir,ie+=D*wt,de+=D*xt,pe+=D*vr,be+=D*ft,je+=D*Ct,Fe+=D*Pr,D=J[9],Le+=D*gr,et+=D*dt,He+=D*yt,Ge+=D*mr,Ye+=D*vt,qe+=D*ht,ee+=D*kr,j+=D*_t,W+=D*bt,ie+=D*Ir,de+=D*wt,pe+=D*xt,be+=D*vr,je+=D*ft,Fe+=D*Ct,Qe+=D*Pr,D=J[10],et+=D*gr,He+=D*dt,Ge+=D*yt,Ye+=D*mr,qe+=D*vt,ee+=D*ht,j+=D*kr,W+=D*_t,ie+=D*bt,de+=D*Ir,pe+=D*wt,be+=D*xt,je+=D*vr,Fe+=D*ft,Qe+=D*Ct,kt+=D*Pr,D=J[11],He+=D*gr,Ge+=D*dt,Ye+=D*yt,qe+=D*mr,ee+=D*vt,j+=D*ht,W+=D*kr,ie+=D*_t,de+=D*bt,pe+=D*Ir,be+=D*wt,je+=D*xt,Fe+=D*vr,Qe+=D*ft,kt+=D*Ct,Ze+=D*Pr,D=J[12],Ge+=D*gr,Ye+=D*dt,qe+=D*yt,ee+=D*mr,j+=D*vt,W+=D*ht,ie+=D*kr,de+=D*_t,pe+=D*bt,be+=D*Ir,je+=D*wt,Fe+=D*xt,Qe+=D*vr,kt+=D*ft,Ze+=D*Ct,$t+=D*Pr,D=J[13],Ye+=D*gr,qe+=D*dt,ee+=D*yt,j+=D*mr,W+=D*vt,ie+=D*ht,de+=D*kr,pe+=D*_t,be+=D*bt,je+=D*Ir,Fe+=D*wt,Qe+=D*xt,kt+=D*vr,Ze+=D*ft,$t+=D*Ct,Wn+=D*Pr,D=J[14],qe+=D*gr,ee+=D*dt,j+=D*yt,W+=D*mr,ie+=D*vt,de+=D*ht,pe+=D*kr,be+=D*_t,je+=D*bt,Fe+=D*Ir,Qe+=D*wt,kt+=D*xt,Ze+=D*vr,$t+=D*ft,Wn+=D*Ct,Xt+=D*Pr,D=J[15],ee+=D*gr,j+=D*dt,W+=D*yt,ie+=D*mr,de+=D*vt,pe+=D*ht,be+=D*kr,je+=D*_t,Fe+=D*bt,Qe+=D*Ir,kt+=D*wt,Ze+=D*xt,$t+=D*vr,Wn+=D*ft,Xt+=D*Ct,rr+=D*Pr,Y+=38*j,ue+=38*W,he+=38*ie,Ce+=38*de,Me+=38*pe,Oe+=38*be,We+=38*je,ot+=38*Fe,ze+=38*Qe,Le+=38*kt,et+=38*Ze,He+=38*$t,Ge+=38*Wn,Ye+=38*Xt,qe+=38*rr,F=1,D=Y+F+65535,F=Math.floor(D/65536),Y=D-F*65536,D=ue+F+65535,F=Math.floor(D/65536),ue=D-F*65536,D=he+F+65535,F=Math.floor(D/65536),he=D-F*65536,D=Ce+F+65535,F=Math.floor(D/65536),Ce=D-F*65536,D=Me+F+65535,F=Math.floor(D/65536),Me=D-F*65536,D=Oe+F+65535,F=Math.floor(D/65536),Oe=D-F*65536,D=We+F+65535,F=Math.floor(D/65536),We=D-F*65536,D=ot+F+65535,F=Math.floor(D/65536),ot=D-F*65536,D=ze+F+65535,F=Math.floor(D/65536),ze=D-F*65536,D=Le+F+65535,F=Math.floor(D/65536),Le=D-F*65536,D=et+F+65535,F=Math.floor(D/65536),et=D-F*65536,D=He+F+65535,F=Math.floor(D/65536),He=D-F*65536,D=Ge+F+65535,F=Math.floor(D/65536),Ge=D-F*65536,D=Ye+F+65535,F=Math.floor(D/65536),Ye=D-F*65536,D=qe+F+65535,F=Math.floor(D/65536),qe=D-F*65536,D=ee+F+65535,F=Math.floor(D/65536),ee=D-F*65536,Y+=F-1+37*(F-1),F=1,D=Y+F+65535,F=Math.floor(D/65536),Y=D-F*65536,D=ue+F+65535,F=Math.floor(D/65536),ue=D-F*65536,D=he+F+65535,F=Math.floor(D/65536),he=D-F*65536,D=Ce+F+65535,F=Math.floor(D/65536),Ce=D-F*65536,D=Me+F+65535,F=Math.floor(D/65536),Me=D-F*65536,D=Oe+F+65535,F=Math.floor(D/65536),Oe=D-F*65536,D=We+F+65535,F=Math.floor(D/65536),We=D-F*65536,D=ot+F+65535,F=Math.floor(D/65536),ot=D-F*65536,D=ze+F+65535,F=Math.floor(D/65536),ze=D-F*65536,D=Le+F+65535,F=Math.floor(D/65536),Le=D-F*65536,D=et+F+65535,F=Math.floor(D/65536),et=D-F*65536,D=He+F+65535,F=Math.floor(D/65536),He=D-F*65536,D=Ge+F+65535,F=Math.floor(D/65536),Ge=D-F*65536,D=Ye+F+65535,F=Math.floor(D/65536),Ye=D-F*65536,D=qe+F+65535,F=Math.floor(D/65536),qe=D-F*65536,D=ee+F+65535,F=Math.floor(D/65536),ee=D-F*65536,Y+=F-1+37*(F-1),H[0]=Y,H[1]=ue,H[2]=he,H[3]=Ce,H[4]=Me,H[5]=Oe,H[6]=We,H[7]=ot,H[8]=ze,H[9]=Le,H[10]=et,H[11]=He,H[12]=Ge,H[13]=Ye,H[14]=qe,H[15]=ee}function T(H,J){_(H,J,J)}function Q(H,J){const X=i();let D;for(D=0;D<16;D++)X[D]=J[D];for(D=253;D>=0;D--)T(X,X),D!==2&&D!==4&&_(X,X,J);for(D=0;D<16;D++)H[D]=X[D]}function Z(H,J){const X=i();let D;for(D=0;D<16;D++)X[D]=J[D];for(D=250;D>=0;D--)T(X,X),D!==1&&_(X,X,J);for(D=0;D<16;D++)H[D]=X[D]}function ne(H,J){const X=i(),D=i(),F=i(),Y=i(),ue=i(),he=i(),Ce=i(),Me=i(),Oe=i();P(X,H[1],H[0]),P(Oe,J[1],J[0]),_(X,X,Oe),S(D,H[0],H[1]),S(Oe,J[0],J[1]),_(D,D,Oe),_(F,H[3],J[3]),_(F,F,l),_(Y,H[2],J[2]),S(Y,Y,Y),P(ue,D,X),P(he,Y,F),S(Ce,Y,F),S(Me,D,X),_(H[0],ue,he),_(H[1],Me,Ce),_(H[2],Ce,he),_(H[3],ue,Me)}function ce(H,J,X){for(let D=0;D<4;D++)v(H[D],J[D],X)}function K(H,J){const X=i(),D=i(),F=i();Q(F,J[2]),_(X,J[0],F),_(D,J[1],F),y(H,D),H[31]^=E(X)<<7}function x(H,J,X){p(H[0],o),p(H[1],a),p(H[2],a),p(H[3],o);for(let D=255;D>=0;--D){const F=X[D/8|0]>>(D&7)&1;ce(H,J,F),ne(J,H),ne(H,H),ce(H,J,F)}}function A(H,J){const X=[i(),i(),i(),i()];p(X[0],u),p(X[1],f),p(X[2],a),_(X[3],u,f),x(H,X,J)}function B(H){if(H.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const J=(0,r.hash)(H);J[0]&=248,J[31]&=127,J[31]|=64;const X=new Uint8Array(32),D=[i(),i(),i(),i()];A(D,J),K(X,D);const F=new Uint8Array(64);return F.set(H),F.set(X,32),{publicKey:X,secretKey:F}}t.generateKeyPairFromSeed=B;function z(H){const J=(0,e.randomBytes)(32,H),X=B(J);return(0,n.wipe)(J),X}t.generateKeyPair=z;function R(H){if(H.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(H.subarray(32))}t.extractPublicKeyFromSecretKey=R;const L=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function q(H,J){let X,D,F,Y;for(D=63;D>=32;--D){for(X=0,F=D-32,Y=D-12;F>4)*L[F],X=J[F]>>8,J[F]&=255;for(F=0;F<32;F++)J[F]-=X*L[F];for(D=0;D<32;D++)J[D+1]+=J[D]>>8,H[D]=J[D]&255}function N(H){const J=new Float64Array(64);for(let X=0;X<64;X++)J[X]=H[X];for(let X=0;X<64;X++)H[X]=0;q(H,J)}function I(H,J){const X=new Float64Array(64),D=[i(),i(),i(),i()],F=(0,r.hash)(H.subarray(0,32));F[0]&=248,F[31]&=127,F[31]|=64;const Y=new Uint8Array(64);Y.set(F.subarray(32),32);const ue=new r.SHA512;ue.update(Y.subarray(32)),ue.update(J);const he=ue.digest();ue.clean(),N(he),A(D,he),K(Y,D),ue.reset(),ue.update(Y.subarray(0,32)),ue.update(H.subarray(32)),ue.update(J);const Ce=ue.digest();N(Ce);for(let Me=0;Me<32;Me++)X[Me]=he[Me];for(let Me=0;Me<32;Me++)for(let Oe=0;Oe<32;Oe++)X[Me+Oe]+=Ce[Me]*F[Oe];return q(Y.subarray(32),X),Y}t.sign=I;function U(H,J){const X=i(),D=i(),F=i(),Y=i(),ue=i(),he=i(),Ce=i();return p(H[2],a),C(H[1],J),T(F,H[1]),_(Y,F,c),P(F,F,H[2]),S(Y,H[2],Y),T(ue,Y),T(he,ue),_(Ce,he,ue),_(X,Ce,F),_(X,X,Y),Z(X,X),_(X,X,F),_(X,X,Y),_(X,X,Y),_(H[0],X,Y),T(D,H[0]),_(D,D,Y),w(D,F)&&_(H[0],H[0],d),T(D,H[0]),_(D,D,Y),w(D,F)?-1:(E(H[0])===J[31]>>7&&P(H[0],o,H[0]),_(H[3],H[0],H[1]),0)}function re(H,J,X){const D=new Uint8Array(32),F=[i(),i(),i(),i()],Y=[i(),i(),i(),i()];if(X.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(U(Y,H))return!1;const ue=new r.SHA512;ue.update(X.subarray(0,32)),ue.update(H),ue.update(J);const he=ue.digest();return N(he),x(F,Y,he),A(Y,X.subarray(32)),ne(F,Y),K(D,F),!b(X,D)}t.verify=re;function M(H){let J=[i(),i(),i(),i()];if(U(J,H))throw new Error("Ed25519: invalid public key");let X=i(),D=i(),F=J[1];S(X,a,F),P(D,a,F),Q(D,D),_(X,X,D);let Y=new Uint8Array(32);return y(Y,X),Y}t.convertPublicKeyToX25519=M;function G(H){const J=(0,r.hash)(H.subarray(0,32));J[0]&=248,J[31]&=127,J[31]|=64;const X=new Uint8Array(J.subarray(0,32));return(0,n.wipe)(J),X}t.convertSecretKeyToX25519=G})(MM);const prt="EdDSA",grt="JWT",hue=".",pue="base64url",mrt="utf8",vrt="utf8",yrt=":",brt="did",wrt="key",MV="base58btc",xrt="z",Ert="K36",_rt=32;function b_(t){return Qs(So(a1(t),mrt),pue)}function gue(t){const e=So(Ert,MV),r=xrt+Qs(aR([e,t]),MV);return[brt,wrt,r].join(yrt)}function Crt(t){return Qs(t,pue)}function Srt(t){return So([b_(t.header),b_(t.payload)].join(hue),vrt)}function Art(t){return[b_(t.header),b_(t.payload),Crt(t.signature)].join(hue)}function DV(t=tv.randomBytes(_rt)){return MM.generateKeyPairFromSeed(t)}async function krt(t,e,r,n,i=lt.fromMiliseconds(Date.now())){const s={alg:prt,typ:grt},o=gue(n.publicKey),a=i+r,c={iss:o,sub:t,aud:e,iat:i,exp:a},l=Srt({header:s,payload:c}),u=MM.sign(n.secretKey,l);return Art({header:s,payload:c,signature:u})}const Irt="PARSE_ERROR",Prt="INVALID_REQUEST",Rrt="METHOD_NOT_FOUND",Trt="INVALID_PARAMS",mue="INTERNAL_ERROR",DM="SERVER_ERROR",Ort=[-32700,-32600,-32601,-32602,-32603],pb={[Irt]:{code:-32700,message:"Parse error"},[Prt]:{code:-32600,message:"Invalid Request"},[Rrt]:{code:-32601,message:"Method not found"},[Trt]:{code:-32602,message:"Invalid params"},[mue]:{code:-32603,message:"Internal error"},[DM]:{code:-32e3,message:"Server error"}},vue=DM;function $rt(t){return Ort.includes(t)}function LV(t){return Object.keys(pb).includes(t)?pb[t]:pb[vue]}function Nrt(t){const e=Object.values(pb).find(r=>r.code===t);return e||pb[vue]}function yue(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var bue={},vu={},BV;function Mrt(){if(BV)return vu;BV=1,Object.defineProperty(vu,"__esModule",{value:!0}),vu.isBrowserCryptoAvailable=vu.getSubtleCrypto=vu.getBrowerCrypto=void 0;function t(){return(Je==null?void 0:Je.crypto)||(Je==null?void 0:Je.msCrypto)||{}}vu.getBrowerCrypto=t;function e(){const n=t();return n.subtle||n.webkitSubtle}vu.getSubtleCrypto=e;function r(){return!!t()&&!!e()}return vu.isBrowserCryptoAvailable=r,vu}var yu={},FV;function Drt(){if(FV)return yu;FV=1,Object.defineProperty(yu,"__esModule",{value:!0}),yu.isBrowser=yu.isNode=yu.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}yu.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}yu.isNode=e;function r(){return!t()&&!e()}return yu.isBrowser=r,yu}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=iu;e.__exportStar(Mrt(),t),e.__exportStar(Drt(),t)})(bue);function LM(t=3){const e=Date.now()*Math.pow(10,t),r=Math.floor(Math.random()*Math.pow(10,t));return e+r}function wue(t=6){return BigInt(LM(t))}function Rg(t,e,r){return{id:r||LM(),jsonrpc:"2.0",method:t,params:e}}function S4(t,e){return{id:t,jsonrpc:"2.0",result:e}}function A4(t,e,r){return{id:t,jsonrpc:"2.0",error:Lrt(e,r)}}function Lrt(t,e){return typeof t>"u"?LV(mue):(typeof t=="string"&&(t=Object.assign(Object.assign({},LV(DM)),{message:t})),typeof e<"u"&&(t.data=e),$rt(t.code)&&(t=Nrt(t.code)),t)}class Brt{}class Frt extends Brt{constructor(){super()}}class jrt extends Frt{constructor(e){super()}}const Urt="^https?:",zrt="^wss?:";function Hrt(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function xue(t,e){const r=Hrt(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function jV(t){return xue(t,Urt)}function UV(t){return xue(t,zrt)}function qrt(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function Eue(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function BM(t){return Eue(t)&&"method"in t}function k4(t){return Eue(t)&&(Iu(t)||$c(t))}function Iu(t){return"result"in t}function $c(t){return"error"in t}class Tf extends jrt{constructor(e){super(e),this.events=new is.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,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async request(e,r){return this.requestStrict(Rg(e.method,e.params||[],e.id||wue().toString()),r)}async requestStrict(e,r){return new Promise(async(n,i)=>{if(!this.connection.connected)try{await this.open()}catch(s){i(s)}this.events.on(`${e.id}`,s=>{$c(s)?i(s.error):n(s.result)});try{await this.connection.send(e,r)}catch(s){i(s)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),k4(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 Wrt=()=>typeof WebSocket<"u"?WebSocket:typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),Vrt=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",zV=t=>t.split("?")[0],HV=10,Grt=Wrt();let Krt=class{constructor(e){if(this.url=e,this.events=new is.EventEmitter,this.registering=!1,!UV(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,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,r)=>{if(typeof this.socket>"u"){r(new Error("Connection already closed"));return}this.socket.onclose=n=>{this.onClose(n),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(a1(e))}catch(r){this.onError(e.id,r)}}register(e=this.url){if(!UV(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,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"));n(this.socket)})})}return this.url=e,this.registering=!0,new Promise((r,n)=>{const i=new URLSearchParams(e).get("origin"),s=bue.isReactNative()?{headers:{origin:i}}:{rejectUnauthorized:!qrt(e)},o=new Grt(e,[],s);Vrt()?o.onerror=a=>{const c=a;n(this.emitError(c.error))}:o.on("error",a=>{n(this.emitError(a))}),o.onopen=()=>{this.onOpen(o),r(o)}})}onOpen(e){e.onmessage=r=>this.onPayload(r),e.onclose=r=>this.onClose(r),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 r=typeof e.data=="string"?Xw(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=A4(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return yue(e,zV(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>HV&&this.events.setMaxListeners(HV)}emitError(e){const r=this.parseError(new Error((e==null?void 0:e.message)||`WebSocket connection failed for host: ${zV(this.url)}`));return this.events.emit("register_error",r),r}};var w_={exports:{}};w_.exports;(function(t,e){var r=200,n="__lodash_hash_undefined__",i=1,s=2,o=9007199254740991,a="[object Arguments]",c="[object Array]",l="[object AsyncFunction]",u="[object Boolean]",f="[object Date]",d="[object Error]",p="[object Function]",g="[object GeneratorFunction]",v="[object Map]",y="[object Number]",b="[object Null]",w="[object Object]",E="[object Promise]",C="[object Proxy]",S="[object RegExp]",P="[object Set]",_="[object String]",T="[object Symbol]",Q="[object Undefined]",Z="[object WeakMap]",ne="[object ArrayBuffer]",ce="[object DataView]",K="[object Float32Array]",x="[object Float64Array]",A="[object Int8Array]",B="[object Int16Array]",z="[object Int32Array]",R="[object Uint8Array]",L="[object Uint8ClampedArray]",q="[object Uint16Array]",N="[object Uint32Array]",I=/[\\^$.*+?()[\]{}|]/g,U=/^\[object .+?Constructor\]$/,re=/^(?:0|[1-9]\d*)$/,M={};M[K]=M[x]=M[A]=M[B]=M[z]=M[R]=M[L]=M[q]=M[N]=!0,M[a]=M[c]=M[ne]=M[u]=M[ce]=M[f]=M[d]=M[p]=M[v]=M[y]=M[w]=M[S]=M[P]=M[_]=M[Z]=!1;var G=typeof Je=="object"&&Je&&Je.Object===Object&&Je,H=typeof self=="object"&&self&&self.Object===Object&&self,J=G||H||Function("return this")(),X=e&&!e.nodeType&&e,D=X&&!0&&t&&!t.nodeType&&t,F=D&&D.exports===X,Y=F&&G.process,ue=function(){try{return Y&&Y.binding&&Y.binding("util")}catch{}}(),he=ue&&ue.isTypedArray;function Ce(le,ve){for(var Ne=-1,Xe=le==null?0:le.length,Gr=0,Ut=[];++Ne-1}function fs(le,ve){var Ne=this.__data__,Xe=Oh(Ne,le);return Xe<0?(++this.size,Ne.push([le,ve])):Ne[Xe][1]=ve,this}Wt.prototype.clear=wr,Wt.prototype.delete=cs,Wt.prototype.get=ls,Wt.prototype.has=us,Wt.prototype.set=fs;function $n(le){var ve=-1,Ne=le==null?0:le.length;for(this.clear();++veei))return!1;var Kr=Ut.get(le);if(Kr&&Ut.get(ve))return Kr==ve;var Vn=-1,oo=!0,ti=Ne&s?new so:void 0;for(Ut.set(le,ve),Ut.set(ve,le);++Vn-1&&le%1==0&&le-1&&le%1==0&&le<=o}function _x(le){var ve=typeof le;return le!=null&&(ve=="object"||ve=="function")}function Mh(le){return le!=null&&typeof le=="object"}var Cx=he?ot(he):fx;function Q4(le){return K4(le)?lx(le):dx(le)}function Vr(){return[]}function Br(){return!1}t.exports=J4})(w_,w_.exports);var Jrt=w_.exports;const Qrt=rs(Jrt);function Yrt(t,e){return e=e||{},new Promise(function(r,n){var i=new XMLHttpRequest,s=[],o=[],a={},c=function(){return{ok:(i.status/100|0)==2,statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(i.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:c,headers:{keys:function(){return s},entries:function(){return o},get:function(u){return a[u.toLowerCase()]},has:function(u){return u.toLowerCase()in a}}}};for(var l in i.open(e.method||"get",t,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(u,f,d){s.push(f=f.toLowerCase()),o.push([f,d]),a[f]=a[f]?a[f]+","+d:d}),r(c())},i.onerror=n,i.withCredentials=e.credentials=="include",e.headers)i.setRequestHeader(l,e.headers[l]);i.send(e.body||null)})}const Zrt=Object.freeze(Object.defineProperty({__proto__:null,default:Yrt},Symbol.toStringTag,{value:"Module"})),qV=wf(Zrt);var Xrt=self.fetch||(self.fetch=qV.default||qV);const ent=rs(Xrt);function tnt(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,C=new Uint8Array(E);b!==w;){for(var S=g[b],P=0,_=E-1;(S!==0||P>>0,C[_]=S%a>>>0,S=S/a>>>0;if(S!==0)throw new Error("Non-zero carry");y=P,b++}for(var T=E-y;T!==E&&C[T]===0;)T++;for(var Q=c.repeat(v);T>>0,E=new Uint8Array(w);g[v];){var C=r[g.charCodeAt(v)];if(C===255)return;for(var S=0,P=w-1;(C!==0||S>>0,E[P]=C%256>>>0,C=C/256>>>0;if(C!==0)throw new Error("Non-zero carry");b=S,v++}if(g[v]!==" "){for(var _=w-b;_!==w&&E[_]===0;)_++;for(var T=new Uint8Array(y+(w-_)),Q=y;_!==w;)T[Q++]=E[_++];return T}}}function p(g){var v=d(g);if(v)return v;throw new Error(`Non-${e} character`)}return{encode:f,decodeUnsafe:d,decode:p}}var rnt=tnt,nnt=rnt;const _ue=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},int=t=>new TextEncoder().encode(t),snt=t=>new TextDecoder().decode(t);class ont{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class ant{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}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 Cue(this,e)}}class cnt{constructor(e){this.decoders=e}or(e){return Cue(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Cue=(t,e)=>new cnt({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class lnt{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new ont(e,r,n),this.decoder=new ant(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const I4=({name:t,prefix:e,encode:r,decode:n})=>new lnt(t,e,r,n),ex=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=nnt(r,e);return I4({prefix:t,name:e,encode:n,decode:s=>_ue(i(s))})},unt=(t,e,r,n)=>{const i={};for(let u=0;u=8&&(a-=8,o[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},fnt=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<I4({prefix:e,name:t,encode(i){return fnt(i,n,r)},decode(i){return unt(i,n,r,t)}}),dnt=I4({prefix:"\0",name:"identity",encode:t=>snt(t),decode:t=>int(t)});var hnt=Object.freeze({__proto__:null,identity:dnt});const pnt=os({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var gnt=Object.freeze({__proto__:null,base2:pnt});const mnt=os({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var vnt=Object.freeze({__proto__:null,base8:mnt});const ynt=ex({prefix:"9",name:"base10",alphabet:"0123456789"});var bnt=Object.freeze({__proto__:null,base10:ynt});const wnt=os({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),xnt=os({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Ent=Object.freeze({__proto__:null,base16:wnt,base16upper:xnt});const _nt=os({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Cnt=os({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Snt=os({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Ant=os({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),knt=os({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Int=os({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Pnt=os({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Rnt=os({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Tnt=os({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Ont=Object.freeze({__proto__:null,base32:_nt,base32upper:Cnt,base32pad:Snt,base32padupper:Ant,base32hex:knt,base32hexupper:Int,base32hexpad:Pnt,base32hexpadupper:Rnt,base32z:Tnt});const $nt=ex({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Nnt=ex({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Mnt=Object.freeze({__proto__:null,base36:$nt,base36upper:Nnt});const Dnt=ex({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Lnt=ex({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Bnt=Object.freeze({__proto__:null,base58btc:Dnt,base58flickr:Lnt});const Fnt=os({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),jnt=os({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Unt=os({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),znt=os({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Hnt=Object.freeze({__proto__:null,base64:Fnt,base64pad:jnt,base64url:Unt,base64urlpad:znt});const Sue=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),qnt=Sue.reduce((t,e,r)=>(t[r]=e,t),[]),Wnt=Sue.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function Vnt(t){return t.reduce((e,r)=>(e+=qnt[r],e),"")}function Gnt(t){const e=[];for(const r of t){const n=Wnt[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const Knt=I4({prefix:"🚀",name:"base256emoji",encode:Vnt,decode:Gnt});var Jnt=Object.freeze({__proto__:null,base256emoji:Knt}),Qnt=Aue,WV=128,Ynt=127,Znt=~Ynt,Xnt=Math.pow(2,31);function Aue(t,e,r){e=e||[],r=r||0;for(var n=r;t>=Xnt;)e[r++]=t&255|WV,t/=128;for(;t&Znt;)e[r++]=t&255|WV,t>>>=7;return e[r]=t|0,Aue.bytes=r-n+1,e}var eit=vR,tit=128,VV=127;function vR(t,n){var r=0,n=n||0,i=0,s=n,o,a=t.length;do{if(s>=a)throw vR.bytes=0,new RangeError("Could not decode varint");o=t[s++],r+=i<28?(o&VV)<=tit);return vR.bytes=s-n,r}var rit=Math.pow(2,7),nit=Math.pow(2,14),iit=Math.pow(2,21),sit=Math.pow(2,28),oit=Math.pow(2,35),ait=Math.pow(2,42),cit=Math.pow(2,49),lit=Math.pow(2,56),uit=Math.pow(2,63),fit=function(t){return t(kue.encode(t,e,r),e),KV=t=>kue.encodingLength(t),yR=(t,e)=>{const r=e.byteLength,n=KV(t),i=n+KV(r),s=new Uint8Array(i+r);return GV(t,s,0),GV(r,s,n),s.set(e,i),new hit(t,r,e,s)};class hit{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}const Iue=({name:t,code:e,encode:r})=>new pit(t,e,r);class pit{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?yR(this.code,r):r.then(n=>yR(this.code,n))}else throw Error("Unknown type, must be binary type")}}const Pue=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),git=Iue({name:"sha2-256",code:18,encode:Pue("SHA-256")}),mit=Iue({name:"sha2-512",code:19,encode:Pue("SHA-512")});var vit=Object.freeze({__proto__:null,sha256:git,sha512:mit});const Rue=0,yit="identity",Tue=_ue,bit=t=>yR(Rue,Tue(t)),wit={code:Rue,name:yit,encode:Tue,digest:bit};var xit=Object.freeze({__proto__:null,identity:wit});new TextEncoder,new TextDecoder;const JV={...hnt,...gnt,...vnt,...bnt,...Ent,...Ont,...Mnt,...Bnt,...Hnt,...Jnt};({...vit,...xit});function Oue(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function Eit(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Oue(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function $ue(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const QV=$ue("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),w7=$ue("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);const e=Eit(t.length);for(let r=0;r{if(!this.initialized){const n=await this.getKeyChain();typeof n<"u"&&(this.keychain=n),this.initialized=!0}},this.has=n=>(this.isInitialized(),this.keychain.has(n)),this.set=async(n,i)=>{this.isInitialized(),this.keychain.set(n,i),await this.persist()},this.get=n=>{this.isInitialized();const i=this.keychain.get(n);if(typeof i>"u"){const{message:s}=Ve("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(s)}return i},this.del=async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()},this.core=e,this.logger=cr.generateChildLogger(r,this.name)}get context(){return cr.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,tue(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?rue(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=Ve("NOT_INITIALIZED",this.name);throw new Error(e)}}}class nst{constructor(e,r,n){this.core=e,this.logger=r,this.name=Iit,this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=i=>(this.isInitialized(),this.keychain.has(i)),this.getClientId=async()=>{this.isInitialized();const i=await this.getClientSeed(),s=DV(i);return gue(s.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=eet();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const s=await this.getClientSeed(),o=DV(s),a=pR();return await krt(a,i,Pit,o)},this.generateSharedKey=(i,s,o)=>{this.isInitialized();const a=this.getPrivateKey(i),c=tet(a,s);return this.setSymKey(c,o)},this.setSymKey=async(i,s)=>{this.isInitialized();const o=s||ret(i);return await this.keychain.set(o,i),o},this.deleteKeyPair=async i=>{this.isInitialized(),await this.keychain.del(i)},this.deleteSymKey=async i=>{this.isInitialized(),await this.keychain.del(i)},this.encode=async(i,s,o)=>{this.isInitialized();const a=eue(o),c=a1(s);if(uV(a)){const d=a.senderPublicKey,p=a.receiverPublicKey;i=await this.generateSharedKey(d,p)}const l=this.getSymKey(i),{type:u,senderPublicKey:f}=a;return iet({type:u,symKey:l,message:c,senderPublicKey:f})},this.decode=async(i,s,o)=>{this.isInitialized();const a=aet(s,o);if(uV(a)){const c=a.receiverPublicKey,l=a.senderPublicKey;i=await this.generateSharedKey(c,l)}try{const c=this.getSymKey(i),l=set({symKey:c,encoded:s});return Xw(l)}catch(c){this.logger.error(`Failed to decode message from topic: '${i}', clientId: '${await this.getClientId()}'`),this.logger.error(c)}},this.getPayloadType=i=>{const s=v_(i);return Qw(s.type)},this.getPayloadSenderPublicKey=i=>{const s=v_(i);return s.senderPublicKey?Qs(s.senderPublicKey,Ks):void 0},this.core=e,this.logger=cr.generateChildLogger(r,this.name),this.keychain=n||new rst(this.core,this.logger)}get context(){return cr.getLoggerContext(this.logger)}async setPrivateKey(e,r){return await this.keychain.set(e,r),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(YV)}catch{e=pR(),await this.keychain.set(YV,e)}return Cit(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=Ve("NOT_INITIALIZED",this.name);throw new Error(e)}}}class ist extends irt{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=Oit,this.version=$it,this.initialized=!1,this.storagePrefix=sh,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const n=await this.getRelayerMessages();typeof n<"u"&&(this.messages=n),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(n){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(n)}finally{this.initialized=!0}}},this.set=async(n,i)=>{this.isInitialized();const s=Ig(i);let o=this.messages.get(n);return typeof o>"u"&&(o={}),typeof o[s]<"u"||(o[s]=i,this.messages.set(n,o),await this.persist()),s},this.get=n=>{this.isInitialized();let i=this.messages.get(n);return typeof i>"u"&&(i={}),i},this.has=(n,i)=>{this.isInitialized();const s=this.get(n),o=Ig(i);return typeof s[o]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=cr.generateChildLogger(e,this.name),this.core=r}get context(){return cr.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,tue(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?rue(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=Ve("NOT_INITIALIZED",this.name);throw new Error(e)}}}class sst extends srt{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new is.EventEmitter,this.name=Mit,this.queue=new Map,this.publishTimeout=lt.toMiliseconds(lt.TEN_SECONDS),this.needsTransportRestart=!1,this.publish=async(n,i,s)=>{var o;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:s}});try{const a=(s==null?void 0:s.ttl)||Nit,c=gR(s),l=(s==null?void 0:s.prompt)||!1,u=(s==null?void 0:s.tag)||0,f=(s==null?void 0:s.id)||wue().toString(),d={topic:n,message:i,opts:{ttl:a,relay:c,prompt:l,tag:u,id:f}},p=setTimeout(()=>this.queue.set(f,d),this.publishTimeout);try{await await P2(this.rpcPublish(n,i,a,c,l,u,f),this.publishTimeout,"Failed to publish payload, please try again."),this.removeRequestFromQueue(f),this.relayer.events.emit(Es.publish,d)}catch(g){if(this.logger.debug("Publishing Payload stalled"),this.needsTransportRestart=!0,(o=s==null?void 0:s.internal)!=null&&o.throwOnFailedPublish)throw this.removeRequestFromQueue(f),g;return}finally{clearTimeout(p)}this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:s}})}catch(a){throw this.logger.debug("Failed to Publish Payload"),this.logger.error(a),a}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.relayer=e,this.logger=cr.generateChildLogger(r,this.name),this.registerEventListeners()}get context(){return cr.getLoggerContext(this.logger)}rpcPublish(e,r,n,i,s,o,a){var c,l,u,f;const d={method:_E(i.protocol).publish,params:{topic:e,message:r,ttl:n,prompt:s,tag:o},id:a};return Ws((c=d.params)==null?void 0:c.prompt)&&((l=d.params)==null||delete l.prompt),Ws((u=d.params)==null?void 0:u.tag)&&((f=d.params)==null||delete f.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:d}),this.relayer.request(d)}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{const{topic:r,message:n,opts:i}=e;await this.publish(r,n,i)})}registerEventListeners(){this.relayer.core.heartbeat.on(ov.HEARTBEAT_EVENTS.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(Es.connection_stalled);return}this.checkQueue()}),this.relayer.on(Es.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class ost{constructor(){this.map=new Map,this.set=(e,r)=>{const n=this.get(e);this.exists(e,r)||this.map.set(e,[...n,r])},this.get=e=>this.map.get(e)||[],this.exists=(e,r)=>this.get(e).includes(r),this.delete=(e,r)=>{if(typeof r>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const n=this.get(e);if(!this.exists(e,r))return;const i=n.filter(s=>s!==r);if(!i.length){this.map.delete(e);return}this.map.set(e,i)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var ast=Object.defineProperty,cst=Object.defineProperties,lst=Object.getOwnPropertyDescriptors,XV=Object.getOwnPropertySymbols,ust=Object.prototype.hasOwnProperty,fst=Object.prototype.propertyIsEnumerable,eG=(t,e,r)=>e in t?ast(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,hy=(t,e)=>{for(var r in e||(e={}))ust.call(e,r)&&eG(t,r,e[r]);if(XV)for(var r of XV(e))fst.call(e,r)&&eG(t,r,e[r]);return t},E7=(t,e)=>cst(t,lst(e));class dst extends crt{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new ost,this.events=new is.EventEmitter,this.name=qit,this.version=Wit,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=sh,this.subscribeTimeout=1e4,this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId())},this.subscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}});try{const s=gR(i),o={topic:n,relay:s};this.pending.set(n,o);const a=await this.rpcSubscribe(n,s);return this.onSubscribe(a,o),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}}),a}catch(s){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(s),s}},this.unsubscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),typeof(i==null?void 0:i.id)<"u"?await this.unsubscribeById(n,i.id,i):await this.unsubscribeByTopic(n,i)},this.isSubscribed=async n=>this.topics.includes(n)?!0:await new Promise((i,s)=>{const o=new lt.Watch;o.start(this.pendingSubscriptionWatchLabel);const a=setInterval(()=>{!this.pending.has(n)&&this.topics.includes(n)&&(clearInterval(a),o.stop(this.pendingSubscriptionWatchLabel),i(!0)),o.elapsed(this.pendingSubscriptionWatchLabel)>=Vit&&(clearInterval(a),o.stop(this.pendingSubscriptionWatchLabel),s(new Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1),this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=cr.generateChildLogger(r,this.name),this.clientId=""}get context(){return cr.getLoggerContext(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}hasSubscription(e,r){let n=!1;try{n=this.getSubscription(e).topic===r}catch{}return n}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,r){const n=this.topicMap.get(e);await Promise.all(n.map(async i=>await this.unsubscribeById(e,i,r)))}async unsubscribeById(e,r,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}});try{const i=gR(n);await this.rpcUnsubscribe(e,r,i);const s=Bn("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,r,s),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}})}catch(i){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(i),i}}async rpcSubscribe(e,r){const n={method:_E(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{await await P2(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Es.connection_stalled)}return Ig(e+this.clientId)}async rpcBatchSubscribe(e){if(!e.length)return;const r=e[0].relay,n={method:_E(r.protocol).batchSubscribe,params:{topics:e.map(i=>i.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{return await await P2(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(Es.connection_stalled)}}rpcUnsubscribe(e,r,n){const i={method:_E(n.protocol).unsubscribe,params:{topic:e,id:r}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(e,r){this.setSubscription(e,E7(hy({},r),{id:e})),this.pending.delete(r.topic)}onBatchSubscribe(e){e.length&&e.forEach(r=>{this.setSubscription(r.id,hy({},r)),this.pending.delete(r.topic)})}async onUnsubscribe(e,r,n){this.events.removeAllListeners(r),this.hasSubscription(r,e)&&this.deleteSubscription(r,n),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,r){this.subscriptions.has(e)||(this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:r}),this.addSubscription(e,r))}addSubscription(e,r){this.subscriptions.set(e,hy({},r)),this.topicMap.set(r.topic,e),this.events.emit(Rc.created,r)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const r=this.subscriptions.get(e);if(!r){const{message:n}=Ve("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}deleteSubscription(e,r){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:r});const n=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(n.topic,e),this.events.emit(Rc.deleted,E7(hy({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Rc.sync)}async reset(){if(this.cached.length){const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let r=0;r"u"||!e.length)return;if(this.subscriptions.size){const{message:r}=Ve("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(r)}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){if(!e.length)return;const r=await this.rpcBatchSubscribe(e);eu(r)&&this.onBatchSubscribe(r.map((n,i)=>E7(hy({},e[i]),{id:n})))}async onConnect(){this.restartInProgress||(await this.restart(),this.onEnable())}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||this.relayer.transportExplicitlyClosed)return;const e=[];this.pending.forEach(r=>{e.push(r)}),await this.batchSubscribe(e)}registerEventListeners(){this.relayer.core.heartbeat.on(ov.HEARTBEAT_EVENTS.pulse,async()=>{await this.checkPending()}),this.relayer.on(Es.connect,async()=>{await this.onConnect()}),this.relayer.on(Es.disconnect,()=>{this.onDisconnect()}),this.events.on(Rc.created,async e=>{const r=Rc.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()}),this.events.on(Rc.deleted,async e=>{const r=Rc.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=Ve("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){this.restartInProgress&&await new Promise(e=>{const r=setInterval(()=>{this.restartInProgress||(clearInterval(r),e())},this.pollingInterval)})}}var hst=Object.defineProperty,tG=Object.getOwnPropertySymbols,pst=Object.prototype.hasOwnProperty,gst=Object.prototype.propertyIsEnumerable,rG=(t,e,r)=>e in t?hst(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,mst=(t,e)=>{for(var r in e||(e={}))pst.call(e,r)&&rG(t,r,e[r]);if(tG)for(var r of tG(e))gst.call(e,r)&&rG(t,r,e[r]);return t};class vst extends ort{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new is.EventEmitter,this.name=Lit,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","socket stalled"],this.hasExperiencedNetworkDisruption=!1,this.request=async r=>{this.logger.debug("Publishing Request Payload");try{return await this.toEstablishConnection(),await this.provider.request(r)}catch(n){throw this.logger.debug("Failed to Publish Request"),this.logger.error(n),n}},this.onPayloadHandler=r=>{this.onProviderPayload(r)},this.onConnectHandler=()=>{this.events.emit(Es.connect)},this.onDisconnectHandler=()=>{this.onProviderDisconnect()},this.onProviderErrorHandler=r=>{this.logger.error(r),this.events.emit(Es.error,r),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(bu.payload,this.onPayloadHandler),this.provider.on(bu.connect,this.onConnectHandler),this.provider.on(bu.disconnect,this.onDisconnectHandler),this.provider.on(bu.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?cr.generateChildLogger(e.logger,this.name):cr.pino(cr.getDefaultLoggerOptions({level:e.logger||Dit})),this.messages=new ist(this.logger,e.core),this.subscriber=new dst(this,this.logger),this.publisher=new sst(this,this.logger),this.relayUrl=(e==null?void 0:e.relayUrl)||Due,this.projectId=e.projectId,this.bundleId=pet(),this.provider={}}async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await this.createProvider(),await Promise.all([this.messages.init(),this.subscriber.init()]);try{await this.transportOpen()}catch{this.logger.warn(`Connection via ${this.relayUrl} failed, attempting to connect via failover domain ${ZV}...`),await this.restartTransport(ZV)}this.initialized=!0,setTimeout(async()=>{this.subscriber.topics.length===0&&(this.logger.info("No topics subscribed to after init, closing transport"),await this.transportClose(),this.transportExplicitlyClosed=!1)},Uit)}get context(){return cr.getLoggerContext(this.logger)}get connected(){return this.provider.connection.connected}get connecting(){return this.provider.connection.connecting}async publish(e,r,n){this.isInitialized(),await this.publisher.publish(e,r,n),await this.recordMessageEvent({topic:e,message:r,publishedAt:Date.now()})}async subscribe(e,r){var n;this.isInitialized();let i=((n=this.subscriber.topicMap.get(e))==null?void 0:n[0])||"";if(i)return i;let s;const o=a=>{a.topic===e&&(this.subscriber.off(Rc.created,o),s())};return await Promise.all([new Promise(a=>{s=a,this.subscriber.on(Rc.created,o)}),new Promise(async a=>{i=await this.subscriber.subscribe(e,r),a()})]),i}async unsubscribe(e,r){this.isInitialized(),await this.subscriber.unsubscribe(e,r)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async transportClose(){this.transportExplicitlyClosed=!0,this.hasExperiencedNetworkDisruption&&this.connected?await P2(this.provider.disconnect(),1e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.connected&&await this.provider.disconnect()}async transportOpen(e){if(this.transportExplicitlyClosed=!1,await this.confirmOnlineStateOrThrow(),!this.connectionAttemptInProgress){e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportClose(),await this.createProvider()),this.connectionAttemptInProgress=!0;try{await Promise.all([new Promise(r=>{if(!this.initialized)return r();this.subscriber.once(Rc.resubscribed,()=>{r()})}),new Promise(async(r,n)=>{try{await P2(this.provider.connect(),1e4,`Socket stalled when trying to connect to ${this.relayUrl}`)}catch(i){n(i);return}r()})])}catch(r){this.logger.error(r);const n=r;if(!this.isConnectionStalled(n.message))throw r;this.provider.events.emit(bu.disconnect)}finally{this.connectionAttemptInProgress=!1,this.hasExperiencedNetworkDisruption=!1}}}async restartTransport(e){await this.confirmOnlineStateOrThrow(),!this.connectionAttemptInProgress&&(this.relayUrl=e||this.relayUrl,await this.transportClose(),await this.createProvider(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await xV())throw new Error("No internet connection detected. Please restart your network and try again.")}isConnectionStalled(e){return this.staleConnectionErrors.some(r=>e.includes(r))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new Tf(new Krt(wet({sdkVersion:jit,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:r,message:n}=e;await this.messages.set(r,n)}async shouldIgnoreMessageEvent(e){const{topic:r,message:n}=e;if(!n||n.length===0)return this.logger.debug(`Ignoring invalid/empty message: ${n}`),!0;if(!await this.subscriber.isSubscribed(r))return this.logger.debug(`Ignoring message for non-subscribed topic ${r}`),!0;const i=this.messages.has(r,n);return i&&this.logger.debug(`Ignoring duplicate message: ${n}`),i}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),BM(e)){if(!e.method.endsWith(Bit))return;const r=e.params,{topic:n,message:i,publishedAt:s}=r.data,o={topic:n,message:i,publishedAt:s};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(mst({type:"event",event:r.id},o)),this.events.emit(r.id,o),await this.acknowledgePayload(e),await this.onMessageEvent(o)}else k4(e)&&this.events.emit(Es.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(Es.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const r=S4(e.id,!0);await this.provider.connection.send(r)}unregisterProviderListeners(){this.provider.off(bu.payload,this.onPayloadHandler),this.provider.off(bu.connect,this.onConnectHandler),this.provider.off(bu.disconnect,this.onDisconnectHandler),this.provider.off(bu.error,this.onProviderErrorHandler)}async registerEventListeners(){this.events.on(Es.connection_stalled,()=>{this.restartTransport().catch(r=>this.logger.error(r))});let e=await xV();htt(async r=>{this.initialized&&e!==r&&(e=r,r?await this.restartTransport().catch(n=>this.logger.error(n)):(this.hasExperiencedNetworkDisruption=!0,await this.transportClose().catch(n=>this.logger.error(n))))})}onProviderDisconnect(){this.events.emit(Es.disconnect),this.attemptToReconnect()}attemptToReconnect(){this.transportExplicitlyClosed||(this.logger.info("attemptToReconnect called. Connecting..."),setTimeout(async()=>{await this.restartTransport().catch(e=>this.logger.error(e))},lt.toMiliseconds(Fit)))}isInitialized(){if(!this.initialized){const{message:e}=Ve("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){if(await this.confirmOnlineStateOrThrow(),!this.connected){if(this.connectionAttemptInProgress)return await new Promise(e=>{const r=setInterval(()=>{this.connected&&(clearInterval(r),e())},this.connectionStatusPollingInterval)});await this.restartTransport()}}}var yst=Object.defineProperty,nG=Object.getOwnPropertySymbols,bst=Object.prototype.hasOwnProperty,wst=Object.prototype.propertyIsEnumerable,iG=(t,e,r)=>e in t?yst(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,sG=(t,e)=>{for(var r in e||(e={}))bst.call(e,r)&&iG(t,r,e[r]);if(nG)for(var r of nG(e))wst.call(e,r)&&iG(t,r,e[r]);return t};class P4 extends art{constructor(e,r,n,i=sh,s=void 0){super(e,r,n,i),this.core=e,this.logger=r,this.name=n,this.map=new Map,this.version=zit,this.cached=[],this.initialized=!1,this.storagePrefix=sh,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(o=>{this.getKey&&o!==null&&!Ws(o)?this.map.set(this.getKey(o),o):qet(o)?this.map.set(o.id,o):Wet(o)&&this.map.set(o.topic,o)}),this.cached=[],this.initialized=!0)},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())},this.get=o=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:o}),this.getData(o)),this.getAll=o=>(this.isInitialized(),o?this.values.filter(a=>Object.keys(o).every(c=>Qrt(a[c],o[c]))):this.values),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=sG(sG({},this.getData(o)),a);this.map.set(o,c),await this.persist()},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),await this.persist())},this.logger=cr.generateChildLogger(r,this.name),this.storagePrefix=i,this.getKey=s}get context(){return cr.getLoggerContext(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())}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const r=this.map.get(e);if(!r){const{message:n}=Ve("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}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:r}=Ve("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}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}=Ve("NOT_INITIALIZED",this.name);throw new Error(e)}}}class xst{constructor(e,r){this.core=e,this.logger=r,this.name=Git,this.version=Kit,this.events=new GN,this.initialized=!1,this.storagePrefix=sh,this.ignoredPayloadTypes=[R1],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:n})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...n])]},this.create=async()=>{this.isInitialized();const n=pR(),i=await this.core.crypto.setSymKey(n),s=Oc(lt.FIVE_MINUTES),o={protocol:Mue},a={topic:i,expiry:s,relay:o,active:!1},c=Net({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:n,relay:o});return await this.pairings.set(i,a),await this.core.relayer.subscribe(i),this.core.expirer.set(i,s),{topic:i,uri:c}},this.pair=async n=>{this.isInitialized(),this.isValidPair(n);const{topic:i,symKey:s,relay:o}=mV(n.uri);let a;if(this.pairings.keys.includes(i)&&(a=this.pairings.get(i),a.active))throw new Error(`Pairing already exists: ${i}. Please try again with a new connection URI.`);const c=Oc(lt.FIVE_MINUTES),l={topic:i,relay:o,expiry:c,active:!1};return await this.pairings.set(i,l),this.core.expirer.set(i,c),n.activatePairing&&await this.activate({topic:i}),this.events.emit(Ry.create,l),this.core.crypto.keychain.has(i)||(await this.core.crypto.setSymKey(s,i),await this.core.relayer.subscribe(i,{relay:o})),l},this.activate=async({topic:n})=>{this.isInitialized();const i=Oc(lt.THIRTY_DAYS);await this.pairings.update(n,{active:!0,expiry:i}),this.core.expirer.set(n,i)},this.ping=async n=>{this.isInitialized(),await this.isValidPing(n);const{topic:i}=n;if(this.pairings.keys.includes(i)){const s=await this.sendRequest(i,"wc_pairingPing",{}),{done:o,resolve:a,reject:c}=Np();this.events.once(ii("pairing_ping",s),({error:l})=>{l?c(l):a()}),await o()}},this.updateExpiry=async({topic:n,expiry:i})=>{this.isInitialized(),await this.pairings.update(n,{expiry:i})},this.updateMetadata=async({topic:n,metadata:i})=>{this.isInitialized(),await this.pairings.update(n,{peerMetadata:i})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async n=>{this.isInitialized(),await this.isValidDisconnect(n);const{topic:i}=n;this.pairings.keys.includes(i)&&(await this.sendRequest(i,"wc_pairingDelete",Bn("USER_DISCONNECTED")),await this.deletePairing(i))},this.sendRequest=async(n,i,s)=>{const o=Rg(i,s),a=await this.core.crypto.encode(n,o),c=dy[i].req;return this.core.history.set(n,o),this.core.relayer.publish(n,a,c),o.id},this.sendResult=async(n,i,s)=>{const o=S4(n,s),a=await this.core.crypto.encode(i,o),c=await this.core.history.get(i,n),l=dy[c.request.method].res;await this.core.relayer.publish(i,a,l),await this.core.history.resolve(o)},this.sendError=async(n,i,s)=>{const o=A4(n,s),a=await this.core.crypto.encode(i,o),c=await this.core.history.get(i,n),l=dy[c.request.method]?dy[c.request.method].res:dy.unregistered_method.res;await this.core.relayer.publish(i,a,l),await this.core.history.resolve(o)},this.deletePairing=async(n,i)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,Bn("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(n),i?Promise.resolve():this.core.expirer.del(n)])},this.cleanup=async()=>{const n=this.pairings.getAll().filter(i=>cd(i.expiry));await Promise.all(n.map(i=>this.deletePairing(i.topic)))},this.onRelayEventRequest=n=>{const{topic:i,payload:s}=n;switch(s.method){case"wc_pairingPing":return this.onPairingPingRequest(i,s);case"wc_pairingDelete":return this.onPairingDeleteRequest(i,s);default:return this.onUnknownRpcMethodRequest(i,s)}},this.onRelayEventResponse=async n=>{const{topic:i,payload:s}=n,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)}},this.onPairingPingRequest=async(n,i)=>{const{id:s}=i;try{this.isValidPing({topic:n}),await this.sendResult(s,n,!0),this.events.emit(Ry.ping,{id:s,topic:n})}catch(o){await this.sendError(s,n,o),this.logger.error(o)}},this.onPairingPingResponse=(n,i)=>{const{id:s}=i;setTimeout(()=>{Iu(i)?this.events.emit(ii("pairing_ping",s),{}):$c(i)&&this.events.emit(ii("pairing_ping",s),{error:i.error})},500)},this.onPairingDeleteRequest=async(n,i)=>{const{id:s}=i;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit(Ry.delete,{id:s,topic:n})}catch(o){await this.sendError(s,n,o),this.logger.error(o)}},this.onUnknownRpcMethodRequest=async(n,i)=>{const{id:s,method:o}=i;try{if(this.registeredMethods.includes(o))return;const a=Bn("WC_METHOD_UNSUPPORTED",o);await this.sendError(s,n,a),this.logger.error(a)}catch(a){await this.sendError(s,n,a),this.logger.error(a)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error(Bn("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=n=>{var i;if(!go(n)){const{message:o}=Ve("MISSING_OR_INVALID",`pair() params: ${n}`);throw new Error(o)}if(!Het(n.uri)){const{message:o}=Ve("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw new Error(o)}const s=mV(n.uri);if(!((i=s==null?void 0:s.relay)!=null&&i.protocol)){const{message:o}=Ve("MISSING_OR_INVALID","pair() uri#relay-protocol");throw new Error(o)}if(!(s!=null&&s.symKey)){const{message:o}=Ve("MISSING_OR_INVALID","pair() uri#symKey");throw new Error(o)}},this.isValidPing=async n=>{if(!go(n)){const{message:s}=Ve("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(s)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidDisconnect=async n=>{if(!go(n)){const{message:s}=Ve("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(s)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidPairingTopic=async n=>{if(!Bi(n,!1)){const{message:i}=Ve("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(i)}if(!this.pairings.keys.includes(n)){const{message:i}=Ve("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(i)}if(cd(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:i}=Ve("EXPIRED",`pairing topic: ${n}`);throw new Error(i)}},this.core=e,this.logger=cr.generateChildLogger(r,this.name),this.pairings=new P4(this.core,this.logger,this.name,this.storagePrefix)}get context(){return cr.getLoggerContext(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=Ve("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(Es.message,async e=>{const{topic:r,message:n}=e;if(!this.pairings.keys.includes(r)||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const i=await this.core.crypto.decode(r,n);try{BM(i)?(this.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):k4(i)&&(await this.core.history.resolve(i),await this.onRelayEventResponse({topic:r,payload:i}),this.core.history.delete(r,i.id))}catch(s){this.logger.error(s)}})}registerExpirerEvents(){this.core.expirer.on(Oa.expired,async e=>{const{topic:r}=iue(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit(Ry.expire,{topic:r}))})}}class Est extends nrt{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new is.EventEmitter,this.name=Jit,this.version=Qit,this.cached=[],this.initialized=!1,this.storagePrefix=sh,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.records.set(n.id,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(n,i,s)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:i,chainId:s}),this.records.has(i.id))return;const o={id:i.id,topic:n,request:{method:i.method,params:i.params||null},chainId:s,expiry:Oc(lt.THIRTY_DAYS)};this.records.set(o.id,o),this.events.emit(ul.created,o)},this.resolve=async n=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:n}),!this.records.has(n.id))return;const i=await this.getRecord(n.id);typeof i.response>"u"&&(i.response=$c(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.events.emit(ul.updated,i))},this.get=async(n,i)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:n,id:i}),await this.getRecord(i)),this.delete=(n,i)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:i}),this.values.forEach(s=>{if(s.topic===n){if(typeof i<"u"&&s.id!==i)return;this.records.delete(s.id),this.events.emit(ul.deleted,s)}})},this.exists=async(n,i)=>(this.isInitialized(),this.records.has(i)?(await this.getRecord(i)).topic===n:!1),this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=cr.generateChildLogger(r,this.name)}get context(){return cr.getLoggerContext(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(r=>{if(typeof r.response<"u")return;const n={topic:r.topic,request:Rg(r.request.method,r.request.params,r.id),chainId:r.chainId};return e.push(n)}),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 r=this.records.get(e);if(!r){const{message:n}=Ve("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(ul.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:r}=Ve("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}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(ul.created,e=>{const r=ul.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(ul.updated,e=>{const r=ul.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.events.on(ul.deleted,e=>{const r=ul.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e}),this.persist()}),this.core.heartbeat.on(ov.HEARTBEAT_EVENTS.pulse,()=>{this.cleanup()})}cleanup(){try{this.records.forEach(e=>{lt.toMiliseconds(e.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${e.id}`),this.delete(e.topic,e.id))})}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=Ve("NOT_INITIALIZED",this.name);throw new Error(e)}}}class _st extends lrt{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new is.EventEmitter,this.name=Yit,this.version=Zit,this.cached=[],this.initialized=!1,this.storagePrefix=sh,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.expirations.set(n.target,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=n=>{try{const i=this.formatTarget(n);return typeof this.getExpiration(i)<"u"}catch{return!1}},this.set=(n,i)=>{this.isInitialized();const s=this.formatTarget(n),o={target:s,expiry:i};this.expirations.set(s,o),this.checkExpiry(s,o),this.events.emit(Oa.created,{target:s,expiration:o})},this.get=n=>{this.isInitialized();const i=this.formatTarget(n);return this.getExpiration(i)},this.del=n=>{if(this.isInitialized(),this.has(n)){const i=this.formatTarget(n),s=this.getExpiration(i);this.expirations.delete(i),this.events.emit(Oa.deleted,{target:i,expiration:s})}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=cr.generateChildLogger(r,this.name)}get context(){return cr.getLoggerContext(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 xet(e);if(typeof e=="number")return Eet(e);const{message:r}=Ve("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(r)}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(Oa.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:r}=Ve("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}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 r=this.expirations.get(e);if(!r){const{message:n}=Ve("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}checkExpiry(e,r){const{expiry:n}=r;lt.toMiliseconds(n)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit(Oa.expired,{target:e,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(ov.HEARTBEAT_EVENTS.pulse,()=>this.checkExpirations()),this.events.on(Oa.created,e=>{const r=Oa.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(Oa.expired,e=>{const r=Oa.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(Oa.deleted,e=>{const r=Oa.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=Ve("NOT_INITIALIZED",this.name);throw new Error(e)}}}class Cst extends urt{constructor(e,r){super(e,r),this.projectId=e,this.logger=r,this.name=x7,this.initialized=!1,this.queue=[],this.verifyDisabled=!1,this.init=async n=>{if(this.verifyDisabled||nv()||!iv())return;const i=this.getVerifyUrl(n==null?void 0:n.verifyUrl);this.verifyUrl!==i&&this.removeIframe(),this.verifyUrl=i;try{await this.createIframe()}catch(s){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(s)}if(!this.initialized){this.removeIframe(),this.verifyUrl=bR;try{await this.createIframe()}catch(s){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(s),this.verifyDisabled=!0}}},this.register=async n=>{this.initialized?this.sendPost(n.attestationId):(this.addToQueue(n.attestationId),await this.init())},this.resolve=async n=>{if(this.isDevEnv)return"";const i=this.getVerifyUrl(n==null?void 0:n.verifyUrl);let s;try{s=await this.fetchAttestation(n.attestationId,i)}catch(o){this.logger.info(`failed to resolve attestation: ${n.attestationId} from url: ${i}`),this.logger.info(o),s=await this.fetchAttestation(n.attestationId,bR)}return s},this.fetchAttestation=async(n,i)=>{this.logger.info(`resolving attestation: ${n} from url: ${i}`);const s=this.startAbortTimer(lt.ONE_SECOND*2),o=await fetch(`${i}/attestation/${n}`,{signal:this.abortController.signal});return clearTimeout(s),o.status===200?await o.json():void 0},this.addToQueue=n=>{this.queue.push(n)},this.processQueue=()=>{this.queue.length!==0&&(this.queue.forEach(n=>this.sendPost(n)),this.queue=[])},this.sendPost=n=>{var i;try{if(!this.iframe)return;(i=this.iframe.contentWindow)==null||i.postMessage(n,"*"),this.logger.info(`postMessage sent: ${n} ${this.verifyUrl}`)}catch{}},this.createIframe=async()=>{let n;const i=s=>{s.data==="verify_ready"&&(this.initialized=!0,this.processQueue(),window.removeEventListener("message",i),n())};await Promise.race([new Promise(s=>{if(document.getElementById(x7))return s();window.addEventListener("message",i);const o=document.createElement("iframe");o.id=x7,o.src=`${this.verifyUrl}/${this.projectId}`,o.style.display="none",document.body.append(o),this.iframe=o,n=s}),new Promise((s,o)=>setTimeout(()=>{window.removeEventListener("message",i),o("verify iframe load timeout")},lt.toMiliseconds(lt.FIVE_SECONDS)))])},this.removeIframe=()=>{this.iframe&&(this.iframe.remove(),this.iframe=void 0,this.initialized=!1)},this.getVerifyUrl=n=>{let i=n||ng;return Xit.includes(i)||(this.logger.info(`verify url: ${i}, not included in trusted list, assigning default: ${ng}`),i=ng),i},this.logger=cr.generateChildLogger(r,this.name),this.verifyUrl=ng,this.abortController=new AbortController,this.isDevEnv=OM()&&{}.IS_VITEST}get context(){return cr.getLoggerContext(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),lt.toMiliseconds(e))}}class Sst extends frt{constructor(e,r){super(e,r),this.projectId=e,this.logger=r,this.context=est,this.registerDeviceToken=async n=>{const{clientId:i,token:s,notificationType:o,enableEncrypted:a=!1}=n,c=`${tst}/${this.projectId}/clients`;await ent(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:i,type:o,token:s,always_raw:a})})},this.logger=cr.generateChildLogger(r,this.context)}}var Ast=Object.defineProperty,oG=Object.getOwnPropertySymbols,kst=Object.prototype.hasOwnProperty,Ist=Object.prototype.propertyIsEnumerable,aG=(t,e,r)=>e in t?Ast(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,cG=(t,e)=>{for(var r in e||(e={}))kst.call(e,r)&&aG(t,r,e[r]);if(oG)for(var r of oG(e))Ist.call(e,r)&&aG(t,r,e[r]);return t};class jM extends rrt{constructor(e){super(e),this.protocol=Nue,this.version=Sit,this.name=FM,this.events=new is.EventEmitter,this.initialized=!1,this.on=(n,i)=>this.events.on(n,i),this.once=(n,i)=>this.events.once(n,i),this.off=(n,i)=>this.events.off(n,i),this.removeListener=(n,i)=>this.events.removeListener(n,i),this.projectId=e==null?void 0:e.projectId,this.relayUrl=(e==null?void 0:e.relayUrl)||Due,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const r=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:cr.pino(cr.getDefaultLoggerOptions({level:(e==null?void 0:e.logger)||Ait.logger}));this.logger=cr.generateChildLogger(r,this.name),this.heartbeat=new ov.HeartBeat,this.crypto=new nst(this,this.logger,e==null?void 0:e.keychain),this.history=new Est(this,this.logger),this.expirer=new _st(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new Gtt(cG(cG({},kit),e==null?void 0:e.storageOptions)),this.relayer=new vst({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new xst(this,this.logger),this.verify=new Cst(this.projectId||"",this.logger),this.echoClient=new Sst(this.projectId||"",this.logger)}static async init(e){const r=new jM(e);await r.initialize();const n=await r.crypto.getClientId();return await r.storage.setItem(Hit,n),r}get context(){return cr.getLoggerContext(this.logger)}async start(){this.initialized||await this.initialize()}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.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}}}const Pst=jM,Lue="wc",Bue=2,Fue="client",UM=`${Lue}@${Bue}:${Fue}:`,_7={name:Fue,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},lG="WALLETCONNECT_DEEPLINK_CHOICE",Rst="proposal",jue="Proposal expired",Tst="session",b3=lt.SEVEN_DAYS,Ost="engine",py={wc_sessionPropose:{req:{ttl:lt.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:lt.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:lt.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:lt.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:lt.ONE_DAY,prompt:!1,tag:1104},res:{ttl:lt.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:lt.ONE_DAY,prompt:!1,tag:1106},res:{ttl:lt.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:lt.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:lt.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:lt.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:lt.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:lt.ONE_DAY,prompt:!1,tag:1112},res:{ttl:lt.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:lt.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:lt.THIRTY_SECONDS,prompt:!1,tag:1115}}},C7={min:lt.FIVE_MINUTES,max:lt.SEVEN_DAYS},wu={idle:"IDLE",active:"ACTIVE"},$st="request",Nst=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"];var Mst=Object.defineProperty,Dst=Object.defineProperties,Lst=Object.getOwnPropertyDescriptors,uG=Object.getOwnPropertySymbols,Bst=Object.prototype.hasOwnProperty,Fst=Object.prototype.propertyIsEnumerable,fG=(t,e,r)=>e in t?Mst(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ho=(t,e)=>{for(var r in e||(e={}))Bst.call(e,r)&&fG(t,r,e[r]);if(uG)for(var r of uG(e))Fst.call(e,r)&&fG(t,r,e[r]);return t},gy=(t,e)=>Dst(t,Lst(e));class jst extends hrt{constructor(e){super(e),this.name=Ost,this.events=new GN,this.initialized=!1,this.ignoredPayloadTypes=[R1],this.requestQueue={state:wu.idle,queue:[]},this.sessionRequestQueue={state:wu.idle,queue:[]},this.requestQueueDelay=lt.ONE_SECOND,this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),this.client.core.pairing.register({methods:Object.keys(py)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},lt.toMiliseconds(this.requestQueueDelay)))},this.connect=async r=>{await this.isInitialized();const n=gy(ho({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:i,requiredNamespaces:s,optionalNamespaces:o,sessionProperties:a,relays:c}=n;let l=i,u,f=!1;if(l&&(f=this.client.core.pairing.pairings.get(l).active),!l||!f){const{topic:E,uri:C}=await this.client.core.pairing.create();l=E,u=C}const d=await this.client.core.crypto.generateKeyPair(),p=ho({requiredNamespaces:s,optionalNamespaces:o,relays:c??[{protocol:Mue}],proposer:{publicKey:d,metadata:this.client.metadata}},a&&{sessionProperties:a}),{reject:g,resolve:v,done:y}=Np(lt.FIVE_MINUTES,jue);if(this.events.once(ii("session_connect"),async({error:E,session:C})=>{if(E)g(E);else if(C){C.self.publicKey=d;const S=gy(ho({},C),{requiredNamespaces:C.requiredNamespaces,optionalNamespaces:C.optionalNamespaces});await this.client.session.set(C.topic,S),await this.setExpiry(C.topic,C.expiry),l&&await this.client.core.pairing.updateMetadata({topic:l,metadata:C.peer.metadata}),v(S)}}),!l){const{message:E}=Ve("NO_MATCHING_KEY",`connect() pairing topic: ${l}`);throw new Error(E)}const b=await this.sendRequest({topic:l,method:"wc_sessionPropose",params:p}),w=Oc(lt.FIVE_MINUTES);return await this.setProposal(b,ho({id:b,expiry:w},p)),{uri:u,approval:y}},this.pair=async r=>(await this.isInitialized(),await this.client.core.pairing.pair(r)),this.approve=async r=>{await this.isInitialized(),await this.isValidApprove(r);const{id:n,relayProtocol:i,namespaces:s,sessionProperties:o}=r,a=this.client.proposal.get(n);let{pairingTopic:c,proposer:l,requiredNamespaces:u,optionalNamespaces:f}=a;c=c||"",Pg(u)||(u=Bet(s,"approve()"));const d=await this.client.core.crypto.generateKeyPair(),p=l.publicKey,g=await this.client.core.crypto.generateSharedKey(d,p);c&&n&&(await this.client.core.pairing.updateMetadata({topic:c,metadata:l.metadata}),await this.sendResult({id:n,topic:c,result:{relay:{protocol:i??"irn"},responderPublicKey:d}}),await this.client.proposal.delete(n,Bn("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:c}));const v=ho({relay:{protocol:i??"irn"},namespaces:s,requiredNamespaces:u,optionalNamespaces:f,pairingTopic:c,controller:{publicKey:d,metadata:this.client.metadata},expiry:Oc(b3)},o&&{sessionProperties:o});await this.client.core.relayer.subscribe(g),await this.sendRequest({topic:g,method:"wc_sessionSettle",params:v,throwOnFailedPublish:!0});const y=gy(ho({},v),{topic:g,pairingTopic:c,acknowledged:!1,self:v.controller,peer:{publicKey:l.publicKey,metadata:l.metadata},controller:d});return await this.client.session.set(g,y),await this.setExpiry(g,Oc(b3)),{topic:g,acknowledged:()=>new Promise(b=>setTimeout(()=>b(this.client.session.get(g)),500))}},this.reject=async r=>{await this.isInitialized(),await this.isValidReject(r);const{id:n,reason:i}=r,{pairingTopic:s}=this.client.proposal.get(n);s&&(await this.sendError(n,s,i),await this.client.proposal.delete(n,Bn("USER_DISCONNECTED")))},this.update=async r=>{await this.isInitialized(),await this.isValidUpdate(r);const{topic:n,namespaces:i}=r,s=await this.sendRequest({topic:n,method:"wc_sessionUpdate",params:{namespaces:i}}),{done:o,resolve:a,reject:c}=Np();return this.events.once(ii("session_update",s),({error:l})=>{l?c(l):a()}),await this.client.session.update(n,{namespaces:i}),{acknowledged:o}},this.extend=async r=>{await this.isInitialized(),await this.isValidExtend(r);const{topic:n}=r,i=await this.sendRequest({topic:n,method:"wc_sessionExtend",params:{}}),{done:s,resolve:o,reject:a}=Np();return this.events.once(ii("session_extend",i),({error:c})=>{c?a(c):o()}),await this.setExpiry(n,Oc(b3)),{acknowledged:s}},this.request=async r=>{await this.isInitialized(),await this.isValidRequest(r);const{chainId:n,request:i,topic:s,expiry:o}=r,a=LM(),{done:c,resolve:l,reject:u}=Np(o,"Request expired. Please try again.");return this.events.once(ii("session_request",a),({error:f,result:d})=>{f?u(f):l(d)}),await Promise.all([new Promise(async f=>{await this.sendRequest({clientRpcId:a,topic:s,method:"wc_sessionRequest",params:{request:i,chainId:n},expiry:o,throwOnFailedPublish:!0}).catch(d=>u(d)),this.client.events.emit("session_request_sent",{topic:s,request:i,chainId:n,id:a}),f()}),new Promise(async f=>{const d=await Cet(this.client.core.storage,lG);_et({id:a,topic:s,wcDeepLink:d}),f()}),c()]).then(f=>f[2])},this.respond=async r=>{await this.isInitialized(),await this.isValidRespond(r);const{topic:n,response:i}=r,{id:s}=i;Iu(i)?await this.sendResult({id:s,topic:n,result:i.result,throwOnFailedPublish:!0}):$c(i)&&await this.sendError(s,n,i.error),this.cleanupAfterResponse(r)},this.ping=async r=>{await this.isInitialized(),await this.isValidPing(r);const{topic:n}=r;if(this.client.session.keys.includes(n)){const i=await this.sendRequest({topic:n,method:"wc_sessionPing",params:{}}),{done:s,resolve:o,reject:a}=Np();this.events.once(ii("session_ping",i),({error:c})=>{c?a(c):o()}),await s()}else this.client.core.pairing.pairings.keys.includes(n)&&await this.client.core.pairing.ping({topic:n})},this.emit=async r=>{await this.isInitialized(),await this.isValidEmit(r);const{topic:n,event:i,chainId:s}=r;await this.sendRequest({topic:n,method:"wc_sessionEvent",params:{event:i,chainId:s}})},this.disconnect=async r=>{await this.isInitialized(),await this.isValidDisconnect(r);const{topic:n}=r;this.client.session.keys.includes(n)?(await this.sendRequest({topic:n,method:"wc_sessionDelete",params:Bn("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession(n)):await this.client.core.pairing.disconnect({topic:n})},this.find=r=>(this.isInitialized(),this.client.session.getAll().filter(n=>Uet(n,r))),this.getPendingSessionRequests=()=>(this.isInitialized(),this.client.pendingRequest.getAll()),this.cleanupDuplicatePairings=async r=>{if(r.pairingTopic)try{const n=this.client.core.pairing.pairings.get(r.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)===r.peer.metadata.url&&s.topic&&s.topic!==n.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(n){this.client.logger.error(n)}},this.deleteSession=async(r,n)=>{const{self:i}=this.client.session.get(r);await this.client.core.relayer.unsubscribe(r),this.client.session.delete(r,Bn("USER_DISCONNECTED")),this.client.core.crypto.keychain.has(i.publicKey)&&await this.client.core.crypto.deleteKeyPair(i.publicKey),this.client.core.crypto.keychain.has(r)&&await this.client.core.crypto.deleteSymKey(r),n||this.client.core.expirer.del(r),this.client.core.storage.removeItem(lG).catch(s=>this.client.logger.warn(s)),this.getPendingSessionRequests().forEach(s=>{s.topic===r&&this.deletePendingSessionRequest(s.id,Bn("USER_DISCONNECTED"))})},this.deleteProposal=async(r,n)=>{await Promise.all([this.client.proposal.delete(r,Bn("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(r)])},this.deletePendingSessionRequest=async(r,n,i=!1)=>{await Promise.all([this.client.pendingRequest.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)]),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(s=>s.id!==r),i&&(this.sessionRequestQueue.state=wu.idle)},this.setExpiry=async(r,n)=>{this.client.session.keys.includes(r)&&await this.client.session.update(r,{expiry:n}),this.client.core.expirer.set(r,n)},this.setProposal=async(r,n)=>{await this.client.proposal.set(r,n),this.client.core.expirer.set(r,n.expiry)},this.setPendingSessionRequest=async r=>{const n=py.wc_sessionRequest.req.ttl,{id:i,topic:s,params:o,verifyContext:a}=r;await this.client.pendingRequest.set(i,{id:i,topic:s,params:o,verifyContext:a}),n&&this.client.core.expirer.set(i,Oc(n))},this.sendRequest=async r=>{const{topic:n,method:i,params:s,expiry:o,relayRpcId:a,clientRpcId:c,throwOnFailedPublish:l}=r,u=Rg(i,s,c);if(iv()&&Nst.includes(i)){const p=Ig(JSON.stringify(u));this.client.core.verify.register({attestationId:p})}const f=await this.client.core.crypto.encode(n,u),d=py[i].req;return o&&(d.ttl=o),a&&(d.id=a),this.client.core.history.set(n,u),l?(d.internal=gy(ho({},d.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,f,d)):this.client.core.relayer.publish(n,f,d).catch(p=>this.client.logger.error(p)),u.id},this.sendResult=async r=>{const{id:n,topic:i,result:s,throwOnFailedPublish:o}=r,a=S4(n,s),c=await this.client.core.crypto.encode(i,a),l=await this.client.core.history.get(i,n),u=py[l.request.method].res;o?(u.internal=gy(ho({},u.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,c,u)):this.client.core.relayer.publish(i,c,u).catch(f=>this.client.logger.error(f)),await this.client.core.history.resolve(a)},this.sendError=async(r,n,i)=>{const s=A4(r,i),o=await this.client.core.crypto.encode(n,s),a=await this.client.core.history.get(n,r),c=py[a.request.method].res;this.client.core.relayer.publish(n,o,c),await this.client.core.history.resolve(s)},this.cleanup=async()=>{const r=[],n=[];this.client.session.getAll().forEach(i=>{cd(i.expiry)&&r.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{cd(i.expiry)&&n.push(i.id)}),await Promise.all([...r.map(i=>this.deleteSession(i)),...n.map(i=>this.deleteProposal(i))])},this.onRelayEventRequest=async r=>{this.requestQueue.queue.push(r),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===wu.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=wu.active;const r=this.requestQueue.queue.shift();if(r)try{this.processRequest(r),await new Promise(n=>setTimeout(n,300))}catch(n){this.client.logger.warn(n)}}this.requestQueue.state=wu.idle},this.processRequest=r=>{const{topic:n,payload:i}=r,s=i.method;switch(s){case"wc_sessionPropose":return this.onSessionProposeRequest(n,i);case"wc_sessionSettle":return this.onSessionSettleRequest(n,i);case"wc_sessionUpdate":return this.onSessionUpdateRequest(n,i);case"wc_sessionExtend":return this.onSessionExtendRequest(n,i);case"wc_sessionPing":return this.onSessionPingRequest(n,i);case"wc_sessionDelete":return this.onSessionDeleteRequest(n,i);case"wc_sessionRequest":return this.onSessionRequest(n,i);case"wc_sessionEvent":return this.onSessionEventRequest(n,i);default:return this.client.logger.info(`Unsupported request method ${s}`)}},this.onRelayEventResponse=async r=>{const{topic:n,payload:i}=r,s=(await this.client.core.history.get(n,i.id)).request.method;switch(s){case"wc_sessionPropose":return this.onSessionProposeResponse(n,i);case"wc_sessionSettle":return this.onSessionSettleResponse(n,i);case"wc_sessionUpdate":return this.onSessionUpdateResponse(n,i);case"wc_sessionExtend":return this.onSessionExtendResponse(n,i);case"wc_sessionPing":return this.onSessionPingResponse(n,i);case"wc_sessionRequest":return this.onSessionRequestResponse(n,i);default:return this.client.logger.info(`Unsupported response method ${s}`)}},this.onRelayEventUnknownPayload=r=>{const{topic:n}=r,{message:i}=Ve("MISSING_OR_INVALID",`Decoded payload on topic ${n} is not identifiable as a JSON-RPC request or a response.`);throw new Error(i)},this.onSessionProposeRequest=async(r,n)=>{const{params:i,id:s}=n;try{this.isValidConnect(ho({},n.params));const o=Oc(lt.FIVE_MINUTES),a=ho({id:s,pairingTopic:r,expiry:o},i);await this.setProposal(s,a);const c=Ig(JSON.stringify(n)),l=await this.getVerifyContext(c,a.proposer.metadata);this.client.events.emit("session_proposal",{id:s,params:a,verifyContext:l})}catch(o){await this.sendError(s,r,o),this.client.logger.error(o)}},this.onSessionProposeResponse=async(r,n)=>{const{id:i}=n;if(Iu(n)){const{result:s}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:s});const o=this.client.proposal.get(i);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:o});const a=o.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:a});const c=s.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:c});const l=await this.client.core.crypto.generateSharedKey(a,c);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:l});const u=await this.client.core.relayer.subscribe(l);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:u}),await this.client.core.pairing.activate({topic:r})}else $c(n)&&(await this.client.proposal.delete(i,Bn("USER_DISCONNECTED")),this.events.emit(ii("session_connect"),{error:n.error}))},this.onSessionSettleRequest=async(r,n)=>{const{id:i,params:s}=n;try{this.isValidSessionSettleRequest(s);const{relay:o,controller:a,expiry:c,namespaces:l,requiredNamespaces:u,optionalNamespaces:f,sessionProperties:d,pairingTopic:p}=n.params,g=ho({topic:r,relay:o,expiry:c,namespaces:l,acknowledged:!0,pairingTopic:p,requiredNamespaces:u,optionalNamespaces:f,controller:a.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:a.publicKey,metadata:a.metadata}},d&&{sessionProperties:d});await this.sendResult({id:n.id,topic:r,result:!0}),this.events.emit(ii("session_connect"),{session:g}),this.cleanupDuplicatePairings(g)}catch(o){await this.sendError(i,r,o),this.client.logger.error(o)}},this.onSessionSettleResponse=async(r,n)=>{const{id:i}=n;Iu(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(ii("session_approve",i),{})):$c(n)&&(await this.client.session.delete(r,Bn("USER_DISCONNECTED")),this.events.emit(ii("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(r,n)=>{const{params:i,id:s}=n;try{const o=`${r}_session_update`,a=m3.get(o);if(a&&this.isRequestOutOfSync(a,s)){this.client.logger.info(`Discarding out of sync request - ${s}`);return}this.isValidUpdate(ho({topic:r},i)),await this.client.session.update(r,{namespaces:i.namespaces}),await this.sendResult({id:s,topic:r,result:!0}),this.client.events.emit("session_update",{id:s,topic:r,params:i}),m3.set(o,s)}catch(o){await this.sendError(s,r,o),this.client.logger.error(o)}},this.isRequestOutOfSync=(r,n)=>parseInt(n.toString().slice(0,-3))<=parseInt(r.toString().slice(0,-3)),this.onSessionUpdateResponse=(r,n)=>{const{id:i}=n;Iu(n)?this.events.emit(ii("session_update",i),{}):$c(n)&&this.events.emit(ii("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(r,n)=>{const{id:i}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,Oc(b3)),await this.sendResult({id:i,topic:r,result:!0}),this.client.events.emit("session_extend",{id:i,topic:r})}catch(s){await this.sendError(i,r,s),this.client.logger.error(s)}},this.onSessionExtendResponse=(r,n)=>{const{id:i}=n;Iu(n)?this.events.emit(ii("session_extend",i),{}):$c(n)&&this.events.emit(ii("session_extend",i),{error:n.error})},this.onSessionPingRequest=async(r,n)=>{const{id:i}=n;try{this.isValidPing({topic:r}),await this.sendResult({id:i,topic:r,result:!0}),this.client.events.emit("session_ping",{id:i,topic:r})}catch(s){await this.sendError(i,r,s),this.client.logger.error(s)}},this.onSessionPingResponse=(r,n)=>{const{id:i}=n;setTimeout(()=>{Iu(n)?this.events.emit(ii("session_ping",i),{}):$c(n)&&this.events.emit(ii("session_ping",i),{error:n.error})},500)},this.onSessionDeleteRequest=async(r,n)=>{const{id:i}=n;try{this.isValidDisconnect({topic:r,reason:n.params}),await Promise.all([new Promise(s=>{this.client.core.relayer.once(Es.publish,async()=>{s(await this.deleteSession(r))})}),this.sendResult({id:i,topic:r,result:!0})]),this.client.events.emit("session_delete",{id:i,topic:r})}catch(s){this.client.logger.error(s)}},this.onSessionRequest=async(r,n)=>{const{id:i,params:s}=n;try{this.isValidRequest(ho({topic:r},s));const o=Ig(JSON.stringify(Rg("wc_sessionRequest",s,i))),a=this.client.session.get(r),c=await this.getVerifyContext(o,a.peer.metadata),l={id:i,topic:r,params:s,verifyContext:c};await this.setPendingSessionRequest(l),this.addSessionRequestToSessionRequestQueue(l),this.processSessionRequestQueue()}catch(o){await this.sendError(i,r,o),this.client.logger.error(o)}},this.onSessionRequestResponse=(r,n)=>{const{id:i}=n;Iu(n)?this.events.emit(ii("session_request",i),{result:n.result}):$c(n)&&this.events.emit(ii("session_request",i),{error:n.error})},this.onSessionEventRequest=async(r,n)=>{const{id:i,params:s}=n;try{const o=`${r}_session_event_${s.event.name}`,a=m3.get(o);if(a&&this.isRequestOutOfSync(a,i)){this.client.logger.info(`Discarding out of sync request - ${i}`);return}this.isValidEmit(ho({topic:r},s)),this.client.events.emit("session_event",{id:i,topic:r,params:s}),m3.set(o,i)}catch(o){await this.sendError(i,r,o),this.client.logger.error(o)}},this.addSessionRequestToSessionRequestQueue=r=>{this.sessionRequestQueue.queue.push(r)},this.cleanupAfterResponse=r=>{this.deletePendingSessionRequest(r.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=wu.idle,this.processSessionRequestQueue()},lt.toMiliseconds(this.requestQueueDelay))},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===wu.active){this.client.logger.info("session request queue is already active.");return}const r=this.sessionRequestQueue.queue[0];if(!r){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=wu.active,this.client.events.emit("session_request",r)}catch(n){this.client.logger.error(n)}},this.onPairingCreated=r=>{if(r.active)return;const n=this.client.proposal.getAll().find(i=>i.pairingTopic===r.topic);n&&this.onSessionProposeRequest(r.topic,Rg("wc_sessionPropose",{requiredNamespaces:n.requiredNamespaces,optionalNamespaces:n.optionalNamespaces,relays:n.relays,proposer:n.proposer,sessionProperties:n.sessionProperties},n.id))},this.isValidConnect=async r=>{if(!go(r)){const{message:c}=Ve("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(c)}const{pairingTopic:n,requiredNamespaces:i,optionalNamespaces:s,sessionProperties:o,relays:a}=r;if(Ws(n)||await this.isValidPairingTopic(n),!Xet(a,!0)){const{message:c}=Ve("MISSING_OR_INVALID",`connect() relays: ${a}`);throw new Error(c)}!Ws(i)&&Pg(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!Ws(s)&&Pg(s)!==0&&this.validateNamespaces(s,"optionalNamespaces"),Ws(o)||this.validateSessionProps(o,"sessionProperties")},this.validateNamespaces=(r,n)=>{const i=Zet(r,"connect()",n);if(i)throw new Error(i.message)},this.isValidApprove=async r=>{if(!go(r))throw new Error(Ve("MISSING_OR_INVALID",`approve() params: ${r}`).message);const{id:n,namespaces:i,relayProtocol:s,sessionProperties:o}=r;await this.isValidProposalId(n);const a=this.client.proposal.get(n),c=CE(i,"approve()");if(c)throw new Error(c.message);const l=bV(a.requiredNamespaces,i,"approve()");if(l)throw new Error(l.message);if(!Bi(s,!0)){const{message:u}=Ve("MISSING_OR_INVALID",`approve() relayProtocol: ${s}`);throw new Error(u)}Ws(o)||this.validateSessionProps(o,"sessionProperties")},this.isValidReject=async r=>{if(!go(r)){const{message:s}=Ve("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(s)}const{id:n,reason:i}=r;if(await this.isValidProposalId(n),!ttt(i)){const{message:s}=Ve("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(s)}},this.isValidSessionSettleRequest=r=>{if(!go(r)){const{message:l}=Ve("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(l)}const{relay:n,controller:i,namespaces:s,expiry:o}=r;if(!oue(n)){const{message:l}=Ve("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(l)}const a=Vet(i,"onSessionSettleRequest()");if(a)throw new Error(a.message);const c=CE(s,"onSessionSettleRequest()");if(c)throw new Error(c.message);if(cd(o)){const{message:l}=Ve("EXPIRED","onSessionSettleRequest()");throw new Error(l)}},this.isValidUpdate=async r=>{if(!go(r)){const{message:c}=Ve("MISSING_OR_INVALID",`update() params: ${r}`);throw new Error(c)}const{topic:n,namespaces:i}=r;await this.isValidSessionTopic(n);const s=this.client.session.get(n),o=CE(i,"update()");if(o)throw new Error(o.message);const a=bV(s.requiredNamespaces,i,"update()");if(a)throw new Error(a.message)},this.isValidExtend=async r=>{if(!go(r)){const{message:i}=Ve("MISSING_OR_INVALID",`extend() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionTopic(n)},this.isValidRequest=async r=>{if(!go(r)){const{message:c}=Ve("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(c)}const{topic:n,request:i,chainId:s,expiry:o}=r;await this.isValidSessionTopic(n);const{namespaces:a}=this.client.session.get(n);if(!yV(a,s)){const{message:c}=Ve("MISSING_OR_INVALID",`request() chainId: ${s}`);throw new Error(c)}if(!rtt(i)){const{message:c}=Ve("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(c)}if(!stt(a,s,i.method)){const{message:c}=Ve("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(c)}if(o&&!ltt(o,C7)){const{message:c}=Ve("MISSING_OR_INVALID",`request() expiry: ${o}. Expiry must be a number (in seconds) between ${C7.min} and ${C7.max}`);throw new Error(c)}},this.isValidRespond=async r=>{var n;if(!go(r)){const{message:o}=Ve("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(o)}const{topic:i,response:s}=r;try{await this.isValidSessionTopic(i)}catch(o){throw(n=r==null?void 0:r.response)!=null&&n.id&&this.cleanupAfterResponse(r),o}if(!ntt(s)){const{message:o}=Ve("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(s)}`);throw new Error(o)}},this.isValidPing=async r=>{if(!go(r)){const{message:i}=Ve("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async r=>{if(!go(r)){const{message:a}=Ve("MISSING_OR_INVALID",`emit() params: ${r}`);throw new Error(a)}const{topic:n,event:i,chainId:s}=r;await this.isValidSessionTopic(n);const{namespaces:o}=this.client.session.get(n);if(!yV(o,s)){const{message:a}=Ve("MISSING_OR_INVALID",`emit() chainId: ${s}`);throw new Error(a)}if(!itt(i)){const{message:a}=Ve("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}if(!ott(o,s,i.name)){const{message:a}=Ve("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(a)}},this.isValidDisconnect=async r=>{if(!go(r)){const{message:i}=Ve("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.getVerifyContext=async(r,n)=>{const i={verified:{verifyUrl:n.verifyUrl||ng,validation:"UNKNOWN",origin:n.url||""}};try{const s=await this.client.core.verify.resolve({attestationId:r,verifyUrl:n.verifyUrl});s&&(i.verified.origin=s.origin,i.verified.isScam=s.isScam,i.verified.validation=s.origin===new URL(n.url).origin?"VALID":"INVALID")}catch(s){this.client.logger.info(s)}return this.client.logger.info(`Verify context: ${JSON.stringify(i)}`),i},this.validateSessionProps=(r,n)=>{Object.values(r).forEach(i=>{if(!Bi(i,!1)){const{message:s}=Ve("MISSING_OR_INVALID",`${n} must be in Record format. Received: ${JSON.stringify(i)}`);throw new Error(s)}})}}async isInitialized(){if(!this.initialized){const{message:e}=Ve("NOT_INITIALIZED",this.name);throw new Error(e)}await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(Es.message,async e=>{const{topic:r,message:n}=e;if(this.ignoredPayloadTypes.includes(this.client.core.crypto.getPayloadType(n)))return;const i=await this.client.core.crypto.decode(r,n);try{BM(i)?(this.client.core.history.set(r,i),this.onRelayEventRequest({topic:r,payload:i})):k4(i)?(await this.client.core.history.resolve(i),await this.onRelayEventResponse({topic:r,payload:i}),this.client.core.history.delete(r,i.id)):this.onRelayEventUnknownPayload({topic:r,payload:i})}catch(s){this.client.logger.error(s)}})}registerExpirerEvents(){this.client.core.expirer.on(Oa.expired,async e=>{const{topic:r,id:n}=iue(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,Ve("EXPIRED"),!0);r?this.client.session.keys.includes(r)&&(await this.deleteSession(r,!0),this.client.events.emit("session_expire",{topic:r})):n&&(await this.deleteProposal(n,!0),this.client.events.emit("proposal_expire",{id:n}))})}registerPairingEvents(){this.client.core.pairing.events.on(Ry.create,e=>this.onPairingCreated(e))}isValidPairingTopic(e){if(!Bi(e,!1)){const{message:r}=Ve("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(r)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:r}=Ve("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(r)}if(cd(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=Ve("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!Bi(e,!1)){const{message:r}=Ve("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(r)}if(!this.client.session.keys.includes(e)){const{message:r}=Ve("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(r)}if(cd(this.client.session.get(e).expiry)){await this.deleteSession(e);const{message:r}=Ve("EXPIRED",`session topic: ${e}`);throw new Error(r)}}async isValidSessionOrPairingTopic(e){if(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(Bi(e,!1)){const{message:r}=Ve("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(r)}else{const{message:r}=Ve("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(r)}}async isValidProposalId(e){if(!ett(e)){const{message:r}=Ve("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(r)}if(!this.client.proposal.keys.includes(e)){const{message:r}=Ve("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(r)}if(cd(this.client.proposal.get(e).expiry)){await this.deleteProposal(e);const{message:r}=Ve("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class Ust extends P4{constructor(e,r){super(e,r,Rst,UM),this.core=e,this.logger=r}}let zst=class extends P4{constructor(e,r){super(e,r,Tst,UM),this.core=e,this.logger=r}};class Hst extends P4{constructor(e,r){super(e,r,$st,UM,n=>n.id),this.core=e,this.logger=r}}let qst=class Uue extends drt{constructor(e){super(e),this.protocol=Lue,this.version=Bue,this.name=_7.name,this.events=new is.EventEmitter,this.on=(n,i)=>this.events.on(n,i),this.once=(n,i)=>this.events.once(n,i),this.off=(n,i)=>this.events.off(n,i),this.removeListener=(n,i)=>this.events.removeListener(n,i),this.removeAllListeners=n=>this.events.removeAllListeners(n),this.connect=async n=>{try{return await this.engine.connect(n)}catch(i){throw this.logger.error(i.message),i}},this.pair=async n=>{try{return await this.engine.pair(n)}catch(i){throw this.logger.error(i.message),i}},this.approve=async n=>{try{return await this.engine.approve(n)}catch(i){throw this.logger.error(i.message),i}},this.reject=async n=>{try{return await this.engine.reject(n)}catch(i){throw this.logger.error(i.message),i}},this.update=async n=>{try{return await this.engine.update(n)}catch(i){throw this.logger.error(i.message),i}},this.extend=async n=>{try{return await this.engine.extend(n)}catch(i){throw this.logger.error(i.message),i}},this.request=async n=>{try{return await this.engine.request(n)}catch(i){throw this.logger.error(i.message),i}},this.respond=async n=>{try{return await this.engine.respond(n)}catch(i){throw this.logger.error(i.message),i}},this.ping=async n=>{try{return await this.engine.ping(n)}catch(i){throw this.logger.error(i.message),i}},this.emit=async n=>{try{return await this.engine.emit(n)}catch(i){throw this.logger.error(i.message),i}},this.disconnect=async n=>{try{return await this.engine.disconnect(n)}catch(i){throw this.logger.error(i.message),i}},this.find=n=>{try{return this.engine.find(n)}catch(i){throw this.logger.error(i.message),i}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(n){throw this.logger.error(n.message),n}},this.name=(e==null?void 0:e.name)||_7.name,this.metadata=(e==null?void 0:e.metadata)||met();const r=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:cr.pino(cr.getDefaultLoggerOptions({level:(e==null?void 0:e.logger)||_7.logger}));this.core=(e==null?void 0:e.core)||new Pst(e),this.logger=cr.generateChildLogger(r,this.name),this.session=new zst(this.core,this.logger),this.proposal=new Ust(this.core,this.logger),this.pendingRequest=new Hst(this.core,this.logger),this.engine=new jst(this)}static async init(e){const r=new Uue(e);return await r.initialize(),r}get context(){return cr.getLoggerContext(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.engine.init(),this.core.verify.init({verifyUrl:this.metadata.verifyUrl}),this.logger.info("SignClient Initialization Success")}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}};var wR={exports:{}};(function(t,e){var r=typeof self<"u"?self:Je,n=function(){function s(){this.fetch=!1,this.DOMException=r.DOMException}return s.prototype=r,new s}();(function(s){(function(o){var a={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function c(x){return x&&DataView.prototype.isPrototypeOf(x)}if(a.arrayBuffer)var l=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(x){return x&&l.indexOf(Object.prototype.toString.call(x))>-1};function f(x){if(typeof x!="string"&&(x=String(x)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(x))throw new TypeError("Invalid character in header field name");return x.toLowerCase()}function d(x){return typeof x!="string"&&(x=String(x)),x}function p(x){var A={next:function(){var B=x.shift();return{done:B===void 0,value:B}}};return a.iterable&&(A[Symbol.iterator]=function(){return A}),A}function g(x){this.map={},x instanceof g?x.forEach(function(A,B){this.append(B,A)},this):Array.isArray(x)?x.forEach(function(A){this.append(A[0],A[1])},this):x&&Object.getOwnPropertyNames(x).forEach(function(A){this.append(A,x[A])},this)}g.prototype.append=function(x,A){x=f(x),A=d(A);var B=this.map[x];this.map[x]=B?B+", "+A:A},g.prototype.delete=function(x){delete this.map[f(x)]},g.prototype.get=function(x){return x=f(x),this.has(x)?this.map[x]:null},g.prototype.has=function(x){return this.map.hasOwnProperty(f(x))},g.prototype.set=function(x,A){this.map[f(x)]=d(A)},g.prototype.forEach=function(x,A){for(var B in this.map)this.map.hasOwnProperty(B)&&x.call(A,this.map[B],B,this)},g.prototype.keys=function(){var x=[];return this.forEach(function(A,B){x.push(B)}),p(x)},g.prototype.values=function(){var x=[];return this.forEach(function(A){x.push(A)}),p(x)},g.prototype.entries=function(){var x=[];return this.forEach(function(A,B){x.push([B,A])}),p(x)},a.iterable&&(g.prototype[Symbol.iterator]=g.prototype.entries);function v(x){if(x.bodyUsed)return Promise.reject(new TypeError("Already read"));x.bodyUsed=!0}function y(x){return new Promise(function(A,B){x.onload=function(){A(x.result)},x.onerror=function(){B(x.error)}})}function b(x){var A=new FileReader,B=y(A);return A.readAsArrayBuffer(x),B}function w(x){var A=new FileReader,B=y(A);return A.readAsText(x),B}function E(x){for(var A=new Uint8Array(x),B=new Array(A.length),z=0;z-1?A:x}function T(x,A){A=A||{};var B=A.body;if(x instanceof T){if(x.bodyUsed)throw new TypeError("Already read");this.url=x.url,this.credentials=x.credentials,A.headers||(this.headers=new g(x.headers)),this.method=x.method,this.mode=x.mode,this.signal=x.signal,!B&&x._bodyInit!=null&&(B=x._bodyInit,x.bodyUsed=!0)}else this.url=String(x);if(this.credentials=A.credentials||this.credentials||"same-origin",(A.headers||!this.headers)&&(this.headers=new g(A.headers)),this.method=_(A.method||this.method||"GET"),this.mode=A.mode||this.mode||null,this.signal=A.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&B)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(B)}T.prototype.clone=function(){return new T(this,{body:this._bodyInit})};function Q(x){var A=new FormData;return x.trim().split("&").forEach(function(B){if(B){var z=B.split("="),R=z.shift().replace(/\+/g," "),L=z.join("=").replace(/\+/g," ");A.append(decodeURIComponent(R),decodeURIComponent(L))}}),A}function Z(x){var A=new g,B=x.replace(/\r?\n[\t ]+/g," ");return B.split(/\r?\n/).forEach(function(z){var R=z.split(":"),L=R.shift().trim();if(L){var q=R.join(":").trim();A.append(L,q)}}),A}S.call(T.prototype);function ne(x,A){A||(A={}),this.type="default",this.status=A.status===void 0?200:A.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in A?A.statusText:"OK",this.headers=new g(A.headers),this.url=A.url||"",this._initBody(x)}S.call(ne.prototype),ne.prototype.clone=function(){return new ne(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new g(this.headers),url:this.url})},ne.error=function(){var x=new ne(null,{status:0,statusText:""});return x.type="error",x};var ce=[301,302,303,307,308];ne.redirect=function(x,A){if(ce.indexOf(A)===-1)throw new RangeError("Invalid status code");return new ne(null,{status:A,headers:{location:x}})},o.DOMException=s.DOMException;try{new o.DOMException}catch{o.DOMException=function(A,B){this.message=A,this.name=B;var z=Error(A);this.stack=z.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function K(x,A){return new Promise(function(B,z){var R=new T(x,A);if(R.signal&&R.signal.aborted)return z(new o.DOMException("Aborted","AbortError"));var L=new XMLHttpRequest;function q(){L.abort()}L.onload=function(){var N={status:L.status,statusText:L.statusText,headers:Z(L.getAllResponseHeaders()||"")};N.url="responseURL"in L?L.responseURL:N.headers.get("X-Request-URL");var I="response"in L?L.response:L.responseText;B(new ne(I,N))},L.onerror=function(){z(new TypeError("Network request failed"))},L.ontimeout=function(){z(new TypeError("Network request failed"))},L.onabort=function(){z(new o.DOMException("Aborted","AbortError"))},L.open(R.method,R.url,!0),R.credentials==="include"?L.withCredentials=!0:R.credentials==="omit"&&(L.withCredentials=!1),"responseType"in L&&a.blob&&(L.responseType="blob"),R.headers.forEach(function(N,I){L.setRequestHeader(I,N)}),R.signal&&(R.signal.addEventListener("abort",q),L.onreadystatechange=function(){L.readyState===4&&R.signal.removeEventListener("abort",q)}),L.send(typeof R._bodyInit>"u"?null:R._bodyInit)})}return K.polyfill=!0,s.fetch||(s.fetch=K,s.Headers=g,s.Request=T,s.Response=ne),o.Headers=g,o.Request=T,o.Response=ne,o.fetch=K,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e})(wR,wR.exports);var Wst=wR.exports;const dG=rs(Wst),Vst={Accept:"application/json","Content-Type":"application/json"},Gst="POST",hG={headers:Vst,method:Gst},pG=10;class _h{constructor(e,r=!1){if(this.url=e,this.disableProviderPing=r,this.events=new is.EventEmitter,this.isAvailable=!1,this.registering=!1,!jV(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=r}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}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,r){this.isAvailable||await this.register();try{const n=a1(e),s=await(await dG(this.url,Object.assign(Object.assign({},hG),{body:n}))).json();this.onPayload({data:s})}catch(n){this.onError(e.id,n)}}async register(e=this.url){if(!jV(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,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"));n()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const r=a1({id:1,jsonrpc:"2.0",method:"test",params:[]});await dG(e,Object.assign(Object.assign({},hG),{body:r}))}this.onOpen()}catch(r){const n=this.parseError(r);throw this.events.emit("register_error",n),this.onClose(),n}}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 r=typeof e.data=="string"?Xw(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),s=A4(e,i);this.events.emit("payload",s)}parseError(e,r=this.url){return yue(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>pG&&this.events.setMaxListeners(pG)}}const gG="error",Kst="wss://relay.walletconnect.com",Jst="wc",Qst="universal_provider",mG=`${Jst}@2:${Qst}:`,Yst="https://rpc.walletconnect.com/v1/",Of={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var my=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},xR={exports:{}};/** +* @license +* Lodash +* Copyright OpenJS Foundation and other contributors +* Released under MIT license +* Based on Underscore.js 1.8.3 +* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors +*/(function(t,e){(function(){var r,n="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__",l=500,u="__lodash_placeholder__",f=1,d=2,p=4,g=1,v=2,y=1,b=2,w=4,E=8,C=16,S=32,P=64,_=128,T=256,Q=512,Z=30,ne="...",ce=800,K=16,x=1,A=2,B=3,z=1/0,R=9007199254740991,L=17976931348623157e292,q=0/0,N=4294967295,I=N-1,U=N>>>1,re=[["ary",_],["bind",y],["bindKey",b],["curry",E],["curryRight",C],["flip",Q],["partial",S],["partialRight",P],["rearg",T]],M="[object Arguments]",G="[object Array]",H="[object AsyncFunction]",J="[object Boolean]",X="[object Date]",D="[object DOMException]",F="[object Error]",Y="[object Function]",ue="[object GeneratorFunction]",he="[object Map]",Ce="[object Number]",Me="[object Null]",Oe="[object Object]",We="[object Promise]",ot="[object Proxy]",ze="[object RegExp]",Le="[object Set]",et="[object String]",He="[object Symbol]",Ge="[object Undefined]",Ye="[object WeakMap]",qe="[object WeakSet]",ee="[object ArrayBuffer]",j="[object DataView]",W="[object Float32Array]",ie="[object Float64Array]",de="[object Int8Array]",pe="[object Int16Array]",be="[object Int32Array]",je="[object Uint8Array]",Fe="[object Uint8ClampedArray]",Qe="[object Uint16Array]",kt="[object Uint32Array]",Ze=/\b__p \+= '';/g,$t=/\b(__p \+=) '' \+/g,Wn=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Xt=/&(?:amp|lt|gt|quot|#39);/g,rr=/[&<>"']/g,gr=RegExp(Xt.source),dt=RegExp(rr.source),yt=/<%-([\s\S]+?)%>/g,mr=/<%([\s\S]+?)%>/g,vt=/<%=([\s\S]+?)%>/g,ht=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,kr=/^\w*$/,_t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,bt=/[\\^$.*+?()[\]{}|]/g,Ir=RegExp(bt.source),wt=/^\s+/,xt=/\s/,vr=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ft=/\{\n\/\* \[wrapped with (.+)\] \*/,Ct=/,? & /,Pr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,yr=/[()=,{}\[\]\/\s]/,br=/\\(\\)?/g,Rs=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Wt=/\w*$/,wr=/^[-+]0x[0-9a-f]+$/i,cs=/^0b[01]+$/i,ls=/^\[object .+?Constructor\]$/,us=/^0o[0-7]+$/i,fs=/^(?:0|[1-9]\d*)$/,$n=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,no=/($^)/,cc=/['\n\r\u2028\u2029\\]/g,io="\\ud800-\\udfff",lc="\\u0300-\\u036f",uc="\\ufe20-\\ufe2f",so="\\u20d0-\\u20ff",ma=lc+uc+so,va="\\u2700-\\u27bf",di="a-z\\xdf-\\xf6\\xf8-\\xff",Ih="\\xac\\xb1\\xd7\\xf7",Ph="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Rh="\\u2000-\\u206f",Th=" \\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",Nf="A-Z\\xc0-\\xd6\\xd8-\\xde",lx="\\ufe0e\\ufe0f",Oh=Ih+Ph+Rh+Th,hv="['’]",$h="["+io+"]",pv="["+Oh+"]",Nh="["+ma+"]",ux="\\d+",W4="["+va+"]",fx="["+di+"]",dx="[^"+io+Oh+ux+va+di+Nf+"]",F1="\\ud83c[\\udffb-\\udfff]",V4="(?:"+Nh+"|"+F1+")",hx="[^"+io+"]",j1="(?:\\ud83c[\\udde6-\\uddff]){2}",Mf="[\\ud800-\\udbff][\\udc00-\\udfff]",Lo="["+Nf+"]",px="\\u200d",gx="(?:"+fx+"|"+dx+")",el="(?:"+Lo+"|"+dx+")",mx="(?:"+hv+"(?:d|ll|m|re|s|t|ve))?",vx="(?:"+hv+"(?:D|LL|M|RE|S|T|VE))?",yx=V4+"?",bx="["+lx+"]?",G4="(?:"+px+"(?:"+[hx,j1,Mf].join("|")+")"+bx+yx+")*",su="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",wx="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",xx=bx+yx+G4,U1="(?:"+[W4,j1,Mf].join("|")+")"+xx,K4="(?:"+[hx+Nh+"?",Nh,j1,Mf,$h].join("|")+")",gv=RegExp(hv,"g"),J4=RegExp(Nh,"g"),z1=RegExp(F1+"(?="+F1+")|"+K4+xx,"g"),Ex=RegExp([Lo+"?"+fx+"+"+mx+"(?="+[pv,Lo,"$"].join("|")+")",el+"+"+vx+"(?="+[pv,Lo+gx,"$"].join("|")+")",Lo+"?"+gx+"+"+mx,Lo+"+"+vx,wx,su,ux,U1].join("|"),"g"),_x=RegExp("["+px+io+ma+lx+"]"),Mh=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Cx=["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"],Q4=-1,Vr={};Vr[W]=Vr[ie]=Vr[de]=Vr[pe]=Vr[be]=Vr[je]=Vr[Fe]=Vr[Qe]=Vr[kt]=!0,Vr[M]=Vr[G]=Vr[ee]=Vr[J]=Vr[j]=Vr[X]=Vr[F]=Vr[Y]=Vr[he]=Vr[Ce]=Vr[Oe]=Vr[ze]=Vr[Le]=Vr[et]=Vr[Ye]=!1;var Br={};Br[M]=Br[G]=Br[ee]=Br[j]=Br[J]=Br[X]=Br[W]=Br[ie]=Br[de]=Br[pe]=Br[be]=Br[he]=Br[Ce]=Br[Oe]=Br[ze]=Br[Le]=Br[et]=Br[He]=Br[je]=Br[Fe]=Br[Qe]=Br[kt]=!0,Br[F]=Br[Y]=Br[Ye]=!1;var le={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},ve={"&":"&","<":"<",">":">",'"':""","'":"'"},Ne={"&":"&","<":"<",">":">",""":'"',"'":"'"},Xe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Gr=parseFloat,Ut=parseInt,sn=typeof my=="object"&&my&&my.Object===Object&&my,ei=typeof self=="object"&&self&&self.Object===Object&&self,fr=sn||ei||Function("return this")(),Kr=e&&!e.nodeType&&e,Vn=Kr&&!0&&t&&!t.nodeType&&t,oo=Vn&&Vn.exports===Kr,ti=oo&&sn.process,on=function(){try{var ye=Vn&&Vn.require&&Vn.require("util").types;return ye||ti&&ti.binding&&ti.binding("util")}catch{}}(),Ts=on&&on.isArrayBuffer,fc=on&&on.isDate,ya=on&&on.isMap,tl=on&&on.isRegExp,mv=on&&on.isSet,Dh=on&&on.isTypedArray;function Ai(ye,ke,_e){switch(_e.length){case 0:return ye.call(ke);case 1:return ye.call(ke,_e[0]);case 2:return ye.call(ke,_e[0],_e[1]);case 3:return ye.call(ke,_e[0],_e[1],_e[2])}return ye.apply(ke,_e)}function dhe(ye,ke,_e,tt){for(var Bt=-1,Or=ye==null?0:ye.length;++Bt-1}function Y4(ye,ke,_e){for(var tt=-1,Bt=ye==null?0:ye.length;++tt-1;);return _e}function UD(ye,ke){for(var _e=ye.length;_e--&&H1(ke,ye[_e],0)>-1;);return _e}function xhe(ye,ke){for(var _e=ye.length,tt=0;_e--;)ye[_e]===ke&&++tt;return tt}var Ehe=tS(le),_he=tS(ve);function Che(ye){return"\\"+Xe[ye]}function She(ye,ke){return ye==null?r:ye[ke]}function q1(ye){return _x.test(ye)}function Ahe(ye){return Mh.test(ye)}function khe(ye){for(var ke,_e=[];!(ke=ye.next()).done;)_e.push(ke.value);return _e}function sS(ye){var ke=-1,_e=Array(ye.size);return ye.forEach(function(tt,Bt){_e[++ke]=[Bt,tt]}),_e}function zD(ye,ke){return function(_e){return ye(ke(_e))}}function Bf(ye,ke){for(var _e=-1,tt=ye.length,Bt=0,Or=[];++_e-1}function p0e(h,m){var k=this.__data__,V=zx(k,h);return V<0?(++this.size,k.push([h,m])):k[V][1]=m,this}ou.prototype.clear=u0e,ou.prototype.delete=f0e,ou.prototype.get=d0e,ou.prototype.has=h0e,ou.prototype.set=p0e;function au(h){var m=-1,k=h==null?0:h.length;for(this.clear();++m=m?h:m)),h}function Ea(h,m,k,V,te,oe){var fe,ge=m&f,xe=m&d,Re=m&p;if(k&&(fe=te?k(h,V,te,oe):k(h)),fe!==r)return fe;if(!wn(h))return h;var Te=zt(h);if(Te){if(fe=y1e(h),!ge)return ao(h,fe)}else{var De=hs(h),Ke=De==Y||De==ue;if(qf(h))return CL(h,ge);if(De==Oe||De==M||Ke&&!te){if(fe=xe||Ke?{}:HL(h),!ge)return xe?a1e(h,R0e(fe,h)):o1e(h,eL(fe,h))}else{if(!Br[De])return te?h:{};fe=b1e(h,De,ge)}}oe||(oe=new hc);var at=oe.get(h);if(at)return at;oe.set(h,fe),yB(h)?h.forEach(function(At){fe.add(Ea(At,m,k,At,h,oe))}):mB(h)&&h.forEach(function(At,nr){fe.set(nr,Ea(At,m,k,nr,h,oe))});var St=Re?xe?TS:RS:xe?lo:ki,Jt=Te?r:St(h);return ba(Jt||h,function(At,nr){Jt&&(nr=At,At=h[nr]),_v(fe,nr,Ea(At,m,k,nr,h,oe))}),fe}function T0e(h){var m=ki(h);return function(k){return tL(k,h,m)}}function tL(h,m,k){var V=k.length;if(h==null)return!V;for(h=Jr(h);V--;){var te=k[V],oe=m[te],fe=h[te];if(fe===r&&!(te in h)||!oe(fe))return!1}return!0}function rL(h,m,k){if(typeof h!="function")throw new wa(o);return Rv(function(){h.apply(r,k)},m)}function Cv(h,m,k,V){var te=-1,oe=Sx,fe=!0,ge=h.length,xe=[],Re=m.length;if(!ge)return xe;k&&(m=pn(m,Bo(k))),V?(oe=Y4,fe=!1):m.length>=i&&(oe=vv,fe=!1,m=new Fh(m));e:for(;++tete?0:te+k),V=V===r||V>te?te:Kt(V),V<0&&(V+=te),V=k>V?0:wB(V);k0&&k(ge)?m>1?zi(ge,m-1,k,V,te):Lf(te,ge):V||(te[te.length]=ge)}return te}var dS=RL(),sL=RL(!0);function rl(h,m){return h&&dS(h,m,ki)}function hS(h,m){return h&&sL(h,m,ki)}function qx(h,m){return Df(m,function(k){return du(h[k])})}function Uh(h,m){m=zf(m,h);for(var k=0,V=m.length;h!=null&&km}function N0e(h,m){return h!=null&&Dr.call(h,m)}function M0e(h,m){return h!=null&&m in Jr(h)}function D0e(h,m,k){return h>=ds(m,k)&&h=120&&Te.length>=120)?new Fh(fe&&Te):r}Te=h[0];var De=-1,Ke=ge[0];e:for(;++De-1;)ge!==h&&Mx.call(ge,xe,1),Mx.call(h,xe,1);return h}function mL(h,m){for(var k=h?m.length:0,V=k-1;k--;){var te=m[k];if(k==V||te!==oe){var oe=te;fu(te)?Mx.call(h,te,1):_S(h,te)}}return h}function wS(h,m){return h+Bx(QD()*(m-h+1))}function J0e(h,m,k,V){for(var te=-1,oe=pi(Lx((m-h)/(k||1)),0),fe=_e(oe);oe--;)fe[V?oe:++te]=h,h+=k;return fe}function xS(h,m){var k="";if(!h||m<1||m>R)return k;do m%2&&(k+=h),m=Bx(m/2),m&&(h+=h);while(m);return k}function Yt(h,m){return BS(VL(h,m,uo),h+"")}function Q0e(h){return XD(tp(h))}function Y0e(h,m){var k=tp(h);return t5(k,jh(m,0,k.length))}function kv(h,m,k,V){if(!wn(h))return h;m=zf(m,h);for(var te=-1,oe=m.length,fe=oe-1,ge=h;ge!=null&&++tete?0:te+m),k=k>te?te:k,k<0&&(k+=te),te=m>k?0:k-m>>>0,m>>>=0;for(var oe=_e(te);++V>>1,fe=h[oe];fe!==null&&!jo(fe)&&(k?fe<=m:fe=i){var Re=m?null:f1e(h);if(Re)return kx(Re);fe=!1,te=vv,xe=new Fh}else xe=m?[]:ge;e:for(;++V=V?h:_a(h,m,k)}var _L=zhe||function(h){return fr.clearTimeout(h)};function CL(h,m){if(m)return h.slice();var k=h.length,V=WD?WD(k):new h.constructor(k);return h.copy(V),V}function kS(h){var m=new h.constructor(h.byteLength);return new $x(m).set(new $x(h)),m}function r1e(h,m){var k=m?kS(h.buffer):h.buffer;return new h.constructor(k,h.byteOffset,h.byteLength)}function n1e(h){var m=new h.constructor(h.source,Wt.exec(h));return m.lastIndex=h.lastIndex,m}function i1e(h){return Ev?Jr(Ev.call(h)):{}}function SL(h,m){var k=m?kS(h.buffer):h.buffer;return new h.constructor(k,h.byteOffset,h.length)}function AL(h,m){if(h!==m){var k=h!==r,V=h===null,te=h===h,oe=jo(h),fe=m!==r,ge=m===null,xe=m===m,Re=jo(m);if(!ge&&!Re&&!oe&&h>m||oe&&fe&&xe&&!ge&&!Re||V&&fe&&xe||!k&&xe||!te)return 1;if(!V&&!oe&&!Re&&h=ge)return xe;var Re=k[V];return xe*(Re=="desc"?-1:1)}}return h.index-m.index}function kL(h,m,k,V){for(var te=-1,oe=h.length,fe=k.length,ge=-1,xe=m.length,Re=pi(oe-fe,0),Te=_e(xe+Re),De=!V;++ge1?k[te-1]:r,fe=te>2?k[2]:r;for(oe=h.length>3&&typeof oe=="function"?(te--,oe):r,fe&&$s(k[0],k[1],fe)&&(oe=te<3?r:oe,te=1),m=Jr(m);++V-1?te[oe?m[fe]:fe]:r}}function $L(h){return uu(function(m){var k=m.length,V=k,te=xa.prototype.thru;for(h&&m.reverse();V--;){var oe=m[V];if(typeof oe!="function")throw new wa(o);if(te&&!fe&&Xx(oe)=="wrapper")var fe=new xa([],!0)}for(V=fe?V:k;++V1&&dr.reverse(),Te&&xege))return!1;var Re=oe.get(h),Te=oe.get(m);if(Re&&Te)return Re==m&&Te==h;var De=-1,Ke=!0,at=k&v?new Fh:r;for(oe.set(h,m),oe.set(m,h);++De1?"& ":"")+m[V],m=m.join(k>2?", ":" "),h.replace(vr,`{ +/* [wrapped with `+m+`] */ +`)}function x1e(h){return zt(h)||qh(h)||!!(KD&&h&&h[KD])}function fu(h,m){var k=typeof h;return m=m??R,!!m&&(k=="number"||k!="symbol"&&fs.test(h))&&h>-1&&h%1==0&&h0){if(++m>=ce)return arguments[0]}else m=0;return h.apply(r,arguments)}}function t5(h,m){var k=-1,V=h.length,te=V-1;for(m=m===r?V:m;++k1?h[m-1]:r;return k=typeof k=="function"?(h.pop(),k):r,iB(h,k)});function sB(h){var m=se(h);return m.__chain__=!0,m}function Ope(h,m){return m(h),h}function r5(h,m){return m(h)}var $pe=uu(function(h){var m=h.length,k=m?h[0]:0,V=this.__wrapped__,te=function(oe){return fS(oe,h)};return m>1||this.__actions__.length||!(V instanceof sr)||!fu(k)?this.thru(te):(V=V.slice(k,+k+(m?1:0)),V.__actions__.push({func:r5,args:[te],thisArg:r}),new xa(V,this.__chain__).thru(function(oe){return m&&!oe.length&&oe.push(r),oe}))});function Npe(){return sB(this)}function Mpe(){return new xa(this.value(),this.__chain__)}function Dpe(){this.__values__===r&&(this.__values__=bB(this.value()));var h=this.__index__>=this.__values__.length,m=h?r:this.__values__[this.__index__++];return{done:h,value:m}}function Lpe(){return this}function Bpe(h){for(var m,k=this;k instanceof Ux;){var V=ZL(k);V.__index__=0,V.__values__=r,m?te.__wrapped__=V:m=V;var te=V;k=k.__wrapped__}return te.__wrapped__=h,m}function Fpe(){var h=this.__wrapped__;if(h instanceof sr){var m=h;return this.__actions__.length&&(m=new sr(this)),m=m.reverse(),m.__actions__.push({func:r5,args:[FS],thisArg:r}),new xa(m,this.__chain__)}return this.thru(FS)}function jpe(){return xL(this.__wrapped__,this.__actions__)}var Upe=Kx(function(h,m,k){Dr.call(h,k)?++h[k]:cu(h,k,1)});function zpe(h,m,k){var V=zt(h)?ND:O0e;return k&&$s(h,m,k)&&(m=r),V(h,Et(m,3))}function Hpe(h,m){var k=zt(h)?Df:iL;return k(h,Et(m,3))}var qpe=OL(XL),Wpe=OL(eB);function Vpe(h,m){return zi(n5(h,m),1)}function Gpe(h,m){return zi(n5(h,m),z)}function Kpe(h,m,k){return k=k===r?1:Kt(k),zi(n5(h,m),k)}function oB(h,m){var k=zt(h)?ba:jf;return k(h,Et(m,3))}function aB(h,m){var k=zt(h)?hhe:nL;return k(h,Et(m,3))}var Jpe=Kx(function(h,m,k){Dr.call(h,k)?h[k].push(m):cu(h,k,[m])});function Qpe(h,m,k,V){h=co(h)?h:tp(h),k=k&&!V?Kt(k):0;var te=h.length;return k<0&&(k=pi(te+k,0)),c5(h)?k<=te&&h.indexOf(m,k)>-1:!!te&&H1(h,m,k)>-1}var Ype=Yt(function(h,m,k){var V=-1,te=typeof m=="function",oe=co(h)?_e(h.length):[];return jf(h,function(fe){oe[++V]=te?Ai(m,fe,k):Sv(fe,m,k)}),oe}),Zpe=Kx(function(h,m,k){cu(h,k,m)});function n5(h,m){var k=zt(h)?pn:uL;return k(h,Et(m,3))}function Xpe(h,m,k,V){return h==null?[]:(zt(m)||(m=m==null?[]:[m]),k=V?r:k,zt(k)||(k=k==null?[]:[k]),pL(h,m,k))}var ege=Kx(function(h,m,k){h[k?0:1].push(m)},function(){return[[],[]]});function tge(h,m,k){var V=zt(h)?Z4:BD,te=arguments.length<3;return V(h,Et(m,4),k,te,jf)}function rge(h,m,k){var V=zt(h)?phe:BD,te=arguments.length<3;return V(h,Et(m,4),k,te,nL)}function nge(h,m){var k=zt(h)?Df:iL;return k(h,o5(Et(m,3)))}function ige(h){var m=zt(h)?XD:Q0e;return m(h)}function sge(h,m,k){(k?$s(h,m,k):m===r)?m=1:m=Kt(m);var V=zt(h)?k0e:Y0e;return V(h,m)}function oge(h){var m=zt(h)?I0e:X0e;return m(h)}function age(h){if(h==null)return 0;if(co(h))return c5(h)?W1(h):h.length;var m=hs(h);return m==he||m==Le?h.size:vS(h).length}function cge(h,m,k){var V=zt(h)?X4:e1e;return k&&$s(h,m,k)&&(m=r),V(h,Et(m,3))}var lge=Yt(function(h,m){if(h==null)return[];var k=m.length;return k>1&&$s(h,m[0],m[1])?m=[]:k>2&&$s(m[0],m[1],m[2])&&(m=[m[0]]),pL(h,zi(m,1),[])}),i5=Hhe||function(){return fr.Date.now()};function uge(h,m){if(typeof m!="function")throw new wa(o);return h=Kt(h),function(){if(--h<1)return m.apply(this,arguments)}}function cB(h,m,k){return m=k?r:m,m=h&&m==null?h.length:m,lu(h,_,r,r,r,r,m)}function lB(h,m){var k;if(typeof m!="function")throw new wa(o);return h=Kt(h),function(){return--h>0&&(k=m.apply(this,arguments)),h<=1&&(m=r),k}}var US=Yt(function(h,m,k){var V=y;if(k.length){var te=Bf(k,X1(US));V|=S}return lu(h,V,m,k,te)}),uB=Yt(function(h,m,k){var V=y|b;if(k.length){var te=Bf(k,X1(uB));V|=S}return lu(m,V,h,k,te)});function fB(h,m,k){m=k?r:m;var V=lu(h,E,r,r,r,r,r,m);return V.placeholder=fB.placeholder,V}function dB(h,m,k){m=k?r:m;var V=lu(h,C,r,r,r,r,r,m);return V.placeholder=dB.placeholder,V}function hB(h,m,k){var V,te,oe,fe,ge,xe,Re=0,Te=!1,De=!1,Ke=!0;if(typeof h!="function")throw new wa(o);m=Sa(m)||0,wn(k)&&(Te=!!k.leading,De="maxWait"in k,oe=De?pi(Sa(k.maxWait)||0,m):oe,Ke="trailing"in k?!!k.trailing:Ke);function at(Kn){var gc=V,pu=te;return V=te=r,Re=Kn,fe=h.apply(pu,gc),fe}function St(Kn){return Re=Kn,ge=Rv(nr,m),Te?at(Kn):fe}function Jt(Kn){var gc=Kn-xe,pu=Kn-Re,OB=m-gc;return De?ds(OB,oe-pu):OB}function At(Kn){var gc=Kn-xe,pu=Kn-Re;return xe===r||gc>=m||gc<0||De&&pu>=oe}function nr(){var Kn=i5();if(At(Kn))return dr(Kn);ge=Rv(nr,Jt(Kn))}function dr(Kn){return ge=r,Ke&&V?at(Kn):(V=te=r,fe)}function Uo(){ge!==r&&_L(ge),Re=0,V=xe=te=ge=r}function Ns(){return ge===r?fe:dr(i5())}function zo(){var Kn=i5(),gc=At(Kn);if(V=arguments,te=this,xe=Kn,gc){if(ge===r)return St(xe);if(De)return _L(ge),ge=Rv(nr,m),at(xe)}return ge===r&&(ge=Rv(nr,m)),fe}return zo.cancel=Uo,zo.flush=Ns,zo}var fge=Yt(function(h,m){return rL(h,1,m)}),dge=Yt(function(h,m,k){return rL(h,Sa(m)||0,k)});function hge(h){return lu(h,Q)}function s5(h,m){if(typeof h!="function"||m!=null&&typeof m!="function")throw new wa(o);var k=function(){var V=arguments,te=m?m.apply(this,V):V[0],oe=k.cache;if(oe.has(te))return oe.get(te);var fe=h.apply(this,V);return k.cache=oe.set(te,fe)||oe,fe};return k.cache=new(s5.Cache||au),k}s5.Cache=au;function o5(h){if(typeof h!="function")throw new wa(o);return function(){var m=arguments;switch(m.length){case 0:return!h.call(this);case 1:return!h.call(this,m[0]);case 2:return!h.call(this,m[0],m[1]);case 3:return!h.call(this,m[0],m[1],m[2])}return!h.apply(this,m)}}function pge(h){return lB(2,h)}var gge=t1e(function(h,m){m=m.length==1&&zt(m[0])?pn(m[0],Bo(Et())):pn(zi(m,1),Bo(Et()));var k=m.length;return Yt(function(V){for(var te=-1,oe=ds(V.length,k);++te=m}),qh=aL(function(){return arguments}())?aL:function(h){return Nn(h)&&Dr.call(h,"callee")&&!GD.call(h,"callee")},zt=_e.isArray,Rge=Ts?Bo(Ts):B0e;function co(h){return h!=null&&a5(h.length)&&!du(h)}function Gn(h){return Nn(h)&&co(h)}function Tge(h){return h===!0||h===!1||Nn(h)&&Os(h)==J}var qf=Whe||XS,Oge=fc?Bo(fc):F0e;function $ge(h){return Nn(h)&&h.nodeType===1&&!Tv(h)}function Nge(h){if(h==null)return!0;if(co(h)&&(zt(h)||typeof h=="string"||typeof h.splice=="function"||qf(h)||ep(h)||qh(h)))return!h.length;var m=hs(h);if(m==he||m==Le)return!h.size;if(Pv(h))return!vS(h).length;for(var k in h)if(Dr.call(h,k))return!1;return!0}function Mge(h,m){return Av(h,m)}function Dge(h,m,k){k=typeof k=="function"?k:r;var V=k?k(h,m):r;return V===r?Av(h,m,r,k):!!V}function HS(h){if(!Nn(h))return!1;var m=Os(h);return m==F||m==D||typeof h.message=="string"&&typeof h.name=="string"&&!Tv(h)}function Lge(h){return typeof h=="number"&&JD(h)}function du(h){if(!wn(h))return!1;var m=Os(h);return m==Y||m==ue||m==H||m==ot}function gB(h){return typeof h=="number"&&h==Kt(h)}function a5(h){return typeof h=="number"&&h>-1&&h%1==0&&h<=R}function wn(h){var m=typeof h;return h!=null&&(m=="object"||m=="function")}function Nn(h){return h!=null&&typeof h=="object"}var mB=ya?Bo(ya):U0e;function Bge(h,m){return h===m||mS(h,m,$S(m))}function Fge(h,m,k){return k=typeof k=="function"?k:r,mS(h,m,$S(m),k)}function jge(h){return vB(h)&&h!=+h}function Uge(h){if(C1e(h))throw new Bt(s);return cL(h)}function zge(h){return h===null}function Hge(h){return h==null}function vB(h){return typeof h=="number"||Nn(h)&&Os(h)==Ce}function Tv(h){if(!Nn(h)||Os(h)!=Oe)return!1;var m=Nx(h);if(m===null)return!0;var k=Dr.call(m,"constructor")&&m.constructor;return typeof k=="function"&&k instanceof k&&Rx.call(k)==Fhe}var qS=tl?Bo(tl):z0e;function qge(h){return gB(h)&&h>=-R&&h<=R}var yB=mv?Bo(mv):H0e;function c5(h){return typeof h=="string"||!zt(h)&&Nn(h)&&Os(h)==et}function jo(h){return typeof h=="symbol"||Nn(h)&&Os(h)==He}var ep=Dh?Bo(Dh):q0e;function Wge(h){return h===r}function Vge(h){return Nn(h)&&hs(h)==Ye}function Gge(h){return Nn(h)&&Os(h)==qe}var Kge=Zx(yS),Jge=Zx(function(h,m){return h<=m});function bB(h){if(!h)return[];if(co(h))return c5(h)?dc(h):ao(h);if(yv&&h[yv])return khe(h[yv]());var m=hs(h),k=m==he?sS:m==Le?kx:tp;return k(h)}function hu(h){if(!h)return h===0?h:0;if(h=Sa(h),h===z||h===-z){var m=h<0?-1:1;return m*L}return h===h?h:0}function Kt(h){var m=hu(h),k=m%1;return m===m?k?m-k:m:0}function wB(h){return h?jh(Kt(h),0,N):0}function Sa(h){if(typeof h=="number")return h;if(jo(h))return q;if(wn(h)){var m=typeof h.valueOf=="function"?h.valueOf():h;h=wn(m)?m+"":m}if(typeof h!="string")return h===0?h:+h;h=FD(h);var k=cs.test(h);return k||us.test(h)?Ut(h.slice(2),k?2:8):wr.test(h)?q:+h}function xB(h){return nl(h,lo(h))}function Qge(h){return h?jh(Kt(h),-R,R):h===0?h:0}function Mr(h){return h==null?"":Fo(h)}var Yge=Y1(function(h,m){if(Pv(m)||co(m)){nl(m,ki(m),h);return}for(var k in m)Dr.call(m,k)&&_v(h,k,m[k])}),EB=Y1(function(h,m){nl(m,lo(m),h)}),l5=Y1(function(h,m,k,V){nl(m,lo(m),h,V)}),Zge=Y1(function(h,m,k,V){nl(m,ki(m),h,V)}),Xge=uu(fS);function eme(h,m){var k=Q1(h);return m==null?k:eL(k,m)}var tme=Yt(function(h,m){h=Jr(h);var k=-1,V=m.length,te=V>2?m[2]:r;for(te&&$s(m[0],m[1],te)&&(V=1);++k1),oe}),nl(h,TS(h),k),V&&(k=Ea(k,f|d|p,d1e));for(var te=m.length;te--;)_S(k,m[te]);return k});function bme(h,m){return CB(h,o5(Et(m)))}var wme=uu(function(h,m){return h==null?{}:G0e(h,m)});function CB(h,m){if(h==null)return{};var k=pn(TS(h),function(V){return[V]});return m=Et(m),gL(h,k,function(V,te){return m(V,te[0])})}function xme(h,m,k){m=zf(m,h);var V=-1,te=m.length;for(te||(te=1,h=r);++Vm){var V=h;h=m,m=V}if(k||h%1||m%1){var te=QD();return ds(h+te*(m-h+Gr("1e-"+((te+"").length-1))),m)}return wS(h,m)}var Ome=Z1(function(h,m,k){return m=m.toLowerCase(),h+(k?kB(m):m)});function kB(h){return GS(Mr(h).toLowerCase())}function IB(h){return h=Mr(h),h&&h.replace($n,Ehe).replace(J4,"")}function $me(h,m,k){h=Mr(h),m=Fo(m);var V=h.length;k=k===r?V:jh(Kt(k),0,V);var te=k;return k-=m.length,k>=0&&h.slice(k,te)==m}function Nme(h){return h=Mr(h),h&&dt.test(h)?h.replace(rr,_he):h}function Mme(h){return h=Mr(h),h&&Ir.test(h)?h.replace(bt,"\\$&"):h}var Dme=Z1(function(h,m,k){return h+(k?"-":"")+m.toLowerCase()}),Lme=Z1(function(h,m,k){return h+(k?" ":"")+m.toLowerCase()}),Bme=TL("toLowerCase");function Fme(h,m,k){h=Mr(h),m=Kt(m);var V=m?W1(h):0;if(!m||V>=m)return h;var te=(m-V)/2;return Yx(Bx(te),k)+h+Yx(Lx(te),k)}function jme(h,m,k){h=Mr(h),m=Kt(m);var V=m?W1(h):0;return m&&V>>0,k?(h=Mr(h),h&&(typeof m=="string"||m!=null&&!qS(m))&&(m=Fo(m),!m&&q1(h))?Hf(dc(h),0,k):h.split(m,k)):[]}var Gme=Z1(function(h,m,k){return h+(k?" ":"")+GS(m)});function Kme(h,m,k){return h=Mr(h),k=k==null?0:jh(Kt(k),0,h.length),m=Fo(m),h.slice(k,k+m.length)==m}function Jme(h,m,k){var V=se.templateSettings;k&&$s(h,m,k)&&(m=r),h=Mr(h),m=l5({},m,V,BL);var te=l5({},m.imports,V.imports,BL),oe=ki(te),fe=iS(te,oe),ge,xe,Re=0,Te=m.interpolate||no,De="__p += '",Ke=oS((m.escape||no).source+"|"+Te.source+"|"+(Te===vt?Rs:no).source+"|"+(m.evaluate||no).source+"|$","g"),at="//# sourceURL="+(Dr.call(m,"sourceURL")?(m.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Q4+"]")+` +`;h.replace(Ke,function(At,nr,dr,Uo,Ns,zo){return dr||(dr=Uo),De+=h.slice(Re,zo).replace(cc,Che),nr&&(ge=!0,De+=`' + +__e(`+nr+`) + +'`),Ns&&(xe=!0,De+=`'; +`+Ns+`; +__p += '`),dr&&(De+=`' + +((__t = (`+dr+`)) == null ? '' : __t) + +'`),Re=zo+At.length,At}),De+=`'; +`;var St=Dr.call(m,"variable")&&m.variable;if(!St)De=`with (obj) { +`+De+` +} +`;else if(yr.test(St))throw new Bt(a);De=(xe?De.replace(Ze,""):De).replace($t,"$1").replace(Wn,"$1;"),De="function("+(St||"obj")+`) { +`+(St?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(ge?", __e = _.escape":"")+(xe?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+De+`return __p +}`;var Jt=RB(function(){return Or(oe,at+"return "+De).apply(r,fe)});if(Jt.source=De,HS(Jt))throw Jt;return Jt}function Qme(h){return Mr(h).toLowerCase()}function Yme(h){return Mr(h).toUpperCase()}function Zme(h,m,k){if(h=Mr(h),h&&(k||m===r))return FD(h);if(!h||!(m=Fo(m)))return h;var V=dc(h),te=dc(m),oe=jD(V,te),fe=UD(V,te)+1;return Hf(V,oe,fe).join("")}function Xme(h,m,k){if(h=Mr(h),h&&(k||m===r))return h.slice(0,HD(h)+1);if(!h||!(m=Fo(m)))return h;var V=dc(h),te=UD(V,dc(m))+1;return Hf(V,0,te).join("")}function eve(h,m,k){if(h=Mr(h),h&&(k||m===r))return h.replace(wt,"");if(!h||!(m=Fo(m)))return h;var V=dc(h),te=jD(V,dc(m));return Hf(V,te).join("")}function tve(h,m){var k=Z,V=ne;if(wn(m)){var te="separator"in m?m.separator:te;k="length"in m?Kt(m.length):k,V="omission"in m?Fo(m.omission):V}h=Mr(h);var oe=h.length;if(q1(h)){var fe=dc(h);oe=fe.length}if(k>=oe)return h;var ge=k-W1(V);if(ge<1)return V;var xe=fe?Hf(fe,0,ge).join(""):h.slice(0,ge);if(te===r)return xe+V;if(fe&&(ge+=xe.length-ge),qS(te)){if(h.slice(ge).search(te)){var Re,Te=xe;for(te.global||(te=oS(te.source,Mr(Wt.exec(te))+"g")),te.lastIndex=0;Re=te.exec(Te);)var De=Re.index;xe=xe.slice(0,De===r?ge:De)}}else if(h.indexOf(Fo(te),ge)!=ge){var Ke=xe.lastIndexOf(te);Ke>-1&&(xe=xe.slice(0,Ke))}return xe+V}function rve(h){return h=Mr(h),h&&gr.test(h)?h.replace(Xt,The):h}var nve=Z1(function(h,m,k){return h+(k?" ":"")+m.toUpperCase()}),GS=TL("toUpperCase");function PB(h,m,k){return h=Mr(h),m=k?r:m,m===r?Ahe(h)?Nhe(h):vhe(h):h.match(m)||[]}var RB=Yt(function(h,m){try{return Ai(h,r,m)}catch(k){return HS(k)?k:new Bt(k)}}),ive=uu(function(h,m){return ba(m,function(k){k=il(k),cu(h,k,US(h[k],h))}),h});function sve(h){var m=h==null?0:h.length,k=Et();return h=m?pn(h,function(V){if(typeof V[1]!="function")throw new wa(o);return[k(V[0]),V[1]]}):[],Yt(function(V){for(var te=-1;++teR)return[];var k=N,V=ds(h,N);m=Et(m),h-=N;for(var te=nS(V,m);++k0||m<0)?new sr(k):(h<0?k=k.takeRight(-h):h&&(k=k.drop(h)),m!==r&&(m=Kt(m),k=m<0?k.dropRight(-m):k.take(m-h)),k)},sr.prototype.takeRightWhile=function(h){return this.reverse().takeWhile(h).reverse()},sr.prototype.toArray=function(){return this.take(N)},rl(sr.prototype,function(h,m){var k=/^(?:filter|find|map|reject)|While$/.test(m),V=/^(?:head|last)$/.test(m),te=se[V?"take"+(m=="last"?"Right":""):m],oe=V||/^find/.test(m);te&&(se.prototype[m]=function(){var fe=this.__wrapped__,ge=V?[1]:arguments,xe=fe instanceof sr,Re=ge[0],Te=xe||zt(fe),De=function(nr){var dr=te.apply(se,Lf([nr],ge));return V&&Ke?dr[0]:dr};Te&&k&&typeof Re=="function"&&Re.length!=1&&(xe=Te=!1);var Ke=this.__chain__,at=!!this.__actions__.length,St=oe&&!Ke,Jt=xe&&!at;if(!oe&&Te){fe=Jt?fe:new sr(this);var At=h.apply(fe,ge);return At.__actions__.push({func:r5,args:[De],thisArg:r}),new xa(At,Ke)}return St&&Jt?h.apply(this,ge):(At=this.thru(De),St?V?At.value()[0]:At.value():At)})}),ba(["pop","push","shift","sort","splice","unshift"],function(h){var m=Ix[h],k=/^(?:push|sort|unshift)$/.test(h)?"tap":"thru",V=/^(?:pop|shift)$/.test(h);se.prototype[h]=function(){var te=arguments;if(V&&!this.__chain__){var oe=this.value();return m.apply(zt(oe)?oe:[],te)}return this[k](function(fe){return m.apply(zt(fe)?fe:[],te)})}}),rl(sr.prototype,function(h,m){var k=se[m];if(k){var V=k.name+"";Dr.call(J1,V)||(J1[V]=[]),J1[V].push({name:m,func:k})}}),J1[Jx(r,b).name]=[{name:"wrapper",func:r}],sr.prototype.clone=r0e,sr.prototype.reverse=n0e,sr.prototype.value=i0e,se.prototype.at=$pe,se.prototype.chain=Npe,se.prototype.commit=Mpe,se.prototype.next=Dpe,se.prototype.plant=Bpe,se.prototype.reverse=Fpe,se.prototype.toJSON=se.prototype.valueOf=se.prototype.value=jpe,se.prototype.first=se.prototype.head,yv&&(se.prototype[yv]=Lpe),se},V1=Mhe();Vn?((Vn.exports=V1)._=V1,Kr._=V1):fr._=V1}).call(my)})(xR,xR.exports);var Zst=Object.defineProperty,Xst=Object.defineProperties,eot=Object.getOwnPropertyDescriptors,vG=Object.getOwnPropertySymbols,tot=Object.prototype.hasOwnProperty,rot=Object.prototype.propertyIsEnumerable,yG=(t,e,r)=>e in t?Zst(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,w3=(t,e)=>{for(var r in e||(e={}))tot.call(e,r)&&yG(t,r,e[r]);if(vG)for(var r of vG(e))rot.call(e,r)&&yG(t,r,e[r]);return t},not=(t,e)=>Xst(t,eot(e));function oh(t,e,r){var n;const i=YXe(t);return((n=e.rpcMap)==null?void 0:n[i.reference])||`${Yst}?chainId=${i.namespace}:${i.reference}&projectId=${r}`}function $1(t){return t.includes(":")?t.split(":")[1]:t}function zue(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function iot(t,e){const r=Object.keys(e.namespaces).filter(i=>i.includes(t));if(!r.length)return[];const n=[];return r.forEach(i=>{const s=e.namespaces[i].accounts;n.push(...s)}),n}function sot(t={},e={}){const r=bG(t),n=bG(e);return xR.exports.merge(r,n)}function bG(t){var e,r,n,i;const s={};if(!Pg(t))return s;for(const[o,a]of Object.entries(t)){const c=$M(o)?[o]:a.chains,l=a.methods||[],u=a.events||[],f=a.rpcMap||{},d=Py(o);s[d]=not(w3(w3({},s[d]),a),{chains:d7(c,(e=s[d])==null?void 0:e.chains),methods:d7(l,(r=s[d])==null?void 0:r.methods),events:d7(u,(n=s[d])==null?void 0:n.events),rpcMap:w3(w3({},f),(i=s[d])==null?void 0:i.rpcMap)})}return s}function oot(t){return t.includes(":")?t.split(":")[2]:t}function aot(t){const e={};for(const[r,n]of Object.entries(t)){const i=n.methods||[],s=n.events||[],o=n.accounts||[],a=$M(r)?[r]:n.chains?n.chains:zue(n.accounts);e[r]={chains:a,methods:i,events:s,accounts:o}}return e}function S7(t){return typeof t=="number"?t:t.includes("0x")?parseInt(t,16):t.includes(":")?Number(t.split(":")[1]):Number(t)}const Hue={},yn=t=>Hue[t],A7=(t,e)=>{Hue[t]=e};class cot{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=yn("events"),this.client=yn("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,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Of.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=$1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||oh(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tf(new _h(n,yn("disableProviderPing")))}}class lot{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=yn("events"),this.client=yn("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())}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,r){this.httpProviders[e]||this.setHttpProvider(parseInt(e),r),this.chainId=parseInt(e),this.events.emit(Of.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,r){const n=r||oh(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tf(new _h(n,yn("disableProviderPing")))}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=parseInt($1(r));e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}async handleSwitchChain(e){var r,n;let i=e.request.params?(r=e.request.params[0])==null?void 0:r.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:(n=this.namespace.chains)==null?void 0:n[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}`)}}class uot{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=yn("events"),this.client=yn("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,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Of.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(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=$1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||oh(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tf(new _h(n,yn("disableProviderPing")))}}class fot{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=yn("events"),this.client=yn("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,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Of.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=$1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||oh(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tf(new _h(n,yn("disableProviderPing")))}}class dot{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=yn("events"),this.client=yn("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,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Of.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{const n=this.getCardanoRPCUrl(r),i=$1(r);e[i]=this.createHttpProvider(i,n)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}getCardanoRPCUrl(e){const r=this.namespace.rpcMap;if(r)return r[e]}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||this.getCardanoRPCUrl(e);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tf(new _h(n,yn("disableProviderPing")))}}class hot{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=yn("events"),this.client=yn("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,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Of.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(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=$1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||oh(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tf(new _h(n,yn("disableProviderPing")))}}class pot{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=yn("events"),this.client=yn("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,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Of.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(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=$1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||oh(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tf(new _h(n,yn("disableProviderPing")))}}class got{constructor(e){this.name="near",this.namespace=e.namespace,this.events=yn("events"),this.client=yn("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,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||oh(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(Of.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||oh(e,this.namespace);return typeof n>"u"?void 0:new Tf(new _h(n,yn("disableProviderPing")))}}var mot=Object.defineProperty,vot=Object.defineProperties,yot=Object.getOwnPropertyDescriptors,wG=Object.getOwnPropertySymbols,bot=Object.prototype.hasOwnProperty,wot=Object.prototype.propertyIsEnumerable,xG=(t,e,r)=>e in t?mot(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,x3=(t,e)=>{for(var r in e||(e={}))bot.call(e,r)&&xG(t,r,e[r]);if(wG)for(var r of wG(e))wot.call(e,r)&&xG(t,r,e[r]);return t},k7=(t,e)=>vot(t,yot(e));class zM{constructor(e){this.events=new GN,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,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:cr.pino(cr.getDefaultLoggerOptions({level:(e==null?void 0:e.logger)||gG})),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const r=new zM(e);return await r.initialize(),r}async request(e,r){const[n,i]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(n).request({request:x3({},e),chainId:`${n}:${i}`,topic:this.session.topic})}sendAsync(e,r,n){const i=new Date().getTime();this.request(e,n).then(s=>r(null,S4(i,s))).catch(s=>r(s,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}),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:Bn("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)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}removeListener(e,r){this.events.removeListener(e,r)}off(e,r){this.events.off(e,r)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let r=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(r>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:n,approval:i}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});n&&(this.uri=n,this.events.emit("display_uri",n)),await i().then(s=>{this.session=s,this.namespaces||(this.namespaces=aot(s.namespaces),this.persist("namespaces",this.namespaces))}).catch(s=>{if(s.message!==jue)throw s;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,r){try{if(!this.session)return;const[n,i]=this.validateChain(e);this.getProvider(n).setDefaultChain(i,r)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(eu(r)){for(const n of r)e.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${r.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await qst.init({logger:this.providerOpts.logger||gG,relayUrl:this.providerOpts.relayUrl||Kst,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name}),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(r=>Py(r)))];A7("client",this.client),A7("events",this.events),A7("disableProviderPing",this.disableProviderPing),e.forEach(r=>{if(!this.session)return;const n=iot(r,this.session),i=zue(n),s=sot(this.namespaces,this.optionalNamespaces),o=k7(x3({},s[r]),{accounts:n,chains:i});switch(r){case"eip155":this.rpcProviders[r]=new lot({namespace:o});break;case"solana":this.rpcProviders[r]=new uot({namespace:o});break;case"cosmos":this.rpcProviders[r]=new fot({namespace:o});break;case"polkadot":this.rpcProviders[r]=new cot({namespace:o});break;case"cip34":this.rpcProviders[r]=new dot({namespace:o});break;case"elrond":this.rpcProviders[r]=new hot({namespace:o});break;case"multiversx":this.rpcProviders[r]=new pot({namespace:o});break;case"near":this.rpcProviders[r]=new got({namespace:o});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{const{params:r}=e,{event:n}=r;if(n.name==="accountsChanged"){const i=n.data;i&&eu(i)&&this.events.emit("accountsChanged",i.map(oot))}else if(n.name==="chainChanged"){const i=r.chainId,s=r.event.data,o=Py(i),a=S7(i)!==S7(s)?`${o}:${S7(s)}`:i;this.onChainChanged(a)}else this.events.emit(n.name,n.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:r})=>{var n;const{namespaces:i}=r,s=(n=this.client)==null?void 0:n.session.get(e);this.session=k7(x3({},s),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:r})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",k7(x3({},Bn("USER_DISCONNECTED")),{data:e.topic}))}),this.on(Of.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){if(!this.rpcProviders[e])throw new Error(`Provider not found: ${e}`);return this.rpcProviders[e]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var r;this.getProvider(e).updateNamespace((r=this.session)==null?void 0:r.namespaces[e])})}setNamespaces(e){const{namespaces:r,optionalNamespaces:n,sessionProperties:i}=e;r&&Object.keys(r).length&&(this.namespaces=r),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=i,this.persist("namespaces",r),this.persist("optionalNamespaces",n)}validateChain(e){const[r,n]=(e==null?void 0:e.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,n];if(r&&!Object.keys(this.namespaces||{}).map(o=>Py(o)).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&n)return[r,n];const i=Py(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()}onChainChanged(e,r=!1){var n;if(!this.namespaces)return;const[i,s]=this.validateChain(e);r||this.getProvider(i).setDefaultChain(s),((n=this.namespaces[i])!=null?n:this.namespaces[`${i}:${s}`]).defaultChain=s,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",s)}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,r){this.client.core.storage.setItem(`${mG}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${mG}/${e}`)}}const xot=zM,Eot="wc",_ot="ethereum_provider",Cot=`${Eot}@2:${_ot}:`,Sot="https://rpc.walletconnect.com/v1/",ER=["eth_sendTransaction","personal_sign"],Aot=["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"],_R=["chainChanged","accountsChanged"],kot=["chainChanged","accountsChanged","message","disconnect","connect"];var Iot=Object.defineProperty,Pot=Object.defineProperties,Rot=Object.getOwnPropertyDescriptors,EG=Object.getOwnPropertySymbols,Tot=Object.prototype.hasOwnProperty,Oot=Object.prototype.propertyIsEnumerable,_G=(t,e,r)=>e in t?Iot(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ty=(t,e)=>{for(var r in e||(e={}))Tot.call(e,r)&&_G(t,r,e[r]);if(EG)for(var r of EG(e))Oot.call(e,r)&&_G(t,r,e[r]);return t},CG=(t,e)=>Pot(t,Rot(e));function x_(t){return Number(t[0].split(":")[1])}function I7(t){return`0x${t.toString(16)}`}function $ot(t){const{chains:e,optionalChains:r,methods:n,optionalMethods:i,events:s,optionalEvents:o,rpcMap:a}=t;if(!eu(e))throw new Error("Invalid chains");const c={chains:e,methods:n||ER,events:s||_R,rpcMap:Ty({},e.length?{[x_(e)]:a[x_(e)]}:{})},l=s==null?void 0:s.filter(p=>!_R.includes(p)),u=n==null?void 0:n.filter(p=>!ER.includes(p));if(!r&&!o&&!i&&!(l!=null&&l.length)&&!(u!=null&&u.length))return{required:e.length?c:void 0};const f=(l==null?void 0:l.length)&&(u==null?void 0:u.length)||!r,d={chains:[...new Set(f?c.chains.concat(r||[]):r)],methods:[...new Set(c.methods.concat(i!=null&&i.length?i:Aot))],events:[...new Set(c.events.concat(o!=null&&o.length?o:kot))],rpcMap:a};return{required:e.length?c:void 0,optional:r.length?d:void 0}}class HM{constructor(){this.events=new is.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=Cot,this.on=(e,r)=>(this.events.on(e,r),this),this.once=(e,r)=>(this.events.once(e,r),this),this.removeListener=(e,r)=>(this.events.removeListener(e,r),this),this.off=(e,r)=>(this.events.off(e,r),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const r=new HM;return await r.initialize(e),r}async request(e){return await this.signer.request(e,this.formatChainId(this.chainId))}sendAsync(e,r){this.signer.sendAsync(e,r,this.formatChainId(this.chainId))}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:r,optional:n}=$ot(this.rpc);try{const i=await new Promise(async(o,a)=>{var c;this.rpc.showQrModal&&((c=this.modal)==null||c.subscribeModal(l=>{!l.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),a(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(CG(Ty({namespaces:Ty({},r&&{[this.namespace]:r})},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:e==null?void 0:e.pairingTopic})).then(l=>{o(l)}).catch(l=>{a(new Error(l.message))})});if(!i)return;const s=ZXe(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:s),this.setAccounts(s),this.events.emit("connect",{chainId:I7(this.chainId)})}catch(i){throw this.signer.logger.error(i),i}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:r}=e,{event:n}=r;n.name==="accountsChanged"?(this.accounts=this.parseAccounts(n.data),this.events.emit("accountsChanged",this.accounts)):n.name==="chainChanged"?this.setChainId(this.formatChainId(n.data)):this.events.emit(n.name,n.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{const r=parseInt(e);this.chainId=r,this.events.emit("chainChanged",I7(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",CG(Ty({},Bn("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var r,n;this.rpc.showQrModal&&((r=this.modal)==null||r.closeModal(),(n=this.modal)==null||n.openModal({uri:e})),this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const r=e.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));r.length&&(this.chainId=r[0],this.events.emit("chainChanged",I7(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const r=this.parseChainId(e);this.chainId=r,this.switchEthereumChain(r)}}parseAccountId(e){const[r,n,i]=e.split(":");return{chainId:`${r}:${n}`,address:i}}setAccounts(e){this.accounts=e.filter(r=>this.parseChainId(this.parseAccountId(r).chainId)===this.chainId).map(r=>this.parseAccountId(r).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var r,n;const i=(r=e==null?void 0:e.chains)!=null?r:[],s=(n=e==null?void 0:e.optionalChains)!=null?n:[],o=i.concat(s);if(!o.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const a=i.length?(e==null?void 0:e.methods)||ER:[],c=i.length?(e==null?void 0:e.events)||_R:[],l=(e==null?void 0:e.optionalMethods)||[],u=(e==null?void 0:e.optionalEvents)||[],f=(e==null?void 0:e.rpcMap)||this.buildRpcMap(o,e.projectId),d=(e==null?void 0:e.qrModalOptions)||void 0;return{chains:i==null?void 0:i.map(p=>this.formatChainId(p)),optionalChains:s.map(p=>this.formatChainId(p)),methods:a,events:c,optionalMethods:l,optionalEvents:u,rpcMap:f,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:d,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,r){const n={};return e.forEach(i=>{n[i]=this.getRpcUrl(i,r)}),n}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?x_(this.rpc.chains):x_(this.rpc.optionalChains),this.signer=await xot.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let r;try{const{WalletConnectModal:n}=await uoe(()=>import("./index-4b2fd375.js").then(i=>i.i),[],import.meta.url);r=n}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(r)try{this.modal=new r(Ty({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(n){throw this.signer.logger.error(n),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:r,optionalChains:n,rpcMap:i}=e;r&&eu(r)&&(this.rpc.chains=r.map(s=>this.formatChainId(s)),r.forEach(s=>{this.rpc.rpcMap[s]=(i==null?void 0:i[s])||this.getRpcUrl(s)})),n&&eu(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n==null?void 0:n.map(s=>this.formatChainId(s)),n.forEach(s=>{this.rpc.rpcMap[s]=(i==null?void 0:i[s])||this.getRpcUrl(s)}))}getRpcUrl(e,r){var n;return((n=this.rpc.rpcMap)==null?void 0:n[e])||`${Sot}?chainId=eip155:${e}&projectId=${r||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),r=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:r==null?void 0:r.accounts),this.setAccounts(r==null?void 0:r.accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(r=>this.parseAccount(r))}}const Not=HM;qM.type="walletConnect";function qM(t){const e=t.isNewChainsStale??!0;let r,n;const i="eip155";return s=>({id:"walletConnect",name:"WalletConnect",type:qM.type,async setup(){const o=await this.getProvider().catch(()=>null);o&&(o.on("connect",this.onConnect.bind(this)),o.on("session_delete",this.onSessionDelete.bind(this)))},async connect({chainId:o,...a}={}){var c,l;try{const u=await this.getProvider();if(!u)throw new l0;u.on("display_uri",this.onDisplayUri);let f=o;if(!f){const v=await((c=s.storage)==null?void 0:c.getItem("state"))??{};s.chains.some(b=>b.id===v.chainId)?f=v.chainId:f=(l=s.chains[0])==null?void 0:l.id}if(!f)throw new Error("No chains found on connector.");const d=await this.isChainsStale();if(u.session&&d&&await u.disconnect(),!u.session||d){const v=s.chains.filter(y=>y.id!==f).map(y=>y.id);await u.connect({optionalChains:[f,...v],..."pairingTopic"in a?{pairingTopic:a.pairingTopic}:{}}),this.setRequestedChainsIds(s.chains.map(y=>y.id))}const p=(await u.enable()).map(v=>Co(v)),g=await this.getChainId();return u.removeListener("display_uri",this.onDisplayUri),u.removeListener("connect",this.onConnect.bind(this)),u.on("accountsChanged",this.onAccountsChanged.bind(this)),u.on("chainChanged",this.onChainChanged),u.on("disconnect",this.onDisconnect.bind(this)),u.on("session_delete",this.onSessionDelete.bind(this)),{accounts:p,chainId:g}}catch(u){throw/(user rejected|connection request reset)/i.test(u==null?void 0:u.message)?new en(u):u}},async disconnect(){const o=await this.getProvider();try{await(o==null?void 0:o.disconnect())}catch(a){if(!/No matching key/i.test(a.message))throw a}finally{o==null||o.removeListener("accountsChanged",this.onAccountsChanged.bind(this)),o==null||o.removeListener("chainChanged",this.onChainChanged),o==null||o.removeListener("disconnect",this.onDisconnect.bind(this)),o==null||o.removeListener("session_delete",this.onSessionDelete.bind(this)),o==null||o.on("connect",this.onConnect.bind(this)),this.setRequestedChainsIds([])}},async getAccounts(){return(await this.getProvider()).accounts.map(a=>Co(a))},async getProvider({chainId:o}={}){var c;async function a(){const l=s.chains.map(u=>u.id);if(l.length)return await Not.init({...t,disableProviderPing:!0,optionalChains:l,projectId:t.projectId,rpcMap:Object.fromEntries(s.chains.map(u=>[u.id,u.rpcUrls.default.http[0]])),showQrModal:t.showQrModal??!0})}return r||(n||(n=a()),r=await n,r==null||r.events.setMaxListeners(1/0)),o&&await((c=this.switchChain)==null?void 0:c.call(this,{chainId:o})),r},async getChainId(){return(await this.getProvider()).chainId},async isAuthorized(){try{const[o,a]=await Promise.all([this.getAccounts(),this.getProvider()]);return o.length?await this.isChainsStale()&&a.session?(await a.disconnect().catch(()=>{}),!1):!0:!1}catch{return!1}},async switchChain({chainId:o}){var c;const a=s.chains.find(l=>l.id===o);if(!a)throw new Xa(new n1);try{const l=await this.getProvider(),u=this.getNamespaceChainsIds(),f=this.getNamespaceMethods();if(!u.includes(o)&&f.includes("wallet_addEthereumChain")){await l.request({method:"wallet_addEthereumChain",params:[{chainId:Mt(a.id),blockExplorerUrls:[(c=a.blockExplorers)==null?void 0:c.default.url],chainName:a.name,nativeCurrency:a.nativeCurrency,rpcUrls:[...a.rpcUrls.default.http]}]});const p=await this.getRequestedChainsIds();this.setRequestedChainsIds([...p,o])}return await l.request({method:"wallet_switchEthereumChain",params:[{chainId:Mt(o)}]}),a}catch(l){const u=typeof l=="string"?l:l==null?void 0:l.message;throw/user rejected request/i.test(u)?new en(l):new Xa(l)}},onAccountsChanged(o){o.length===0?this.onDisconnect():s.emitter.emit("change",{accounts:o.map(a=>Co(a))})},onChainChanged(o){const a=Fd(o);s.emitter.emit("change",{chainId:a})},async onConnect(o){const a=Fd(o.chainId),c=await this.getAccounts();s.emitter.emit("connect",{accounts:c,chainId:a})},async onDisconnect(o){this.setRequestedChainsIds([]),s.emitter.emit("disconnect");const a=await this.getProvider();a.removeListener("accountsChanged",this.onAccountsChanged.bind(this)),a.removeListener("chainChanged",this.onChainChanged),a.removeListener("disconnect",this.onDisconnect.bind(this)),a.removeListener("session_delete",this.onSessionDelete.bind(this)),a.on("connect",this.onConnect.bind(this))},onDisplayUri(o){s.emitter.emit("message",{type:"display_uri",data:o})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){var a,c,l;return r?((l=(c=(a=r.session)==null?void 0:a.namespaces[i])==null?void 0:c.chains)==null?void 0:l.map(u=>parseInt(u.split(":")[1]||"")))??[]:[]},getNamespaceMethods(){var a,c;return r?((c=(a=r.session)==null?void 0:a.namespaces[i])==null?void 0:c.methods)??[]:[]},async getRequestedChainsIds(){var o;return await((o=s.storage)==null?void 0:o.getItem(this.requestedChainsStorageKey))??[]},async isChainsStale(){if(this.getNamespaceMethods().includes("wallet_addEthereumChain")||!e)return!1;const a=s.chains.map(u=>u.id),c=this.getNamespaceChainsIds();if(c.length&&!c.some(u=>a.includes(u)))return!1;const l=await this.getRequestedChainsIds();return!a.every(u=>l.includes(u))},async setRequestedChainsIds(o){var a;await((a=s.storage)==null?void 0:a.setItem(this.requestedChainsStorageKey,o))},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}})}function Dt(){return Dt=Object.assign?Object.assign.bind():function(t){for(var e=1;e0){const f=c[0];`${a[0].toUpperCase()}${a.slice(1)}`,a=f}return f=>({id:"sequence",name:"Sequence",type:Ch.type,async setup(){const d=await this.getProvider();d.on("chainChanged",p=>{f.emitter.emit("change",{chain:{id:Mp(p),unsupported:!1}})}),d.on("accountsChanged",p=>{f.emitter.emit("accountsChanged",this.onAccountsChanged(p))}),d.on("disconnect",()=>{this.onDisconnect()})},async connect(){const d=await this.getProvider();if(!d.isConnected()){var p,g;const y=localStorage.getItem(Qi.Theme),b=localStorage.getItem(Qi.EthAuthSettings),w=b?JSON.parse(b):{},E=Dt({authorize:!0},w,s,{settings:Dt({theme:y||"dark"},s==null?void 0:s.settings)}),C=await d.connect(E);if(C.error)throw new en(new Error(C.error));if(!C.connected)throw new en(new Error("Wallet connection rejected"));const S=(p=C.proof)==null?void 0:p.proofString,P=(g=C.proof)==null?void 0:g.typedData;if(S){const _=JSON.stringify({proofString:S,typedData:P});localStorage.setItem(Qi.EthAuthProof,_)}}return{accounts:[...await this.getAccounts()],chainId:d.getChainId()}},async disconnect(){(await this.getProvider()).disconnect()},async getAccounts(){const d=await this.getProvider();return[Co(await d.getSigner().getAddress())]},async getProvider(){try{return Zg.getWallet()}catch{const p=localStorage.get(Qi.ProjectAccessKey);if(!p)throw"projectAccessKey not found";const g=Zg.initWallet(p,{defaultNetwork:i,transports:{walletAppURL:o||"https://sequence.app"},defaultEIP6492:!0,analytics:!1}),v=await g.getChainId();return f.emitter.emit("change",{chainId:Mp(v)}),g}},async isAuthorized(){try{return!!await this.getAccounts()}catch{return!1}},async switchChain({chainId:d}){const p=await this.getProvider(),g=f.chains.find(v=>v.id===d)||f.chains[0];return p.setDefaultChainId(Mp(d)),f.emitter.emit("change",{chainId:d}),g},async getChainId(){return(await this.getProvider()).getChainId()},async onAccountsChanged(d){return{account:d[0]}},async onChainChanged(d){const p=await this.getProvider();f.emitter.emit("change",{chainId:Mp(d)}),p.setDefaultChainId(Mp(d))},async onConnect(d){},async onDisconnect(){localStorage.removeItem(Qi.EthAuthProof),f.emitter.emit("disconnect")}})}function Mp(t){return typeof t=="object"?Mp(t.chainId):typeof t=="string"?Number.parseInt(t,t.trim().substring(0,2)==="0x"?16:10):typeof t=="bigint"?Number(t):t}function oc(t){if(t==null)throw new TypeError("Cannot destructure "+t)}const SG=({isDarkMode:t})=>{const e=t?"white":"black";return n=>{let i=Dt({},(oc(n),n));return O.createElement(O.Fragment,null,O.createElement("svg",Dt({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 29 34",fill:"none"},i),O.createElement("path",{d:"M27.702 11.5918C27.5049 11.7448 24.0243 13.7068 24.0243 18.0694C24.0243 23.1155 28.4532 24.9007 28.5858 24.9449C28.5654 25.0537 27.8822 27.3897 26.2506 29.77C24.7958 31.8646 23.2765 33.9558 20.9651 33.9558C18.6538 33.9558 18.0589 32.6127 15.3907 32.6127C12.7904 32.6127 11.8659 34 9.75169 34C7.63748 34 6.1623 32.0618 4.46618 29.6816C2.50154 26.8865 0.914185 22.5443 0.914185 18.423C0.914185 11.8128 5.21057 8.30703 9.43897 8.30703C11.6857 8.30703 13.5586 9.78278 14.9692 9.78278C16.3118 9.78278 18.4056 8.21862 20.9617 8.21862C21.9304 8.21862 25.4111 8.30703 27.702 11.5918ZM19.7483 5.42014C20.8054 4.16542 21.5532 2.42444 21.5532 0.683468C21.5532 0.442044 21.5328 0.19722 21.4886 0C19.7687 0.0646065 17.7224 1.14591 16.4886 2.57746C15.5199 3.67917 14.6157 5.42014 14.6157 7.18492C14.6157 7.45014 14.6599 7.71537 14.6803 7.80038C14.7891 7.82078 14.9658 7.84458 15.1426 7.84458C16.6857 7.84458 18.6266 6.81088 19.7483 5.42014Z",fill:e})))}},AG=({isDarkMode:t})=>{const e=t?"#FFFFFF":"#000000";return n=>{let i=Dt({},(oc(n),n));return O.createElement(O.Fragment,null,O.createElement("svg",Dt({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 41 40",fill:"none"},i),O.createElement("path",{d:"M27.166 20.8774C27.1338 17.335 30.0617 15.633 30.1936 15.5493C28.5463 13.1395 25.9852 12.8113 25.0714 12.7727C22.8932 12.5507 20.8179 14.0565 19.7111 14.0565C18.6043 14.0565 16.8991 12.8049 15.0909 12.8403C12.7131 12.8757 10.5221 14.2205 9.2962 16.3505C6.8284 20.6297 8.66557 26.9777 11.0722 30.4557C12.2498 32.1545 13.6494 34.0689 15.493 33.9981C17.2691 33.9273 17.9383 32.8495 20.0811 32.8495C22.224 32.8495 22.8289 33.9981 24.7014 33.9627C26.6094 33.9241 27.8191 32.2253 28.9871 30.5201C30.3352 28.5478 30.8918 26.6366 30.924 26.5369C30.8822 26.5208 27.2046 25.1116 27.166 20.8774Z",fill:e}),O.createElement("path",{d:"M23.6429 10.4722C24.621 9.28822 25.2806 7.64089 25.1004 6C23.6911 6.05791 21.9859 6.93949 20.9756 8.12351C20.0715 9.16917 19.2768 10.8455 19.4923 12.4542C21.0592 12.5764 22.6648 11.653 23.6429 10.4722Z",fill:e})))}},Mot=t=>({id:"apple",isSequenceBased:!0,logoDark:SG({isDarkMode:!0}),logoLight:SG({isDarkMode:!1}),monochromeLogoDark:AG({isDarkMode:!0}),monochromeLogoLight:AG({isDarkMode:!1}),name:"Apple",createConnector:()=>{var e;return Ch(Dt({},t,{connect:Dt({},t==null?void 0:t.connect,{settings:Dt({},t==null||(e=t.connect)==null?void 0:e.settings,{signInWith:"apple"})})}))}}),kG=t=>{let e=Dt({},(oc(t),t));return O.createElement(O.Fragment,null,O.createElement("svg",Dt({viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),O.createElement("rect",{width:"28",height:"28",fill:"#2C5FF6"}),O.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14 23.8C19.4124 23.8 23.8 19.4124 23.8 14C23.8 8.58761 19.4124 4.2 14 4.2C8.58761 4.2 4.2 8.58761 4.2 14C4.2 19.4124 8.58761 23.8 14 23.8ZM11.55 10.8C11.1358 10.8 10.8 11.1358 10.8 11.55V16.45C10.8 16.8642 11.1358 17.2 11.55 17.2H16.45C16.8642 17.2 17.2 16.8642 17.2 16.45V11.55C17.2 11.1358 16.8642 10.8 16.45 10.8H11.55Z",fill:"white"})))},Dot=t=>({id:"coinbase-wallet",logoDark:kG,logoLight:kG,name:"Coinbase Wallet",createConnector:()=>EM(Dt({},t))}),IG=({isDarkMode:t})=>{const e=t?"white":"black";return n=>{let i=Dt({},(oc(n),n));return O.createElement(O.Fragment,null,O.createElement("svg",Dt({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 35 34",fill:"none"},i),O.createElement("path",{d:"M17.0826 16.3805C17.1802 16.4598 17.32 16.4598 17.4176 16.3805L30.1401 6.04341C30.5283 5.72801 30.3053 5.09985 29.8051 5.09985H4.69499C4.19482 5.09985 3.9718 5.72801 4.35998 6.04341L17.0826 16.3805Z",fill:e}),O.createElement("path",{d:"M19.7626 19.2667L33.3838 8.19943C33.731 7.91735 34.2501 8.16441 34.2501 8.61174V24.2249C34.2501 26.5721 32.3473 28.4749 30.0001 28.4749H4.50006C2.15285 28.4749 0.250061 26.5721 0.250061 24.2249V8.61174C0.250061 8.16441 0.769134 7.91735 1.11631 8.19943L14.7375 19.2667C16.2014 20.4561 18.2987 20.4561 19.7626 19.2667Z",fill:e})))}},CR="@sequence.kit.connector.email",Lot=t=>({id:"email",isSequenceBased:!0,logoDark:IG({isDarkMode:!0}),logoLight:IG({isDarkMode:!1}),name:"Email",createConnector:()=>{var e;const r=localStorage.getItem(CR);return Ch(Dt({},t,{connect:Dt({},t==null?void 0:t.connect,{settings:Dt({},t==null||(e=t.connect)==null?void 0:e.settings,{signInOptions:["email"],signInWithEmail:r||""})})}))}}),PG=t=>{let e=Dt({},(oc(t),t));return O.createElement(O.Fragment,null,O.createElement("svg",Dt({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 41 40",fill:"none"},e),O.createElement("path",{d:"M17.4214 36.9716C9.27855 35.5145 3.10712 28.4859 3.10712 20.0001C3.10712 10.5715 10.8214 2.85718 20.25 2.85718C29.6785 2.85718 37.3928 10.5715 37.3928 20.0001C37.3928 28.4859 31.2214 35.5145 23.0785 36.9716L22.1357 36.2002H18.3643L17.4214 36.9716Z",fill:"url(#paint0_linear_193_14528)"}),O.createElement("path",{d:"M26.9357 24.7999L27.7072 19.9999H23.1643V16.657C23.1643 15.2856 23.6786 14.257 25.7357 14.257H27.9643V9.88558C26.7643 9.71415 25.3929 9.54272 24.1929 9.54272C20.25 9.54272 17.5071 11.9427 17.5071 16.2285V19.9999H13.2214V24.7999H17.5071V36.8857C18.45 37.0571 19.3929 37.1429 20.3357 37.1429C21.2786 37.1429 22.2214 37.0571 23.1643 36.8857V24.7999H26.9357Z",fill:"white"}),O.createElement("defs",null,O.createElement("linearGradient",{id:"paint0_linear_193_14528",x1:"20.2508",y1:"35.9507",x2:"20.2508",y2:"2.85086",gradientUnits:"userSpaceOnUse"},O.createElement("stop",{"stop-color":"#0062E0"}),O.createElement("stop",{offset:"1","stop-color":"#19AFFF"})))))},RG=({isDarkMode:t})=>{const e=t?"#FFFFFF":"#000000";return n=>{let i=Dt({},(oc(n),n));return O.createElement(O.Fragment,null,O.createElement("svg",Dt({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 41 40",fill:"none"},i),O.createElement("path",{d:"M25.8582 10.4398C24.1222 10.4398 23.6288 11.2098 23.6288 12.9073V15.709H28.246L27.791 20.2476H23.6279V34H18.1024V20.2468H14.375V15.7081H18.1042V12.9851C18.1042 8.40625 19.9399 6 25.0891 6C26.1942 6 27.5163 6.0875 28.3055 6.19775V10.459",fill:e})))}},Bot=t=>({id:"facebook",isSequenceBased:!0,logoDark:PG,logoLight:PG,monochromeLogoDark:RG({isDarkMode:!0}),monochromeLogoLight:RG({isDarkMode:!1}),name:"Facebook",createConnector:()=>{var e;return Ch(Dt({},t,{connect:Dt({},t==null?void 0:t.connect,{settings:Dt({},t==null||(e=t.connect)==null?void 0:e.settings,{signInWith:"facebook"})})}))}}),TG=t=>{let e=Dt({},(oc(t),t));return O.createElement(O.Fragment,null,O.createElement("svg",Dt({viewBox:"0 0 41 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),O.createElement("g",{id:"Frame 2114"},O.createElement("g",{id:"Group"},O.createElement("path",{id:"Vector",d:"M20.7497 16.8828V23.5218H29.9756C29.5705 25.6568 28.3548 27.4647 26.5314 28.6803L32.095 32.9972C35.3366 30.0051 37.2068 25.6102 37.2068 20.3895C37.2068 19.1739 37.0977 18.005 36.895 16.883L20.7497 16.8828Z",fill:"#4285F4"}),O.createElement("path",{id:"Vector_2",d:"M11.1424 23.2627L9.88756 24.2232L5.44592 27.6829C8.2667 33.2777 14.0481 37.1427 20.7493 37.1427C25.3778 37.1427 29.2583 35.6154 32.0947 32.9973L26.5311 28.6803C25.0038 29.7089 23.0557 30.3324 20.7493 30.3324C16.2922 30.3324 12.5053 27.3246 11.1494 23.2726L11.1424 23.2627Z",fill:"#34A853"}),O.createElement("path",{id:"Vector_3",d:"M5.44594 12.3169C4.27718 14.6233 3.60712 17.2259 3.60712 19.9999C3.60712 22.7739 4.27718 25.3765 5.44594 27.6829C5.44594 27.6984 11.1499 23.2569 11.1499 23.2569C10.8071 22.2284 10.6044 21.1375 10.6044 19.9997C10.6044 18.8619 10.8071 17.7711 11.1499 16.7425L5.44594 12.3169Z",fill:"#FBBC05"}),O.createElement("path",{id:"Vector_4",d:"M20.7497 9.6829C23.2744 9.6829 25.5185 10.5556 27.3107 12.2387L32.2198 7.32972C29.2431 4.55574 25.3783 2.85693 20.7497 2.85693C14.0484 2.85693 8.2667 6.70628 5.44592 12.3167L11.1497 16.7427C12.5055 12.6907 16.2926 9.6829 20.7497 9.6829Z",fill:"#EA4335"})))))},OG=({isDarkMode:t})=>{const e=t?"white":"black";return n=>{let i=Dt({},(oc(n),n));return O.createElement("svg",Dt({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 41 40",fill:"none"},i),O.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M25.8355 14.7613C24.5584 13.5329 22.9441 12.9032 21.1356 12.9032C17.9377 12.9032 15.2302 15.0813 14.2595 18.0232L14.2593 18.023C14.0142 18.7662 13.8712 19.5609 13.8712 20.3866C13.8712 21.2124 14.004 22.0072 14.2594 22.7504L14.2587 22.751H14.2595C15.2302 25.6929 17.9377 27.871 21.1356 27.871C22.7907 27.871 24.1904 27.4168 25.2939 26.6736V26.6732C26.5812 25.7958 27.4497 24.5055 27.746 22.9777H21.1355V18.3223H32.6808C32.8034 19.0758 32.875 19.85 32.875 20.6655C32.875 24.4332 31.5467 27.6126 29.2377 29.77L29.2378 29.7703C27.2148 31.6594 24.446 32.7742 21.1356 32.7742C16.3438 32.7742 12.2059 29.9871 10.1931 25.9407V25.94L10.193 25.9401C9.35521 24.2678 8.875 22.3891 8.875 20.3866C8.875 18.384 9.35521 16.5053 10.193 14.833H10.1934C12.2063 10.7869 16.344 8 21.1356 8C24.446 8 27.2148 9.22839 29.3298 11.231L25.8355 14.7613Z",fill:e}))}},Fot=t=>({id:"google",isSequenceBased:!0,logoDark:TG,logoLight:TG,monochromeLogoDark:OG({isDarkMode:!0}),monochromeLogoLight:OG({isDarkMode:!1}),name:"Google",createConnector:()=>{var e;return Ch(Dt({},t,{connect:Dt({},t==null?void 0:t.connect,{settings:Dt({},t==null||(e=t.connect)==null?void 0:e.settings,{signInWith:"google"})})}))}}),$G=t=>{let e=Dt({},(oc(t),t));return O.createElement(O.Fragment,null,O.createElement("svg",Dt({viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),O.createElement("rect",{width:"28",height:"28"}),O.createElement("path",{d:"M24.0891 3.1199L15.3446 9.61456L16.9617 5.7828L24.0891 3.1199Z",fill:"#E2761B",stroke:"#E2761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),O.createElement("path",{d:"M3.90207 3.1199L12.5763 9.67608L11.0383 5.7828L3.90207 3.1199Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),O.createElement("path",{d:"M20.9429 18.1745L18.6139 21.7426L23.597 23.1136L25.0295 18.2536L20.9429 18.1745Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),O.createElement("path",{d:"M2.97929 18.2536L4.40301 23.1136L9.38607 21.7426L7.05713 18.1745L2.97929 18.2536Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),O.createElement("path",{d:"M9.10483 12.1456L7.71626 14.2461L12.6642 14.4658L12.4884 9.14877L9.10483 12.1456Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),O.createElement("path",{d:"M18.8864 12.1456L15.4589 9.08725L15.3446 14.4658L20.2837 14.2461L18.8864 12.1456Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),O.createElement("path",{d:"M9.38606 21.7426L12.3566 20.2925L9.79033 18.2888L9.38606 21.7426Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),O.createElement("path",{d:"M15.6347 20.2925L18.6139 21.7426L18.2009 18.2888L15.6347 20.2925Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),O.createElement("path",{d:"M18.6139 21.7426L15.6347 20.2925L15.8719 22.2348L15.8456 23.0521L18.6139 21.7426Z",fill:"#D7C1B3",stroke:"#D7C1B3",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),O.createElement("path",{d:"M9.38606 21.7426L12.1544 23.0521L12.1368 22.2348L12.3566 20.2925L9.38606 21.7426Z",fill:"#D7C1B3",stroke:"#D7C1B3",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),O.createElement("path",{d:"M12.1984 17.0056L9.72002 16.2762L11.4689 15.4765L12.1984 17.0056Z",fill:"#233447",stroke:"#233447",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),O.createElement("path",{d:"M15.7928 17.0056L16.5223 15.4765L18.28 16.2762L15.7928 17.0056Z",fill:"#233447",stroke:"#233447",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),O.createElement("path",{d:"M9.38606 21.7426L9.80791 18.1745L7.05712 18.2536L9.38606 21.7426Z",fill:"#CD6116",stroke:"#CD6116",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),O.createElement("path",{d:"M18.1921 18.1745L18.6139 21.7426L20.9429 18.2536L18.1921 18.1745Z",fill:"#CD6116",stroke:"#CD6116",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),O.createElement("path",{d:"M20.2837 14.2461L15.3446 14.4658L15.8016 17.0057L16.5311 15.4765L18.2888 16.2762L20.2837 14.2461Z",fill:"#CD6116",stroke:"#CD6116",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),O.createElement("path",{d:"M9.72002 16.2762L11.4777 15.4765L12.1984 17.0057L12.6642 14.4658L7.71626 14.2461L9.72002 16.2762Z",fill:"#CD6116",stroke:"#CD6116",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),O.createElement("path",{d:"M7.71626 14.2461L9.79033 18.2888L9.72002 16.2762L7.71626 14.2461Z",fill:"#E4751F",stroke:"#E4751F",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),O.createElement("path",{d:"M18.2888 16.2762L18.2009 18.2888L20.2837 14.2461L18.2888 16.2762Z",fill:"#E4751F",stroke:"#E4751F",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),O.createElement("path",{d:"M12.6642 14.4658L12.1984 17.0057L12.7784 20.0025L12.9102 16.0565L12.6642 14.4658Z",fill:"#E4751F",stroke:"#E4751F",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),O.createElement("path",{d:"M15.3446 14.4658L15.1073 16.0477L15.2128 20.0025L15.8016 17.0057L15.3446 14.4658Z",fill:"#E4751F",stroke:"#E4751F",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),O.createElement("path",{d:"M15.8016 17.0056L15.2128 20.0025L15.6347 20.2925L18.2009 18.2888L18.2888 16.2762L15.8016 17.0056Z",fill:"#F6851B",stroke:"#F6851B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),O.createElement("path",{d:"M9.72002 16.2762L9.79033 18.2888L12.3566 20.2925L12.7784 20.0025L12.1984 17.0056L9.72002 16.2762Z",fill:"#F6851B",stroke:"#F6851B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),O.createElement("path",{d:"M15.8456 23.0521L15.8719 22.2348L15.6522 22.0414H12.339L12.1368 22.2348L12.1544 23.0521L9.38606 21.7426L10.3528 22.5336L12.3126 23.8958H15.6786L17.6472 22.5336L18.6139 21.7426L15.8456 23.0521Z",fill:"#C0AD9E",stroke:"#C0AD9E",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),O.createElement("path",{d:"M15.6347 20.2925L15.2128 20.0025H12.7784L12.3566 20.2925L12.1368 22.2348L12.339 22.0414H15.6522L15.8719 22.2348L15.6347 20.2925Z",fill:"#161616",stroke:"#161616",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),O.createElement("path",{d:"M24.4583 10.0364L25.2053 6.45072L24.0891 3.1199L15.6347 9.39485L18.8864 12.1456L23.4827 13.4903L24.5022 12.3038L24.0628 11.9874L24.7658 11.3459L24.221 10.924L24.924 10.3879L24.4583 10.0364Z",fill:"#763D16",stroke:"#763D16",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),O.createElement("path",{d:"M2.79472 6.45072L3.54174 10.0364L3.06717 10.3879L3.77024 10.924L3.23415 11.3459L3.93722 11.9874L3.4978 12.3038L4.50847 13.4903L9.10483 12.1456L12.3566 9.39485L3.90207 3.1199L2.79472 6.45072Z",fill:"#763D16",stroke:"#763D16",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),O.createElement("path",{d:"M23.4827 13.4903L18.8864 12.1456L20.2837 14.2461L18.2009 18.2888L20.9429 18.2536H25.0295L23.4827 13.4903Z",fill:"#F6851B",stroke:"#F6851B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),O.createElement("path",{d:"M9.10484 12.1456L4.50848 13.4903L2.97929 18.2536H7.05713L9.79033 18.2888L7.71626 14.2461L9.10484 12.1456Z",fill:"#F6851B",stroke:"#F6851B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),O.createElement("path",{d:"M15.3446 14.4658L15.6347 9.39485L16.9705 5.7828H11.0383L12.3566 9.39485L12.6642 14.4658L12.7696 16.0653L12.7784 20.0025H15.2128L15.2304 16.0653L15.3446 14.4658Z",fill:"#F6851B",stroke:"#F6851B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"})))},E_=t=>{let e=Dt({},(oc(t),t));return O.createElement(O.Fragment,null,O.createElement("svg",Dt({xmlns:"http://www.w3.org/2000/svg",style:{fill:"none"},id:"svg1316",version:"1.1",viewBox:"0 0 396 396"},e),O.createElement("g",{transform:"translate(0,38)",id:"g1256",clipPath:"url(#clip0_5_131)"},O.createElement("g",{id:"g1254",clipPath:"url(#clip1_5_131)"},O.createElement("path",{style:{fill:"#111111"},id:"path1232",d:"M 0,67.5049 V 250.165 c 0,37.282 30.1402,67.505 67.32,67.505 h 261.36 c 37.18,0 67.32,-30.223 67.32,-67.505 V 67.5049 C 396,30.223 365.86,0 328.68,0 H 67.32 C 30.1402,0 0,30.223 0,67.5049 Z"}),O.createElement("path",{style:{fill:"url(#paint0_linear_5_13"},id:"path1234",d:"M 0,67.5049 V 250.165 c 0,37.282 30.1402,67.505 67.32,67.505 h 261.36 c 37.18,0 67.32,-30.223 67.32,-67.505 V 67.5049 C 396,30.223 365.86,0 328.68,0 H 67.32 C 30.1402,0 0,30.223 0,67.5049 Z"}),O.createElement("path",{style:{fill:"url(#paint1_linear_5_131"},id:"path1236",d:"m 98.9999,79.4176 c 0,-10.9653 -8.8648,-19.8544 -19.8,-19.8544 -10.9352,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.8648,19.8544 19.8,19.8544 10.9352,0 19.8,-8.8892 19.8,-19.8544 z"}),O.createElement("path",{style:{fill:"url(#paint2_linear_5_131)"},id:"path1238",d:"m 98.9999,79.4176 c 0,-10.9653 -8.8648,-19.8544 -19.8,-19.8544 -10.9352,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.8648,19.8544 19.8,19.8544 10.9352,0 19.8,-8.8892 19.8,-19.8544 z"}),O.createElement("path",{style:{fill:"url(#paint3_linear_5_131)"},id:"path1240",d:"m 98.9999,79.4176 c 0,-10.9653 -8.8648,-19.8544 -19.8,-19.8544 -10.9352,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.8648,19.8544 19.8,19.8544 10.9352,0 19.8,-8.8892 19.8,-19.8544 z"}),O.createElement("path",{style:{fill:"url(#paint4_linear_5_131)"},id:"path1242",d:"m 98.9999,238.126 c 0,-10.965 -8.8648,-19.854 -19.8,-19.854 -10.9352,0 -19.8,8.889 -19.8,19.854 0,10.966 8.8648,19.855 19.8,19.855 10.9352,0 19.8,-8.889 19.8,-19.855 z"}),O.createElement("path",{style:{fill:"url(#paint5_linear_5_131)"},id:"path1244",d:"m 336.6,158.835 c 0,-10.965 -8.865,-19.854 -19.8,-19.854 -10.935,0 -19.8,8.889 -19.8,19.854 0,10.965 8.865,19.855 19.8,19.855 10.935,0 19.8,-8.89 19.8,-19.855 z"}),O.createElement("path",{style:{fill:"url(#paint6_linear_5_131)"},id:"path1246",d:"m 336.6,158.835 c 0,-10.965 -8.865,-19.854 -19.8,-19.854 -10.935,0 -19.8,8.889 -19.8,19.854 0,10.965 8.865,19.855 19.8,19.855 10.935,0 19.8,-8.89 19.8,-19.855 z"}),O.createElement("path",{style:{fill:"url(#paint7_linear_5_131)"},id:"path1248",d:"M 316.8,59.5632 H 158.4 c -10.935,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.865,19.8544 19.8,19.8544 h 158.4 c 10.935,0 19.8,-8.8892 19.8,-19.8544 0,-10.9653 -8.865,-19.8544 -19.8,-19.8544 z"}),O.createElement("path",{style:{fill:"url(#paint8_linear_5_131)"},id:"path1250",d:"M 316.8,218.272 H 158.4 c -10.935,0 -19.8,8.889 -19.8,19.854 0,10.966 8.865,19.855 19.8,19.855 h 158.4 c 10.935,0 19.8,-8.889 19.8,-19.855 0,-10.965 -8.865,-19.854 -19.8,-19.854 z"}),O.createElement("path",{style:{fill:"url(#paint9_linear_5_131)"},id:"path1252",d:"M 237.6,138.981 H 79.2 c -10.9352,0 -19.8,8.889 -19.8,19.854 0,10.965 8.8648,19.855 19.8,19.855 h 158.4 c 10.935,0 19.8,-8.89 19.8,-19.855 0,-10.965 -8.865,-19.854 -19.8,-19.854 z"}))),O.createElement("defs",{id:"defs1314"},O.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"318",x2:"198",y1:"4.0585401e-05",x1:"198",id:"paint0_linear_5_131"},O.createElement("stop",{id:"stop1258",stopColor:"#1D273D"}),O.createElement("stop",{id:"stop1260",stopColor:"#0D0F13",offset:"1"})),O.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"63",x2:"92.5",y1:"99",x1:"65.5",id:"paint1_linear_5_131"},O.createElement("stop",{id:"stop1263",stopColor:"#4462FE"}),O.createElement("stop",{id:"stop1265",stopColor:"#7D69FA",offset:"1"})),O.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"97.591103",x2:"96.137703",y1:"99.291199",x1:"62.879902",id:"paint2_linear_5_131"},O.createElement("stop",{id:"stop1268",stopColor:"#3757FD"}),O.createElement("stop",{id:"stop1270",stopColor:"#6980FA",offset:"1"})),O.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"97.591103",x2:"96.137703",y1:"99.291199",x1:"62.879902",id:"paint3_linear_5_131"},O.createElement("stop",{id:"stop1273",stopColor:"#2447FF"}),O.createElement("stop",{id:"stop1275",stopColor:"#6980FA",offset:"1"})),O.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"223.5",x2:"91.5",y1:"251.5",x1:"65",id:"paint4_linear_5_131"},O.createElement("stop",{id:"stop1278",stopColor:"#BC3EE6"}),O.createElement("stop",{id:"stop1280",stopColor:"#D972F1",offset:"1"})),O.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"146",x2:"329.5",y1:"172",x1:"305",id:"paint5_linear_5_131"},O.createElement("stop",{id:"stop1283",stopColor:"#29BDFF"}),O.createElement("stop",{id:"stop1285",stopColor:"#96E7FB",offset:"1"})),O.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"176.772",x2:"334.56699",y1:"178.418",x1:"300.17999",id:"paint6_linear_5_131"},O.createElement("stop",{id:"stop1288",stopColor:"#23BBFF"}),O.createElement("stop",{id:"stop1290",stopColor:"#85E7FF",offset:"1"})),O.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"60",x2:"317.5",y1:"99",x1:"154.5",id:"paint7_linear_5_131"},O.createElement("stop",{id:"stop1293",stopColor:"#23BBFF"}),O.createElement("stop",{id:"stop1295",stopColor:"#85E7FF",offset:"1"})),O.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"218",x2:"312.5",y1:"258",x1:"156",id:"paint8_linear_5_131"},O.createElement("stop",{id:"stop1298",stopColor:"#2447FF"}),O.createElement("stop",{id:"stop1300",stopColor:"#6980FA",offset:"1"})),O.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"139",x2:"235.5",y1:"179",x1:"86.000099",id:"paint9_linear_5_131"},O.createElement("stop",{id:"stop1303",stopColor:"#6634FF"}),O.createElement("stop",{id:"stop1305",stopColor:"#9C6DFF",offset:"1"})),O.createElement("clipPath",{id:"clip0_5_131"},O.createElement("rect",{style:{fill:"#ffffff"},y:"0",x:"0",id:"rect1308",height:"317.67001",width:"396"})),O.createElement("clipPath",{id:"clip1_5_131"},O.createElement("rect",{style:{fill:"#ffffff"},y:"0",x:"0",id:"rect1311",height:"317.67001",width:"396"})))))};window.ethereum=window.ethereum||{};const jot=()=>({id:"metamask",logoDark:$G,logoLight:$G,name:"Metamask",createConnector:()=>yC()}),Uot=t=>({id:"mock",isSequenceBased:!0,logoDark:E_,logoLight:E_,name:"Mock",createConnector:()=>CN(t)}),zot=t=>({id:"sequence",isSequenceBased:!0,logoDark:E_,logoLight:E_,name:"Sequence",createConnector:()=>Ch(Dt({},t))}),E3=({isDarkMode:t})=>{let e;return t===void 0?e="#9146FF":e=t?"white":"black",n=>(Dt({},(oc(n),n)),O.createElement(O.Fragment,null,O.createElement("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 2400 2800",transform:"scale(0.80)"},O.createElement("g",null,O.createElement("g",{id:"Layer_1-2"},O.createElement("path",{fill:e,d:"M500,0L0,500v1800h600v500l500-500h400l900-900V0H500z M2200,1300l-400,400h-400l-350,350v-350H600V200h1600 V1300z"}),O.createElement("rect",{x:"1700",y:"550",fill:e,width:"200",height:"600"}),O.createElement("rect",{x:"1150",y:"550",fill:e,width:"200",height:"600"}))))))},Hot=t=>({id:"twitch",isSequenceBased:!0,logoDark:E3({}),logoLight:E3({}),monochromeLogoDark:E3({isDarkMode:!0}),monochromeLogoLight:E3({isDarkMode:!1}),name:"Twitch",createConnector:()=>{var e;return Ch(Dt({},t,{connect:Dt({},t==null?void 0:t.connect,{settings:Dt({},t==null||(e=t.connect)==null?void 0:e.settings,{signInWith:"twitch"})})}))}}),NG=t=>{let e=Dt({},(oc(t),t));return O.createElement(O.Fragment,null,O.createElement("svg",Dt({fill:"none",viewBox:"0 0 480 332",xmlns:"http://www.w3.org/2000/svg"},e),O.createElement("path",{d:"m126.613 93.9842c62.622-61.3123 164.152-61.3123 226.775 0l7.536 7.3788c3.131 3.066 3.131 8.036 0 11.102l-25.781 25.242c-1.566 1.533-4.104 1.533-5.67 0l-10.371-10.154c-43.687-42.7734-114.517-42.7734-158.204 0l-11.107 10.874c-1.565 1.533-4.103 1.533-5.669 0l-25.781-25.242c-3.132-3.066-3.132-8.036 0-11.102zm280.093 52.2038 22.946 22.465c3.131 3.066 3.131 8.036 0 11.102l-103.463 101.301c-3.131 3.065-8.208 3.065-11.339 0l-73.432-71.896c-.783-.767-2.052-.767-2.835 0l-73.43 71.896c-3.131 3.065-8.208 3.065-11.339 0l-103.4657-101.302c-3.1311-3.066-3.1311-8.036 0-11.102l22.9456-22.466c3.1311-3.065 8.2077-3.065 11.3388 0l73.4333 71.897c.782.767 2.051.767 2.834 0l73.429-71.897c3.131-3.065 8.208-3.065 11.339 0l73.433 71.897c.783.767 2.052.767 2.835 0l73.431-71.895c3.132-3.066 8.208-3.066 11.339 0z",fill:"#3396ff"})))},qot=t=>({id:"wallet-connect",logoDark:NG,logoLight:NG,name:"Walletconnect",createConnector:()=>qM(Dt({},t))}),Wot=({walletConnectProjectId:t,defaultChainId:e,projectAccessKey:r,appName:n})=>cfe(r,[Dot({appName:n}),Lot({defaultNetwork:e,connect:{app:n,projectAccessKey:r}}),Fot({defaultNetwork:e,connect:{app:n,projectAccessKey:r}}),Bot({defaultNetwork:e,connect:{app:n,projectAccessKey:r}}),Hot({defaultNetwork:e,connect:{app:n}}),Mot({defaultNetwork:e,connect:{app:n}}),jot(),qot({projectId:t}),zot({defaultNetwork:e,connect:{app:n,projectAccessKey:r}})]);function WM(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function _3(){}function MG(){return typeof WeakMap<"u"?new WeakMap:Vot()}function Vot(){return{add:_3,delete:_3,get:_3,set:_3,has:function(t){return!1}}}var Got=Object.prototype.hasOwnProperty,SR=function(t,e){return Got.call(t,e)};function P7(t,e){for(var r in e)SR(e,r)&&(t[r]=e[r]);return t}var Kot=/^[ \t]*(?:\r\n|\r|\n)/,Jot=/(?:\r\n|\r|\n)[ \t]*$/,Qot=/^(?:[\r\n]|$)/,Yot=/(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/,Zot=/^[ \t]*[\r\n][ \t\r\n]*$/;function DG(t,e,r){var n=0,i=t[0].match(Yot);i&&(n=i[1].length);var s="(\\r\\n|\\r|\\n).{0,"+n+"}",o=new RegExp(s,"g");e&&(t=t.slice(1));var a=r.newline,c=r.trimLeadingNewline,l=r.trimTrailingNewline,u=typeof a=="string",f=t.length,d=t.map(function(p,g){return p=p.replace(o,"$1"),g===0&&c&&(p=p.replace(Kot,"")),g===f-1&&l&&(p=p.replace(Jot,"")),u&&(p=p.replace(/\r\n|\n|\r/g,function(v){return a})),p});return d}function Xot(t,e){for(var r="",n=0,i=t.length;n{},registerClassName:()=>{},onEndFileScope:()=>{},registerComposition:()=>{},markCompositionUsed:()=>{},getIdentOption:()=>"short"},kE=[tat],N1=()=>{if(kE.length<1)throw new Error("No adapter configured");return kE[kE.length-1]},Wue=!1,rat=t=>{Wue||nat(t)},nat=t=>{if(!t)throw new Error('No adapter provided when calling "setAdapter"');Wue=!0,kE.push(t)},R4=function(){return N1().appendCss(...arguments)},Vue=function(){return N1().registerClassName(...arguments)},iat=function(){return N1().registerComposition(...arguments)},Gue=function(){return N1().markCompositionUsed(...arguments)},sat=function(){for(var e,r,n=arguments.length,i=new Array(n),s=0;s{var{fileScope:e,css:r}=t,n=e.packageName?[e.packageName,e.filePath].join("/"):e.filePath,i=BG[n];if(!i){var s=document.createElement("style");e.packageName&&s.setAttribute("data-package",e.packageName),s.setAttribute("data-file",e.filePath),s.setAttribute("type","text/css"),i=BG[n]=s,document.head.appendChild(s)}i.innerHTML=r};function uat(t){var e=t.match(/^var\((.*)\)$/);return e?e[1]:t}/*! https://mths.be/cssesc v3.0.0 by @mathias */var fat={},dat=fat.hasOwnProperty,hat=function(e,r){if(!e)return r;var n={};for(var i in r)n[i]=dat.call(e,i)?e[i]:r[i];return n},pat=/[ -,\.\/:-@\[-\^`\{-~]/,gat=/[ -,\.\/:-@\[\]\^`\{-~]/,mat=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g,GM=function t(e,r){r=hat(r,t.options),r.quotes!="single"&&r.quotes!="double"&&(r.quotes="single");for(var n=r.quotes=="double"?'"':"'",i=r.isIdentifier,s=e.charAt(0),o="",a=0,c=e.length;a126){if(u>=55296&&u<=56319&&a0;){const a=o.shift();if(a!==void 0)for(const c in r[a]){const l=r[a][c];o.push(l);let u=s[a];for(;u>0&&!(c in r[u]);)u=s[u];if(c in r[u]){const f=r[u][c];s[l]=f,n[l]=[...n[l],...n[f]]}else s[l]=0}}return{gotoFn:r,output:n,failure:s}}search(e){let r=0;const n=[];for(let i=0;i0&&!(s in this.gotoFn[r]);)r=this.failure[r];if(s in this.gotoFn[r]&&(r=this.gotoFn[r][s],this.output[r].length>0)){const o=this.output[r];n.push([i,o])}}return n}}var Sn;(function(t){t.Attribute="attribute",t.Pseudo="pseudo",t.PseudoElement="pseudo-element",t.Tag="tag",t.Universal="universal",t.Adjacent="adjacent",t.Child="child",t.Descendant="descendant",t.Parent="parent",t.Sibling="sibling",t.ColumnCombinator="column-combinator"})(Sn||(Sn={}));var Ba;(function(t){t.Any="any",t.Element="element",t.End="end",t.Equals="equals",t.Exists="exists",t.Hyphen="hyphen",t.Not="not",t.Start="start"})(Ba||(Ba={}));const FG=/^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,bat=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,wat=new Map([[126,Ba.Element],[94,Ba.Start],[36,Ba.End],[42,Ba.Any],[33,Ba.Not],[124,Ba.Hyphen]]),xat=new Set(["has","not","matches","is","where","host","host-context"]);function Eat(t){switch(t.type){case Sn.Adjacent:case Sn.Child:case Sn.Descendant:case Sn.Parent:case Sn.Sibling:case Sn.ColumnCombinator:return!0;default:return!1}}const _at=new Set(["contains","icontains"]);function Cat(t,e,r){const n=parseInt(e,16)-65536;return n!==n||r?e:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,n&1023|56320)}function vy(t){return t.replace(bat,Cat)}function R7(t){return t===39||t===34}function jG(t){return t===32||t===9||t===10||t===12||t===13}function Sat(t){const e=[],r=Kue(e,`${t}`,0);if(r0&&r0&&Eat(n[n.length-1]))throw new Error("Did not expect successive traversals.")}function l(d){if(n.length>0&&n[n.length-1].type===Sn.Descendant){n[n.length-1].type=d;return}c(),n.push({type:d})}function u(d,p){n.push({type:Sn.Attribute,name:d,action:p,value:i(1),namespace:null,ignoreCase:"quirks"})}function f(){if(n.length&&n[n.length-1].type===Sn.Descendant&&n.pop(),n.length===0)throw new Error("Empty sub-selector");t.push(n)}if(s(0),e.length===r)return r;e:for(;r=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function yi(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}var kat=/(\u000D|\u000C|\u000D\u000A)/g,Iat=/[\u0000\uD800-\uDFFF]/g,Pat=/(\/\*)[\s\S]*?(\*\/)/g,Rat=function(e,r){r===void 0&&(r=0),e=e.replace(kat,` +`).replace(Iat,"�"),e=e.replace(Pat,"");for(var n=[];r"})}else if(i===34){var o=UG(e,r);if(o===null)return null;var a=yi(o,2),c=a[0],l=a[1];n.push({type:"",value:l}),r=c}else if(i===35){if(r+1=65&&u<=90||u>=97&&u<=122||u>=128||u>=48&&u<=57||u===92&&r+2",value:l.toLowerCase(),flag:f}),r=c;continue}}}n.push({type:"",value:i})}else if(i===39){var o=UG(e,r);if(o===null)return null;var p=yi(o,2),c=p[0],l=p[1];n.push({type:"",value:l}),r=c}else if(i===40)n.push({type:"<(-token>"});else if(i===41)n.push({type:"<)-token>"});else if(i===43){var g=C3(e,r);if(g===null)n.push({type:"",value:i});else{var v=yi(g,2),c=v[0],y=v[1];y[0]===""?n.push({type:"",value:y[1],unit:y[2].toLowerCase(),flag:"number"}):y[0]===""?n.push({type:y[0],value:y[1],flag:y[2]}):n.push({type:y[0],value:y[1],flag:"number"}),r=c}}else if(i===44)n.push({type:""});else if(i===45){var b=C3(e,r);if(b!==null){var w=yi(b,2),c=w[0],y=w[1];y[0]===""?n.push({type:"",value:y[1],unit:y[2].toLowerCase(),flag:"number"}):y[0]===""?n.push({type:y[0],value:y[1],flag:y[2]}):n.push({type:y[0],value:y[1],flag:"number"}),r=c;continue}if(r+2"}),r+=2;continue}}var o=zG(e,r);if(o!==null){var C=yi(o,3),c=C[0],l=C[1],S=C[2];n.push({type:S,value:l}),r=c;continue}n.push({type:"",value:i})}else if(i===46){var b=C3(e,r);if(b===null)n.push({type:"",value:i});else{var P=yi(b,2),c=P[0],y=P[1];y[0]===""?n.push({type:"",value:y[1],unit:y[2].toLowerCase(),flag:"number"}):y[0]===""?n.push({type:y[0],value:y[1],flag:y[2]}):n.push({type:y[0],value:y[1],flag:"number"}),r=c;continue}}else if(i===58)n.push({type:""});else if(i===59)n.push({type:""});else if(i===60){if(r+3"}),r+=3;continue}}n.push({type:"",value:i})}else if(i===64){var o=JM(e,r+1);if(o!==null){var T=yi(o,2),c=T[0],l=T[1];n.push({type:"",value:l.toLowerCase()}),r=c;continue}n.push({type:"",value:i})}else if(i===91)n.push({type:"<[-token>"});else if(i===92){var o=tx(e,r);if(o===null)return null;var Q=yi(o,2),c=Q[0],l=Q[1];e=e.slice(0,r)+l+e.slice(c+1),r-=1}else if(i===93)n.push({type:"<]-token>"});else if(i===123)n.push({type:"<{-token>"});else if(i===125)n.push({type:"<}-token>"});else if(i>=48&&i<=57){var o=C3(e,r),Z=yi(o,2),c=Z[0],y=Z[1];y[0]===""?n.push({type:"",value:y[1],unit:y[2].toLowerCase(),flag:"number"}):y[0]===""?n.push({type:y[0],value:y[1],flag:y[2]}):n.push({type:y[0],value:y[1],flag:"number"}),r=c}else if(i===95||i>=65&&i<=90||i>=97&&i<=122||i>=128){var o=zG(e,r);if(o===null)return null;var ne=yi(o,3),c=ne[0],l=ne[1],S=ne[2];n.push({type:S,value:l}),r=c}else n.push({type:"",value:i})}return n.push({type:""}),n},UG=function(e,r){if(e.length<=r+1)return null;for(var n=e.charCodeAt(r),i=[],s=r+1;s=65&&i<=90||i>=97&&i<=122||i>=128)return!0;if(i===92){if(e.length<=r+2)return!1;var s=e.charCodeAt(r+2);return s!==10}else return!1}else{if(n===95||n>=65&&n<=90||n>=97&&n<=122||n>=128)return!0;if(n===92){if(e.length<=r+1)return!1;var i=e.charCodeAt(r+1);return i!==10}else return!1}},tx=function(e,r){if(e.length<=r+1||e.charCodeAt(r)!==92)return null;var n=e.charCodeAt(r+1);if(n===10)return null;if(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102){for(var i=[n],s=Math.min(r+7,e.length),o=r+2;o=48&&a<=57||a>=65&&a<=70||a>=97&&a<=102)i.push(a);else break}if(o",o,f]]}return s+1",o]]:[s,["",o,a]]},Tat=function(e,r){if(e.length<=r)return null;var n="integer",i=[],s=e.charCodeAt(r);for((s===43||s===45)&&(r+=1,s===45&&i.push(45));r=48&&o<=57)i.push(o),r+=1;else break}if(r+1=48&&c<=57)for(i.push(a,c),n="number",r+=2;r=48&&o<=57)i.push(o),r+=1;else break}}if(r+1=48&&c<=57;if(u||(c===43||c===45)&&l>=48&&l<=57)for(n="number",u?(i.push(69,c),r+=2):c===45?(i.push(69,45,l),r+=3):(i.push(69,l),r+=3);r=48&&o<=57)i.push(o),r+=1;else break}}}var f=String.fromCharCode.apply(null,i),d=n==="number"?parseFloat(f):parseInt(f);return d===-0&&(d=0),Number.isNaN(d)?null:[r-1,d,n]},Oat=function(e,r){if(e.length<=r)return null;for(var n=[],i=e.charCodeAt(r);r=65&&i<=90||i>=97&&i<=122||i>=128||i>=48&&i<=57){n.push(i);continue}else{var s=tx(e,r);if(s!==null){var o=yi(s,2),a=o[0],c=o[1];n.push(c),r=a;continue}}break}return r===0?null:[r-1,String.fromCharCode.apply(null,n)]},JM=function(e,r){if(e.length<=r||!Jue(e,r))return null;for(var n=[],i=e.charCodeAt(r);r=65&&i<=90||i>=97&&i<=122||i>=128||i>=48&&i<=57){n.push(i);continue}else{var s=tx(e,r);if(s!==null){var o=yi(s,2),a=o[0],c=o[1];n.push(c),r=a;continue}}break}return[r-1,String.fromCharCode.apply(null,n)]},$at=function(e,r){for(var n=e.charCodeAt(r);n===9||n===32||n===10;)n=e.charCodeAt(++r);for(var i=[],s=!1;rs+1){var a=e.charCodeAt(s+1);if(a===40){for(var c=2;s+c"];if(l!==9&&l!==32&&l!==10){var u=$at(e,s+c);if(u===null)return null;var f=yi(u,2),d=f[0],p=f[1];return[d,p,""]}}return[s+1,o.toLowerCase(),""]}}}else if(e.length>s+1){var a=e.charCodeAt(s+1);if(a===40)return[s+1,o.toLowerCase(),""]}return[s,o.toLowerCase(),""]},Nat=function(e){for(var r=e.length-1;r>=0;r--)e[r]=Mat(e[r]);return e},Mat=function(e){if(e.mediaCondition===null)return e;var r=Dat(e.mediaCondition);return r.operator===null&&r.children.length===1&&"children"in r.children[0]&&(r=r.children[0]),{mediaPrefix:e.mediaPrefix,mediaType:e.mediaType,mediaCondition:r}},Dat=function t(e){for(var r=e.children.length-1;r>=0;r--){var n=e.children[r];if(!("context"in n)){var i=t(n);if(i.operator===null&&i.children.length===1)e.children[r]=i.children[0];else if(i.operator===e.operator&&(i.operator==="and"||i.operator==="or")){for(var s=[r,1],o=0;o"&&r[0].value==="media"){if(r[1].type!=="")throw vo("Expected whitespace after media");n=2;for(var s=2;s"){i=s;break}else if(o.type==="")throw vo("Expected '{' in media query but found ';'")}}return r=r.slice(n,i),jat(r)},Fat=function(e){for(var r=[],n=!1,i=0;i"?(n=!0,r.length>0&&(r[r.length-1].wsAfter=!0)):(r.push(C_(C_({},e[i]),{wsBefore:n,wsAfter:!1})),n=!1);return r},jat=function(e){for(var r,n,i=[[]],s=0;s"?i.push([]):i[i.length-1].push(o)}var a=i.map(Fat);if(a.length===1&&a[0].length===0)return[{mediaCondition:null,mediaPrefix:null,mediaType:"all"}];var c=a.map(function(p){return p.length===0?null:Uat(p)}),l=[];try{for(var u=Aat(c),f=u.next();!f.done;f=u.next()){var d=f.value;d!==null&&l.push(d)}}catch(p){r={error:p}}finally{try{f&&!f.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}if(l.length===0)throw vo("No valid media queries");return l},Uat=function(e){var r=e[0];if(r.type==="<(-token>")try{return{mediaPrefix:null,mediaType:"all",mediaCondition:T7(e,!0)}}catch(f){throw vo("Expected media condition after '('",f)}else if(r.type===""){var n=null,i=void 0,s=r.value;(s==="only"||s==="not")&&(n=s);var o=n===null?0:1;if(e.length<=o)throw vo("Expected extra token in media query");var a=e[o];if(a.type===""){var c=a.value;if(c==="all")i="all";else if(c==="print"||c==="screen")i=c;else if(c==="tty"||c==="tv"||c==="projection"||c==="handheld"||c==="braille"||c==="embossed"||c==="aural"||c==="speech")n=n==="not"?null:"not",i="all";else throw vo("Unknown ident '".concat(c,"' in media query"))}else if(n==="not"&&a.type==="<(-token>"){var l=[{type:"<(-token>",wsBefore:!1,wsAfter:!1}];l.push.apply(l,e),l.push({type:"<)-token>",wsBefore:!1,wsAfter:!1});try{return{mediaPrefix:null,mediaType:"all",mediaCondition:T7(l,!0)}}catch(f){throw vo("Expected media condition after '('",f)}}else throw vo("Invalid media query");if(o+1===e.length)return{mediaPrefix:n,mediaType:i,mediaCondition:null};if(o+4"&&u.value==="and")try{return{mediaPrefix:n,mediaType:i,mediaCondition:T7(e.slice(o+2),!1)}}catch(f){throw vo("Expected media condition after 'and'",f)}else throw vo("Expected 'and' after media prefix")}else throw vo("Expected media condition after media prefix")}else throw vo("Expected media condition or media prefix")},T7=function t(e,r,n){if(n===void 0&&(n=null),e.length<3||e[0].type!=="<(-token>"||e[e.length-1].type!=="<)-token>")throw new Error("Invalid media condition");for(var i=e.length-1,s=0,o=0,a=0;a"?(o+=1,s=Math.max(s,o)):c.type==="<)-token>"&&(o-=1),o===0){i=a;break}}if(o!==0)throw new Error(`Mismatched parens +Invalid media condition`);var l,u=e.slice(0,i+1);if(s===1?l=zat(u):u[1].type===""&&u[1].value==="not"?l=t(u.slice(2,-1),!0,"not"):l=t(u.slice(1,-1),!0),i===e.length-1)return{operator:n,children:[l]};var f=e[i+1];if(f.type!=="")throw new Error(`Invalid operator +Invalid media condition`);if(n!==null&&n!==f.value)throw new Error("'".concat(f.value,"' and '").concat(n,`' must not be at same level +Invalid media condition`));if(f.value==="or"&&!r)throw new Error(`Cannot use 'or' at top level of a media query +Invalid media condition`);if(f.value!=="and"&&f.value!=="or")throw new Error("Invalid operator: '".concat(f.value,`' +Invalid media condition`));var d=t(e.slice(i+2),r,f.value);return{operator:f.value,children:[l].concat(d.children)}},zat=function(e){if(e.length<3||e[0].type!=="<(-token>"||e[e.length-1].type!=="<)-token>")throw new Error("Invalid media feature");for(var r=[e[0]],n=1;n"&&i.value>0&&s.type===""&&s.value===47&&o.type===""&&o.value>0){r.push({type:"",numerator:i.value,denominator:o.value,wsBefore:i.wsBefore,wsAfter:o.wsAfter}),n+=2;continue}}r.push(e[n])}var a=r[1];if(a.type===""&&r.length===3)return{context:"boolean",feature:a.value};if(r.length===5&&r[1].type===""&&r[2].type===""){var c=r[3];if(c.type===""||c.type===""||c.type===""||c.type===""){var l=r[1].value,u=null,f=l.slice(0,4);f==="min-"?(u="min",l=l.slice(4)):f==="max-"&&(u="max",l=l.slice(4)),c.wsBefore,c.wsAfter;var d=AR(c,["wsBefore","wsAfter"]);return{context:"value",prefix:u,feature:l,value:d}}}else if(r.length>=5)try{var p=Hat(r);return{context:"range",feature:p.featureName,range:p}}catch(g){throw vo("Invalid media feature",g)}throw new Error("Invalid media feature")},Hat=function(e){var r,n,i,s;if(e.length<5||e[0].type!=="<(-token>"||e[e.length-1].type!=="<)-token>")throw new Error("Invalid range");var o={leftToken:null,leftOp:null,featureName:"",rightOp:null,rightToken:null},a=e[1].type===""||e[1].type===""||e[1].type===""||e[1].type===""&&e[1].value==="infinite";if(e[2].type===""){if(e[2].value===60)e[3].type===""&&e[3].value===61&&!e[3].wsBefore?o[a?"leftOp":"rightOp"]="<=":o[a?"leftOp":"rightOp"]="<";else if(e[2].value===62)e[3].type===""&&e[3].value===61&&!e[3].wsBefore?o[a?"leftOp":"rightOp"]=">=":o[a?"leftOp":"rightOp"]=">";else if(e[2].value===61)o[a?"leftOp":"rightOp"]="=";else throw new Error("Invalid range");if(a)o.leftToken=e[1];else if(e[1].type==="")o.featureName=e[1].value;else throw new Error("Invalid range");var c=2+((n=(r=o[a?"leftOp":"rightOp"])===null||r===void 0?void 0:r.length)!==null&&n!==void 0?n:0),l=e[c];if(a)if(l.type===""){if(o.featureName=l.value,e.length>=7){var u=e[c+1],f=e[c+2];if(u.type===""){var d=u.value;if(d===60)f.type===""&&f.value===61&&!f.wsBefore?o.rightOp="<=":o.rightOp="<";else if(d===62)f.type===""&&f.value===61&&!f.wsBefore?o.rightOp=">=":o.rightOp=">";else throw new Error("Invalid range");var p=e[c+1+((s=(i=o.rightOp)===null||i===void 0?void 0:i.length)!==null&&s!==void 0?s:0)];o.rightToken=p}else throw new Error("Invalid range")}else if(c+2!==e.length)throw new Error("Invalid range")}else throw new Error("Invalid range");else o.rightToken=l;var g=null,v=o.leftToken,y=o.leftOp,b=o.featureName,w=o.rightOp,E=o.rightToken,C=null;if(v!==null){if(v.type===""){var S=v.type,P=v.value;P==="infinite"&&(C={type:S,value:P})}else if(v.type===""||v.type===""||v.type===""){v.wsBefore,v.wsAfter;var _=AR(v,["wsBefore","wsAfter"]);C=_}}var T=null;if(E!==null){if(E.type===""){var S=E.type,P=E.value;P==="infinite"&&(T={type:S,value:P})}else if(E.type===""||E.type===""||E.type===""){E.wsBefore,E.wsAfter;var Q=AR(E,["wsBefore","wsAfter"]);T=Q}}if(C!==null&&T!==null)if((y==="<"||y==="<=")&&(w==="<"||w==="<="))g={leftToken:C,leftOp:y,featureName:b,rightOp:w,rightToken:T};else if((y===">"||y===">=")&&(w===">"||w===">="))g={leftToken:C,leftOp:y,featureName:b,rightOp:w,rightToken:T};else throw new Error("Invalid range");else C===null&&y===null&&w!==null&&T!==null?g={leftToken:C,leftOp:y,featureName:b,rightOp:w,rightToken:T}:C!==null&&y!==null&&w===null&&T===null&&(g={leftToken:C,leftOp:y,featureName:b,rightOp:w,rightToken:T});return g}else throw new Error("Invalid range")};function qat(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Wat(t){var e=qat(t,"string");return typeof e=="symbol"?e:String(e)}function Vat(t,e,r){return e=Wat(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function HG(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function gb(t){for(var e=1;e=0)&&(r[i]=t[i]);return r}function qG(t,e){if(t==null)return{};var r=Gat(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function yy(t,e){for(var r in t)e(t[r],r)}function Ep(t,e){var r={};for(var n in t)e.indexOf(n)===-1&&(r[n]=t[n]);return r}function Kat(t,e){var r={};for(var n in t)r[e(t[n],n)]=t[n];return r}function kR(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n{var r=()=>{var i=new RegExp(".".concat(Qat(KM(e,{isIdentifier:!0}))),"g");return t.replace(i,"&")},n;try{n=Sat(t)}catch{throw new Error("Invalid selector: ".concat(r()))}n.forEach(i=>{try{for(var s=i.length-1;s>=-1;s--){if(!i[s])throw new Error;var o=i[s];if(o.type==="child"||o.type==="parent"||o.type==="sibling"||o.type==="adjacent"||o.type==="descendant")throw new Error;if(o.type==="attribute"&&o.name==="class"&&o.value===e)return}}catch{throw new Error(wl(WG||(WG=WM([` + Invalid selector: `,` + + Style selectors must target the '&' character (along with any modifiers), e.g. `," or ",`. + + This is to ensure that each style block only affects the styling of a single class. + + If your selector is targeting another class, you should move it to the style definition for that class, e.g. given we have styles for 'parent' and 'child' elements, instead of adding a selector of `,") to 'parent', you should add ",` to 'child'). + + If your selector is targeting something global, use the 'globalStyle' function instead, e.g. if you wanted to write `,", you should instead write 'globalStyle(",`, { ... })' + `])),r(),"`${parent} &`","`${parent} &:hover`","`& ${child}`","`${parent} &`","`& h1`","`${parent} h1`"))}})};class S_{constructor(){this.ruleset=new Map,this.precedenceLookup=new Map}findOrCreateCondition(e){var r=this.ruleset.get(e);return r||(r={query:e,rules:[],children:new S_},this.ruleset.set(e,r)),r}getConditionalRulesetByPath(e){var r=this;for(var n of e){var i=r.findOrCreateCondition(n);r=i.children}return r}addRule(e,r,n){var i=this.getConditionalRulesetByPath(n),s=i.findOrCreateCondition(r);if(!s)throw new Error("Failed to add conditional rule");s.rules.push(e)}addConditionPrecedence(e,r){for(var n=this.getConditionalRulesetByPath(e),i=0;ia.has(u.query));l>-1?r.splice(l,0,c):r.push(c)};for(var[i,s]of this.precedenceLookup.entries())n(s);return r}renderToArray(){var e=[];for(var{query:r,rules:n,children:i}of this.getSortedRuleset()){var s={};for(var o of n)s[o.selector]=o.rule;Object.assign(s,...i.renderToArray()),e.push({[r]:s})}return e}}var Que={":-moz-any-link":!0,":-moz-full-screen":!0,":-moz-placeholder":!0,":-moz-read-only":!0,":-moz-read-write":!0,":-ms-fullscreen":!0,":-ms-input-placeholder":!0,":-webkit-any-link":!0,":-webkit-full-screen":!0,"::-moz-color-swatch":!0,"::-moz-list-bullet":!0,"::-moz-list-number":!0,"::-moz-page-sequence":!0,"::-moz-page":!0,"::-moz-placeholder":!0,"::-moz-progress-bar":!0,"::-moz-range-progress":!0,"::-moz-range-thumb":!0,"::-moz-range-track":!0,"::-moz-scrolled-page-sequence":!0,"::-moz-selection":!0,"::-ms-backdrop":!0,"::-ms-browse":!0,"::-ms-check":!0,"::-ms-clear":!0,"::-ms-fill-lower":!0,"::-ms-fill-upper":!0,"::-ms-fill":!0,"::-ms-reveal":!0,"::-ms-thumb":!0,"::-ms-ticks-after":!0,"::-ms-ticks-before":!0,"::-ms-tooltip":!0,"::-ms-track":!0,"::-ms-value":!0,"::-webkit-backdrop":!0,"::-webkit-inner-spin-button":!0,"::-webkit-input-placeholder":!0,"::-webkit-meter-bar":!0,"::-webkit-meter-even-less-good-value":!0,"::-webkit-meter-inner-element":!0,"::-webkit-meter-optimum-value":!0,"::-webkit-meter-suboptimum-value":!0,"::-webkit-outer-spin-button":!0,"::-webkit-progress-bar":!0,"::-webkit-progress-inner-element":!0,"::-webkit-progress-inner-value":!0,"::-webkit-progress-value":!0,"::-webkit-resizer":!0,"::-webkit-scrollbar-button":!0,"::-webkit-scrollbar-corner":!0,"::-webkit-scrollbar-thumb":!0,"::-webkit-scrollbar-track-piece":!0,"::-webkit-scrollbar-track":!0,"::-webkit-scrollbar":!0,"::-webkit-search-cancel-button":!0,"::-webkit-search-results-button":!0,"::-webkit-slider-runnable-track":!0,"::-webkit-slider-thumb":!0,"::after":!0,"::backdrop":!0,"::before":!0,"::cue":!0,"::file-selector-button":!0,"::first-letter":!0,"::first-line":!0,"::grammar-error":!0,"::marker":!0,"::placeholder":!0,"::selection":!0,"::spelling-error":!0,"::target-text":!0,"::view-transition-group":!0,"::view-transition-image-pair":!0,"::view-transition-new":!0,"::view-transition-old":!0,"::view-transition":!0,":active":!0,":after":!0,":any-link":!0,":before":!0,":blank":!0,":checked":!0,":default":!0,":defined":!0,":disabled":!0,":empty":!0,":enabled":!0,":first-child":!0,":first-letter":!0,":first-line":!0,":first-of-type":!0,":first":!0,":focus-visible":!0,":focus-within":!0,":focus":!0,":fullscreen":!0,":hover":!0,":in-range":!0,":indeterminate":!0,":invalid":!0,":last-child":!0,":last-of-type":!0,":left":!0,":link":!0,":only-child":!0,":only-of-type":!0,":optional":!0,":out-of-range":!0,":placeholder-shown":!0,":read-only":!0,":read-write":!0,":required":!0,":right":!0,":root":!0,":scope":!0,":target":!0,":valid":!0,":visited":!0},Zat=Object.keys(Que),Xat=Que,VG,GG=(t,e)=>new Error(wl(VG||(VG=WM([` + Invalid media query: "`,`" + + `,` + + Read more on MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries + `])),t,e)),ect=t=>{if(t==="@media ")throw GG(t,"Query is empty");try{Lat(t)}catch(e){throw GG(t,e.message)}},tct=["vars"],rct=["content"],Yue="__DECLARATION",nct={animationIterationCount:!0,borderImage:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,initialLetter:!0,lineClamp:!0,lineHeight:!0,maxLines:!0,opacity:!0,order:!0,orphans:!0,scale:!0,tabSize:!0,WebkitLineClamp:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,maskBorder:!0,maskBorderOutset:!0,maskBorderSlice:!0,maskBorderWidth:!0,shapeImageThreshold:!0,stopOpacity:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};function ict(t){return t.replace(/([A-Z])/g,"-$1").replace(/^ms-/,"-ms-").toLowerCase()}function sct(t,e,r,n){var i=t.slice(0,e),s=t.slice(r);return"".concat(i).concat(n).concat(s)}var oct=" ",_p=[...Zat,"@layer","@media","@supports","@container","selectors"];class act{constructor(e,r){this.rules=[],this.conditionalRulesets=[new S_],this.fontFaceRules=[],this.keyframesRules=[],this.localClassNamesMap=new Map(e.map(n=>[n,n])),this.localClassNamesSearch=new yat(e),this.layers=new Map,this.composedClassLists=r.map(n=>{var{identifier:i,classList:s}=n;return{identifier:i,regex:RegExp("(".concat(s,")"),"g")}}).reverse()}processCssObj(e){if(e.type==="fontFace"){this.fontFaceRules.push(e.rule);return}if(e.type==="keyframes"){e.rule=Object.fromEntries(Object.entries(e.rule).map(s=>{var[o,a]=s;return[o,this.transformProperties(a)]})),this.keyframesRules.push(e);return}if(this.currConditionalRuleset=new S_,e.type==="layer"){var r="@layer ".concat(e.name);this.addLayer([r])}else{var n=Ep(e.rule,_p);this.addRule({selector:e.selector,rule:n}),this.transformLayer(e,e.rule["@layer"]),this.transformMedia(e,e.rule["@media"]),this.transformSupports(e,e.rule["@supports"]),this.transformContainer(e,e.rule["@container"]),this.transformSimplePseudos(e,e.rule),this.transformSelectors(e,e.rule)}var i=this.conditionalRulesets[this.conditionalRulesets.length-1];i.mergeIfCompatible(this.currConditionalRuleset)||this.conditionalRulesets.push(this.currConditionalRuleset)}addConditionalRule(e,r){var n=this.transformVars(this.transformProperties(e.rule)),i=this.transformSelector(e.selector);if(!this.currConditionalRuleset)throw new Error("Couldn't add conditional rule");var s=r[r.length-1],o=r.slice(0,r.length-1);this.currConditionalRuleset.addRule({selector:i,rule:n},s,o)}addRule(e){var r=this.transformVars(this.transformProperties(e.rule)),n=this.transformSelector(e.selector);this.rules.push({selector:n,rule:r})}addLayer(e){var r=e.join(" - ");this.layers.set(r,e)}transformProperties(e){return this.transformContent(this.pixelifyProperties(e))}pixelifyProperties(e){return yy(e,(r,n)=>{typeof r=="number"&&r!==0&&!nct[n]&&(e[n]="".concat(r,"px"))}),e}transformVars(e){var{vars:r}=e,n=qG(e,tct);return r?gb(gb({},Kat(r,(i,s)=>uat(s))),n):n}transformContent(e){var{content:r}=e,n=qG(e,rct);if(typeof r>"u")return n;var i=Array.isArray(r)?r:[r];return gb({content:i.map(s=>s&&(s.includes('"')||s.includes("'")||/^([A-Za-z\-]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)(\s|$)/.test(s))?s:'"'.concat(s,'"'))},n)}transformClassname(e){return".".concat(KM(e,{isIdentifier:!0}))}transformSelector(e){var r=e,n=function(p){r=r.replace(s,()=>(Gue(p),p))};for(var{identifier:i,regex:s}of this.composedClassLists)n(i);if(this.localClassNamesMap.has(r))return this.transformClassname(r);for(var o=this.localClassNamesSearch.search(r),a=r.length,c=o.length-1;c>=0;c--){var[l,[u]]=o[c],f=l-u.length+1;f>=a||(a=f,r[f-1]!=="."&&(r=sct(r,f,l+1,this.transformClassname(u))))}return r}transformSelectors(e,r,n){yy(r.selectors,(i,s)=>{if(e.type!=="local")throw new Error("Selectors are not allowed within ".concat(e.type==="global"?'"globalStyle"':'"selectors"'));var o=this.transformSelector(s.replace(RegExp("&","g"),e.selector));Yat(o,e.selector);var a={selector:o,rule:Ep(i,_p)};n?this.addConditionalRule(a,n):this.addRule(a);var c={type:"selector",selector:o,rule:i};this.transformLayer(c,i["@layer"],n),this.transformSupports(c,i["@supports"],n),this.transformMedia(c,i["@media"],n)})}transformMedia(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(r){var i;(i=this.currConditionalRuleset)===null||i===void 0||i.addConditionPrecedence(n,Object.keys(r).map(l=>"@media ".concat(l)));for(var[s,o]of Object.entries(r)){var a="@media ".concat(s);ect(a);var c=[...n,a];this.addConditionalRule({selector:e.selector,rule:Ep(o,_p)},c),e.type==="local"&&(this.transformSimplePseudos(e,o,c),this.transformSelectors(e,o,c)),this.transformLayer(e,o["@layer"],c),this.transformSupports(e,o["@supports"],c),this.transformContainer(e,o["@container"],c)}}}transformContainer(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(r){var i;(i=this.currConditionalRuleset)===null||i===void 0||i.addConditionPrecedence(n,Object.keys(r).map(s=>"@container ".concat(s))),yy(r,(s,o)=>{var a="@container ".concat(o),c=[...n,a];this.addConditionalRule({selector:e.selector,rule:Ep(s,_p)},c),e.type==="local"&&(this.transformSimplePseudos(e,s,c),this.transformSelectors(e,s,c)),this.transformLayer(e,s["@layer"],c),this.transformSupports(e,s["@supports"],c),this.transformMedia(e,s["@media"],c)})}}transformLayer(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(r){var i;(i=this.currConditionalRuleset)===null||i===void 0||i.addConditionPrecedence(n,Object.keys(r).map(s=>"@layer ".concat(s))),yy(r,(s,o)=>{var a=[...n,"@layer ".concat(o)];this.addLayer(a),this.addConditionalRule({selector:e.selector,rule:Ep(s,_p)},a),e.type==="local"&&(this.transformSimplePseudos(e,s,a),this.transformSelectors(e,s,a)),this.transformMedia(e,s["@media"],a),this.transformSupports(e,s["@supports"],a),this.transformContainer(e,s["@container"],a)})}}transformSupports(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(r){var i;(i=this.currConditionalRuleset)===null||i===void 0||i.addConditionPrecedence(n,Object.keys(r).map(s=>"@supports ".concat(s))),yy(r,(s,o)=>{var a=[...n,"@supports ".concat(o)];this.addConditionalRule({selector:e.selector,rule:Ep(s,_p)},a),e.type==="local"&&(this.transformSimplePseudos(e,s,a),this.transformSelectors(e,s,a)),this.transformLayer(e,s["@layer"],a),this.transformMedia(e,s["@media"],a),this.transformContainer(e,s["@container"],a)})}}transformSimplePseudos(e,r,n){for(var i of Object.keys(r))if(Xat[i]){if(e.type!=="local")throw new Error("Simple pseudos are not valid in ".concat(e.type==="global"?'"globalStyle"':'"selectors"'));n?this.addConditionalRule({selector:"".concat(e.selector).concat(i),rule:r[i]},n):this.addRule({conditions:n,selector:"".concat(e.selector).concat(i),rule:r[i]})}}toCss(){var e=[];for(var r of this.fontFaceRules)e.push(y0({"@font-face":r}));for(var n of this.keyframesRules)e.push(y0({["@keyframes ".concat(n.name)]:n.rule}));for(var i of this.layers.values()){var[s,...o]=i.reverse(),a={[s]:Yue};for(var c of o)a={[c]:a};e.push(y0(a))}for(var l of this.rules)e.push(y0({[l.selector]:l.rule}));for(var u of this.conditionalRulesets)for(var f of u.renderToArray())e.push(y0(f));return e.filter(Boolean)}}function y0(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=[],n=function(o){var a=t[o];if(a&&Array.isArray(a))r.push(...a.map(l=>y0({[o]:l},e)));else if(a&&typeof a=="object"){var c=Object.keys(a).length===0;c||r.push("".concat(e).concat(o,` { +`).concat(y0(a,e+oct),` +`).concat(e,"}"))}else a===Yue?r.push("".concat(e).concat(o,";")):r.push("".concat(e).concat(o.startsWith("--")?o:ict(o),": ").concat(a,";"))};for(var i of Object.keys(t))n(i);return r.join(` +`)}function cct(t){var{localClassNames:e,cssObjs:r,composedClassLists:n}=t,i=new act(e,n);for(var s of r)i.processCssObj(s);return i.toCss()}function Zue(t){for(var e=0,r,n=0,i=t.length;i>=4;++n,i-=4)r=t.charCodeAt(n)&255|(t.charCodeAt(++n)&255)<<8|(t.charCodeAt(++n)&255)<<16|(t.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,e=(r&65535)*1540483477+((r>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(t.charCodeAt(n+2)&255)<<16;case 2:e^=(t.charCodeAt(n+1)&255)<<8;case 1:e^=t.charCodeAt(n)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var QM={exports:{}},O7,KG;function lct(){return KG||(KG=1,O7={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}),O7}var $7,JG;function Xue(){if(JG)return $7;JG=1;const t=lct(),e={};for(const i of Object.keys(t))e[t[i]]=i;const r={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};$7=r;for(const i of Object.keys(r)){if(!("channels"in r[i]))throw new Error("missing channels property: "+i);if(!("labels"in r[i]))throw new Error("missing channel labels property: "+i);if(r[i].labels.length!==r[i].channels)throw new Error("channel and label counts mismatch: "+i);const{channels:s,labels:o}=r[i];delete r[i].channels,delete r[i].labels,Object.defineProperty(r[i],"channels",{value:s}),Object.defineProperty(r[i],"labels",{value:o})}r.rgb.hsl=function(i){const s=i[0]/255,o=i[1]/255,a=i[2]/255,c=Math.min(s,o,a),l=Math.max(s,o,a),u=l-c;let f,d;l===c?f=0:s===l?f=(o-a)/u:o===l?f=2+(a-s)/u:a===l&&(f=4+(s-o)/u),f=Math.min(f*60,360),f<0&&(f+=360);const p=(c+l)/2;return l===c?d=0:p<=.5?d=u/(l+c):d=u/(2-l-c),[f,d*100,p*100]},r.rgb.hsv=function(i){let s,o,a,c,l;const u=i[0]/255,f=i[1]/255,d=i[2]/255,p=Math.max(u,f,d),g=p-Math.min(u,f,d),v=function(y){return(p-y)/6/g+1/2};return g===0?(c=0,l=0):(l=g/p,s=v(u),o=v(f),a=v(d),u===p?c=a-o:f===p?c=1/3+s-a:d===p&&(c=2/3+o-s),c<0?c+=1:c>1&&(c-=1)),[c*360,l*100,p*100]},r.rgb.hwb=function(i){const s=i[0],o=i[1];let a=i[2];const c=r.rgb.hsl(i)[0],l=1/255*Math.min(s,Math.min(o,a));return a=1-1/255*Math.max(s,Math.max(o,a)),[c,l*100,a*100]},r.rgb.cmyk=function(i){const s=i[0]/255,o=i[1]/255,a=i[2]/255,c=Math.min(1-s,1-o,1-a),l=(1-s-c)/(1-c)||0,u=(1-o-c)/(1-c)||0,f=(1-a-c)/(1-c)||0;return[l*100,u*100,f*100,c*100]};function n(i,s){return(i[0]-s[0])**2+(i[1]-s[1])**2+(i[2]-s[2])**2}return r.rgb.keyword=function(i){const s=e[i];if(s)return s;let o=1/0,a;for(const c of Object.keys(t)){const l=t[c],u=n(i,l);u.04045?((s+.055)/1.055)**2.4:s/12.92,o=o>.04045?((o+.055)/1.055)**2.4:o/12.92,a=a>.04045?((a+.055)/1.055)**2.4:a/12.92;const c=s*.4124+o*.3576+a*.1805,l=s*.2126+o*.7152+a*.0722,u=s*.0193+o*.1192+a*.9505;return[c*100,l*100,u*100]},r.rgb.lab=function(i){const s=r.rgb.xyz(i);let o=s[0],a=s[1],c=s[2];o/=95.047,a/=100,c/=108.883,o=o>.008856?o**(1/3):7.787*o+16/116,a=a>.008856?a**(1/3):7.787*a+16/116,c=c>.008856?c**(1/3):7.787*c+16/116;const l=116*a-16,u=500*(o-a),f=200*(a-c);return[l,u,f]},r.hsl.rgb=function(i){const s=i[0]/360,o=i[1]/100,a=i[2]/100;let c,l,u;if(o===0)return u=a*255,[u,u,u];a<.5?c=a*(1+o):c=a+o-a*o;const f=2*a-c,d=[0,0,0];for(let p=0;p<3;p++)l=s+1/3*-(p-1),l<0&&l++,l>1&&l--,6*l<1?u=f+(c-f)*6*l:2*l<1?u=c:3*l<2?u=f+(c-f)*(2/3-l)*6:u=f,d[p]=u*255;return d},r.hsl.hsv=function(i){const s=i[0];let o=i[1]/100,a=i[2]/100,c=o;const l=Math.max(a,.01);a*=2,o*=a<=1?a:2-a,c*=l<=1?l:2-l;const u=(a+o)/2,f=a===0?2*c/(l+c):2*o/(a+o);return[s,f*100,u*100]},r.hsv.rgb=function(i){const s=i[0]/60,o=i[1]/100;let a=i[2]/100;const c=Math.floor(s)%6,l=s-Math.floor(s),u=255*a*(1-o),f=255*a*(1-o*l),d=255*a*(1-o*(1-l));switch(a*=255,c){case 0:return[a,d,u];case 1:return[f,a,u];case 2:return[u,a,d];case 3:return[u,f,a];case 4:return[d,u,a];case 5:return[a,u,f]}},r.hsv.hsl=function(i){const s=i[0],o=i[1]/100,a=i[2]/100,c=Math.max(a,.01);let l,u;u=(2-o)*a;const f=(2-o)*c;return l=o*c,l/=f<=1?f:2-f,l=l||0,u/=2,[s,l*100,u*100]},r.hwb.rgb=function(i){const s=i[0]/360;let o=i[1]/100,a=i[2]/100;const c=o+a;let l;c>1&&(o/=c,a/=c);const u=Math.floor(6*s),f=1-a;l=6*s-u,u&1&&(l=1-l);const d=o+l*(f-o);let p,g,v;switch(u){default:case 6:case 0:p=f,g=d,v=o;break;case 1:p=d,g=f,v=o;break;case 2:p=o,g=f,v=d;break;case 3:p=o,g=d,v=f;break;case 4:p=d,g=o,v=f;break;case 5:p=f,g=o,v=d;break}return[p*255,g*255,v*255]},r.cmyk.rgb=function(i){const s=i[0]/100,o=i[1]/100,a=i[2]/100,c=i[3]/100,l=1-Math.min(1,s*(1-c)+c),u=1-Math.min(1,o*(1-c)+c),f=1-Math.min(1,a*(1-c)+c);return[l*255,u*255,f*255]},r.xyz.rgb=function(i){const s=i[0]/100,o=i[1]/100,a=i[2]/100;let c,l,u;return c=s*3.2406+o*-1.5372+a*-.4986,l=s*-.9689+o*1.8758+a*.0415,u=s*.0557+o*-.204+a*1.057,c=c>.0031308?1.055*c**(1/2.4)-.055:c*12.92,l=l>.0031308?1.055*l**(1/2.4)-.055:l*12.92,u=u>.0031308?1.055*u**(1/2.4)-.055:u*12.92,c=Math.min(Math.max(0,c),1),l=Math.min(Math.max(0,l),1),u=Math.min(Math.max(0,u),1),[c*255,l*255,u*255]},r.xyz.lab=function(i){let s=i[0],o=i[1],a=i[2];s/=95.047,o/=100,a/=108.883,s=s>.008856?s**(1/3):7.787*s+16/116,o=o>.008856?o**(1/3):7.787*o+16/116,a=a>.008856?a**(1/3):7.787*a+16/116;const c=116*o-16,l=500*(s-o),u=200*(o-a);return[c,l,u]},r.lab.xyz=function(i){const s=i[0],o=i[1],a=i[2];let c,l,u;l=(s+16)/116,c=o/500+l,u=l-a/200;const f=l**3,d=c**3,p=u**3;return l=f>.008856?f:(l-16/116)/7.787,c=d>.008856?d:(c-16/116)/7.787,u=p>.008856?p:(u-16/116)/7.787,c*=95.047,l*=100,u*=108.883,[c,l,u]},r.lab.lch=function(i){const s=i[0],o=i[1],a=i[2];let c;c=Math.atan2(a,o)*360/2/Math.PI,c<0&&(c+=360);const u=Math.sqrt(o*o+a*a);return[s,u,c]},r.lch.lab=function(i){const s=i[0],o=i[1],c=i[2]/360*2*Math.PI,l=o*Math.cos(c),u=o*Math.sin(c);return[s,l,u]},r.rgb.ansi16=function(i,s=null){const[o,a,c]=i;let l=s===null?r.rgb.hsv(i)[2]:s;if(l=Math.round(l/50),l===0)return 30;let u=30+(Math.round(c/255)<<2|Math.round(a/255)<<1|Math.round(o/255));return l===2&&(u+=60),u},r.hsv.ansi16=function(i){return r.rgb.ansi16(r.hsv.rgb(i),i[2])},r.rgb.ansi256=function(i){const s=i[0],o=i[1],a=i[2];return s===o&&o===a?s<8?16:s>248?231:Math.round((s-8)/247*24)+232:16+36*Math.round(s/255*5)+6*Math.round(o/255*5)+Math.round(a/255*5)},r.ansi16.rgb=function(i){let s=i%10;if(s===0||s===7)return i>50&&(s+=3.5),s=s/10.5*255,[s,s,s];const o=(~~(i>50)+1)*.5,a=(s&1)*o*255,c=(s>>1&1)*o*255,l=(s>>2&1)*o*255;return[a,c,l]},r.ansi256.rgb=function(i){if(i>=232){const l=(i-232)*10+8;return[l,l,l]}i-=16;let s;const o=Math.floor(i/36)/5*255,a=Math.floor((s=i%36)/6)/5*255,c=s%6/5*255;return[o,a,c]},r.rgb.hex=function(i){const o=(((Math.round(i[0])&255)<<16)+((Math.round(i[1])&255)<<8)+(Math.round(i[2])&255)).toString(16).toUpperCase();return"000000".substring(o.length)+o},r.hex.rgb=function(i){const s=i.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!s)return[0,0,0];let o=s[0];s[0].length===3&&(o=o.split("").map(f=>f+f).join(""));const a=parseInt(o,16),c=a>>16&255,l=a>>8&255,u=a&255;return[c,l,u]},r.rgb.hcg=function(i){const s=i[0]/255,o=i[1]/255,a=i[2]/255,c=Math.max(Math.max(s,o),a),l=Math.min(Math.min(s,o),a),u=c-l;let f,d;return u<1?f=l/(1-u):f=0,u<=0?d=0:c===s?d=(o-a)/u%6:c===o?d=2+(a-s)/u:d=4+(s-o)/u,d/=6,d%=1,[d*360,u*100,f*100]},r.hsl.hcg=function(i){const s=i[1]/100,o=i[2]/100,a=o<.5?2*s*o:2*s*(1-o);let c=0;return a<1&&(c=(o-.5*a)/(1-a)),[i[0],a*100,c*100]},r.hsv.hcg=function(i){const s=i[1]/100,o=i[2]/100,a=s*o;let c=0;return a<1&&(c=(o-a)/(1-a)),[i[0],a*100,c*100]},r.hcg.rgb=function(i){const s=i[0]/360,o=i[1]/100,a=i[2]/100;if(o===0)return[a*255,a*255,a*255];const c=[0,0,0],l=s%1*6,u=l%1,f=1-u;let d=0;switch(Math.floor(l)){case 0:c[0]=1,c[1]=u,c[2]=0;break;case 1:c[0]=f,c[1]=1,c[2]=0;break;case 2:c[0]=0,c[1]=1,c[2]=u;break;case 3:c[0]=0,c[1]=f,c[2]=1;break;case 4:c[0]=u,c[1]=0,c[2]=1;break;default:c[0]=1,c[1]=0,c[2]=f}return d=(1-o)*a,[(o*c[0]+d)*255,(o*c[1]+d)*255,(o*c[2]+d)*255]},r.hcg.hsv=function(i){const s=i[1]/100,o=i[2]/100,a=s+o*(1-s);let c=0;return a>0&&(c=s/a),[i[0],c*100,a*100]},r.hcg.hsl=function(i){const s=i[1]/100,a=i[2]/100*(1-s)+.5*s;let c=0;return a>0&&a<.5?c=s/(2*a):a>=.5&&a<1&&(c=s/(2*(1-a))),[i[0],c*100,a*100]},r.hcg.hwb=function(i){const s=i[1]/100,o=i[2]/100,a=s+o*(1-s);return[i[0],(a-s)*100,(1-a)*100]},r.hwb.hcg=function(i){const s=i[1]/100,a=1-i[2]/100,c=a-s;let l=0;return c<1&&(l=(a-c)/(1-c)),[i[0],c*100,l*100]},r.apple.rgb=function(i){return[i[0]/65535*255,i[1]/65535*255,i[2]/65535*255]},r.rgb.apple=function(i){return[i[0]/255*65535,i[1]/255*65535,i[2]/255*65535]},r.gray.rgb=function(i){return[i[0]/100*255,i[0]/100*255,i[0]/100*255]},r.gray.hsl=function(i){return[0,0,i[0]]},r.gray.hsv=r.gray.hsl,r.gray.hwb=function(i){return[0,100,i[0]]},r.gray.cmyk=function(i){return[0,0,0,i[0]]},r.gray.lab=function(i){return[i[0],0,0]},r.gray.hex=function(i){const s=Math.round(i[0]/100*255)&255,a=((s<<16)+(s<<8)+s).toString(16).toUpperCase();return"000000".substring(a.length)+a},r.rgb.gray=function(i){return[(i[0]+i[1]+i[2])/3/255*100]},$7}var N7,QG;function uct(){if(QG)return N7;QG=1;const t=Xue();function e(){const s={},o=Object.keys(t);for(let a=o.length,c=0;c1&&(c=l),o(c))};return"conversion"in o&&(a.conversion=o.conversion),a}function s(o){const a=function(...c){const l=c[0];if(l==null)return l;l.length>1&&(c=l);const u=o(c);if(typeof u=="object")for(let f=u.length,d=0;d{r[o]={},Object.defineProperty(r[o],"channels",{value:t[o].channels}),Object.defineProperty(r[o],"labels",{value:t[o].labels});const a=e(o);Object.keys(a).forEach(l=>{const u=a[l];r[o][l]=s(u),r[o][l].raw=i(u)})}),M7=r,M7}QM.exports;(function(t){const e=(u,f)=>(...d)=>`\x1B[${u(...d)+f}m`,r=(u,f)=>(...d)=>{const p=u(...d);return`\x1B[${38+f};5;${p}m`},n=(u,f)=>(...d)=>{const p=u(...d);return`\x1B[${38+f};2;${p[0]};${p[1]};${p[2]}m`},i=u=>u,s=(u,f,d)=>[u,f,d],o=(u,f,d)=>{Object.defineProperty(u,f,{get:()=>{const p=d();return Object.defineProperty(u,f,{value:p,enumerable:!0,configurable:!0}),p},enumerable:!0,configurable:!0})};let a;const c=(u,f,d,p)=>{a===void 0&&(a=fct());const g=p?10:0,v={};for(const[y,b]of Object.entries(a)){const w=y==="ansi16"?"ansi":y;y===f?v[w]=u(d,g):typeof b=="object"&&(v[w]=u(b[f],g))}return v};function l(){const u=new Map,f={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};f.color.gray=f.color.blackBright,f.bgColor.bgGray=f.bgColor.bgBlackBright,f.color.grey=f.color.blackBright,f.bgColor.bgGrey=f.bgColor.bgBlackBright;for(const[d,p]of Object.entries(f)){for(const[g,v]of Object.entries(p))f[g]={open:`\x1B[${v[0]}m`,close:`\x1B[${v[1]}m`},p[g]=f[g],u.set(v[0],v[1]);Object.defineProperty(f,d,{value:p,enumerable:!1})}return Object.defineProperty(f,"codes",{value:u,enumerable:!1}),f.color.close="\x1B[39m",f.bgColor.close="\x1B[49m",o(f.color,"ansi",()=>c(e,"ansi16",i,!1)),o(f.color,"ansi256",()=>c(r,"ansi256",i,!1)),o(f.color,"ansi16m",()=>c(n,"rgb",s,!1)),o(f.bgColor,"ansi",()=>c(e,"ansi16",i,!0)),o(f.bgColor,"ansi256",()=>c(r,"ansi256",i,!0)),o(f.bgColor,"ansi16m",()=>c(n,"rgb",s,!0)),f}Object.defineProperty(t,"exports",{enumerable:!0,get:l})})(QM);var dct=QM.exports,hct={stdout:!1,stderr:!1};const pct=(t,e,r)=>{let n=t.indexOf(e);if(n===-1)return t;const i=e.length;let s=0,o="";do o+=t.substr(s,n-s)+e+r,s=n+i,n=t.indexOf(e,s);while(n!==-1);return o+=t.substr(s),o},gct=(t,e,r,n)=>{let i=0,s="";do{const o=t[n-1]==="\r";s+=t.substr(i,(o?n-1:n)-i)+e+(o?`\r +`:` +`)+r,i=n+1,n=t.indexOf(` +`,i)}while(n!==-1);return s+=t.substr(i),s};var mct={stringReplaceAll:pct,stringEncaseCRLFWithFirstIndex:gct},D7,ZG;function vct(){if(ZG)return D7;ZG=1;const t=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,e=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,r=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,n=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,i=new Map([["n",` +`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function s(l){const u=l[0]==="u",f=l[1]==="{";return u&&!f&&l.length===5||l[0]==="x"&&l.length===3?String.fromCharCode(parseInt(l.slice(1),16)):u&&f?String.fromCodePoint(parseInt(l.slice(2,-1),16)):i.get(l)||l}function o(l,u){const f=[],d=u.trim().split(/\s*,\s*/g);let p;for(const g of d){const v=Number(g);if(!Number.isNaN(v))f.push(v);else if(p=g.match(r))f.push(p[2].replace(n,(y,b,w)=>b?s(b):w));else throw new Error(`Invalid Chalk template style argument: ${g} (in style '${l}')`)}return f}function a(l){e.lastIndex=0;const u=[];let f;for(;(f=e.exec(l))!==null;){const d=f[1];if(f[2]){const p=o(d,f[2]);u.push([d].concat(p))}else u.push([d])}return u}function c(l,u){const f={};for(const p of u)for(const g of p.styles)f[g[0]]=p.inverse?null:g.slice(1);let d=l;for(const[p,g]of Object.entries(f))if(Array.isArray(g)){if(!(p in d))throw new Error(`Unknown Chalk style: ${p}`);d=g.length>0?d[p](...g):d[p]}return d}return D7=(l,u)=>{const f=[],d=[];let p=[];if(u.replace(t,(g,v,y,b,w,E)=>{if(v)p.push(s(v));else if(b){const C=p.join("");p=[],d.push(f.length===0?C:c(l,f)(C)),f.push({inverse:y,styles:a(b)})}else if(w){if(f.length===0)throw new Error("Found extraneous } in Chalk template literal");d.push(c(l,f)(p.join(""))),p=[],f.pop()}else p.push(E)}),d.push(p.join("")),f.length>0){const g=`Chalk template literal is missing ${f.length} closing bracket${f.length===1?"":"s"} (\`}\`)`;throw new Error(g)}return d.join("")},D7}const R2=dct,{stdout:IR,stderr:PR}=hct,{stringReplaceAll:yct,stringEncaseCRLFWithFirstIndex:bct}=mct,{isArray:A_}=Array,efe=["ansi","ansi","ansi256","ansi16m"],av=Object.create(null),wct=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const r=IR?IR.level:0;t.level=e.level===void 0?r:e.level};class xct{constructor(e){return tfe(e)}}const tfe=t=>{const e={};return wct(e,t),e.template=(...r)=>nfe(e.template,...r),Object.setPrototypeOf(e,T4.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},e.template.Instance=xct,e.template};function T4(t){return tfe(t)}for(const[t,e]of Object.entries(R2))av[t]={get(){const r=O4(this,YM(e.open,e.close,this._styler),this._isEmpty);return Object.defineProperty(this,t,{value:r}),r}};av.visible={get(){const t=O4(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:t}),t}};const rfe=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(const t of rfe)av[t]={get(){const{level:e}=this;return function(...r){const n=YM(R2.color[efe[e]][t](...r),R2.color.close,this._styler);return O4(this,n,this._isEmpty)}}};for(const t of rfe){const e="bg"+t[0].toUpperCase()+t.slice(1);av[e]={get(){const{level:r}=this;return function(...n){const i=YM(R2.bgColor[efe[r]][t](...n),R2.bgColor.close,this._styler);return O4(this,i,this._isEmpty)}}}}const Ect=Object.defineProperties(()=>{},{...av,level:{enumerable:!0,get(){return this._generator.level},set(t){this._generator.level=t}}}),YM=(t,e,r)=>{let n,i;return r===void 0?(n=t,i=e):(n=r.openAll+t,i=e+r.closeAll),{open:t,close:e,openAll:n,closeAll:i,parent:r}},O4=(t,e,r)=>{const n=(...i)=>A_(i[0])&&A_(i[0].raw)?XG(n,nfe(n,...i)):XG(n,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(n,Ect),n._generator=t,n._styler=e,n._isEmpty=r,n},XG=(t,e)=>{if(t.level<=0||!e)return t._isEmpty?"":e;let r=t._styler;if(r===void 0)return e;const{openAll:n,closeAll:i}=r;if(e.indexOf("\x1B")!==-1)for(;r!==void 0;)e=yct(e,r.close,r.open),r=r.parent;const s=e.indexOf(` +`);return s!==-1&&(e=bct(e,i,n,s)),n+e+i};let L7;const nfe=(t,...e)=>{const[r]=e;if(!A_(r)||!A_(r.raw))return e.join(" ");const n=e.slice(1),i=[r.raw[0]];for(let s=1;s{B7.push(t)},registerClassName:t=>{tK.add(t)},registerComposition:t=>{rK.push(t)},markCompositionUsed:()=>{},onEndFileScope:t=>{var e=cct({localClassNames:Array.from(tK),composedClassLists:rK,cssObjs:B7}).join(` +`);lat({fileScope:t,css:e}),B7=[]},getIdentOption:()=>"short"};rat(Bct);function k_(t,e){return k_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},k_(t,e)}function Fct(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&k_(t,e)}function RR(){RR=function(i,s){return new r(i,void 0,s)};var t=RegExp.prototype,e=new WeakMap;function r(i,s,o){var a=new RegExp(i,s);return e.set(a,o||e.get(i)),k_(a,r.prototype)}function n(i,s){var o=e.get(s);return Object.keys(o).reduce(function(a,c){var l=o[c];if(typeof l=="number")a[c]=i[l];else{for(var u=0;i[l[u]]===void 0&&u+1]+)>/g,function(c,l){var u=o[l];return"$"+(Array.isArray(u)?u.join("$"):u)}))}if(typeof s=="function"){var a=this;return t[Symbol.replace].call(this,i,function(){var c=arguments;return typeof c[c.length-1]!="object"&&(c=[].slice.call(c)).push(n(c,a)),s.apply(this,c)})}return t[Symbol.replace].call(this,i,s)},RR.apply(this,arguments)}function jct(t){var{debugId:e,debugFileName:r}=t,n=e?[e.replace(/\s/g,"_")]:[];if(r){var{filePath:i}=Hl(),s=i.match(RR(/([^\/\\]*)?[\/\\]?([^\/\\]*)\.css\.(ts|js|tsx|jsx|cjs|mjs)$/,{dir:1,file:2}));if(s&&s.groups){var{dir:o,file:a}=s.groups;n.unshift(a&&a!=="index"?a:o)}}return n.join("_")}function nK(t){return t.match(/^[0-9]/)?"_".concat(t):t}function XM(t){var e=aat(),{debugId:r,debugFileName:n=!0}=gb(gb({},typeof t=="string"?{debugId:t}:null),typeof t=="object"?t:null),i=cat().toString(36),{filePath:s,packageName:o}=Hl(),a=Zue(o?"".concat(o).concat(s):s),c="".concat(a).concat(i);if(e==="debug"){var l=jct({debugId:r,debugFileName:n});return l&&(c="".concat(l,"__").concat(c)),nK(c)}if(typeof e=="function"){if(c=e({hash:c,debugId:r,filePath:s,packageName:o}),!c.match(/^[A-Z_][0-9A-Z_]+$/i))throw new Error('Identifier function returned invalid indentifier: "'.concat(c,'"'));return c}return nK(c)}function Uct(t,e){var r=XM(e);Vue(r,Hl());var n=[],i=[];for(var s of t)typeof s=="string"?n.push(s):i.push(s);var o=r;if(n.length>0&&(o="".concat(r," ").concat(Jat(n)),iat({identifier:r,classList:o},Hl()),i.length>0&&Gue(r)),i.length>0){var a=Lct.all(i,{arrayMerge:(c,l)=>l});R4({type:"local",selector:r,rule:a},Hl())}return o}function pa(t,e){if(Array.isArray(t))return Uct(t,e);var r=XM(e);return Vue(r,Hl()),R4({type:"local",selector:r,rule:t},Hl()),r}function Qc(t,e){R4({type:"global",selector:t,rule:e},Hl())}function sfe(t,e){var r=KM(XM(e),{isIdentifier:!0});return R4({type:"keyframes",name:r,rule:t},Hl()),r}function ah(){return ah=Object.assign?Object.assign.bind():function(t){for(var e=1;e svg`,{width:"20px",height:"20px"});D1();const Hct=({onConnect:t,connectors:e})=>{const{theme:r}=uw(),{isPending:n}=nae();return O.createElement(ae,{flexDirection:"column",gap:"2",marginTop:"5"},e.map(i=>{const s=r==="dark"?i._wallet.logoDark:i._wallet.logoLight,o=i._wallet.name,a=i._wallet.id;return O.createElement(ae,{key:a,as:"button",flexDirection:"row",alignItems:"center",justifyContent:"space-between",background:"backgroundSecondary",color:"text100",borderRadius:"md",padding:"4",style:{height:"60px"},className:zct,onClick:()=>t(i)},O.createElement(Pe,{variant:"medium",color:"text100"},o,n),O.createElement(ae,{justifyContent:"center",alignItems:"center",style:{backgroundColor:i._wallet.iconBackground},borderRadius:"md",className:ofe},O.createElement(s,null)))}))},qct=({config:t={}})=>{const{signIn:e={}}=t,{logoUrl:r}=e;return O.createElement(O.Fragment,null,r&&O.createElement(ae,{marginTop:"5",justifyContent:"center",alignItems:"center"},O.createElement(Hn,{src:r,style:{height:"110px"}})))};let Qi=function(t){return t.Settings="@kit.settings",t.Theme="@kit.theme",t.EthAuthProof="@kit.ethAuthProof",t.EthAuthSettings="@kit.ethAuthSettings",t.ProjectAccessKey="@kit.projectAccessKey",t}({});const F7={showEmailInput:!0,walletAuthOptions:["sequence","metamask","wallet-connect","coinbase-wallet"],socialAuthOptions:["google","facebook","twitch","apple"]},afe=60*60*24*7;function Wct(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,s;for(s=0;s=0)&&(r[i]=t[i]);return r}const Vct=["createConnector"],cfe=(t,e)=>{localStorage.setItem(Qi.ProjectAccessKey,t);const r=[],n=e.find(s=>s.id==="injected");return e.filter(s=>!n||!n.hideConnectorId?!0:s.id!==n.hideConnectorId).forEach(s=>{const{createConnector:o}=s,a=Wct(s,Vct),c=ah({},a),l=u=>{const d=o()(u);return d._wallet=ah({},c),d};r.push(l)}),r},Gct=t=>/^\S+@\S+\.\S{2,}$/.test(t),OR={1:{name:"Ethereum",symbol:"ETH",logoURI:"https://assets.coingecko.com/coins/images/279/thumb/ethereum.png",decimals:18,blockExplorerName:"Etherscan",blockExplorerUrl:"https://etherscan.io"},5:{name:"Goerli",symbol:"ETH",decimals:18,logoURI:"https://assets.coingecko.com/coins/images/279/thumb/ethereum.png",blockExplorerName:"Etherscan (Goerli)",blockExplorerUrl:"https://goerli.etherscan.io"},10:{name:"Optimism",symbol:"OP",logoURI:"https://assets.coingecko.com/coins/images/25244/small/Optimism.png",decimals:18,blockExplorerName:"Etherscan (Optimism)",blockExplorerUrl:"https://optimistic.etherscan.io"},56:{name:"BNB",symbol:"BNB",logoURI:"https://assets.coingecko.com/coins/images/825/thumb/bnb-icon2_2x.png",decimals:18,blockExplorerName:"BscScan",blockExplorerUrl:"https://bscscan.com"},100:{name:"Gnosis",symbol:"GNO",logoURI:"https://assets.coingecko.com/coins/images/662/small/logo_square_simple_300px.png",decimals:18,blockExplorerUrl:"https://gnosisscan.io",blockExplorerName:"Gnosis Scan"},137:{name:"Polygon",symbol:"MATIC",logoURI:"https://assets.coingecko.com/coins/images/4713/thumb/matic-token-icon.png",decimals:18,blockExplorerName:"Polyscan",blockExplorerUrl:"https://polygonscan.com"},1101:{name:"Polygon zkEVM",symbol:"ETH",logoURI:"https://assets.coingecko.com/coins/images/4713/thumb/matic-token-icon.png",decimals:18,blockExplorerName:"PolygonScan",blockExplorerUrl:"https://zkevm.polygonscan.com"},42161:{name:"Arbitrum",symbol:"ARB",logoURI:"https://assets.coingecko.com/asset_platforms/images/33/small/arbitrum-one.png",decimals:18,blockExplorerName:"Arbiscan",blockExplorerUrl:"https://arbiscan.io"},43114:{name:"Avalanche",symbol:"AVAX",logoURI:"https://assets.coingecko.com/coins/images/12559/small/Avalanche_Circle_RedWhite_Trans.png",decimals:18,blockExplorerName:"Snowtrace",blockExplorerUrl:"https://snowtrace.io"},80001:{name:"Mumbai",symbol:"MATIC",logoURI:"https://assets.coingecko.com/coins/images/4713/thumb/matic-token-icon.png",decimals:18,blockExplorerName:"Polyscan (Mumbai)",blockExplorerUrl:"https://mumbai.polygonscan.com"}},Kct=(t,e)=>{const r=e.find(s=>s.id===t);if(r){var n,i;return{name:r.name,symbol:r.nativeCurrency.symbol,decimals:r.nativeCurrency.decimals,logoURI:OR[1].logoURI,blockExplorerName:(n=r.blockExplorers)==null?void 0:n.default.name,blockExplorerUrl:(i=r.blockExplorers)==null?void 0:i.default.url}}},ui=(t,e)=>OR[t]||Kct(t,e)||OR[1],Sh=()=>{const t=O.createContext(void 0);return[()=>{const r=O.useContext(t);if(!r)throw new Error("useGenericContext must be used within a Provider");return r},t.Provider]},tD=t=>{switch(t){case"top-right":return{top:"0px",right:"0px"};case"top-left":return{top:"0px",left:"0px"};case"top-center":return{top:"0px"};case"bottom-right":return{bottom:"0px",right:"0px"};case"bottom-left":return{bottom:"0px",left:"0px"};case"bottom-center":return{bottom:"0px"};case"middle-right":return{right:"0px"};case"middle-left":return{left:"0px"};case"center":default:return{}}},Jct=(t,e="light")=>{switch(t){case 1:return"#abf";case 137:return"#c7a6ff";case 42161:return"#52A7E6";case 10:return"#DB3132";case 56:return e==="light"?"#CB9C1D":"#EEB445";case 43114:return"#E84142";case 100:return e==="light"?"#00193C":"#D8E8FF";case 5:return e==="light"?"#A77A00":"#FFA700";case 80001:return e==="light"?"#D68828":"#FFA700";default:return"#abf"}},Qct=(t,e="light")=>{switch(t){case 1:return"#132362";case 137:return"#350881";case 42161:return e==="light"?"#EDF7FF":"#0C3754";case 10:return e==="light"?"#FFEAE9":"#390B0C";case 56:return e==="light"?"#FFE8AB":"#554018";case 43114:return e==="light"?"#FBDFDF":"#390B0C";case 100:return e==="light"?"#D8E8FF":"#00193C";case 5:return e==="light"?"#FFD871":"#554018";case 80001:return e==="light"?"#FFE8CD":"#554018";default:return"#132362"}};function Yct(t){var e;const{account:r,chain:n,transport:i}=t,s={chainId:n.id,name:n.name,ensAddress:(e=n.contracts)==null||(e=e.ensRegistry)==null?void 0:e.address};return new lX(i,s).getSigner(r.address)}function Zct(t){var e;const{chain:r,transport:n}=t,i={chainId:r.id,name:r.name,ensAddress:(e=r.contracts)==null||(e=e.ensRegistry)==null?void 0:e.address};return n.type==="fallback"?new QEe(n.transports.map(({value:s})=>new rf(s==null?void 0:s.url,i))):new rf(n.url,i)}const Xct=async t=>{const e=localStorage.getItem(Qi.EthAuthProof);if(e)return JSON.parse(e);const r=localStorage.getItem(Qi.EthAuthSettings);if(!r)throw new Error("No ETHAuth settings found");const n=JSON.parse(r),i=t.account.address,s=new m8;s.address=i,s.claims.app=n.app||"app",s.claims.ogn=n.origin,s.claims.n=n.nonce,s.setExpiryIn(n.expiry?Math.max(n.expiry,200):afe);const o=s.messageTypedData();o.domain.verifyingContract;const c=await Yct(t)._signTypedData(o.domain,o.types,o.message);s.signature=c;const u=await new Hb().encodeProof(s,!0);return{typedData:o,proofString:u}},elt=async(t,e,r)=>{const n=t.account.address,s=await new Hb().decodeProof(r.proofString,!0),o=Zct(e);return await Zg.utils.isValidTypedDataSignature(n,r.typedData,s.signature,o)},as=t=>{const e=cn[t];if(!e)throw"invalid network";const r=localStorage.getItem(Qi.ProjectAccessKey)||void 0,n=new WO("https://metadata.sequence.app",r),i=new qO(_O(e.name),r),s=new Uy("https://api.sequence.app",r);return{network:e,metadataClient:n,indexerClient:i,apiClient:s}},tlt=t=>{const{isConnected:e}=Woe(),{theme:r}=uw(),{config:n={}}=t,{signIn:i={}}=n,{showEmailInput:s=F7.showEmailInput,socialAuthOptions:o=F7.socialAuthOptions,walletAuthOptions:a=F7.walletAuthOptions}=i,{openConnectModal:c,setOpenConnectModal:l}=t,[u,f]=$.useState(""),{connectors:d,connect:p}=nae(),g=d.filter(T=>!!(T!=null&&T._wallet)),[v,y]=$.useState(!1),b=g.find(T=>T._wallet.id==="mock"),w=g.find(T=>T._wallet.id==="email"),E=g.filter(T=>!!a.find(Z=>Z===T._wallet.id)).sort((T,Q)=>a.indexOf(T._wallet.id)-a.indexOf(Q._wallet.id)),C=g.filter(T=>!!o.find(Z=>Z===T._wallet.id)).sort((T,Q)=>o.indexOf(T._wallet.id)-o.indexOf(Q._wallet.id));E.length>4;const S=T=>{f(T.target.value)};$.useEffect(()=>{e&&c&&l(!1)},[e,c]);const P=T=>{if(i.useMock&&b){p({connector:b});return}if(T._wallet.id==="email"){const Q=prompt("Auto-email login, please specify the email address:");localStorage.setItem(CR,Q||"")}p({connector:T})},_=T=>{if(T.preventDefault(),i.useMock&&b){p({connector:b});return}w&&(localStorage.setItem(CR,u),p({connector:w}))};return v?O.createElement(O.Fragment,null,O.createElement(ae,{as:"button",position:"absolute",style:{top:"20px"},onClick:()=>y(!1),className:IE},O.createElement(z8,null)),O.createElement(Hct,{connectors:E,onConnect:P})):O.createElement(O.Fragment,null,O.createElement(qct,{config:n}),O.createElement(ae,{marginTop:"5"},w&&s&&O.createElement(O.Fragment,null,O.createElement("form",{onSubmit:_},O.createElement(yh,{onChange:S,value:u,name:"email",placeholder:"Enter email","data-1p-ignore":!0}),O.createElement(Sr,{type:"submit",disabled:!Gct(u),marginTop:"4",width:"full",label:"Continue",rightIcon:Wu}))),C.length>0&&O.createElement(O.Fragment,null,w&&s&&O.createElement(O.Fragment,null,O.createElement(ae,{style:{marginBottom:"-4px"}},O.createElement(Xb,{color:"backgroundSecondary"})),O.createElement(ae,{justifyContent:"center",alignItems:"center"},O.createElement(Pe,{variant:"small",color:"text50"},"or sign in via"))),O.createElement(ae,{marginTop:"3",gap:"2",flexDirection:"row",justifyContent:"center",alignItems:"center",flexWrap:"wrap"},C.map(T=>{const Q=r==="dark"?T._wallet.monochromeLogoDark:T._wallet.monochromeLogoLight;return O.createElement(Yl,{key:T._wallet.id,className:IE,justifyContent:"center",alignItems:"center",onClick:()=>P(T),aspectRatio:"1/1",style:{width:`calc(25% - ${ut.space[2]})`}},O.createElement(ae,{className:TR,flexDirection:"column",alignItems:"center",justifyContent:"center"},O.createElement(Q,null)))}))),E.length>0&&O.createElement(O.Fragment,null,(w&&s||C.length>0)&&O.createElement(O.Fragment,null,O.createElement(ae,{style:{marginBottom:"-4px"}},O.createElement(Xb,{color:"backgroundSecondary"})),O.createElement(ae,{justifyContent:"center",alignItems:"center"},O.createElement(Pe,{variant:"small",color:"text50"},"or select a wallet"))),O.createElement(ae,{marginTop:"3",gap:"2",flexDirection:"row",justifyContent:"center",alignItems:"center"},E.map(T=>{const Q=r==="dark"?T._wallet.logoDark||T._wallet.logoDark:T._wallet.logoLight||T._wallet.logoLight;return O.createElement(Yl,{key:T._wallet.id,className:IE,justifyContent:"center",alignItems:"center",onClick:()=>P(T),aspectRatio:"1/1",style:{width:`calc(25% - ${ut.space[2]})`}},O.createElement(ae,{className:TR,flexDirection:"column",alignItems:"center",justifyContent:"center"},O.createElement(Q,null)))})))))};function rlt(t){if(t==null)throw new TypeError("Cannot destructure "+t)}const nlt=t=>{let e=ah({},(rlt(t),t));return O.createElement(O.Fragment,null,O.createElement("svg",ah({xmlns:"http://www.w3.org/2000/svg",style:{fill:"none"},id:"svg1316",version:"1.1",viewBox:"0 0 396 396"},e),O.createElement("g",{transform:"translate(0,38)",id:"g1256",clipPath:"url(#clip0_5_131)"},O.createElement("g",{id:"g1254",clipPath:"url(#clip1_5_131)"},O.createElement("path",{style:{fill:"#111111"},id:"path1232",d:"M 0,67.5049 V 250.165 c 0,37.282 30.1402,67.505 67.32,67.505 h 261.36 c 37.18,0 67.32,-30.223 67.32,-67.505 V 67.5049 C 396,30.223 365.86,0 328.68,0 H 67.32 C 30.1402,0 0,30.223 0,67.5049 Z"}),O.createElement("path",{style:{fill:"url(#paint0_linear_5_13"},id:"path1234",d:"M 0,67.5049 V 250.165 c 0,37.282 30.1402,67.505 67.32,67.505 h 261.36 c 37.18,0 67.32,-30.223 67.32,-67.505 V 67.5049 C 396,30.223 365.86,0 328.68,0 H 67.32 C 30.1402,0 0,30.223 0,67.5049 Z"}),O.createElement("path",{style:{fill:"url(#paint1_linear_5_131"},id:"path1236",d:"m 98.9999,79.4176 c 0,-10.9653 -8.8648,-19.8544 -19.8,-19.8544 -10.9352,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.8648,19.8544 19.8,19.8544 10.9352,0 19.8,-8.8892 19.8,-19.8544 z"}),O.createElement("path",{style:{fill:"url(#paint2_linear_5_131)"},id:"path1238",d:"m 98.9999,79.4176 c 0,-10.9653 -8.8648,-19.8544 -19.8,-19.8544 -10.9352,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.8648,19.8544 19.8,19.8544 10.9352,0 19.8,-8.8892 19.8,-19.8544 z"}),O.createElement("path",{style:{fill:"url(#paint3_linear_5_131)"},id:"path1240",d:"m 98.9999,79.4176 c 0,-10.9653 -8.8648,-19.8544 -19.8,-19.8544 -10.9352,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.8648,19.8544 19.8,19.8544 10.9352,0 19.8,-8.8892 19.8,-19.8544 z"}),O.createElement("path",{style:{fill:"url(#paint4_linear_5_131)"},id:"path1242",d:"m 98.9999,238.126 c 0,-10.965 -8.8648,-19.854 -19.8,-19.854 -10.9352,0 -19.8,8.889 -19.8,19.854 0,10.966 8.8648,19.855 19.8,19.855 10.9352,0 19.8,-8.889 19.8,-19.855 z"}),O.createElement("path",{style:{fill:"url(#paint5_linear_5_131)"},id:"path1244",d:"m 336.6,158.835 c 0,-10.965 -8.865,-19.854 -19.8,-19.854 -10.935,0 -19.8,8.889 -19.8,19.854 0,10.965 8.865,19.855 19.8,19.855 10.935,0 19.8,-8.89 19.8,-19.855 z"}),O.createElement("path",{style:{fill:"url(#paint6_linear_5_131)"},id:"path1246",d:"m 336.6,158.835 c 0,-10.965 -8.865,-19.854 -19.8,-19.854 -10.935,0 -19.8,8.889 -19.8,19.854 0,10.965 8.865,19.855 19.8,19.855 10.935,0 19.8,-8.89 19.8,-19.855 z"}),O.createElement("path",{style:{fill:"url(#paint7_linear_5_131)"},id:"path1248",d:"M 316.8,59.5632 H 158.4 c -10.935,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.865,19.8544 19.8,19.8544 h 158.4 c 10.935,0 19.8,-8.8892 19.8,-19.8544 0,-10.9653 -8.865,-19.8544 -19.8,-19.8544 z"}),O.createElement("path",{style:{fill:"url(#paint8_linear_5_131)"},id:"path1250",d:"M 316.8,218.272 H 158.4 c -10.935,0 -19.8,8.889 -19.8,19.854 0,10.966 8.865,19.855 19.8,19.855 h 158.4 c 10.935,0 19.8,-8.889 19.8,-19.855 0,-10.965 -8.865,-19.854 -19.8,-19.854 z"}),O.createElement("path",{style:{fill:"url(#paint9_linear_5_131)"},id:"path1252",d:"M 237.6,138.981 H 79.2 c -10.9352,0 -19.8,8.889 -19.8,19.854 0,10.965 8.8648,19.855 19.8,19.855 h 158.4 c 10.935,0 19.8,-8.89 19.8,-19.855 0,-10.965 -8.865,-19.854 -19.8,-19.854 z"}))),O.createElement("defs",{id:"defs1314"},O.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"318",x2:"198",y1:"4.0585401e-05",x1:"198",id:"paint0_linear_5_131"},O.createElement("stop",{id:"stop1258",stopColor:"#1D273D"}),O.createElement("stop",{id:"stop1260",stopColor:"#0D0F13",offset:"1"})),O.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"63",x2:"92.5",y1:"99",x1:"65.5",id:"paint1_linear_5_131"},O.createElement("stop",{id:"stop1263",stopColor:"#4462FE"}),O.createElement("stop",{id:"stop1265",stopColor:"#7D69FA",offset:"1"})),O.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"97.591103",x2:"96.137703",y1:"99.291199",x1:"62.879902",id:"paint2_linear_5_131"},O.createElement("stop",{id:"stop1268",stopColor:"#3757FD"}),O.createElement("stop",{id:"stop1270",stopColor:"#6980FA",offset:"1"})),O.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"97.591103",x2:"96.137703",y1:"99.291199",x1:"62.879902",id:"paint3_linear_5_131"},O.createElement("stop",{id:"stop1273",stopColor:"#2447FF"}),O.createElement("stop",{id:"stop1275",stopColor:"#6980FA",offset:"1"})),O.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"223.5",x2:"91.5",y1:"251.5",x1:"65",id:"paint4_linear_5_131"},O.createElement("stop",{id:"stop1278",stopColor:"#BC3EE6"}),O.createElement("stop",{id:"stop1280",stopColor:"#D972F1",offset:"1"})),O.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"146",x2:"329.5",y1:"172",x1:"305",id:"paint5_linear_5_131"},O.createElement("stop",{id:"stop1283",stopColor:"#29BDFF"}),O.createElement("stop",{id:"stop1285",stopColor:"#96E7FB",offset:"1"})),O.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"176.772",x2:"334.56699",y1:"178.418",x1:"300.17999",id:"paint6_linear_5_131"},O.createElement("stop",{id:"stop1288",stopColor:"#23BBFF"}),O.createElement("stop",{id:"stop1290",stopColor:"#85E7FF",offset:"1"})),O.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"60",x2:"317.5",y1:"99",x1:"154.5",id:"paint7_linear_5_131"},O.createElement("stop",{id:"stop1293",stopColor:"#23BBFF"}),O.createElement("stop",{id:"stop1295",stopColor:"#85E7FF",offset:"1"})),O.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"218",x2:"312.5",y1:"258",x1:"156",id:"paint8_linear_5_131"},O.createElement("stop",{id:"stop1298",stopColor:"#2447FF"}),O.createElement("stop",{id:"stop1300",stopColor:"#6980FA",offset:"1"})),O.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"139",x2:"235.5",y1:"179",x1:"86.000099",id:"paint9_linear_5_131"},O.createElement("stop",{id:"stop1303",stopColor:"#6634FF"}),O.createElement("stop",{id:"stop1305",stopColor:"#9C6DFF",offset:"1"})),O.createElement("clipPath",{id:"clip0_5_131"},O.createElement("rect",{style:{fill:"#ffffff"},y:"0",x:"0",id:"rect1308",height:"317.67001",width:"396"})),O.createElement("clipPath",{id:"clip1_5_131"},O.createElement("rect",{style:{fill:"#ffffff"},y:"0",x:"0",id:"rect1311",height:"317.67001",width:"396"})))))},[lfe,ilt]=Sh(),[slt,olt]=Sh(),[alt,clt]=Sh(),[llt,ult]=Sh(),flt={dark:"dark",light:"light"},dlt=t=>{const{config:e,children:r}=t,{defaultTheme:n="dark",signIn:i={},position:s="center",displayedAssets:o=[],ethAuth:a={},disableAnalytics:c=!1}=e,l=i.projectName||"app",{expiry:u=afe,app:f=l,origin:d=location.origin,nonce:p}=a,{projectName:g}=i,[v,y]=$.useState(!1),[b,w]=$.useState(n||flt.dark),[E,C]=$.useState(s),[S,P]=$.useState(o),[_,T]=$.useState(),{address:Q,isConnected:Z}=Woe(),ne=K=>{const A=Zg.initWallet(K).client.analytics;T(A)};$.useEffect(()=>{if(!Z){_==null||_.reset();return}Q&&(_==null||_.identify(Q.toLowerCase()))},[_,Q,Z]);const ce=()=>{window.open("https://sequence.xyz")};return $.useEffect(()=>{const K=localStorage.getItem(Qi.ProjectAccessKey)||"";c||ne(K)},[]),$.useEffect(()=>{b!==n&&w(n)},[n]),$.useEffect(()=>{E!==s&&C(s)},[s]),$.useEffect(()=>{typeof b=="object"||localStorage.setItem(Qi.Theme,b),localStorage.setItem(Qi.EthAuthSettings,JSON.stringify({expiry:u,app:f,origin:d,nonce:p}))},[b,a]),$.useEffect(()=>{P(S)},[o]),O.createElement(clt,{value:{theme:b,setTheme:w,position:E,setPosition:C}},O.createElement(olt,{value:{setOpenConnectModal:y,openConnectModalState:v}},O.createElement(ult,{value:{setDisplayedAssets:P,displayedAssets:S}},O.createElement(ilt,{value:{setAnalytics:T,analytics:_}},O.createElement("div",{id:"kit-provider"},O.createElement(Z8,{root:"#kit-provider",scope:"kit",theme:b},O.createElement(L8,null,v&&O.createElement(V$,{scroll:!1,backdropColor:"backgroundBackdrop",size:"sm",contentProps:{style:ah({maxWidth:"364px"},tD(s))},onClose:()=>y(!1)},O.createElement(ae,{padding:"4",className:eD},O.createElement(ae,{justifyContent:"center",color:"text100",alignItems:"center",fontWeight:"medium",style:{marginTop:"4px"}},O.createElement(Pe,null,"Sign in ",g?`to ${g}`:"")),O.createElement(tlt,ah({openConnectModal:v,setOpenConnectModal:y},t)),O.createElement(ae,{onClick:ce,className:IE,gap:"1",marginTop:"2",flexDirection:"row",alignItems:"center",justifyContent:"center"},O.createElement(Pe,{fontSize:"small",color:"text100"},"Powered by Sequence"),O.createElement(ae,{height:"5",width:"5"},O.createElement(nlt,null)))))))),r))))},hlt=()=>{const{setOpenConnectModal:t,openConnectModalState:e}=slt();return{setOpenConnectModal:t,openConnectModalState:e}},rx=()=>{const{setTheme:t,theme:e,position:r,setPosition:n}=alt();return{setTheme:t,theme:e,position:r,setPosition:n}},plt=()=>{const{setDisplayedAssets:t,displayedAssets:e}=llt();return{displayedAssets:e,setDisplayedAssets:t}},ufe=qoe.useSyncExternalStore,iK=$.createContext(void 0),ffe=$.createContext(!1);function dfe(t,e){return t||(e&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=iK),window.ReactQueryClientContext):iK)}const rD=({context:t}={})=>{const e=$.useContext(dfe(t,$.useContext(ffe)));if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},nD=({client:t,children:e,context:r,contextSharing:n=!1})=>{$.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]);const i=dfe(r,n);return $.createElement(ffe.Provider,{value:!r&&n},$.createElement(i.Provider,{value:t},e))},hfe=$.createContext(!1),glt=()=>$.useContext(hfe);hfe.Provider;function mlt(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}const vlt=$.createContext(mlt()),ylt=()=>$.useContext(vlt);function pfe(t,e){return typeof t=="function"?t(...e):!!t}const blt=(t,e)=>{(t.suspense||t.useErrorBoundary)&&(e.isReset()||(t.retryOnMount=!1))},wlt=t=>{$.useEffect(()=>{t.clearReset()},[t])},xlt=({result:t,errorResetBoundary:e,useErrorBoundary:r,query:n})=>t.isError&&!e.isReset()&&!t.isFetching&&pfe(r,[t.error,n]),Elt=t=>{t.suspense&&typeof t.staleTime!="number"&&(t.staleTime=1e3)},_lt=(t,e)=>t.isLoading&&t.isFetching&&!e,Clt=(t,e,r)=>(t==null?void 0:t.suspense)&&_lt(e,r),Slt=(t,e,r)=>e.fetchOptimistic(t).then(({data:n})=>{t.onSuccess==null||t.onSuccess(n),t.onSettled==null||t.onSettled(n,null)}).catch(n=>{r.clearReset(),t.onError==null||t.onError(n),t.onSettled==null||t.onSettled(void 0,n)});function gfe(t,e){const r=rD({context:t.context}),n=glt(),i=ylt(),s=r.defaultQueryOptions(t);s._optimisticResults=n?"isRestoring":"optimistic",s.onError&&(s.onError=Un.batchCalls(s.onError)),s.onSuccess&&(s.onSuccess=Un.batchCalls(s.onSuccess)),s.onSettled&&(s.onSettled=Un.batchCalls(s.onSettled)),Elt(s),blt(s,i),wlt(i);const[o]=$.useState(()=>new e(r,s)),a=o.getOptimisticResult(s);if(ufe($.useCallback(c=>{const l=n?()=>{}:o.subscribe(Un.batchCalls(c));return o.updateResult(),l},[o,n]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),$.useEffect(()=>{o.setOptions(s,{listeners:!1})},[s,o]),Clt(s,a,n))throw Slt(s,o,i);if(xlt({result:a,errorResetBoundary:i,useErrorBoundary:s.useErrorBoundary,query:o.getCurrentQuery()}))throw a.error;return s.notifyOnChangeProps?a:o.trackResult(a)}function eo(t,e,r){const n=tg(t,e,r);return gfe(n,tae)}function mfe(t,e,r){const n=xFe(t,e,r),i=rD({context:n.context}),[s]=$.useState(()=>new LFe(i,n));$.useEffect(()=>{s.setOptions(n)},[s,n]);const o=ufe($.useCallback(c=>s.subscribe(Un.batchCalls(c)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),a=$.useCallback((c,l)=>{s.mutate(c,l).catch(Alt)},[s]);if(o.error&&pfe(s.options.useErrorBoundary,[o.error]))throw o.error;return{...o,mutate:a,mutateAsync:o.mutate}}function Alt(){}function klt(t,e,r){const n=tg(t,e,r);return gfe(n,DFe)}function Ilt(t,e,r){return t===t&&(r!==void 0&&(t=t<=r?t:r),e!==void 0&&(t=t>=e?t:e)),t}var vfe=Ilt;function Plt(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r-1&&t%1==0&&t-1&&t%1==0&&t<=Out}var Afe=$ut,Nut=$4,Mut=Afe,Dut=N4,Lut="[object Arguments]",But="[object Array]",Fut="[object Boolean]",jut="[object Date]",Uut="[object Error]",zut="[object Function]",Hut="[object Map]",qut="[object Number]",Wut="[object Object]",Vut="[object RegExp]",Gut="[object Set]",Kut="[object String]",Jut="[object WeakMap]",Qut="[object ArrayBuffer]",Yut="[object DataView]",Zut="[object Float32Array]",Xut="[object Float64Array]",eft="[object Int8Array]",tft="[object Int16Array]",rft="[object Int32Array]",nft="[object Uint8Array]",ift="[object Uint8ClampedArray]",sft="[object Uint16Array]",oft="[object Uint32Array]",ln={};ln[Zut]=ln[Xut]=ln[eft]=ln[tft]=ln[rft]=ln[nft]=ln[ift]=ln[sft]=ln[oft]=!0;ln[Lut]=ln[But]=ln[Qut]=ln[Fut]=ln[Yut]=ln[jut]=ln[Uut]=ln[zut]=ln[Hut]=ln[qut]=ln[Wut]=ln[Vut]=ln[Gut]=ln[Kut]=ln[Jut]=!1;function aft(t){return Dut(t)&&Mut(t.length)&&!!ln[Nut(t)]}var cft=aft;function lft(t){return function(e){return t(e)}}var uft=lft,P_={exports:{}};P_.exports;(function(t,e){var r=bfe,n=e&&!e.nodeType&&e,i=n&&!0&&t&&!t.nodeType&&t,s=i&&i.exports===n,o=s&&r.process,a=function(){try{var c=i&&i.require&&i.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();t.exports=a})(P_,P_.exports);var fft=P_.exports,dft=cft,hft=uft,lK=fft,uK=lK&&lK.isTypedArray,pft=uK?hft(uK):dft,gft=pft,mft=Klt,vft=Cut,yft=Cfe,bft=Iut,wft=Sfe,xft=gft,Eft=Object.prototype,_ft=Eft.hasOwnProperty;function Cft(t,e){var r=yft(t),n=!r&&vft(t),i=!r&&!n&&bft(t),s=!r&&!n&&!i&&xft(t),o=r||n||i||s,a=o?mft(t.length,String):[],c=a.length;for(var l in t)(e||_ft.call(t,l))&&!(o&&(l=="length"||i&&(l=="offset"||l=="parent")||s&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||wft(l,c)))&&a.push(l);return a}var Sft=Cft,Aft=Object.prototype;function kft(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Aft;return t===r}var Ift=kft;function Pft(t,e){return function(r){return t(e(r))}}var Rft=Pft,Tft=Rft,Oft=Tft(Object.keys,Object),$ft=Oft,Nft=Ift,Mft=$ft,Dft=Object.prototype,Lft=Dft.hasOwnProperty;function Bft(t){if(!Nft(t))return Mft(t);var e=[];for(var r in Object(t))Lft.call(t,r)&&r!="constructor"&&e.push(r);return e}var Fft=Bft;function jft(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var iD=jft,Uft=$4,zft=iD,Hft="[object AsyncFunction]",qft="[object Function]",Wft="[object GeneratorFunction]",Vft="[object Proxy]";function Gft(t){if(!zft(t))return!1;var e=Uft(t);return e==qft||e==Wft||e==Hft||e==Vft}var Kft=Gft,Jft=Kft,Qft=Afe;function Yft(t){return t!=null&&Qft(t.length)&&!Jft(t)}var kfe=Yft,Zft=Sft,Xft=Fft,edt=kfe;function tdt(t){return edt(t)?Zft(t):Xft(t)}var rdt=tdt,ndt=Vlt,idt=rdt;function sdt(t){return t==null?[]:ndt(t,idt(t))}var odt=sdt,adt=vfe,cdt=yfe,ldt=odt;function udt(t,e){var r=ldt(t);return cdt(r,adt(e,0,r.length))}var fdt=udt;function ddt(t,e){return t===e||t!==t&&e!==e}var hdt=ddt,pdt=hdt,gdt=kfe,mdt=Sfe,vdt=iD;function ydt(t,e,r){if(!vdt(r))return!1;var n=typeof e;return(n=="number"?gdt(r)&&mdt(e,r.length):n=="string"&&e in r)?pdt(r[e],t):!1}var bdt=ydt,wdt=/\s/;function xdt(t){for(var e=t.length;e--&&wdt.test(t.charAt(e)););return e}var Edt=xdt,_dt=Edt,Cdt=/^\s+/;function Sdt(t){return t&&t.slice(0,_dt(t)+1).replace(Cdt,"")}var Adt=Sdt,kdt=$4,Idt=N4,Pdt="[object Symbol]";function Rdt(t){return typeof t=="symbol"||Idt(t)&&kdt(t)==Pdt}var Tdt=Rdt,Odt=Adt,fK=iD,$dt=Tdt,dK=0/0,Ndt=/^[-+]0x[0-9a-f]+$/i,Mdt=/^0b[01]+$/i,Ddt=/^0o[0-7]+$/i,Ldt=parseInt;function Bdt(t){if(typeof t=="number")return t;if($dt(t))return dK;if(fK(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=fK(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Odt(t);var r=Mdt.test(t);return r||Ddt.test(t)?Ldt(t.slice(2),r?2:8):Ndt.test(t)?dK:+t}var Fdt=Bdt,jdt=Fdt,hK=1/0,Udt=17976931348623157e292;function zdt(t){if(!t)return t===0?t:0;if(t=jdt(t),t===hK||t===-hK){var e=t<0?-1:1;return e*Udt}return t===t?t:0}var Hdt=zdt,qdt=Hdt;function Wdt(t){var e=qdt(t),r=e%1;return e===e?r?e-r:e:0}var Vdt=Wdt,Gdt=Ult,Kdt=fdt,Jdt=Cfe,Qdt=bdt,Ydt=Vdt;function Zdt(t,e,r){(r?Qdt(t,e,r):e===void 0)?e=1:e=Ydt(e);var n=Jdt(t)?Gdt:Kdt;return n(t,e)}var Xdt=Zdt;const eht=rs(Xdt);function tht(t){const{children:e,config:r,initialState:n,reconnectOnMount:i=!0}=t,{onMount:s}=QBe(r,{initialState:n,reconnectOnMount:i});r._internal.ssr||s();const o=$.useRef(!0);return $.useEffect(()=>{if(o.current&&r._internal.ssr)return s(),()=>{o.current=!1}},[]),e}const Ife=$.createContext(void 0);function rht(t){const{children:e,config:r}=t,n={value:r};return $.createElement(tht,t,$.createElement(Ife.Provider,n,e))}const nht="2.5.4",iht=()=>`wagmi@${nht}`;class sht extends wh{constructor(){super(...arguments),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiError"})}get docsBaseUrl(){return"https://wagmi.sh/react"}get version(){return iht()}}class oht extends sht{constructor(){super("`useConfig` must be used within `WagmiProvider`.",{docsPath:"https://wagmi.sh/react/api/WagmiProvider"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiProviderNotFoundError"})}}function bn(t={}){const e=t.config??$.useContext(Ife);if(!e)throw new oht;return e}const j7=t=>typeof t=="object"&&!Array.isArray(t);function aht(t,e,r=e,n=rh){const i=$.useRef([]),s=AN.useSyncExternalStoreWithSelector(t,e,r,o=>o,(o,a)=>{if(j7(o)&&j7(a)&&i.current.length){for(const c of i.current)if(!n(o[c],a[c]))return!1;return!0}return n(o,a)});if(j7(s)){const o={...s};return Object.defineProperties(o,Object.entries(o).reduce((a,[c,l])=>({...a,[c]:{configurable:!1,enumerable:!0,get:()=>(i.current.includes(c)||i.current.push(c),l)}}),{})),o}return s}function to(t={}){const e=bn(t);return aht(r=>Foe(e,{onChange:r}),()=>_N(e))}function cht(t){const e=eo({...t,queryKeyHashFn:BFe});return e.queryKey=t.queryKey,e}function M4(t={}){const e=bn(t);return $.useSyncExternalStore(r=>VBe(e,{onChange:r}),()=>NH(e),()=>NH(e))}function lht(t={}){const e=bn(t);return $.useSyncExternalStore(r=>GBe(e,{onChange:r}),()=>$P(e),()=>$P(e))}function Pfe(t={}){const{mutation:e}=t,r=bn(t),n=zFe(r),{mutate:i,mutateAsync:s,...o}=mfe({...e,...n});return{...o,connectors:lht().map(a=>a.connector),disconnect:i,disconnectAsync:s}}function uht(t={}){const e=bn(t);return AN.useSyncExternalStoreWithSelector(r=>JBe(e,{onChange:r}),()=>NP(e,t),()=>NP(e,t),r=>r,(r,n)=>(r==null?void 0:r.uid)===(n==null?void 0:n.uid))}function sD(t={}){const{mutation:e}=t,r=bn(t),n=WFe(r),{mutate:i,mutateAsync:s,...o}=mfe({...e,...n});return{...o,chains:r.chains,switchChain:i,switchChainAsync:s}}function oD(t={}){const{query:e={},...r}=t,n=bn(r),i=rD(),{address:s,connector:o,status:a}=to(),c=M4(),{queryKey:l,...u}=HFe(n,{...t,chainId:t.chainId??c,connector:t.connector??o}),f=!!(a!=="disconnected"&&(e.enabled??!0));return $.useEffect(()=>{s?i.invalidateQueries({queryKey:l}):i.removeQueries({queryKey:l})},[s,i]),cht({...e,...u,queryKey:l,enabled:f,staleTime:1/0})}var D4={},fht=function(){var t=document.getSelection();if(!t.rangeCount)return function(){};for(var e=document.activeElement,r=[],n=0;n"u"){r&&console.warn("unable to use e.clipboardData"),r&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var f=pK[e.format]||pK.default;window.clipboardData.setData(f,t)}else u.clipboardData.clearData(),u.clipboardData.setData(e.format,t);e.onCopy&&(u.preventDefault(),e.onCopy(u.clipboardData))}),document.body.appendChild(a),s.selectNodeContents(a),o.addRange(s);var l=document.execCommand("copy");if(!l)throw new Error("copy command was unsuccessful");c=!0}catch(u){r&&console.error("unable to copy using execCommand: ",u),r&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(e.format||"text",t),e.onCopy&&e.onCopy(window.clipboardData),c=!0}catch(f){r&&console.error("unable to copy using clipboardData: ",f),r&&console.error("falling back to prompt"),n=pht("message"in e?e.message:hht),window.prompt(n,t)}}finally{o&&(typeof o.removeRange=="function"?o.removeRange(s):o.removeAllRanges()),a&&document.body.removeChild(a),i()}return c}var mht=ght;function $R(t){"@babel/helpers - typeof";return $R=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$R(t)}Object.defineProperty(D4,"__esModule",{value:!0});D4.CopyToClipboard=void 0;var S3=Rfe($),vht=Rfe(mht),yht=["text","onCopy","options","children"];function Rfe(t){return t&&t.__esModule?t:{default:t}}function gK(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function mK(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function wht(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,s;for(s=0;s=0)&&(r[i]=t[i]);return r}function xht(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function vK(t,e){for(var r=0;r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function R_(t){return R_=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},R_(t)}function aD(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ofe=function(t){_ht(r,t);var e=Cht(r);function r(){var n;xht(this,r);for(var i=arguments.length,s=new Array(i),o=0;oe in t?Iht(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,O2=(t,e)=>{for(var r in e||(e={}))Nfe.call(e,r)&&yK(t,r,e[r]);if(T_)for(var r of T_(e))Mfe.call(e,r)&&yK(t,r,e[r]);return t},cD=(t,e)=>{var r={};for(var n in t)Nfe.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&T_)for(var n of T_(t))e.indexOf(n)<0&&Mfe.call(t,n)&&(r[n]=t[n]);return r};/** + * @license QR Code generator library (TypeScript) + * Copyright (c) Project Nayuki. + * SPDX-License-Identifier: MIT + */var c1;(t=>{const e=class{constructor(c,l,u,f){if(this.version=c,this.errorCorrectionLevel=l,this.modules=[],this.isFunction=[],ce.MAX_VERSION)throw new RangeError("Version value out of range");if(f<-1||f>7)throw new RangeError("Mask value out of range");this.size=c*4+17;let d=[];for(let g=0;g7)throw new RangeError("Invalid value");let g,v;for(g=u;;g++){const E=e.getNumDataCodewords(g,l)*8,C=a.getTotalBits(c,g);if(C<=E){v=C;break}if(g>=f)throw new RangeError("Data too long")}for(const E of[e.Ecc.MEDIUM,e.Ecc.QUARTILE,e.Ecc.HIGH])p&&v<=e.getNumDataCodewords(g,E)*8&&(l=E);let y=[];for(const E of c){n(E.mode.modeBits,4,y),n(E.numChars,E.mode.numCharCountBits(g),y);for(const C of E.getData())y.push(C)}s(y.length==v);const b=e.getNumDataCodewords(g,l)*8;s(y.length<=b),n(0,Math.min(4,b-y.length),y),n(0,(8-y.length%8)%8,y),s(y.length%8==0);for(let E=236;y.lengthw[C>>>3]|=E<<7-(C&7)),new e(g,l,w,d)}getModule(c,l){return 0<=c&&c>>9)*1335;const f=(l<<10|u)^21522;s(f>>>15==0);for(let d=0;d<=5;d++)this.setFunctionModule(8,d,i(f,d));this.setFunctionModule(8,7,i(f,6)),this.setFunctionModule(8,8,i(f,7)),this.setFunctionModule(7,8,i(f,8));for(let d=9;d<15;d++)this.setFunctionModule(14-d,8,i(f,d));for(let d=0;d<8;d++)this.setFunctionModule(this.size-1-d,8,i(f,d));for(let d=8;d<15;d++)this.setFunctionModule(8,this.size-15+d,i(f,d));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let c=this.version;for(let u=0;u<12;u++)c=c<<1^(c>>>11)*7973;const l=this.version<<12|c;s(l>>>18==0);for(let u=0;u<18;u++){const f=i(l,u),d=this.size-11+u%3,p=Math.floor(u/3);this.setFunctionModule(d,p,f),this.setFunctionModule(p,d,f)}}drawFinderPattern(c,l){for(let u=-4;u<=4;u++)for(let f=-4;f<=4;f++){const d=Math.max(Math.abs(f),Math.abs(u)),p=c+f,g=l+u;0<=p&&p{(E!=v-d||S>=g)&&w.push(C[E])});return s(w.length==p),w}drawCodewords(c){if(c.length!=Math.floor(e.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let l=0;for(let u=this.size-1;u>=1;u-=2){u==6&&(u=5);for(let f=0;f>>3],7-(l&7)),l++)}}s(l==c.length*8)}applyMask(c){if(c<0||c>7)throw new RangeError("Mask value out of range");for(let l=0;l5&&c++):(this.finderPenaltyAddHistory(g,v),p||(c+=this.finderPenaltyCountPatterns(v)*e.PENALTY_N3),p=this.modules[d][y],g=1);c+=this.finderPenaltyTerminateAndCount(p,g,v)*e.PENALTY_N3}for(let d=0;d5&&c++):(this.finderPenaltyAddHistory(g,v),p||(c+=this.finderPenaltyCountPatterns(v)*e.PENALTY_N3),p=this.modules[y][d],g=1);c+=this.finderPenaltyTerminateAndCount(p,g,v)*e.PENALTY_N3}for(let d=0;dp+(g?1:0),l);const u=this.size*this.size,f=Math.ceil(Math.abs(l*20-u*10)/u)-1;return s(0<=f&&f<=9),c+=f*e.PENALTY_N4,s(0<=c&&c<=2568888),c}getAlignmentPatternPositions(){if(this.version==1)return[];{const c=Math.floor(this.version/7)+2,l=this.version==32?26:Math.ceil((this.version*4+4)/(c*2-2))*2;let u=[6];for(let f=this.size-7;u.lengthe.MAX_VERSION)throw new RangeError("Version number out of range");let l=(16*c+128)*c+64;if(c>=2){const u=Math.floor(c/7)+2;l-=(25*u-10)*u-55,c>=7&&(l-=36)}return s(208<=l&&l<=29648),l}static getNumDataCodewords(c,l){return Math.floor(e.getNumRawDataModules(c)/8)-e.ECC_CODEWORDS_PER_BLOCK[l.ordinal][c]*e.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][c]}static reedSolomonComputeDivisor(c){if(c<1||c>255)throw new RangeError("Degree out of range");let l=[];for(let f=0;f0);for(const f of c){const d=f^u.shift();u.push(0),l.forEach((p,g)=>u[g]^=e.reedSolomonMultiply(p,d))}return u}static reedSolomonMultiply(c,l){if(c>>>8||l>>>8)throw new RangeError("Byte out of range");let u=0;for(let f=7;f>=0;f--)u=u<<1^(u>>>7)*285,u^=(l>>>f&1)*c;return s(u>>>8==0),u}finderPenaltyCountPatterns(c){const l=c[1];s(l<=this.size*3);const u=l>0&&c[2]==l&&c[3]==l*3&&c[4]==l&&c[5]==l;return(u&&c[0]>=l*4&&c[6]>=l?1:0)+(u&&c[6]>=l*4&&c[0]>=l?1:0)}finderPenaltyTerminateAndCount(c,l,u){return c&&(this.finderPenaltyAddHistory(l,u),l=0),l+=this.size,this.finderPenaltyAddHistory(l,u),this.finderPenaltyCountPatterns(u)}finderPenaltyAddHistory(c,l){l[0]==0&&(c+=this.size),l.pop(),l.unshift(c)}};let r=e;r.MIN_VERSION=1,r.MAX_VERSION=40,r.PENALTY_N1=3,r.PENALTY_N2=3,r.PENALTY_N3=40,r.PENALTY_N4=10,r.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],r.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],t.QrCode=r;function n(c,l,u){if(l<0||l>31||c>>>l)throw new RangeError("Value out of range");for(let f=l-1;f>=0;f--)u.push(c>>>f&1)}function i(c,l){return(c>>>l&1)!=0}function s(c){if(!c)throw new Error("Assertion error")}const o=class{constructor(c,l,u){if(this.mode=c,this.numChars=l,this.bitData=u,l<0)throw new RangeError("Invalid argument");this.bitData=u.slice()}static makeBytes(c){let l=[];for(const u of c)n(u,8,l);return new o(o.Mode.BYTE,c.length,l)}static makeNumeric(c){if(!o.isNumeric(c))throw new RangeError("String contains non-numeric characters");let l=[];for(let u=0;u=1<{(e=>{const r=class{constructor(i,s){this.ordinal=i,this.formatBits=s}};let n=r;n.LOW=new r(0,1),n.MEDIUM=new r(1,0),n.QUARTILE=new r(2,3),n.HIGH=new r(3,2),e.Ecc=n})(t.QrCode||(t.QrCode={}))})(c1||(c1={}));(t=>{(e=>{const r=class{constructor(i,s){this.modeBits=i,this.numBitsCharCount=s}numCharCountBits(i){return this.numBitsCharCount[Math.floor((i+7)/17)]}};let n=r;n.NUMERIC=new r(1,[10,12,14]),n.ALPHANUMERIC=new r(2,[9,11,13]),n.BYTE=new r(4,[8,16,16]),n.KANJI=new r(8,[8,10,12]),n.ECI=new r(7,[0,0,0]),e.Mode=n})(t.QrSegment||(t.QrSegment={}))})(c1||(c1={}));var ig=c1;/** + * @license qrcode.react + * Copyright (c) Paul O'Shannessy + * SPDX-License-Identifier: ISC + */var Dfe={L:ig.QrCode.Ecc.LOW,M:ig.QrCode.Ecc.MEDIUM,Q:ig.QrCode.Ecc.QUARTILE,H:ig.QrCode.Ecc.HIGH},Lfe=128,Bfe="L",Ffe="#FFFFFF",jfe="#000000",Ufe=!1,lD=4,Pht=.1;function zfe(t,e=0){const r=[];return t.forEach(function(n,i){let s=null;n.forEach(function(o,a){if(!o&&s!==null){r.push(`M${s+e} ${i+e}h${a-s}v1H${s+e}z`),s=null;return}if(a===n.length-1){if(!o)return;s===null?r.push(`M${a+e},${i+e} h1v1H${a+e}z`):r.push(`M${s+e},${i+e} h${a+1-s}v1H${s+e}z`);return}o&&s===null&&(s=a)})}),r.join("")}function Hfe(t,e){return t.slice().map((r,n)=>n=e.y+e.h?r:r.map((i,s)=>s=e.x+e.w?i:!1))}function qfe(t,e,r,n){if(n==null)return null;const i=r?lD:0,s=t.length+i*2,o=Math.floor(e*Pht),a=s/e,c=(n.width||o)*a,l=(n.height||o)*a,u=n.x==null?t.length/2-c/2:n.x*a,f=n.y==null?t.length/2-l/2:n.y*a;let d=null;if(n.excavate){let p=Math.floor(u),g=Math.floor(f),v=Math.ceil(c+u-p),y=Math.ceil(l+f-g);d={x:p,y:g,w:v,h:y}}return{x:u,y:f,h:l,w:c,excavation:d}}var Rht=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}();function Tht(t){const e=t,{value:r,size:n=Lfe,level:i=Bfe,bgColor:s=Ffe,fgColor:o=jfe,includeMargin:a=Ufe,style:c,imageSettings:l}=e,u=cD(e,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),f=l==null?void 0:l.src,d=$.useRef(null),p=$.useRef(null),[g,v]=$.useState(!1);$.useEffect(()=>{if(d.current!=null){const w=d.current,E=w.getContext("2d");if(!E)return;let C=ig.QrCode.encodeText(r,Dfe[i]).getModules();const S=a?lD:0,P=C.length+S*2,_=qfe(C,n,a,l),T=p.current,Q=_!=null&&T!==null&&T.complete&&T.naturalHeight!==0&&T.naturalWidth!==0;Q&&_.excavation!=null&&(C=Hfe(C,_.excavation));const Z=window.devicePixelRatio||1;w.height=w.width=n*Z;const ne=n/P*Z;E.scale(ne,ne),E.fillStyle=s,E.fillRect(0,0,P,P),E.fillStyle=o,Rht?E.fill(new Path2D(zfe(C,S))):C.forEach(function(ce,K){ce.forEach(function(x,A){x&&E.fillRect(A+S,K+S,1,1)})}),Q&&E.drawImage(T,_.x+S,_.y+S,_.w,_.h)}}),$.useEffect(()=>{v(!1)},[f]);const y=O2({height:n,width:n},c);let b=null;return f!=null&&(b=O.createElement("img",{src:f,key:f,style:{display:"none"},onLoad:()=>{v(!0)},ref:p})),O.createElement(O.Fragment,null,O.createElement("canvas",O2({style:y,height:n,width:n,ref:d},u)),b)}function Oht(t){const e=t,{value:r,size:n=Lfe,level:i=Bfe,bgColor:s=Ffe,fgColor:o=jfe,includeMargin:a=Ufe,imageSettings:c}=e,l=cD(e,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let u=ig.QrCode.encodeText(r,Dfe[i]).getModules();const f=a?lD:0,d=u.length+f*2,p=qfe(u,n,a,c);let g=null;c!=null&&p!=null&&(p.excavation!=null&&(u=Hfe(u,p.excavation)),g=O.createElement("image",{xlinkHref:c.src,height:p.h,width:p.w,x:p.x+f,y:p.y+f,preserveAspectRatio:"none"}));const v=zfe(u,f);return O.createElement("svg",O2({height:n,width:n,viewBox:`0 0 ${d} ${d}`},l),O.createElement("path",{fill:s,d:`M0,0 h${d}v${d}H0z`,shapeRendering:"crispEdges"}),O.createElement("path",{fill:o,d:v,shapeRendering:"crispEdges"}),g)}var $ht=t=>{const e=t,{renderAs:r}=e,n=cD(e,["renderAs"]);return r==="svg"?O.createElement(Oht,O2({},n)):O.createElement(Tht,O2({},n))},Wfe={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Je,function(){var r=1e3,n=6e4,i=36e5,s="millisecond",o="second",a="minute",c="hour",l="day",u="week",f="month",d="quarter",p="year",g="date",v="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|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,w={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(x){var A=["th","st","nd","rd"],B=x%100;return"["+x+(A[(B-20)%10]||A[B]||A[0])+"]"}},E=function(x,A,B){var z=String(x);return!z||z.length>=A?x:""+Array(A+1-z.length).join(B)+x},C={s:E,z:function(x){var A=-x.utcOffset(),B=Math.abs(A),z=Math.floor(B/60),R=B%60;return(A<=0?"+":"-")+E(z,2,"0")+":"+E(R,2,"0")},m:function x(A,B){if(A.date()1)return x(q[0])}else{var N=A.name;P[N]=A,R=N}return!z&&R&&(S=R),R||!z&&S},Z=function(x,A){if(T(x))return x.clone();var B=typeof A=="object"?A:{};return B.date=x,B.args=arguments,new ce(B)},ne=C;ne.l=Q,ne.i=T,ne.w=function(x,A){return Z(x,{locale:A.$L,utc:A.$u,x:A.$x,$offset:A.$offset})};var ce=function(){function x(B){this.$L=Q(B.locale,null,!0),this.parse(B),this.$x=this.$x||B.x||{},this[_]=!0}var A=x.prototype;return A.parse=function(B){this.$d=function(z){var R=z.date,L=z.utc;if(R===null)return new Date(NaN);if(ne.u(R))return new Date;if(R instanceof Date)return new Date(R);if(typeof R=="string"&&!/Z$/i.test(R)){var q=R.match(y);if(q){var N=q[2]-1||0,I=(q[7]||"0").substring(0,3);return L?new Date(Date.UTC(q[1],N,q[3]||1,q[4]||0,q[5]||0,q[6]||0,I)):new Date(q[1],N,q[3]||1,q[4]||0,q[5]||0,q[6]||0,I)}}return new Date(R)}(B),this.init()},A.init=function(){var B=this.$d;this.$y=B.getFullYear(),this.$M=B.getMonth(),this.$D=B.getDate(),this.$W=B.getDay(),this.$H=B.getHours(),this.$m=B.getMinutes(),this.$s=B.getSeconds(),this.$ms=B.getMilliseconds()},A.$utils=function(){return ne},A.isValid=function(){return this.$d.toString()!==v},A.isSame=function(B,z){var R=Z(B);return this.startOf(z)<=R&&R<=this.endOf(z)},A.isAfter=function(B,z){return Z(B)`Invalid value for key ${t}`,zht=t=>`Pattern length exceeds max of ${t}.`,Hht=t=>`Missing ${t} property in key`,qht=t=>`Property 'weight' in key '${t}' must be a positive integer`,bK=Object.prototype.hasOwnProperty;class Wht{constructor(e){this._keys=[],this._keyMap={};let r=0;e.forEach(n=>{let i=Qfe(n);r+=i.weight,this._keys.push(i),this._keyMap[i.id]=i,r+=i.weight}),this._keys.forEach(n=>{n.weight/=r})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Qfe(t){let e=null,r=null,n=null,i=1,s=null;if(Ml(t)||pf(t))n=t,e=wK(t),r=DR(t);else{if(!bK.call(t,"name"))throw new Error(Hht("name"));const o=t.name;if(n=o,bK.call(t,"weight")&&(i=t.weight,i<=0))throw new Error(qht(o));e=wK(o),r=DR(o),s=t.getFn}return{path:e,id:r,weight:i,src:n,getFn:s}}function wK(t){return pf(t)?t:t.split(".")}function DR(t){return pf(t)?t.join("."):t}function Vht(t,e){let r=[],n=!1;const i=(s,o,a)=>{if(Qo(s))if(!o[a])r.push(s);else{let c=o[a];const l=s[c];if(!Qo(l))return;if(a===o.length-1&&(Ml(l)||Gfe(l)||Bht(l)))r.push(Lht(l));else if(pf(l)){n=!0;for(let u=0,f=l.length;ut.score===e.score?t.idx{this._keysMap[r.id]=n})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Ml(this.docs[0])?this.docs.forEach((e,r)=>{this._addString(e,r)}):this.docs.forEach((e,r)=>{this._addObject(e,r)}),this.norm.clear())}add(e){const r=this.size();Ml(e)?this._addString(e,r):this._addObject(e,r)}removeAt(e){this.records.splice(e,1);for(let r=e,n=this.size();r{let o=i.getFn?i.getFn(e):this.getFn(e,i.path);if(Qo(o)){if(pf(o)){let a=[];const c=[{nestedArrIndex:-1,value:o}];for(;c.length;){const{nestedArrIndex:l,value:u}=c.pop();if(Qo(u))if(Ml(u)&&!U7(u)){let f={v:u,i:l,n:this.norm.get(u)};a.push(f)}else pf(u)&&u.forEach((f,d)=>{c.push({nestedArrIndex:d,value:f})})}n.$[s]=a}else if(Ml(o)&&!U7(o)){let a={v:o,n:this.norm.get(o)};n.$[s]=a}}}),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}}function Yfe(t,e,{getFn:r=Nt.getFn,fieldNormWeight:n=Nt.fieldNormWeight}={}){const i=new uD({getFn:r,fieldNormWeight:n});return i.setKeys(t.map(Qfe)),i.setSources(e),i.create(),i}function Xht(t,{getFn:e=Nt.getFn,fieldNormWeight:r=Nt.fieldNormWeight}={}){const{keys:n,records:i}=t,s=new uD({getFn:e,fieldNormWeight:r});return s.setKeys(n),s.setIndexRecords(i),s}function A3(t,{errors:e=0,currentLocation:r=0,expectedLocation:n=0,distance:i=Nt.distance,ignoreLocation:s=Nt.ignoreLocation}={}){const o=e/t.length;if(s)return o;const a=Math.abs(n-r);return i?o+a/i:a?1:o}function e0t(t=[],e=Nt.minMatchCharLength){let r=[],n=-1,i=-1,s=0;for(let o=t.length;s=e&&r.push([n,i]),n=-1)}return t[s-1]&&s-n>=e&&r.push([n,s-1]),r}const b0=32;function t0t(t,e,r,{location:n=Nt.location,distance:i=Nt.distance,threshold:s=Nt.threshold,findAllMatches:o=Nt.findAllMatches,minMatchCharLength:a=Nt.minMatchCharLength,includeMatches:c=Nt.includeMatches,ignoreLocation:l=Nt.ignoreLocation}={}){if(e.length>b0)throw new Error(zht(b0));const u=e.length,f=t.length,d=Math.max(0,Math.min(n,f));let p=s,g=d;const v=a>1||c,y=v?Array(f):[];let b;for(;(b=t.indexOf(e,g))>-1;){let _=A3(e,{currentLocation:b,expectedLocation:d,distance:i,ignoreLocation:l});if(p=Math.min(_,p),g=b+u,v){let T=0;for(;T=Z;x-=1){let A=x-1,B=r[t.charAt(A)];if(v&&(y[A]=+!!B),ce[x]=(ce[x+1]<<1|1)&B,_&&(ce[x]|=(w[x+1]|w[x])<<1|1|w[x+1]),ce[x]&S&&(E=A3(e,{errors:_,currentLocation:A,expectedLocation:d,distance:i,ignoreLocation:l}),E<=p)){if(p=E,g=A,g<=d)break;Z=Math.max(1,2*d-g)}}if(A3(e,{errors:_+1,currentLocation:d,expectedLocation:d,distance:i,ignoreLocation:l})>p)break;w=ce}const P={isMatch:g>=0,score:Math.max(.001,E)};if(v){const _=e0t(y,a);_.length?c&&(P.indices=_):P.isMatch=!1}return P}function r0t(t){let e={};for(let r=0,n=t.length;r{this.chunks.push({pattern:d,alphabet:r0t(d),startIndex:p})},f=this.pattern.length;if(f>b0){let d=0;const p=f%b0,g=f-p;for(;d{const{isMatch:b,score:w,indices:E}=t0t(e,g,v,{location:i+y,distance:s,threshold:o,findAllMatches:a,minMatchCharLength:c,includeMatches:n,ignoreLocation:l});b&&(d=!0),f+=w,b&&E&&(u=[...u,...E])});let p={isMatch:d,score:d?f/this.chunks.length:1};return d&&n&&(p.indices=u),p}}class Ah{constructor(e){this.pattern=e}static isMultiMatch(e){return xK(e,this.multiRegex)}static isSingleMatch(e){return xK(e,this.singleRegex)}search(){}}function xK(t,e){const r=t.match(e);return r?r[1]:null}class n0t extends Ah{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const r=e===this.pattern;return{isMatch:r,score:r?0:1,indices:[0,this.pattern.length-1]}}}class i0t extends Ah{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const n=e.indexOf(this.pattern)===-1;return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class s0t extends Ah{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const r=e.startsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,this.pattern.length-1]}}}class o0t extends Ah{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const r=!e.startsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}}class a0t extends Ah{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const r=e.endsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class c0t extends Ah{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const r=!e.endsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}}class Xfe extends Ah{constructor(e,{location:r=Nt.location,threshold:n=Nt.threshold,distance:i=Nt.distance,includeMatches:s=Nt.includeMatches,findAllMatches:o=Nt.findAllMatches,minMatchCharLength:a=Nt.minMatchCharLength,isCaseSensitive:c=Nt.isCaseSensitive,ignoreLocation:l=Nt.ignoreLocation}={}){super(e),this._bitapSearch=new Zfe(e,{location:r,threshold:n,distance:i,includeMatches:s,findAllMatches:o,minMatchCharLength:a,isCaseSensitive:c,ignoreLocation:l})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class ede extends Ah{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let r=0,n;const i=[],s=this.pattern.length;for(;(n=e.indexOf(this.pattern,r))>-1;)r=n+s,i.push([n,r-1]);const o=!!i.length;return{isMatch:o,score:o?0:1,indices:i}}}const LR=[n0t,ede,s0t,o0t,c0t,a0t,i0t,Xfe],EK=LR.length,l0t=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,u0t="|";function f0t(t,e={}){return t.split(u0t).map(r=>{let n=r.trim().split(l0t).filter(s=>s&&!!s.trim()),i=[];for(let s=0,o=n.length;s!!(t[O_.AND]||t[O_.OR]),g0t=t=>!!t[jR.PATH],m0t=t=>!pf(t)&&Kfe(t)&&!UR(t),_K=t=>({[O_.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function tde(t,e,{auto:r=!0}={}){const n=i=>{let s=Object.keys(i);const o=g0t(i);if(!o&&s.length>1&&!UR(i))return n(_K(i));if(m0t(i)){const c=o?i[jR.PATH]:s[0],l=o?i[jR.PATTERN]:i[c];if(!Ml(l))throw new Error(Uht(c));const u={keyId:DR(c),pattern:l};return r&&(u.searcher=FR(l,e)),u}let a={children:[],operator:s[0]};return s.forEach(c=>{const l=i[c];pf(l)&&l.forEach(u=>{a.children.push(n(u))})}),a};return UR(t)||(t=_K(t)),n(t)}function v0t(t,{ignoreFieldNorm:e=Nt.ignoreFieldNorm}){t.forEach(r=>{let n=1;r.matches.forEach(({key:i,norm:s,score:o})=>{const a=i?i.weight:null;n*=Math.pow(o===0&&a?Number.EPSILON:o,(a||1)*(e?1:s))}),r.score=n})}function y0t(t,e){const r=t.matches;e.matches=[],Qo(r)&&r.forEach(n=>{if(!Qo(n.indices)||!n.indices.length)return;const{indices:i,value:s}=n;let o={indices:i,value:s};n.key&&(o.key=n.key.src),n.idx>-1&&(o.refIndex=n.idx),e.matches.push(o)})}function b0t(t,e){e.score=t.score}function w0t(t,e,{includeMatches:r=Nt.includeMatches,includeScore:n=Nt.includeScore}={}){const i=[];return r&&i.push(y0t),n&&i.push(b0t),t.map(s=>{const{idx:o}=s,a={item:e[o],refIndex:o};return i.length&&i.forEach(c=>{c(s,a)}),a})}class gf{constructor(e,r={},n){this.options={...Nt,...r},this.options.useExtendedSearch,this._keyStore=new Wht(this.options.keys),this.setCollection(e,n)}setCollection(e,r){if(this._docs=e,r&&!(r instanceof uD))throw new Error(jht);this._myIndex=r||Yfe(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){Qo(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const r=[];for(let n=0,i=this._docs.length;n-1&&(c=c.slice(0,r)),w0t(c,this._docs,{includeMatches:n,includeScore:i})}_searchStringList(e){const r=FR(e,this.options),{records:n}=this._myIndex,i=[];return n.forEach(({v:s,i:o,n:a})=>{if(!Qo(s))return;const{isMatch:c,score:l,indices:u}=r.searchIn(s);c&&i.push({item:s,idx:o,matches:[{score:l,value:s,norm:a,indices:u}]})}),i}_searchLogical(e){const r=tde(e,this.options),n=(a,c,l)=>{if(!a.children){const{keyId:f,searcher:d}=a,p=this._findMatches({key:this._keyStore.get(f),value:this._myIndex.getValueForItemAtKeyId(c,f),searcher:d});return p&&p.length?[{idx:l,item:c,matches:p}]:[]}const u=[];for(let f=0,d=a.children.length;f{if(Qo(a)){let l=n(r,a,c);l.length&&(s[c]||(s[c]={idx:c,item:a,matches:[]},o.push(s[c])),l.forEach(({matches:u})=>{s[c].matches.push(...u)}))}}),o}_searchObjectList(e){const r=FR(e,this.options),{keys:n,records:i}=this._myIndex,s=[];return i.forEach(({$:o,i:a})=>{if(!Qo(o))return;let c=[];n.forEach((l,u)=>{c.push(...this._findMatches({key:l,value:o[u],searcher:r}))}),c.length&&s.push({idx:a,item:o,matches:c})}),s}_findMatches({key:e,value:r,searcher:n}){if(!Qo(r))return[];let i=[];if(pf(r))r.forEach(({v:s,i:o,n:a})=>{if(!Qo(s))return;const{isMatch:c,score:l,indices:u}=n.searchIn(s);c&&i.push({score:l,key:e,value:s,idx:o,norm:a,indices:u})});else{const{v:s,n:o}=r,{isMatch:a,score:c,indices:l}=n.searchIn(s);a&&i.push({score:c,key:e,value:s,norm:o,indices:l})}return i}}gf.version="6.6.2";gf.createIndex=Yfe;gf.parseIndex=Xht;gf.config=Nt;gf.parseQuery=tde;p0t(h0t);function rde(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;et.forEach(r=>E0t(r,e))}function L1(...t){return $.useCallback(nde(...t),t)}function ide(t,e=[]){let r=[];function n(s,o){const a=$.createContext(o),c=r.length;r=[...r,o];function l(f){const{scope:d,children:p,...g}=f,v=(d==null?void 0:d[t][c])||a,y=$.useMemo(()=>g,Object.values(g));return $.createElement(v.Provider,{value:y},p)}function u(f,d){const p=(d==null?void 0:d[t][c])||a,g=$.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return l.displayName=s+"Provider",[l,u]}const i=()=>{const s=r.map(o=>$.createContext(o));return function(a){const c=(a==null?void 0:a[t])||s;return $.useMemo(()=>({[`__scope${t}`]:{...a,[t]:c}}),[a,c])}};return i.scopeName=t,[n,_0t(i,...e)]}function _0t(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=n.reduce((a,{useScope:c,scopeName:l})=>{const f=c(s)[`__scope${l}`];return{...a,...f}},{});return $.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return r.scopeName=e.scopeName,r}const fD=$.forwardRef((t,e)=>{const{children:r,...n}=t,i=$.Children.toArray(r),s=i.find(S0t);if(s){const o=s.props.children,a=i.map(c=>c===s?$.Children.count(o)>1?$.Children.only(null):$.isValidElement(o)?o.props.children:null:c);return $.createElement(zR,ts({},n,{ref:e}),$.isValidElement(o)?$.cloneElement(o,void 0,a):null)}return $.createElement(zR,ts({},n,{ref:e}),r)});fD.displayName="Slot";const zR=$.forwardRef((t,e)=>{const{children:r,...n}=t;return $.isValidElement(r)?$.cloneElement(r,{...A0t(n,r.props),ref:e?nde(e,r.ref):r.ref}):$.Children.count(r)>1?$.Children.only(null):null});zR.displayName="SlotClone";const C0t=({children:t})=>$.createElement($.Fragment,null,t);function S0t(t){return $.isValidElement(t)&&t.type===C0t}function A0t(t,e){const r={...e};for(const n in e){const i=t[n],s=e[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...a)=>{s(...a),i(...a)}:i&&(r[n]=i):n==="style"?r[n]={...i,...s}:n==="className"&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...t,...r}}const k0t=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],nx=k0t.reduce((t,e)=>{const r=$.forwardRef((n,i)=>{const{asChild:s,...o}=n,a=s?fD:e;return $.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),$.createElement(a,ts({},o,{ref:i}))});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function I0t(t,e){t&&Gc.flushSync(()=>t.dispatchEvent(e))}function ch(t){const e=$.useRef(t);return $.useEffect(()=>{e.current=t}),$.useMemo(()=>(...r)=>{var n;return(n=e.current)===null||n===void 0?void 0:n.call(e,...r)},[])}function P0t(t,e=globalThis==null?void 0:globalThis.document){const r=ch(t);$.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)},[r,e])}const HR="dismissableLayer.update",R0t="dismissableLayer.pointerDownOutside",T0t="dismissableLayer.focusOutside";let CK;const O0t=$.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$0t=$.forwardRef((t,e)=>{var r;const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:c,...l}=t,u=$.useContext(O0t),[f,d]=$.useState(null),p=(r=f==null?void 0:f.ownerDocument)!==null&&r!==void 0?r:globalThis==null?void 0:globalThis.document,[,g]=$.useState({}),v=L1(e,T=>d(T)),y=Array.from(u.layers),[b]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),w=y.indexOf(b),E=f?y.indexOf(f):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,S=E>=w,P=N0t(T=>{const Q=T.target,Z=[...u.branches].some(ne=>ne.contains(Q));!S||Z||(s==null||s(T),a==null||a(T),T.defaultPrevented||c==null||c())},p),_=M0t(T=>{const Q=T.target;[...u.branches].some(ne=>ne.contains(Q))||(o==null||o(T),a==null||a(T),T.defaultPrevented||c==null||c())},p);return P0t(T=>{E===u.layers.size-1&&(i==null||i(T),!T.defaultPrevented&&c&&(T.preventDefault(),c()))},p),$.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(CK=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),SK(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=CK)}},[f,p,n,u]),$.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),SK())},[f,u]),$.useEffect(()=>{const T=()=>g({});return document.addEventListener(HR,T),()=>document.removeEventListener(HR,T)},[]),$.createElement(nx.div,ts({},l,{ref:v,style:{pointerEvents:C?S?"auto":"none":void 0,...t.style},onFocusCapture:j0(t.onFocusCapture,_.onFocusCapture),onBlurCapture:j0(t.onBlurCapture,_.onBlurCapture),onPointerDownCapture:j0(t.onPointerDownCapture,P.onPointerDownCapture)}))});function N0t(t,e=globalThis==null?void 0:globalThis.document){const r=ch(t),n=$.useRef(!1),i=$.useRef(()=>{});return $.useEffect(()=>{const s=a=>{if(a.target&&!n.current){let l=function(){sde(R0t,r,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=l,e.addEventListener("click",i.current,{once:!0})):l()}else e.removeEventListener("click",i.current);n.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function M0t(t,e=globalThis==null?void 0:globalThis.document){const r=ch(t),n=$.useRef(!1);return $.useEffect(()=>{const i=s=>{s.target&&!n.current&&sde(T0t,r,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function SK(){const t=new CustomEvent(HR);document.dispatchEvent(t)}function sde(t,e,r,{discrete:n}){const i=r.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&i.addEventListener(t,e,{once:!0}),n?I0t(i,s):i.dispatchEvent(s)}let z7=0;function D0t(){$.useEffect(()=>{var t,e;const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(t=r[0])!==null&&t!==void 0?t:AK()),document.body.insertAdjacentElement("beforeend",(e=r[1])!==null&&e!==void 0?e:AK()),z7++,()=>{z7===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),z7--}},[])}function AK(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}const H7="focusScope.autoFocusOnMount",q7="focusScope.autoFocusOnUnmount",kK={bubbles:!1,cancelable:!0},L0t=$.forwardRef((t,e)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=t,[a,c]=$.useState(null),l=ch(i),u=ch(s),f=$.useRef(null),d=L1(e,v=>c(v)),p=$.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;$.useEffect(()=>{if(n){let v=function(E){if(p.paused||!a)return;const C=E.target;a.contains(C)?f.current=C:ed(f.current,{select:!0})},y=function(E){if(p.paused||!a)return;const C=E.relatedTarget;C!==null&&(a.contains(C)||ed(f.current,{select:!0}))},b=function(E){if(document.activeElement===document.body)for(const S of E)S.removedNodes.length>0&&ed(a)};document.addEventListener("focusin",v),document.addEventListener("focusout",y);const w=new MutationObserver(b);return a&&w.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",y),w.disconnect()}}},[n,a,p.paused]),$.useEffect(()=>{if(a){PK.add(p);const v=document.activeElement;if(!a.contains(v)){const b=new CustomEvent(H7,kK);a.addEventListener(H7,l),a.dispatchEvent(b),b.defaultPrevented||(B0t(H0t(ode(a)),{select:!0}),document.activeElement===v&&ed(a))}return()=>{a.removeEventListener(H7,l),setTimeout(()=>{const b=new CustomEvent(q7,kK);a.addEventListener(q7,u),a.dispatchEvent(b),b.defaultPrevented||ed(v??document.body,{select:!0}),a.removeEventListener(q7,u),PK.remove(p)},0)}}},[a,l,u,p]);const g=$.useCallback(v=>{if(!r&&!n||p.paused)return;const y=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,b=document.activeElement;if(y&&b){const w=v.currentTarget,[E,C]=F0t(w);E&&C?!v.shiftKey&&b===C?(v.preventDefault(),r&&ed(E,{select:!0})):v.shiftKey&&b===E&&(v.preventDefault(),r&&ed(C,{select:!0})):b===w&&v.preventDefault()}},[r,n,p.paused]);return $.createElement(nx.div,ts({tabIndex:-1},o,{ref:d,onKeyDown:g}))});function B0t(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(ed(n,{select:e}),document.activeElement!==r)return}function F0t(t){const e=ode(t),r=IK(e,t),n=IK(e.reverse(),t);return[r,n]}function ode(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function IK(t,e){for(const r of t)if(!j0t(r,{upTo:e}))return r}function j0t(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function U0t(t){return t instanceof HTMLInputElement&&"select"in t}function ed(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&U0t(t)&&e&&t.select()}}const PK=z0t();function z0t(){let t=[];return{add(e){const r=t[0];e!==r&&(r==null||r.pause()),t=RK(t,e),t.unshift(e)},remove(e){var r;t=RK(t,e),(r=t[0])===null||r===void 0||r.resume()}}}function RK(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function H0t(t){return t.filter(e=>e.tagName!=="A")}const vm=globalThis!=null&&globalThis.document?$.useLayoutEffect:()=>{},q0t=EJ["useId".toString()]||(()=>{});let W0t=0;function V0t(t){const[e,r]=$.useState(q0t());return vm(()=>{t||r(n=>n??String(W0t++))},[t]),t||(e?`radix-${e}`:"")}const G0t=["top","right","bottom","left"],lh=Math.min,Yo=Math.max,$_=Math.round,k3=Math.floor,uh=t=>({x:t,y:t}),K0t={left:"right",right:"left",bottom:"top",top:"bottom"},J0t={start:"end",end:"start"};function qR(t,e,r){return Yo(t,lh(e,r))}function mf(t,e){return typeof t=="function"?t(e):t}function vf(t){return t.split("-")[0]}function cv(t){return t.split("-")[1]}function dD(t){return t==="x"?"y":"x"}function hD(t){return t==="y"?"height":"width"}function lv(t){return["top","bottom"].includes(vf(t))?"y":"x"}function pD(t){return dD(lv(t))}function Q0t(t,e,r){r===void 0&&(r=!1);const n=cv(t),i=pD(t),s=hD(i);let o=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=N_(o)),[o,N_(o)]}function Y0t(t){const e=N_(t);return[WR(t),e,WR(e)]}function WR(t){return t.replace(/start|end/g,e=>J0t[e])}function Z0t(t,e,r){const n=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return r?e?i:n:e?n:i;case"left":case"right":return e?s:o;default:return[]}}function X0t(t,e,r,n){const i=cv(t);let s=Z0t(vf(t),r==="start",n);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(WR)))),s}function N_(t){return t.replace(/left|right|bottom|top/g,e=>K0t[e])}function e1t(t){return{top:0,right:0,bottom:0,left:0,...t}}function ade(t){return typeof t!="number"?e1t(t):{top:t,right:t,bottom:t,left:t}}function M_(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function TK(t,e,r){let{reference:n,floating:i}=t;const s=lv(e),o=pD(e),a=hD(o),c=vf(e),l=s==="y",u=n.x+n.width/2-i.width/2,f=n.y+n.height/2-i.height/2,d=n[a]/2-i[a]/2;let p;switch(c){case"top":p={x:u,y:n.y-i.height};break;case"bottom":p={x:u,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:f};break;case"left":p={x:n.x-i.width,y:f};break;default:p={x:n.x,y:n.y}}switch(cv(e)){case"start":p[o]-=d*(r&&l?-1:1);break;case"end":p[o]+=d*(r&&l?-1:1);break}return p}const t1t=async(t,e,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:o}=r,a=s.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(e));let l=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=TK(l,n,c),d=n,p={},g=0;for(let v=0;v({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:i,rects:s,platform:o,elements:a,middlewareData:c}=e,{element:l,padding:u=0}=mf(t,e)||{};if(l==null)return{};const f=ade(u),d={x:r,y:n},p=pD(i),g=hD(p),v=await o.getDimensions(l),y=p==="y",b=y?"top":"left",w=y?"bottom":"right",E=y?"clientHeight":"clientWidth",C=s.reference[g]+s.reference[p]-d[p]-s.floating[g],S=d[p]-s.reference[p],P=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l));let _=P?P[E]:0;(!_||!await(o.isElement==null?void 0:o.isElement(P)))&&(_=a.floating[E]||s.floating[g]);const T=C/2-S/2,Q=_/2-v[g]/2-1,Z=lh(f[b],Q),ne=lh(f[w],Q),ce=Z,K=_-v[g]-ne,x=_/2-v[g]/2+T,A=qR(ce,x,K),B=!c.arrow&&cv(i)!=null&&x!=A&&s.reference[g]/2-(xce<=0)){var Q,Z;const ce=(((Q=s.flip)==null?void 0:Q.index)||0)+1,K=S[ce];if(K)return{data:{index:ce,overflows:T},reset:{placement:K}};let x=(Z=T.filter(A=>A.overflows[0]<=0).sort((A,B)=>A.overflows[1]-B.overflows[1])[0])==null?void 0:Z.placement;if(!x)switch(p){case"bestFit":{var ne;const A=(ne=T.map(B=>[B.placement,B.overflows.filter(z=>z>0).reduce((z,R)=>z+R,0)]).sort((B,z)=>B[1]-z[1])[0])==null?void 0:ne[0];A&&(x=A);break}case"initialPlacement":x=a;break}if(i!==x)return{reset:{placement:x}}}return{}}}};function $K(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function NK(t){return G0t.some(e=>t[e]>=0)}const n1t=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...i}=mf(t,e);switch(n){case"referenceHidden":{const s=await $2(e,{...i,elementContext:"reference"}),o=$K(s,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:NK(o)}}}case"escaped":{const s=await $2(e,{...i,altBoundary:!0}),o=$K(s,r.floating);return{data:{escapedOffsets:o,escaped:NK(o)}}}default:return{}}}}};async function i1t(t,e){const{placement:r,platform:n,elements:i}=t,s=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=vf(r),a=cv(r),c=lv(r)==="y",l=["left","top"].includes(o)?-1:1,u=s&&c?-1:1,f=mf(e,t);let{mainAxis:d,crossAxis:p,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof g=="number"&&(p=a==="end"?g*-1:g),c?{x:p*u,y:d*l}:{x:d*l,y:p*u}}const s1t=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){const{x:r,y:n}=e,i=await i1t(e,t);return{x:r+i.x,y:n+i.y,data:i}}}},o1t=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:y=>{let{x:b,y:w}=y;return{x:b,y:w}}},...c}=mf(t,e),l={x:r,y:n},u=await $2(e,c),f=lv(vf(i)),d=dD(f);let p=l[d],g=l[f];if(s){const y=d==="y"?"top":"left",b=d==="y"?"bottom":"right",w=p+u[y],E=p-u[b];p=qR(w,p,E)}if(o){const y=f==="y"?"top":"left",b=f==="y"?"bottom":"right",w=g+u[y],E=g-u[b];g=qR(w,g,E)}const v=a.fn({...e,[d]:p,[f]:g});return{...v,data:{x:v.x-r,y:v.y-n}}}}},a1t=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=mf(t,e),u={x:r,y:n},f=lv(i),d=dD(f);let p=u[d],g=u[f];const v=mf(a,e),y=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const E=d==="y"?"height":"width",C=s.reference[d]-s.floating[E]+y.mainAxis,S=s.reference[d]+s.reference[E]-y.mainAxis;pS&&(p=S)}if(l){var b,w;const E=d==="y"?"width":"height",C=["top","left"].includes(vf(i)),S=s.reference[f]-s.floating[E]+(C&&((b=o.offset)==null?void 0:b[f])||0)+(C?0:y.crossAxis),P=s.reference[f]+s.reference[E]+(C?0:((w=o.offset)==null?void 0:w[f])||0)-(C?y.crossAxis:0);gP&&(g=P)}return{[d]:p,[f]:g}}}},c1t=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:r,rects:n,platform:i,elements:s}=e,{apply:o=()=>{},...a}=mf(t,e),c=await $2(e,a),l=vf(r),u=cv(r),f=lv(r)==="y",{width:d,height:p}=n.floating;let g,v;l==="top"||l==="bottom"?(g=l,v=u===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(v=l,g=u==="end"?"top":"bottom");const y=p-c[g],b=d-c[v],w=!e.middlewareData.shift;let E=y,C=b;if(f){const P=d-c.left-c.right;C=u||w?lh(b,P):P}else{const P=p-c.top-c.bottom;E=u||w?lh(y,P):P}if(w&&!u){const P=Yo(c.left,0),_=Yo(c.right,0),T=Yo(c.top,0),Q=Yo(c.bottom,0);f?C=d-2*(P!==0||_!==0?P+_:Yo(c.left,c.right)):E=p-2*(T!==0||Q!==0?T+Q:Yo(c.top,c.bottom))}await o({...e,availableWidth:C,availableHeight:E});const S=await i.getDimensions(s.floating);return d!==S.width||p!==S.height?{reset:{rects:!0}}:{}}}};function fh(t){return cde(t)?(t.nodeName||"").toLowerCase():"#document"}function ia(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function $f(t){var e;return(e=(cde(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function cde(t){return t instanceof Node||t instanceof ia(t).Node}function yf(t){return t instanceof Element||t instanceof ia(t).Element}function tu(t){return t instanceof HTMLElement||t instanceof ia(t).HTMLElement}function MK(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ia(t).ShadowRoot}function ix(t){const{overflow:e,overflowX:r,overflowY:n,display:i}=ec(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!["inline","contents"].includes(i)}function l1t(t){return["table","td","th"].includes(fh(t))}function gD(t){const e=mD(),r=ec(t);return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function u1t(t){let e=ym(t);for(;tu(e)&&!L4(e);){if(gD(e))return e;e=ym(e)}return null}function mD(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function L4(t){return["html","body","#document"].includes(fh(t))}function ec(t){return ia(t).getComputedStyle(t)}function B4(t){return yf(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function ym(t){if(fh(t)==="html")return t;const e=t.assignedSlot||t.parentNode||MK(t)&&t.host||$f(t);return MK(e)?e.host:e}function lde(t){const e=ym(t);return L4(e)?t.ownerDocument?t.ownerDocument.body:t.body:tu(e)&&ix(e)?e:lde(e)}function N2(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const i=lde(t),s=i===((n=t.ownerDocument)==null?void 0:n.body),o=ia(i);return s?e.concat(o,o.visualViewport||[],ix(i)?i:[],o.frameElement&&r?N2(o.frameElement):[]):e.concat(i,N2(i,[],r))}function ude(t){const e=ec(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=tu(t),s=i?t.offsetWidth:r,o=i?t.offsetHeight:n,a=$_(r)!==s||$_(n)!==o;return a&&(r=s,n=o),{width:r,height:n,$:a}}function vD(t){return yf(t)?t:t.contextElement}function Tg(t){const e=vD(t);if(!tu(e))return uh(1);const r=e.getBoundingClientRect(),{width:n,height:i,$:s}=ude(e);let o=(s?$_(r.width):r.width)/n,a=(s?$_(r.height):r.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const f1t=uh(0);function fde(t){const e=ia(t);return!mD()||!e.visualViewport?f1t:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function d1t(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==ia(t)?!1:e}function l1(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const i=t.getBoundingClientRect(),s=vD(t);let o=uh(1);e&&(n?yf(n)&&(o=Tg(n)):o=Tg(t));const a=d1t(s,r,n)?fde(s):uh(0);let c=(i.left+a.x)/o.x,l=(i.top+a.y)/o.y,u=i.width/o.x,f=i.height/o.y;if(s){const d=ia(s),p=n&&yf(n)?ia(n):n;let g=d.frameElement;for(;g&&n&&p!==d;){const v=Tg(g),y=g.getBoundingClientRect(),b=ec(g),w=y.left+(g.clientLeft+parseFloat(b.paddingLeft))*v.x,E=y.top+(g.clientTop+parseFloat(b.paddingTop))*v.y;c*=v.x,l*=v.y,u*=v.x,f*=v.y,c+=w,l+=E,g=ia(g).frameElement}}return M_({width:u,height:f,x:c,y:l})}function h1t(t){let{rect:e,offsetParent:r,strategy:n}=t;const i=tu(r),s=$f(r);if(r===s)return e;let o={scrollLeft:0,scrollTop:0},a=uh(1);const c=uh(0);if((i||!i&&n!=="fixed")&&((fh(r)!=="body"||ix(s))&&(o=B4(r)),tu(r))){const l=l1(r);a=Tg(r),c.x=l.x+r.clientLeft,c.y=l.y+r.clientTop}return{width:e.width*a.x,height:e.height*a.y,x:e.x*a.x-o.scrollLeft*a.x+c.x,y:e.y*a.y-o.scrollTop*a.y+c.y}}function p1t(t){return Array.from(t.getClientRects())}function dde(t){return l1($f(t)).left+B4(t).scrollLeft}function g1t(t){const e=$f(t),r=B4(t),n=t.ownerDocument.body,i=Yo(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=Yo(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+dde(t);const a=-r.scrollTop;return ec(n).direction==="rtl"&&(o+=Yo(e.clientWidth,n.clientWidth)-i),{width:i,height:s,x:o,y:a}}function m1t(t,e){const r=ia(t),n=$f(t),i=r.visualViewport;let s=n.clientWidth,o=n.clientHeight,a=0,c=0;if(i){s=i.width,o=i.height;const l=mD();(!l||l&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:s,height:o,x:a,y:c}}function v1t(t,e){const r=l1(t,!0,e==="fixed"),n=r.top+t.clientTop,i=r.left+t.clientLeft,s=tu(t)?Tg(t):uh(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,c=i*s.x,l=n*s.y;return{width:o,height:a,x:c,y:l}}function DK(t,e,r){let n;if(e==="viewport")n=m1t(t,r);else if(e==="document")n=g1t($f(t));else if(yf(e))n=v1t(e,r);else{const i=fde(t);n={...e,x:e.x-i.x,y:e.y-i.y}}return M_(n)}function hde(t,e){const r=ym(t);return r===e||!yf(r)||L4(r)?!1:ec(r).position==="fixed"||hde(r,e)}function y1t(t,e){const r=e.get(t);if(r)return r;let n=N2(t,[],!1).filter(a=>yf(a)&&fh(a)!=="body"),i=null;const s=ec(t).position==="fixed";let o=s?ym(t):t;for(;yf(o)&&!L4(o);){const a=ec(o),c=gD(o);!c&&a.position==="fixed"&&(i=null),(s?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||ix(o)&&!c&&hde(t,o))?n=n.filter(u=>u!==o):i=a,o=ym(o)}return e.set(t,n),n}function b1t(t){let{element:e,boundary:r,rootBoundary:n,strategy:i}=t;const o=[...r==="clippingAncestors"?y1t(e,this._c):[].concat(r),n],a=o[0],c=o.reduce((l,u)=>{const f=DK(e,u,i);return l.top=Yo(f.top,l.top),l.right=lh(f.right,l.right),l.bottom=lh(f.bottom,l.bottom),l.left=Yo(f.left,l.left),l},DK(e,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function w1t(t){return ude(t)}function x1t(t,e,r){const n=tu(e),i=$f(e),s=r==="fixed",o=l1(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const c=uh(0);if(n||!n&&!s)if((fh(e)!=="body"||ix(i))&&(a=B4(e)),n){const l=l1(e,!0,s,e);c.x=l.x+e.clientLeft,c.y=l.y+e.clientTop}else i&&(c.x=dde(i));return{x:o.left+a.scrollLeft-c.x,y:o.top+a.scrollTop-c.y,width:o.width,height:o.height}}function LK(t,e){return!tu(t)||ec(t).position==="fixed"?null:e?e(t):t.offsetParent}function pde(t,e){const r=ia(t);if(!tu(t))return r;let n=LK(t,e);for(;n&&l1t(n)&&ec(n).position==="static";)n=LK(n,e);return n&&(fh(n)==="html"||fh(n)==="body"&&ec(n).position==="static"&&!gD(n))?r:n||u1t(t)||r}const E1t=async function(t){let{reference:e,floating:r,strategy:n}=t;const i=this.getOffsetParent||pde,s=this.getDimensions;return{reference:x1t(e,await i(r),n),floating:{x:0,y:0,...await s(r)}}};function _1t(t){return ec(t).direction==="rtl"}const C1t={convertOffsetParentRelativeRectToViewportRelativeRect:h1t,getDocumentElement:$f,getClippingRect:b1t,getOffsetParent:pde,getElementRects:E1t,getClientRects:p1t,getDimensions:w1t,getScale:Tg,isElement:yf,isRTL:_1t};function S1t(t,e){let r=null,n;const i=$f(t);function s(){clearTimeout(n),r&&r.disconnect(),r=null}function o(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const{left:l,top:u,width:f,height:d}=t.getBoundingClientRect();if(a||e(),!f||!d)return;const p=k3(u),g=k3(i.clientWidth-(l+f)),v=k3(i.clientHeight-(u+d)),y=k3(l),w={rootMargin:-p+"px "+-g+"px "+-v+"px "+-y+"px",threshold:Yo(0,lh(1,c))||1};let E=!0;function C(S){const P=S[0].intersectionRatio;if(P!==c){if(!E)return o();P?o(!1,P):n=setTimeout(()=>{o(!1,1e-7)},100)}E=!1}try{r=new IntersectionObserver(C,{...w,root:i.ownerDocument})}catch{r=new IntersectionObserver(C,w)}r.observe(t)}return o(!0),s}function A1t(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,l=vD(t),u=i||s?[...l?N2(l):[],...N2(e)]:[];u.forEach(b=>{i&&b.addEventListener("scroll",r,{passive:!0}),s&&b.addEventListener("resize",r)});const f=l&&a?S1t(l,r):null;let d=-1,p=null;o&&(p=new ResizeObserver(b=>{let[w]=b;w&&w.target===l&&p&&(p.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{p&&p.observe(e)})),r()}),l&&!c&&p.observe(l),p.observe(e));let g,v=c?l1(t):null;c&&y();function y(){const b=l1(t);v&&(b.x!==v.x||b.y!==v.y||b.width!==v.width||b.height!==v.height)&&r(),v=b,g=requestAnimationFrame(y)}return r(),()=>{u.forEach(b=>{i&&b.removeEventListener("scroll",r),s&&b.removeEventListener("resize",r)}),f&&f(),p&&p.disconnect(),p=null,c&&cancelAnimationFrame(g)}}const k1t=(t,e,r)=>{const n=new Map,i={platform:C1t,...r},s={...i.platform,_c:n};return t1t(t,e,{...i,platform:s})},I1t=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:i}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?OK({element:n.current,padding:i}).fn(r):{}:n?OK({element:n,padding:i}).fn(r):{}}}};var PE=typeof document<"u"?$.useLayoutEffect:$.useEffect;function D_(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!D_(t[n],e[n]))return!1;return!0}if(i=Object.keys(t),r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){const s=i[n];if(!(s==="_owner"&&t.$$typeof)&&!D_(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function gde(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function BK(t,e){const r=gde(t);return Math.round(e*r)/r}function FK(t){const e=$.useRef(t);return PE(()=>{e.current=t}),e}function P1t(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:c,open:l}=t,[u,f]=$.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[d,p]=$.useState(n);D_(d,n)||p(n);const[g,v]=$.useState(null),[y,b]=$.useState(null),w=$.useCallback(B=>{B!=P.current&&(P.current=B,v(B))},[v]),E=$.useCallback(B=>{B!==_.current&&(_.current=B,b(B))},[b]),C=s||g,S=o||y,P=$.useRef(null),_=$.useRef(null),T=$.useRef(u),Q=FK(c),Z=FK(i),ne=$.useCallback(()=>{if(!P.current||!_.current)return;const B={placement:e,strategy:r,middleware:d};Z.current&&(B.platform=Z.current),k1t(P.current,_.current,B).then(z=>{const R={...z,isPositioned:!0};ce.current&&!D_(T.current,R)&&(T.current=R,Gc.flushSync(()=>{f(R)}))})},[d,e,r,Z]);PE(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(B=>({...B,isPositioned:!1})))},[l]);const ce=$.useRef(!1);PE(()=>(ce.current=!0,()=>{ce.current=!1}),[]),PE(()=>{if(C&&(P.current=C),S&&(_.current=S),C&&S){if(Q.current)return Q.current(C,S,ne);ne()}},[C,S,ne,Q]);const K=$.useMemo(()=>({reference:P,floating:_,setReference:w,setFloating:E}),[w,E]),x=$.useMemo(()=>({reference:C,floating:S}),[C,S]),A=$.useMemo(()=>{const B={position:r,left:0,top:0};if(!x.floating)return B;const z=BK(x.floating,u.x),R=BK(x.floating,u.y);return a?{...B,transform:"translate("+z+"px, "+R+"px)",...gde(x.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:z,top:R}},[r,a,x.floating,u.x,u.y]);return $.useMemo(()=>({...u,update:ne,refs:K,elements:x,floatingStyles:A}),[u,ne,K,x,A])}function R1t(t){const[e,r]=$.useState(void 0);return vm(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const c=s.borderBoxSize,l=Array.isArray(c)?c[0]:c;o=l.inlineSize,a=l.blockSize}else o=t.offsetWidth,a=t.offsetHeight;r({width:o,height:a})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}const mde="Popper",[vde,yde]=ide(mde),[T1t,bde]=vde(mde),O1t=t=>{const{__scopePopper:e,children:r}=t,[n,i]=$.useState(null);return $.createElement(T1t,{scope:e,anchor:n,onAnchorChange:i},r)},$1t="PopperAnchor",N1t=$.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...i}=t,s=bde($1t,r),o=$.useRef(null),a=L1(e,o);return $.useEffect(()=>{s.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:$.createElement(nx.div,ts({},i,{ref:a}))}),wde="PopperContent",[M1t,wbt]=vde(wde),D1t=$.forwardRef((t,e)=>{var r,n,i,s,o,a,c,l;const{__scopePopper:u,side:f="bottom",sideOffset:d=0,align:p="center",alignOffset:g=0,arrowPadding:v=0,avoidCollisions:y=!0,collisionBoundary:b=[],collisionPadding:w=0,sticky:E="partial",hideWhenDetached:C=!1,updatePositionStrategy:S="optimized",onPlaced:P,..._}=t,T=bde(wde,u),[Q,Z]=$.useState(null),ne=L1(e,Ce=>Z(Ce)),[ce,K]=$.useState(null),x=R1t(ce),A=(r=x==null?void 0:x.width)!==null&&r!==void 0?r:0,B=(n=x==null?void 0:x.height)!==null&&n!==void 0?n:0,z=f+(p!=="center"?"-"+p:""),R=typeof w=="number"?w:{top:0,right:0,bottom:0,left:0,...w},L=Array.isArray(b)?b:[b],q=L.length>0,N={padding:R,boundary:L.filter(L1t),altBoundary:q},{refs:I,floatingStyles:U,placement:re,isPositioned:M,middlewareData:G}=P1t({strategy:"fixed",placement:z,whileElementsMounted:(...Ce)=>A1t(...Ce,{animationFrame:S==="always"}),elements:{reference:T.anchor},middleware:[s1t({mainAxis:d+B,alignmentAxis:g}),y&&o1t({mainAxis:!0,crossAxis:!1,limiter:E==="partial"?a1t():void 0,...N}),y&&r1t({...N}),c1t({...N,apply:({elements:Ce,rects:Me,availableWidth:Oe,availableHeight:We})=>{const{width:ot,height:ze}=Me.reference,Le=Ce.floating.style;Le.setProperty("--radix-popper-available-width",`${Oe}px`),Le.setProperty("--radix-popper-available-height",`${We}px`),Le.setProperty("--radix-popper-anchor-width",`${ot}px`),Le.setProperty("--radix-popper-anchor-height",`${ze}px`)}}),ce&&I1t({element:ce,padding:v}),B1t({arrowWidth:A,arrowHeight:B}),C&&n1t({strategy:"referenceHidden",...N})]}),[H,J]=xde(re),X=ch(P);vm(()=>{M&&(X==null||X())},[M,X]);const D=(i=G.arrow)===null||i===void 0?void 0:i.x,F=(s=G.arrow)===null||s===void 0?void 0:s.y,Y=((o=G.arrow)===null||o===void 0?void 0:o.centerOffset)!==0,[ue,he]=$.useState();return vm(()=>{Q&&he(window.getComputedStyle(Q).zIndex)},[Q]),$.createElement("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:M?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ue,"--radix-popper-transform-origin":[(a=G.transformOrigin)===null||a===void 0?void 0:a.x,(c=G.transformOrigin)===null||c===void 0?void 0:c.y].join(" ")},dir:t.dir},$.createElement(M1t,{scope:u,placedSide:H,onArrowChange:K,arrowX:D,arrowY:F,shouldHideArrow:Y},$.createElement(nx.div,ts({"data-side":H,"data-align":J},_,{ref:ne,style:{..._.style,animation:M?void 0:"none",opacity:(l=G.hide)!==null&&l!==void 0&&l.referenceHidden?0:void 0}}))))});function L1t(t){return t!==null}const B1t=t=>({name:"transformOrigin",options:t,fn(e){var r,n,i,s,o;const{placement:a,rects:c,middlewareData:l}=e,f=((r=l.arrow)===null||r===void 0?void 0:r.centerOffset)!==0,d=f?0:t.arrowWidth,p=f?0:t.arrowHeight,[g,v]=xde(a),y={start:"0%",center:"50%",end:"100%"}[v],b=((n=(i=l.arrow)===null||i===void 0?void 0:i.x)!==null&&n!==void 0?n:0)+d/2,w=((s=(o=l.arrow)===null||o===void 0?void 0:o.y)!==null&&s!==void 0?s:0)+p/2;let E="",C="";return g==="bottom"?(E=f?y:`${b}px`,C=`${-p}px`):g==="top"?(E=f?y:`${b}px`,C=`${c.floating.height+p}px`):g==="right"?(E=`${-p}px`,C=f?y:`${w}px`):g==="left"&&(E=`${c.floating.width+p}px`,C=f?y:`${w}px`),{data:{x:E,y:C}}}});function xde(t){const[e,r="center"]=t.split("-");return[e,r]}const F1t=O1t,Ede=N1t,j1t=D1t;function U1t(t,e){return $.useReducer((r,n)=>{const i=e[r][n];return i??r},t)}const _de=t=>{const{present:e,children:r}=t,n=z1t(e),i=typeof r=="function"?r({present:n.isPresent}):$.Children.only(r),s=L1(n.ref,i.ref);return typeof r=="function"||n.isPresent?$.cloneElement(i,{ref:s}):null};_de.displayName="Presence";function z1t(t){const[e,r]=$.useState(),n=$.useRef({}),i=$.useRef(t),s=$.useRef("none"),o=t?"mounted":"unmounted",[a,c]=U1t(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return $.useEffect(()=>{const l=I3(n.current);s.current=a==="mounted"?l:"none"},[a]),vm(()=>{const l=n.current,u=i.current;if(u!==t){const d=s.current,p=I3(l);t?c("MOUNT"):p==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(u&&d!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,c]),vm(()=>{if(e){const l=f=>{const p=I3(n.current).includes(f.animationName);f.target===e&&p&&Gc.flushSync(()=>c("ANIMATION_END"))},u=f=>{f.target===e&&(s.current=I3(n.current))};return e.addEventListener("animationstart",u),e.addEventListener("animationcancel",l),e.addEventListener("animationend",l),()=>{e.removeEventListener("animationstart",u),e.removeEventListener("animationcancel",l),e.removeEventListener("animationend",l)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:$.useCallback(l=>{l&&(n.current=getComputedStyle(l)),r(l)},[])}}function I3(t){return(t==null?void 0:t.animationName)||"none"}function H1t({prop:t,defaultProp:e,onChange:r=()=>{}}){const[n,i]=q1t({defaultProp:e,onChange:r}),s=t!==void 0,o=s?t:n,a=ch(r),c=$.useCallback(l=>{if(s){const f=typeof l=="function"?l(t):l;f!==t&&a(f)}else i(l)},[s,t,i,a]);return[o,c]}function q1t({defaultProp:t,onChange:e}){const r=$.useState(t),[n]=r,i=$.useRef(n),s=ch(e);return $.useEffect(()=>{i.current!==n&&(s(n),i.current=n)},[n,i,s]),r}var W1t=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Cp=new WeakMap,P3=new WeakMap,R3={},W7=0,Cde=function(t){return t&&(t.host||Cde(t.parentNode))},V1t=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=Cde(r);return n&&t.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},G1t=function(t,e,r,n){var i=V1t(e,Array.isArray(t)?t:[t]);R3[r]||(R3[r]=new WeakMap);var s=R3[r],o=[],a=new Set,c=new Set(i),l=function(f){!f||a.has(f)||(a.add(f),l(f.parentNode))};i.forEach(l);var u=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(d){if(a.has(d))u(d);else{var p=d.getAttribute(n),g=p!==null&&p!=="false",v=(Cp.get(d)||0)+1,y=(s.get(d)||0)+1;Cp.set(d,v),s.set(d,y),o.push(d),v===1&&g&&P3.set(d,!0),y===1&&d.setAttribute(r,"true"),g||d.setAttribute(n,"true")}})};return u(e),a.clear(),W7++,function(){o.forEach(function(f){var d=Cp.get(f)-1,p=s.get(f)-1;Cp.set(f,d),s.set(f,p),d||(P3.has(f)||f.removeAttribute(n),P3.delete(f)),p||f.removeAttribute(r)}),W7--,W7||(Cp=new WeakMap,Cp=new WeakMap,P3=new WeakMap,R3={})}},K1t=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),i=e||W1t(t);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live]"))),G1t(n,i,r,"aria-hidden")):function(){return null}},RE="right-scroll-bar-position",TE="width-before-scroll-bar",J1t="with-scroll-bars-hidden",Q1t="--removed-body-scroll-bar-size";function Y1t(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function Z1t(t,e){var r=$.useState(function(){return{value:t,callback:e,facade:{get current(){return r.value},set current(n){var i=r.value;i!==n&&(r.value=n,r.callback(n,i))}}}})[0];return r.callback=e,r.facade}function X1t(t,e){return Z1t(e||null,function(r){return t.forEach(function(n){return Y1t(n,r)})})}function ept(t){return t}function tpt(t,e){e===void 0&&(e=ept);var r=[],n=!1,i={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:t},useMedium:function(s){var o=e(s,n);return r.push(o),function(){r=r.filter(function(a){return a!==o})}},assignSyncMedium:function(s){for(n=!0;r.length;){var o=r;r=[],o.forEach(s)}r={push:function(a){return s(a)},filter:function(){return r}}},assignMedium:function(s){n=!0;var o=[];if(r.length){var a=r;r=[],a.forEach(s),o=r}var c=function(){var u=o;o=[],u.forEach(s)},l=function(){return Promise.resolve().then(c)};l(),r={push:function(u){o.push(u),l()},filter:function(u){return o=o.filter(u),r}}}};return i}function rpt(t){t===void 0&&(t={});var e=tpt(null);return e.options=ja({async:!0,ssr:!1},t),e}var Sde=function(t){var e=t.sideCar,r=B8(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=e.read();if(!n)throw new Error("Sidecar medium not found");return $.createElement(n,ja({},r))};Sde.isSideCarExport=!0;function npt(t,e){return t.useMedium(e),Sde}var Ade=rpt(),V7=function(){},F4=$.forwardRef(function(t,e){var r=$.useRef(null),n=$.useState({onScrollCapture:V7,onWheelCapture:V7,onTouchMoveCapture:V7}),i=n[0],s=n[1],o=t.forwardProps,a=t.children,c=t.className,l=t.removeScrollBar,u=t.enabled,f=t.shards,d=t.sideCar,p=t.noIsolation,g=t.inert,v=t.allowPinchZoom,y=t.as,b=y===void 0?"div":y,w=B8(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),E=d,C=X1t([r,e]),S=ja(ja({},w),i);return $.createElement($.Fragment,null,u&&$.createElement(E,{sideCar:Ade,removeScrollBar:l,shards:f,noIsolation:p,inert:g,setCallbacks:s,allowPinchZoom:!!v,lockRef:r}),o?$.cloneElement($.Children.only(a),ja(ja({},S),{ref:C})):$.createElement(b,ja({},S,{className:c,ref:C}),a))});F4.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};F4.classNames={fullWidth:TE,zeroRight:RE};var jK,ipt=function(){if(jK)return jK;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function spt(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=ipt();return e&&t.setAttribute("nonce",e),t}function opt(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function apt(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var cpt=function(){var t=0,e=null;return{add:function(r){t==0&&(e=spt())&&(opt(e,r),apt(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},lpt=function(){var t=cpt();return function(e,r){$.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&r])}},kde=function(){var t=lpt(),e=function(r){var n=r.styles,i=r.dynamic;return t(n,i),null};return e},upt={left:0,top:0,right:0,gap:0},G7=function(t){return parseInt(t||"",10)||0},fpt=function(t){var e=window.getComputedStyle(document.body),r=e[t==="padding"?"paddingLeft":"marginLeft"],n=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[G7(r),G7(n),G7(i)]},dpt=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return upt;var e=fpt(t),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}},hpt=kde(),ppt=function(t,e,r,n){var i=t.left,s=t.top,o=t.right,a=t.gap;return r===void 0&&(r="margin"),` + .`.concat(J1t,` { + overflow: hidden `).concat(n,`; + padding-right: `).concat(a,"px ").concat(n,`; + } + body { + overflow: hidden `).concat(n,`; + overscroll-behavior: contain; + `).concat([e&&"position: relative ".concat(n,";"),r==="margin"&&` + padding-left: `.concat(i,`px; + padding-top: `).concat(s,`px; + padding-right: `).concat(o,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(a,"px ").concat(n,`; + `),r==="padding"&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),` + } + + .`).concat(RE,` { + right: `).concat(a,"px ").concat(n,`; + } + + .`).concat(TE,` { + margin-right: `).concat(a,"px ").concat(n,`; + } + + .`).concat(RE," .").concat(RE,` { + right: 0 `).concat(n,`; + } + + .`).concat(TE," .").concat(TE,` { + margin-right: 0 `).concat(n,`; + } + + body { + `).concat(Q1t,": ").concat(a,`px; + } +`)},gpt=function(t){var e=t.noRelative,r=t.noImportant,n=t.gapMode,i=n===void 0?"margin":n,s=$.useMemo(function(){return dpt(i)},[i]);return $.createElement(hpt,{styles:ppt(s,!e,i,r?"":"!important")})},VR=!1;if(typeof window<"u")try{var T3=Object.defineProperty({},"passive",{get:function(){return VR=!0,!0}});window.addEventListener("test",T3,T3),window.removeEventListener("test",T3,T3)}catch{VR=!1}var Sp=VR?{passive:!1}:!1,mpt=function(t){return t.tagName==="TEXTAREA"},Ide=function(t,e){var r=window.getComputedStyle(t);return r[e]!=="hidden"&&!(r.overflowY===r.overflowX&&!mpt(t)&&r[e]==="visible")},vpt=function(t){return Ide(t,"overflowY")},ypt=function(t){return Ide(t,"overflowX")},UK=function(t,e){var r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var n=Pde(t,r);if(n){var i=Rde(t,r),s=i[1],o=i[2];if(s>o)return!0}r=r.parentNode}while(r&&r!==document.body);return!1},bpt=function(t){var e=t.scrollTop,r=t.scrollHeight,n=t.clientHeight;return[e,r,n]},wpt=function(t){var e=t.scrollLeft,r=t.scrollWidth,n=t.clientWidth;return[e,r,n]},Pde=function(t,e){return t==="v"?vpt(e):ypt(e)},Rde=function(t,e){return t==="v"?bpt(e):wpt(e)},xpt=function(t,e){return t==="h"&&e==="rtl"?-1:1},Ept=function(t,e,r,n,i){var s=xpt(t,window.getComputedStyle(e).direction),o=s*n,a=r.target,c=e.contains(a),l=!1,u=o>0,f=0,d=0;do{var p=Rde(t,a),g=p[0],v=p[1],y=p[2],b=v-y-s*g;(g||b)&&Pde(t,a)&&(f+=b,d+=g),a=a.parentNode}while(!c&&a!==document.body||c&&(e.contains(a)||e===a));return(u&&(i&&f===0||!i&&o>f)||!u&&(i&&d===0||!i&&-o>d))&&(l=!0),l},O3=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},zK=function(t){return[t.deltaX,t.deltaY]},HK=function(t){return t&&"current"in t?t.current:t},_pt=function(t,e){return t[0]===e[0]&&t[1]===e[1]},Cpt=function(t){return` + .block-interactivity-`.concat(t,` {pointer-events: none;} + .allow-interactivity-`).concat(t,` {pointer-events: all;} +`)},Spt=0,Ap=[];function Apt(t){var e=$.useRef([]),r=$.useRef([0,0]),n=$.useRef(),i=$.useState(Spt++)[0],s=$.useState(function(){return kde()})[0],o=$.useRef(t);$.useEffect(function(){o.current=t},[t]),$.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var v=O$([t.lockRef.current],(t.shards||[]).map(HK),!0).filter(Boolean);return v.forEach(function(y){return y.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),v.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var a=$.useCallback(function(v,y){if("touches"in v&&v.touches.length===2)return!o.current.allowPinchZoom;var b=O3(v),w=r.current,E="deltaX"in v?v.deltaX:w[0]-b[0],C="deltaY"in v?v.deltaY:w[1]-b[1],S,P=v.target,_=Math.abs(E)>Math.abs(C)?"h":"v";if("touches"in v&&_==="h"&&P.type==="range")return!1;var T=UK(_,P);if(!T)return!0;if(T?S=_:(S=_==="v"?"h":"v",T=UK(_,P)),!T)return!1;if(!n.current&&"changedTouches"in v&&(E||C)&&(n.current=S),!S)return!0;var Q=n.current||S;return Ept(Q,y,v,Q==="h"?E:C,!0)},[]),c=$.useCallback(function(v){var y=v;if(!(!Ap.length||Ap[Ap.length-1]!==s)){var b="deltaY"in y?zK(y):O3(y),w=e.current.filter(function(S){return S.name===y.type&&S.target===y.target&&_pt(S.delta,b)})[0];if(w&&w.should){y.cancelable&&y.preventDefault();return}if(!w){var E=(o.current.shards||[]).map(HK).filter(Boolean).filter(function(S){return S.contains(y.target)}),C=E.length>0?a(y,E[0]):!o.current.noIsolation;C&&y.cancelable&&y.preventDefault()}}},[]),l=$.useCallback(function(v,y,b,w){var E={name:v,delta:y,target:b,should:w};e.current.push(E),setTimeout(function(){e.current=e.current.filter(function(C){return C!==E})},1)},[]),u=$.useCallback(function(v){r.current=O3(v),n.current=void 0},[]),f=$.useCallback(function(v){l(v.type,zK(v),v.target,a(v,t.lockRef.current))},[]),d=$.useCallback(function(v){l(v.type,O3(v),v.target,a(v,t.lockRef.current))},[]);$.useEffect(function(){return Ap.push(s),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:d}),document.addEventListener("wheel",c,Sp),document.addEventListener("touchmove",c,Sp),document.addEventListener("touchstart",u,Sp),function(){Ap=Ap.filter(function(v){return v!==s}),document.removeEventListener("wheel",c,Sp),document.removeEventListener("touchmove",c,Sp),document.removeEventListener("touchstart",u,Sp)}},[]);var p=t.removeScrollBar,g=t.inert;return $.createElement($.Fragment,null,g?$.createElement(s,{styles:Cpt(i)}):null,p?$.createElement(gpt,{gapMode:"margin"}):null)}const kpt=npt(Ade,Apt);var Tde=$.forwardRef(function(t,e){return $.createElement(F4,ja({},t,{ref:e,sideCar:kpt}))});Tde.classNames=F4.classNames;const Ipt=Tde,Ode="Popover",[$de,xbt]=ide(Ode,[yde]),j4=yde(),[Ppt,uv]=$de(Ode),Rpt=t=>{const{__scopePopover:e,children:r,open:n,defaultOpen:i,onOpenChange:s,modal:o=!1}=t,a=j4(e),c=$.useRef(null),[l,u]=$.useState(!1),[f=!1,d]=H1t({prop:n,defaultProp:i,onChange:s});return $.createElement(F1t,a,$.createElement(Ppt,{scope:e,contentId:V0t(),triggerRef:c,open:f,onOpenChange:d,onOpenToggle:$.useCallback(()=>d(p=>!p),[d]),hasCustomAnchor:l,onCustomAnchorAdd:$.useCallback(()=>u(!0),[]),onCustomAnchorRemove:$.useCallback(()=>u(!1),[]),modal:o},r))},Tpt="PopoverAnchor",Opt=$.forwardRef((t,e)=>{const{__scopePopover:r,...n}=t,i=uv(Tpt,r),s=j4(r),{onCustomAnchorAdd:o,onCustomAnchorRemove:a}=i;return $.useEffect(()=>(o(),()=>a()),[o,a]),$.createElement(Ede,ts({},s,n,{ref:e}))}),$pt="PopoverTrigger",Npt=$.forwardRef((t,e)=>{const{__scopePopover:r,...n}=t,i=uv($pt,r),s=j4(r),o=L1(e,i.triggerRef),a=$.createElement(nx.button,ts({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Mde(i.open)},n,{ref:o,onClick:j0(t.onClick,i.onOpenToggle)}));return i.hasCustomAnchor?a:$.createElement(Ede,ts({asChild:!0},s),a)}),Mpt="PopoverPortal",[Ebt,Dpt]=$de(Mpt,{forceMount:void 0}),M2="PopoverContent",Lpt=$.forwardRef((t,e)=>{const r=Dpt(M2,t.__scopePopover),{forceMount:n=r.forceMount,...i}=t,s=uv(M2,t.__scopePopover);return $.createElement(_de,{present:n||s.open},s.modal?$.createElement(Bpt,ts({},i,{ref:e})):$.createElement(Fpt,ts({},i,{ref:e})))}),Bpt=$.forwardRef((t,e)=>{const r=uv(M2,t.__scopePopover),n=$.useRef(null),i=L1(e,n),s=$.useRef(!1);return $.useEffect(()=>{const o=n.current;if(o)return K1t(o)},[]),$.createElement(Ipt,{as:fD,allowPinchZoom:!0},$.createElement(Nde,ts({},t,{ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:j0(t.onCloseAutoFocus,o=>{var a;o.preventDefault(),s.current||(a=r.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:j0(t.onPointerDownOutside,o=>{const a=o.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0,l=a.button===2||c;s.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:j0(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})))}),Fpt=$.forwardRef((t,e)=>{const r=uv(M2,t.__scopePopover),n=$.useRef(!1),i=$.useRef(!1);return $.createElement(Nde,ts({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o;if((o=t.onCloseAutoFocus)===null||o===void 0||o.call(t,s),!s.defaultPrevented){var a;n.current||(a=r.triggerRef.current)===null||a===void 0||a.focus(),s.preventDefault()}n.current=!1,i.current=!1},onInteractOutside:s=>{var o,a;(o=t.onInteractOutside)===null||o===void 0||o.call(t,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const c=s.target;((a=r.triggerRef.current)===null||a===void 0?void 0:a.contains(c))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}}))}),Nde=$.forwardRef((t,e)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:o,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...f}=t,d=uv(M2,r),p=j4(r);return D0t(),$.createElement(L0t,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:s},$.createElement($0t,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>d.onOpenChange(!1)},$.createElement(j1t,ts({"data-state":Mde(d.open),role:"dialog",id:d.contentId},p,f,{ref:e,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}))))});function Mde(t){return t?"open":"closed"}const jpt=Rpt,Upt=Opt,zpt=Npt,Hpt=Lpt,[qpt,Wpt]=Sh(),sx=()=>{const{setOpenWalletModal:t,openWalletModalState:e}=qpt();return{setOpenWalletModal:t,openWalletModalState:e}};function Cs(){return Cs=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(r[i]=t[i]);return r}const kn=(t,e)=>t.toLowerCase()===e.toLowerCase(),yD=(t,e)=>{let r=t;return t.length>=e&&(r=t.slice(0,e/2)+"..."+t.slice(t.length-e/2,t.length)),r},Dde=t=>`0x${yD((t==null?void 0:t.substring(2))||"",8)}`;var td=function(t){return t[t.VERY_LARGE=0]="VERY_LARGE",t[t.FRACTION=1]="FRACTION",t[t.VERY_TINY=2]="VERY_TINY",t[t.MIXED=3]="MIXED",t}(td||{});const bf=t=>{if(isNaN(Number(t)))return console.error(`display format error ${t} is not a number`),"NaN";const e=Number(t);if(e===0)return"0";let r;e>1e8?r=td.VERY_LARGE:e<1e-10?r=td.VERY_TINY:e<1?r=td.FRACTION:r=td.MIXED;let n,i;switch(r){case td.VERY_LARGE:n="compact",i={maximumFractionDigits:4};break;case td.VERY_TINY:n="scientific",i={maximumFractionDigits:4};break;case td.FRACTION:n="standard",i={maximumSignificantDigits:4};break;default:n="standard",i={maximumFractionDigits:2}}return Intl.NumberFormat("en-US",Cs({notation:n},i)).format(e)},Vpt=t=>t.charAt(0).toUpperCase()+t.slice(1),Lde=(t,e)=>{const r=t.split(".");return r.length===1?t:`${r[0]}.${r[1].slice(0,e)}`},L_=t=>/0x[a-fA-F0-9]{40}/.test(t),Gpt=t=>t>0?ut.colors.positive:t<0?ut.colors.negative:ut.colors.text50,qK=(t,e)=>{var r;const n=e.find(s=>kn(s.token.contractAddress,t.contractAddress));return n&&(n==null||(r=n.price24hChange)==null?void 0:r.value)||0},ru=({balance:t,prices:e,decimals:r,conversionRate:n})=>{var i;let s=0;const o=e.find(f=>kn(f.token.contractAddress,t.contractAddress));if(!o)return"0.00";const a=((i=o.price)==null?void 0:i.value)||0,c=Zn(t.balance,r),l=parseFloat(c)*a;return s+=l,`${(s*n).toFixed(2)}`},Bde=t=>{const e=[],r=[],n=[];return t.forEach(i=>{i.contractAddress===Rn?e.push(i):i.contractType==="ERC20"?r.push(i):(i.contractType==="ERC721"||i.contractType==="ERC1155")&&n.push(i)}),{nativeTokens:e,erc20Tokens:r,collectibles:n}},Fde=t=>{const e=[];return t==null||t.pages.forEach(r=>{e.push(...r.transactions)}),e},B_=async({accountAddress:t,chainId:e})=>{try{const{indexerClient:r}=await as(e),n=await r.getEtherBalance({accountAddress:t});return[{chainId:e,contractAddress:Rn,accountAddress:t,balance:(n==null?void 0:n.balance.balanceWei)||"0",contractType:HO.UNKNOWN,blockHash:"",blockNumber:0,tokenID:""}]}catch(r){return console.error(r),[]}},bD=async({tokens:t})=>{try{if(t.length===0)return[];const e=t[0].chainId,{apiClient:r}=await as(e),n=await r.getCoinPrices({tokens:t});return(n==null?void 0:n.tokenPrices)||[]}catch(e){console.error(e);return}},F_=async({accountAddress:t,chainId:e,contractAddress:r},{hideUnlistedTokens:n,hideCollectibles:i,includeMetadata:s=!0})=>{try{const{indexerClient:o}=await as(e),a=await o.getTokenBalances(Cs({accountAddress:t,includeMetadata:s},r?{contractAddress:r}:{}));let c=(a==null?void 0:a.balances)||[];if(n&&c.length>0){const l=await bD({tokens:c.map(u=>({chainId:u.chainId,contractAddress:u.contractAddress,tokenId:u.tokenID}))});c=c.filter(u=>{const f=l==null?void 0:l.find(d=>kn(d.token.contractAddress,u.contractAddress)&&d.token.chainId===u.chainId);return u.contractType!=="ERC20"||!!f&&f.price!==null})}return i&&c.length>0&&(c=c.filter(l=>l.contractType!=="ERC721"&&l.contractType!=="ERC1155")),c}catch(o){return console.error(o),[]}},Kpt=async({accountAddress:t,chainId:e},{hideUnlistedTokens:r,hideCollectibles:n})=>{try{return(await Promise.all([B_({accountAddress:t,chainId:e}),F_({accountAddress:t,chainId:e},{hideUnlistedTokens:r,hideCollectibles:n})])).flat()}catch(i){return console.error(i),[]}},jde=async({accountAddress:t,chainId:e,collectionAddress:r,includeMetadata:n=!0})=>{try{const{indexerClient:i}=await as(e),s=await i.getTokenBalances({accountAddress:t,includeMetadata:n,contractAddress:r});return(s==null?void 0:s.balances)||[]}catch(i){return console.error(i),[]}},Jpt=async({accountAddress:t,chainIds:e,displayAssets:r},{hideUnlistedTokens:n,hideCollectibles:i})=>{let o=[];const a=r.length>0;try{if(a){const C=r.filter(T=>kn(T.contractAddress,Rn)),S=r.filter(T=>!kn(T.contractAddress,Rn)),P={},_={};C.forEach(T=>{P[T.chainId]||(P[T.chainId]=[]),P[T.chainId].push(T)}),S.forEach(T=>{_[T.chainId]||(_[T.chainId]=[]),_[T.chainId].push(T)}),o=(await Promise.all([...Object.keys(P).map(T=>B_({accountAddress:t,chainId:Number(T)})),...Object.keys(_).map(T=>_[Number(T)].map(Q=>F_({accountAddress:t,chainId:Number(T),contractAddress:Q.contractAddress},{hideUnlistedTokens:n,hideCollectibles:i,includeMetadata:!1}))).flat()])).flat()}else o=(await Promise.all([...e.map(C=>B_({accountAddress:t,chainId:C})),...e.map(C=>F_({accountAddress:t,chainId:C},{hideUnlistedTokens:n,hideCollectibles:i,includeMetadata:!1}))])).flat();const{nativeTokens:c,erc20Tokens:l,collectibles:u}=Bde(o),f=new Promise(async(C,S)=>{if(l.length>0){const P=l.map(T=>({chainId:T.chainId,contractAddress:T.contractAddress})),_=await bD({tokens:P})||[];C(_)}else C([])}),d=u.map(async C=>a?C:await jde({accountAddress:t,chainId:C.chainId,collectionAddress:C.contractAddress,includeMetadata:!1})),p=async()=>{const C={},S={};l.forEach(_=>{S[_.chainId]?S[_.chainId].push(_):S[_.chainId]=[_]});const P=Object.keys(S).map(async _=>{const{metadataClient:T}=as(_),Z=S[Number(_)].map(ce=>ce.contractAddress),ne=await T.getContractInfoBatch({chainID:String(_),contractAddresses:Z});C[Number(_)]=ne});return await Promise.all([...P]),C},[g,v,...y]=await Promise.all([f,p(),...d]),b=l.sort((C,S)=>{var P,_;const T=g.find(R=>kn(R.token.contractAddress,C.contractAddress)),Q=g.find(R=>kn(R.token.contractAddress,S.contractAddress)),Z=T!=null&&T.price?T.price.value:0,ne=Q!=null&&Q.price?Q.price.value:0,ce=(P=v[C.chainId].contractInfoMap[C.contractAddress])==null?void 0:P.decimals,K=(_=v[S.chainId].contractInfoMap[S.contractAddress])==null?void 0:_.decimals,x=ce===void 0?0:Number(Zn(C.balance,ce)),A=K===void 0?0:Number(Zn(S.balance,K)),B=x*Z;return A*ne-B}),w=eht(y.flat(),10).sort((C,S)=>C.contractAddress.localeCompare(S.contractAddress));return i?[...c.length>0?[c[0]]:[],...b.length>0?b.slice(0,11):[]]:[...c.length>0?[c[0]]:[],...b.length>0?[b[0]]:[],...w.length>0?[...w]:[]]}catch(c){return console.error(c),[]}},Qpt=async({accountAddress:t,chainId:e,collectionAddress:r,tokenId:n})=>{const{indexerClient:i}=await as(e);return(await i.getTokenBalances({accountAddress:t,includeMetadata:!0,contractAddress:r,tokenID:n})).balances[0]},Ypt=async({tokens:t})=>{try{if(t.length===0)return[];const e=t[0].chainId,{apiClient:r}=await as(e),n=await r.getCollectiblePrices({tokens:t});return(n==null?void 0:n.tokenPrices)||[]}catch(e){console.error(e);return}},Ude=async({chainId:t,contractAddress:e,accountAddress:r,tokenId:n,page:i})=>{const{indexerClient:s}=as(t);return s.getTransactionHistory({includeMetadata:!0,page:i,filter:{accountAddress:r,contractAddress:e,tokenID:n}})},Zpt=async({chainIds:t,accountAddress:e})=>(await Promise.all([...t.map(s=>Ude({chainId:s,accountAddress:e,page:{page:1}}))])).map(s=>s.transactions).flat().sort((s,o)=>{const a=new Date(s.timestamp).getTime();return new Date(o.timestamp).getTime()-a}),Xpt=async({toCurrency:t})=>{if(t==="USD")return 1;const{apiClient:e}=as(137);return(await e.getExchangeRate({toCurrency:t})).exchangeRate.value},egt=async({tokens:t})=>{const{metadataClient:e}=as(t.chainId);return(await e.getTokenMetadata({chainID:t.chainId.toString(),contractAddress:t.contractAddress,tokenIDs:t.tokenIds})).tokenMetadata},tgt=async t=>{const{metadataClient:e}=as(Number(t.chainID));return(await e.getContractInfo(t)).contractInfo},rgt=["chainIds"],ngt=["disabled"],ac={oneSecond:1*1e3,oneMinute:60*1e3,oneHour:60*60*1e3},wD=(t,e)=>eo({queryKey:["balances",t,e],queryFn:async()=>{const{chainIds:r}=t,n=U4(t,rgt);return(await Promise.all(r.map(s=>Kpt(Cs({},n,{chainId:s}),e)))).flat()},retry:!0,staleTime:10*ac.oneMinute,enabled:t.chainIds.length>0&&!!t.accountAddress}),igt=t=>eo({queryKey:["collectionBalance",t],queryFn:()=>jde(t),retry:!0,staleTime:10*ac.oneMinute,enabled:!!t.chainId&&!!t.accountAddress&&!!t.collectionAddress}),B1=t=>{let{disabled:e}=t,r=U4(t,ngt);return eo({queryKey:["coinPrices",r],queryFn:()=>bD(r),retry:!0,staleTime:1*ac.oneMinute,enabled:r.tokens.length>0&&!e})},sgt=(t,e)=>eo({queryKey:["balancesAssetsSummary",t,e],queryFn:()=>Jpt(t,e),retry:!0,staleTime:10*ac.oneMinute,enabled:t.chainIds.length>0&&!!t.accountAddress}),ogt=(t,e)=>eo({queryKey:["coinBalance",t,e],queryFn:()=>kn((t==null?void 0:t.contractAddress)||"",Rn)?B_({accountAddress:t.accountAddress,chainId:t.chainId}).then(i=>i[0]):F_(t,e).then(n=>n[0]),retry:!0,staleTime:1*ac.oneMinute,enabled:!!t.chainId&&!!t.accountAddress}),zde=t=>eo({queryKey:["collectibleBalance",t],queryFn:()=>Qpt(t),retry:!0,staleTime:5*ac.oneMinute,enabled:!!t.chainId&&!!t.accountAddress&&!!t.collectionAddress&&!!t.tokenId}),Hde=t=>eo({queryKey:["useCollectiblePrices",t],queryFn:()=>Ypt(t),retry:!0,staleTime:5*ac.oneMinute,enabled:t.tokens.length>0}),qde=t=>klt({queryKey:["transactionHistory",t],queryFn:({pageParam:e})=>Ude(Cs({},t,e?{page:{page:e}}:{page:{page:1}})),getNextPageParam:({page:e})=>{if(e.more)return(e==null?void 0:e.page)||1},retry:!0,staleTime:10*ac.oneMinute,enabled:!!t.chainId&&!t.disabled&&!!t.accountAddress}),agt=t=>eo({queryKey:["transactionHistorySummary",t],queryFn:()=>Zpt(t),retry:!0,staleTime:10*ac.oneMinute,enabled:t.chainIds.length>0&&!!t.accountAddress}),kh=t=>eo({queryKey:["useConversionRate",t],queryFn:()=>Xpt(t),retry:!0,staleTime:60*ac.oneMinute}),cgt=t=>eo({queryKey:["useTokenMetadata",t],queryFn:()=>egt(t),retry:!0,staleTime:60*ac.oneMinute,enabled:!!t.tokens.chainId&&!!t.tokens.contractAddress}),lgt=t=>eo({queryKey:["useContractInfo",t],queryFn:()=>tgt(t),retry:!0,staleTime:60*ac.oneMinute,enabled:!!t.chainID&&!!t.contractAddress}),[ugt,fgt]=Sh(),Yc=()=>{const{setHistory:t,history:e}=ugt();return{setNavigation:i=>{const s=document.getElementById("sequence-kit-wallet-content"),o=s==null?void 0:s.parentElement;o==null||o.scrollTo(0,0);const a=[...e,i];t(a)},history:e,setHistory:t,goBack:()=>{const i=[...e];i.pop(),t(i)}}},dgt=[{inputs:[{internalType:"address",name:"_from",type:"address"},{internalType:"address",name:"_to",type:"address"},{internalType:"uint256[]",name:"_ids",type:"uint256[]"},{internalType:"uint256[]",name:"_amounts",type:"uint256[]"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"}],hgt=[{constant:!1,inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],pgt=[{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"}],Wde=[{symbol:"USD",sign:"$",name:{message:"US Dollar"},decimals:2},{symbol:"CAD",sign:"$",name:{message:"Canadian Dollar"},decimals:2},{symbol:"GBP",sign:"£",name:{message:"British Pound Sterling"},decimals:2},{symbol:"EUR",sign:"€",name:{message:"Euro"},decimals:2},{symbol:"CNY",sign:"¥",name:{message:"Chinese Yuan"},decimals:2},{symbol:"JPY",sign:"¥",name:{message:"Japanese Yen"},decimals:2},{symbol:"KRW",sign:"₩",name:{message:"South Korean Won"},decimals:2},{symbol:"SGD",sign:"$",name:{message:"Singapore Dollar"},decimals:2},{symbol:"CHF",sign:"CHF ",name:{message:"Swiss Franc"},decimals:2},{symbol:"AUD",sign:"$",name:{message:"Australian Dollar"},decimals:2},{symbol:"NZD",sign:"$",name:{message:"New Zealand Dollar"},decimals:2},{symbol:"SEK",sign:"kr ",name:{message:"Swedish Krona"},decimals:2},{symbol:"NOK",sign:"kr ",name:{message:"Norwegian Krone"},decimals:2},{symbol:"MXN",sign:"$",name:{message:"Mexican Peso"},decimals:2},{symbol:"INR",sign:"₹",name:{message:"Indian Rupee"},decimals:2},{symbol:"ZAR",sign:"R ",name:{message:"South African Rand"},decimals:2},{symbol:"TRY",sign:"₺",name:{message:"Turkish Lira"},decimals:2},{symbol:"BRL",sign:"R$",name:{message:"Brazilian Real"},decimals:2},{symbol:"DKK",sign:"kr ",name:{message:"Danish Krone"},decimals:2},{symbol:"PLN",sign:"zł ",name:{message:"Polish Zloty"},decimals:2},{symbol:"THB",sign:"฿",name:{message:"Thai Baht"},decimals:2},{symbol:"IDR",sign:"Rp",name:{message:"Indonesian Rupiah"},decimals:2}],ggt=Wde[0],ga="54px",Zc=navigator.userAgent.match(/chrome|chromium|crios/i)?"13px":"0px",ro=()=>{const{chains:t}=bn(),e=()=>{let l=!0,u=!1,f=ggt,d=t.map(p=>p.id);try{const p=localStorage.getItem(Qi.Settings),g=JSON.parse(p||"{}");if((g==null?void 0:g.hideUnlistedTokens)!==void 0&&(l=g==null?void 0:g.hideUnlistedTokens),(g==null?void 0:g.hideCollectibles)!==void 0&&(u=g==null?void 0:g.hideCollectibles),(g==null?void 0:g.fiatCurrency)!==void 0&&(f=g==null?void 0:g.fiatCurrency),(g==null?void 0:g.selectedNetworks)!==void 0){let v=!0;g.selectedNetworks.forEach(y=>{t.find(b=>b.id===y)===void 0&&(v=!1)}),v&&(d=g==null?void 0:g.selectedNetworks)}}catch(p){console.error(p,"Failed to fetch settings")}return{hideUnlistedTokens:l,hideCollectibles:u,fiatCurrency:f,selectedNetworks:d}},r=e(),[n,i]=$.useState(r);return Cs({},n,{setFiatCurrency:l=>{const u=e(),f=Cs({},u,{fiatCurrency:l});localStorage.setItem(Qi.Settings,JSON.stringify(f)),i(f)},setHideCollectibles:l=>{const u=e(),f=Cs({},u,{hideCollectibles:l});localStorage.setItem(Qi.Settings,JSON.stringify(f)),i(f)},setHideUnlistedTokens:l=>{const u=e(),f=Cs({},u,{hideUnlistedTokens:l});localStorage.setItem(Qi.Settings,JSON.stringify(f)),i(f)},setSelectedNetworks:l=>{const u=e(),f=Cs({},u,{selectedNetworks:l});localStorage.setItem(Qi.Settings,JSON.stringify(f)),i(f)}})},mgt=({size:t=30})=>O.createElement(ae,{alignItems:"center",justifyContent:"center",borderRadius:"circle",background:"backgroundInverse",flexShrink:"0",style:{width:`${t}px`,height:`${t}px`}},O.createElement(Pe,{variant:"large",color:"textInverse100"},"?")),u1=({imageUrl:t,size:e=30})=>t?O.createElement(Hn,{src:t,borderRadius:"circle",style:{width:`${e}px`,height:`${e}px`}}):O.createElement(mgt,{size:e}),WK=({networkLogoUrl:t,logoUrl:e,tokenName:r,balance:n,balanceFiat:i,priceChangePercentage:s,symbol:o})=>{const{fiatCurrency:a}=ro(),c=s>0?"+":"";return O.createElement(ae,{background:"backgroundSecondary",width:"full",height:"full",borderRadius:"md",padding:"4",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"1"},O.createElement(ae,{marginBottom:"1"},O.createElement(u1,{size:36,imageUrl:e})),O.createElement(ae,{marginBottom:"3"},O.createElement(ae,{flexDirection:"row",gap:"1",justifyContent:"flex-start",alignItems:"center"},O.createElement(Pe,{fontWeight:"bold",whiteSpace:"nowrap",color:"text100",style:{maxWidth:"130px",textOverflow:"ellipsis",overflow:"hidden"}},r),O.createElement(u1,{size:12,imageUrl:t})),O.createElement(Pe,{color:"text50",whiteSpace:"nowrap",style:{display:"block",maxWidth:"150px",textOverflow:"ellipsis",overflow:"hidden"}},`${n} ${o}`)),O.createElement(ae,null,O.createElement(ae,null,O.createElement(Pe,{fontWeight:"bold",color:"text100"},`${a.sign}${i}`)),O.createElement(Pe,{style:{color:Gpt(s)}},`${c}${s.toFixed(2)}%`)))},VK=({balance:t})=>{var e;const{chains:r}=bn(),{fiatCurrency:n}=ro(),i=kn(t.contractAddress,Rn),s=ui(t.chainId,r),{data:o=[],isLoading:a}=B1({tokens:[{chainId:t.chainId,contractAddress:t.contractAddress}]}),{data:c=1,isLoading:l}=kh({toCurrency:n.symbol}),{data:u,isLoading:f}=lgt({chainID:String(t.chainId),contractAddress:t.contractAddress});if(a||l||f)return O.createElement(ae,{background:"backgroundSecondary",width:"full",height:"full",borderRadius:"md"});if(i){const S=ru({balance:t,prices:o,conversionRate:c,decimals:s.decimals}),P=qK(t,o),_=Zn(t.balance,s.decimals),T=bf(_);return O.createElement(WK,{networkLogoUrl:s.logoURI,logoUrl:s.logoURI,tokenName:s.name,balance:T,balanceFiat:S,priceChangePercentage:P,symbol:s.symbol})}const p=(e=u==null?void 0:u.decimals)!=null?e:18,g=ru({balance:t,prices:o,conversionRate:c,decimals:p}),v=qK(t,o),y=Zn(t.balance,p),b=bf(y),w=(u==null?void 0:u.name)||"Unknown",E=(u==null?void 0:u.name)||"TOKEN",C=u==null?void 0:u.logoURI;return O.createElement(WK,{networkLogoUrl:s.logoURI,logoUrl:C,tokenName:w,balance:b,balanceFiat:g,priceChangePercentage:v,symbol:E})},xD=({imageUrl:t})=>O.createElement(Yl,{padding:"0",aspectRatio:"1/1",justifyContent:"center",alignItems:"center",overflow:"hidden",borderRadius:"md",background:"backgroundSecondary"},O.createElement(Hn,{style:{height:"100%"},src:t})),vgt=({balance:t})=>{var e;const{data:r}=cgt({tokens:{chainId:t.chainId,contractAddress:t.contractAddress,tokenIds:[t.tokenID]}}),n=r==null||(e=r[0])==null?void 0:e.image;return O.createElement(xD,{imageUrl:n})};M1("packages/wallet/src/shared/Skeleton/styles.css.ts","kit");const ygt=sfe({"0%":{opacity:.25},"50%":{opacity:.1},"100%":{opacity:.25}},"PulseSimple"),bgt=pa({height:"76px",backgroundColor:"#909090",animation:`${ygt} 2s ease-in-out infinite`},"skeleton");D1();const nn=({width:t="100%",height:e="100%",borderRadius:r="md",aspectRatio:n})=>O.createElement(ae,{className:bgt,borderRadius:r,aspectRatio:n,style:{width:t,height:e}}),wgt=()=>O.createElement(ae,{style:{display:"grid",gridTemplateColumns:`calc(50% - ${ut.space[1]}) calc(50% - ${ut.space[1]})`,gap:ut.space[2]}},Array(12).fill(null).map((t,e)=>O.createElement(ae,{key:e},O.createElement(nn,{height:"100%",width:"100%",aspectRatio:"1/1"}))));M1("packages/wallet/src/shared/styles.css.ts","kit");const ql=pa({":hover":{cursor:"pointer",opacity:"0.8",userSelect:"none"}},"clickable"),ED=pa({"> div":{overflowY:"scroll"}},"scrollbar");Qc(`html:not(.is-apple) ${ED} > div::-webkit-scrollbar-thumb`,{background:"none",backgroundClip:"content-box",transition:"background 0.5s linear"});Qc(`html:not(.is-apple) ${ED} > div:hover::-webkit-scrollbar-thumb`,{background:ut.colors.text50,backgroundClip:"content-box"});const _D=pa({},"walletContent");Qc(`${_D} + button`,{backgroundColor:"transparent"});Qc(`${_D} + button > svg`,{width:"20px",height:"20px"});D1();const xgt=()=>{const{address:t}=to(),{setNavigation:e}=Yc(),{displayedAssets:r}=plt(),{hideUnlistedTokens:n,hideCollectibles:i,selectedNetworks:s}=ro(),{data:o=[],isLoading:a}=sgt({accountAddress:t||"",chainIds:s,displayAssets:r},{hideUnlistedTokens:n,hideCollectibles:i});if(a)return O.createElement(wgt,null);const{nativeTokens:c,erc20Tokens:l,collectibles:u}=Bde(o),f=d=>{d.contractType==="ERC1155"||d.contractType==="ERC721"?e&&e({location:"collectible-details",params:{contractAddress:d.contractAddress,chainId:d.chainId,tokenId:d.tokenID}}):d.contractType==="ERC20"?e&&e({location:"coin-details",params:{contractAddress:d.contractAddress,chainId:d.chainId}}):e&&e({location:"coin-details",params:{contractAddress:d.contractAddress,chainId:d.chainId}})};return O.createElement(ae,{style:{display:"grid",gridTemplateColumns:`calc(50% - ${ut.space[1]}) calc(50% - ${ut.space[1]})`,gap:ut.space[2]}},c.map(d=>O.createElement(ae,{key:d.contractAddress,className:ql,aspectRatio:"1/1",onClick:()=>f(d)},O.createElement(VK,{balance:d}))),l.map(d=>O.createElement(ae,{className:ql,key:d.contractAddress,aspectRatio:"1/1",onClick:()=>f(d)},O.createElement(VK,{balance:d}))),u.map(d=>O.createElement(ae,{className:ql,aspectRatio:"1/1",key:`${d.contractAddress}-${d.tokenID}}`,onClick:()=>f(d)},O.createElement(vgt,{balance:d}))))},Egt=()=>O.createElement(ae,{paddingLeft:"5",paddingBottom:"5",gap:"4",flexDirection:"column",style:{paddingRight:`calc(${ut.space[5]} - ${Zc})`}},O.createElement(xgt,null)),_gt=()=>{const{address:t,chain:e}=to(),{chains:r}=bn(),[n,i]=$.useState(!1),s=ui((e==null?void 0:e.id)||1,r);$.useEffect(()=>{n&&setTimeout(()=>{i(!1)},4e3)},[n]);const o=()=>{i(!0)},a=()=>{window.open(`https://twitter.com/intent/tweet?text=Here%20is%20my%20address%20${t}`)};return O.createElement(ae,{style:{paddingTop:ga}},O.createElement(ae,{padding:"5",paddingTop:"3",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"4"},O.createElement(ae,{marginTop:"1",width:"fit",background:"white",borderRadius:"md",alignItems:"center",justifyContent:"center",padding:"4"},O.createElement($ht,{value:t||"",size:200,bgColor:"white",fgColor:"black","data-id":"receiveQR"})),O.createElement(ae,null,O.createElement(ae,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"2"},O.createElement(Pe,{variant:"medium",color:"text100",textAlign:"center",lineHeight:"inherit",style:{fontWeight:"700"}},"My Wallet"),O.createElement(Hn,{width:"5",src:s.logoURI,alt:"icon"})),O.createElement(ae,{marginTop:"2",style:{maxWidth:"180px",textAlign:"center"}},O.createElement(Pe,{textAlign:"center",color:"text50",style:{fontSize:"14px",maxWidth:"180px",overflowWrap:"anywhere"}},t))),O.createElement(ae,{gap:"3"},O.createElement($fe.CopyToClipboard,{text:t||""},O.createElement(Sr,{onClick:o,leftIcon:H8,label:n?"Copied!":"Copy"})),O.createElement(Sr,{onClick:a,leftIcon:KIe,label:"Share"})),O.createElement(ae,{justifyContent:"center",alignItems:"center",style:{maxWidth:"260px",textAlign:"center"}},O.createElement(Pe,{color:"text100",variant:"small",style:{maxWidth:"260px",overflowWrap:"anywhere"}},`This is a ${s.name} address. Please only send assets on the ${s.name} network.`))))},Vde=({imageUrl:t,name:e,decimals:r,balance:n,symbol:i,fiatValue:s,chainId:o,showSquareImage:a})=>{const{chains:c}=bn(),{fiatCurrency:l}=ro(),u=Zn(n,r),f=bf(u),d=ui(o,c);return O.createElement(ae,{alignItems:"flex-end",justifyContent:"space-between"},O.createElement(ae,{justifyContent:"space-between",alignItems:"center",gap:"2"},a?O.createElement(ae,{style:{width:"40px"}},O.createElement(xD,{imageUrl:t})):O.createElement(u1,{imageUrl:t,size:40}),O.createElement(ae,{flexDirection:"column",alignItems:"flex-start"},O.createElement(ae,{flexDirection:"row",alignItems:"center",gap:"1"},O.createElement(Pe,{variant:"medium",color:"text100"},e),O.createElement(u1,{imageUrl:d.logoURI,size:12})),O.createElement(Pe,{color:"text50",variant:"normal"}," ",`${f} ${i} available`))),O.createElement(ae,{flexDirection:"column",alignItems:"flex-end",justifyContent:"flex-end"},s&&O.createElement(Pe,{variant:"normal",color:"text100"},`${l.sign}${s}`)))},Cgt=({chainId:t,contractAddress:e})=>{var r,n,i,s,o;const{analytics:a}=lfe(),{chains:c}=bn(),l=M4(),{address:u="",connector:f}=to(),d=!!(f!=null&&(r=f._wallet)!=null&&r.isSequenceBased),p=l===t,g=!p&&!d,{switchChain:v}=sD(),y=$.useRef(null),{setOpenWalletModal:b}=sx(),{fiatCurrency:w}=ro(),[E,C]=$.useState("0"),[S,P]=$.useState(""),{data:_}=oD(),{data:T=[],isLoading:Q}=wD({accountAddress:u,chainIds:[t],contractAddress:e},{hideUnlistedTokens:!1}),Z=ui(t,c),ne=T.find(Y=>Y.contractAddress===e),{data:ce=[],isLoading:K}=B1({tokens:[{chainId:t,contractAddress:e}]}),{data:x=1,isLoading:A}=kh({toCurrency:w.symbol});if(Q||K||A)return null;const z=kn(e,Rn),R=z?Z.decimals:(ne==null||(n=ne.contractInfo)==null?void 0:n.decimals)||18,L=z?Z.name:(ne==null||(i=ne.contractInfo)==null?void 0:i.name)||"",q=z?Z.logoURI:ne==null||(s=ne.contractInfo)==null?void 0:s.logoURI,N=z?Z.symbol:(ne==null||(o=ne.contractInfo)==null?void 0:o.symbol)||"",I=E===""?"0":E,U=Gg(I,R),re=ru({balance:Cs({},ne,{balance:U.toString()}),prices:ce,conversionRate:x,decimals:R}),M=U.gt((ne==null?void 0:ne.balance)||"0"),G=U.gt(0),H=Y=>{const{value:ue}=Y.target,he=Lde(ue,R);C(he)},J=()=>{var Y;(Y=y.current)==null||Y.focus();const ue=Zn((ne==null?void 0:ne.balance)||0,R).toString();C(ue)},X=async()=>{const Y=await navigator.clipboard.readText();P(Y)},D=()=>{P("")},F=async Y=>{!p&&d&&v({chainId:t}),Y.preventDefault();const ue=Gg(I,R);if(z){var he;a==null||a.track({event:"SEND_TRANSACTION_REQUEST",props:{walletClient:(f==null||(he=f._wallet)==null?void 0:he.id)||"unknown"}}),_==null||_.sendTransaction({to:S,value:BigInt(ue.toString())}).catch(Me=>console.error("User rejected transaction",Me))}else{var Ce;a==null||a.track({event:"SEND_TRANSACTION_REQUEST",props:{walletClient:(f==null||(Ce=f._wallet)==null?void 0:Ce.id)||"unknown"}}),_==null||_.sendTransaction({to:ne==null?void 0:ne.contractAddress,data:new fi(hgt).encodeFunctionData("transfer",[S,ue.toHexString()])}).catch(Me=>console.error("User rejected transaction",Me))}b(!1)};return O.createElement(ae,{padding:"5",paddingTop:"3",style:{marginTop:ga},gap:"2",flexDirection:"column",as:"form",onSubmit:F},O.createElement(ae,{background:"backgroundSecondary",borderRadius:"md",padding:"4",gap:"2",flexDirection:"column"},O.createElement(Vde,{imageUrl:q,decimals:R,name:L,symbol:N,balance:(ne==null?void 0:ne.balance)||"0",fiatValue:ru({balance:ne,prices:ce,conversionRate:x,decimals:R}),chainId:t}),O.createElement(nse,{ref:y,style:{fontSize:ut.fontSizes.xlarge,fontWeight:ut.fontWeights.bold},name:"amount",value:E,onChange:H,controls:O.createElement(O.Fragment,null,O.createElement(Pe,{variant:"small",color:"text50",whiteSpace:"nowrap"},`~${w.sign}${re}`),O.createElement(Sr,{size:"xs",shape:"square",label:"Max",onClick:J,"data-id":"maxCoin",flexShrink:"0"}),O.createElement(Pe,{fontSize:"xlarge",fontWeight:"bold",color:"text100"},N))}),M&&O.createElement(Pe,{as:"div",variant:"normal",color:"negative",marginTop:"2"},"Insufficient Funds")),O.createElement(ae,{background:"backgroundSecondary",borderRadius:"md",padding:"4",gap:"2",flexDirection:"column"},O.createElement(Pe,{fontSize:"normal",color:"text50"},"To"),L_(S)?O.createElement(ae,{borderRadius:"md",background:"backgroundSecondary",width:"full",flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:"4",className:ql,onClick:D,style:{height:"52px"}},O.createElement(ae,{flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"2"},O.createElement(lw,{address:S,style:{width:"20px"}}),O.createElement(Pe,{color:"text100"},`0x${yD(S.substring(2),8)}`)),O.createElement(w1,{size:"xs"})):O.createElement(yh,{value:S,onChange:Y=>P(Y.target.value),placeholder:`${Z.name} Address (0x...)`,name:"to-address","data-1p-ignore":!0,controls:O.createElement(Sr,{size:"xs",shape:"square",label:"Paste",onClick:X,"data-id":"to-address",flexShrink:"0",leftIcon:H8})})),g&&O.createElement(ae,{marginTop:"3"},O.createElement(Pe,{color:"negative"},"The wallet is connected to the wrong network. Please switch network before proceeding"),O.createElement(Sr,{marginTop:"2",width:"full",variant:"primary",type:"button",label:"Switch Network",onClick:()=>v({chainId:t}),disabled:p,style:{height:"52px",borderRadius:ut.radii.md}})),O.createElement(Sr,{color:"text100",marginTop:"3",width:"full",variant:"primary",type:"submit",disabled:!G||!L_(S)||M||!p&&!d,label:"Send",rightIcon:Wu,style:{height:"52px",borderRadius:ut.radii.md}}))},Sgt=({chainId:t,contractAddress:e,tokenId:r})=>{var n,i,s,o,a;const{analytics:c}=lfe(),{chains:l}=bn(),u=M4(),{address:f="",connector:d}=to(),p=!!(d!=null&&(n=d._wallet)!=null&&n.isSequenceBased),g=u===t,v=!g&&!p,{switchChain:y}=sD(),b=$.useRef(null),{setOpenWalletModal:w}=sx(),[E,C]=$.useState("0"),[S,P]=$.useState(""),{data:_}=oD(),{data:T,isLoading:Q}=zde({accountAddress:f,chainId:t,collectionAddress:e,tokenId:r}),Z=ui(t,l);if(Q)return null;const ce=(T==null||(i=T.tokenMetadata)==null?void 0:i.decimals)||0,K=(T==null||(s=T.tokenMetadata)==null?void 0:s.name)||"Unknown",x=(T==null||(o=T.tokenMetadata)==null?void 0:o.image)||(T==null||(a=T.contractInfo)==null?void 0:a.logoURI)||"",A=E===""?"0":E,B=Gg(A,ce),z=B.gt((T==null?void 0:T.balance)||"0"),R=B.gt(0),L=X=>{const{value:D}=X.target,F=Lde(D,ce);C(F)},q=()=>{var X;(X=b.current)==null||X.focus();const D=Number(E)-1,F=Math.max(D,0).toString();C(F)},N=()=>{var X;(X=b.current)==null||X.focus();const D=Number(E)+1,F=Number(Zn((T==null?void 0:T.balance)||0,ce)),Y=Math.min(D,F).toString();C(Y)},I=()=>{var X;(X=b.current)==null||X.focus();const D=Zn((T==null?void 0:T.balance)||0,ce).toString();C(D)},U=async()=>{const X=await navigator.clipboard.readText();P(X)},re=()=>{P("")},M=async X=>{var D,F;X.preventDefault(),!g&&p&&y({chainId:t});const Y=Gg(A,ce),{contractType:ue}=T;switch(ue){case"ERC721":c==null||c.track({event:"SEND_TRANSACTION_REQUEST",props:{walletClient:(d==null||(D=d._wallet)==null?void 0:D.id)||"unknown"}}),_==null||_.sendTransaction({to:T.contractAddress,data:new fi(pgt).encodeFunctionData("safeTransferFrom",[f,S,r])}).catch(he=>console.error("User rejected transaction",he));break;case"ERC1155":default:c==null||c.track({event:"SEND_TRANSACTION_REQUEST",props:{walletClient:(d==null||(F=d._wallet)==null?void 0:F.id)||"unknown"}}),_==null||_.sendTransaction({to:T.contractAddress,data:new fi(dgt).encodeFunctionData("safeBatchTransferFrom",[f,S,[r],[Y.toHexString()],[]])}).catch(he=>console.error("User rejected transaction",he))}w(!1)},G=Zn((T==null?void 0:T.balance)||0,ce).toString(),H=Number(E)===0,J=Number(E)>=Number(G);return O.createElement(ae,{padding:"5",paddingTop:"3",style:{marginTop:ga},gap:"2",flexDirection:"column",as:"form",onSubmit:M},O.createElement(ae,{background:"backgroundSecondary",borderRadius:"md",padding:"4",gap:"2",flexDirection:"column"},O.createElement(Vde,{imageUrl:x,showSquareImage:!0,decimals:ce,name:K,symbol:"",balance:(T==null?void 0:T.balance)||"0",chainId:t}),O.createElement(nse,{ref:b,style:{fontSize:ut.fontSizes.xlarge,fontWeight:ut.fontWeights.bold},name:"amount",value:E,onChange:L,controls:O.createElement(ae,{gap:"2"},O.createElement(Sr,{disabled:H,size:"xs",onClick:q,leftIcon:YIe}),O.createElement(Sr,{disabled:J,size:"xs",onClick:N,leftIcon:CIe}),O.createElement(Sr,{size:"xs",shape:"square",label:"Max",onClick:I,"data-id":"maxCoin",flexShrink:"0"}))}),z&&O.createElement(Pe,{as:"div",variant:"normal",color:"negative",marginTop:"2"},"Insufficient Balance")),O.createElement(ae,{background:"backgroundSecondary",borderRadius:"md",padding:"4",gap:"2",flexDirection:"column"},O.createElement(Pe,{fontSize:"normal",color:"text50"},"To"),L_(S)?O.createElement(ae,{borderRadius:"md",background:"backgroundSecondary",width:"full",flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:"4",className:ql,onClick:re,style:{height:"52px"}},O.createElement(ae,{flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"2"},O.createElement(lw,{address:S,style:{width:"20px"}}),O.createElement(Pe,{color:"text100"},`0x${yD(S.substring(2),8)}`)),O.createElement(w1,{size:"xs"})):O.createElement(yh,{value:S,onChange:X=>P(X.target.value),placeholder:`${Z.name} Address (0x...)`,name:"to-address","data-1p-ignore":!0,controls:O.createElement(Sr,{size:"xs",shape:"square",label:"Paste",onClick:U,"data-id":"to-address",flexShrink:"0",leftIcon:H8})})),v&&O.createElement(ae,{marginTop:"3"},O.createElement(Pe,{color:"negative"},"The wallet is connected to the wrong network. Please switch network before proceeding"),O.createElement(Sr,{marginTop:"2",width:"full",variant:"primary",type:"button",label:"Switch Network",onClick:()=>y({chainId:t}),disabled:g,style:{height:"52px",borderRadius:ut.radii.md}})),O.createElement(Sr,{color:"text100",marginTop:"3",width:"full",variant:"primary",type:"submit",disabled:!R||!L_(S)||z||!g&&!p,label:"Send",rightIcon:Wu,style:{height:"52px",borderRadius:ut.radii.md}}))},Agt=({transaction:t})=>{var e;const{chains:r}=bn(),{fiatCurrency:n}=ro(),{setNavigation:i}=Yc(),s=()=>{i({location:"transaction-details",params:{transaction:t}})};let o=[];(e=t.transfers)==null||e.forEach(w=>{const E=w.contractAddress;o.includes(E)||o.push(E)});const{data:a=[],isLoading:c}=B1({tokens:o.map(w=>({contractAddress:w,chainId:t.chainId}))}),{data:l=1,isLoading:u}=kh({toCurrency:n.symbol}),f=c||u,{transfers:d}=t,p=ui(t.chainId,r),g=w=>{switch(w){case Sc.SEND:return O.createElement(tP,{style:{transform:"rotate(270deg)",width:"16px"}});case Sc.RECEIVE:return O.createElement(tP,{style:{transform:"rotate(90deg)",width:"16px"}});case Sc.UNKNOWN:default:return O.createElement(nie,{style:{width:"14px"}})}},v=w=>{switch(w){case Sc.SEND:return"Sent";case Sc.RECEIVE:return"Received";case Sc.UNKNOWN:default:return"Transacted"}},y=(w,E,C)=>{let S="";C===Sc.SEND?S="-":C===Sc.RECEIVE&&(S="+");let P="text50";return C===Sc.SEND?P=ut.colors.negative:C===Sc.RECEIVE&&(P=ut.colors.positive),O.createElement(Pe,{fontWeight:"bold",fontSize:"normal",style:{color:P}},`${S}${w} ${E}`)},b=({transfer:w,isFirstItem:E})=>{const{amounts:C}=w,S=Vfe(t.timestamp).format("MMM DD, YYYY");return O.createElement(ae,{gap:"2",width:"full",flexDirection:"column",justifyContent:"space-between"},O.createElement(ae,{flexDirection:"row",justifyContent:"space-between"},O.createElement(ae,{color:"text50",gap:"1",flexDirection:"row",justifyContent:"center",alignItems:"center"},g(w.transferType),O.createElement(Pe,{fontWeight:"medium",fontSize:"normal",color:"text100"},v(w.transferType)),O.createElement(Hn,{src:p.logoURI,width:"3"})),E&&O.createElement(ae,null,O.createElement(Pe,{fontWeight:"medium",fontSize:"normal",color:"text50"},S))),C.map((P,_)=>{var T,Q,Z,ne,ce,K;const x=ui(t.chainId,r),A=kn(w.contractAddress,Rn),B=((T=w.contractInfo)==null?void 0:T.type)==="ERC721"||((Q=w.contractInfo)==null?void 0:Q.type)==="ERC1155";let z;const R=(Z=w.tokenIds)==null?void 0:Z[_];if(B&&R){var L;z=((L=w.tokenMetadata)==null||(L=L[R])==null?void 0:L.decimals)||0}else{var q;z=A?x.decimals:(q=w.contractInfo)==null?void 0:q.decimals}const N=Zn(P,z),I=A?x.symbol:((ne=w.contractInfo)==null?void 0:ne.symbol)||"",U=A?x.logoURI:(ce=w.contractInfo)==null?void 0:ce.logoURI,re=(K=a.find(M=>kn(M.token.contractAddress,w.contractAddress)))==null||(K=K.price)==null?void 0:K.value;return O.createElement(ae,{key:_,flexDirection:"row",justifyContent:"space-between"},O.createElement(ae,{flexDirection:"row",gap:"2",justifyContent:"center",alignItems:"center"},U&&O.createElement(Hn,{src:U,width:"5",alt:"token logo"}),y(bf(N),I,w.transferType)),f&&O.createElement(nn,{width:"35px",height:"20px"}),re&&O.createElement(Pe,{fontWeight:"medium",fontSize:"normal",color:"text50"},`${n.sign}${(Number(N)*re*l).toFixed(2)}`))}))};return O.createElement(ae,{background:"backgroundSecondary",borderRadius:"md",padding:"4",gap:"2",alignItems:"center",justifyContent:"center",flexDirection:"column",className:ql,onClick:()=>s()},d==null?void 0:d.map((w,E)=>O.createElement(ae,{key:`${t.txnHash}-${E}`,width:"full"},b({transfer:w,isFirstItem:E===0}))))},CD=()=>{const t=()=>O.createElement(ae,{flexDirection:"column",gap:"2",width:"full",justifyContent:"space-between"},O.createElement(ae,{flexDirection:"row",justifyContent:"space-between"},O.createElement(nn,{width:"65px",height:"20px"}),O.createElement(nn,{width:"75px",height:"17px"})),O.createElement(ae,{flexDirection:"row",justifyContent:"space-between"},O.createElement(nn,{width:"120px",height:"20px"}),O.createElement(nn,{width:"35px",height:"17px"})));return O.createElement(ae,{flexDirection:"column",gap:"3"},O.createElement(nn,{width:"70px",height:"17px"}),O.createElement(ae,{flexDirection:"column",gap:"2"},Array(8).fill(null).map((e,r)=>O.createElement(ae,{borderRadius:"md",padding:"4",gap:"2",alignItems:"center",justifyContent:"center",flexDirection:"column",background:"backgroundSecondary",key:r},t()))))},SD=({transactions:t,isLoading:e,isFetchingNextPage:r})=>{const n=[{id:"today",label:"Today"},{id:"yesterday",label:"Yesterday"},{id:"week",label:"Last Week"},{id:"month",label:"Last Month"},{id:"year",label:"Last Year"},{id:"years",label:"Past Years"}],i=$.useMemo(()=>{const a=new Date(new Date().setHours(0,0,0,0)).getTime(),c=new Date(new Date().setDate(new Date(a).getDate()-1)).getTime(),l=new Date(new Date().setDate(new Date().getDate()-7)).getTime(),u=new Date(new Date().setDate(new Date().getDate()-30)).getTime(),f=new Date(new Date().setDate(new Date().getDate()-365)).getTime(),d={today:[],yesterday:[],week:[],month:[],year:[],years:[]};return t.forEach(p=>{const g=new Date(p.timestamp).getTime();g>a?d.today.push(p):g>c?d.yesterday.push(p):g>l?d.week.push(p):g>u?d.month.push(p):g>f?d.year.push(p):d.years.push(p)}),d},[t]);if(e)return O.createElement(ae,{flexDirection:"column",gap:"2"},O.createElement(CD,null));const s=({label:a})=>O.createElement(ae,null,O.createElement(Pe,{color:"text50",fontWeight:"medium",fontSize:"normal"},a)),o=({transactions:a})=>O.createElement(ae,{flexDirection:"column",gap:"2"},a.map((c,l)=>O.createElement(ae,{key:`${c.txnHash}-${l}`,flexDirection:"column",gap:"2"},O.createElement(Agt,{transaction:c}))));return O.createElement(ae,{flexDirection:"column",gap:"5"},n.map(a=>{const c=i[a.id];return c.length===0?null:O.createElement(ae,{key:a.id,flexDirection:"column",gap:"3"},O.createElement(s,{label:a.label}),O.createElement(o,{transactions:c}))}),t.length===0&&O.createElement(ae,{flexDirection:"column",gap:"3"},O.createElement(s,{label:"History"}),O.createElement(Pe,{color:"text100"},"No Recent Transaction History Found")),r&&O.createElement(ae,{margin:"4",alignItems:"center",justifyContent:"center"},O.createElement(J$,null)))},kgt=()=>{const{selectedNetworks:t}=ro(),{address:e}=to(),{data:r=[],isLoading:n}=agt({accountAddress:e||"",chainIds:t});return O.createElement(ae,null,O.createElement(ae,{paddingLeft:"5",paddingBottom:"5",paddingTop:"3",style:{paddingRight:`calc(${ut.space[5]} - ${Zc})`}},O.createElement(SD,{transactions:r,isLoading:n,isFetchingNextPage:!1})))},j_=({balance:t})=>{var e,r;const{chains:n}=bn(),{setNavigation:i}=Yc(),s=kn(t.contractAddress,Rn),o=ui(t.chainId,n),a=s?o.logoURI:t==null||(e=t.contractInfo)==null?void 0:e.logoURI,c=s?o.name:(t==null||(r=t.contractInfo)==null?void 0:r.name)||"Unknown",l=()=>{var f,d;if(t.contractType==="ERC721"||t.contractType==="ERC1155")return t.balance;const p=s?o.decimals:t==null||(f=t.contractInfo)==null?void 0:f.decimals,g=Zn(t.balance,p||0),v=bf(g),y=s?o.symbol:t==null||(d=t.contractInfo)==null?void 0:d.symbol;return`${v} ${y}`},u=()=>{const f=t.contractType==="ERC721"||t.contractType==="ERC1155";i(f?{location:"collection-details",params:{contractAddress:t.contractAddress,chainId:t.chainId}}:{location:"coin-details",params:{contractAddress:t.contractAddress,chainId:t.chainId}})};return O.createElement(ae,{key:t.contractAddress,onClick:u,width:"full",flexDirection:"row",justifyContent:"space-between",alignItems:"center",className:ql},O.createElement(ae,{gap:"3",flexDirection:"row",alignItems:"center",justifyContent:"center"},O.createElement(u1,{imageUrl:a,size:30}),O.createElement(ae,{gap:"1",flexDirection:"row",alignItems:"center",justifyContent:"center"},O.createElement(Pe,{color:"text100",fontWeight:"bold",fontSize:"normal",style:{textOverflow:"ellipsis",overflow:"hidden",maxWidth:"250px",textWrap:"nowrap"}},c),O.createElement(Hn,{src:o.logoURI,alt:"network logo",style:{width:"12px",height:"12px"}}))),O.createElement(ae,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"1"},O.createElement(Pe,{color:"text50",fontWeight:"bold",fontSize:"normal"},l()),O.createElement(Wu,{color:"text50"})))},GK=({toLocation:t,label:e})=>{const{setNavigation:r}=Yc(),n=()=>{r(t)};return O.createElement(ae,{onClick:n,width:"full",flexDirection:"row",justifyContent:"space-between",alignItems:"center",className:ql},O.createElement(Pe,{color:"text50",fontSize:"normal",fontWeight:"medium"},e),O.createElement(ae,{flexDirection:"row",justifyContent:"center",alignItems:"center"},O.createElement(Pe,{color:"text50",fontSize:"normal",fontWeight:"medium"},"View all"),O.createElement(Wu,{color:"text50",size:"sm"})))},Igt=()=>{const{chains:t}=bn(),{fiatCurrency:e,hideUnlistedTokens:r,selectedNetworks:n}=ro(),[i,s]=$.useState(""),{address:o}=to(),{data:a,isLoading:c}=wD({accountAddress:o||"",chainIds:n},{hideUnlistedTokens:r}),l=(a==null?void 0:a.filter(Z=>Z.contractType==="ERC20"||kn(Z.contractAddress,Rn)))||[],{data:u=[],isLoading:f}=B1({tokens:l.map(Z=>({chainId:Z.chainId,contractAddress:Z.contractAddress}))}),{data:d=1,isLoading:p}=kh({toCurrency:e.symbol}),g=l.sort((Z,ne)=>{var ce,K;return Number(ru({balance:ne,prices:u,conversionRate:d,decimals:((ce=ne.contractInfo)==null?void 0:ce.decimals)||18}))-Number(ru({balance:Z,prices:u,conversionRate:d,decimals:((K=ne.contractInfo)==null?void 0:K.decimals)||18}))}),y=((a==null?void 0:a.filter(Z=>Z.contractType==="ERC721"||Z.contractType==="ERC1155"))||[]).sort((Z,ne)=>Number(ne.balance)-Number(Z.balance)),b=c||f||p,w=y.map((Z,ne)=>{var ce;return{index:ne,name:((ce=Z.contractInfo)==null?void 0:ce.name)||"Unknown"}}),E=g.map((Z,ne)=>{if(kn(Z.contractAddress,Rn)){const K=ui(Z.chainId,t);return{index:ne,name:K.name}}else{var ce;return{index:ne,name:((ce=Z.contractInfo)==null?void 0:ce.name)||"Unknown"}}}),C=g.length,S=y.length,P=new gf(E,{keys:["name"]}),_=new gf(w,{keys:["name"]}),T=(i===""?E:P.search(i).map(Z=>Z.item)).slice(0,5),Q=(i===""?w:_.search(i).map(Z=>Z.item)).slice(0,5);return O.createElement(ae,{paddingLeft:"5",paddingBottom:"5",paddingTop:"3",flexDirection:"column",gap:"10",alignItems:"center",justifyContent:"center",style:{paddingRight:`calc(${ut.space[5]} - ${Zc})`}},O.createElement(ae,{width:"full"},O.createElement(yh,{autoFocus:!0,name:"search wallet",leftIcon:q8,value:i,onChange:Z=>s(Z.target.value),placeholder:"Search your wallet","data-1p-ignore":!0})),O.createElement(ae,{width:"full",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"5"},O.createElement(GK,{toLocation:{location:"search-view-all",params:{defaultTab:"collections"}},label:`Collections (${S})`}),b?Array(5).fill(null).map((Z,ne)=>O.createElement(nn,{key:ne,width:"100%",height:"32px"})):Q.length===0?O.createElement(Pe,{color:"text100"},"No collections found"):Q.map(Z=>{const ne=y[Z.index];return O.createElement(j_,{key:ne.contractAddress,balance:ne})})),O.createElement(ae,{width:"full",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"5"},O.createElement(GK,{toLocation:{location:"search-view-all",params:{defaultTab:"coins"}},label:`Coins (${C})`}),b?Array(5).fill(null).map((Z,ne)=>O.createElement(nn,{key:ne,width:"100%",height:"32px"})):T.length===0?O.createElement(Pe,{color:"text100"},"No coins found"):T.map(Z=>{const ne=g[Z.index];return O.createElement(j_,{key:ne.contractAddress,balance:ne})})))},Pgt=({defaultTab:t})=>{const{chains:e}=bn(),{fiatCurrency:r,hideUnlistedTokens:n,selectedNetworks:i}=ro(),[s,o]=$.useState(""),[a,c]=$.useState(t);$.useEffect(()=>{o("")},[a]);const{address:l}=to(),{data:u,isLoading:f}=wD({accountAddress:l||"",chainIds:i},{hideUnlistedTokens:n}),d=(u==null?void 0:u.filter(A=>A.contractType==="ERC20"||kn(A.contractAddress,Rn)))||[],{data:p=[],isLoading:g}=B1({tokens:d.map(A=>({chainId:A.chainId,contractAddress:A.contractAddress}))}),{data:v=1,isLoading:y}=kh({toCurrency:r.symbol}),b=d.sort((A,B)=>{var z,R;return Number(ru({balance:B,prices:p,conversionRate:v,decimals:((z=B.contractInfo)==null?void 0:z.decimals)||18}))-Number(ru({balance:A,prices:p,conversionRate:v,decimals:((R=A.contractInfo)==null?void 0:R.decimals)||18}))}),E=((u==null?void 0:u.filter(A=>A.contractType==="ERC721"||A.contractType==="ERC1155"))||[]).sort((A,B)=>Number(B.balance)-Number(A.balance)),C=b.length,S=E.length,P=f||g||y,_=E.map((A,B)=>{var z;return{index:B,name:((z=A.contractInfo)==null?void 0:z.name)||"Unknown"}}),T=b.map((A,B)=>{if(kn(A.contractAddress,Rn)){const R=ui(A.chainId,e);return{index:B,name:R.name}}else{var z;return{index:B,name:((z=A.contractInfo)==null?void 0:z.name)||"Unknown"}}}),Q=new gf(T,{keys:["name"]}),Z=new gf(_,{keys:["name"]}),ne=s===""?T:Q.search(s).map(A=>A.item),ce=s===""?_:Z.search(s).map(A=>A.item),K=()=>O.createElement(nn,{width:"360px",height:"48px"}),x=()=>O.createElement(O.Fragment,null,Array(8).fill(null).map((A,B)=>O.createElement(nn,{key:B,width:"full",height:"32px"})));return O.createElement(ae,{paddingLeft:"5",paddingBottom:"5",paddingTop:"3",flexDirection:"column",gap:"5",alignItems:"center",justifyContent:"center",style:{paddingRight:`calc(${ut.space[5]} - ${Zc})`}},O.createElement(ae,{width:"full"},O.createElement(yh,{autoFocus:!0,name:"search wallet",leftIcon:q8,value:s,onChange:A=>o(A.target.value),placeholder:"Search your wallet","data-1p-ignore":!0})),O.createElement(ae,{width:"full"},O.createElement(hNe,{value:a,onValueChange:A=>c(A)},O.createElement(ae,{marginBottom:"5"},!P&&O.createElement(dNe,{value:a,tabs:[{label:`Collections (${S})`,value:"collections"},{label:`Coins (${C})`,value:"coins"}]}),P&&O.createElement(K,null)),O.createElement(iH,{value:"collections"},O.createElement(ae,{flexDirection:"column",gap:"3"},P&&O.createElement(x,null),!P&&ce.length===0&&O.createElement(Pe,{color:"text100"},"No Collectibles Found"),!P&&ce.length>0&&ce.map(A=>{const B=E[A.index];return O.createElement(j_,{key:B.contractAddress,balance:B})}))),O.createElement(iH,{value:"coins"},O.createElement(ae,{flexDirection:"column",gap:"3"},P&&O.createElement(x,null),!P&&b.length==0&&O.createElement(Pe,{color:"text100"},"No Coins Found"),!P&&ne.length>0&&ne.map(A=>{const B=b[A.index];return O.createElement(j_,{key:B.contractAddress,balance:B})}))))))},Rgt=()=>{const{setNavigation:t}=Yc(),e=()=>{t({location:"settings-general"})},r=()=>{t({location:"settings-currency"})},n=()=>{t({location:"settings-networks"})};return O.createElement(ae,{style:{paddingTop:ga}},O.createElement(ae,{padding:"5",paddingTop:"3"},O.createElement(ae,{flexDirection:"column",gap:"2"},O.createElement(Sr,{onClick:e,leftIcon:tie,rightIcon:Wu,width:"full",label:"General",style:{height:"52px",borderRadius:ut.radii.md}}),O.createElement(Sr,{onClick:r,leftIcon:$Ie,rightIcon:Wu,width:"full",label:"Currency",style:{height:"52px",borderRadius:ut.radii.md}}),O.createElement(Sr,{onClick:n,leftIcon:UIe,rightIcon:Wu,width:"full",label:"Networks",style:{height:"52px",borderRadius:ut.radii.md}}))))},Tgt=()=>{rx();const{hideUnlistedTokens:t,setHideUnlistedTokens:e,hideCollectibles:r,setHideCollectibles:n}=ro(),i=()=>{e(!t)},s=()=>{n(!r)};return O.createElement(ae,{style:{paddingTop:ga}},O.createElement(ae,{gap:"2",padding:"5",paddingTop:"3",flexDirection:"column"},O.createElement(Yl,{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},O.createElement(Pe,{color:"text100",fontWeight:"bold"},"Hide unlisted tokens"),O.createElement(nH,{checked:t,onCheckedChange:i})),O.createElement(Yl,{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},O.createElement(Pe,{color:"text100",fontWeight:"bold"},"Hide collectibles"),O.createElement(nH,{checked:r,onCheckedChange:s}))))},Ogt=t=>{const{selected:e,className:r,squareIndicator:n=!1}=t;return O.createElement(ae,{borderStyle:"solid",borderColor:n&&e?"transparent":"borderNormal",borderWidth:"thin",position:"relative",alignItems:"center",justifyContent:"center",flexShrink:"0",className:r,style:{borderRadius:n?"4px":ut.radii.circle,width:"20px",height:"20px"}},O.createElement(ae,{as:Zb.div,background:n?"borderNormal":"backgroundInverse",position:"absolute",color:"textInverse100",initial:{opacity:e?1:0,scale:e?1:.5},animate:{opacity:e?1:0,scale:e?1:.5},transition:{ease:"backOut"},style:{borderRadius:n?"4px":ut.radii.circle,width:n?"20px":"14px",height:n?"20px":"14px"},justifyContent:"center",alignItems:"center"},n&&O.createElement(Nm,{color:"white",style:{width:"14px",height:"14px"}})))},$gt=["value","selected","children","disabled","onClick","className","hideIndicator","squareIndicator"],Gde=t=>{const{value:e,selected:r,children:n,disabled:i,onClick:s,className:o,hideIndicator:a,squareIndicator:c=!1}=t,l=U4(t,$gt);return O.createElement(Yl,Cs({as:"button",clickable:!0,className:x0t(o),disabled:i,onClick:()=>s(e),userSelect:"none",alignItems:"center",justifyContent:"space-between",textAlign:"left",width:"full",style:{appearance:"none"}},l),n,!a&&O.createElement(Ogt,{selected:r,squareIndicator:c}))},Ngt=()=>{const{fiatCurrency:t,setFiatCurrency:e}=ro();return O.createElement(ae,{paddingBottom:"5",paddingLeft:"5",paddingTop:"3",style:{paddingRight:`calc(${ut.space[5]} - ${Zc})`}},O.createElement(ae,{flexDirection:"column",gap:"2"},Wde.map(r=>O.createElement(Gde,{key:r.symbol,value:r.symbol,selected:r.symbol===t.symbol,onClick:()=>e&&e(r)},O.createElement(ae,{gap:"2",justifyContent:"flex-start",alignItems:"center"},O.createElement(Pe,{color:"text100",fontWeight:"bold"},r.symbol),O.createElement(Pe,{color:"text50"},r.name.message))))))},Mgt=()=>{const{selectedNetworks:t,setSelectedNetworks:e}=ro(),{chains:r}=bn(),n=i=>{if(t.includes(i)){if(t.length===1)return;e(t.filter(s=>s!==i))}else e([...t,i])};return O.createElement(ae,{style:{paddingTop:ga}},O.createElement(ae,{padding:"5",paddingTop:"3"},O.createElement(Pe,{variant:"small",color:"text50"},"Networks"),O.createElement(ae,{flexDirection:"column",gap:"2"},r.map(i=>{const s=ui(i.id,r);return O.createElement(Gde,{disabled:t.length===1&&t.includes(i.id),key:i.id,selected:t.includes(i.id),onClick:()=>n(i.id),value:i.id,squareIndicator:!0},O.createElement(ae,{gap:"2",justifyContent:"center",alignItems:"center"},O.createElement(Hn,{width:"3",height:"3",src:s.logoURI,alt:"network"}),O.createElement(Pe,{color:"text100",variant:"small"},s.name)))}))))},ox=({chainId:t})=>{const{chains:e}=bn(),{network:r}=as(t),n=ui(t,e),i=Jct(t),s=Qct(t);return O.createElement(ae,{height:"6",paddingY:"1",paddingLeft:"1.5",paddingRight:"2",gap:"1",style:{background:s},borderRadius:"xs",flexDirection:"row",justifyContent:"center",alignItems:"center",width:"min"},O.createElement(Hn,{style:{width:"14px"},src:n.logoURI}),O.createElement(Pe,{fontWeight:"bold",fontSize:"xsmall",style:{color:i}},Vpt(r.name)))},Dgt=({chainId:t})=>O.createElement(ae,{style:{paddingTop:ga}},O.createElement(ae,{flexDirection:"column",gap:"10",paddingBottom:"5",paddingLeft:"5",paddingTop:"0",style:{marginTop:"-20px",paddingRight:`calc(${ut.space[5]} - ${Zc})`}},O.createElement(ae,{marginBottom:"10",gap:"2",alignItems:"center",justifyContent:"center",flexDirection:"column"},O.createElement(nn,{width:"32px",height:"32px"}),O.createElement(nn,{height:"24px",width:"70px"}),O.createElement(ox,{chainId:t})),O.createElement(ae,null,O.createElement(Pe,{fontWeight:"medium",color:"text50",fontSize:"normal"},"Balance"),O.createElement(ae,{flexDirection:"row",alignItems:"flex-end",justifyContent:"space-between"},O.createElement(nn,{width:"150px",height:"36px"}),O.createElement(nn,{width:"33px",height:"17px"}))),O.createElement(Sr,{color:"text100",marginTop:"4",marginBottom:"10",width:"full",variant:"primary",leftIcon:W8,label:"Send",disabled:!0,onClick:()=>{}}),O.createElement(ae,null,O.createElement(CD,null)))),Lgt=(t,e)=>{var r;const[n,i]=$.useState(null),s=$.useMemo(()=>new IntersectionObserver(([o])=>i(o),e),[]);return $.useEffect(()=>(t.current&&s.observe(t.current),()=>{t.current&&s.disconnect()}),[t.current,s]),(r=n==null?void 0:n.isIntersecting)!=null?r:!1},Kde=t=>{const{onLoad:e,hasMore:r=!0,children:n}=t,[i,s]=$.useState(0),[o,a]=$.useState(!1),c=$.useRef(null),l=Lgt(c);$.useEffect(()=>{l&&r&&!o&&u()},[l]);const u=async()=>{a(!0),await e(i),s(f=>f+1),a(!1)};return O.createElement(O.Fragment,null,n,O.createElement("div",{ref:c}))},Bgt=({contractAddress:t,chainId:e})=>{var r,n,i,s;const{chains:o}=bn(),{setNavigation:a}=Yc(),{fiatCurrency:c,hideUnlistedTokens:l}=ro(),{address:u}=to(),{data:f,isLoading:d,fetchNextPage:p,hasNextPage:g,isFetchingNextPage:v}=qde({chainId:e,accountAddress:u||"",contractAddress:t}),y=Fde(f),{data:b,isLoading:w}=ogt({accountAddress:u||"",contractAddress:t,chainId:e},{hideUnlistedTokens:l}),{data:E,isLoading:C}=B1({tokens:[{chainId:e,contractAddress:t}]}),{data:S=1,isLoading:P}=kh({toCurrency:c.symbol});if(w||C||P)return O.createElement(Dgt,{chainId:e});const T=kn(t,Rn),Q=T?ui(e,o).logoURI:b==null||(r=b.contractInfo)==null?void 0:r.logoURI,Z=T?ui(e,o).symbol:b==null||(n=b.contractInfo)==null?void 0:n.symbol,ne=T?ui(e,o).name:b==null||(i=b.contractInfo)==null?void 0:i.name,ce=T?ui(e,o).decimals:b==null||(s=b.contractInfo)==null?void 0:s.decimals,K=Zn((b==null?void 0:b.balance)||"0",ce),x=bf(K),A=b?ru({balance:b,prices:E||[],conversionRate:S,decimals:ce||0}):"0",B=()=>{a({location:"send-coin",params:{chainId:e,contractAddress:t}})};return O.createElement(ae,{style:{paddingTop:ga}},O.createElement(ae,{flexDirection:"column",gap:"10",paddingBottom:"5",paddingLeft:"5",paddingTop:"0",style:{marginTop:"-20px",paddingRight:`calc(${ut.space[5]} - ${Zc})`}},O.createElement(ae,{marginBottom:"10",gap:"2",alignItems:"center",justifyContent:"center",flexDirection:"column"},O.createElement(Hn,{width:"8",src:Q,alt:"logo"}),O.createElement(Pe,{color:"text100",fontWeight:"bold",fontSize:"large"},ne),O.createElement(ox,{chainId:e})),O.createElement(ae,null,O.createElement(Pe,{fontWeight:"medium",color:"text50",fontSize:"normal"},"Balance"),O.createElement(ae,{flexDirection:"row",alignItems:"flex-end",justifyContent:"space-between"},O.createElement(Pe,{fontWeight:"bold",color:"text100",fontSize:"xlarge"},`${x} ${Z}`),O.createElement(Pe,{fontWeight:"medium",color:"text50",fontSize:"normal"},`${c.sign}${A}`))),O.createElement(Sr,{width:"full",variant:"primary",leftIcon:W8,color:"text100",label:"Send",onClick:B}),O.createElement(ae,null,O.createElement(Kde,{onLoad:()=>p(),hasMore:g},O.createElement(SD,{transactions:y,isLoading:d,isFetchingNextPage:v})))))},Fgt=({chainId:t})=>O.createElement(ae,{paddingLeft:"5",paddingBottom:"5",paddingTop:"3",marginTop:"8",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"10",style:{paddingRight:`calc(${ut.space[5]} - ${Zc})`}},O.createElement(ae,{flexDirection:"column",gap:"2",justifyContent:"center",alignItems:"center"},O.createElement(nn,{width:"32px",height:"32px"}),O.createElement(nn,{width:"100px",height:"24px"}),O.createElement(ox,{chainId:t}),O.createElement(nn,{width:"142px",height:"17px"})),O.createElement(ae,{width:"full"},O.createElement(nn,{width:"168px",height:"20px"}),O.createElement(ae,{style:{display:"grid",gridTemplateColumns:`calc(50% - ${ut.space[1]}) calc(50% - ${ut.space[1]})`,gap:ut.space[2]},width:"full",marginTop:"3"},Array(8).fill(null).map((e,r)=>O.createElement(nn,{width:"full",aspectRatio:"1/1"}))))),jgt=({chainId:t,contractAddress:e})=>{var r;const{setNavigation:n}=Yc(),{address:i}=to(),{data:s,isLoading:o}=igt({chainId:t,accountAddress:i||"",collectionAddress:e}),a=s==null||(r=s[0])==null?void 0:r.contractInfo,c=a==null?void 0:a.logoURI;if(o)return O.createElement(Fgt,{chainId:t});const l=u=>{n&&n({location:"collectible-details",params:{contractAddress:u.contractAddress,chainId:u.chainId,tokenId:u.tokenID}})};return O.createElement(ae,{paddingLeft:"5",paddingBottom:"5",paddingTop:"3",marginTop:"8",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"10",style:{paddingRight:`calc(${ut.space[5]} - ${Zc})`}},O.createElement(ae,{flexDirection:"column",gap:"2",justifyContent:"center",alignItems:"center"},O.createElement(u1,{imageUrl:c,size:32}),O.createElement(Pe,{fontWeight:"bold",fontSize:"large",color:"text100"},(a==null?void 0:a.name)||"Unknown"),O.createElement(ox,{chainId:t}),O.createElement(Pe,{fontWeight:"medium",fontSize:"normal",color:"text50"},`${(s==null?void 0:s.length)||0} Unique Collectibles`)),O.createElement(ae,{width:"full"},O.createElement(Pe,{fontWeight:"medium",fontSize:"normal",color:"text50"},`Owned (${(s==null?void 0:s.length)||0})`),O.createElement(ae,{style:{display:"grid",gridTemplateColumns:`calc(50% - ${ut.space[1]}) calc(50% - ${ut.space[1]})`,gap:ut.space[2]},width:"full",marginTop:"3"},s==null?void 0:s.map(u=>{var f,d,p;const g=u.balance,v=(u==null||(f=u.tokenMetadata)==null?void 0:f.decimals)||0,y=bf(Zn(g,v));return O.createElement(ae,{key:`${u.contractAddress}-${u.tokenID}`,onClick:()=>l(u),className:ql},O.createElement(ae,{background:"backgroundSecondary",aspectRatio:"1/1",width:"full",borderRadius:"md",justifyContent:"center",alignItems:"center",marginBottom:"2"},O.createElement(Hn,{style:{height:"100%"},src:(d=u.tokenMetadata)==null?void 0:d.image})),O.createElement(ae,null,O.createElement(Pe,{fontWeight:"bold",fontSize:"normal",color:"text100"},`${(p=u.tokenMetadata)==null?void 0:p.name}`)),O.createElement(ae,null,O.createElement(Pe,{marginTop:"1",fontWeight:"medium",fontSize:"normal",color:"text50"},y," Owned")))}))))},Ugt=()=>O.createElement(ae,{style:{paddingTop:ga}},O.createElement(ae,{flexDirection:"column",gap:"10",paddingBottom:"5",paddingLeft:"5",paddingTop:"0",style:{marginTop:"-20px",paddingRight:`calc(${ut.space[5]} - ${Zc})`}},O.createElement(ae,{gap:"3",alignItems:"center",justifyContent:"center",flexDirection:"column"},O.createElement(nn,{width:"120px",height:"30px"}),O.createElement(nn,{width:"140px",height:"40px"})),O.createElement(ae,null,O.createElement(nn,{width:"347px",height:"347px"})),O.createElement(ae,null,O.createElement(ae,null,O.createElement(Pe,{fontWeight:"medium",color:"text50",fontSize:"normal"},"Balance"),O.createElement(ae,{flexDirection:"row",alignItems:"flex-end",justifyContent:"space-between"},O.createElement(nn,{width:"44px",height:"36px"}),O.createElement(nn,{width:"34px",height:"17px"}))),O.createElement(Sr,{color:"text100",marginTop:"4",width:"full",variant:"primary",leftIcon:W8,label:"Send",onClick:()=>{}})),O.createElement(ae,null,O.createElement(Pe,{fontSize:"normal",color:"text50",fontWeight:"medium"},"This week"),O.createElement(CD,null)))),zgt=({contractAddress:t,chainId:e,tokenId:r})=>{var n,i,s,o,a,c;const{chains:l}=bn(),{address:u}=to(),{fiatCurrency:f}=ro(),{setNavigation:d}=Yc(),{data:p,isLoading:g,fetchNextPage:v,hasNextPage:y,isFetchingNextPage:b}=qde({chainId:e,accountAddress:u||"",contractAddress:t,tokenId:r}),w=Fde(p),{data:E,isLoading:C}=zde({accountAddress:u||"",collectionAddress:t,chainId:e,tokenId:r}),{data:S,isLoading:P}=Hde({tokens:[{chainId:e,contractAddress:t,tokenId:r}]}),{data:_=1,isLoading:T}=kh({toCurrency:f.symbol});if(C||P||T)return O.createElement(Ugt,null);const Z=()=>{d({location:"send-collectible",params:{chainId:e,contractAddress:t,tokenId:r}})},ne=ui(e,l),ce=E==null||(n=E.contractInfo)==null?void 0:n.logoURI,K=(E==null||(i=E.contractInfo)==null?void 0:i.name)||"Unknown Collection",x=(E==null||(s=E.tokenMetadata)==null?void 0:s.decimals)||0,A=(E==null?void 0:E.balance)||"0",B=Zn(A,x),z=bf(Number(B)),R=E?ru({balance:E,prices:S||[],conversionRate:_,decimals:x}):"0";return O.createElement(ae,{style:{paddingTop:ga}},O.createElement(ae,{flexDirection:"column",gap:"10",paddingBottom:"5",paddingLeft:"5",paddingTop:"0",style:{marginTop:"-20px",paddingRight:`calc(${ut.space[5]} - ${Zc})`}},O.createElement(ae,{gap:"3",alignItems:"center",justifyContent:"center",flexDirection:"column"},O.createElement(ae,{flexDirection:"row",gap:"2",justifyContent:"center",alignItems:"center"},O.createElement(Hn,{borderRadius:"circle",width:"8",src:ce,alt:"collection logo",style:{objectFit:"cover"}}),O.createElement(ae,{gap:"1",flexDirection:"row",justifyContent:"center",alignItems:"center"},O.createElement(Pe,{fontWeight:"bold",fontSize:"small",color:"text100"},K),O.createElement(Hn,{width:"3",src:ne.logoURI,alt:"collection logo"}))),O.createElement(ae,{flexDirection:"column",justifyContent:"center",alignItems:"center"},O.createElement(Pe,{color:"text100",fontWeight:"bold",fontSize:"large"},(E==null||(o=E.tokenMetadata)==null?void 0:o.name)||"Unknown Collectible"),O.createElement(Pe,{color:"text50",fontSize:"small",fontWeight:"medium"},`#${r}`))),O.createElement(ae,null,O.createElement(xD,{imageUrl:E==null||(a=E.tokenMetadata)==null?void 0:a.image})),O.createElement(ae,null,O.createElement(ae,null,O.createElement(Pe,{fontWeight:"medium",color:"text50",fontSize:"normal"},"Balance"),O.createElement(ae,{flexDirection:"row",alignItems:"flex-end",justifyContent:"space-between"},O.createElement(Pe,{fontWeight:"bold",color:"text100",fontSize:"xlarge"},z),S&&((c=S[0].price)==null?void 0:c.value)&&O.createElement(Pe,{fontWeight:"medium",color:"text50",fontSize:"normal"},`${f.symbol} ${R}`))),O.createElement(Sr,{color:"text100",marginTop:"4",width:"full",variant:"primary",leftIcon:W8,label:"Send",onClick:Z})),O.createElement(ae,null,O.createElement(Kde,{onLoad:()=>v(),hasMore:y},O.createElement(SD,{transactions:w,isLoading:g,isFetchingNextPage:b})))))},Hgt=["buttonVariant","text","size"],Jde=t=>{const{buttonVariant:e="icon",text:r,size:n="xs"}=t,i=U4(t,Hgt),[s,o]=$.useState(!1);$.useEffect(()=>{s&&setTimeout(()=>{o(!1)},4e3)},[s]);const a=()=>{o(!0)},c=s?"Copied!":"Copy",l=e==="icon"?"rgba(0,0,0,0)":ut.colors.buttonGlass;return O.createElement($fe.CopyToClipboard,{text:r,onCopy:a},O.createElement(af,Cs({size:n,icon:s?Nm:H8},i,{style:Cs({background:l},t==null?void 0:t.style),label:e==="with-label"?c:void 0})))},qgt=({transaction:t})=>{var e,r;const{chains:n}=bn(),{fiatCurrency:i}=ro(),s=[],o=[];(e=t.transfers)==null||e.forEach(w=>{var E,C;if(((E=w.contractInfo)==null?void 0:E.type)==="ERC721"||((C=w.contractInfo)==null?void 0:C.type)==="ERC1155"){var S;(S=w.tokenIds)==null||S.forEach(_=>{if(!o.find(Z=>{var ne;return Z.chainId===t.chainId&&kn(Z.contractAddress,((ne=w.contractInfo)==null?void 0:ne.address)||"")&&Z.tokenId===_})){var Q;o.push({chainId:t.chainId,contractAddress:((Q=w.contractInfo)==null?void 0:Q.address)||"",tokenId:_})}})}else{var P;const _=(w==null||(P=w.contractInfo)==null?void 0:P.address)||Rn;s.find(Q=>Q.chainId===t.chainId&&kn(Q.contractAddress,_))||s.push({chainId:t.chainId,contractAddress:_})}});const{data:a,isLoading:c}=B1({tokens:s}),{data:l,isLoading:u}=Hde({tokens:o}),{data:f=1,isLoading:d}=kh({toCurrency:i.symbol}),p=s.length>0&&c||o.length>0&&u||d,g=ui(t.chainId,n),v=Vfe(t.timestamp).format("ddd MMM DD YYYY, h:m:s a"),y=()=>{window.open(`${g.blockExplorerUrl}/tx/${t.txnHash}`,"_blank")},b=({transfer:w})=>{var E,C,S,P;const _=w.to,T=_.substring(0,10)+"..."+_.substring(w.to.length-4,w.to.length),Q=kn((w==null||(E=w.contractInfo)==null?void 0:E.address)||"",Rn),Z=Q?g.logoURI:w==null||(C=w.contractInfo)==null?void 0:C.logoURI,ne=Q?g.symbol:(w==null||(S=w.contractInfo)==null?void 0:S.symbol)||"";return O.createElement(O.Fragment,null,(P=w.amounts)==null?void 0:P.map((ce,K)=>{var x,A,B,z,R;const L=w.contractType==="ERC721"||w.contractType==="ERC1155",q=((x=w.tokenIds)==null?void 0:x[K])||"0",N=(w==null||(A=w.tokenMetadata)==null||(A=A[q])==null?void 0:A.decimals)||0,I=Q?g.decimals:(w==null||(B=w.contractInfo)==null?void 0:B.decimals)||0,re=Zn(ce,L?N:I),M=bf(re),G=L?l==null||(z=l.find(J=>{var X,D;return kn(J.token.contractAddress,((X=w.contractInfo)==null?void 0:X.address)||"")&&J.token.tokenId===((D=w.tokenIds)==null?void 0:D[K])&&J.token.chainId===t.chainId}))==null||(z=z.price)==null?void 0:z.value:a==null||(R=a.find(J=>{var X;return kn(J.token.contractAddress,((X=w.contractInfo)==null?void 0:X.address)||Rn)&&J.token.chainId===t.chainId}))==null||(R=R.price)==null?void 0:R.value,H=(parseFloat(re)*(f*(G||0))).toFixed(2);return O.createElement(ae,{key:K,width:"full",flexDirection:"row",gap:"2",justifyContent:"space-between",alignItems:"center"},O.createElement(ae,{flexDirection:"row",justifyContent:"flex-start",alignItems:"center",gap:"2",height:"12",borderRadius:"md",background:"buttonGlass",padding:"2",style:{flexBasis:"100%"}},O.createElement(u1,{imageUrl:Z,size:20}),O.createElement(ae,{gap:"0.5",flexDirection:"column",alignItems:"flex-start",justifyContent:"center"},O.createElement(Pe,{fontWeight:"bold",fontSize:"xsmall",color:"text100"},`${M} ${ne}`),p?O.createElement(nn,{width:"44px",height:"12px"}):O.createElement(Pe,{fontWeight:"bold",fontSize:"xsmall",color:"text50"},G?`${i.sign}${H}`:""))),O.createElement(tP,{color:"text50",style:{width:"16px"}}),O.createElement(ae,{flexDirection:"row",justifyContent:"flex-start",alignItems:"center",gap:"2",height:"12",borderRadius:"md",background:"buttonGlass",padding:"2",style:{flexBasis:"100%"}},O.createElement(lw,{address:_,style:{width:"20px"}}),O.createElement(Pe,{fontWeight:"bold",fontSize:"xsmall",color:"text100"},T)))}))};return O.createElement(ae,{padding:"5",paddingTop:"3",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"10",marginTop:"5"},O.createElement(ae,{marginTop:"6",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"1"},O.createElement(Pe,{fontSize:"normal",fontWeight:"medium"},"Transaction details"),O.createElement(Pe,{marginBottom:"1",fontSize:"small",fontWeight:"medium",color:"text50"},v),O.createElement(ox,{chainId:t.chainId})),O.createElement(ae,{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"4",width:"full",padding:"4",background:"backgroundSecondary",borderRadius:"md"},O.createElement(ae,{width:"full",gap:"1",flexDirection:"row",alignItems:"center",justifyContent:"flex-start"},O.createElement(Pe,{fontSize:"normal",fontWeight:"medium",color:"text50"},"Transfer"),O.createElement(Hn,{width:"3",src:g.logoURI,alt:"network logo"})),(r=t.transfers)==null?void 0:r.map((w,E)=>O.createElement(ae,{width:"full",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"4",key:`transfer-${E}`},O.createElement(b,{transfer:w})))),O.createElement(Sr,{onClick:y,width:"full",borderRadius:"md",rightIcon:LIe,label:`View on ${g.blockExplorerName}`}),O.createElement(ae,null,O.createElement(ae,{width:"full",flexDirection:"column",gap:"2",justifyContent:"center",alignItems:"flex-start"},O.createElement(Xb,{width:"full",margin:"0",style:{marginBottom:"-4px"}}),O.createElement(Pe,{color:"text50",fontSize:"normal",fontWeight:"medium"},"Status"),O.createElement(Pe,{fontSize:"normal",fontWeight:"medium",color:"text100"},"Complete")),O.createElement(ae,{width:"full",flexDirection:"column",gap:"2",justifyContent:"center",alignItems:"flex-start"},O.createElement(Xb,{width:"full",margin:"0",style:{marginBottom:"-4px"}}),O.createElement(Pe,{color:"text50",fontSize:"normal",fontWeight:"medium"},"Transaction Hash"),O.createElement(Pe,{color:"text100",fontSize:"normal",fontWeight:"medium",style:{overflowWrap:"anywhere"}},t.txnHash),O.createElement(Jde,{marginTop:"2",buttonVariant:"with-label",text:t.txnHash}))))},Wgt=$.forwardRef(({onClickAccount:t},e)=>{const{address:r}=to();return O.createElement(ae,{gap:"2",alignItems:"center"},O.createElement(ae,{width:"full",flexDirection:"column",alignItems:"center",justifyContent:"center"},O.createElement(ae,{onClick:t,gap:"2",alignItems:"center",justifyContent:"center",className:ql,position:"relative",ref:e},O.createElement(lw,{size:"sm",address:r||""}),O.createElement(Pe,{color:"text100",fontWeight:"medium",variant:"normal"},Dde(r||"")),O.createElement(eie,{color:"text100"}))))}),Vgt=$.forwardRef(({setOpenWalletDropdown:t},e)=>{const{setNavigation:r}=Yc(),{setOpenWalletModal:n}=sx(),{address:i}=to(),{disconnect:s}=Pfe(),{theme:o}=rx(),a=()=>{t(!1),r({location:"receive"})},c=()=>{t(!1),r({location:"history"})},l=()=>{t(!1),r({location:"settings"})},u=()=>{n(!1),t(!1),s()},f=()=>{switch(o){case"dark":return"rgba(38, 38, 38, 0.85)";case"light":return"rgba(217, 217, 217, 0.85)";default:return ut.colors.transparent}};return O.createElement(ae,{padding:"3",ref:e,zIndex:"30",borderRadius:"md",style:{position:"relative",pointerEvents:"auto",width:"370px",backdropFilter:"blur(12.5px)",top:"16px",left:"15px",background:f()}},O.createElement(ae,{flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start"},O.createElement(ae,{flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"3",marginLeft:"2",color:"text100"},O.createElement(lw,{style:{width:"28px"},size:"md",address:i||""}),O.createElement(Pe,{fontSize:"large",style:{fontWeight:"700"},color:"text100"},Dde(i||"")),O.createElement(Jde,{buttonVariant:"icon",size:"md",text:i||"",color:"text100",style:{marginLeft:"-16px"}})),O.createElement(af,{onClick:()=>t(!1),size:"xs",background:"buttonGlass",icon:w1})),O.createElement(ae,{gap:"2",marginTop:"3",flexDirection:"column"},O.createElement(Sr,{variant:"glass",style:{borderRadius:ut.radii.md},width:"full",leftIcon:HIe,label:"Receive",onClick:a}),O.createElement(Sr,{style:{borderRadius:ut.radii.md},width:"full",leftIcon:nie,label:"History",onClick:c}),O.createElement(Sr,{style:{borderRadius:ut.radii.md},width:"full",leftIcon:tie,label:"Settings",onClick:l}),O.createElement(Sr,{label:"Sign Out",style:{borderRadius:ut.radii.md},width:"full",leftIcon:rie,onClick:u})))});M1("packages/wallet/src/shared/WalletHeader/styles.css.ts","kit");const Ggt=pa({":focus-visible":{boxShadow:"none"}},"searchButton");D1();const K7=({})=>{const{openWalletModalState:t}=sx(),[e,r]=$.useState(!1),{goBack:n,history:i,setNavigation:s}=Yc(),o=$.useRef(!1);$.useEffect(()=>{t||r(!1)},[t]),$.useEffect(()=>{e?o.current?r(!1):o.current=!0:o.current=!1},[i.length,e]);const a=()=>{r(!0)},c=()=>{n()},l=()=>{s({location:"search"})};return O.createElement(ae,{as:Zb.div},O.createElement(jpt,{open:e},O.createElement(Upt,null),O.createElement(ae,{background:"backgroundPrimary",zIndex:"20",position:"fixed",flexDirection:"row",alignItems:"center",justifyContent:"space-between",width:"full",style:{height:ga,paddingTop:"6px"}},i.length>0?O.createElement(af,{onClick:c,icon:z8,style:{backgroundColor:ut.colors.backgroundPrimary,width:"44px"}}):O.createElement(af,{onClick:l,icon:q8,className:Ggt,style:{backgroundColor:ut.colors.backgroundPrimary,width:"44px"}}),O.createElement(zpt,{asChild:!0},O.createElement(Wgt,{onClickAccount:a})),O.createElement(ae,{style:{width:"44px"}})),O.createElement(L8,null,e&&O.createElement(Hpt,{asChild:!0,side:"bottom",align:"start"},O.createElement(Vgt,{setOpenWalletDropdown:r})))))},fl=({secondaryText:t,primaryText:e})=>{const{goBack:r,history:n}=Yc(),i=()=>{r()};return O.createElement(ae,{background:"backgroundPrimary",zIndex:"20",position:"fixed",width:"full",flexDirection:"row",alignItems:"center",justifyContent:"space-between",style:{height:ga,paddingTop:"6px",backgroundColor:ut.colors.backgroundPrimary}},n.length>0?O.createElement(af,{onClick:i,icon:z8,size:"sm",style:{background:"rgba(0,0,0,0)",width:"44px"}}):O.createElement(ae,null),O.createElement(ae,null,O.createElement(Pe,{fontWeight:"medium",variant:"small",color:"text50"},t),O.createElement(Pe,{fontWeight:"medium",variant:"small",color:"text100"},e)),O.createElement(ae,{style:{width:"44px"}}))},KK=t=>{const{location:e}=t;switch(e){case"send-coin":return O.createElement(Cgt,{chainId:t.params.chainId,contractAddress:t.params.contractAddress});case"send-collectible":return O.createElement(Sgt,{chainId:t.params.chainId,contractAddress:t.params.contractAddress,tokenId:t.params.tokenId});case"receive":return O.createElement(_gt,null);case"history":return O.createElement(kgt,null);case"search":return O.createElement(Igt,null);case"search-view-all":return O.createElement(Pgt,{defaultTab:t.params.defaultTab});case"settings":return O.createElement(Rgt,null);case"settings-general":return O.createElement(Tgt,null);case"settings-currency":return O.createElement(Ngt,null);case"settings-networks":return O.createElement(Mgt,null);case"coin-details":return O.createElement(Bgt,{contractAddress:t.params.contractAddress,chainId:t.params.chainId});case"collectible-details":return O.createElement(zgt,{contractAddress:t.params.contractAddress,chainId:t.params.chainId,tokenId:t.params.tokenId});case"collection-details":return O.createElement(jgt,{contractAddress:t.params.contractAddress,chainId:t.params.chainId});case"transaction-details":return O.createElement(qgt,{transaction:t.params.transaction});case"home":default:return O.createElement(Egt,null)}},Kgt=t=>{const{location:e}=t;switch(e){case"search":return O.createElement(fl,{primaryText:"Search wallet"});case"search-view-all":return O.createElement(fl,{secondaryText:"Search wallet / ",primaryText:"View all"});case"settings":return O.createElement(fl,{secondaryText:"Wallet / ",primaryText:"Settings"});case"settings-general":return O.createElement(fl,{secondaryText:"Wallet / Settings / ",primaryText:"General"});case"settings-currency":return O.createElement(fl,{secondaryText:"Wallet / Settings / ",primaryText:"Currency"});case"settings-networks":return O.createElement(fl,{secondaryText:"Wallet / Settings / ",primaryText:"Networks"});case"receive":return O.createElement(fl,{secondaryText:"Wallet / ",primaryText:"Receive"});case"history":return O.createElement(fl,{secondaryText:"Wallet / ",primaryText:"History"});case"coin-details":return O.createElement(K7,null);case"collectible-details":return O.createElement(K7,null);case"transaction-details":return O.createElement(fl,{secondaryText:"",primaryText:""});case"send-collectible":case"send-coin":return O.createElement(fl,{secondaryText:"Wallet /",primaryText:"Send"});case"home":default:return O.createElement(K7,null)}},Jgt={location:"home"},Qgt=t=>{const e=new PN;return O.createElement(nD,{client:e},O.createElement(Ygt,t))},Ygt=({children:t})=>{const{theme:e,position:r}=rx(),[n,i]=$.useState(!1),[s,o]=$.useState([]),a=s.length>0?s[s.length-1]:Jgt,c=a.location==="home"||a.location==="collection-details"||a.location==="collectible-details"||a.location==="coin-details"||a.location==="history"||a.location==="search"||a.location==="search-view-all"||a.location==="settings-currency";return $.useEffect(()=>{n&&o([])},[n]),O.createElement(Wpt,{value:{setOpenWalletModal:i,openWalletModalState:n}},O.createElement(fgt,{value:{setHistory:o,history:s}},O.createElement("div",{id:"kit-wallet"},O.createElement(Z8,{root:"#kit-wallet",scope:"kit",theme:e},O.createElement(L8,null,n&&O.createElement(V$,{contentProps:{style:Cs({maxWidth:"400px",height:"fit-content"},tD(r))},scroll:!1,backdropColor:"backgroundBackdrop",onClose:()=>i(!1)},O.createElement(ae,{className:_D,id:"sequence-kit-wallet-content"},Kgt(a),c?O.createElement(Xie,{className:ED,style:{paddingTop:ga,height:"min(800px, 80vh)"}},KK(a)):KK(a)))))),t))};var Zgt=()=>typeof window<"u"&&window.localStorage.getItem("IS_PAPER_DEV")==="true",Xgt=()=>typeof window<"u"&&window.location.origin.includes("paper.xyz"),Qde=()=>{var t;return Zgt()?(t=window.localStorage.getItem("PAPER_DEV_URL"))!=null?t:"http://localhost:3000":Xgt()?window.location.origin:"https://withpaper.com"},Yde={colorPrimary:"#cf3781",colorBackground:"#ffffff",colorText:"#1a202c",borderRadius:12,fontFamily:"Open Sans"},emt=Object.defineProperty,tmt=Object.defineProperties,rmt=Object.getOwnPropertyDescriptors,JK=Object.getOwnPropertySymbols,nmt=Object.prototype.hasOwnProperty,imt=Object.prototype.propertyIsEnumerable,QK=(t,e,r)=>e in t?emt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,mo=(t,e)=>{for(var r in e||(e={}))nmt.call(e,r)&&QK(t,r,e[r]);if(JK)for(var r of JK(e))imt.call(e,r)&&QK(t,r,e[r]);return t},YK=(t,e)=>tmt(t,rmt(e)),smt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Zde=smt((t,e)=>{e.exports={name:"@paperxyz/js-client-sdk",description:"Paper JS SDK for Checkout Elements",version:"0.2.5",license:"Apache-2.0",main:"dist/index.js",module:"dist/index.mjs",types:"dist/index.d.ts",files:["dist/**"],bugs:{url:"https://github.com/paperxyz/js-sdk/issues"},homepage:"https://github.com/paperxyz/js-sdk",repository:{type:"git",url:"git+https://github.com/paperxyz/js-sdk.git"},author:"Paper ",scripts:{build:"tsup src/index.ts --env.NODE_ENV production","build-package-checkout":"yarn build","dev-checkout":"tsup src/index.ts --env.NODE_ENV development --watch",lint:'eslint "src/**/*.ts*"',"lint:fix":"yarn lint --fix",clean:"rm -rf .turbo && rm -rf node_modules && rm -rf dist",prepare:"cd ../../ && node ./scripts/postInstall && cd ./packages/js-client-sdk"},keywords:[],devDependencies:{"@paperxyz/tsconfig":"*","eslint-config-paperxyz":"*",typescript:"^4.7.4"},dependencies:{"@paperxyz/sdk-common-utilities":"*",ethers:"^5.7.2"},publishConfig:{access:"public"}}}),Xde=Qde(),omt="/sdk/2022-08-12/checkout-with-card",amt=(t=>(t.UserAbandonedCheckout="User abandoned the checkout",t.UserLoginFailed="User login failed",t.InvalidProps="The props you passed in to this component are not valid.",t.InvalidCard="The card information is invalid. Please double check that the Card, CVC, and Zip code are all correct.",t.EmailNotVerified="The email was unable to be verified.",t.NotEnoughSupply="There is not enough supply to claim.",t.AddressNotAllowed="This address is not on the allowlist.",t.NoActiveClaimPhase="There is no active claim phase at the moment.",t))(amt||{}),cmt=(t=>(t.ErrorConnectingToWallet="Error connecting to wallet",t.ErrorSendingTransaction="Something went wrong sending transaction",t.InsufficientBalance="Insufficient ETH",t.TransactionCancelled="Transaction Cancelled",t.WrongChain="Wrong Chain Detected",t.ChainSwitchUnderway="There is a network switch already underway",t.PendingSignature="Pending Signature",t))(cmt||{}),lmt=class{constructor(t){this.link=t}addStylingOptions(t){t.colorPrimary&&this.link.searchParams.set("colorPrimary",t.colorPrimary),t.colorBackground&&this.link.searchParams.set("colorBackground",t.colorBackground),t.colorText&&this.link.searchParams.set("colorText",t.colorText),t.borderRadius!==void 0&&this.link.searchParams.set("borderRadius",t.borderRadius.toString()),t.fontFamily&&this.link.searchParams.set("fontFamily",t.fontFamily),t.inputBackgroundColor&&this.link.searchParams.set("inputBackgroundColor",t.inputBackgroundColor),t.inputBorderColor&&this.link.searchParams.set("inputBorderColor",t.inputBorderColor)}addClientSecret(t){this.link.searchParams.set("sdkClientSecret",t)}addLocale(t){t&&this.link.searchParams.set("locale",t.toString())}addOTP(){this.link.searchParams.set("withOTP","true")}addAppName(t){t&&this.link.searchParams.set("appName",t)}addShowConnectWalletOptions(t){this.link.searchParams.append("showConnectWalletOptions",t.toString())}addReceivingWalletType(t){this.link.searchParams.append("walletType",t||"Preset")}addRecipientWalletAddress(t){this.link.searchParams.set("recipientWalletAddress",t)}addPayerWalletAddress(t){this.link.searchParams.append("payerWalletAddress",t)}addDate(t){this.link.searchParams.set("date",t?t.toString():Date.now().toString())}getLink(){return this.link}},umt=({url:t,width:e=440,height:r=700})=>{if(!(window!=null&&window.top))return null;let n=window.top.outerHeight/2+window.top.screenY-r/2,i=window.top.outerWidth/2+window.top.screenX-e/2;return window.open(t,"_blank",`popup=true,width=${e},height=${r},top=${n},left=${i}`)};function ZK(t,e,r){var n;(n=t.contentWindow)==null||n.postMessage(mo({eventType:e},r),"*")}var fmt=Zde(),dmt=class{constructor({elementOrId:e,onLoad:r}){this.elementOrId=e,this.onLoad=r}createPaymentElement({handler:e,link:r,iframeId:n}){let i=document.createElement("iframe");if(i.src=r.href,i.id=n,i.allow="payment",i.setAttribute("style","margin-left:auto; margin-right:auto; width:100%; height: 100%; min-height:375px; transition-property:all; transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1); transition-duration:150ms; color-scheme: light;"),i.onload=a=>{this.onLoad&&this.onLoad(a)},i.setAttribute("data-paper-sdk-version",`@paperxyz/js-client-sdk@${fmt.version}`),!this.elementOrId)return window.addEventListener("message",e(i)),i;let s=this.elementOrId;if(typeof s=="string"){let a=document.getElementById(s);if(!a)throw new Error("Invalid id given");s=a}let o=s.querySelector("#"+n);return o?(o.src===r.href||(o.src=r.href),o):(window.addEventListener("message",e(i)),s.appendChild(i))}},XK={top:"0px",left:"0px",right:"0px",bottom:"0px"},hmt=()=>({main:YK(mo({},XK),{position:"fixed",zIndex:"10000",display:"flex",alignItems:"center",justifyContent:"center"}),overlay:YK(mo({},XK),{position:"absolute",backgroundColor:"rgba(0, 0, 0, 0.33)"}),body:{background:"transparent",borderRadius:"12px",position:"relative",overflow:"hidden",width:"100%",maxWidth:"500px",height:"700px",maxHeight:"80%",animation:"pew-modal-slideIn 0.2s forwards"},spinner:{position:"absolute",top:"0",bottom:"0",left:"0",right:"0",margin:"auto",borderWidth:"3px",borderColor:"#2D3748 #2D3748 transparent transparent",borderRadius:"50%",width:"30px",height:"30px",animation:"spin 1s linear infinite"},iframe:{position:"relative",height:"100%",width:"100%",border:"none",background:"transparent"}}),pmt=` + @keyframes pew-modal-slideIn { + from {opacity: 0; transform: translate3d(0, 20px, 0);} + to {opacity: 1; transform: translate3d(0, 0, 0);} + } + + @keyframes pew-modal-slideOut { + from {opacity: 1; transform: translate3d(0, 0, 0);} + to {opacity: 0; transform: translate3d(0, 20px, 0);} + } + + @keyframes spin { + to { transform: rotate(360deg); } + } +`,wy="paper-js-sdk-modal",gmt=class{constructor(t,e){this.styles=hmt(),this.container=t||document.body,e&&this.mergeStyles(e),this.main=document.createElement("div"),this.main.id=wy,this.overlay=document.createElement("div"),this.overlay.id=`${wy}-overlay`,this.body=document.createElement("div"),this.body.id=`${wy}-body`,this.spinner=document.createElement("div"),this.spinner.id=`${wy}-spinner`,this.iframe=document.createElement("iframe"),this.iframe.id=`${wy}-iframe`,this.iframe.allow="camera; microphone; payment",this.style=document.createElement("style"),this.style.innerHTML=pmt,this.assignStyles(this.main,this.styles.main),this.assignStyles(this.overlay,this.styles.overlay),this.assignStyles(this.body,this.styles.body),this.assignStyles(this.spinner,this.styles.spinner),this.assignStyles(this.iframe,this.styles.iframe)}open({iframeUrl:t}={}){t&&(this.body.appendChild(this.spinner),this.iframe.src=t,this.iframe.onload=()=>this.body.removeChild(this.spinner),this.body.appendChild(this.iframe)),this.addAccessibility(),this.main.appendChild(this.overlay),this.main.appendChild(this.style),this.main.appendChild(this.body),this.container.appendChild(this.main),document.body.style.overflow="hidden"}close(){this.body.style.animation="pew-modal-slideOut 0.2s forwards",window.setTimeout(()=>this.main.remove(),250)}mergeStyles(t){this.styles.body=mo(mo({},this.styles.body),t.body||{}),this.styles.spinner=mo(mo({},this.styles.spinner),t.spinner||{}),this.styles.overlay=mo(mo({},this.styles.overlay),t.overlay||{}),this.styles.main=mo(mo({},this.styles.main),t.main||{}),this.styles.iframe=mo(mo({},this.styles.iframe),t.iframe||{})}addAccessibility(){this.main.setAttribute("aria-hidden","true"),this.overlay.setAttribute("aria-hidden","true"),this.body.setAttribute("aria-modal","true"),this.body.setAttribute("role","dialog")}assignStyles(t,e){Object.assign(t.style,e)}};function mmt({sdkClientSecret:t,appName:e,options:r=mo({},Yde),locale:n,configs:i}){let s=new URL(omt,Xde),o=t;if(!o&&i&&(o=btoa(JSON.stringify(i))),!o){let c="/error?errorMessage=Must have either sdkClientSecret or configs field set. Received neither",l=Qde();return new URL(c,l)}let a=new lmt(s);return a.addClientSecret(o??""),a.addStylingOptions(r),a.addLocale(n),a.addAppName(e),a.getLink()}function vmt({iframe:t,onError:e,onReview:r,onPaymentSuccess:n,onBeforeModalOpen:i,onPriceUpdate:s}){let o;return a=>{if(!a.origin.startsWith(Xde))return;let{data:c}=a;switch(c.eventType){case"checkoutWithCardError":e&&e({code:c.code,error:c.error});break;case"paymentSuccess":n&&n({transactionId:c.id,id:c.id}),c.postToIframe&&ZK(t,c.eventType,c);break;case"reviewComplete":r&&r({id:c.id,cardholderName:c.cardholderName});break;case"openModalWithUrl":i&&c.url&&c.url.includes("promptKYCModal")?i({url:c.url}):(o=new gmt(void 0,{body:{colorScheme:"light"}}),o.open({iframeUrl:c.url}));break;case"completedSDKModal":o.close(),c.postToIframe&&ZK(t,c.eventType,c);break;case"requestedPopup":{umt({url:c.url,width:c.width,height:c.height})||console.error("CheckoutWithCard: Unable to open popup.");break}case"sizing":t.style.height=c.height+"px",t.style.maxHeight=c.height+"px";break;case"onPriceUpdate":{s==null||s(c);break}}}}function ymt({onCloseKycModal:t,onOpenKycModal:e,sdkClientSecret:r,appName:n,elementOrId:i,onLoad:s,onError:o,locale:a,options:c,onPaymentSuccess:l,onReview:u,onBeforeModalOpen:f,onPriceUpdate:d,useAltDomain:p=!0,configs:g}){let v="checkout-with-card-iframe",y=w=>vmt({iframe:w,onCloseKycModal:t,onOpenKycModal:e,onError:o,onPaymentSuccess:l,onReview:u,onBeforeModalOpen:f,onPriceUpdate:d,useAltDomain:p}),b=mmt({sdkClientSecret:r,appName:n,locale:a,options:c,useAltDomain:p,configs:g});return new dmt({onLoad:s,elementOrId:i}).createPaymentElement({handler:y,iframeId:v,link:b})}Zde();function bmt(t){if(t.sheet)return t.sheet;for(var e=0;e0?Ji(fv,--$o):0,bm--,ci===10&&(bm=1,H4--),ci}function sa(){return ci=$o2||L2(ci)>3?"":" "}function Omt(t,e){for(;--e&&sa()&&!(ci<48||ci>102||ci>57&&ci<65||ci>70&&ci<97););return ax(t,OE()+(e<6&&Wl()==32&&sa()==32))}function KR(t){for(;sa();)switch(ci){case t:return $o;case 34:case 39:t!==34&&t!==39&&KR(ci);break;case 40:t===41&&KR(t);break;case 92:sa();break}return $o}function $mt(t,e){for(;sa()&&t+ci!==47+10;)if(t+ci===42+42&&Wl()===47)break;return"/*"+ax(e,$o-1)+"*"+z4(t===47?t:sa())}function Nmt(t){for(;!L2(Wl());)sa();return ax(t,$o)}function Mmt(t){return she(NE("",null,null,null,[""],t=ihe(t),0,[0],t))}function NE(t,e,r,n,i,s,o,a,c){for(var l=0,u=0,f=o,d=0,p=0,g=0,v=1,y=1,b=1,w=0,E="",C=i,S=s,P=n,_=E;y;)switch(g=w,w=sa()){case 40:if(g!=108&&Ji(_,f-1)==58){GR(_+=Nr($E(w),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:_+=$E(w);break;case 9:case 10:case 13:case 32:_+=Tmt(g);break;case 92:_+=Omt(OE()-1,7);continue;case 47:switch(Wl()){case 42:case 47:$3(Dmt($mt(sa(),OE()),e,r),c);break;default:_+="/"}break;case 123*v:a[l++]=xl(_)*b;case 125*v:case 59:case 0:switch(w){case 0:case 125:y=0;case 59+u:b==-1&&(_=Nr(_,/\f/g,"")),p>0&&xl(_)-f&&$3(p>32?tJ(_+";",n,r,f-1):tJ(Nr(_," ","")+";",n,r,f-2),c);break;case 59:_+=";";default:if($3(P=eJ(_,e,r,l,u,i,a,E,C=[],S=[],f),s),w===123)if(u===0)NE(_,e,P,P,C,s,f,a,S);else switch(d===99&&Ji(_,3)===110?100:d){case 100:case 108:case 109:case 115:NE(t,P,P,n&&$3(eJ(t,P,P,0,0,i,a,E,i,C=[],f),S),i,S,f,a,n?C:S);break;default:NE(_,P,P,P,[""],S,0,a,S)}}l=u=p=0,v=b=1,E=_="",f=o;break;case 58:f=1+xl(_),p=g;default:if(v<1){if(w==123)--v;else if(w==125&&v++==0&&Rmt()==125)continue}switch(_+=z4(w),w*v){case 38:b=u>0?1:(_+="\f",-1);break;case 44:a[l++]=(xl(_)-1)*b,b=1;break;case 64:Wl()===45&&(_+=$E(sa())),d=Wl(),u=f=xl(E=_+=Nmt(OE())),w++;break;case 45:g===45&&xl(_)==2&&(v=0)}}return s}function eJ(t,e,r,n,i,s,o,a,c,l,u){for(var f=i-1,d=i===0?s:[""],p=ID(d),g=0,v=0,y=0;g0?d[b]+" "+w:Nr(w,/&\f/g,d[b])))&&(c[y++]=E);return q4(t,e,r,i===0?AD:a,c,l,u)}function Dmt(t,e,r){return q4(t,e,r,ehe,z4(Pmt()),D2(t,2,-2),0)}function tJ(t,e,r,n){return q4(t,e,r,kD,D2(t,0,n),D2(t,n+1,-1),n)}function Og(t,e){for(var r="",n=ID(t),i=0;i6)switch(Ji(t,e+1)){case 109:if(Ji(t,e+4)!==45)break;case 102:return Nr(t,/(.+:)(.+)-([^]+)/,"$1"+$r+"$2-$3$1"+U_+(Ji(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~GR(t,"stretch")?ohe(Nr(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(Ji(t,e+1)!==115)break;case 6444:switch(Ji(t,xl(t)-3-(~GR(t,"!important")&&10))){case 107:return Nr(t,":",":"+$r)+t;case 101:return Nr(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+$r+(Ji(t,14)===45?"inline-":"")+"box$3$1"+$r+"$2$3$1"+bs+"$2box$3")+t}break;case 5936:switch(Ji(t,e+11)){case 114:return $r+t+bs+Nr(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return $r+t+bs+Nr(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return $r+t+bs+Nr(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return $r+t+bs+t+t}return t}var Vmt=function(e,r,n,i){if(e.length>-1&&!e.return)switch(e.type){case kD:e.return=ohe(e.value,e.length);break;case the:return Og([xy(e,{value:Nr(e.value,"@","@"+$r)})],i);case AD:if(e.length)return Imt(e.props,function(s){switch(kmt(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Og([xy(e,{props:[Nr(s,/:(read-\w+)/,":"+U_+"$1")]})],i);case"::placeholder":return Og([xy(e,{props:[Nr(s,/:(plac\w+)/,":"+$r+"input-$1")]}),xy(e,{props:[Nr(s,/:(plac\w+)/,":"+U_+"$1")]}),xy(e,{props:[Nr(s,/:(plac\w+)/,bs+"input-$1")]})],i)}return""})}},Gmt=[Vmt],Kmt=function(e){var r=e.key;if(r==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(v){var y=v.getAttribute("data-emotion");y.indexOf(" ")!==-1&&(document.head.appendChild(v),v.setAttribute("data-s",""))})}var i=e.stylisPlugins||Gmt,s={},o,a=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(v){for(var y=v.getAttribute("data-emotion").split(" "),b=1;be in t?ovt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,lvt=(t,e)=>{for(var r in e||(e={}))avt.call(e,r)&&lJ(t,r,e[r]);if(cJ)for(var r of cJ(e))cvt.call(e,r)&&lJ(t,r,e[r]);return t},uvt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),RD=uvt((t,e)=>{e.exports={name:"@paperxyz/react-client-sdk",version:"1.1.3",description:"Paper React Client SDK for Checkout Elements",license:"Apache-2.0",main:"dist/index.js",types:"./dist/index.d.ts",type:"module",files:["dist/**"],exports:{".":{import:"./dist/index.js",types:"./dist/index.d.ts"}},bugs:{url:"https://github.com/paperxyz/js-sdk/issues"},homepage:"https://github.com/paperxyz/js-sdk",repository:{type:"git",url:"git+https://github.com/paperxyz/js-sdk.git"},author:"Paper ",keywords:[],scripts:{build:"tsup-node src/index.ts --env.NODE_ENV production --env.ESM_ONLY true ","build-package-checkout":"yarn build","dev-checkout":"tsup-node src/index.ts --env.NODE_ENV development --watch --env.ESM_ONLY true",lint:'eslint "src/**/*.ts*"',"lint:fix":"yarn lint --fix",clean:"rm -rf .turbo && rm -rf node_modules && rm -rf dist",prepare:"cd ../../ && node ./scripts/postInstall && cd ./packages/react-client-sdk"},peerDependencies:{react:">=16.0.0","react-dom":">=16.0.0"},devDependencies:{"@paperxyz/tsconfig":"*","@types/react":"18.0.26","eslint-config-paperxyz":"*",react:"^18.2.0","react-dom":"^18.2.0",typescript:"^4.7.4"},dependencies:{"@emotion/css":"11.10.5","@headlessui/react":"1.7.6","@paperxyz/js-client-sdk":"*","@paperxyz/sdk-common-utilities":"*"}}}),fvt=$.createContext({chainName:"Polygon",setChainName:()=>{},clientId:"",appName:""}),dvt=()=>$.useContext(fvt);Xc` + opacity: 0; +`;Xc` + opacity: 1; +`;var hvt=Xc` + position: relative; + width: 100%; + height: 100%; +`;Xc` + display: grid; + position: relative; + width: 100%; +`;Xc` + transition-delay: 150ms; + transition-property: opacity; + transition-duration: 75ms; +`;Xc` + transition-property: opacity; + transition-duration: 150ms; +`;Xc` + background-color: transparent; + grid-column-start: 1; + grid-row-start: 1; +`;var pvt=({className:t})=>ct("div",{id:"loader",className:ivt(mvt,t)}),gvt=svt` + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +`,mvt=Xc` + border: 0.15rem solid #f3f3f300; + border-top: 0.15rem solid #000000; + border-left: 0.15rem solid #000000; + border-radius: 50%; + width: 4rem; + height: 4rem; + animation: ${gvt} 1s linear infinite; +`,vvt=()=>ct("div",{className:yvt,children:ct(pvt,{className:bvt})}),yvt=Xc` + position: absolute; + top: 50%; + left: 50%; + transform: translate3d(-50%, -50%, 0); +`,bvt=Xc` + color: #000000; + width: 2rem; + height: 2rem; +`,wvt=RD(),xvt=({sdkClientSecret:t,appName:e,options:r=lvt({},Yde),onPaymentSuccess:n,onReview:i,onError:s,onBeforeModalOpen:o,onPriceUpdate:a,locale:c,configs:l})=>{let{appName:u}=dvt(),[f,d]=$.useState(!0),p=$.useCallback(()=>{d(!1)},[]),g=$.useRef(null),v=e||u;return $.useEffect(()=>{let y=setTimeout(()=>{d(!1)},1e3);return()=>{clearTimeout(y)}},[]),$.useEffect(()=>{g.current&&ymt({sdkClientSecret:t,appName:v,elementOrId:g.current,locale:c,onError:s,onLoad:p,onPaymentSuccess:n,onReview:i,onBeforeModalOpen:o,onPriceUpdate:a,options:r,configs:l})},[g.current]),ct(hye,{children:ct("div",{className:hvt,ref:g,"data-paper-sdk-version":`@paperxyz/react-client-sdk@${wvt.version}`,children:f&&ct(vvt,{})})})};Xc` + padding-top: 0.625rem; + padding-bottom: 0.625rem; + padding-left: 1.25rem; + padding-right: 1.25rem; + background-color: #1f2937; + color: #ffffff; + font-size: 0.875rem; + line-height: 1.25rem; + font-weight: 600; + justify-content: flex-start; + align-items: center; + border-radius: 0.5rem; + border: none; + cursor: pointer; +`;RD();RD();var Evt=(t=>(t.THIRDWEB_NFT_DROP_V2="THIRDWEB_NFT_DROP_V2",t.THIRDWEB_EDITION_DROP_V2="THIRDWEB_EDITION_DROP_V2",t.THIRDWEB_SIGNATURE="THIRDWEB_SIGNATURE",t.CANDY_MACHINE="CANDY_MACHINE",t.AUCTION_HOUSE="AUCTION_HOUSE",t))(Evt||{}),_vt=(t=>(t.POPUP="POPUP",t.NEW_TAB="NEW_TAB",t.MODAL="MODAL",t.DRAWER="DRAWER",t.EMBED="EMBED",t))(_vt||{});const[Cvt,Svt]=Sh(),cx=()=>{const{triggerCheckout:t,closeCheckout:e,settings:r}=Cvt();return{triggerCheckout:t,closeCheckout:e,settings:r}};function f1(){return f1=Object.assign?Object.assign.bind():function(t){for(var e=1;et.toLowerCase()===e.toLowerCase();var rd=function(t){return t[t.VERY_LARGE=0]="VERY_LARGE",t[t.FRACTION=1]="FRACTION",t[t.VERY_TINY=2]="VERY_TINY",t[t.MIXED=3]="MIXED",t}(rd||{});const JR=t=>{if(isNaN(Number(t)))return console.error(`display format error ${t} is not a number`),"NaN";const e=Number(t);if(e===0)return"0";let r;e>1e8?r=rd.VERY_LARGE:e<1e-10?r=rd.VERY_TINY:e<1?r=rd.FRACTION:r=rd.MIXED;let n,i;switch(r){case rd.VERY_LARGE:n="compact",i={maximumFractionDigits:4};break;case rd.VERY_TINY:n="scientific",i={maximumFractionDigits:4};break;case rd.FRACTION:n="standard",i={maximumSignificantDigits:4};break;default:n="standard",i={maximumFractionDigits:2}}return Intl.NumberFormat("en-US",f1({notation:n},i)).format(e)},Avt=t=>t.charAt(0).toUpperCase()+t.slice(1),kvt=t=>t.chainId===1?"Ethereum":Avt(t.name),Ivt=async({accountAddress:t,chainId:e})=>{try{const{indexerClient:r}=await as(e),n=await r.getEtherBalance({accountAddress:t});return[{chainId:e,contractAddress:Rn,accountAddress:t,balance:(n==null?void 0:n.balance.balanceWei)||"0",contractType:HO.UNKNOWN,blockHash:"",blockNumber:0,tokenID:""}]}catch(r){return console.error(r),[]}},Pvt=async({accountAddress:t,chainId:e})=>{try{const{indexerClient:r}=await as(e),n=await r.getTokenBalances({accountAddress:t,includeMetadata:!0});return(n==null?void 0:n.balances)||[]}catch(r){return console.error(r),[]}},Rvt=async({accountAddress:t,chainId:e})=>{try{return(await Promise.all([Ivt({accountAddress:t,chainId:e}),Pvt({accountAddress:t,chainId:e})])).flat()}catch(r){return console.error(r),[]}},Tvt=async({chainId:t,tokenId:e,contractAddress:r})=>{const{metadataClient:n}=await as(t);return(await n.getTokenMetadata({chainID:String(t),contractAddress:r,tokenIDs:[e]})).tokenMetadata[0]},Ovt=async({chainID:t,contractAddress:e})=>{const{metadataClient:r}=await as(t);return(await r.getContractInfo({chainID:t,contractAddress:e})).contractInfo},$vt=async({chainId:t,email:e,contractAddress:r,abi:n,receiptTitle:i,collectionContractAddress:s,methodArguments:o,currency:a,currencyAmount:c,methodName:l,recipientAddress:u})=>{const{network:f,apiClient:d}=await as(t),p=kvt(f),g=JSON.stringify(f1({title:i,email:e,limitPerTransaction:1,quantity:1,mintMethod:{args:o,payment:{currency:a,value:`${c} * $QUANTITY`},name:l},walletAddress:u},s?{contractArgs:{collectionContractAddress:s}}:{})),{secret:v}=await d.paperSessionSecret2({chainName:p,contractAddress:r,abi:n,paramsJson:g});return v},TD={oneSecond:1*1e3,oneMinute:60*1e3,oneHour:60*60*1e3},Nvt=t=>eo({queryKey:["balances",t],queryFn:()=>Rvt(t),retry:!0,staleTime:10*TD.oneMinute,enabled:!!t.chainId&&!!t.accountAddress}),Mvt=t=>eo({queryKey:["useTokenMetadata",t],queryFn:()=>Tvt(t),retry:!0,staleTime:10*TD.oneMinute,enabled:!!t.chainId&&!!t.contractAddress}),lhe=t=>eo({queryKey:["useContractInfo",t],queryFn:()=>Ovt(t),retry:!0,staleTime:60*TD.oneMinute,enabled:!!t.chainID&&!!t.contractAddress}),[Dvt,Lvt]=Sh(),Bvt=({settings:t})=>{var e,r;const[n,i]=$.useState(!0),[s,o]=$.useState(((e=t.creditCardCheckout)==null?void 0:e.email)||""),[a,c]=$.useState(s),[l,u]=$.useState(null),[f,d]=$.useState(!1),{setNavigation:p}=dv(),g=()=>{n&&o(a||""),n||c(s),i(!n)},v=async()=>{d(!0);try{if(!s)throw"No email address found";if(!t.creditCardCheckout)throw"No credit card checkout settings found";const S=await $vt(f1({email:s},t.creditCardCheckout));u(S)}catch(S){console.error("Failed to fetch paper secret",S),p({location:"transaction-error",params:{error:S}})}d(!1)};$.useEffect(()=>{const S=setInterval(()=>{const P=document.getElementById("paper-js-sdk-modal");P&&(P.style.pointerEvents="visible")},100);return()=>{clearInterval(S)}},[]),$.useEffect(()=>{s!==""&&v()},[s]);const y=()=>/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/.test(a||""),b=S=>{c(S.target.value)},w=S=>{p({location:"transaction-pending",params:{transactionId:S}})},E=S=>{p({location:"transaction-error",params:{error:S}})},C=()=>n?O.createElement(ae,{as:"form",flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start",onSubmit:g},O.createElement(ae,{flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"2"},O.createElement(Pe,{fontSize:"normal",fontWeight:"normal",color:"text50"},"Receipt email address"),O.createElement(yh,{autoFocus:!0,name:"email",type:"email",placeholder:"Email Address",value:a,onChange:b,"data-1p-ignore":!0})),O.createElement(Sr,{size:"xs",label:"Save",leftIcon:Nm,disabled:!y(),type:"submit"})):O.createElement(ae,{flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start"},O.createElement(ae,{flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"2"},O.createElement(Pe,{fontSize:"normal",fontWeight:"normal",color:"text50"},"Receipt email address"),O.createElement(Pe,{fontSize:"normal",fontWeight:"bold",color:"text100"},s)),O.createElement(Sr,{size:"xs",label:"Edit",leftIcon:MIe,onClick:g}));return O.createElement(ae,null,C(),f&&O.createElement(ae,{width:"full",height:"full",flexDirection:"column",alignItems:"center",justifyContent:"center",style:{height:"200px"}},O.createElement(J$,{size:"lg",style:{width:"60px",height:"60px"}})),l&&!f&&O.createElement(Yl,{marginY:"4",flexDirection:"column"},O.createElement(xvt,{sdkClientSecret:l,appName:t==null||(r=t.creditCardCheckout)==null?void 0:r.receiptTitle,onReview:()=>{},onPaymentSuccess:S=>{w(S.id)},onError:S=>{console.error("Payment error:",S),E(S.error)},options:{colorPrimary:"#447dd1",colorText:"#ffffff",borderRadius:12}})))},OD="54px",Fvt=()=>{const{settings:t}=cx();return O.createElement(ae,{paddingX:"4",paddingBottom:"8",gap:"4",flexDirection:"column",style:{marginTop:OD}},t&&O.createElement(Bvt,{settings:t}))},jvt=10*1e3,Uvt=()=>{const t=dv(),{params:{transactionId:e}}=t.navigation,{setNavigation:r}=t,n=`https://withpaper.com/api/v1/transaction-status/${e}`,i=async()=>{try{console.log("Polling for transaction status");const s=await fetch(n,{method:"GET",headers:{accept:"application/json"}}).then(c=>c.json()),o=s.result.status,a=s.result.transactionHash;if(console.log("transaction status poll response:",o),o==="PENDING")return;if(o==="TRANSFER_SUCCEEDED"){r&&r({location:"transaction-success",params:{transactionHash:a}});return}if(o==="TRANSFER_FAILED"||o==="PAYMENT_FAILED"){r&&r({location:"transaction-error",params:{error:new Error("Failed to transfer collectible")}});return}}catch(s){console.error("An error occurred while fetching the transaction status"),r&&r({location:"transaction-error",params:{error:s}})}};return $.useEffect(()=>{const s=setInterval(()=>{i()},jvt);return()=>{clearInterval(s)}},[]),O.createElement(ae,{style:{height:"500px"}},O.createElement(ae,{position:"absolute",top:"0",left:"0",width:"full",height:"full",flexDirection:"column",alignItems:"center",justifyContent:"center"},O.createElement(J$,{size:"lg",style:{width:"60px",height:"60px"}}),O.createElement(Pe,{variant:"medium",color:"text50",textAlign:"center",marginTop:"8"},"Transaction in progress. ",O.createElement("br",null),"This may take a few minutes.")))},zvt=()=>{const{closeCheckout:t,settings:e}=cx(),n=dv().navigation;return $.useEffect(()=>{setTimeout(()=>{var i,s;t(),!(e==null||(i=e.creditCardCheckout)==null)&&i.onSuccess&&(e==null||(s=e.creditCardCheckout)==null||s.onSuccess(n.params.transactionHash))},3e3)},[]),O.createElement(ae,{style:{height:"500px"}},O.createElement(ae,{flexDirection:"column",alignItems:"center",position:"absolute",style:{top:"50%",right:"50%",transform:"translate(50%, -50%)"}},O.createElement(Hvt,null),O.createElement(Pe,{fontSize:"xlarge"},"Success!"),O.createElement(Pe,{textAlign:"center",variant:"normal",color:"text80"},"The transaction was successful.")))},Hvt=()=>O.createElement(ae,{color:"white",background:"positive",alignItems:"center",justifyContent:"center",width:"16",height:"16",borderRadius:"circle",marginBottom:"2"},O.createElement(Nm,{size:"xl"})),qvt=()=>{const{closeCheckout:t,settings:e}=cx(),n=dv().navigation;return $.useEffect(()=>{setTimeout(()=>{var i,s;t(),!(e==null||(i=e.creditCardCheckout)==null)&&i.onError&&(e==null||(s=e.creditCardCheckout)==null||s.onError(n.params.error))},3e3)},[]),O.createElement(ae,{style:{height:"500px"}},O.createElement(ae,{flexDirection:"column",alignItems:"center",position:"absolute",style:{top:"50%",right:"50%",transform:"translate(50%, -50%)"}},O.createElement(Wvt,null),O.createElement(Pe,{fontSize:"xlarge"},"Error"),O.createElement(Pe,{textAlign:"center",variant:"normal",color:"text80"},"An error occurred while processing the transaction.")))},Wvt=()=>O.createElement(ae,{color:"white",alignItems:"center",justifyContent:"center",width:"16",height:"16",borderRadius:"circle",marginBottom:"2",background:"negative"},O.createElement(w1,{size:"xl"})),Vvt=({size:t=30})=>O.createElement(ae,{alignItems:"center",justifyContent:"center",borderRadius:"circle",background:"backgroundInverse",style:{width:`${t}px`,height:`${t}px`}},O.createElement(Pe,{style:{fontSize:`${t-4}px`},display:"inline-block",variant:"large",color:"textInverse100"},"?")),mb=({imageUrl:t,size:e=30})=>t?O.createElement(Hn,{src:t,borderRadius:"circle",style:{width:`${e}px`,height:`${e}px`}}):O.createElement(Vvt,{size:e});M1("packages/checkout/src/shared/components/Skeleton/styles.css.ts","kit");const Gvt=sfe({"0%":{opacity:.25},"50%":{opacity:.1},"100%":{opacity:.25}},"PulseSimple"),Kvt=pa({height:"76px",backgroundColor:"#909090",animation:`${Gvt} 2s ease-in-out infinite`},"skeleton");D1();const sg=({width:t="100%",height:e="100%",borderRadius:r="md"})=>O.createElement(ae,{className:Kvt,borderRadius:r,style:{width:t,height:e}}),Jvt=({contractAddress:t,tokenId:e,quantityRaw:r,chainId:n})=>{const{chains:i}=bn(),{data:s,isLoading:o}=Mvt({chainId:n,contractAddress:t,tokenId:e}),{data:a,isLoading:c}=lhe({chainID:String(n),contractAddress:t});if(o||c)return O.createElement(Qvt,null);const u=ui(n,[...i]),{name:f="unknown",image:d,decimals:p=0}=s||{},{logoURI:g,name:v="Unknown Collection"}=a||{},y=Zn(r,p);return O.createElement(Yl,{flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between"},O.createElement(ae,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"2"},O.createElement(ae,{aspectRatio:"1/1",height:"full",justifyContent:"center",alignItems:"center",style:{width:"80px"}},O.createElement(Hn,{src:d,borderRadius:"md",style:{height:"80px"}})),O.createElement(ae,{flexDirection:"column",alignItems:"flex-start",justifyContent:"center",gap:"2"},O.createElement(ae,{gap:"1",alignItems:"center"},O.createElement(mb,{size:12,imageUrl:g}),O.createElement(Pe,{marginLeft:"1",fontSize:"small",color:"text80",fontWeight:"bold"},v),O.createElement(mb,{size:12,imageUrl:u.logoURI})),O.createElement(ae,{flexDirection:"column",alignItems:"flex-start",justifyContent:"center",style:{width:"180px"}},O.createElement(Pe,{color:"text100",fontSize:"normal",fontWeight:"normal"},f),O.createElement(Pe,{color:"text50",fontSize:"normal",fontWeight:"normal"},`#${e}`)))),O.createElement(ae,{height:"full",fontSize:"small",color:"text50",fontWeight:"bold"},`x${JR(y)}`))},Qvt=()=>O.createElement(Yl,{flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between"},O.createElement(ae,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"2"},O.createElement(sg,{height:"80px",width:"80px"}),O.createElement(ae,{flexDirection:"column",alignItems:"flex-start",justifyContent:"center",gap:"2"},O.createElement(sg,{width:"100px",height:"14px"}),O.createElement(sg,{width:"180px",height:"34px"}))),O.createElement(sg,{height:"14px",width:"14px"}));M1("packages/checkout/src/views/CheckoutSelection/styles.css.ts","kit");const uhe=pa({},"insufficientBalanceButton");Qc(`${uhe} > div`,{justifyContent:"center"});D1();const Yvt=()=>{var t,e,r,n;const{chains:i}=bn();dv();const{closeCheckout:s,settings:o}=cx(),{address:a}=to(),c=o==null?void 0:o.cryptoCheckout,l=!!c,{data:u,isLoading:f}=lhe({contractAddress:(c==null||(t=c.coinQuantity)==null?void 0:t.contractAddress)||"",chainID:String((c==null?void 0:c.chainId)||1)}),{data:d,isLoading:p}=Nvt({accountAddress:a||"",chainId:(c==null?void 0:c.chainId)||1}),g=(f||p)&&c,v=uJ((c==null||(e=c.coinQuantity)==null?void 0:e.contractAddress)||"",Rn),y=ui((c==null?void 0:c.chainId)||1,i),b=v?y.decimals:(u==null?void 0:u.decimals)||0,w=v?y.symbol:(u==null?void 0:u.symbol)||"COIN",E=v?y.logoURI:(u==null?void 0:u.logoURI)||"",C=d==null?void 0:d.find(K=>{var x;return uJ(K.contractAddress,(c==null||(x=c.coinQuantity)==null?void 0:x.contractAddress)||"")}),S=C?C.balance:"0",P=(c==null||(r=c.coinQuantity)==null?void 0:r.amountRequiredRaw)||"0",_=Zn(S,b),T=Zn(P,b),Q=we.from(S).lt(we.from(P)),Z=(o==null?void 0:o.orderSummaryItems)||[],ne=(o==null||(n=o.cryptoCheckout)==null?void 0:n.chainId)||1,ce=()=>{var K;console.log("trigger transaction");const x=o==null||(K=o.cryptoCheckout)==null?void 0:K.triggerTransaction;x&&x(),s()};return O.createElement(ae,{paddingX:"5",paddingBottom:"5",style:{marginTop:OD},flexDirection:"column",gap:"3"},Z.length>0&&O.createElement(O.Fragment,null,O.createElement(Pe,{fontWeight:"normal",fontSize:"normal",color:"text50"},"Order summary"),O.createElement(ae,{flexDirection:"column",gap:"2"},Z.map((K,x)=>O.createElement(Jvt,f1({key:x},K,{chainId:ne})))),O.createElement(ae,{marginTop:"2"},O.createElement(Xb,{color:"backgroundSecondary",style:{margin:"0px"}}))),l&&O.createElement(ae,{justifyContent:"space-between",alignItems:"center"},O.createElement(Pe,{fontWeight:"normal",fontSize:"normal",color:"text50"},"Total"),g?O.createElement(sg,{width:"100px",height:"17px"}):O.createElement(ae,{flexDirection:"row",gap:"1",alignItems:"center"},O.createElement(mb,{imageUrl:E,size:12}),O.createElement(Pe,{fontWeight:"normal",fontSize:"normal",color:"text100"},`${JR(T)} ${w}`))),O.createElement(ae,{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"2"},l&&!Q&&!g&&O.createElement(Sr,{style:{borderRadius:ut.radii.md,height:"56px"},width:"full",leftIcon:()=>O.createElement(mb,{size:20,imageUrl:E}),variant:"primary",label:`Pay with ${w}`,rightIcon:Wu,onClick:ce}),l&&(Q||g)&&O.createElement(Sr,{className:uhe,style:{borderRadius:ut.radii.md,height:"56px",justifyContent:"center"},width:"full",leftIcon:()=>O.createElement(mb,{size:20,imageUrl:E}),variant:"glass",label:`Insufficient ${w}`,onClick:ce,disabled:!0})),l&&O.createElement(ae,{width:"full",justifyContent:"flex-end"},g?O.createElement(sg,{width:"102px",height:"14px"}):O.createElement(Pe,{fontWeight:"bold",fontSize:"small",color:"text50"},"Balance: ",`${JR(_)} ${w}`)))},Y7=({secondaryText:t,primaryText:e,disableBack:r=!1})=>{const{goBack:n,history:i}=dv(),s=()=>{n()};return O.createElement(ae,{background:"backgroundPrimary",zIndex:"20",position:"fixed",width:"full",flexDirection:"row",alignItems:"center",justifyContent:"space-between",style:{height:OD,paddingTop:"6px",backgroundColor:ut.colors.backgroundPrimary}},i.length>0&&!r?O.createElement(af,{onClick:s,icon:z8,size:"sm",style:{background:"rgba(0,0,0,0)",width:"44px"}}):O.createElement(ae,null),O.createElement(ae,null,O.createElement(Pe,{fontWeight:"medium",variant:"small",color:"text50"},t),O.createElement(Pe,{fontWeight:"medium",variant:"small",color:"text100"},e)),O.createElement(ae,{style:{width:"44px"}}))};M1("packages/checkout/src/shared/styles.css.ts","kit");const $D=pa({},"walletContent");Qc(`${$D} + button`,{backgroundColor:"transparent"});Qc(`${$D} + button > svg`,{width:"20px",height:"20px"});D1();const fhe={location:"select-method-checkout"},Zvt=t=>{const e=new PN;return O.createElement(nD,{client:e},O.createElement(Xvt,t))},Xvt=({children:t})=>{const{theme:e,position:r}=rx(),[n,i]=$.useState(!1),[s,o]=$.useState(),[a,c]=$.useState([]),l=a.length>0?a[a.length-1]:fhe,u=g=>{o(g),i(!0)},f=()=>{i(!1)},d=()=>{const{location:g}=l;switch(g){case"select-method-checkout":return O.createElement(Yvt,null);case"transaction-pending":return O.createElement(Uvt,null);case"transaction-success":return O.createElement(zvt,null);case"transaction-error":return O.createElement(qvt,null);case"transaction-form":default:return O.createElement(Fvt,null)}},p=()=>{const{location:g}=l;switch(g){case"select-method-checkout":return O.createElement(Y7,{primaryText:"Checkout"});case"transaction-success":case"transaction-error":case"transaction-pending":return O.createElement(Y7,{disableBack:!0,primaryText:"Pay with credit or debit card"});case"transaction-form":default:return O.createElement(Y7,{primaryText:"Pay with credit or debit card"})}};return $.useEffect(()=>{n&&c([])},[n]),O.createElement(Svt,{value:{triggerCheckout:u,closeCheckout:f,settings:s,theme:e}},O.createElement(Lvt,{value:{history:a,setHistory:c}},O.createElement("div",{id:"kit-checkout"},O.createElement(Z8,{root:"#kit-checkout",scope:"kit",theme:e},O.createElement(L8,null,n&&O.createElement(V$,{contentProps:{style:f1({maxWidth:"400px",height:"auto"},tD(r))},scroll:!1,backdropColor:"backgroundBackdrop",onClose:()=>i(!1)},O.createElement(ae,{id:"sequence-kit-checkout-content",className:$D},p(),d()))))),t))},dv=()=>{const{setHistory:t,history:e}=Dvt(),r=s=>{const o=document.getElementById("sequence-kit-wallet-content"),a=o==null?void 0:o.parentElement;a==null||a.scrollTo(0,0);const c=[...e,s];t(c)},n=()=>{const s=[...e];s.pop(),t(s)},i=e.length>0?e[e.length-1]:fhe;return{setNavigation:r,history:e,setHistory:t,goBack:n,navigation:i}},eyt=`Two roads diverged in a yellow wood, +Robert Frost poet + +And sorry I could not travel both +And be one traveler, long I stood +And looked down one as far as I could +To where it bent in the undergrowth; + +Then took the other, as just as fair, +And having perhaps the better claim, +Because it was grassy and wanted wear; +Though as for that the passing there +Had worn them really about the same, + +And both that morning equally lay +In leaves no step had trodden black. +Oh, I kept the first for another day! +Yet knowing how way leads on to way, +I doubted if I should ever come back. + +I shall be telling this with a sigh +Somewhere ages and ages hence: +Two roads diverged in a wood, and I— +I took the one less traveled by, +And that has made all the difference.`,tyt=[{label:"Terms",url:"https://sequence.xyz/terms"},{label:"About",url:"https://github.com/0xsequence/kit"},{label:"Blog",url:"https://sequence.xyz/blog"},{label:"Builder",url:"https://sequence.build"},{label:"Docs",url:"https://docs.sequence.xyz/wallet/connectors/kit/kit/overview"}],ryt=[{id:"discord",url:"https://discord.gg/sequence",icon:"img/social/discord.svg"},{id:"twitter",url:"https://www.twitter.com/0xsequence",icon:"img/social/twitter.svg"},{id:"youtube",url:"https://www.youtube.com/channel/UC1zHgUyV-doddTcnFNqt62Q",icon:"img/social/youtube.svg"},{id:"github",url:"https://github.com/0xsequence",icon:"img/social/github.svg"}];var fJ="u3q5o00";const nyt=()=>{const{theme:t}=uw(),e=FNe("isMobile"),r=s=>{window.open(s)},n=()=>ct(ae,{flexDirection:"row",gap:"4",children:tyt.map((s,o)=>ct(ae,{onClick:()=>r(s.url),className:fJ,gap:"4",children:ct(Pe,{fontWeight:"normal",fontSize:"small",color:"text50",children:s.label})},o))}),i=()=>ct(ae,{gap:"4",justifyContent:"center",alignItems:"center",children:ryt.map((s,o)=>ct(ae,{className:fJ,onClick:()=>window.open(s.url),children:ct(Hn,{height:"3",src:s.icon,alt:s.id,style:{filter:t==="dark"?"invert(0)":"invert(1)"}})},o))});return e?Ta(ae,{flexDirection:"column",padding:"5",gap:"2",style:{height:"60px"},position:"fixed",bottom:"0",width:"full",justifyContent:"center",alignItems:"center",children:[ct(n,{}),ct(i,{})]}):Ta(ae,{padding:"5",style:{height:"60px"},position:"fixed",bottom:"0",width:"full",justifyContent:"space-between",children:[ct(n,{}),ct(i,{})]})},iyt=t=>({cryptoCheckout:{chainId:137,triggerTransaction:async()=>{console.log("triggered transaction")},coinQuantity:{contractAddress:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",amountRequiredRaw:"10000000000"}},orderSummaryItems:[{contractAddress:"0x631998e91476da5b870d741192fc5cbc55f5a52e",tokenId:"66597",quantityRaw:"100"},{contractAddress:"0x624e4fa6980afcf8ea27bfe08e2fb5979b64df1c",tokenId:"1741",quantityRaw:"100"}]}),syt=(t,e)=>{let r=t;return t.length>=e&&(r=t.slice(0,e/2)+"..."+t.slice(t.length-e/2,t.length)),r},oyt=t=>`0x${syt((t==null?void 0:t.substring(2))||"",8)}`;function ayt(){const{theme:t,setTheme:e}=uw(),{setTheme:r}=rx(),{address:n,connector:i,isConnected:s}=to(),{setOpenConnectModal:o}=hlt(),{setOpenWalletModal:a}=sx(),{triggerCheckout:c}=cx(),{disconnect:l}=Pfe(),{data:u}=oD(),{switchChain:f}=sD(),d=M4(),p=uht(),{debug:g}=hre.parse(location.search),v=g==="true",y=async()=>{if(!(!u||!p))try{const Q=await Xct(u);console.log("proof:",Q);const Z=await elt(u,p,Q);console.log("isValid?:",Z)}catch(Q){console.error(Q)}},b=async()=>{if(u)try{const Q=eyt,Z=await u.signMessage({account:n||"",message:Q});console.log("signature:",Z);const[ne]=await u.getAddresses(),ce=await p.verifyMessage({address:ne,message:Q,signature:Z});console.log("isValid?",ce)}catch(Q){console.error(Q)}},w=()=>{e(t==="dark"?"light":"dark"),r(t==="dark"?"light":"dark")},E=()=>s?Ta(ae,{padding:"5",justifyContent:"space-between",children:[Ta(ae,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"3",children:[ct(Hn,{style:{width:"36px"},src:"kit-logo.svg"}),ct(Hn,{style:{width:"24px",filter:t==="dark"?"invert(0)":"invert(1)"},src:"kit-logo-text.svg"})]}),ct(ae,{children:Ta(ae,{flexDirection:"column",children:[Ta(ae,{flexDirection:"row",gap:"2",justifyContent:"flex-end",alignItems:"center",children:[ct(ae,{style:{marginRight:"-12px"},children:ct(_,{})}),ct(Pe,{fontWeight:"medium",fontSize:"normal",color:"text100",children:oyt(n||"")})]}),ct(ae,{alignItems:"center",justifyContent:"flex-end",flexDirection:"row",children:ct(Pe,{fontWeight:"medium",fontSize:"normal",color:"text50",children:i==null?void 0:i.name})})]})})]}):ct(ae,{padding:"5",justifyContent:"flex-end",children:ct(ae,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"3",children:ct(_,{})})}),C=({title:Q,description:Z,onClick:ne})=>Ta(Yl,{style:{width:"332px"},clickable:!0,onClick:ne,children:[ct(Pe,{color:"text100",lineHeight:"5",fontSize:"normal",fontWeight:"bold",children:Q}),ct(ae,{marginTop:"1",children:ct(Pe,{fontWeight:"medium",lineHeight:"5",color:"text50",fontSize:"normal",children:Z})})]}),S=()=>{o(!0)},P=()=>{c(iyt())},_=()=>ct(Sr,{variant:"base",style:{color:ut.colors.text100},onClick:w,leftIcon:t==="dark"?XIe:FIe});return Ta(ae,{background:"backgroundPrimary",children:[v&&ct(ae,{justifyContent:"center",alignItems:"center",children:ct(Pe,{children:"Debug mode"})}),ct(ae,{style:{height:"72px"},position:"fixed",width:"full",top:"0",children:ct(E,{})}),ct(ae,{style:{height:"100vh"},flexDirection:"column",justifyContent:"center",alignItems:"center",children:s?Ta(ae,{flexDirection:"column",gap:"4",children:[Ta(ae,{flexDirection:"column",gap:"2",children:[ct(Pe,{color:"text50",fontSize:"small",fontWeight:"medium",children:"Demos"}),ct(C,{title:"Embedded wallet",description:"Connect a Sequence wallet to view, swap, send, and receive collections",onClick:()=>a(!0)}),ct(C,{title:"Checkout",description:"Checkout screen before placing a purchase on coins or collections",onClick:P}),ct(C,{title:"Sign message",description:"Sign a message with your wallet",onClick:b}),v&&ct(C,{title:"Generate EthAuth proof",description:"Generate EthAuth proof",onClick:y}),v&&ct(C,{title:"Switch network",description:"Switch network",onClick:()=>{f(d===1?{chainId:137}:{chainId:1})}})]}),ct(ae,{width:"full",gap:"2",flexDirection:"row",justifyContent:"flex-end",children:ct(Sr,{onClick:()=>l(),leftIcon:rie,label:"Sign out"})})]}):ct(ae,{children:Ta(ae,{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"5",children:[Ta(ae,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"3",children:[ct(Hn,{style:{width:"48px"},src:"kit-logo.svg"}),ct(Hn,{style:{width:"32px",filter:t==="dark"?"invert(0)":"invert(1)"},src:"kit-logo-text.svg"})]}),ct(ae,{gap:"2",flexDirection:"row",alignItems:"center",children:ct(Sr,{onClick:S,variant:"feature",label:"Connect"})})]})})}),ct(nyt,{})]})}const cyt=_oe({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://cloudflare-eth.com"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0x8cab227b1162f03b8338331adaad7aadc83b895e",blockCreated:18958930},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),lyt=_oe({id:137,name:"Polygon",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{default:{http:["https://polygon-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://polygonscan.com",apiUrl:"https://api.polygonscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}}),uyt=new PN;function fyt(){const{debug:t}=hre.parse(location.search),e=t==="true",r=[cyt,lyt],n="iK0DPkHRt0IFo8o4M3fZIIOAAAAAAAAAA",i=[...Wot({walletConnectProjectId:"c65a6cb1aa83c4e24500130f23a437d8",defaultChainId:137,appName:"demo app",projectAccessKey:n}),...e?cfe(n,[Uot({accounts:["0xCb88b6315507e9d8c35D81AFB7F190aB6c3227C9"]})]):[]],s={};r.forEach(c=>{const l=Zg.network.findNetworkConfig(Zg.network.allNetworks,c.id);l&&(s[c.id]=ILe(l.rpcUrl))});const o=BBe({transports:s,connectors:i,chains:r});return ct(rht,{config:o,children:ct(nD,{client:uyt,children:ct(dlt,{config:{defaultTheme:"dark",signIn:{projectName:"Skyweaver",useMock:e},displayedAssets:[{contractAddress:Rn,chainId:137},{contractAddress:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",chainId:137},{contractAddress:"0x631998e91476da5b870d741192fc5cbc55f5a52e",chainId:137}]},children:ct(Qgt,{children:ct(Zvt,{children:ct("div",{id:"app",children:ct(Z8,{root:"#app",scope:"app",theme:"dark",children:ct(ayt,{})})})})})})})})}const dyt=Z7.createRoot(document.getElementById("root"));dyt.render(ct(O.StrictMode,{children:ct(fyt,{})}));export{Ue as B,lb as H,i2 as I,uoe as _,uf as a,Xl as b,pC as c,ODe as d,hw as e,Y$ as g,Zd as i,Ro as s}; diff --git a/assets/index-4b2fd375.js b/assets/index-4b2fd375.js new file mode 100644 index 00000000..a7ea48da --- /dev/null +++ b/assets/index-4b2fd375.js @@ -0,0 +1 @@ +import{_ as pe}from"./index-1664f73d.js";const fe=Symbol(),Z=Object.getPrototypeOf,F=new WeakMap,me=e=>e&&(F.has(e)?F.get(e):Z(e)===Object.prototype||Z(e)===Array.prototype),ge=e=>me(e)&&e[fe]||null,ee=(e,t=!0)=>{F.set(e,t)},J=e=>typeof e=="object"&&e!==null,C=new WeakMap,x=new WeakSet,he=(e=Object.is,t=(o,h)=>new Proxy(o,h),s=o=>J(o)&&!x.has(o)&&(Array.isArray(o)||!(Symbol.iterator in o))&&!(o instanceof WeakMap)&&!(o instanceof WeakSet)&&!(o instanceof Error)&&!(o instanceof Number)&&!(o instanceof Date)&&!(o instanceof String)&&!(o instanceof RegExp)&&!(o instanceof ArrayBuffer),r=o=>{switch(o.status){case"fulfilled":return o.value;case"rejected":throw o.reason;default:throw o}},l=new WeakMap,c=(o,h,I=r)=>{const b=l.get(o);if((b==null?void 0:b[0])===h)return b[1];const y=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o));return ee(y,!0),l.set(o,[h,y]),Reflect.ownKeys(o).forEach(P=>{if(Object.getOwnPropertyDescriptor(y,P))return;const L=Reflect.get(o,P),D={value:L,enumerable:!0,configurable:!0};if(x.has(L))ee(L,!1);else if(L instanceof Promise)delete D.value,D.get=()=>I(L);else if(C.has(L)){const[v,z]=C.get(L);D.value=c(v,z(),I)}Object.defineProperty(y,P,D)}),Object.preventExtensions(y)},m=new WeakMap,f=[1,1],W=o=>{if(!J(o))throw new Error("object required");const h=m.get(o);if(h)return h;let I=f[0];const b=new Set,y=(i,a=++f[0])=>{I!==a&&(I=a,b.forEach(n=>n(i,a)))};let P=f[1];const L=(i=++f[1])=>(P!==i&&!b.size&&(P=i,v.forEach(([a])=>{const n=a[1](i);n>I&&(I=n)})),I),D=i=>(a,n)=>{const g=[...a];g[1]=[i,...g[1]],y(g,n)},v=new Map,z=(i,a)=>{if(b.size){const n=a[3](D(i));v.set(i,[a,n])}else v.set(i,[a])},Y=i=>{var a;const n=v.get(i);n&&(v.delete(i),(a=n[1])==null||a.call(n))},de=i=>(b.add(i),b.size===1&&v.forEach(([n,g],R)=>{const N=n[3](D(R));v.set(R,[n,N])}),()=>{b.delete(i),b.size===0&&v.forEach(([n,g],R)=>{g&&(g(),v.set(R,[n]))})}),H=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o)),V=t(H,{deleteProperty(i,a){const n=Reflect.get(i,a);Y(a);const g=Reflect.deleteProperty(i,a);return g&&y(["delete",[a],n]),g},set(i,a,n,g){const R=Reflect.has(i,a),N=Reflect.get(i,a,g);if(R&&(e(N,n)||m.has(n)&&e(N,m.get(n))))return!0;Y(a),J(n)&&(n=ge(n)||n);let $=n;if(n instanceof Promise)n.then(A=>{n.status="fulfilled",n.value=A,y(["resolve",[a],A])}).catch(A=>{n.status="rejected",n.reason=A,y(["reject",[a],A])});else{!C.has(n)&&s(n)&&($=W(n));const A=!x.has($)&&C.get($);A&&z(a,A)}return Reflect.set(i,a,$,g),y(["set",[a],n,N]),!0}});m.set(o,V);const ue=[H,L,c,de];return C.set(V,ue),Reflect.ownKeys(o).forEach(i=>{const a=Object.getOwnPropertyDescriptor(o,i);"value"in a&&(V[i]=o[i],delete a.value,delete a.writable),Object.defineProperty(H,i,a)}),V})=>[W,C,x,e,t,s,r,l,c,m,f],[be]=he();function S(e={}){return be(e)}function U(e,t,s){const r=C.get(e);let l;const c=[],m=r[3];let f=!1;const o=m(h=>{if(c.push(h),s){t(c.splice(0));return}l||(l=Promise.resolve().then(()=>{l=void 0,f&&t(c.splice(0))}))});return f=!0,()=>{f=!1,o()}}function ye(e,t){const s=C.get(e),[r,l,c]=s;return c(r,l(),t)}const d=S({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),ce={state:d,subscribe(e){return U(d,()=>e(d))},push(e,t){e!==d.view&&(d.view=e,t&&(d.data=t),d.history.push(e))},reset(e){d.view=e,d.history=[e]},replace(e){d.history.length>1&&(d.history[d.history.length-1]=e,d.view=e)},goBack(){if(d.history.length>1){d.history.pop();const[e]=d.history.slice(-1);d.view=e}},setData(e){d.data=e}},p={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return p.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return p.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},formatNativeUrl(e,t,s){if(p.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let r=e;r.includes("://")||(r=e.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,s);const l=encodeURIComponent(t);return`${r}wc?uri=${l}`},formatUniversalUrl(e,t,s){if(!p.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let r=e;r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,s);const l=encodeURIComponent(t);return`${r}wc?uri=${l}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){window.open(e,t,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(p.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(p.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(p.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(p.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=ce.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},ve=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),u=S({enabled:ve,userSessionId:"",events:[],connectedWalletId:void 0}),we={state:u,subscribe(e){return U(u.events,()=>e(ye(u.events[u.events.length-1])))},initialize(){u.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(u.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){u.connectedWalletId=e},click(e){if(u.enabled){const t={type:"CLICK",name:e.name,userSessionId:u.userSessionId,timestamp:Date.now(),data:e};u.events.push(t)}},track(e){if(u.enabled){const t={type:"TRACK",name:e.name,userSessionId:u.userSessionId,timestamp:Date.now(),data:e};u.events.push(t)}},view(e){if(u.enabled){const t={type:"VIEW",name:e.name,userSessionId:u.userSessionId,timestamp:Date.now(),data:e};u.events.push(t)}}},E=S({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),w={state:E,subscribe(e){return U(E,()=>e(E))},setChains(e){E.chains=e},setWalletConnectUri(e){E.walletConnectUri=e},setIsCustomDesktop(e){E.isCustomDesktop=e},setIsCustomMobile(e){E.isCustomMobile=e},setIsDataLoaded(e){E.isDataLoaded=e},setIsUiLoaded(e){E.isUiLoaded=e},setIsAuth(e){E.isAuth=e}},B=S({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),k={state:B,subscribe(e){return U(B,()=>e(B))},setConfig(e){var t,s;we.initialize(),w.setChains(e.chains),w.setIsAuth(!!e.enableAuthMode),w.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),w.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),p.setModalVersionInStorage(),Object.assign(B,e)}};var Ie=Object.defineProperty,te=Object.getOwnPropertySymbols,Ee=Object.prototype.hasOwnProperty,Oe=Object.prototype.propertyIsEnumerable,se=(e,t,s)=>t in e?Ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Le=(e,t)=>{for(var s in t||(t={}))Ee.call(t,s)&&se(e,s,t[s]);if(te)for(var s of te(t))Oe.call(t,s)&&se(e,s,t[s]);return e};const G="https://explorer-api.walletconnect.com",Q="wcm",X="js-2.6.2";async function K(e,t){const s=Le({sdkType:Q,sdkVersion:X},t),r=new URL(e,G);return r.searchParams.append("projectId",k.state.projectId),Object.entries(s).forEach(([l,c])=>{c&&r.searchParams.append(l,String(c))}),(await fetch(r)).json()}const j={async getDesktopListings(e){return K("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return K("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return K("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return K("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${G}/w3m/v1/getWalletImage/${e}?projectId=${k.state.projectId}&sdkType=${Q}&sdkVersion=${X}`},getAssetImageUrl(e){return`${G}/w3m/v1/getAssetImage/${e}?projectId=${k.state.projectId}&sdkType=${Q}&sdkVersion=${X}`}};var We=Object.defineProperty,oe=Object.getOwnPropertySymbols,Ae=Object.prototype.hasOwnProperty,Ce=Object.prototype.propertyIsEnumerable,ne=(e,t,s)=>t in e?We(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Se=(e,t)=>{for(var s in t||(t={}))Ae.call(t,s)&&ne(e,s,t[s]);if(oe)for(var s of oe(t))Ce.call(t,s)&&ne(e,s,t[s]);return e};const re=p.isMobile(),O=S({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),Ne={state:O,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=k.state;if(e==="NONE"||t==="ALL"&&!e)return O.recomendedWallets;if(p.isArray(e)){const s={recommendedIds:e.join(",")},{listings:r}=await j.getAllListings(s),l=Object.values(r);l.sort((c,m)=>{const f=e.indexOf(c.id),W=e.indexOf(m.id);return f-W}),O.recomendedWallets=l}else{const{chains:s,isAuth:r}=w.state,l=s==null?void 0:s.join(","),c=p.isArray(t),m={page:1,sdks:r?"auth_v1":void 0,entries:p.RECOMMENDED_WALLET_AMOUNT,chains:l,version:2,excludedIds:c?t.join(","):void 0},{listings:f}=re?await j.getMobileListings(m):await j.getDesktopListings(m);O.recomendedWallets=Object.values(f)}return O.recomendedWallets},async getWallets(e){const t=Se({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:r}=k.state,{recomendedWallets:l}=O;if(r==="ALL")return O.wallets;l.length?t.excludedIds=l.map(I=>I.id).join(","):p.isArray(s)&&(t.excludedIds=s.join(",")),p.isArray(r)&&(t.excludedIds=[t.excludedIds,r].filter(Boolean).join(",")),w.state.isAuth&&(t.sdks="auth_v1");const{page:c,search:m}=e,{listings:f,total:W}=re?await j.getMobileListings(t):await j.getDesktopListings(t),o=Object.values(f),h=m?"search":"wallets";return O[h]={listings:[...O[h].listings,...o],total:W,page:c??1},{listings:o,total:W}},getWalletImageUrl(e){return j.getWalletImageUrl(e)},getAssetImageUrl(e){return j.getAssetImageUrl(e)},resetSearch(){O.search={listings:[],total:0,page:1}}},_=S({open:!1}),q={state:_,subscribe(e){return U(_,()=>e(_))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:r}=w.state;if(p.removeWalletConnectDeepLink(),w.setWalletConnectUri(e==null?void 0:e.uri),w.setChains(e==null?void 0:e.chains),ce.reset("ConnectWallet"),s&&r)_.open=!0,t();else{const l=setInterval(()=>{const c=w.state;c.isUiLoaded&&c.isDataLoaded&&(clearInterval(l),_.open=!0,t())},200)}})},close(){_.open=!1}};var De=Object.defineProperty,ae=Object.getOwnPropertySymbols,je=Object.prototype.hasOwnProperty,Me=Object.prototype.propertyIsEnumerable,ie=(e,t,s)=>t in e?De(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Ue=(e,t)=>{for(var s in t||(t={}))je.call(t,s)&&ie(e,s,t[s]);if(ae)for(var s of ae(t))Me.call(t,s)&&ie(e,s,t[s]);return e};function Pe(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const T=S({themeMode:Pe()?"dark":"light"}),le={state:T,subscribe(e){return U(T,()=>e(T))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(T.themeMode=t),s&&(T.themeVariables=Ue({},s))}},M=S({open:!1,message:"",variant:"success"}),Te={state:M,subscribe(e){return U(M,()=>e(M))},openToast(e,t){M.open=!0,M.message=e,M.variant=t},closeToast(){M.open=!1}};class Re{constructor(t){this.openModal=q.open,this.closeModal=q.close,this.subscribeModal=q.subscribe,this.setTheme=le.setThemeConfig,le.setThemeConfig(t),k.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await pe(()=>import("./index-7c6a5327.js"),["./index-7c6a5327.js","./index-1664f73d.js","./index-f4824932.css"],import.meta.url);const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),w.setIsUiLoaded(!0)}}}const Ve=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:Re},Symbol.toStringTag,{value:"Module"}));export{we as R,ce as T,p as a,Ve as i,le as n,Te as o,w as p,q as s,Ne as t,k as y}; diff --git a/assets/index-6a2af3e6.js b/assets/index-6a2af3e6.js deleted file mode 100644 index 89bf9949..00000000 --- a/assets/index-6a2af3e6.js +++ /dev/null @@ -1,404 +0,0 @@ -var Wq=Object.defineProperty;var Hq=(t,e,r)=>e in t?Wq(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var st=(t,e,r)=>(Hq(t,typeof e!="symbol"?e+"":e,r),r);function qq(t,e){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(t,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"]'))n(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"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(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 n(i){if(i.ep)return;i.ep=!0;const s=r(i);fetch(i.href,s)}})();var Sl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ki(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function QI(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var YI={exports:{}},Ig={},JI={exports:{}},Je={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var W1=Symbol.for("react.element"),Vq=Symbol.for("react.portal"),Gq=Symbol.for("react.fragment"),Kq=Symbol.for("react.strict_mode"),Qq=Symbol.for("react.profiler"),Yq=Symbol.for("react.provider"),Jq=Symbol.for("react.context"),Xq=Symbol.for("react.forward_ref"),Zq=Symbol.for("react.suspense"),eV=Symbol.for("react.memo"),tV=Symbol.for("react.lazy"),C9=Symbol.iterator;function rV(t){return t===null||typeof t!="object"?null:(t=C9&&t[C9]||t["@@iterator"],typeof t=="function"?t:null)}var XI={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ZI=Object.assign,eO={};function xd(t,e,r){this.props=t,this.context=e,this.refs=eO,this.updater=r||XI}xd.prototype.isReactComponent={};xd.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};xd.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function tO(){}tO.prototype=xd.prototype;function $8(t,e,r){this.props=t,this.context=e,this.refs=eO,this.updater=r||XI}var M8=$8.prototype=new tO;M8.constructor=$8;ZI(M8,xd.prototype);M8.isPureReactComponent=!0;var S9=Array.isArray,rO=Object.prototype.hasOwnProperty,N8={current:null},nO={key:!0,ref:!0,__self:!0,__source:!0};function iO(t,e,r){var n,i={},s=null,o=null;if(e!=null)for(n in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)rO.call(e,n)&&!nO.hasOwnProperty(n)&&(i[n]=e[n]);var a=arguments.length-2;if(a===1)i.children=r;else if(1>>1,E=_[R];if(0>>1;Ri(T,L))Ui(W,T)?(_[R]=W,_[U]=L,R=U):(_[R]=T,_[j]=L,R=j);else if(Ui(W,L))_[R]=W,_[U]=L,R=U;else break e}}return N}function i(_,N){var L=_.sortIndex-N.sortIndex;return L!==0?L:_.id-N.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var c=[],l=[],u=1,f=null,d=3,h=!1,p=!1,v=!1,m=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(_){for(var N=r(l);N!==null;){if(N.callback===null)n(l);else if(N.startTime<=_)n(l),N.sortIndex=N.expirationTime,e(c,N);else break;N=r(l)}}function C(_){if(v=!1,b(_),!p)if(r(c)!==null)p=!0,$(A);else{var N=r(l);N!==null&&D(C,N.startTime-_)}}function A(_,N){p=!1,v&&(v=!1,g(I),I=-1),h=!0;var L=d;try{for(b(N),f=r(c);f!==null&&(!(f.expirationTime>N)||_&&!H());){var R=f.callback;if(typeof R=="function"){f.callback=null,d=f.priorityLevel;var E=R(f.expirationTime<=N);N=t.unstable_now(),typeof E=="function"?f.callback=E:f===r(c)&&n(c),b(N)}else n(c);f=r(c)}if(f!==null)var M=!0;else{var j=r(l);j!==null&&D(C,j.startTime-N),M=!1}return M}finally{f=null,d=L,h=!1}}var O=!1,w=null,I=-1,B=5,z=-1;function H(){return!(t.unstable_now()-z_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<_?Math.floor(1e3/_):5},t.unstable_getCurrentPriorityLevel=function(){return d},t.unstable_getFirstCallbackNode=function(){return r(c)},t.unstable_next=function(_){switch(d){case 1:case 2:case 3:var N=3;break;default:N=d}var L=d;d=N;try{return _()}finally{d=L}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(_,N){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var L=d;d=_;try{return N()}finally{d=L}},t.unstable_scheduleCallback=function(_,N,L){var R=t.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0R?(_.sortIndex=L,e(l,_),r(c)===null&&_===r(l)&&(v?(g(I),I=-1):v=!0,D(C,L-R))):(_.sortIndex=E,e(c,_),p||h||(p=!0,$(A))),_},t.unstable_shouldYield=H,t.unstable_wrapCallback=function(_){var N=d;return function(){var L=d;d=N;try{return _.apply(this,arguments)}finally{d=L}}}})(lO);cO.exports=lO;var pV=cO.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var uO=k,Ci=pV;function ce(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),n5=Object.prototype.hasOwnProperty,vV=/^[: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]*$/,A9={},_9={};function mV(t){return n5.call(_9,t)?!0:n5.call(A9,t)?!1:vV.test(t)?_9[t]=!0:(A9[t]=!0,!1)}function yV(t,e,r,n){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function gV(t,e,r,n){if(e===null||typeof e>"u"||yV(t,e,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Hn(t,e,r,n,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var cn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){cn[t]=new Hn(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];cn[e]=new Hn(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){cn[t]=new Hn(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){cn[t]=new Hn(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){cn[t]=new Hn(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){cn[t]=new Hn(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){cn[t]=new Hn(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){cn[t]=new Hn(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){cn[t]=new Hn(t,5,!1,t.toLowerCase(),null,!1,!1)});var B8=/[\-:]([a-z])/g;function F8(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(B8,F8);cn[e]=new Hn(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(B8,F8);cn[e]=new Hn(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(B8,F8);cn[e]=new Hn(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){cn[t]=new Hn(t,1,!1,t.toLowerCase(),null,!1,!1)});cn.xlinkHref=new Hn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){cn[t]=new Hn(t,1,!1,t.toLowerCase(),null,!0,!0)});function j8(t,e,r,n){var i=cn.hasOwnProperty(e)?cn[e]:null;(i!==null?i.type!==0:n||!(2a||i[o]!==s[a]){var c=` -`+i[o].replace(" at new "," at ");return t.displayName&&c.includes("")&&(c=c.replace("",t.displayName)),c}while(1<=o&&0<=a);break}}}finally{ew=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?Mh(t):""}function bV(t){switch(t.tag){case 5:return Mh(t.type);case 16:return Mh("Lazy");case 13:return Mh("Suspense");case 19:return Mh("SuspenseList");case 0:case 2:case 15:return t=tw(t.type,!1),t;case 11:return t=tw(t.type.render,!1),t;case 1:return t=tw(t.type,!0),t;default:return""}}function a5(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case tf:return"Fragment";case ef:return"Portal";case i5:return"Profiler";case U8:return"StrictMode";case s5:return"Suspense";case o5:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case hO:return(t.displayName||"Context")+".Consumer";case dO:return(t._context.displayName||"Context")+".Provider";case z8:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case W8:return e=t.displayName||null,e!==null?e:a5(t.type)||"Memo";case ja:e=t._payload,t=t._init;try{return a5(t(e))}catch{}}return null}function wV(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return a5(e);case 8:return e===U8?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function bc(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function vO(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function xV(t){var e=vO(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,s=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Lp(t){t._valueTracker||(t._valueTracker=xV(t))}function mO(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=vO(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function Tm(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function c5(t,e){var r=e.checked;return fr({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function T9(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=bc(e.value!=null?e.value:r),t._wrapperState={initialChecked:n,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function yO(t,e){e=e.checked,e!=null&&j8(t,"checked",e,!1)}function l5(t,e){yO(t,e);var r=bc(e.value),n=e.type;if(r!=null)n==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(n==="submit"||n==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?u5(t,e.type,r):e.hasOwnProperty("defaultValue")&&u5(t,e.type,bc(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function I9(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function u5(t,e,r){(e!=="number"||Tm(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var Nh=Array.isArray;function Cf(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=Bp.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function P0(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var qh={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},EV=["Webkit","ms","Moz","O"];Object.keys(qh).forEach(function(t){EV.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),qh[e]=qh[t]})});function xO(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||qh.hasOwnProperty(t)&&qh[t]?(""+e).trim():e+"px"}function EO(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=xO(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,i):t[r]=i}}var CV=fr({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function h5(t,e){if(e){if(CV[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(ce(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(ce(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(ce(61))}if(e.style!=null&&typeof e.style!="object")throw Error(ce(62))}}function p5(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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 v5=null;function H8(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var m5=null,Sf=null,kf=null;function $9(t){if(t=V1(t)){if(typeof m5!="function")throw Error(ce(280));var e=t.stateNode;e&&(e=Ng(e),m5(t.stateNode,t.type,e))}}function CO(t){Sf?kf?kf.push(t):kf=[t]:Sf=t}function SO(){if(Sf){var t=Sf,e=kf;if(kf=Sf=null,$9(t),e)for(t=0;t>>=0,t===0?32:31-(MV(t)/NV|0)|0}var Fp=64,jp=4194304;function Dh(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function $m(t,e){var r=t.pendingLanes;if(r===0)return 0;var n=0,i=t.suspendedLanes,s=t.pingedLanes,o=r&268435455;if(o!==0){var a=o&~i;a!==0?n=Dh(a):(s&=o,s!==0&&(n=Dh(s)))}else o=r&~i,o!==0?n=Dh(o):s!==0&&(n=Dh(s));if(n===0)return 0;if(e!==0&&e!==n&&!(e&i)&&(i=n&-n,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(n&4&&(n|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=n;0r;r++)e.push(t);return e}function H1(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Ss(e),t[e]=r}function FV(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var n=t.eventTimes;for(t=t.expirationTimes;0=Gh),z9=String.fromCharCode(32),W9=!1;function HO(t,e){switch(t){case"keyup":return hG.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qO(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var rf=!1;function vG(t,e){switch(t){case"compositionend":return qO(e);case"keypress":return e.which!==32?null:(W9=!0,z9);case"textInput":return t=e.data,t===z9&&W9?null:t;default:return null}}function mG(t,e){if(rf)return t==="compositionend"||!X8&&HO(t,e)?(t=zO(),jv=Q8=Qa=null,rf=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=G9(r)}}function QO(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?QO(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function YO(){for(var t=window,e=Tm();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=Tm(t.document)}return e}function Z8(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function kG(t){var e=YO(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&QO(r.ownerDocument.documentElement,r)){if(n!==null&&Z8(r)){if(e=n.start,t=n.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=r.textContent.length,s=Math.min(n.start,i);n=n.end===void 0?s:Math.min(n.end,i),!t.extend&&s>n&&(i=n,n=s,s=i),i=K9(r,s);var o=K9(r,n);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>n?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,nf=null,E5=null,Qh=null,C5=!1;function Q9(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;C5||nf==null||nf!==Tm(n)||(n=nf,"selectionStart"in n&&Z8(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Qh&&M0(Qh,n)||(Qh=n,n=Dm(E5,"onSelect"),0af||(t.current=T5[af],T5[af]=null,af--)}function xt(t,e){af++,T5[af]=t.current,t.current=e}var wc={},An=jc(wc),ti=jc(!1),ql=wc;function Hf(t,e){var r=t.type.contextTypes;if(!r)return wc;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in r)i[s]=e[s];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function ri(t){return t=t.childContextTypes,t!=null}function Bm(){Vt(ti),Vt(An)}function r7(t,e,r){if(An.current!==wc)throw Error(ce(168));xt(An,e),xt(ti,r)}function sR(t,e,r){var n=t.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in e))throw Error(ce(108,wV(t)||"Unknown",i));return fr({},r,n)}function Fm(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||wc,ql=An.current,xt(An,t),xt(ti,ti.current),!0}function n7(t,e,r){var n=t.stateNode;if(!n)throw Error(ce(169));r?(t=sR(t,e,ql),n.__reactInternalMemoizedMergedChildContext=t,Vt(ti),Vt(An),xt(An,t)):Vt(ti),xt(ti,r)}var Mo=null,Dg=!1,vw=!1;function oR(t){Mo===null?Mo=[t]:Mo.push(t)}function LG(t){Dg=!0,oR(t)}function Uc(){if(!vw&&Mo!==null){vw=!0;var t=0,e=lt;try{var r=Mo;for(lt=1;t>=o,i-=o,Fo=1<<32-Ss(e)+i|r<I?(B=w,w=null):B=w.sibling;var z=d(g,w,b[I],C);if(z===null){w===null&&(w=B);break}t&&w&&z.alternate===null&&e(g,w),y=s(z,y,I),O===null?A=z:O.sibling=z,O=z,w=B}if(I===b.length)return r(g,w),tr&&hl(g,I),A;if(w===null){for(;II?(B=w,w=null):B=w.sibling;var H=d(g,w,z.value,C);if(H===null){w===null&&(w=B);break}t&&w&&H.alternate===null&&e(g,w),y=s(H,y,I),O===null?A=H:O.sibling=H,O=H,w=B}if(z.done)return r(g,w),tr&&hl(g,I),A;if(w===null){for(;!z.done;I++,z=b.next())z=f(g,z.value,C),z!==null&&(y=s(z,y,I),O===null?A=z:O.sibling=z,O=z);return tr&&hl(g,I),A}for(w=n(g,w);!z.done;I++,z=b.next())z=h(w,g,I,z.value,C),z!==null&&(t&&z.alternate!==null&&w.delete(z.key===null?I:z.key),y=s(z,y,I),O===null?A=z:O.sibling=z,O=z);return t&&w.forEach(function(K){return e(g,K)}),tr&&hl(g,I),A}function m(g,y,b,C){if(typeof b=="object"&&b!==null&&b.type===tf&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case Dp:e:{for(var A=b.key,O=y;O!==null;){if(O.key===A){if(A=b.type,A===tf){if(O.tag===7){r(g,O.sibling),y=i(O,b.props.children),y.return=g,g=y;break e}}else if(O.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===ja&&u7(A)===O.type){r(g,O.sibling),y=i(O,b.props),y.ref=lh(g,O,b),y.return=g,g=y;break e}r(g,O);break}else e(g,O);O=O.sibling}b.type===tf?(y=$l(b.props.children,g.mode,C,b.key),y.return=g,g=y):(C=Kv(b.type,b.key,b.props,null,g.mode,C),C.ref=lh(g,y,b),C.return=g,g=C)}return o(g);case ef:e:{for(O=b.key;y!==null;){if(y.key===O)if(y.tag===4&&y.stateNode.containerInfo===b.containerInfo&&y.stateNode.implementation===b.implementation){r(g,y.sibling),y=i(y,b.children||[]),y.return=g,g=y;break e}else{r(g,y);break}else e(g,y);y=y.sibling}y=Cw(b,g.mode,C),y.return=g,g=y}return o(g);case ja:return O=b._init,m(g,y,O(b._payload),C)}if(Nh(b))return p(g,y,b,C);if(ih(b))return v(g,y,b,C);Gp(g,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,y!==null&&y.tag===6?(r(g,y.sibling),y=i(y,b),y.return=g,g=y):(r(g,y),y=Ew(b,g.mode,C),y.return=g,g=y),o(g)):r(g,y)}return m}var Vf=pR(!0),vR=pR(!1),G1={},ao=jc(G1),B0=jc(G1),F0=jc(G1);function _l(t){if(t===G1)throw Error(ce(174));return t}function cE(t,e){switch(xt(F0,e),xt(B0,t),xt(ao,G1),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:d5(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=d5(e,t)}Vt(ao),xt(ao,e)}function Gf(){Vt(ao),Vt(B0),Vt(F0)}function mR(t){_l(F0.current);var e=_l(ao.current),r=d5(e,t.type);e!==r&&(xt(B0,t),xt(ao,r))}function lE(t){B0.current===t&&(Vt(ao),Vt(B0))}var or=jc(0);function qm(t){for(var e=t;e!==null;){if(e.tag===13){var r=e.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var mw=[];function uE(){for(var t=0;tr?r:4,t(!0);var n=yw.transition;yw.transition={};try{t(!1),e()}finally{lt=r,yw.transition=n}}function RR(){return Vi().memoizedState}function UG(t,e,r){var n=uc(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},$R(t))MR(e,r);else if(r=uR(t,e,r,n),r!==null){var i=Ln();ks(r,t,n,i),NR(r,e,n)}}function zG(t,e,r){var n=uc(t),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if($R(t))MR(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,r);if(i.hasEagerState=!0,i.eagerState=a,Ps(a,o)){var c=e.interleaved;c===null?(i.next=i,oE(e)):(i.next=c.next,c.next=i),e.interleaved=i;return}}catch{}finally{}r=uR(t,e,i,n),r!==null&&(i=Ln(),ks(r,t,n,i),NR(r,e,n))}}function $R(t){var e=t.alternate;return t===lr||e!==null&&e===lr}function MR(t,e){Yh=Vm=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function NR(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,V8(t,r)}}var Gm={readContext:qi,useCallback:vn,useContext:vn,useEffect:vn,useImperativeHandle:vn,useInsertionEffect:vn,useLayoutEffect:vn,useMemo:vn,useReducer:vn,useRef:vn,useState:vn,useDebugValue:vn,useDeferredValue:vn,useTransition:vn,useMutableSource:vn,useSyncExternalStore:vn,useId:vn,unstable_isNewReconciler:!1},WG={readContext:qi,useCallback:function(t,e){return qs().memoizedState=[t,e===void 0?null:e],t},useContext:qi,useEffect:d7,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,Hv(4194308,4,_R.bind(null,e,t),r)},useLayoutEffect:function(t,e){return Hv(4194308,4,t,e)},useInsertionEffect:function(t,e){return Hv(4,2,t,e)},useMemo:function(t,e){var r=qs();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=qs();return e=r!==void 0?r(e):e,n.memoizedState=n.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},n.queue=t,t=t.dispatch=UG.bind(null,lr,t),[n.memoizedState,t]},useRef:function(t){var e=qs();return t={current:t},e.memoizedState=t},useState:f7,useDebugValue:vE,useDeferredValue:function(t){return qs().memoizedState=t},useTransition:function(){var t=f7(!1),e=t[0];return t=jG.bind(null,t[1]),qs().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=lr,i=qs();if(tr){if(r===void 0)throw Error(ce(407));r=r()}else{if(r=e(),Jr===null)throw Error(ce(349));Gl&30||bR(n,e,r)}i.memoizedState=r;var s={value:r,getSnapshot:e};return i.queue=s,d7(xR.bind(null,n,s,t),[t]),n.flags|=2048,z0(9,wR.bind(null,n,s,r,e),void 0,null),r},useId:function(){var t=qs(),e=Jr.identifierPrefix;if(tr){var r=jo,n=Fo;r=(n&~(1<<32-Ss(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=j0++,0<\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=o.createElement(r,{is:n.is}):(t=o.createElement(r),r==="select"&&(o=t,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):t=o.createElementNS(t,r),t[Xs]=e,t[L0]=n,HR(t,e,!1,!1),e.stateNode=t;e:{switch(o=p5(r,n),r){case"dialog":zt("cancel",t),zt("close",t),i=n;break;case"iframe":case"object":case"embed":zt("load",t),i=n;break;case"video":case"audio":for(i=0;iQf&&(e.flags|=128,n=!0,uh(s,!1),e.lanes=4194304)}else{if(!n)if(t=qm(o),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),uh(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!tr)return mn(e),null}else 2*Er()-s.renderingStartTime>Qf&&r!==1073741824&&(e.flags|=128,n=!0,uh(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(r=s.last,r!==null?r.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Er(),e.sibling=null,r=or.current,xt(or,n?r&1|2:r&1),e):(mn(e),null);case 22:case 23:return xE(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?fi&1073741824&&(mn(e),e.subtreeFlags&6&&(e.flags|=8192)):mn(e),null;case 24:return null;case 25:return null}throw Error(ce(156,e.tag))}function JG(t,e){switch(tE(e),e.tag){case 1:return ri(e.type)&&Bm(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Gf(),Vt(ti),Vt(An),uE(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return lE(e),null;case 13:if(Vt(or),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(ce(340));qf()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Vt(or),null;case 4:return Gf(),null;case 10:return sE(e.type._context),null;case 22:case 23:return xE(),null;case 24:return null;default:return null}}var Qp=!1,wn=!1,XG=typeof WeakSet=="function"?WeakSet:Set,fe=null;function ff(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){pr(t,e,n)}else r.current=null}function U5(t,e,r){try{r()}catch(n){pr(t,e,n)}}var x7=!1;function ZG(t,e){if(S5=Mm,t=YO(),Z8(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{r.nodeType,s.nodeType}catch{r=null;break e}var o=0,a=-1,c=-1,l=0,u=0,f=t,d=null;t:for(;;){for(var h;f!==r||i!==0&&f.nodeType!==3||(a=o+i),f!==s||n!==0&&f.nodeType!==3||(c=o+n),f.nodeType===3&&(o+=f.nodeValue.length),(h=f.firstChild)!==null;)d=f,f=h;for(;;){if(f===t)break t;if(d===r&&++l===i&&(a=o),d===s&&++u===n&&(c=o),(h=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=h}r=a===-1||c===-1?null:{start:a,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(k5={focusedElem:t,selectionRange:r},Mm=!1,fe=e;fe!==null;)if(e=fe,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,fe=t;else for(;fe!==null;){e=fe;try{var p=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var v=p.memoizedProps,m=p.memoizedState,g=e.stateNode,y=g.getSnapshotBeforeUpdate(e.elementType===e.type?v:ps(e.type,v),m);g.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var b=e.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ce(163))}}catch(C){pr(e,e.return,C)}if(t=e.sibling,t!==null){t.return=e.return,fe=t;break}fe=e.return}return p=x7,x7=!1,p}function Jh(t,e,r){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&U5(e,r,s)}i=i.next}while(i!==n)}}function Fg(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var n=r.create;r.destroy=n()}r=r.next}while(r!==e)}}function z5(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function GR(t){var e=t.alternate;e!==null&&(t.alternate=null,GR(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Xs],delete e[L0],delete e[P5],delete e[NG],delete e[DG])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function KR(t){return t.tag===5||t.tag===3||t.tag===4}function E7(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||KR(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function W5(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=Lm));else if(n!==4&&(t=t.child,t!==null))for(W5(t,e,r),t=t.sibling;t!==null;)W5(t,e,r),t=t.sibling}function H5(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(H5(t,e,r),t=t.sibling;t!==null;)H5(t,e,r),t=t.sibling}var tn=null,ms=!1;function Ia(t,e,r){for(r=r.child;r!==null;)QR(t,e,r),r=r.sibling}function QR(t,e,r){if(oo&&typeof oo.onCommitFiberUnmount=="function")try{oo.onCommitFiberUnmount(Og,r)}catch{}switch(r.tag){case 5:wn||ff(r,e);case 6:var n=tn,i=ms;tn=null,Ia(t,e,r),tn=n,ms=i,tn!==null&&(ms?(t=tn,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):tn.removeChild(r.stateNode));break;case 18:tn!==null&&(ms?(t=tn,r=r.stateNode,t.nodeType===8?pw(t.parentNode,r):t.nodeType===1&&pw(t,r),R0(t)):pw(tn,r.stateNode));break;case 4:n=tn,i=ms,tn=r.stateNode.containerInfo,ms=!0,Ia(t,e,r),tn=n,ms=i;break;case 0:case 11:case 14:case 15:if(!wn&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&U5(r,e,o),i=i.next}while(i!==n)}Ia(t,e,r);break;case 1:if(!wn&&(ff(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){pr(r,e,a)}Ia(t,e,r);break;case 21:Ia(t,e,r);break;case 22:r.mode&1?(wn=(n=wn)||r.memoizedState!==null,Ia(t,e,r),wn=n):Ia(t,e,r);break;default:Ia(t,e,r)}}function C7(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new XG),e.forEach(function(n){var i=cK.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}}function ss(t,e){var r=e.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~s}if(n=i,n=Er()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*tK(n/1960))-n,10t?16:t,Ya===null)var n=!1;else{if(t=Ya,Ya=null,Ym=0,it&6)throw Error(ce(331));var i=it;for(it|=4,fe=t.current;fe!==null;){var s=fe,o=s.child;if(fe.flags&16){var a=s.deletions;if(a!==null){for(var c=0;cEr()-bE?Rl(t,0):gE|=r),ni(t,e)}function n$(t,e){e===0&&(t.mode&1?(e=jp,jp<<=1,!(jp&130023424)&&(jp=4194304)):e=1);var r=Ln();t=Qo(t,e),t!==null&&(H1(t,e,r),ni(t,r))}function aK(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),n$(t,r)}function cK(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,i=t.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(ce(314))}n!==null&&n.delete(e),n$(t,r)}var i$;i$=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||ti.current)Xn=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return Xn=!1,QG(t,e,r);Xn=!!(t.flags&131072)}else Xn=!1,tr&&e.flags&1048576&&aR(e,Um,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;qv(t,e),t=e.pendingProps;var i=Hf(e,An.current);_f(e,r),i=dE(null,e,n,t,i,r);var s=hE();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,ri(n)?(s=!0,Fm(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,aE(e),i.updater=Lg,e.stateNode=i,i._reactInternals=e,M5(e,n,t,r),e=L5(null,e,n,!0,s,r)):(e.tag=0,tr&&s&&eE(e),$n(null,e,i,r),e=e.child),e;case 16:n=e.elementType;e:{switch(qv(t,e),t=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=uK(n),t=ps(n,t),i){case 0:e=D5(null,e,n,t,r);break e;case 1:e=g7(null,e,n,t,r);break e;case 11:e=m7(null,e,n,t,r);break e;case 14:e=y7(null,e,n,ps(n.type,t),r);break e}throw Error(ce(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:ps(n,i),D5(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:ps(n,i),g7(t,e,n,i,r);case 3:e:{if(UR(e),t===null)throw Error(ce(387));n=e.pendingProps,s=e.memoizedState,i=s.element,fR(t,e),Hm(e,n,null,r);var o=e.memoizedState;if(n=o.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=Kf(Error(ce(423)),e),e=b7(t,e,n,r,i);break e}else if(n!==i){i=Kf(Error(ce(424)),e),e=b7(t,e,n,r,i);break e}else for(yi=ac(e.stateNode.containerInfo.firstChild),gi=e,tr=!0,ys=null,r=vR(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(qf(),n===i){e=Yo(t,e,r);break e}$n(t,e,n,r)}e=e.child}return e;case 5:return mR(e),t===null&&O5(e),n=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,A5(n,i)?o=null:s!==null&&A5(n,s)&&(e.flags|=32),jR(t,e),$n(t,e,o,r),e.child;case 6:return t===null&&O5(e),null;case 13:return zR(t,e,r);case 4:return cE(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=Vf(e,null,n,r):$n(t,e,n,r),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:ps(n,i),m7(t,e,n,i,r);case 7:return $n(t,e,e.pendingProps,r),e.child;case 8:return $n(t,e,e.pendingProps.children,r),e.child;case 12:return $n(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(n=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,xt(zm,n._currentValue),n._currentValue=o,s!==null)if(Ps(s.value,o)){if(s.children===i.children&&!ti.current){e=Yo(t,e,r);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var c=a.firstContext;c!==null;){if(c.context===n){if(s.tag===1){c=Wo(-1,r&-r),c.tag=2;var l=s.updateQueue;if(l!==null){l=l.shared;var u=l.pending;u===null?c.next=c:(c.next=u.next,u.next=c),l.pending=c}}s.lanes|=r,c=s.alternate,c!==null&&(c.lanes|=r),R5(s.return,r,e),a.lanes|=r;break}c=c.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(ce(341));o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),R5(o,r,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}$n(t,e,i.children,r),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,_f(e,r),i=qi(i),n=n(i),e.flags|=1,$n(t,e,n,r),e.child;case 14:return n=e.type,i=ps(n,e.pendingProps),i=ps(n.type,i),y7(t,e,n,i,r);case 15:return BR(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:ps(n,i),qv(t,e),e.tag=1,ri(n)?(t=!0,Fm(e)):t=!1,_f(e,r),hR(e,n,i),M5(e,n,i,r),L5(null,e,n,!0,t,r);case 19:return WR(t,e,r);case 22:return FR(t,e,r)}throw Error(ce(156,e.tag))};function s$(t,e){return OO(t,e)}function lK(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function zi(t,e,r,n){return new lK(t,e,r,n)}function CE(t){return t=t.prototype,!(!t||!t.isReactComponent)}function uK(t){if(typeof t=="function")return CE(t)?1:0;if(t!=null){if(t=t.$$typeof,t===z8)return 11;if(t===W8)return 14}return 2}function fc(t,e){var r=t.alternate;return r===null?(r=zi(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function Kv(t,e,r,n,i,s){var o=2;if(n=t,typeof t=="function")CE(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case tf:return $l(r.children,i,s,e);case U8:o=8,i|=8;break;case i5:return t=zi(12,r,e,i|2),t.elementType=i5,t.lanes=s,t;case s5:return t=zi(13,r,e,i),t.elementType=s5,t.lanes=s,t;case o5:return t=zi(19,r,e,i),t.elementType=o5,t.lanes=s,t;case pO:return Ug(r,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case dO:o=10;break e;case hO:o=9;break e;case z8:o=11;break e;case W8:o=14;break e;case ja:o=16,n=null;break e}throw Error(ce(130,t==null?t:typeof t,""))}return e=zi(o,r,e,i),e.elementType=t,e.type=n,e.lanes=s,e}function $l(t,e,r,n){return t=zi(7,t,n,e),t.lanes=r,t}function Ug(t,e,r,n){return t=zi(22,t,n,e),t.elementType=pO,t.lanes=r,t.stateNode={isHidden:!1},t}function Ew(t,e,r){return t=zi(6,t,null,e),t.lanes=r,t}function Cw(t,e,r){return e=zi(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function fK(t,e,r,n,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=nw(0),this.expirationTimes=nw(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=nw(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function SE(t,e,r,n,i,s,o,a,c){return t=new fK(t,e,r,a,c),e===1?(e=1,s===!0&&(e|=8)):e=0,s=zi(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},aE(s),t}function dK(t,e,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l$)}catch(t){console.error(t)}}l$(),aO.exports=Ai;var $s=aO.exports;const yK=ki($s);var O7=$s;r5.createRoot=O7.createRoot,r5.hydrateRoot=O7.hydrateRoot;var PE={exports:{}};const gK={},bK=Object.freeze(Object.defineProperty({__proto__:null,default:gK},Symbol.toStringTag,{value:"Module"})),u$=QI(bK);PE.exports;(function(t){(function(e,r){function n(F,x){if(!F)throw new Error(x||"Assertion failed")}function i(F,x){F.super_=x;var P=function(){};P.prototype=x.prototype,F.prototype=new P,F.prototype.constructor=F}function s(F,x,P){if(s.isBN(F))return F;this.negative=0,this.words=null,this.length=0,this.red=null,F!==null&&((x==="le"||x==="be")&&(P=x,x=10),this._init(F||0,x||10,P||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=u$.Buffer}catch{}s.isBN=function(x){return x instanceof s?!0:x!==null&&typeof x=="object"&&x.constructor.wordSize===s.wordSize&&Array.isArray(x.words)},s.max=function(x,P){return x.cmp(P)>0?x:P},s.min=function(x,P){return x.cmp(P)<0?x:P},s.prototype._init=function(x,P,$){if(typeof x=="number")return this._initNumber(x,P,$);if(typeof x=="object")return this._initArray(x,P,$);P==="hex"&&(P=16),n(P===(P|0)&&P>=2&&P<=36),x=x.toString().replace(/\s+/g,"");var D=0;x[0]==="-"&&(D++,this.negative=1),D=0;D-=3)N=x[D]|x[D-1]<<8|x[D-2]<<16,this.words[_]|=N<>>26-L&67108863,L+=24,L>=26&&(L-=26,_++);else if($==="le")for(D=0,_=0;D>>26-L&67108863,L+=24,L>=26&&(L-=26,_++);return this._strip()};function a(F,x){var P=F.charCodeAt(x);if(P>=48&&P<=57)return P-48;if(P>=65&&P<=70)return P-55;if(P>=97&&P<=102)return P-87;n(!1,"Invalid character in "+F)}function c(F,x,P){var $=a(F,P);return P-1>=x&&($|=a(F,P-1)<<4),$}s.prototype._parseHex=function(x,P,$){this.length=Math.ceil((x.length-P)/6),this.words=new Array(this.length);for(var D=0;D=P;D-=2)L=c(x,P,D)<<_,this.words[N]|=L&67108863,_>=18?(_-=18,N+=1,this.words[N]|=L>>>26):_+=8;else{var R=x.length-P;for(D=R%2===0?P+1:P;D=18?(_-=18,N+=1,this.words[N]|=L>>>26):_+=8}this._strip()};function l(F,x,P,$){for(var D=0,_=0,N=Math.min(F.length,P),L=x;L=49?_=R-49+10:R>=17?_=R-17+10:_=R,n(R>=0&&_<$,"Invalid character"),D+=_}return D}s.prototype._parseBase=function(x,P,$){this.words=[0],this.length=1;for(var D=0,_=1;_<=67108863;_*=P)D++;D--,_=_/P|0;for(var N=x.length-$,L=N%D,R=Math.min(N,N-L)+$,E=0,M=$;M1&&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?""}var d=["","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"],h=[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],p=[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(x,P){x=x||10,P=P|0||1;var $;if(x===16||x==="hex"){$="";for(var D=0,_=0,N=0;N>>24-D&16777215,D+=2,D>=26&&(D-=26,N--),_!==0||N!==this.length-1?$=d[6-R.length]+R+$:$=R+$}for(_!==0&&($=_.toString(16)+$);$.length%P!==0;)$="0"+$;return this.negative!==0&&($="-"+$),$}if(x===(x|0)&&x>=2&&x<=36){var E=h[x],M=p[x];$="";var j=this.clone();for(j.negative=0;!j.isZero();){var T=j.modrn(M).toString(x);j=j.idivn(M),j.isZero()?$=T+$:$=d[E-T.length]+T+$}for(this.isZero()&&($="0"+$);$.length%P!==0;)$="0"+$;return this.negative!==0&&($="-"+$),$}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var x=this.words[0];return this.length===2?x+=this.words[1]*67108864:this.length===3&&this.words[2]===1?x+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-x:x},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(x,P){return this.toArrayLike(o,x,P)}),s.prototype.toArray=function(x,P){return this.toArrayLike(Array,x,P)};var v=function(x,P){return x.allocUnsafe?x.allocUnsafe(P):new x(P)};s.prototype.toArrayLike=function(x,P,$){this._strip();var D=this.byteLength(),_=$||Math.max(1,D);n(D<=_,"byte array longer than desired length"),n(_>0,"Requested array length <= 0");var N=v(x,_),L=P==="le"?"LE":"BE";return this["_toArrayLike"+L](N,D),N},s.prototype._toArrayLikeLE=function(x,P){for(var $=0,D=0,_=0,N=0;_>8&255),$>16&255),N===6?($>24&255),D=0,N=0):(D=L>>>24,N+=2)}if($=0&&(x[$--]=L>>8&255),$>=0&&(x[$--]=L>>16&255),N===6?($>=0&&(x[$--]=L>>24&255),D=0,N=0):(D=L>>>24,N+=2)}if($>=0)for(x[$--]=D;$>=0;)x[$--]=0},Math.clz32?s.prototype._countBits=function(x){return 32-Math.clz32(x)}:s.prototype._countBits=function(x){var P=x,$=0;return P>=4096&&($+=13,P>>>=13),P>=64&&($+=7,P>>>=7),P>=8&&($+=4,P>>>=4),P>=2&&($+=2,P>>>=2),$+P},s.prototype._zeroBits=function(x){if(x===0)return 26;var P=x,$=0;return P&8191||($+=13,P>>>=13),P&127||($+=7,P>>>=7),P&15||($+=4,P>>>=4),P&3||($+=2,P>>>=2),P&1||$++,$},s.prototype.bitLength=function(){var x=this.words[this.length-1],P=this._countBits(x);return(this.length-1)*26+P};function m(F){for(var x=new Array(F.bitLength()),P=0;P>>D&1}return x}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var x=0,P=0;Px.length?this.clone().ior(x):x.clone().ior(this)},s.prototype.uor=function(x){return this.length>x.length?this.clone().iuor(x):x.clone().iuor(this)},s.prototype.iuand=function(x){var P;this.length>x.length?P=x:P=this;for(var $=0;$x.length?this.clone().iand(x):x.clone().iand(this)},s.prototype.uand=function(x){return this.length>x.length?this.clone().iuand(x):x.clone().iuand(this)},s.prototype.iuxor=function(x){var P,$;this.length>x.length?(P=this,$=x):(P=x,$=this);for(var D=0;D<$.length;D++)this.words[D]=P.words[D]^$.words[D];if(this!==P)for(;Dx.length?this.clone().ixor(x):x.clone().ixor(this)},s.prototype.uxor=function(x){return this.length>x.length?this.clone().iuxor(x):x.clone().iuxor(this)},s.prototype.inotn=function(x){n(typeof x=="number"&&x>=0);var P=Math.ceil(x/26)|0,$=x%26;this._expand(P),$>0&&P--;for(var D=0;D0&&(this.words[D]=~this.words[D]&67108863>>26-$),this._strip()},s.prototype.notn=function(x){return this.clone().inotn(x)},s.prototype.setn=function(x,P){n(typeof x=="number"&&x>=0);var $=x/26|0,D=x%26;return this._expand($+1),P?this.words[$]=this.words[$]|1<x.length?($=this,D=x):($=x,D=this);for(var _=0,N=0;N>>26;for(;_!==0&&N<$.length;N++)P=($.words[N]|0)+_,this.words[N]=P&67108863,_=P>>>26;if(this.length=$.length,_!==0)this.words[this.length]=_,this.length++;else if($!==this)for(;N<$.length;N++)this.words[N]=$.words[N];return this},s.prototype.add=function(x){var P;return x.negative!==0&&this.negative===0?(x.negative=0,P=this.sub(x),x.negative^=1,P):x.negative===0&&this.negative!==0?(this.negative=0,P=x.sub(this),this.negative=1,P):this.length>x.length?this.clone().iadd(x):x.clone().iadd(this)},s.prototype.isub=function(x){if(x.negative!==0){x.negative=0;var P=this.iadd(x);return x.negative=1,P._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(x),this.negative=1,this._normSign();var $=this.cmp(x);if($===0)return this.negative=0,this.length=1,this.words[0]=0,this;var D,_;$>0?(D=this,_=x):(D=x,_=this);for(var N=0,L=0;L<_.length;L++)P=(D.words[L]|0)-(_.words[L]|0)+N,N=P>>26,this.words[L]=P&67108863;for(;N!==0&&L>26,this.words[L]=P&67108863;if(N===0&&L>>26,j=R&67108863,T=Math.min(E,x.length-1),U=Math.max(0,E-F.length+1);U<=T;U++){var W=E-U|0;D=F.words[W]|0,_=x.words[U]|0,N=D*_+j,M+=N/67108864|0,j=N&67108863}P.words[E]=j|0,R=M|0}return R!==0?P.words[E]=R|0:P.length--,P._strip()}var y=function(x,P,$){var D=x.words,_=P.words,N=$.words,L=0,R,E,M,j=D[0]|0,T=j&8191,U=j>>>13,W=D[1]|0,V=W&8191,G=W>>>13,J=D[2]|0,Y=J&8191,X=J>>>13,ae=D[3]|0,oe=ae&8191,ue=ae>>>13,tt=D[4]|0,Oe=tt&8191,Pe=tt>>>13,ct=D[5]|0,Ce=ct&8191,be=ct>>>13,Qt=D[6]|0,Re=Qt&8191,$e=Qt>>>13,Yt=D[7]|0,Me=Yt&8191,Ne=Yt>>>13,Jt=D[8]|0,De=Jt&8191,Le=Jt>>>13,Xt=D[9]|0,Be=Xt&8191,Fe=Xt>>>13,Zt=_[0]|0,je=Zt&8191,Ct=Zt>>>13,Zc=_[1]|0,St=Zc&8191,kt=Zc>>>13,el=_[2]|0,At=el&8191,_t=el>>>13,tl=_[3]|0,Pt=tl&8191,Tt=tl>>>13,rl=_[4]|0,It=rl&8191,Ot=rl>>>13,nl=_[5]|0,Rt=nl&8191,$t=nl>>>13,il=_[6]|0,Mt=il&8191,Nt=il>>>13,sl=_[7]|0,Dt=sl&8191,Lt=sl>>>13,ol=_[8]|0,Bt=ol&8191,Ft=ol>>>13,al=_[9]|0,jt=al&8191,Ut=al>>>13;$.negative=x.negative^P.negative,$.length=19,R=Math.imul(T,je),E=Math.imul(T,Ct),E=E+Math.imul(U,je)|0,M=Math.imul(U,Ct);var ka=(L+R|0)+((E&8191)<<13)|0;L=(M+(E>>>13)|0)+(ka>>>26)|0,ka&=67108863,R=Math.imul(V,je),E=Math.imul(V,Ct),E=E+Math.imul(G,je)|0,M=Math.imul(G,Ct),R=R+Math.imul(T,St)|0,E=E+Math.imul(T,kt)|0,E=E+Math.imul(U,St)|0,M=M+Math.imul(U,kt)|0;var Aa=(L+R|0)+((E&8191)<<13)|0;L=(M+(E>>>13)|0)+(Aa>>>26)|0,Aa&=67108863,R=Math.imul(Y,je),E=Math.imul(Y,Ct),E=E+Math.imul(X,je)|0,M=Math.imul(X,Ct),R=R+Math.imul(V,St)|0,E=E+Math.imul(V,kt)|0,E=E+Math.imul(G,St)|0,M=M+Math.imul(G,kt)|0,R=R+Math.imul(T,At)|0,E=E+Math.imul(T,_t)|0,E=E+Math.imul(U,At)|0,M=M+Math.imul(U,_t)|0;var _a=(L+R|0)+((E&8191)<<13)|0;L=(M+(E>>>13)|0)+(_a>>>26)|0,_a&=67108863,R=Math.imul(oe,je),E=Math.imul(oe,Ct),E=E+Math.imul(ue,je)|0,M=Math.imul(ue,Ct),R=R+Math.imul(Y,St)|0,E=E+Math.imul(Y,kt)|0,E=E+Math.imul(X,St)|0,M=M+Math.imul(X,kt)|0,R=R+Math.imul(V,At)|0,E=E+Math.imul(V,_t)|0,E=E+Math.imul(G,At)|0,M=M+Math.imul(G,_t)|0,R=R+Math.imul(T,Pt)|0,E=E+Math.imul(T,Tt)|0,E=E+Math.imul(U,Pt)|0,M=M+Math.imul(U,Tt)|0;var Pa=(L+R|0)+((E&8191)<<13)|0;L=(M+(E>>>13)|0)+(Pa>>>26)|0,Pa&=67108863,R=Math.imul(Oe,je),E=Math.imul(Oe,Ct),E=E+Math.imul(Pe,je)|0,M=Math.imul(Pe,Ct),R=R+Math.imul(oe,St)|0,E=E+Math.imul(oe,kt)|0,E=E+Math.imul(ue,St)|0,M=M+Math.imul(ue,kt)|0,R=R+Math.imul(Y,At)|0,E=E+Math.imul(Y,_t)|0,E=E+Math.imul(X,At)|0,M=M+Math.imul(X,_t)|0,R=R+Math.imul(V,Pt)|0,E=E+Math.imul(V,Tt)|0,E=E+Math.imul(G,Pt)|0,M=M+Math.imul(G,Tt)|0,R=R+Math.imul(T,It)|0,E=E+Math.imul(T,Ot)|0,E=E+Math.imul(U,It)|0,M=M+Math.imul(U,Ot)|0;var Ta=(L+R|0)+((E&8191)<<13)|0;L=(M+(E>>>13)|0)+(Ta>>>26)|0,Ta&=67108863,R=Math.imul(Ce,je),E=Math.imul(Ce,Ct),E=E+Math.imul(be,je)|0,M=Math.imul(be,Ct),R=R+Math.imul(Oe,St)|0,E=E+Math.imul(Oe,kt)|0,E=E+Math.imul(Pe,St)|0,M=M+Math.imul(Pe,kt)|0,R=R+Math.imul(oe,At)|0,E=E+Math.imul(oe,_t)|0,E=E+Math.imul(ue,At)|0,M=M+Math.imul(ue,_t)|0,R=R+Math.imul(Y,Pt)|0,E=E+Math.imul(Y,Tt)|0,E=E+Math.imul(X,Pt)|0,M=M+Math.imul(X,Tt)|0,R=R+Math.imul(V,It)|0,E=E+Math.imul(V,Ot)|0,E=E+Math.imul(G,It)|0,M=M+Math.imul(G,Ot)|0,R=R+Math.imul(T,Rt)|0,E=E+Math.imul(T,$t)|0,E=E+Math.imul(U,Rt)|0,M=M+Math.imul(U,$t)|0;var B2=(L+R|0)+((E&8191)<<13)|0;L=(M+(E>>>13)|0)+(B2>>>26)|0,B2&=67108863,R=Math.imul(Re,je),E=Math.imul(Re,Ct),E=E+Math.imul($e,je)|0,M=Math.imul($e,Ct),R=R+Math.imul(Ce,St)|0,E=E+Math.imul(Ce,kt)|0,E=E+Math.imul(be,St)|0,M=M+Math.imul(be,kt)|0,R=R+Math.imul(Oe,At)|0,E=E+Math.imul(Oe,_t)|0,E=E+Math.imul(Pe,At)|0,M=M+Math.imul(Pe,_t)|0,R=R+Math.imul(oe,Pt)|0,E=E+Math.imul(oe,Tt)|0,E=E+Math.imul(ue,Pt)|0,M=M+Math.imul(ue,Tt)|0,R=R+Math.imul(Y,It)|0,E=E+Math.imul(Y,Ot)|0,E=E+Math.imul(X,It)|0,M=M+Math.imul(X,Ot)|0,R=R+Math.imul(V,Rt)|0,E=E+Math.imul(V,$t)|0,E=E+Math.imul(G,Rt)|0,M=M+Math.imul(G,$t)|0,R=R+Math.imul(T,Mt)|0,E=E+Math.imul(T,Nt)|0,E=E+Math.imul(U,Mt)|0,M=M+Math.imul(U,Nt)|0;var F2=(L+R|0)+((E&8191)<<13)|0;L=(M+(E>>>13)|0)+(F2>>>26)|0,F2&=67108863,R=Math.imul(Me,je),E=Math.imul(Me,Ct),E=E+Math.imul(Ne,je)|0,M=Math.imul(Ne,Ct),R=R+Math.imul(Re,St)|0,E=E+Math.imul(Re,kt)|0,E=E+Math.imul($e,St)|0,M=M+Math.imul($e,kt)|0,R=R+Math.imul(Ce,At)|0,E=E+Math.imul(Ce,_t)|0,E=E+Math.imul(be,At)|0,M=M+Math.imul(be,_t)|0,R=R+Math.imul(Oe,Pt)|0,E=E+Math.imul(Oe,Tt)|0,E=E+Math.imul(Pe,Pt)|0,M=M+Math.imul(Pe,Tt)|0,R=R+Math.imul(oe,It)|0,E=E+Math.imul(oe,Ot)|0,E=E+Math.imul(ue,It)|0,M=M+Math.imul(ue,Ot)|0,R=R+Math.imul(Y,Rt)|0,E=E+Math.imul(Y,$t)|0,E=E+Math.imul(X,Rt)|0,M=M+Math.imul(X,$t)|0,R=R+Math.imul(V,Mt)|0,E=E+Math.imul(V,Nt)|0,E=E+Math.imul(G,Mt)|0,M=M+Math.imul(G,Nt)|0,R=R+Math.imul(T,Dt)|0,E=E+Math.imul(T,Lt)|0,E=E+Math.imul(U,Dt)|0,M=M+Math.imul(U,Lt)|0;var j2=(L+R|0)+((E&8191)<<13)|0;L=(M+(E>>>13)|0)+(j2>>>26)|0,j2&=67108863,R=Math.imul(De,je),E=Math.imul(De,Ct),E=E+Math.imul(Le,je)|0,M=Math.imul(Le,Ct),R=R+Math.imul(Me,St)|0,E=E+Math.imul(Me,kt)|0,E=E+Math.imul(Ne,St)|0,M=M+Math.imul(Ne,kt)|0,R=R+Math.imul(Re,At)|0,E=E+Math.imul(Re,_t)|0,E=E+Math.imul($e,At)|0,M=M+Math.imul($e,_t)|0,R=R+Math.imul(Ce,Pt)|0,E=E+Math.imul(Ce,Tt)|0,E=E+Math.imul(be,Pt)|0,M=M+Math.imul(be,Tt)|0,R=R+Math.imul(Oe,It)|0,E=E+Math.imul(Oe,Ot)|0,E=E+Math.imul(Pe,It)|0,M=M+Math.imul(Pe,Ot)|0,R=R+Math.imul(oe,Rt)|0,E=E+Math.imul(oe,$t)|0,E=E+Math.imul(ue,Rt)|0,M=M+Math.imul(ue,$t)|0,R=R+Math.imul(Y,Mt)|0,E=E+Math.imul(Y,Nt)|0,E=E+Math.imul(X,Mt)|0,M=M+Math.imul(X,Nt)|0,R=R+Math.imul(V,Dt)|0,E=E+Math.imul(V,Lt)|0,E=E+Math.imul(G,Dt)|0,M=M+Math.imul(G,Lt)|0,R=R+Math.imul(T,Bt)|0,E=E+Math.imul(T,Ft)|0,E=E+Math.imul(U,Bt)|0,M=M+Math.imul(U,Ft)|0;var U2=(L+R|0)+((E&8191)<<13)|0;L=(M+(E>>>13)|0)+(U2>>>26)|0,U2&=67108863,R=Math.imul(Be,je),E=Math.imul(Be,Ct),E=E+Math.imul(Fe,je)|0,M=Math.imul(Fe,Ct),R=R+Math.imul(De,St)|0,E=E+Math.imul(De,kt)|0,E=E+Math.imul(Le,St)|0,M=M+Math.imul(Le,kt)|0,R=R+Math.imul(Me,At)|0,E=E+Math.imul(Me,_t)|0,E=E+Math.imul(Ne,At)|0,M=M+Math.imul(Ne,_t)|0,R=R+Math.imul(Re,Pt)|0,E=E+Math.imul(Re,Tt)|0,E=E+Math.imul($e,Pt)|0,M=M+Math.imul($e,Tt)|0,R=R+Math.imul(Ce,It)|0,E=E+Math.imul(Ce,Ot)|0,E=E+Math.imul(be,It)|0,M=M+Math.imul(be,Ot)|0,R=R+Math.imul(Oe,Rt)|0,E=E+Math.imul(Oe,$t)|0,E=E+Math.imul(Pe,Rt)|0,M=M+Math.imul(Pe,$t)|0,R=R+Math.imul(oe,Mt)|0,E=E+Math.imul(oe,Nt)|0,E=E+Math.imul(ue,Mt)|0,M=M+Math.imul(ue,Nt)|0,R=R+Math.imul(Y,Dt)|0,E=E+Math.imul(Y,Lt)|0,E=E+Math.imul(X,Dt)|0,M=M+Math.imul(X,Lt)|0,R=R+Math.imul(V,Bt)|0,E=E+Math.imul(V,Ft)|0,E=E+Math.imul(G,Bt)|0,M=M+Math.imul(G,Ft)|0,R=R+Math.imul(T,jt)|0,E=E+Math.imul(T,Ut)|0,E=E+Math.imul(U,jt)|0,M=M+Math.imul(U,Ut)|0;var z2=(L+R|0)+((E&8191)<<13)|0;L=(M+(E>>>13)|0)+(z2>>>26)|0,z2&=67108863,R=Math.imul(Be,St),E=Math.imul(Be,kt),E=E+Math.imul(Fe,St)|0,M=Math.imul(Fe,kt),R=R+Math.imul(De,At)|0,E=E+Math.imul(De,_t)|0,E=E+Math.imul(Le,At)|0,M=M+Math.imul(Le,_t)|0,R=R+Math.imul(Me,Pt)|0,E=E+Math.imul(Me,Tt)|0,E=E+Math.imul(Ne,Pt)|0,M=M+Math.imul(Ne,Tt)|0,R=R+Math.imul(Re,It)|0,E=E+Math.imul(Re,Ot)|0,E=E+Math.imul($e,It)|0,M=M+Math.imul($e,Ot)|0,R=R+Math.imul(Ce,Rt)|0,E=E+Math.imul(Ce,$t)|0,E=E+Math.imul(be,Rt)|0,M=M+Math.imul(be,$t)|0,R=R+Math.imul(Oe,Mt)|0,E=E+Math.imul(Oe,Nt)|0,E=E+Math.imul(Pe,Mt)|0,M=M+Math.imul(Pe,Nt)|0,R=R+Math.imul(oe,Dt)|0,E=E+Math.imul(oe,Lt)|0,E=E+Math.imul(ue,Dt)|0,M=M+Math.imul(ue,Lt)|0,R=R+Math.imul(Y,Bt)|0,E=E+Math.imul(Y,Ft)|0,E=E+Math.imul(X,Bt)|0,M=M+Math.imul(X,Ft)|0,R=R+Math.imul(V,jt)|0,E=E+Math.imul(V,Ut)|0,E=E+Math.imul(G,jt)|0,M=M+Math.imul(G,Ut)|0;var W2=(L+R|0)+((E&8191)<<13)|0;L=(M+(E>>>13)|0)+(W2>>>26)|0,W2&=67108863,R=Math.imul(Be,At),E=Math.imul(Be,_t),E=E+Math.imul(Fe,At)|0,M=Math.imul(Fe,_t),R=R+Math.imul(De,Pt)|0,E=E+Math.imul(De,Tt)|0,E=E+Math.imul(Le,Pt)|0,M=M+Math.imul(Le,Tt)|0,R=R+Math.imul(Me,It)|0,E=E+Math.imul(Me,Ot)|0,E=E+Math.imul(Ne,It)|0,M=M+Math.imul(Ne,Ot)|0,R=R+Math.imul(Re,Rt)|0,E=E+Math.imul(Re,$t)|0,E=E+Math.imul($e,Rt)|0,M=M+Math.imul($e,$t)|0,R=R+Math.imul(Ce,Mt)|0,E=E+Math.imul(Ce,Nt)|0,E=E+Math.imul(be,Mt)|0,M=M+Math.imul(be,Nt)|0,R=R+Math.imul(Oe,Dt)|0,E=E+Math.imul(Oe,Lt)|0,E=E+Math.imul(Pe,Dt)|0,M=M+Math.imul(Pe,Lt)|0,R=R+Math.imul(oe,Bt)|0,E=E+Math.imul(oe,Ft)|0,E=E+Math.imul(ue,Bt)|0,M=M+Math.imul(ue,Ft)|0,R=R+Math.imul(Y,jt)|0,E=E+Math.imul(Y,Ut)|0,E=E+Math.imul(X,jt)|0,M=M+Math.imul(X,Ut)|0;var H2=(L+R|0)+((E&8191)<<13)|0;L=(M+(E>>>13)|0)+(H2>>>26)|0,H2&=67108863,R=Math.imul(Be,Pt),E=Math.imul(Be,Tt),E=E+Math.imul(Fe,Pt)|0,M=Math.imul(Fe,Tt),R=R+Math.imul(De,It)|0,E=E+Math.imul(De,Ot)|0,E=E+Math.imul(Le,It)|0,M=M+Math.imul(Le,Ot)|0,R=R+Math.imul(Me,Rt)|0,E=E+Math.imul(Me,$t)|0,E=E+Math.imul(Ne,Rt)|0,M=M+Math.imul(Ne,$t)|0,R=R+Math.imul(Re,Mt)|0,E=E+Math.imul(Re,Nt)|0,E=E+Math.imul($e,Mt)|0,M=M+Math.imul($e,Nt)|0,R=R+Math.imul(Ce,Dt)|0,E=E+Math.imul(Ce,Lt)|0,E=E+Math.imul(be,Dt)|0,M=M+Math.imul(be,Lt)|0,R=R+Math.imul(Oe,Bt)|0,E=E+Math.imul(Oe,Ft)|0,E=E+Math.imul(Pe,Bt)|0,M=M+Math.imul(Pe,Ft)|0,R=R+Math.imul(oe,jt)|0,E=E+Math.imul(oe,Ut)|0,E=E+Math.imul(ue,jt)|0,M=M+Math.imul(ue,Ut)|0;var q2=(L+R|0)+((E&8191)<<13)|0;L=(M+(E>>>13)|0)+(q2>>>26)|0,q2&=67108863,R=Math.imul(Be,It),E=Math.imul(Be,Ot),E=E+Math.imul(Fe,It)|0,M=Math.imul(Fe,Ot),R=R+Math.imul(De,Rt)|0,E=E+Math.imul(De,$t)|0,E=E+Math.imul(Le,Rt)|0,M=M+Math.imul(Le,$t)|0,R=R+Math.imul(Me,Mt)|0,E=E+Math.imul(Me,Nt)|0,E=E+Math.imul(Ne,Mt)|0,M=M+Math.imul(Ne,Nt)|0,R=R+Math.imul(Re,Dt)|0,E=E+Math.imul(Re,Lt)|0,E=E+Math.imul($e,Dt)|0,M=M+Math.imul($e,Lt)|0,R=R+Math.imul(Ce,Bt)|0,E=E+Math.imul(Ce,Ft)|0,E=E+Math.imul(be,Bt)|0,M=M+Math.imul(be,Ft)|0,R=R+Math.imul(Oe,jt)|0,E=E+Math.imul(Oe,Ut)|0,E=E+Math.imul(Pe,jt)|0,M=M+Math.imul(Pe,Ut)|0;var V2=(L+R|0)+((E&8191)<<13)|0;L=(M+(E>>>13)|0)+(V2>>>26)|0,V2&=67108863,R=Math.imul(Be,Rt),E=Math.imul(Be,$t),E=E+Math.imul(Fe,Rt)|0,M=Math.imul(Fe,$t),R=R+Math.imul(De,Mt)|0,E=E+Math.imul(De,Nt)|0,E=E+Math.imul(Le,Mt)|0,M=M+Math.imul(Le,Nt)|0,R=R+Math.imul(Me,Dt)|0,E=E+Math.imul(Me,Lt)|0,E=E+Math.imul(Ne,Dt)|0,M=M+Math.imul(Ne,Lt)|0,R=R+Math.imul(Re,Bt)|0,E=E+Math.imul(Re,Ft)|0,E=E+Math.imul($e,Bt)|0,M=M+Math.imul($e,Ft)|0,R=R+Math.imul(Ce,jt)|0,E=E+Math.imul(Ce,Ut)|0,E=E+Math.imul(be,jt)|0,M=M+Math.imul(be,Ut)|0;var G2=(L+R|0)+((E&8191)<<13)|0;L=(M+(E>>>13)|0)+(G2>>>26)|0,G2&=67108863,R=Math.imul(Be,Mt),E=Math.imul(Be,Nt),E=E+Math.imul(Fe,Mt)|0,M=Math.imul(Fe,Nt),R=R+Math.imul(De,Dt)|0,E=E+Math.imul(De,Lt)|0,E=E+Math.imul(Le,Dt)|0,M=M+Math.imul(Le,Lt)|0,R=R+Math.imul(Me,Bt)|0,E=E+Math.imul(Me,Ft)|0,E=E+Math.imul(Ne,Bt)|0,M=M+Math.imul(Ne,Ft)|0,R=R+Math.imul(Re,jt)|0,E=E+Math.imul(Re,Ut)|0,E=E+Math.imul($e,jt)|0,M=M+Math.imul($e,Ut)|0;var K2=(L+R|0)+((E&8191)<<13)|0;L=(M+(E>>>13)|0)+(K2>>>26)|0,K2&=67108863,R=Math.imul(Be,Dt),E=Math.imul(Be,Lt),E=E+Math.imul(Fe,Dt)|0,M=Math.imul(Fe,Lt),R=R+Math.imul(De,Bt)|0,E=E+Math.imul(De,Ft)|0,E=E+Math.imul(Le,Bt)|0,M=M+Math.imul(Le,Ft)|0,R=R+Math.imul(Me,jt)|0,E=E+Math.imul(Me,Ut)|0,E=E+Math.imul(Ne,jt)|0,M=M+Math.imul(Ne,Ut)|0;var Q2=(L+R|0)+((E&8191)<<13)|0;L=(M+(E>>>13)|0)+(Q2>>>26)|0,Q2&=67108863,R=Math.imul(Be,Bt),E=Math.imul(Be,Ft),E=E+Math.imul(Fe,Bt)|0,M=Math.imul(Fe,Ft),R=R+Math.imul(De,jt)|0,E=E+Math.imul(De,Ut)|0,E=E+Math.imul(Le,jt)|0,M=M+Math.imul(Le,Ut)|0;var Y2=(L+R|0)+((E&8191)<<13)|0;L=(M+(E>>>13)|0)+(Y2>>>26)|0,Y2&=67108863,R=Math.imul(Be,jt),E=Math.imul(Be,Ut),E=E+Math.imul(Fe,jt)|0,M=Math.imul(Fe,Ut);var J2=(L+R|0)+((E&8191)<<13)|0;return L=(M+(E>>>13)|0)+(J2>>>26)|0,J2&=67108863,N[0]=ka,N[1]=Aa,N[2]=_a,N[3]=Pa,N[4]=Ta,N[5]=B2,N[6]=F2,N[7]=j2,N[8]=U2,N[9]=z2,N[10]=W2,N[11]=H2,N[12]=q2,N[13]=V2,N[14]=G2,N[15]=K2,N[16]=Q2,N[17]=Y2,N[18]=J2,L!==0&&(N[19]=L,$.length++),$};Math.imul||(y=g);function b(F,x,P){P.negative=x.negative^F.negative,P.length=F.length+x.length;for(var $=0,D=0,_=0;_>>26)|0,D+=N>>>26,N&=67108863}P.words[_]=L,$=N,N=D}return $!==0?P.words[_]=$:P.length--,P._strip()}function C(F,x,P){return b(F,x,P)}s.prototype.mulTo=function(x,P){var $,D=this.length+x.length;return this.length===10&&x.length===10?$=y(this,x,P):D<63?$=g(this,x,P):D<1024?$=b(this,x,P):$=C(this,x,P),$},s.prototype.mul=function(x){var P=new s(null);return P.words=new Array(this.length+x.length),this.mulTo(x,P)},s.prototype.mulf=function(x){var P=new s(null);return P.words=new Array(this.length+x.length),C(this,x,P)},s.prototype.imul=function(x){return this.clone().mulTo(x,this)},s.prototype.imuln=function(x){var P=x<0;P&&(x=-x),n(typeof x=="number"),n(x<67108864);for(var $=0,D=0;D>=26,$+=_/67108864|0,$+=N>>>26,this.words[D]=N&67108863}return $!==0&&(this.words[D]=$,this.length++),P?this.ineg():this},s.prototype.muln=function(x){return this.clone().imuln(x)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(x){var P=m(x);if(P.length===0)return new s(1);for(var $=this,D=0;D=0);var P=x%26,$=(x-P)/26,D=67108863>>>26-P<<26-P,_;if(P!==0){var N=0;for(_=0;_>>26-P}N&&(this.words[_]=N,this.length++)}if($!==0){for(_=this.length-1;_>=0;_--)this.words[_+$]=this.words[_];for(_=0;_<$;_++)this.words[_]=0;this.length+=$}return this._strip()},s.prototype.ishln=function(x){return n(this.negative===0),this.iushln(x)},s.prototype.iushrn=function(x,P,$){n(typeof x=="number"&&x>=0);var D;P?D=(P-P%26)/26:D=0;var _=x%26,N=Math.min((x-_)/26,this.length),L=67108863^67108863>>>_<<_,R=$;if(D-=N,D=Math.max(0,D),R){for(var E=0;EN)for(this.length-=N,E=0;E=0&&(M!==0||E>=D);E--){var j=this.words[E]|0;this.words[E]=M<<26-_|j>>>_,M=j&L}return R&&M!==0&&(R.words[R.length++]=M),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(x,P,$){return n(this.negative===0),this.iushrn(x,P,$)},s.prototype.shln=function(x){return this.clone().ishln(x)},s.prototype.ushln=function(x){return this.clone().iushln(x)},s.prototype.shrn=function(x){return this.clone().ishrn(x)},s.prototype.ushrn=function(x){return this.clone().iushrn(x)},s.prototype.testn=function(x){n(typeof x=="number"&&x>=0);var P=x%26,$=(x-P)/26,D=1<=0);var P=x%26,$=(x-P)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=$)return this;if(P!==0&&$++,this.length=Math.min($,this.length),P!==0){var D=67108863^67108863>>>P<=67108864;P++)this.words[P]-=67108864,P===this.length-1?this.words[P+1]=1:this.words[P+1]++;return this.length=Math.max(this.length,P+1),this},s.prototype.isubn=function(x){if(n(typeof x=="number"),n(x<67108864),x<0)return this.iaddn(-x);if(this.negative!==0)return this.negative=0,this.iaddn(x),this.negative=1,this;if(this.words[0]-=x,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var P=0;P>26)-(R/67108864|0),this.words[_+$]=N&67108863}for(;_>26,this.words[_+$]=N&67108863;if(L===0)return this._strip();for(n(L===-1),L=0,_=0;_>26,this.words[_]=N&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(x,P){var $=this.length-x.length,D=this.clone(),_=x,N=_.words[_.length-1]|0,L=this._countBits(N);$=26-L,$!==0&&(_=_.ushln($),D.iushln($),N=_.words[_.length-1]|0);var R=D.length-_.length,E;if(P!=="mod"){E=new s(null),E.length=R+1,E.words=new Array(E.length);for(var M=0;M=0;T--){var U=(D.words[_.length+T]|0)*67108864+(D.words[_.length+T-1]|0);for(U=Math.min(U/N|0,67108863),D._ishlnsubmul(_,U,T);D.negative!==0;)U--,D.negative=0,D._ishlnsubmul(_,1,T),D.isZero()||(D.negative^=1);E&&(E.words[T]=U)}return E&&E._strip(),D._strip(),P!=="div"&&$!==0&&D.iushrn($),{div:E||null,mod:D}},s.prototype.divmod=function(x,P,$){if(n(!x.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var D,_,N;return this.negative!==0&&x.negative===0?(N=this.neg().divmod(x,P),P!=="mod"&&(D=N.div.neg()),P!=="div"&&(_=N.mod.neg(),$&&_.negative!==0&&_.iadd(x)),{div:D,mod:_}):this.negative===0&&x.negative!==0?(N=this.divmod(x.neg(),P),P!=="mod"&&(D=N.div.neg()),{div:D,mod:N.mod}):this.negative&x.negative?(N=this.neg().divmod(x.neg(),P),P!=="div"&&(_=N.mod.neg(),$&&_.negative!==0&&_.isub(x)),{div:N.div,mod:_}):x.length>this.length||this.cmp(x)<0?{div:new s(0),mod:this}:x.length===1?P==="div"?{div:this.divn(x.words[0]),mod:null}:P==="mod"?{div:null,mod:new s(this.modrn(x.words[0]))}:{div:this.divn(x.words[0]),mod:new s(this.modrn(x.words[0]))}:this._wordDiv(x,P)},s.prototype.div=function(x){return this.divmod(x,"div",!1).div},s.prototype.mod=function(x){return this.divmod(x,"mod",!1).mod},s.prototype.umod=function(x){return this.divmod(x,"mod",!0).mod},s.prototype.divRound=function(x){var P=this.divmod(x);if(P.mod.isZero())return P.div;var $=P.div.negative!==0?P.mod.isub(x):P.mod,D=x.ushrn(1),_=x.andln(1),N=$.cmp(D);return N<0||_===1&&N===0?P.div:P.div.negative!==0?P.div.isubn(1):P.div.iaddn(1)},s.prototype.modrn=function(x){var P=x<0;P&&(x=-x),n(x<=67108863);for(var $=(1<<26)%x,D=0,_=this.length-1;_>=0;_--)D=($*D+(this.words[_]|0))%x;return P?-D:D},s.prototype.modn=function(x){return this.modrn(x)},s.prototype.idivn=function(x){var P=x<0;P&&(x=-x),n(x<=67108863);for(var $=0,D=this.length-1;D>=0;D--){var _=(this.words[D]|0)+$*67108864;this.words[D]=_/x|0,$=_%x}return this._strip(),P?this.ineg():this},s.prototype.divn=function(x){return this.clone().idivn(x)},s.prototype.egcd=function(x){n(x.negative===0),n(!x.isZero());var P=this,$=x.clone();P.negative!==0?P=P.umod(x):P=P.clone();for(var D=new s(1),_=new s(0),N=new s(0),L=new s(1),R=0;P.isEven()&&$.isEven();)P.iushrn(1),$.iushrn(1),++R;for(var E=$.clone(),M=P.clone();!P.isZero();){for(var j=0,T=1;!(P.words[0]&T)&&j<26;++j,T<<=1);if(j>0)for(P.iushrn(j);j-- >0;)(D.isOdd()||_.isOdd())&&(D.iadd(E),_.isub(M)),D.iushrn(1),_.iushrn(1);for(var U=0,W=1;!($.words[0]&W)&&U<26;++U,W<<=1);if(U>0)for($.iushrn(U);U-- >0;)(N.isOdd()||L.isOdd())&&(N.iadd(E),L.isub(M)),N.iushrn(1),L.iushrn(1);P.cmp($)>=0?(P.isub($),D.isub(N),_.isub(L)):($.isub(P),N.isub(D),L.isub(_))}return{a:N,b:L,gcd:$.iushln(R)}},s.prototype._invmp=function(x){n(x.negative===0),n(!x.isZero());var P=this,$=x.clone();P.negative!==0?P=P.umod(x):P=P.clone();for(var D=new s(1),_=new s(0),N=$.clone();P.cmpn(1)>0&&$.cmpn(1)>0;){for(var L=0,R=1;!(P.words[0]&R)&&L<26;++L,R<<=1);if(L>0)for(P.iushrn(L);L-- >0;)D.isOdd()&&D.iadd(N),D.iushrn(1);for(var E=0,M=1;!($.words[0]&M)&&E<26;++E,M<<=1);if(E>0)for($.iushrn(E);E-- >0;)_.isOdd()&&_.iadd(N),_.iushrn(1);P.cmp($)>=0?(P.isub($),D.isub(_)):($.isub(P),_.isub(D))}var j;return P.cmpn(1)===0?j=D:j=_,j.cmpn(0)<0&&j.iadd(x),j},s.prototype.gcd=function(x){if(this.isZero())return x.abs();if(x.isZero())return this.abs();var P=this.clone(),$=x.clone();P.negative=0,$.negative=0;for(var D=0;P.isEven()&&$.isEven();D++)P.iushrn(1),$.iushrn(1);do{for(;P.isEven();)P.iushrn(1);for(;$.isEven();)$.iushrn(1);var _=P.cmp($);if(_<0){var N=P;P=$,$=N}else if(_===0||$.cmpn(1)===0)break;P.isub($)}while(!0);return $.iushln(D)},s.prototype.invm=function(x){return this.egcd(x).a.umod(x)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(x){return this.words[0]&x},s.prototype.bincn=function(x){n(typeof x=="number");var P=x%26,$=(x-P)/26,D=1<>>26,L&=67108863,this.words[N]=L}return _!==0&&(this.words[N]=_,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(x){var P=x<0;if(this.negative!==0&&!P)return-1;if(this.negative===0&&P)return 1;this._strip();var $;if(this.length>1)$=1;else{P&&(x=-x),n(x<=67108863,"Number is too big");var D=this.words[0]|0;$=D===x?0:Dx.length)return 1;if(this.length=0;$--){var D=this.words[$]|0,_=x.words[$]|0;if(D!==_){D<_?P=-1:D>_&&(P=1);break}}return P},s.prototype.gtn=function(x){return this.cmpn(x)===1},s.prototype.gt=function(x){return this.cmp(x)===1},s.prototype.gten=function(x){return this.cmpn(x)>=0},s.prototype.gte=function(x){return this.cmp(x)>=0},s.prototype.ltn=function(x){return this.cmpn(x)===-1},s.prototype.lt=function(x){return this.cmp(x)===-1},s.prototype.lten=function(x){return this.cmpn(x)<=0},s.prototype.lte=function(x){return this.cmp(x)<=0},s.prototype.eqn=function(x){return this.cmpn(x)===0},s.prototype.eq=function(x){return this.cmp(x)===0},s.red=function(x){return new H(x)},s.prototype.toRed=function(x){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),x.convertTo(this)._forceRed(x)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(x){return this.red=x,this},s.prototype.forceRed=function(x){return n(!this.red,"Already a number in reduction context"),this._forceRed(x)},s.prototype.redAdd=function(x){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,x)},s.prototype.redIAdd=function(x){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,x)},s.prototype.redSub=function(x){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,x)},s.prototype.redISub=function(x){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,x)},s.prototype.redShl=function(x){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,x)},s.prototype.redMul=function(x){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,x),this.red.mul(this,x)},s.prototype.redIMul=function(x){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,x),this.red.imul(this,x)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(x){return n(this.red&&!x.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,x)};var A={k256:null,p224:null,p192:null,p25519:null};function O(F,x){this.name=F,this.p=new s(x,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}O.prototype._tmp=function(){var x=new s(null);return x.words=new Array(Math.ceil(this.n/13)),x},O.prototype.ireduce=function(x){var P=x,$;do this.split(P,this.tmp),P=this.imulK(P),P=P.iadd(this.tmp),$=P.bitLength();while($>this.n);var D=$0?P.isub(this.p):P.strip!==void 0?P.strip():P._strip(),P},O.prototype.split=function(x,P){x.iushrn(this.n,0,P)},O.prototype.imulK=function(x){return x.imul(this.k)};function w(){O.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(w,O),w.prototype.split=function(x,P){for(var $=4194303,D=Math.min(x.length,9),_=0;_>>22,N=L}N>>>=22,x.words[_-10]=N,N===0&&x.length>10?x.length-=10:x.length-=9},w.prototype.imulK=function(x){x.words[x.length]=0,x.words[x.length+1]=0,x.length+=2;for(var P=0,$=0;$>>=26,x.words[$]=_,P=D}return P!==0&&(x.words[x.length++]=P),x},s._prime=function(x){if(A[x])return A[x];var P;if(x==="k256")P=new w;else if(x==="p224")P=new I;else if(x==="p192")P=new B;else if(x==="p25519")P=new z;else throw new Error("Unknown prime "+x);return A[x]=P,P};function H(F){if(typeof F=="string"){var x=s._prime(F);this.m=x.p,this.prime=x}else n(F.gtn(1),"modulus must be greater than 1"),this.m=F,this.prime=null}H.prototype._verify1=function(x){n(x.negative===0,"red works only with positives"),n(x.red,"red works only with red numbers")},H.prototype._verify2=function(x,P){n((x.negative|P.negative)===0,"red works only with positives"),n(x.red&&x.red===P.red,"red works only with red numbers")},H.prototype.imod=function(x){return this.prime?this.prime.ireduce(x)._forceRed(this):(u(x,x.umod(this.m)._forceRed(this)),x)},H.prototype.neg=function(x){return x.isZero()?x.clone():this.m.sub(x)._forceRed(this)},H.prototype.add=function(x,P){this._verify2(x,P);var $=x.add(P);return $.cmp(this.m)>=0&&$.isub(this.m),$._forceRed(this)},H.prototype.iadd=function(x,P){this._verify2(x,P);var $=x.iadd(P);return $.cmp(this.m)>=0&&$.isub(this.m),$},H.prototype.sub=function(x,P){this._verify2(x,P);var $=x.sub(P);return $.cmpn(0)<0&&$.iadd(this.m),$._forceRed(this)},H.prototype.isub=function(x,P){this._verify2(x,P);var $=x.isub(P);return $.cmpn(0)<0&&$.iadd(this.m),$},H.prototype.shl=function(x,P){return this._verify1(x),this.imod(x.ushln(P))},H.prototype.imul=function(x,P){return this._verify2(x,P),this.imod(x.imul(P))},H.prototype.mul=function(x,P){return this._verify2(x,P),this.imod(x.mul(P))},H.prototype.isqr=function(x){return this.imul(x,x.clone())},H.prototype.sqr=function(x){return this.mul(x,x)},H.prototype.sqrt=function(x){if(x.isZero())return x.clone();var P=this.m.andln(3);if(n(P%2===1),P===3){var $=this.m.add(new s(1)).iushrn(2);return this.pow(x,$)}for(var D=this.m.subn(1),_=0;!D.isZero()&&D.andln(1)===0;)_++,D.iushrn(1);n(!D.isZero());var N=new s(1).toRed(this),L=N.redNeg(),R=this.m.subn(1).iushrn(1),E=this.m.bitLength();for(E=new s(2*E*E).toRed(this);this.pow(E,R).cmp(L)!==0;)E.redIAdd(L);for(var M=this.pow(E,D),j=this.pow(x,D.addn(1).iushrn(1)),T=this.pow(x,D),U=_;T.cmp(N)!==0;){for(var W=T,V=0;W.cmp(N)!==0;V++)W=W.redSqr();n(V=0;_--){for(var M=P.words[_],j=E-1;j>=0;j--){var T=M>>j&1;if(N!==D[0]&&(N=this.sqr(N)),T===0&&L===0){R=0;continue}L<<=1,L|=T,R++,!(R!==$&&(_!==0||j!==0))&&(N=this.mul(N,D[L]),R=0,L=0)}E=26}return N},H.prototype.convertTo=function(x){var P=x.umod(this.m);return P===x?P.clone():P},H.prototype.convertFrom=function(x){var P=x.clone();return P.red=null,P},s.mont=function(x){return new K(x)};function K(F){H.call(this,F),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(K,H),K.prototype.convertTo=function(x){return this.imod(x.ushln(this.shift))},K.prototype.convertFrom=function(x){var P=this.imod(x.mul(this.rinv));return P.red=null,P},K.prototype.imul=function(x,P){if(x.isZero()||P.isZero())return x.words[0]=0,x.length=1,x;var $=x.imul(P),D=$.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=$.isub(D).iushrn(this.shift),N=_;return _.cmp(this.m)>=0?N=_.isub(this.m):_.cmpn(0)<0&&(N=_.iadd(this.m)),N._forceRed(this)},K.prototype.mul=function(x,P){if(x.isZero()||P.isZero())return new s(0)._forceRed(this);var $=x.mul(P),D=$.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=$.isub(D).iushrn(this.shift),N=_;return _.cmp(this.m)>=0?N=_.isub(this.m):_.cmpn(0)<0&&(N=_.iadd(this.m)),N._forceRed(this)},K.prototype.invm=function(x){var P=this.imod(x._invmp(this.m).mul(this.r2));return P._forceRed(this)}})(t,Sl)})(PE);var wK=PE.exports;const Te=ki(wK),xK="logger/5.7.0";let R7=!1,$7=!1;const Qv={debug:1,default:2,info:2,warning:3,error:4,off:5};let M7=Qv.default,Sw=null;function EK(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}const N7=EK();var Q5;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(Q5||(Q5={}));var vs;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(vs||(vs={}));const D7="0123456789abcdef";let ee=class Mr{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){const n=e.toLowerCase();Qv[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(M7>Qv[n])&&console.log.apply(console,r)}debug(...e){this._log(Mr.levels.DEBUG,e)}info(...e){this._log(Mr.levels.INFO,e)}warn(...e){this._log(Mr.levels.WARNING,e)}makeError(e,r,n){if($7)return this.makeError("censored error",r,{});r||(r=Mr.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(c=>{const l=n[c];try{if(l instanceof Uint8Array){let u="";for(let f=0;f>4],u+=D7[l[f]&15];i.push(c+"=Uint8Array(0x"+u+")")}else i.push(c+"="+JSON.stringify(l))}catch{i.push(c+"="+JSON.stringify(n[c].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);const s=e;let o="";switch(r){case vs.NUMERIC_FAULT:{o="NUMERIC_FAULT";const c=e;switch(c){case"overflow":case"underflow":case"division-by-zero":o+="-"+c;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result";break}break}case vs.CALL_EXCEPTION:case vs.INSUFFICIENT_FUNDS:case vs.MISSING_NEW:case vs.NONCE_EXPIRED:case vs.REPLACEMENT_UNDERPRICED:case vs.TRANSACTION_REPLACED:case vs.UNPREDICTABLE_GAS_LIMIT:o=r;break}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),i.length&&(e+=" ("+i.join(", ")+")");const a=new Error(e);return a.reason=s,a.code=r,Object.keys(n).forEach(function(c){a[c]=n[c]}),a}throwError(e,r,n){throw this.makeError(e,r,n)}throwArgumentError(e,r,n){return this.throwError(e,Mr.errors.INVALID_ARGUMENT,{argument:r,value:n})}assert(e,r,n,i){e||this.throwError(r,n,i)}assertArgument(e,r,n,i){e||this.throwArgumentError(r,n,i)}checkNormalize(e){N7&&this.throwError("platform missing String.prototype.normalize",Mr.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:N7})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,Mr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,Mr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,n){n?n=": "+n:n="",er&&this.throwError("too many arguments"+n,Mr.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",Mr.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",Mr.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",Mr.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return Sw||(Sw=new Mr(xK)),Sw}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",Mr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),R7){if(!e)return;this.globalLogger().throwError("error censorship permanent",Mr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}$7=!!e,R7=!!r}static setLogLevel(e){const r=Qv[e.toLowerCase()];if(r==null){Mr.globalLogger().warn("invalid log level - "+e);return}M7=r}static from(e){return new Mr(e)}};ee.errors=vs;ee.levels=Q5;const CK="bytes/5.7.0",hr=new ee(CK);function f$(t){return!!t.toHexString}function Tf(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return Tf(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function Jo(t){return Ue(t)&&!(t.length%2)||va(t)}function L7(t){return typeof t=="number"&&t==t&&t%1===0}function va(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!L7(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function re(t,e){if(e||(e={}),typeof t=="number"){hr.checkSafeUint53(t,"invalid arrayify value");const r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),Tf(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),f$(t)&&(t=t.toHexString()),Ue(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":hr.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let i=0;ire(i)),r=e.reduce((i,s)=>i+s.length,0),n=new Uint8Array(r);return e.reduce((i,s)=>(n.set(s,i),i+s.length),0),Tf(n)}function co(t){let e=re(t);if(e.length===0)return e;let r=0;for(;re&&hr.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),Tf(r)}function Ue(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const kw="0123456789abcdef";function te(t,e){if(e||(e={}),typeof t=="number"){hr.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=kw[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),f$(t))return t.toHexString();if(Ue(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":hr.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(va(t)){let r="0x";for(let n=0;n>4]+kw[i&15]}return r}return hr.throwArgumentError("invalid hexlify value","value",t)}function yo(t){if(typeof t!="string")t=te(t);else if(!Ue(t)||t.length%2)return null;return(t.length-2)/2}function vr(t,e,r){return typeof t!="string"?t=te(t):(!Ue(t)||t.length%2)&&hr.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function Mn(t){let e="0x";return t.forEach(r=>{e+=te(r).substring(2)}),e}function As(t){const e=d$(te(t,{hexPad:"left"}));return e==="0x"?"0x0":e}function d$(t){typeof t!="string"&&(t=te(t)),Ue(t)||hr.throwArgumentError("invalid hex string","value",t),t=t.substring(2);let e=0;for(;e2*e+2&&hr.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function hu(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Jo(t)){let r=re(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=te(r.slice(0,32)),e.s=te(r.slice(32,64))):r.length===65?(e.r=te(r.slice(0,32)),e.s=te(r.slice(32,64)),e.v=r[64]):hr.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:hr.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=te(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){const i=e0(re(e._vs),32);e._vs=te(i);const s=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=s:e.recoveryParam!==s&&hr.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;const o=te(i);e.s==null?e.s=o:e.s!==o&&hr.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?hr.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{const i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&hr.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!Ue(e.r)?hr.throwArgumentError("signature missing or invalid r","signature",t):e.r=pt(e.r,32),e.s==null||!Ue(e.s)?hr.throwArgumentError("signature missing or invalid s","signature",t):e.s=pt(e.s,32);const r=re(e.s);r[0]>=128&&hr.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const n=te(r);e._vs&&(Ue(e._vs)||hr.throwArgumentError("signature invalid _vs","signature",t),e._vs=pt(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&hr.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function Y5(t){return t=hu(t),te(ht([t.r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}const h$="bignumber/5.7.0";var H0=Te.BN;const Io=new ee(h$),Aw={},B7=9007199254740991;function SK(t){return t!=null&&(Z.isBigNumber(t)||typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||Ue(t)||typeof t=="bigint"||va(t))}let F7=!1;class Z{constructor(e,r){e!==Aw&&Io.throwError("cannot call constructor directly; use BigNumber.from",ee.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Vn(Qe(this).fromTwos(e))}toTwos(e){return Vn(Qe(this).toTwos(e))}abs(){return this._hex[0]==="-"?Z.from(this._hex.substring(1)):this}add(e){return Vn(Qe(this).add(Qe(e)))}sub(e){return Vn(Qe(this).sub(Qe(e)))}div(e){return Z.from(e).isZero()&&Ri("division-by-zero","div"),Vn(Qe(this).div(Qe(e)))}mul(e){return Vn(Qe(this).mul(Qe(e)))}mod(e){const r=Qe(e);return r.isNeg()&&Ri("division-by-zero","mod"),Vn(Qe(this).umod(r))}pow(e){const r=Qe(e);return r.isNeg()&&Ri("negative-power","pow"),Vn(Qe(this).pow(r))}and(e){const r=Qe(e);return(this.isNegative()||r.isNeg())&&Ri("unbound-bitwise-result","and"),Vn(Qe(this).and(r))}or(e){const r=Qe(e);return(this.isNegative()||r.isNeg())&&Ri("unbound-bitwise-result","or"),Vn(Qe(this).or(r))}xor(e){const r=Qe(e);return(this.isNegative()||r.isNeg())&&Ri("unbound-bitwise-result","xor"),Vn(Qe(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&Ri("negative-width","mask"),Vn(Qe(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Ri("negative-width","shl"),Vn(Qe(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Ri("negative-width","shr"),Vn(Qe(this).shrn(e))}eq(e){return Qe(this).eq(Qe(e))}lt(e){return Qe(this).lt(Qe(e))}lte(e){return Qe(this).lte(Qe(e))}gt(e){return Qe(this).gt(Qe(e))}gte(e){return Qe(this).gte(Qe(e))}isNegative(){return this._hex[0]==="-"}isZero(){return Qe(this).isZero()}toNumber(){try{return Qe(this).toNumber()}catch{Ri("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Io.throwError("this platform does not support BigInt",ee.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?F7||(F7=!0,Io.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?Io.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",ee.errors.UNEXPECTED_ARGUMENT,{}):Io.throwError("BigNumber.toString does not accept parameters",ee.errors.UNEXPECTED_ARGUMENT,{})),Qe(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof Z)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new Z(Aw,q0(e)):e.match(/^-?[0-9]+$/)?new Z(Aw,q0(new H0(e))):Io.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&Ri("underflow","BigNumber.from",e),(e>=B7||e<=-B7)&&Ri("overflow","BigNumber.from",e),Z.from(String(e));const r=e;if(typeof r=="bigint")return Z.from(r.toString());if(va(r))return Z.from(te(r));if(r)if(r.toHexString){const n=r.toHexString();if(typeof n=="string")return Z.from(n)}else{let n=r._hex;if(n==null&&r.type==="BigNumber"&&(n=r.hex),typeof n=="string"&&(Ue(n)||n[0]==="-"&&Ue(n.substring(1))))return Z.from(n)}return Io.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function q0(t){if(typeof t!="string")return q0(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&Io.throwArgumentError("invalid hex","value",t),t=q0(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function Vn(t){return Z.from(q0(t))}function Qe(t){const e=Z.from(t).toHexString();return e[0]==="-"?new H0("-"+e.substring(3),16):new H0(e.substring(2),16)}function Ri(t,e,r){const n={fault:t,operation:e};return r!=null&&(n.value=r),Io.throwError(t,ee.errors.NUMERIC_FAULT,n)}function kK(t){return new H0(t,36).toString(16)}function AK(t){return new H0(t,16).toString(36)}const Nn=new ee(h$),t0={},p$=Z.from(0),v$=Z.from(-1);function m$(t,e,r,n){const i={fault:e,operation:r};return n!==void 0&&(i.value=n),Nn.throwError(t,ee.errors.NUMERIC_FAULT,i)}let r0="0";for(;r0.length<256;)r0+=r0;function TE(t){if(typeof t!="number")try{t=Z.from(t).toNumber()}catch{}return typeof t=="number"&&t>=0&&t<=256&&!(t%1)?"1"+r0.substring(0,t):Nn.throwArgumentError("invalid decimal size","decimals",t)}function Yv(t,e){e==null&&(e=0);const r=TE(e);t=Z.from(t);const n=t.lt(p$);n&&(t=t.mul(v$));let i=t.mod(r).toString();for(;i.length2&&Nn.throwArgumentError("too many decimal points","value",t);let s=i[0],o=i[1];for(s||(s="0"),o||(o="0");o[o.length-1]==="0";)o=o.substring(0,o.length-1);for(o.length>r.length-1&&m$("fractional component exceeds decimals","underflow","parseFixed"),o===""&&(o="0");o.lengthe[o]==null?c:(typeof e[o]!==a&&Nn.throwArgumentError("invalid fixed format ("+o+" not "+a+")","format."+o,e[o]),e[o]);r=s("signed","boolean",r),n=s("width","number",n),i=s("decimals","number",i)}return n%8&&Nn.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),i>80&&Nn.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new If(t0,r,n,i)}}class en{constructor(e,r,n,i){e!==t0&&Nn.throwError("cannot use FixedNumber constructor; use FixedNumber.from",ee.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=r,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&Nn.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const r=Ws(this._value,this.format.decimals),n=Ws(e._value,e.format.decimals);return en.fromValue(r.add(n),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const r=Ws(this._value,this.format.decimals),n=Ws(e._value,e.format.decimals);return en.fromValue(r.sub(n),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const r=Ws(this._value,this.format.decimals),n=Ws(e._value,e.format.decimals);return en.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const r=Ws(this._value,this.format.decimals),n=Ws(e._value,e.format.decimals);return en.fromValue(r.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=en.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(r=r.subUnsafe(j7.toFormat(r.format))),r}ceiling(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=en.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(r=r.addUnsafe(j7.toFormat(r.format))),r}round(e){e==null&&(e=0);const r=this.toString().split(".");if(r.length===1&&r.push("0"),(e<0||e>80||e%1)&&Nn.throwArgumentError("invalid decimal count","decimals",e),r[1].length<=e)return this;const n=en.from("1"+r0.substring(0,e),this.format),i=_K.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(i).floor().divUnsafe(n)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(e){if(e==null)return this._hex;e%8&&Nn.throwArgumentError("invalid byte width","width",e);const r=Z.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return pt(r,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return en.fromString(this._value,e)}static fromValue(e,r,n){return n==null&&r!=null&&!SK(r)&&(n=r,r=null),r==null&&(r=0),n==null&&(n="fixed"),en.fromString(Yv(e,r),If.from(n))}static fromString(e,r){r==null&&(r="fixed");const n=If.from(r),i=Ws(e,n.decimals);!n.signed&&i.lt(p$)&&m$("unsigned value cannot be negative","overflow","value",e);let s=null;n.signed?s=i.toTwos(n.width).toHexString():(s=i.toHexString(),s=pt(s,n.width/8));const o=Yv(i,n.decimals);return new en(t0,s,o,n)}static fromBytes(e,r){r==null&&(r="fixed");const n=If.from(r);if(re(e).length>n.width/8)throw new Error("overflow");let i=Z.from(e);n.signed&&(i=i.fromTwos(n.width));const s=i.toTwos((n.signed?0:1)+n.width).toHexString(),o=Yv(i,n.decimals);return new en(t0,s,o,n)}static from(e,r){if(typeof e=="string")return en.fromString(e,r);if(va(e))return en.fromBytes(e,r);try{return en.fromValue(e,0,r)}catch(n){if(n.code!==ee.errors.INVALID_ARGUMENT)throw n}return Nn.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}}const j7=en.from(1),_K=en.from("0.5"),PK="properties/5.7.0";var TK=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const Zm=new ee(PK);function ne(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function ws(t,e){for(let r=0;r<32;r++){if(t[e])return t[e];if(!t.prototype||typeof t.prototype!="object")break;t=Object.getPrototypeOf(t.prototype).constructor}return null}function mt(t){return TK(this,void 0,void 0,function*(){const e=Object.keys(t).map(n=>{const i=t[n];return Promise.resolve(i).then(s=>({key:n,value:s}))});return(yield Promise.all(e)).reduce((n,i)=>(n[i.key]=i.value,n),{})})}function IE(t,e){(!t||typeof t!="object")&&Zm.throwArgumentError("invalid object","object",t),Object.keys(t).forEach(r=>{e[r]||Zm.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)})}function Gt(t){const e={};for(const r in t)e[r]=t[r];return e}const IK={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function y$(t){if(t==null||IK[typeof t])return!0;if(Array.isArray(t)||typeof t=="object"){if(!Object.isFrozen(t))return!1;const e=Object.keys(t);for(let r=0;rbi(e)));if(typeof t=="object"){const e={};for(const r in t){const n=t[r];n!==void 0&&ne(e,r,bi(n))}return e}return Zm.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function bi(t){return OK(t)}class pu{constructor(e){for(const r in e)this[r]=bi(e[r])}}const K1="abi/5.7.0",Ze=new ee(K1),Yl={};let U7={calldata:!0,memory:!0,storage:!0},RK={calldata:!0,memory:!0};function Xp(t,e){if(t==="bytes"||t==="string"){if(U7[e])return!0}else if(t==="address"){if(e==="payable")return!0}else if((t.indexOf("[")>=0||t==="tuple")&&RK[e])return!0;return(U7[e]||e==="payable")&&Ze.throwArgumentError("invalid modifier","name",e),!1}function $K(t,e){let r=t;function n(a){Ze.throwArgumentError(`unexpected character at position ${a}`,"param",t)}t=t.replace(/\s/g," ");function i(a){let c={type:"",name:"",parent:a,state:{allowType:!0}};return e&&(c.indexed=!1),c}let s={type:"",name:"",state:{allowType:!0}},o=s;for(let a=0;aJSON.parse(i.format(e)))),JSON.stringify(n)}let r="";return this.baseType==="array"?(r+=this.arrayChildren.format(e),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):this.baseType==="tuple"?(e!==rt.sighash&&(r+=this.type),r+="("+this.components.map(n=>n.format(e)).join(e===rt.full?", ":",")+")"):r+=this.type,e!==rt.sighash&&(this.indexed===!0&&(r+=" indexed"),e===rt.full&&this.name&&(r+=" "+this.name)),r}static from(e,r){return typeof e=="string"?Ur.fromString(e,r):Ur.fromObject(e)}static fromObject(e){return Ur.isParamType(e)?e:new Ur(Yl,{name:e.name||null,type:Hu(e.type),indexed:e.indexed==null?null:!!e.indexed,components:e.components?e.components.map(Ur.fromObject):null})}static fromString(e,r){function n(i){return Ur.fromObject({name:i.name,type:i.type,indexed:i.indexed,components:i.components})}return n($K(e,!!r))}static isParamType(e){return!!(e!=null&&e._isParamType)}}function V0(t,e){return DK(t).map(r=>Ur.fromString(r,e))}class to{constructor(e,r){e!==Yl&&Ze.throwError("use a static from method",ee.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Jv(this,r),this._isFragment=!0,Object.freeze(this)}static from(e){return to.isFragment(e)?e:typeof e=="string"?to.fromString(e):to.fromObject(e)}static fromObject(e){if(to.isFragment(e))return e;switch(e.type){case"function":return bs.fromObject(e);case"event":return Zs.fromObject(e);case"constructor":return gs.fromObject(e);case"error":return Lo.fromObject(e);case"fallback":case"receive":return null}return Ze.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return e=e.replace(/\s/g," "),e=e.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," "),e=e.trim(),e.split(" ")[0]==="event"?Zs.fromString(e.substring(5).trim()):e.split(" ")[0]==="function"?bs.fromString(e.substring(8).trim()):e.split("(")[0].trim()==="constructor"?gs.fromString(e.trim()):e.split(" ")[0]==="error"?Lo.fromString(e.substring(5).trim()):Ze.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!!(e&&e._isFragment)}}class Zs extends to{format(e){if(e||(e=rt.sighash),rt[e]||Ze.throwArgumentError("invalid format type","format",e),e===rt.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==rt.sighash&&(r+="event "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===rt.full?", ":",")+") ",e!==rt.sighash&&this.anonymous&&(r+="anonymous "),r.trim()}static from(e){return typeof e=="string"?Zs.fromString(e):Zs.fromObject(e)}static fromObject(e){if(Zs.isEventFragment(e))return e;e.type!=="event"&&Ze.throwArgumentError("invalid event object","value",e);const r={name:G0(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(Ur.fromObject):[],type:"event"};return new Zs(Yl,r)}static fromString(e){let r=e.match(K0);r||Ze.throwArgumentError("invalid event string","value",e);let n=!1;return r[3].split(" ").forEach(i=>{switch(i.trim()){case"anonymous":n=!0;break;case"":break;default:Ze.warn("unknown modifier: "+i)}}),Zs.fromObject({name:r[1].trim(),anonymous:n,inputs:V0(r[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&e.type==="event"}}function g$(t,e){e.gas=null;let r=t.split("@");return r.length!==1?(r.length>2&&Ze.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||Ze.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=Z.from(r[1]),r[0]):t}function b$(t,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",t.split(" ").forEach(r=>{switch(r.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+r)}})}function w$(t){let e={constant:!1,payable:!0,stateMutability:"payable"};return t.stateMutability!=null?(e.stateMutability=t.stateMutability,e.constant=e.stateMutability==="view"||e.stateMutability==="pure",t.constant!=null&&!!t.constant!==e.constant&&Ze.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable=e.stateMutability==="payable",t.payable!=null&&!!t.payable!==e.payable&&Ze.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",t)):t.payable!=null?(e.payable=!!t.payable,t.constant==null&&!e.payable&&t.type!=="constructor"&&Ze.throwArgumentError("unable to determine stateMutability","value",t),e.constant=!!t.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&Ze.throwArgumentError("cannot have constant payable function","value",t)):t.constant!=null?(e.constant=!!t.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):t.type!=="constructor"&&Ze.throwArgumentError("unable to determine stateMutability","value",t),e}class gs extends to{format(e){if(e||(e=rt.sighash),rt[e]||Ze.throwArgumentError("invalid format type","format",e),e===rt.json)return JSON.stringify({type:"constructor",stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});e===rt.sighash&&Ze.throwError("cannot format a constructor for sighash",ee.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let r="constructor("+this.inputs.map(n=>n.format(e)).join(e===rt.full?", ":",")+") ";return this.stateMutability&&this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "),r.trim()}static from(e){return typeof e=="string"?gs.fromString(e):gs.fromObject(e)}static fromObject(e){if(gs.isConstructorFragment(e))return e;e.type!=="constructor"&&Ze.throwArgumentError("invalid constructor object","value",e);let r=w$(e);r.constant&&Ze.throwArgumentError("constructor cannot be constant","value",e);const n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(Ur.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?Z.from(e.gas):null};return new gs(Yl,n)}static fromString(e){let r={type:"constructor"};e=g$(e,r);let n=e.match(K0);return(!n||n[1].trim()!=="constructor")&&Ze.throwArgumentError("invalid constructor string","value",e),r.inputs=V0(n[2].trim(),!1),b$(n[3].trim(),r),gs.fromObject(r)}static isConstructorFragment(e){return e&&e._isFragment&&e.type==="constructor"}}class bs extends gs{format(e){if(e||(e=rt.sighash),rt[e]||Ze.throwArgumentError("invalid format type","format",e),e===rt.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e))),outputs:this.outputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==rt.sighash&&(r+="function "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===rt.full?", ":",")+") ",e!==rt.sighash&&(this.stateMutability?this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "):this.constant&&(r+="view "),this.outputs&&this.outputs.length&&(r+="returns ("+this.outputs.map(n=>n.format(e)).join(", ")+") "),this.gas!=null&&(r+="@"+this.gas.toString()+" ")),r.trim()}static from(e){return typeof e=="string"?bs.fromString(e):bs.fromObject(e)}static fromObject(e){if(bs.isFunctionFragment(e))return e;e.type!=="function"&&Ze.throwArgumentError("invalid function object","value",e);let r=w$(e);const n={type:e.type,name:G0(e.name),constant:r.constant,inputs:e.inputs?e.inputs.map(Ur.fromObject):[],outputs:e.outputs?e.outputs.map(Ur.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?Z.from(e.gas):null};return new bs(Yl,n)}static fromString(e){let r={type:"function"};e=g$(e,r);let n=e.split(" returns ");n.length>2&&Ze.throwArgumentError("invalid function string","value",e);let i=n[0].match(K0);if(i||Ze.throwArgumentError("invalid function signature","value",e),r.name=i[1].trim(),r.name&&G0(r.name),r.inputs=V0(i[2],!1),b$(i[3].trim(),r),n.length>1){let s=n[1].match(K0);(s[1].trim()!=""||s[3].trim()!="")&&Ze.throwArgumentError("unexpected tokens","value",e),r.outputs=V0(s[2],!1)}else r.outputs=[];return bs.fromObject(r)}static isFunctionFragment(e){return e&&e._isFragment&&e.type==="function"}}function z7(t){const e=t.format();return(e==="Error(string)"||e==="Panic(uint256)")&&Ze.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",t),t}class Lo extends to{format(e){if(e||(e=rt.sighash),rt[e]||Ze.throwArgumentError("invalid format type","format",e),e===rt.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==rt.sighash&&(r+="error "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===rt.full?", ":",")+") ",r.trim()}static from(e){return typeof e=="string"?Lo.fromString(e):Lo.fromObject(e)}static fromObject(e){if(Lo.isErrorFragment(e))return e;e.type!=="error"&&Ze.throwArgumentError("invalid error object","value",e);const r={type:e.type,name:G0(e.name),inputs:e.inputs?e.inputs.map(Ur.fromObject):[]};return z7(new Lo(Yl,r))}static fromString(e){let r={type:"error"},n=e.match(K0);return n||Ze.throwArgumentError("invalid error signature","value",e),r.name=n[1].trim(),r.name&&G0(r.name),r.inputs=V0(n[2],!1),z7(Lo.fromObject(r))}static isErrorFragment(e){return e&&e._isFragment&&e.type==="error"}}function Hu(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}const NK=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function G0(t){return(!t||!t.match(NK))&&Ze.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}const K0=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function DK(t){t=t.trim();let e=[],r="",n=0;for(let i=0;ithis.wordSize&&OE.throwError("value out-of-bounds",ee.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:r.length}),r.length%this.wordSize&&(r=ht([this._padding.slice(r.length%this.wordSize),r])),r}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,r=>{this._data[e]=this._getValue(r)}}}class ey{constructor(e,r,n,i){ne(this,"_data",re(e)),ne(this,"wordSize",r||32),ne(this,"_coerceFunc",n),ne(this,"allowLoose",i),this._offset=0}get data(){return te(this._data)}get consumed(){return this._offset}static coerce(e,r){let n=e.match("^u?int([0-9]+)$");return n&&parseInt(n[1])<=48&&(r=r.toNumber()),r}coerce(e,r){return this._coerceFunc?this._coerceFunc(e,r):ey.coerce(e,r)}_peekBytes(e,r,n){let i=Math.ceil(r/this.wordSize)*this.wordSize;return this._offset+i>this._data.length&&(this.allowLoose&&n&&this._offset+r<=this._data.length?i=r:OE.throwError("data out-of-bounds",ee.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+i})),this._data.slice(this._offset,this._offset+i)}subReader(e){return new ey(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,r){let n=this._peekBytes(0,e,!!r);return this._offset+=n.length,n.slice(0,e)}readValue(){return Z.from(this.readBytes(this.wordSize))}}var E$={exports:{}};/** - * [js-sha3]{@link https://github.com/emn178/js-sha3} - * - * @version 0.8.0 - * @author Chen, Yi-Cyuan [emn178@gmail.com] - * @copyright Chen, Yi-Cyuan 2015-2018 - * @license MIT - */(function(t){(function(){var e="input is invalid type",r="finalize already called",n=typeof window=="object",i=n?window:{};i.JS_SHA3_NO_WINDOW&&(n=!1);var s=!n&&typeof self=="object",o=!i.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;o?i=Sl:s&&(i=self);var a=!i.JS_SHA3_NO_COMMON_JS&&!0&&t.exports,c=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",l="0123456789abcdef".split(""),u=[31,7936,2031616,520093696],f=[4,1024,262144,67108864],d=[1,256,65536,16777216],h=[6,1536,393216,100663296],p=[0,8,16,24],v=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],m=[224,256,384,512],g=[128,256],y=["hex","buffer","arrayBuffer","array","digest"],b={128:168,256:136};(i.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(T){return Object.prototype.toString.call(T)==="[object Array]"}),c&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(T){return typeof T=="object"&&T.buffer&&T.buffer.constructor===ArrayBuffer});for(var C=function(T,U,W){return function(V){return new E(T,U,T).update(V)[W]()}},A=function(T,U,W){return function(V,G){return new E(T,U,G).update(V)[W]()}},O=function(T,U,W){return function(V,G,J,Y){return x["cshake"+T].update(V,G,J,Y)[W]()}},w=function(T,U,W){return function(V,G,J,Y){return x["kmac"+T].update(V,G,J,Y)[W]()}},I=function(T,U,W,V){for(var G=0;G>5,this.byteCount=this.blockCount<<2,this.outputBlocks=W>>5,this.extraBytes=(W&31)>>3;for(var V=0;V<50;++V)this.s[V]=0}E.prototype.update=function(T){if(this.finalized)throw new Error(r);var U,W=typeof T;if(W!=="string"){if(W==="object"){if(T===null)throw new Error(e);if(c&&T.constructor===ArrayBuffer)T=new Uint8Array(T);else if(!Array.isArray(T)&&(!c||!ArrayBuffer.isView(T)))throw new Error(e)}else throw new Error(e);U=!0}for(var V=this.blocks,G=this.byteCount,J=T.length,Y=this.blockCount,X=0,ae=this.s,oe,ue;X>2]|=T[X]<>2]|=ue<>2]|=(192|ue>>6)<>2]|=(128|ue&63)<=57344?(V[oe>>2]|=(224|ue>>12)<>2]|=(128|ue>>6&63)<>2]|=(128|ue&63)<>2]|=(240|ue>>18)<>2]|=(128|ue>>12&63)<>2]|=(128|ue>>6&63)<>2]|=(128|ue&63)<=G){for(this.start=oe-G,this.block=V[Y],oe=0;oe>8,W=T&255;W>0;)G.unshift(W),T=T>>8,W=T&255,++V;return U?G.push(V):G.unshift(V),this.update(G),G.length},E.prototype.encodeString=function(T){var U,W=typeof T;if(W!=="string"){if(W==="object"){if(T===null)throw new Error(e);if(c&&T.constructor===ArrayBuffer)T=new Uint8Array(T);else if(!Array.isArray(T)&&(!c||!ArrayBuffer.isView(T)))throw new Error(e)}else throw new Error(e);U=!0}var V=0,G=T.length;if(U)V=G;else for(var J=0;J=57344?V+=3:(Y=65536+((Y&1023)<<10|T.charCodeAt(++J)&1023),V+=4)}return V+=this.encode(V*8),this.update(T),V},E.prototype.bytepad=function(T,U){for(var W=this.encode(U),V=0;V>2]|=this.padding[U&3],this.lastByteIndex===this.byteCount)for(T[0]=T[W],U=1;U>4&15]+l[X&15]+l[X>>12&15]+l[X>>8&15]+l[X>>20&15]+l[X>>16&15]+l[X>>28&15]+l[X>>24&15];J%T===0&&(j(U),G=0)}return V&&(X=U[G],Y+=l[X>>4&15]+l[X&15],V>1&&(Y+=l[X>>12&15]+l[X>>8&15]),V>2&&(Y+=l[X>>20&15]+l[X>>16&15])),Y},E.prototype.arrayBuffer=function(){this.finalize();var T=this.blockCount,U=this.s,W=this.outputBlocks,V=this.extraBytes,G=0,J=0,Y=this.outputBits>>3,X;V?X=new ArrayBuffer(W+1<<2):X=new ArrayBuffer(Y);for(var ae=new Uint32Array(X);J>8&255,Y[X+2]=ae>>16&255,Y[X+3]=ae>>24&255;J%T===0&&j(U)}return V&&(X=J<<2,ae=U[G],Y[X]=ae&255,V>1&&(Y[X+1]=ae>>8&255),V>2&&(Y[X+2]=ae>>16&255)),Y};function M(T,U,W){E.call(this,T,U,W)}M.prototype=new E,M.prototype.finalize=function(){return this.encode(this.outputBits,!0),E.prototype.finalize.call(this)};var j=function(T){var U,W,V,G,J,Y,X,ae,oe,ue,tt,Oe,Pe,ct,Ce,be,Qt,Re,$e,Yt,Me,Ne,Jt,De,Le,Xt,Be,Fe,Zt,je,Ct,Zc,St,kt,el,At,_t,tl,Pt,Tt,rl,It,Ot,nl,Rt,$t,il,Mt,Nt,sl,Dt,Lt,ol,Bt,Ft,al,jt,Ut,ka,Aa,_a,Pa,Ta;for(V=0;V<48;V+=2)G=T[0]^T[10]^T[20]^T[30]^T[40],J=T[1]^T[11]^T[21]^T[31]^T[41],Y=T[2]^T[12]^T[22]^T[32]^T[42],X=T[3]^T[13]^T[23]^T[33]^T[43],ae=T[4]^T[14]^T[24]^T[34]^T[44],oe=T[5]^T[15]^T[25]^T[35]^T[45],ue=T[6]^T[16]^T[26]^T[36]^T[46],tt=T[7]^T[17]^T[27]^T[37]^T[47],Oe=T[8]^T[18]^T[28]^T[38]^T[48],Pe=T[9]^T[19]^T[29]^T[39]^T[49],U=Oe^(Y<<1|X>>>31),W=Pe^(X<<1|Y>>>31),T[0]^=U,T[1]^=W,T[10]^=U,T[11]^=W,T[20]^=U,T[21]^=W,T[30]^=U,T[31]^=W,T[40]^=U,T[41]^=W,U=G^(ae<<1|oe>>>31),W=J^(oe<<1|ae>>>31),T[2]^=U,T[3]^=W,T[12]^=U,T[13]^=W,T[22]^=U,T[23]^=W,T[32]^=U,T[33]^=W,T[42]^=U,T[43]^=W,U=Y^(ue<<1|tt>>>31),W=X^(tt<<1|ue>>>31),T[4]^=U,T[5]^=W,T[14]^=U,T[15]^=W,T[24]^=U,T[25]^=W,T[34]^=U,T[35]^=W,T[44]^=U,T[45]^=W,U=ae^(Oe<<1|Pe>>>31),W=oe^(Pe<<1|Oe>>>31),T[6]^=U,T[7]^=W,T[16]^=U,T[17]^=W,T[26]^=U,T[27]^=W,T[36]^=U,T[37]^=W,T[46]^=U,T[47]^=W,U=ue^(G<<1|J>>>31),W=tt^(J<<1|G>>>31),T[8]^=U,T[9]^=W,T[18]^=U,T[19]^=W,T[28]^=U,T[29]^=W,T[38]^=U,T[39]^=W,T[48]^=U,T[49]^=W,ct=T[0],Ce=T[1],$t=T[11]<<4|T[10]>>>28,il=T[10]<<4|T[11]>>>28,Fe=T[20]<<3|T[21]>>>29,Zt=T[21]<<3|T[20]>>>29,Aa=T[31]<<9|T[30]>>>23,_a=T[30]<<9|T[31]>>>23,It=T[40]<<18|T[41]>>>14,Ot=T[41]<<18|T[40]>>>14,kt=T[2]<<1|T[3]>>>31,el=T[3]<<1|T[2]>>>31,be=T[13]<<12|T[12]>>>20,Qt=T[12]<<12|T[13]>>>20,Mt=T[22]<<10|T[23]>>>22,Nt=T[23]<<10|T[22]>>>22,je=T[33]<<13|T[32]>>>19,Ct=T[32]<<13|T[33]>>>19,Pa=T[42]<<2|T[43]>>>30,Ta=T[43]<<2|T[42]>>>30,Bt=T[5]<<30|T[4]>>>2,Ft=T[4]<<30|T[5]>>>2,At=T[14]<<6|T[15]>>>26,_t=T[15]<<6|T[14]>>>26,Re=T[25]<<11|T[24]>>>21,$e=T[24]<<11|T[25]>>>21,sl=T[34]<<15|T[35]>>>17,Dt=T[35]<<15|T[34]>>>17,Zc=T[45]<<29|T[44]>>>3,St=T[44]<<29|T[45]>>>3,De=T[6]<<28|T[7]>>>4,Le=T[7]<<28|T[6]>>>4,al=T[17]<<23|T[16]>>>9,jt=T[16]<<23|T[17]>>>9,tl=T[26]<<25|T[27]>>>7,Pt=T[27]<<25|T[26]>>>7,Yt=T[36]<<21|T[37]>>>11,Me=T[37]<<21|T[36]>>>11,Lt=T[47]<<24|T[46]>>>8,ol=T[46]<<24|T[47]>>>8,nl=T[8]<<27|T[9]>>>5,Rt=T[9]<<27|T[8]>>>5,Xt=T[18]<<20|T[19]>>>12,Be=T[19]<<20|T[18]>>>12,Ut=T[29]<<7|T[28]>>>25,ka=T[28]<<7|T[29]>>>25,Tt=T[38]<<8|T[39]>>>24,rl=T[39]<<8|T[38]>>>24,Ne=T[48]<<14|T[49]>>>18,Jt=T[49]<<14|T[48]>>>18,T[0]=ct^~be&Re,T[1]=Ce^~Qt&$e,T[10]=De^~Xt&Fe,T[11]=Le^~Be&Zt,T[20]=kt^~At&tl,T[21]=el^~_t&Pt,T[30]=nl^~$t&Mt,T[31]=Rt^~il&Nt,T[40]=Bt^~al&Ut,T[41]=Ft^~jt&ka,T[2]=be^~Re&Yt,T[3]=Qt^~$e&Me,T[12]=Xt^~Fe&je,T[13]=Be^~Zt&Ct,T[22]=At^~tl&Tt,T[23]=_t^~Pt&rl,T[32]=$t^~Mt&sl,T[33]=il^~Nt&Dt,T[42]=al^~Ut&Aa,T[43]=jt^~ka&_a,T[4]=Re^~Yt&Ne,T[5]=$e^~Me&Jt,T[14]=Fe^~je&Zc,T[15]=Zt^~Ct&St,T[24]=tl^~Tt&It,T[25]=Pt^~rl&Ot,T[34]=Mt^~sl&Lt,T[35]=Nt^~Dt&ol,T[44]=Ut^~Aa&Pa,T[45]=ka^~_a&Ta,T[6]=Yt^~Ne&ct,T[7]=Me^~Jt&Ce,T[16]=je^~Zc&De,T[17]=Ct^~St&Le,T[26]=Tt^~It&kt,T[27]=rl^~Ot&el,T[36]=sl^~Lt&nl,T[37]=Dt^~ol&Rt,T[46]=Aa^~Pa&Bt,T[47]=_a^~Ta&Ft,T[8]=Ne^~ct&be,T[9]=Jt^~Ce&Qt,T[18]=Zc^~De&Xt,T[19]=St^~Le&Be,T[28]=It^~kt&At,T[29]=Ot^~el&_t,T[38]=Lt^~nl&$t,T[39]=ol^~Rt&il,T[48]=Pa^~Bt&al,T[49]=Ta^~Ft&jt,T[0]^=v[V],T[1]^=v[V+1]};if(a)t.exports=x;else for($=0;$>=8;return e}function H7(t,e,r){let n=0;for(let i=0;ie+1+n&&Gs.throwError("child data too short",ee.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function S$(t,e){if(t.length===0&&Gs.throwError("data too short",ee.errors.BUFFER_OVERRUN,{}),t[e]>=248){const r=t[e]-247;e+1+r>t.length&&Gs.throwError("data short segment too short",ee.errors.BUFFER_OVERRUN,{});const n=H7(t,e+1,r);return e+1+r+n>t.length&&Gs.throwError("data long segment too short",ee.errors.BUFFER_OVERRUN,{}),q7(t,e,e+1+r,r+n)}else if(t[e]>=192){const r=t[e]-192;return e+1+r>t.length&&Gs.throwError("data array too short",ee.errors.BUFFER_OVERRUN,{}),q7(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;e+1+r>t.length&&Gs.throwError("data array too short",ee.errors.BUFFER_OVERRUN,{});const n=H7(t,e+1,r);e+1+r+n>t.length&&Gs.throwError("data array too short",ee.errors.BUFFER_OVERRUN,{});const i=te(t.slice(e+1+r,e+1+r+n));return{consumed:1+r+n,result:i}}else if(t[e]>=128){const r=t[e]-128;e+1+r>t.length&&Gs.throwError("data too short",ee.errors.BUFFER_OVERRUN,{});const n=te(t.slice(e+1,e+1+r));return{consumed:1+r,result:n}}return{consumed:1,result:te(t[e])}}function Vg(t){const e=re(t),r=S$(e,0);return r.consumed!==e.length&&Gs.throwArgumentError("invalid rlp data","data",t),r.result}const jK=Object.freeze(Object.defineProperty({__proto__:null,decode:Vg,encode:Jl},Symbol.toStringTag,{value:"Module"})),UK="address/5.7.0",Ja=new ee(UK);function V7(t){Ue(t,20)||Ja.throwArgumentError("invalid address","address",t),t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=re(Ee(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const zK=9007199254740991;function WK(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const RE={};for(let t=0;t<10;t++)RE[String(t)]=String(t);for(let t=0;t<26;t++)RE[String.fromCharCode(65+t)]=String(10+t);const G7=Math.floor(WK(zK));function k$(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>RE[n]).join("");for(;e.length>=G7;){let n=e.substring(0,G7);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function Ie(t){let e=null;if(typeof t!="string"&&Ja.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=V7(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&Ja.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==k$(t)&&Ja.throwArgumentError("bad icap checksum","address",t),e=kK(t.substring(4));e.length<40;)e="0"+e;e=V7("0x"+e)}else Ja.throwArgumentError("invalid address","address",t);return e}function A$(t){try{return Ie(t),!0}catch{}return!1}function HK(t){let e=AK(Ie(t).substring(2)).toUpperCase();for(;e.length<30;)e="0"+e;return"XE"+k$("XE00"+e)+e}function $E(t){let e=null;try{e=Ie(t.from)}catch{Ja.throwArgumentError("missing from address","transaction",t)}const r=co(re(Z.from(t.nonce).toHexString()));return Ie(vr(Ee(Jl([e,r])),12))}function qK(t,e,r){return yo(e)!==32&&Ja.throwArgumentError("salt must be 32 bytes","salt",e),yo(r)!==32&&Ja.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),Ie(vr(Ee(ht(["0xff",Ie(t),e,r])),12))}class VK extends ma{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){try{r=Ie(r)}catch(n){this._throwError(n.message,r)}return e.writeValue(r)}decode(e){return Ie(pt(e.readValue().toHexString(),20))}}class GK extends ma{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,r){return this.coder.encode(e,r)}decode(e){return this.coder.decode(e)}}const hf=new ee(K1);function _$(t,e,r){let n=null;if(Array.isArray(r))n=r;else if(r&&typeof r=="object"){let c={};n=e.map(l=>{const u=l.localName;return u||hf.throwError("cannot encode object for signature with missing names",ee.errors.INVALID_ARGUMENT,{argument:"values",coder:l,value:r}),c[u]&&hf.throwError("cannot encode object for signature with duplicate names",ee.errors.INVALID_ARGUMENT,{argument:"values",coder:l,value:r}),c[u]=!0,r[u]})}else hf.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&hf.throwArgumentError("types/value length mismatch","tuple",r);let i=new J5(t.wordSize),s=new J5(t.wordSize),o=[];e.forEach((c,l)=>{let u=n[l];if(c.dynamic){let f=s.length;c.encode(s,u);let d=i.writeUpdatableValue();o.push(h=>{d(h+f)})}else c.encode(i,u)}),o.forEach(c=>{c(i.length)});let a=t.appendWriter(i);return a+=t.appendWriter(s),a}function P$(t,e){let r=[],n=t.subReader(0);e.forEach(s=>{let o=null;if(s.dynamic){let a=t.readValue(),c=n.subReader(a.toNumber());try{o=s.decode(c)}catch(l){if(l.code===ee.errors.BUFFER_OVERRUN)throw l;o=l,o.baseType=s.name,o.name=s.localName,o.type=s.type}}else try{o=s.decode(t)}catch(a){if(a.code===ee.errors.BUFFER_OVERRUN)throw a;o=a,o.baseType=s.name,o.name=s.localName,o.type=s.type}o!=null&&r.push(o)});const i=e.reduce((s,o)=>{const a=o.localName;return a&&(s[a]||(s[a]=0),s[a]++),s},{});e.forEach((s,o)=>{let a=s.localName;if(!a||i[a]!==1||(a==="length"&&(a="_length"),r[a]!=null))return;const c=r[o];c instanceof Error?Object.defineProperty(r,a,{enumerable:!0,get:()=>{throw c}}):r[a]=c});for(let s=0;s{throw o}})}return Object.freeze(r)}class KK extends ma{constructor(e,r,n){const i=e.type+"["+(r>=0?r:"")+"]",s=r===-1||e.dynamic;super("array",i,n,s),this.coder=e,this.length=r}defaultValue(){const e=this.coder.defaultValue(),r=[];for(let n=0;ne._data.length&&hf.throwError("insufficient data length",ee.errors.BUFFER_OVERRUN,{length:e._data.length,count:r}));let n=[];for(let i=0;i>6===2;o++)s++;return s}return t===Yn.OVERRUN?r.length-e-1:0}function iQ(t,e,r,n,i){return t===Yn.OVERLONG?(n.push(i),0):(n.push(65533),$$(t,e,r))}const M$=Object.freeze({error:nQ,ignore:$$,replace:iQ});function ME(t,e){e==null&&(e=M$.error),t=re(t);const r=[];let n=0;for(;n>7)){r.push(i);continue}let s=null,o=null;if((i&224)===192)s=1,o=127;else if((i&240)===224)s=2,o=2047;else if((i&248)===240)s=3,o=65535;else{(i&192)===128?n+=e(Yn.UNEXPECTED_CONTINUE,n-1,t,r):n+=e(Yn.BAD_PREFIX,n-1,t,r);continue}if(n-1+s>=t.length){n+=e(Yn.OVERRUN,n-1,t,r);continue}let a=i&(1<<8-s-1)-1;for(let c=0;c1114111){n+=e(Yn.OUT_OF_RANGE,n-1-s,t,r,a);continue}if(a>=55296&&a<=57343){n+=e(Yn.UTF16_SURROGATE,n-1-s,t,r,a);continue}if(a<=o){n+=e(Yn.OVERLONG,n-1-s,t,r,a);continue}r.push(a)}}return r}function vt(t,e=go.current){e!=go.current&&(R$.checkNormalize(),t=t.normalize(e));let r=[];for(let n=0;n>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const s=t.charCodeAt(n);if(n>=t.length||(s&64512)!==56320)throw new Error("invalid utf-8 string");const o=65536+((i&1023)<<10)+(s&1023);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return re(r)}function _w(t){const e="0000"+t.toString(16);return"\\u"+e.substring(e.length-4)}function sQ(t,e){return'"'+ME(t,e).map(r=>{if(r<256){switch(r){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(r>=32&&r<127)return String.fromCharCode(r)}return r<=65535?_w(r):(r-=65536,_w((r>>10&1023)+55296)+_w((r&1023)+56320))}).join("")+'"'}function X5(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function ya(t,e){return X5(ME(t,e))}function ry(t,e=go.current){return ME(vt(t,e))}function oQ(t){const e=vt(t);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return te(ht([e,ty]).slice(0,32))}function aQ(t){const e=re(t);if(e.length!==32)throw new Error("invalid bytes32 - not 32 bytes long");if(e[31]!==0)throw new Error("invalid bytes32 string - no null terminator");let r=31;for(;e[r-1]===0;)r--;return ya(e.slice(0,r))}function cQ(t){if(t.length%4!==0)throw new Error("bad data");let e=[];for(let r=0;r{let s=i.split(":");r+=parseInt(s[0],16),n[r]=e(s[1])}),n}function N$(t){let e=0;return t.split(",").map(r=>{let n=r.split("-");n.length===1?n[1]="0":n[1]===""&&(n[1]="1");let i=e+parseInt(n[0],16);return e=parseInt(n[1],16),{l:i,h:e}})}function DE(t,e){let r=0;for(let n=0;n=r&&t<=r+i.h&&(t-r)%(i.d||1)===0){if(i.e&&i.e.indexOf(t-r)!==-1)continue;return i}}return null}const lQ=N$("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),uQ="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(t=>parseInt(t,16)),fQ=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],dQ=NE("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),hQ=NE("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),pQ=NE("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",cQ),vQ=N$("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function mQ(t){return t.reduce((e,r)=>(r.forEach(n=>{e.push(n)}),e),[])}function yQ(t){return!!DE(t,lQ)}function gQ(t){let e=DE(t,fQ);if(e)return[t+e.s];let r=dQ[t];if(r)return r;let n=hQ[t];if(n)return[t+n[0]];let i=pQ[t];return i||null}function bQ(t){return!!DE(t,vQ)}function wQ(t){if(t.match(/^[a-z0-9-]*$/i)&&t.length<=59)return t.toLowerCase();let e=ry(t);e=mQ(e.map(n=>{if(uQ.indexOf(n)>=0)return[];if(n>=65024&&n<=65039)return[];let i=gQ(n);return i||[n]})),e=ry(X5(e),go.NFKC),e.forEach(n=>{if(bQ(n))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")}),e.forEach(n=>{if(yQ(n))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")});let r=X5(e);if(r.substring(0,1)==="-"||r.substring(2,4)==="--"||r.substring(r.length-1)==="-")throw new Error("invalid hyphen");return r}class xQ extends T${constructor(e){super("string",e)}defaultValue(){return""}encode(e,r){return super.encode(e,vt(r))}decode(e){return ya(super.decode(e))}}class Zp extends ma{constructor(e,r){let n=!1;const i=[];e.forEach(o=>{o.dynamic&&(n=!0),i.push(o.type)});const s="tuple("+i.join(",")+")";super("tuple",s,r,n),this.coders=e}defaultValue(){const e=[];this.coders.forEach(n=>{e.push(n.defaultValue())});const r=this.coders.reduce((n,i)=>{const s=i.localName;return s&&(n[s]||(n[s]=0),n[s]++),n},{});return this.coders.forEach((n,i)=>{let s=n.localName;!s||r[s]!==1||(s==="length"&&(s="_length"),e[s]==null&&(e[s]=e[i]))}),Object.freeze(e)}encode(e,r){return _$(e,this.coders,r)}decode(e){return e.coerce(this.name,P$(e,this.coders))}}const ev=new ee(K1),EQ=new RegExp(/^bytes([0-9]*)$/),CQ=new RegExp(/^(u?int)([0-9]*)$/);class LE{constructor(e){ne(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new VK(e.name);case"bool":return new QK(e.name);case"string":return new xQ(e.name);case"bytes":return new YK(e.name);case"array":return new KK(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new Zp((e.components||[]).map(n=>this._getCoder(n)),e.name);case"":return new XK(e.name)}let r=e.type.match(CQ);if(r){let n=parseInt(r[2]||"256");return(n===0||n>256||n%8!==0)&&ev.throwArgumentError("invalid "+r[1]+" bit length","param",e),new tQ(n/8,r[1]==="int",e.name)}if(r=e.type.match(EQ),r){let n=parseInt(r[1]);return(n===0||n>32)&&ev.throwArgumentError("invalid bytes length","param",e),new JK(n,e.name)}return ev.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,r){return new ey(e,this._getWordSize(),this.coerceFunc,r)}_getWriter(){return new J5(this._getWordSize())}getDefaultValue(e){const r=e.map(i=>this._getCoder(Ur.from(i)));return new Zp(r,"_").defaultValue()}encode(e,r){e.length!==r.length&&ev.throwError("types/values length mismatch",ee.errors.INVALID_ARGUMENT,{count:{types:e.length,values:r.length},value:{types:e,values:r}});const n=e.map(o=>this._getCoder(Ur.from(o))),i=new Zp(n,"_"),s=this._getWriter();return i.encode(s,r),s.data}decode(e,r,n){const i=e.map(o=>this._getCoder(Ur.from(o)));return new Zp(i,"_").decode(this._getReader(re(r),n))}}const zn=new LE;function Xa(t){return Ee(vt(t))}const D$="hash/5.7.0";function BE(t){t=atob(t);const e=[];for(let r=0;r0&&Array.isArray(a)?i(a,o-1):r.push(a)})};return i(t,e),r}function kQ(t){const e={};for(let r=0;r>--c&1}const f=31,d=Math.pow(2,f),h=d>>>1,p=h>>1,v=d-1;let m=0;for(let A=0;A1;){let z=O+w>>>1;A>>1|u(),I=I<<1^h,B=(B^h)<<1|h|1;y=I,b=1+B-I}let C=n-4;return g.map(A=>{switch(A-C){case 3:return C+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return C+256+(t[a++]<<8|t[a++]);case 1:return C+t[a++];default:return A-1}})}function _Q(t){let e=0;return()=>t[e++]}function PQ(t){return _Q(AQ(t))}function TQ(t){return t&1?~t>>1:t>>1}function IQ(t,e){let r=Array(t);for(let n=0;ne[o]):r}function RQ(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(MQ(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(NQ(r,t))}return kQ(L$(e))}function $Q(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(r)}return e}function B$(t,e,r){let n=Array(t).fill(void 0).map(()=>[]);for(let i=0;in[o].push(s));return n}function MQ(t,e){let r=1+e(),n=e(),i=$Q(e),s=B$(i.length,1+t,e);return L$(s.map((o,a)=>{const c=o[0],l=o.slice(1);return Array(i[a]).fill(void 0).map((u,f)=>{let d=f*n;return[c+f*r,l.map(h=>h+d)]})}))}function NQ(t,e){let r=1+e();return B$(r,1+t,e).map(i=>[i[0],i.slice(1)])}function DQ(t){let e=ny(t).sort((n,i)=>n-i);return r();function r(){let n=[];for(;;){let l=ny(t,e);if(l.length==0)break;n.push({set:new Set(l),node:r()})}n.sort((l,u)=>u.set.size-l.set.size);let i=t(),s=i%3;i=i/3|0;let o=!!(i&1);i>>=1;let a=i==1,c=i==2;return{branches:n,valid:s,fe0f:o,save:a,check:c}}}function LQ(){return PQ(BE("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}const Gg=LQ(),BQ=new Set(ny(Gg)),FQ=new Set(ny(Gg)),jQ=RQ(Gg),UQ=DQ(Gg),Q7=45,Y7=95;function F$(t){return ry(t)}function zQ(t){return t.filter(e=>e!=65039)}function j$(t){for(let e of t.split(".")){let r=F$(e);try{for(let n=r.lastIndexOf(Y7)-1;n>=0;n--)if(r[n]!==Y7)throw new Error("underscore only allowed at start");if(r.length>=4&&r.every(n=>n<128)&&r[2]===Q7&&r[3]===Q7)throw new Error("invalid label extension")}catch(n){throw new Error(`Invalid label "${e}": ${n.message}`)}}return t}function WQ(t){return j$(HQ(t,zQ))}function HQ(t,e){let r=F$(t).reverse(),n=[];for(;r.length;){let i=VQ(r);if(i){n.push(...e(i));continue}let s=r.pop();if(BQ.has(s)){n.push(s);continue}if(FQ.has(s))continue;let o=jQ[s];if(o){n.push(...o);continue}throw new Error(`Disallowed codepoint: 0x${s.toString(16).toUpperCase()}`)}return j$(qQ(String.fromCodePoint(...n)))}function qQ(t){return t.normalize("NFC")}function VQ(t,e){var r;let n=UQ,i,s,o=[],a=t.length;for(e&&(e.length=0);a;){let c=t[--a];if(n=(r=n.branches.find(l=>l.set.has(c)))===null||r===void 0?void 0:r.node,!n)break;if(n.save)s=c;else if(n.check&&c===s)break;o.push(c),n.fe0f&&(o.push(65039),a>0&&t[a-1]==65039&&a--),n.valid&&(i=o.slice(),n.valid==2&&i.splice(1,1),e&&e.push(...t.slice(a).reverse()),t.length=a)}return i}const GQ=new ee(D$),U$=new Uint8Array(32);U$.fill(0);function J7(t){if(t.length===0)throw new Error("invalid ENS name; empty component");return t}function jE(t){const e=vt(WQ(t)),r=[];if(t.length===0)return r;let n=0;for(let i=0;i=e.length)throw new Error("invalid ENS name; empty component");return r.push(J7(e.slice(n))),r}function KQ(t){try{return jE(t).length!==0}catch{}return!1}function n0(t){typeof t!="string"&&GQ.throwArgumentError("invalid ENS name; not a string","name",t);let e=U$;const r=jE(t);for(;r.length;)e=Ee(ht([e,Ee(r.pop())]));return te(e)}function z$(t){return te(ht(jE(t).map(e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const r=new Uint8Array(e.length+1);return r.set(e,1),r[0]=r.length-1,r})))+"00"}const QQ=`Ethereum Signed Message: -`;function Kg(t){return typeof t=="string"&&(t=vt(t)),Ee(ht([vt(QQ),vt(String(t.length)),t]))}var YQ=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const ir=new ee(D$),W$=new Uint8Array(32);W$.fill(0);const JQ=Z.from(-1),H$=Z.from(0),q$=Z.from(1),XQ=Z.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function ZQ(t){const e=re(t),r=e.length%32;return r?Mn([e,W$.slice(r)]):te(e)}const eY=pt(q$.toHexString(),32),tY=pt(H$.toHexString(),32),X7={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},Pw=["name","version","chainId","verifyingContract","salt"];function Z7(t){return function(e){return typeof e!="string"&&ir.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const rY={name:Z7("name"),version:Z7("version"),chainId:function(t){try{return Z.from(t).toString()}catch{}return ir.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return Ie(t).toLowerCase()}catch{}return ir.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=re(t);if(e.length!==32)throw new Error("bad length");return te(e)}catch{}return ir.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function Tw(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=e[1]==="",n=parseInt(e[2]||"256");(n%8!==0||n>256||e[2]&&e[2]!==String(n))&&ir.throwArgumentError("invalid numeric width","type",t);const i=XQ.mask(r?n-1:n),s=r?i.add(q$).mul(JQ):H$;return function(o){const a=Z.from(o);return(a.lt(s)||a.gt(i))&&ir.throwArgumentError(`value out-of-bounds for ${t}`,"value",o),pt(a.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return(r===0||r>32||e[1]!==String(r))&&ir.throwArgumentError("invalid bytes width","type",t),function(n){return re(n).length!==r&&ir.throwArgumentError(`invalid length for ${t}`,"value",n),ZQ(n)}}}switch(t){case"address":return function(e){return pt(Ie(e),32)};case"bool":return function(e){return e?eY:tY};case"bytes":return function(e){return Ee(e)};case"string":return function(e){return Xa(e)}}return null}function ek(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}class _r{constructor(e){ne(this,"types",Object.freeze(bi(e))),ne(this,"_encoderCache",{}),ne(this,"_types",{});const r={},n={},i={};Object.keys(e).forEach(a=>{r[a]={},n[a]=[],i[a]={}});for(const a in e){const c={};e[a].forEach(l=>{c[l.name]&&ir.throwArgumentError(`duplicate variable name ${JSON.stringify(l.name)} in ${JSON.stringify(a)}`,"types",e),c[l.name]=!0;const u=l.type.match(/^([^\x5b]*)(\x5b|$)/)[1];u===a&&ir.throwArgumentError(`circular type reference to ${JSON.stringify(u)}`,"types",e),!Tw(u)&&(n[u]||ir.throwArgumentError(`unknown type ${JSON.stringify(u)}`,"types",e),n[u].push(a),r[a][u]=!0)})}const s=Object.keys(n).filter(a=>n[a].length===0);s.length===0?ir.throwArgumentError("missing primary type","types",e):s.length>1&&ir.throwArgumentError(`ambiguous primary types or unused types: ${s.map(a=>JSON.stringify(a)).join(", ")}`,"types",e),ne(this,"primaryType",s[0]);function o(a,c){c[a]&&ir.throwArgumentError(`circular type reference to ${JSON.stringify(a)}`,"types",e),c[a]=!0,Object.keys(r[a]).forEach(l=>{n[l]&&(o(l,c),Object.keys(c).forEach(u=>{i[u][l]=!0}))}),delete c[a]}o(this.primaryType,{});for(const a in i){const c=Object.keys(i[a]);c.sort(),this._types[a]=ek(a,e[a])+c.map(l=>ek(l,e[l])).join("")}}getEncoder(e){let r=this._encoderCache[e];return r||(r=this._encoderCache[e]=this._getEncoder(e)),r}_getEncoder(e){{const i=Tw(e);if(i)return i}const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const i=r[1],s=this.getEncoder(i),o=parseInt(r[3]);return a=>{o>=0&&a.length!==o&&ir.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",a);let c=a.map(s);return this._types[i]&&(c=c.map(Ee)),Ee(Mn(c))}}const n=this.types[e];if(n){const i=Xa(this._types[e]);return s=>{const o=n.map(({name:a,type:c})=>{const l=this.getEncoder(c)(s[a]);return this._types[c]?Ee(l):l});return o.unshift(i),Mn(o)}}return ir.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const r=this._types[e];return r||ir.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return Ee(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,n){if(Tw(e))return n(e,r);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){const o=i[1],a=parseInt(i[3]);return a>=0&&r.length!==a&&ir.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",r),r.map(c=>this._visit(o,c,n))}const s=this.types[e];return s?s.reduce((o,{name:a,type:c})=>(o[a]=this._visit(c,r[a],n),o),{}):ir.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new _r(e)}static getPrimaryType(e){return _r.from(e).primaryType}static hashStruct(e,r,n){return _r.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){const i=X7[n];i||ir.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>Pw.indexOf(n.name)-Pw.indexOf(i.name)),_r.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return Mn(["0x1901",_r.hashDomain(e),_r.from(r).hash(n)])}static hash(e,r,n){return Ee(_r.encode(e,r,n))}static resolveNames(e,r,n,i){return YQ(this,void 0,void 0,function*(){e=Gt(e);const s={};e.verifyingContract&&!Ue(e.verifyingContract,20)&&(s[e.verifyingContract]="0x");const o=_r.from(r);o.visit(n,(a,c)=>(a==="address"&&!Ue(c,20)&&(s[c]="0x"),c));for(const a in s)s[a]=yield i(a);return e.verifyingContract&&s[e.verifyingContract]&&(e.verifyingContract=s[e.verifyingContract]),n=o.visit(n,(a,c)=>a==="address"&&s[c]?s[c]:c),{domain:e,value:n}})}static getPayload(e,r,n){_r.hashDomain(e);const i={},s=[];Pw.forEach(c=>{const l=e[c];l!=null&&(i[c]=rY[c](l),s.push({name:c,type:X7[c]}))});const o=_r.from(r),a=Gt(r);return a.EIP712Domain?ir.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):a.EIP712Domain=s,o.encode(n),{types:a,domain:i,primaryType:o.primaryType,message:o.visit(n,(c,l)=>{if(c.match(/^bytes(\d*)/))return te(re(l));if(c.match(/^u?int/))return Z.from(l).toString();switch(c){case"address":return l.toLowerCase();case"bool":return!!l;case"string":return typeof l!="string"&&ir.throwArgumentError("invalid string","value",l),l}return ir.throwArgumentError("unsupported type","type",c)})}}}const nr=new ee(K1);class V$ extends pu{}class G$ extends pu{}class nY extends pu{}class iy extends pu{static isIndexed(e){return!!(e&&e._isIndexed)}}const iY={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function tk(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return r.error=e,r}class $r{constructor(e){let r=[];typeof e=="string"?r=JSON.parse(e):r=e,ne(this,"fragments",r.map(n=>to.from(n)).filter(n=>n!=null)),ne(this,"_abiCoder",ws(new.target,"getAbiCoder")()),ne(this,"functions",{}),ne(this,"errors",{}),ne(this,"events",{}),ne(this,"structs",{}),this.fragments.forEach(n=>{let i=null;switch(n.type){case"constructor":if(this.deploy){nr.warn("duplicate definition - constructor");return}ne(this,"deploy",n);return;case"function":i=this.functions;break;case"event":i=this.events;break;case"error":i=this.errors;break;default:return}let s=n.format();if(i[s]){nr.warn("duplicate definition - "+s);return}i[s]=n}),this.deploy||ne(this,"deploy",gs.from({payable:!1,type:"constructor"})),ne(this,"_isInterface",!0)}format(e){e||(e=rt.full),e===rt.sighash&&nr.throwArgumentError("interface does not support formatting sighash","format",e);const r=this.fragments.map(n=>n.format(e));return e===rt.json?JSON.stringify(r.map(n=>JSON.parse(n))):r}static getAbiCoder(){return zn}static getAddress(e){return Ie(e)}static getSighash(e){return vr(Xa(e.format()),0,4)}static getEventTopic(e){return Xa(e.format())}getFunction(e){if(Ue(e)){for(const n in this.functions)if(e===this.getSighash(n))return this.functions[n];nr.throwArgumentError("no matching function","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.functions).filter(s=>s.split("(")[0]===n);return i.length===0?nr.throwArgumentError("no matching function","name",n):i.length>1&&nr.throwArgumentError("multiple matching functions","name",n),this.functions[i[0]]}const r=this.functions[bs.fromString(e).format()];return r||nr.throwArgumentError("no matching function","signature",e),r}getEvent(e){if(Ue(e)){const n=e.toLowerCase();for(const i in this.events)if(n===this.getEventTopic(i))return this.events[i];nr.throwArgumentError("no matching event","topichash",n)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.events).filter(s=>s.split("(")[0]===n);return i.length===0?nr.throwArgumentError("no matching event","name",n):i.length>1&&nr.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}const r=this.events[Zs.fromString(e).format()];return r||nr.throwArgumentError("no matching event","signature",e),r}getError(e){if(Ue(e)){const n=ws(this.constructor,"getSighash");for(const i in this.errors){const s=this.errors[i];if(e===n(s))return this.errors[i]}nr.throwArgumentError("no matching error","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.errors).filter(s=>s.split("(")[0]===n);return i.length===0?nr.throwArgumentError("no matching error","name",n):i.length>1&&nr.throwArgumentError("multiple matching errors","name",n),this.errors[i[0]]}const r=this.errors[bs.fromString(e).format()];return r||nr.throwArgumentError("no matching error","signature",e),r}getSighash(e){if(typeof e=="string")try{e=this.getFunction(e)}catch(r){try{e=this.getError(e)}catch{throw r}}return ws(this.constructor,"getSighash")(e)}getEventTopic(e){return typeof e=="string"&&(e=this.getEvent(e)),ws(this.constructor,"getEventTopic")(e)}_decodeParams(e,r){return this._abiCoder.decode(e,r)}_encodeParams(e,r){return this._abiCoder.encode(e,r)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,r){typeof e=="string"&&(e=this.getError(e));const n=re(r);return te(n.slice(0,4))!==this.getSighash(e)&&nr.throwArgumentError(`data signature does not match error ${e.name}.`,"data",te(n)),this._decodeParams(e.inputs,n.slice(4))}encodeErrorResult(e,r){return typeof e=="string"&&(e=this.getError(e)),te(ht([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionData(e,r){typeof e=="string"&&(e=this.getFunction(e));const n=re(r);return te(n.slice(0,4))!==this.getSighash(e)&&nr.throwArgumentError(`data signature does not match function ${e.name}.`,"data",te(n)),this._decodeParams(e.inputs,n.slice(4))}encodeFunctionData(e,r){return typeof e=="string"&&(e=this.getFunction(e)),te(ht([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionResult(e,r){typeof e=="string"&&(e=this.getFunction(e));let n=re(r),i=null,s="",o=null,a=null,c=null;switch(n.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,n)}catch{}break;case 4:{const l=te(n.slice(0,4)),u=iY[l];if(u)o=this._abiCoder.decode(u.inputs,n.slice(4)),a=u.name,c=u.signature,u.reason&&(i=o[0]),a==="Error"?s=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(o[0])}`:a==="Panic"&&(s=`; VM Exception while processing transaction: reverted with panic code ${o[0]}`);else try{const f=this.getError(l);o=this._abiCoder.decode(f.inputs,n.slice(4)),a=f.name,c=f.format()}catch{}break}}return nr.throwError("call revert exception"+s,ee.errors.CALL_EXCEPTION,{method:e.format(),data:te(r),errorArgs:o,errorName:a,errorSignature:c,reason:i})}encodeFunctionResult(e,r){return typeof e=="string"&&(e=this.getFunction(e)),te(this._abiCoder.encode(e.outputs,r||[]))}encodeFilterTopics(e,r){typeof e=="string"&&(e=this.getEvent(e)),r.length>e.inputs.length&&nr.throwError("too many arguments for "+e.format(),ee.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:r});let n=[];e.anonymous||n.push(this.getEventTopic(e));const i=(s,o)=>s.type==="string"?Xa(o):s.type==="bytes"?Ee(te(o)):(s.type==="bool"&&typeof o=="boolean"&&(o=o?"0x01":"0x00"),s.type.match(/^u?int/)&&(o=Z.from(o).toHexString()),s.type==="address"&&this._abiCoder.encode(["address"],[o]),pt(te(o),32));for(r.forEach((s,o)=>{let a=e.inputs[o];if(!a.indexed){s!=null&&nr.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+a.name,s);return}s==null?n.push(null):a.baseType==="array"||a.baseType==="tuple"?nr.throwArgumentError("filtering with tuples or arrays not supported","contract."+a.name,s):Array.isArray(s)?n.push(s.map(c=>i(a,c))):n.push(i(a,s))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,r){typeof e=="string"&&(e=this.getEvent(e));const n=[],i=[],s=[];return e.anonymous||n.push(this.getEventTopic(e)),r.length!==e.inputs.length&&nr.throwArgumentError("event arguments/values mismatch","values",r),e.inputs.forEach((o,a)=>{const c=r[a];if(o.indexed)if(o.type==="string")n.push(Xa(c));else if(o.type==="bytes")n.push(Ee(c));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");n.push(this._abiCoder.encode([o.type],[c]))}else i.push(o),s.push(c)}),{data:this._abiCoder.encode(i,s),topics:n}}decodeEventLog(e,r,n){if(typeof e=="string"&&(e=this.getEvent(e)),n!=null&&!e.anonymous){let d=this.getEventTopic(e);(!Ue(n[0],32)||n[0].toLowerCase()!==d)&&nr.throwError("fragment/topic mismatch",ee.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:d,value:n[0]}),n=n.slice(1)}let i=[],s=[],o=[];e.inputs.forEach((d,h)=>{d.indexed?d.type==="string"||d.type==="bytes"||d.baseType==="tuple"||d.baseType==="array"?(i.push(Ur.fromObject({type:"bytes32",name:d.name})),o.push(!0)):(i.push(d),o.push(!1)):(s.push(d),o.push(!1))});let a=n!=null?this._abiCoder.decode(i,ht(n)):null,c=this._abiCoder.decode(s,r,!0),l=[],u=0,f=0;e.inputs.forEach((d,h)=>{if(d.indexed)if(a==null)l[h]=new iy({_isIndexed:!0,hash:null});else if(o[h])l[h]=new iy({_isIndexed:!0,hash:a[f++]});else try{l[h]=a[f++]}catch(p){l[h]=p}else try{l[h]=c[u++]}catch(p){l[h]=p}if(d.name&&l[d.name]==null){const p=l[h];p instanceof Error?Object.defineProperty(l,d.name,{enumerable:!0,get:()=>{throw tk(`property ${JSON.stringify(d.name)}`,p)}}):l[d.name]=p}});for(let d=0;d{throw tk(`index ${d}`,h)}})}return Object.freeze(l)}parseTransaction(e){let r=this.getFunction(e.data.substring(0,10).toLowerCase());return r?new G$({args:this._abiCoder.decode(r.inputs,"0x"+e.data.substring(10)),functionFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r),value:Z.from(e.value||"0")}):null}parseLog(e){let r=this.getEvent(e.topics[0]);return!r||r.anonymous?null:new V$({eventFragment:r,name:r.name,signature:r.format(),topic:this.getEventTopic(r),args:this.decodeEventLog(r,e.data,e.topics)})}parseError(e){const r=te(e);let n=this.getError(r.substring(0,10).toLowerCase());return n?new nY({args:this._abiCoder.decode(n.inputs,"0x"+r.substring(10)),errorFragment:n,name:n.name,signature:n.format(),sighash:this.getSighash(n)}):null}static isInterface(e){return!!(e&&e._isInterface)}}const sY="abstract-provider/5.7.0";var oY=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const aY=new ee(sY);class cY extends pu{static isForkEvent(e){return!!(e&&e._isForkEvent)}}class ga{constructor(){aY.checkAbstract(new.target,ga),ne(this,"_isProvider",!0)}getFeeData(){return oY(this,void 0,void 0,function*(){const{block:e,gasPrice:r}=yield mt({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(o=>null)});let n=null,i=null,s=null;return e&&e.baseFeePerGas&&(n=e.baseFeePerGas,s=Z.from("1500000000"),i=e.baseFeePerGas.mul(2).add(s)),{lastBaseFeePerGas:n,maxFeePerGas:i,maxPriorityFeePerGas:s,gasPrice:r}})}addListener(e,r){return this.on(e,r)}removeListener(e,r){return this.off(e,r)}static isProvider(e){return!!(e&&e._isProvider)}}const lY="abstract-signer/5.7.0";var os=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const $i=new ee(lY),uY=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],fY=[ee.errors.INSUFFICIENT_FUNDS,ee.errors.NONCE_EXPIRED,ee.errors.REPLACEMENT_UNDERPRICED];let xc=class K${constructor(){$i.checkAbstract(new.target,K$),ne(this,"_isSigner",!0)}getBalance(e){return os(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return os(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return os(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const r=yield mt(this.checkTransaction(e));return yield this.provider.estimateGas(r)})}call(e,r){return os(this,void 0,void 0,function*(){this._checkProvider("call");const n=yield mt(this.checkTransaction(e));return yield this.provider.call(n,r)})}sendTransaction(e){return os(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");const r=yield this.populateTransaction(e),n=yield this.signTransaction(r);return yield this.provider.sendTransaction(n)})}getChainId(){return os(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return os(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return os(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(e){return os(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(const n in e)uY.indexOf(n)===-1&&$i.throwArgumentError("invalid transaction key: "+n,"transaction",e);const r=Gt(e);return r.from==null?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then(n=>(n[0].toLowerCase()!==n[1].toLowerCase()&&$i.throwArgumentError("from address mismatch","transaction",e),n[0])),r}populateTransaction(e){return os(this,void 0,void 0,function*(){const r=yield mt(this.checkTransaction(e));r.to!=null&&(r.to=Promise.resolve(r.to).then(i=>os(this,void 0,void 0,function*(){if(i==null)return null;const s=yield this.resolveName(i);return s==null&&$i.throwArgumentError("provided ENS name resolves to null","tx.to",i),s})),r.to.catch(i=>{}));const n=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||n)?$i.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e):(r.type===0||r.type===1)&&n&&$i.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1)r.gasPrice==null&&(r.gasPrice=this.getGasPrice());else{const i=yield this.getFeeData();if(r.type==null)if(i.maxFeePerGas!=null&&i.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){const s=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=s,r.maxPriorityFeePerGas=s}else r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas);else i.gasPrice!=null?(n&&$i.throwError("network does not support EIP-1559",ee.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=i.gasPrice),r.type=0):$i.throwError("failed to get consistent fee data",ee.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else r.type===2&&(r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas))}return r.nonce==null&&(r.nonce=this.getTransactionCount("pending")),r.gasLimit==null&&(r.gasLimit=this.estimateGas(r).catch(i=>{if(fY.indexOf(i.code)>=0)throw i;return $i.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",ee.errors.UNPREDICTABLE_GAS_LIMIT,{error:i,tx:r})})),r.chainId==null?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then(i=>(i[1]!==0&&i[0]!==i[1]&&$i.throwArgumentError("chainId address mismatch","transaction",e),i[0])),yield mt(r)})}_checkProvider(e){this.provider||$i.throwError("missing provider",ee.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!!(e&&e._isSigner)}};class UE extends xc{constructor(e,r){super(),ne(this,"address",e),ne(this,"provider",r||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,r){return Promise.resolve().then(()=>{$i.throwError(e,ee.errors.UNSUPPORTED_OPERATION,{operation:r})})}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,r,n){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new UE(this.address,e)}}var Q$={},Xe={},Q1=Y$;function Y$(t,e){if(!t)throw new Error(e||"Assertion failed")}Y$.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)};var Z5={exports:{}};typeof Object.create=="function"?Z5.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Z5.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}};var dY=Z5.exports,hY=Q1,pY=dY;Xe.inherits=pY;function vY(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function mY(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),i=0;i>6|192,r[n++]=s&63|128):vY(t,i)?(s=65536+((s&1023)<<10)+(t.charCodeAt(++i)&1023),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=s&63|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=s&63|128)}else for(i=0;i>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}Xe.htonl=J$;function gY(t,e){for(var r="",n=0;n>>0}return s}Xe.join32=bY;function wY(t,e){for(var r=new Array(t.length*4),n=0,i=0;n>>24,r[i+1]=s>>>16&255,r[i+2]=s>>>8&255,r[i+3]=s&255):(r[i+3]=s>>>24,r[i+2]=s>>>16&255,r[i+1]=s>>>8&255,r[i]=s&255)}return r}Xe.split32=wY;function xY(t,e){return t>>>e|t<<32-e}Xe.rotr32=xY;function EY(t,e){return t<>>32-e}Xe.rotl32=EY;function CY(t,e){return t+e>>>0}Xe.sum32=CY;function SY(t,e,r){return t+e+r>>>0}Xe.sum32_3=SY;function kY(t,e,r,n){return t+e+r+n>>>0}Xe.sum32_4=kY;function AY(t,e,r,n,i){return t+e+r+n+i>>>0}Xe.sum32_5=AY;function _Y(t,e,r,n){var i=t[e],s=t[e+1],o=n+s>>>0,a=(o>>0,t[e+1]=o}Xe.sum64=_Y;function PY(t,e,r,n){var i=e+n>>>0,s=(i>>0}Xe.sum64_hi=PY;function TY(t,e,r,n){var i=e+n;return i>>>0}Xe.sum64_lo=TY;function IY(t,e,r,n,i,s,o,a){var c=0,l=e;l=l+n>>>0,c+=l>>0,c+=l>>0,c+=l>>0}Xe.sum64_4_hi=IY;function OY(t,e,r,n,i,s,o,a){var c=e+n+s+a;return c>>>0}Xe.sum64_4_lo=OY;function RY(t,e,r,n,i,s,o,a,c,l){var u=0,f=e;f=f+n>>>0,u+=f>>0,u+=f>>0,u+=f>>0,u+=f>>0}Xe.sum64_5_hi=RY;function $Y(t,e,r,n,i,s,o,a,c,l){var u=e+n+s+a+l;return u>>>0}Xe.sum64_5_lo=$Y;function MY(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}Xe.rotr64_hi=MY;function NY(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}Xe.rotr64_lo=NY;function DY(t,e,r){return t>>>r}Xe.shr64_hi=DY;function LY(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}Xe.shr64_lo=LY;var Sd={},rk=Xe,BY=Q1;function Qg(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}Sd.BlockHash=Qg;Qg.prototype.update=function(e,r){if(e=rk.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var n=e.length%this._delta8;this.pending=e.slice(e.length-n,e.length),this.pending.length===0&&(this.pending=null),e=rk.join32(e,0,e.length-n,this.endian);for(var i=0;i>>24&255,i[s++]=e>>>16&255,i[s++]=e>>>8&255,i[s++]=e&255}else for(i[s++]=e&255,i[s++]=e>>>8&255,i[s++]=e>>>16&255,i[s++]=e>>>24&255,i[s++]=0,i[s++]=0,i[s++]=0,i[s++]=0,o=8;o>>3}_o.g0_256=WY;function HY(t){return lo(t,17)^lo(t,19)^t>>>10}_o.g1_256=HY;var Yf=Xe,qY=Sd,VY=_o,Iw=Yf.rotl32,dh=Yf.sum32,GY=Yf.sum32_5,KY=VY.ft_1,nM=qY.BlockHash,QY=[1518500249,1859775393,2400959708,3395469782];function bo(){if(!(this instanceof bo))return new bo;nM.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Yf.inherits(bo,nM);var YY=bo;bo.blockSize=512;bo.outSize=160;bo.hmacStrength=80;bo.padLength=64;bo.prototype._update=function(e,r){for(var n=this.W,i=0;i<16;i++)n[i]=e[r+i];for(;ithis.blockSize&&(e=new this.Hash().update(e).digest()),LJ(e.length<=this.blockSize);for(var r=e.length;r>8,d=u&255;f?c.push(f,d):c.push(d)}return c}r.toArray=n;function i(o){return o.length===1?"0"+o:o}r.zero2=i;function s(o){for(var a="",c=0;c(d>>1)-1?v=(d>>1)-m:v=m,h.isubn(v)):v=0,f[p]=v,h.iushrn(1)}return f}r.getNAF=n;function i(c,l){var u=[[],[]];c=c.clone(),l=l.clone();for(var f=0,d=0,h;c.cmpn(-f)>0||l.cmpn(-d)>0;){var p=c.andln(3)+f&3,v=l.andln(3)+d&3;p===3&&(p=-1),v===3&&(v=-1);var m;p&1?(h=c.andln(7)+f&7,(h===3||h===5)&&v===2?m=-p:m=p):m=0,u[0].push(m);var g;v&1?(h=l.andln(7)+d&7,(h===3||h===5)&&p===2?g=-v:g=v):g=0,u[1].push(g),2*f===m+1&&(f=1-f),2*d===g+1&&(d=1-d),c.iushrn(1),l.iushrn(1)}return u}r.getJSF=i;function s(c,l,u){var f="_"+l;c.prototype[l]=function(){return this[f]!==void 0?this[f]:this[f]=u.call(this)}}r.cachedProperty=s;function o(c){return typeof c=="string"?r.toArray(c,"hex"):c}r.parseBytes=o;function a(c){return new Te(c,"hex","le")}r.intFromLE=a}),sy=Pi.getNAF,jJ=Pi.getJSF,oy=Pi.assert;function zc(t,e){this.type=t,this.p=new Te(e.p,16),this.red=e.prime?Te.red(e.prime):Te.mont(this.p),this.zero=new Te(0).toRed(this.red),this.one=new Te(1).toRed(this.red),this.two=new Te(2).toRed(this.red),this.n=e.n&&new Te(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var vu=zc;zc.prototype.point=function(){throw new Error("Not implemented")};zc.prototype.validate=function(){throw new Error("Not implemented")};zc.prototype._fixedNafMul=function(e,r){oy(e.precomputed);var n=e._getDoubles(),i=sy(r,1,this._bitLength),s=(1<=a;l--)c=(c<<1)+i[l];o.push(c)}for(var u=this.jpoint(null,null,null),f=this.jpoint(null,null,null),d=s;d>0;d--){for(a=0;a=0;c--){for(var l=0;c>=0&&o[c]===0;c--)l++;if(c>=0&&l++,a=a.dblp(l),c<0)break;var u=o[c];oy(u!==0),e.type==="affine"?u>0?a=a.mixedAdd(s[u-1>>1]):a=a.mixedAdd(s[-u-1>>1].neg()):u>0?a=a.add(s[u-1>>1]):a=a.add(s[-u-1>>1].neg())}return e.type==="affine"?a.toP():a};zc.prototype._wnafMulAdd=function(e,r,n,i,s){var o=this._wnafT1,a=this._wnafT2,c=this._wnafT3,l=0,u,f,d;for(u=0;u=1;u-=2){var p=u-1,v=u;if(o[p]!==1||o[v]!==1){c[p]=sy(n[p],o[p],this._bitLength),c[v]=sy(n[v],o[v],this._bitLength),l=Math.max(c[p].length,l),l=Math.max(c[v].length,l);continue}var m=[r[p],null,null,r[v]];r[p].y.cmp(r[v].y)===0?(m[1]=r[p].add(r[v]),m[2]=r[p].toJ().mixedAdd(r[v].neg())):r[p].y.cmp(r[v].y.redNeg())===0?(m[1]=r[p].toJ().mixedAdd(r[v]),m[2]=r[p].add(r[v].neg())):(m[1]=r[p].toJ().mixedAdd(r[v]),m[2]=r[p].toJ().mixedAdd(r[v].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],y=jJ(n[p],n[v]);for(l=Math.max(y[0].length,l),c[p]=new Array(l),c[v]=new Array(l),f=0;f=0;u--){for(var w=0;u>=0;){var I=!0;for(f=0;f=0&&w++,A=A.dblp(w),u<0)break;for(f=0;f0?d=a[f][B-1>>1]:B<0&&(d=a[f][-B-1>>1].neg()),d.type==="affine"?A=A.mixedAdd(d):A=A.add(d))}}for(u=0;u=Math.ceil((e.bitLength()+1)/r.step):!1};Zi.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s=0&&(h=l,p=u),f.negative&&(f=f.neg(),d=d.neg()),h.negative&&(h=h.neg(),p=p.neg()),[{a:f,b:d},{a:h,b:p}]};es.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],s=i.b.mul(e).divRound(this.n),o=n.b.neg().mul(e).divRound(this.n),a=s.mul(n.a),c=o.mul(i.a),l=s.mul(n.b),u=o.mul(i.b),f=e.sub(a).sub(c),d=l.add(u).neg();return{k1:f,k2:d}};es.prototype.pointFromX=function(e,r){e=new Te(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var s=i.fromRed().isOdd();return(r&&!s||!r&&s)&&(i=i.redNeg()),this.point(e,i)};es.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0};es.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,o=0;o":""};Zr.prototype.isInfinity=function(){return this.inf};Zr.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};Zr.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),o=s.redSqr().redISub(this.x.redAdd(this.x)),a=s.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)};Zr.prototype.getX=function(){return this.x.fromRed()};Zr.prototype.getY=function(){return this.y.fromRed()};Zr.prototype.mul=function(e){return e=new Te(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};Zr.prototype.mulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)};Zr.prototype.jmulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)};Zr.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};Zr.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=function(s){return s.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};Zr.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function un(t,e,r,n){vu.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Te(0)):(this.x=new Te(e,16),this.y=new Te(r,16),this.z=new Te(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}WE(un,vu.BasePoint);es.prototype.jpoint=function(e,r,n){return new un(this,e,r,n)};un.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)};un.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};un.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),s=e.x.redMul(n),o=this.y.redMul(r.redMul(e.z)),a=e.y.redMul(n.redMul(this.z)),c=i.redSub(s),l=o.redSub(a);if(c.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var u=c.redSqr(),f=u.redMul(c),d=i.redMul(u),h=l.redSqr().redIAdd(f).redISub(d).redISub(d),p=l.redMul(d.redISub(h)).redISub(o.redMul(f)),v=this.z.redMul(e.z).redMul(c);return this.curve.jpoint(h,p,v)};un.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),s=this.y,o=e.y.redMul(r).redMul(this.z),a=n.redSub(i),c=s.redSub(o);if(a.cmpn(0)===0)return c.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var l=a.redSqr(),u=l.redMul(a),f=n.redMul(l),d=c.redSqr().redIAdd(u).redISub(f).redISub(f),h=c.redMul(f.redISub(d)).redISub(s.redMul(u)),p=this.z.redMul(a);return this.curve.jpoint(d,h,p)};un.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}};un.prototype.inspect=function(){return this.isInfinity()?"":""};un.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var Xv=_d(function(t,e){var r=e;r.base=vu,r.short=zJ,r.mont=null,r.edwards=null}),Zv=_d(function(t,e){var r=e,n=Pi.assert;function i(a){a.type==="short"?this.curve=new Xv.short(a):a.type==="edwards"?this.curve=new Xv.edwards(a):this.curve=new Xv.mont(a),this.g=this.curve.g,this.n=this.curve.n,this.hash=a.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=i;function s(a,c){Object.defineProperty(r,a,{configurable:!0,enumerable:!0,get:function(){var l=new i(c);return Object.defineProperty(r,a,{configurable:!0,enumerable:!0,value:l}),l}})}s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Qn.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Qn.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Qn.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Qn.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Qn.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Qn.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Qn.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var o;try{o=null.crash()}catch{o=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Qn.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",o]})});function Ec(t){if(!(this instanceof Ec))return new Ec(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=xs.toArray(t.entropy,t.entropyEnc||"hex"),r=xs.toArray(t.nonce,t.nonceEnc||"hex"),n=xs.toArray(t.pers,t.persEnc||"hex");zE(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var vM=Ec;Ec.prototype._init=function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};Ec.prototype.generate=function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=xs.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length"};var WJ=Pi.assert;function Yg(t,e){if(t instanceof Yg)return t;this._importDER(t,e)||(WJ(t.r&&t.s,"Signature without r or s"),this.r=new Te(t.r,16),this.s=new Te(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var Jg=Yg;function HJ(){this.place=0}function $w(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,s=0,o=e.place;s>>=0;return i<=127?!1:(e.place=o,i)}function ok(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}Yg.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=ok(r),n=ok(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];Mw(i,r.length),i=i.concat(r),i.push(2),Mw(i,n.length);var s=i.concat(n),o=[48];return Mw(o,s.length),o=o.concat(s),Pi.encode(o,e)};var qJ=function(){throw new Error("unsupported")},mM=Pi.assert;function Gi(t){if(!(this instanceof Gi))return new Gi(t);typeof t=="string"&&(mM(Object.prototype.hasOwnProperty.call(Zv,t),"Unknown curve "+t),t=Zv[t]),t instanceof Zv.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var VJ=Gi;Gi.prototype.keyPair=function(e){return new HE(this,e)};Gi.prototype.keyFromPrivate=function(e,r){return HE.fromPrivate(this,e,r)};Gi.prototype.keyFromPublic=function(e,r){return HE.fromPublic(this,e,r)};Gi.prototype.genKeyPair=function(e){e||(e={});for(var r=new vM({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||qJ(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new Te(2));;){var s=new Te(r.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}};Gi.prototype._truncateToN=function(e,r){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};Gi.prototype.sign=function(e,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),e=this._truncateToN(new Te(e,16));for(var s=this.n.byteLength(),o=r.getPrivate().toArray("be",s),a=e.toArray("be",s),c=new vM({hash:this.hash,entropy:o,nonce:a,pers:i.pers,persEnc:i.persEnc||"utf8"}),l=this.n.sub(new Te(1)),u=0;;u++){var f=i.k?i.k(u):new Te(c.generate(this.n.byteLength()));if(f=this._truncateToN(f,!0),!(f.cmpn(1)<=0||f.cmp(l)>=0)){var d=this.g.mul(f);if(!d.isInfinity()){var h=d.getX(),p=h.umod(this.n);if(p.cmpn(0)!==0){var v=f.invm(this.n).mul(p.mul(r.getPrivate()).iadd(e));if(v=v.umod(this.n),v.cmpn(0)!==0){var m=(d.getY().isOdd()?1:0)|(h.cmp(p)!==0?2:0);return i.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),m^=1),new Jg({r:p,s:v,recoveryParam:m})}}}}}};Gi.prototype.verify=function(e,r,n,i){e=this._truncateToN(new Te(e,16)),n=this.keyFromPublic(n,i),r=new Jg(r,"hex");var s=r.r,o=r.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a=o.invm(this.n),c=a.mul(e).umod(this.n),l=a.mul(s).umod(this.n),u;return this.curve._maxwellTrick?(u=this.g.jmulAdd(c,n.getPublic(),l),u.isInfinity()?!1:u.eqXToP(s)):(u=this.g.mulAdd(c,n.getPublic(),l),u.isInfinity()?!1:u.getX().umod(this.n).cmp(s)===0)};Gi.prototype.recoverPubKey=function(t,e,r,n){mM((3&r)===r,"The recovery param is more than two bits"),e=new Jg(e,n);var i=this.n,s=new Te(t),o=e.r,a=e.s,c=r&1,l=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");l?o=this.curve.pointFromX(o.add(this.curve.n),c):o=this.curve.pointFromX(o,c);var u=e.r.invm(i),f=i.sub(s).mul(u).umod(i),d=a.mul(u).umod(i);return this.g.mulAdd(f,o,d)};Gi.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new Jg(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(t,e,i)}catch{continue}if(s.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var GJ=_d(function(t,e){var r=e;r.version="6.5.4",r.utils=Pi,r.rand=function(){throw new Error("unsupported")},r.curve=Xv,r.curves=Zv,r.ec=VJ,r.eddsa=null}),KJ=GJ.ec;const QJ="signing-key/5.7.0",n6=new ee(QJ);let Nw=null;function Ks(){return Nw||(Nw=new KJ("secp256k1")),Nw}class Ml{constructor(e){ne(this,"curve","secp256k1"),ne(this,"privateKey",te(e)),yo(this.privateKey)!==32&&n6.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=Ks().keyFromPrivate(re(this.privateKey));ne(this,"publicKey","0x"+r.getPublic(!1,"hex")),ne(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),ne(this,"_isSigningKey",!0)}_addPoint(e){const r=Ks().keyFromPublic(re(this.publicKey)),n=Ks().keyFromPublic(re(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const r=Ks().keyFromPrivate(re(this.privateKey)),n=re(e);n.length!==32&&n6.throwArgumentError("bad digest length","digest",e);const i=r.sign(n,{canonical:!0});return hu({recoveryParam:i.recoveryParam,r:pt("0x"+i.r.toString(16),32),s:pt("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const r=Ks().keyFromPrivate(re(this.privateKey)),n=Ks().keyFromPublic(re(qE(e)));return pt("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function yM(t,e){const r=hu(e),n={r:re(r.r),s:re(r.s)};return"0x"+Ks().recoverPubKey(re(t),n,r.recoveryParam).encode("hex",!1)}function qE(t,e){const r=re(t);if(r.length===32){const n=new Ml(r);return e?"0x"+Ks().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}else{if(r.length===33)return e?te(r):"0x"+Ks().keyFromPublic(r).getPublic(!1,"hex");if(r.length===65)return e?"0x"+Ks().keyFromPublic(r).getPublic(!0,"hex"):te(r)}return n6.throwArgumentError("invalid public or private key","key","[REDACTED]")}const YJ="transactions/5.7.0",En=new ee(YJ);var i6;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(i6||(i6={}));function VE(t){return t==="0x"?null:Ie(t)}function xn(t){return t==="0x"?rr:Z.from(t)}const JJ=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],XJ={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function dc(t){const e=qE(t);return Ie(vr(Ee(vr(e,1)),12))}function Zl(t,e){return dc(yM(re(t),e))}function di(t,e){const r=co(Z.from(t).toHexString());return r.length>32&&En.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function Dw(t,e){return{address:Ie(t),storageKeys:(e||[]).map((r,n)=>(yo(r)!==32&&En.throwArgumentError("invalid access list storageKey",`accessList[${t}:${n}]`,r),r.toLowerCase()))}}function mu(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(r.length>2&&En.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${n}]`,r),Dw(r[0],r[1])):Dw(r.address,r.storageKeys));const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,s)=>(i[s]=!0,i),{});return Dw(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function gM(t){return mu(t).map(e=>[e.address,e.storageKeys])}function bM(t,e){if(t.gasPrice!=null){const n=Z.from(t.gasPrice),i=Z.from(t.maxFeePerGas||0);n.eq(i)||En.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:n,maxFeePerGas:i})}const r=[di(t.chainId||0,"chainId"),di(t.nonce||0,"nonce"),di(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),di(t.maxFeePerGas||0,"maxFeePerGas"),di(t.gasLimit||0,"gasLimit"),t.to!=null?Ie(t.to):"0x",di(t.value||0,"value"),t.data||"0x",gM(t.accessList||[])];if(e){const n=hu(e);r.push(di(n.recoveryParam,"recoveryParam")),r.push(co(n.r)),r.push(co(n.s))}return Mn(["0x02",Jl(r)])}function wM(t,e){const r=[di(t.chainId||0,"chainId"),di(t.nonce||0,"nonce"),di(t.gasPrice||0,"gasPrice"),di(t.gasLimit||0,"gasLimit"),t.to!=null?Ie(t.to):"0x",di(t.value||0,"value"),t.data||"0x",gM(t.accessList||[])];if(e){const n=hu(e);r.push(di(n.recoveryParam,"recoveryParam")),r.push(co(n.r)),r.push(co(n.s))}return Mn(["0x01",Jl(r)])}function ZJ(t,e){IE(t,XJ);const r=[];JJ.forEach(function(o){let a=t[o.name]||[];const c={};o.numeric&&(c.hexPad="left"),a=re(te(a,c)),o.length&&a.length!==o.length&&a.length>0&&En.throwArgumentError("invalid length for "+o.name,"transaction:"+o.name,a),o.maxLength&&(a=co(a),a.length>o.maxLength&&En.throwArgumentError("invalid length for "+o.name,"transaction:"+o.name,a)),r.push(te(a))});let n=0;if(t.chainId!=null?(n=t.chainId,typeof n!="number"&&En.throwArgumentError("invalid transaction.chainId","transaction",t)):e&&!Jo(e)&&e.v>28&&(n=Math.floor((e.v-35)/2)),n!==0&&(r.push(te(n)),r.push("0x"),r.push("0x")),!e)return Jl(r);const i=hu(e);let s=27+i.recoveryParam;return n!==0?(r.pop(),r.pop(),r.pop(),s+=n*2+8,i.v>28&&i.v!==s&&En.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e)):i.v!==s&&En.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e),r.push(te(s)),r.push(co(re(i.r))),r.push(co(re(i.s))),Jl(r)}function s6(t,e){if(t.type==null||t.type===0)return t.accessList!=null&&En.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",t),ZJ(t,e);switch(t.type){case 1:return wM(t,e);case 2:return bM(t,e)}return En.throwError(`unsupported transaction type: ${t.type}`,ee.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:t.type})}function xM(t,e,r){try{const n=xn(e[0]).toNumber();if(n!==0&&n!==1)throw new Error("bad recid");t.v=n}catch{En.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=pt(e[1],32),t.s=pt(e[2],32);try{const n=Ee(r(t));t.from=Zl(n,{r:t.r,s:t.s,recoveryParam:t.v})}catch{}}function eX(t){const e=Vg(t.slice(1));e.length!==9&&e.length!==12&&En.throwArgumentError("invalid component count for transaction type: 2","payload",te(t));const r=xn(e[2]),n=xn(e[3]),i={type:2,chainId:xn(e[0]).toNumber(),nonce:xn(e[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:xn(e[4]),to:VE(e[5]),value:xn(e[6]),data:e[7],accessList:mu(e[8])};return e.length===9||(i.hash=Ee(t),xM(i,e.slice(9),bM)),i}function tX(t){const e=Vg(t.slice(1));e.length!==8&&e.length!==11&&En.throwArgumentError("invalid component count for transaction type: 1","payload",te(t));const r={type:1,chainId:xn(e[0]).toNumber(),nonce:xn(e[1]).toNumber(),gasPrice:xn(e[2]),gasLimit:xn(e[3]),to:VE(e[4]),value:xn(e[5]),data:e[6],accessList:mu(e[7])};return e.length===8||(r.hash=Ee(t),xM(r,e.slice(8),wM)),r}function rX(t){const e=Vg(t);e.length!==9&&e.length!==6&&En.throwArgumentError("invalid raw transaction","rawTransaction",t);const r={nonce:xn(e[0]).toNumber(),gasPrice:xn(e[1]),gasLimit:xn(e[2]),to:VE(e[3]),value:xn(e[4]),data:e[5],chainId:0};if(e.length===6)return r;try{r.v=Z.from(e[6]).toNumber()}catch{return r}if(r.r=pt(e[7],32),r.s=pt(e[8],32),Z.from(r.r).isZero()&&Z.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let n=r.v-27;const i=e.slice(0,6);r.chainId!==0&&(i.push(te(r.chainId)),i.push("0x"),i.push("0x"),n-=r.chainId*2+8);const s=Ee(Jl(i));try{r.from=Zl(s,{r:te(r.r),s:te(r.s),recoveryParam:n})}catch{}r.hash=Ee(t)}return r.type=null,r}function EM(t){const e=re(t);if(e[0]>127)return rX(e);switch(e[0]){case 1:return tX(e);case 2:return eX(e)}return En.throwError(`unsupported transaction type: ${e[0]}`,ee.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}const nX="contracts/5.7.0";var eu=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const wr=new ee(nX);function ay(t,e){return eu(this,void 0,void 0,function*(){const r=yield e;typeof r!="string"&&wr.throwArgumentError("invalid address or ENS name","name",r);try{return Ie(r)}catch{}t||wr.throwError("a provider or signer is needed to resolve ENS names",ee.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield t.resolveName(r);return n==null&&wr.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n})}function em(t,e,r){return eu(this,void 0,void 0,function*(){return Array.isArray(r)?yield Promise.all(r.map((n,i)=>em(t,Array.isArray(e)?e[i]:e[n.name],n))):r.type==="address"?yield ay(t,e):r.type==="tuple"?yield em(t,e,r.components):r.baseType==="array"?Array.isArray(e)?yield Promise.all(e.map(n=>em(t,n,r.arrayChildren))):Promise.reject(wr.makeError("invalid value for array",ee.errors.INVALID_ARGUMENT,{argument:"value",value:e})):e})}function Xg(t,e,r){return eu(this,void 0,void 0,function*(){let n={};r.length===e.inputs.length+1&&typeof r[r.length-1]=="object"&&(n=Gt(r.pop())),wr.checkArgumentCount(r.length,e.inputs.length,"passed to contract"),t.signer?n.from?n.from=mt({override:ay(t.signer,n.from),signer:t.signer.getAddress()}).then(l=>eu(this,void 0,void 0,function*(){return Ie(l.signer)!==l.override&&wr.throwError("Contract with a Signer cannot override from",ee.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),l.override})):n.from=t.signer.getAddress():n.from&&(n.from=ay(t.provider,n.from));const i=yield mt({args:em(t.signer||t.provider,r,e.inputs),address:t.resolvedAddress,overrides:mt(n)||{}}),s=t.interface.encodeFunctionData(e,i.args),o={data:s,to:i.address},a=i.overrides;if(a.nonce!=null&&(o.nonce=Z.from(a.nonce).toNumber()),a.gasLimit!=null&&(o.gasLimit=Z.from(a.gasLimit)),a.gasPrice!=null&&(o.gasPrice=Z.from(a.gasPrice)),a.maxFeePerGas!=null&&(o.maxFeePerGas=Z.from(a.maxFeePerGas)),a.maxPriorityFeePerGas!=null&&(o.maxPriorityFeePerGas=Z.from(a.maxPriorityFeePerGas)),a.from!=null&&(o.from=a.from),a.type!=null&&(o.type=a.type),a.accessList!=null&&(o.accessList=mu(a.accessList)),o.gasLimit==null&&e.gas!=null){let l=21e3;const u=re(s);for(let f=0;fn[l]!=null);return c.length&&wr.throwError(`cannot override ${c.map(l=>JSON.stringify(l)).join(",")}`,ee.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:c}),o})}function iX(t,e){return function(...r){return Xg(t,e,r)}}function sX(t,e){const r=t.signer||t.provider;return function(...n){return eu(this,void 0,void 0,function*(){r||wr.throwError("estimate require a provider or signer",ee.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield Xg(t,e,n);return yield r.estimateGas(i)})}}function oX(t,e){const r=e.wait.bind(e);e.wait=n=>r(n).then(i=>(i.events=i.logs.map(s=>{let o=bi(s),a=null;try{a=t.interface.parseLog(s)}catch{}return a&&(o.args=a.args,o.decode=(c,l)=>t.interface.decodeEventLog(a.eventFragment,c,l),o.event=a.name,o.eventSignature=a.signature),o.removeListener=()=>t.provider,o.getBlock=()=>t.provider.getBlock(i.blockHash),o.getTransaction=()=>t.provider.getTransaction(i.transactionHash),o.getTransactionReceipt=()=>Promise.resolve(i),o}),i))}function CM(t,e,r){const n=t.signer||t.provider;return function(...i){return eu(this,void 0,void 0,function*(){let s;if(i.length===e.inputs.length+1&&typeof i[i.length-1]=="object"){const c=Gt(i.pop());c.blockTag!=null&&(s=yield c.blockTag),delete c.blockTag,i.push(c)}t.deployTransaction!=null&&(yield t._deployed(s));const o=yield Xg(t,e,i),a=yield n.call(o,s);try{let c=t.interface.decodeFunctionResult(e,a);return r&&e.outputs.length===1&&(c=c[0]),c}catch(c){throw c.code===ee.errors.CALL_EXCEPTION&&(c.address=t.address,c.args=i,c.transaction=o),c}})}}function aX(t,e){return function(...r){return eu(this,void 0,void 0,function*(){t.signer||wr.throwError("sending a transaction requires a signer",ee.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),t.deployTransaction!=null&&(yield t._deployed());const n=yield Xg(t,e,r),i=yield t.signer.sendTransaction(n);return oX(t,i),i})}}function ak(t,e,r){return e.constant?CM(t,e,r):aX(t,e)}function SM(t){return t.address&&(t.topics==null||t.topics.length===0)?"*":(t.address||"*")+"@"+(t.topics?t.topics.map(e=>Array.isArray(e)?e.join("|"):e).join(":"):"")}class Q0{constructor(e,r){ne(this,"tag",e),ne(this,"filter",r),this._listeners=[]}addListener(e,r){this._listeners.push({listener:e,once:r})}removeListener(e){let r=!1;this._listeners=this._listeners.filter(n=>r||n.listener!==e?!0:(r=!0,!1))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map(e=>e.listener)}listenerCount(){return this._listeners.length}run(e){const r=this.listenerCount();return this._listeners=this._listeners.filter(n=>{const i=e.slice();return setTimeout(()=>{n.listener.apply(this,i)},0),!n.once}),r}prepareEvent(e){}getEmit(e){return[e]}}class cX extends Q0{constructor(){super("error",null)}}class ck extends Q0{constructor(e,r,n,i){const s={address:e};let o=r.getEventTopic(n);i?(o!==i[0]&&wr.throwArgumentError("topic mismatch","topics",i),s.topics=i.slice()):s.topics=[o],super(SM(s),s),ne(this,"address",e),ne(this,"interface",r),ne(this,"fragment",n)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(r,n)=>this.interface.decodeEventLog(this.fragment,r,n);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(r){e.args=null,e.decodeError=r}}getEmit(e){const r=x$(e.args);if(r.length)throw r[0].error;const n=(e.args||[]).slice();return n.push(e),n}}class lk extends Q0{constructor(e,r){super("*",{address:e}),ne(this,"address",e),ne(this,"interface",r)}prepareEvent(e){super.prepareEvent(e);try{const r=this.interface.parseLog(e);e.event=r.name,e.eventSignature=r.signature,e.decode=(n,i)=>this.interface.decodeEventLog(r.eventFragment,n,i),e.args=r.args}catch{}}}class lX{constructor(e,r,n){ne(this,"interface",ws(new.target,"getInterface")(r)),n==null?(ne(this,"provider",null),ne(this,"signer",null)):xc.isSigner(n)?(ne(this,"provider",n.provider||null),ne(this,"signer",n)):ga.isProvider(n)?(ne(this,"provider",n),ne(this,"signer",null)):wr.throwArgumentError("invalid signer or provider","signerOrProvider",n),ne(this,"callStatic",{}),ne(this,"estimateGas",{}),ne(this,"functions",{}),ne(this,"populateTransaction",{}),ne(this,"filters",{});{const o={};Object.keys(this.interface.events).forEach(a=>{const c=this.interface.events[a];ne(this.filters,a,(...l)=>({address:this.address,topics:this.interface.encodeFilterTopics(c,l)})),o[c.name]||(o[c.name]=[]),o[c.name].push(a)}),Object.keys(o).forEach(a=>{const c=o[a];c.length===1?ne(this.filters,a,this.filters[c[0]]):wr.warn(`Duplicate definition of ${a} (${c.join(", ")})`)})}if(ne(this,"_runningEvents",{}),ne(this,"_wrappedEmits",{}),e==null&&wr.throwArgumentError("invalid contract address or ENS name","addressOrName",e),ne(this,"address",e),this.provider)ne(this,"resolvedAddress",ay(this.provider,e));else try{ne(this,"resolvedAddress",Promise.resolve(Ie(e)))}catch{wr.throwError("provider is required to use ENS name as contract address",ee.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch(o=>{});const i={},s={};Object.keys(this.interface.functions).forEach(o=>{const a=this.interface.functions[o];if(s[o]){wr.warn(`Duplicate ABI entry for ${JSON.stringify(o)}`);return}s[o]=!0;{const c=a.name;i[`%${c}`]||(i[`%${c}`]=[]),i[`%${c}`].push(o)}this[o]==null&&ne(this,o,ak(this,a,!0)),this.functions[o]==null&&ne(this.functions,o,ak(this,a,!1)),this.callStatic[o]==null&&ne(this.callStatic,o,CM(this,a,!0)),this.populateTransaction[o]==null&&ne(this.populateTransaction,o,iX(this,a)),this.estimateGas[o]==null&&ne(this.estimateGas,o,sX(this,a))}),Object.keys(i).forEach(o=>{const a=i[o];if(a.length>1)return;o=o.substring(1);const c=a[0];try{this[o]==null&&ne(this,o,this[c])}catch{}this.functions[o]==null&&ne(this.functions,o,this.functions[c]),this.callStatic[o]==null&&ne(this.callStatic,o,this.callStatic[c]),this.populateTransaction[o]==null&&ne(this.populateTransaction,o,this.populateTransaction[c]),this.estimateGas[o]==null&&ne(this.estimateGas,o,this.estimateGas[c])})}static getContractAddress(e){return $E(e)}static getInterface(e){return $r.isInterface(e)?e:new $r(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then(()=>this):this._deployedPromise=this.provider.getCode(this.address,e).then(r=>(r==="0x"&&wr.throwError("contract not deployed",ee.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this))),this._deployedPromise}fallback(e){this.signer||wr.throwError("sending a transactions require a signer",ee.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const r=Gt(e||{});return["from","to"].forEach(function(n){r[n]!=null&&wr.throwError("cannot override "+n,ee.errors.UNSUPPORTED_OPERATION,{operation:n})}),r.to=this.resolvedAddress,this.deployed().then(()=>this.signer.sendTransaction(r))}connect(e){typeof e=="string"&&(e=new UE(e,this.provider));const r=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&ne(r,"deployTransaction",this.deployTransaction),r}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return iy.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if(typeof e=="string"){if(e==="error")return this._normalizeRunningEvent(new cX);if(e==="event")return this._normalizeRunningEvent(new Q0("event",null));if(e==="*")return this._normalizeRunningEvent(new lk(this.address,this.interface));const r=this.interface.getEvent(e);return this._normalizeRunningEvent(new ck(this.address,this.interface,r))}if(e.topics&&e.topics.length>0){try{const n=e.topics[0];if(typeof n!="string")throw new Error("invalid topic");const i=this.interface.getEvent(n);return this._normalizeRunningEvent(new ck(this.address,this.interface,i,e.topics))}catch{}const r={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new Q0(SM(r),r))}return this._normalizeRunningEvent(new lk(this.address,this.interface))}_checkRunningEvents(e){if(e.listenerCount()===0){delete this._runningEvents[e.tag];const r=this._wrappedEmits[e.tag];r&&e.filter&&(this.provider.off(e.filter,r),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,r,n){const i=bi(r);return i.removeListener=()=>{n&&(e.removeListener(n),this._checkRunningEvents(e))},i.getBlock=()=>this.provider.getBlock(r.blockHash),i.getTransaction=()=>this.provider.getTransaction(r.transactionHash),i.getTransactionReceipt=()=>this.provider.getTransactionReceipt(r.transactionHash),e.prepareEvent(i),i}_addEventListener(e,r,n){if(this.provider||wr.throwError("events require a provider or a signer with a provider",ee.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(r,n),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const i=s=>{let o=this._wrapEvent(e,s,r);if(o.decodeError==null)try{const a=e.getEmit(o);this.emit(e.filter,...a)}catch(a){o.decodeError=a.error}e.filter!=null&&this.emit("event",o),o.decodeError!=null&&this.emit("error",o.decodeError,o)};this._wrappedEmits[e.tag]=i,e.filter!=null&&this.provider.on(e.filter,i)}}queryFilter(e,r,n){const i=this._getRunningEvent(e),s=Gt(i.filter);return typeof r=="string"&&Ue(r,32)?(n!=null&&wr.throwArgumentError("cannot specify toBlock with blockhash","toBlock",n),s.blockHash=r):(s.fromBlock=r??0,s.toBlock=n??"latest"),this.provider.getLogs(s).then(o=>o.map(a=>this._wrapEvent(i,a,null)))}on(e,r){return this._addEventListener(this._getRunningEvent(e),r,!1),this}once(e,r){return this._addEventListener(this._getRunningEvent(e),r,!0),this}emit(e,...r){if(!this.provider)return!1;const n=this._getRunningEvent(e),i=n.run(r)>0;return this._checkRunningEvents(n),i}listenerCount(e){return this.provider?e==null?Object.keys(this._runningEvents).reduce((r,n)=>r+this._runningEvents[n].listenerCount(),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(e==null){const r=[];for(let n in this._runningEvents)this._runningEvents[n].listeners().forEach(i=>{r.push(i)});return r}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(e==null){for(const n in this._runningEvents){const i=this._runningEvents[n];i.removeAllListeners(),this._checkRunningEvents(i)}return this}const r=this._getRunningEvent(e);return r.removeAllListeners(),this._checkRunningEvents(r),this}off(e,r){if(!this.provider)return this;const n=this._getRunningEvent(e);return n.removeListener(r),this._checkRunningEvents(n),this}removeListener(e,r){return this.off(e,r)}}class Pd extends lX{}class kM{constructor(e){ne(this,"alphabet",e),ne(this,"base",e.length),ne(this,"_alphabetMap",{}),ne(this,"_leader",e.charAt(0));for(let r=0;r0;)n.push(o%this.base),o=o/this.base|0}let i="";for(let s=0;r[s]===0&&s=0;--s)i+=this.alphabet[n[s]];return i}decode(e){if(typeof e!="string")throw new TypeError("Expected String");let r=[];if(e.length===0)return new Uint8Array(r);r.push(0);for(let n=0;n>=8;for(;s>0;)r.push(s&255),s>>=8}for(let n=0;e[n]===this._leader&&n>24&255,c[e.length+1]=f>>16&255,c[e.length+2]=f>>8&255,c[e.length+3]=f&255;let d=re(Y0(i,t,c));s||(s=d.length,u=new Uint8Array(s),o=Math.ceil(n/s),l=n-(o-1)*s),u.set(d);for(let v=1;v=256)throw new Error("Depth too large!");return dk(ht([this.privateKey!=null?"0x0488ADE4":"0x0488B21E",te(this.depth),this.parentFingerprint,pt(te(this.index),4),this.chainCode,this.privateKey!=null?ht(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new hi(Tu,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let r=this.path;r&&(r+="/"+(e&~qu));const n=new Uint8Array(37);if(e&qu){if(!this.privateKey)throw new Error("cannot derive child of neutered node");n.set(re(this.privateKey),1),r&&(r+="'")}else n.set(re(this.publicKey));for(let f=24;f>=0;f-=8)n[33+(f>>3)]=e>>24-f&255;const i=re(Y0(ed.sha512,this.chainCode,n)),s=i.slice(0,32),o=i.slice(32);let a=null,c=null;this.privateKey?a=rv(Z.from(s).add(this.privateKey).mod(gX)):c=new Ml(te(s))._addPoint(this.publicKey);let l=r;const u=this.mnemonic;return u&&(l=Object.freeze({phrase:u.phrase,path:r,locale:u.locale||"en"})),new hi(Tu,a,c,this.fingerprint,rv(o),e,this.depth+1,l)}derivePath(e){const r=e.split("/");if(r.length===0||r[0]==="m"&&this.depth!==0)throw new Error("invalid path - "+e);r[0]==="m"&&r.shift();let n=this;for(let i=0;i=qu)throw new Error("invalid path index - "+s);n=n._derive(qu+o)}else if(s.match(/^[0-9]+$/)){const o=parseInt(s);if(o>=qu)throw new Error("invalid path index - "+s);n=n._derive(o)}else throw new Error("invalid path component - "+s)}return n}static _fromSeed(e,r){const n=re(e);if(n.length<16||n.length>64)throw new Error("invalid seed");const i=re(Y0(ed.sha512,bX,n));return new hi(Tu,rv(i.slice(0,32)),null,"0x00000000",rv(i.slice(32)),0,0,r)}static fromMnemonic(e,r,n){return n=KE(n),e=eb(Zg(e,n),n),hi._fromSeed(TM(e,r),{phrase:e,path:"m",locale:n.locale})}static fromSeed(e){return hi._fromSeed(e,null)}static fromExtendedKey(e){const r=Zf.decode(e);(r.length!==82||dk(r.slice(0,78))!==e)&&J0.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const n=r[4],i=te(r.slice(5,9)),s=parseInt(te(r.slice(9,13)).substring(2),16),o=te(r.slice(13,45)),a=r.slice(45,78);switch(te(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new hi(Tu,null,te(a),i,o,s,n,null);case"0x0488ade4":case"0x04358394 ":if(a[0]!==0)break;return new hi(Tu,te(a.slice(1)),null,i,o,s,n,null)}return J0.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function TM(t,e){e||(e="");const r=vt("mnemonic"+e,go.NFKD);return GE(vt(t,go.NFKD),r,2048,64,"sha512")}function Zg(t,e){e=KE(e),J0.checkNormalize();const r=e.split(t);if(r.length%3!==0)throw new Error("invalid mnemonic");const n=re(new Uint8Array(Math.ceil(11*r.length/8)));let i=0;for(let l=0;l>3]|=1<<7-i%8),i++}const s=32*r.length/3,o=r.length/3,a=PM(o);if((re(ea(n.slice(0,s/8)))[0]&a)!==(n[n.length-1]&a))throw new Error("invalid checksum");return te(n.slice(0,s/8))}function eb(t,e){if(e=KE(e),t=re(t),t.length%4!==0||t.length<16||t.length>32)throw new Error("invalid entropy");const r=[0];let n=11;for(let o=0;o8?(r[r.length-1]<<=8,r[r.length-1]|=t[o],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=t[o]>>8-n,r.push(t[o]&wX(8-n)),n+=3);const i=t.length/4,s=re(ea(t))[0]&PM(i);return r[r.length-1]<<=i,r[r.length-1]|=s>>8-i,e.join(r.map(o=>e.getWord(o)))}function xX(t,e){try{return Zg(t,e),!0}catch{}return!1}function EX(t){return(typeof t!="number"||t<0||t>=qu||t%1)&&J0.throwArgumentError("invalid account index","index",t),`m/44'/60'/${t}'/0/0`}const CX="random/5.7.0",o6=new ee(CX);function SX(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}const hk=SX();let tm=hk.crypto||hk.msCrypto;(!tm||!tm.getRandomValues)&&(o6.warn("WARNING: Missing strong random number source"),tm={getRandomValues:function(t){return o6.throwError("no secure random source avaialble",ee.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});function ro(t){(t<=0||t>1024||t%1||t!=t)&&o6.throwArgumentError("invalid length","length",t);const e=new Uint8Array(t);return tm.getRandomValues(e),re(e)}function IM(t){t=t.slice();for(let e=t.length-1;e>0;e--){const r=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[r],t[r]=n}return t}var OM={exports:{}};(function(t,e){(function(r){function n(R){return parseInt(R)===R}function i(R){if(!n(R.length))return!1;for(var E=0;E255)return!1;return!0}function s(R,E){if(R.buffer&&ArrayBuffer.isView(R)&&R.name==="Uint8Array")return E&&(R.slice?R=R.slice():R=Array.prototype.slice.call(R)),R;if(Array.isArray(R)){if(!i(R))throw new Error("Array contains invalid value: "+R);return new Uint8Array(R)}if(n(R.length)&&i(R))return new Uint8Array(R);throw new Error("unsupported array-like object")}function o(R){return new Uint8Array(R)}function a(R,E,M,j,T){(j!=null||T!=null)&&(R.slice?R=R.slice(j,T):R=Array.prototype.slice.call(R,j,T)),E.set(R,M)}var c=function(){function R(M){var j=[],T=0;for(M=encodeURI(M);T191&&U<224?(j.push(String.fromCharCode((U&31)<<6|M[T+1]&63)),T+=2):(j.push(String.fromCharCode((U&15)<<12|(M[T+1]&63)<<6|M[T+2]&63)),T+=3)}return j.join("")}return{toBytes:R,fromBytes:E}}(),l=function(){function R(j){for(var T=[],U=0;U>4]+E[W&15])}return T.join("")}return{toBytes:R,fromBytes:M}}(),u={16:10,24:12,32:14},f=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],d=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],h=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],p=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],v=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],m=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],g=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],y=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],b=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],C=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],A=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],O=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],w=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],I=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],B=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function z(R){for(var E=[],M=0;M>2,this._Ke[U][E%4]=T[E],this._Kd[R-U][E%4]=T[E];for(var W=0,V=j,G;V>16&255]<<24^d[G>>8&255]<<16^d[G&255]<<8^d[G>>24&255]^f[W]<<24,W+=1,j!=8)for(var E=1;E>8&255]<<8^d[G>>16&255]<<16^d[G>>24&255]<<24;for(var E=j/2+1;E>2,Y=V%4,this._Ke[J][Y]=T[E],this._Kd[R-J][Y]=T[E++],V++}for(var J=1;J>24&255]^w[G>>16&255]^I[G>>8&255]^B[G&255]},H.prototype.encrypt=function(R){if(R.length!=16)throw new Error("invalid plaintext size (must be 16 bytes)");for(var E=this._Ke.length-1,M=[0,0,0,0],j=z(R),T=0;T<4;T++)j[T]^=this._Ke[0][T];for(var U=1;U>24&255]^v[j[(T+1)%4]>>16&255]^m[j[(T+2)%4]>>8&255]^g[j[(T+3)%4]&255]^this._Ke[U][T];j=M.slice()}for(var W=o(16),V,T=0;T<4;T++)V=this._Ke[E][T],W[4*T]=(d[j[T]>>24&255]^V>>24)&255,W[4*T+1]=(d[j[(T+1)%4]>>16&255]^V>>16)&255,W[4*T+2]=(d[j[(T+2)%4]>>8&255]^V>>8)&255,W[4*T+3]=(d[j[(T+3)%4]&255]^V)&255;return W},H.prototype.decrypt=function(R){if(R.length!=16)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var E=this._Kd.length-1,M=[0,0,0,0],j=z(R),T=0;T<4;T++)j[T]^=this._Kd[0][T];for(var U=1;U>24&255]^b[j[(T+3)%4]>>16&255]^C[j[(T+2)%4]>>8&255]^A[j[(T+1)%4]&255]^this._Kd[U][T];j=M.slice()}for(var W=o(16),V,T=0;T<4;T++)V=this._Kd[E][T],W[4*T]=(h[j[T]>>24&255]^V>>24)&255,W[4*T+1]=(h[j[(T+3)%4]>>16&255]^V>>16)&255,W[4*T+2]=(h[j[(T+2)%4]>>8&255]^V>>8)&255,W[4*T+3]=(h[j[(T+1)%4]&255]^V)&255;return W};var K=function(R){if(!(this instanceof K))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new H(R)};K.prototype.encrypt=function(R){if(R=s(R),R.length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var E=o(R.length),M=o(16),j=0;j=0;--E)this._counter[E]=R%256,R=R>>8},$.prototype.setBytes=function(R){if(R=s(R,!0),R.length!=16)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=R},$.prototype.increment=function(){for(var R=15;R>=0;R--)if(this._counter[R]===255)this._counter[R]=0;else{this._counter[R]++;break}};var D=function(R,E){if(!(this instanceof D))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",E instanceof $||(E=new $(E)),this._counter=E,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new H(R)};D.prototype.encrypt=function(R){for(var E=s(R,!0),M=0;M16)throw new Error("PKCS#7 padding byte out of range");for(var M=R.length-E,j=0;j=64;){let L=g,R=y,E=b,M=C,j=A,T=O,U=w,W=I,V,G,J,Y,X;for(G=0;G<16;G++)J=_+G*4,B[G]=(D[J]&255)<<24|(D[J+1]&255)<<16|(D[J+2]&255)<<8|D[J+3]&255;for(G=16;G<64;G++)V=B[G-2],Y=(V>>>17|V<<32-17)^(V>>>19|V<<32-19)^V>>>10,V=B[G-15],X=(V>>>7|V<<32-7)^(V>>>18|V<<32-18)^V>>>3,B[G]=(Y+B[G-7]|0)+(X+B[G-16]|0)|0;for(G=0;G<64;G++)Y=(((j>>>6|j<<32-6)^(j>>>11|j<<32-11)^(j>>>25|j<<32-25))+(j&T^~j&U)|0)+(W+(m[G]+B[G]|0)|0)|0,X=((L>>>2|L<<32-2)^(L>>>13|L<<32-13)^(L>>>22|L<<32-22))+(L&R^L&E^R&E)|0,W=U,U=T,T=j,j=M+Y|0,M=E,E=R,R=L,L=Y+X|0;g=g+L|0,y=y+R|0,b=b+E|0,C=C+M|0,A=A+j|0,O=O+T|0,w=w+U|0,I=I+W|0,_+=64,N-=64}}z(v);let H,K=v.length%64,F=v.length/536870912|0,x=v.length<<3,P=K<56?56:120,$=v.slice(v.length-K,v.length);for($.push(128),H=K+1;H>>24&255),$.push(F>>>16&255),$.push(F>>>8&255),$.push(F>>>0&255),$.push(x>>>24&255),$.push(x>>>16&255),$.push(x>>>8&255),$.push(x>>>0&255),z($),[g>>>24&255,g>>>16&255,g>>>8&255,g>>>0&255,y>>>24&255,y>>>16&255,y>>>8&255,y>>>0&255,b>>>24&255,b>>>16&255,b>>>8&255,b>>>0&255,C>>>24&255,C>>>16&255,C>>>8&255,C>>>0&255,A>>>24&255,A>>>16&255,A>>>8&255,A>>>0&255,O>>>24&255,O>>>16&255,O>>>8&255,O>>>0&255,w>>>24&255,w>>>16&255,w>>>8&255,w>>>0&255,I>>>24&255,I>>>16&255,I>>>8&255,I>>>0&255]}function s(v,m,g){v=v.length<=64?v:i(v);const y=64+m.length+4,b=new Array(y),C=new Array(64);let A,O=[];for(A=0;A<64;A++)b[A]=54;for(A=0;A=y-4;I--){if(b[I]++,b[I]<=255)return;b[I]=0}}for(;g>=32;)w(),O=O.concat(i(C.concat(i(b)))),g-=32;return g>0&&(w(),O=O.concat(i(C.concat(i(b))).slice(0,g))),O}function o(v,m,g,y,b){let C;for(u(v,(2*g-1)*16,b,0,16),C=0;C<2*g;C++)l(v,C*16,b,16),c(b,y),u(b,0,v,m+C*16,16);for(C=0;C>>32-m}function c(v,m){u(v,0,m,0,16);for(let g=8;g>0;g-=2)m[4]^=a(m[0]+m[12],7),m[8]^=a(m[4]+m[0],9),m[12]^=a(m[8]+m[4],13),m[0]^=a(m[12]+m[8],18),m[9]^=a(m[5]+m[1],7),m[13]^=a(m[9]+m[5],9),m[1]^=a(m[13]+m[9],13),m[5]^=a(m[1]+m[13],18),m[14]^=a(m[10]+m[6],7),m[2]^=a(m[14]+m[10],9),m[6]^=a(m[2]+m[14],13),m[10]^=a(m[6]+m[2],18),m[3]^=a(m[15]+m[11],7),m[7]^=a(m[3]+m[15],9),m[11]^=a(m[7]+m[3],13),m[15]^=a(m[11]+m[7],18),m[1]^=a(m[0]+m[3],7),m[2]^=a(m[1]+m[0],9),m[3]^=a(m[2]+m[1],13),m[0]^=a(m[3]+m[2],18),m[6]^=a(m[5]+m[4],7),m[7]^=a(m[6]+m[5],9),m[4]^=a(m[7]+m[6],13),m[5]^=a(m[4]+m[7],18),m[11]^=a(m[10]+m[9],7),m[8]^=a(m[11]+m[10],9),m[9]^=a(m[8]+m[11],13),m[10]^=a(m[9]+m[8],18),m[12]^=a(m[15]+m[14],7),m[13]^=a(m[12]+m[15],9),m[14]^=a(m[13]+m[12],13),m[15]^=a(m[14]+m[13],18);for(let g=0;g<16;++g)v[g]+=m[g]}function l(v,m,g,y){for(let b=0;b=256)return!1}return!0}function d(v,m){if(typeof v!="number"||v%1)throw new Error("invalid "+m);return v}function h(v,m,g,y,b,C,A){if(g=d(g,"N"),y=d(y,"r"),b=d(b,"p"),C=d(C,"dkLen"),g===0||g&g-1)throw new Error("N must be power of 2");if(g>2147483647/128/y)throw new Error("N too large");if(y>2147483647/128/b)throw new Error("r too large");if(!f(v))throw new Error("password must be an array or buffer");if(v=Array.prototype.slice.call(v),!f(m))throw new Error("salt must be an array or buffer");m=Array.prototype.slice.call(m);let O=s(v,m,b*128*y);const w=new Uint32Array(b*32*y);for(let j=0;jR&&(j=R);for(let U=0;UR&&(j=R);for(let U=0;U>0&255),O.push(w[U]>>8&255),O.push(w[U]>>16&255),O.push(w[U]>>24&255);const T=s(v,O,C);return A&&A(null,1,T),T}A&&E(M)};if(!A)for(;;){const j=M();if(j!=null)return j}M()}const p={scrypt:function(v,m,g,y,b,C,A){return new Promise(function(O,w){let I=0;A&&A(0),h(v,m,g,y,b,C,function(B,z,H){if(B)w(B);else if(H)A&&I!==1&&A(1),O(new Uint8Array(H));else if(A&&z!==I)return I=z,A(z)})})},syncScrypt:function(v,m,g,y,b,C){return new Uint8Array(h(v,m,g,y,b,C))}};t.exports=p})()})(MM);var IX=MM.exports;const XE=ki(IX);var OX=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const a6=new ee(RM);function pk(t){return t!=null&&t.mnemonic&&t.mnemonic.phrase}class RX extends pu{isKeystoreAccount(e){return!!(e&&e._isKeystoreAccount)}}function $X(t,e,r){if(xr(t,"crypto/cipher")==="aes-128-ctr"){const i=Nl(xr(t,"crypto/cipherparams/iv")),s=new no.Counter(i),o=new no.ModeOfOperation.ctr(e,s);return re(o.decrypt(r))}return null}function NM(t,e){const r=Nl(xr(t,"crypto/ciphertext"));if(te(Ee(ht([e.slice(16,32),r]))).substring(2)!==xr(t,"crypto/mac").toLowerCase())throw new Error("invalid password");const i=$X(t,e.slice(0,16),r);i||a6.throwError("unsupported cipher",ee.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});const s=e.slice(32,64),o=dc(i);if(t.address){let c=t.address.toLowerCase();if(c.substring(0,2)!=="0x"&&(c="0x"+c),Ie(c)!==o)throw new Error("address mismatch")}const a={_isKeystoreAccount:!0,address:o,privateKey:te(i)};if(xr(t,"x-ethers/version")==="0.1"){const c=Nl(xr(t,"x-ethers/mnemonicCiphertext")),l=Nl(xr(t,"x-ethers/mnemonicCounter")),u=new no.Counter(l),f=new no.ModeOfOperation.ctr(s,u),d=xr(t,"x-ethers/path")||td,h=xr(t,"x-ethers/locale")||"en",p=re(f.decrypt(c));try{const v=eb(p,h),m=hi.fromMnemonic(v,null,h).derivePath(d);if(m.privateKey!=a.privateKey)throw new Error("mnemonic mismatch");a.mnemonic=m.mnemonic}catch(v){if(v.code!==ee.errors.INVALID_ARGUMENT||v.argument!=="wordlist")throw v}}return new RX(a)}function DM(t,e,r,n,i){return re(GE(t,e,r,n,i))}function MX(t,e,r,n,i){return Promise.resolve(DM(t,e,r,n,i))}function LM(t,e,r,n,i){const s=QE(e),o=xr(t,"crypto/kdf");if(o&&typeof o=="string"){const a=function(c,l){return a6.throwArgumentError("invalid key-derivation function parameters",c,l)};if(o.toLowerCase()==="scrypt"){const c=Nl(xr(t,"crypto/kdfparams/salt")),l=parseInt(xr(t,"crypto/kdfparams/n")),u=parseInt(xr(t,"crypto/kdfparams/r")),f=parseInt(xr(t,"crypto/kdfparams/p"));(!l||!u||!f)&&a("kdf",o),l&l-1&&a("N",l);const d=parseInt(xr(t,"crypto/kdfparams/dklen"));return d!==32&&a("dklen",d),n(s,c,l,u,f,64,i)}else if(o.toLowerCase()==="pbkdf2"){const c=Nl(xr(t,"crypto/kdfparams/salt"));let l=null;const u=xr(t,"crypto/kdfparams/prf");u==="hmac-sha256"?l="sha256":u==="hmac-sha512"?l="sha512":a("prf",u);const f=parseInt(xr(t,"crypto/kdfparams/c")),d=parseInt(xr(t,"crypto/kdfparams/dklen"));return d!==32&&a("dklen",d),r(s,c,f,d,l)}}return a6.throwArgumentError("unsupported key-derivation function","kdf",o)}function NX(t,e){const r=JSON.parse(t),n=LM(r,e,DM,XE.syncScrypt);return NM(r,n)}function DX(t,e,r){return OX(this,void 0,void 0,function*(){const n=JSON.parse(t),i=yield LM(n,e,MX,XE.scrypt,r);return NM(n,i)})}function LX(t,e,r,n){try{if(Ie(t.address)!==dc(t.privateKey))throw new Error("address/privateKey mismatch");if(pk(t)){const m=t.mnemonic;if(hi.fromMnemonic(m.phrase,null,m.locale).derivePath(m.path||td).privateKey!=t.privateKey)throw new Error("mnemonic mismatch")}}catch(m){return Promise.reject(m)}typeof r=="function"&&!n&&(n=r,r={}),r||(r={});const i=re(t.privateKey),s=QE(e);let o=null,a=null,c=null;if(pk(t)){const m=t.mnemonic;o=re(Zg(m.phrase,m.locale||"en")),a=m.path||td,c=m.locale||"en"}let l=r.client;l||(l="ethers.js");let u=null;r.salt?u=re(r.salt):u=ro(32);let f=null;if(r.iv){if(f=re(r.iv),f.length!==16)throw new Error("invalid iv")}else f=ro(16);let d=null;if(r.uuid){if(d=re(r.uuid),d.length!==16)throw new Error("invalid uuid")}else d=ro(16);let h=1<<17,p=8,v=1;return r.scrypt&&(r.scrypt.N&&(h=r.scrypt.N),r.scrypt.r&&(p=r.scrypt.r),r.scrypt.p&&(v=r.scrypt.p)),XE.scrypt(s,u,h,p,v,64,n).then(m=>{m=re(m);const g=m.slice(0,16),y=m.slice(16,32),b=m.slice(32,64),C=new no.Counter(f),A=new no.ModeOfOperation.ctr(g,C),O=re(A.encrypt(i)),w=Ee(ht([y,O])),I={address:t.address.substring(2).toLowerCase(),id:AX(d),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:te(f).substring(2)},ciphertext:te(O).substring(2),kdf:"scrypt",kdfparams:{salt:te(u).substring(2),n:h,dklen:32,p:v,r:p},mac:w.substring(2)}};if(o){const B=ro(16),z=new no.Counter(B),H=new no.ModeOfOperation.ctr(b,z),K=re(H.encrypt(o)),F=new Date,x=F.getUTCFullYear()+"-"+ph(F.getUTCMonth()+1,2)+"-"+ph(F.getUTCDate(),2)+"T"+ph(F.getUTCHours(),2)+"-"+ph(F.getUTCMinutes(),2)+"-"+ph(F.getUTCSeconds(),2)+".0Z";I["x-ethers"]={client:l,gethFilename:"UTC--"+x+"--"+I.address,mnemonicCounter:te(B).substring(2),mnemonicCiphertext:te(K).substring(2),path:a,locale:c,version:"0.1"}}return JSON.stringify(I)})}function BX(t,e,r){if(YE(t)){r&&r(0);const n=$M(t,e);return r&&r(1),Promise.resolve(n)}return JE(t)?DX(t,e,r):Promise.reject(new Error("invalid JSON wallet"))}function FX(t,e){if(YE(t))return $M(t,e);if(JE(t))return NX(t,e);throw new Error("invalid JSON wallet")}const jX="wallet/5.7.0";var vk=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const Iu=new ee(jX);function UX(t){return t!=null&&Ue(t.privateKey,32)&&t.address!=null}function zX(t){const e=t.mnemonic;return e&&e.phrase}let WX=class Vu extends xc{constructor(e,r){if(super(),UX(e)){const n=new Ml(e.privateKey);if(ne(this,"_signingKey",()=>n),ne(this,"address",dc(this.publicKey)),this.address!==Ie(e.address)&&Iu.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),zX(e)){const i=e.mnemonic;ne(this,"_mnemonic",()=>({phrase:i.phrase,path:i.path||td,locale:i.locale||"en"}));const s=this.mnemonic,o=hi.fromMnemonic(s.phrase,null,s.locale).derivePath(s.path);dc(o.privateKey)!==this.address&&Iu.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else ne(this,"_mnemonic",()=>null)}else{if(Ml.isSigningKey(e))e.curve!=="secp256k1"&&Iu.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),ne(this,"_signingKey",()=>e);else{typeof e=="string"&&e.match(/^[0-9a-f]*$/i)&&e.length===64&&(e="0x"+e);const n=new Ml(e);ne(this,"_signingKey",()=>n)}ne(this,"_mnemonic",()=>null),ne(this,"address",dc(this.publicKey))}r&&!ga.isProvider(r)&&Iu.throwArgumentError("invalid provider","provider",r),ne(this,"provider",r||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new Vu(this,e)}signTransaction(e){return mt(e).then(r=>{r.from!=null&&(Ie(r.from)!==this.address&&Iu.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete r.from);const n=this._signingKey().signDigest(Ee(s6(r)));return s6(r,n)})}signMessage(e){return vk(this,void 0,void 0,function*(){return Y5(this._signingKey().signDigest(Kg(e)))})}_signTypedData(e,r,n){return vk(this,void 0,void 0,function*(){const i=yield _r.resolveNames(e,r,n,s=>(this.provider==null&&Iu.throwError("cannot resolve ENS names without a provider",ee.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:s}),this.provider.resolveName(s)));return Y5(this._signingKey().signDigest(_r.hash(i.domain,r,i.value)))})}encrypt(e,r,n){if(typeof r=="function"&&!n&&(n=r,r={}),n&&typeof n!="function")throw new Error("invalid callback");return r||(r={}),LX(this,e,r,n)}static createRandom(e){let r=ro(16);e||(e={}),e.extraEntropy&&(r=re(vr(Ee(ht([r,e.extraEntropy])),0,16)));const n=eb(r,e.locale);return Vu.fromMnemonic(n,e.path,e.locale)}static fromEncryptedJson(e,r,n){return BX(e,r,n).then(i=>new Vu(i))}static fromEncryptedJsonSync(e,r){return new Vu(FX(e,r))}static fromMnemonic(e,r,n){return r||(r=td),new Vu(hi.fromMnemonic(e,null,n).derivePath(r))}};function BM(t,e){return Zl(Kg(t),e)}function HX(t,e,r,n){return Zl(_r.hash(t,e,r),n)}const qX="networks/5.7.1",mk=new ee(qX);function VX(t){return t&&typeof t.renetwork=="function"}function No(t){const e=function(r,n){n==null&&(n={});const i=[];if(r.InfuraProvider&&n.infura!=="-")try{i.push(new r.InfuraProvider(t,n.infura))}catch{}if(r.EtherscanProvider&&n.etherscan!=="-")try{i.push(new r.EtherscanProvider(t,n.etherscan))}catch{}if(r.AlchemyProvider&&n.alchemy!=="-")try{i.push(new r.AlchemyProvider(t,n.alchemy))}catch{}if(r.PocketProvider&&n.pocket!=="-"){const s=["goerli","ropsten","rinkeby","sepolia"];try{const o=new r.PocketProvider(t,n.pocket);o.network&&s.indexOf(o.network.name)===-1&&i.push(o)}catch{}}if(r.CloudflareProvider&&n.cloudflare!=="-")try{i.push(new r.CloudflareProvider(t))}catch{}if(r.AnkrProvider&&n.ankr!=="-")try{const s=["ropsten"],o=new r.AnkrProvider(t,n.ankr);o.network&&s.indexOf(o.network.name)===-1&&i.push(o)}catch{}if(i.length===0)return null;if(r.FallbackProvider){let s=1;return n.quorum!=null?s=n.quorum:t==="homestead"&&(s=2),new r.FallbackProvider(i,s)}return i[0]};return e.renetwork=function(r){return No(r)},e}function cy(t,e){const r=function(n,i){return n.JsonRpcProvider?new n.JsonRpcProvider(t,e):null};return r.renetwork=function(n){return cy(t,n)},r}const yk={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:No("homestead")},gk={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:No("ropsten")},bk={chainId:63,name:"classicMordor",_defaultProvider:cy("https://www.ethercluster.com/mordor","classicMordor")},nv={unspecified:{chainId:0,name:"unspecified"},homestead:yk,mainnet:yk,morden:{chainId:2,name:"morden"},ropsten:gk,testnet:gk,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:No("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:No("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:No("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:No("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:cy("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:bk,classicTestnet:bk,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:cy("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:No("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:No("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function GX(t){if(t==null)return null;if(typeof t=="number"){for(const n in nv){const i=nv[n];if(i.chainId===t)return{name:i.name,chainId:i.chainId,ensAddress:i.ensAddress||null,_defaultProvider:i._defaultProvider||null}}return{chainId:t,name:"unknown"}}if(typeof t=="string"){const n=nv[t];return n==null?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}const e=nv[t.name];if(!e)return typeof t.chainId!="number"&&mk.throwArgumentError("invalid network chainId","network",t),t;t.chainId!==0&&t.chainId!==e.chainId&&mk.throwArgumentError("network chainId mismatch","network",t);let r=t._defaultProvider||null;return r==null&&e._defaultProvider&&(VX(e._defaultProvider)?r=e._defaultProvider.renetwork(t):r=e._defaultProvider),{name:t.name,chainId:e.chainId,ensAddress:t.ensAddress||e.ensAddress||null,_defaultProvider:r}}const KX="web/5.7.1";var QX=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};function YX(t,e){return QX(this,void 0,void 0,function*(){e==null&&(e={});const r={method:e.method||"GET",headers:e.headers||{},body:e.body||void 0};if(e.skipFetchSetup!==!0&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),e.fetchOptions!=null){const o=e.fetchOptions;o.mode&&(r.mode=o.mode),o.cache&&(r.cache=o.cache),o.credentials&&(r.credentials=o.credentials),o.redirect&&(r.redirect=o.redirect),o.referrer&&(r.referrer=o.referrer)}const n=yield fetch(t,r),i=yield n.arrayBuffer(),s={};return n.headers.forEach?n.headers.forEach((o,a)=>{s[a.toLowerCase()]=o}):n.headers.keys().forEach(o=>{s[o.toLowerCase()]=n.headers.get(o)}),{headers:s,statusCode:n.status,statusMessage:n.statusText,body:re(new Uint8Array(i))}})}var JX=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const fs=new ee(KX);function wk(t){return new Promise(e=>{setTimeout(e,t)})}function Ra(t,e){if(t==null)return null;if(typeof t=="string")return t;if(Jo(t)){if(e&&(e.split("/")[0]==="text"||e.split(";")[0].trim()==="application/json"))try{return ya(t)}catch{}return te(t)}return t}function XX(t){return vt(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function FM(t,e,r){const n=typeof t=="object"&&t.throttleLimit!=null?t.throttleLimit:12;fs.assertArgument(n>0&&n%1===0,"invalid connection throttle limit","connection.throttleLimit",n);const i=typeof t=="object"?t.throttleCallback:null,s=typeof t=="object"&&typeof t.throttleSlotInterval=="number"?t.throttleSlotInterval:100;fs.assertArgument(s>0&&s%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",s);const o=typeof t=="object"?!!t.errorPassThrough:!1,a={};let c=null;const l={method:"GET"};let u=!1,f=2*60*1e3;if(typeof t=="string")c=t;else if(typeof t=="object"){if((t==null||t.url==null)&&fs.throwArgumentError("missing URL","connection.url",t),c=t.url,typeof t.timeout=="number"&&t.timeout>0&&(f=t.timeout),t.headers)for(const g in t.headers)a[g.toLowerCase()]={key:g,value:String(t.headers[g])},["if-none-match","if-modified-since"].indexOf(g.toLowerCase())>=0&&(u=!0);if(l.allowGzip=!!t.allowGzip,t.user!=null&&t.password!=null){c.substring(0,6)!=="https:"&&t.allowInsecureAuthentication!==!0&&fs.throwError("basic authentication requires a secure https url",ee.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:t.user,password:"[REDACTED]"});const g=t.user+":"+t.password;a.authorization={key:"Authorization",value:"Basic "+FE(vt(g))}}t.skipFetchSetup!=null&&(l.skipFetchSetup=!!t.skipFetchSetup),t.fetchOptions!=null&&(l.fetchOptions=Gt(t.fetchOptions))}const d=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),h=c?c.match(d):null;if(h)try{const g={statusCode:200,statusMessage:"OK",headers:{"content-type":h[1]||"text/plain"},body:h[2]?BE(h[3]):XX(h[3])};let y=g.body;return r&&(y=r(g.body,g)),Promise.resolve(y)}catch(g){fs.throwError("processing response error",ee.errors.SERVER_ERROR,{body:Ra(h[1],h[2]),error:g,requestBody:null,requestMethod:"GET",url:c})}e&&(l.method="POST",l.body=e,a["content-type"]==null&&(a["content-type"]={key:"Content-Type",value:"application/octet-stream"}),a["content-length"]==null&&(a["content-length"]={key:"Content-Length",value:String(e.length)}));const p={};Object.keys(a).forEach(g=>{const y=a[g];p[y.key]=y.value}),l.headers=p;const v=function(){let g=null;return{promise:new Promise(function(C,A){f&&(g=setTimeout(()=>{g!=null&&(g=null,A(fs.makeError("timeout",ee.errors.TIMEOUT,{requestBody:Ra(l.body,p["content-type"]),requestMethod:l.method,timeout:f,url:c})))},f))}),cancel:function(){g!=null&&(clearTimeout(g),g=null)}}}(),m=function(){return JX(this,void 0,void 0,function*(){for(let g=0;g=300)&&(v.cancel(),fs.throwError("bad response",ee.errors.SERVER_ERROR,{status:y.statusCode,headers:y.headers,body:Ra(b,y.headers?y.headers["content-type"]:null),requestBody:Ra(l.body,p["content-type"]),requestMethod:l.method,url:c})),r)try{const C=yield r(b,y);return v.cancel(),C}catch(C){if(C.throttleRetry&&g{let a=null;if(s!=null)try{a=JSON.parse(ya(s))}catch(c){fs.throwError("invalid JSON",ee.errors.SERVER_ERROR,{body:s,error:c})}return r&&(a=r(a,o)),a},i=null;if(e!=null){i=vt(e);const s=typeof t=="string"?{url:t}:Gt(t);s.headers?Object.keys(s.headers).filter(a=>a.toLowerCase()==="content-type").length!==0||(s.headers=Gt(s.headers),s.headers["content-type"]="application/json"):s.headers={"content-type":"application/json"},t=s}return FM(t,i,n)}function Za(t,e){return e||(e={}),e=Gt(e),e.floor==null&&(e.floor=0),e.ceiling==null&&(e.ceiling=1e4),e.interval==null&&(e.interval=250),new Promise(function(r,n){let i=null,s=!1;const o=()=>s?!1:(s=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout(()=>{o()&&n(new Error("timeout"))},e.timeout));const a=e.retryLimit;let c=0;function l(){return t().then(function(u){if(u!==void 0)o()&&r(u);else if(e.oncePoll)e.oncePoll.once("poll",l);else if(e.onceBlock)e.onceBlock.once("block",l);else if(!s){if(c++,c>a){o()&&n(new Error("retry limit reached"));return}let f=e.interval*parseInt(String(Math.random()*Math.pow(2,c)));fe.ceiling&&(f=e.ceiling),setTimeout(l,f)}return null},function(u){o()&&n(u)})}l()})}var ly="qpzry9x8gf2tvdw0s3jn54khce6mua7l",c6={};for(var iv=0;iv>25;return(t&33554431)<<5^-(e>>0&1)&996825010^-(e>>1&1)&642813549^-(e>>2&1)&513874426^-(e>>3&1)&1027748829^-(e>>4&1)&705979059}function jM(t){for(var e=1,r=0;r126)return"Invalid prefix ("+t+")";e=Of(e)^n>>5}for(e=Of(e),r=0;rr)throw new TypeError("Exceeds length limit");t=t.toLowerCase();var n=jM(t);if(typeof n=="string")throw new Error(n);for(var i=t+"1",s=0;s>5)throw new Error("Non 5-bit word");n=Of(n)^o,i+=ly.charAt(o)}for(s=0;s<6;++s)n=Of(n);for(n^=1,s=0;s<6;++s){var a=n>>(5-s)*5&31;i+=ly.charAt(a)}return i}function UM(t,e){if(e=e||90,t.length<8)return t+" too short";if(t.length>e)return"Exceeds length limit";var r=t.toLowerCase(),n=t.toUpperCase();if(t!==r&&t!==n)return"Mixed-case string "+t;t=r;var i=t.lastIndexOf("1");if(i===-1)return"No separator character for "+t;if(i===0)return"Missing prefix for "+t;var s=t.slice(0,i),o=t.slice(i+1);if(o.length<6)return"Data too short";var a=jM(s);if(typeof a=="string")return a;for(var c=[],l=0;l=o.length)&&c.push(f)}return a!==1?"Invalid checksum for "+t:{prefix:s,words:c}}function eZ(){var t=UM.apply(null,arguments);if(typeof t=="object")return t}function tZ(t){var e=UM.apply(null,arguments);if(typeof e=="object")return e;throw new Error(e)}function tb(t,e,r,n){for(var i=0,s=0,o=(1<=r;)s-=r,a.push(i>>s&o);if(n)s>0&&a.push(i<=e)return"Excess padding";if(i<this.data(f,!0);return e.transaction={hash:o,type:l,accessList:he.allowNull(this.accessList.bind(this),null),blockHash:he.allowNull(o,null),blockNumber:he.allowNull(c,null),transactionIndex:he.allowNull(c,null),confirmations:he.allowNull(c,null),from:r,gasPrice:he.allowNull(n),maxPriorityFeePerGas:he.allowNull(n),maxFeePerGas:he.allowNull(n),gasLimit:n,to:he.allowNull(r,null),value:n,nonce:c,data:s,r:he.allowNull(this.uint256),s:he.allowNull(this.uint256),v:he.allowNull(c),creates:he.allowNull(r,null),raw:he.allowNull(s)},e.transactionRequest={from:he.allowNull(r),nonce:he.allowNull(c),gasLimit:he.allowNull(n),gasPrice:he.allowNull(n),maxPriorityFeePerGas:he.allowNull(n),maxFeePerGas:he.allowNull(n),to:he.allowNull(r),value:he.allowNull(n),data:he.allowNull(u),type:he.allowNull(c),accessList:he.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:c,blockNumber:c,transactionHash:o,address:r,topics:he.arrayOf(o),data:s,logIndex:c,blockHash:o},e.receipt={to:he.allowNull(this.address,null),from:he.allowNull(this.address,null),contractAddress:he.allowNull(r,null),transactionIndex:c,root:he.allowNull(a),gasUsed:n,logsBloom:he.allowNull(s),blockHash:o,transactionHash:o,logs:he.arrayOf(this.receiptLog.bind(this)),blockNumber:c,confirmations:he.allowNull(c,null),cumulativeGasUsed:n,effectiveGasPrice:he.allowNull(n),status:he.allowNull(c),type:l},e.block={hash:he.allowNull(o),parentHash:o,number:c,timestamp:c,nonce:he.allowNull(a),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:he.allowNull(r),extraData:s,transactions:he.allowNull(he.arrayOf(o)),baseFeePerGas:he.allowNull(n)},e.blockWithTransactions=Gt(e.block),e.blockWithTransactions.transactions=he.allowNull(he.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:he.allowNull(i,void 0),toBlock:he.allowNull(i,void 0),blockHash:he.allowNull(o,void 0),address:he.allowNull(r,void 0),topics:he.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:he.allowNull(c),blockHash:he.allowNull(o),transactionIndex:c,removed:he.allowNull(this.boolean.bind(this)),address:r,data:he.allowFalsish(s,"0x"),topics:he.arrayOf(o),transactionHash:o,logIndex:c},e}accessList(e){return mu(e||[])}number(e){return e==="0x"?0:Z.from(e).toNumber()}type(e){return e==="0x"||e==null?0:Z.from(e).toNumber()}bigNumber(e){return Z.from(e)}boolean(e){if(typeof e=="boolean")return e;if(typeof e=="string"){if(e=e.toLowerCase(),e==="true")return!0;if(e==="false")return!1}throw new Error("invalid boolean - "+e)}hex(e,r){return typeof e=="string"&&(!r&&e.substring(0,2)!=="0x"&&(e="0x"+e),Ue(e))?e.toLowerCase():vh.throwArgumentError("invalid hash","value",e)}data(e,r){const n=this.hex(e,r);if(n.length%2!==0)throw new Error("invalid data; odd-length - "+e);return n}address(e){return Ie(e)}callAddress(e){if(!Ue(e,32))return null;const r=Ie(vr(e,12));return r===ur?null:r}contractAddress(e){return $E(e)}blockTag(e){if(e==null)return"latest";if(e==="earliest")return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if(typeof e=="number"||Ue(e))return As(e);throw new Error("invalid blockTag")}hash(e,r){const n=this.hex(e,r);return yo(n)!==32?vh.throwArgumentError("invalid hash","value",e):n}difficulty(e){if(e==null)return null;const r=Z.from(e);try{return r.toNumber()}catch{}return null}uint256(e){if(!Ue(e))throw new Error("invalid uint256");return pt(e,32)}_block(e,r){e.author!=null&&e.miner==null&&(e.miner=e.author);const n=e._difficulty!=null?e._difficulty:e.difficulty,i=he.check(r,e);return i._difficulty=n==null?null:Z.from(n),i}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return he.check(this.formats.transactionRequest,e)}transactionResponse(e){e.gas!=null&&e.gasLimit==null&&(e.gasLimit=e.gas),e.to&&Z.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),e.input!=null&&e.data==null&&(e.data=e.input),e.to==null&&e.creates==null&&(e.creates=this.contractAddress(e)),(e.type===1||e.type===2)&&e.accessList==null&&(e.accessList=[]);const r=he.check(this.formats.transaction,e);if(e.chainId!=null){let n=e.chainId;Ue(n)&&(n=Z.from(n).toNumber()),r.chainId=n}else{let n=e.networkId;n==null&&r.v==null&&(n=e.chainId),Ue(n)&&(n=Z.from(n).toNumber()),typeof n!="number"&&r.v!=null&&(n=(r.v-35)/2,n<0&&(n=0),n=parseInt(n)),typeof n!="number"&&(n=0),r.chainId=n}return r.blockHash&&r.blockHash.replace(/0/g,"")==="x"&&(r.blockHash=null),r}transaction(e){return EM(e)}receiptLog(e){return he.check(this.formats.receiptLog,e)}receipt(e){const r=he.check(this.formats.receipt,e);if(r.root!=null)if(r.root.length<=4){const n=Z.from(r.root).toNumber();n===0||n===1?(r.status!=null&&r.status!==n&&vh.throwArgumentError("alt-root-status/status mismatch","value",{root:r.root,status:r.status}),r.status=n,delete r.root):vh.throwArgumentError("invalid alt-root-status","value.root",r.root)}else r.root.length!==66&&vh.throwArgumentError("invalid root hash","value.root",r.root);return r.status!=null&&(r.byzantium=!0),r}topics(e){return Array.isArray(e)?e.map(r=>this.topics(r)):e!=null?this.hash(e,!0):null}filter(e){return he.check(this.formats.filter,e)}filterLog(e){return he.check(this.formats.filterLog,e)}static check(e,r){const n={};for(const i in e)try{const s=e[i](r[i]);s!==void 0&&(n[i]=s)}catch(s){throw s.checkKey=i,s.checkValue=r[i],s}return n}static allowNull(e,r){return function(n){return n==null?r:e(n)}}static allowFalsish(e,r){return function(n){return n?e(n):r}}static arrayOf(e){return function(r){if(!Array.isArray(r))throw new Error("not an array");const n=[];return r.forEach(function(i){n.push(e(i))}),n}}}function aZ(t){return t&&typeof t.isCommunityResource=="function"}function Ek(t){return aZ(t)&&t.isCommunityResource()}var ke=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const Ve=new ee(Td),cZ=10;function Ck(t){return t==null?"null":(yo(t)!==32&&Ve.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function Sk(t){for(t=t.slice();t.length>0&&t[t.length-1]==null;)t.pop();return t.map(e=>{if(Array.isArray(e)){const r={};e.forEach(i=>{r[Ck(i)]=!0});const n=Object.keys(r);return n.sort(),n.join("|")}else return Ck(e)}).join("&")}function lZ(t){return t===""?[]:t.split(/&/g).map(e=>{if(e==="")return[];const r=e.split("|").map(n=>n==="null"?null:n);return r.length===1?r[0]:r})}function Ou(t){if(typeof t=="string"){if(t=t.toLowerCase(),yo(t)===32)return"tx:"+t;if(t.indexOf(":")===-1)return t}else{if(Array.isArray(t))return"filter:*:"+Sk(t);if(cY.isForkEvent(t))throw Ve.warn("not implemented"),new Error("not implemented");if(t&&typeof t=="object")return"filter:"+(t.address||"*")+":"+Sk(t.topics||[])}throw new Error("invalid event - "+t)}function mh(){return new Date().getTime()}function kk(t){return new Promise(e=>{setTimeout(e,t)})}const uZ=["block","network","pending","poll"];let fZ=class{constructor(e,r,n){ne(this,"tag",e),ne(this,"listener",r),ne(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return e[0]!=="tx"?null:e[1]}get filter(){const e=this.tag.split(":");if(e[0]!=="filter")return null;const r=e[1],n=lZ(e[2]),i={};return n.length>0&&(i.topics=n),r&&r!=="*"&&(i.address=r),i}pollable(){return this.tag.indexOf(":")>=0||uZ.indexOf(this.tag)>=0}};const dZ={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function Bw(t){return pt(Z.from(t).toHexString(),32)}function Ak(t){return Zf.encode(ht([t,vr(ea(ea(t)),0,4)]))}const zM=new RegExp("^(ipfs)://(.*)$","i"),_k=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),zM,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function rm(t,e){try{return ya(X0(t,e))}catch{}return null}function X0(t,e){if(t==="0x")return null;const r=Z.from(vr(t,e,e+32)).toNumber(),n=Z.from(vr(t,r,r+32)).toNumber();return vr(t,r+32,r+32+n)}function Fw(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):Ve.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function Pk(t){const e=re(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function hZ(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}function WM(t){const e=[];let r=0;for(let n=0;nZ.from(e).eq(1)).catch(e=>{if(e.code===ee.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e})),this._supportsEip2544}_fetch(e,r){return ke(this,void 0,void 0,function*(){const n={to:this.address,ccipReadEnabled:!0,data:Mn([e,n0(this.name),r||"0x"])};let i=!1;(yield this.supportsWildcard())&&(i=!0,n.data=Mn(["0x9061b923",WM([z$(this.name),n.data])]));try{let s=yield this.provider.call(n);return re(s).length%32===4&&Ve.throwError("resolver threw error",ee.errors.CALL_EXCEPTION,{transaction:n,data:s}),i&&(s=X0(s,0)),s}catch(s){if(s.code===ee.errors.CALL_EXCEPTION)return null;throw s}})}_fetchBytes(e,r){return ke(this,void 0,void 0,function*(){const n=yield this._fetch(e,r);return n!=null?X0(n,0):null})}_getAddress(e,r){const n=dZ[String(e)];if(n==null&&Ve.throwError(`unsupported coin type: ${e}`,ee.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),n.ilk==="eth")return this.provider.formatter.address(r);const i=re(r);if(n.p2pkh!=null){const s=r.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return Ak(ht([[n.p2pkh],"0x"+s[2]]))}}if(n.p2sh!=null){const s=r.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(s){const o=parseInt(s[1],16);if(s[2].length===o*2&&o>=1&&o<=75)return Ak(ht([[n.p2sh],"0x"+s[2]]))}}if(n.prefix!=null){const s=i[1];let o=i[0];if(o===0?s!==20&&s!==32&&(o=-1):o=-1,o>=0&&i.length===2+s&&s>=1&&s<=75){const a=xk.toWords(i.slice(2));return a.unshift(o),xk.encode(n.prefix,a)}}return null}getAddress(e){return ke(this,void 0,void 0,function*(){if(e==null&&(e=60),e===60)try{const i=yield this._fetch("0x3b3b57de");return i==="0x"||i===ty?null:this.provider.formatter.callAddress(i)}catch(i){if(i.code===ee.errors.CALL_EXCEPTION)return null;throw i}const r=yield this._fetchBytes("0xf1cb7e06",Bw(e));if(r==null||r==="0x")return null;const n=this._getAddress(e,r);return n==null&&Ve.throwError("invalid or unsupported coin data",ee.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:r}),n})}getAvatar(){return ke(this,void 0,void 0,function*(){const e=[{type:"name",content:this.name}];try{const r=yield this.getText("avatar");if(r==null)return null;for(let n=0;n<_k.length;n++){const i=r.match(_k[n]);if(i==null)continue;const s=i[1].toLowerCase();switch(s){case"https":return e.push({type:"url",content:r}),{linkage:e,url:r};case"data":return e.push({type:"data",content:r}),{linkage:e,url:r};case"ipfs":return e.push({type:"ipfs",content:r}),{linkage:e,url:Fw(r)};case"erc721":case"erc1155":{const o=s==="erc721"?"0xc87b56dd":"0x0e89341c";e.push({type:s,content:r});const a=this._resolvedAddress||(yield this.getAddress()),c=(i[2]||"").split("/");if(c.length!==2)return null;const l=yield this.provider.formatter.address(c[0]),u=pt(Z.from(c[1]).toHexString(),32);if(s==="erc721"){const v=this.provider.formatter.callAddress(yield this.provider.call({to:l,data:Mn(["0x6352211e",u])}));if(a!==v)return null;e.push({type:"owner",content:v})}else if(s==="erc1155"){const v=Z.from(yield this.provider.call({to:l,data:Mn(["0x00fdd58e",pt(a,32),u])}));if(v.isZero())return null;e.push({type:"balance",content:v.toString()})}const f={to:this.provider.formatter.address(c[0]),data:Mn([o,u])};let d=rm(yield this.provider.call(f),0);if(d==null)return null;e.push({type:"metadata-url-base",content:d}),s==="erc1155"&&(d=d.replace("{id}",u.substring(2)),e.push({type:"metadata-url-expanded",content:d})),d.match(/^ipfs:/i)&&(d=Fw(d)),e.push({type:"metadata-url",content:d});const h=yield J1(d);if(!h)return null;e.push({type:"metadata",content:JSON.stringify(h)});let p=h.image;if(typeof p!="string")return null;if(!p.match(/^(https:\/\/|data:)/i)){if(p.match(zM)==null)return null;e.push({type:"url-ipfs",content:p}),p=Fw(p)}return e.push({type:"url",content:p}),{linkage:e,url:p}}}}}catch{}return null})}getContentHash(){return ke(this,void 0,void 0,function*(){const e=yield this._fetchBytes("0xbc1c58d1");if(e==null||e==="0x")return null;const r=e.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const o=parseInt(r[3],16);if(r[4].length===o*2)return"ipfs://"+Zf.encode("0x"+r[1])}const n=e.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(n){const o=parseInt(n[3],16);if(n[4].length===o*2)return"ipns://"+Zf.encode("0x"+n[1])}const i=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(i&&i[1].length===32*2)return"bzz://"+i[1];const s=e.match(/^0x90b2c605([0-9a-f]*)$/);if(s&&s[1].length===34*2){const o={"=":"","+":"-","/":"_"};return"sia://"+FE("0x"+s[1]).replace(/[=+\/]/g,c=>o[c])}return Ve.throwError("invalid or unsupported content hash data",ee.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})})}getText(e){return ke(this,void 0,void 0,function*(){let r=vt(e);r=ht([Bw(64),Bw(r.length),r]),r.length%32!==0&&(r=ht([r,pt("0x",32-e.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",te(r));return n==null||n==="0x"?null:ya(n)})}}let jw=null,pZ=1;class rb extends ga{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),ne(this,"anyNetwork",e==="any"),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch(r=>{}),this._ready().catch(r=>{});else{const r=ws(new.target,"getNetwork")(e);r?(ne(this,"_network",r),this.emit("network",r,null)):Ve.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return ke(this,void 0,void 0,function*(){if(this._network==null){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch{}e==null&&(e=yield this.detectNetwork()),e||Ve.throwError("no network detected",ee.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=e:ne(this,"_network",e),this.emit("network",e,null))}return this._network})}get ready(){return Za(()=>this._ready().then(e=>e,e=>{if(!(e.code===ee.errors.NETWORK_ERROR&&e.event==="noNetwork"))throw e}))}static getFormatter(){return jw==null&&(jw=new he),jw}static getNetwork(e){return GX(e??"homestead")}ccipReadFetch(e,r,n){return ke(this,void 0,void 0,function*(){if(this.disableCcipRead||n.length===0)return null;const i=e.to.toLowerCase(),s=r.toLowerCase(),o=[];for(let a=0;a=0?null:JSON.stringify({data:s,sender:i}),f=yield J1({url:l,errorPassThrough:!0},u,(h,p)=>(h.status=p.statusCode,h));if(f.data)return f.data;const d=f.message||"unknown error";if(f.status>=400&&f.status<500)return Ve.throwError(`response not found during CCIP fetch: ${d}`,ee.errors.SERVER_ERROR,{url:c,errorMessage:d});o.push(d)}return Ve.throwError(`error encountered during CCIP fetch: ${o.map(a=>JSON.stringify(a)).join(", ")}`,ee.errors.SERVER_ERROR,{urls:n,errorMessages:o})})}_getInternalBlockNumber(e){return ke(this,void 0,void 0,function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const i=this._internalBlockNumber;try{const s=yield i;if(mh()-s.respTime<=e)return s.blockNumber;break}catch{if(this._internalBlockNumber===i)break}}const r=mh(),n=mt({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(i=>null,i=>i)}).then(({blockNumber:i,networkError:s})=>{if(s)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),s;const o=mh();return i=Z.from(i).toNumber(),i{this._internalBlockNumber===n&&(this._internalBlockNumber=null)}),(yield n).blockNumber})}poll(){return ke(this,void 0,void 0,function*(){const e=pZ++,r=[];let n=null;try{n=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(i){this.emit("error",i);return}if(this._setFastBlockNumber(n),this.emit("poll",e,n),n===this._lastBlockNumber){this.emit("didPoll",e);return}if(this._emitted.block===-2&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)Ve.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",Ve.makeError("network block skew detected",ee.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(let i=this._emitted.block+1;i<=n;i++)this.emit("block",i);this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach(i=>{if(i==="block")return;const s=this._emitted[i];s!=="pending"&&n-s>12&&delete this._emitted[i]})),this._lastBlockNumber===-2&&(this._lastBlockNumber=n-1),this._events.forEach(i=>{switch(i.type){case"tx":{const s=i.hash;let o=this.getTransactionReceipt(s).then(a=>(!a||a.blockNumber==null||(this._emitted["t:"+s]=a.blockNumber,this.emit(s,a)),null)).catch(a=>{this.emit("error",a)});r.push(o);break}case"filter":{if(!i._inflight){i._inflight=!0,i._lastBlockNumber===-2&&(i._lastBlockNumber=n-1);const s=i.filter;s.fromBlock=i._lastBlockNumber+1,s.toBlock=n;const o=s.toBlock-this._maxFilterBlockRange;o>s.fromBlock&&(s.fromBlock=o),s.fromBlock<0&&(s.fromBlock=0);const a=this.getLogs(s).then(c=>{i._inflight=!1,c.length!==0&&c.forEach(l=>{l.blockNumber>i._lastBlockNumber&&(i._lastBlockNumber=l.blockNumber),this._emitted["b:"+l.blockHash]=l.blockNumber,this._emitted["t:"+l.transactionHash]=l.blockNumber,this.emit(s,l)})}).catch(c=>{this.emit("error",c),i._inflight=!1});r.push(a)}break}}}),this._lastBlockNumber=n,Promise.all(r).then(()=>{this.emit("didPoll",e)}).catch(i=>{this.emit("error",i)})})}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return ke(this,void 0,void 0,function*(){return Ve.throwError("provider does not support network detection",ee.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return ke(this,void 0,void 0,function*(){const e=yield this._ready(),r=yield this.detectNetwork();if(e.chainId!==r.chainId){if(this.anyNetwork)return this._network=r,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",r,e),yield kk(0),this._network;const n=Ve.makeError("underlying network changed",ee.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:r});throw this.emit("error",n),n}return e})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(e=>{this._setFastBlockNumber(e)},e=>{}),this._fastBlockNumber!=null?this._fastBlockNumber:-1}get polling(){return this._poller!=null}set polling(e){e&&!this._poller?(this._poller=setInterval(()=>{this.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(()=>{this.poll(),this._bootstrapPoll=setTimeout(()=>{this._poller||this.poll(),this._bootstrapPoll=null},this.pollingInterval)},0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if(typeof e!="number"||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){const e=mh();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then(r=>((this._fastBlockNumber==null||r>this._fastBlockNumber)&&(this._fastBlockNumber=r),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(e){this._fastBlockNumber!=null&&ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,r,n){return ke(this,void 0,void 0,function*(){return this._waitForTransaction(e,r??1,n||0,null)})}_waitForTransaction(e,r,n,i){return ke(this,void 0,void 0,function*(){const s=yield this.getTransactionReceipt(e);return(s?s.confirmations:0)>=r?s:new Promise((o,a)=>{const c=[];let l=!1;const u=function(){return l?!0:(l=!0,c.forEach(d=>{d()}),!1)},f=d=>{d.confirmations{this.removeListener(e,f)}),i){let d=i.startBlock,h=null;const p=v=>ke(this,void 0,void 0,function*(){l||(yield kk(1e3),this.getTransactionCount(i.from).then(m=>ke(this,void 0,void 0,function*(){if(!l){if(m<=i.nonce)d=v;else{{const g=yield this.getTransaction(e);if(g&&g.blockNumber!=null)return}for(h==null&&(h=d-3,h{l||this.once("block",p)}))});if(l)return;this.once("block",p),c.push(()=>{this.removeListener("block",p)})}if(typeof n=="number"&&n>0){const d=setTimeout(()=>{u()||a(Ve.makeError("timeout exceeded",ee.errors.TIMEOUT,{timeout:n}))},n);d.unref&&d.unref(),c.push(()=>{clearTimeout(d)})}})})}getBlockNumber(){return ke(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return ke(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return Z.from(e)}catch(r){return Ve.throwError("bad result from backend",ee.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:r})}})}getBalance(e,r){return ke(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield mt({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getBalance",n);try{return Z.from(i)}catch(s){return Ve.throwError("bad result from backend",ee.errors.SERVER_ERROR,{method:"getBalance",params:n,result:i,error:s})}})}getTransactionCount(e,r){return ke(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield mt({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getTransactionCount",n);try{return Z.from(i).toNumber()}catch(s){return Ve.throwError("bad result from backend",ee.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:i,error:s})}})}getCode(e,r){return ke(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield mt({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getCode",n);try{return te(i)}catch(s){return Ve.throwError("bad result from backend",ee.errors.SERVER_ERROR,{method:"getCode",params:n,result:i,error:s})}})}getStorageAt(e,r,n){return ke(this,void 0,void 0,function*(){yield this.getNetwork();const i=yield mt({address:this._getAddress(e),blockTag:this._getBlockTag(n),position:Promise.resolve(r).then(o=>As(o))}),s=yield this.perform("getStorageAt",i);try{return te(s)}catch(o){return Ve.throwError("bad result from backend",ee.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:s,error:o})}})}_wrapTransaction(e,r,n){if(r!=null&&yo(r)!==32)throw new Error("invalid response - sendTransaction");const i=e;return r!=null&&e.hash!==r&&Ve.throwError("Transaction hash mismatch from Provider.sendTransaction.",ee.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:r}),i.wait=(s,o)=>ke(this,void 0,void 0,function*(){s==null&&(s=1),o==null&&(o=0);let a;s!==0&&n!=null&&(a={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:n});const c=yield this._waitForTransaction(e.hash,s,o,a);return c==null&&s===0?null:(this._emitted["t:"+e.hash]=c.blockNumber,c.status===0&&Ve.throwError("transaction failed",ee.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:c}),c)}),i}sendTransaction(e){return ke(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Promise.resolve(e).then(s=>te(s)),n=this.formatter.transaction(e);n.confirmations==null&&(n.confirmations=0);const i=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const s=yield this.perform("sendTransaction",{signedTransaction:r});return this._wrapTransaction(n,s,i)}catch(s){throw s.transaction=n,s.transactionHash=n.hash,s}})}_getTransactionRequest(e){return ke(this,void 0,void 0,function*(){const r=yield e,n={};return["from","to"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?this._getAddress(s):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?Z.from(s):null))}),["type"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s??null))}),r.accessList&&(n.accessList=this.formatter.accessList(r.accessList)),["data"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(s=>s?te(s):null))}),this.formatter.transactionRequest(yield mt(n))})}_getFilter(e){return ke(this,void 0,void 0,function*(){e=yield e;const r={};return e.address!=null&&(r.address=this._getAddress(e.address)),["blockHash","topics"].forEach(n=>{e[n]!=null&&(r[n]=e[n])}),["fromBlock","toBlock"].forEach(n=>{e[n]!=null&&(r[n]=this._getBlockTag(e[n]))}),this.formatter.filter(yield mt(r))})}_call(e,r,n){return ke(this,void 0,void 0,function*(){n>=cZ&&Ve.throwError("CCIP read exceeded maximum redirections",ee.errors.SERVER_ERROR,{redirects:n,transaction:e});const i=e.to,s=yield this.perform("call",{transaction:e,blockTag:r});if(n>=0&&r==="latest"&&i!=null&&s.substring(0,10)==="0x556f1830"&&yo(s)%32===4)try{const o=vr(s,4),a=vr(o,0,32);Z.from(a).eq(i)||Ve.throwError("CCIP Read sender did not match",ee.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:s});const c=[],l=Z.from(vr(o,32,64)).toNumber(),u=Z.from(vr(o,l,l+32)).toNumber(),f=vr(o,l+32);for(let g=0;gke(this,void 0,void 0,function*(){const s=yield this.perform("getBlock",i);if(s==null)return i.blockHash!=null&&this._emitted["b:"+i.blockHash]==null||i.blockTag!=null&&n>this._emitted.block?null:void 0;if(r){let o=null;for(let c=0;cthis._wrapTransaction(c)),a}return this.formatter.block(s)}),{oncePoll:this})})}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return ke(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return Za(()=>ke(this,void 0,void 0,function*(){const n=yield this.perform("getTransaction",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;const i=this.formatter.transactionResponse(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}return this._wrapTransaction(i)}),{oncePoll:this})})}getTransactionReceipt(e){return ke(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return Za(()=>ke(this,void 0,void 0,function*(){const n=yield this.perform("getTransactionReceipt",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;if(n.blockHash==null)return;const i=this.formatter.receipt(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}return i}),{oncePoll:this})})}getLogs(e){return ke(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield mt({filter:this._getFilter(e)}),n=yield this.perform("getLogs",r);return n.forEach(i=>{i.removed==null&&(i.removed=!1)}),he.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)})}getEtherPrice(){return ke(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(e){return ke(this,void 0,void 0,function*(){if(e=yield e,typeof e=="number"&&e<0){e%1&&Ve.throwArgumentError("invalid BlockTag","blockTag",e);let r=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return r+=e,r<0&&(r=0),this.formatter.blockTag(r)}return this.formatter.blockTag(e)})}getResolver(e){return ke(this,void 0,void 0,function*(){let r=e;for(;;){if(r===""||r==="."||e!=="eth"&&r==="eth")return null;const n=yield this._getResolver(r,"getResolver");if(n!=null){const i=new l6(this,n,e);return r!==e&&!(yield i.supportsWildcard())?null:i}r=r.split(".").slice(1).join(".")}})}_getResolver(e,r){return ke(this,void 0,void 0,function*(){r==null&&(r="ENS");const n=yield this.getNetwork();n.ensAddress||Ve.throwError("network does not support ENS",ee.errors.UNSUPPORTED_OPERATION,{operation:r,network:n.name});try{const i=yield this.call({to:n.ensAddress,data:"0x0178b8bf"+n0(e).substring(2)});return this.formatter.callAddress(i)}catch{}return null})}resolveName(e){return ke(this,void 0,void 0,function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(n){if(Ue(e))throw n}typeof e!="string"&&Ve.throwArgumentError("invalid ENS name","name",e);const r=yield this.getResolver(e);return r?yield r.getAddress():null})}lookupAddress(e){return ke(this,void 0,void 0,function*(){e=yield e,e=this.formatter.address(e);const r=e.substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"lookupAddress");if(n==null)return null;const i=rm(yield this.call({to:n,data:"0x691f3431"+n0(r).substring(2)}),0);return(yield this.resolveName(i))!=e?null:i})}getAvatar(e){return ke(this,void 0,void 0,function*(){let r=null;if(Ue(e)){const s=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",o=yield this._getResolver(s,"getAvatar");if(!o)return null;r=new l6(this,o,s);try{const a=yield r.getAvatar();if(a)return a.url}catch(a){if(a.code!==ee.errors.CALL_EXCEPTION)throw a}try{const a=rm(yield this.call({to:o,data:"0x691f3431"+n0(s).substring(2)}),0);r=yield this.getResolver(a)}catch(a){if(a.code!==ee.errors.CALL_EXCEPTION)throw a;return null}}else if(r=yield this.getResolver(e),!r)return null;const n=yield r.getAvatar();return n==null?null:n.url})}perform(e,r){return Ve.throwError(e+" not implemented",ee.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_stopEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_addEventListener(e,r,n){const i=new fZ(Ou(e),r,n);return this._events.push(i),this._startEvent(i),this}on(e,r){return this._addEventListener(e,r,!1)}once(e,r){return this._addEventListener(e,r,!0)}emit(e,...r){let n=!1,i=[],s=Ou(e);return this._events=this._events.filter(o=>o.tag!==s?!0:(setTimeout(()=>{o.listener.apply(this,r)},0),n=!0,o.once?(i.push(o),!1):!0)),i.forEach(o=>{this._stopEvent(o)}),n}listenerCount(e){if(!e)return this._events.length;let r=Ou(e);return this._events.filter(n=>n.tag===r).length}listeners(e){if(e==null)return this._events.map(n=>n.listener);let r=Ou(e);return this._events.filter(n=>n.tag===r).map(n=>n.listener)}off(e,r){if(r==null)return this.removeAllListeners(e);const n=[];let i=!1,s=Ou(e);return this._events=this._events.filter(o=>o.tag!==s||o.listener!=r||i?!0:(i=!0,n.push(o),!1)),n.forEach(o=>{this._stopEvent(o)}),this}removeAllListeners(e){let r=[];if(e==null)r=this._events,this._events=[];else{const n=Ou(e);this._events=this._events.filter(i=>i.tag!==n?!0:(r.push(i),!1))}return r.forEach(n=>{this._stopEvent(n)}),this}}var Oo=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const Pr=new ee(Td),vZ=["call","estimateGas"];function s0(t,e){if(t==null)return null;if(typeof t.message=="string"&&t.message.match("reverted")){const r=Ue(t.data)?t.data:null;if(!e||r)return{message:t.message,data:r}}if(typeof t=="object"){for(const r in t){const n=s0(t[r],e);if(n)return n}return null}if(typeof t=="string")try{return s0(JSON.parse(t),e)}catch{}return null}function HM(t,e,r){const n=r.transaction||r.signedTransaction;if(t==="call"){const s=s0(e,!0);if(s)return s.data;Pr.throwError("missing revert data in call exception; Transaction reverted without a reason string",ee.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if(t==="estimateGas"){let s=s0(e.body,!1);s==null&&(s=s0(e,!1)),s&&Pr.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",ee.errors.UNPREDICTABLE_GAS_LIMIT,{reason:s.message,method:t,transaction:n,error:e})}let i=e.message;throw e.code===ee.errors.SERVER_ERROR&&e.error&&typeof e.error.message=="string"?i=e.error.message:typeof e.body=="string"?i=e.body:typeof e.responseText=="string"&&(i=e.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&Pr.throwError("insufficient funds for intrinsic transaction cost",ee.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),i.match(/nonce (is )?too low/i)&&Pr.throwError("nonce has already been used",ee.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&Pr.throwError("replacement fee too low",ee.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),i.match(/only replay-protected/i)&&Pr.throwError("legacy pre-eip-155 transactions not supported",ee.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),vZ.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&Pr.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",ee.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function Tk(t){return new Promise(function(e){setTimeout(e,t)})}function mZ(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function yh(t){return t&&t.toLowerCase()}const u6={};class qM extends xc{constructor(e,r,n){if(super(),e!==u6)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");ne(this,"provider",r),n==null&&(n=0),typeof n=="string"?(ne(this,"_address",this.provider.formatter.address(n)),ne(this,"_index",null)):typeof n=="number"?(ne(this,"_index",n),ne(this,"_address",null)):Pr.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(e){return Pr.throwError("cannot alter JSON-RPC Signer connection",ee.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new yZ(u6,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(e=>(e.length<=this._index&&Pr.throwError("unknown account #"+this._index,ee.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index])))}sendUncheckedTransaction(e){e=Gt(e);const r=this.getAddress().then(n=>(n&&(n=n.toLowerCase()),n));if(e.gasLimit==null){const n=Gt(e);n.from=r,e.gasLimit=this.provider.estimateGas(n)}return e.to!=null&&(e.to=Promise.resolve(e.to).then(n=>Oo(this,void 0,void 0,function*(){if(n==null)return null;const i=yield this.provider.resolveName(n);return i==null&&Pr.throwArgumentError("provided ENS name resolves to null","tx.to",n),i}))),mt({tx:mt(e),sender:r}).then(({tx:n,sender:i})=>{n.from!=null?n.from.toLowerCase()!==i&&Pr.throwArgumentError("from address mismatch","transaction",e):n.from=i;const s=this.provider.constructor.hexlifyTransaction(n,{from:!0});return this.provider.send("eth_sendTransaction",[s]).then(o=>o,o=>(typeof o.message=="string"&&o.message.match(/user denied/i)&&Pr.throwError("user rejected transaction",ee.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:n}),HM("sendTransaction",o,s)))})}signTransaction(e){return Pr.throwError("signing transactions is unsupported",ee.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return Oo(this,void 0,void 0,function*(){const r=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),n=yield this.sendUncheckedTransaction(e);try{return yield Za(()=>Oo(this,void 0,void 0,function*(){const i=yield this.provider.getTransaction(n);if(i!==null)return this.provider._wrapTransaction(i,n,r)}),{oncePoll:this.provider})}catch(i){throw i.transactionHash=n,i}})}signMessage(e){return Oo(this,void 0,void 0,function*(){const r=typeof e=="string"?vt(e):e,n=yield this.getAddress();try{return yield this.provider.send("personal_sign",[te(r),n.toLowerCase()])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&Pr.throwError("user rejected signing",ee.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:e}),i}})}_legacySignMessage(e){return Oo(this,void 0,void 0,function*(){const r=typeof e=="string"?vt(e):e,n=yield this.getAddress();try{return yield this.provider.send("eth_sign",[n.toLowerCase(),te(r)])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&Pr.throwError("user rejected signing",ee.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:e}),i}})}_signTypedData(e,r,n){return Oo(this,void 0,void 0,function*(){const i=yield _r.resolveNames(e,r,n,o=>this.provider.resolveName(o)),s=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[s.toLowerCase(),JSON.stringify(_r.getPayload(i.domain,r,i.value))])}catch(o){throw typeof o.message=="string"&&o.message.match(/user denied/i)&&Pr.throwError("user rejected signing",ee.errors.ACTION_REJECTED,{action:"_signTypedData",from:s,messageData:{domain:i.domain,types:r,value:i.value}}),o}})}unlock(e){return Oo(this,void 0,void 0,function*(){const r=this.provider,n=yield this.getAddress();return r.send("personal_unlockAccount",[n.toLowerCase(),e,null])})}}class yZ extends qM{sendTransaction(e){return this.sendUncheckedTransaction(e).then(r=>({hash:r,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:n=>this.provider.waitForTransaction(r,n)}))}}const gZ={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};let ta=class extends rb{constructor(e,r){let n=r;n==null&&(n=new Promise((i,s)=>{setTimeout(()=>{this.detectNetwork().then(o=>{i(o)},o=>{s(o)})},0)})),super(n),e||(e=ws(this.constructor,"defaultUrl")()),typeof e=="string"?ne(this,"connection",Object.freeze({url:e})):ne(this,"connection",Object.freeze(Gt(e))),this._nextId=42}get _cache(){return this._eventLoopCache==null&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(()=>{this._cache.detectNetwork=null},0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return Oo(this,void 0,void 0,function*(){yield Tk(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch{try{e=yield this.send("net_version",[])}catch{}}if(e!=null){const r=ws(this.constructor,"getNetwork");try{return r(Z.from(e).toNumber())}catch(n){return Pr.throwError("could not detect network",ee.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:n})}}return Pr.throwError("could not detect network",ee.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(e){return new qM(u6,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(e=>e.map(r=>this.formatter.address(r)))}send(e,r){const n={method:e,params:r,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:bi(n),provider:this});const i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];const s=J1(this.connection,JSON.stringify(n),mZ).then(o=>(this.emit("debug",{action:"response",request:n,response:o,provider:this}),o),o=>{throw this.emit("debug",{action:"response",error:o,request:n,provider:this}),o});return i&&(this._cache[e]=s,setTimeout(()=>{this._cache[e]=null},0)),s}prepareRequest(e,r){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[yh(r.address),r.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[yh(r.address),r.blockTag]];case"getCode":return["eth_getCode",[yh(r.address),r.blockTag]];case"getStorageAt":return["eth_getStorageAt",[yh(r.address),pt(r.position,32),r.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[r.signedTransaction]];case"getBlock":return r.blockTag?["eth_getBlockByNumber",[r.blockTag,!!r.includeTransactions]]:r.blockHash?["eth_getBlockByHash",[r.blockHash,!!r.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[r.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[r.transactionHash]];case"call":return["eth_call",[ws(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0}),r.blockTag]];case"estimateGas":return["eth_estimateGas",[ws(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0})]];case"getLogs":return r.filter&&r.filter.address!=null&&(r.filter.address=yh(r.filter.address)),["eth_getLogs",[r.filter]]}return null}perform(e,r){return Oo(this,void 0,void 0,function*(){if(e==="call"||e==="estimateGas"){const i=r.transaction;if(i&&i.type!=null&&Z.from(i.type).isZero()&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const s=yield this.getFeeData();s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null&&(r=Gt(r),r.transaction=Gt(i),delete r.transaction.type)}}const n=this.prepareRequest(e,r);n==null&&Pr.throwError(e+" not implemented",ee.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(n[0],n[1])}catch(i){return HM(e,i,r)}})}_startEvent(e){e.tag==="pending"&&this._startPending(),super._startEvent(e)}_startPending(){if(this._pendingFilter!=null)return;const e=this,r=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=r,r.then(function(n){function i(){e.send("eth_getFilterChanges",[n]).then(function(s){if(e._pendingFilter!=r)return null;let o=Promise.resolve();return s.forEach(function(a){e._emitted["t:"+a.toLowerCase()]="pending",o=o.then(function(){return e.getTransaction(a).then(function(c){return e.emit("pending",c),null})})}),o.then(function(){return Tk(1e3)})}).then(function(){if(e._pendingFilter!=r){e.send("eth_uninstallFilter",[n]);return}return setTimeout(function(){i()},0),null}).catch(s=>{})}return i(),n}).catch(n=>{})}_stopEvent(e){e.tag==="pending"&&this.listenerCount("pending")===0&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,r){const n=Gt(gZ);if(r)for(const s in r)r[s]&&(n[s]=!0);IE(e,n);const i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(s){if(e[s]==null)return;const o=As(Z.from(e[s]));s==="gasLimit"&&(s="gas"),i[s]=o}),["from","to","data"].forEach(function(s){e[s]!=null&&(i[s]=te(e[s]))}),e.accessList&&(i.accessList=mu(e.accessList)),i}};var bZ=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const wZ=new ee(Td);class uy extends ta{detectNetwork(){const e=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return bZ(this,void 0,void 0,function*(){let r=this.network;return r==null&&(r=yield e.detectNetwork.call(this),r||wZ.throwError("no network detected",ee.errors.UNKNOWN_ERROR,{}),this._network==null&&(ne(this,"_network",r),this.emit("network",r,null))),r})}}var fy=globalThis&&globalThis.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})};const gl=new ee(Td);function sv(){return new Date().getTime()}function Ik(t){let e=null;for(let r=0;re?null:(n+i)/2}function pf(t){if(t===null)return"null";if(typeof t=="number"||typeof t=="boolean")return JSON.stringify(t);if(typeof t=="string")return t;if(Z.isBigNumber(t))return t.toString();if(Array.isArray(t))return JSON.stringify(t.map(e=>pf(e)));if(typeof t=="object"){const e=Object.keys(t);return e.sort(),"{"+e.map(r=>{let n=t[r];return typeof n=="function"?n="[function]":n=pf(n),JSON.stringify(r)+":"+n}).join(",")+"}"}throw new Error("unknown value type: "+typeof t)}let xZ=1;function Rk(t){let e=null,r=null,n=new Promise(o=>{e=function(){r&&(clearTimeout(r),r=null),o()},r=setTimeout(e,t)});const i=o=>(n=n.then(o),n);function s(){return n}return{cancel:e,getPromise:s,wait:i}}const EZ=[ee.errors.CALL_EXCEPTION,ee.errors.INSUFFICIENT_FUNDS,ee.errors.NONCE_EXPIRED,ee.errors.REPLACEMENT_UNDERPRICED,ee.errors.UNPREDICTABLE_GAS_LIMIT],CZ=["address","args","errorArgs","errorSignature","method","transaction"];function ov(t,e){const r={weight:t.weight};return Object.defineProperty(r,"provider",{get:()=>t.provider}),t.start&&(r.start=t.start),e&&(r.duration=e-t.start),t.done&&(t.error?r.error=t.error:r.result=t.result||null),r}function SZ(t,e){return function(r){const n={};r.forEach(s=>{const o=t(s.result);n[o]||(n[o]={count:0,result:s.result}),n[o].count++});const i=Object.keys(n);for(let s=0;s=e)return o.result}}}function kZ(t,e,r){let n=pf;switch(e){case"getBlockNumber":return function(i){const s=i.map(a=>a.result);let o=Ok(i.map(a=>a.result),2);if(o!=null)return o=Math.ceil(o),s.indexOf(o+1)>=0&&o++,o>=t._highestBlockNumber&&(t._highestBlockNumber=o),t._highestBlockNumber};case"getGasPrice":return function(i){const s=i.map(o=>o.result);return s.sort(),s[Math.floor(s.length/2)]};case"getEtherPrice":return function(i){return Ok(i.map(s=>s.result))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":n=function(i){return i==null?null:(i=Gt(i),i.confirmations=-1,pf(i))};break;case"getBlock":r.includeTransactions?n=function(i){return i==null?null:(i=Gt(i),i.transactions=i.transactions.map(s=>(s=Gt(s),s.confirmations=-1,s)),pf(i))}:n=function(i){return i==null?null:pf(i)};break;default:throw new Error("unknown method: "+e)}return SZ(n,t.quorum)}function gh(t,e){return fy(this,void 0,void 0,function*(){const r=t.provider;return r.blockNumber!=null&&r.blockNumber>=e||e===-1?r:Za(()=>new Promise((n,i)=>{setTimeout(function(){return r.blockNumber>=e?n(r):t.cancelled?n(null):n(void 0)},0)}),{oncePoll:r})})}function AZ(t,e,r,n){return fy(this,void 0,void 0,function*(){let i=t.provider;switch(r){case"getBlockNumber":case"getGasPrice":return i[r]();case"getEtherPrice":if(i.getEtherPrice)return i.getEtherPrice();break;case"getBalance":case"getTransactionCount":case"getCode":return n.blockTag&&Ue(n.blockTag)&&(i=yield gh(t,e)),i[r](n.address,n.blockTag||"latest");case"getStorageAt":return n.blockTag&&Ue(n.blockTag)&&(i=yield gh(t,e)),i.getStorageAt(n.address,n.position,n.blockTag||"latest");case"getBlock":return n.blockTag&&Ue(n.blockTag)&&(i=yield gh(t,e)),i[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash);case"call":case"estimateGas":return n.blockTag&&Ue(n.blockTag)&&(i=yield gh(t,e)),r==="call"&&n.blockTag?i[r](n.transaction,n.blockTag):i[r](n.transaction);case"getTransaction":case"getTransactionReceipt":return i[r](n.transactionHash);case"getLogs":{let s=n.filter;return(s.fromBlock&&Ue(s.fromBlock)||s.toBlock&&Ue(s.toBlock))&&(i=yield gh(t,e)),i.getLogs(s)}}return gl.throwError("unknown method error",ee.errors.UNKNOWN_ERROR,{method:r,params:n})})}class _Z extends rb{constructor(e,r){e.length===0&&gl.throwArgumentError("missing providers","providers",e);const n=e.map((o,a)=>{if(ga.isProvider(o)){const u=Ek(o)?2e3:750;return Object.freeze({provider:o,weight:1,stallTimeout:u,priority:1})}const c=Gt(o);c.priority==null&&(c.priority=1),c.stallTimeout==null&&(c.stallTimeout=Ek(o)?2e3:750),c.weight==null&&(c.weight=1);const l=c.weight;return(l%1||l>512||l<1)&&gl.throwArgumentError("invalid weight; must be integer in [1, 512]",`providers[${a}].weight`,l),Object.freeze(c)}),i=n.reduce((o,a)=>o+a.weight,0);r==null?r=i/2:r>i&&gl.throwArgumentError("quorum will always fail; larger than total weight","quorum",r);let s=Ik(n.map(o=>o.provider.network));s==null&&(s=new Promise((o,a)=>{setTimeout(()=>{this.detectNetwork().then(o,a)},0)})),super(s),ne(this,"providerConfigs",Object.freeze(n)),ne(this,"quorum",r),this._highestBlockNumber=-1}detectNetwork(){return fy(this,void 0,void 0,function*(){const e=yield Promise.all(this.providerConfigs.map(r=>r.provider.getNetwork()));return Ik(e)})}perform(e,r){return fy(this,void 0,void 0,function*(){if(e==="sendTransaction"){const c=yield Promise.all(this.providerConfigs.map(l=>l.provider.sendTransaction(r.signedTransaction).then(u=>u.hash,u=>u)));for(let l=0;lc.priority-l.priority);const s=this._highestBlockNumber;let o=0,a=!0;for(;;){const c=sv();let l=i.filter(h=>h.runner&&c-h.starth+p.weight,0);for(;l{h.staller=null}),h.runner=AZ(h,s,e,r).then(v=>{h.done=!0,h.result=v,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:p,backend:ov(h,sv()),request:{method:e,params:bi(r)},provider:this})},v=>{h.done=!0,h.error=v,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:p,backend:ov(h,sv()),request:{method:e,params:bi(r)},provider:this})}),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:p,backend:ov(h,null),request:{method:e,params:bi(r)},provider:this}),l+=h.weight}const u=[];i.forEach(h=>{h.done||!h.runner||(u.push(h.runner),h.staller&&u.push(h.staller.getPromise()))}),u.length&&(yield Promise.race(u));const f=i.filter(h=>h.done&&h.error==null);if(f.length>=this.quorum){const h=n(f);if(h!==void 0)return i.forEach(p=>{p.staller&&p.staller.cancel(),p.cancelled=!0}),h;a||(yield Rk(100).getPromise()),a=!1}const d=i.reduce((h,p)=>{if(!p.done||p.error==null)return h;const v=p.error.code;return EZ.indexOf(v)>=0&&(h[v]||(h[v]={error:p.error,weight:0}),h[v].weight+=p.weight),h},{});if(Object.keys(d).forEach(h=>{const p=d[h];if(p.weight{g.staller&&g.staller.cancel(),g.cancelled=!0});const v=p.error,m={};CZ.forEach(g=>{v[g]!=null&&(m[g]=v[g])}),gl.throwError(v.reason||v.message,h,m)}),i.filter(h=>!h.done).length===0)break}return i.forEach(c=>{c.staller&&c.staller.cancel(),c.cancelled=!0}),gl.throwError("failed to meet quorum",ee.errors.SERVER_ERROR,{method:e,params:r,results:i.map(c=>ov(c)),provider:this})})}}const $k=new ee(Td);let PZ=1;function Mk(t,e){const r="Web3LegacyFetcher";return function(n,i){const s={method:n,params:i,id:PZ++,jsonrpc:"2.0"};return new Promise((o,a)=>{this.emit("debug",{action:"request",fetcher:r,request:bi(s),provider:this}),e(s,(c,l)=>{if(c)return this.emit("debug",{action:"response",fetcher:r,error:c,request:s,provider:this}),a(c);if(this.emit("debug",{action:"response",fetcher:r,request:s,response:l,provider:this}),l.error){const u=new Error(l.error.message);return u.code=l.error.code,u.data=l.error.data,a(u)}o(l.result)})})}}function TZ(t){return function(e,r){r==null&&(r=[]);const n={method:e,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:bi(n),provider:this}),t.request(n).then(i=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,response:i,provider:this}),i),i=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,error:i,provider:this}),i})}}class VM extends ta{constructor(e,r){e==null&&$k.throwArgumentError("missing provider","provider",e);let n=null,i=null,s=null;typeof e=="function"?(n="unknown:",i=e):(n=e.host||e.path||"",!n&&e.isMetaMask&&(n="metamask"),s=e,e.request?(n===""&&(n="eip-1193:"),i=TZ(e)):e.sendAsync?i=Mk(e,e.sendAsync.bind(e)):e.send?i=Mk(e,e.send.bind(e)):$k.throwArgumentError("unsupported provider","provider",e),n||(n="unknown:")),super(n,r),ne(this,"jsonRpcFetchFunc",i),ne(this,"provider",s)}send(e,r){return this.jsonRpcFetchFunc(e,r)}}const IZ="solidity/5.7.0",OZ=new RegExp("^bytes([0-9]+)$"),RZ=new RegExp("^(u?int)([0-9]*)$"),$Z=new RegExp("^(.*)\\[([0-9]*)\\]$"),MZ="0000000000000000000000000000000000000000000000000000000000000000",Gu=new ee(IZ);function GM(t,e,r){switch(t){case"address":return r?e0(e,32):re(e);case"string":return vt(e);case"bytes":return re(e);case"bool":return e=e?"0x01":"0x00",r?e0(e,32):re(e)}let n=t.match(RZ);if(n){let i=parseInt(n[2]||"256");return(n[2]&&String(i)!==n[2]||i%8!==0||i===0||i>256)&&Gu.throwArgumentError("invalid number type","type",t),r&&(i=256),e=Z.from(e).toTwos(i),e0(e,i/8)}if(n=t.match(OZ),n){const i=parseInt(n[1]);return(String(i)!==n[1]||i===0||i>32)&&Gu.throwArgumentError("invalid bytes type","type",t),re(e).byteLength!==i&&Gu.throwArgumentError(`invalid value for ${t}`,"value",e),r?re((e+MZ).substring(0,66)):e}if(n=t.match($Z),n&&Array.isArray(e)){const i=n[1];parseInt(n[2]||String(e.length))!=e.length&&Gu.throwArgumentError(`invalid array length for ${t}`,"value",e);const o=[];return e.forEach(function(a){o.push(GM(i,a,!0))}),ht(o)}return Gu.throwArgumentError("invalid type","type",t)}function qe(t,e){t.length!=e.length&&Gu.throwArgumentError("wrong number of values; expected ${ types.length }","values",e);const r=[];return t.forEach(function(n,i){r.push(GM(n,e[i]))}),te(ht(r))}function hc(t,e){return Ee(qe(t,e))}function NZ(t,e){return ea(qe(t,e))}const DZ="units/5.7.0",KM=new ee(DZ),QM=["wei","kwei","mwei","gwei","szabo","finney","ether"];function LZ(t){const e=String(t).split(".");(e.length>2||!e[0].match(/^-?[0-9]*$/)||e[1]&&!e[1].match(/^[0-9]*$/)||t==="."||t==="-.")&&KM.throwArgumentError("invalid value","value",t);let r=e[0],n="";for(r.substring(0,1)==="-"&&(n="-",r=r.substring(1));r.substring(0,1)==="0";)r=r.substring(1);r===""&&(r="0");let i="";for(e.length===2&&(i="."+(e[1]||"0"));i.length>2&&i[i.length-1]==="0";)i=i.substring(0,i.length-1);const s=[];for(;r.length;)if(r.length<=3){s.unshift(r);break}else{const o=r.length-3;s.unshift(r.substring(o)),r=r.substring(0,o)}return n+s.join(",")+i}function Sr(t,e){if(typeof e=="string"){const r=QM.indexOf(e);r!==-1&&(e=3*r)}return Yv(t,e??18)}function rd(t,e){if(typeof t!="string"&&KM.throwArgumentError("value must be a string","value",t),typeof e=="string"){const r=QM.indexOf(e);r!==-1&&(e=3*r)}return Ws(t,e??18)}function BZ(t){return Sr(t,18)}function FZ(t){return rd(t,18)}const jZ=Object.freeze(Object.defineProperty({__proto__:null,AbiCoder:LE,ConstructorFragment:gs,ErrorFragment:Lo,EventFragment:Zs,FormatTypes:rt,Fragment:to,FunctionFragment:bs,HDNode:hi,Indexed:iy,Interface:$r,LogDescription:V$,Logger:ee,ParamType:Ur,RLP:jK,SigningKey:Ml,get SupportedAlgorithm(){return ed},TransactionDescription:G$,get TransactionTypes(){return i6},get UnicodeNormalizationForm(){return go},Utf8ErrorFuncs:M$,get Utf8ErrorReason(){return Yn},_TypedDataEncoder:_r,_fetchData:FM,_toEscapedUtf8String:sQ,accessListify:mu,arrayify:re,base58:Zf,base64:SQ,checkProperties:IE,checkResultErrors:x$,commify:LZ,computeAddress:dc,computeHmac:Y0,computePublicKey:qE,concat:ht,deepCopy:bi,defaultAbiCoder:zn,defaultPath:td,defineReadOnly:ne,dnsEncode:z$,entropyToMnemonic:eb,fetchJson:J1,formatBytes32String:oQ,formatEther:BZ,formatUnits:Sr,getAccountPath:EX,getAddress:Ie,getContractAddress:$E,getCreate2Address:qK,getIcapAddress:HK,getJsonWalletAddress:TX,getStatic:ws,hashMessage:Kg,hexConcat:Mn,hexDataLength:yo,hexDataSlice:vr,hexStripZeros:d$,hexValue:As,hexZeroPad:pt,hexlify:te,id:Xa,isAddress:A$,isBytes:va,isBytesLike:Jo,isHexString:Ue,isValidMnemonic:xX,isValidName:KQ,joinSignature:Y5,keccak256:Ee,mnemonicToEntropy:Zg,mnemonicToSeed:TM,namehash:n0,nameprep:wQ,parseBytes32String:aQ,parseEther:FZ,parseTransaction:EM,parseUnits:rd,poll:Za,randomBytes:ro,recoverAddress:Zl,recoverPublicKey:yM,resolveProperties:mt,ripemd160:AM,serializeTransaction:s6,sha256:ea,sha512:dX,shallowCopy:Gt,shuffled:IM,solidityKeccak256:hc,solidityPack:qe,soliditySha256:NZ,splitSignature:hu,stripZeros:co,toUtf8Bytes:vt,toUtf8CodePoints:ry,toUtf8String:ya,verifyMessage:BM,verifyTypedData:HX,zeroPad:e0},Symbol.toStringTag,{value:"Module"})),YM="%[a-f0-9]{2}",Nk=new RegExp("("+YM+")|([^%]+?)","gi"),Dk=new RegExp("("+YM+")+","gi");function f6(t,e){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;e=e||1;const r=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],f6(r),f6(n))}function UZ(t){try{return decodeURIComponent(t)}catch{let e=t.match(Nk)||[];for(let r=1;rt==null,VZ=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),d6=Symbol("encodeFragmentIdentifier");function GZ(t){switch(t.arrayFormat){case"index":return e=>(r,n)=>{const i=r.length;return n===void 0||t.skipNull&&n===null||t.skipEmptyString&&n===""?r:n===null?[...r,[Ar(e,t),"[",i,"]"].join("")]:[...r,[Ar(e,t),"[",Ar(i,t),"]=",Ar(n,t)].join("")]};case"bracket":return e=>(r,n)=>n===void 0||t.skipNull&&n===null||t.skipEmptyString&&n===""?r:n===null?[...r,[Ar(e,t),"[]"].join("")]:[...r,[Ar(e,t),"[]=",Ar(n,t)].join("")];case"colon-list-separator":return e=>(r,n)=>n===void 0||t.skipNull&&n===null||t.skipEmptyString&&n===""?r:n===null?[...r,[Ar(e,t),":list="].join("")]:[...r,[Ar(e,t),":list=",Ar(n,t)].join("")];case"comma":case"separator":case"bracket-separator":{const e=t.arrayFormat==="bracket-separator"?"[]=":"=";return r=>(n,i)=>i===void 0||t.skipNull&&i===null||t.skipEmptyString&&i===""?n:(i=i===null?"":i,n.length===0?[[Ar(r,t),e,Ar(i,t)].join("")]:[[n,Ar(i,t)].join(t.arrayFormatSeparator)])}default:return e=>(r,n)=>n===void 0||t.skipNull&&n===null||t.skipEmptyString&&n===""?r:n===null?[...r,Ar(e,t)]:[...r,[Ar(e,t),"=",Ar(n,t)].join("")]}}function KZ(t){let e;switch(t.arrayFormat){case"index":return(r,n,i)=>{if(e=/\[(\d*)]$/.exec(r),r=r.replace(/\[\d*]$/,""),!e){i[r]=n;return}i[r]===void 0&&(i[r]={}),i[r][e[1]]=n};case"bracket":return(r,n,i)=>{if(e=/(\[])$/.exec(r),r=r.replace(/\[]$/,""),!e){i[r]=n;return}if(i[r]===void 0){i[r]=[n];return}i[r]=[...i[r],n]};case"colon-list-separator":return(r,n,i)=>{if(e=/(:list)$/.exec(r),r=r.replace(/:list$/,""),!e){i[r]=n;return}if(i[r]===void 0){i[r]=[n];return}i[r]=[...i[r],n]};case"comma":case"separator":return(r,n,i)=>{const s=typeof n=="string"&&n.includes(t.arrayFormatSeparator),o=typeof n=="string"&&!s&&Do(n,t).includes(t.arrayFormatSeparator);n=o?Do(n,t):n;const a=s||o?n.split(t.arrayFormatSeparator).map(c=>Do(c,t)):n===null?n:Do(n,t);i[r]=a};case"bracket-separator":return(r,n,i)=>{const s=/(\[])$/.test(r);if(r=r.replace(/\[]$/,""),!s){i[r]=n&&Do(n,t);return}const o=n===null?[]:n.split(t.arrayFormatSeparator).map(a=>Do(a,t));if(i[r]===void 0){i[r]=o;return}i[r]=[...i[r],...o]};default:return(r,n,i)=>{if(i[r]===void 0){i[r]=n;return}i[r]=[...[i[r]].flat(),n]}}}function XM(t){if(typeof t!="string"||t.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function Ar(t,e){return e.encode?e.strict?VZ(t):encodeURIComponent(t):t}function Do(t,e){return e.decode?WZ(t):t}function ZM(t){return Array.isArray(t)?t.sort():typeof t=="object"?ZM(Object.keys(t)).sort((e,r)=>Number(e)-Number(r)).map(e=>t[e]):t}function eN(t){const e=t.indexOf("#");return e!==-1&&(t=t.slice(0,e)),t}function QZ(t){let e="";const r=t.indexOf("#");return r!==-1&&(e=t.slice(r)),e}function Lk(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&typeof t=="string"&&t.trim()!==""?t=Number(t):e.parseBooleans&&t!==null&&(t.toLowerCase()==="true"||t.toLowerCase()==="false")&&(t=t.toLowerCase()==="true"),t}function ZE(t){t=eN(t);const e=t.indexOf("?");return e===-1?"":t.slice(e+1)}function eC(t,e){e={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...e},XM(e.arrayFormatSeparator);const r=KZ(e),n=Object.create(null);if(typeof t!="string"||(t=t.trim().replace(/^[?#&]/,""),!t))return n;for(const i of t.split("&")){if(i==="")continue;const s=e.decode?i.replace(/\+/g," "):i;let[o,a]=JM(s,"=");o===void 0&&(o=s),a=a===void 0?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?a:Do(a,e),r(Do(o,e),a,n)}for(const[i,s]of Object.entries(n))if(typeof s=="object"&&s!==null)for(const[o,a]of Object.entries(s))s[o]=Lk(a,e);else n[i]=Lk(s,e);return e.sort===!1?n:(e.sort===!0?Object.keys(n).sort():Object.keys(n).sort(e.sort)).reduce((i,s)=>{const o=n[s];return o&&typeof o=="object"&&!Array.isArray(o)?i[s]=ZM(o):i[s]=o,i},Object.create(null))}function tN(t,e){if(!t)return"";e={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...e},XM(e.arrayFormatSeparator);const r=o=>e.skipNull&&qZ(t[o])||e.skipEmptyString&&t[o]==="",n=GZ(e),i={};for(const[o,a]of Object.entries(t))r(o)||(i[o]=a);const s=Object.keys(i);return e.sort!==!1&&s.sort(e.sort),s.map(o=>{const a=t[o];return a===void 0?"":a===null?Ar(o,e):Array.isArray(a)?a.length===0&&e.arrayFormat==="bracket-separator"?Ar(o,e)+"[]":a.reduce(n(o),[]).join("&"):Ar(o,e)+"="+Ar(a,e)}).filter(o=>o.length>0).join("&")}function rN(t,e){var i;e={decode:!0,...e};let[r,n]=JM(t,"#");return r===void 0&&(r=t),{url:((i=r==null?void 0:r.split("?"))==null?void 0:i[0])??"",query:eC(ZE(t),e),...e&&e.parseFragmentIdentifier&&n?{fragmentIdentifier:Do(n,e)}:{}}}function nN(t,e){e={encode:!0,strict:!0,[d6]:!0,...e};const r=eN(t.url).split("?")[0]||"",n=ZE(t.url),i={...eC(n,{sort:!1}),...t.query};let s=tN(i,e);s&&(s=`?${s}`);let o=QZ(t.url);if(t.fragmentIdentifier){const a=new URL(r);a.hash=t.fragmentIdentifier,o=e[d6]?a.hash:`#${t.fragmentIdentifier}`}return`${r}${s}${o}`}function iN(t,e,r){r={parseFragmentIdentifier:!0,[d6]:!1,...r};const{url:n,query:i,fragmentIdentifier:s}=rN(t,r);return nN({url:n,query:HZ(i,e),fragmentIdentifier:s},r)}function YZ(t,e,r){const n=Array.isArray(e)?i=>!e.includes(i):(i,s)=>!e(i,s);return iN(t,n,r)}const sN=Object.freeze(Object.defineProperty({__proto__:null,exclude:YZ,extract:ZE,parse:eC,parseUrl:rN,pick:iN,stringify:tN,stringifyUrl:nN},Symbol.toStringTag,{value:"Module"})),tC=k.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),nb=k.createContext({});function JZ(){return k.useContext(nb).visualElement}const X1=k.createContext(null),ib=typeof document<"u",dy=ib?k.useLayoutEffect:k.useEffect,oN=k.createContext({strict:!1});function XZ(t,e,r,n){const i=JZ(),s=k.useContext(oN),o=k.useContext(X1),a=k.useContext(tC).reducedMotion,c=k.useRef();n=n||s.renderer,!c.current&&n&&(c.current=n(t,{visualState:e,parent:i,props:r,presenceId:o?o.id:void 0,blockInitialAnimation:o?o.initial===!1:!1,reducedMotionConfig:a}));const l=c.current;return dy(()=>{l&&l.render()}),(window.HandoffAppearAnimations?dy:k.useEffect)(()=>{l&&l.animationState&&l.animationState.animateChanges()}),l}function vf(t){return typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function ZZ(t,e,r){return k.useCallback(n=>{n&&t.mount&&t.mount(n),e&&(n?e.mount(n):e.unmount()),r&&(typeof r=="function"?r(n):vf(r)&&(r.current=n))},[e])}function Z0(t){return typeof t=="string"||Array.isArray(t)}function sb(t){return typeof t=="object"&&typeof t.start=="function"}const eee=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function ob(t){return sb(t.animate)||eee.some(e=>Z0(t[e]))}function aN(t){return!!(ob(t)||t.variants)}function tee(t,e){if(ob(t)){const{initial:r,animate:n}=t;return{initial:r===!1||Z0(r)?r:void 0,animate:Z0(n)?n:void 0}}return t.inherit!==!1?e:{}}function ree(t){const{initial:e,animate:r}=tee(t,k.useContext(nb));return k.useMemo(()=>({initial:e,animate:r}),[Bk(e),Bk(r)])}function Bk(t){return Array.isArray(t)?t.join(" "):t}const Po=t=>({isEnabled:e=>t.some(r=>!!e[r])}),e1={measureLayout:Po(["layout","layoutId","drag"]),animation:Po(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:Po(["exit"]),drag:Po(["drag","dragControls"]),focus:Po(["whileFocus"]),hover:Po(["whileHover","onHoverStart","onHoverEnd"]),tap:Po(["whileTap","onTap","onTapStart","onTapCancel"]),pan:Po(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:Po(["whileInView","onViewportEnter","onViewportLeave"])};function nee(t){for(const e in t)e==="projectionNodeConstructor"?e1.projectionNodeConstructor=t[e]:e1[e].Component=t[e]}function ab(t){const e=k.useRef(null);return e.current===null&&(e.current=t()),e.current}const o0={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let iee=1;function see(){return ab(()=>{if(o0.hasEverUpdated)return iee++})}const rC=k.createContext({});class oee extends S.Component{getSnapshotBeforeUpdate(){const{visualElement:e,props:r}=this.props;return e&&e.setProps(r),null}componentDidUpdate(){}render(){return this.props.children}}const cN=k.createContext({}),aee=Symbol.for("motionComponentSymbol");function cee({preloadedFeatures:t,createVisualElement:e,projectionNodeConstructor:r,useRender:n,useVisualState:i,Component:s}){t&&nee(t);function o(c,l){const u={...k.useContext(tC),...c,layoutId:lee(c)},{isStatic:f}=u;let d=null;const h=ree(c),p=f?void 0:see(),v=i(c,f);if(!f&&ib){h.visualElement=XZ(s,v,u,e);const m=k.useContext(oN).strict,g=k.useContext(cN);h.visualElement&&(d=h.visualElement.loadFeatures(u,m,t,p,r||e1.projectionNodeConstructor,g))}return k.createElement(oee,{visualElement:h.visualElement,props:u},d,k.createElement(nb.Provider,{value:h},n(s,c,p,ZZ(v,h.visualElement,l),v,f,h.visualElement)))}const a=k.forwardRef(o);return a[aee]=s,a}function lee({layoutId:t}){const e=k.useContext(rC).id;return e&&t!==void 0?e+"-"+t:t}function uee(t){function e(n,i={}){return cee(t(n,i))}if(typeof Proxy>"u")return e;const r=new Map;return new Proxy(e,{get:(n,i)=>(r.has(i)||r.set(i,e(i)),r.get(i))})}const fee=["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 nC(t){return typeof t!="string"||t.includes("-")?!1:!!(fee.indexOf(t)>-1||/[A-Z]/.test(t))}const hy={};function dee(t){Object.assign(hy,t)}const py=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Id=new Set(py);function lN(t,{layout:e,layoutId:r}){return Id.has(t)||t.startsWith("origin")||(e||r!==void 0)&&(!!hy[t]||t==="opacity")}const ai=t=>!!(t!=null&&t.getVelocity),hee={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},pee=(t,e)=>py.indexOf(t)-py.indexOf(e);function vee({transform:t,transformKeys:e},{enableHardwareAcceleration:r=!0,allowTransformNone:n=!0},i,s){let o="";e.sort(pee);for(const a of e)o+=`${hee[a]||a}(${t[a]}) `;return r&&!t.z&&(o+="translateZ(0)"),o=o.trim(),s?o=s(t,i?"":o):n&&i&&(o="none"),o}function uN(t){return t.startsWith("--")}const mee=(t,e)=>e&&typeof t=="number"?e.transform(t):t,nd=(t,e,r)=>Math.min(Math.max(r,t),e),yu={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},a0={...yu,transform:t=>nd(0,1,t)},av={...yu,default:1},c0=t=>Math.round(t*1e5)/1e5,t1=/(-)?([\d]*\.?[\d])+/g,h6=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,yee=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Z1(t){return typeof t=="string"}const ep=t=>({test:e=>Z1(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Na=ep("deg"),ho=ep("%"),we=ep("px"),gee=ep("vh"),bee=ep("vw"),Fk={...ho,parse:t=>ho.parse(t)/100,transform:t=>ho.transform(t*100)},jk={...yu,transform:Math.round},fN={borderWidth:we,borderTopWidth:we,borderRightWidth:we,borderBottomWidth:we,borderLeftWidth:we,borderRadius:we,radius:we,borderTopLeftRadius:we,borderTopRightRadius:we,borderBottomRightRadius:we,borderBottomLeftRadius:we,width:we,maxWidth:we,height:we,maxHeight:we,size:we,top:we,right:we,bottom:we,left:we,padding:we,paddingTop:we,paddingRight:we,paddingBottom:we,paddingLeft:we,margin:we,marginTop:we,marginRight:we,marginBottom:we,marginLeft:we,rotate:Na,rotateX:Na,rotateY:Na,rotateZ:Na,scale:av,scaleX:av,scaleY:av,scaleZ:av,skew:Na,skewX:Na,skewY:Na,distance:we,translateX:we,translateY:we,translateZ:we,x:we,y:we,z:we,perspective:we,transformPerspective:we,opacity:a0,originX:Fk,originY:Fk,originZ:we,zIndex:jk,fillOpacity:a0,strokeOpacity:a0,numOctaves:jk};function iC(t,e,r,n){const{style:i,vars:s,transform:o,transformKeys:a,transformOrigin:c}=t;a.length=0;let l=!1,u=!1,f=!0;for(const d in e){const h=e[d];if(uN(d)){s[d]=h;continue}const p=fN[d],v=mee(h,p);if(Id.has(d)){if(l=!0,o[d]=v,a.push(d),!f)continue;h!==(p.default||0)&&(f=!1)}else d.startsWith("origin")?(u=!0,c[d]=v):i[d]=v}if(e.transform||(l||n?i.transform=vee(t,r,f,n):i.transform&&(i.transform="none")),u){const{originX:d="50%",originY:h="50%",originZ:p=0}=c;i.transformOrigin=`${d} ${h} ${p}`}}const sC=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function dN(t,e,r){for(const n in e)!ai(e[n])&&!lN(n,r)&&(t[n]=e[n])}function wee({transformTemplate:t},e,r){return k.useMemo(()=>{const n=sC();return iC(n,e,{enableHardwareAcceleration:!r},t),Object.assign({},n.vars,n.style)},[e])}function xee(t,e,r){const n=t.style||{},i={};return dN(i,n,t),Object.assign(i,wee(t,e,r)),t.transformValues?t.transformValues(i):i}function Eee(t,e,r){const n={},i=xee(t,e,r);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),n.style=i,n}const Cee=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","viewport"]);function vy(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||Cee.has(t)}let hN=t=>!vy(t);function See(t){t&&(hN=e=>e.startsWith("on")?!vy(e):t(e))}try{See(require("@emotion/is-prop-valid").default)}catch{}function kee(t,e,r){const n={};for(const i in t)i==="values"&&typeof t.values=="object"||(hN(i)||r===!0&&vy(i)||!e&&!vy(i)||t.draggable&&i.startsWith("onDrag"))&&(n[i]=t[i]);return n}function Uk(t,e,r){return typeof t=="string"?t:we.transform(e+r*t)}function Aee(t,e,r){const n=Uk(e,t.x,t.width),i=Uk(r,t.y,t.height);return`${n} ${i}`}const _ee={offset:"stroke-dashoffset",array:"stroke-dasharray"},Pee={offset:"strokeDashoffset",array:"strokeDasharray"};function Tee(t,e,r=1,n=0,i=!0){t.pathLength=1;const s=i?_ee:Pee;t[s.offset]=we.transform(-n);const o=we.transform(e),a=we.transform(r);t[s.array]=`${o} ${a}`}function oC(t,{attrX:e,attrY:r,originX:n,originY:i,pathLength:s,pathSpacing:o=1,pathOffset:a=0,...c},l,u,f){if(iC(t,c,l,f),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:d,style:h,dimensions:p}=t;d.transform&&(p&&(h.transform=d.transform),delete d.transform),p&&(n!==void 0||i!==void 0||h.transform)&&(h.transformOrigin=Aee(p,n!==void 0?n:.5,i!==void 0?i:.5)),e!==void 0&&(d.x=e),r!==void 0&&(d.y=r),s!==void 0&&Tee(d,s,o,a,!1)}const pN=()=>({...sC(),attrs:{}}),aC=t=>typeof t=="string"&&t.toLowerCase()==="svg";function Iee(t,e,r,n){const i=k.useMemo(()=>{const s=pN();return oC(s,e,{enableHardwareAcceleration:!1},aC(n),t.transformTemplate),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};dN(s,t.style,t),i.style={...s,...i.style}}return i}function Oee(t=!1){return(r,n,i,s,{latestValues:o},a)=>{const l=(nC(r)?Iee:Eee)(n,o,a,r),f={...kee(n,typeof r=="string",t),...l,ref:s},{children:d}=n,h=k.useMemo(()=>ai(d)?d.get():d,[d]);return i&&(f["data-projection-id"]=i),k.createElement(r,{...f,children:h})}}const cC=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function vN(t,{style:e,vars:r},n,i){Object.assign(t.style,e,i&&i.getProjectionStyles(n));for(const s in r)t.style.setProperty(s,r[s])}const mN=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 yN(t,e,r,n){vN(t,e,void 0,n);for(const i in e.attrs)t.setAttribute(mN.has(i)?i:cC(i),e.attrs[i])}function lC(t,e){const{style:r}=t,n={};for(const i in r)(ai(r[i])||e.style&&ai(e.style[i])||lN(i,t))&&(n[i]=r[i]);return n}function gN(t,e){const r=lC(t,e);for(const n in t)if(ai(t[n])||ai(e[n])){const i=n==="x"||n==="y"?"attr"+n.toUpperCase():n;r[i]=t[n]}return r}function uC(t,e,r,n={},i={}){return typeof e=="function"&&(e=e(r!==void 0?r:t.custom,n,i)),typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"&&(e=e(r!==void 0?r:t.custom,n,i)),e}const my=t=>Array.isArray(t),Ree=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),$ee=t=>my(t)?t[t.length-1]||0:t;function nm(t){const e=ai(t)?t.get():t;return Ree(e)?e.toValue():e}function Mee({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:r},n,i,s){const o={latestValues:Nee(n,i,s,t),renderState:e()};return r&&(o.mount=a=>r(n,a,o)),o}const bN=t=>(e,r)=>{const n=k.useContext(nb),i=k.useContext(X1),s=()=>Mee(t,e,n,i);return r?s():ab(s)};function Nee(t,e,r,n){const i={},s=n(t,{});for(const d in s)i[d]=nm(s[d]);let{initial:o,animate:a}=t;const c=ob(t),l=aN(t);e&&l&&!c&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let u=r?r.initial===!1:!1;u=u||o===!1;const f=u?a:o;return f&&typeof f!="boolean"&&!sb(f)&&(Array.isArray(f)?f:[f]).forEach(h=>{const p=uC(t,h);if(!p)return;const{transitionEnd:v,transition:m,...g}=p;for(const y in g){let b=g[y];if(Array.isArray(b)){const C=u?b.length-1:0;b=b[C]}b!==null&&(i[y]=b)}for(const y in v)i[y]=v[y]}),i}const Dee={useVisualState:bN({scrapeMotionValuesFromProps:gN,createRenderState:pN,onMount:(t,e,{renderState:r,latestValues:n})=>{try{r.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{r.dimensions={x:0,y:0,width:0,height:0}}oC(r,n,{enableHardwareAcceleration:!1},aC(e.tagName),t.transformTemplate),yN(e,r)}})},Lee={useVisualState:bN({scrapeMotionValuesFromProps:lC,createRenderState:sC})};function Bee(t,{forwardMotionProps:e=!1},r,n,i){return{...nC(t)?Dee:Lee,preloadedFeatures:r,useRender:Oee(e),createVisualElement:n,projectionNodeConstructor:i,Component:t}}var bt;(function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.InView="whileInView",t.Exit="exit"})(bt||(bt={}));function cb(t,e,r,n={passive:!0}){return t.addEventListener(e,r,n),()=>t.removeEventListener(e,r)}function p6(t,e,r,n){k.useEffect(()=>{const i=t.current;if(r&&i)return cb(i,e,r,n)},[t,e,r,n])}function Fee({whileFocus:t,visualElement:e}){const{animationState:r}=e,n=k.useCallback(()=>{r&&r.setActive(bt.Focus,!0)},[r]),i=k.useCallback(()=>{r&&r.setActive(bt.Focus,!1)},[r]);p6(e,"focus",t?n:void 0),p6(e,"blur",t?i:void 0)}const wN=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function fC(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}const xN=t=>e=>wN(e)&&t(e,fC(e));function Rf(t,e,r,n){return cb(t,e,xN(r),n)}function yy(t,e,r,n){return p6(t,e,r&&xN(r),n)}function EN(t){let e=null;return()=>{const r=()=>{e=null};return e===null?(e=t,r):!1}}const zk=EN("dragHorizontal"),Wk=EN("dragVertical");function CN(t){let e=!1;if(t==="y")e=Wk();else if(t==="x")e=zk();else{const r=zk(),n=Wk();r&&n?e=()=>{r(),n()}:(r&&r(),n&&n())}return e}function SN(){const t=CN(!0);return t?(t(),!1):!0}function Hk(t,e,r,n){return(i,s)=>{i.type==="touch"||SN()||(r&&t.animationState&&t.animationState.setActive(bt.Hover,e),n&&n(i,s))}}function jee({onHoverStart:t,onHoverEnd:e,whileHover:r,visualElement:n}){yy(n,"pointerenter",k.useMemo(()=>t||r?Hk(n,!0,!!r,t):void 0,[t,!!r,n]),{passive:!t}),yy(n,"pointerleave",k.useMemo(()=>e||r?Hk(n,!1,!!r,e):void 0,[t,!!r,n]),{passive:!e})}const kN=(t,e)=>e?t===e?!0:kN(t,e.parentElement):!1;function dC(t){return k.useEffect(()=>()=>t(),[])}const Uee=(t,e)=>r=>e(t(r)),lb=(...t)=>t.reduce(Uee);function zee({onTap:t,onTapStart:e,onTapCancel:r,whileTap:n,visualElement:i,...s}){const o=t||e||r||n,a=k.useRef(!1),c=k.useRef(null),l={passive:!(e||t||r||s.onPointerDown)};function u(){c.current&&c.current(),c.current=null}function f(){return u(),a.current=!1,i.getProps().whileTap&&i.animationState&&i.animationState.setActive(bt.Tap,!1),!SN()}function d(v,m){var g,y,b,C;f()&&(kN(i.current,v.target)?(C=(b=i.getProps()).onTap)===null||C===void 0||C.call(b,v,m):(y=(g=i.getProps()).onTapCancel)===null||y===void 0||y.call(g,v,m))}function h(v,m){var g,y;f()&&((y=(g=i.getProps()).onTapCancel)===null||y===void 0||y.call(g,v,m))}const p=k.useCallback((v,m)=>{var g;if(u(),a.current)return;a.current=!0,c.current=lb(Rf(window,"pointerup",d,l),Rf(window,"pointercancel",h,l));const y=i.getProps();y.whileTap&&i.animationState&&i.animationState.setActive(bt.Tap,!0),(g=y.onTapStart)===null||g===void 0||g.call(y,v,m)},[!!e,i]);yy(i,"pointerdown",o?p:void 0,l),dC(u)}const v6=new WeakMap,Uw=new WeakMap,Wee=t=>{const e=v6.get(t.target);e&&e(t)},Hee=t=>{t.forEach(Wee)};function qee({root:t,...e}){const r=t||document;Uw.has(r)||Uw.set(r,{});const n=Uw.get(r),i=JSON.stringify(e);return n[i]||(n[i]=new IntersectionObserver(Hee,{root:t,...e})),n[i]}function Vee(t,e,r){const n=qee(e);return v6.set(t,r),n.observe(t),()=>{v6.delete(t),n.unobserve(t)}}function Gee({visualElement:t,whileInView:e,onViewportEnter:r,onViewportLeave:n,viewport:i={}}){const s=k.useRef({hasEnteredView:!1,isInView:!1});let o=!!(e||r||n);i.once&&s.current.hasEnteredView&&(o=!1),(typeof IntersectionObserver>"u"?Yee:Qee)(o,s.current,t,i)}const Kee={some:0,all:1};function Qee(t,e,r,{root:n,margin:i,amount:s="some",once:o}){k.useEffect(()=>{if(!t||!r.current)return;const a={root:n==null?void 0:n.current,rootMargin:i,threshold:typeof s=="number"?s:Kee[s]},c=l=>{const{isIntersecting:u}=l;if(e.isInView===u||(e.isInView=u,o&&!u&&e.hasEnteredView))return;u&&(e.hasEnteredView=!0),r.animationState&&r.animationState.setActive(bt.InView,u);const f=r.getProps(),d=u?f.onViewportEnter:f.onViewportLeave;d&&d(l)};return Vee(r.current,a,c)},[t,n,i,s])}function Yee(t,e,r,{fallback:n=!0}){k.useEffect(()=>{!t||!n||requestAnimationFrame(()=>{e.hasEnteredView=!0;const{onViewportEnter:i}=r.getProps();i&&i(null),r.animationState&&r.animationState.setActive(bt.InView,!0)})},[t])}const ec=t=>e=>(t(e),null),Jee={inView:ec(Gee),tap:ec(zee),focus:ec(Fee),hover:ec(jee)};function AN(){const t=k.useContext(X1);if(t===null)return[!0,null];const{isPresent:e,onExitComplete:r,register:n}=t,i=k.useId();return k.useEffect(()=>n(i),[]),!e&&r?[!1,()=>r&&r(i)]:[!0]}function _N(t,e){if(!Array.isArray(e))return!1;const r=e.length;if(r!==t.length)return!1;for(let n=0;n/^\-?\d*\.?\d+$/.test(t),Zee=t=>/^0[^.\s]+$/.test(t),Ho={delta:0,timestamp:0},PN=1/60*1e3,ete=typeof performance<"u"?()=>performance.now():()=>Date.now(),TN=typeof window<"u"?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(ete()),PN);function tte(t){let e=[],r=[],n=0,i=!1,s=!1;const o=new WeakSet,a={schedule:(c,l=!1,u=!1)=>{const f=u&&i,d=f?e:r;return l&&o.add(c),d.indexOf(c)===-1&&(d.push(c),f&&i&&(n=e.length)),c},cancel:c=>{const l=r.indexOf(c);l!==-1&&r.splice(l,1),o.delete(c)},process:c=>{if(i){s=!0;return}if(i=!0,[e,r]=[r,e],r.length=0,n=e.length,n)for(let l=0;l(t[e]=tte(()=>r1=!0),t),{}),kn=tp.reduce((t,e)=>{const r=ub[e];return t[e]=(n,i=!1,s=!1)=>(r1||ite(),r.schedule(n,i,s)),t},{}),Cc=tp.reduce((t,e)=>(t[e]=ub[e].cancel,t),{}),zw=tp.reduce((t,e)=>(t[e]=()=>ub[e].process(Ho),t),{}),nte=t=>ub[t].process(Ho),IN=t=>{r1=!1,Ho.delta=m6?PN:Math.max(Math.min(t-Ho.timestamp,rte),1),Ho.timestamp=t,y6=!0,tp.forEach(nte),y6=!1,r1&&(m6=!1,TN(IN))},ite=()=>{r1=!0,m6=!0,y6||TN(IN)};function hC(t,e){t.indexOf(e)===-1&&t.push(e)}function pC(t,e){const r=t.indexOf(e);r>-1&&t.splice(r,1)}class vC{constructor(){this.subscriptions=[]}add(e){return hC(this.subscriptions,e),()=>pC(this.subscriptions,e)}notify(e,r,n){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,r,n);else for(let s=0;s!isNaN(parseFloat(t));class ote{constructor(e,r={}){this.version="8.5.5",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(n,i=!0)=>{this.prev=this.current,this.current=n;const{delta:s,timestamp:o}=Ho;this.lastUpdated!==o&&(this.timeDelta=s,this.lastUpdated=o,kn.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>kn.postRender(this.velocityCheck),this.velocityCheck=({timestamp:n})=>{n!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=e,this.canTrackVelocity=ste(this.current),this.owner=r.owner}onChange(e){return this.on("change",e)}on(e,r){this.events[e]||(this.events[e]=new vC);const n=this.events[e].add(r);return e==="change"?()=>{n(),kn.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,r){this.passiveEffect=e,this.stopPassiveEffect=r}set(e,r=!0){!r||!this.passiveEffect?this.updateAndNotify(e,r):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,r,n){this.set(r),this.prev=e,this.timeDelta=n}jump(e){this.updateAndNotify(e),this.prev=e,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?mC(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=e(r)||null,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(){this.animation=null}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function id(t,e){return new ote(t,e)}const yC=(t,e)=>r=>!!(Z1(r)&&yee.test(r)&&r.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(r,e)),ON=(t,e,r)=>n=>{if(!Z1(n))return n;const[i,s,o,a]=n.match(t1);return{[t]:parseFloat(i),[e]:parseFloat(s),[r]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},ate=t=>nd(0,255,t),Ww={...yu,transform:t=>Math.round(ate(t))},Pl={test:yC("rgb","red"),parse:ON("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:n=1})=>"rgba("+Ww.transform(t)+", "+Ww.transform(e)+", "+Ww.transform(r)+", "+c0(a0.transform(n))+")"};function cte(t){let e="",r="",n="",i="";return t.length>5?(e=t.substring(1,3),r=t.substring(3,5),n=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),r=t.substring(2,3),n=t.substring(3,4),i=t.substring(4,5),e+=e,r+=r,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}const g6={test:yC("#"),parse:cte,transform:Pl.transform},mf={test:yC("hsl","hue"),parse:ON("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:n=1})=>"hsla("+Math.round(t)+", "+ho.transform(c0(e))+", "+ho.transform(c0(r))+", "+c0(a0.transform(n))+")"},Rn={test:t=>Pl.test(t)||g6.test(t)||mf.test(t),parse:t=>Pl.test(t)?Pl.parse(t):mf.test(t)?mf.parse(t):g6.parse(t),transform:t=>Z1(t)?t:t.hasOwnProperty("red")?Pl.transform(t):mf.transform(t)},RN="${c}",$N="${n}";function lte(t){var e,r;return isNaN(t)&&Z1(t)&&(((e=t.match(t1))===null||e===void 0?void 0:e.length)||0)+(((r=t.match(h6))===null||r===void 0?void 0:r.length)||0)>0}function gy(t){typeof t=="number"&&(t=`${t}`);const e=[];let r=0,n=0;const i=t.match(h6);i&&(r=i.length,t=t.replace(h6,RN),e.push(...i.map(Rn.parse)));const s=t.match(t1);return s&&(n=s.length,t=t.replace(t1,$N),e.push(...s.map(yu.parse))),{values:e,numColors:r,numNumbers:n,tokenised:t}}function MN(t){return gy(t).values}function NN(t){const{values:e,numColors:r,tokenised:n}=gy(t),i=e.length;return s=>{let o=n;for(let a=0;atypeof t=="number"?0:t;function fte(t){const e=MN(t);return NN(t)(e.map(ute))}const Sc={test:lte,parse:MN,createTransformer:NN,getAnimatableNone:fte},dte=new Set(["brightness","contrast","saturate","opacity"]);function hte(t){const[e,r]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[n]=r.match(t1)||[];if(!n)return t;const i=r.replace(n,"");let s=dte.has(e)?1:0;return n!==r&&(s*=100),e+"("+s+i+")"}const pte=/([a-z-]*)\(.*?\)/g,b6={...Sc,getAnimatableNone:t=>{const e=t.match(pte);return e?e.map(hte).join(" "):t}},vte={...fN,color:Rn,backgroundColor:Rn,outlineColor:Rn,fill:Rn,stroke:Rn,borderColor:Rn,borderTopColor:Rn,borderRightColor:Rn,borderBottomColor:Rn,borderLeftColor:Rn,filter:b6,WebkitFilter:b6},gC=t=>vte[t];function bC(t,e){var r;let n=gC(t);return n!==b6&&(n=Sc),(r=n.getAnimatableNone)===null||r===void 0?void 0:r.call(n,e)}const DN=t=>e=>e.test(t),mte={test:t=>t==="auto",parse:t=>t},LN=[yu,we,ho,Na,bee,gee,mte],bh=t=>LN.find(DN(t)),yte=[...LN,Rn,Sc],gte=t=>yte.find(DN(t));function bte(t){const e={};return t.values.forEach((r,n)=>e[n]=r.get()),e}function wte(t){const e={};return t.values.forEach((r,n)=>e[n]=r.getVelocity()),e}function fb(t,e,r){const n=t.getProps();return uC(n,e,r!==void 0?r:n.custom,bte(t),wte(t))}function xte(t,e,r){t.hasValue(e)?t.getValue(e).set(r):t.addValue(e,id(r))}function Ete(t,e){const r=fb(t,e);let{transitionEnd:n={},transition:i={},...s}=r?t.makeTargetAnimatable(r,!1):{};s={...s,...n};for(const o in s){const a=$ee(s[o]);xte(t,o,a)}}function Cte(t,e,r){var n,i;const s=Object.keys(e).filter(a=>!t.hasValue(a)),o=s.length;if(o)for(let a=0;at*1e3,Tte={current:!1},wC=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,xC=t=>e=>1-t(1-e),EC=t=>t*t,Ite=xC(EC),CC=wC(EC),yr=(t,e,r)=>-r*t+r*e+t;function Hw(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function Ote({hue:t,saturation:e,lightness:r,alpha:n}){t/=360,e/=100,r/=100;let i=0,s=0,o=0;if(!e)i=s=o=r;else{const a=r<.5?r*(1+e):r+e-r*e,c=2*r-a;i=Hw(c,a,t+1/3),s=Hw(c,a,t),o=Hw(c,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:n}}const qw=(t,e,r)=>{const n=t*t;return Math.sqrt(Math.max(0,r*(e*e-n)+n))},Rte=[g6,Pl,mf],$te=t=>Rte.find(e=>e.test(t));function qk(t){const e=$te(t);let r=e.parse(t);return e===mf&&(r=Ote(r)),r}const BN=(t,e)=>{const r=qk(t),n=qk(e),i={...r};return s=>(i.red=qw(r.red,n.red,s),i.green=qw(r.green,n.green,s),i.blue=qw(r.blue,n.blue,s),i.alpha=yr(r.alpha,n.alpha,s),Pl.transform(i))};function FN(t,e){return typeof t=="number"?r=>yr(t,e,r):Rn.test(t)?BN(t,e):UN(t,e)}const jN=(t,e)=>{const r=[...t],n=r.length,i=t.map((s,o)=>FN(s,e[o]));return s=>{for(let o=0;o{const r={...t,...e},n={};for(const i in r)t[i]!==void 0&&e[i]!==void 0&&(n[i]=FN(t[i],e[i]));return i=>{for(const s in n)r[s]=n[s](i);return r}},UN=(t,e)=>{const r=Sc.createTransformer(e),n=gy(t),i=gy(e);return n.numColors===i.numColors&&n.numNumbers>=i.numNumbers?lb(jN(n.values,i.values),r):o=>`${o>0?e:t}`},xy=(t,e,r)=>{const n=e-t;return n===0?1:(r-t)/n},Vk=(t,e)=>r=>yr(t,e,r);function Nte(t){return typeof t=="number"?Vk:typeof t=="string"?Rn.test(t)?BN:UN:Array.isArray(t)?jN:typeof t=="object"?Mte:Vk}function Dte(t,e,r){const n=[],i=r||Nte(t[0]),s=t.length-1;for(let o=0;ot[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const o=Dte(e,n,i),a=o.length,c=l=>{let u=0;if(a>1)for(;uc(nd(t[0],t[s-1],l)):c}const SC=t=>t,WN=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,Lte=1e-7,Bte=12;function Fte(t,e,r,n,i){let s,o,a=0;do o=e+(r-e)/2,s=WN(o,n,i)-t,s>0?r=o:e=o;while(Math.abs(s)>Lte&&++aFte(s,0,1,t,r);return s=>s===0||s===1?s:WN(i(s),e,n)}const qN=t=>1-Math.sin(Math.acos(t)),kC=xC(qN),jte=wC(kC),VN=HN(.33,1.53,.69,.99),AC=xC(VN),Ute=wC(AC),zte=t=>(t*=2)<1?.5*AC(t):.5*(2-Math.pow(2,-10*(t-1))),Wte={linear:SC,easeIn:EC,easeInOut:CC,easeOut:Ite,circIn:qN,circInOut:jte,circOut:kC,backIn:AC,backInOut:Ute,backOut:VN,anticipate:zte},Gk=t=>{if(Array.isArray(t)){wy(t.length===4);const[e,r,n,i]=t;return HN(e,r,n,i)}else if(typeof t=="string")return Wte[t];return t},Hte=t=>Array.isArray(t)&&typeof t[0]!="number";function qte(t,e){return t.map(()=>e||CC).splice(0,t.length-1)}function Vte(t){const e=t.length;return t.map((r,n)=>n!==0?n/(e-1):0)}function Gte(t,e){return t.map(r=>r*e)}function w6({keyframes:t,ease:e=CC,times:r,duration:n=300}){t=[...t];const i=Hte(e)?e.map(Gk):Gk(e),s={done:!1,value:t[0]},o=Gte(r&&r.length===t.length?r:Vte(t),n);function a(){return zN(o,t,{ease:Array.isArray(i)?i:qte(t,i)})}let c=a();return{next:l=>(s.value=c(l),s.done=l>=n,s),flipTarget:()=>{t.reverse(),c=a()}}}const Vw=.001,Kte=.01,Kk=10,Qte=.05,Yte=1;function Jte({duration:t=800,bounce:e=.25,velocity:r=0,mass:n=1}){let i,s;Pte(t<=Kk*1e3);let o=1-e;o=nd(Qte,Yte,o),t=nd(Kte,Kk,t/1e3),o<1?(i=l=>{const u=l*o,f=u*t,d=u-r,h=x6(l,o),p=Math.exp(-f);return Vw-d/h*p},s=l=>{const f=l*o*t,d=f*r+r,h=Math.pow(o,2)*Math.pow(l,2)*t,p=Math.exp(-f),v=x6(Math.pow(l,2),o);return(-i(l)+Vw>0?-1:1)*((d-h)*p)/v}):(i=l=>{const u=Math.exp(-l*t),f=(l-r)*t+1;return-Vw+u*f},s=l=>{const u=Math.exp(-l*t),f=(r-l)*(t*t);return u*f});const a=5/t,c=Zte(i,s,a);if(t=t*1e3,isNaN(c))return{stiffness:100,damping:10,duration:t};{const l=Math.pow(c,2)*n;return{stiffness:l,damping:o*2*Math.sqrt(n*l),duration:t}}}const Xte=12;function Zte(t,e,r){let n=r;for(let i=1;it[r]!==void 0)}function rre(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!Qk(t,tre)&&Qk(t,ere)){const r=Jte(t);e={...e,...r,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}const nre=5;function GN({keyframes:t,restDelta:e,restSpeed:r,...n}){let i=t[0],s=t[t.length-1];const o={done:!1,value:i},{stiffness:a,damping:c,mass:l,velocity:u,duration:f,isResolvedFromDuration:d}=rre(n);let h=ire,p=u?-(u/1e3):0;const v=c/(2*Math.sqrt(a*l));function m(){const g=s-i,y=Math.sqrt(a/l)/1e3,b=Math.abs(g)<5;if(r||(r=b?.01:2),e||(e=b?.005:.5),v<1){const C=x6(y,v);h=A=>{const O=Math.exp(-v*y*A);return s-O*((p+v*y*g)/C*Math.sin(C*A)+g*Math.cos(C*A))}}else if(v===1)h=C=>s-Math.exp(-y*C)*(g+(p+y*g)*C);else{const C=y*Math.sqrt(v*v-1);h=A=>{const O=Math.exp(-v*y*A),w=Math.min(C*A,300);return s-O*((p+v*y*g)*Math.sinh(w)+C*g*Math.cosh(w))/C}}}return m(),{next:g=>{const y=h(g);if(d)o.done=g>=f;else{let b=p;if(g!==0)if(v<1){const O=Math.max(0,g-nre);b=mC(y-h(O),g-O)}else b=0;const C=Math.abs(b)<=r,A=Math.abs(s-y)<=e;o.done=C&&A}return o.value=o.done?s:y,o},flipTarget:()=>{p=-p,[i,s]=[s,i],m()}}}GN.needsInterpolation=(t,e)=>typeof t=="string"||typeof e=="string";const ire=t=>0;function sre({keyframes:t=[0],velocity:e=0,power:r=.8,timeConstant:n=350,restDelta:i=.5,modifyTarget:s}){const o=t[0],a={done:!1,value:o};let c=r*e;const l=o+c,u=s===void 0?l:s(l);return u!==l&&(c=u-o),{next:f=>{const d=-c*Math.exp(-f/n);return a.done=!(d>i||d<-i),a.value=a.done?u:u+d,a},flipTarget:()=>{}}}const ore={decay:sre,keyframes:w6,tween:w6,spring:GN};function KN(t,e,r=0){return t-e-r}function are(t,e=0,r=0,n=!0){return n?KN(e+-t,e,r):e-(t-e)+r}function cre(t,e,r,n){return n?t>=e+r:t<=-r}const lre=t=>{const e=({delta:r})=>t(r);return{start:()=>kn.update(e,!0),stop:()=>Cc.update(e)}};function Ey({duration:t,driver:e=lre,elapsed:r=0,repeat:n=0,repeatType:i="loop",repeatDelay:s=0,keyframes:o,autoplay:a=!0,onPlay:c,onStop:l,onComplete:u,onRepeat:f,onUpdate:d,type:h="keyframes",...p}){var v,m;const g=r;let y,b=0,C=t,A=!1,O=!0,w;const I=ore[o.length>2?"keyframes":h]||w6,B=o[0],z=o[o.length-1];let H={done:!1,value:B};!((m=(v=I).needsInterpolation)===null||m===void 0)&&m.call(v,B,z)&&(w=zN([0,100],[B,z],{clamp:!1}),o=[0,100]);const K=I({...p,duration:t,keyframes:o});function F(){b++,i==="reverse"?(O=b%2===0,r=are(r,C,s,O)):(r=KN(r,C,s),i==="mirror"&&K.flipTarget()),A=!1,f&&f()}function x(){y&&y.stop(),u&&u()}function P(D){O||(D=-D),r+=D,A||(H=K.next(Math.max(0,r)),w&&(H.value=w(H.value)),A=O?H.done:r<=0),d&&d(H.value),A&&(b===0&&(C=C!==void 0?C:r),b{l&&l(),y&&y.stop()},set currentTime(D){r=g,P(D)},sample:D=>{r=g;const _=t&&typeof t=="number"?Math.max(t*.5,50):50;let N=0;for(P(0);N<=D;){const L=D-N;P(Math.min(L,_)),N+=_}return H}}}function ure(t){return!t||Array.isArray(t)||typeof t=="string"&&QN[t]}const Bh=([t,e,r,n])=>`cubic-bezier(${t}, ${e}, ${r}, ${n})`,QN={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Bh([0,.65,.55,1]),circOut:Bh([.55,0,1,.45]),backIn:Bh([.31,.01,.66,-.59]),backOut:Bh([.33,1.53,.69,.99])};function fre(t){if(t)return Array.isArray(t)?Bh(t):QN[t]}function dre(t,e,r,{delay:n=0,duration:i,repeat:s=0,repeatType:o="loop",ease:a,times:c}={}){return t.animate({[e]:r,offset:c},{delay:n,duration:i,easing:fre(a),fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}const Yk={waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate")},Gw={},YN={};for(const t in Yk)YN[t]=()=>(Gw[t]===void 0&&(Gw[t]=Yk[t]()),Gw[t]);function hre(t,{repeat:e,repeatType:r="loop"}){const n=e&&r!=="loop"&&e%2===1?0:t.length-1;return t[n]}const pre=new Set(["opacity"]),cv=10;function vre(t,e,{onUpdate:r,onComplete:n,...i}){if(!(YN.waapi()&&pre.has(e)&&!i.repeatDelay&&i.repeatType!=="mirror"&&i.damping!==0))return!1;let{keyframes:o,duration:a=300,elapsed:c=0,ease:l}=i;if(i.type==="spring"||!ure(i.ease)){if(i.repeat===1/0)return;const f=Ey({...i,elapsed:0});let d={done:!1,value:o[0]};const h=[];let p=0;for(;!d.done&&p<2e4;)d=f.sample(p),h.push(d.value),p+=cv;o=h,a=p-cv,l="linear"}const u=dre(t.owner.current,e,o,{...i,delay:-c,duration:a,ease:l});return u.onfinish=()=>{t.set(hre(o,i)),kn.update(()=>u.cancel()),n&&n()},{get currentTime(){return u.currentTime||0},set currentTime(f){u.currentTime=f},stop:()=>{const{currentTime:f}=u;if(f){const d=Ey({...i,autoplay:!1});t.setWithVelocity(d.sample(f-cv).value,d.sample(f).value,cv)}kn.update(()=>u.cancel())}}}function JN(t,e){const r=performance.now(),n=({timestamp:i})=>{const s=i-r;s>=e&&(Cc.read(n),t(s-e))};return kn.read(n,!0),()=>Cc.read(n)}function mre({keyframes:t,elapsed:e,onUpdate:r,onComplete:n}){const i=()=>{r&&r(t[t.length-1]),n&&n()};return e?{stop:JN(i,-e)}:i()}function yre({keyframes:t,velocity:e=0,min:r,max:n,power:i=.8,timeConstant:s=750,bounceStiffness:o=500,bounceDamping:a=10,restDelta:c=1,modifyTarget:l,driver:u,onUpdate:f,onComplete:d,onStop:h}){const p=t[0];let v;function m(C){return r!==void 0&&Cn}function g(C){return r===void 0?n:n===void 0||Math.abs(r-C){var O;f==null||f(A),(O=C.onUpdate)===null||O===void 0||O.call(C,A)},onComplete:d,onStop:h})}function b(C){y({type:"spring",stiffness:o,damping:a,restDelta:c,...C})}if(m(p))b({velocity:e,keyframes:[p,g(p)]});else{let C=i*e+p;typeof l<"u"&&(C=l(C));const A=g(C),O=A===r?-1:1;let w,I;const B=z=>{w=I,I=z,e=mC(z-w,Ho.delta),(O===1&&z>A||O===-1&&zv==null?void 0:v.stop()}}const cl=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),lv=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Kw=()=>({type:"keyframes",ease:"linear",duration:.3}),gre={type:"keyframes",duration:.8},Jk={x:cl,y:cl,z:cl,rotate:cl,rotateX:cl,rotateY:cl,rotateZ:cl,scaleX:lv,scaleY:lv,scale:lv,opacity:Kw,backgroundColor:Kw,color:Kw,default:lv},bre=(t,{keyframes:e})=>e.length>2?gre:(Jk[t]||Jk.default)(e[1]),E6=(t,e)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&Sc.test(e)&&!e.startsWith("url("));function wre({when:t,delay:e,delayChildren:r,staggerChildren:n,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:c,elapsed:l,...u}){return!!Object.keys(u).length}function Xk(t){return t===0||typeof t=="string"&&parseFloat(t)===0&&t.indexOf(" ")===-1}function Zk(t){return typeof t=="number"?0:bC("",t)}function XN(t,e){return t[e]||t.default||t}function xre(t,e,r,n){const i=E6(e,r);let s=n.from!==void 0?n.from:t.get();return s==="none"&&i&&typeof r=="string"?s=bC(e,r):Xk(s)&&typeof r=="string"?s=Zk(r):!Array.isArray(r)&&Xk(r)&&typeof s=="string"&&(r=Zk(s)),Array.isArray(r)?(r[0]===null&&(r[0]=s),r):[s,r]}const _C=(t,e,r,n={})=>i=>{const s=XN(n,t)||{},o=s.delay||n.delay||0;let{elapsed:a=0}=n;a=a-im(o);const c=xre(e,t,r,s),l=c[0],u=c[c.length-1],f=E6(t,l),d=E6(t,u);let h={keyframes:c,velocity:e.getVelocity(),...s,elapsed:a,onUpdate:m=>{e.set(m),s.onUpdate&&s.onUpdate(m)},onComplete:()=>{i(),s.onComplete&&s.onComplete()}};if(!f||!d||Tte.current||s.type===!1)return mre(h);if(s.type==="inertia")return yre(h);wre(s)||(h={...h,...bre(t,h)}),h.duration&&(h.duration=im(h.duration)),h.repeatDelay&&(h.repeatDelay=im(h.repeatDelay));const p=e.owner,v=p&&p.current;if(p&&v instanceof HTMLElement&&!(p!=null&&p.getProps().onUpdate)){const m=vre(e,t,h);if(m)return m}return Ey(h)};function Ere(t,e,r={}){t.notify("AnimationStart",e);let n;if(Array.isArray(e)){const i=e.map(s=>C6(t,s,r));n=Promise.all(i)}else if(typeof e=="string")n=C6(t,e,r);else{const i=typeof e=="function"?fb(t,e,r.custom):e;n=ZN(t,i,r)}return n.then(()=>t.notify("AnimationComplete",e))}function C6(t,e,r={}){var n;const i=fb(t,e,r.custom);let{transition:s=t.getDefaultTransition()||{}}=i||{};r.transitionOverride&&(s=r.transitionOverride);const o=i?()=>ZN(t,i,r):()=>Promise.resolve(),a=!((n=t.variantChildren)===null||n===void 0)&&n.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:d}=s;return Cre(t,e,u+l,f,d,r)}:()=>Promise.resolve(),{when:c}=s;if(c){const[l,u]=c==="beforeChildren"?[o,a]:[a,o];return l().then(u)}else return Promise.all([o(),a(r.delay)])}function ZN(t,e,{delay:r=0,transitionOverride:n,type:i}={}){var s;let{transition:o=t.getDefaultTransition(),transitionEnd:a,...c}=t.makeTargetAnimatable(e);const l=t.getValue("willChange");n&&(o=n);const u=[],f=i&&((s=t.animationState)===null||s===void 0?void 0:s.getState()[i]);for(const d in c){const h=t.getValue(d),p=c[d];if(!h||p===void 0||f&&kre(f,d))continue;const v={delay:r,elapsed:0,...o};if(window.HandoffAppearAnimations&&!h.hasAnimated){const g=t.getProps()[_te];g&&(v.elapsed=window.HandoffAppearAnimations(g,d,h,kn))}let m=h.start(_C(d,h,p,t.shouldReduceMotion&&Id.has(d)?{type:!1}:v));by(l)&&(l.add(d),m=m.then(()=>l.remove(d))),u.push(m)}return Promise.all(u).then(()=>{a&&Ete(t,a)})}function Cre(t,e,r=0,n=0,i=1,s){const o=[],a=(t.variantChildren.size-1)*n,c=i===1?(l=0)=>l*n:(l=0)=>a-l*n;return Array.from(t.variantChildren).sort(Sre).forEach((l,u)=>{l.notify("AnimationStart",e),o.push(C6(l,e,{...s,delay:r+c(u)}).then(()=>l.notify("AnimationComplete",e)))}),Promise.all(o)}function Sre(t,e){return t.sortNodePosition(e)}function kre({protectedKeys:t,needsAnimating:e},r){const n=t.hasOwnProperty(r)&&e[r]!==!0;return e[r]=!1,n}const PC=[bt.Animate,bt.InView,bt.Focus,bt.Hover,bt.Tap,bt.Drag,bt.Exit],Are=[...PC].reverse(),_re=PC.length;function Pre(t){return e=>Promise.all(e.map(({animation:r,options:n})=>Ere(t,r,n)))}function Tre(t){let e=Pre(t);const r=Ore();let n=!0;const i=(c,l)=>{const u=fb(t,l);if(u){const{transition:f,transitionEnd:d,...h}=u;c={...c,...h,...d}}return c};function s(c){e=c(t)}function o(c,l){const u=t.getProps(),f=t.getVariantContext(!0)||{},d=[],h=new Set;let p={},v=1/0;for(let g=0;g<_re;g++){const y=Are[g],b=r[y],C=u[y]!==void 0?u[y]:f[y],A=Z0(C),O=y===l?b.isActive:null;O===!1&&(v=g);let w=C===f[y]&&C!==u[y]&&A;if(w&&n&&t.manuallyAnimateOnMount&&(w=!1),b.protectedKeys={...p},!b.isActive&&O===null||!C&&!b.prevProp||sb(C)||typeof C=="boolean")continue;const I=Ire(b.prevProp,C);let B=I||y===l&&b.isActive&&!w&&A||g>v&&A;const z=Array.isArray(C)?C:[C];let H=z.reduce(i,{});O===!1&&(H={});const{prevResolvedValues:K={}}=b,F={...K,...H},x=P=>{B=!0,h.delete(P),b.needsAnimating[P]=!0};for(const P in F){const $=H[P],D=K[P];p.hasOwnProperty(P)||($!==D?my($)&&my(D)?!_N($,D)||I?x(P):b.protectedKeys[P]=!0:$!==void 0?x(P):h.add(P):$!==void 0&&h.has(P)?x(P):b.protectedKeys[P]=!0)}b.prevProp=C,b.prevResolvedValues=H,b.isActive&&(p={...p,...H}),n&&t.blockInitialAnimation&&(B=!1),B&&!w&&d.push(...z.map(P=>({animation:P,options:{type:y,...c}})))}if(h.size){const g={};h.forEach(y=>{const b=t.getBaseTarget(y);b!==void 0&&(g[y]=b)}),d.push({animation:g})}let m=!!d.length;return n&&u.initial===!1&&!t.manuallyAnimateOnMount&&(m=!1),n=!1,m?e(d):Promise.resolve()}function a(c,l,u){var f;if(r[c].isActive===l)return Promise.resolve();(f=t.variantChildren)===null||f===void 0||f.forEach(h=>{var p;return(p=h.animationState)===null||p===void 0?void 0:p.setActive(c,l)}),r[c].isActive=l;const d=o(u,c);for(const h in r)r[h].protectedKeys={};return d}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>r}}function Ire(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!_N(e,t):!1}function ll(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ore(){return{[bt.Animate]:ll(!0),[bt.InView]:ll(),[bt.Hover]:ll(),[bt.Tap]:ll(),[bt.Drag]:ll(),[bt.Focus]:ll(),[bt.Exit]:ll()}}const Rre={animation:ec(({visualElement:t,animate:e})=>{t.animationState||(t.animationState=Tre(t)),sb(e)&&k.useEffect(()=>e.subscribe(t),[e])}),exit:ec(t=>{const{custom:e,visualElement:r}=t,[n,i]=AN(),s=k.useContext(X1);k.useEffect(()=>{r.isPresent=n;const o=r.animationState&&r.animationState.setActive(bt.Exit,!n,{custom:s&&s.custom||e});o&&!n&&o.then(i)},[n])})},eA=(t,e)=>Math.abs(t-e);function $re(t,e){const r=eA(t.x,e.x),n=eA(t.y,e.y);return Math.sqrt(r**2+n**2)}class eD{constructor(e,r,{transformPagePoint:n}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const l=Yw(this.lastMoveEventInfo,this.history),u=this.startEvent!==null,f=$re(l.offset,{x:0,y:0})>=3;if(!u&&!f)return;const{point:d}=l,{timestamp:h}=Ho;this.history.push({...d,timestamp:h});const{onStart:p,onMove:v}=this.handlers;u||(p&&p(this.lastMoveEvent,l),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,l)},this.handlePointerMove=(l,u)=>{this.lastMoveEvent=l,this.lastMoveEventInfo=Qw(u,this.transformPagePoint),kn.update(this.updatePoint,!0)},this.handlePointerUp=(l,u)=>{if(this.end(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const{onEnd:f,onSessionEnd:d}=this.handlers,h=Yw(l.type==="pointercancel"?this.lastMoveEventInfo:Qw(u,this.transformPagePoint),this.history);this.startEvent&&f&&f(l,h),d&&d(l,h)},!wN(e))return;this.handlers=r,this.transformPagePoint=n;const i=fC(e),s=Qw(i,this.transformPagePoint),{point:o}=s,{timestamp:a}=Ho;this.history=[{...o,timestamp:a}];const{onSessionStart:c}=r;c&&c(e,Yw(s,this.history)),this.removeListeners=lb(Rf(window,"pointermove",this.handlePointerMove),Rf(window,"pointerup",this.handlePointerUp),Rf(window,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Cc.update(this.updatePoint)}}function Qw(t,e){return e?{point:e(t.point)}:t}function tA(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Yw({point:t},e){return{point:t,delta:tA(t,tD(e)),offset:tA(t,Mre(e)),velocity:Nre(e,.1)}}function Mre(t){return t[0]}function tD(t){return t[t.length-1]}function Nre(t,e){if(t.length<2)return{x:0,y:0};let r=t.length-1,n=null;const i=tD(t);for(;r>=0&&(n=t[r],!(i.timestamp-n.timestamp>im(e)));)r--;if(!n)return{x:0,y:0};const s=(i.timestamp-n.timestamp)/1e3;if(s===0)return{x:0,y:0};const o={x:(i.x-n.x)/s,y:(i.y-n.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Si(t){return t.max-t.min}function S6(t,e=0,r=.01){return Math.abs(t-e)<=r}function rA(t,e,r,n=.5){t.origin=n,t.originPoint=yr(e.min,e.max,t.origin),t.scale=Si(r)/Si(e),(S6(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=yr(r.min,r.max,t.origin)-t.originPoint,(S6(t.translate)||isNaN(t.translate))&&(t.translate=0)}function l0(t,e,r,n){rA(t.x,e.x,r.x,n==null?void 0:n.originX),rA(t.y,e.y,r.y,n==null?void 0:n.originY)}function nA(t,e,r){t.min=r.min+e.min,t.max=t.min+Si(e)}function Dre(t,e,r){nA(t.x,e.x,r.x),nA(t.y,e.y,r.y)}function iA(t,e,r){t.min=e.min-r.min,t.max=t.min+Si(e)}function u0(t,e,r){iA(t.x,e.x,r.x),iA(t.y,e.y,r.y)}function Lre(t,{min:e,max:r},n){return e!==void 0&&tr&&(t=n?yr(r,t,n.max):Math.min(t,r)),t}function sA(t,e,r){return{min:e!==void 0?t.min+e:void 0,max:r!==void 0?t.max+r-(t.max-t.min):void 0}}function Bre(t,{top:e,left:r,bottom:n,right:i}){return{x:sA(t.x,r,i),y:sA(t.y,e,n)}}function oA(t,e){let r=e.min-t.min,n=e.max-t.max;return e.max-e.minn?r=xy(e.min,e.max-n,t.min):n>i&&(r=xy(t.min,t.max-i,e.min)),nd(0,1,r)}function Ure(t,e){const r={};return e.min!==void 0&&(r.min=e.min-t.min),e.max!==void 0&&(r.max=e.max-t.min),r}const k6=.35;function zre(t=k6){return t===!1?t=0:t===!0&&(t=k6),{x:aA(t,"left","right"),y:aA(t,"top","bottom")}}function aA(t,e,r){return{min:cA(t,e),max:cA(t,r)}}function cA(t,e){return typeof t=="number"?t:t[e]||0}const lA=()=>({translate:0,scale:1,origin:0,originPoint:0}),f0=()=>({x:lA(),y:lA()}),uA=()=>({min:0,max:0}),Nr=()=>({x:uA(),y:uA()});function Vs(t){return[t("x"),t("y")]}function rD({top:t,left:e,right:r,bottom:n}){return{x:{min:e,max:r},y:{min:t,max:n}}}function Wre({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Hre(t,e){if(!e)return t;const r=e({x:t.left,y:t.top}),n=e({x:t.right,y:t.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}function Jw(t){return t===void 0||t===1}function A6({scale:t,scaleX:e,scaleY:r}){return!Jw(t)||!Jw(e)||!Jw(r)}function vl(t){return A6(t)||nD(t)||t.z||t.rotate||t.rotateX||t.rotateY}function nD(t){return fA(t.x)||fA(t.y)}function fA(t){return t&&t!=="0%"}function Cy(t,e,r){const n=t-r,i=e*n;return r+i}function dA(t,e,r,n,i){return i!==void 0&&(t=Cy(t,i,n)),Cy(t,r,n)+e}function _6(t,e=0,r=1,n,i){t.min=dA(t.min,e,r,n,i),t.max=dA(t.max,e,r,n,i)}function iD(t,{x:e,y:r}){_6(t.x,e.translate,e.scale,e.originPoint),_6(t.y,r.translate,r.scale,r.originPoint)}function qre(t,e,r,n=!1){var i,s;const o=r.length;if(!o)return;e.x=e.y=1;let a,c;for(let l=0;l1.0000000000001||t<.999999999999?t:1}function za(t,e){t.min=t.min+e,t.max=t.max+e}function pA(t,e,[r,n,i]){const s=e[i]!==void 0?e[i]:.5,o=yr(t.min,t.max,s);_6(t,e[r],e[n],o,e.scale)}const Vre=["x","scaleX","originX"],Gre=["y","scaleY","originY"];function yf(t,e){pA(t.x,e,Vre),pA(t.y,e,Gre)}function sD(t,e){return rD(Hre(t.getBoundingClientRect(),e))}function Kre(t,e,r){const n=sD(t,r),{scroll:i}=e;return i&&(za(n.x,i.offset.x),za(n.y,i.offset.y)),n}const Qre=new WeakMap;class Yre{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Nr(),this.visualElement=e}start(e,{snapToCursor:r=!1}={}){if(this.visualElement.isPresent===!1)return;const n=a=>{this.stopAnimation(),r&&this.snapToCursor(fC(a,"page").point)},i=(a,c)=>{var l;const{drag:u,dragPropagation:f,onDragStart:d}=this.getProps();u&&!f&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=CN(u),!this.openGlobalLock)||(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Vs(h=>{var p,v;let m=this.getAxisMotionValue(h).get()||0;if(ho.test(m)){const g=(v=(p=this.visualElement.projection)===null||p===void 0?void 0:p.layout)===null||v===void 0?void 0:v.layoutBox[h];g&&(m=Si(g)*(parseFloat(m)/100))}this.originPoint[h]=m}),d==null||d(a,c),(l=this.visualElement.animationState)===null||l===void 0||l.setActive(bt.Drag,!0))},s=(a,c)=>{const{dragPropagation:l,dragDirectionLock:u,onDirectionLock:f,onDrag:d}=this.getProps();if(!l&&!this.openGlobalLock)return;const{offset:h}=c;if(u&&this.currentDirection===null){this.currentDirection=Jre(h),this.currentDirection!==null&&(f==null||f(this.currentDirection));return}this.updateAxis("x",c.point,h),this.updateAxis("y",c.point,h),this.visualElement.render(),d==null||d(a,c)},o=(a,c)=>this.stop(a,c);this.panSession=new eD(e,{onSessionStart:n,onStart:i,onMove:s,onSessionEnd:o},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(e,r){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:i}=r;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s==null||s(e,r)}cancel(){var e,r;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),(e=this.panSession)===null||e===void 0||e.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),(r=this.visualElement.animationState)===null||r===void 0||r.setActive(bt.Drag,!1)}updateAxis(e,r,n){const{drag:i}=this.getProps();if(!n||!uv(e,i,this.currentDirection))return;const s=this.getAxisMotionValue(e);let o=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(o=Lre(o,this.constraints[e],this.elastic[e])),s.set(o)}resolveConstraints(){const{dragConstraints:e,dragElastic:r}=this.getProps(),{layout:n}=this.visualElement.projection||{},i=this.constraints;e&&vf(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&n?this.constraints=Bre(n.layoutBox,e):this.constraints=!1,this.elastic=zre(r),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Vs(s=>{this.getAxisMotionValue(s)&&(this.constraints[s]=Ure(n.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:r}=this.getProps();if(!e||!vf(e))return!1;const n=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=Kre(n,i.root,this.visualElement.getTransformPagePoint());let o=Fre(i.layout.layoutBox,s);if(r){const a=r(Wre(o));this.hasMutatedConstraints=!!a,a&&(o=rD(a))}return o}startAnimation(e){const{drag:r,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=Vs(u=>{if(!uv(u,r,this.currentDirection))return;let f=(c==null?void 0:c[u])||{};o&&(f={min:0,max:0});const d=i?200:1e6,h=i?40:1e7,p={type:"inertia",velocity:n?e[u]:0,bounceStiffness:d,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(u,p)});return Promise.all(l).then(a)}startAxisValueAnimation(e,r){const n=this.getAxisMotionValue(e);return n.start(_C(e,n,0,r))}stopAnimation(){Vs(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){var r;const n="_drag"+e.toUpperCase(),i=this.visualElement.getProps()[n];return i||this.visualElement.getValue(e,((r=this.visualElement.getProps().initial)===null||r===void 0?void 0:r[e])||0)}snapToCursor(e){Vs(r=>{const{drag:n}=this.getProps();if(!uv(r,n,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(r);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[r];s.set(e[r]-yr(o,a,.5))}})}scalePositionWithinConstraints(){var e;if(!this.visualElement.current)return;const{drag:r,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!vf(n)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Vs(a=>{const c=this.getAxisMotionValue(a);if(c){const l=c.get();s[a]=jre({min:l,max:l},this.constraints[a])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",(e=i.root)===null||e===void 0||e.updateScroll(),i.updateLayout(),this.resolveConstraints(),Vs(a=>{if(!uv(a,r,null))return;const c=this.getAxisMotionValue(a),{min:l,max:u}=this.constraints[a];c.set(yr(l,u,s[a]))})}addListeners(){var e;if(!this.visualElement.current)return;Qre.set(this.visualElement,this);const r=this.visualElement.current,n=Rf(r,"pointerdown",l=>{const{drag:u,dragListener:f=!0}=this.getProps();u&&f&&this.start(l)}),i=()=>{const{dragConstraints:l}=this.getProps();vf(l)&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,o=s.addEventListener("measure",i);s&&!s.layout&&((e=s.root)===null||e===void 0||e.updateScroll(),s.updateLayout()),i();const a=cb(window,"resize",()=>this.scalePositionWithinConstraints()),c=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Vs(f=>{const d=this.getAxisMotionValue(f);d&&(this.originPoint[f]+=l[f].translate,d.set(d.get()+l[f].translate))}),this.visualElement.render())});return()=>{a(),n(),o(),c==null||c()}}getProps(){const e=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=k6,dragMomentum:a=!0}=e;return{...e,drag:r,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function uv(t,e,r){return(e===!0||e===t)&&(r===null||r===t)}function Jre(t,e=10){let r=null;return Math.abs(t.y)>e?r="y":Math.abs(t.x)>e&&(r="x"),r}function Xre(t){const{dragControls:e,visualElement:r}=t,n=ab(()=>new Yre(r));k.useEffect(()=>e&&e.subscribe(n),[n,e]),k.useEffect(()=>n.addListeners(),[n])}function Zre({onPan:t,onPanStart:e,onPanEnd:r,onPanSessionStart:n,visualElement:i}){const s=t||e||r||n,o=k.useRef(null),{transformPagePoint:a}=k.useContext(tC),c={onSessionStart:n,onStart:e,onMove:t,onEnd:(u,f)=>{o.current=null,r&&r(u,f)}};k.useEffect(()=>{o.current!==null&&o.current.updateHandlers(c)});function l(u){o.current=new eD(u,c,{transformPagePoint:a})}yy(i,"pointerdown",s&&l),dC(()=>o.current&&o.current.end())}const ene={pan:ec(Zre),drag:ec(Xre)};function P6(t){return typeof t=="string"&&t.startsWith("var(--")}const oD=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function tne(t){const e=oD.exec(t);if(!e)return[,];const[,r,n]=e;return[r,n]}function T6(t,e,r=1){const[n,i]=tne(t);if(!n)return;const s=window.getComputedStyle(e).getPropertyValue(n);return s?s.trim():P6(i)?T6(i,e,r+1):i}function rne(t,{...e},r){const n=t.current;if(!(n instanceof Element))return{target:e,transitionEnd:r};r&&(r={...r}),t.values.forEach(i=>{const s=i.get();if(!P6(s))return;const o=T6(s,n);o&&i.set(o)});for(const i in e){const s=e[i];if(!P6(s))continue;const o=T6(s,n);o&&(e[i]=o,r&&r[i]===void 0&&(r[i]=s))}return{target:e,transitionEnd:r}}const nne=new Set(["width","height","top","left","right","bottom","x","y"]),aD=t=>nne.has(t),ine=t=>Object.keys(t).some(aD),vA=t=>t===yu||t===we;var mA;(function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"})(mA||(mA={}));const yA=(t,e)=>parseFloat(t.split(", ")[e]),gA=(t,e)=>(r,{transform:n})=>{if(n==="none"||!n)return 0;const i=n.match(/^matrix3d\((.+)\)$/);if(i)return yA(i[1],e);{const s=n.match(/^matrix\((.+)\)$/);return s?yA(s[1],t):0}},sne=new Set(["x","y","z"]),one=py.filter(t=>!sne.has(t));function ane(t){const e=[];return one.forEach(r=>{const n=t.getValue(r);n!==void 0&&(e.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),e.length&&t.render(),e}const bA={width:({x:t},{paddingLeft:e="0",paddingRight:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),height:({y:t},{paddingTop:e="0",paddingBottom:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:gA(4,13),y:gA(5,14)},cne=(t,e,r)=>{const n=e.measureViewportBox(),i=e.current,s=getComputedStyle(i),{display:o}=s,a={};o==="none"&&e.setStaticValue("display",t.display||"block"),r.forEach(l=>{a[l]=bA[l](n,s)}),e.render();const c=e.measureViewportBox();return r.forEach(l=>{const u=e.getValue(l);u&&u.jump(a[l]),t[l]=bA[l](c,s)}),t},lne=(t,e,r={},n={})=>{e={...e},n={...n};const i=Object.keys(e).filter(aD);let s=[],o=!1;const a=[];if(i.forEach(c=>{const l=t.getValue(c);if(!t.hasValue(c))return;let u=r[c],f=bh(u);const d=e[c];let h;if(my(d)){const p=d.length,v=d[0]===null?1:0;u=d[v],f=bh(u);for(let m=v;m=0?window.pageYOffset:null,l=cne(e,t,a);return s.length&&s.forEach(([u,f])=>{t.getValue(u).set(f)}),t.render(),ib&&c!==null&&window.scrollTo({top:c}),{target:l,transitionEnd:n}}else return{target:e,transitionEnd:n}};function une(t,e,r,n){return ine(e)?lne(t,e,r,n):{target:e,transitionEnd:n}}const fne=(t,e,r,n)=>{const i=rne(t,e,n);return e=i.target,n=i.transitionEnd,une(t,e,r,n)},I6={current:null},cD={current:!1};function dne(){if(cD.current=!0,!!ib)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>I6.current=t.matches;t.addListener(e),e()}else I6.current=!1}function hne(t,e,r){const{willChange:n}=e;for(const i in e){const s=e[i],o=r[i];if(ai(s))t.addValue(i,s),by(n)&&n.add(i);else if(ai(o))t.addValue(i,id(s,{owner:t})),by(n)&&n.remove(i);else if(o!==s)if(t.hasValue(i)){const a=t.getValue(i);!a.hasAnimated&&a.set(s)}else{const a=t.getStaticValue(i);t.addValue(i,id(a!==void 0?a:s,{owner:t}))}}for(const i in r)e[i]===void 0&&t.removeValue(i);return e}const lD=Object.keys(e1),pne=lD.length,wA=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class vne{constructor({parent:e,props:r,reducedMotionConfig:n,visualState:i},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,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.scheduleRender=()=>kn.render(this.render,!1,!0);const{latestValues:o,renderState:a}=i;this.latestValues=o,this.baseTarget={...o},this.initialValues=r.initial?{...o}:{},this.renderState=a,this.parent=e,this.props=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=n,this.options=s,this.isControllingVariants=ob(r),this.isVariantNode=aN(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:c,...l}=this.scrapeMotionValuesFromProps(r,{});for(const u in l){const f=l[u];o[u]!==void 0&&ai(f)&&(f.set(o[u],!1),by(c)&&c.add(u))}}scrapeMotionValuesFromProps(e,r){return{}}mount(e){var r;this.current=e,this.projection&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=(r=this.parent)===null||r===void 0?void 0:r.addVariantChild(this)),this.values.forEach((n,i)=>this.bindToMotionValue(i,n)),cD.current||dne(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:I6.current,this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var e,r,n;(e=this.projection)===null||e===void 0||e.unmount(),Cc.update(this.notifyUpdate),Cc.render(this.render),this.valueSubscriptions.forEach(i=>i()),(r=this.removeFromVariantTree)===null||r===void 0||r.call(this),(n=this.parent)===null||n===void 0||n.children.delete(this);for(const i in this.events)this.events[i].clear();this.current=null}bindToMotionValue(e,r){const n=Id.has(e),i=r.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&kn.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),s=r.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,()=>{i(),s()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}loadFeatures({children:e,...r},n,i,s,o,a){const c=[];for(let l=0;lthis.scheduleRender(),animationType:typeof u=="string"?u:"both",initialPromotionConfig:a,layoutScroll:h,layoutRoot:p})}return c}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Nr()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,r){this.latestValues[e]=r}makeTargetAnimatable(e,r=!0){return this.makeTargetAnimatableFromInstance(e,this.props,r)}setProps(e){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender();const r=this.props;this.props=e;for(let n=0;nn.variantChildren.delete(e)}addValue(e,r){r!==this.values.get(e)&&(this.removeValue(e),this.bindToMotionValue(e,r)),this.values.set(e,r),this.latestValues[e]=r.get()}removeValue(e){var r;this.values.delete(e),(r=this.valueSubscriptions.get(e))===null||r===void 0||r(),this.valueSubscriptions.delete(e),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,r){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&r!==void 0&&(n=id(r,{owner:this}),this.addValue(e,n)),n}readValue(e){return this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.readValueFromInstance(this.current,e,this.options)}setBaseTarget(e,r){this.baseTarget[e]=r}getBaseTarget(e){var r;const{initial:n}=this.props,i=typeof n=="string"||typeof n=="object"?(r=uC(this.props,n))===null||r===void 0?void 0:r[e]:void 0;if(n&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!ai(s)?s:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,r){return this.events[e]||(this.events[e]=new vC),this.events[e].add(r)}notify(e,...r){var n;(n=this.events[e])===null||n===void 0||n.notify(...r)}}const uD=["initial",...PC],mne=uD.length;class fD extends vne{sortInstanceNodePosition(e,r){return e.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(e,r){var n;return(n=e.style)===null||n===void 0?void 0:n[r]}removeValueFromRenderState(e,{vars:r,style:n}){delete r[e],delete n[e]}makeTargetAnimatableFromInstance({transition:e,transitionEnd:r,...n},{transformValues:i},s){let o=kte(n,e||{},this);if(i&&(r&&(r=i(r)),n&&(n=i(n)),o&&(o=i(o))),s){Cte(this,n,o);const a=fne(this,n,o,r);r=a.transitionEnd,n=a.target}return{transition:e,transitionEnd:r,...n}}}function yne(t){return window.getComputedStyle(t)}class gne extends fD{readValueFromInstance(e,r){if(Id.has(r)){const n=gC(r);return n&&n.default||0}else{const n=yne(e),i=(uN(r)?n.getPropertyValue(r):n[r])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:r}){return sD(e,r)}build(e,r,n,i){iC(e,r,n,i.transformTemplate)}scrapeMotionValuesFromProps(e,r){return lC(e,r)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;ai(e)&&(this.childSubscription=e.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}renderInstance(e,r,n,i){vN(e,r,n,i)}}class bne extends fD{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(e,r){return e[r]}readValueFromInstance(e,r){var n;return Id.has(r)?((n=gC(r))===null||n===void 0?void 0:n.default)||0:(r=mN.has(r)?r:cC(r),e.getAttribute(r))}measureInstanceViewportBox(){return Nr()}scrapeMotionValuesFromProps(e,r){return gN(e,r)}build(e,r,n,i){oC(e,r,n,this.isSVGTag,i.transformTemplate)}renderInstance(e,r,n,i){yN(e,r,n,i)}mount(e){this.isSVGTag=aC(e.tagName),super.mount(e)}}const wne=(t,e)=>nC(t)?new bne(e,{enableHardwareAcceleration:!1}):new gne(e,{enableHardwareAcceleration:!0});function xA(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const wh={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(we.test(t))t=parseFloat(t);else return t;const r=xA(t,e.target.x),n=xA(t,e.target.y);return`${r}% ${n}%`}},EA="_$css",xne={correct:(t,{treeScale:e,projectionDelta:r})=>{const n=t,i=t.includes("var("),s=[];i&&(t=t.replace(oD,h=>(s.push(h),EA)));const o=Sc.parse(t);if(o.length>5)return n;const a=Sc.createTransformer(t),c=typeof o[0]!="number"?1:0,l=r.x.scale*e.x,u=r.y.scale*e.y;o[0+c]/=l,o[1+c]/=u;const f=yr(l,u,.5);typeof o[2+c]=="number"&&(o[2+c]/=f),typeof o[3+c]=="number"&&(o[3+c]/=f);let d=a(o);if(i){let h=0;d=d.replace(EA,()=>{const p=s[h];return h++,p})}return d}};class Ene extends S.Component{componentDidMount(){const{visualElement:e,layoutGroup:r,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=e;dee(Sne),s&&(r.group&&r.group.add(s),n&&n.register&&i&&n.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),o0.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:r,visualElement:n,drag:i,isPresent:s}=this.props,o=n.projection;return o&&(o.isPresent=s,i||e.layoutDependency!==r||r===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?o.promote():o.relegate()||kn.postRender(()=>{var a;!((a=o.getStack())===null||a===void 0)&&a.members.length||this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),!e.currentAnimation&&e.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:e,layoutGroup:r,switchLayoutGroup:n}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),r!=null&&r.group&&r.group.remove(i),n!=null&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e==null||e()}render(){return null}}function Cne(t){const[e,r]=AN(),n=k.useContext(rC);return S.createElement(Ene,{...t,layoutGroup:n,switchLayoutGroup:k.useContext(cN),isPresent:e,safeToRemove:r})}const Sne={borderRadius:{...wh,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:wh,borderTopRightRadius:wh,borderBottomLeftRadius:wh,borderBottomRightRadius:wh,boxShadow:xne},kne={measureLayout:Cne};function Ane(t,e,r={}){const n=ai(t)?t:id(t);return n.start(_C("",n,e,r)),{stop:()=>n.stop(),isAnimating:()=>n.isAnimating()}}const dD=["TopLeft","TopRight","BottomLeft","BottomRight"],_ne=dD.length,CA=t=>typeof t=="string"?parseFloat(t):t,SA=t=>typeof t=="number"||we.test(t);function Pne(t,e,r,n,i,s){i?(t.opacity=yr(0,r.opacity!==void 0?r.opacity:1,Tne(n)),t.opacityExit=yr(e.opacity!==void 0?e.opacity:1,0,Ine(n))):s&&(t.opacity=yr(e.opacity!==void 0?e.opacity:1,r.opacity!==void 0?r.opacity:1,n));for(let o=0;o<_ne;o++){const a=`border${dD[o]}Radius`;let c=kA(e,a),l=kA(r,a);if(c===void 0&&l===void 0)continue;c||(c=0),l||(l=0),c===0||l===0||SA(c)===SA(l)?(t[a]=Math.max(yr(CA(c),CA(l),n),0),(ho.test(l)||ho.test(c))&&(t[a]+="%")):t[a]=l}(e.rotate||r.rotate)&&(t.rotate=yr(e.rotate||0,r.rotate||0,n))}function kA(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Tne=hD(0,.5,kC),Ine=hD(.5,.95,SC);function hD(t,e,r){return n=>ne?1:r(xy(t,e,n))}function AA(t,e){t.min=e.min,t.max=e.max}function cs(t,e){AA(t.x,e.x),AA(t.y,e.y)}function _A(t,e,r,n,i){return t-=e,t=Cy(t,1/r,n),i!==void 0&&(t=Cy(t,1/i,n)),t}function One(t,e=0,r=1,n=.5,i,s=t,o=t){if(ho.test(e)&&(e=parseFloat(e),e=yr(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=yr(s.min,s.max,n);t===s&&(a-=e),t.min=_A(t.min,e,r,a,i),t.max=_A(t.max,e,r,a,i)}function PA(t,e,[r,n,i],s,o){One(t,e[r],e[n],e[i],e.scale,s,o)}const Rne=["x","scaleX","originX"],$ne=["y","scaleY","originY"];function TA(t,e,r,n){PA(t.x,e,Rne,r==null?void 0:r.x,n==null?void 0:n.x),PA(t.y,e,$ne,r==null?void 0:r.y,n==null?void 0:n.y)}function IA(t){return t.translate===0&&t.scale===1}function pD(t){return IA(t.x)&&IA(t.y)}function vD(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}function OA(t){return Si(t.x)/Si(t.y)}class Mne{constructor(){this.members=[]}add(e){hC(this.members,e),e.scheduleRender()}remove(e){if(pC(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(e){const r=this.members.findIndex(i=>e===i);if(r===0)return!1;let n;for(let i=r;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){n=s;break}}return n?(this.promote(n),!0):!1}promote(e,r){var n;const i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.instance&&i.scheduleRender(),e.scheduleRender(),e.resumeFrom=i,r&&(e.resumeFrom.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),!((n=e.root)===null||n===void 0)&&n.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:s}=e.options;s===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var r,n,i,s,o;(n=(r=e.options).onExitComplete)===null||n===void 0||n.call(r),(o=(i=e.resumingFrom)===null||i===void 0?void 0:(s=i.options).onExitComplete)===null||o===void 0||o.call(s)})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function RA(t,e,r){let n="";const i=t.x.translate/e.x,s=t.y.translate/e.y;if((i||s)&&(n=`translate3d(${i}px, ${s}px, 0) `),(e.x!==1||e.y!==1)&&(n+=`scale(${1/e.x}, ${1/e.y}) `),r){const{rotate:c,rotateX:l,rotateY:u}=r;c&&(n+=`rotate(${c}deg) `),l&&(n+=`rotateX(${l}deg) `),u&&(n+=`rotateY(${u}deg) `)}const o=t.x.scale*e.x,a=t.y.scale*e.y;return(o!==1||a!==1)&&(n+=`scale(${o}, ${a})`),n||"none"}const Nne=(t,e)=>t.depth-e.depth;class Dne{constructor(){this.children=[],this.isDirty=!1}add(e){hC(this.children,e),this.isDirty=!0}remove(e){pC(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Nne),this.isDirty=!1,this.children.forEach(e)}}const $A=["","X","Y","Z"],MA=1e3;let Lne=0;function mD({attachResizeListener:t,defaultParent:e,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(o,a={},c=e==null?void 0:e()){this.id=Lne++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isTransformDirty=!1,this.isProjectionDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(jne),this.nodes.forEach(Wne),this.nodes.forEach(Hne)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=o,this.latestValues=a,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0,o&&this.root.registerPotentialNode(o,this);for(let l=0;lthis.root.updateBlockedByResize=!1;t(o,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=JN(h,250),o0.hasAnimatedSinceResize&&(o0.hasAnimatedSinceResize=!1,this.nodes.forEach(DA))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&f&&(l||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:h,hasRelativeTargetChanged:p,layout:v})=>{var m,g,y,b,C;if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const A=(g=(m=this.options.transition)!==null&&m!==void 0?m:f.getDefaultTransition())!==null&&g!==void 0?g:Qne,{onLayoutAnimationStart:O,onLayoutAnimationComplete:w}=f.getProps(),I=!this.targetLayout||!vD(this.targetLayout,v)||p,B=!h&&p;if(this.options.layoutRoot||!((y=this.resumeFrom)===null||y===void 0)&&y.instance||B||h&&(I||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,B);const z={...XN(A,"layout"),onPlay:O,onComplete:w};(f.shouldReduceMotion||this.options.layoutRoot)&&(z.delay=0,z.type=!1),this.startAnimation(z)}else!h&&this.animationProgress===0&&DA(this),this.isLead()&&((C=(b=this.options).onExitComplete)===null||C===void 0||C.call(b));this.targetLayout=v})}unmount(){var o,a;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),(o=this.getStack())===null||o===void 0||o.remove(this),(a=this.parent)===null||a===void 0||a.children.delete(this),this.instance=void 0,Cc.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var o;return this.isAnimationBlocked||((o=this.parent)===null||o===void 0?void 0:o.isTreeAnimationBlocked())||!1}startUpdate(){var o;this.isUpdateBlocked()||(this.isUpdating=!0,(o=this.nodes)===null||o===void 0||o.forEach(qne),this.animationId++)}getTransformTemplate(){var o;return(o=this.options.visualElement)===null||o===void 0?void 0:o.getProps().transformTemplate}willUpdate(o=!0){var a,c,l;if(this.root.isUpdateBlocked()){(c=(a=this.options).onExitComplete)===null||c===void 0||c.call(a);return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){var o;if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c{var b;const C=y/1e3;LA(h.x,o.x,C),LA(h.y,o.y,C),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(!((b=this.relativeParent)===null||b===void 0)&&b.layout)&&(u0(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Gne(this.relativeTarget,this.relativeTargetOrigin,p,C)),v&&(this.animationValues=d,Pne(d,f,this.latestValues,C,g,m)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=C},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,c;this.notifyListeners("animationStart"),(a=this.currentAnimation)===null||a===void 0||a.stop(),this.resumingFrom&&((c=this.resumingFrom.currentAnimation)===null||c===void 0||c.stop()),this.pendingAnimation&&(Cc.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=kn.update(()=>{o0.hasAnimatedSinceResize=!0,this.currentAnimation=Ane(0,MA,{...o,onUpdate:l=>{var u;this.mixTargetDelta(l),(u=o.onUpdate)===null||u===void 0||u.call(o,l)},onComplete:()=>{var l;(l=o.onComplete)===null||l===void 0||l.call(o),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var o;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),(o=this.getStack())===null||o===void 0||o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var o;this.currentAnimation&&((o=this.mixTargetDelta)===null||o===void 0||o.call(this,MA),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:c,layout:l,latestValues:u}=o;if(!(!a||!c||!l)){if(this!==o&&this.layout&&l&&yD(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||Nr();const f=Si(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+f;const d=Si(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+d}cs(a,c),yf(a,u),l0(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(o,a){var c,l,u;this.sharedNodes.has(o)||this.sharedNodes.set(o,new Mne),this.sharedNodes.get(o).add(a),a.promote({transition:(c=a.options.initialPromotionConfig)===null||c===void 0?void 0:c.transition,preserveFollowOpacity:(u=(l=a.options.initialPromotionConfig)===null||l===void 0?void 0:l.shouldPreserveFollowOpacity)===null||u===void 0?void 0:u.call(l,a)})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.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 l=this.getStack();l&&l.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}resetRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:c}=o;if((c.rotate||c.rotateX||c.rotateY||c.rotateZ)&&(a=!0),!a)return;const l={};for(let u=0;u<$A.length;u++){const f="rotate"+$A[u];c[f]&&(l[f]=c[f],o.setStaticValue(f,0))}o==null||o.render();for(const u in l)o.setStaticValue(u,l[u]);o.scheduleRender()}getProjectionStyles(o={}){var a,c;const l={};if(!this.instance||this.isSVG)return l;if(this.isVisible)l.visibility="";else return{visibility:"hidden"};const u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,l.opacity="",l.pointerEvents=nm(o.pointerEvents)||"",l.transform=u?u(this.latestValues,""):"none",l;const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){const v={};return this.options.layoutId&&(v.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,v.pointerEvents=nm(o.pointerEvents)||""),this.hasProjected&&!vl(this.latestValues)&&(v.transform=u?u({},""):"none",this.hasProjected=!1),v}const d=f.animationValues||f.latestValues;this.applyTransformsToTarget(),l.transform=RA(this.projectionDeltaWithTransform,this.treeScale,d),u&&(l.transform=u(d,l.transform));const{x:h,y:p}=this.projectionDelta;l.transformOrigin=`${h.origin*100}% ${p.origin*100}% 0`,f.animationValues?l.opacity=f===this?(c=(a=d.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&c!==void 0?c:1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:l.opacity=f===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const v in hy){if(d[v]===void 0)continue;const{correct:m,applyTo:g}=hy[v],y=l.transform==="none"?d[v]:m(d[v],f);if(g){const b=g.length;for(let C=0;C{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(NA),this.root.sharedNodes.clear()}}}function Bne(t){t.updateLayout()}function Fne(t){var e,r,n;const i=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&i&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:o}=t.layout,{animationType:a}=t.options,c=i.source!==t.layout.source;a==="size"?Vs(h=>{const p=c?i.measuredBox[h]:i.layoutBox[h],v=Si(p);p.min=s[h].min,p.max=p.min+v}):yD(a,i.layoutBox,s)&&Vs(h=>{const p=c?i.measuredBox[h]:i.layoutBox[h],v=Si(s[h]);p.max=p.min+v});const l=f0();l0(l,s,i.layoutBox);const u=f0();c?l0(u,t.applyTransform(o,!0),i.measuredBox):l0(u,s,i.layoutBox);const f=!pD(l);let d=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:p,layout:v}=h;if(p&&v){const m=Nr();u0(m,i.layoutBox,p.layoutBox);const g=Nr();u0(g,s,v.layoutBox),vD(m,g)||(d=!0),h.options.layoutRoot&&(t.relativeTarget=g,t.relativeTargetOrigin=m,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:i,delta:u,layoutDelta:l,hasLayoutChanged:f,hasRelativeTargetChanged:d})}else t.isLead()&&((n=(r=t.options).onExitComplete)===null||n===void 0||n.call(r));t.options.transition=void 0}function jne(t){t.isProjectionDirty||(t.isProjectionDirty=!!(t.parent&&t.parent.isProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=!!(t.parent&&t.parent.isTransformDirty))}function Une(t){t.clearSnapshot()}function NA(t){t.clearMeasurements()}function zne(t){const{visualElement:e}=t.options;e!=null&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function DA(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function Wne(t){t.resolveTargetDelta()}function Hne(t){t.calcProjection()}function qne(t){t.resetRotation()}function Vne(t){t.removeLeadSnapshot()}function LA(t,e,r){t.translate=yr(e.translate,0,r),t.scale=yr(e.scale,1,r),t.origin=e.origin,t.originPoint=e.originPoint}function BA(t,e,r,n){t.min=yr(e.min,r.min,n),t.max=yr(e.max,r.max,n)}function Gne(t,e,r,n){BA(t.x,e.x,r.x,n),BA(t.y,e.y,r.y,n)}function Kne(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Qne={duration:.45,ease:[.4,0,.1,1]};function Yne(t,e){let r=t.root;for(let s=t.path.length-1;s>=0;s--)if(t.path[s].instance){r=t.path[s];break}const i=(r&&r!==t.root?r.instance:document).querySelector(`[data-projection-id="${e}"]`);i&&t.mount(i,!0)}function FA(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function Jne(t){FA(t.x),FA(t.y)}function yD(t,e,r){return t==="position"||t==="preserve-aspect"&&!S6(OA(e),OA(r),.2)}const Xne=mD({attachResizeListener:(t,e)=>cb(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Xw={current:void 0},Zne=mD({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Xw.current){const t=new Xne(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),Xw.current=t}return Xw.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),eie={...Rre,...Jee,...ene,...kne},n1=uee((t,e)=>Bee(t,e,eie,wne,Zne));function gD(){const t=k.useRef(!1);return dy(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function tie(){const t=gD(),[e,r]=k.useState(0),n=k.useCallback(()=>{t.current&&r(e+1)},[e]);return[k.useCallback(()=>kn.postRender(n),[n]),e]}class rie extends k.Component{getSnapshotBeforeUpdate(e){const r=this.props.childRef.current;if(r&&e.isPresent&&!this.props.isPresent){const n=this.props.sizeRef.current;n.height=r.offsetHeight||0,n.width=r.offsetWidth||0,n.top=r.offsetTop,n.left=r.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function nie({children:t,isPresent:e}){const r=k.useId(),n=k.useRef(null),i=k.useRef({width:0,height:0,top:0,left:0});return k.useInsertionEffect(()=>{const{width:s,height:o,top:a,left:c}=i.current;if(e||!n.current||!s||!o)return;n.current.dataset.motionPopId=r;const l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule(` - [data-motion-pop-id="${r}"] { - position: absolute !important; - width: ${s}px !important; - height: ${o}px !important; - top: ${a}px !important; - left: ${c}px !important; - } - `),()=>{document.head.removeChild(l)}},[e]),k.createElement(rie,{isPresent:e,childRef:n,sizeRef:i},k.cloneElement(t,{ref:n}))}const Zw=({children:t,initial:e,isPresent:r,onExitComplete:n,custom:i,presenceAffectsLayout:s,mode:o})=>{const a=ab(iie),c=k.useId(),l=k.useMemo(()=>({id:c,initial:e,isPresent:r,custom:i,onExitComplete:u=>{a.set(u,!0);for(const f of a.values())if(!f)return;n&&n()},register:u=>(a.set(u,!1),()=>a.delete(u))}),s?void 0:[r]);return k.useMemo(()=>{a.forEach((u,f)=>a.set(f,!1))},[r]),k.useEffect(()=>{!r&&!a.size&&n&&n()},[r]),o==="popLayout"&&(t=k.createElement(nie,{isPresent:r},t)),k.createElement(X1.Provider,{value:l},t)};function iie(){return new Map}const Ku=t=>t.key||"";function sie(t,e){t.forEach(r=>{const n=Ku(r);e.set(n,r)})}function oie(t){const e=[];return k.Children.forEach(t,r=>{k.isValidElement(r)&&e.push(r)}),e}const db=({children:t,custom:e,initial:r=!0,onExitComplete:n,exitBeforeEnter:i,presenceAffectsLayout:s=!0,mode:o="sync"})=>{i&&(o="wait");let[a]=tie();const c=k.useContext(rC).forceRender;c&&(a=c);const l=gD(),u=oie(t);let f=u;const d=new Set,h=k.useRef(f),p=k.useRef(new Map).current,v=k.useRef(!0);if(dy(()=>{v.current=!1,sie(u,p),h.current=f}),dC(()=>{v.current=!0,p.clear(),d.clear()}),v.current)return k.createElement(k.Fragment,null,f.map(b=>k.createElement(Zw,{key:Ku(b),isPresent:!0,initial:r?void 0:!1,presenceAffectsLayout:s,mode:o},b)));f=[...f];const m=h.current.map(Ku),g=u.map(Ku),y=m.length;for(let b=0;b{if(g.indexOf(b)!==-1)return;const C=p.get(b);if(!C)return;const A=m.indexOf(b),O=()=>{p.delete(b),d.delete(b);const w=h.current.findIndex(I=>I.key===b);if(h.current.splice(w,1),!d.size){if(h.current=u,l.current===!1)return;a(),n&&n()}};f.splice(A,0,k.createElement(Zw,{key:Ku(C),isPresent:!1,onExitComplete:O,custom:e,presenceAffectsLayout:s,mode:o},C))}),f=f.map(b=>{const C=b.key;return d.has(C)?b:k.createElement(Zw,{key:Ku(b),isPresent:!0,presenceAffectsLayout:s,mode:o},b)}),k.createElement(k.Fragment,null,d.size?f:f.map(b=>k.cloneElement(b)))};var O6=function(t,e){return O6=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},O6(t,e)};function bD(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");O6(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var ji=function(){return ji=Object.assign||function(e){for(var r,n=1,i=arguments.length;n=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function xD(t,e){return function(r,n){e(r,n,t)}}function aie(t,e,r,n,i,s){function o(g){if(g!==void 0&&typeof g!="function")throw new TypeError("Function expected");return g}for(var a=n.kind,c=a==="getter"?"get":a==="setter"?"set":"value",l=!e&&t?n.static?t:t.prototype:null,u=e||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),f,d=!1,h=r.length-1;h>=0;h--){var p={};for(var v in n)p[v]=v==="access"?{}:n[v];for(var v in n.access)p.access[v]=n.access[v];p.addInitializer=function(g){if(d)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(g||null))};var m=(0,r[h])(a==="accessor"?{get:u.get,set:u.set}:u[c],p);if(a==="accessor"){if(m===void 0)continue;if(m===null||typeof m!="object")throw new TypeError("Object expected");(f=o(m.get))&&(u.get=f),(f=o(m.set))&&(u.set=f),(f=o(m.init))&&i.unshift(f)}else(f=o(m))&&(a==="field"?i.unshift(f):u[c]=f)}l&&Object.defineProperty(l,n.name,u),d=!0}function cie(t,e,r){for(var n=arguments.length>2,i=0;i0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function TC(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function AD(){for(var t=[],e=0;e1||a(d,h)})})}function a(d,h){try{c(n[d](h))}catch(p){f(s[0][3],p)}}function c(d){d.value instanceof sd?Promise.resolve(d.value.v).then(l,u):f(s[0][2],d)}function l(d){a("next",d)}function u(d){a("throw",d)}function f(d,h){d(h),s.shift(),s.length&&a(s[0][0],s[0][1])}}function TD(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=t[i]?function(o){return(r=!r)?{value:sd(t[i](o)),done:!1}:s?s(o):o}:s}}function ID(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Sy=="function"?Sy(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function OD(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var fie=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function RD(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&pb(e,t,r);return fie(e,t),e}function $D(t){return t&&t.__esModule?t:{default:t}}function MD(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function ND(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function DD(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function LD(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose]}if(typeof n!="function")throw new TypeError("Object not disposable.");t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}var die=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};function BD(t){function e(n){t.error=t.hasError?new die(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}function r(){for(;t.stack.length;){var n=t.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(r,function(s){return e(s),r()})}catch(s){e(s)}}if(t.hasError)throw t.error}return r()}const hie={__extends:bD,__assign:ji,__rest:hb,__decorate:wD,__param:xD,__metadata:ED,__awaiter:CD,__generator:SD,__createBinding:pb,__exportStar:kD,__values:Sy,__read:TC,__spread:AD,__spreadArrays:_D,__spreadArray:IC,__await:sd,__asyncGenerator:PD,__asyncDelegator:TD,__asyncValues:ID,__makeTemplateObject:OD,__importStar:RD,__importDefault:$D,__classPrivateFieldGet:MD,__classPrivateFieldSet:ND,__classPrivateFieldIn:DD,__addDisposableResource:LD,__disposeResources:BD},nTe=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:LD,get __assign(){return ji},__asyncDelegator:TD,__asyncGenerator:PD,__asyncValues:ID,__await:sd,__awaiter:CD,__classPrivateFieldGet:MD,__classPrivateFieldIn:DD,__classPrivateFieldSet:ND,__createBinding:pb,__decorate:wD,__disposeResources:BD,__esDecorate:aie,__exportStar:kD,__extends:bD,__generator:SD,__importDefault:$D,__importStar:RD,__makeTemplateObject:OD,__metadata:ED,__param:xD,__propKey:lie,__read:TC,__rest:hb,__runInitializers:cie,__setFunctionName:uie,__spread:AD,__spreadArray:IC,__spreadArrays:_D,__values:Sy,default:hie},Symbol.toStringTag,{value:"Module"})),FD={black:"#000000",white:"#ffffff",inherit:"inherit",transparent:"transparent",positive:"#1FC266",negative:"#C2501F",info:"#0076CC",warning:"#F4B03E",gradientBackdrop:`linear-gradient( - 243.18deg, - rgba(86, 52, 189, 0.85) 0%, - rgba(49, 41, 223, 0.85) 63.54%, - rgba(7, 98, 149, 0.85) 100% - )`,gradientPrimary:"linear-gradient(89.69deg, #4411E1 0.27%, #7537F9 99.73%)",gradientSecondary:"linear-gradient(32.51deg, #951990 -15.23%, #3A35B1 48.55%, #20A8B0 100%)",arbitrumDark:"#212D44",arbitrumLight:"#93D4FF",avalanceDark:"#810C0C",avalanceLight:"#FF8080",bscDark:"#584508",bscLight:"#FCCF43",ethereumDark:"#132362",ethereumLight:"#AABBFF",gnosisDark:"#084246",gnosisLight:"#8CF6FD",polygonDark:"#350881",polygonLight:"#C7A6FF"},pie={...FD,text100:"rgba(255, 255, 255, 1)",text80:"rgba(255, 255, 255, 0.8)",text50:"rgba(255, 255, 255, 0.5)",textInverse100:"rgba(0, 0, 0, 1)",backgroundPrimary:"rgba(0, 0, 0, 1)",backgroundSecondary:"rgba(255, 255, 255, 0.1)",backgroundContrast:"rgba(0, 0, 0, 0.5)",backgroundMuted:"rgba(255, 255, 255, 0.05)",backgroundControl:"rgba(255, 255, 255, 0.25)",backgroundInverse:"rgba(255, 255, 255, 1)",backgroundBackdrop:"rgba(34, 34, 34, 0.9)",backgroundOverlay:"rgba(0, 0, 0, 0.7)",backgroundRaised:"rgba(54, 54, 54, 0.7)",buttonGlass:"rgba(255, 255, 255, 0.15)",buttonEmphasis:"rgba(0, 0, 0, 0.5)",buttonInverse:"rgba(255, 255, 255, 0.8)",borderNormal:"rgba(255, 255, 255, 0.25)",borderFocus:"rgba(255, 255, 255, 0.5)"},vie={...FD,text100:"rgba(0, 0, 0, 1)",text80:"rgba(0, 0, 0, 0.8)",text50:"rgba(0, 0, 0, 0.5)",textInverse100:"rgba(255, 255, 255, 1)",backgroundPrimary:"rgba(244, 244, 244, 1)",backgroundSecondary:"rgba(0, 0, 0, 0.1)",backgroundContrast:"rgba(244, 244, 244, 0.5)",backgroundMuted:"rgba(0, 0, 0, 0.05)",backgroundControl:"rgba(0, 0, 0, 0.25)",backgroundInverse:"rgba(0, 0, 0, 1)",backgroundBackdrop:"rgba(221, 221, 221, 0.9)",backgroundOverlay:"rgba(244, 244, 244, 0.7)",backgroundRaised:"rgba(192, 192, 192, 0.7)",buttonGlass:"rgba(0, 0, 0, 0.15)",buttonEmphasis:"rgba(255, 255, 255, 0.5)",buttonInverse:"rgba(0, 0, 0, 0.8)",borderNormal:"rgba(0, 0, 0, 0.25)",borderFocus:"rgba(0, 0, 0, 0.5)"},mie={dark:pie,light:vie},yie={inherit:{fontFamily:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit",fontWeight:"inherit"},xlarge:{fontFamily:"body",fontSize:"xlarge",lineHeight:"9",letterSpacing:"none",fontWeight:"bold"},large:{fontFamily:"body",fontSize:"large",lineHeight:"7",letterSpacing:"normal",fontWeight:"semibold"},medium:{fontFamily:"body",fontSize:"medium",lineHeight:"6",letterSpacing:"normal",fontWeight:"bold"},normal:{fontFamily:"body",fontSize:"normal",lineHeight:"5",letterSpacing:"wide",fontWeight:"normal"},small:{fontFamily:"body",fontSize:"small",lineHeight:"4",letterSpacing:"wide",fontWeight:"medium"},xsmall:{fontFamily:"body",fontSize:"xsmall",lineHeight:"4",letterSpacing:"wide",fontWeight:"bold"},code:{fontFamily:"mono",fontSize:"normal",lineHeight:"5",letterSpacing:"none",fontWeight:"normal"}},jA={sm:0,md:480,lg:769,xl:1281};var UA={colors:{black:"var(--colors-black)",white:"var(--colors-white)",inherit:"var(--colors-inherit)",transparent:"var(--colors-transparent)",positive:"var(--colors-positive)",negative:"var(--colors-negative)",info:"var(--colors-info)",warning:"var(--colors-warning)",gradientBackdrop:"var(--colors-gradient-backdrop)",gradientPrimary:"var(--colors-gradient-primary)",gradientSecondary:"var(--colors-gradient-secondary)",arbitrumDark:"var(--colors-arbitrum-dark)",arbitrumLight:"var(--colors-arbitrum-light)",avalanceDark:"var(--colors-avalance-dark)",avalanceLight:"var(--colors-avalance-light)",bscDark:"var(--colors-bsc-dark)",bscLight:"var(--colors-bsc-light)",ethereumDark:"var(--colors-ethereum-dark)",ethereumLight:"var(--colors-ethereum-light)",gnosisDark:"var(--colors-gnosis-dark)",gnosisLight:"var(--colors-gnosis-light)",polygonDark:"var(--colors-polygon-dark)",polygonLight:"var(--colors-polygon-light)",text100:"var(--colors-text100)",text80:"var(--colors-text80)",text50:"var(--colors-text50)",textInverse100:"var(--colors-text-inverse100)",backgroundPrimary:"var(--colors-background-primary)",backgroundSecondary:"var(--colors-background-secondary)",backgroundContrast:"var(--colors-background-contrast)",backgroundMuted:"var(--colors-background-muted)",backgroundControl:"var(--colors-background-control)",backgroundInverse:"var(--colors-background-inverse)",backgroundBackdrop:"var(--colors-background-backdrop)",backgroundOverlay:"var(--colors-background-overlay)",backgroundRaised:"var(--colors-background-raised)",buttonGlass:"var(--colors-button-glass)",buttonEmphasis:"var(--colors-button-emphasis)",buttonInverse:"var(--colors-button-inverse)",borderNormal:"var(--colors-border-normal)",borderFocus:"var(--colors-border-focus)"}},ve={blur:{blur:"var(--blur-blur)",none:"var(--blur-none)"},borderWidths:{none:"var(--border-widths-none)",thin:"var(--border-widths-thin)",thick:"var(--border-widths-thick)"},fonts:{inherit:"var(--fonts-inherit)",body:"var(--fonts-body)",mono:"var(--fonts-mono)"},fontSizes:{inherit:"var(--font-sizes-inherit)",xsmall:"var(--font-sizes-xsmall)",small:"var(--font-sizes-small)",normal:"var(--font-sizes-normal)",medium:"var(--font-sizes-medium)",large:"var(--font-sizes-large)",xlarge:"var(--font-sizes-xlarge)"},fontWeights:{inherit:"var(--font-weights-inherit)",normal:"var(--font-weights-normal)",medium:"var(--font-weights-medium)",semibold:"var(--font-weights-semibold)",bold:"var(--font-weights-bold)"},letterSpacings:{inherit:"var(--letter-spacings-inherit)",none:"var(--letter-spacings-none)",normal:"var(--letter-spacings-normal)",wide:"var(--letter-spacings-wide)"},lineHeights:{4:"var(--line-heights-4)",5:"var(--line-heights-5)",6:"var(--line-heights-6)",7:"var(--line-heights-7)",9:"var(--line-heights-9)",inherit:"var(--line-heights-inherit)"},opacity:{0:"var(--opacity-0)",50:"var(--opacity-50)",80:"var(--opacity-80)",100:"var(--opacity-100)"},radii:{none:"var(--radii-none)",xs:"var(--radii-xs)",sm:"var(--radii-sm)",md:"var(--radii-md)",lg:"var(--radii-lg)",circle:"var(--radii-circle)"},space:{0:"var(--space-0)",1:"var(--space-1)",2:"var(--space-2)",3:"var(--space-3)",4:"var(--space-4)",5:"var(--space-5)",6:"var(--space-6)",7:"var(--space-7)",8:"var(--space-8)",9:"var(--space-9)",10:"var(--space-10)",12:"var(--space-12)",14:"var(--space-14)",16:"var(--space-16)","0.25":"var(--space-0_25)","0.5":"var(--space-0_5)","1.5":"var(--space-1_5)"},colors:{black:"var(--colors-black)",white:"var(--colors-white)",inherit:"var(--colors-inherit)",transparent:"var(--colors-transparent)",positive:"var(--colors-positive)",negative:"var(--colors-negative)",info:"var(--colors-info)",warning:"var(--colors-warning)",gradientBackdrop:"var(--colors-gradient-backdrop)",gradientPrimary:"var(--colors-gradient-primary)",gradientSecondary:"var(--colors-gradient-secondary)",arbitrumDark:"var(--colors-arbitrum-dark)",arbitrumLight:"var(--colors-arbitrum-light)",avalanceDark:"var(--colors-avalance-dark)",avalanceLight:"var(--colors-avalance-light)",bscDark:"var(--colors-bsc-dark)",bscLight:"var(--colors-bsc-light)",ethereumDark:"var(--colors-ethereum-dark)",ethereumLight:"var(--colors-ethereum-light)",gnosisDark:"var(--colors-gnosis-dark)",gnosisLight:"var(--colors-gnosis-light)",polygonDark:"var(--colors-polygon-dark)",polygonLight:"var(--colors-polygon-light)",text100:"var(--colors-text100)",text80:"var(--colors-text80)",text50:"var(--colors-text50)",textInverse100:"var(--colors-text-inverse100)",backgroundPrimary:"var(--colors-background-primary)",backgroundSecondary:"var(--colors-background-secondary)",backgroundContrast:"var(--colors-background-contrast)",backgroundMuted:"var(--colors-background-muted)",backgroundControl:"var(--colors-background-control)",backgroundInverse:"var(--colors-background-inverse)",backgroundBackdrop:"var(--colors-background-backdrop)",backgroundOverlay:"var(--colors-background-overlay)",backgroundRaised:"var(--colors-background-raised)",buttonGlass:"var(--colors-button-glass)",buttonEmphasis:"var(--colors-button-emphasis)",buttonInverse:"var(--colors-button-inverse)",borderNormal:"var(--colors-border-normal)",borderFocus:"var(--colors-border-focus)"}};function gie(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function bie(t){var e=gie(t,"string");return typeof e=="symbol"?e:String(e)}function wie(t,e,r){return e=bie(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function zA(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ex(t){for(var e=1;efunction(){for(var e=arguments.length,r=new Array(e),n=0;nc.styles)),s=Object.keys(i),o=s.filter(c=>"mappings"in i[c]),a=c=>{var l=[],u={},f=ex({},c),d=!1;for(var h of o){var p=c[h];if(p!=null){var v=i[h];d=!0;for(var m of v.mappings)u[m]=p,f[m]==null&&delete f[m]}}var g=d?ex(ex({},u),f):c,y=function(){var O=g[b],w=i[b];try{if(w.mappings)return"continue";if(typeof O=="string"||typeof O=="number")l.push(w.values[O].defaultClass);else if(Array.isArray(O))for(var I=0;It,Cie=function(){return xie(Eie)(...arguments)},jD=Cie({conditions:{defaultCondition:"sm",conditionNames:["sm","md","lg","xl"],responsiveArray:void 0},styles:{borderWidth:{mappings:["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth"]},borderRadius:{mappings:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderLeftRadius:{mappings:["borderBottomLeftRadius","borderTopLeftRadius"]},borderRightRadius:{mappings:["borderBottomRightRadius","borderTopRightRadius"]},borderTopRadius:{mappings:["borderTopLeftRadius","borderTopRightRadius"]},borderBottomRadius:{mappings:["borderBottomLeftRadius","borderBottomRightRadius"]},margin:{mappings:["marginTop","marginBottom","marginLeft","marginRight"]},marginX:{mappings:["marginLeft","marginRight"]},marginY:{mappings:["marginTop","marginBottom"]},overflow:{mappings:["overflowX","overflowY"]},padding:{mappings:["paddingTop","paddingBottom","paddingLeft","paddingRight"]},paddingX:{mappings:["paddingLeft","paddingRight"]},paddingY:{mappings:["paddingTop","paddingBottom"]},placeItems:{mappings:["justifyContent","alignItems"]},inset:{mappings:["top","bottom","left","right"]},width:{values:{0:{conditions:{sm:"fyvr10",md:"fyvr11",lg:"fyvr12",xl:"fyvr13"},defaultClass:"fyvr10"},1:{conditions:{sm:"fyvr14",md:"fyvr15",lg:"fyvr16",xl:"fyvr17"},defaultClass:"fyvr14"},2:{conditions:{sm:"fyvr18",md:"fyvr19",lg:"fyvr1a",xl:"fyvr1b"},defaultClass:"fyvr18"},3:{conditions:{sm:"fyvr1c",md:"fyvr1d",lg:"fyvr1e",xl:"fyvr1f"},defaultClass:"fyvr1c"},4:{conditions:{sm:"fyvr1g",md:"fyvr1h",lg:"fyvr1i",xl:"fyvr1j"},defaultClass:"fyvr1g"},5:{conditions:{sm:"fyvr1k",md:"fyvr1l",lg:"fyvr1m",xl:"fyvr1n"},defaultClass:"fyvr1k"},6:{conditions:{sm:"fyvr1o",md:"fyvr1p",lg:"fyvr1q",xl:"fyvr1r"},defaultClass:"fyvr1o"},7:{conditions:{sm:"fyvr1s",md:"fyvr1t",lg:"fyvr1u",xl:"fyvr1v"},defaultClass:"fyvr1s"},8:{conditions:{sm:"fyvr1w",md:"fyvr1x",lg:"fyvr1y",xl:"fyvr1z"},defaultClass:"fyvr1w"},9:{conditions:{sm:"fyvr110",md:"fyvr111",lg:"fyvr112",xl:"fyvr113"},defaultClass:"fyvr110"},10:{conditions:{sm:"fyvr114",md:"fyvr115",lg:"fyvr116",xl:"fyvr117"},defaultClass:"fyvr114"},12:{conditions:{sm:"fyvr118",md:"fyvr119",lg:"fyvr11a",xl:"fyvr11b"},defaultClass:"fyvr118"},14:{conditions:{sm:"fyvr11c",md:"fyvr11d",lg:"fyvr11e",xl:"fyvr11f"},defaultClass:"fyvr11c"},16:{conditions:{sm:"fyvr11g",md:"fyvr11h",lg:"fyvr11i",xl:"fyvr11j"},defaultClass:"fyvr11g"},"0.25":{conditions:{sm:"fyvr11k",md:"fyvr11l",lg:"fyvr11m",xl:"fyvr11n"},defaultClass:"fyvr11k"},"0.5":{conditions:{sm:"fyvr11o",md:"fyvr11p",lg:"fyvr11q",xl:"fyvr11r"},defaultClass:"fyvr11o"},"1.5":{conditions:{sm:"fyvr11s",md:"fyvr11t",lg:"fyvr11u",xl:"fyvr11v"},defaultClass:"fyvr11s"},none:{conditions:{sm:"fyvr11w",md:"fyvr11x",lg:"fyvr11y",xl:"fyvr11z"},defaultClass:"fyvr11w"},px:{conditions:{sm:"fyvr120",md:"fyvr121",lg:"fyvr122",xl:"fyvr123"},defaultClass:"fyvr120"},auto:{conditions:{sm:"fyvr124",md:"fyvr125",lg:"fyvr126",xl:"fyvr127"},defaultClass:"fyvr124"},full:{conditions:{sm:"fyvr128",md:"fyvr129",lg:"fyvr12a",xl:"fyvr12b"},defaultClass:"fyvr128"},"1/2":{conditions:{sm:"fyvr12c",md:"fyvr12d",lg:"fyvr12e",xl:"fyvr12f"},defaultClass:"fyvr12c"},"1/3":{conditions:{sm:"fyvr12g",md:"fyvr12h",lg:"fyvr12i",xl:"fyvr12j"},defaultClass:"fyvr12g"},"2/3":{conditions:{sm:"fyvr12k",md:"fyvr12l",lg:"fyvr12m",xl:"fyvr12n"},defaultClass:"fyvr12k"},"1/4":{conditions:{sm:"fyvr12o",md:"fyvr12p",lg:"fyvr12q",xl:"fyvr12r"},defaultClass:"fyvr12o"},"3/4":{conditions:{sm:"fyvr12s",md:"fyvr12t",lg:"fyvr12u",xl:"fyvr12v"},defaultClass:"fyvr12s"},fit:{conditions:{sm:"fyvr12w",md:"fyvr12x",lg:"fyvr12y",xl:"fyvr12z"},defaultClass:"fyvr12w"},max:{conditions:{sm:"fyvr130",md:"fyvr131",lg:"fyvr132",xl:"fyvr133"},defaultClass:"fyvr130"},min:{conditions:{sm:"fyvr134",md:"fyvr135",lg:"fyvr136",xl:"fyvr137"},defaultClass:"fyvr134"},vw:{conditions:{sm:"fyvr138",md:"fyvr139",lg:"fyvr13a",xl:"fyvr13b"},defaultClass:"fyvr138"},vh:{conditions:{sm:"fyvr13c",md:"fyvr13d",lg:"fyvr13e",xl:"fyvr13f"},defaultClass:"fyvr13c"}}},height:{values:{0:{conditions:{sm:"fyvr13g",md:"fyvr13h",lg:"fyvr13i",xl:"fyvr13j"},defaultClass:"fyvr13g"},1:{conditions:{sm:"fyvr13k",md:"fyvr13l",lg:"fyvr13m",xl:"fyvr13n"},defaultClass:"fyvr13k"},2:{conditions:{sm:"fyvr13o",md:"fyvr13p",lg:"fyvr13q",xl:"fyvr13r"},defaultClass:"fyvr13o"},3:{conditions:{sm:"fyvr13s",md:"fyvr13t",lg:"fyvr13u",xl:"fyvr13v"},defaultClass:"fyvr13s"},4:{conditions:{sm:"fyvr13w",md:"fyvr13x",lg:"fyvr13y",xl:"fyvr13z"},defaultClass:"fyvr13w"},5:{conditions:{sm:"fyvr140",md:"fyvr141",lg:"fyvr142",xl:"fyvr143"},defaultClass:"fyvr140"},6:{conditions:{sm:"fyvr144",md:"fyvr145",lg:"fyvr146",xl:"fyvr147"},defaultClass:"fyvr144"},7:{conditions:{sm:"fyvr148",md:"fyvr149",lg:"fyvr14a",xl:"fyvr14b"},defaultClass:"fyvr148"},8:{conditions:{sm:"fyvr14c",md:"fyvr14d",lg:"fyvr14e",xl:"fyvr14f"},defaultClass:"fyvr14c"},9:{conditions:{sm:"fyvr14g",md:"fyvr14h",lg:"fyvr14i",xl:"fyvr14j"},defaultClass:"fyvr14g"},10:{conditions:{sm:"fyvr14k",md:"fyvr14l",lg:"fyvr14m",xl:"fyvr14n"},defaultClass:"fyvr14k"},12:{conditions:{sm:"fyvr14o",md:"fyvr14p",lg:"fyvr14q",xl:"fyvr14r"},defaultClass:"fyvr14o"},14:{conditions:{sm:"fyvr14s",md:"fyvr14t",lg:"fyvr14u",xl:"fyvr14v"},defaultClass:"fyvr14s"},16:{conditions:{sm:"fyvr14w",md:"fyvr14x",lg:"fyvr14y",xl:"fyvr14z"},defaultClass:"fyvr14w"},"0.25":{conditions:{sm:"fyvr150",md:"fyvr151",lg:"fyvr152",xl:"fyvr153"},defaultClass:"fyvr150"},"0.5":{conditions:{sm:"fyvr154",md:"fyvr155",lg:"fyvr156",xl:"fyvr157"},defaultClass:"fyvr154"},"1.5":{conditions:{sm:"fyvr158",md:"fyvr159",lg:"fyvr15a",xl:"fyvr15b"},defaultClass:"fyvr158"},none:{conditions:{sm:"fyvr15c",md:"fyvr15d",lg:"fyvr15e",xl:"fyvr15f"},defaultClass:"fyvr15c"},px:{conditions:{sm:"fyvr15g",md:"fyvr15h",lg:"fyvr15i",xl:"fyvr15j"},defaultClass:"fyvr15g"},auto:{conditions:{sm:"fyvr15k",md:"fyvr15l",lg:"fyvr15m",xl:"fyvr15n"},defaultClass:"fyvr15k"},full:{conditions:{sm:"fyvr15o",md:"fyvr15p",lg:"fyvr15q",xl:"fyvr15r"},defaultClass:"fyvr15o"},"1/2":{conditions:{sm:"fyvr15s",md:"fyvr15t",lg:"fyvr15u",xl:"fyvr15v"},defaultClass:"fyvr15s"},"1/3":{conditions:{sm:"fyvr15w",md:"fyvr15x",lg:"fyvr15y",xl:"fyvr15z"},defaultClass:"fyvr15w"},"2/3":{conditions:{sm:"fyvr160",md:"fyvr161",lg:"fyvr162",xl:"fyvr163"},defaultClass:"fyvr160"},"1/4":{conditions:{sm:"fyvr164",md:"fyvr165",lg:"fyvr166",xl:"fyvr167"},defaultClass:"fyvr164"},"3/4":{conditions:{sm:"fyvr168",md:"fyvr169",lg:"fyvr16a",xl:"fyvr16b"},defaultClass:"fyvr168"},fit:{conditions:{sm:"fyvr16c",md:"fyvr16d",lg:"fyvr16e",xl:"fyvr16f"},defaultClass:"fyvr16c"},max:{conditions:{sm:"fyvr16g",md:"fyvr16h",lg:"fyvr16i",xl:"fyvr16j"},defaultClass:"fyvr16g"},min:{conditions:{sm:"fyvr16k",md:"fyvr16l",lg:"fyvr16m",xl:"fyvr16n"},defaultClass:"fyvr16k"},vw:{conditions:{sm:"fyvr16o",md:"fyvr16p",lg:"fyvr16q",xl:"fyvr16r"},defaultClass:"fyvr16o"},vh:{conditions:{sm:"fyvr16s",md:"fyvr16t",lg:"fyvr16u",xl:"fyvr16v"},defaultClass:"fyvr16s"}}},maxWidth:{values:{0:{conditions:{sm:"fyvr16w",md:"fyvr16x",lg:"fyvr16y",xl:"fyvr16z"},defaultClass:"fyvr16w"},1:{conditions:{sm:"fyvr170",md:"fyvr171",lg:"fyvr172",xl:"fyvr173"},defaultClass:"fyvr170"},2:{conditions:{sm:"fyvr174",md:"fyvr175",lg:"fyvr176",xl:"fyvr177"},defaultClass:"fyvr174"},3:{conditions:{sm:"fyvr178",md:"fyvr179",lg:"fyvr17a",xl:"fyvr17b"},defaultClass:"fyvr178"},4:{conditions:{sm:"fyvr17c",md:"fyvr17d",lg:"fyvr17e",xl:"fyvr17f"},defaultClass:"fyvr17c"},5:{conditions:{sm:"fyvr17g",md:"fyvr17h",lg:"fyvr17i",xl:"fyvr17j"},defaultClass:"fyvr17g"},6:{conditions:{sm:"fyvr17k",md:"fyvr17l",lg:"fyvr17m",xl:"fyvr17n"},defaultClass:"fyvr17k"},7:{conditions:{sm:"fyvr17o",md:"fyvr17p",lg:"fyvr17q",xl:"fyvr17r"},defaultClass:"fyvr17o"},8:{conditions:{sm:"fyvr17s",md:"fyvr17t",lg:"fyvr17u",xl:"fyvr17v"},defaultClass:"fyvr17s"},9:{conditions:{sm:"fyvr17w",md:"fyvr17x",lg:"fyvr17y",xl:"fyvr17z"},defaultClass:"fyvr17w"},10:{conditions:{sm:"fyvr180",md:"fyvr181",lg:"fyvr182",xl:"fyvr183"},defaultClass:"fyvr180"},12:{conditions:{sm:"fyvr184",md:"fyvr185",lg:"fyvr186",xl:"fyvr187"},defaultClass:"fyvr184"},14:{conditions:{sm:"fyvr188",md:"fyvr189",lg:"fyvr18a",xl:"fyvr18b"},defaultClass:"fyvr188"},16:{conditions:{sm:"fyvr18c",md:"fyvr18d",lg:"fyvr18e",xl:"fyvr18f"},defaultClass:"fyvr18c"},"0.25":{conditions:{sm:"fyvr18g",md:"fyvr18h",lg:"fyvr18i",xl:"fyvr18j"},defaultClass:"fyvr18g"},"0.5":{conditions:{sm:"fyvr18k",md:"fyvr18l",lg:"fyvr18m",xl:"fyvr18n"},defaultClass:"fyvr18k"},"1.5":{conditions:{sm:"fyvr18o",md:"fyvr18p",lg:"fyvr18q",xl:"fyvr18r"},defaultClass:"fyvr18o"},none:{conditions:{sm:"fyvr18s",md:"fyvr18t",lg:"fyvr18u",xl:"fyvr18v"},defaultClass:"fyvr18s"},px:{conditions:{sm:"fyvr18w",md:"fyvr18x",lg:"fyvr18y",xl:"fyvr18z"},defaultClass:"fyvr18w"},auto:{conditions:{sm:"fyvr190",md:"fyvr191",lg:"fyvr192",xl:"fyvr193"},defaultClass:"fyvr190"},full:{conditions:{sm:"fyvr194",md:"fyvr195",lg:"fyvr196",xl:"fyvr197"},defaultClass:"fyvr194"},"1/2":{conditions:{sm:"fyvr198",md:"fyvr199",lg:"fyvr19a",xl:"fyvr19b"},defaultClass:"fyvr198"},"1/3":{conditions:{sm:"fyvr19c",md:"fyvr19d",lg:"fyvr19e",xl:"fyvr19f"},defaultClass:"fyvr19c"},"2/3":{conditions:{sm:"fyvr19g",md:"fyvr19h",lg:"fyvr19i",xl:"fyvr19j"},defaultClass:"fyvr19g"},"1/4":{conditions:{sm:"fyvr19k",md:"fyvr19l",lg:"fyvr19m",xl:"fyvr19n"},defaultClass:"fyvr19k"},"3/4":{conditions:{sm:"fyvr19o",md:"fyvr19p",lg:"fyvr19q",xl:"fyvr19r"},defaultClass:"fyvr19o"},fit:{conditions:{sm:"fyvr19s",md:"fyvr19t",lg:"fyvr19u",xl:"fyvr19v"},defaultClass:"fyvr19s"},max:{conditions:{sm:"fyvr19w",md:"fyvr19x",lg:"fyvr19y",xl:"fyvr19z"},defaultClass:"fyvr19w"},min:{conditions:{sm:"fyvr1a0",md:"fyvr1a1",lg:"fyvr1a2",xl:"fyvr1a3"},defaultClass:"fyvr1a0"},vw:{conditions:{sm:"fyvr1a4",md:"fyvr1a5",lg:"fyvr1a6",xl:"fyvr1a7"},defaultClass:"fyvr1a4"},vh:{conditions:{sm:"fyvr1a8",md:"fyvr1a9",lg:"fyvr1aa",xl:"fyvr1ab"},defaultClass:"fyvr1a8"}}},maxHeight:{values:{0:{conditions:{sm:"fyvr1ac",md:"fyvr1ad",lg:"fyvr1ae",xl:"fyvr1af"},defaultClass:"fyvr1ac"},1:{conditions:{sm:"fyvr1ag",md:"fyvr1ah",lg:"fyvr1ai",xl:"fyvr1aj"},defaultClass:"fyvr1ag"},2:{conditions:{sm:"fyvr1ak",md:"fyvr1al",lg:"fyvr1am",xl:"fyvr1an"},defaultClass:"fyvr1ak"},3:{conditions:{sm:"fyvr1ao",md:"fyvr1ap",lg:"fyvr1aq",xl:"fyvr1ar"},defaultClass:"fyvr1ao"},4:{conditions:{sm:"fyvr1as",md:"fyvr1at",lg:"fyvr1au",xl:"fyvr1av"},defaultClass:"fyvr1as"},5:{conditions:{sm:"fyvr1aw",md:"fyvr1ax",lg:"fyvr1ay",xl:"fyvr1az"},defaultClass:"fyvr1aw"},6:{conditions:{sm:"fyvr1b0",md:"fyvr1b1",lg:"fyvr1b2",xl:"fyvr1b3"},defaultClass:"fyvr1b0"},7:{conditions:{sm:"fyvr1b4",md:"fyvr1b5",lg:"fyvr1b6",xl:"fyvr1b7"},defaultClass:"fyvr1b4"},8:{conditions:{sm:"fyvr1b8",md:"fyvr1b9",lg:"fyvr1ba",xl:"fyvr1bb"},defaultClass:"fyvr1b8"},9:{conditions:{sm:"fyvr1bc",md:"fyvr1bd",lg:"fyvr1be",xl:"fyvr1bf"},defaultClass:"fyvr1bc"},10:{conditions:{sm:"fyvr1bg",md:"fyvr1bh",lg:"fyvr1bi",xl:"fyvr1bj"},defaultClass:"fyvr1bg"},12:{conditions:{sm:"fyvr1bk",md:"fyvr1bl",lg:"fyvr1bm",xl:"fyvr1bn"},defaultClass:"fyvr1bk"},14:{conditions:{sm:"fyvr1bo",md:"fyvr1bp",lg:"fyvr1bq",xl:"fyvr1br"},defaultClass:"fyvr1bo"},16:{conditions:{sm:"fyvr1bs",md:"fyvr1bt",lg:"fyvr1bu",xl:"fyvr1bv"},defaultClass:"fyvr1bs"},"0.25":{conditions:{sm:"fyvr1bw",md:"fyvr1bx",lg:"fyvr1by",xl:"fyvr1bz"},defaultClass:"fyvr1bw"},"0.5":{conditions:{sm:"fyvr1c0",md:"fyvr1c1",lg:"fyvr1c2",xl:"fyvr1c3"},defaultClass:"fyvr1c0"},"1.5":{conditions:{sm:"fyvr1c4",md:"fyvr1c5",lg:"fyvr1c6",xl:"fyvr1c7"},defaultClass:"fyvr1c4"},none:{conditions:{sm:"fyvr1c8",md:"fyvr1c9",lg:"fyvr1ca",xl:"fyvr1cb"},defaultClass:"fyvr1c8"},px:{conditions:{sm:"fyvr1cc",md:"fyvr1cd",lg:"fyvr1ce",xl:"fyvr1cf"},defaultClass:"fyvr1cc"},auto:{conditions:{sm:"fyvr1cg",md:"fyvr1ch",lg:"fyvr1ci",xl:"fyvr1cj"},defaultClass:"fyvr1cg"},full:{conditions:{sm:"fyvr1ck",md:"fyvr1cl",lg:"fyvr1cm",xl:"fyvr1cn"},defaultClass:"fyvr1ck"},"1/2":{conditions:{sm:"fyvr1co",md:"fyvr1cp",lg:"fyvr1cq",xl:"fyvr1cr"},defaultClass:"fyvr1co"},"1/3":{conditions:{sm:"fyvr1cs",md:"fyvr1ct",lg:"fyvr1cu",xl:"fyvr1cv"},defaultClass:"fyvr1cs"},"2/3":{conditions:{sm:"fyvr1cw",md:"fyvr1cx",lg:"fyvr1cy",xl:"fyvr1cz"},defaultClass:"fyvr1cw"},"1/4":{conditions:{sm:"fyvr1d0",md:"fyvr1d1",lg:"fyvr1d2",xl:"fyvr1d3"},defaultClass:"fyvr1d0"},"3/4":{conditions:{sm:"fyvr1d4",md:"fyvr1d5",lg:"fyvr1d6",xl:"fyvr1d7"},defaultClass:"fyvr1d4"},fit:{conditions:{sm:"fyvr1d8",md:"fyvr1d9",lg:"fyvr1da",xl:"fyvr1db"},defaultClass:"fyvr1d8"},max:{conditions:{sm:"fyvr1dc",md:"fyvr1dd",lg:"fyvr1de",xl:"fyvr1df"},defaultClass:"fyvr1dc"},min:{conditions:{sm:"fyvr1dg",md:"fyvr1dh",lg:"fyvr1di",xl:"fyvr1dj"},defaultClass:"fyvr1dg"},vw:{conditions:{sm:"fyvr1dk",md:"fyvr1dl",lg:"fyvr1dm",xl:"fyvr1dn"},defaultClass:"fyvr1dk"},vh:{conditions:{sm:"fyvr1do",md:"fyvr1dp",lg:"fyvr1dq",xl:"fyvr1dr"},defaultClass:"fyvr1do"}}},minWidth:{values:{0:{conditions:{sm:"fyvr1ds",md:"fyvr1dt",lg:"fyvr1du",xl:"fyvr1dv"},defaultClass:"fyvr1ds"},1:{conditions:{sm:"fyvr1dw",md:"fyvr1dx",lg:"fyvr1dy",xl:"fyvr1dz"},defaultClass:"fyvr1dw"},2:{conditions:{sm:"fyvr1e0",md:"fyvr1e1",lg:"fyvr1e2",xl:"fyvr1e3"},defaultClass:"fyvr1e0"},3:{conditions:{sm:"fyvr1e4",md:"fyvr1e5",lg:"fyvr1e6",xl:"fyvr1e7"},defaultClass:"fyvr1e4"},4:{conditions:{sm:"fyvr1e8",md:"fyvr1e9",lg:"fyvr1ea",xl:"fyvr1eb"},defaultClass:"fyvr1e8"},5:{conditions:{sm:"fyvr1ec",md:"fyvr1ed",lg:"fyvr1ee",xl:"fyvr1ef"},defaultClass:"fyvr1ec"},6:{conditions:{sm:"fyvr1eg",md:"fyvr1eh",lg:"fyvr1ei",xl:"fyvr1ej"},defaultClass:"fyvr1eg"},7:{conditions:{sm:"fyvr1ek",md:"fyvr1el",lg:"fyvr1em",xl:"fyvr1en"},defaultClass:"fyvr1ek"},8:{conditions:{sm:"fyvr1eo",md:"fyvr1ep",lg:"fyvr1eq",xl:"fyvr1er"},defaultClass:"fyvr1eo"},9:{conditions:{sm:"fyvr1es",md:"fyvr1et",lg:"fyvr1eu",xl:"fyvr1ev"},defaultClass:"fyvr1es"},10:{conditions:{sm:"fyvr1ew",md:"fyvr1ex",lg:"fyvr1ey",xl:"fyvr1ez"},defaultClass:"fyvr1ew"},12:{conditions:{sm:"fyvr1f0",md:"fyvr1f1",lg:"fyvr1f2",xl:"fyvr1f3"},defaultClass:"fyvr1f0"},14:{conditions:{sm:"fyvr1f4",md:"fyvr1f5",lg:"fyvr1f6",xl:"fyvr1f7"},defaultClass:"fyvr1f4"},16:{conditions:{sm:"fyvr1f8",md:"fyvr1f9",lg:"fyvr1fa",xl:"fyvr1fb"},defaultClass:"fyvr1f8"},"0.25":{conditions:{sm:"fyvr1fc",md:"fyvr1fd",lg:"fyvr1fe",xl:"fyvr1ff"},defaultClass:"fyvr1fc"},"0.5":{conditions:{sm:"fyvr1fg",md:"fyvr1fh",lg:"fyvr1fi",xl:"fyvr1fj"},defaultClass:"fyvr1fg"},"1.5":{conditions:{sm:"fyvr1fk",md:"fyvr1fl",lg:"fyvr1fm",xl:"fyvr1fn"},defaultClass:"fyvr1fk"},none:{conditions:{sm:"fyvr1fo",md:"fyvr1fp",lg:"fyvr1fq",xl:"fyvr1fr"},defaultClass:"fyvr1fo"},px:{conditions:{sm:"fyvr1fs",md:"fyvr1ft",lg:"fyvr1fu",xl:"fyvr1fv"},defaultClass:"fyvr1fs"},auto:{conditions:{sm:"fyvr1fw",md:"fyvr1fx",lg:"fyvr1fy",xl:"fyvr1fz"},defaultClass:"fyvr1fw"},full:{conditions:{sm:"fyvr1g0",md:"fyvr1g1",lg:"fyvr1g2",xl:"fyvr1g3"},defaultClass:"fyvr1g0"},"1/2":{conditions:{sm:"fyvr1g4",md:"fyvr1g5",lg:"fyvr1g6",xl:"fyvr1g7"},defaultClass:"fyvr1g4"},"1/3":{conditions:{sm:"fyvr1g8",md:"fyvr1g9",lg:"fyvr1ga",xl:"fyvr1gb"},defaultClass:"fyvr1g8"},"2/3":{conditions:{sm:"fyvr1gc",md:"fyvr1gd",lg:"fyvr1ge",xl:"fyvr1gf"},defaultClass:"fyvr1gc"},"1/4":{conditions:{sm:"fyvr1gg",md:"fyvr1gh",lg:"fyvr1gi",xl:"fyvr1gj"},defaultClass:"fyvr1gg"},"3/4":{conditions:{sm:"fyvr1gk",md:"fyvr1gl",lg:"fyvr1gm",xl:"fyvr1gn"},defaultClass:"fyvr1gk"},fit:{conditions:{sm:"fyvr1go",md:"fyvr1gp",lg:"fyvr1gq",xl:"fyvr1gr"},defaultClass:"fyvr1go"},max:{conditions:{sm:"fyvr1gs",md:"fyvr1gt",lg:"fyvr1gu",xl:"fyvr1gv"},defaultClass:"fyvr1gs"},min:{conditions:{sm:"fyvr1gw",md:"fyvr1gx",lg:"fyvr1gy",xl:"fyvr1gz"},defaultClass:"fyvr1gw"},vw:{conditions:{sm:"fyvr1h0",md:"fyvr1h1",lg:"fyvr1h2",xl:"fyvr1h3"},defaultClass:"fyvr1h0"},vh:{conditions:{sm:"fyvr1h4",md:"fyvr1h5",lg:"fyvr1h6",xl:"fyvr1h7"},defaultClass:"fyvr1h4"}}},minHeight:{values:{0:{conditions:{sm:"fyvr1h8",md:"fyvr1h9",lg:"fyvr1ha",xl:"fyvr1hb"},defaultClass:"fyvr1h8"},1:{conditions:{sm:"fyvr1hc",md:"fyvr1hd",lg:"fyvr1he",xl:"fyvr1hf"},defaultClass:"fyvr1hc"},2:{conditions:{sm:"fyvr1hg",md:"fyvr1hh",lg:"fyvr1hi",xl:"fyvr1hj"},defaultClass:"fyvr1hg"},3:{conditions:{sm:"fyvr1hk",md:"fyvr1hl",lg:"fyvr1hm",xl:"fyvr1hn"},defaultClass:"fyvr1hk"},4:{conditions:{sm:"fyvr1ho",md:"fyvr1hp",lg:"fyvr1hq",xl:"fyvr1hr"},defaultClass:"fyvr1ho"},5:{conditions:{sm:"fyvr1hs",md:"fyvr1ht",lg:"fyvr1hu",xl:"fyvr1hv"},defaultClass:"fyvr1hs"},6:{conditions:{sm:"fyvr1hw",md:"fyvr1hx",lg:"fyvr1hy",xl:"fyvr1hz"},defaultClass:"fyvr1hw"},7:{conditions:{sm:"fyvr1i0",md:"fyvr1i1",lg:"fyvr1i2",xl:"fyvr1i3"},defaultClass:"fyvr1i0"},8:{conditions:{sm:"fyvr1i4",md:"fyvr1i5",lg:"fyvr1i6",xl:"fyvr1i7"},defaultClass:"fyvr1i4"},9:{conditions:{sm:"fyvr1i8",md:"fyvr1i9",lg:"fyvr1ia",xl:"fyvr1ib"},defaultClass:"fyvr1i8"},10:{conditions:{sm:"fyvr1ic",md:"fyvr1id",lg:"fyvr1ie",xl:"fyvr1if"},defaultClass:"fyvr1ic"},12:{conditions:{sm:"fyvr1ig",md:"fyvr1ih",lg:"fyvr1ii",xl:"fyvr1ij"},defaultClass:"fyvr1ig"},14:{conditions:{sm:"fyvr1ik",md:"fyvr1il",lg:"fyvr1im",xl:"fyvr1in"},defaultClass:"fyvr1ik"},16:{conditions:{sm:"fyvr1io",md:"fyvr1ip",lg:"fyvr1iq",xl:"fyvr1ir"},defaultClass:"fyvr1io"},"0.25":{conditions:{sm:"fyvr1is",md:"fyvr1it",lg:"fyvr1iu",xl:"fyvr1iv"},defaultClass:"fyvr1is"},"0.5":{conditions:{sm:"fyvr1iw",md:"fyvr1ix",lg:"fyvr1iy",xl:"fyvr1iz"},defaultClass:"fyvr1iw"},"1.5":{conditions:{sm:"fyvr1j0",md:"fyvr1j1",lg:"fyvr1j2",xl:"fyvr1j3"},defaultClass:"fyvr1j0"},none:{conditions:{sm:"fyvr1j4",md:"fyvr1j5",lg:"fyvr1j6",xl:"fyvr1j7"},defaultClass:"fyvr1j4"},px:{conditions:{sm:"fyvr1j8",md:"fyvr1j9",lg:"fyvr1ja",xl:"fyvr1jb"},defaultClass:"fyvr1j8"},auto:{conditions:{sm:"fyvr1jc",md:"fyvr1jd",lg:"fyvr1je",xl:"fyvr1jf"},defaultClass:"fyvr1jc"},full:{conditions:{sm:"fyvr1jg",md:"fyvr1jh",lg:"fyvr1ji",xl:"fyvr1jj"},defaultClass:"fyvr1jg"},"1/2":{conditions:{sm:"fyvr1jk",md:"fyvr1jl",lg:"fyvr1jm",xl:"fyvr1jn"},defaultClass:"fyvr1jk"},"1/3":{conditions:{sm:"fyvr1jo",md:"fyvr1jp",lg:"fyvr1jq",xl:"fyvr1jr"},defaultClass:"fyvr1jo"},"2/3":{conditions:{sm:"fyvr1js",md:"fyvr1jt",lg:"fyvr1ju",xl:"fyvr1jv"},defaultClass:"fyvr1js"},"1/4":{conditions:{sm:"fyvr1jw",md:"fyvr1jx",lg:"fyvr1jy",xl:"fyvr1jz"},defaultClass:"fyvr1jw"},"3/4":{conditions:{sm:"fyvr1k0",md:"fyvr1k1",lg:"fyvr1k2",xl:"fyvr1k3"},defaultClass:"fyvr1k0"},fit:{conditions:{sm:"fyvr1k4",md:"fyvr1k5",lg:"fyvr1k6",xl:"fyvr1k7"},defaultClass:"fyvr1k4"},max:{conditions:{sm:"fyvr1k8",md:"fyvr1k9",lg:"fyvr1ka",xl:"fyvr1kb"},defaultClass:"fyvr1k8"},min:{conditions:{sm:"fyvr1kc",md:"fyvr1kd",lg:"fyvr1ke",xl:"fyvr1kf"},defaultClass:"fyvr1kc"},vw:{conditions:{sm:"fyvr1kg",md:"fyvr1kh",lg:"fyvr1ki",xl:"fyvr1kj"},defaultClass:"fyvr1kg"},vh:{conditions:{sm:"fyvr1kk",md:"fyvr1kl",lg:"fyvr1km",xl:"fyvr1kn"},defaultClass:"fyvr1kk"}}},top:{values:{0:{conditions:{sm:"fyvr1ko",md:"fyvr1kp",lg:"fyvr1kq",xl:"fyvr1kr"},defaultClass:"fyvr1ko"},1:{conditions:{sm:"fyvr1ks",md:"fyvr1kt",lg:"fyvr1ku",xl:"fyvr1kv"},defaultClass:"fyvr1ks"},2:{conditions:{sm:"fyvr1kw",md:"fyvr1kx",lg:"fyvr1ky",xl:"fyvr1kz"},defaultClass:"fyvr1kw"},3:{conditions:{sm:"fyvr1l0",md:"fyvr1l1",lg:"fyvr1l2",xl:"fyvr1l3"},defaultClass:"fyvr1l0"},4:{conditions:{sm:"fyvr1l4",md:"fyvr1l5",lg:"fyvr1l6",xl:"fyvr1l7"},defaultClass:"fyvr1l4"},5:{conditions:{sm:"fyvr1l8",md:"fyvr1l9",lg:"fyvr1la",xl:"fyvr1lb"},defaultClass:"fyvr1l8"},6:{conditions:{sm:"fyvr1lc",md:"fyvr1ld",lg:"fyvr1le",xl:"fyvr1lf"},defaultClass:"fyvr1lc"},7:{conditions:{sm:"fyvr1lg",md:"fyvr1lh",lg:"fyvr1li",xl:"fyvr1lj"},defaultClass:"fyvr1lg"},8:{conditions:{sm:"fyvr1lk",md:"fyvr1ll",lg:"fyvr1lm",xl:"fyvr1ln"},defaultClass:"fyvr1lk"},9:{conditions:{sm:"fyvr1lo",md:"fyvr1lp",lg:"fyvr1lq",xl:"fyvr1lr"},defaultClass:"fyvr1lo"},10:{conditions:{sm:"fyvr1ls",md:"fyvr1lt",lg:"fyvr1lu",xl:"fyvr1lv"},defaultClass:"fyvr1ls"},12:{conditions:{sm:"fyvr1lw",md:"fyvr1lx",lg:"fyvr1ly",xl:"fyvr1lz"},defaultClass:"fyvr1lw"},14:{conditions:{sm:"fyvr1m0",md:"fyvr1m1",lg:"fyvr1m2",xl:"fyvr1m3"},defaultClass:"fyvr1m0"},16:{conditions:{sm:"fyvr1m4",md:"fyvr1m5",lg:"fyvr1m6",xl:"fyvr1m7"},defaultClass:"fyvr1m4"},"0.25":{conditions:{sm:"fyvr1m8",md:"fyvr1m9",lg:"fyvr1ma",xl:"fyvr1mb"},defaultClass:"fyvr1m8"},"0.5":{conditions:{sm:"fyvr1mc",md:"fyvr1md",lg:"fyvr1me",xl:"fyvr1mf"},defaultClass:"fyvr1mc"},"1.5":{conditions:{sm:"fyvr1mg",md:"fyvr1mh",lg:"fyvr1mi",xl:"fyvr1mj"},defaultClass:"fyvr1mg"},auto:{conditions:{sm:"fyvr1mk",md:"fyvr1ml",lg:"fyvr1mm",xl:"fyvr1mn"},defaultClass:"fyvr1mk"}}},bottom:{values:{0:{conditions:{sm:"fyvr1mo",md:"fyvr1mp",lg:"fyvr1mq",xl:"fyvr1mr"},defaultClass:"fyvr1mo"},1:{conditions:{sm:"fyvr1ms",md:"fyvr1mt",lg:"fyvr1mu",xl:"fyvr1mv"},defaultClass:"fyvr1ms"},2:{conditions:{sm:"fyvr1mw",md:"fyvr1mx",lg:"fyvr1my",xl:"fyvr1mz"},defaultClass:"fyvr1mw"},3:{conditions:{sm:"fyvr1n0",md:"fyvr1n1",lg:"fyvr1n2",xl:"fyvr1n3"},defaultClass:"fyvr1n0"},4:{conditions:{sm:"fyvr1n4",md:"fyvr1n5",lg:"fyvr1n6",xl:"fyvr1n7"},defaultClass:"fyvr1n4"},5:{conditions:{sm:"fyvr1n8",md:"fyvr1n9",lg:"fyvr1na",xl:"fyvr1nb"},defaultClass:"fyvr1n8"},6:{conditions:{sm:"fyvr1nc",md:"fyvr1nd",lg:"fyvr1ne",xl:"fyvr1nf"},defaultClass:"fyvr1nc"},7:{conditions:{sm:"fyvr1ng",md:"fyvr1nh",lg:"fyvr1ni",xl:"fyvr1nj"},defaultClass:"fyvr1ng"},8:{conditions:{sm:"fyvr1nk",md:"fyvr1nl",lg:"fyvr1nm",xl:"fyvr1nn"},defaultClass:"fyvr1nk"},9:{conditions:{sm:"fyvr1no",md:"fyvr1np",lg:"fyvr1nq",xl:"fyvr1nr"},defaultClass:"fyvr1no"},10:{conditions:{sm:"fyvr1ns",md:"fyvr1nt",lg:"fyvr1nu",xl:"fyvr1nv"},defaultClass:"fyvr1ns"},12:{conditions:{sm:"fyvr1nw",md:"fyvr1nx",lg:"fyvr1ny",xl:"fyvr1nz"},defaultClass:"fyvr1nw"},14:{conditions:{sm:"fyvr1o0",md:"fyvr1o1",lg:"fyvr1o2",xl:"fyvr1o3"},defaultClass:"fyvr1o0"},16:{conditions:{sm:"fyvr1o4",md:"fyvr1o5",lg:"fyvr1o6",xl:"fyvr1o7"},defaultClass:"fyvr1o4"},"0.25":{conditions:{sm:"fyvr1o8",md:"fyvr1o9",lg:"fyvr1oa",xl:"fyvr1ob"},defaultClass:"fyvr1o8"},"0.5":{conditions:{sm:"fyvr1oc",md:"fyvr1od",lg:"fyvr1oe",xl:"fyvr1of"},defaultClass:"fyvr1oc"},"1.5":{conditions:{sm:"fyvr1og",md:"fyvr1oh",lg:"fyvr1oi",xl:"fyvr1oj"},defaultClass:"fyvr1og"},auto:{conditions:{sm:"fyvr1ok",md:"fyvr1ol",lg:"fyvr1om",xl:"fyvr1on"},defaultClass:"fyvr1ok"}}},left:{values:{0:{conditions:{sm:"fyvr1oo",md:"fyvr1op",lg:"fyvr1oq",xl:"fyvr1or"},defaultClass:"fyvr1oo"},1:{conditions:{sm:"fyvr1os",md:"fyvr1ot",lg:"fyvr1ou",xl:"fyvr1ov"},defaultClass:"fyvr1os"},2:{conditions:{sm:"fyvr1ow",md:"fyvr1ox",lg:"fyvr1oy",xl:"fyvr1oz"},defaultClass:"fyvr1ow"},3:{conditions:{sm:"fyvr1p0",md:"fyvr1p1",lg:"fyvr1p2",xl:"fyvr1p3"},defaultClass:"fyvr1p0"},4:{conditions:{sm:"fyvr1p4",md:"fyvr1p5",lg:"fyvr1p6",xl:"fyvr1p7"},defaultClass:"fyvr1p4"},5:{conditions:{sm:"fyvr1p8",md:"fyvr1p9",lg:"fyvr1pa",xl:"fyvr1pb"},defaultClass:"fyvr1p8"},6:{conditions:{sm:"fyvr1pc",md:"fyvr1pd",lg:"fyvr1pe",xl:"fyvr1pf"},defaultClass:"fyvr1pc"},7:{conditions:{sm:"fyvr1pg",md:"fyvr1ph",lg:"fyvr1pi",xl:"fyvr1pj"},defaultClass:"fyvr1pg"},8:{conditions:{sm:"fyvr1pk",md:"fyvr1pl",lg:"fyvr1pm",xl:"fyvr1pn"},defaultClass:"fyvr1pk"},9:{conditions:{sm:"fyvr1po",md:"fyvr1pp",lg:"fyvr1pq",xl:"fyvr1pr"},defaultClass:"fyvr1po"},10:{conditions:{sm:"fyvr1ps",md:"fyvr1pt",lg:"fyvr1pu",xl:"fyvr1pv"},defaultClass:"fyvr1ps"},12:{conditions:{sm:"fyvr1pw",md:"fyvr1px",lg:"fyvr1py",xl:"fyvr1pz"},defaultClass:"fyvr1pw"},14:{conditions:{sm:"fyvr1q0",md:"fyvr1q1",lg:"fyvr1q2",xl:"fyvr1q3"},defaultClass:"fyvr1q0"},16:{conditions:{sm:"fyvr1q4",md:"fyvr1q5",lg:"fyvr1q6",xl:"fyvr1q7"},defaultClass:"fyvr1q4"},"0.25":{conditions:{sm:"fyvr1q8",md:"fyvr1q9",lg:"fyvr1qa",xl:"fyvr1qb"},defaultClass:"fyvr1q8"},"0.5":{conditions:{sm:"fyvr1qc",md:"fyvr1qd",lg:"fyvr1qe",xl:"fyvr1qf"},defaultClass:"fyvr1qc"},"1.5":{conditions:{sm:"fyvr1qg",md:"fyvr1qh",lg:"fyvr1qi",xl:"fyvr1qj"},defaultClass:"fyvr1qg"},auto:{conditions:{sm:"fyvr1qk",md:"fyvr1ql",lg:"fyvr1qm",xl:"fyvr1qn"},defaultClass:"fyvr1qk"}}},right:{values:{0:{conditions:{sm:"fyvr1qo",md:"fyvr1qp",lg:"fyvr1qq",xl:"fyvr1qr"},defaultClass:"fyvr1qo"},1:{conditions:{sm:"fyvr1qs",md:"fyvr1qt",lg:"fyvr1qu",xl:"fyvr1qv"},defaultClass:"fyvr1qs"},2:{conditions:{sm:"fyvr1qw",md:"fyvr1qx",lg:"fyvr1qy",xl:"fyvr1qz"},defaultClass:"fyvr1qw"},3:{conditions:{sm:"fyvr1r0",md:"fyvr1r1",lg:"fyvr1r2",xl:"fyvr1r3"},defaultClass:"fyvr1r0"},4:{conditions:{sm:"fyvr1r4",md:"fyvr1r5",lg:"fyvr1r6",xl:"fyvr1r7"},defaultClass:"fyvr1r4"},5:{conditions:{sm:"fyvr1r8",md:"fyvr1r9",lg:"fyvr1ra",xl:"fyvr1rb"},defaultClass:"fyvr1r8"},6:{conditions:{sm:"fyvr1rc",md:"fyvr1rd",lg:"fyvr1re",xl:"fyvr1rf"},defaultClass:"fyvr1rc"},7:{conditions:{sm:"fyvr1rg",md:"fyvr1rh",lg:"fyvr1ri",xl:"fyvr1rj"},defaultClass:"fyvr1rg"},8:{conditions:{sm:"fyvr1rk",md:"fyvr1rl",lg:"fyvr1rm",xl:"fyvr1rn"},defaultClass:"fyvr1rk"},9:{conditions:{sm:"fyvr1ro",md:"fyvr1rp",lg:"fyvr1rq",xl:"fyvr1rr"},defaultClass:"fyvr1ro"},10:{conditions:{sm:"fyvr1rs",md:"fyvr1rt",lg:"fyvr1ru",xl:"fyvr1rv"},defaultClass:"fyvr1rs"},12:{conditions:{sm:"fyvr1rw",md:"fyvr1rx",lg:"fyvr1ry",xl:"fyvr1rz"},defaultClass:"fyvr1rw"},14:{conditions:{sm:"fyvr1s0",md:"fyvr1s1",lg:"fyvr1s2",xl:"fyvr1s3"},defaultClass:"fyvr1s0"},16:{conditions:{sm:"fyvr1s4",md:"fyvr1s5",lg:"fyvr1s6",xl:"fyvr1s7"},defaultClass:"fyvr1s4"},"0.25":{conditions:{sm:"fyvr1s8",md:"fyvr1s9",lg:"fyvr1sa",xl:"fyvr1sb"},defaultClass:"fyvr1s8"},"0.5":{conditions:{sm:"fyvr1sc",md:"fyvr1sd",lg:"fyvr1se",xl:"fyvr1sf"},defaultClass:"fyvr1sc"},"1.5":{conditions:{sm:"fyvr1sg",md:"fyvr1sh",lg:"fyvr1si",xl:"fyvr1sj"},defaultClass:"fyvr1sg"},auto:{conditions:{sm:"fyvr1sk",md:"fyvr1sl",lg:"fyvr1sm",xl:"fyvr1sn"},defaultClass:"fyvr1sk"}}},paddingTop:{values:{0:{conditions:{sm:"fyvr1so",md:"fyvr1sp",lg:"fyvr1sq",xl:"fyvr1sr"},defaultClass:"fyvr1so"},1:{conditions:{sm:"fyvr1ss",md:"fyvr1st",lg:"fyvr1su",xl:"fyvr1sv"},defaultClass:"fyvr1ss"},2:{conditions:{sm:"fyvr1sw",md:"fyvr1sx",lg:"fyvr1sy",xl:"fyvr1sz"},defaultClass:"fyvr1sw"},3:{conditions:{sm:"fyvr1t0",md:"fyvr1t1",lg:"fyvr1t2",xl:"fyvr1t3"},defaultClass:"fyvr1t0"},4:{conditions:{sm:"fyvr1t4",md:"fyvr1t5",lg:"fyvr1t6",xl:"fyvr1t7"},defaultClass:"fyvr1t4"},5:{conditions:{sm:"fyvr1t8",md:"fyvr1t9",lg:"fyvr1ta",xl:"fyvr1tb"},defaultClass:"fyvr1t8"},6:{conditions:{sm:"fyvr1tc",md:"fyvr1td",lg:"fyvr1te",xl:"fyvr1tf"},defaultClass:"fyvr1tc"},7:{conditions:{sm:"fyvr1tg",md:"fyvr1th",lg:"fyvr1ti",xl:"fyvr1tj"},defaultClass:"fyvr1tg"},8:{conditions:{sm:"fyvr1tk",md:"fyvr1tl",lg:"fyvr1tm",xl:"fyvr1tn"},defaultClass:"fyvr1tk"},9:{conditions:{sm:"fyvr1to",md:"fyvr1tp",lg:"fyvr1tq",xl:"fyvr1tr"},defaultClass:"fyvr1to"},10:{conditions:{sm:"fyvr1ts",md:"fyvr1tt",lg:"fyvr1tu",xl:"fyvr1tv"},defaultClass:"fyvr1ts"},12:{conditions:{sm:"fyvr1tw",md:"fyvr1tx",lg:"fyvr1ty",xl:"fyvr1tz"},defaultClass:"fyvr1tw"},14:{conditions:{sm:"fyvr1u0",md:"fyvr1u1",lg:"fyvr1u2",xl:"fyvr1u3"},defaultClass:"fyvr1u0"},16:{conditions:{sm:"fyvr1u4",md:"fyvr1u5",lg:"fyvr1u6",xl:"fyvr1u7"},defaultClass:"fyvr1u4"},"0.25":{conditions:{sm:"fyvr1u8",md:"fyvr1u9",lg:"fyvr1ua",xl:"fyvr1ub"},defaultClass:"fyvr1u8"},"0.5":{conditions:{sm:"fyvr1uc",md:"fyvr1ud",lg:"fyvr1ue",xl:"fyvr1uf"},defaultClass:"fyvr1uc"},"1.5":{conditions:{sm:"fyvr1ug",md:"fyvr1uh",lg:"fyvr1ui",xl:"fyvr1uj"},defaultClass:"fyvr1ug"}}},paddingBottom:{values:{0:{conditions:{sm:"fyvr1uk",md:"fyvr1ul",lg:"fyvr1um",xl:"fyvr1un"},defaultClass:"fyvr1uk"},1:{conditions:{sm:"fyvr1uo",md:"fyvr1up",lg:"fyvr1uq",xl:"fyvr1ur"},defaultClass:"fyvr1uo"},2:{conditions:{sm:"fyvr1us",md:"fyvr1ut",lg:"fyvr1uu",xl:"fyvr1uv"},defaultClass:"fyvr1us"},3:{conditions:{sm:"fyvr1uw",md:"fyvr1ux",lg:"fyvr1uy",xl:"fyvr1uz"},defaultClass:"fyvr1uw"},4:{conditions:{sm:"fyvr1v0",md:"fyvr1v1",lg:"fyvr1v2",xl:"fyvr1v3"},defaultClass:"fyvr1v0"},5:{conditions:{sm:"fyvr1v4",md:"fyvr1v5",lg:"fyvr1v6",xl:"fyvr1v7"},defaultClass:"fyvr1v4"},6:{conditions:{sm:"fyvr1v8",md:"fyvr1v9",lg:"fyvr1va",xl:"fyvr1vb"},defaultClass:"fyvr1v8"},7:{conditions:{sm:"fyvr1vc",md:"fyvr1vd",lg:"fyvr1ve",xl:"fyvr1vf"},defaultClass:"fyvr1vc"},8:{conditions:{sm:"fyvr1vg",md:"fyvr1vh",lg:"fyvr1vi",xl:"fyvr1vj"},defaultClass:"fyvr1vg"},9:{conditions:{sm:"fyvr1vk",md:"fyvr1vl",lg:"fyvr1vm",xl:"fyvr1vn"},defaultClass:"fyvr1vk"},10:{conditions:{sm:"fyvr1vo",md:"fyvr1vp",lg:"fyvr1vq",xl:"fyvr1vr"},defaultClass:"fyvr1vo"},12:{conditions:{sm:"fyvr1vs",md:"fyvr1vt",lg:"fyvr1vu",xl:"fyvr1vv"},defaultClass:"fyvr1vs"},14:{conditions:{sm:"fyvr1vw",md:"fyvr1vx",lg:"fyvr1vy",xl:"fyvr1vz"},defaultClass:"fyvr1vw"},16:{conditions:{sm:"fyvr1w0",md:"fyvr1w1",lg:"fyvr1w2",xl:"fyvr1w3"},defaultClass:"fyvr1w0"},"0.25":{conditions:{sm:"fyvr1w4",md:"fyvr1w5",lg:"fyvr1w6",xl:"fyvr1w7"},defaultClass:"fyvr1w4"},"0.5":{conditions:{sm:"fyvr1w8",md:"fyvr1w9",lg:"fyvr1wa",xl:"fyvr1wb"},defaultClass:"fyvr1w8"},"1.5":{conditions:{sm:"fyvr1wc",md:"fyvr1wd",lg:"fyvr1we",xl:"fyvr1wf"},defaultClass:"fyvr1wc"}}},paddingLeft:{values:{0:{conditions:{sm:"fyvr1wg",md:"fyvr1wh",lg:"fyvr1wi",xl:"fyvr1wj"},defaultClass:"fyvr1wg"},1:{conditions:{sm:"fyvr1wk",md:"fyvr1wl",lg:"fyvr1wm",xl:"fyvr1wn"},defaultClass:"fyvr1wk"},2:{conditions:{sm:"fyvr1wo",md:"fyvr1wp",lg:"fyvr1wq",xl:"fyvr1wr"},defaultClass:"fyvr1wo"},3:{conditions:{sm:"fyvr1ws",md:"fyvr1wt",lg:"fyvr1wu",xl:"fyvr1wv"},defaultClass:"fyvr1ws"},4:{conditions:{sm:"fyvr1ww",md:"fyvr1wx",lg:"fyvr1wy",xl:"fyvr1wz"},defaultClass:"fyvr1ww"},5:{conditions:{sm:"fyvr1x0",md:"fyvr1x1",lg:"fyvr1x2",xl:"fyvr1x3"},defaultClass:"fyvr1x0"},6:{conditions:{sm:"fyvr1x4",md:"fyvr1x5",lg:"fyvr1x6",xl:"fyvr1x7"},defaultClass:"fyvr1x4"},7:{conditions:{sm:"fyvr1x8",md:"fyvr1x9",lg:"fyvr1xa",xl:"fyvr1xb"},defaultClass:"fyvr1x8"},8:{conditions:{sm:"fyvr1xc",md:"fyvr1xd",lg:"fyvr1xe",xl:"fyvr1xf"},defaultClass:"fyvr1xc"},9:{conditions:{sm:"fyvr1xg",md:"fyvr1xh",lg:"fyvr1xi",xl:"fyvr1xj"},defaultClass:"fyvr1xg"},10:{conditions:{sm:"fyvr1xk",md:"fyvr1xl",lg:"fyvr1xm",xl:"fyvr1xn"},defaultClass:"fyvr1xk"},12:{conditions:{sm:"fyvr1xo",md:"fyvr1xp",lg:"fyvr1xq",xl:"fyvr1xr"},defaultClass:"fyvr1xo"},14:{conditions:{sm:"fyvr1xs",md:"fyvr1xt",lg:"fyvr1xu",xl:"fyvr1xv"},defaultClass:"fyvr1xs"},16:{conditions:{sm:"fyvr1xw",md:"fyvr1xx",lg:"fyvr1xy",xl:"fyvr1xz"},defaultClass:"fyvr1xw"},"0.25":{conditions:{sm:"fyvr1y0",md:"fyvr1y1",lg:"fyvr1y2",xl:"fyvr1y3"},defaultClass:"fyvr1y0"},"0.5":{conditions:{sm:"fyvr1y4",md:"fyvr1y5",lg:"fyvr1y6",xl:"fyvr1y7"},defaultClass:"fyvr1y4"},"1.5":{conditions:{sm:"fyvr1y8",md:"fyvr1y9",lg:"fyvr1ya",xl:"fyvr1yb"},defaultClass:"fyvr1y8"}}},paddingRight:{values:{0:{conditions:{sm:"fyvr1yc",md:"fyvr1yd",lg:"fyvr1ye",xl:"fyvr1yf"},defaultClass:"fyvr1yc"},1:{conditions:{sm:"fyvr1yg",md:"fyvr1yh",lg:"fyvr1yi",xl:"fyvr1yj"},defaultClass:"fyvr1yg"},2:{conditions:{sm:"fyvr1yk",md:"fyvr1yl",lg:"fyvr1ym",xl:"fyvr1yn"},defaultClass:"fyvr1yk"},3:{conditions:{sm:"fyvr1yo",md:"fyvr1yp",lg:"fyvr1yq",xl:"fyvr1yr"},defaultClass:"fyvr1yo"},4:{conditions:{sm:"fyvr1ys",md:"fyvr1yt",lg:"fyvr1yu",xl:"fyvr1yv"},defaultClass:"fyvr1ys"},5:{conditions:{sm:"fyvr1yw",md:"fyvr1yx",lg:"fyvr1yy",xl:"fyvr1yz"},defaultClass:"fyvr1yw"},6:{conditions:{sm:"fyvr1z0",md:"fyvr1z1",lg:"fyvr1z2",xl:"fyvr1z3"},defaultClass:"fyvr1z0"},7:{conditions:{sm:"fyvr1z4",md:"fyvr1z5",lg:"fyvr1z6",xl:"fyvr1z7"},defaultClass:"fyvr1z4"},8:{conditions:{sm:"fyvr1z8",md:"fyvr1z9",lg:"fyvr1za",xl:"fyvr1zb"},defaultClass:"fyvr1z8"},9:{conditions:{sm:"fyvr1zc",md:"fyvr1zd",lg:"fyvr1ze",xl:"fyvr1zf"},defaultClass:"fyvr1zc"},10:{conditions:{sm:"fyvr1zg",md:"fyvr1zh",lg:"fyvr1zi",xl:"fyvr1zj"},defaultClass:"fyvr1zg"},12:{conditions:{sm:"fyvr1zk",md:"fyvr1zl",lg:"fyvr1zm",xl:"fyvr1zn"},defaultClass:"fyvr1zk"},14:{conditions:{sm:"fyvr1zo",md:"fyvr1zp",lg:"fyvr1zq",xl:"fyvr1zr"},defaultClass:"fyvr1zo"},16:{conditions:{sm:"fyvr1zs",md:"fyvr1zt",lg:"fyvr1zu",xl:"fyvr1zv"},defaultClass:"fyvr1zs"},"0.25":{conditions:{sm:"fyvr1zw",md:"fyvr1zx",lg:"fyvr1zy",xl:"fyvr1zz"},defaultClass:"fyvr1zw"},"0.5":{conditions:{sm:"fyvr1100",md:"fyvr1101",lg:"fyvr1102",xl:"fyvr1103"},defaultClass:"fyvr1100"},"1.5":{conditions:{sm:"fyvr1104",md:"fyvr1105",lg:"fyvr1106",xl:"fyvr1107"},defaultClass:"fyvr1104"}}},marginTop:{values:{0:{conditions:{sm:"fyvr1108",md:"fyvr1109",lg:"fyvr110a",xl:"fyvr110b"},defaultClass:"fyvr1108"},1:{conditions:{sm:"fyvr110c",md:"fyvr110d",lg:"fyvr110e",xl:"fyvr110f"},defaultClass:"fyvr110c"},2:{conditions:{sm:"fyvr110g",md:"fyvr110h",lg:"fyvr110i",xl:"fyvr110j"},defaultClass:"fyvr110g"},3:{conditions:{sm:"fyvr110k",md:"fyvr110l",lg:"fyvr110m",xl:"fyvr110n"},defaultClass:"fyvr110k"},4:{conditions:{sm:"fyvr110o",md:"fyvr110p",lg:"fyvr110q",xl:"fyvr110r"},defaultClass:"fyvr110o"},5:{conditions:{sm:"fyvr110s",md:"fyvr110t",lg:"fyvr110u",xl:"fyvr110v"},defaultClass:"fyvr110s"},6:{conditions:{sm:"fyvr110w",md:"fyvr110x",lg:"fyvr110y",xl:"fyvr110z"},defaultClass:"fyvr110w"},7:{conditions:{sm:"fyvr1110",md:"fyvr1111",lg:"fyvr1112",xl:"fyvr1113"},defaultClass:"fyvr1110"},8:{conditions:{sm:"fyvr1114",md:"fyvr1115",lg:"fyvr1116",xl:"fyvr1117"},defaultClass:"fyvr1114"},9:{conditions:{sm:"fyvr1118",md:"fyvr1119",lg:"fyvr111a",xl:"fyvr111b"},defaultClass:"fyvr1118"},10:{conditions:{sm:"fyvr111c",md:"fyvr111d",lg:"fyvr111e",xl:"fyvr111f"},defaultClass:"fyvr111c"},12:{conditions:{sm:"fyvr111g",md:"fyvr111h",lg:"fyvr111i",xl:"fyvr111j"},defaultClass:"fyvr111g"},14:{conditions:{sm:"fyvr111k",md:"fyvr111l",lg:"fyvr111m",xl:"fyvr111n"},defaultClass:"fyvr111k"},16:{conditions:{sm:"fyvr111o",md:"fyvr111p",lg:"fyvr111q",xl:"fyvr111r"},defaultClass:"fyvr111o"},"0.25":{conditions:{sm:"fyvr111s",md:"fyvr111t",lg:"fyvr111u",xl:"fyvr111v"},defaultClass:"fyvr111s"},"0.5":{conditions:{sm:"fyvr111w",md:"fyvr111x",lg:"fyvr111y",xl:"fyvr111z"},defaultClass:"fyvr111w"},"1.5":{conditions:{sm:"fyvr1120",md:"fyvr1121",lg:"fyvr1122",xl:"fyvr1123"},defaultClass:"fyvr1120"},auto:{conditions:{sm:"fyvr1124",md:"fyvr1125",lg:"fyvr1126",xl:"fyvr1127"},defaultClass:"fyvr1124"}}},marginBottom:{values:{0:{conditions:{sm:"fyvr1128",md:"fyvr1129",lg:"fyvr112a",xl:"fyvr112b"},defaultClass:"fyvr1128"},1:{conditions:{sm:"fyvr112c",md:"fyvr112d",lg:"fyvr112e",xl:"fyvr112f"},defaultClass:"fyvr112c"},2:{conditions:{sm:"fyvr112g",md:"fyvr112h",lg:"fyvr112i",xl:"fyvr112j"},defaultClass:"fyvr112g"},3:{conditions:{sm:"fyvr112k",md:"fyvr112l",lg:"fyvr112m",xl:"fyvr112n"},defaultClass:"fyvr112k"},4:{conditions:{sm:"fyvr112o",md:"fyvr112p",lg:"fyvr112q",xl:"fyvr112r"},defaultClass:"fyvr112o"},5:{conditions:{sm:"fyvr112s",md:"fyvr112t",lg:"fyvr112u",xl:"fyvr112v"},defaultClass:"fyvr112s"},6:{conditions:{sm:"fyvr112w",md:"fyvr112x",lg:"fyvr112y",xl:"fyvr112z"},defaultClass:"fyvr112w"},7:{conditions:{sm:"fyvr1130",md:"fyvr1131",lg:"fyvr1132",xl:"fyvr1133"},defaultClass:"fyvr1130"},8:{conditions:{sm:"fyvr1134",md:"fyvr1135",lg:"fyvr1136",xl:"fyvr1137"},defaultClass:"fyvr1134"},9:{conditions:{sm:"fyvr1138",md:"fyvr1139",lg:"fyvr113a",xl:"fyvr113b"},defaultClass:"fyvr1138"},10:{conditions:{sm:"fyvr113c",md:"fyvr113d",lg:"fyvr113e",xl:"fyvr113f"},defaultClass:"fyvr113c"},12:{conditions:{sm:"fyvr113g",md:"fyvr113h",lg:"fyvr113i",xl:"fyvr113j"},defaultClass:"fyvr113g"},14:{conditions:{sm:"fyvr113k",md:"fyvr113l",lg:"fyvr113m",xl:"fyvr113n"},defaultClass:"fyvr113k"},16:{conditions:{sm:"fyvr113o",md:"fyvr113p",lg:"fyvr113q",xl:"fyvr113r"},defaultClass:"fyvr113o"},"0.25":{conditions:{sm:"fyvr113s",md:"fyvr113t",lg:"fyvr113u",xl:"fyvr113v"},defaultClass:"fyvr113s"},"0.5":{conditions:{sm:"fyvr113w",md:"fyvr113x",lg:"fyvr113y",xl:"fyvr113z"},defaultClass:"fyvr113w"},"1.5":{conditions:{sm:"fyvr1140",md:"fyvr1141",lg:"fyvr1142",xl:"fyvr1143"},defaultClass:"fyvr1140"},auto:{conditions:{sm:"fyvr1144",md:"fyvr1145",lg:"fyvr1146",xl:"fyvr1147"},defaultClass:"fyvr1144"}}},marginLeft:{values:{0:{conditions:{sm:"fyvr1148",md:"fyvr1149",lg:"fyvr114a",xl:"fyvr114b"},defaultClass:"fyvr1148"},1:{conditions:{sm:"fyvr114c",md:"fyvr114d",lg:"fyvr114e",xl:"fyvr114f"},defaultClass:"fyvr114c"},2:{conditions:{sm:"fyvr114g",md:"fyvr114h",lg:"fyvr114i",xl:"fyvr114j"},defaultClass:"fyvr114g"},3:{conditions:{sm:"fyvr114k",md:"fyvr114l",lg:"fyvr114m",xl:"fyvr114n"},defaultClass:"fyvr114k"},4:{conditions:{sm:"fyvr114o",md:"fyvr114p",lg:"fyvr114q",xl:"fyvr114r"},defaultClass:"fyvr114o"},5:{conditions:{sm:"fyvr114s",md:"fyvr114t",lg:"fyvr114u",xl:"fyvr114v"},defaultClass:"fyvr114s"},6:{conditions:{sm:"fyvr114w",md:"fyvr114x",lg:"fyvr114y",xl:"fyvr114z"},defaultClass:"fyvr114w"},7:{conditions:{sm:"fyvr1150",md:"fyvr1151",lg:"fyvr1152",xl:"fyvr1153"},defaultClass:"fyvr1150"},8:{conditions:{sm:"fyvr1154",md:"fyvr1155",lg:"fyvr1156",xl:"fyvr1157"},defaultClass:"fyvr1154"},9:{conditions:{sm:"fyvr1158",md:"fyvr1159",lg:"fyvr115a",xl:"fyvr115b"},defaultClass:"fyvr1158"},10:{conditions:{sm:"fyvr115c",md:"fyvr115d",lg:"fyvr115e",xl:"fyvr115f"},defaultClass:"fyvr115c"},12:{conditions:{sm:"fyvr115g",md:"fyvr115h",lg:"fyvr115i",xl:"fyvr115j"},defaultClass:"fyvr115g"},14:{conditions:{sm:"fyvr115k",md:"fyvr115l",lg:"fyvr115m",xl:"fyvr115n"},defaultClass:"fyvr115k"},16:{conditions:{sm:"fyvr115o",md:"fyvr115p",lg:"fyvr115q",xl:"fyvr115r"},defaultClass:"fyvr115o"},"0.25":{conditions:{sm:"fyvr115s",md:"fyvr115t",lg:"fyvr115u",xl:"fyvr115v"},defaultClass:"fyvr115s"},"0.5":{conditions:{sm:"fyvr115w",md:"fyvr115x",lg:"fyvr115y",xl:"fyvr115z"},defaultClass:"fyvr115w"},"1.5":{conditions:{sm:"fyvr1160",md:"fyvr1161",lg:"fyvr1162",xl:"fyvr1163"},defaultClass:"fyvr1160"},auto:{conditions:{sm:"fyvr1164",md:"fyvr1165",lg:"fyvr1166",xl:"fyvr1167"},defaultClass:"fyvr1164"}}},marginRight:{values:{0:{conditions:{sm:"fyvr1168",md:"fyvr1169",lg:"fyvr116a",xl:"fyvr116b"},defaultClass:"fyvr1168"},1:{conditions:{sm:"fyvr116c",md:"fyvr116d",lg:"fyvr116e",xl:"fyvr116f"},defaultClass:"fyvr116c"},2:{conditions:{sm:"fyvr116g",md:"fyvr116h",lg:"fyvr116i",xl:"fyvr116j"},defaultClass:"fyvr116g"},3:{conditions:{sm:"fyvr116k",md:"fyvr116l",lg:"fyvr116m",xl:"fyvr116n"},defaultClass:"fyvr116k"},4:{conditions:{sm:"fyvr116o",md:"fyvr116p",lg:"fyvr116q",xl:"fyvr116r"},defaultClass:"fyvr116o"},5:{conditions:{sm:"fyvr116s",md:"fyvr116t",lg:"fyvr116u",xl:"fyvr116v"},defaultClass:"fyvr116s"},6:{conditions:{sm:"fyvr116w",md:"fyvr116x",lg:"fyvr116y",xl:"fyvr116z"},defaultClass:"fyvr116w"},7:{conditions:{sm:"fyvr1170",md:"fyvr1171",lg:"fyvr1172",xl:"fyvr1173"},defaultClass:"fyvr1170"},8:{conditions:{sm:"fyvr1174",md:"fyvr1175",lg:"fyvr1176",xl:"fyvr1177"},defaultClass:"fyvr1174"},9:{conditions:{sm:"fyvr1178",md:"fyvr1179",lg:"fyvr117a",xl:"fyvr117b"},defaultClass:"fyvr1178"},10:{conditions:{sm:"fyvr117c",md:"fyvr117d",lg:"fyvr117e",xl:"fyvr117f"},defaultClass:"fyvr117c"},12:{conditions:{sm:"fyvr117g",md:"fyvr117h",lg:"fyvr117i",xl:"fyvr117j"},defaultClass:"fyvr117g"},14:{conditions:{sm:"fyvr117k",md:"fyvr117l",lg:"fyvr117m",xl:"fyvr117n"},defaultClass:"fyvr117k"},16:{conditions:{sm:"fyvr117o",md:"fyvr117p",lg:"fyvr117q",xl:"fyvr117r"},defaultClass:"fyvr117o"},"0.25":{conditions:{sm:"fyvr117s",md:"fyvr117t",lg:"fyvr117u",xl:"fyvr117v"},defaultClass:"fyvr117s"},"0.5":{conditions:{sm:"fyvr117w",md:"fyvr117x",lg:"fyvr117y",xl:"fyvr117z"},defaultClass:"fyvr117w"},"1.5":{conditions:{sm:"fyvr1180",md:"fyvr1181",lg:"fyvr1182",xl:"fyvr1183"},defaultClass:"fyvr1180"},auto:{conditions:{sm:"fyvr1184",md:"fyvr1185",lg:"fyvr1186",xl:"fyvr1187"},defaultClass:"fyvr1184"}}},gap:{values:{0:{conditions:{sm:"fyvr1188",md:"fyvr1189",lg:"fyvr118a",xl:"fyvr118b"},defaultClass:"fyvr1188"},1:{conditions:{sm:"fyvr118c",md:"fyvr118d",lg:"fyvr118e",xl:"fyvr118f"},defaultClass:"fyvr118c"},2:{conditions:{sm:"fyvr118g",md:"fyvr118h",lg:"fyvr118i",xl:"fyvr118j"},defaultClass:"fyvr118g"},3:{conditions:{sm:"fyvr118k",md:"fyvr118l",lg:"fyvr118m",xl:"fyvr118n"},defaultClass:"fyvr118k"},4:{conditions:{sm:"fyvr118o",md:"fyvr118p",lg:"fyvr118q",xl:"fyvr118r"},defaultClass:"fyvr118o"},5:{conditions:{sm:"fyvr118s",md:"fyvr118t",lg:"fyvr118u",xl:"fyvr118v"},defaultClass:"fyvr118s"},6:{conditions:{sm:"fyvr118w",md:"fyvr118x",lg:"fyvr118y",xl:"fyvr118z"},defaultClass:"fyvr118w"},7:{conditions:{sm:"fyvr1190",md:"fyvr1191",lg:"fyvr1192",xl:"fyvr1193"},defaultClass:"fyvr1190"},8:{conditions:{sm:"fyvr1194",md:"fyvr1195",lg:"fyvr1196",xl:"fyvr1197"},defaultClass:"fyvr1194"},9:{conditions:{sm:"fyvr1198",md:"fyvr1199",lg:"fyvr119a",xl:"fyvr119b"},defaultClass:"fyvr1198"},10:{conditions:{sm:"fyvr119c",md:"fyvr119d",lg:"fyvr119e",xl:"fyvr119f"},defaultClass:"fyvr119c"},12:{conditions:{sm:"fyvr119g",md:"fyvr119h",lg:"fyvr119i",xl:"fyvr119j"},defaultClass:"fyvr119g"},14:{conditions:{sm:"fyvr119k",md:"fyvr119l",lg:"fyvr119m",xl:"fyvr119n"},defaultClass:"fyvr119k"},16:{conditions:{sm:"fyvr119o",md:"fyvr119p",lg:"fyvr119q",xl:"fyvr119r"},defaultClass:"fyvr119o"},"0.25":{conditions:{sm:"fyvr119s",md:"fyvr119t",lg:"fyvr119u",xl:"fyvr119v"},defaultClass:"fyvr119s"},"0.5":{conditions:{sm:"fyvr119w",md:"fyvr119x",lg:"fyvr119y",xl:"fyvr119z"},defaultClass:"fyvr119w"},"1.5":{conditions:{sm:"fyvr11a0",md:"fyvr11a1",lg:"fyvr11a2",xl:"fyvr11a3"},defaultClass:"fyvr11a0"}}},borderBottomWidth:{values:{none:{conditions:{sm:"fyvr11a4",md:"fyvr11a5",lg:"fyvr11a6",xl:"fyvr11a7"},defaultClass:"fyvr11a4"},thin:{conditions:{sm:"fyvr11a8",md:"fyvr11a9",lg:"fyvr11aa",xl:"fyvr11ab"},defaultClass:"fyvr11a8"},thick:{conditions:{sm:"fyvr11ac",md:"fyvr11ad",lg:"fyvr11ae",xl:"fyvr11af"},defaultClass:"fyvr11ac"}}},borderLeftWidth:{values:{none:{conditions:{sm:"fyvr11ag",md:"fyvr11ah",lg:"fyvr11ai",xl:"fyvr11aj"},defaultClass:"fyvr11ag"},thin:{conditions:{sm:"fyvr11ak",md:"fyvr11al",lg:"fyvr11am",xl:"fyvr11an"},defaultClass:"fyvr11ak"},thick:{conditions:{sm:"fyvr11ao",md:"fyvr11ap",lg:"fyvr11aq",xl:"fyvr11ar"},defaultClass:"fyvr11ao"}}},borderRightWidth:{values:{none:{conditions:{sm:"fyvr11as",md:"fyvr11at",lg:"fyvr11au",xl:"fyvr11av"},defaultClass:"fyvr11as"},thin:{conditions:{sm:"fyvr11aw",md:"fyvr11ax",lg:"fyvr11ay",xl:"fyvr11az"},defaultClass:"fyvr11aw"},thick:{conditions:{sm:"fyvr11b0",md:"fyvr11b1",lg:"fyvr11b2",xl:"fyvr11b3"},defaultClass:"fyvr11b0"}}},borderTopWidth:{values:{none:{conditions:{sm:"fyvr11b4",md:"fyvr11b5",lg:"fyvr11b6",xl:"fyvr11b7"},defaultClass:"fyvr11b4"},thin:{conditions:{sm:"fyvr11b8",md:"fyvr11b9",lg:"fyvr11ba",xl:"fyvr11bb"},defaultClass:"fyvr11b8"},thick:{conditions:{sm:"fyvr11bc",md:"fyvr11bd",lg:"fyvr11be",xl:"fyvr11bf"},defaultClass:"fyvr11bc"}}},borderBottomLeftRadius:{values:{none:{conditions:{sm:"fyvr11bg",md:"fyvr11bh",lg:"fyvr11bi",xl:"fyvr11bj"},defaultClass:"fyvr11bg"},xs:{conditions:{sm:"fyvr11bk",md:"fyvr11bl",lg:"fyvr11bm",xl:"fyvr11bn"},defaultClass:"fyvr11bk"},sm:{conditions:{sm:"fyvr11bo",md:"fyvr11bp",lg:"fyvr11bq",xl:"fyvr11br"},defaultClass:"fyvr11bo"},md:{conditions:{sm:"fyvr11bs",md:"fyvr11bt",lg:"fyvr11bu",xl:"fyvr11bv"},defaultClass:"fyvr11bs"},lg:{conditions:{sm:"fyvr11bw",md:"fyvr11bx",lg:"fyvr11by",xl:"fyvr11bz"},defaultClass:"fyvr11bw"},circle:{conditions:{sm:"fyvr11c0",md:"fyvr11c1",lg:"fyvr11c2",xl:"fyvr11c3"},defaultClass:"fyvr11c0"}}},borderBottomRightRadius:{values:{none:{conditions:{sm:"fyvr11c4",md:"fyvr11c5",lg:"fyvr11c6",xl:"fyvr11c7"},defaultClass:"fyvr11c4"},xs:{conditions:{sm:"fyvr11c8",md:"fyvr11c9",lg:"fyvr11ca",xl:"fyvr11cb"},defaultClass:"fyvr11c8"},sm:{conditions:{sm:"fyvr11cc",md:"fyvr11cd",lg:"fyvr11ce",xl:"fyvr11cf"},defaultClass:"fyvr11cc"},md:{conditions:{sm:"fyvr11cg",md:"fyvr11ch",lg:"fyvr11ci",xl:"fyvr11cj"},defaultClass:"fyvr11cg"},lg:{conditions:{sm:"fyvr11ck",md:"fyvr11cl",lg:"fyvr11cm",xl:"fyvr11cn"},defaultClass:"fyvr11ck"},circle:{conditions:{sm:"fyvr11co",md:"fyvr11cp",lg:"fyvr11cq",xl:"fyvr11cr"},defaultClass:"fyvr11co"}}},borderTopLeftRadius:{values:{none:{conditions:{sm:"fyvr11cs",md:"fyvr11ct",lg:"fyvr11cu",xl:"fyvr11cv"},defaultClass:"fyvr11cs"},xs:{conditions:{sm:"fyvr11cw",md:"fyvr11cx",lg:"fyvr11cy",xl:"fyvr11cz"},defaultClass:"fyvr11cw"},sm:{conditions:{sm:"fyvr11d0",md:"fyvr11d1",lg:"fyvr11d2",xl:"fyvr11d3"},defaultClass:"fyvr11d0"},md:{conditions:{sm:"fyvr11d4",md:"fyvr11d5",lg:"fyvr11d6",xl:"fyvr11d7"},defaultClass:"fyvr11d4"},lg:{conditions:{sm:"fyvr11d8",md:"fyvr11d9",lg:"fyvr11da",xl:"fyvr11db"},defaultClass:"fyvr11d8"},circle:{conditions:{sm:"fyvr11dc",md:"fyvr11dd",lg:"fyvr11de",xl:"fyvr11df"},defaultClass:"fyvr11dc"}}},borderTopRightRadius:{values:{none:{conditions:{sm:"fyvr11dg",md:"fyvr11dh",lg:"fyvr11di",xl:"fyvr11dj"},defaultClass:"fyvr11dg"},xs:{conditions:{sm:"fyvr11dk",md:"fyvr11dl",lg:"fyvr11dm",xl:"fyvr11dn"},defaultClass:"fyvr11dk"},sm:{conditions:{sm:"fyvr11do",md:"fyvr11dp",lg:"fyvr11dq",xl:"fyvr11dr"},defaultClass:"fyvr11do"},md:{conditions:{sm:"fyvr11ds",md:"fyvr11dt",lg:"fyvr11du",xl:"fyvr11dv"},defaultClass:"fyvr11ds"},lg:{conditions:{sm:"fyvr11dw",md:"fyvr11dx",lg:"fyvr11dy",xl:"fyvr11dz"},defaultClass:"fyvr11dw"},circle:{conditions:{sm:"fyvr11e0",md:"fyvr11e1",lg:"fyvr11e2",xl:"fyvr11e3"},defaultClass:"fyvr11e0"}}},fontSize:{values:{inherit:{conditions:{sm:"fyvr11e4",md:"fyvr11e5",lg:"fyvr11e6",xl:"fyvr11e7"},defaultClass:"fyvr11e4"},xsmall:{conditions:{sm:"fyvr11e8",md:"fyvr11e9",lg:"fyvr11ea",xl:"fyvr11eb"},defaultClass:"fyvr11e8"},small:{conditions:{sm:"fyvr11ec",md:"fyvr11ed",lg:"fyvr11ee",xl:"fyvr11ef"},defaultClass:"fyvr11ec"},normal:{conditions:{sm:"fyvr11eg",md:"fyvr11eh",lg:"fyvr11ei",xl:"fyvr11ej"},defaultClass:"fyvr11eg"},medium:{conditions:{sm:"fyvr11ek",md:"fyvr11el",lg:"fyvr11em",xl:"fyvr11en"},defaultClass:"fyvr11ek"},large:{conditions:{sm:"fyvr11eo",md:"fyvr11ep",lg:"fyvr11eq",xl:"fyvr11er"},defaultClass:"fyvr11eo"},xlarge:{conditions:{sm:"fyvr11es",md:"fyvr11et",lg:"fyvr11eu",xl:"fyvr11ev"},defaultClass:"fyvr11es"}}},fontWeight:{values:{inherit:{conditions:{sm:"fyvr11ew",md:"fyvr11ex",lg:"fyvr11ey",xl:"fyvr11ez"},defaultClass:"fyvr11ew"},normal:{conditions:{sm:"fyvr11f0",md:"fyvr11f1",lg:"fyvr11f2",xl:"fyvr11f3"},defaultClass:"fyvr11f0"},medium:{conditions:{sm:"fyvr11f4",md:"fyvr11f5",lg:"fyvr11f6",xl:"fyvr11f7"},defaultClass:"fyvr11f4"},semibold:{conditions:{sm:"fyvr11f8",md:"fyvr11f9",lg:"fyvr11fa",xl:"fyvr11fb"},defaultClass:"fyvr11f8"},bold:{conditions:{sm:"fyvr11fc",md:"fyvr11fd",lg:"fyvr11fe",xl:"fyvr11ff"},defaultClass:"fyvr11fc"}}},letterSpacing:{values:{inherit:{conditions:{sm:"fyvr11fg",md:"fyvr11fh",lg:"fyvr11fi",xl:"fyvr11fj"},defaultClass:"fyvr11fg"},none:{conditions:{sm:"fyvr11fk",md:"fyvr11fl",lg:"fyvr11fm",xl:"fyvr11fn"},defaultClass:"fyvr11fk"},normal:{conditions:{sm:"fyvr11fo",md:"fyvr11fp",lg:"fyvr11fq",xl:"fyvr11fr"},defaultClass:"fyvr11fo"},wide:{conditions:{sm:"fyvr11fs",md:"fyvr11ft",lg:"fyvr11fu",xl:"fyvr11fv"},defaultClass:"fyvr11fs"}}},lineHeight:{values:{4:{conditions:{sm:"fyvr11fw",md:"fyvr11fx",lg:"fyvr11fy",xl:"fyvr11fz"},defaultClass:"fyvr11fw"},5:{conditions:{sm:"fyvr11g0",md:"fyvr11g1",lg:"fyvr11g2",xl:"fyvr11g3"},defaultClass:"fyvr11g0"},6:{conditions:{sm:"fyvr11g4",md:"fyvr11g5",lg:"fyvr11g6",xl:"fyvr11g7"},defaultClass:"fyvr11g4"},7:{conditions:{sm:"fyvr11g8",md:"fyvr11g9",lg:"fyvr11ga",xl:"fyvr11gb"},defaultClass:"fyvr11g8"},9:{conditions:{sm:"fyvr11gc",md:"fyvr11gd",lg:"fyvr11ge",xl:"fyvr11gf"},defaultClass:"fyvr11gc"},inherit:{conditions:{sm:"fyvr11gg",md:"fyvr11gh",lg:"fyvr11gi",xl:"fyvr11gj"},defaultClass:"fyvr11gg"}}},textAlign:{values:{center:{conditions:{sm:"fyvr11gk",md:"fyvr11gl",lg:"fyvr11gm",xl:"fyvr11gn"},defaultClass:"fyvr11gk"},left:{conditions:{sm:"fyvr11go",md:"fyvr11gp",lg:"fyvr11gq",xl:"fyvr11gr"},defaultClass:"fyvr11go"},right:{conditions:{sm:"fyvr11gs",md:"fyvr11gt",lg:"fyvr11gu",xl:"fyvr11gv"},defaultClass:"fyvr11gs"}}},display:{values:{block:{conditions:{sm:"fyvr11gw",md:"fyvr11gx",lg:"fyvr11gy",xl:"fyvr11gz"},defaultClass:"fyvr11gw"},flex:{conditions:{sm:"fyvr11h0",md:"fyvr11h1",lg:"fyvr11h2",xl:"fyvr11h3"},defaultClass:"fyvr11h0"},grid:{conditions:{sm:"fyvr11h4",md:"fyvr11h5",lg:"fyvr11h6",xl:"fyvr11h7"},defaultClass:"fyvr11h4"},"inline-block":{conditions:{sm:"fyvr11h8",md:"fyvr11h9",lg:"fyvr11ha",xl:"fyvr11hb"},defaultClass:"fyvr11h8"},"inline-flex":{conditions:{sm:"fyvr11hc",md:"fyvr11hd",lg:"fyvr11he",xl:"fyvr11hf"},defaultClass:"fyvr11hc"},none:{conditions:{sm:"fyvr11hg",md:"fyvr11hh",lg:"fyvr11hi",xl:"fyvr11hj"},defaultClass:"fyvr11hg"},contents:{conditions:{sm:"fyvr11hk",md:"fyvr11hl",lg:"fyvr11hm",xl:"fyvr11hn"},defaultClass:"fyvr11hk"}}},position:{values:{absolute:{conditions:{sm:"fyvr11ho",md:"fyvr11hp",lg:"fyvr11hq",xl:"fyvr11hr"},defaultClass:"fyvr11ho"},fixed:{conditions:{sm:"fyvr11hs",md:"fyvr11ht",lg:"fyvr11hu",xl:"fyvr11hv"},defaultClass:"fyvr11hs"},relative:{conditions:{sm:"fyvr11hw",md:"fyvr11hx",lg:"fyvr11hy",xl:"fyvr11hz"},defaultClass:"fyvr11hw"},sticky:{conditions:{sm:"fyvr11i0",md:"fyvr11i1",lg:"fyvr11i2",xl:"fyvr11i3"},defaultClass:"fyvr11i0"}}},flexDirection:{values:{column:{conditions:{sm:"fyvr11i4",md:"fyvr11i5",lg:"fyvr11i6",xl:"fyvr11i7"},defaultClass:"fyvr11i4"},"column-reverse":{conditions:{sm:"fyvr11i8",md:"fyvr11i9",lg:"fyvr11ia",xl:"fyvr11ib"},defaultClass:"fyvr11i8"},row:{conditions:{sm:"fyvr11ic",md:"fyvr11id",lg:"fyvr11ie",xl:"fyvr11if"},defaultClass:"fyvr11ic"},"row-reverse":{conditions:{sm:"fyvr11ig",md:"fyvr11ih",lg:"fyvr11ii",xl:"fyvr11ij"},defaultClass:"fyvr11ig"}}},flexShrink:{values:{0:{conditions:{sm:"fyvr11ik",md:"fyvr11il",lg:"fyvr11im",xl:"fyvr11in"},defaultClass:"fyvr11ik"},1:{conditions:{sm:"fyvr11io",md:"fyvr11ip",lg:"fyvr11iq",xl:"fyvr11ir"},defaultClass:"fyvr11io"}}},flexGrow:{values:{0:{conditions:{sm:"fyvr11is",md:"fyvr11it",lg:"fyvr11iu",xl:"fyvr11iv"},defaultClass:"fyvr11is"},1:{conditions:{sm:"fyvr11iw",md:"fyvr11ix",lg:"fyvr11iy",xl:"fyvr11iz"},defaultClass:"fyvr11iw"}}},flexWrap:{values:{nowrap:{conditions:{sm:"fyvr11j0",md:"fyvr11j1",lg:"fyvr11j2",xl:"fyvr11j3"},defaultClass:"fyvr11j0"},wrap:{conditions:{sm:"fyvr11j4",md:"fyvr11j5",lg:"fyvr11j6",xl:"fyvr11j7"},defaultClass:"fyvr11j4"},"wrap-reverse":{conditions:{sm:"fyvr11j8",md:"fyvr11j9",lg:"fyvr11ja",xl:"fyvr11jb"},defaultClass:"fyvr11j8"}}},justifyContent:{values:{"flex-start":{conditions:{sm:"fyvr11jc",md:"fyvr11jd",lg:"fyvr11je",xl:"fyvr11jf"},defaultClass:"fyvr11jc"},center:{conditions:{sm:"fyvr11jg",md:"fyvr11jh",lg:"fyvr11ji",xl:"fyvr11jj"},defaultClass:"fyvr11jg"},"flex-end":{conditions:{sm:"fyvr11jk",md:"fyvr11jl",lg:"fyvr11jm",xl:"fyvr11jn"},defaultClass:"fyvr11jk"},stretch:{conditions:{sm:"fyvr11jo",md:"fyvr11jp",lg:"fyvr11jq",xl:"fyvr11jr"},defaultClass:"fyvr11jo"},"space-around":{conditions:{sm:"fyvr11js",md:"fyvr11jt",lg:"fyvr11ju",xl:"fyvr11jv"},defaultClass:"fyvr11js"},"space-between":{conditions:{sm:"fyvr11jw",md:"fyvr11jx",lg:"fyvr11jy",xl:"fyvr11jz"},defaultClass:"fyvr11jw"},"space-evenly":{conditions:{sm:"fyvr11k0",md:"fyvr11k1",lg:"fyvr11k2",xl:"fyvr11k3"},defaultClass:"fyvr11k0"}}},justifySelf:{values:{"flex-start":{conditions:{sm:"fyvr11k4",md:"fyvr11k5",lg:"fyvr11k6",xl:"fyvr11k7"},defaultClass:"fyvr11k4"},center:{conditions:{sm:"fyvr11k8",md:"fyvr11k9",lg:"fyvr11ka",xl:"fyvr11kb"},defaultClass:"fyvr11k8"},"flex-end":{conditions:{sm:"fyvr11kc",md:"fyvr11kd",lg:"fyvr11ke",xl:"fyvr11kf"},defaultClass:"fyvr11kc"},stretch:{conditions:{sm:"fyvr11kg",md:"fyvr11kh",lg:"fyvr11ki",xl:"fyvr11kj"},defaultClass:"fyvr11kg"}}},alignItems:{values:{"flex-start":{conditions:{sm:"fyvr11kk",md:"fyvr11kl",lg:"fyvr11km",xl:"fyvr11kn"},defaultClass:"fyvr11kk"},center:{conditions:{sm:"fyvr11ko",md:"fyvr11kp",lg:"fyvr11kq",xl:"fyvr11kr"},defaultClass:"fyvr11ko"},"flex-end":{conditions:{sm:"fyvr11ks",md:"fyvr11kt",lg:"fyvr11ku",xl:"fyvr11kv"},defaultClass:"fyvr11ks"},stretch:{conditions:{sm:"fyvr11kw",md:"fyvr11kx",lg:"fyvr11ky",xl:"fyvr11kz"},defaultClass:"fyvr11kw"},baseline:{conditions:{sm:"fyvr11l0",md:"fyvr11l1",lg:"fyvr11l2",xl:"fyvr11l3"},defaultClass:"fyvr11l0"}}},alignSelf:{values:{"flex-start":{conditions:{sm:"fyvr11l4",md:"fyvr11l5",lg:"fyvr11l6",xl:"fyvr11l7"},defaultClass:"fyvr11l4"},center:{conditions:{sm:"fyvr11l8",md:"fyvr11l9",lg:"fyvr11la",xl:"fyvr11lb"},defaultClass:"fyvr11l8"},"flex-end":{conditions:{sm:"fyvr11lc",md:"fyvr11ld",lg:"fyvr11le",xl:"fyvr11lf"},defaultClass:"fyvr11lc"},stretch:{conditions:{sm:"fyvr11lg",md:"fyvr11lh",lg:"fyvr11li",xl:"fyvr11lj"},defaultClass:"fyvr11lg"},baseline:{conditions:{sm:"fyvr11lk",md:"fyvr11ll",lg:"fyvr11lm",xl:"fyvr11ln"},defaultClass:"fyvr11lk"}}},overflowX:{values:{auto:{conditions:{sm:"fyvr11lo",md:"fyvr11lp",lg:"fyvr11lq",xl:"fyvr11lr"},defaultClass:"fyvr11lo"},hidden:{conditions:{sm:"fyvr11ls",md:"fyvr11lt",lg:"fyvr11lu",xl:"fyvr11lv"},defaultClass:"fyvr11ls"},scroll:{conditions:{sm:"fyvr11lw",md:"fyvr11lx",lg:"fyvr11ly",xl:"fyvr11lz"},defaultClass:"fyvr11lw"},visible:{conditions:{sm:"fyvr11m0",md:"fyvr11m1",lg:"fyvr11m2",xl:"fyvr11m3"},defaultClass:"fyvr11m0"}}},overflowY:{values:{auto:{conditions:{sm:"fyvr11m4",md:"fyvr11m5",lg:"fyvr11m6",xl:"fyvr11m7"},defaultClass:"fyvr11m4"},hidden:{conditions:{sm:"fyvr11m8",md:"fyvr11m9",lg:"fyvr11ma",xl:"fyvr11mb"},defaultClass:"fyvr11m8"},scroll:{conditions:{sm:"fyvr11mc",md:"fyvr11md",lg:"fyvr11me",xl:"fyvr11mf"},defaultClass:"fyvr11mc"},visible:{conditions:{sm:"fyvr11mg",md:"fyvr11mh",lg:"fyvr11mi",xl:"fyvr11mj"},defaultClass:"fyvr11mg"}}},visibility:{values:{hidden:{conditions:{sm:"fyvr11mk",md:"fyvr11ml",lg:"fyvr11mm",xl:"fyvr11mn"},defaultClass:"fyvr11mk"},visible:{conditions:{sm:"fyvr11mo",md:"fyvr11mp",lg:"fyvr11mq",xl:"fyvr11mr"},defaultClass:"fyvr11mo"}}}}},{conditions:void 0,styles:{backdropFilter:{values:{blur:{defaultClass:"fyvr11ms"},none:{defaultClass:"fyvr11mt"}}},fontFamily:{values:{inherit:{defaultClass:"fyvr11mu"},body:{defaultClass:"fyvr11mv"},mono:{defaultClass:"fyvr11mw"}}},textOverflow:{values:{ellipsis:{defaultClass:"fyvr11mx"},clip:{defaultClass:"fyvr11my"}}},textTransform:{values:{capitalize:{defaultClass:"fyvr11mz"},lowercase:{defaultClass:"fyvr11n0"},uppercase:{defaultClass:"fyvr11n1"}}},userSelect:{values:{none:{defaultClass:"fyvr11n2"},text:{defaultClass:"fyvr11n3"},all:{defaultClass:"fyvr11n4"},auto:{defaultClass:"fyvr11n5"}}},whiteSpace:{values:{normal:{defaultClass:"fyvr11n6"},nowrap:{defaultClass:"fyvr11n7"},initial:{defaultClass:"fyvr11n8"},inherit:{defaultClass:"fyvr11n9"}}},wordBreak:{values:{"break-word":{defaultClass:"fyvr11na"}}},wordWrap:{values:{normal:{defaultClass:"fyvr11nb"},"break-word":{defaultClass:"fyvr11nc"},initial:{defaultClass:"fyvr11nd"},inherit:{defaultClass:"fyvr11ne"}}},zIndex:{values:{0:{defaultClass:"fyvr11nf"},1:{defaultClass:"fyvr11ng"},10:{defaultClass:"fyvr11nh"},20:{defaultClass:"fyvr11ni"},30:{defaultClass:"fyvr11nj"},40:{defaultClass:"fyvr11nk"},50:{defaultClass:"fyvr11nl"},"-1":{defaultClass:"fyvr11nm"},auto:{defaultClass:"fyvr11nn"}}},aspectRatio:{values:{"1/1":{defaultClass:"fyvr11no"},"16/9":{defaultClass:"fyvr11np"},"4/3":{defaultClass:"fyvr11nq"},"3/1":{defaultClass:"fyvr11nr"},auto:{defaultClass:"fyvr11ns"}}}}},{conditions:{defaultCondition:"base",conditionNames:["base","active","disabled","focus","hover","checked"],responsiveArray:void 0},styles:{borderColor:{mappings:["borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]},borderStyle:{mappings:["borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle"]},focusRing:{mappings:["boxShadow","outline"]},background:{values:{black:{conditions:{base:"fyvr11nt",active:"fyvr11nu",disabled:"fyvr11nv",focus:"fyvr11nw",hover:"fyvr11nx",checked:"fyvr11ny"},defaultClass:"fyvr11nt"},white:{conditions:{base:"fyvr11nz",active:"fyvr11o0",disabled:"fyvr11o1",focus:"fyvr11o2",hover:"fyvr11o3",checked:"fyvr11o4"},defaultClass:"fyvr11nz"},inherit:{conditions:{base:"fyvr11o5",active:"fyvr11o6",disabled:"fyvr11o7",focus:"fyvr11o8",hover:"fyvr11o9",checked:"fyvr11oa"},defaultClass:"fyvr11o5"},transparent:{conditions:{base:"fyvr11ob",active:"fyvr11oc",disabled:"fyvr11od",focus:"fyvr11oe",hover:"fyvr11of",checked:"fyvr11og"},defaultClass:"fyvr11ob"},positive:{conditions:{base:"fyvr11oh",active:"fyvr11oi",disabled:"fyvr11oj",focus:"fyvr11ok",hover:"fyvr11ol",checked:"fyvr11om"},defaultClass:"fyvr11oh"},negative:{conditions:{base:"fyvr11on",active:"fyvr11oo",disabled:"fyvr11op",focus:"fyvr11oq",hover:"fyvr11or",checked:"fyvr11os"},defaultClass:"fyvr11on"},info:{conditions:{base:"fyvr11ot",active:"fyvr11ou",disabled:"fyvr11ov",focus:"fyvr11ow",hover:"fyvr11ox",checked:"fyvr11oy"},defaultClass:"fyvr11ot"},warning:{conditions:{base:"fyvr11oz",active:"fyvr11p0",disabled:"fyvr11p1",focus:"fyvr11p2",hover:"fyvr11p3",checked:"fyvr11p4"},defaultClass:"fyvr11oz"},gradientBackdrop:{conditions:{base:"fyvr11p5",active:"fyvr11p6",disabled:"fyvr11p7",focus:"fyvr11p8",hover:"fyvr11p9",checked:"fyvr11pa"},defaultClass:"fyvr11p5"},gradientPrimary:{conditions:{base:"fyvr11pb",active:"fyvr11pc",disabled:"fyvr11pd",focus:"fyvr11pe",hover:"fyvr11pf",checked:"fyvr11pg"},defaultClass:"fyvr11pb"},gradientSecondary:{conditions:{base:"fyvr11ph",active:"fyvr11pi",disabled:"fyvr11pj",focus:"fyvr11pk",hover:"fyvr11pl",checked:"fyvr11pm"},defaultClass:"fyvr11ph"},arbitrumDark:{conditions:{base:"fyvr11pn",active:"fyvr11po",disabled:"fyvr11pp",focus:"fyvr11pq",hover:"fyvr11pr",checked:"fyvr11ps"},defaultClass:"fyvr11pn"},arbitrumLight:{conditions:{base:"fyvr11pt",active:"fyvr11pu",disabled:"fyvr11pv",focus:"fyvr11pw",hover:"fyvr11px",checked:"fyvr11py"},defaultClass:"fyvr11pt"},avalanceDark:{conditions:{base:"fyvr11pz",active:"fyvr11q0",disabled:"fyvr11q1",focus:"fyvr11q2",hover:"fyvr11q3",checked:"fyvr11q4"},defaultClass:"fyvr11pz"},avalanceLight:{conditions:{base:"fyvr11q5",active:"fyvr11q6",disabled:"fyvr11q7",focus:"fyvr11q8",hover:"fyvr11q9",checked:"fyvr11qa"},defaultClass:"fyvr11q5"},bscDark:{conditions:{base:"fyvr11qb",active:"fyvr11qc",disabled:"fyvr11qd",focus:"fyvr11qe",hover:"fyvr11qf",checked:"fyvr11qg"},defaultClass:"fyvr11qb"},bscLight:{conditions:{base:"fyvr11qh",active:"fyvr11qi",disabled:"fyvr11qj",focus:"fyvr11qk",hover:"fyvr11ql",checked:"fyvr11qm"},defaultClass:"fyvr11qh"},ethereumDark:{conditions:{base:"fyvr11qn",active:"fyvr11qo",disabled:"fyvr11qp",focus:"fyvr11qq",hover:"fyvr11qr",checked:"fyvr11qs"},defaultClass:"fyvr11qn"},ethereumLight:{conditions:{base:"fyvr11qt",active:"fyvr11qu",disabled:"fyvr11qv",focus:"fyvr11qw",hover:"fyvr11qx",checked:"fyvr11qy"},defaultClass:"fyvr11qt"},gnosisDark:{conditions:{base:"fyvr11qz",active:"fyvr11r0",disabled:"fyvr11r1",focus:"fyvr11r2",hover:"fyvr11r3",checked:"fyvr11r4"},defaultClass:"fyvr11qz"},gnosisLight:{conditions:{base:"fyvr11r5",active:"fyvr11r6",disabled:"fyvr11r7",focus:"fyvr11r8",hover:"fyvr11r9",checked:"fyvr11ra"},defaultClass:"fyvr11r5"},polygonDark:{conditions:{base:"fyvr11rb",active:"fyvr11rc",disabled:"fyvr11rd",focus:"fyvr11re",hover:"fyvr11rf",checked:"fyvr11rg"},defaultClass:"fyvr11rb"},polygonLight:{conditions:{base:"fyvr11rh",active:"fyvr11ri",disabled:"fyvr11rj",focus:"fyvr11rk",hover:"fyvr11rl",checked:"fyvr11rm"},defaultClass:"fyvr11rh"},text100:{conditions:{base:"fyvr11rn",active:"fyvr11ro",disabled:"fyvr11rp",focus:"fyvr11rq",hover:"fyvr11rr",checked:"fyvr11rs"},defaultClass:"fyvr11rn"},text80:{conditions:{base:"fyvr11rt",active:"fyvr11ru",disabled:"fyvr11rv",focus:"fyvr11rw",hover:"fyvr11rx",checked:"fyvr11ry"},defaultClass:"fyvr11rt"},text50:{conditions:{base:"fyvr11rz",active:"fyvr11s0",disabled:"fyvr11s1",focus:"fyvr11s2",hover:"fyvr11s3",checked:"fyvr11s4"},defaultClass:"fyvr11rz"},textInverse100:{conditions:{base:"fyvr11s5",active:"fyvr11s6",disabled:"fyvr11s7",focus:"fyvr11s8",hover:"fyvr11s9",checked:"fyvr11sa"},defaultClass:"fyvr11s5"},backgroundPrimary:{conditions:{base:"fyvr11sb",active:"fyvr11sc",disabled:"fyvr11sd",focus:"fyvr11se",hover:"fyvr11sf",checked:"fyvr11sg"},defaultClass:"fyvr11sb"},backgroundSecondary:{conditions:{base:"fyvr11sh",active:"fyvr11si",disabled:"fyvr11sj",focus:"fyvr11sk",hover:"fyvr11sl",checked:"fyvr11sm"},defaultClass:"fyvr11sh"},backgroundContrast:{conditions:{base:"fyvr11sn",active:"fyvr11so",disabled:"fyvr11sp",focus:"fyvr11sq",hover:"fyvr11sr",checked:"fyvr11ss"},defaultClass:"fyvr11sn"},backgroundMuted:{conditions:{base:"fyvr11st",active:"fyvr11su",disabled:"fyvr11sv",focus:"fyvr11sw",hover:"fyvr11sx",checked:"fyvr11sy"},defaultClass:"fyvr11st"},backgroundControl:{conditions:{base:"fyvr11sz",active:"fyvr11t0",disabled:"fyvr11t1",focus:"fyvr11t2",hover:"fyvr11t3",checked:"fyvr11t4"},defaultClass:"fyvr11sz"},backgroundInverse:{conditions:{base:"fyvr11t5",active:"fyvr11t6",disabled:"fyvr11t7",focus:"fyvr11t8",hover:"fyvr11t9",checked:"fyvr11ta"},defaultClass:"fyvr11t5"},backgroundBackdrop:{conditions:{base:"fyvr11tb",active:"fyvr11tc",disabled:"fyvr11td",focus:"fyvr11te",hover:"fyvr11tf",checked:"fyvr11tg"},defaultClass:"fyvr11tb"},backgroundOverlay:{conditions:{base:"fyvr11th",active:"fyvr11ti",disabled:"fyvr11tj",focus:"fyvr11tk",hover:"fyvr11tl",checked:"fyvr11tm"},defaultClass:"fyvr11th"},backgroundRaised:{conditions:{base:"fyvr11tn",active:"fyvr11to",disabled:"fyvr11tp",focus:"fyvr11tq",hover:"fyvr11tr",checked:"fyvr11ts"},defaultClass:"fyvr11tn"},buttonGlass:{conditions:{base:"fyvr11tt",active:"fyvr11tu",disabled:"fyvr11tv",focus:"fyvr11tw",hover:"fyvr11tx",checked:"fyvr11ty"},defaultClass:"fyvr11tt"},buttonEmphasis:{conditions:{base:"fyvr11tz",active:"fyvr11u0",disabled:"fyvr11u1",focus:"fyvr11u2",hover:"fyvr11u3",checked:"fyvr11u4"},defaultClass:"fyvr11tz"},buttonInverse:{conditions:{base:"fyvr11u5",active:"fyvr11u6",disabled:"fyvr11u7",focus:"fyvr11u8",hover:"fyvr11u9",checked:"fyvr11ua"},defaultClass:"fyvr11u5"},borderNormal:{conditions:{base:"fyvr11ub",active:"fyvr11uc",disabled:"fyvr11ud",focus:"fyvr11ue",hover:"fyvr11uf",checked:"fyvr11ug"},defaultClass:"fyvr11ub"},borderFocus:{conditions:{base:"fyvr11uh",active:"fyvr11ui",disabled:"fyvr11uj",focus:"fyvr11uk",hover:"fyvr11ul",checked:"fyvr11um"},defaultClass:"fyvr11uh"}}},borderBottomColor:{values:{black:{conditions:{base:"fyvr11un",active:"fyvr11uo",disabled:"fyvr11up",focus:"fyvr11uq",hover:"fyvr11ur",checked:"fyvr11us"},defaultClass:"fyvr11un"},white:{conditions:{base:"fyvr11ut",active:"fyvr11uu",disabled:"fyvr11uv",focus:"fyvr11uw",hover:"fyvr11ux",checked:"fyvr11uy"},defaultClass:"fyvr11ut"},inherit:{conditions:{base:"fyvr11uz",active:"fyvr11v0",disabled:"fyvr11v1",focus:"fyvr11v2",hover:"fyvr11v3",checked:"fyvr11v4"},defaultClass:"fyvr11uz"},transparent:{conditions:{base:"fyvr11v5",active:"fyvr11v6",disabled:"fyvr11v7",focus:"fyvr11v8",hover:"fyvr11v9",checked:"fyvr11va"},defaultClass:"fyvr11v5"},positive:{conditions:{base:"fyvr11vb",active:"fyvr11vc",disabled:"fyvr11vd",focus:"fyvr11ve",hover:"fyvr11vf",checked:"fyvr11vg"},defaultClass:"fyvr11vb"},negative:{conditions:{base:"fyvr11vh",active:"fyvr11vi",disabled:"fyvr11vj",focus:"fyvr11vk",hover:"fyvr11vl",checked:"fyvr11vm"},defaultClass:"fyvr11vh"},info:{conditions:{base:"fyvr11vn",active:"fyvr11vo",disabled:"fyvr11vp",focus:"fyvr11vq",hover:"fyvr11vr",checked:"fyvr11vs"},defaultClass:"fyvr11vn"},warning:{conditions:{base:"fyvr11vt",active:"fyvr11vu",disabled:"fyvr11vv",focus:"fyvr11vw",hover:"fyvr11vx",checked:"fyvr11vy"},defaultClass:"fyvr11vt"},gradientBackdrop:{conditions:{base:"fyvr11vz",active:"fyvr11w0",disabled:"fyvr11w1",focus:"fyvr11w2",hover:"fyvr11w3",checked:"fyvr11w4"},defaultClass:"fyvr11vz"},gradientPrimary:{conditions:{base:"fyvr11w5",active:"fyvr11w6",disabled:"fyvr11w7",focus:"fyvr11w8",hover:"fyvr11w9",checked:"fyvr11wa"},defaultClass:"fyvr11w5"},gradientSecondary:{conditions:{base:"fyvr11wb",active:"fyvr11wc",disabled:"fyvr11wd",focus:"fyvr11we",hover:"fyvr11wf",checked:"fyvr11wg"},defaultClass:"fyvr11wb"},arbitrumDark:{conditions:{base:"fyvr11wh",active:"fyvr11wi",disabled:"fyvr11wj",focus:"fyvr11wk",hover:"fyvr11wl",checked:"fyvr11wm"},defaultClass:"fyvr11wh"},arbitrumLight:{conditions:{base:"fyvr11wn",active:"fyvr11wo",disabled:"fyvr11wp",focus:"fyvr11wq",hover:"fyvr11wr",checked:"fyvr11ws"},defaultClass:"fyvr11wn"},avalanceDark:{conditions:{base:"fyvr11wt",active:"fyvr11wu",disabled:"fyvr11wv",focus:"fyvr11ww",hover:"fyvr11wx",checked:"fyvr11wy"},defaultClass:"fyvr11wt"},avalanceLight:{conditions:{base:"fyvr11wz",active:"fyvr11x0",disabled:"fyvr11x1",focus:"fyvr11x2",hover:"fyvr11x3",checked:"fyvr11x4"},defaultClass:"fyvr11wz"},bscDark:{conditions:{base:"fyvr11x5",active:"fyvr11x6",disabled:"fyvr11x7",focus:"fyvr11x8",hover:"fyvr11x9",checked:"fyvr11xa"},defaultClass:"fyvr11x5"},bscLight:{conditions:{base:"fyvr11xb",active:"fyvr11xc",disabled:"fyvr11xd",focus:"fyvr11xe",hover:"fyvr11xf",checked:"fyvr11xg"},defaultClass:"fyvr11xb"},ethereumDark:{conditions:{base:"fyvr11xh",active:"fyvr11xi",disabled:"fyvr11xj",focus:"fyvr11xk",hover:"fyvr11xl",checked:"fyvr11xm"},defaultClass:"fyvr11xh"},ethereumLight:{conditions:{base:"fyvr11xn",active:"fyvr11xo",disabled:"fyvr11xp",focus:"fyvr11xq",hover:"fyvr11xr",checked:"fyvr11xs"},defaultClass:"fyvr11xn"},gnosisDark:{conditions:{base:"fyvr11xt",active:"fyvr11xu",disabled:"fyvr11xv",focus:"fyvr11xw",hover:"fyvr11xx",checked:"fyvr11xy"},defaultClass:"fyvr11xt"},gnosisLight:{conditions:{base:"fyvr11xz",active:"fyvr11y0",disabled:"fyvr11y1",focus:"fyvr11y2",hover:"fyvr11y3",checked:"fyvr11y4"},defaultClass:"fyvr11xz"},polygonDark:{conditions:{base:"fyvr11y5",active:"fyvr11y6",disabled:"fyvr11y7",focus:"fyvr11y8",hover:"fyvr11y9",checked:"fyvr11ya"},defaultClass:"fyvr11y5"},polygonLight:{conditions:{base:"fyvr11yb",active:"fyvr11yc",disabled:"fyvr11yd",focus:"fyvr11ye",hover:"fyvr11yf",checked:"fyvr11yg"},defaultClass:"fyvr11yb"},text100:{conditions:{base:"fyvr11yh",active:"fyvr11yi",disabled:"fyvr11yj",focus:"fyvr11yk",hover:"fyvr11yl",checked:"fyvr11ym"},defaultClass:"fyvr11yh"},text80:{conditions:{base:"fyvr11yn",active:"fyvr11yo",disabled:"fyvr11yp",focus:"fyvr11yq",hover:"fyvr11yr",checked:"fyvr11ys"},defaultClass:"fyvr11yn"},text50:{conditions:{base:"fyvr11yt",active:"fyvr11yu",disabled:"fyvr11yv",focus:"fyvr11yw",hover:"fyvr11yx",checked:"fyvr11yy"},defaultClass:"fyvr11yt"},textInverse100:{conditions:{base:"fyvr11yz",active:"fyvr11z0",disabled:"fyvr11z1",focus:"fyvr11z2",hover:"fyvr11z3",checked:"fyvr11z4"},defaultClass:"fyvr11yz"},backgroundPrimary:{conditions:{base:"fyvr11z5",active:"fyvr11z6",disabled:"fyvr11z7",focus:"fyvr11z8",hover:"fyvr11z9",checked:"fyvr11za"},defaultClass:"fyvr11z5"},backgroundSecondary:{conditions:{base:"fyvr11zb",active:"fyvr11zc",disabled:"fyvr11zd",focus:"fyvr11ze",hover:"fyvr11zf",checked:"fyvr11zg"},defaultClass:"fyvr11zb"},backgroundContrast:{conditions:{base:"fyvr11zh",active:"fyvr11zi",disabled:"fyvr11zj",focus:"fyvr11zk",hover:"fyvr11zl",checked:"fyvr11zm"},defaultClass:"fyvr11zh"},backgroundMuted:{conditions:{base:"fyvr11zn",active:"fyvr11zo",disabled:"fyvr11zp",focus:"fyvr11zq",hover:"fyvr11zr",checked:"fyvr11zs"},defaultClass:"fyvr11zn"},backgroundControl:{conditions:{base:"fyvr11zt",active:"fyvr11zu",disabled:"fyvr11zv",focus:"fyvr11zw",hover:"fyvr11zx",checked:"fyvr11zy"},defaultClass:"fyvr11zt"},backgroundInverse:{conditions:{base:"fyvr11zz",active:"fyvr1200",disabled:"fyvr1201",focus:"fyvr1202",hover:"fyvr1203",checked:"fyvr1204"},defaultClass:"fyvr11zz"},backgroundBackdrop:{conditions:{base:"fyvr1205",active:"fyvr1206",disabled:"fyvr1207",focus:"fyvr1208",hover:"fyvr1209",checked:"fyvr120a"},defaultClass:"fyvr1205"},backgroundOverlay:{conditions:{base:"fyvr120b",active:"fyvr120c",disabled:"fyvr120d",focus:"fyvr120e",hover:"fyvr120f",checked:"fyvr120g"},defaultClass:"fyvr120b"},backgroundRaised:{conditions:{base:"fyvr120h",active:"fyvr120i",disabled:"fyvr120j",focus:"fyvr120k",hover:"fyvr120l",checked:"fyvr120m"},defaultClass:"fyvr120h"},buttonGlass:{conditions:{base:"fyvr120n",active:"fyvr120o",disabled:"fyvr120p",focus:"fyvr120q",hover:"fyvr120r",checked:"fyvr120s"},defaultClass:"fyvr120n"},buttonEmphasis:{conditions:{base:"fyvr120t",active:"fyvr120u",disabled:"fyvr120v",focus:"fyvr120w",hover:"fyvr120x",checked:"fyvr120y"},defaultClass:"fyvr120t"},buttonInverse:{conditions:{base:"fyvr120z",active:"fyvr1210",disabled:"fyvr1211",focus:"fyvr1212",hover:"fyvr1213",checked:"fyvr1214"},defaultClass:"fyvr120z"},borderNormal:{conditions:{base:"fyvr1215",active:"fyvr1216",disabled:"fyvr1217",focus:"fyvr1218",hover:"fyvr1219",checked:"fyvr121a"},defaultClass:"fyvr1215"},borderFocus:{conditions:{base:"fyvr121b",active:"fyvr121c",disabled:"fyvr121d",focus:"fyvr121e",hover:"fyvr121f",checked:"fyvr121g"},defaultClass:"fyvr121b"}}},borderBottomStyle:{values:{solid:{conditions:{base:"fyvr121h",active:"fyvr121i",disabled:"fyvr121j",focus:"fyvr121k",hover:"fyvr121l",checked:"fyvr121m"},defaultClass:"fyvr121h"},dashed:{conditions:{base:"fyvr121n",active:"fyvr121o",disabled:"fyvr121p",focus:"fyvr121q",hover:"fyvr121r",checked:"fyvr121s"},defaultClass:"fyvr121n"},dotted:{conditions:{base:"fyvr121t",active:"fyvr121u",disabled:"fyvr121v",focus:"fyvr121w",hover:"fyvr121x",checked:"fyvr121y"},defaultClass:"fyvr121t"}}},borderLeftColor:{values:{black:{conditions:{base:"fyvr121z",active:"fyvr1220",disabled:"fyvr1221",focus:"fyvr1222",hover:"fyvr1223",checked:"fyvr1224"},defaultClass:"fyvr121z"},white:{conditions:{base:"fyvr1225",active:"fyvr1226",disabled:"fyvr1227",focus:"fyvr1228",hover:"fyvr1229",checked:"fyvr122a"},defaultClass:"fyvr1225"},inherit:{conditions:{base:"fyvr122b",active:"fyvr122c",disabled:"fyvr122d",focus:"fyvr122e",hover:"fyvr122f",checked:"fyvr122g"},defaultClass:"fyvr122b"},transparent:{conditions:{base:"fyvr122h",active:"fyvr122i",disabled:"fyvr122j",focus:"fyvr122k",hover:"fyvr122l",checked:"fyvr122m"},defaultClass:"fyvr122h"},positive:{conditions:{base:"fyvr122n",active:"fyvr122o",disabled:"fyvr122p",focus:"fyvr122q",hover:"fyvr122r",checked:"fyvr122s"},defaultClass:"fyvr122n"},negative:{conditions:{base:"fyvr122t",active:"fyvr122u",disabled:"fyvr122v",focus:"fyvr122w",hover:"fyvr122x",checked:"fyvr122y"},defaultClass:"fyvr122t"},info:{conditions:{base:"fyvr122z",active:"fyvr1230",disabled:"fyvr1231",focus:"fyvr1232",hover:"fyvr1233",checked:"fyvr1234"},defaultClass:"fyvr122z"},warning:{conditions:{base:"fyvr1235",active:"fyvr1236",disabled:"fyvr1237",focus:"fyvr1238",hover:"fyvr1239",checked:"fyvr123a"},defaultClass:"fyvr1235"},gradientBackdrop:{conditions:{base:"fyvr123b",active:"fyvr123c",disabled:"fyvr123d",focus:"fyvr123e",hover:"fyvr123f",checked:"fyvr123g"},defaultClass:"fyvr123b"},gradientPrimary:{conditions:{base:"fyvr123h",active:"fyvr123i",disabled:"fyvr123j",focus:"fyvr123k",hover:"fyvr123l",checked:"fyvr123m"},defaultClass:"fyvr123h"},gradientSecondary:{conditions:{base:"fyvr123n",active:"fyvr123o",disabled:"fyvr123p",focus:"fyvr123q",hover:"fyvr123r",checked:"fyvr123s"},defaultClass:"fyvr123n"},arbitrumDark:{conditions:{base:"fyvr123t",active:"fyvr123u",disabled:"fyvr123v",focus:"fyvr123w",hover:"fyvr123x",checked:"fyvr123y"},defaultClass:"fyvr123t"},arbitrumLight:{conditions:{base:"fyvr123z",active:"fyvr1240",disabled:"fyvr1241",focus:"fyvr1242",hover:"fyvr1243",checked:"fyvr1244"},defaultClass:"fyvr123z"},avalanceDark:{conditions:{base:"fyvr1245",active:"fyvr1246",disabled:"fyvr1247",focus:"fyvr1248",hover:"fyvr1249",checked:"fyvr124a"},defaultClass:"fyvr1245"},avalanceLight:{conditions:{base:"fyvr124b",active:"fyvr124c",disabled:"fyvr124d",focus:"fyvr124e",hover:"fyvr124f",checked:"fyvr124g"},defaultClass:"fyvr124b"},bscDark:{conditions:{base:"fyvr124h",active:"fyvr124i",disabled:"fyvr124j",focus:"fyvr124k",hover:"fyvr124l",checked:"fyvr124m"},defaultClass:"fyvr124h"},bscLight:{conditions:{base:"fyvr124n",active:"fyvr124o",disabled:"fyvr124p",focus:"fyvr124q",hover:"fyvr124r",checked:"fyvr124s"},defaultClass:"fyvr124n"},ethereumDark:{conditions:{base:"fyvr124t",active:"fyvr124u",disabled:"fyvr124v",focus:"fyvr124w",hover:"fyvr124x",checked:"fyvr124y"},defaultClass:"fyvr124t"},ethereumLight:{conditions:{base:"fyvr124z",active:"fyvr1250",disabled:"fyvr1251",focus:"fyvr1252",hover:"fyvr1253",checked:"fyvr1254"},defaultClass:"fyvr124z"},gnosisDark:{conditions:{base:"fyvr1255",active:"fyvr1256",disabled:"fyvr1257",focus:"fyvr1258",hover:"fyvr1259",checked:"fyvr125a"},defaultClass:"fyvr1255"},gnosisLight:{conditions:{base:"fyvr125b",active:"fyvr125c",disabled:"fyvr125d",focus:"fyvr125e",hover:"fyvr125f",checked:"fyvr125g"},defaultClass:"fyvr125b"},polygonDark:{conditions:{base:"fyvr125h",active:"fyvr125i",disabled:"fyvr125j",focus:"fyvr125k",hover:"fyvr125l",checked:"fyvr125m"},defaultClass:"fyvr125h"},polygonLight:{conditions:{base:"fyvr125n",active:"fyvr125o",disabled:"fyvr125p",focus:"fyvr125q",hover:"fyvr125r",checked:"fyvr125s"},defaultClass:"fyvr125n"},text100:{conditions:{base:"fyvr125t",active:"fyvr125u",disabled:"fyvr125v",focus:"fyvr125w",hover:"fyvr125x",checked:"fyvr125y"},defaultClass:"fyvr125t"},text80:{conditions:{base:"fyvr125z",active:"fyvr1260",disabled:"fyvr1261",focus:"fyvr1262",hover:"fyvr1263",checked:"fyvr1264"},defaultClass:"fyvr125z"},text50:{conditions:{base:"fyvr1265",active:"fyvr1266",disabled:"fyvr1267",focus:"fyvr1268",hover:"fyvr1269",checked:"fyvr126a"},defaultClass:"fyvr1265"},textInverse100:{conditions:{base:"fyvr126b",active:"fyvr126c",disabled:"fyvr126d",focus:"fyvr126e",hover:"fyvr126f",checked:"fyvr126g"},defaultClass:"fyvr126b"},backgroundPrimary:{conditions:{base:"fyvr126h",active:"fyvr126i",disabled:"fyvr126j",focus:"fyvr126k",hover:"fyvr126l",checked:"fyvr126m"},defaultClass:"fyvr126h"},backgroundSecondary:{conditions:{base:"fyvr126n",active:"fyvr126o",disabled:"fyvr126p",focus:"fyvr126q",hover:"fyvr126r",checked:"fyvr126s"},defaultClass:"fyvr126n"},backgroundContrast:{conditions:{base:"fyvr126t",active:"fyvr126u",disabled:"fyvr126v",focus:"fyvr126w",hover:"fyvr126x",checked:"fyvr126y"},defaultClass:"fyvr126t"},backgroundMuted:{conditions:{base:"fyvr126z",active:"fyvr1270",disabled:"fyvr1271",focus:"fyvr1272",hover:"fyvr1273",checked:"fyvr1274"},defaultClass:"fyvr126z"},backgroundControl:{conditions:{base:"fyvr1275",active:"fyvr1276",disabled:"fyvr1277",focus:"fyvr1278",hover:"fyvr1279",checked:"fyvr127a"},defaultClass:"fyvr1275"},backgroundInverse:{conditions:{base:"fyvr127b",active:"fyvr127c",disabled:"fyvr127d",focus:"fyvr127e",hover:"fyvr127f",checked:"fyvr127g"},defaultClass:"fyvr127b"},backgroundBackdrop:{conditions:{base:"fyvr127h",active:"fyvr127i",disabled:"fyvr127j",focus:"fyvr127k",hover:"fyvr127l",checked:"fyvr127m"},defaultClass:"fyvr127h"},backgroundOverlay:{conditions:{base:"fyvr127n",active:"fyvr127o",disabled:"fyvr127p",focus:"fyvr127q",hover:"fyvr127r",checked:"fyvr127s"},defaultClass:"fyvr127n"},backgroundRaised:{conditions:{base:"fyvr127t",active:"fyvr127u",disabled:"fyvr127v",focus:"fyvr127w",hover:"fyvr127x",checked:"fyvr127y"},defaultClass:"fyvr127t"},buttonGlass:{conditions:{base:"fyvr127z",active:"fyvr1280",disabled:"fyvr1281",focus:"fyvr1282",hover:"fyvr1283",checked:"fyvr1284"},defaultClass:"fyvr127z"},buttonEmphasis:{conditions:{base:"fyvr1285",active:"fyvr1286",disabled:"fyvr1287",focus:"fyvr1288",hover:"fyvr1289",checked:"fyvr128a"},defaultClass:"fyvr1285"},buttonInverse:{conditions:{base:"fyvr128b",active:"fyvr128c",disabled:"fyvr128d",focus:"fyvr128e",hover:"fyvr128f",checked:"fyvr128g"},defaultClass:"fyvr128b"},borderNormal:{conditions:{base:"fyvr128h",active:"fyvr128i",disabled:"fyvr128j",focus:"fyvr128k",hover:"fyvr128l",checked:"fyvr128m"},defaultClass:"fyvr128h"},borderFocus:{conditions:{base:"fyvr128n",active:"fyvr128o",disabled:"fyvr128p",focus:"fyvr128q",hover:"fyvr128r",checked:"fyvr128s"},defaultClass:"fyvr128n"}}},borderLeftStyle:{values:{solid:{conditions:{base:"fyvr128t",active:"fyvr128u",disabled:"fyvr128v",focus:"fyvr128w",hover:"fyvr128x",checked:"fyvr128y"},defaultClass:"fyvr128t"},dashed:{conditions:{base:"fyvr128z",active:"fyvr1290",disabled:"fyvr1291",focus:"fyvr1292",hover:"fyvr1293",checked:"fyvr1294"},defaultClass:"fyvr128z"},dotted:{conditions:{base:"fyvr1295",active:"fyvr1296",disabled:"fyvr1297",focus:"fyvr1298",hover:"fyvr1299",checked:"fyvr129a"},defaultClass:"fyvr1295"}}},borderRightColor:{values:{black:{conditions:{base:"fyvr129b",active:"fyvr129c",disabled:"fyvr129d",focus:"fyvr129e",hover:"fyvr129f",checked:"fyvr129g"},defaultClass:"fyvr129b"},white:{conditions:{base:"fyvr129h",active:"fyvr129i",disabled:"fyvr129j",focus:"fyvr129k",hover:"fyvr129l",checked:"fyvr129m"},defaultClass:"fyvr129h"},inherit:{conditions:{base:"fyvr129n",active:"fyvr129o",disabled:"fyvr129p",focus:"fyvr129q",hover:"fyvr129r",checked:"fyvr129s"},defaultClass:"fyvr129n"},transparent:{conditions:{base:"fyvr129t",active:"fyvr129u",disabled:"fyvr129v",focus:"fyvr129w",hover:"fyvr129x",checked:"fyvr129y"},defaultClass:"fyvr129t"},positive:{conditions:{base:"fyvr129z",active:"fyvr12a0",disabled:"fyvr12a1",focus:"fyvr12a2",hover:"fyvr12a3",checked:"fyvr12a4"},defaultClass:"fyvr129z"},negative:{conditions:{base:"fyvr12a5",active:"fyvr12a6",disabled:"fyvr12a7",focus:"fyvr12a8",hover:"fyvr12a9",checked:"fyvr12aa"},defaultClass:"fyvr12a5"},info:{conditions:{base:"fyvr12ab",active:"fyvr12ac",disabled:"fyvr12ad",focus:"fyvr12ae",hover:"fyvr12af",checked:"fyvr12ag"},defaultClass:"fyvr12ab"},warning:{conditions:{base:"fyvr12ah",active:"fyvr12ai",disabled:"fyvr12aj",focus:"fyvr12ak",hover:"fyvr12al",checked:"fyvr12am"},defaultClass:"fyvr12ah"},gradientBackdrop:{conditions:{base:"fyvr12an",active:"fyvr12ao",disabled:"fyvr12ap",focus:"fyvr12aq",hover:"fyvr12ar",checked:"fyvr12as"},defaultClass:"fyvr12an"},gradientPrimary:{conditions:{base:"fyvr12at",active:"fyvr12au",disabled:"fyvr12av",focus:"fyvr12aw",hover:"fyvr12ax",checked:"fyvr12ay"},defaultClass:"fyvr12at"},gradientSecondary:{conditions:{base:"fyvr12az",active:"fyvr12b0",disabled:"fyvr12b1",focus:"fyvr12b2",hover:"fyvr12b3",checked:"fyvr12b4"},defaultClass:"fyvr12az"},arbitrumDark:{conditions:{base:"fyvr12b5",active:"fyvr12b6",disabled:"fyvr12b7",focus:"fyvr12b8",hover:"fyvr12b9",checked:"fyvr12ba"},defaultClass:"fyvr12b5"},arbitrumLight:{conditions:{base:"fyvr12bb",active:"fyvr12bc",disabled:"fyvr12bd",focus:"fyvr12be",hover:"fyvr12bf",checked:"fyvr12bg"},defaultClass:"fyvr12bb"},avalanceDark:{conditions:{base:"fyvr12bh",active:"fyvr12bi",disabled:"fyvr12bj",focus:"fyvr12bk",hover:"fyvr12bl",checked:"fyvr12bm"},defaultClass:"fyvr12bh"},avalanceLight:{conditions:{base:"fyvr12bn",active:"fyvr12bo",disabled:"fyvr12bp",focus:"fyvr12bq",hover:"fyvr12br",checked:"fyvr12bs"},defaultClass:"fyvr12bn"},bscDark:{conditions:{base:"fyvr12bt",active:"fyvr12bu",disabled:"fyvr12bv",focus:"fyvr12bw",hover:"fyvr12bx",checked:"fyvr12by"},defaultClass:"fyvr12bt"},bscLight:{conditions:{base:"fyvr12bz",active:"fyvr12c0",disabled:"fyvr12c1",focus:"fyvr12c2",hover:"fyvr12c3",checked:"fyvr12c4"},defaultClass:"fyvr12bz"},ethereumDark:{conditions:{base:"fyvr12c5",active:"fyvr12c6",disabled:"fyvr12c7",focus:"fyvr12c8",hover:"fyvr12c9",checked:"fyvr12ca"},defaultClass:"fyvr12c5"},ethereumLight:{conditions:{base:"fyvr12cb",active:"fyvr12cc",disabled:"fyvr12cd",focus:"fyvr12ce",hover:"fyvr12cf",checked:"fyvr12cg"},defaultClass:"fyvr12cb"},gnosisDark:{conditions:{base:"fyvr12ch",active:"fyvr12ci",disabled:"fyvr12cj",focus:"fyvr12ck",hover:"fyvr12cl",checked:"fyvr12cm"},defaultClass:"fyvr12ch"},gnosisLight:{conditions:{base:"fyvr12cn",active:"fyvr12co",disabled:"fyvr12cp",focus:"fyvr12cq",hover:"fyvr12cr",checked:"fyvr12cs"},defaultClass:"fyvr12cn"},polygonDark:{conditions:{base:"fyvr12ct",active:"fyvr12cu",disabled:"fyvr12cv",focus:"fyvr12cw",hover:"fyvr12cx",checked:"fyvr12cy"},defaultClass:"fyvr12ct"},polygonLight:{conditions:{base:"fyvr12cz",active:"fyvr12d0",disabled:"fyvr12d1",focus:"fyvr12d2",hover:"fyvr12d3",checked:"fyvr12d4"},defaultClass:"fyvr12cz"},text100:{conditions:{base:"fyvr12d5",active:"fyvr12d6",disabled:"fyvr12d7",focus:"fyvr12d8",hover:"fyvr12d9",checked:"fyvr12da"},defaultClass:"fyvr12d5"},text80:{conditions:{base:"fyvr12db",active:"fyvr12dc",disabled:"fyvr12dd",focus:"fyvr12de",hover:"fyvr12df",checked:"fyvr12dg"},defaultClass:"fyvr12db"},text50:{conditions:{base:"fyvr12dh",active:"fyvr12di",disabled:"fyvr12dj",focus:"fyvr12dk",hover:"fyvr12dl",checked:"fyvr12dm"},defaultClass:"fyvr12dh"},textInverse100:{conditions:{base:"fyvr12dn",active:"fyvr12do",disabled:"fyvr12dp",focus:"fyvr12dq",hover:"fyvr12dr",checked:"fyvr12ds"},defaultClass:"fyvr12dn"},backgroundPrimary:{conditions:{base:"fyvr12dt",active:"fyvr12du",disabled:"fyvr12dv",focus:"fyvr12dw",hover:"fyvr12dx",checked:"fyvr12dy"},defaultClass:"fyvr12dt"},backgroundSecondary:{conditions:{base:"fyvr12dz",active:"fyvr12e0",disabled:"fyvr12e1",focus:"fyvr12e2",hover:"fyvr12e3",checked:"fyvr12e4"},defaultClass:"fyvr12dz"},backgroundContrast:{conditions:{base:"fyvr12e5",active:"fyvr12e6",disabled:"fyvr12e7",focus:"fyvr12e8",hover:"fyvr12e9",checked:"fyvr12ea"},defaultClass:"fyvr12e5"},backgroundMuted:{conditions:{base:"fyvr12eb",active:"fyvr12ec",disabled:"fyvr12ed",focus:"fyvr12ee",hover:"fyvr12ef",checked:"fyvr12eg"},defaultClass:"fyvr12eb"},backgroundControl:{conditions:{base:"fyvr12eh",active:"fyvr12ei",disabled:"fyvr12ej",focus:"fyvr12ek",hover:"fyvr12el",checked:"fyvr12em"},defaultClass:"fyvr12eh"},backgroundInverse:{conditions:{base:"fyvr12en",active:"fyvr12eo",disabled:"fyvr12ep",focus:"fyvr12eq",hover:"fyvr12er",checked:"fyvr12es"},defaultClass:"fyvr12en"},backgroundBackdrop:{conditions:{base:"fyvr12et",active:"fyvr12eu",disabled:"fyvr12ev",focus:"fyvr12ew",hover:"fyvr12ex",checked:"fyvr12ey"},defaultClass:"fyvr12et"},backgroundOverlay:{conditions:{base:"fyvr12ez",active:"fyvr12f0",disabled:"fyvr12f1",focus:"fyvr12f2",hover:"fyvr12f3",checked:"fyvr12f4"},defaultClass:"fyvr12ez"},backgroundRaised:{conditions:{base:"fyvr12f5",active:"fyvr12f6",disabled:"fyvr12f7",focus:"fyvr12f8",hover:"fyvr12f9",checked:"fyvr12fa"},defaultClass:"fyvr12f5"},buttonGlass:{conditions:{base:"fyvr12fb",active:"fyvr12fc",disabled:"fyvr12fd",focus:"fyvr12fe",hover:"fyvr12ff",checked:"fyvr12fg"},defaultClass:"fyvr12fb"},buttonEmphasis:{conditions:{base:"fyvr12fh",active:"fyvr12fi",disabled:"fyvr12fj",focus:"fyvr12fk",hover:"fyvr12fl",checked:"fyvr12fm"},defaultClass:"fyvr12fh"},buttonInverse:{conditions:{base:"fyvr12fn",active:"fyvr12fo",disabled:"fyvr12fp",focus:"fyvr12fq",hover:"fyvr12fr",checked:"fyvr12fs"},defaultClass:"fyvr12fn"},borderNormal:{conditions:{base:"fyvr12ft",active:"fyvr12fu",disabled:"fyvr12fv",focus:"fyvr12fw",hover:"fyvr12fx",checked:"fyvr12fy"},defaultClass:"fyvr12ft"},borderFocus:{conditions:{base:"fyvr12fz",active:"fyvr12g0",disabled:"fyvr12g1",focus:"fyvr12g2",hover:"fyvr12g3",checked:"fyvr12g4"},defaultClass:"fyvr12fz"}}},borderRightStyle:{values:{solid:{conditions:{base:"fyvr12g5",active:"fyvr12g6",disabled:"fyvr12g7",focus:"fyvr12g8",hover:"fyvr12g9",checked:"fyvr12ga"},defaultClass:"fyvr12g5"},dashed:{conditions:{base:"fyvr12gb",active:"fyvr12gc",disabled:"fyvr12gd",focus:"fyvr12ge",hover:"fyvr12gf",checked:"fyvr12gg"},defaultClass:"fyvr12gb"},dotted:{conditions:{base:"fyvr12gh",active:"fyvr12gi",disabled:"fyvr12gj",focus:"fyvr12gk",hover:"fyvr12gl",checked:"fyvr12gm"},defaultClass:"fyvr12gh"}}},borderTopColor:{values:{black:{conditions:{base:"fyvr12gn",active:"fyvr12go",disabled:"fyvr12gp",focus:"fyvr12gq",hover:"fyvr12gr",checked:"fyvr12gs"},defaultClass:"fyvr12gn"},white:{conditions:{base:"fyvr12gt",active:"fyvr12gu",disabled:"fyvr12gv",focus:"fyvr12gw",hover:"fyvr12gx",checked:"fyvr12gy"},defaultClass:"fyvr12gt"},inherit:{conditions:{base:"fyvr12gz",active:"fyvr12h0",disabled:"fyvr12h1",focus:"fyvr12h2",hover:"fyvr12h3",checked:"fyvr12h4"},defaultClass:"fyvr12gz"},transparent:{conditions:{base:"fyvr12h5",active:"fyvr12h6",disabled:"fyvr12h7",focus:"fyvr12h8",hover:"fyvr12h9",checked:"fyvr12ha"},defaultClass:"fyvr12h5"},positive:{conditions:{base:"fyvr12hb",active:"fyvr12hc",disabled:"fyvr12hd",focus:"fyvr12he",hover:"fyvr12hf",checked:"fyvr12hg"},defaultClass:"fyvr12hb"},negative:{conditions:{base:"fyvr12hh",active:"fyvr12hi",disabled:"fyvr12hj",focus:"fyvr12hk",hover:"fyvr12hl",checked:"fyvr12hm"},defaultClass:"fyvr12hh"},info:{conditions:{base:"fyvr12hn",active:"fyvr12ho",disabled:"fyvr12hp",focus:"fyvr12hq",hover:"fyvr12hr",checked:"fyvr12hs"},defaultClass:"fyvr12hn"},warning:{conditions:{base:"fyvr12ht",active:"fyvr12hu",disabled:"fyvr12hv",focus:"fyvr12hw",hover:"fyvr12hx",checked:"fyvr12hy"},defaultClass:"fyvr12ht"},gradientBackdrop:{conditions:{base:"fyvr12hz",active:"fyvr12i0",disabled:"fyvr12i1",focus:"fyvr12i2",hover:"fyvr12i3",checked:"fyvr12i4"},defaultClass:"fyvr12hz"},gradientPrimary:{conditions:{base:"fyvr12i5",active:"fyvr12i6",disabled:"fyvr12i7",focus:"fyvr12i8",hover:"fyvr12i9",checked:"fyvr12ia"},defaultClass:"fyvr12i5"},gradientSecondary:{conditions:{base:"fyvr12ib",active:"fyvr12ic",disabled:"fyvr12id",focus:"fyvr12ie",hover:"fyvr12if",checked:"fyvr12ig"},defaultClass:"fyvr12ib"},arbitrumDark:{conditions:{base:"fyvr12ih",active:"fyvr12ii",disabled:"fyvr12ij",focus:"fyvr12ik",hover:"fyvr12il",checked:"fyvr12im"},defaultClass:"fyvr12ih"},arbitrumLight:{conditions:{base:"fyvr12in",active:"fyvr12io",disabled:"fyvr12ip",focus:"fyvr12iq",hover:"fyvr12ir",checked:"fyvr12is"},defaultClass:"fyvr12in"},avalanceDark:{conditions:{base:"fyvr12it",active:"fyvr12iu",disabled:"fyvr12iv",focus:"fyvr12iw",hover:"fyvr12ix",checked:"fyvr12iy"},defaultClass:"fyvr12it"},avalanceLight:{conditions:{base:"fyvr12iz",active:"fyvr12j0",disabled:"fyvr12j1",focus:"fyvr12j2",hover:"fyvr12j3",checked:"fyvr12j4"},defaultClass:"fyvr12iz"},bscDark:{conditions:{base:"fyvr12j5",active:"fyvr12j6",disabled:"fyvr12j7",focus:"fyvr12j8",hover:"fyvr12j9",checked:"fyvr12ja"},defaultClass:"fyvr12j5"},bscLight:{conditions:{base:"fyvr12jb",active:"fyvr12jc",disabled:"fyvr12jd",focus:"fyvr12je",hover:"fyvr12jf",checked:"fyvr12jg"},defaultClass:"fyvr12jb"},ethereumDark:{conditions:{base:"fyvr12jh",active:"fyvr12ji",disabled:"fyvr12jj",focus:"fyvr12jk",hover:"fyvr12jl",checked:"fyvr12jm"},defaultClass:"fyvr12jh"},ethereumLight:{conditions:{base:"fyvr12jn",active:"fyvr12jo",disabled:"fyvr12jp",focus:"fyvr12jq",hover:"fyvr12jr",checked:"fyvr12js"},defaultClass:"fyvr12jn"},gnosisDark:{conditions:{base:"fyvr12jt",active:"fyvr12ju",disabled:"fyvr12jv",focus:"fyvr12jw",hover:"fyvr12jx",checked:"fyvr12jy"},defaultClass:"fyvr12jt"},gnosisLight:{conditions:{base:"fyvr12jz",active:"fyvr12k0",disabled:"fyvr12k1",focus:"fyvr12k2",hover:"fyvr12k3",checked:"fyvr12k4"},defaultClass:"fyvr12jz"},polygonDark:{conditions:{base:"fyvr12k5",active:"fyvr12k6",disabled:"fyvr12k7",focus:"fyvr12k8",hover:"fyvr12k9",checked:"fyvr12ka"},defaultClass:"fyvr12k5"},polygonLight:{conditions:{base:"fyvr12kb",active:"fyvr12kc",disabled:"fyvr12kd",focus:"fyvr12ke",hover:"fyvr12kf",checked:"fyvr12kg"},defaultClass:"fyvr12kb"},text100:{conditions:{base:"fyvr12kh",active:"fyvr12ki",disabled:"fyvr12kj",focus:"fyvr12kk",hover:"fyvr12kl",checked:"fyvr12km"},defaultClass:"fyvr12kh"},text80:{conditions:{base:"fyvr12kn",active:"fyvr12ko",disabled:"fyvr12kp",focus:"fyvr12kq",hover:"fyvr12kr",checked:"fyvr12ks"},defaultClass:"fyvr12kn"},text50:{conditions:{base:"fyvr12kt",active:"fyvr12ku",disabled:"fyvr12kv",focus:"fyvr12kw",hover:"fyvr12kx",checked:"fyvr12ky"},defaultClass:"fyvr12kt"},textInverse100:{conditions:{base:"fyvr12kz",active:"fyvr12l0",disabled:"fyvr12l1",focus:"fyvr12l2",hover:"fyvr12l3",checked:"fyvr12l4"},defaultClass:"fyvr12kz"},backgroundPrimary:{conditions:{base:"fyvr12l5",active:"fyvr12l6",disabled:"fyvr12l7",focus:"fyvr12l8",hover:"fyvr12l9",checked:"fyvr12la"},defaultClass:"fyvr12l5"},backgroundSecondary:{conditions:{base:"fyvr12lb",active:"fyvr12lc",disabled:"fyvr12ld",focus:"fyvr12le",hover:"fyvr12lf",checked:"fyvr12lg"},defaultClass:"fyvr12lb"},backgroundContrast:{conditions:{base:"fyvr12lh",active:"fyvr12li",disabled:"fyvr12lj",focus:"fyvr12lk",hover:"fyvr12ll",checked:"fyvr12lm"},defaultClass:"fyvr12lh"},backgroundMuted:{conditions:{base:"fyvr12ln",active:"fyvr12lo",disabled:"fyvr12lp",focus:"fyvr12lq",hover:"fyvr12lr",checked:"fyvr12ls"},defaultClass:"fyvr12ln"},backgroundControl:{conditions:{base:"fyvr12lt",active:"fyvr12lu",disabled:"fyvr12lv",focus:"fyvr12lw",hover:"fyvr12lx",checked:"fyvr12ly"},defaultClass:"fyvr12lt"},backgroundInverse:{conditions:{base:"fyvr12lz",active:"fyvr12m0",disabled:"fyvr12m1",focus:"fyvr12m2",hover:"fyvr12m3",checked:"fyvr12m4"},defaultClass:"fyvr12lz"},backgroundBackdrop:{conditions:{base:"fyvr12m5",active:"fyvr12m6",disabled:"fyvr12m7",focus:"fyvr12m8",hover:"fyvr12m9",checked:"fyvr12ma"},defaultClass:"fyvr12m5"},backgroundOverlay:{conditions:{base:"fyvr12mb",active:"fyvr12mc",disabled:"fyvr12md",focus:"fyvr12me",hover:"fyvr12mf",checked:"fyvr12mg"},defaultClass:"fyvr12mb"},backgroundRaised:{conditions:{base:"fyvr12mh",active:"fyvr12mi",disabled:"fyvr12mj",focus:"fyvr12mk",hover:"fyvr12ml",checked:"fyvr12mm"},defaultClass:"fyvr12mh"},buttonGlass:{conditions:{base:"fyvr12mn",active:"fyvr12mo",disabled:"fyvr12mp",focus:"fyvr12mq",hover:"fyvr12mr",checked:"fyvr12ms"},defaultClass:"fyvr12mn"},buttonEmphasis:{conditions:{base:"fyvr12mt",active:"fyvr12mu",disabled:"fyvr12mv",focus:"fyvr12mw",hover:"fyvr12mx",checked:"fyvr12my"},defaultClass:"fyvr12mt"},buttonInverse:{conditions:{base:"fyvr12mz",active:"fyvr12n0",disabled:"fyvr12n1",focus:"fyvr12n2",hover:"fyvr12n3",checked:"fyvr12n4"},defaultClass:"fyvr12mz"},borderNormal:{conditions:{base:"fyvr12n5",active:"fyvr12n6",disabled:"fyvr12n7",focus:"fyvr12n8",hover:"fyvr12n9",checked:"fyvr12na"},defaultClass:"fyvr12n5"},borderFocus:{conditions:{base:"fyvr12nb",active:"fyvr12nc",disabled:"fyvr12nd",focus:"fyvr12ne",hover:"fyvr12nf",checked:"fyvr12ng"},defaultClass:"fyvr12nb"}}},borderTopStyle:{values:{solid:{conditions:{base:"fyvr12nh",active:"fyvr12ni",disabled:"fyvr12nj",focus:"fyvr12nk",hover:"fyvr12nl",checked:"fyvr12nm"},defaultClass:"fyvr12nh"},dashed:{conditions:{base:"fyvr12nn",active:"fyvr12no",disabled:"fyvr12np",focus:"fyvr12nq",hover:"fyvr12nr",checked:"fyvr12ns"},defaultClass:"fyvr12nn"},dotted:{conditions:{base:"fyvr12nt",active:"fyvr12nu",disabled:"fyvr12nv",focus:"fyvr12nw",hover:"fyvr12nx",checked:"fyvr12ny"},defaultClass:"fyvr12nt"}}},color:{values:{black:{conditions:{base:"fyvr12nz",active:"fyvr12o0",disabled:"fyvr12o1",focus:"fyvr12o2",hover:"fyvr12o3",checked:"fyvr12o4"},defaultClass:"fyvr12nz"},white:{conditions:{base:"fyvr12o5",active:"fyvr12o6",disabled:"fyvr12o7",focus:"fyvr12o8",hover:"fyvr12o9",checked:"fyvr12oa"},defaultClass:"fyvr12o5"},inherit:{conditions:{base:"fyvr12ob",active:"fyvr12oc",disabled:"fyvr12od",focus:"fyvr12oe",hover:"fyvr12of",checked:"fyvr12og"},defaultClass:"fyvr12ob"},transparent:{conditions:{base:"fyvr12oh",active:"fyvr12oi",disabled:"fyvr12oj",focus:"fyvr12ok",hover:"fyvr12ol",checked:"fyvr12om"},defaultClass:"fyvr12oh"},positive:{conditions:{base:"fyvr12on",active:"fyvr12oo",disabled:"fyvr12op",focus:"fyvr12oq",hover:"fyvr12or",checked:"fyvr12os"},defaultClass:"fyvr12on"},negative:{conditions:{base:"fyvr12ot",active:"fyvr12ou",disabled:"fyvr12ov",focus:"fyvr12ow",hover:"fyvr12ox",checked:"fyvr12oy"},defaultClass:"fyvr12ot"},info:{conditions:{base:"fyvr12oz",active:"fyvr12p0",disabled:"fyvr12p1",focus:"fyvr12p2",hover:"fyvr12p3",checked:"fyvr12p4"},defaultClass:"fyvr12oz"},warning:{conditions:{base:"fyvr12p5",active:"fyvr12p6",disabled:"fyvr12p7",focus:"fyvr12p8",hover:"fyvr12p9",checked:"fyvr12pa"},defaultClass:"fyvr12p5"},gradientBackdrop:{conditions:{base:"fyvr12pb",active:"fyvr12pc",disabled:"fyvr12pd",focus:"fyvr12pe",hover:"fyvr12pf",checked:"fyvr12pg"},defaultClass:"fyvr12pb"},gradientPrimary:{conditions:{base:"fyvr12ph",active:"fyvr12pi",disabled:"fyvr12pj",focus:"fyvr12pk",hover:"fyvr12pl",checked:"fyvr12pm"},defaultClass:"fyvr12ph"},gradientSecondary:{conditions:{base:"fyvr12pn",active:"fyvr12po",disabled:"fyvr12pp",focus:"fyvr12pq",hover:"fyvr12pr",checked:"fyvr12ps"},defaultClass:"fyvr12pn"},arbitrumDark:{conditions:{base:"fyvr12pt",active:"fyvr12pu",disabled:"fyvr12pv",focus:"fyvr12pw",hover:"fyvr12px",checked:"fyvr12py"},defaultClass:"fyvr12pt"},arbitrumLight:{conditions:{base:"fyvr12pz",active:"fyvr12q0",disabled:"fyvr12q1",focus:"fyvr12q2",hover:"fyvr12q3",checked:"fyvr12q4"},defaultClass:"fyvr12pz"},avalanceDark:{conditions:{base:"fyvr12q5",active:"fyvr12q6",disabled:"fyvr12q7",focus:"fyvr12q8",hover:"fyvr12q9",checked:"fyvr12qa"},defaultClass:"fyvr12q5"},avalanceLight:{conditions:{base:"fyvr12qb",active:"fyvr12qc",disabled:"fyvr12qd",focus:"fyvr12qe",hover:"fyvr12qf",checked:"fyvr12qg"},defaultClass:"fyvr12qb"},bscDark:{conditions:{base:"fyvr12qh",active:"fyvr12qi",disabled:"fyvr12qj",focus:"fyvr12qk",hover:"fyvr12ql",checked:"fyvr12qm"},defaultClass:"fyvr12qh"},bscLight:{conditions:{base:"fyvr12qn",active:"fyvr12qo",disabled:"fyvr12qp",focus:"fyvr12qq",hover:"fyvr12qr",checked:"fyvr12qs"},defaultClass:"fyvr12qn"},ethereumDark:{conditions:{base:"fyvr12qt",active:"fyvr12qu",disabled:"fyvr12qv",focus:"fyvr12qw",hover:"fyvr12qx",checked:"fyvr12qy"},defaultClass:"fyvr12qt"},ethereumLight:{conditions:{base:"fyvr12qz",active:"fyvr12r0",disabled:"fyvr12r1",focus:"fyvr12r2",hover:"fyvr12r3",checked:"fyvr12r4"},defaultClass:"fyvr12qz"},gnosisDark:{conditions:{base:"fyvr12r5",active:"fyvr12r6",disabled:"fyvr12r7",focus:"fyvr12r8",hover:"fyvr12r9",checked:"fyvr12ra"},defaultClass:"fyvr12r5"},gnosisLight:{conditions:{base:"fyvr12rb",active:"fyvr12rc",disabled:"fyvr12rd",focus:"fyvr12re",hover:"fyvr12rf",checked:"fyvr12rg"},defaultClass:"fyvr12rb"},polygonDark:{conditions:{base:"fyvr12rh",active:"fyvr12ri",disabled:"fyvr12rj",focus:"fyvr12rk",hover:"fyvr12rl",checked:"fyvr12rm"},defaultClass:"fyvr12rh"},polygonLight:{conditions:{base:"fyvr12rn",active:"fyvr12ro",disabled:"fyvr12rp",focus:"fyvr12rq",hover:"fyvr12rr",checked:"fyvr12rs"},defaultClass:"fyvr12rn"},text100:{conditions:{base:"fyvr12rt",active:"fyvr12ru",disabled:"fyvr12rv",focus:"fyvr12rw",hover:"fyvr12rx",checked:"fyvr12ry"},defaultClass:"fyvr12rt"},text80:{conditions:{base:"fyvr12rz",active:"fyvr12s0",disabled:"fyvr12s1",focus:"fyvr12s2",hover:"fyvr12s3",checked:"fyvr12s4"},defaultClass:"fyvr12rz"},text50:{conditions:{base:"fyvr12s5",active:"fyvr12s6",disabled:"fyvr12s7",focus:"fyvr12s8",hover:"fyvr12s9",checked:"fyvr12sa"},defaultClass:"fyvr12s5"},textInverse100:{conditions:{base:"fyvr12sb",active:"fyvr12sc",disabled:"fyvr12sd",focus:"fyvr12se",hover:"fyvr12sf",checked:"fyvr12sg"},defaultClass:"fyvr12sb"},backgroundPrimary:{conditions:{base:"fyvr12sh",active:"fyvr12si",disabled:"fyvr12sj",focus:"fyvr12sk",hover:"fyvr12sl",checked:"fyvr12sm"},defaultClass:"fyvr12sh"},backgroundSecondary:{conditions:{base:"fyvr12sn",active:"fyvr12so",disabled:"fyvr12sp",focus:"fyvr12sq",hover:"fyvr12sr",checked:"fyvr12ss"},defaultClass:"fyvr12sn"},backgroundContrast:{conditions:{base:"fyvr12st",active:"fyvr12su",disabled:"fyvr12sv",focus:"fyvr12sw",hover:"fyvr12sx",checked:"fyvr12sy"},defaultClass:"fyvr12st"},backgroundMuted:{conditions:{base:"fyvr12sz",active:"fyvr12t0",disabled:"fyvr12t1",focus:"fyvr12t2",hover:"fyvr12t3",checked:"fyvr12t4"},defaultClass:"fyvr12sz"},backgroundControl:{conditions:{base:"fyvr12t5",active:"fyvr12t6",disabled:"fyvr12t7",focus:"fyvr12t8",hover:"fyvr12t9",checked:"fyvr12ta"},defaultClass:"fyvr12t5"},backgroundInverse:{conditions:{base:"fyvr12tb",active:"fyvr12tc",disabled:"fyvr12td",focus:"fyvr12te",hover:"fyvr12tf",checked:"fyvr12tg"},defaultClass:"fyvr12tb"},backgroundBackdrop:{conditions:{base:"fyvr12th",active:"fyvr12ti",disabled:"fyvr12tj",focus:"fyvr12tk",hover:"fyvr12tl",checked:"fyvr12tm"},defaultClass:"fyvr12th"},backgroundOverlay:{conditions:{base:"fyvr12tn",active:"fyvr12to",disabled:"fyvr12tp",focus:"fyvr12tq",hover:"fyvr12tr",checked:"fyvr12ts"},defaultClass:"fyvr12tn"},backgroundRaised:{conditions:{base:"fyvr12tt",active:"fyvr12tu",disabled:"fyvr12tv",focus:"fyvr12tw",hover:"fyvr12tx",checked:"fyvr12ty"},defaultClass:"fyvr12tt"},buttonGlass:{conditions:{base:"fyvr12tz",active:"fyvr12u0",disabled:"fyvr12u1",focus:"fyvr12u2",hover:"fyvr12u3",checked:"fyvr12u4"},defaultClass:"fyvr12tz"},buttonEmphasis:{conditions:{base:"fyvr12u5",active:"fyvr12u6",disabled:"fyvr12u7",focus:"fyvr12u8",hover:"fyvr12u9",checked:"fyvr12ua"},defaultClass:"fyvr12u5"},buttonInverse:{conditions:{base:"fyvr12ub",active:"fyvr12uc",disabled:"fyvr12ud",focus:"fyvr12ue",hover:"fyvr12uf",checked:"fyvr12ug"},defaultClass:"fyvr12ub"},borderNormal:{conditions:{base:"fyvr12uh",active:"fyvr12ui",disabled:"fyvr12uj",focus:"fyvr12uk",hover:"fyvr12ul",checked:"fyvr12um"},defaultClass:"fyvr12uh"},borderFocus:{conditions:{base:"fyvr12un",active:"fyvr12uo",disabled:"fyvr12up",focus:"fyvr12uq",hover:"fyvr12ur",checked:"fyvr12us"},defaultClass:"fyvr12un"}}},cursor:{values:{default:{conditions:{base:"fyvr12ut",active:"fyvr12uu",disabled:"fyvr12uv",focus:"fyvr12uw",hover:"fyvr12ux",checked:"fyvr12uy"},defaultClass:"fyvr12ut"},pointer:{conditions:{base:"fyvr12uz",active:"fyvr12v0",disabled:"fyvr12v1",focus:"fyvr12v2",hover:"fyvr12v3",checked:"fyvr12v4"},defaultClass:"fyvr12uz"},text:{conditions:{base:"fyvr12v5",active:"fyvr12v6",disabled:"fyvr12v7",focus:"fyvr12v8",hover:"fyvr12v9",checked:"fyvr12va"},defaultClass:"fyvr12v5"}}},opacity:{values:{0:{conditions:{base:"fyvr12vb",active:"fyvr12vc",disabled:"fyvr12vd",focus:"fyvr12ve",hover:"fyvr12vf",checked:"fyvr12vg"},defaultClass:"fyvr12vb"},50:{conditions:{base:"fyvr12vh",active:"fyvr12vi",disabled:"fyvr12vj",focus:"fyvr12vk",hover:"fyvr12vl",checked:"fyvr12vm"},defaultClass:"fyvr12vh"},80:{conditions:{base:"fyvr12vn",active:"fyvr12vo",disabled:"fyvr12vp",focus:"fyvr12vq",hover:"fyvr12vr",checked:"fyvr12vs"},defaultClass:"fyvr12vn"},100:{conditions:{base:"fyvr12vt",active:"fyvr12vu",disabled:"fyvr12vv",focus:"fyvr12vw",hover:"fyvr12vx",checked:"fyvr12vy"},defaultClass:"fyvr12vt"}}},pointerEvents:{values:{none:{conditions:{base:"fyvr12vz",active:"fyvr12w0",disabled:"fyvr12w1",focus:"fyvr12w2",hover:"fyvr12w3",checked:"fyvr12w4"},defaultClass:"fyvr12vz"},auto:{conditions:{base:"fyvr12w5",active:"fyvr12w6",disabled:"fyvr12w7",focus:"fyvr12w8",hover:"fyvr12w9",checked:"fyvr12wa"},defaultClass:"fyvr12w5"}}},outline:{values:{none:{conditions:{base:"fyvr12wb",active:"fyvr12wc",disabled:"fyvr12wd",focus:"fyvr12we",hover:"fyvr12wf",checked:"fyvr12wg"},defaultClass:"fyvr12wb"}}},boxShadow:{values:{none:{conditions:{base:"fyvr12wh",active:"fyvr12wi",disabled:"fyvr12wj",focus:"fyvr12wk",hover:"fyvr12wl",checked:"fyvr12wm"},defaultClass:"fyvr12wh"}}}}});const Sie=["alignItems","alignSelf","flexDirection","gap","justifyContent","justifySelf","placeItems"],R6=t=>(t.display||(t.display=Object.keys(t).some(e=>Sie.includes(e))?"flex":void 0),jD(t));R6.properties=jD.properties;function UD(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e{const{as:r="div",sx:n={},className:i,...s}=t,o={},a={};for(const l in s)R6.properties.has(l)?o[l]=s[l]:a[l]=s[l];const c=R6({...o,...n});return k.createElement(r,{className:Ti(c,i),...a,ref:e})});var zD={exports:{}},xh={};/** - * @license React - * react-jsx-runtime.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var WA;function kie(){if(WA)return xh;WA=1;var t=S,e=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(a,c,l){var u,f={},d=null,h=null;l!==void 0&&(d=""+l),c.key!==void 0&&(d=""+c.key),c.ref!==void 0&&(h=c.ref);for(u in c)n.call(c,u)&&!s.hasOwnProperty(u)&&(f[u]=c[u]);if(a&&a.defaultProps)for(u in c=a.defaultProps,c)f[u]===void 0&&(f[u]=c[u]);return{$$typeof:e,type:a,key:d,ref:h,props:f,_owner:i.current}}return xh.Fragment=r,xh.jsx=o,xh.jsxs=o,xh}zD.exports=kie();var Q=zD.exports;function Aie(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function _ie(t){var e=Aie(t,"string");return typeof e=="symbol"?e:String(e)}function Pie(t,e,r){return e=_ie(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function HA(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function qA(t){for(var e=1;e{for(var n of Object.keys(t)){var i;if(t[n]!==((i=e[n])!==null&&i!==void 0?i:r[n]))return!1}return!0},dr=t=>{var e=r=>{var n=t.defaultClassName,i=qA(qA({},t.defaultVariants),r);for(var s in i){var o,a=(o=i[s])!==null&&o!==void 0?o:t.defaultVariants[s];if(a!=null){var c=a;typeof c=="boolean"&&(c=c===!0?"true":"false");var l=t.variantClassNames[s][c];l&&(n+=" "+l)}}for(var[u,f]of t.compoundVariants)Tie(u,i,t.defaultVariants)&&(n+=" "+f);return n};return e.variants=()=>Object.keys(t.variantClassNames),e.classNames={get base(){return t.defaultClassName.split(" ")[0]},get variants(){return VA(t.variantClassNames,r=>VA(r,n=>n.split(" ")[0]))}},e};dr({defaultClassName:"_2q9vfj7",variantClassNames:{variant:{info:"fyvr11ot",warning:"fyvr11oz",success:"fyvr11oh",error:"fyvr11on"},size:{sm:"_1qxj1ib9 fyvr11mv fyvr11ec fyvr11fw fyvr11fs fyvr11f4 fyvr1wo fyvr1yk fyvr13w fyvr1e8",md:"_1qxj1ib9 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 fyvr1ws fyvr1yo fyvr140 fyvr1ec",lg:"_1qxj1ib9 fyvr11mv fyvr11ek fyvr11g4 fyvr11fo fyvr11fc fyvr1ww fyvr1ys fyvr144 fyvr1eg"}},defaultVariants:{},compoundVariants:[]});const i1=t=>{const{color:e="backgroundMuted",marginY:r="4",...n}=t;return Q.jsx(q,{as:"hr",marginY:r,background:e,height:"px",borderWidth:"none",...n})};var Iie=dr({defaultClassName:"_1qxj1ib9",variantClassNames:{variant:{inherit:"fyvr11mu fyvr11e4 fyvr11gg fyvr11fg fyvr11ew",xlarge:"fyvr11mv fyvr11es fyvr11gc fyvr11fk fyvr11fc",large:"fyvr11mv fyvr11eo fyvr11g8 fyvr11fo fyvr11f8",medium:"fyvr11mv fyvr11ek fyvr11g4 fyvr11fo fyvr11fc",normal:"fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0",small:"fyvr11mv fyvr11ec fyvr11fw fyvr11fs fyvr11f4",xsmall:"fyvr11mv fyvr11e8 fyvr11fw fyvr11fs fyvr11fc",code:"fyvr11mw fyvr11eg fyvr11g0 fyvr11fk fyvr11f0"},ellipsis:{true:"fyvr11ls fyvr11m8 fyvr11n7 fyvr11mx"},italic:{true:"_1qxj1ibj"},underline:{true:"_1qxj1ibk"},uppercase:{true:"_1qxj1ibl"},capitalize:{true:"_1qxj1ibm"},hidden:{true:"_1qxj1ibn"}},defaultVariants:{},compoundVariants:[]});const ie=k.forwardRef((t,e)=>{const{as:r="span",variant:n="inherit",className:i,hidden:s,italic:o,underline:a,children:c,ellipsis:l,uppercase:u,capitalize:f,...d}=t,h=yie[n];return Q.jsx(q,{as:r,className:Ti(i,Iie({hidden:s,ellipsis:l,italic:o,underline:a,uppercase:u,capitalize:f})),ref:e,...h,...d,children:c})});var Oie=dr({defaultClassName:"_140wn8ng fyvr11ls fyvr11m8 fyvr11n7 fyvr11ko fyvr11h0",variantClassNames:{variant:{base:"_140wn8nh",feature:"_140wn8ni fyvr11ph fyvr12o5",primary:"fyvr11pb fyvr12o5",glass:"fyvr11tt fyvr12rt",emphasis:"fyvr11tz fyvr12rt",raised:"fyvr11tn fyvr12rt",danger:"fyvr11on fyvr12o5",text:"_140wn8no _1qxj1ib9 fyvr11mv fyvr11ec fyvr11fw fyvr11fs fyvr11f4 fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr11ob fyvr12s5"},shape:{circle:"fyvr11dc fyvr11e0 fyvr11c0 fyvr11co",square:"fyvr11d0 fyvr11do fyvr11bo fyvr11cc"},disabled:{true:"fyvr12ut fyvr12vh",false:"fyvr12uz fyvr12vt fyvr12vr"},size:{xs:"_140wn8nt _1qxj1ib9 fyvr11mv fyvr11e8 fyvr11fw fyvr11fs fyvr11fc fyvr1ws fyvr1yo",sm:"_140wn8nu _1qxj1ib9 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 fyvr1ww fyvr1ys",md:"_140wn8nv _1qxj1ib9 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 fyvr1x0 fyvr1yw",lg:"_140wn8nw _1qxj1ib9 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 fyvr1x0 fyvr1yw"},iconOnly:{true:"_140wn8nx"},hasLeftIcon:{true:"_140wn8ny"},hasRightIcon:{true:"_140wn8nz"},activeOutline:{light:"_140wn8n10",bold:"_140wn8n11"}},defaultVariants:{},compoundVariants:[[{iconOnly:!0,size:"xs"},"_140wn8n12"],[{iconOnly:!0,size:"sm"},"_140wn8n13"],[{iconOnly:!0,size:"md"},"_140wn8n14"],[{iconOnly:!0,size:"lg"},"_140wn8n15"],[{iconOnly:!1,hasLeftIcon:!0,size:"xs"},"_140wn8n16"],[{iconOnly:!1,hasLeftIcon:!0,size:"sm"},"_140wn8n17"],[{iconOnly:!1,hasLeftIcon:!0,size:"md"},"_140wn8n18"],[{iconOnly:!1,hasRightIcon:!0,size:"xs"},"_140wn8n19"],[{iconOnly:!1,hasRightIcon:!0,size:"sm"},"_140wn8n1a"],[{iconOnly:!1,hasRightIcon:!0,size:"md"},"_140wn8n1b"]]});const nt=k.forwardRef((t,e)=>{const{as:r="button",activeOutline:n,className:i,disabled:s=!1,display:o="inline-flex",fontWeight:a="bold",pending:c=!1,label:l,leftIcon:u,rightIcon:f,size:d="md",variant:h="glass",width:p="fit",shape:v="circle",type:m="button",...g}=t,y=u!==void 0&&l!==void 0,b=f!==void 0&&l!==void 0,C=u!==void 0&&l===void 0,A=d==="xs"?"xs":"sm";return Q.jsx(q,{as:r,className:Ti(i,Oie({activeOutline:n,disabled:s||c,hasLeftIcon:y,hasRightIcon:b,iconOnly:C,size:h==="text"?void 0:d,shape:h==="text"?void 0:v,variant:h})),disabled:s||c,display:o,fontWeight:a,ref:e,type:m,width:p,...g,children:C?Q.jsx(u,{size:A}):Q.jsxs(q,{width:"full",height:"full",justifyContent:"space-between",alignItems:"center",gap:d==="xs"?"1":"2",children:[Q.jsxs(q,{justifyContent:"flex-start",alignItems:"center",gap:d==="xs"?"1":"2",children:[u&&Q.jsx(u,{size:A}),Q.jsx(ie,{children:l})]}),f&&Q.jsx(f,{size:A})]})})});var Rie=dr({defaultClassName:"rhmai63",variantClassNames:{clickable:{true:"fyvr12vr fyvr12uz"},disabled:{true:"rhmai65"},outlined:{true:"fyvr11a8 fyvr11ak fyvr11aw fyvr11b8 fyvr12n5 fyvr12ft fyvr1215 fyvr128h fyvr12nh fyvr12g5 fyvr121h fyvr128t"},blur:{true:"fyvr11ms"}},defaultVariants:{},compoundVariants:[]});const Eo=k.forwardRef((t,e)=>{const{className:r,children:n,clickable:i,outlined:s,disabled:o,blur:a,width:c="full",...l}=t;return Q.jsx(q,{className:Ti(r,Rie({clickable:i,outlined:s,disabled:o,blur:a})),background:s?"transparent":"backgroundSecondary",overflow:"hidden",borderRadius:"md",padding:"4",width:c,ref:e,...l,children:n})});function yt(){return yt=Object.assign?Object.assign.bind():function(t){for(var e=1;et.forEach(r=>$ie(r,e))}function Kt(...t){return k.useCallback(WD(...t),t)}function _n(t,e=[]){let r=[];function n(s,o){const a=k.createContext(o),c=r.length;r=[...r,o];function l(f){const{scope:d,children:h,...p}=f,v=(d==null?void 0:d[t][c])||a,m=k.useMemo(()=>p,Object.values(p));return k.createElement(v.Provider,{value:m},h)}function u(f,d){const h=(d==null?void 0:d[t][c])||a,p=k.useContext(h);if(p)return p;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return l.displayName=s+"Provider",[l,u]}const i=()=>{const s=r.map(o=>k.createContext(o));return function(a){const c=(a==null?void 0:a[t])||s;return k.useMemo(()=>({[`__scope${t}`]:{...a,[t]:c}}),[a,c])}};return i.scopeName=t,[n,Mie(i,...e)]}function Mie(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=n.reduce((a,{useScope:c,scopeName:l})=>{const f=c(s)[`__scope${l}`];return{...a,...f}},{});return k.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return r.scopeName=e.scopeName,r}function xe(t,e,{checkForDefaultPrevented:r=!0}={}){return function(i){if(t==null||t(i),r===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function Ki(t){const e=k.useRef(t);return k.useEffect(()=>{e.current=t}),k.useMemo(()=>(...r)=>{var n;return(n=e.current)===null||n===void 0?void 0:n.call(e,...r)},[])}function kc({prop:t,defaultProp:e,onChange:r=()=>{}}){const[n,i]=Nie({defaultProp:e,onChange:r}),s=t!==void 0,o=s?t:n,a=Ki(r),c=k.useCallback(l=>{if(s){const f=typeof l=="function"?l(t):l;f!==t&&a(f)}else i(l)},[s,t,i,a]);return[o,c]}function Nie({defaultProp:t,onChange:e}){const r=k.useState(t),[n]=r,i=k.useRef(n),s=Ki(e);return k.useEffect(()=>{i.current!==n&&(s(n),i.current=n)},[n,i,s]),r}function vb(t){const e=k.useRef({value:t,previous:t});return k.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}const Qi=globalThis!=null&&globalThis.document?k.useLayoutEffect:()=>{};function mb(t){const[e,r]=k.useState(void 0);return Qi(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const c=s.borderBoxSize,l=Array.isArray(c)?c[0]:c;o=l.inlineSize,a=l.blockSize}else o=t.offsetWidth,a=t.offsetHeight;r({width:o,height:a})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}function Die(t,e){return k.useReducer((r,n)=>{const i=e[r][n];return i??r},t)}const Wc=t=>{const{present:e,children:r}=t,n=Lie(e),i=typeof r=="function"?r({present:n.isPresent}):k.Children.only(r),s=Kt(n.ref,i.ref);return typeof r=="function"||n.isPresent?k.cloneElement(i,{ref:s}):null};Wc.displayName="Presence";function Lie(t){const[e,r]=k.useState(),n=k.useRef({}),i=k.useRef(t),s=k.useRef("none"),o=t?"mounted":"unmounted",[a,c]=Die(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return k.useEffect(()=>{const l=fv(n.current);s.current=a==="mounted"?l:"none"},[a]),Qi(()=>{const l=n.current,u=i.current;if(u!==t){const d=s.current,h=fv(l);t?c("MOUNT"):h==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(u&&d!==h?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,c]),Qi(()=>{if(e){const l=f=>{const h=fv(n.current).includes(f.animationName);f.target===e&&h&&$s.flushSync(()=>c("ANIMATION_END"))},u=f=>{f.target===e&&(s.current=fv(n.current))};return e.addEventListener("animationstart",u),e.addEventListener("animationcancel",l),e.addEventListener("animationend",l),()=>{e.removeEventListener("animationstart",u),e.removeEventListener("animationcancel",l),e.removeEventListener("animationend",l)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:k.useCallback(l=>{l&&(n.current=getComputedStyle(l)),r(l)},[])}}function fv(t){return(t==null?void 0:t.animationName)||"none"}function _e(){return _e=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{children:r,...n}=t,i=k.Children.toArray(r),s=i.find(Fie);if(s){const o=s.props.children,a=i.map(c=>c===s?k.Children.count(o)>1?k.Children.only(null):k.isValidElement(o)?o.props.children:null:c);return k.createElement($6,_e({},n,{ref:e}),k.isValidElement(o)?k.cloneElement(o,void 0,a):null)}return k.createElement($6,_e({},n,{ref:e}),r)});od.displayName="Slot";const $6=k.forwardRef((t,e)=>{const{children:r,...n}=t;return k.isValidElement(r)?k.cloneElement(r,{...jie(n,r.props),ref:e?WD(e,r.ref):r.ref}):k.Children.count(r)>1?k.Children.only(null):null});$6.displayName="SlotClone";const Bie=({children:t})=>k.createElement(k.Fragment,null,t);function Fie(t){return k.isValidElement(t)&&t.type===Bie}function jie(t,e){const r={...e};for(const n in e){const i=t[n],s=e[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...a)=>{s(...a),i(...a)}:i&&(r[n]=i):n==="style"?r[n]={...i,...s}:n==="className"&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...t,...r}}const Uie=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],et=Uie.reduce((t,e)=>{const r=k.forwardRef((n,i)=>{const{asChild:s,...o}=n,a=s?od:e;return k.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),k.createElement(a,yt({},o,{ref:i}))});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function OC(t,e){t&&$s.flushSync(()=>t.dispatchEvent(e))}const HD="Checkbox",[zie,iTe]=_n(HD),[Wie,Hie]=zie(HD),qie=k.forwardRef((t,e)=>{const{__scopeCheckbox:r,name:n,checked:i,defaultChecked:s,required:o,disabled:a,value:c="on",onCheckedChange:l,...u}=t,[f,d]=k.useState(null),h=Kt(e,b=>d(b)),p=k.useRef(!1),v=f?!!f.closest("form"):!0,[m=!1,g]=kc({prop:i,defaultProp:s,onChange:l}),y=k.useRef(m);return k.useEffect(()=>{const b=f==null?void 0:f.form;if(b){const C=()=>g(y.current);return b.addEventListener("reset",C),()=>b.removeEventListener("reset",C)}},[f,g]),k.createElement(Wie,{scope:r,state:m,disabled:a},k.createElement(et.button,yt({type:"button",role:"checkbox","aria-checked":Dl(m)?"mixed":m,"aria-required":o,"data-state":qD(m),"data-disabled":a?"":void 0,disabled:a,value:c},u,{ref:h,onKeyDown:xe(t.onKeyDown,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:xe(t.onClick,b=>{g(C=>Dl(C)?!0:!C),v&&(p.current=b.isPropagationStopped(),p.current||b.stopPropagation())})})),v&&k.createElement(Kie,{control:f,bubbles:!p.current,name:n,value:c,checked:m,required:o,disabled:a,style:{transform:"translateX(-100%)"}}))}),Vie="CheckboxIndicator",Gie=k.forwardRef((t,e)=>{const{__scopeCheckbox:r,forceMount:n,...i}=t,s=Hie(Vie,r);return k.createElement(Wc,{present:n||Dl(s.state)||s.state===!0},k.createElement(et.span,yt({"data-state":qD(s.state),"data-disabled":s.disabled?"":void 0},i,{ref:e,style:{pointerEvents:"none",...t.style}})))}),Kie=t=>{const{control:e,checked:r,bubbles:n=!0,...i}=t,s=k.useRef(null),o=vb(r),a=mb(e);return k.useEffect(()=>{const c=s.current,l=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(l,"checked").set;if(o!==r&&f){const d=new Event("click",{bubbles:n});c.indeterminate=Dl(r),f.call(c,Dl(r)?!1:r),c.dispatchEvent(d)}},[o,r,n]),k.createElement("input",yt({type:"checkbox","aria-hidden":!0,defaultChecked:Dl(r)?!1:r},i,{tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function Dl(t){return t==="indeterminate"}function qD(t){return Dl(t)?"indeterminate":t?"checked":"unchecked"}const Qie=qie,Yie=Gie;var Jie=dr({defaultClassName:"_43lu9r4",variantClassNames:{labelLocation:{top:"fyvr11kw fyvr11i4 fyvr118k fyvr11h0",left:"_43lu9r6 fyvr11ko fyvr11ic fyvr118k fyvr11h0",right:"_43lu9r7 fyvr11ko fyvr11ic fyvr118k fyvr11h0",hidden:"fyvr1188 fyvr11h0"}},defaultVariants:{},compoundVariants:[]});const gu=t=>{const{id:e,label:r,description:n,labelLocation:i="top",children:s,...o}=t,a=()=>r||n?Q.jsxs(q,{flexDirection:"column",gap:"0.5",children:[r&&Q.jsx(ie,{variant:"small",color:"text100",hidden:i==="hidden",children:r}),n&&Q.jsx(ie,{variant:"small",color:"text50",hidden:i==="hidden",children:n})]}):null;return Q.jsxs(q,{as:"label",className:Jie({labelLocation:i}),htmlFor:e,...o,children:[["left","top","hidden"].includes(i)&&a(),s,i==="right"&&a()]})};var br=dr({defaultClassName:"_1dizidw0",variantClassNames:{size:{xs:"_1dizidw1",sm:"_1dizidw2",md:"_1dizidw3",lg:"_1dizidw4",xl:"_1dizidw5"}},defaultVariants:{},compoundVariants:[]});const Xie=t=>Q.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Q.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M11.168 9.25V2.929h-1.5V9.25h-6.32v1.5h6.32v6.321h1.5V10.75h6.321v-1.5h-6.32Z",clipRule:"evenodd"})}),Zie=({size:t="sm",...e})=>Q.jsx(q,{as:Xie,className:br({size:t}),...e}),ese=t=>Q.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Q.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m10.888 14.47 1.06 1.06L17.48 10l-5.53-5.53-1.06 1.06 3.719 3.72H4.418v1.5h10.19l-3.72 3.72Z",clipRule:"evenodd"})}),M6=({size:t="sm",...e})=>Q.jsx(q,{as:ese,className:br({size:t}),...e}),tse=t=>Q.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Q.jsx("path",{stroke:"currentColor",strokeWidth:1.5,d:"m4.304 10.232 4.263 4.79 7.13-11.238"})}),Od=({size:t="sm",...e})=>Q.jsx(q,{as:tse,className:br({size:t}),...e}),rse=t=>Q.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Q.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m3.888 7.53 1.06-1.06 5.47 5.47 5.47-5.47 1.06 1.06-6.53 6.53-6.53-6.53Z",clipRule:"evenodd"})}),VD=({size:t="sm",...e})=>Q.jsx(q,{as:rse,className:br({size:t}),...e}),nse=t=>Q.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Q.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m12.888 3.47 1.06 1.06L8.48 10l5.47 5.47-1.061 1.06L6.358 10l6.53-6.53Z",clipRule:"evenodd"})}),yb=({size:t="sm",...e})=>Q.jsx(q,{as:nse,className:br({size:t}),...e}),ise=t=>Q.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Q.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m7.949 16.53-1.061-1.06 5.47-5.47-5.47-5.47 1.06-1.06L14.48 10l-6.53 6.53Z",clipRule:"evenodd"})}),qo=({size:t="sm",...e})=>Q.jsx(q,{as:ise,className:br({size:t}),...e}),sse=t=>Q.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Q.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m10.418 11.06 4.47 4.47 1.06-1.06L11.48 10l4.47-4.47-1.06-1.06-4.47 4.47-4.47-4.47-1.06 1.06L9.357 10l-4.47 4.47 1.06 1.06 4.47-4.47Z",clipRule:"evenodd"})}),bu=({size:t="sm",...e})=>Q.jsx(q,{as:sse,className:br({size:t}),...e}),ose=t=>Q.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Q.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M14.918 4.5h-6V6h4.5v6.5h1.5v-8Zm-1.5 9.5v3h-9V6h3V3h9v11h-3Zm-7.5 1.5v-8h6v8h-6Z",clipRule:"evenodd"})}),gb=({size:t="sm",...e})=>Q.jsx(q,{as:ose,className:br({size:t}),...e}),ase=t=>Q.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Q.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M5 6.714 3.618 3.547H2.5L4.158 7.02H2.98v.69h1.494v.663H2.981v.69h1.494v1.484h1.036V9.063h1.46v-.69h-1.46v-.66l.001-.003h1.46v-.69h-1.13L7.5 3.547H6.383L5 6.714Zm4.747 8.232v-.788a2.887 2.887 0 0 1-1.04-.249 2.04 2.04 0 0 1-.863-.727 2.213 2.213 0 0 1-.344-1.125h1.017c.02.26.098.476.236.65.14.171.319.299.535.383.144.054.297.09.46.109V10.81l-.319-.093c-.538-.157-.964-.388-1.28-.693-.312-.304-.469-.707-.469-1.209 0-.415.105-.777.315-1.086.21-.31.495-.55.853-.72.273-.133.573-.215.9-.246v-.817h.537v.81c.365.023.692.106.981.249.35.17.626.406.827.706.201.298.306.64.315 1.027h-.978a1.04 1.04 0 0 0-.433-.774 1.47 1.47 0 0 0-.712-.264v2.253l.283.079c.214.056.434.132.659.228a2.6 2.6 0 0 1 .627.38c.192.157.347.351.466.583.12.232.18.51.18.834 0 .407-.098.77-.295 1.086a2.006 2.006 0 0 1-.85.749c-.304.15-.66.239-1.07.265v.79h-.538Zm1.024-1.877c-.148.064-.31.106-.486.128v-2.23c.216.064.41.136.584.218.193.089.345.201.457.337.113.136.17.31.17.524 0 .234-.065.44-.194.615-.129.174-.306.31-.531.408ZM9.747 7.706v2.095a4.605 4.605 0 0 1-.246-.086 2.195 2.195 0 0 1-.4-.207 1.038 1.038 0 0 1-.299-.313.847.847 0 0 1-.111-.443.94.94 0 0 1 .164-.545c.112-.162.268-.288.47-.38.126-.059.267-.099.422-.12Zm7.677 10.086h-4.9v-.897h.34a.342.342 0 0 0 .29-.186c.068-.117.114-.254.137-.411.023-.16.032-.304.028-.432l-.027-.779H12.5v-.896h.76l-.043-1.262c-.018-.472.073-.866.273-1.183.203-.317.473-.555.809-.715.335-.16.697-.24 1.084-.24.346 0 .656.056.931.166.278.11.511.26.7.452.191.188.328.404.41.647.081.243.097.498.048.766l-1.01-.156c.023-.22-.014-.403-.11-.55a.891.891 0 0 0-.395-.33 1.31 1.31 0 0 0-1.102.024c-.177.09-.322.227-.434.411-.11.185-.164.42-.164.708l.048 1.261h1.649v.897H14.34l.029.752c.014.29-.025.55-.116.78-.04.1-.096.193-.166.276h3.337v.897Z",clipRule:"evenodd"})}),cse=({size:t="sm",...e})=>Q.jsx(q,{as:ase,className:br({size:t}),...e}),lse=t=>Q.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Q.jsx("path",{fill:"currentColor",d:"m5.285 12.883 6.53-6.53 2.254 2.253-6.531 6.531-2.878.618.625-2.872ZM14.674 8.001l-2.253-2.253 1.502-1.503L16.176 6.5 14.674 8Z"})}),use=({size:t="sm",...e})=>Q.jsx(q,{as:lse,className:br({size:t}),...e}),fse=t=>Q.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:[Q.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeWidth:1.5,d:"M10.906 8.966c1.459 1.316 1.459 3.45 0 4.765l-2.53 2.282c-1.459 1.316-3.824 1.316-5.282 0-1.459-1.315-1.459-3.449 0-4.764l1.265-1.142"}),Q.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeWidth:1.5,d:"M8.094 11c-1.459-1.316-1.459-3.449 0-4.765l2.53-2.282c1.459-1.316 3.823-1.316 5.282 0s1.459 3.449 0 4.765l-1.265 1.14"})]}),dse=({size:t="sm",...e})=>Q.jsx(q,{as:fse,className:br({size:t}),...e}),hse=t=>Q.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Q.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M15.918 14.994v.752A7.003 7.003 0 0 1 6.968 5.05a7.003 7.003 0 0 1 8.95-.796v.752a4.979 4.979 0 0 0-3.293 1.459 5 5 0 0 0 3.293 8.53Zm-4.353-.398c.329.329.684.615 1.059.859a5.5 5.5 0 1 1 0-10.91 6.5 6.5 0 0 0-1.06 10.051Z",clipRule:"evenodd"})}),pse=({size:t="sm",...e})=>Q.jsx(q,{as:hse,className:br({size:t}),...e}),vse=t=>Q.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Q.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M13.283 6.175a4.643 4.643 0 1 0-6.566 6.567l-.708.707a5.644 5.644 0 1 1 7.982 0l-.708-.707a4.644 4.644 0 0 0 0-6.567Zm-5.097 1.47a2.565 2.565 0 0 1 3.628 3.627l.707.707a3.565 3.565 0 1 0-5.042 0l.707-.707a2.565 2.565 0 0 1 0-3.627ZM10 10.959a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm0 .667-1.5 6h3l-1.5-6Z",clipRule:"evenodd"})}),mse=({size:t="sm",...e})=>Q.jsx(q,{as:vse,className:br({size:t}),...e}),yse=t=>Q.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Q.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M6.418 3.6h-2.5v2.5h2.5V3.6Zm0-1.5h1.5v5.5h-5.5V2.1h4Zm0 12h-2.5v2.5h2.5v-2.5Zm0-1.5h1.5v5.5h-5.5v-5.5h4Zm8-9h2.5v2.5h-2.5V3.6Zm4-1.5h-5.5v5.5h5.5V2.1Zm-1.5 12h-2.5v2.5h2.5v-2.5Zm0-1.5h1.5v5.5h-5.5v-5.5h4ZM9.668 2.1v7.25h-7.25v1.5h8.75V2.1h-1.5Zm1.5 10.5v5.5h-1.5v-5.5h1.5Zm1.75-1.75h5.5v-1.5h-5.5v1.5Z",clipRule:"evenodd"})}),gse=({size:t="sm",...e})=>Q.jsx(q,{as:yse,className:br({size:t}),...e}),bse=t=>Q.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Q.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M13.918 9.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm-.677 4.383a5.5 5.5 0 1 1 1.06-1.06l2.648 2.647-1.061 1.06-2.647-2.647Z",clipRule:"evenodd"})}),bb=({size:t="sm",...e})=>Q.jsx(q,{as:bse,className:br({size:t}),...e}),wse=t=>Q.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Q.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M11.529 15.925 9.419 11 4.493 8.89 2.418 8l2.142-.714 11.08-3.693L17.418 3l-.593 1.779-3.693 11.08L12.418 18l-.89-2.075Zm-1.71-6.386L6.635 8.175l6.82-2.273-3.638 3.637Zm1.06 1.061 1.364 3.183 2.273-6.82L10.88 10.6Z",clipRule:"evenodd"})}),wb=({size:t="sm",...e})=>Q.jsx(q,{as:wse,className:br({size:t}),...e}),xse=t=>Q.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Q.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M12.775 5.204a5.465 5.465 0 0 0-1.341-.537L11 2.5H9l-.443 2.214c-.444.128-.866.31-1.257.54L5.404 3.99 3.99 5.404l1.283 1.925c-.212.38-.38.787-.497 1.216L2.5 9v2l2.276.455c.118.429.285.836.497 1.216L3.99 14.596l1.414 1.414L7.3 14.746c.391.23.813.412 1.257.54L9 17.5h2l.434-2.167c.474-.12.925-.302 1.341-.537l1.821 1.214 1.414-1.414-1.195-1.793c.253-.427.45-.891.581-1.382L17.5 11V9l-2.104-.42a5.467 5.467 0 0 0-.581-1.383l1.195-1.793-1.414-1.414-1.82 1.214Zm-.59 2.692a2.976 2.976 0 1 0-4.208 4.208 2.976 2.976 0 0 0 4.209-4.208Z",clipRule:"evenodd"})}),GD=({size:t="sm",...e})=>Q.jsx(q,{as:xse,className:br({size:t}),...e}),Ese=t=>Q.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:[Q.jsx("path",{fill:"currentColor",d:"M4 6.234a.5.5 0 0 0-.5.5v8a.5.5 0 0 0 .5.5h8a.5.5 0 0 0 .5-.5V10.5L14 9v5.734a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h5.769l-1.516 1.5H4Z"}),Q.jsx("path",{stroke:"currentColor",strokeWidth:1.25,d:"M11 3h5v5"}),Q.jsx("path",{stroke:"currentColor",strokeWidth:1.5,d:"m16 3-8 8"})]}),Cse=({size:t="sm",...e})=>Q.jsx(q,{as:Ese,className:br({size:t}),...e}),Sse=t=>Q.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Q.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M9.418 3.25h-5.75v13.5h5.75v-1.5h-4.25V4.75h4.25v-1.5Zm4.53 11.28-1.06-1.06 2.72-2.72h-8.19v-1.5h8.19l-2.72-2.72 1.06-1.06L18.48 10l-4.53 4.53Z",clipRule:"evenodd"})}),KD=({size:t="sm",...e})=>Q.jsx(q,{as:Sse,className:br({size:t}),...e}),kse=t=>Q.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Q.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M16.539 10.75H4.298v-1.5h12.24v1.5Z",clipRule:"evenodd"})}),Ase=({size:t="sm",...e})=>Q.jsx(q,{as:kse,className:br({size:t}),...e}),_se=t=>Q.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:[Q.jsx("path",{fill:"currentColor",d:"M4.633 10.75a5.878 5.878 0 0 1 .008-1.5H2.202v1.5h2.431ZM5.814 6.456A5.854 5.854 0 0 1 6.88 5.401L5.139 3.66l-1.06 1.06 1.735 1.736ZM4.078 15.28l1.711-1.711c.306.398.662.755 1.058 1.063L5.14 16.34l-1.06-1.06ZM9.668 15.802v2.414h1.5V15.8a5.876 5.876 0 0 1-1.5.003ZM13.98 14.623l1.718 1.717 1.06-1.06-1.721-1.723c-.305.4-.66.758-1.056 1.066ZM16.184 10.75h2.45v-1.5h-2.457a5.882 5.882 0 0 1 .007 1.5ZM15.012 6.467l1.747-1.747-1.061-1.06-1.75 1.75c.399.305.756.66 1.064 1.057ZM11.168 4.258V1.784h-1.5v2.472a5.875 5.875 0 0 1 1.5.002Z"}),Q.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M10.418 12.504a2.504 2.504 0 1 0 0-5.008 2.504 2.504 0 0 0 0 5.008Zm0 1.5a4.004 4.004 0 1 0 0-8.008 4.004 4.004 0 0 0 0 8.008Z",clipRule:"evenodd"})]}),Pse=({size:t="sm",...e})=>Q.jsx(q,{as:_se,className:br({size:t}),...e}),Tse=t=>Q.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",...t,children:Q.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"m12.28 2.856-6.71 8.887h4.134l-1.424 6.2 6.887-8.71h-4.322l1.435-6.377Z",clipRule:"evenodd"})}),QD=({size:t="sm",...e})=>Q.jsx(q,{as:Tse,className:br({size:t}),...e});var Ise=dr({defaultClassName:"_1c9x66f1 fyvr11a8 fyvr11ak fyvr11aw fyvr11b8 fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr12nb fyvr12fz fyvr121b fyvr128n fyvr12nh fyvr12g5 fyvr121h fyvr128t fyvr11h0 fyvr11ko fyvr11jg fyvr12vt fyvr12vr fyvr12vj fyvr12uz fyvr12uv",variantClassNames:{size:{sm:"_1c9x66f2",lg:"_1c9x66f3"}},defaultVariants:{},compoundVariants:[]}),Ose=dr({defaultClassName:"_1c9x66f5 fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr12rt fyvr11rz",variantClassNames:{size:{sm:"_1c9x66f6",lg:"_1c9x66f7"}},defaultVariants:{},compoundVariants:[]});const Rse=({size:t="sm"})=>Q.jsx(Yie,{className:Ose({size:t}),children:Q.jsx(Od,{size:t})});k.forwardRef((t,e)=>{const{disabled:r=!1,id:n,name:i,label:s="",labelLocation:o="left",size:a="sm",...c}=t;return Q.jsx(gu,{disabled:r,display:"flex",id:n??i,label:s,labelLocation:o,whiteSpace:"nowrap",children:Q.jsx(Qie,{className:Ise({size:a}),disabled:r,id:n??i,name:i,ref:e,...c,children:Q.jsx(Rse,{})})})});S.createContext(null);const $se=sO["useId".toString()]||(()=>{});let Mse=0;function pc(t){const[e,r]=k.useState($se());return Qi(()=>{t||r(n=>n??String(Mse++))},[t]),t||(e?`radix-${e}`:"")}const YD="Collapsible",[Nse,sTe]=_n(YD);Nse(YD);function xb(t){const e=t+"CollectionProvider",[r,n]=_n(e),[i,s]=r(e,{collectionRef:{current:null},itemMap:new Map}),o=h=>{const{scope:p,children:v}=h,m=S.useRef(null),g=S.useRef(new Map).current;return S.createElement(i,{scope:p,itemMap:g,collectionRef:m},v)},a=t+"CollectionSlot",c=S.forwardRef((h,p)=>{const{scope:v,children:m}=h,g=s(a,v),y=Kt(p,g.collectionRef);return S.createElement(od,{ref:y},m)}),l=t+"CollectionItemSlot",u="data-radix-collection-item",f=S.forwardRef((h,p)=>{const{scope:v,children:m,...g}=h,y=S.useRef(null),b=Kt(p,y),C=s(l,v);return S.useEffect(()=>(C.itemMap.set(y,{ref:y,...g}),()=>void C.itemMap.delete(y))),S.createElement(od,{[u]:"",ref:b},m)});function d(h){const p=s(t+"CollectionConsumer",h);return S.useCallback(()=>{const m=p.collectionRef.current;if(!m)return[];const g=Array.from(m.querySelectorAll(`[${u}]`));return Array.from(p.itemMap.values()).sort((C,A)=>g.indexOf(C.ref.current)-g.indexOf(A.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:o,Slot:c,ItemSlot:f},d,n]}const Dse=k.createContext(void 0);function Eb(t){const e=k.useContext(Dse);return t||e||"ltr"}function Lse(t,e=globalThis==null?void 0:globalThis.document){const r=Ki(t);k.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)},[r,e])}const N6="dismissableLayer.update",Bse="dismissableLayer.pointerDownOutside",Fse="dismissableLayer.focusOutside";let GA;const jse=k.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),RC=k.forwardRef((t,e)=>{var r;const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:c,...l}=t,u=k.useContext(jse),[f,d]=k.useState(null),h=(r=f==null?void 0:f.ownerDocument)!==null&&r!==void 0?r:globalThis==null?void 0:globalThis.document,[,p]=k.useState({}),v=Kt(e,I=>d(I)),m=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(g),b=f?m.indexOf(f):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,A=b>=y,O=Use(I=>{const B=I.target,z=[...u.branches].some(H=>H.contains(B));!A||z||(s==null||s(I),a==null||a(I),I.defaultPrevented||c==null||c())},h),w=zse(I=>{const B=I.target;[...u.branches].some(H=>H.contains(B))||(o==null||o(I),a==null||a(I),I.defaultPrevented||c==null||c())},h);return Lse(I=>{b===u.layers.size-1&&(i==null||i(I),!I.defaultPrevented&&c&&(I.preventDefault(),c()))},h),k.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(GA=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),KA(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=GA)}},[f,h,n,u]),k.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),KA())},[f,u]),k.useEffect(()=>{const I=()=>p({});return document.addEventListener(N6,I),()=>document.removeEventListener(N6,I)},[]),k.createElement(et.div,_e({},l,{ref:v,style:{pointerEvents:C?A?"auto":"none":void 0,...t.style},onFocusCapture:xe(t.onFocusCapture,w.onFocusCapture),onBlurCapture:xe(t.onBlurCapture,w.onBlurCapture),onPointerDownCapture:xe(t.onPointerDownCapture,O.onPointerDownCapture)}))});function Use(t,e=globalThis==null?void 0:globalThis.document){const r=Ki(t),n=k.useRef(!1),i=k.useRef(()=>{});return k.useEffect(()=>{const s=a=>{if(a.target&&!n.current){let c=function(){JD(Bse,r,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=c,e.addEventListener("click",i.current,{once:!0})):c()}else e.removeEventListener("click",i.current);n.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function zse(t,e=globalThis==null?void 0:globalThis.document){const r=Ki(t),n=k.useRef(!1);return k.useEffect(()=>{const i=s=>{s.target&&!n.current&&JD(Fse,r,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function KA(){const t=new CustomEvent(N6);document.dispatchEvent(t)}function JD(t,e,r,{discrete:n}){const i=r.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&i.addEventListener(t,e,{once:!0}),n?OC(i,s):i.dispatchEvent(s)}const Wse=RC;let tx=0;function XD(){k.useEffect(()=>{var t,e;const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(t=r[0])!==null&&t!==void 0?t:QA()),document.body.insertAdjacentElement("beforeend",(e=r[1])!==null&&e!==void 0?e:QA()),tx++,()=>{tx===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),tx--}},[])}function QA(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}const rx="focusScope.autoFocusOnMount",nx="focusScope.autoFocusOnUnmount",YA={bubbles:!1,cancelable:!0},ZD=k.forwardRef((t,e)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=t,[a,c]=k.useState(null),l=Ki(i),u=Ki(s),f=k.useRef(null),d=Kt(e,v=>c(v)),h=k.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;k.useEffect(()=>{if(n){let v=function(b){if(h.paused||!a)return;const C=b.target;a.contains(C)?f.current=C:Da(f.current,{select:!0})},m=function(b){if(h.paused||!a)return;const C=b.relatedTarget;C!==null&&(a.contains(C)||Da(f.current,{select:!0}))},g=function(b){if(document.activeElement===document.body)for(const A of b)A.removedNodes.length>0&&Da(a)};document.addEventListener("focusin",v),document.addEventListener("focusout",m);const y=new MutationObserver(g);return a&&y.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",m),y.disconnect()}}},[n,a,h.paused]),k.useEffect(()=>{if(a){XA.add(h);const v=document.activeElement;if(!a.contains(v)){const g=new CustomEvent(rx,YA);a.addEventListener(rx,l),a.dispatchEvent(g),g.defaultPrevented||(Hse(Qse(eL(a)),{select:!0}),document.activeElement===v&&Da(a))}return()=>{a.removeEventListener(rx,l),setTimeout(()=>{const g=new CustomEvent(nx,YA);a.addEventListener(nx,u),a.dispatchEvent(g),g.defaultPrevented||Da(v??document.body,{select:!0}),a.removeEventListener(nx,u),XA.remove(h)},0)}}},[a,l,u,h]);const p=k.useCallback(v=>{if(!r&&!n||h.paused)return;const m=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,g=document.activeElement;if(m&&g){const y=v.currentTarget,[b,C]=qse(y);b&&C?!v.shiftKey&&g===C?(v.preventDefault(),r&&Da(b,{select:!0})):v.shiftKey&&g===b&&(v.preventDefault(),r&&Da(C,{select:!0})):g===y&&v.preventDefault()}},[r,n,h.paused]);return k.createElement(et.div,_e({tabIndex:-1},o,{ref:d,onKeyDown:p}))});function Hse(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(Da(n,{select:e}),document.activeElement!==r)return}function qse(t){const e=eL(t),r=JA(e,t),n=JA(e.reverse(),t);return[r,n]}function eL(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function JA(t,e){for(const r of t)if(!Vse(r,{upTo:e}))return r}function Vse(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function Gse(t){return t instanceof HTMLInputElement&&"select"in t}function Da(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&Gse(t)&&e&&t.select()}}const XA=Kse();function Kse(){let t=[];return{add(e){const r=t[0];e!==r&&(r==null||r.pause()),t=ZA(t,e),t.unshift(e)},remove(e){var r;t=ZA(t,e),(r=t[0])===null||r===void 0||r.resume()}}}function ZA(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function Qse(t){return t.filter(e=>e.tagName!=="A")}const Yse=["top","right","bottom","left"],Ac=Math.min,pi=Math.max,ky=Math.round,dv=Math.floor,_c=t=>({x:t,y:t}),Jse={left:"right",right:"left",bottom:"top",top:"bottom"},Xse={start:"end",end:"start"};function D6(t,e,r){return pi(t,Ac(e,r))}function ra(t,e){return typeof t=="function"?t(e):t}function na(t){return t.split("-")[0]}function Rd(t){return t.split("-")[1]}function $C(t){return t==="x"?"y":"x"}function MC(t){return t==="y"?"height":"width"}function $d(t){return["top","bottom"].includes(na(t))?"y":"x"}function NC(t){return $C($d(t))}function Zse(t,e,r){r===void 0&&(r=!1);const n=Rd(t),i=NC(t),s=MC(i);let o=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=Ay(o)),[o,Ay(o)]}function eoe(t){const e=Ay(t);return[L6(t),e,L6(e)]}function L6(t){return t.replace(/start|end/g,e=>Xse[e])}function toe(t,e,r){const n=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return r?e?i:n:e?n:i;case"left":case"right":return e?s:o;default:return[]}}function roe(t,e,r,n){const i=Rd(t);let s=toe(na(t),r==="start",n);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(L6)))),s}function Ay(t){return t.replace(/left|right|bottom|top/g,e=>Jse[e])}function noe(t){return{top:0,right:0,bottom:0,left:0,...t}}function tL(t){return typeof t!="number"?noe(t):{top:t,right:t,bottom:t,left:t}}function _y(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function e_(t,e,r){let{reference:n,floating:i}=t;const s=$d(e),o=NC(e),a=MC(o),c=na(e),l=s==="y",u=n.x+n.width/2-i.width/2,f=n.y+n.height/2-i.height/2,d=n[a]/2-i[a]/2;let h;switch(c){case"top":h={x:u,y:n.y-i.height};break;case"bottom":h={x:u,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:f};break;case"left":h={x:n.x-i.width,y:f};break;default:h={x:n.x,y:n.y}}switch(Rd(e)){case"start":h[o]-=d*(r&&l?-1:1);break;case"end":h[o]+=d*(r&&l?-1:1);break}return h}const ioe=async(t,e,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:o}=r,a=s.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(e));let l=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=e_(l,n,c),d=n,h={},p=0;for(let v=0;v({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:i,rects:s,platform:o,elements:a,middlewareData:c}=e,{element:l,padding:u=0}=ra(t,e)||{};if(l==null)return{};const f=tL(u),d={x:r,y:n},h=NC(i),p=MC(h),v=await o.getDimensions(l),m=h==="y",g=m?"top":"left",y=m?"bottom":"right",b=m?"clientHeight":"clientWidth",C=s.reference[p]+s.reference[h]-d[h]-s.floating[p],A=d[h]-s.reference[h],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l));let w=O?O[b]:0;(!w||!await(o.isElement==null?void 0:o.isElement(O)))&&(w=a.floating[b]||s.floating[p]);const I=C/2-A/2,B=w/2-v[p]/2-1,z=Ac(f[g],B),H=Ac(f[y],B),K=z,F=w-v[p]-H,x=w/2-v[p]/2+I,P=D6(K,x,F),$=!c.arrow&&Rd(i)!=null&&x!=P&&s.reference[p]/2-(xK<=0)){var B,z;const K=(((B=s.flip)==null?void 0:B.index)||0)+1,F=A[K];if(F)return{data:{index:K,overflows:I},reset:{placement:F}};let x=(z=I.filter(P=>P.overflows[0]<=0).sort((P,$)=>P.overflows[1]-$.overflows[1])[0])==null?void 0:z.placement;if(!x)switch(h){case"bestFit":{var H;const P=(H=I.map($=>[$.placement,$.overflows.filter(D=>D>0).reduce((D,_)=>D+_,0)]).sort(($,D)=>$[1]-D[1])[0])==null?void 0:H[0];P&&(x=P);break}case"initialPlacement":x=a;break}if(i!==x)return{reset:{placement:x}}}return{}}}};function r_(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function n_(t){return Yse.some(e=>t[e]>=0)}const ooe=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...i}=ra(t,e);switch(n){case"referenceHidden":{const s=await s1(e,{...i,elementContext:"reference"}),o=r_(s,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:n_(o)}}}case"escaped":{const s=await s1(e,{...i,altBoundary:!0}),o=r_(s,r.floating);return{data:{escapedOffsets:o,escaped:n_(o)}}}default:return{}}}}};async function aoe(t,e){const{placement:r,platform:n,elements:i}=t,s=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=na(r),a=Rd(r),c=$d(r)==="y",l=["left","top"].includes(o)?-1:1,u=s&&c?-1:1,f=ra(e,t);let{mainAxis:d,crossAxis:h,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof p=="number"&&(h=a==="end"?p*-1:p),c?{x:h*u,y:d*l}:{x:d*l,y:h*u}}const coe=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){const{x:r,y:n}=e,i=await aoe(e,t);return{x:r+i.x,y:n+i.y,data:i}}}},loe=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:m=>{let{x:g,y}=m;return{x:g,y}}},...c}=ra(t,e),l={x:r,y:n},u=await s1(e,c),f=$d(na(i)),d=$C(f);let h=l[d],p=l[f];if(s){const m=d==="y"?"top":"left",g=d==="y"?"bottom":"right",y=h+u[m],b=h-u[g];h=D6(y,h,b)}if(o){const m=f==="y"?"top":"left",g=f==="y"?"bottom":"right",y=p+u[m],b=p-u[g];p=D6(y,p,b)}const v=a.fn({...e,[d]:h,[f]:p});return{...v,data:{x:v.x-r,y:v.y-n}}}}},uoe=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=ra(t,e),u={x:r,y:n},f=$d(i),d=$C(f);let h=u[d],p=u[f];const v=ra(a,e),m=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const b=d==="y"?"height":"width",C=s.reference[d]-s.floating[b]+m.mainAxis,A=s.reference[d]+s.reference[b]-m.mainAxis;hA&&(h=A)}if(l){var g,y;const b=d==="y"?"width":"height",C=["top","left"].includes(na(i)),A=s.reference[f]-s.floating[b]+(C&&((g=o.offset)==null?void 0:g[f])||0)+(C?0:m.crossAxis),O=s.reference[f]+s.reference[b]+(C?0:((y=o.offset)==null?void 0:y[f])||0)-(C?m.crossAxis:0);pO&&(p=O)}return{[d]:h,[f]:p}}}},foe=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:r,rects:n,platform:i,elements:s}=e,{apply:o=()=>{},...a}=ra(t,e),c=await s1(e,a),l=na(r),u=Rd(r),f=$d(r)==="y",{width:d,height:h}=n.floating;let p,v;l==="top"||l==="bottom"?(p=l,v=u===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(v=l,p=u==="end"?"top":"bottom");const m=h-c[p],g=d-c[v],y=!e.middlewareData.shift;let b=m,C=g;if(f){const O=d-c.left-c.right;C=u||y?Ac(g,O):O}else{const O=h-c.top-c.bottom;b=u||y?Ac(m,O):O}if(y&&!u){const O=pi(c.left,0),w=pi(c.right,0),I=pi(c.top,0),B=pi(c.bottom,0);f?C=d-2*(O!==0||w!==0?O+w:pi(c.left,c.right)):b=h-2*(I!==0||B!==0?I+B:pi(c.top,c.bottom))}await o({...e,availableWidth:C,availableHeight:b});const A=await i.getDimensions(s.floating);return d!==A.width||h!==A.height?{reset:{rects:!0}}:{}}}};function Pc(t){return rL(t)?(t.nodeName||"").toLowerCase():"#document"}function wi(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ba(t){var e;return(e=(rL(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function rL(t){return t instanceof Node||t instanceof wi(t).Node}function ia(t){return t instanceof Element||t instanceof wi(t).Element}function Co(t){return t instanceof HTMLElement||t instanceof wi(t).HTMLElement}function i_(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof wi(t).ShadowRoot}function rp(t){const{overflow:e,overflowX:r,overflowY:n,display:i}=Yi(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!["inline","contents"].includes(i)}function doe(t){return["table","td","th"].includes(Pc(t))}function DC(t){const e=LC(),r=Yi(t);return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function hoe(t){let e=ad(t);for(;Co(e)&&!Cb(e);){if(DC(e))return e;e=ad(e)}return null}function LC(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Cb(t){return["html","body","#document"].includes(Pc(t))}function Yi(t){return wi(t).getComputedStyle(t)}function Sb(t){return ia(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function ad(t){if(Pc(t)==="html")return t;const e=t.assignedSlot||t.parentNode||i_(t)&&t.host||ba(t);return i_(e)?e.host:e}function nL(t){const e=ad(t);return Cb(e)?t.ownerDocument?t.ownerDocument.body:t.body:Co(e)&&rp(e)?e:nL(e)}function o1(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const i=nL(t),s=i===((n=t.ownerDocument)==null?void 0:n.body),o=wi(i);return s?e.concat(o,o.visualViewport||[],rp(i)?i:[],o.frameElement&&r?o1(o.frameElement):[]):e.concat(i,o1(i,[],r))}function iL(t){const e=Yi(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=Co(t),s=i?t.offsetWidth:r,o=i?t.offsetHeight:n,a=ky(r)!==s||ky(n)!==o;return a&&(r=s,n=o),{width:r,height:n,$:a}}function BC(t){return ia(t)?t:t.contextElement}function $f(t){const e=BC(t);if(!Co(e))return _c(1);const r=e.getBoundingClientRect(),{width:n,height:i,$:s}=iL(e);let o=(s?ky(r.width):r.width)/n,a=(s?ky(r.height):r.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const poe=_c(0);function sL(t){const e=wi(t);return!LC()||!e.visualViewport?poe:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function voe(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==wi(t)?!1:e}function tu(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const i=t.getBoundingClientRect(),s=BC(t);let o=_c(1);e&&(n?ia(n)&&(o=$f(n)):o=$f(t));const a=voe(s,r,n)?sL(s):_c(0);let c=(i.left+a.x)/o.x,l=(i.top+a.y)/o.y,u=i.width/o.x,f=i.height/o.y;if(s){const d=wi(s),h=n&&ia(n)?wi(n):n;let p=d.frameElement;for(;p&&n&&h!==d;){const v=$f(p),m=p.getBoundingClientRect(),g=Yi(p),y=m.left+(p.clientLeft+parseFloat(g.paddingLeft))*v.x,b=m.top+(p.clientTop+parseFloat(g.paddingTop))*v.y;c*=v.x,l*=v.y,u*=v.x,f*=v.y,c+=y,l+=b,p=wi(p).frameElement}}return _y({width:u,height:f,x:c,y:l})}function moe(t){let{rect:e,offsetParent:r,strategy:n}=t;const i=Co(r),s=ba(r);if(r===s)return e;let o={scrollLeft:0,scrollTop:0},a=_c(1);const c=_c(0);if((i||!i&&n!=="fixed")&&((Pc(r)!=="body"||rp(s))&&(o=Sb(r)),Co(r))){const l=tu(r);a=$f(r),c.x=l.x+r.clientLeft,c.y=l.y+r.clientTop}return{width:e.width*a.x,height:e.height*a.y,x:e.x*a.x-o.scrollLeft*a.x+c.x,y:e.y*a.y-o.scrollTop*a.y+c.y}}function yoe(t){return Array.from(t.getClientRects())}function oL(t){return tu(ba(t)).left+Sb(t).scrollLeft}function goe(t){const e=ba(t),r=Sb(t),n=t.ownerDocument.body,i=pi(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=pi(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+oL(t);const a=-r.scrollTop;return Yi(n).direction==="rtl"&&(o+=pi(e.clientWidth,n.clientWidth)-i),{width:i,height:s,x:o,y:a}}function boe(t,e){const r=wi(t),n=ba(t),i=r.visualViewport;let s=n.clientWidth,o=n.clientHeight,a=0,c=0;if(i){s=i.width,o=i.height;const l=LC();(!l||l&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:s,height:o,x:a,y:c}}function woe(t,e){const r=tu(t,!0,e==="fixed"),n=r.top+t.clientTop,i=r.left+t.clientLeft,s=Co(t)?$f(t):_c(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,c=i*s.x,l=n*s.y;return{width:o,height:a,x:c,y:l}}function s_(t,e,r){let n;if(e==="viewport")n=boe(t,r);else if(e==="document")n=goe(ba(t));else if(ia(e))n=woe(e,r);else{const i=sL(t);n={...e,x:e.x-i.x,y:e.y-i.y}}return _y(n)}function aL(t,e){const r=ad(t);return r===e||!ia(r)||Cb(r)?!1:Yi(r).position==="fixed"||aL(r,e)}function xoe(t,e){const r=e.get(t);if(r)return r;let n=o1(t,[],!1).filter(a=>ia(a)&&Pc(a)!=="body"),i=null;const s=Yi(t).position==="fixed";let o=s?ad(t):t;for(;ia(o)&&!Cb(o);){const a=Yi(o),c=DC(o);!c&&a.position==="fixed"&&(i=null),(s?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||rp(o)&&!c&&aL(t,o))?n=n.filter(u=>u!==o):i=a,o=ad(o)}return e.set(t,n),n}function Eoe(t){let{element:e,boundary:r,rootBoundary:n,strategy:i}=t;const o=[...r==="clippingAncestors"?xoe(e,this._c):[].concat(r),n],a=o[0],c=o.reduce((l,u)=>{const f=s_(e,u,i);return l.top=pi(f.top,l.top),l.right=Ac(f.right,l.right),l.bottom=Ac(f.bottom,l.bottom),l.left=pi(f.left,l.left),l},s_(e,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Coe(t){return iL(t)}function Soe(t,e,r){const n=Co(e),i=ba(e),s=r==="fixed",o=tu(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const c=_c(0);if(n||!n&&!s)if((Pc(e)!=="body"||rp(i))&&(a=Sb(e)),n){const l=tu(e,!0,s,e);c.x=l.x+e.clientLeft,c.y=l.y+e.clientTop}else i&&(c.x=oL(i));return{x:o.left+a.scrollLeft-c.x,y:o.top+a.scrollTop-c.y,width:o.width,height:o.height}}function o_(t,e){return!Co(t)||Yi(t).position==="fixed"?null:e?e(t):t.offsetParent}function cL(t,e){const r=wi(t);if(!Co(t))return r;let n=o_(t,e);for(;n&&doe(n)&&Yi(n).position==="static";)n=o_(n,e);return n&&(Pc(n)==="html"||Pc(n)==="body"&&Yi(n).position==="static"&&!DC(n))?r:n||hoe(t)||r}const koe=async function(t){let{reference:e,floating:r,strategy:n}=t;const i=this.getOffsetParent||cL,s=this.getDimensions;return{reference:Soe(e,await i(r),n),floating:{x:0,y:0,...await s(r)}}};function Aoe(t){return Yi(t).direction==="rtl"}const _oe={convertOffsetParentRelativeRectToViewportRelativeRect:moe,getDocumentElement:ba,getClippingRect:Eoe,getOffsetParent:cL,getElementRects:koe,getClientRects:yoe,getDimensions:Coe,getScale:$f,isElement:ia,isRTL:Aoe};function Poe(t,e){let r=null,n;const i=ba(t);function s(){clearTimeout(n),r&&r.disconnect(),r=null}function o(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const{left:l,top:u,width:f,height:d}=t.getBoundingClientRect();if(a||e(),!f||!d)return;const h=dv(u),p=dv(i.clientWidth-(l+f)),v=dv(i.clientHeight-(u+d)),m=dv(l),y={rootMargin:-h+"px "+-p+"px "+-v+"px "+-m+"px",threshold:pi(0,Ac(1,c))||1};let b=!0;function C(A){const O=A[0].intersectionRatio;if(O!==c){if(!b)return o();O?o(!1,O):n=setTimeout(()=>{o(!1,1e-7)},100)}b=!1}try{r=new IntersectionObserver(C,{...y,root:i.ownerDocument})}catch{r=new IntersectionObserver(C,y)}r.observe(t)}return o(!0),s}function Toe(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,l=BC(t),u=i||s?[...l?o1(l):[],...o1(e)]:[];u.forEach(g=>{i&&g.addEventListener("scroll",r,{passive:!0}),s&&g.addEventListener("resize",r)});const f=l&&a?Poe(l,r):null;let d=-1,h=null;o&&(h=new ResizeObserver(g=>{let[y]=g;y&&y.target===l&&h&&(h.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{h&&h.observe(e)})),r()}),l&&!c&&h.observe(l),h.observe(e));let p,v=c?tu(t):null;c&&m();function m(){const g=tu(t);v&&(g.x!==v.x||g.y!==v.y||g.width!==v.width||g.height!==v.height)&&r(),v=g,p=requestAnimationFrame(m)}return r(),()=>{u.forEach(g=>{i&&g.removeEventListener("scroll",r),s&&g.removeEventListener("resize",r)}),f&&f(),h&&h.disconnect(),h=null,c&&cancelAnimationFrame(p)}}const Ioe=(t,e,r)=>{const n=new Map,i={platform:_oe,...r},s={...i.platform,_c:n};return ioe(t,e,{...i,platform:s})},Ooe=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:i}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?t_({element:n.current,padding:i}).fn(r):{}:n?t_({element:n,padding:i}).fn(r):{}}}};var sm=typeof document<"u"?k.useLayoutEffect:k.useEffect;function Py(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!Py(t[n],e[n]))return!1;return!0}if(i=Object.keys(t),r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){const s=i[n];if(!(s==="_owner"&&t.$$typeof)&&!Py(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function lL(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function a_(t,e){const r=lL(t);return Math.round(e*r)/r}function c_(t){const e=k.useRef(t);return sm(()=>{e.current=t}),e}function Roe(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:c,open:l}=t,[u,f]=k.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[d,h]=k.useState(n);Py(d,n)||h(n);const[p,v]=k.useState(null),[m,g]=k.useState(null),y=k.useCallback($=>{$!=O.current&&(O.current=$,v($))},[v]),b=k.useCallback($=>{$!==w.current&&(w.current=$,g($))},[g]),C=s||p,A=o||m,O=k.useRef(null),w=k.useRef(null),I=k.useRef(u),B=c_(c),z=c_(i),H=k.useCallback(()=>{if(!O.current||!w.current)return;const $={placement:e,strategy:r,middleware:d};z.current&&($.platform=z.current),Ioe(O.current,w.current,$).then(D=>{const _={...D,isPositioned:!0};K.current&&!Py(I.current,_)&&(I.current=_,$s.flushSync(()=>{f(_)}))})},[d,e,r,z]);sm(()=>{l===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,f($=>({...$,isPositioned:!1})))},[l]);const K=k.useRef(!1);sm(()=>(K.current=!0,()=>{K.current=!1}),[]),sm(()=>{if(C&&(O.current=C),A&&(w.current=A),C&&A){if(B.current)return B.current(C,A,H);H()}},[C,A,H,B]);const F=k.useMemo(()=>({reference:O,floating:w,setReference:y,setFloating:b}),[y,b]),x=k.useMemo(()=>({reference:C,floating:A}),[C,A]),P=k.useMemo(()=>{const $={position:r,left:0,top:0};if(!x.floating)return $;const D=a_(x.floating,u.x),_=a_(x.floating,u.y);return a?{...$,transform:"translate("+D+"px, "+_+"px)",...lL(x.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:D,top:_}},[r,a,x.floating,u.x,u.y]);return k.useMemo(()=>({...u,update:H,refs:F,elements:x,floatingStyles:P}),[u,H,F,x,P])}const uL="Popper",[fL,Md]=_n(uL),[$oe,dL]=fL(uL),Moe=t=>{const{__scopePopper:e,children:r}=t,[n,i]=k.useState(null);return k.createElement($oe,{scope:e,anchor:n,onAnchorChange:i},r)},Noe="PopperAnchor",Doe=k.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...i}=t,s=dL(Noe,r),o=k.useRef(null),a=Kt(e,o);return k.useEffect(()=>{s.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:k.createElement(et.div,_e({},i,{ref:a}))}),hL="PopperContent",[Loe,oTe]=fL(hL),Boe=k.forwardRef((t,e)=>{var r,n,i,s,o,a,c,l;const{__scopePopper:u,side:f="bottom",sideOffset:d=0,align:h="center",alignOffset:p=0,arrowPadding:v=0,avoidCollisions:m=!0,collisionBoundary:g=[],collisionPadding:y=0,sticky:b="partial",hideWhenDetached:C=!1,updatePositionStrategy:A="optimized",onPlaced:O,...w}=t,I=dL(hL,u),[B,z]=k.useState(null),H=Kt(e,ue=>z(ue)),[K,F]=k.useState(null),x=mb(K),P=(r=x==null?void 0:x.width)!==null&&r!==void 0?r:0,$=(n=x==null?void 0:x.height)!==null&&n!==void 0?n:0,D=f+(h!=="center"?"-"+h:""),_=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},N=Array.isArray(g)?g:[g],L=N.length>0,R={padding:_,boundary:N.filter(Foe),altBoundary:L},{refs:E,floatingStyles:M,placement:j,isPositioned:T,middlewareData:U}=Roe({strategy:"fixed",placement:D,whileElementsMounted:(...ue)=>Toe(...ue,{animationFrame:A==="always"}),elements:{reference:I.anchor},middleware:[coe({mainAxis:d+$,alignmentAxis:p}),m&&loe({mainAxis:!0,crossAxis:!1,limiter:b==="partial"?uoe():void 0,...R}),m&&soe({...R}),foe({...R,apply:({elements:ue,rects:tt,availableWidth:Oe,availableHeight:Pe})=>{const{width:ct,height:Ce}=tt.reference,be=ue.floating.style;be.setProperty("--radix-popper-available-width",`${Oe}px`),be.setProperty("--radix-popper-available-height",`${Pe}px`),be.setProperty("--radix-popper-anchor-width",`${ct}px`),be.setProperty("--radix-popper-anchor-height",`${Ce}px`)}}),K&&Ooe({element:K,padding:v}),joe({arrowWidth:P,arrowHeight:$}),C&&ooe({strategy:"referenceHidden",...R})]}),[W,V]=pL(j),G=Ki(O);Qi(()=>{T&&(G==null||G())},[T,G]);const J=(i=U.arrow)===null||i===void 0?void 0:i.x,Y=(s=U.arrow)===null||s===void 0?void 0:s.y,X=((o=U.arrow)===null||o===void 0?void 0:o.centerOffset)!==0,[ae,oe]=k.useState();return Qi(()=>{B&&oe(window.getComputedStyle(B).zIndex)},[B]),k.createElement("div",{ref:E.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:T?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ae,"--radix-popper-transform-origin":[(a=U.transformOrigin)===null||a===void 0?void 0:a.x,(c=U.transformOrigin)===null||c===void 0?void 0:c.y].join(" ")},dir:t.dir},k.createElement(Loe,{scope:u,placedSide:W,onArrowChange:F,arrowX:J,arrowY:Y,shouldHideArrow:X},k.createElement(et.div,_e({"data-side":W,"data-align":V},w,{ref:H,style:{...w.style,animation:T?void 0:"none",opacity:(l=U.hide)!==null&&l!==void 0&&l.referenceHidden?0:void 0}}))))});function Foe(t){return t!==null}const joe=t=>({name:"transformOrigin",options:t,fn(e){var r,n,i,s,o;const{placement:a,rects:c,middlewareData:l}=e,f=((r=l.arrow)===null||r===void 0?void 0:r.centerOffset)!==0,d=f?0:t.arrowWidth,h=f?0:t.arrowHeight,[p,v]=pL(a),m={start:"0%",center:"50%",end:"100%"}[v],g=((n=(i=l.arrow)===null||i===void 0?void 0:i.x)!==null&&n!==void 0?n:0)+d/2,y=((s=(o=l.arrow)===null||o===void 0?void 0:o.y)!==null&&s!==void 0?s:0)+h/2;let b="",C="";return p==="bottom"?(b=f?m:`${g}px`,C=`${-h}px`):p==="top"?(b=f?m:`${g}px`,C=`${c.floating.height+h}px`):p==="right"?(b=`${-h}px`,C=f?m:`${y}px`):p==="left"&&(b=`${c.floating.width+h}px`,C=f?m:`${y}px`),{data:{x:b,y:C}}}});function pL(t){const[e,r="center"]=t.split("-");return[e,r]}const Uoe=Moe,zoe=Doe,Woe=Boe,vL=k.forwardRef((t,e)=>{var r;const{container:n=globalThis==null||(r=globalThis.document)===null||r===void 0?void 0:r.body,...i}=t;return n?yK.createPortal(k.createElement(et.div,_e({},i,{ref:e})),n):null}),ix="rovingFocusGroup.onEntryFocus",Hoe={bubbles:!1,cancelable:!0},FC="RovingFocusGroup",[B6,mL,qoe]=xb(FC),[Voe,Nd]=_n(FC,[qoe]),[Goe,Koe]=Voe(FC),Qoe=k.forwardRef((t,e)=>k.createElement(B6.Provider,{scope:t.__scopeRovingFocusGroup},k.createElement(B6.Slot,{scope:t.__scopeRovingFocusGroup},k.createElement(Yoe,yt({},t,{ref:e}))))),Yoe=k.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:c,onEntryFocus:l,...u}=t,f=k.useRef(null),d=Kt(e,f),h=Eb(s),[p=null,v]=kc({prop:o,defaultProp:a,onChange:c}),[m,g]=k.useState(!1),y=Ki(l),b=mL(r),C=k.useRef(!1),[A,O]=k.useState(0);return k.useEffect(()=>{const w=f.current;if(w)return w.addEventListener(ix,y),()=>w.removeEventListener(ix,y)},[y]),k.createElement(Goe,{scope:r,orientation:n,dir:h,loop:i,currentTabStopId:p,onItemFocus:k.useCallback(w=>v(w),[v]),onItemShiftTab:k.useCallback(()=>g(!0),[]),onFocusableItemAdd:k.useCallback(()=>O(w=>w+1),[]),onFocusableItemRemove:k.useCallback(()=>O(w=>w-1),[])},k.createElement(et.div,yt({tabIndex:m||A===0?-1:0,"data-orientation":n},u,{ref:d,style:{outline:"none",...t.style},onMouseDown:xe(t.onMouseDown,()=>{C.current=!0}),onFocus:xe(t.onFocus,w=>{const I=!C.current;if(w.target===w.currentTarget&&I&&!m){const B=new CustomEvent(ix,Hoe);if(w.currentTarget.dispatchEvent(B),!B.defaultPrevented){const z=b().filter(P=>P.focusable),H=z.find(P=>P.active),K=z.find(P=>P.id===p),x=[H,K,...z].filter(Boolean).map(P=>P.ref.current);yL(x)}}C.current=!1}),onBlur:xe(t.onBlur,()=>g(!1))})))}),Joe="RovingFocusGroupItem",Xoe=k.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:s,...o}=t,a=pc(),c=s||a,l=Koe(Joe,r),u=l.currentTabStopId===c,f=mL(r),{onFocusableItemAdd:d,onFocusableItemRemove:h}=l;return k.useEffect(()=>{if(n)return d(),()=>h()},[n,d,h]),k.createElement(B6.ItemSlot,{scope:r,id:c,focusable:n,active:i},k.createElement(et.span,yt({tabIndex:u?0:-1,"data-orientation":l.orientation},o,{ref:e,onMouseDown:xe(t.onMouseDown,p=>{n?l.onItemFocus(c):p.preventDefault()}),onFocus:xe(t.onFocus,()=>l.onItemFocus(c)),onKeyDown:xe(t.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){l.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const v=tae(p,l.orientation,l.dir);if(v!==void 0){p.preventDefault();let g=f().filter(y=>y.focusable).map(y=>y.ref.current);if(v==="last")g.reverse();else if(v==="prev"||v==="next"){v==="prev"&&g.reverse();const y=g.indexOf(p.currentTarget);g=l.loop?rae(g,y+1):g.slice(y+1)}setTimeout(()=>yL(g))}})})))}),Zoe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function eae(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function tae(t,e,r){const n=eae(t.key,r);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Zoe[n]}function yL(t){const e=document.activeElement;for(const r of t)if(r===e||(r.focus(),document.activeElement!==e))return}function rae(t,e){return t.map((r,n)=>t[(e+n)%t.length])}const gL=Qoe,jC=Xoe;var nae=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Ru=new WeakMap,hv=new WeakMap,pv={},sx=0,bL=function(t){return t&&(t.host||bL(t.parentNode))},iae=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=bL(r);return n&&t.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},sae=function(t,e,r,n){var i=iae(e,Array.isArray(t)?t:[t]);pv[r]||(pv[r]=new WeakMap);var s=pv[r],o=[],a=new Set,c=new Set(i),l=function(f){!f||a.has(f)||(a.add(f),l(f.parentNode))};i.forEach(l);var u=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(d){if(a.has(d))u(d);else{var h=d.getAttribute(n),p=h!==null&&h!=="false",v=(Ru.get(d)||0)+1,m=(s.get(d)||0)+1;Ru.set(d,v),s.set(d,m),o.push(d),v===1&&p&&hv.set(d,!0),m===1&&d.setAttribute(r,"true"),p||d.setAttribute(n,"true")}})};return u(e),a.clear(),sx++,function(){o.forEach(function(f){var d=Ru.get(f)-1,h=s.get(f)-1;Ru.set(f,d),s.set(f,h),d||(hv.has(f)||f.removeAttribute(n),hv.delete(f)),h||f.removeAttribute(r)}),sx--,sx||(Ru=new WeakMap,Ru=new WeakMap,hv=new WeakMap,pv={})}},wL=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),i=e||nae(t);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live]"))),sae(n,i,r,"aria-hidden")):function(){return null}},eo=function(){return eo=Object.assign||function(e){for(var r,n=1,i=arguments.length;n"u")return Eae;var e=Cae(t),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}},kae=SL(),Aae=function(t,e,r,n){var i=t.left,s=t.top,o=t.right,a=t.gap;return r===void 0&&(r="margin"),` - .`.concat(aae,` { - overflow: hidden `).concat(n,`; - padding-right: `).concat(a,"px ").concat(n,`; - } - body { - overflow: hidden `).concat(n,`; - overscroll-behavior: contain; - `).concat([e&&"position: relative ".concat(n,";"),r==="margin"&&` - padding-left: `.concat(i,`px; - padding-top: `).concat(s,`px; - padding-right: `).concat(o,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(a,"px ").concat(n,`; - `),r==="padding"&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),` - } - - .`).concat(om,` { - right: `).concat(a,"px ").concat(n,`; - } - - .`).concat(am,` { - margin-right: `).concat(a,"px ").concat(n,`; - } - - .`).concat(om," .").concat(om,` { - right: 0 `).concat(n,`; - } - - .`).concat(am," .").concat(am,` { - margin-right: 0 `).concat(n,`; - } - - body { - `).concat(cae,": ").concat(a,`px; - } -`)},_ae=function(t){var e=t.noRelative,r=t.noImportant,n=t.gapMode,i=n===void 0?"margin":n,s=k.useMemo(function(){return Sae(i)},[i]);return k.createElement(kae,{styles:Aae(s,!e,i,r?"":"!important")})},F6=!1;if(typeof window<"u")try{var vv=Object.defineProperty({},"passive",{get:function(){return F6=!0,!0}});window.addEventListener("test",vv,vv),window.removeEventListener("test",vv,vv)}catch{F6=!1}var $u=F6?{passive:!1}:!1,Pae=function(t){return t.tagName==="TEXTAREA"},kL=function(t,e){var r=window.getComputedStyle(t);return r[e]!=="hidden"&&!(r.overflowY===r.overflowX&&!Pae(t)&&r[e]==="visible")},Tae=function(t){return kL(t,"overflowY")},Iae=function(t){return kL(t,"overflowX")},l_=function(t,e){var r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var n=AL(t,r);if(n){var i=_L(t,r),s=i[1],o=i[2];if(s>o)return!0}r=r.parentNode}while(r&&r!==document.body);return!1},Oae=function(t){var e=t.scrollTop,r=t.scrollHeight,n=t.clientHeight;return[e,r,n]},Rae=function(t){var e=t.scrollLeft,r=t.scrollWidth,n=t.clientWidth;return[e,r,n]},AL=function(t,e){return t==="v"?Tae(e):Iae(e)},_L=function(t,e){return t==="v"?Oae(e):Rae(e)},$ae=function(t,e){return t==="h"&&e==="rtl"?-1:1},Mae=function(t,e,r,n,i){var s=$ae(t,window.getComputedStyle(e).direction),o=s*n,a=r.target,c=e.contains(a),l=!1,u=o>0,f=0,d=0;do{var h=_L(t,a),p=h[0],v=h[1],m=h[2],g=v-m-s*p;(p||g)&&AL(t,a)&&(f+=g,d+=p),a=a.parentNode}while(!c&&a!==document.body||c&&(e.contains(a)||e===a));return(u&&(i&&f===0||!i&&o>f)||!u&&(i&&d===0||!i&&-o>d))&&(l=!0),l},mv=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},u_=function(t){return[t.deltaX,t.deltaY]},f_=function(t){return t&&"current"in t?t.current:t},Nae=function(t,e){return t[0]===e[0]&&t[1]===e[1]},Dae=function(t){return` - .block-interactivity-`.concat(t,` {pointer-events: none;} - .allow-interactivity-`).concat(t,` {pointer-events: all;} -`)},Lae=0,Mu=[];function Bae(t){var e=k.useRef([]),r=k.useRef([0,0]),n=k.useRef(),i=k.useState(Lae++)[0],s=k.useState(function(){return SL()})[0],o=k.useRef(t);k.useEffect(function(){o.current=t},[t]),k.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var v=oae([t.lockRef.current],(t.shards||[]).map(f_),!0).filter(Boolean);return v.forEach(function(m){return m.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),v.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var a=k.useCallback(function(v,m){if("touches"in v&&v.touches.length===2)return!o.current.allowPinchZoom;var g=mv(v),y=r.current,b="deltaX"in v?v.deltaX:y[0]-g[0],C="deltaY"in v?v.deltaY:y[1]-g[1],A,O=v.target,w=Math.abs(b)>Math.abs(C)?"h":"v";if("touches"in v&&w==="h"&&O.type==="range")return!1;var I=l_(w,O);if(!I)return!0;if(I?A=w:(A=w==="v"?"h":"v",I=l_(w,O)),!I)return!1;if(!n.current&&"changedTouches"in v&&(b||C)&&(n.current=A),!A)return!0;var B=n.current||A;return Mae(B,m,v,B==="h"?b:C,!0)},[]),c=k.useCallback(function(v){var m=v;if(!(!Mu.length||Mu[Mu.length-1]!==s)){var g="deltaY"in m?u_(m):mv(m),y=e.current.filter(function(A){return A.name===m.type&&A.target===m.target&&Nae(A.delta,g)})[0];if(y&&y.should){m.cancelable&&m.preventDefault();return}if(!y){var b=(o.current.shards||[]).map(f_).filter(Boolean).filter(function(A){return A.contains(m.target)}),C=b.length>0?a(m,b[0]):!o.current.noIsolation;C&&m.cancelable&&m.preventDefault()}}},[]),l=k.useCallback(function(v,m,g,y){var b={name:v,delta:m,target:g,should:y};e.current.push(b),setTimeout(function(){e.current=e.current.filter(function(C){return C!==b})},1)},[]),u=k.useCallback(function(v){r.current=mv(v),n.current=void 0},[]),f=k.useCallback(function(v){l(v.type,u_(v),v.target,a(v,t.lockRef.current))},[]),d=k.useCallback(function(v){l(v.type,mv(v),v.target,a(v,t.lockRef.current))},[]);k.useEffect(function(){return Mu.push(s),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:d}),document.addEventListener("wheel",c,$u),document.addEventListener("touchmove",c,$u),document.addEventListener("touchstart",u,$u),function(){Mu=Mu.filter(function(v){return v!==s}),document.removeEventListener("wheel",c,$u),document.removeEventListener("touchmove",c,$u),document.removeEventListener("touchstart",u,$u)}},[]);var h=t.removeScrollBar,p=t.inert;return k.createElement(k.Fragment,null,p?k.createElement(s,{styles:Dae(i)}):null,h?k.createElement(_ae,{gapMode:"margin"}):null)}const Fae=vae(CL,Bae);var PL=k.forwardRef(function(t,e){return k.createElement(kb,eo({},t,{ref:e,sideCar:Fae}))});PL.classNames=kb.classNames;const TL=PL,jae=["Enter"," "],Ab="Menu",[Uae,aTe,zae]=xb(Ab),[wu,IL]=_n(Ab,[zae,Md,Nd]);Md();const Wae=Nd();wu(Ab);const[cTe,Hae]=wu(Ab),qae="MenuPortal";wu(qae,{forceMount:void 0});const Vae="MenuContent",[lTe,OL]=wu(Vae),j6="MenuItem",d_="menu.itemSelect",RL=k.forwardRef((t,e)=>{const{disabled:r=!1,onSelect:n,...i}=t,s=k.useRef(null),o=Hae(j6,t.__scopeMenu),a=OL(j6,t.__scopeMenu),c=Kt(e,s),l=k.useRef(!1),u=()=>{const f=s.current;if(!r&&f){const d=new CustomEvent(d_,{bubbles:!0,cancelable:!0});f.addEventListener(d_,h=>n==null?void 0:n(h),{once:!0}),OC(f,d),d.defaultPrevented?l.current=!1:o.onClose()}};return k.createElement(Gae,_e({},i,{ref:c,disabled:r,onClick:xe(t.onClick,u),onPointerDown:f=>{var d;(d=t.onPointerDown)===null||d===void 0||d.call(t,f),l.current=!0},onPointerUp:xe(t.onPointerUp,f=>{var d;l.current||(d=f.currentTarget)===null||d===void 0||d.click()}),onKeyDown:xe(t.onKeyDown,f=>{const d=a.searchRef.current!=="";r||d&&f.key===" "||jae.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})}))}),Gae=k.forwardRef((t,e)=>{const{__scopeMenu:r,disabled:n=!1,textValue:i,...s}=t,o=OL(j6,r),a=Wae(r),c=k.useRef(null),l=Kt(e,c),[u,f]=k.useState(!1),[d,h]=k.useState("");return k.useEffect(()=>{const p=c.current;if(p){var v;h(((v=p.textContent)!==null&&v!==void 0?v:"").trim())}},[s.children]),k.createElement(Uae.ItemSlot,{scope:r,disabled:n,textValue:i??d},k.createElement(jC,_e({asChild:!0},a,{focusable:!n}),k.createElement(et.div,_e({role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0},s,{ref:l,onPointerMove:xe(t.onPointerMove,h_(p=>{n?o.onItemLeave(p):(o.onItemEnter(p),p.defaultPrevented||p.currentTarget.focus())})),onPointerLeave:xe(t.onPointerLeave,h_(p=>o.onItemLeave(p))),onFocus:xe(t.onFocus,()=>f(!0)),onBlur:xe(t.onBlur,()=>f(!1))}))))}),Kae=k.forwardRef((t,e)=>{const{checked:r=!1,onCheckedChange:n,...i}=t;return k.createElement(ML,{scope:t.__scopeMenu,checked:r},k.createElement(RL,_e({role:"menuitemcheckbox","aria-checked":Ty(r)?"mixed":r},i,{ref:e,"data-state":UC(r),onSelect:xe(i.onSelect,()=>n==null?void 0:n(Ty(r)?!0:!r),{checkForDefaultPrevented:!1})})))}),Qae="MenuRadioGroup",[uTe,Yae]=wu(Qae,{value:void 0,onValueChange:()=>{}}),Jae="MenuRadioItem",Xae=k.forwardRef((t,e)=>{const{value:r,...n}=t,i=Yae(Jae,t.__scopeMenu),s=r===i.value;return k.createElement(ML,{scope:t.__scopeMenu,checked:s},k.createElement(RL,_e({role:"menuitemradio","aria-checked":s},n,{ref:e,"data-state":UC(s),onSelect:xe(n.onSelect,()=>{var o;return(o=i.onValueChange)===null||o===void 0?void 0:o.call(i,r)},{checkForDefaultPrevented:!1})})))}),$L="MenuItemIndicator",[ML,Zae]=wu($L,{checked:!1}),ece=k.forwardRef((t,e)=>{const{__scopeMenu:r,forceMount:n,...i}=t,s=Zae($L,r);return k.createElement(Wc,{present:n||Ty(s.checked)||s.checked===!0},k.createElement(et.span,_e({},i,{ref:e,"data-state":UC(s.checked)})))}),tce="MenuSub";wu(tce);function Ty(t){return t==="indeterminate"}function UC(t){return Ty(t)?"indeterminate":t?"checked":"unchecked"}function h_(t){return e=>e.pointerType==="mouse"?t(e):void 0}const rce=Kae,nce=Xae,ice=ece,NL="DropdownMenu",[sce,fTe]=_n(NL,[IL]),zC=IL();sce(NL);const oce=k.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=zC(r);return k.createElement(rce,_e({},i,n,{ref:e}))}),ace=k.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=zC(r);return k.createElement(nce,_e({},i,n,{ref:e}))}),cce=k.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,i=zC(r);return k.createElement(ice,_e({},i,n,{ref:e}))}),lce=oce,uce=ace,DL=cce;var LL="_1k2mbvi5",BL="_1k2mbvi4 fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr1x4 fyvr1yk fyvr1ss fyvr1uo fyvr12wk fyvr12we fyvr11h0 fyvr11ko fyvr11jw fyvr12uz fyvr11n2 fyvr11hw fyvr12rz";const fce=({children:t})=>Q.jsx(DL,{className:LL,children:t});k.forwardRef(({className:t,children:e,...r},n)=>Q.jsxs(lce,{className:Ti(BL,t),...r,ref:n,children:[Q.jsx(fce,{children:Q.jsx(Od,{size:"xs"})}),Q.jsx(ie,{variant:"small",children:e})]}));k.forwardRef(({className:t,children:e,...r},n)=>Q.jsxs(uce,{className:Ti(BL,t),...r,ref:n,children:[Q.jsx(DL,{className:LL,children:Q.jsx(ie,{children:"•"})}),Q.jsx(ie,{variant:"small",children:e})]}));const sa=k.forwardRef((t,e)=>{const{icon:r,size:n="md",...i}=t;return Q.jsx(nt,{leftIcon:r,size:n,flexShrink:"0",ref:e,...i})}),dce=(...t)=>e=>t.forEach(r=>{r&&(typeof r=="function"?r(e):r.current=e)});var hce="fyvr12wh fyvr12wb fyvr11ho fyvr12vb fyvr1ko fyvr1oo fyvr1mo fyvr1qo",pce="_1hq71vk1 _1qxj1ib9 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 fyvr11a8 fyvr11ak fyvr11aw fyvr11b8 fyvr1t4 fyvr1v0 fyvr1ww fyvr1ys fyvr12n5 fyvr12ft fyvr1215 fyvr128h fyvr12nn fyvr12gb fyvr121n fyvr128z fyvr11ko fyvr11hc fyvr11ic fyvr11jc fyvr1g0 fyvr11hw",vce=dr({defaultClassName:"_1hq71vk5",variantClassNames:{borderRadius:{xs:"fyvr11cw fyvr11dk fyvr11bk fyvr11c8",sm:"fyvr11d0 fyvr11do fyvr11bo fyvr11cc",md:"fyvr11d4 fyvr11ds fyvr11bs fyvr11cg"}},defaultVariants:{},compoundVariants:[]});const mce={png:".png,image/png",jpeg:".jpeg,image/jpeg",jpg:".jpg,image/jpg",images:"image/*",pdf:".pdf,application/pdf"};k.forwardRef((t,e)=>{const{borderRadius:r="md",description:n,disabled:i=!1,id:s,label:o="",labelLocation:a="hidden",name:c,onValueChange:l,placeholder:u="Upload a file",validExtensions:f,...d}=t,h=k.useRef(null),p=dce(h,e),[v,m]=k.useState(null),g=b=>{const C=b.currentTarget.files;if(!C||!C[0])return;const A=C[0],O=A.name,w=A.size/1e3;m({name:O,size:w,extension:O.split(".").pop()??""}),l==null||l(A)},y=f.map(b=>mce[b]).join(",");return Q.jsx(gu,{description:n,disabled:i,display:"grid",id:s??c,label:o,labelLocation:a,children:Q.jsx(q,{width:"full",children:Q.jsxs(q,{justifyContent:v?"space-between":"flex-start",color:v?"text100":"text50",className:Ti(pce,vce({borderRadius:r})),children:[v?Q.jsxs(q,{flexDirection:"row",gap:"2",alignItems:"baseline",children:[Q.jsx(ie,{children:v.name}),Q.jsxs(ie,{color:"text50",variant:"xsmall",children:[v.size.toFixed(2)," kb"]})]}):Q.jsx(ie,{children:u}),Q.jsx(q,{accept:y,as:"input",className:hce,cursor:v?"text":"pointer",disabled:i||!!v,id:s??c,name:c,onChange:g,ref:p,type:"file",...d}),v&&Q.jsx(sa,{cursor:"pointer",icon:bu,size:"xs",onClick:b=>{var C;b.preventDefault(),b.stopPropagation(),(C=h.current)!=null&&C.value&&(h.current.value=""),l==null||l(null),m(null)},zIndex:"10"})]})})})});var yce=dr({defaultClassName:"_1bhyzin0",variantClassNames:{size:{xs:"_1bhyzin1",sm:"_1bhyzin2",md:"_1bhyzin3",lg:"_1bhyzin4",xl:"_1bhyzin5"}},defaultVariants:{},compoundVariants:[]});const U6=1e3,Mf=64,cx=Mf/2,lx=(t,e=U6)=>t%e/(U6/Mf),ml=(t,e=0)=>{let r=3735928559^e,n=1103547991^e;for(let i=0,s;i>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),4294967296*(2097151&n)+(r>>>0)},gce=(t,e,r)=>{const n=Math.random().toString(36).slice(2,12),i=t%360,s=(t+120)%360,o=r%360;return{id:ml(n),a:`hsl(${i}deg 100% 40%)`,b:`hsl(${s}deg 100% 50%)`,c:`hsl(${o}deg 100% 50%)`}},bce=(t,e)=>{const r=[];for(let n=0;n{const s=Mf/10+lx(n.r,U6*1.5/(i+1));return{...gce(n.a,n.b,n.c),x:lx(n.x),y:lx(n.y),r:s}})},np=k.memo(t=>{const{className:e,address:r,size:n="md",complexity:i=1,...s}=t,o=bce(r,i);return Q.jsxs(q,{as:"svg",className:Ti(e,yce({size:n})),viewBox:`0 0 ${Mf} ${Mf}`,version:"1.1",flexShrink:"0",borderRadius:"circle",overflow:"hidden",xmlns:"http://www.w3.org/2000/svg",...s,children:[Q.jsxs("defs",{children:[Q.jsx("clipPath",{id:"circle-clip",children:Q.jsx("circle",{cx,cy:cx,r:cx})}),Q.jsxs("filter",{id:"blur",x:"-10%",y:"-10%",width:"120%",height:"120%",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[Q.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),Q.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),Q.jsx("feGaussianBlur",{stdDeviation:Mf/10,result:"effect1_foregroundBlur"})]}),Q.jsxs("linearGradient",{id:`gradient-background-${o[0].id}`,x1:"0",y1:"0",x2:"1",y2:"1",children:[Q.jsx("stop",{offset:"0",stopColor:o[0].c}),Q.jsx("stop",{offset:"1",stopColor:o[0].a})]}),o.map(a=>Q.jsxs(k.Fragment,{children:[Q.jsxs("radialGradient",{id:`gradient-primary-${a.id}`,children:[Q.jsx("stop",{offset:"0",stopColor:a.a}),Q.jsx("stop",{offset:"1",stopColor:a.b})]}),Q.jsxs("radialGradient",{id:`gradient-secondary-${a.id}`,children:[Q.jsx("stop",{offset:"0",stopColor:a.c}),Q.jsx("stop",{offset:"1",stopColor:a.b})]})]},a.id))]}),Q.jsxs("g",{clipPath:"url(#circle-clip)",children:[Q.jsx("rect",{width:"100%",height:"100%",fill:`url(#gradient-background-${o[0].id})`}),Q.jsx("g",{filter:"url(#blur)",children:o.map(a=>Q.jsxs(k.Fragment,{children:[Q.jsx("circle",{fill:`url(#gradient-primary-${a.id})`,cx:a.x,cy:a.y,r:a.r}),Q.jsx("circle",{fill:`url(#gradient-secondary-${a.id})`,cx:a.y,cy:a.x,r:a.r/2})]},a.id))})]})]})}),gr=t=>{const{disableAnimation:e=!1,onLoad:r,...n}=t,[i,s]=k.useState(!1),o=a=>{s(!0),r==null||r(a)};return Q.jsx(q,{as:n1.img,initial:e?void 0:{opacity:0},animate:e?void 0:{opacity:i?1:0},transition:{duration:.2},onLoad:e?void 0:o,...n})},FL="Dialog",[jL,dTe]=_n(FL),[wce,Hc]=jL(FL),xce=t=>{const{__scopeDialog:e,children:r,open:n,defaultOpen:i,onOpenChange:s,modal:o=!0}=t,a=k.useRef(null),c=k.useRef(null),[l=!1,u]=kc({prop:n,defaultProp:i,onChange:s});return k.createElement(wce,{scope:e,triggerRef:a,contentRef:c,contentId:pc(),titleId:pc(),descriptionId:pc(),open:l,onOpenChange:u,onOpenToggle:k.useCallback(()=>u(f=>!f),[u]),modal:o},r)},UL="DialogPortal",[Ece,zL]=jL(UL,{forceMount:void 0}),Cce=t=>{const{__scopeDialog:e,forceMount:r,children:n,container:i}=t,s=Hc(UL,e);return k.createElement(Ece,{scope:e,forceMount:r},k.Children.map(n,o=>k.createElement(Wc,{present:r||s.open},k.createElement(vL,{asChild:!0,container:i},o))))},z6="DialogOverlay",Sce=k.forwardRef((t,e)=>{const r=zL(z6,t.__scopeDialog),{forceMount:n=r.forceMount,...i}=t,s=Hc(z6,t.__scopeDialog);return s.modal?k.createElement(Wc,{present:n||s.open},k.createElement(kce,_e({},i,{ref:e}))):null}),kce=k.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=Hc(z6,r);return k.createElement(TL,{as:od,allowPinchZoom:!0,shards:[i.contentRef]},k.createElement(et.div,_e({"data-state":HL(i.open)},n,{ref:e,style:{pointerEvents:"auto",...n.style}})))}),a1="DialogContent",Ace=k.forwardRef((t,e)=>{const r=zL(a1,t.__scopeDialog),{forceMount:n=r.forceMount,...i}=t,s=Hc(a1,t.__scopeDialog);return k.createElement(Wc,{present:n||s.open},s.modal?k.createElement(_ce,_e({},i,{ref:e})):k.createElement(Pce,_e({},i,{ref:e})))}),_ce=k.forwardRef((t,e)=>{const r=Hc(a1,t.__scopeDialog),n=k.useRef(null),i=Kt(e,r.contentRef,n);return k.useEffect(()=>{const s=n.current;if(s)return wL(s)},[]),k.createElement(WL,_e({},t,{ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:xe(t.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=r.triggerRef.current)===null||o===void 0||o.focus()}),onPointerDownOutside:xe(t.onPointerDownOutside,s=>{const o=s.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&s.preventDefault()}),onFocusOutside:xe(t.onFocusOutside,s=>s.preventDefault())}))}),Pce=k.forwardRef((t,e)=>{const r=Hc(a1,t.__scopeDialog),n=k.useRef(!1),i=k.useRef(!1);return k.createElement(WL,_e({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o;if((o=t.onCloseAutoFocus)===null||o===void 0||o.call(t,s),!s.defaultPrevented){var a;n.current||(a=r.triggerRef.current)===null||a===void 0||a.focus(),s.preventDefault()}n.current=!1,i.current=!1},onInteractOutside:s=>{var o,a;(o=t.onInteractOutside)===null||o===void 0||o.call(t,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const c=s.target;((a=r.triggerRef.current)===null||a===void 0?void 0:a.contains(c))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}}))}),WL=k.forwardRef((t,e)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=t,a=Hc(a1,r),c=k.useRef(null),l=Kt(e,c);return XD(),k.createElement(k.Fragment,null,k.createElement(ZD,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:s},k.createElement(RC,_e({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":HL(a.open)},o,{ref:l,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),Tce="DialogClose",Ice=k.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,i=Hc(Tce,r);return k.createElement(et.button,_e({type:"button"},n,{ref:e,onClick:xe(t.onClick,()=>i.onOpenChange(!1))}))});function HL(t){return t?"open":"closed"}const Oce=xce,Rce=Cce,$ce=Sce,Mce=Ace,Nce=Ice;var Dce=dr({defaultClassName:"_1vqx0w94",variantClassNames:{shadows:{true:"_1vqx0w95",false:"_1vqx0w96"},direction:{vertical:"_1vqx0w97",horizontal:"_1vqx0w98"}},defaultVariants:{},compoundVariants:[]}),Lce=dr({defaultClassName:"_1vqx0w91 fyvr128 fyvr15o",variantClassNames:{direction:{vertical:"_1vqx0w92",horizontal:"_1vqx0w93"}},defaultVariants:{},compoundVariants:[]});const qL=t=>{const{children:e,shadows:r=!0,direction:n="vertical",contentProps:i,...s}=t;return Q.jsx(q,{className:Dce({direction:n,shadows:r}),position:"relative",width:"full",height:"full",...s,children:Q.jsx(q,{className:Lce({direction:n}),background:"backgroundPrimary",...i,children:e})})};function Bce(t){var e=t.match(/^var\((.*)\)$/);return e?e[1]:t}function Fce(t,e){var r=t;for(var n of e){if(!(n in r))throw new Error("Path ".concat(e.join(" -> ")," does not exist in object"));r=r[n]}return r}function VL(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],n=t.constructor();for(var i in t){var s=t[i],o=[...r,i];typeof s=="string"||typeof s=="number"||s==null?n[i]=e(s,o):typeof s=="object"&&!Array.isArray(s)?n[i]=VL(s,e,o):console.warn('Skipping invalid key "'.concat(o.join("."),'". Should be a string, number, null or object. Received: "').concat(Array.isArray(s)?"Array":typeof s,'"'))}return n}function p_(t,e,r){t.style.setProperty(Bce(e),r)}function v_(t,e,r){if(typeof r=="object"){var n=e;VL(r,(o,a)=>{p_(t,Fce(n,a),String(o))})}else{var i=e;for(var s in i)p_(t,s,i[s])}}const WC=["dark","light"],jce="dark",Uce="data-theme",m_="@sequence.theme",zce=t=>WC.includes(t),Wce=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),GL=t=>t?`${m_}.${t}`:m_,Hce=t=>{const e=localStorage.getItem(GL(t));return e&&WC.includes(e)?e:jce},KL=k.createContext(null),_b=t=>{const[e,r]=k.useState(t.theme||Hce(t.scope));k.useEffect(()=>{/Mac/.test(window.navigator.userAgent)&&window.document.documentElement.classList.add("is-apple")},[]),k.useEffect(()=>{t.theme&&r(t.theme)},[t.theme]),k.useEffect(()=>{const i=document.querySelector(t.root||":root");i&&(zce(e)?(i.setAttribute(Uce,e),v_(i,UA,{colors:mie[e]})):Wce(e)&&v_(i,UA,{colors:e}))},[e,t.root]);const n=k.useMemo(()=>({theme:e,root:t.root,setTheme:i=>{WC.includes(i)&&(localStorage.setItem(GL(t.scope),i),r(i))}}),[e,t.root,t.scope]);return Q.jsx(KL.Provider,{value:n,children:t.children})},ip=()=>{const t=k.useContext(KL);if(!t)throw new Error("useTheme must be used within a ThemeProvider");return t};var qce="fyvr110o fyvr112o fyvr114o fyvr116o fyvr11ho fyvr1qo fyvr1ko fyvr11ni",Vce=dr({defaultClassName:"_5b32m95 fyvr11d8 fyvr11dw fyvr11bg fyvr11by fyvr11c4 fyvr11cm fyvr11ls fyvr11m8 fyvr12wk fyvr12we fyvr11h0 fyvr11i4 fyvr11hs fyvr11sb fyvr1mo fyvr1om",variantClassNames:{size:{sm:"_5b32m96",lg:"_5b32m97"},autoHeight:{true:"_5b32m98"}},defaultVariants:{},compoundVariants:[[{autoHeight:!0,size:"lg"},"_5b32m99"]]}),Gce="fyvr11hs fyvr1ko fyvr1oo fyvr1qo fyvr1mo",Kce="fyvr11jg fyvr11ko fyvr11h0 fyvr11hs fyvr11ni fyvr1ko fyvr1oo fyvr1qo fyvr1mo";const HC=t=>{const{autoHeight:e=!1,backdropColor:r="backgroundBackdrop",children:n,disableAnimation:i=!1,isDismissible:s=!0,onClose:o,scroll:a=!0,size:c="lg",overlayProps:l,contentProps:u}=t,{root:f}=ip(),d=document.querySelector(f||"body");return Q.jsx(Oce,{modal:!0,defaultOpen:!0,onOpenChange:o,children:Q.jsx(Rce,{forceMount:!0,container:d,children:Q.jsxs(q,{className:Kce,children:[Q.jsx(q,{as:$ce,asChild:!0,background:r,className:Gce,forceMount:!0,children:Q.jsx(n1.div,{initial:i?!1:{opacity:0},animate:i?!1:{opacity:1},exit:i?void 0:{opacity:0},transition:{type:"tween",ease:"linear"},...l},"modal-overlay")}),Q.jsx(Mce,{asChild:!0,className:Vce({autoHeight:e,size:c}),forceMount:!0,onEscapeKeyDown:h=>{s?o==null||o():h.preventDefault()},onInteractOutside:h=>{s||h.preventDefault()},children:Q.jsxs(n1.div,{initial:i?!1:{y:"100%",opacity:c==="sm"?0:1},animate:i?!1:{y:0,opacity:1},exit:i?void 0:{y:"100%",opacity:c==="sm"?0:1},transition:{type:"tween",ease:"easeOut"},...u,children:[a?Q.jsx(qL,{children:n}):n,s&&Q.jsx(Nce,{asChild:!0,children:Q.jsx(sa,{icon:bu,backdropFilter:"blur",size:"xs",className:qce,"aria-label":"Close"})})]},"modal-content")})]})})})};var Qce=dr({defaultClassName:"_1acm19ya fyvr1t4 fyvr1v0 fyvr12wh fyvr12wb fyvr11gw fyvr128 fyvr15o",variantClassNames:{numeric:{false:"_1qxj1ib9 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0",true:"_1qxj1ib9 fyvr11mv fyvr11eo fyvr11g8 fyvr11fo fyvr11f8"}},defaultVariants:{},compoundVariants:[]}),Yce="_1acm19y1 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg fyvr1ww fyvr1ys fyvr11hc fyvr11ko fyvr11ob fyvr12rt fyvr1g0 fyvr118g",Jce=dr({defaultClassName:"_1acm19y5",variantClassNames:{borderRadius:{xs:"fyvr11cw fyvr11dk fyvr11bk fyvr11c8",sm:"fyvr11d0 fyvr11do fyvr11bo fyvr11cc",md:"fyvr11d4 fyvr11ds fyvr11bs fyvr11cg"}},defaultVariants:{},compoundVariants:[]});const qc=k.forwardRef((t,e)=>{const{as:r="input",autoComplete:n="off",borderRadius:i="md",description:s,disabled:o=!1,id:a,label:c="",labelLocation:l="hidden",leftIcon:u,rightIcon:f,name:d,controls:h,type:p="text",numeric:v=!1,...m}=t;return Q.jsx(gu,{description:s,disabled:o,display:"grid",id:a??d,label:c,labelLocation:l,children:Q.jsx(q,{width:"full",children:Q.jsxs(q,{className:Ti(Yce,Jce({borderRadius:i})),children:[u&&Q.jsx(u,{size:"sm"}),Q.jsx(q,{as:r,autoComplete:n,spellCheck:"false",className:Qce({numeric:v}),disabled:o,id:a??d,name:d,ref:e,type:p,...m}),f&&Q.jsx(f,{size:"sm"}),h]})})})}),Xce=RegExp("^\\d*(?:\\\\[.])?\\d*$");function Zce(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const QL=k.forwardRef((t,e)=>{const{name:r="amount",placeholder:n,onChange:i,onBlur:s,...o}=t,a=l=>{let{value:u}=l.target;u=u.replace(/,/g,"."),u.startsWith(".")&&(u="0"+u),u.startsWith("0")&&(u=u.replace(/^0+(?=\d)/,"")),(u===""||Xce.test(Zce(u)))&&(i==null||i({...l,target:{...l.target,value:u}}))},c=l=>{const{value:u}=l.target;let f=u;f.endsWith(".")&&(f=f.slice(0,-1)),f.endsWith(".0")&&(f=f.slice(0,-2)),f==="0"&&(f=""),s==null||s(l),f!==u&&(i==null||i({...l,target:{...l.target,value:f}}))};return Q.jsx(qc,{name:r,onChange:a,onBlur:c,inputMode:"decimal",autoComplete:"off",autoCorrect:"off",type:"text",pattern:"^[0-9]*[.,]?[0-9]*$",placeholder:n||"0",minLength:1,maxLength:79,spellCheck:"false",numeric:!0,ref:e,...o})});dr({defaultClassName:"dtv8gt1",variantClassNames:{size:{sm:"dtv8gt2",normal:"dtv8gt3",md:"dtv8gt4",lg:"dtv8gt5",xl:"dtv8gt6"}},defaultVariants:{},compoundVariants:[]});const YL="Progress",Pb=100,[ele,hTe]=_n(YL),[tle,pTe]=ele(YL),rle=k.forwardRef((t,e)=>{const{__scopeProgress:r,value:n,max:i,getValueLabel:s=nle,...o}=t,a=W6(i)?i:Pb,c=JL(n,a)?n:null,l=Iy(c)?s(c,a):void 0;return k.createElement(tle,{scope:r,value:c,max:a},k.createElement(et.div,yt({"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":Iy(c)?c:void 0,"aria-valuetext":l,role:"progressbar","data-state":ile(c,a),"data-value":c??void 0,"data-max":a},o,{ref:e})))});rle.propTypes={max(t,e,r){const n=t[e],i=String(n);return n&&!W6(n)?new Error(sle(i,r)):null},value(t,e,r){const n=t[e],i=String(n),s=W6(t.max)?t.max:Pb;return n!=null&&!JL(n,s)?new Error(ole(i,r)):null}};function nle(t,e){return`${Math.round(t/e*100)}%`}function ile(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function Iy(t){return typeof t=="number"}function W6(t){return Iy(t)&&!isNaN(t)&&t>0}function JL(t,e){return Iy(t)&&!isNaN(t)&&t<=e&&t>=0}function sle(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Pb}\`.`}function ole(t,e){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${e}\`. The \`value\` prop must be: - - a positive number - - less than the value passed to \`max\` (or ${Pb} if no \`max\` prop is set) - - \`null\` if the progress is indeterminate. - -Defaulting to \`null\`.`}const XL="Radio",[ale,ZL]=_n(XL),[cle,lle]=ale(XL),ule=k.forwardRef((t,e)=>{const{__scopeRadio:r,name:n,checked:i=!1,required:s,disabled:o,value:a="on",onCheck:c,...l}=t,[u,f]=k.useState(null),d=Kt(e,v=>f(v)),h=k.useRef(!1),p=u?!!u.closest("form"):!0;return k.createElement(cle,{scope:r,checked:i,disabled:o},k.createElement(et.button,yt({type:"button",role:"radio","aria-checked":i,"data-state":eB(i),"data-disabled":o?"":void 0,disabled:o,value:a},l,{ref:d,onClick:xe(t.onClick,v=>{i||c==null||c(),p&&(h.current=v.isPropagationStopped(),h.current||v.stopPropagation())})})),p&&k.createElement(hle,{control:u,bubbles:!h.current,name:n,value:a,checked:i,required:s,disabled:o,style:{transform:"translateX(-100%)"}}))}),fle="RadioIndicator",dle=k.forwardRef((t,e)=>{const{__scopeRadio:r,forceMount:n,...i}=t,s=lle(fle,r);return k.createElement(Wc,{present:n||s.checked},k.createElement(et.span,yt({"data-state":eB(s.checked),"data-disabled":s.disabled?"":void 0},i,{ref:e})))}),hle=t=>{const{control:e,checked:r,bubbles:n=!0,...i}=t,s=k.useRef(null),o=vb(r),a=mb(e);return k.useEffect(()=>{const c=s.current,l=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(l,"checked").set;if(o!==r&&f){const d=new Event("click",{bubbles:n});f.call(c,r),c.dispatchEvent(d)}},[o,r,n]),k.createElement("input",yt({type:"radio","aria-hidden":!0,defaultChecked:r},i,{tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function eB(t){return t?"checked":"unchecked"}const ple=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],tB="RadioGroup",[vle,vTe]=_n(tB,[Nd,ZL]),rB=Nd(),nB=ZL(),[mle,yle]=vle(tB),gle=k.forwardRef((t,e)=>{const{__scopeRadioGroup:r,name:n,defaultValue:i,value:s,required:o=!1,disabled:a=!1,orientation:c,dir:l,loop:u=!0,onValueChange:f,...d}=t,h=rB(r),p=Eb(l),[v,m]=kc({prop:s,defaultProp:i,onChange:f});return k.createElement(mle,{scope:r,name:n,required:o,disabled:a,value:v,onValueChange:m},k.createElement(gL,yt({asChild:!0},h,{orientation:c,dir:p,loop:u}),k.createElement(et.div,yt({role:"radiogroup","aria-required":o,"aria-orientation":c,"data-disabled":a?"":void 0,dir:p},d,{ref:e}))))}),ble="RadioGroupItem",wle=k.forwardRef((t,e)=>{const{__scopeRadioGroup:r,disabled:n,...i}=t,s=yle(ble,r),o=s.disabled||n,a=rB(r),c=nB(r),l=k.useRef(null),u=Kt(e,l),f=s.value===i.value,d=k.useRef(!1);return k.useEffect(()=>{const h=v=>{ple.includes(v.key)&&(d.current=!0)},p=()=>d.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",p),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",p)}},[]),k.createElement(jC,yt({asChild:!0},a,{focusable:!o,active:f}),k.createElement(ule,yt({disabled:o,required:s.required,checked:f},c,i,{name:s.name,ref:u,onCheck:()=>s.onValueChange(i.value),onKeyDown:xe(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:xe(i.onFocus,()=>{var h;d.current&&((h=l.current)===null||h===void 0||h.click())})})))}),xle=k.forwardRef((t,e)=>{const{__scopeRadioGroup:r,...n}=t,i=nB(r);return k.createElement(dle,yt({},i,n,{ref:e}))}),Ele=gle,Cle=wle,Sle=xle;var kle=dr({defaultClassName:"io59uy8 io59uy7 fyvr11h0 fyvr11ko fyvr11jg fyvr11hw fyvr128 fyvr15o fyvr12rt",variantClassNames:{size:{sm:"io59uy9",lg:"io59uya"}},defaultVariants:{},compoundVariants:[]}),Ale=dr({defaultClassName:"io59uy3 fyvr11dc fyvr11e0 fyvr11c0 fyvr11co fyvr12nb fyvr12fz fyvr121b fyvr128n fyvr12nh fyvr12g5 fyvr121h fyvr128t fyvr11ob fyvr12uz fyvr12uv fyvr12vj",variantClassNames:{size:{sm:"io59uy4 fyvr11a8 fyvr11ak fyvr11aw fyvr11b8",lg:"io59uy5 fyvr11ac fyvr11ao fyvr11b0 fyvr11bc"}},defaultVariants:{},compoundVariants:[]});const _le=t=>{const{id:e,label:r,size:n="sm",value:i,disabled:s}=t;return Q.jsx(q,{alignItems:"center",children:Q.jsx(gu,{disabled:s,display:"flex",id:e,label:r,labelLocation:"right",children:Q.jsx(Cle,{className:Ale({size:n}),value:i,id:e,disabled:s,children:Q.jsx(Sle,{className:kle({size:n})})})})})};k.forwardRef((t,e)=>{const{flexDirection:r="column",disabled:n=!1,gap:i="2",name:s,options:o,size:a="sm",...c}=t;return Q.jsx(Ele,{disabled:n,name:s,ref:e,...c,children:Q.jsx(q,{flexDirection:r,gap:i,children:o.map(({label:l,value:u,disabled:f})=>Q.jsx(_le,{id:`${s}-${u}`,label:l,size:a,value:u,disabled:f},u))})})});function y_(t,[e,r]){return Math.min(r,Math.max(e,t))}const iB=k.forwardRef((t,e)=>k.createElement(et.span,_e({},t,{ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}))),Ple=[" ","Enter","ArrowUp","ArrowDown"],Tle=[" ","Enter"],Tb="Select",[Ib,qC,Ile]=xb(Tb),[Dd,mTe]=_n(Tb,[Ile,Md]),VC=Md(),[Ole,xu]=Dd(Tb),[Rle,$le]=Dd(Tb),Mle=t=>{const{__scopeSelect:e,children:r,open:n,defaultOpen:i,onOpenChange:s,value:o,defaultValue:a,onValueChange:c,dir:l,name:u,autoComplete:f,disabled:d,required:h}=t,p=VC(e),[v,m]=k.useState(null),[g,y]=k.useState(null),[b,C]=k.useState(!1),A=Eb(l),[O=!1,w]=kc({prop:n,defaultProp:i,onChange:s}),[I,B]=kc({prop:o,defaultProp:a,onChange:c}),z=k.useRef(null),H=v?!!v.closest("form"):!0,[K,F]=k.useState(new Set),x=Array.from(K).map(P=>P.props.value).join(";");return k.createElement(Uoe,p,k.createElement(Ole,{required:h,scope:e,trigger:v,onTriggerChange:m,valueNode:g,onValueNodeChange:y,valueNodeHasChildren:b,onValueNodeHasChildrenChange:C,contentId:pc(),value:I,onValueChange:B,open:O,onOpenChange:w,dir:A,triggerPointerDownPosRef:z,disabled:d},k.createElement(Ib.Provider,{scope:e},k.createElement(Rle,{scope:t.__scopeSelect,onNativeOptionAdd:k.useCallback(P=>{F($=>new Set($).add(P))},[]),onNativeOptionRemove:k.useCallback(P=>{F($=>{const D=new Set($);return D.delete(P),D})},[])},r)),H?k.createElement(aB,{key:x,"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:f,value:I,onChange:P=>B(P.target.value),disabled:d},I===void 0?k.createElement("option",{value:""}):null,Array.from(K)):null))},Nle="SelectTrigger",Dle=k.forwardRef((t,e)=>{const{__scopeSelect:r,disabled:n=!1,...i}=t,s=VC(r),o=xu(Nle,r),a=o.disabled||n,c=Kt(e,o.onTriggerChange),l=qC(r),[u,f,d]=cB(p=>{const v=l().filter(y=>!y.disabled),m=v.find(y=>y.value===o.value),g=lB(v,p,m);g!==void 0&&o.onValueChange(g.value)}),h=()=>{a||(o.onOpenChange(!0),d())};return k.createElement(zoe,_e({asChild:!0},s),k.createElement(et.button,_e({type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":oB(o.value)?"":void 0},i,{ref:c,onClick:xe(i.onClick,p=>{p.currentTarget.focus()}),onPointerDown:xe(i.onPointerDown,p=>{const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&(h(),o.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)},p.preventDefault())}),onKeyDown:xe(i.onKeyDown,p=>{const v=u.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&f(p.key),!(v&&p.key===" ")&&Ple.includes(p.key)&&(h(),p.preventDefault())})})))}),Lle="SelectValue",Ble=k.forwardRef((t,e)=>{const{__scopeSelect:r,className:n,style:i,children:s,placeholder:o="",...a}=t,c=xu(Lle,r),{onValueNodeHasChildrenChange:l}=c,u=s!==void 0,f=Kt(e,c.onValueNodeChange);return Qi(()=>{l(u)},[l,u]),k.createElement(et.span,_e({},a,{ref:f,style:{pointerEvents:"none"}}),oB(c.value)?k.createElement(k.Fragment,null,o):s)}),Fle=k.forwardRef((t,e)=>{const{__scopeSelect:r,children:n,...i}=t;return k.createElement(et.span,_e({"aria-hidden":!0},i,{ref:e}),n||"▼")}),cd="SelectContent",jle=k.forwardRef((t,e)=>{const r=xu(cd,t.__scopeSelect),[n,i]=k.useState();if(Qi(()=>{i(new DocumentFragment)},[]),!r.open){const s=n;return s?$s.createPortal(k.createElement(sB,{scope:t.__scopeSelect},k.createElement(Ib.Slot,{scope:t.__scopeSelect},k.createElement("div",null,t.children))),s):null}return k.createElement(Ule,_e({},t,{ref:e}))}),Ro=10,[sB,Ob]=Dd(cd),Ule=k.forwardRef((t,e)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:o,side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:f,collisionBoundary:d,collisionPadding:h,sticky:p,hideWhenDetached:v,avoidCollisions:m,...g}=t,y=xu(cd,r),[b,C]=k.useState(null),[A,O]=k.useState(null),w=Kt(e,W=>C(W)),[I,B]=k.useState(null),[z,H]=k.useState(null),K=qC(r),[F,x]=k.useState(!1),P=k.useRef(!1);k.useEffect(()=>{if(b)return wL(b)},[b]),XD();const $=k.useCallback(W=>{const[V,...G]=K().map(X=>X.ref.current),[J]=G.slice(-1),Y=document.activeElement;for(const X of W)if(X===Y||(X==null||X.scrollIntoView({block:"nearest"}),X===V&&A&&(A.scrollTop=0),X===J&&A&&(A.scrollTop=A.scrollHeight),X==null||X.focus(),document.activeElement!==Y))return},[K,A]),D=k.useCallback(()=>$([I,b]),[$,I,b]);k.useEffect(()=>{F&&D()},[F,D]);const{onOpenChange:_,triggerPointerDownPosRef:N}=y;k.useEffect(()=>{if(b){let W={x:0,y:0};const V=J=>{var Y,X,ae,oe;W={x:Math.abs(Math.round(J.pageX)-((Y=(X=N.current)===null||X===void 0?void 0:X.x)!==null&&Y!==void 0?Y:0)),y:Math.abs(Math.round(J.pageY)-((ae=(oe=N.current)===null||oe===void 0?void 0:oe.y)!==null&&ae!==void 0?ae:0))}},G=J=>{W.x<=10&&W.y<=10?J.preventDefault():b.contains(J.target)||_(!1),document.removeEventListener("pointermove",V),N.current=null};return N.current!==null&&(document.addEventListener("pointermove",V),document.addEventListener("pointerup",G,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",V),document.removeEventListener("pointerup",G,{capture:!0})}}},[b,_,N]),k.useEffect(()=>{const W=()=>_(!1);return window.addEventListener("blur",W),window.addEventListener("resize",W),()=>{window.removeEventListener("blur",W),window.removeEventListener("resize",W)}},[_]);const[L,R]=cB(W=>{const V=K().filter(Y=>!Y.disabled),G=V.find(Y=>Y.ref.current===document.activeElement),J=lB(V,W,G);J&&setTimeout(()=>J.ref.current.focus())}),E=k.useCallback((W,V,G)=>{const J=!P.current&&!G;(y.value!==void 0&&y.value===V||J)&&(B(W),J&&(P.current=!0))},[y.value]),M=k.useCallback(()=>b==null?void 0:b.focus(),[b]),j=k.useCallback((W,V,G)=>{const J=!P.current&&!G;(y.value!==void 0&&y.value===V||J)&&H(W)},[y.value]),T=n==="popper"?g_:zle,U=T===g_?{side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:f,collisionBoundary:d,collisionPadding:h,sticky:p,hideWhenDetached:v,avoidCollisions:m}:{};return k.createElement(sB,{scope:r,content:b,viewport:A,onViewportChange:O,itemRefCallback:E,selectedItem:I,onItemLeave:M,itemTextRefCallback:j,focusSelectedItem:D,selectedItemText:z,position:n,isPositioned:F,searchRef:L},k.createElement(TL,{as:od,allowPinchZoom:!0},k.createElement(ZD,{asChild:!0,trapped:y.open,onMountAutoFocus:W=>{W.preventDefault()},onUnmountAutoFocus:xe(i,W=>{var V;(V=y.trigger)===null||V===void 0||V.focus({preventScroll:!0}),W.preventDefault()})},k.createElement(RC,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:W=>W.preventDefault(),onDismiss:()=>y.onOpenChange(!1)},k.createElement(T,_e({role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:W=>W.preventDefault()},g,U,{onPlaced:()=>x(!0),ref:w,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:xe(g.onKeyDown,W=>{const V=W.ctrlKey||W.altKey||W.metaKey;if(W.key==="Tab"&&W.preventDefault(),!V&&W.key.length===1&&R(W.key),["ArrowUp","ArrowDown","Home","End"].includes(W.key)){let J=K().filter(Y=>!Y.disabled).map(Y=>Y.ref.current);if(["ArrowUp","End"].includes(W.key)&&(J=J.slice().reverse()),["ArrowUp","ArrowDown"].includes(W.key)){const Y=W.target,X=J.indexOf(Y);J=J.slice(X+1)}setTimeout(()=>$(J)),W.preventDefault()}})}))))))}),zle=k.forwardRef((t,e)=>{const{__scopeSelect:r,onPlaced:n,...i}=t,s=xu(cd,r),o=Ob(cd,r),[a,c]=k.useState(null),[l,u]=k.useState(null),f=Kt(e,w=>u(w)),d=qC(r),h=k.useRef(!1),p=k.useRef(!0),{viewport:v,selectedItem:m,selectedItemText:g,focusSelectedItem:y}=o,b=k.useCallback(()=>{if(s.trigger&&s.valueNode&&a&&l&&v&&m&&g){const w=s.trigger.getBoundingClientRect(),I=l.getBoundingClientRect(),B=s.valueNode.getBoundingClientRect(),z=g.getBoundingClientRect();if(s.dir!=="rtl"){const Y=z.left-I.left,X=B.left-Y,ae=w.left-X,oe=w.width+ae,ue=Math.max(oe,I.width),tt=window.innerWidth-Ro,Oe=y_(X,[Ro,tt-ue]);a.style.minWidth=oe+"px",a.style.left=Oe+"px"}else{const Y=I.right-z.right,X=window.innerWidth-B.right-Y,ae=window.innerWidth-w.right-X,oe=w.width+ae,ue=Math.max(oe,I.width),tt=window.innerWidth-Ro,Oe=y_(X,[Ro,tt-ue]);a.style.minWidth=oe+"px",a.style.right=Oe+"px"}const H=d(),K=window.innerHeight-Ro*2,F=v.scrollHeight,x=window.getComputedStyle(l),P=parseInt(x.borderTopWidth,10),$=parseInt(x.paddingTop,10),D=parseInt(x.borderBottomWidth,10),_=parseInt(x.paddingBottom,10),N=P+$+F+_+D,L=Math.min(m.offsetHeight*5,N),R=window.getComputedStyle(v),E=parseInt(R.paddingTop,10),M=parseInt(R.paddingBottom,10),j=w.top+w.height/2-Ro,T=K-j,U=m.offsetHeight/2,W=m.offsetTop+U,V=P+$+W,G=N-V;if(V<=j){const Y=m===H[H.length-1].ref.current;a.style.bottom="0px";const X=l.clientHeight-v.offsetTop-v.offsetHeight,ae=Math.max(T,U+(Y?M:0)+X+D),oe=V+ae;a.style.height=oe+"px"}else{const Y=m===H[0].ref.current;a.style.top="0px";const ae=Math.max(j,P+v.offsetTop+(Y?E:0)+U)+G;a.style.height=ae+"px",v.scrollTop=V-j+v.offsetTop}a.style.margin=`${Ro}px 0`,a.style.minHeight=L+"px",a.style.maxHeight=K+"px",n==null||n(),requestAnimationFrame(()=>h.current=!0)}},[d,s.trigger,s.valueNode,a,l,v,m,g,s.dir,n]);Qi(()=>b(),[b]);const[C,A]=k.useState();Qi(()=>{l&&A(window.getComputedStyle(l).zIndex)},[l]);const O=k.useCallback(w=>{w&&p.current===!0&&(b(),y==null||y(),p.current=!1)},[b,y]);return k.createElement(Wle,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:O},k.createElement("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C}},k.createElement(et.div,_e({},i,{ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}}))))}),g_=k.forwardRef((t,e)=>{const{__scopeSelect:r,align:n="start",collisionPadding:i=Ro,...s}=t,o=VC(r);return k.createElement(Woe,_e({},o,s,{ref:e,align:n,collisionPadding:i,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[Wle,Hle]=Dd(cd,{}),b_="SelectViewport",qle=k.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,i=Ob(b_,r),s=Hle(b_,r),o=Kt(e,i.onViewportChange),a=k.useRef(0);return k.createElement(k.Fragment,null,k.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),k.createElement(Ib.Slot,{scope:r},k.createElement(et.div,_e({"data-radix-select-viewport":"",role:"presentation"},n,{ref:o,style:{position:"relative",flex:1,overflow:"auto",...n.style},onScroll:xe(n.onScroll,c=>{const l=c.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:f}=s;if(f!=null&&f.current&&u){const d=Math.abs(a.current-l.scrollTop);if(d>0){const h=window.innerHeight-Ro*2,p=parseFloat(u.style.minHeight),v=parseFloat(u.style.height),m=Math.max(p,v);if(m0?b:0,u.style.justifyContent="flex-end")}}}a.current=l.scrollTop})}))))}),Vle="SelectGroup",[Gle,yTe]=Dd(Vle),Kle=k.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,i=pc();return k.createElement(Gle,{scope:r,id:i},k.createElement(et.div,_e({role:"group","aria-labelledby":i},n,{ref:e})))}),H6="SelectItem",[Qle,Yle]=Dd(H6),Jle=k.forwardRef((t,e)=>{const{__scopeSelect:r,value:n,disabled:i=!1,textValue:s,...o}=t,a=xu(H6,r),c=Ob(H6,r),l=a.value===n,[u,f]=k.useState(s??""),[d,h]=k.useState(!1),p=Kt(e,g=>{var y;return(y=c.itemRefCallback)===null||y===void 0?void 0:y.call(c,g,n,i)}),v=pc(),m=()=>{i||(a.onValueChange(n),a.onOpenChange(!1))};if(n==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return k.createElement(Qle,{scope:r,value:n,disabled:i,textId:v,isSelected:l,onItemTextChange:k.useCallback(g=>{f(y=>{var b;return y||((b=g==null?void 0:g.textContent)!==null&&b!==void 0?b:"").trim()})},[])},k.createElement(Ib.ItemSlot,{scope:r,value:n,disabled:i,textValue:u},k.createElement(et.div,_e({role:"option","aria-labelledby":v,"data-highlighted":d?"":void 0,"aria-selected":l&&d,"data-state":l?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1},o,{ref:p,onFocus:xe(o.onFocus,()=>h(!0)),onBlur:xe(o.onBlur,()=>h(!1)),onPointerUp:xe(o.onPointerUp,m),onPointerMove:xe(o.onPointerMove,g=>{if(i){var y;(y=c.onItemLeave)===null||y===void 0||y.call(c)}else g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:xe(o.onPointerLeave,g=>{if(g.currentTarget===document.activeElement){var y;(y=c.onItemLeave)===null||y===void 0||y.call(c)}}),onKeyDown:xe(o.onKeyDown,g=>{var y;((y=c.searchRef)===null||y===void 0?void 0:y.current)!==""&&g.key===" "||(Tle.includes(g.key)&&m(),g.key===" "&&g.preventDefault())})}))))}),yv="SelectItemText",Xle=k.forwardRef((t,e)=>{const{__scopeSelect:r,className:n,style:i,...s}=t,o=xu(yv,r),a=Ob(yv,r),c=Yle(yv,r),l=$le(yv,r),[u,f]=k.useState(null),d=Kt(e,g=>f(g),c.onItemTextChange,g=>{var y;return(y=a.itemTextRefCallback)===null||y===void 0?void 0:y.call(a,g,c.value,c.disabled)}),h=u==null?void 0:u.textContent,p=k.useMemo(()=>k.createElement("option",{key:c.value,value:c.value,disabled:c.disabled},h),[c.disabled,c.value,h]),{onNativeOptionAdd:v,onNativeOptionRemove:m}=l;return Qi(()=>(v(p),()=>m(p)),[v,m,p]),k.createElement(k.Fragment,null,k.createElement(et.span,_e({id:c.textId},s,{ref:d})),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?$s.createPortal(s.children,o.valueNode):null)});function oB(t){return t===""||t===void 0}const aB=k.forwardRef((t,e)=>{const{value:r,...n}=t,i=k.useRef(null),s=Kt(e,i),o=vb(r);return k.useEffect(()=>{const a=i.current,c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==r&&u){const f=new Event("change",{bubbles:!0});u.call(a,r),a.dispatchEvent(f)}},[o,r]),k.createElement(iB,{asChild:!0},k.createElement("select",_e({},n,{ref:s,defaultValue:r})))});aB.displayName="BubbleSelect";function cB(t){const e=Ki(t),r=k.useRef(""),n=k.useRef(0),i=k.useCallback(o=>{const a=r.current+o;e(a),function c(l){r.current=l,window.clearTimeout(n.current),l!==""&&(n.current=window.setTimeout(()=>c(""),1e3))}(a)},[e]),s=k.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return k.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,i,s]}function lB(t,e,r){const i=e.length>1&&Array.from(e).every(l=>l===e[0])?e[0]:e,s=r?t.indexOf(r):-1;let o=Zle(t,Math.max(s,0));i.length===1&&(o=o.filter(l=>l!==r));const c=o.find(l=>l.textValue.toLowerCase().startsWith(i.toLowerCase()));return c!==r?c:void 0}function Zle(t,e){return t.map((r,n)=>t[(e+n)%t.length])}const eue=Mle,tue=Dle,rue=Ble,nue=Fle,iue=jle,sue=qle,oue=Kle,aue=Jle,cue=Xle;var lue="gohwuma fyvr11d0 fyvr11do fyvr11bo fyvr11cc fyvr11ls fyvr11m8 fyvr11ms fyvr11tt fyvr12rt fyvr11nj",uue="gohwume _1qxj1ib9 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 fyvr1ww fyvr1ys fyvr1t0 fyvr1uw fyvr12wk fyvr12wl fyvr12we fyvr12wf fyvr11h0 fyvr11jw fyvr11ko fyvr12uz fyvr12uv fyvr12rt fyvr12vt fyvr12vj",fue="gohwum1 _1qxj1ib9 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 fyvr1t4 fyvr1v0 fyvr1ww fyvr1ys fyvr11ko fyvr11ob fyvr11hc fyvr11f4 fyvr12rt fyvr118c fyvr11jw fyvr11n2 fyvr12uz",due=dr({defaultClassName:"gohwum5",variantClassNames:{borderRadius:{xs:"fyvr11cw fyvr11dk fyvr11bk fyvr11c8",sm:"fyvr11d0 fyvr11do fyvr11bo fyvr11cc",md:"fyvr11d4 fyvr11ds fyvr11bs fyvr11cg"}},defaultVariants:{},compoundVariants:[]});const hue=k.forwardRef(({children:t,className:e,...r},n)=>Q.jsx(aue,{className:Ti(uue,e),...r,ref:n,children:Q.jsx(cue,{children:t})}));k.forwardRef((t,e)=>{const{borderRadius:r="md",disabled:n=!1,id:i,label:s="",description:o,labelLocation:a="hidden",name:c,options:l,placeholder:u,...f}=t;return Q.jsx(gu,{disabled:n,display:"grid",id:i??c,label:s,labelLocation:a,description:o,whiteSpace:"nowrap",children:Q.jsxs(eue,{disabled:n,name:c,...f,children:[Q.jsxs(tue,{id:i??c,className:Ti(fue,due({borderRadius:r})),ref:e,children:[Q.jsx(rue,{placeholder:u}),Q.jsx(q,{as:nue,display:"inline-flex",children:Q.jsx(VD,{})})]}),Q.jsx(iue,{className:lue,children:Q.jsx(sue,{children:Q.jsx(oue,{children:l.map(({value:d,label:h,...p})=>Q.jsx(hue,{value:d,...p,children:h},d))})})})]})})});k.forwardRef((t,e)=>{const{controls:r,onChange:n,placeholder:i="Search",name:s="search",value:o,...a}=t,c=o?Q.jsx(sa,{icon:bu,size:"xs",onClick:()=>n==null?void 0:n({target:{value:""}})}):void 0;return Q.jsx(qc,{ref:e,name:s,leftIcon:bb,controls:r||c,placeholder:i,value:o,onChange:l=>n==null?void 0:n(l),...a})});var pue=dr({defaultClassName:"en4abt1",variantClassNames:{size:{sm:"en4abt2",md:"en4abt3",lg:"en4abt4"}},defaultVariants:{},compoundVariants:[]});const GC=k.forwardRef((t,e)=>{const{size:r="md",...n}=t;return Q.jsx(q,{className:pue({size:r}),color:"text50",ref:e,...n,children:Q.jsxs("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",children:[Q.jsx("circle",{cx:"12",cy:"12",fill:"none",r:"10.5",strokeDasharray:"42",strokeLinecap:"round"}),Q.jsx("circle",{cx:"12",cy:"12",fill:"none",opacity:"0.25",r:"10.5",strokeLinecap:"round"})]})})});k.forwardRef(({children:t},e)=>Q.jsx(q,{ref:e,width:"fit",height:"fit",onClick:r=>{r.preventDefault(),r.stopPropagation()},onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),r.stopPropagation())},children:t}));const uB="Switch",[vue,gTe]=_n(uB),[mue,yue]=vue(uB),gue=k.forwardRef((t,e)=>{const{__scopeSwitch:r,name:n,checked:i,defaultChecked:s,required:o,disabled:a,value:c="on",onCheckedChange:l,...u}=t,[f,d]=k.useState(null),h=Kt(e,y=>d(y)),p=k.useRef(!1),v=f?!!f.closest("form"):!0,[m=!1,g]=kc({prop:i,defaultProp:s,onChange:l});return k.createElement(mue,{scope:r,checked:m,disabled:a},k.createElement(et.button,yt({type:"button",role:"switch","aria-checked":m,"aria-required":o,"data-state":fB(m),"data-disabled":a?"":void 0,disabled:a,value:c},u,{ref:h,onClick:xe(t.onClick,y=>{g(b=>!b),v&&(p.current=y.isPropagationStopped(),p.current||y.stopPropagation())})})),v&&k.createElement(xue,{control:f,bubbles:!p.current,name:n,value:c,checked:m,required:o,disabled:a,style:{transform:"translateX(-100%)"}}))}),bue="SwitchThumb",wue=k.forwardRef((t,e)=>{const{__scopeSwitch:r,...n}=t,i=yue(bue,r);return k.createElement(et.span,yt({"data-state":fB(i.checked),"data-disabled":i.disabled?"":void 0},n,{ref:e}))}),xue=t=>{const{control:e,checked:r,bubbles:n=!0,...i}=t,s=k.useRef(null),o=vb(r),a=mb(e);return k.useEffect(()=>{const c=s.current,l=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(l,"checked").set;if(o!==r&&f){const d=new Event("click",{bubbles:n});f.call(c,r),c.dispatchEvent(d)}},[o,r,n]),k.createElement("input",yt({type:"checkbox","aria-hidden":!0,defaultChecked:r},i,{tabIndex:-1,ref:s,style:{...t.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function fB(t){return t?"checked":"unchecked"}const Eue=gue,Cue=wue;var Sue="_1lp2u8e1 fyvr11dc fyvr11e0 fyvr11c0 fyvr11co fyvr1ss fyvr1uo fyvr1wk fyvr1yg fyvr11sz fyvr11hw fyvr12uz",kue="_1lp2u8e3 fyvr11dc fyvr11e0 fyvr11c0 fyvr11co fyvr11ho fyvr1ko fyvr1oo fyvr1k fyvr140 fyvr11nz";const w_=t=>{const{disabled:e,label:r,labelLocation:n="left",description:i,id:s,name:o,...a}=t;return Q.jsx(gu,{disabled:e,display:"flex",id:s??o,label:r,labelLocation:n,description:i,whiteSpace:"nowrap",children:Q.jsx(Eue,{className:Sue,disabled:e,...a,children:Q.jsx(q,{position:"relative",width:"full",height:"full",children:Q.jsx(Cue,{className:kue})})})})};dr({defaultClassName:"nwwh3z7",variantClassNames:{variant:{pill:"nwwh3z8",line:"nwwh3z9 fyvr11g0"},active:{true:"fyvr12vx",false:"nwwh3zb"},disabled:{true:"fyvr12vh"}},defaultVariants:{},compoundVariants:[[{active:!0,variant:"pill"},"fyvr11u5 fyvr12sb"],[{active:!1,variant:"pill"},"fyvr11ob fyvr12rz"],[{active:!0,variant:"line"},"fyvr12rt"],[{active:!1,variant:"line"},"fyvr12rz"]]});const dB="Tabs",[Aue,bTe]=_n(dB,[Nd]),hB=Nd(),[_ue,KC]=Aue(dB),Pue=k.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,onValueChange:i,defaultValue:s,orientation:o="horizontal",dir:a,activationMode:c="automatic",...l}=t,u=Eb(a),[f,d]=kc({prop:n,onChange:i,defaultProp:s});return k.createElement(_ue,{scope:r,baseId:pc(),value:f,onValueChange:d,orientation:o,dir:u,activationMode:c},k.createElement(et.div,yt({dir:u,"data-orientation":o},l,{ref:e})))}),Tue="TabsList",Iue=k.forwardRef((t,e)=>{const{__scopeTabs:r,loop:n=!0,...i}=t,s=KC(Tue,r),o=hB(r);return k.createElement(gL,yt({asChild:!0},o,{orientation:s.orientation,dir:s.dir,loop:n}),k.createElement(et.div,yt({role:"tablist","aria-orientation":s.orientation},i,{ref:e})))}),Oue="TabsTrigger",Rue=k.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,disabled:i=!1,...s}=t,o=KC(Oue,r),a=hB(r),c=pB(o.baseId,n),l=vB(o.baseId,n),u=n===o.value;return k.createElement(jC,yt({asChild:!0},a,{focusable:!i,active:u}),k.createElement(et.button,yt({type:"button",role:"tab","aria-selected":u,"aria-controls":l,"data-state":u?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c},s,{ref:e,onMouseDown:xe(t.onMouseDown,f=>{!i&&f.button===0&&f.ctrlKey===!1?o.onValueChange(n):f.preventDefault()}),onKeyDown:xe(t.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&o.onValueChange(n)}),onFocus:xe(t.onFocus,()=>{const f=o.activationMode!=="manual";!u&&!i&&f&&o.onValueChange(n)})})))}),$ue="TabsContent",Mue=k.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,forceMount:i,children:s,...o}=t,a=KC($ue,r),c=pB(a.baseId,n),l=vB(a.baseId,n),u=n===a.value,f=k.useRef(u);return k.useEffect(()=>{const d=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(d)},[]),k.createElement(Wc,{present:i||u},({present:d})=>k.createElement(et.div,yt({"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":c,hidden:!d,id:l,tabIndex:0},o,{ref:e,style:{...t.style,animationDuration:f.current?"0s":void 0}}),d&&s))});function pB(t,e){return`${t}-trigger-${e}`}function vB(t,e){return`${t}-content-${e}`}const Nue=Pue,Due=Iue,Lue=Rue;var Bue="_10c8o0n1 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg fyvr11h0 fyvr11hw fyvr128 fyvr11sh fyvr14o",Fue="_10c8o0n5 fyvr11d0 fyvr11do fyvr11bo fyvr11cc fyvr11ho fyvr1ko fyvr1oo fyvr14c fyvr11tt fyvr12vz",jue="_10c8o0n3 fyvr11d0 fyvr11do fyvr11bo fyvr11cc fyvr12wh fyvr12wb fyvr128 fyvr15o fyvr12uz fyvr11hw fyvr11ob fyvr11n2 fyvr12rz";const Uue=t=>{const{tabs:e,value:r}=t;if(!e.length)return null;const n=100/e.length,i=e.findIndex(s=>s.value===r);return Q.jsxs(Due,{className:Bue,style:{outline:void 0},children:[Q.jsx(q,{display:"flex",position:"absolute",inset:"2",height:"8",children:Q.jsx("div",{className:Fue,style:{width:`${n}%`,transform:`translateX(${i*100}%)`}})}),e.map(s=>Q.jsx(Lue,{className:jue,value:s.value,children:Q.jsx(ie,{variant:"normal",fontWeight:"bold",children:s.label})},s.value))]})},zue=Nue,x_=Mue;var Wue="_1qxj1ib9 fyvr11mv fyvr11e8 fyvr11fw fyvr11fs fyvr11fc fyvr11cw fyvr11dk fyvr11bk fyvr11c8 fyvr1wo fyvr1yk fyvr1ss fyvr1uo fyvr11hc fyvr118c fyvr11n7";k.forwardRef((t,e)=>{const{icon:r,label:n,...i}=t;return Q.jsxs(q,{className:Wue,ref:e,background:"buttonGlass",...i,children:[r&&Q.jsx(r,{size:"xs"}),Q.jsx(ie,{children:n})]})});const Hue="ToastProvider",[que,wTe,Vue]=xb("Toast"),[mB,xTe]=_n("Toast",[Vue]),[ETe,yB]=mB(Hue),E_="toast.viewportPause",C_="toast.viewportResume",Rb="Toast",Gue="toast.swipeStart",Kue="toast.swipeMove",Que="toast.swipeCancel",Yue="toast.swipeEnd",[Jue,Xue]=mB(Rb,{onClose(){}}),Zue=k.forwardRef((t,e)=>{const{__scopeToast:r,type:n="foreground",duration:i,open:s,onClose:o,onEscapeKeyDown:a,onPause:c,onResume:l,onSwipeStart:u,onSwipeMove:f,onSwipeCancel:d,onSwipeEnd:h,...p}=t,v=yB(Rb,r),[m,g]=k.useState(null),y=Kt(e,x=>g(x)),b=k.useRef(null),C=k.useRef(null),A=i||v.duration,O=k.useRef(0),w=k.useRef(A),I=k.useRef(0),{onToastAdd:B,onToastRemove:z}=v,H=Ki(()=>{var x;(m==null?void 0:m.contains(document.activeElement))&&((x=v.viewport)===null||x===void 0||x.focus()),o()}),K=k.useCallback(x=>{!x||x===1/0||(window.clearTimeout(I.current),O.current=new Date().getTime(),I.current=window.setTimeout(H,x))},[H]);k.useEffect(()=>{const x=v.viewport;if(x){const P=()=>{K(w.current),l==null||l()},$=()=>{const D=new Date().getTime()-O.current;w.current=w.current-D,window.clearTimeout(I.current),c==null||c()};return x.addEventListener(E_,$),x.addEventListener(C_,P),()=>{x.removeEventListener(E_,$),x.removeEventListener(C_,P)}}},[v.viewport,A,c,l,K]),k.useEffect(()=>{s&&!v.isClosePausedRef.current&&K(A)},[s,A,v.isClosePausedRef,K]),k.useEffect(()=>(B(),()=>z()),[B,z]);const F=k.useMemo(()=>m?bB(m):null,[m]);return v.viewport?k.createElement(k.Fragment,null,F&&k.createElement(efe,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0},F),k.createElement(Jue,{scope:r,onClose:H},$s.createPortal(k.createElement(que.ItemSlot,{scope:r},k.createElement(Wse,{asChild:!0,onEscapeKeyDown:xe(a,()=>{v.isFocusedToastEscapeKeyDownRef.current||H(),v.isFocusedToastEscapeKeyDownRef.current=!1})},k.createElement(et.li,_e({role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":v.swipeDirection},p,{ref:y,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:xe(t.onKeyDown,x=>{x.key==="Escape"&&(a==null||a(x.nativeEvent),x.nativeEvent.defaultPrevented||(v.isFocusedToastEscapeKeyDownRef.current=!0,H()))}),onPointerDown:xe(t.onPointerDown,x=>{x.button===0&&(b.current={x:x.clientX,y:x.clientY})}),onPointerMove:xe(t.onPointerMove,x=>{if(!b.current)return;const P=x.clientX-b.current.x,$=x.clientY-b.current.y,D=!!C.current,_=["left","right"].includes(v.swipeDirection),N=["left","up"].includes(v.swipeDirection)?Math.min:Math.max,L=_?N(0,P):0,R=_?0:N(0,$),E=x.pointerType==="touch"?10:2,M={x:L,y:R},j={originalEvent:x,delta:M};D?(C.current=M,gv(Kue,f,j,{discrete:!1})):S_(M,v.swipeDirection,E)?(C.current=M,gv(Gue,u,j,{discrete:!1}),x.target.setPointerCapture(x.pointerId)):(Math.abs(P)>E||Math.abs($)>E)&&(b.current=null)}),onPointerUp:xe(t.onPointerUp,x=>{const P=C.current,$=x.target;if($.hasPointerCapture(x.pointerId)&&$.releasePointerCapture(x.pointerId),C.current=null,b.current=null,P){const D=x.currentTarget,_={originalEvent:x,delta:P};S_(P,v.swipeDirection,v.swipeThreshold)?gv(Yue,h,_,{discrete:!0}):gv(Que,d,_,{discrete:!0}),D.addEventListener("click",N=>N.preventDefault(),{once:!0})}})})))),v.viewport))):null});Zue.propTypes={type(t){if(t.type&&!["foreground","background"].includes(t.type)){const e=`Invalid prop \`type\` supplied to \`${Rb}\`. Expected \`foreground | background\`.`;return new Error(e)}return null}};const efe=t=>{const{__scopeToast:e,children:r,...n}=t,i=yB(Rb,e),[s,o]=k.useState(!1),[a,c]=k.useState(!1);return sfe(()=>o(!0)),k.useEffect(()=>{const l=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(l)},[]),a?null:k.createElement(vL,{asChild:!0},k.createElement(iB,n,s&&k.createElement(k.Fragment,null,i.label," ",r)))},tfe="ToastAction",rfe=k.forwardRef((t,e)=>{const{altText:r,...n}=t;return r?k.createElement(gB,{altText:r,asChild:!0},k.createElement(ife,_e({},n,{ref:e}))):null});rfe.propTypes={altText(t){return t.altText?null:new Error(`Missing prop \`altText\` expected on \`${tfe}\``)}};const nfe="ToastClose",ife=k.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t,i=Xue(nfe,r);return k.createElement(gB,{asChild:!0},k.createElement(et.button,_e({type:"button"},n,{ref:e,onClick:xe(t.onClick,i.onClose)})))}),gB=k.forwardRef((t,e)=>{const{__scopeToast:r,altText:n,...i}=t;return k.createElement(et.div,_e({"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0},i,{ref:e}))});function bB(t){const e=[];return Array.from(t.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&e.push(n.textContent),ofe(n)){const i=n.ariaHidden||n.hidden||n.style.display==="none",s=n.dataset.radixToastAnnounceExclude==="";if(!i)if(s){const o=n.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...bB(n))}}),e}function gv(t,e,r,{discrete:n}){const i=r.originalEvent.currentTarget,s=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});e&&i.addEventListener(t,e,{once:!0}),n?OC(i,s):i.dispatchEvent(s)}const S_=(t,e,r=0)=>{const n=Math.abs(t.x),i=Math.abs(t.y),s=n>i;return e==="left"||e==="right"?s&&n>r:!s&&i>r};function sfe(t=()=>{}){const e=Ki(t);Qi(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[e])}function ofe(t){return t.nodeType===t.ELEMENT_NODE}dr({defaultClassName:"_6wut8v3",variantClassNames:{variant:{normal:"_6wut8v4",success:"_6wut8v5",error:"_6wut8v6"}},defaultVariants:{},compoundVariants:[]});k.createContext(null);var afe="_15pztn2",cfe="_15pztn1 _1qxj1ib9 fyvr11mv fyvr11eg fyvr11g0 fyvr11fs fyvr11f0 fyvr11d4 fyvr11ds fyvr11bs fyvr11cg fyvr1t4 fyvr1v0 fyvr1ww fyvr1ys fyvr11ko fyvr11ob fyvr12rt fyvr128 fyvr11h0";k.forwardRef((t,e)=>{const{as:r="textarea",autoComplete:n="off",borderRadius:i="md",description:s,disabled:o=!1,id:a,label:c="",labelLocation:l="hidden",name:u,rows:f,resize:d=!1,...h}=t;return Q.jsx(gu,{description:s,disabled:o,display:"grid",id:a??u,label:c,labelLocation:l,children:Q.jsx(q,{as:r,autoComplete:n,spellCheck:"false",className:Ti(cfe,d&&afe),disabled:o,id:a??u,name:u,ref:e,rows:f,borderRadius:i,...h})})});var lfe="bnrrebg fyvr11dc fyvr11e0 fyvr11c0 fyvr11co fyvr11ls fyvr11m8 fyvr11jg fyvr11ko fyvr11sh fyvr128 fyvr15o fyvr11h0",ufe="bnrrebe",ffe=dr({defaultClassName:"bnrreb5 fyvr11ls fyvr11m8 fyvr11jg fyvr11ko fyvr11h0",variantClassNames:{size:{xs:"bnrreb6",sm:"bnrreb7",md:"bnrreb8",lg:"bnrreb9"},borderRadius:{circle:"fyvr11dc fyvr11e0 fyvr11c0 fyvr11co",lg:"fyvr11d8 fyvr11dw fyvr11bw fyvr11ck",md:"fyvr11d4 fyvr11ds fyvr11bs fyvr11cg",sm:"fyvr11d0 fyvr11do fyvr11bo fyvr11cc"}},defaultVariants:{},compoundVariants:[]});k.memo(t=>{const{borderRadius:e="circle",className:r,disableAnimation:n=!1,style:i,src:s,symbol:o,size:a="md",...c}=t;return Q.jsx(q,{className:Ti(r,ffe({borderRadius:e,size:a})),style:i,flexShrink:"0",...c,children:s?Q.jsx(gr,{className:ufe,disableAnimation:n,src:s}):Q.jsx(ie,{className:lfe,variant:"normal",fontWeight:"medium",color:"text50",uppercase:!0,children:o==null?void 0:o.replace(/\s/,"").slice(0,4)})})});const[$b,CTe]=_n("Tooltip",[Md]);Md();const dfe="TooltipProvider";$b(dfe);const wB="Tooltip";$b(wB);const hfe="TooltipPortal";$b(hfe,{forceMount:void 0});$b(wB,{isInside:!1});const pfe=(t,e={})=>{const r=new Map().set("isMobile",`@media screen and (max-width: ${jA.lg-1}px)`).set("isDesktop",`@media screen and (min-width: ${jA.lg}px)`);if(!t.startsWith("@media")){const c=r.get(t);if(!c||c==="")throw new Error(`useMediaQuery failed to get breakpoint from theme for: ${t}`);t=c}const n=t.replace(/^@media( ?)/m,""),i=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:s=!1}=e,[o,a]=k.useState(()=>i?window.matchMedia(n).matches:s);return k.useEffect(()=>{let c=!0;if(!i)return;const l=window.matchMedia(n),u=()=>{c&&a(l.matches)};return u(),l.addListener(u),()=>{c=!1,l.removeListener(u)}},[n,i]),o},vfe=[{inputs:[{internalType:"bytes32",type:"bytes32"}],name:"getAlternativeSignature",outputs:[{internalType:"string",type:"string"}],stateMutability:"view",type:"function"}];var mfe=Object.freeze({__proto__:null,abi:vfe});const yfe=[{type:"function",name:"isValidSignature",constant:!0,inputs:[{type:"bytes32"},{type:"bytes"}],outputs:[{type:"bytes4"}],payable:!1,stateMutability:"view"}],gfe={isValidSignatureBytes32:"0x1626ba7e"};var bfe=Object.freeze({__proto__:null,abi:yfe,returns:gfe});const wfe=[{inputs:[{internalType:"bytes",name:"error",type:"bytes"}],name:"ERC1271Revert",type:"error"},{inputs:[{internalType:"bytes",name:"error",type:"bytes"}],name:"ERC6492DeployFailed",type:"error"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSig",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"},{internalType:"bool",name:"allowSideEffects",type:"bool"},{internalType:"bool",name:"deployAlreadyDeployed",type:"bool"}],name:"isValidSigImpl",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSigNoThrow",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSigWithSideEffects",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],name:"isValidSigWithSideEffectsNoThrow",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}];var xfe=Object.freeze({__proto__:null,abi:wfe});const Efe=[{type:"function",name:"deploy",constant:!1,inputs:[{type:"address"},{type:"bytes32"}],outputs:[],payable:!0,stateMutability:"payable"}];var Cfe=Object.freeze({__proto__:null,abi:Efe});const Sfe=[{type:"function",name:"nonce",constant:!0,inputs:[],outputs:[{type:"uint256"}],payable:!1,stateMutability:"view"},{type:"function",name:"readNonce",constant:!0,inputs:[{type:"uint256"}],outputs:[{type:"uint256"}],payable:!1,stateMutability:"view"},{type:"function",name:"updateImplementation",constant:!1,inputs:[{type:"address"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"selfExecute",constant:!1,inputs:[{components:[{type:"bool",name:"delegateCall"},{type:"bool",name:"revertOnError"},{type:"uint256",name:"gasLimit"},{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}],type:"tuple[]"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"execute",constant:!1,inputs:[{components:[{type:"bool",name:"delegateCall"},{type:"bool",name:"revertOnError"},{type:"uint256",name:"gasLimit"},{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}],type:"tuple[]"},{type:"uint256"},{type:"bytes"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"createContract",inputs:[{type:"bytes"}],payable:!0,stateMutability:"payable"},{type:"function",name:"setExtraImageHash",constant:!1,inputs:[{type:"bytes32",name:"imageHash"},{type:"uint256",name:"expiration"}],outputs:[],payable:!1,stateMutability:"nonpayable"}];var kfe=Object.freeze({__proto__:null,abi:Sfe});const Afe=[{type:"function",name:"updateImageHash",constant:!0,inputs:[{type:"bytes32"}],outputs:[],payable:!1,stateMutability:"view"},{type:"function",name:"imageHash",constant:!0,inputs:[],outputs:[{type:"bytes32"}],payable:!1,stateMutability:"view"}];var _fe=Object.freeze({__proto__:null,abi:Afe});const Pfe=[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_mainModule",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_wallet",type:"address"},{indexed:!0,internalType:"bytes32",name:"_imageHash",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"_threshold",type:"uint256"},{indexed:!1,internalType:"bytes",name:"_signers",type:"bytes"}],name:"RequiredConfig",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_wallet",type:"address"},{indexed:!0,internalType:"address",name:"_signer",type:"address"}],name:"RequiredSigner",type:"event"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callBalanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callBlockNumber",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_i",type:"uint256"}],name:"callBlockhash",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"callChainId",outputs:[{internalType:"uint256",name:"id",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCode",outputs:[{internalType:"bytes",name:"code",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCodeHash",outputs:[{internalType:"bytes32",name:"codeHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCodeSize",outputs:[{internalType:"uint256",name:"size",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callCoinbase",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"callDifficulty",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasLeft",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasLimit",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasPrice",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callOrigin",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"callTimestamp",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"knownImageHashes",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"lastImageHashUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"lastSignerUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"lastWalletUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"bool",name:"delegateCall",type:"bool"},{internalType:"bool",name:"revertOnError",type:"bool"},{internalType:"uint256",name:"gasLimit",type:"uint256"},{internalType:"address",name:"target",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],internalType:"struct IModuleCalls.Transaction[]",name:"_txs",type:"tuple[]"}],name:"multiCall",outputs:[{internalType:"bool[]",name:"_successes",type:"bool[]"},{internalType:"bytes[]",name:"_results",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"uint256",name:"_threshold",type:"uint256"},{components:[{internalType:"uint256",name:"weight",type:"uint256"},{internalType:"address",name:"signer",type:"address"}],internalType:"struct RequireUtils.Member[]",name:"_members",type:"tuple[]"},{internalType:"bool",name:"_index",type:"bool"}],name:"publishConfig",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"uint256",name:"_sizeMembers",type:"uint256"},{internalType:"bytes",name:"_signature",type:"bytes"},{internalType:"bool",name:"_index",type:"bool"}],name:"publishInitialSigners",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"uint256",name:"_nonce",type:"uint256"}],name:"requireMinNonce",outputs:[],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_expiration",type:"uint256"}],name:"requireNonExpired",outputs:[],stateMutability:"view",type:"function"}];var Tfe=Object.freeze({__proto__:null,abi:Pfe});const Ife=[{inputs:[{internalType:"address",name:"",type:"address"}],name:"requireFreshSigner",outputs:[],stateMutability:"nonpayable",type:"function"}];var Ofe=Object.freeze({__proto__:null,abi:Ife});const Xr={erc6492:xfe,erc5719:mfe,erc1271:bfe,factory:Cfe,mainModule:kfe,mainModuleUpgradable:_fe,sequenceUtils:Tfe,requireFreshSigner:Ofe},Rfe=Object.freeze(Object.defineProperty({__proto__:null,walletContracts:Xr},Symbol.toStringTag,{value:"Module"}));function Oy(){return Oy=Object.assign?Object.assign.bind():function(t){for(var e=1;ethis.fetch(this.url("Ping"),me({},n)).then(i=>ye(i).then(s=>({status:s.status}))),this.version=n=>this.fetch(this.url("Version"),me({},n)).then(i=>ye(i).then(s=>({version:s.version}))),this.runtimeStatus=n=>this.fetch(this.url("RuntimeStatus"),me({},n)).then(i=>ye(i).then(s=>({status:s.status}))),this.getSequenceContext=n=>this.fetch(this.url("GetSequenceContext"),me({},n)).then(i=>ye(i).then(s=>({data:s.data}))),this.getAuthToken=(n,i)=>this.fetch(this.url("GetAuthToken"),me(n,i)).then(s=>ye(s).then(o=>({status:o.status,jwtToken:o.jwtToken,address:o.address,user:o.user}))),this.sendPasswordlessLink=(n,i)=>this.fetch(this.url("SendPasswordlessLink"),me(n,i)).then(s=>ye(s).then(o=>({status:o.status}))),this.friendList=(n,i)=>this.fetch(this.url("FriendList"),me(n,i)).then(s=>ye(s).then(o=>({page:o.page,friends:o.friends}))),this.getFriendByAddress=(n,i)=>this.fetch(this.url("GetFriendByAddress"),me(n,i)).then(s=>ye(s).then(o=>({status:o.status,friend:o.friend}))),this.searchFriends=(n,i)=>this.fetch(this.url("SearchFriends"),me(n,i)).then(s=>ye(s).then(o=>({friends:o.friends}))),this.addFriend=(n,i)=>this.fetch(this.url("AddFriend"),me(n,i)).then(s=>ye(s).then(o=>({status:o.status,friend:o.friend}))),this.updateFriendNickname=(n,i)=>this.fetch(this.url("UpdateFriendNickname"),me(n,i)).then(s=>ye(s).then(o=>({status:o.status,friend:o.friend}))),this.removeFriend=(n,i)=>this.fetch(this.url("RemoveFriend"),me(n,i)).then(s=>ye(s).then(o=>({status:o.status}))),this.contractCall=(n,i)=>this.fetch(this.url("ContractCall"),me(n,i)).then(s=>ye(s).then(o=>({returns:o.returns}))),this.decodeContractCall=(n,i)=>this.fetch(this.url("DecodeContractCall"),me(n,i)).then(s=>ye(s).then(o=>({call:o.call}))),this.lookupContractCallSelectors=(n,i)=>this.fetch(this.url("LookupContractCallSelectors"),me(n,i)).then(s=>ye(s).then(o=>({signatures:o.signatures}))),this.userStorageFetch=(n,i)=>this.fetch(this.url("UserStorageFetch"),me(n,i)).then(s=>ye(s).then(o=>({object:o.object}))),this.userStorageSave=(n,i)=>this.fetch(this.url("UserStorageSave"),me(n,i)).then(s=>ye(s).then(o=>({ok:o.ok}))),this.userStorageDelete=(n,i)=>this.fetch(this.url("UserStorageDelete"),me(n,i)).then(s=>ye(s).then(o=>({ok:o.ok}))),this.userStorageFetchAll=(n,i)=>this.fetch(this.url("UserStorageFetchAll"),me(n,i)).then(s=>ye(s).then(o=>({objects:o.objects}))),this.getMoonpayLink=(n,i)=>this.fetch(this.url("GetMoonpayLink"),me(n,i)).then(s=>ye(s).then(o=>({signedUrl:o.signedUrl}))),this.getSardineClientToken=n=>this.fetch(this.url("GetSardineClientToken"),me({},n)).then(i=>ye(i).then(s=>({token:s.token}))),this.isUsingGoogleMail=(n,i)=>this.fetch(this.url("IsUsingGoogleMail"),me(n,i)).then(s=>ye(s).then(o=>({yes:o.yes}))),this.resolveENSAddress=(n,i)=>this.fetch(this.url("ResolveENSAddress"),me(n,i)).then(s=>ye(s).then(o=>({address:o.address,ok:o.ok}))),this.isValidSignature=(n,i)=>this.fetch(this.url("IsValidSignature"),me(n,i)).then(s=>ye(s).then(o=>({isValid:o.isValid}))),this.isValidMessageSignature=(n,i)=>this.fetch(this.url("IsValidMessageSignature"),me(n,i)).then(s=>ye(s).then(o=>({isValid:o.isValid}))),this.isValidTypedDataSignature=(n,i)=>this.fetch(this.url("IsValidTypedDataSignature"),me(n,i)).then(s=>ye(s).then(o=>({isValid:o.isValid}))),this.isValidETHAuthProof=(n,i)=>this.fetch(this.url("IsValidETHAuthProof"),me(n,i)).then(s=>ye(s).then(o=>({isValid:o.isValid}))),this.getCoinPrices=(n,i)=>this.fetch(this.url("GetCoinPrices"),me(n,i)).then(s=>ye(s).then(o=>({tokenPrices:o.tokenPrices}))),this.getCollectiblePrices=(n,i)=>this.fetch(this.url("GetCollectiblePrices"),me(n,i)).then(s=>ye(s).then(o=>({tokenPrices:o.tokenPrices}))),this.getExchangeRate=(n,i)=>this.fetch(this.url("GetExchangeRate"),me(n,i)).then(s=>ye(s).then(o=>({exchangeRate:o.exchangeRate}))),this.memoryStore=(n,i)=>this.fetch(this.url("MemoryStore"),me(n,i)).then(s=>ye(s).then(o=>({ok:o.ok}))),this.memoryLoad=(n,i)=>this.fetch(this.url("MemoryLoad"),me(n,i)).then(s=>ye(s).then(o=>({value:o.value}))),this.listPayCardsOnFile=n=>this.fetch(this.url("ListPayCardsOnFile"),me({},n)).then(i=>ye(i).then(s=>({payCards:s.payCards}))),this.savePayCard=(n,i)=>this.fetch(this.url("SavePayCard"),me(n,i)).then(s=>ye(s).then(o=>({ok:o.ok,payCard:o.payCard}))),this.updatePayCardCVC=(n,i)=>this.fetch(this.url("UpdatePayCardCVC"),me(n,i)).then(s=>ye(s).then(o=>({ok:o.ok}))),this.deletePayCard=(n,i)=>this.fetch(this.url("DeletePayCard"),me(n,i)).then(s=>ye(s).then(o=>({ok:o.ok}))),this.smartRampQuote=(n,i)=>this.fetch(this.url("SmartRampQuote"),me(n,i)).then(s=>ye(s).then(o=>({status:o.status,quoteDetails:o.quoteDetails}))),this.smartRampPurchase=(n,i)=>this.fetch(this.url("SmartRampPurchase"),me(n,i)).then(s=>ye(s).then(o=>({processing:o.processing,receipt:o.receipt}))),this.smartRampWaitOrderConfirmation=(n,i)=>this.fetch(this.url("SmartRampWaitOrderConfirmation"),me(n,i)).then(s=>ye(s).then(o=>({done:o.done,receipt:o.receipt}))),this.smartRampGetOrder=(n,i)=>this.fetch(this.url("SmartRampGetOrder"),me(n,i)).then(s=>ye(s).then(o=>({order:o.order}))),this.smartRampCheckCardAuthorization=(n,i)=>this.fetch(this.url("SmartRampCheckCardAuthorization"),me(n,i)).then(s=>ye(s).then(o=>({cardAuth:o.cardAuth}))),this.smartRampOrdersList=(n,i)=>this.fetch(this.url("SmartRampOrdersList"),me(n,i)).then(s=>ye(s).then(o=>({page:o.page,orders:o.orders}))),this.smartRampGetOrderTxnHash=(n,i)=>this.fetch(this.url("SmartRampGetOrderTxnHash"),me(n,i)).then(s=>ye(s).then(o=>({txnHash:o.txnHash,txnSuccessful:o.txnSuccessful}))),this.smartRampSubmitCardAuthorization=(n,i)=>this.fetch(this.url("SmartRampSubmitCardAuthorization"),me(n,i)).then(s=>ye(s).then(o=>({status:o.status}))),this.adminSmartRampGetOrder=(n,i)=>this.fetch(this.url("AdminSmartRampGetOrder"),me(n,i)).then(s=>ye(s).then(o=>({order:o.order}))),this.adminSmartRampListCompletedOrders=(n,i)=>this.fetch(this.url("AdminSmartRampListCompletedOrders"),me(n,i)).then(s=>ye(s).then(o=>({orders:o.orders}))),this.adminSmartRampListPendingOrders=(n,i)=>this.fetch(this.url("AdminSmartRampListPendingOrders"),me(n,i)).then(s=>ye(s).then(o=>({pendingOrders:o.pendingOrders}))),this.getInviteInfo=n=>this.fetch(this.url("GetInviteInfo"),me({},n)).then(i=>ye(i).then(s=>({inviteInfo:s.inviteInfo}))),this.isValidAccessCode=(n,i)=>this.fetch(this.url("IsValidAccessCode"),me(n,i)).then(s=>ye(s).then(o=>({status:o.status}))),this.internalClaimAccessCode=(n,i)=>this.fetch(this.url("InternalClaimAccessCode"),me(n,i)).then(s=>ye(s).then(o=>({status:o.status}))),this.walletRecover=(n,i)=>this.fetch(this.url("WalletRecover"),me(n,i)).then(s=>ye(s).then(o=>({encryptedWallet:o.encryptedWallet}))),this.blockNumberAtTime=(n,i)=>this.fetch(this.url("BlockNumberAtTime"),me(n,i)).then(s=>ye(s).then(o=>({blocks:o.blocks}))),this.paperSessionSecret=(n,i)=>this.fetch(this.url("PaperSessionSecret"),me(n,i)).then(s=>ye(s).then(o=>({secret:o.secret}))),this.paperSessionSecret2=(n,i)=>this.fetch(this.url("PaperSessionSecret2"),me(n,i)).then(s=>ye(s).then(o=>({secret:o.secret}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const me=(t={},e={})=>({method:"POST",headers:Oy({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{})}),ye=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch{throw{code:"unknown",msg:`expecting JSON, got: ${e}`,status:t.status}}if(!t.ok)throw r;return r}),k_=typeof global=="object"?global.fetch:window.fetch;class d0 extends xB{constructor(e,r,n){super(e.endsWith("/")?e.slice(0,-1):e,k_),this.projectAccessKey=r,this.jwtAuth=n,this._fetch=(i,s)=>{const o={},a=this.jwtAuth,c=this.projectAccessKey;return a&&a.length>0&&(o.Authorization=`BEARER ${a}`),c&&c.length>0&&(o["X-Access-Key"]=c),s.headers=Oy({},s.headers,o),k_(i,s)},this.fetch=this._fetch}}const Ffe=Object.freeze(Object.defineProperty({__proto__:null,API:xB,SequenceAPIClient:d0,SmartRampOrderStatus:Dfe,SmartRampTxnStatus:Lfe,SortOrder:Bfe,WebRPCSchemaHash:Nfe,WebRPCSchemaVersion:Mfe,WebRPCVersion:$fe},Symbol.toStringTag,{value:"Module"})),EB="3.7.5",jfe=EB,Ufe=typeof atob=="function",zfe=typeof btoa=="function",Ld=typeof Buffer=="function",A_=typeof TextDecoder=="function"?new TextDecoder:void 0,__=typeof TextEncoder=="function"?new TextEncoder:void 0,Wfe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Fh=Array.prototype.slice.call(Wfe),bv=(t=>{let e={};return t.forEach((r,n)=>e[r]=n),e})(Fh),Hfe=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,rn=String.fromCharCode.bind(String),P_=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),CB=t=>t.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),SB=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),kB=t=>{let e,r,n,i,s="";const o=t.length%3;for(let a=0;a255||(n=t.charCodeAt(a++))>255||(i=t.charCodeAt(a++))>255)throw new TypeError("invalid character found");e=r<<16|n<<8|i,s+=Fh[e>>18&63]+Fh[e>>12&63]+Fh[e>>6&63]+Fh[e&63]}return o?s.slice(0,o-3)+"===".substring(o):s},QC=zfe?t=>btoa(t):Ld?t=>Buffer.from(t,"binary").toString("base64"):kB,q6=Ld?t=>Buffer.from(t).toString("base64"):t=>{let r=[];for(let n=0,i=t.length;ne?CB(q6(t)):q6(t),qfe=t=>{if(t.length<2){var e=t.charCodeAt(0);return e<128?t:e<2048?rn(192|e>>>6)+rn(128|e&63):rn(224|e>>>12&15)+rn(128|e>>>6&63)+rn(128|e&63)}else{var e=65536+(t.charCodeAt(0)-55296)*1024+(t.charCodeAt(1)-56320);return rn(240|e>>>18&7)+rn(128|e>>>12&63)+rn(128|e>>>6&63)+rn(128|e&63)}},Vfe=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,AB=t=>t.replace(Vfe,qfe),T_=Ld?t=>Buffer.from(t,"utf8").toString("base64"):__?t=>q6(__.encode(t)):t=>QC(AB(t)),Nf=(t,e=!1)=>e?CB(T_(t)):T_(t),I_=t=>Nf(t,!0),Gfe=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,Kfe=t=>{switch(t.length){case 4:var e=(7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3),r=e-65536;return rn((r>>>10)+55296)+rn((r&1023)+56320);case 3:return rn((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return rn((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},_B=t=>t.replace(Gfe,Kfe),PB=t=>{if(t=t.replace(/\s+/g,""),!Hfe.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(t.length&3));let e,r="",n,i;for(let s=0;s>16&255):i===64?rn(e>>16&255,e>>8&255):rn(e>>16&255,e>>8&255,e&255);return r},YC=Ufe?t=>atob(SB(t)):Ld?t=>Buffer.from(t,"base64").toString("binary"):PB,TB=Ld?t=>P_(Buffer.from(t,"base64")):t=>P_(YC(t).split("").map(e=>e.charCodeAt(0))),IB=t=>TB(OB(t)),Qfe=Ld?t=>Buffer.from(t,"base64").toString("utf8"):A_?t=>A_.decode(TB(t)):t=>_B(YC(t)),OB=t=>SB(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),V6=t=>Qfe(OB(t)),Yfe=t=>{if(typeof t!="string")return!1;const e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},RB=t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),$B=function(){const t=(e,r)=>Object.defineProperty(String.prototype,e,RB(r));t("fromBase64",function(){return V6(this)}),t("toBase64",function(e){return Nf(this,e)}),t("toBase64URI",function(){return Nf(this,!0)}),t("toBase64URL",function(){return Nf(this,!0)}),t("toUint8Array",function(){return IB(this)})},MB=function(){const t=(e,r)=>Object.defineProperty(Uint8Array.prototype,e,RB(r));t("toBase64",function(e){return cm(this,e)}),t("toBase64URI",function(){return cm(this,!0)}),t("toBase64URL",function(){return cm(this,!0)})},Jfe=()=>{$B(),MB()},ru={version:EB,VERSION:jfe,atob:YC,atobPolyfill:PB,btoa:QC,btoaPolyfill:kB,fromBase64:V6,toBase64:Nf,encode:Nf,encodeURI:I_,encodeURL:I_,utob:AB,btou:_B,decode:V6,isValid:Yfe,fromUint8Array:cm,toUint8Array:IB,extendString:$B,extendUint8Array:MB,extendBuiltins:Jfe};var G6=function(){return G6=Object.assign||function(e){for(var r,n=1,i=arguments.length;n0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]0&&(i.types.Claims.push({name:"app",type:"string"}),i.message.app=this.claims.app),this.claims.iat&&this.claims.iat>0&&(i.types.Claims.push({name:"iat",type:"int64"}),i.message.iat=this.claims.iat),this.claims.exp&&this.claims.exp>0&&(i.types.Claims.push({name:"exp",type:"int64"}),i.message.exp=this.claims.exp),this.claims.n&&this.claims.n>0&&(i.types.Claims.push({name:"n",type:"uint64"}),i.message.n=this.claims.n),this.claims.typ&&this.claims.typ.length>0&&(i.types.Claims.push({name:"typ",type:"string"}),i.message.typ=this.claims.typ),this.claims.ogn&&this.claims.ogn.length>0&&(i.types.Claims.push({name:"ogn",type:"string"}),i.message.ogn=this.claims.ogn),this.claims.v&&this.claims.v.length>0&&(i.types.Claims.push({name:"v",type:"string"}),i.message.v=this.claims.v),i},t}(),Zfe=function(t){if(t.app==="")return{ok:!1,err:new Error("claims: app is empty")};var e=Math.round(new Date().getTime()/1e3),r=5*60,n=60*60*24*365+r;return t.v===""?{ok:!1,err:new Error("claims: ethauth version is empty")}:t.iat&&t.iat!==0&&(t.iat>e+r||t.iate+n?{ok:!1,err:new Error("claims: token has expired")}:{ok:!0}},ede=function(t,e,r){return bl(void 0,void 0,void 0,function(){var n,i;return wl(this,function(s){return n=r.messageDigest(),i=BM(n,r.signature),i.slice(0,2)==="0x"&&i.length===42&&i.toLowerCase()===r.address.toLowerCase()?[2,{isValid:!0,address:r.address}]:[2,{isValid:!1}]})})},tde=function(t,e,r){return bl(void 0,void 0,void 0,function(){var n,i,s,o,a;return wl(this,function(c){switch(c.label){case 0:return!t||t===void 0?[2,{isValid:!1}]:(n=r.messageDigest(),[4,t.getCode(r.address)]);case 1:if(i=c.sent(),i==="0x"||i.length<=2)throw new Error("ValidateContractAccountProof failed. unable to fetch wallet contract code");return s=["function isValidSignature(bytes32, bytes) public view returns (bytes4)"],o=new Pd(r.address,s,t),[4,o.isValidSignature(n,re(r.signature))];case 2:return a=c.sent(),a===rde?[2,{isValid:!0,address:r.address}]:[2,{isValid:!1}]}})})},rde="0x1626ba7e",NB="1",K6="eth",nde={name:"ETHAuth",version:NB},c1=function(){function t(){for(var e=[],r=0;r0&&(c+="."+i.extra),[2,c]}})})},this.decodeProof=function(i,s){return s===void 0&&(s=!1),bl(n,void 0,void 0,function(){var o,a,c,l,u,f,d,h,p,v;return wl(this,function(m){switch(m.label){case 0:if(o=i.split("."),o.length<4||o.length>5)throw new Error("ethauth: invalid proof string");if(a=o[0],c=o[1],l=o[2],u=o[3],f=o[4],a!==K6)throw new Error("ethauth: not an ethauth proof");return d=ru.decode(l),h=JSON.parse(d),p=new Mb({address:c,claims:h,signature:u,extra:f}),[4,this.validateProof(p,s)];case 1:if(v=m.sent(),!v)throw new Error("ethauth: proof is invalid");return[2,p]}})})},this.validateProof=function(i,s){return s===void 0&&(s=!1),bl(n,void 0,void 0,function(){var o,a;return wl(this,function(c){switch(c.label){case 0:if(o=this.validateProofClaims(i),o.err)throw new Error("ethauth: proof claims are invalid ".concat(o.err));return s===!0?[3,2]:[4,this.validateProofSignature(i)];case 1:if(a=c.sent(),a!==!0)throw new Error("ethauth: proof signature is invalid");c.label=2;case 2:return[2,!0]}})})},this.validateProofSignature=function(i){return bl(n,void 0,void 0,function(){var s,c,o,a,c;return wl(this,function(l){switch(l.label){case 0:s=[],c=0,l.label=1;case 1:if(!(cru.encode(t,!0),JC=t=>ru.encode(JSON.stringify(t),!0),sde=t=>{if(t!=null)return ru.decode(t)},XC=t=>{if(t!=null)return JSON.parse(ru.decode(t))};function DB(t){return t!=null&&(Z.isBigNumber(t)||typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||Ue(t)||typeof t=="bigint"||va(t))}const ZC=t=>re(Ee(typeof t=="string"?vt(t):t)),LB=(t,e,r)=>qe(["string","uint256","address","bytes32"],["",e,t,r]),Q6=(t,e,r)=>Ee(LB(t,e,r)),BB=()=>typeof window>"u"&&typeof process=="object",ode=()=>!BB(),FB=t=>{const e=t.split(".");if(e.length!==3)throw new Error("invalid jwt");return JSON.parse(ru.decode(e[1]))};function Ry(){return Ry=Object.assign?Object.assign.bind():function(t){for(var e=1;ege.configure(t),l1=(t,e,r)=>{const n={};return r&&r.length>0&&(n.Authorization=`BEARER ${r}`),e&&e.length>0&&(n["X-Access-Key"]=e),{url:t,headers:n,skipFetchSetup:!0,fetchOptions:{mode:"cors",cache:"force-cache",credentials:"same-origin",redirect:"follow",referrer:"client"}}};let cde=class{constructor(){this.cache=void 0,this.cache=new Map}do(e,r,n,...i){e=`${e}:${Ee(vt(JSON.stringify(i,lde)))}`;let s=this.cache.get(e);if(s&&s.expiration&&new Date>=s.expiration&&(s=void 0,this.cache.delete(e)),!s){const o={promise:n(...i)};r!==void 0&&(o.promise=o.promise.then(a=>(o.expiration=new Date(Date.now()+r),a))),s=o,this.cache.set(e,s)}return s.promise}};function lde(t,e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).sort()):e}function e4(t,e){return function(...r){const n=Array.prototype.slice.call(r);return new Promise(async(i,s)=>{try{n.push((o,a)=>o?s(o):i(a)),await t.apply(e,n)}catch(o){s(o)}})}}function ude(t,e){const r=encodeURIComponent(t),n=encodeURIComponent(JSON.stringify(e));return`${r}=${n}`}function fde(t){const e=t.split("&"),r={};for(const n of e){const i=n.split("=");r[decodeURIComponent(i[0])]=JSON.parse(decodeURIComponent(i[1]))}return r}const t4=(t=0,e=Number.MAX_SAFE_INTEGER)=>(t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t),UB=t=>{if(!t||typeof t!="string")return"";const e=t.match(/[\d.]+/);return e&&e.length>0?e[0].trim():""},zB=t=>{if(!t||typeof t!="string")return"";const e=t.match(/[\w\s\d]+/);return e&&e.length>0?e[0].trim():""},WB=t=>{if(!t||typeof t!="string")return"";const e=t.match(/[\w\d.\-:\/]+/);return e&&e.length>0?e[0].trim():""},dde=t=>new Promise(e=>{const r=setTimeout(()=>{clearTimeout(r),e()},t)}),HB=t=>{const e=Ry({},t.types);return delete e.EIP712Domain,_r.hash(t.domain,e,t.message)},sp=t=>re(HB(t)),{defineReadOnly:hde,getStatic:pde,resolveProperties:vde,checkProperties:mde,shallowCopy:yde,deepCopy:gde}=jZ,bde=t=>t.replace(/([^:]\/)\/+/g,"$1"),wde=Object.freeze(Object.defineProperty({__proto__:null,Logger:jB,PromiseCache:cde,base64Decode:sde,base64DecodeObject:XC,base64Encode:ide,base64EncodeObject:JC,checkProperties:mde,configureLogger:ade,deepCopy:gde,defineReadOnly:hde,encodeMessageDigest:ZC,encodeTypedDataDigest:sp,encodeTypedDataHash:HB,getEthersConnectionInfo:l1,getRandomInt:t4,getStatic:pde,isBigNumberish:DB,isBrowser:ode,isNode:BB,jwtDecodeClaims:FB,logger:ge,packMessageData:LB,promisify:e4,queryStringFromObject:ude,queryStringToObject:fde,resolveProperties:vde,sanitizeAlphanumeric:zB,sanitizeHost:WB,sanitizeNumberString:UB,shallowCopy:yde,sleep:dde,subDigestOf:Q6,urlClean:bde},Symbol.toStringTag,{value:"Module"}));function er(){return er=Object.assign?Object.assign.bind():function(t){for(var e=1;etypeof t=="number"?t:t.chainId?t.chainId:Z.from(t).toNumber(),Ede=t=>{if(t)return qB(t)},VB=(t,e=!1,r=!1)=>{if(!t)throw new Error("invalid network config: empty config");const n=[];if(Array.isArray(t)?n.push(...t):n.push(t),n.length===0){if(e)throw new Error("invalid network config: empty config");return!1}const i=n.map(l=>l.chainId).sort(),s=i.filter((l,u)=>i.indexOf(l)!==u);if(s.length>0){if(e)throw new Error(`invalid network config: duplicate chainIds ${s}`);return!1}n.forEach(l=>l.name=l.name.toLowerCase());const o=n.map(l=>l.name).sort(),a=o.filter((l,u)=>o.indexOf(l)!==u);if(a.length>0){if(e)throw new Error(`invalid network config: duplicate network names ${a}`);return!1}let c=!1;for(let l=0;l(VB(t,!0,e),t),Cde=(t,e=!0)=>{const r=t.map(i=>i.chainId).sort(),n=r.filter((i,s)=>r.indexOf(i)!==s);if(n.length>0){if(e)throw new Error(`invalid network config: duplicate chainIds ${n}`);return!1}return!0},Sde=(t,e)=>{if(!(!t||!e)){if(!t.chainId&&!t.name)throw new Error("failed to update network config: source config is missing chainId or name");if(t.chainId!==e.chainId&&t.name!==e.name)throw new Error("failed to update network config: one of chainId or name must match");t.rpcUrl&&(e.rpcUrl=t.rpcUrl,e.provider=void 0),t.provider&&(e.provider=t.provider),t.relayer&&(e.relayer=t.relayer)}},KB=t=>GB(QB(t)),_s=(t,e)=>{if(typeof e=="string")if(e.startsWith("0x")){const r=Z.from(e).toNumber();return t.find(n=>n.chainId===r)}else return t.find(r=>r.name===e||`${r.chainId}`===e);else{if(typeof e=="number")return t.find(r=>r.chainId===e);if(e.chainId)return t.find(r=>r.chainId===e.chainId);if(Z.isBigNumber(e)){const r=e.toNumber();return t.find(n=>n.chainId===r)}else return}},kde=(t,e)=>t?t.name===e||t.chainId===e:!1,Ade=t=>{const e={};for(let r=0;r{if(!t)return[];const e=t.sort((n,i)=>n.chainId===i.chainId?0:n.chainIdn.isDefaultChain);return r>0&&e.splice(0,0,e.splice(r,1)[0]),e},Nb=(t,e)=>typeof t=="string"?(e=e||{},t.replace(/\$\{\s*([$#@\-\d\w]+)\s*\}/gim,function(r,n){let i=e[n];return typeof i=="function"?i=i():i==null?i="":typeof i=="object"||typeof i=="symbol"?i=i.toString():i=i.valueOf(),i})):"",r4=t=>Nb("https://${network}-indexer.sequence.app",{network:t}),YB=t=>Nb("https://${network}-relayer.sequence.app",{network:t}),JB=t=>Nb("https://nodes.sequence.app/${network}",{network:t});function n4(t){return _s(ld,t)}function XB(t){return Z.isBigNumber(t)?t:DB(t)?Z.from(t):Z.from(t.chainId)}const kr=t=>{const e=JB(t);return{rpcUrl:e,relayer:{url:YB(t),provider:{url:e}},indexerUrl:r4(t)}},ld=KB([er({},Wt[se.POLYGON],kr("polygon"),{isDefaultChain:!0,isAuthChain:!0}),er({},Wt[se.MAINNET],kr("mainnet")),er({},Wt[se.BSC],kr("bsc")),er({},Wt[se.AVALANCHE],kr("avalanche")),er({},Wt[se.ARBITRUM],kr("arbitrum")),er({},Wt[se.ARBITRUM_NOVA],kr("arbitrum-nova")),er({},Wt[se.OPTIMISM],kr("optimism")),er({},Wt[se.OPTIMISM_SEPOLIA],kr("optimism-sepolia")),er({},Wt[se.POLYGON_ZKEVM],kr("polygon-zkevm")),er({},Wt[se.GNOSIS],kr("gnosis")),er({},Wt[se.RINKEBY],kr("rinkeby"),{disabled:!0}),er({},Wt[se.GOERLI],kr("goerli"),{disabled:!0}),er({},Wt[se.SEPOLIA],kr("sepolia")),er({},Wt[se.POLYGON_MUMBAI],kr("mumbai")),er({},Wt[se.BSC_TESTNET],kr("bsc-testnet")),er({},Wt[se.ARBITRUM_SEPOLIA],kr("arbitrum-sepolia")),er({},Wt[se.BASE],kr("base")),er({},Wt[se.BASE_SEPOLIA],kr("base-sepolia")),er({},Wt[se.HOMEVERSE_TESTNET],kr("homeverse-testnet")),er({},Wt[se.AVALANCHE_TESTNET],kr("avalanche-testnet")),er({},Wt[se.HARDHAT],{rpcUrl:"http://localhost:8545",relayer:{url:"http://localhost:3000",provider:{url:"http://localhost:8545"}}}),er({},Wt[se.HARDHAT_2],{rpcUrl:"http://localhost:9545",relayer:{url:"http://localhost:3000",provider:{url:"http://localhost:9545"}}})]),ud="2.0";class i4{constructor(e,r){this.sender=void 0,this.handler=void 0,this.sender=r,e&&this.setMiddleware(e)}setMiddleware(e){this.handler=ZB(e,this.sender.sendAsync)}sendAsync(e,r,n){try{this.handler(e,r,n)}catch(i){r(i,void 0)}}}const ZB=(t,e)=>{if(t.length===0)return e;const r=i=>i.sendAsyncMiddleware?i.sendAsyncMiddleware:i;let n;n=r(t[t.length-1])(e);for(let i=t.length-2;i>=0;i--)n=r(t[i])(n);return n};function eF(t){return t!==void 0&&t.send!==void 0&&t.constructor.defaultUrl!==void 0&&t.detectNetwork!==void 0&&t.getSigner!==void 0&&t.perform!==void 0}function tF(t){return t!==void 0&&t.sendAsync!==void 0}let _de=0;class $y{constructor(e,r){this.send=void 0,this.request=void 0,this.defaultChainId=void 0,this.sendAsync=(n,i,s)=>{this.send(n.method,n.params,s||this.defaultChainId).then(o=>{i(void 0,{jsonrpc:"2.0",id:n.id,result:o})}).catch(o=>{i(o,void 0)})},this.defaultChainId=r,eF(e)?this.send=e.send.bind(e):tF(e)?this.send=(n,i,s)=>new Promise((o,a)=>{e.sendAsync({jsonrpc:ud,id:++_de,method:n,params:i},(c,l)=>{c?a(c):o(l?l.result:void 0)},s||this.defaultChainId)}):this.send=e,this.request=(n,i)=>this.send(n.method,n.params,i)}}class Pde{constructor(e){this.provider=e,this.sendAsync=(r,n)=>{this.provider.send(r.method,r.params).then(i=>{n(void 0,{jsonrpc:"2.0",id:r.id,result:i})}).catch(i=>{n(i,void 0)})},this.send=this.sendAsync}}class Tde{constructor(e){this.sendAsyncMiddleware=void 0,this.isAllowedFunc=void 0,e?this.isAllowedFunc=e:this.isAllowedFunc=r=>!0,this.sendAsyncMiddleware=Y6(this.isAllowedFunc)}setIsAllowedFunc(e){this.isAllowedFunc=e,this.sendAsyncMiddleware=Y6(this.isAllowedFunc)}}const Y6=t=>e=>(r,n,i)=>{if(!t(r))throw new Error("allowProvider middleware precondition is unmet.");e(r,n,i)};class s4{constructor(e){this.cachableJsonRpcMethods=["net_version","eth_chainId","eth_accounts","sequence_getWalletContext","sequence_getNetworks"],this.cachableJsonRpcMethodsByBlock=["eth_call","eth_getCode"],this.cache=void 0,this.cacheByBlock=void 0,this.cacheByBlockResetLock=!1,this.onUpdateCallback=void 0,this.defaultChainId=void 0,this.sendAsyncMiddleware=r=>(n,i,s)=>{if(this.cachableJsonRpcMethods.includes(n.method)||this.cachableJsonRpcMethodsByBlock.includes(n.method)){const o=this.cacheKey(n.method,n.params,s||this.defaultChainId),a=this.getCacheValue(o);if(a&&a!==""){i(void 0,{jsonrpc:"2.0",id:n.id,result:a});return}}r(n,(o,a,c)=>{if((this.cachableJsonRpcMethods.includes(n.method)||this.cachableJsonRpcMethodsByBlock.includes(n.method))&&a&&a.result&&this.shouldCacheResponse(n,a)){const l=this.cacheKey(n.method,n.params,c||this.defaultChainId);this.cachableJsonRpcMethods.includes(n.method)?this.setCacheValue(l,a.result):this.setCacheByBlockValue(l,a.result)}i(o,a)},s||this.defaultChainId)},this.cacheKey=(r,n,i)=>{let s="";return i?s=`${i}:${r}:`:s=`:${r}:`,!n||n.length===0?s+"[]":s+JSON.stringify(n)},this.getCache=()=>this.cache,this.setCache=r=>{this.cache=r,this.onUpdateCallback&&this.onUpdateCallback()},this.getCacheValue=r=>{if(this.cache[r])return this.cache[r];if(this.cacheByBlock[r])return this.cacheByBlock[r]},this.setCacheValue=(r,n)=>{this.cache[r]=n,this.onUpdateCallback&&this.onUpdateCallback(r,n)},this.setCacheByBlockValue=(r,n)=>{this.cacheByBlock[r]=n,this.cacheByBlockResetLock||(this.cacheByBlockResetLock=!0,setTimeout(()=>{this.cacheByBlockResetLock=!1,this.cacheByBlock={}},1500))},this.shouldCacheResponse=(r,n)=>!(!n||!n.result||r.method==="eth_getCode"&&n.result.length<=2),this.clearCache=()=>{this.cache={},this.cacheByBlock={}},this.cache={},this.cacheByBlock={},this.defaultChainId=e==null?void 0:e.defaultChainId,e!=null&&e.blockCache?(e==null?void 0:e.blockCache)!==!0&&(this.cachableJsonRpcMethodsByBlock=e==null?void 0:e.blockCache):this.cachableJsonRpcMethodsByBlock=[]}onUpdate(e){this.onUpdateCallback=e}}class rF{constructor(e){this.options=void 0,this.sendAsyncMiddleware=r=>(n,i,s)=>{const{id:o,method:a}=n;switch(a){case"net_version":if(this.options.chainId){i(void 0,{jsonrpc:"2.0",id:o,result:`${this.options.chainId}`});return}break;case"eth_chainId":if(this.options.chainId){i(void 0,{jsonrpc:"2.0",id:o,result:te(this.options.chainId)});return}break;case"eth_accounts":if(this.options.accountAddress){i(void 0,{jsonrpc:"2.0",id:o,result:[Ie(this.options.accountAddress)]});return}break;case"sequence_getWalletContext":if(this.options.walletContext){i(void 0,{jsonrpc:"2.0",id:o,result:this.options.walletContext});return}break}r(n,i,s)},this.options=e}}const nF=t=>(e,r,n)=>{t(e,(i,s)=>{if(!i&&s&&s.error)throw typeof s.error=="string"?new Error(s.error):new Error(s.error.message);r(i,s)},n)},iF=t=>(e,r,n)=>{const i=n?` chainId:${n}`:"";ge.info(`[provider request]${i} id:${e.id} method:${e.method} params:`,e.params),t(e,(s,o)=>{s?ge.warn(`[provider response]${i} id:${e.id} method:${e.method} params:`,e.params,"error:",s):ge.info(`[provider response]${i} id:${e.id} method:${e.method} params:`,e.params,"response:",o),r(s,o)},n)},Ide=t=>e=>(r,n,i)=>{const s=t(r),{id:o,method:a}=r;switch(a){case"net_version":n(void 0,{jsonrpc:"2.0",id:o,result:`${s}`});return;case"eth_chainId":n(void 0,{jsonrpc:"2.0",id:o,result:te(s)});return}e(r,n,i)},sF=["personal_sign","eth_sign","eth_signTypedData","eth_signTypedData_v4","eth_sendTransaction","eth_sendRawTransaction","sequence_sign","sequence_signTypedData_v4","sequence_getWalletContext","sequence_getWalletConfig","sequence_getWalletState","sequence_getNetworks","sequence_updateConfig","sequence_publishConfig","sequence_gasRefundOptions","sequence_getNonce","sequence_relay","eth_decrypt","eth_getEncryptionPublicKey","wallet_addEthereumChain","wallet_switchEthereumChain","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"];class Ode{constructor(e){this.provider=void 0,this.sendAsyncMiddleware=r=>(n,i,s)=>{if(sF.includes(n.method)){this.provider.sendAsync(n,i,s);return}r(n,i,s)},this.provider=e}}class Rde{constructor(e){this.privateJsonRpcMethods=["net_version","eth_chainId","eth_accounts",...sF],this.provider=void 0,this.rpcUrl=void 0,this.sendAsyncMiddleware=r=>(n,i)=>{if(this.provider&&!this.privateJsonRpcMethods.includes(n.method)){this.provider.send(n.method,n.params).then(s=>{i(void 0,{jsonrpc:"2.0",id:n.id,result:s})}).catch(s=>i(s));return}ge.debug("[public-provider] sending request to signer window",n.method),r(n,i)},e&&this.setRpcUrl(e)}getRpcUrl(){return this.rpcUrl}setRpcUrl(e){!e||e===""?(this.rpcUrl=void 0,this.provider=void 0):(this.rpcUrl=e,this.provider=new ta(e))}}class oF{constructor(){this.singleflightJsonRpcMethods=["eth_chainId","net_version","eth_call","eth_getCode","eth_blockNumber","eth_getBalance","eth_getStorageAt","eth_getTransactionCount","eth_getBlockTransactionCountByHash","eth_getBlockTransactionCountByNumber","eth_getUncleCountByBlockHash","eth_getUncleCountByBlockNumber","eth_getBlockByHash","eth_getBlockByNumber","eth_getTransactionByHash","eth_getTransactionByBlockHashAndIndex","eth_getTransactionByBlockNumberAndIndex","eth_getTransactionReceipt","eth_getUncleByBlockHashAndIndex","eth_getUncleByBlockNumberAndIndex","eth_getLogs"],this.inflight=void 0,this.sendAsyncMiddleware=e=>(r,n,i)=>{if(!this.singleflightJsonRpcMethods.includes(r.method)){e(r,n,i);return}const s=this.requestKey(r.method,r.params||[],i);if(!this.inflight[s])this.inflight[s]=[];else{this.inflight[s].push({id:r.id,callback:n});return}e(r,(o,a,c)=>{n(o,a);for(let l=0;l{let i="";return n?i=`${n}:${e}:`:i=`:${e}:`,!r||r.length===0?i+"[]":i+JSON.stringify(r)},this.inflight={}}}class $de extends ta{constructor(e,r){super(e,r==null?void 0:r.chainId),this._chainId=void 0,this._sender=void 0,this.send=(a,c)=>this._sender.send(a,c),this.fetch=(a,c)=>{const l={method:a,params:c,id:this._nextId++,jsonrpc:"2.0"};return J1(this.connection,JSON.stringify(l),Mde).then(f=>f,f=>{throw f})};const n=r==null?void 0:r.chainId,i=r==null?void 0:r.middlewares,s=r==null?void 0:r.blockCache;this._chainId=n;const o=new i4(i??[new rF({chainId:n}),new oF,new s4({defaultChainId:n,blockCache:s})],new $y(this.fetch,n));this._sender=new $y(o,n)}async getNetwork(){const e=this._chainId;if(e){const r=Wt[e],n=(r==null?void 0:r.name)||"",i=r==null?void 0:r.ensAddress;return{name:n,chainId:e,ensAddress:i}}else{const r=await this.send("eth_chainId",[]);return this._chainId=Z.from(r).toNumber(),this.getNetwork()}}}function Mde(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}const Nde=Object.freeze(Object.defineProperty({__proto__:null,AllowProvider:Tde,CachedProvider:s4,ChainId:se,EagerProvider:rF,JsonRpcExternalProvider:Pde,JsonRpcProvider:$de,JsonRpcRouter:i4,JsonRpcSender:$y,JsonRpcVersion:ud,NetworkType:dt,PublicProvider:Rde,SigningProvider:Ode,SingleflightMiddleware:oF,allNetworks:ld,allowProviderMiddleware:Y6,checkNetworkConfig:kde,createJsonRpcMiddlewareStack:ZB,ensureUniqueNetworks:Cde,ensureValidNetworks:GB,exceptionProviderMiddleware:nF,findNetworkConfig:_s,findSupportedNetwork:n4,getChainId:qB,indexerURL:r4,isJsonRpcHandler:tF,isJsonRpcProvider:eF,isNetworkConfig:xde,isValidNetworkConfig:VB,loggingProviderMiddleware:iF,maybeChainId:Ede,networkProviderMiddleware:Ide,networks:Wt,networksIndex:Ade,nodesURL:JB,relayerURL:YB,sortNetworks:QB,stringTemplate:Nb,toChainIdNumber:XB,updateNetworkConfig:Sde,validateAndSortNetworks:KB},Symbol.toStringTag,{value:"Module"}));function on(){return on=Object.assign?Object.assign.bind():function(t){for(var e=1;e{if(a4(i))return qe(["uint8","uint8","address"],[Ll.Address,i.weight,i.address]);if(i.isDynamic){const s=re(i.signature);return qe(["uint8","uint8","address","uint16","bytes"],[Ll.DynamicSignature,i.weight,i.address,s.length,s])}return qe(["uint8","uint8","bytes"],[Ll.EOASignature,i.weight,i.signature])});return qe(["uint16",...new Array(n.length).fill("bytes")],[r,...n])}async function dF(t,e,r){const n=op(e),i=await Promise.all(t.signers.map(async s=>{if(a4(s))return s;if(s.isDynamic){if(!s.address)throw new Error("Dynamic signature part must have address");if(!o4(s.address,n,s.signature,r))throw new Error(`Invalid dynamic signature part ${s.address}`);return{address:s.address,weight:s.weight,signature:s.signature}}else return{address:ap(n,s.signature),weight:s.weight,signature:s.signature}}));return{version:1,payload:e,subdigest:n,config:{version:1,threshold:t.threshold,signers:i}}}function h0(t,e,r,n){if(r.length!==0)throw new Error("Explicit subdigests not supported on v1");let i=Z.from(0);const s=t.signers.map(a=>{if(!e.has(a.address))return a;const c=e.get(a.address),l=re(c.signature);return i=i.add(a.weight),c.isDynamic||l.length!==66?on({},a,{isDynamic:!0,signature:c.signature,address:a.address}):on({},a,{isDynamic:!1,signature:c.signature})});return{encoded:c4({version:1,threshold:t.threshold,signers:s}),weight:i}}const l4={decode:t=>fF(t),encode:t=>c4(t),trim:async t=>t,supportsNoChainId:!0,recover:(t,e,r)=>dF(t,e,r),encodeSigners:(t,e,r,n)=>h0(t,e,r),hasEnoughSigningPower:(t,e)=>{const{weight:r}=l4.encodeSigners(t,e,[],0);return r.gte(t.threshold)},chainSignatures:(t,e)=>{throw new Error("Signature chaining not supported on v1")},hashSetImageHash:function(t){throw new Error("Image hash not supported on v1")},signaturesOf(t){return t.signers.filter(e=>e.signature!==void 0).map(e=>({address:e.address,signature:e.signature}))},signaturesOfDecoded:function(t){return t.signers.map(e=>e.signature).filter(e=>e!==void 0)}};var Hde=Object.freeze({__proto__:null,SignaturePartType:Ll,isAddressMember:a4,isUnrecoveredSignatureMember:lF,isUnrecoveredSignature:uF,decodeSignature:fF,encodeSignature:c4,recoverSignature:dF,encodeSigners:h0,SignatureCoder:l4});const u4={isWalletConfig:t=>t.version===1&&t.threshold!==void 0&&t.signers!==void 0,imageHashOf:t=>t.signers.reduce((e,r)=>Ee(zn.encode(["bytes32","uint8","address"],[e,r.weight,r.address])),qe(["uint256"],[t.threshold])),hasSubdigest:(t,e)=>!1,isComplete:t=>!0,checkpointOf:t=>Z.from(0),signersOf:t=>t.signers.map(e=>({address:e.address,weight:Z.from(e.weight).toNumber()})),fromSimple:t=>{if(!rr.eq(t.checkpoint))throw new Error("v1 wallet config does not support checkpoint");if(t.subdigests&&t.subdigests.length>0)throw new Error("v1 wallet config does not support subdigests");return{version:1,threshold:t.threshold,signers:t.signers}},update:{isKindUsed:!0,buildTransaction:(t,e,r,n)=>{const i=new $r([...Xr.mainModule.abi,...Xr.mainModuleUpgradable.abi]),s=[];return(!n||n==="first")&&s.push({to:t,data:i.encodeFunctionData(i.getFunction("updateImplementation"),[r.mainModuleUpgradable]),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}),s.push({to:t,data:i.encodeFunctionData(i.getFunction("updateImageHash"),[u4.imageHashOf(e)]),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}),{entrypoint:t,transactions:s}},decodeTransaction:function(t){throw new Error("Function not implemented.")}},toJSON:function(t){const e=t.signers.map(r=>({weight:Z.from(r.weight).toString(),address:r.address}));return JSON.stringify({version:t.version,threshold:Z.from(t.threshold).toString(),signers:e})},fromJSON:function(t){const e=JSON.parse(t),r=e.signers.map(n=>({weight:Z.from(n.weight),address:n.address}));return{version:e.version,threshold:Z.from(e.threshold),signers:r}},editConfig:function(t,e){var r;const n=t.signers.slice();if(e.checkpoint&&!rr.eq(e.checkpoint))throw new Error("v1 wallet config does not support checkpoint");if(e.add)for(const i of e.add)n.find(s=>s.address===i.address)||n.push({weight:i.weight,address:i.address});if(e.remove)for(const i of e.remove){const s=n.findIndex(o=>o.address===i);s>=0&&n.splice(s,1)}return{version:t.version,threshold:(r=e.threshold)!=null?r:t.threshold,signers:n}},buildStubSignature:function(t,e){const r=new Map;for(const[i,s]of e.entries()){r.set(i,{signature:s,isDynamic:!0});const{encoded:o,weight:a}=h0(t,r,[]);if(a.gte(t.threshold))return o}const n=t.signers;for(const{address:i}of n.sort(({weight:s},{weight:o})=>Z.from(s).sub(o).toNumber())){const s="0x4e82f02f388a12b5f9d29eaf2452dd040c0ee5804b4e504b4dd64e396c6c781f2c7624195acba242dd825bfd25a290912e3c230841fd55c9a734c4de8d9899451b02";r.set(i,{signature:s,isDynamic:!1});const{encoded:o,weight:a}=h0(t,r,[]);if(a.gte(t.threshold))return o}return h0(t,r,[]).encoded}};var qde=Object.freeze({__proto__:null,ConfigCoder:u4});const hF=1,pF={version:hF,factory:"0xf9D09D634Fb818b05149329C1dcCFAeA53639d96",guestModule:"0x02390F3E6E5FD1C6786CB78FD3027C117a9955A7",mainModule:"0xd01F11855bCcb95f88D7A48492F66410d4637313",mainModuleUpgradable:"0x7EFE6cE415956c5f80C6530cC6cc81b4808F6118",walletCreationCode:"0x603a600e3d39601a805130553df3363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3"};var Bo=Object.freeze({__proto__:null,config:qde,signature:Hde,version:hF,DeployedWalletContext:pF});const f4="0x8713a7c4465f6fbee2b6e9d6646d1d9f83fec929edfc4baf661f3c865bdd04d1";function vF(t){return Ee(mF(t))}function mF(t){return qe(["bytes32","bytes32"],[f4,t])}function yF(t){const e=re(t);if(e.length===64&&te(e.slice(0,32))===f4)return te(e.slice(32,64))}function Vde(t){return yF(t)!==void 0}var Gde=Object.freeze({__proto__:null,SetImageHashPrefix:f4,hashSetImageHash:vF,messageSetImageHash:mF,decodeMessageSetImageHash:yF,isMessageSetImageHash:Vde});let Yr=function(t){return t[t.Legacy=0]="Legacy",t[t.Dynamic=1]="Dynamic",t[t.NoChainIdDynamic=2]="NoChainIdDynamic",t[t.Chained=3]="Chained",t}({}),mr=function(t){return t[t.Signature=0]="Signature",t[t.Address=1]="Address",t[t.DynamicSignature=2]="DynamicSignature",t[t.Node=3]="Node",t[t.Branch=4]="Branch",t[t.Subdigest=5]="Subdigest",t[t.Nested=6]="Nested",t}({});const My=66;function nu(t){return t.left!==void 0&&t.right!==void 0}function Bd(t){return t.tree!==void 0}function cp(t){return t.unrecovered&&t.signature!==void 0&&t.isDynamic!==void 0}function Ny(t){let e=re(t),r;const n=(i,s)=>i?i.right?{left:i,right:s}:{left:i.left,right:s}:{left:s};for(;e.length>0;){const i=e[0];switch(e=e.slice(1),i){case mr.Signature:{const s=e[0],o=te(e.slice(1,My+1));r=n(r,{signature:o,weight:s,unrecovered:!0,isDynamic:!1}),e=e.slice(My+1)}break;case mr.Address:{const s=e[0],o=Ie(te(e.slice(1,21)));r=n(r,{address:o,weight:s}),e=e.slice(21)}break;case mr.DynamicSignature:{const s=e[0],o=Ie(te(e.slice(1,21))),a=e[21]<<16|e[22]<<8|e[23],c=te(e.slice(24,24+a));r=n(r,{address:o,signature:c,weight:s,unrecovered:!0,isDynamic:!0}),e=e.slice(24+a)}break;case mr.Node:{const s=te(e.slice(0,32));r=n(r,{nodeHash:s}),e=e.slice(32)}break;case mr.Branch:{const s=e[0]<<16|e[1]<<8|e[2],o=Ny(e.slice(3,3+s));r=n(r,o),e=e.slice(3+s)}break;case mr.Subdigest:{const s=te(e.slice(0,32));r=n(r,{subdigest:s}),e=e.slice(32)}break;case mr.Nested:{const s=e[0],o=e[1]<<8|e[2],a=e[3]<<16|e[4]<<8|e[5],c=Ny(e.slice(6,6+a));r=n(r,{weight:s,threshold:o,tree:c}),e=e.slice(6+a)}break;default:throw new Error(`Unknown signature part type: ${i}: ${te(e)}`)}}if(!r)throw new Error("Empty signature tree");return r.right?r:r.left}class gF extends Error{constructor(e){super(`Invalid signature leaf: ${JSON.stringify(e)}`),this.leaf=e}}async function Bl(t,e,r){if(nu(t)){const[n,i]=await Promise.all([Bl(t.left,e,r),Bl(t.right,e,r)]);return{left:n,right:i}}if(Bd(t))return{weight:t.weight,threshold:t.threshold,tree:await Bl(t.tree,e,r)};if(cp(t))if(t.isDynamic){if(!t.address)throw new Error("Dynamic signature leaf without address");if(!await o4(t.address,e,t.signature,r))throw new gF(t);return{weight:t.weight,address:t.address,signature:t.signature,subdigest:e}}else return{weight:t.weight,address:ap(e,t.signature),signature:t.signature,subdigest:e};return t}const gn={concat:(t,e)=>qe(["bytes","bytes"],[t,e]),node:t=>qe(["uint8","bytes32"],[mr.Node,t]),branch:t=>{const e=re(t);return qe(["uint8","uint24","bytes"],[mr.Branch,e.length,e])},nested:(t,e,r)=>{const n=re(r);return qe(["uint8","uint8","uint16","uint24","bytes"],[mr.Nested,t,e,n.length,n])},subdigest:t=>qe(["uint8","bytes32"],[mr.Subdigest,t]),signature:(t,e)=>qe(["uint8","uint8","bytes"],[mr.Signature,t,e]),dynamicSignature:(t,e,r)=>{const n=re(r);return qe(["uint8","uint8","address","uint24","bytes"],[mr.DynamicSignature,t,e,n.length,n])},address:(t,e)=>qe(["uint8","uint8","address"],[mr.Address,t,e])};function p0(t,e,r,n,i={}){const s=v0(t.tree,e,r,i);return Z.from(n).isZero()?{encoded:qe(["uint8","uint16","uint32","bytes"],[Yr.NoChainIdDynamic,t.threshold,t.checkpoint,s.encoded]),weight:s.weight}:Z.from(t.threshold).gt(255)?{encoded:qe(["uint8","uint16","uint32","bytes"],[Yr.Dynamic,t.threshold,t.checkpoint,s.encoded]),weight:s.weight}:{encoded:qe(["uint8","uint8","uint32","bytes"],[Yr.Legacy,t.threshold,t.checkpoint,s.encoded]),weight:s.weight}}function v0(t,e,r,n={}){const i=!n.disableTrim;if(Is(t)){const s=v0(t.left,e,r),o=v0(t.right,e,r),a=Bn(t.left),c=Bn(t.right);return i&&s.weight.eq(0)&&o.weight.eq(0)&&!a&&!c?{encoded:gn.node(Ui(t)),weight:rr}:i&&o.weight.eq(0)&&!c?{encoded:gn.concat(s.encoded,gn.node(Ui(t.right))),weight:s.weight}:i&&s.weight.eq(0)&&!a?{encoded:gn.concat(gn.node(Ui(t.left)),gn.branch(o.encoded)),weight:o.weight}:{encoded:gn.concat(s.encoded,gn.branch(o.encoded)),weight:s.weight.add(o.weight)}}if(xa(t)){const s=v0(t.tree,e,r);return i&&s.weight.eq(0)?{encoded:gn.node(Ui(t)),weight:rr}:{encoded:gn.nested(t.weight,t.threshold,s.encoded),weight:s.weight}}if(Ea(t))return{encoded:gn.node(Ui(t)),weight:rr};if(wa(t)){const s=r.includes(t.subdigest);return{encoded:gn.subdigest(t.subdigest),weight:s?O$:rr}}if(Bn(t))if(e.has(t.address)){const o=e.get(t.address),a=o.signature;return n.forceDynamicEncoding||o.isDynamic?{encoded:gn.dynamicSignature(t.weight,t.address,a),weight:Z.from(t.weight)}:{encoded:gn.signature(t.weight,a),weight:Z.from(t.weight)}}else return{encoded:gn.address(t.weight,t.address),weight:rr};throw new Error(`Invalid topology - unknown error: ${JSON.stringify(t)}`)}function d4(t){return p4(t)?d4(t.suffix[t.suffix.length-1]):t.config}function h4(t){return t.type!==void 0&&t.decoded!==void 0&&t.version!==void 0&&t.version===2}function lp(t){return t.suffix!==void 0&&Array.isArray(t.suffix)&&t.suffix.every(h4)}function bF(t){return t.type!==void 0&&t.config!==void 0&&t.digest!==void 0&&t.version!==void 0&&t.version===2}function p4(t){return t.chain!==void 0&&Array.isArray(t.chain)&&t.chain.every(bF)}function Db(t){const e=re(t),r=e[0];switch(r){case Yr.Legacy:return{version:2,type:Yr.Legacy,decoded:lm(e)};case Yr.Dynamic:return{version:2,type:Yr.Dynamic,decoded:lm(e.slice(1))};case Yr.NoChainIdDynamic:return{version:2,type:Yr.NoChainIdDynamic,decoded:lm(e.slice(1))};case Yr.Chained:return wF(e);default:throw new Error(`Invalid signature type: ${r}`)}}function lm(t){const e=re(t),r=e[0]<<8|e[1],n=e[2]<<24|e[3]<<16|e[4]<<8|e[5],i=Ny(e.slice(6));return{threshold:r,checkpoint:n,tree:i}}function wF(t){const e=re(t),r=e[0];if(r!==Yr.Chained)throw new Error(`Expected chained signature type: ${r}`);const n=[];let i=1;for(;ire(mc(s))),i=qe(n.map(()=>["uint24","bytes"]).flat(),n.map(s=>[s.length,s]).flat());return qe(["uint8","bytes"],[Yr.Chained,i])}function mc(t){if(Jo(t))return te(t);if(lp(t)||p4(t))return Lb(mc(t),(t.suffix||[]).map(mc));const e=h4(t)?t.decoded:t.config;switch(t.type){case Yr.Legacy:if(Z.from(e.threshold).gt(255))throw new Error(`Legacy signature threshold is too large: ${e.threshold} (max 255)`);return J6(e);case Yr.NoChainIdDynamic:case Yr.Dynamic:return qe(["uint8","bytes"],[t.type,J6(e)]);case Yr.Chained:throw new Error("Unreachable code: Chained signature should be handled above");default:throw new Error(`Invalid signature type: ${t.type}`)}}function J6(t){return qe(["uint16","uint32","bytes"],[t.threshold,t.checkpoint,m0(t.tree)])}function m0(t){if(Is(t)||nu(t)){const e=re(m0(t.right)),r=re(m0(t.left));return Is(t.right)||nu(t.right)?qe(["bytes","uint8","uint24","bytes"],[r,mr.Branch,e.length,e]):qe(["bytes","bytes"],[r,e])}if(xa(t)||Bd(t)){const e=re(m0(t.tree));return qe(["uint8","uint8","uint16","uint24","bytes"],[mr.Nested,t.weight,t.threshold,e.length,e])}if(cp(t)||Bn(t)&&t.signature!==void 0){const e=re(t.signature);if(t.isDynamic||e.length!==My){if(!t.address)throw new Error("Dynamic signature leaf must have address");return qe(["uint8","uint8","address","uint24","bytes"],[mr.DynamicSignature,t.weight,t.address,e.length,e])}else return qe(["uint8","uint8","bytes"],[mr.Signature,t.weight,e])}if(Bn(t))return qe(["uint8","uint8","address"],[mr.Address,t.weight,t.address]);if(Ea(t))return qe(["uint8","bytes32"],[mr.Node,t.nodeHash]);if(wa(t))return qe(["uint8","bytes32"],[mr.Subdigest,t.subdigest]);throw new Error(`Unknown signature tree type: ${t}`)}function y0(t){return Is(t)?[...y0(t.left),...y0(t.right)]:xa(t)?y0(t.tree):Bn(t)&&t.signature?[{address:t.address,signature:t.signature}]:[]}function g0(t){return nu(t)?[...g0(t.left),...g0(t.right)]:Bd(t)?g0(t.tree):cp(t)?[t.signature]:[]}function um(t){return nu(t)?[...um(t.left),...um(t.right)]:Bd(t)?um(t.tree):wa(t)?[t.subdigest]:[]}async function Dy(t){const e=typeof t=="string"?Db(t):t;if(lp(e)){const n=await Promise.all([Dy(on({},e,{suffix:void 0})),...e.suffix.map(i=>Dy(i))]);return Lb(n[0],n.slice(1))}const{trimmed:r}=await b0(e.decoded.tree);return mc(on({},e,{decoded:on({},e.decoded,{tree:r})}))}async function b0(t,e=!0){if(nu(t)){const[r,n]=await Promise.all([b0(t.left),b0(t.right)]);if(r.weight===0&&n.weight===0)try{const i=await Bl(t,ty,void 0);return{weight:0,trimmed:{nodeHash:Ui(i)}}}catch{}else return{weight:r.weight+n.weight,trimmed:{left:r.trimmed,right:n.trimmed}}}if(Bd(t)){const r=await b0(t.tree);if(r.weight===0)try{const n=await Bl(t,ty,void 0);return{weight:0,trimmed:{nodeHash:Ui(n)}}}catch{}return{weight:r.weight,trimmed:{weight:t.weight,threshold:t.threshold,tree:r.trimmed}}}return Ea(t)&&SF(t.nodeHash)?{weight:0,trimmed:on({},CF(t.nodeHash))}:cp(t)||Bn(t)&&t.signature!==void 0?{weight:Z.from(t.weight).toNumber(),trimmed:t}:!e&&wa(t)?{weight:1/0,trimmed:t}:{weight:0,trimmed:t}}const Bb={decode:t=>Db(t),encode:t=>mc(t),trim:t=>Dy(t),supportsNoChainId:!0,recover:(t,e,r)=>v4(t,e,r),encodeSigners:(t,e,r,n)=>p0(t,e,r,n),hasEnoughSigningPower:(t,e)=>{const{weight:r}=Bb.encodeSigners(t,e,[],0);return r.gte(t.threshold)},chainSignatures:(t,e)=>{const r=e.reverse(),n=Jo(t)?t:mc(t),i=r.map(s=>Jo(s)?s:mc(s));return Lb(n,i)},hashSetImageHash:function(t){return vF(t)},signaturesOf(t){return y0(t.tree)},signaturesOfDecoded:function(t){return g0(t.decoded.tree)}};var Kde=Object.freeze({__proto__:null,SignatureType:Yr,SignaturePartType:mr,SignaturePartTypeLength:My,isUnrecoveredNode:nu,isUnrecoveredNestedLeaf:Bd,isUnrecoveredSignatureLeaf:cp,decodeSignatureTree:Ny,InvalidSignatureLeafError:gF,recoverTopology:Bl,partEncoder:gn,encodeSigners:p0,encodeTree:v0,deepestConfigOfSignature:d4,isUnrecoveredSignature:h4,isUnrecoveredChainedSignature:lp,isSignature:bF,isChainedSignature:p4,decodeSignature:Db,decodeSignatureBody:lm,decodeChainedSignature:wF,setImageHashStruct:xF,recoverSignature:v4,encodeChain:Lb,encodeSignature:mc,encodeSignatureBody:J6,encodeSignatureTree:m0,signaturesOf:y0,signaturesOfDecoded:g0,subdigestsOfDecoded:um,trimSignature:Dy,trimUnrecoveredTree:b0,SignatureCoder:Bb});function Bn(t){return t.address!==void 0&&t.weight!==void 0}function wa(t){return t.subdigest!==void 0&&t.address===void 0}function w0(t){return Is(t)?JSON.stringify({left:w0(t.left),right:w0(t.right)}):xa(t)?JSON.stringify({weight:Z.from(t.weight).toString(),threshold:Z.from(t.threshold).toString(),tree:w0(t.tree)}):Bn(t)?JSON.stringify({address:t.address,weight:Z.from(t.weight).toString()}):JSON.stringify(t)}function x0(t){const e=typeof t=="string"?JSON.parse(t):t;return e.left!==void 0&&e.right!==void 0?{left:x0(e.left),right:x0(e.right)}:e.weight!==void 0&&e.threshold!==void 0&&e.tree!==void 0?{weight:Z.from(e.weight),threshold:Z.from(e.threshold),tree:x0(e.tree)}:e.address!==void 0&&e.weight!==void 0?{address:e.address,weight:Z.from(e.weight)}:e}function xa(t){return t.tree!==void 0&&t.weight!==void 0&&t.threshold!==void 0}function Ea(t){return t.nodeHash!==void 0}function m4(t){return Bn(t)||wa(t)||xa(t)||Ea(t)}function Is(t){return t.left!==void 0&&t.right!==void 0}function Qde(t){return Is(t)||m4(t)}function EF(t){return qe(["uint96","address"],[t.weight,t.address])}function CF(t){const e=re(t);if(e.length!==32)throw new Error("Invalid encoded string length");const r=Z.from(e.slice(0,12)),n=Ie(te(e.slice(12)));return{weight:r,address:n}}function SF(t){const e=re(t);return e.length!==32?!1:e.slice(0,11).every(n=>n===0)}function Ui(t){if(Bn(t))return EF(t);if(wa(t))return hc(["string","bytes32"],[`Sequence static digest: -`,t.subdigest]);if(xa(t)){const e=Ui(t.tree);return hc(["string","bytes32","uint256","uint256"],[`Sequence nested config: -`,e,t.threshold,t.weight])}return Ea(t)?t.nodeHash:hc(["bytes32","bytes32"],[Ui(t.left),Ui(t.right)])}function Yde(t){const e=[];let r=t;for(;!m4(r);)e.unshift(r.right),r=r.left;return e.unshift(r),e}function Jde(t){return t.threshold!==void 0&&t.checkpoint!==void 0&&t.tree!==void 0&&t.version!==void 0&&t.version===2}function y4(t){return hc(["bytes32","uint256"],[hc(["bytes32","uint256"],[Ui(t.tree),t.threshold]),t.checkpoint])}function kF(t){return t.threshold!==void 0&&t.weight!==void 0&&t.members!==void 0}function Df(t){return Bn(t)||wa(t)?[t]:xa(t)?[{threshold:t.threshold,weight:t.weight,members:Df(t.tree)}]:Ea(t)?[]:[...Df(t.left),...Df(t.right)]}function X6(t){return Ea(t)?!0:Is(t)?X6(t.left)||X6(t.right):!1}function Xde(t){return{threshold:t.threshold,checkpoint:t.checkpoint,members:Df(t.tree)}}const AF=(t,e)=>t.map(r=>kF(r)?{tree:e(r.members),threshold:r.threshold,weight:r.weight}:r);function g4(t){if(t.length===0)throw new Error("Empty members array");return AF(t,g4).reduce((r,n)=>({left:r,right:n}))}function b4(t){if(t.length===0)throw new Error("Empty members array");const e=AF(t,b4);for(let r=e.length;r>1;r=r/2)for(let n=0;n=r?e[n]=e[i]:e[n]={left:e[i],right:e[s]}}return e[0]}function w4(t){return t.length>8?b4(t):g4(t)}function _F(t,e=w4){return{version:2,threshold:t.threshold,checkpoint:t.checkpoint,tree:e(t.members)}}function Ly(t,e){return wa(t)?t.subdigest===e:Is(t)?Ly(t.left,e)||Ly(t.right,e):!1}function Z6(t){const e=[t],r=new Set;for(;e.length>0;){const n=e.pop();xa(n)?e.push(n.tree):Is(n)?(e.push(n.left),e.push(n.right)):Bn(n)&&r.add({address:n.address,weight:Z.from(n.weight).toNumber()})}return Array.from(r)}function By(t){return Is(t)?By(t.left)&&By(t.right):!Ea(t)}const Fb={isWalletConfig:t=>t.version===2&&t.threshold!==void 0&&t.tree!==void 0,imageHashOf:t=>y4(t),hasSubdigest:(t,e)=>Ly(t.tree,e),checkpointOf:t=>Z.from(t.checkpoint),signersOf:t=>Z6(t.tree),fromSimple:t=>{var e;return _F(on({},t,{members:[...t.signers,...((e=t.subdigests)!=null?e:[]).map(r=>({subdigest:r}))]}))},isComplete:t=>By(t.tree),update:{isKindUsed:!0,buildTransaction:(t,e,r,n)=>{const i=new $r(Xr.mainModuleUpgradable.abi);return{entrypoint:t,transactions:[{to:t,data:i.encodeFunctionData(i.getFunction("updateImageHash"),[Fb.imageHashOf(e)]),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}]}},decodeTransaction:function(t){var e,r,n,i;const s=new $r(Xr.mainModuleUpgradable.abi);if(t.transactions.length!==1)throw new Error("Invalid transaction bundle, expected 1 transaction");const o=t.transactions[0].data;if(!o)throw new Error("Invalid transaction bundle, expected data");const a=s.decodeFunctionData(s.getFunction("updateImageHash"),o);if(!a)throw new Error("Invalid transaction bundle, expected valid data");if(t.transactions[0].to!==t.entrypoint)throw new Error("Invalid transaction bundle, expected to be sent to entrypoint");if(t.transactions[0].delegateCall)throw new Error("Invalid transaction bundle, expected not to be a delegateCall");if(!t.transactions[0].revertOnError)throw new Error("Invalid transaction bundle, expected revertOnError");if(!rr.eq((e=(r=t.transactions[0])==null?void 0:r.value)!=null?e:0))throw new Error("Invalid transaction bundle, expected value to be 0");if(!rr.eq((n=(i=t.transactions[0])==null?void 0:i.gasLimit)!=null?n:0))throw new Error("Invalid transaction bundle, expected value to be 0");return{address:t.entrypoint,newImageHash:a[0],kind:void 0}}},toJSON:function(t){return JSON.stringify({version:t.version,threshold:Z.from(t.threshold).toString(),checkpoint:Z.from(t.checkpoint).toString(),tree:w0(t.tree)})},fromJSON:function(t){const e=JSON.parse(t);return{version:e.version,threshold:Z.from(e.threshold),checkpoint:Z.from(e.checkpoint),tree:x0(e.tree)}},editConfig:function(t,e){var r,n;const i=Df(t.tree);if(e.add)for(const s of e.add)i.find(o=>Bn(o)&&o.address===s.address)||i.push({address:s.address,weight:s.weight});if(e.remove)for(const s of e.remove){const o=i.findIndex(a=>Bn(a)&&a.address===s);o>=0&&i.splice(o,1)}return{version:t.version,threshold:(r=e.threshold)!=null?r:t.threshold,checkpoint:(n=e.checkpoint)!=null?n:t.checkpoint,tree:w4(i)}},buildStubSignature:function(t,e){const r=new Map;for(const[i,s]of e.entries()){r.set(i,{signature:s,isDynamic:!0});const{encoded:o,weight:a}=p0(t,r,[],0);if(a.gte(t.threshold))return o}const n=Z6(t.tree);for(const{address:i}of n.sort(({weight:s},{weight:o})=>s-o)){const s="0x4e82f02f388a12b5f9d29eaf2452dd040c0ee5804b4e504b4dd64e396c6c781f2c7624195acba242dd825bfd25a290912e3c230841fd55c9a734c4de8d9899451b02";r.set(i,{signature:s,isDynamic:!1});const{encoded:o,weight:a}=p0(t,r,[],0);if(a.gte(t.threshold))return o}return p0(t,r,[],0).encoded}};var Zde=Object.freeze({__proto__:null,isSignerLeaf:Bn,isSubdigestLeaf:wa,topologyToJSON:w0,topologyFromJSON:x0,isNestedLeaf:xa,isNodeLeaf:Ea,isLeaf:m4,isNode:Is,isTopology:Qde,encodeSignerLeaf:EF,decodeSignerLeaf:CF,isEncodedSignerLeaf:SF,hashNode:Ui,leftFace:Yde,isWalletConfig:Jde,imageHash:y4,isSimpleNestedMember:kF,topologyToMembers:Df,hasUnknownNodes:X6,toSimpleWalletConfig:Xde,legacyTopologyBuilder:g4,merkleTopologyBuilder:b4,optimized2SignersTopologyBuilder:w4,toWalletConfig:_F,hasSubdigest:Ly,signersOf:Z6,isComplete:By,ConfigCoder:Fb}),ehe=Object.freeze({__proto__:null});const the={config:Fb,signature:Bb},PF=2,TF={version:PF,factory:"0xFaA5c0b14d1bED5C888Ca655B9a8A5911F78eF4A",guestModule:"0xfea230Ee243f88BC698dD8f1aE93F8301B6cdfaE",mainModule:"0xfBf8f1A5E00034762D928f46d438B947f5d4065d",mainModuleUpgradable:"0x4222dcA3974E39A8b41c411FeDDE9b09Ae14b911",walletCreationCode:"0x603a600e3d39601a805130553df3363d3d373d3d3d363d30545af43d82803e903d91601857fd5bf3"};var Ge=Object.freeze({__proto__:null,config:Zde,signature:Kde,context:ehe,chained:Gde,coders:the,version:PF,DeployedWalletContext:TF});function e3(t,e){const r=Ee(qe(["bytes","bytes32"],[t.walletCreationCode,pt(t.mainModule,32)])),n=Ee(qe(["bytes1","address","bytes32","bytes32"],["0xff",t.factory,e,r]));return Ie(vr(n,12))}async function rhe(t,e,r,n,i,s){return(await Promise.all(UF.map(async a=>{try{const c=a.signature.SignatureCoder.decode(te(r)),l=await a.signature.SignatureCoder.recover(c,{address:t,digest:te(e),chainId:n},i),u=a.config.ConfigCoder.imageHashOf(l.config);if(e3(s[a.version],u).toLowerCase()===t.toLowerCase())return!0;const d=await a.signature.SignatureCoder.recover(c,{address:t,digest:te(e),chainId:n},i),h=a.config.ConfigCoder.imageHashOf(d.config);return e3(s[a.version],h).toLowerCase()===t.toLowerCase()}catch{}return!1}))).some(a=>a)}function nhe(t){const e=Object.keys(t).length;for(let r=1;r<=e;r++){const n=t[r];if(!n||n.version!==r)return!1}return!0}function ihe(t){const e=Object.keys(t).length;return t[e]}const she={1:pF,2:TF};var ohe=Object.freeze({__proto__:null,addressOf:e3,isValidCounterfactual:rhe,isValidVersionedContext:nhe,latestContext:ihe,defaultContexts:she});const jb=`tuple( - bool delegateCall, - bool revertOnError, - uint256 gasLimit, - address target, - uint256 value, - bytes data -)[]`;function ahe(t,e,r,n){return on({},t,{chainId:r,intent:{id:n,wallet:e}})}function che(t){return Ee(zn.encode(["address","uint256","bytes32"],[t.intent.wallet,t.chainId,t.intent.id]))}function lhe(t){const e=zn.decode(["uint256",jb],t);if(e.length!==2||!e[0]||!e[1])throw new Error("Invalid meta transaction data");return[e[0],e[1]]}function IF(t,e){return zn.encode(["uint256",jb],[t,u1(e)])}function OF(t,e){return Ee(IF(t,e))}function uhe(t,e,r,n){return op({address:t,chainId:e,digest:OF(r,n)})}function fhe(t,e,r){return op({address:t,chainId:e,digest:Ee(zn.encode(["string",jb],["guest:",u1(r)]))})}function RF(t,e){return e.map(r=>x4(t,r))}function x4(t,e){if(e.to&&e.to!==ur)return{nonce:e.nonce,transaction:{delegateCall:!1,revertOnError:!1,gasLimit:e.gasLimit||0,to:e.to,value:e.value||0,data:e.data||"0x"}};{const r=new $r(Xr.mainModule.abi),n=r.encodeFunctionData(r.getFunction("createContract"),[e.data]);return{nonce:e.nonce,transaction:{delegateCall:!1,revertOnError:!1,gasLimit:e.gasLimit,to:t,value:e.value||0,data:n}}}}function Ub(t){return t.delegateCall!==void 0||t.revertOnError!==void 0}function $F(t){return t.every(Ub)}function u1(t){return t.map(e=>{var r;return{delegateCall:e.delegateCall===!0,revertOnError:e.revertOnError===!0,gasLimit:e.gasLimit!==void 0?e.gasLimit:rr,target:(r=e.to)!=null?r:ur,value:e.value!==void 0?e.value:rr,data:e.data!==void 0?e.data:[]}})}function dhe(t){return t.map(e=>({delegateCall:e.delegateCall,revertOnError:e.revertOnError,gasLimit:e.gasLimit,to:e.target,value:e.value,data:e.data}))}function hhe(t,e){const r=Z.from(t),n=Z.from(e),i=I$.pow(Z.from(96));if(!n.div(i).eq(rr))throw new Error("Space already encoded");return n.add(r.mul(i))}function phe(t){const e=Z.from(t),r=I$.pow(Z.from(96));return[e.div(r),e.mod(r)]}function vhe(t,e){return Array.isArray(e)?$F(e)?e:RF(t,e).map(n=>n.transaction):Ub(e)?[e]:[x4(t,e).transaction]}function MF(t){return t!==void 0&&t.entrypoint!==void 0&&t.chainId!==void 0&&t.transactions!==void 0&&t.nonce!==void 0&&t.intent!==void 0&&t.intent.id!==void 0&&t.intent.wallet!==void 0&&Array.isArray(t.transactions)&&t.transactions.reduce((e,r)=>e&&Ub(r),!0)}function NF(t){return t!==void 0&&t.signature!==void 0&&t.signature!==""&&MF(t)}function mhe(t){const e=new $r(Xr.mainModule.abi);return e.encodeFunctionData(e.getFunction("execute"),NF(t)?[u1(t.transactions),t.nonce,t.signature]:[u1(t.transactions),0,[]])}const DF="0x61c2926c",LF=`tuple( - bool delegateCall, - bool revertOnError, - uint256 gasLimit, - address target, - uint256 value, - bytes data -)[]`,t3=(t,e)=>{const r=[],n=new $r(Xr.mainModule.abi);for(const i of e){const s=re(i.data||"0x");if(i.to===t&&te(s.slice(0,4))===DF){const o=s.slice(4),a=zn.decode([LF],o)[0];r.push(...t3(i.to,a.map(c=>on({},c,{to:c.target}))))}else try{const o=n.decodeFunctionData("execute",s)[0],a=t3(t,o.map(c=>on({},c,{to:c.target})));r.push(...a)}catch{r.push(i)}}return r};var yhe=Object.freeze({__proto__:null,MetaTransactionsType:jb,intendTransactionBundle:ahe,intendedTransactionID:che,unpackMetaTransactionsData:lhe,packMetaTransactionsData:IF,digestOfTransactions:OF,subdigestOfTransactions:uhe,subdigestOfGuestModuleTransactions:fhe,toSequenceTransactions:RF,toSequenceTransaction:x4,isSequenceTransaction:Ub,hasSequenceTransactions:$F,sequenceTxAbiEncode:u1,fromTxAbiEncode:dhe,encodeNonce:hhe,decodeNonce:phe,fromTransactionish:vhe,isTransactionBundle:MF,isSignedTransactionBundle:NF,encodeBundleExecData:mhe,selfExecuteSelector:DF,selfExecuteAbi:LF,unwind:t3});const BF="0x608060405234801561001057600080fd5b5060405161124a38038061124a83398101604081905261002f91610124565b600060405161003d906100dd565b604051809103906000f080158015610059573d6000803e3d6000fd5b5090506000816001600160a01b0316638f0684308686866040518463ffffffff1660e01b815260040161008e939291906101fb565b6020604051808303816000875af11580156100ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100d19190610244565b9050806000526001601ff35b610fdc8061026e83390190565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561011b578181015183820152602001610103565b50506000910152565b60008060006060848603121561013957600080fd5b83516001600160a01b038116811461015057600080fd5b6020850151604086015191945092506001600160401b038082111561017457600080fd5b818601915086601f83011261018857600080fd5b81518181111561019a5761019a6100ea565b604051601f8201601f19908116603f011681019083821181831017156101c2576101c26100ea565b816040528281528960208487010111156101db57600080fd5b6101ec836020830160208801610100565b80955050505050509250925092565b60018060a01b0384168152826020820152606060408201526000825180606084015261022e816080850160208701610100565b601f01601f191691909101608001949350505050565b60006020828403121561025657600080fd5b8151801515811461026657600080fd5b939250505056fe608060405234801561001057600080fd5b50610fbc806100206000396000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c806376be4cea1161005057806376be4cea146100a65780638f068430146100b957806398ef1ed8146100cc57600080fd5b80631c6453271461006c5780633d787b6314610093575b600080fd5b61007f61007a366004610ad4565b6100df565b604051901515815260200160405180910390f35b61007f6100a1366004610ad4565b61023d565b61007f6100b4366004610b3e565b61031e565b61007f6100c7366004610ad4565b6108e1565b61007f6100da366004610ad4565b61096e565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea9061012890889088908890889088908190600401610bc3565b6020604051808303816000875af1925050508015610181575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261017e91810190610c45565b60015b610232573d8080156101af576040519150601f19603f3d011682016040523d82523d6000602084013e6101b4565b606091505b508051600181900361022757816000815181106101d3576101d3610c69565b6020910101517fff00000000000000000000000000000000000000000000000000000000000000167f0100000000000000000000000000000000000000000000000000000000000000149250610235915050565b600092505050610235565b90505b949350505050565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea906102879088908890889088906001908990600401610bc3565b6020604051808303816000875af19250505080156102e0575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682019092526102dd91810190610c45565b60015b610232573d80801561030e576040519150601f19603f3d011682016040523d82523d6000602084013e610313565b606091505b506000915050610235565b600073ffffffffffffffffffffffffffffffffffffffff87163b6060827f64926492649264926492649264926492649264926492649264926492649264928888610369602082610c98565b610375928b9290610cd8565b61037e91610d02565b1490508015610484576000606089828a610399602082610c98565b926103a693929190610cd8565b8101906103b39190610e18565b955090925090508415806103c45750865b1561047d576000808373ffffffffffffffffffffffffffffffffffffffff16836040516103f19190610eb2565b6000604051808303816000865af19150503d806000811461042e576040519150601f19603f3d011682016040523d82523d6000602084013e610433565b606091505b50915091508161047a57806040517f9d0d6e2d0000000000000000000000000000000000000000000000000000000081526004016104719190610f18565b60405180910390fd5b50505b50506104be565b87878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509294505050505b80806104ca5750600083115b156106bb576040517f1626ba7e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8b1690631626ba7e90610523908c908690600401610f2b565b602060405180830381865afa92505050801561057a575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261057791810190610f44565b60015b61060f573d8080156105a8576040519150601f19603f3d011682016040523d82523d6000602084013e6105ad565b606091505b50851580156105bc5750600084115b156105db576105d08b8b8b8b8b600161031e565b9450505050506108d7565b806040517f6f2a95990000000000000000000000000000000000000000000000000000000081526004016104719190610f18565b7fffffffff0000000000000000000000000000000000000000000000000000000081167f1626ba7e000000000000000000000000000000000000000000000000000000001480158161065f575086155b801561066b5750600085115b1561068b5761067f8c8c8c8c8c600161031e565b955050505050506108d7565b841580156106965750825b80156106a0575087155b156106af57806000526001601ffd5b94506108d79350505050565b6041871461074b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f5369676e617475726556616c696461746f72237265636f7665725369676e657260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610471565b600061075a6020828a8c610cd8565b61076391610d02565b90506000610775604060208b8d610cd8565b61077e91610d02565b905060008a8a604081811061079557610795610c69565b919091013560f81c915050601b81148015906107b557508060ff16601c14155b15610842576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f5369676e617475726556616c696461746f723a20696e76616c6964207369676e60448201527f617475726520762076616c7565000000000000000000000000000000000000006064820152608401610471565b6040805160008152602081018083528e905260ff831691810191909152606081018490526080810183905273ffffffffffffffffffffffffffffffffffffffff8e169060019060a0016020604051602081039080840390855afa1580156108ad573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff161496505050505050505b9695505050505050565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea9061092b9088908890889088906001908990600401610bc3565b6020604051808303816000875af115801561094a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102329190610c45565b6040517f76be4cea00000000000000000000000000000000000000000000000000000000815260009030906376be4cea906109b790889088908890889088908190600401610bc3565b6020604051808303816000875af1925050508015610a10575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252610a0d91810190610c45565b60015b610232573d808015610a3e576040519150601f19603f3d011682016040523d82523d6000602084013e610a43565b606091505b5080516001819003610a6257816000815181106101d3576101d3610c69565b8082fd5b73ffffffffffffffffffffffffffffffffffffffff81168114610a8857600080fd5b50565b60008083601f840112610a9d57600080fd5b50813567ffffffffffffffff811115610ab557600080fd5b602083019150836020828501011115610acd57600080fd5b9250929050565b60008060008060608587031215610aea57600080fd5b8435610af581610a66565b935060208501359250604085013567ffffffffffffffff811115610b1857600080fd5b610b2487828801610a8b565b95989497509550505050565b8015158114610a8857600080fd5b60008060008060008060a08789031215610b5757600080fd5b8635610b6281610a66565b955060208701359450604087013567ffffffffffffffff811115610b8557600080fd5b610b9189828a01610a8b565b9095509350506060870135610ba581610b30565b91506080870135610bb581610b30565b809150509295509295509295565b73ffffffffffffffffffffffffffffffffffffffff8716815285602082015260a060408201528360a0820152838560c0830137600060c085830181019190915292151560608201529015156080820152601f9092017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016909101019392505050565b600060208284031215610c5757600080fd5b8151610c6281610b30565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b81810381811115610cd2577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b92915050565b60008085851115610ce857600080fd5b83861115610cf557600080fd5b5050820193919092039150565b80356020831015610cd2577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff602084900360031b1b1692915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112610d7e57600080fd5b813567ffffffffffffffff80821115610d9957610d99610d3e565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715610ddf57610ddf610d3e565b81604052838152866020858801011115610df857600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600060608486031215610e2d57600080fd5b8335610e3881610a66565b9250602084013567ffffffffffffffff80821115610e5557600080fd5b610e6187838801610d6d565b93506040860135915080821115610e7757600080fd5b50610e8486828701610d6d565b9150509250925092565b60005b83811015610ea9578181015183820152602001610e91565b50506000910152565b60008251610ec4818460208701610e8e565b9190910192915050565b60008151808452610ee6816020860160208601610e8e565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610c626020830184610ece565b8281526040602082015260006102356040830184610ece565b600060208284031215610f5657600080fd5b81517fffffffff0000000000000000000000000000000000000000000000000000000081168114610c6257600080fdfea26469706673582212201a72aed4b15ffb05b6502997a9bb655992e06590bd26b336dfbb153d7ff6f34b64736f6c63430008120033",ghe="0x6492649264926492649264926492649264926492649264926492649264926492";async function FF(t,e,r,n){return await t.call({data:ht([BF,new LE().encode(["address","bytes32","bytes"],[e,r,n])])})==="0x01"}var bhe=Object.freeze({__proto__:null,EIP_6492_OFFCHAIN_DEPLOY_CODE:BF,EIP_6492_SUFFIX:ghe,validateEIP6492Offchain:FF});class whe{constructor(e){this.provider=e,this.isDeployedCache=new Set}module(e){return new Pd(e,[...Xr.mainModuleUpgradable.abi,...Xr.mainModule.abi,...Xr.erc1271.abi],this.provider)}async isDeployed(e){if(this.isDeployedCache.has(e))return!0;const n=(await this.provider.getCode(e).then(i=>re(i))).length!==0;return n&&this.isDeployedCache.add(e),n}async implementation(e){const r=zn.encode(["address"],[e]),n=await this.provider.getStorageAt(e,r).then(i=>re(i));if(n.length===20)return Ie(te(n));if(n.length===32)return zn.decode(["address"],n)[0]}async imageHash(e){try{return await this.module(e).imageHash()}catch{}}async nonce(e,r=0){try{return await this.module(e).readNonce(r)}catch(n){if(!await this.isDeployed(e))return 0;throw n}}async isValidSignature(e,r,n){return FF(this.provider,e,r,n)}}var xhe=Object.freeze({__proto__:null,OnChainReader:whe});function Ehe(t){return t&&t.address&&t.digest&&t.chainId!==void 0&&t.config}var de=Object.freeze({__proto__:null,config:Dde,signature:Lde,context:ohe,signer:Wde,EIP1271:jde,transaction:yhe,reader:xhe,EIP6492:bhe,isWalletSignRequestMetadata:Ehe});const r3=[{config:u4,signature:l4},{config:Fb,signature:Bb}];function jF(t){const e=t-1;if(e<0||e>=r3.length)throw new Error(`No coder for version: ${t}`);return r3[e]}function Che(t){return jF(t)}var nn=Object.freeze({__proto__:null,ALL_CODERS:r3,coderFor:jF,genericCoderFor:Che});const UF=[Bo,Ge],She=Object.freeze(Object.defineProperty({__proto__:null,allVersions:UF,commons:de,universal:nn,v1:Bo,v2:Ge},Symbol.toStringTag,{value:"Module"}));function khe(t,e,r){for(let n=0;ne.version)&&(e=r);if(e===void 0)throw new Error("No migrations");return e}async getAllMigratePresignedTransaction(e){const{address:r,fromImageHash:n,fromVersion:i,chainId:s}=e;let o=n,a=i;const c=Object.values(this.contexts),l=[];for(let u=1;ure(s).length===0))return O_;if(!n.provider)throw new Error("signer.provider is not set, but is required");return n.provider.estimateGas({from:e,to:i.to,data:i.data,value:i.value})}))).map(i=>({executed:!0,succeeded:!0,gasUsed:Z.from(i).toNumber(),gasLimit:Z.from(i).toNumber()}))}async getNonce(e,r,n){if(!this.provider)throw new Error("provider is not set");if(await this.provider.getCode(e)==="0x")return 0;r===void 0&&(r=0);const s=await new Pd(e,Xr.mainModule.abi,this.provider).readNonce(r,{blockTag:n});return de.transaction.encodeNonce(r,s)}async wait(e,r,n=this.waitPollRate,i=5){var s=this;typeof e!="string"&&(e=de.transaction.intendedTransactionID(e));let o=!1;const a=async function(u,f){let d=0;for(;!o;){try{return await u()}catch(h){if(d++,i!==void 0&&d>=i)throw ge.error(`giving up after ${d} failed attempts${f?`: ${f}`:""}`,h),h;ge.warn(`attempt #${d} failed${f?`: ${f}`:""}`,h)}n>0&&await new Promise(h=>setTimeout(h,n))}throw new Error(`timed out after ${d} failed attempts${f?`: ${f}`:""}`)},c=async function(){let u=s.fromBlockLog;if(u<0&&(u=await a(()=>s.provider.getBlockNumber(),"unable to get latest block number")+u),typeof e!="string")throw new Error("impossible");const f=e.replace("0x","");for(;!o;){const d=await a(()=>s.provider.getBlockNumber(),"unable to get latest block number"),h=await a(()=>s.provider.getLogs({fromBlock:Math.max(0,u-s.deltaBlocksLog),toBlock:d,topics:["0x1f180c27086c7a39ea2a7b25239d1ab92348f07ca7bb59d1438fcf527568f881"]}),`unable to get NonceChange logs for blocks ${Math.max(0,u-s.deltaBlocksLog)} to ${d}`);u=d;const v=(await Promise.all(h.map(m=>a(()=>s.provider.getTransactionReceipt(m.transactionHash),`unable to get receipt for transaction ${m.transactionHash}`)))).find(m=>m.logs.find(g=>g.topics.length===0&&g.data.replace("0x","")===f||g.topics.length===1&&g.topics[0]==="0x3dbd1590ea96dd3253a91f24e64e3a502e1225d602a5731357bc12643070ccd7"&&g.data.length>=64&&g.data.replace("0x","").startsWith(f)));if(v)return Tc({receipt:v},await a(()=>s.provider.getTransaction(v.transactionHash),`unable to get transaction ${v.transactionHash}`));o||await new Promise(m=>setTimeout(m,n))}throw new Error(`Timeout waiting for transaction receipt ${e}`)};return r!==void 0?Promise.race([c(),new Promise((l,u)=>setTimeout(()=>{o=!0,u(`Timeout waiting for transaction receipt ${e}`)},r))]):c()}}function Rhe(t){return t.signer!==void 0&&xc.isSigner(t.signer)}class $he extends VF{constructor(e){if(super(xc.isSigner(e)?{provider:e.provider}:Tc({},e,{provider:e.signer.provider})),this.signer=void 0,this.txnOptions=void 0,this.signer=xc.isSigner(e)?e:e.signer,!this.signer.provider)throw new Error("Signer must have a provider")}async getFeeOptions(e,...r){return{options:[]}}async getFeeOptionsRaw(e,r,n){return{options:[]}}async gasRefundOptions(e,...r){const{options:n}=await this.getFeeOptions(e,...r);return n}setTransactionOptions(e){this.txnOptions=e}async relay(e,r,n=!0){r!==void 0&&ge.warn("LocalRelayer doesn't accept fee quotes");const i=de.transaction.encodeBundleExecData(e),s=this.signer.sendTransaction(Tc({to:e.entrypoint,data:i},this.txnOptions,{gasLimit:9e6}));if(n){const o=await s;return o.receipt=await o.wait(),o}else return s}}const Mhe="v1",Nhe="v0.4.0",Dhe="950b00c821b56110c64d947312b9dea3e197e207";let tc=function(t){return t.UNKNOWN="UNKNOWN",t.DROPPED="DROPPED",t.QUEUED="QUEUED",t.SENT="SENT",t.SUCCEEDED="SUCCEEDED",t.PARTIALLY_FAILED="PARTIALLY_FAILED",t.FAILED="FAILED",t}({}),Lhe=function(t){return t.SEND="SEND",t.RECEIVE="RECEIVE",t.BRIDGE_DEPOSIT="BRIDGE_DEPOSIT",t.BRIDGE_WITHDRAW="BRIDGE_WITHDRAW",t.BURN="BURN",t.UNKNOWN="UNKNOWN",t}({}),Bhe=function(t){return t.UNKNOWN="UNKNOWN",t.ERC20_TOKEN="ERC20_TOKEN",t.ERC1155_TOKEN="ERC1155_TOKEN",t}({}),Fhe=function(t){return t.DESC="DESC",t.ASC="ASC",t}({});class GF{constructor(e,r){this.hostname=void 0,this.fetch=void 0,this.path="/rpc/Relayer/",this.ping=n=>this.fetch(this.url("Ping"),ut({},n)).then(i=>ft(i).then(s=>({status:s.status}))),this.version=n=>this.fetch(this.url("Version"),ut({},n)).then(i=>ft(i).then(s=>({version:s.version}))),this.runtimeStatus=n=>this.fetch(this.url("RuntimeStatus"),ut({},n)).then(i=>ft(i).then(s=>({status:s.status}))),this.getSequenceContext=n=>this.fetch(this.url("GetSequenceContext"),ut({},n)).then(i=>ft(i).then(s=>({data:s.data}))),this.getChainID=n=>this.fetch(this.url("GetChainID"),ut({},n)).then(i=>ft(i).then(s=>({chainID:s.chainID}))),this.sendMetaTxn=(n,i)=>this.fetch(this.url("SendMetaTxn"),ut(n,i)).then(s=>ft(s).then(o=>({status:o.status,txnHash:o.txnHash}))),this.getMetaTxnNonce=(n,i)=>this.fetch(this.url("GetMetaTxnNonce"),ut(n,i)).then(s=>ft(s).then(o=>({nonce:o.nonce}))),this.getMetaTxnReceipt=(n,i)=>this.fetch(this.url("GetMetaTxnReceipt"),ut(n,i)).then(s=>ft(s).then(o=>({receipt:o.receipt}))),this.simulate=(n,i)=>this.fetch(this.url("Simulate"),ut(n,i)).then(s=>ft(s).then(o=>({results:o.results}))),this.updateMetaTxnGasLimits=(n,i)=>this.fetch(this.url("UpdateMetaTxnGasLimits"),ut(n,i)).then(s=>ft(s).then(o=>({payload:o.payload}))),this.feeTokens=n=>this.fetch(this.url("FeeTokens"),ut({},n)).then(i=>ft(i).then(s=>({isFeeRequired:s.isFeeRequired,tokens:s.tokens}))),this.feeOptions=(n,i)=>this.fetch(this.url("FeeOptions"),ut(n,i)).then(s=>ft(s).then(o=>({options:o.options,quote:o.quote}))),this.getMetaTxnNetworkFeeOptions=(n,i)=>this.fetch(this.url("GetMetaTxnNetworkFeeOptions"),ut(n,i)).then(s=>ft(s).then(o=>({options:o.options}))),this.sentTransactions=(n,i)=>this.fetch(this.url("SentTransactions"),ut(n,i)).then(s=>ft(s).then(o=>({page:o.page,transactions:o.transactions}))),this.pendingTransactions=(n,i)=>this.fetch(this.url("PendingTransactions"),ut(n,i)).then(s=>ft(s).then(o=>({page:o.page,transactions:o.transactions}))),this.getGasTank=(n,i)=>this.fetch(this.url("GetGasTank"),ut(n,i)).then(s=>ft(s).then(o=>({gasTank:o.gasTank}))),this.addGasTank=(n,i)=>this.fetch(this.url("AddGasTank"),ut(n,i)).then(s=>ft(s).then(o=>({status:o.status,gasTank:o.gasTank}))),this.updateGasTank=(n,i)=>this.fetch(this.url("UpdateGasTank"),ut(n,i)).then(s=>ft(s).then(o=>({status:o.status,gasTank:o.gasTank}))),this.getGasSponsor=(n,i)=>this.fetch(this.url("GetGasSponsor"),ut(n,i)).then(s=>ft(s).then(o=>({gasSponsor:o.gasSponsor}))),this.listGasSponsors=(n,i)=>this.fetch(this.url("ListGasSponsors"),ut(n,i)).then(s=>ft(s).then(o=>({page:o.page,gasSponsors:o.gasSponsors}))),this.addGasSponsor=(n,i)=>this.fetch(this.url("AddGasSponsor"),ut(n,i)).then(s=>ft(s).then(o=>({status:o.status,gasSponsor:o.gasSponsor}))),this.updateGasSponsor=(n,i)=>this.fetch(this.url("UpdateGasSponsor"),ut(n,i)).then(s=>ft(s).then(o=>({status:o.status,gasSponsor:o.gasSponsor}))),this.removeGasSponsor=(n,i)=>this.fetch(this.url("RemoveGasSponsor"),ut(n,i)).then(s=>ft(s).then(o=>({status:o.status}))),this.reportGasSponsorUsage=(n,i)=>this.fetch(this.url("ReportGasSponsorUsage"),ut(n,i)).then(s=>ft(s).then(o=>({gasSponsorUsage:o.gasSponsorUsage}))),this.nextGasTankBalanceAdjustmentNonce=(n,i)=>this.fetch(this.url("NextGasTankBalanceAdjustmentNonce"),ut(n,i)).then(s=>ft(s).then(o=>({nonce:o.nonce}))),this.adjustGasTankBalance=(n,i)=>this.fetch(this.url("AdjustGasTankBalance"),ut(n,i)).then(s=>ft(s).then(o=>({status:o.status,adjustment:o.adjustment}))),this.getGasTankBalanceAdjustment=(n,i)=>this.fetch(this.url("GetGasTankBalanceAdjustment"),ut(n,i)).then(s=>ft(s).then(o=>({adjustment:o.adjustment}))),this.listGasTankBalanceAdjustments=(n,i)=>this.fetch(this.url("ListGasTankBalanceAdjustments"),ut(n,i)).then(s=>ft(s).then(o=>({page:o.page,adjustments:o.adjustments}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const ut=(t={},e={})=>({method:"POST",headers:Tc({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{})}),ft=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch{throw{code:"unknown",msg:`expecting JSON, got: ${e}`,status:t.status}}if(!t.ok)throw r;return r});var fd=Object.freeze({__proto__:null,WebRPCVersion:Mhe,WebRPCSchemaVersion:Nhe,WebRPCSchemaHash:Dhe,ETHTxnStatus:tc,TransferType:Lhe,FeeTokenType:Bhe,SortOrder:Fhe,Relayer:GF});const jhe=[tc.DROPPED,tc.SUCCEEDED,tc.PARTIALLY_FAILED,tc.FAILED],Uhe=[tc.DROPPED,tc.PARTIALLY_FAILED,tc.FAILED];function zhe(t){return t.url!==void 0&&typeof t.url=="string"&&t.provider!==void 0&&ga.isProvider(t.provider)}const Whe=typeof global=="object"?global.fetch:window.fetch;class KF{constructor(e){if(this.options=e,this.service=void 0,this.provider=void 0,this._fetch=(r,n)=>{const i={},{jwtAuth:s,projectAccessKey:o}=this.options;return s&&s.length>0&&(i.Authorization=`BEARER ${s}`),o&&o.length>0&&(i["X-Access-Key"]=o),n.headers=Tc({},n.headers,i),Whe(r,n)},this.service=new GF(e.url,this._fetch),ga.isProvider(e.provider))this.provider=e.provider;else{const{jwtAuth:r,projectAccessKey:n}=this.options,i=l1(e.provider.url,n,r);this.provider=new uy(i)}}async waitReceipt(e,r=1e3,n=5,i){typeof e!="string"&&(e=de.transaction.intendedTransactionID(e)),ge.info(`[rpc-relayer/waitReceipt] waiting for ${e}`);let s=0;for(;i===void 0||!i();){try{const{receipt:o}=await this.service.getMetaTxnReceipt({metaTxID:e});if(o&&o.txnReceipt&&o.txnReceipt!=="null"&&jhe.includes(o.status))return{receipt:o}}catch(o){if(s++,s===n)throw o}(i===void 0||!i())&&await new Promise(o=>setTimeout(o,r))}throw new Error(`Cancelled waiting for transaction receipt ${e}`)}async simulate(e,...r){const i=zn.encode([de.transaction.MetaTransactionsType],[de.transaction.sequenceTxAbiEncode(r)]);return(await this.service.simulate({wallet:e,transactions:i})).results}async getFeeOptions(e,...r){const n=await this.service.feeTokens();if(n.isFeeRequired){const i=n.tokens.map(c=>c.symbol).join(", ");ge.info(`[rpc-relayer/getFeeOptions] relayer fees are required, accepted tokens are ${i}`);const s=await this.getNonce(e);if(!this.provider)throw ge.warn("[rpc-relayer/getFeeOptions] provider not set, needed for stub signature"),new Error("provider is not set");const{options:o,quote:a}=await this.service.feeOptions({wallet:e,to:e,data:de.transaction.encodeBundleExecData({entrypoint:e,transactions:r,nonce:s})});return ge.info(`[rpc-relayer/getFeeOptions] got refund options ${JSON.stringify(o)}`),{options:o,quote:{_tag:"FeeQuote",_quote:a}}}else return ge.info("[rpc-relayer/getFeeOptions] relayer fees are not required"),{options:[]}}async getFeeOptionsRaw(e,r,n){const{options:i,quote:s}=await this.service.feeOptions({wallet:e,to:e,data:te(r),simulate:n==null?void 0:n.simulate});return{options:i,quote:{_tag:"FeeQuote",_quote:s}}}async gasRefundOptions(e,...r){const{options:n}=await this.getFeeOptions(e,...r);return n}async getNonce(e,r){ge.info(`[rpc-relayer/getNonce] get nonce for wallet ${e} space: ${r}`);const n=r!==void 0?Z.from(r).toHexString():void 0,i=await this.service.getMetaTxnNonce({walletContractAddress:e,space:n}),s=Z.from(i.nonce),[o,a]=de.transaction.decodeNonce(s);return ge.info(`[rpc-relayer/getNonce] got next nonce for wallet ${e} ${a} space: ${o}`),s}async relay(e,r,n=!0){var i=this;ge.info(`[rpc-relayer/relay] relaying signed meta-transactions ${JSON.stringify(e)} with quote ${JSON.stringify(r)}`);let s;if(r!==void 0&&(typeof r._quote=="string"?s=r._quote:ge.warn("[rpc-relayer/relay] ignoring invalid fee quote")),!this.provider)throw ge.warn("[rpc-relayer/relay] provider not set, failed relay"),new Error("provider is not set");const o=de.transaction.encodeBundleExecData(e),a=await this.service.sendMetaTxn({call:{walletAddress:e.intent.wallet,contract:e.entrypoint,input:o},quote:s});if(ge.info(`[rpc-relayer/relay] got relay result ${JSON.stringify(a)}`),n)return this.wait(e.intent.id);{const c={hash:e.intent.id,confirmations:0,from:e.intent.wallet,wait:u=>Promise.reject(new Error("impossible"))},l=async function(f){var d;if(!i.provider)throw new Error("cannot wait for receipt, relayer has no provider set");const h=await i.wait(e.intent.id),p=(d=h.receipt)==null?void 0:d.transactionHash;if(!p)throw new Error("cannot wait for receipt, unknown native transaction hash");return Object.assign(c,h),i.provider.waitForTransaction(p,f)};return c.wait=l,c}}async wait(e,r,n=1e3,i=5){var s=this;let o=!1;const{receipt:a}=await(r!==void 0?Promise.race([this.waitReceipt(e,n,i,()=>o),new Promise((l,u)=>setTimeout(()=>{o=!0,u(`Timeout waiting for transaction receipt ${e}`)},r))]):this.waitReceipt(e,n,i));if(!a.txnReceipt||Uhe.includes(a.status))throw new Hhe(a);const c=JSON.parse(a.txnReceipt);return{blockHash:c.blockHash,blockNumber:Z.from(c.blockNumber).toNumber(),confirmations:1,from:typeof e=="string"?void 0:e.intent.wallet,hash:c.transactionHash,raw:a.txnReceipt,receipt:c,wait:async function(l){return s.provider.waitForTransaction(c.transactionHash,l)}}}}class Hhe{constructor(e){this.receipt=e}}function QF(t){return typeof t=="object"&&typeof t.simulate=="function"&&typeof t.getFeeOptions=="function"&&typeof t.gasRefundOptions=="function"&&typeof t.getNonce=="function"&&typeof t.relay=="function"&&typeof t.wait=="function"}const qhe=Object.freeze(Object.defineProperty({__proto__:null,LocalRelayer:$he,ProviderRelayer:VF,ProviderRelayerDefaults:qF,RpcRelayer:KF,RpcRelayerProto:fd,isLocalRelayerOptions:Rhe,isProviderRelayerOptions:Ohe,isRelayer:QF,isRpcRelayerOptions:zhe,proto:fd},Symbol.toStringTag,{value:"Module"}));function YF(t){return t.getAddress!==void 0&&t.buildDeployTransaction!==void 0&&t.predecorateSignedTransactions!==void 0&&t.decorateTransactions!==void 0&&t.sign!==void 0&&t.notifyStatusChange!==void 0}class JF{constructor(e,r=!0){this.signer=e,this.eoa=r}getAddress(){return this.signer.getAddress()}async buildDeployTransaction(e){}async predecorateSignedTransactions(e){return[]}async decorateTransactions(e,r){return e}sign(e,r){return this.signer.signMessage(e)}notifyStatusChange(e,r,n){}suffix(){return[2]}}var a3=Object.freeze({__proto__:null,isSapientSigner:YF,SignerWrapper:JF});let rc=function(t){return t[t.INITIAL=0]="INITIAL",t[t.SIGNING=1]="SIGNING",t[t.SIGNED=2]="SIGNED",t[t.ERROR=3]="ERROR",t}({});function XF(t){return t===void 0||t.state===rc.INITIAL||t.state===rc.SIGNING}class zb{constructor(e,r=zb.randomTag()){this.tag=r,this.observers=[],this.signers=[],this.count=0,this.setSigners(e)}static randomTag(){return`default-${te(ro(8)).slice(2)}`}pullId(){return`${this.tag}-${this.count++}`}setSigners(e){this.signers=e.map(r=>YF(r)?r:new JF(r))}async getSigners(){return Promise.all(this.signers.map(async function(e){return e.getAddress()}))}subscribe(e){return this.observers.push(e),()=>{this.observers=this.observers.filter(r=>r!==e)}}async notifyObservers(e,r,n){await Promise.all([...this.signers.map(async function(i){return i.notifyStatusChange(e,r,n)}),...this.observers.map(async function(i){return i(r,n)})])}async buildDeployTransaction(e){let r;for(const n of this.signers){const i=await n.buildDeployTransaction(e);r===void 0?r=i:i!=null&&i.transactions&&(r.transactions=i.transactions.concat(r.transactions))}return r}async predecorateSignedTransactions(e){const r=[];for(const n of this.signers)r.push(...await n.predecorateSignedTransactions(e??{}));return r}async decorateTransactions(e,r){for(const n of this.signers)e=await n.decorateTransactions(e,r??{});return e}signMessage(e){var r=this;const n=this.pullId();return new Promise(async function(i){const{message:s,metadata:o,callback:a,candidates:c}=e,l={ended:!1,message:s,signers:{}};let u=o??{};const f=v=>{u=v,r.notifyObservers(n,l,u)},d=()=>{try{r.notifyObservers(n,l,u);const v=Object.entries(l.signers).filter(([m,g])=>XF(g));if(a&&a(l,f)||v.length===0){l.ended=!0,i(l),r.notifyObservers(n,l,u);return}}catch(v){console.error("Error while notifying observers",v)}};let h=r.signers;if(c){const v=await Promise.all(r.signers.map(async function(m){return m.getAddress()}));h=r.signers.filter((m,g)=>c.includes(v[g]))}const p=await Promise.allSettled(h.map(async function(v){const m=await v.getAddress();l.signers[m]={state:rc.SIGNING,request:v.sign(s,o??{}).then(g=>{const y=v.suffix();return l.signers[m]={state:rc.SIGNED,signature:g,suffix:y},d(),g}).catch(g=>{throw l.signers[m]={state:rc.ERROR,error:g},d(),g})}}));for(let v=0;vmt(e))):mt(t)}const $_=t=>{const e=new Map;for(const r of Object.keys(t.signers)){const n=t.signers[r];if(n.state===rc.SIGNED){const i=re(n.suffix),s=qe(["bytes","bytes"],[n.signature,i]);e.set(r,{signature:s,isDynamic:i.length!==1||i[0]!==2})}}return e};class f1 extends xc{constructor(e){if(rr.eq(e.chainId)&&!e.coders.signature.supportsNoChainId)throw new Error(`Sequence version ${e.config.version} doesn't support chainId 0`);super(),this.context=void 0,this.config=void 0,this.address=void 0,this.chainId=void 0,this.provider=void 0,this.relayer=void 0,this.coders=void 0,this.orchestrator=void 0,this._reader=void 0,this.context=e.context,this.config=e.config,this.orchestrator=e.orchestrator,this.coders=e.coders,this.address=e.address,this.chainId=e.chainId,this.provider=e.provider,this.relayer=e.relayer,this._reader=e.reader}static newWallet(e){const r=de.context.addressOf(e.context,e.coders.config.imageHashOf(e.config));return new f1(Wa({},e,{address:r}))}reader(){if(this._reader)return this._reader;if(!this.provider)throw new Error("Wallet status provider requires a provider");return new de.reader.OnChainReader(this.provider)}setConfig(e){this.config=e}setOrchestrator(e){this.orchestrator=e}setAddress(e){this.address=e}getSigners(){return this.orchestrator.getSigners()}async getAddress(){return this.address}async decorateTransactions(e){const r=await this.orchestrator.decorateTransactions(e);if(await this.reader().isDeployed(this.address))return r;const n=[{to:r.entrypoint,data:de.transaction.encodeBundleExecData(r),revertOnError:!0}],i=await this.buildDeployTransaction();return i&&n.unshift(...i.transactions),{entrypoint:this.context.guestModule,chainId:this.chainId,intent:r.intent,transactions:n}}async buildDeployTransaction(e){if(e!=null&&e.ignoreDeployed&&await this.reader().isDeployed(this.address))return;const r=this.coders.config.imageHashOf(this.config);if(de.context.addressOf(this.context,r)!==this.address)throw new Error(`First address of config ${r} doesn't match wallet address ${this.address}`);const n=f1.buildDeployTransaction(this.context,r);if(e!=null&&e.includeChildren){const i=await this.orchestrator.buildDeployTransaction(e);i&&(n.transactions=i.transactions.concat(n.transactions))}return n}async deploy(e){const r=await this.buildDeployTransaction(e);if(r!==void 0){if(!this.relayer)throw new Error("Wallet deploy requires a relayer");return this.relayer.relay(Wa({},r,{chainId:this.chainId,intent:{id:te(ro(32)),wallet:this.address}}))}}static buildDeployTransaction(e,r){const n=new $r(Xr.factory.abi);return{entrypoint:e.guestModule,transactions:[{to:e.factory,data:n.encodeFunctionData(n.getFunction("deploy"),[e.mainModule,r]),gasLimit:1e5,delegateCall:!1,revertOnError:!0,value:0}]}}async buildUpdateConfigurationTransaction(e){if(this.coders.config.update.isKindUsed){const r=await this.reader().implementation(this.address),n=r&&r===this.context.mainModuleUpgradable;return this.coders.config.update.buildTransaction(this.address,e,this.context,n?"later":"first")}return this.coders.config.update.buildTransaction(this.address,e,this.context)}async getNonce(e=0){const r=await this.reader().nonce(this.address,e);if(r===void 0)throw new Error("Unable to determine nonce");return r}async signDigest(e,r){const n=Q6(this.address,this.chainId,e);if(this.coders.config.hasSubdigest(this.config,n))return this.coders.signature.encodeSigners(this.config,new Map,[n],this.chainId).encoded;const i=Wa({},r,{digest:e,chainId:this.chainId,address:this.address,config:this.config}),s=re(n),o=await this.orchestrator.signMessage({candidates:this.coders.config.signersOf(this.config).map(c=>c.address),message:s,metadata:i,callback:(c,l)=>{const u=$_(c),f=Wa({},i,{parts:u});return l(f),this.coders.signature.hasEnoughSigningPower(this.config,u)}}),a=$_(o);return this.coders.signature.encodeSigners(this.config,a,[],this.chainId).encoded}signMessage(e){return this.signDigest(Ee(e),{message:e})}signTransactionBundle(e){if(e.entrypoint!==this.address)throw new Error(`Invalid entrypoint: ${e.entrypoint} !== ${this.address}`);return this.signTransactions(e.transactions,e.nonce)}async fetchNonceOrSpace(e){let r;if(e&&e.space!==void 0)r=Z.from(e.space);else{if(e===void 0)return this.randomNonce();if(e&&e.serial===!0)r=0;else return e}const n=await this.reader().nonce(this.address,r);if(n===void 0)throw new Error("Unable to determine nonce");return de.transaction.encodeNonce(r,n)}randomNonce(){const e=Z.from(te(ro(12)));return de.transaction.encodeNonce(e,0)}async signTransactions(e,r,n){const i=await R_(e),s=de.transaction.fromTransactionish(this.address,i);s.length===0&&s.push({to:this.address,data:"0x",value:0,gasLimit:0,delegateCall:!1,revertOnError:!0});const o=await this.fetchNonceOrSpace(r),a=de.transaction.digestOfTransactions(o,s),c=Wa({digest:a,transactions:s},n),l=await this.signDigest(a,c);return{intent:{id:Q6(this.address,this.chainId,a),wallet:this.address},chainId:this.chainId,transactions:s,entrypoint:this.address,nonce:o,signature:l}}async sendSignedTransaction(e,r){if(!this.relayer)throw new Error("Wallet sendTransaction requires a relayer");return this.relayer.relay(e,r)}async sendTransaction(e,r){let n;(r==null?void 0:r.nonce)!==void 0?n=r.nonce:r!=null&&r.serial?n={serial:!0}:n=this.randomNonce();const i=await this.signTransactions(e,n),s=await this.decorateTransactions(i);return this.sendSignedTransaction(s,r==null?void 0:r.quote)}async fillGasLimits(e){const r=await R_(e),n=de.transaction.fromTransactionish(this.address,r),i=this.relayer;if(!i)throw new Error("Wallet fillGasLimits requires a relayer");const s=await i.simulate(this.address,...n);return n.map((o,a)=>{const c=o.gasLimit?Z.from(o.gasLimit).toNumber():s[a].gasLimit;return Wa({},o,s[a],{gasLimit:c})})}connect(e,r){return this.provider=e,this.relayer=r,this}signTransaction(e){throw new Error("Method not implemented.")}}function $o(){return $o=Object.assign?Object.assign.bind():function(t){for(var e=1;eGhe(t[e])):!1}function Qhe(t){if(!t)return[];const e=Z.from(t.value);switch(t.token.type){case fd.FeeTokenType.UNKNOWN:return[{delegateCall:!1,revertOnError:!0,gasLimit:t.gasLimit,to:t.to,value:e.toHexString(),data:[]}];case fd.FeeTokenType.ERC20_TOKEN:if(!t.token.contractAddress)throw new Error("No contract address for ERC-20 fee option");return[{delegateCall:!1,revertOnError:!0,gasLimit:t.gasLimit,to:t.token.contractAddress,value:0,data:new $r([{constant:!1,inputs:[{type:"address"},{type:"uint256"}],name:"transfer",outputs:[],type:"function"}]).encodeFunctionData("transfer",[t.to,e.toHexString()])}];default:throw new Error(`Unhandled fee token type ${t.token.type}`)}}class Yhe{constructor(e,r,n){this.account=e,this.chainId=r,this.options=n,this._isSigner=!0}get provider(){return this.account.providerFor(this.chainId)}async getAddress(){return this.account.address}signMessage(e){var r,n;return this.account.signMessage(e,this.chainId,(r=(n=this.options)==null?void 0:n.cantValidateBehavior)!=null?r:"throw")}async defaultSelectFee(e,r){if(r.length===0)return;const n=[{constant:!0,inputs:[{type:"address"}],name:"balanceOf",outputs:[{type:"uint256"}],type:"function"}];for(const i of r)if(i.token.type===fd.FeeTokenType.UNKNOWN){if((await this.getBalance()).gte(Z.from(i.value)))return i}else if(i.token.contractAddress&&i.token.type===fd.FeeTokenType.ERC20_TOKEN&&(await new Pd(i.token.contractAddress,n,this.provider).balanceOf(this.account.address)).gte(Z.from(i.value)))return i;throw new Error("No fee option available - not enough balance")}async sendTransaction(e,r){var n,i,s,o,a;const c=Khe(e)?await mt(e):e,l=await this.account.prepareTransactions({txs:c,chainId:this.chainId,stubSignatureOverrides:(n=(i=this.options)==null?void 0:i.stubSignatureOverrides)!=null?n:new Map,simulateForFeeOptions:r==null?void 0:r.simulateForFeeOptions}),f=await((s=(o=this.options)==null?void 0:o.selectFee)!=null?s:this.defaultSelectFee.bind(this))(c,l.feeOptions),d=[...l.transactions,...Qhe(f)];return this.account.sendTransaction(d,this.chainId,l.feeQuote,void 0,void 0,((a=this.options)==null?void 0:a.nonceSpace)!==void 0?{nonceSpace:this.options.nonceSpace}:void 0)}getBalance(e){return this.provider.getBalance(this.account.address,e)}call(e,r){return this.provider.call(e,r)}async resolveName(e){const r=await this.provider.resolveName(e);if(!r)throw new Error(`Could not resolve name ${e}`);return r}connect(e){throw new Error("Method not implemented.")}signTransaction(e){throw new Error("Method not implemented.")}getTransactionCount(e){throw new Error("Method not implemented.")}estimateGas(e){throw new Error("Method not implemented.")}getChainId(){return Promise.resolve(Z.from(this.chainId).toNumber())}getGasPrice(){throw new Error("Method not implemented.")}getFeeData(){throw new Error("Method not implemented.")}checkTransaction(e){throw new Error("Method not implemented.")}populateTransaction(e){throw new Error("Method not implemented.")}_checkProvider(e){throw new Error("Method not implemented.")}}class Jhe{async isDeployed(e){return!1}async implementation(e){}async imageHash(e){}async nonce(e,r){return rr}async isValidSignature(e,r,n){throw new Error("Method not supported.")}}class Uo{constructor(e){this.address=void 0,this.networks=void 0,this.tracker=void 0,this.contexts=void 0,this.migrator=void 0,this.migrations=void 0,this.orchestrator=void 0,this.jwt=void 0,this.projectAccessKey=void 0,this.address=Ie(e.address),this.contexts=e.contexts,this.tracker=e.tracker,this.networks=e.networks,this.orchestrator=e.orchestrator,this.jwt=e.jwt,this.projectAccessKey=e.projectAccessKey,this.migrations=e.migrations||o3.DefaultMigrations,this.migrator=new s3.Migrator(e.tracker,this.migrations,this.contexts)}getSigner(e,r){return new Yhe(this,e,r)}static async new(e){var r;const i=new s3.Migrator(e.tracker,(r=e.migrations)!=null?r:o3.DefaultMigrations,e.contexts).lastMigration(),s=i.configCoder,o=s.fromSimple(e.config),a=s.imageHashOf(o),c=e.contexts[i.version],l=de.context.addressOf(c,a);return await e.tracker.saveCounterfactualWallet({config:o,context:Object.values(e.contexts)}),new Uo({address:l,tracker:e.tracker,contexts:e.contexts,networks:e.networks,orchestrator:e.orchestrator,migrations:e.migrations,projectAccessKey:e.projectAccessKey})}getAddress(){return Promise.resolve(this.address)}get version(){return this.migrator.lastMigration().version}get coders(){const e=this.migrator.lastMigration();return{signature:e.signatureCoder,config:e.configCoder}}network(e){const r=Z.from(e),n=this.networks.find(i=>r.eq(i.chainId));if(!n)throw new Error(`Network not found for chainId ${e}`);return n}providerFor(e){const r=this.network(e);if(!r.provider&&!r.rpcUrl)throw new Error(`Provider not found for chainId ${e}`);return r.provider||new uy(l1(r.rpcUrl,this.projectAccessKey,this.jwt),{name:"",chainId:Z.from(e).toNumber()})}reader(e){return rr.eq(e)?new Jhe:new de.reader.OnChainReader(this.providerFor(e))}relayer(e){const r=this.network(e);if(!r.relayer)throw new Error(`Relayer not found for chainId ${e}`);return QF(r.relayer)?r.relayer:new KF($o({},r.relayer,{projectAccessKey:this.projectAccessKey,jwtAuth:this.jwt}))}setOrchestrator(e){this.orchestrator=e}setJwt(e){this.jwt=e}contextFor(e){const r=this.contexts[e];if(!r)throw new Error(`Context not found for version ${e}`);return r}walletForStatus(e,r){const n=nn.coderFor(r.version);return this.walletFor(e,this.contextFor(r.version),r.config,n)}walletFor(e,r,n,i){const s=rr.eq(e);return new f1({config:n,context:r,chainId:e,coders:i,relayer:s?void 0:this.relayer(e),address:this.address,orchestrator:this.orchestrator,reader:this.reader(e)})}async status(e,r=!1){var n=this;const i=this.reader(e).isDeployed(this.address),s=this.tracker.imageHashOfCounterfactualWallet({wallet:this.address}).then(A=>{if(!A)throw new Error(`Counterfactual imageHash not found for wallet ${this.address}`);return A}),o=s.then(A=>zF.counterfactualVersion(this.address,A.imageHash,Object.values(this.contexts))),a=async function(){if(!await i)return o;const O=await n.reader(e).implementation(n.address);if(!O)throw new Error(`Implementation not found for wallet ${n.address}`);const w=Object.values(n.contexts);for(let I=0;I0?v[v.length-1].nextImageHash:d,g=await this.tracker.configOfImageHash({imageHash:m});if(!g)throw new Error(`Config not found for imageHash ${m}`);const y=await i,b=await s,C=nn.coderFor(h).config.checkpointOf(g);return{original:$o({},b,{version:await o}),onChain:{imageHash:f,config:await l,version:u,deployed:y},fullyMigrated:h===this.version,signedMigrations:p,version:h,presignedConfigurations:v,imageHash:m,config:g,checkpoint:C,canOnchainValidate:u===this.version&&y}}mustBeFullyMigrated(e){if(!e.fullyMigrated)throw new Error(`Wallet ${this.address} is not fully migrated`)}async predecorateSignedTransactions(e,r){const n=await this.orchestrator.predecorateSignedTransactions({chainId:r}),i=await this.predecorateTransactions([],e,r);return de.transaction.fromTransactionish(this.address,i).length>0&&n.push(await this.signTransactions(i,r)),n}async predecorateTransactions(e,r,n){if(r.onChain.imageHash!==r.imageHash){const s=await this.walletForStatus(n,r).buildUpdateConfigurationTransaction(r.config);return[Array.isArray(e)?e:[e],s.transactions].flat()}return e}async decorateTransactions(e,r,n){var i,s;if(!Array.isArray(e))return this.decorateTransactions([e],r,n);n=(i=n)!=null?i:e[0].chainId;const o=await this.buildBootstrapTransactions(r,n),a=o.transactions.length>0;if(!a&&e.length===1)return e[0];const{entrypoint:c}=a?o:e[0],l={entrypoint:c,chainId:n,intent:(s=e[0])==null?void 0:s.intent,transactions:[...o.transactions,...e.map(u=>({to:u.entrypoint,data:de.transaction.encodeBundleExecData(u),gasLimit:0,delegateCall:!1,revertOnError:!0,value:0}))]};if(!r.onChain.deployed){const u=de.transaction.subdigestOfGuestModuleTransactions(this.contexts[this.version].guestModule,n,l.transactions);l.intent===void 0?l.intent={id:u,wallet:this.address}:l.intent.id=u}return l}async decorateSignature(e,r){if(!r.presignedConfigurations||r.presignedConfigurations.length===0)return e;const n=this.coders.signature,i=r.presignedConfigurations.map(o=>o.signature),s=n.chainSignatures(e,i);return n.trim(s)}async publishWitness(){const e=Ee(vt(`This is a Sequence account woo! ${Date.now()}`)),r=await this.signDigest(e,0,!1),n=this.coders.signature.decode(r),i=this.coders.signature.signaturesOfDecoded(n);return this.tracker.saveWitnesses({wallet:this.address,digest:e,chainId:0,signatures:i})}async signDigest(e,r,n=!0,i="ignore",s){const o=rr.eq(r)?this.networks[0].chainId:r,a=await this.status(o);if(this.mustBeFullyMigrated(a),!a.canOnchainValidate&&i==="throw")throw new Error("Wallet cannot validate onchain");const l=await this.walletForStatus(r,a).signDigest(e,s),u=n?this.decorateSignature(l,a):l;if(!a.canOnchainValidate)switch(i){case"ignore":return u;case"eip6492":return this.buildEIP6492Signature(await u,a,r)}return u}buildOnChainSignature(e){const r=de.signature.subdigestOf({digest:te(e),chainId:0,address:this.address}),n=te(r),i=this.coders.config.fromSimple({threshold:32768,checkpoint:0,signers:[],subdigests:[n]}),s=new $r(Xr.mainModule.abi),o={entrypoint:this.address,transactions:[{to:this.address,data:s.encodeFunctionData("setExtraImageHash",[this.coders.config.imageHashOf(i),"57896044618658097711785492504343953926634992332820282019728792003956564819968"]),gasLimit:25e4}]};this.tracker.saveWalletConfig({config:i});const a=this.coders.signature.encodeSigners(i,new Map,[n],0).encoded;return{bundle:o,signature:a}}async buildEIP6492Signature(e,r,n){const i=await this.buildBootstrapTransactions(r,n);if(i.transactions.length===0)throw new Error("Cannot build EIP-6492 signature without bootstrap transactions");const s=zn.encode(["address","bytes","bytes"],[i.entrypoint,de.transaction.encodeBundleExecData(i),e]);return qe(["bytes","bytes32"],[s,de.EIP6492.EIP_6492_SUFFIX])}async editConfig(e){const r=await this.status(0).then(i=>i.config),n=this.coders.config.editConfig(r,$o({},e,{checkpoint:this.coders.config.checkpointOf(r).add(1)}));return this.updateConfig(n)}async updateConfig(e){if(!this.coders.config.isWalletConfig(e))throw new Error(`Invalid config for wallet ${this.address}`);const r=this.coders.config.imageHashOf(e),n=this.coders.signature.hashSetImageHash(r),i=await this.signDigest(n,0,!1);await this.tracker.savePresignedConfiguration({wallet:this.address,nextConfig:e,signature:i});const s=await this.tracker.configOfImageHash({imageHash:r,noCache:!0});if(!s||this.coders.config.imageHashOf(s)!==r)throw Error(`Reverse lookup failed for imageHash ${r}`)}async buildBootstrapTransactions(e,r){var n;const i=await this.orchestrator.buildDeployTransaction({chainId:r}),s=(n=i==null?void 0:i.transactions)!=null?n:[];if(!e.onChain.deployed){const c=f1.buildDeployTransaction(e.original.context,e.original.imageHash);s.push(...c.transactions)}s.length,s.push(...e.signedMigrations.map(c=>({to:c.tx.entrypoint,data:de.transaction.encodeBundleExecData(c.tx),value:0,gasLimit:0,revertOnError:!0,delegateCall:!1})));const o=e.signedMigrations.length>0?e.signedMigrations[0].tx.intent.id:de.transaction.subdigestOfGuestModuleTransactions(this.contexts[this.version].guestModule,r,s),{guestModule:a}=this.contextFor(e.version);return{entrypoint:a,transactions:s,chainId:r,intent:{id:o,wallet:this.address}}}async bootstrapTransactions(e,r){const n=r||await this.status(e);return this.buildBootstrapTransactions(n,e)}async doBootstrap(e,r,n){const i=await this.bootstrapTransactions(e,n);return this.relayer(e).relay($o({},i,{chainId:e}),r)}signMessage(e,r,n="ignore"){return this.signDigest(Ee(e),r,!0,n)}async signTransactions(e,r,n,i){const s=n||await this.status(r);this.mustBeFullyMigrated(s);const o=this.walletForStatus(r,s),a={address:this.address,digest:"",chainId:r,config:{version:this.version},decorate:!0,cantValidateBehavior:"ignore"},c=i!=null&&i.serial?{serial:!0}:(i==null?void 0:i.nonceSpace)!==void 0?{space:i.nonceSpace}:void 0,l=await o.signTransactions(e,c,a);return $o({},l,{signature:await this.decorateSignature(l.signature,s)})}async signMigrations(e,r){const n=await this.status(e);if(n.fullyMigrated)return!1;const i=this.walletForStatus(e,n),s=r(i.config),o=await this.migrator.signNextMigration(this.address,n.version,i,s);if(!o)return!1;await this.tracker.saveWalletConfig({config:s});const a=nn.coderFor(s.version).config,c=a.imageHashOf(s),l=await this.tracker.configOfImageHash({imageHash:c,noCache:!0});if(!l||a.imageHashOf(l)!==c)throw Error(`Reverse lookup failed for imageHash ${c}`);return await this.tracker.saveMigration(this.address,o,this.contexts),!0}async signAllMigrations(e){var r=this;const n=[];return{signedMigrations:(await Promise.all(this.networks.map(async function(o){try{return await r.signMigrations(o.chainId,e)}catch(a){return console.warn(`Failed to sign migrations for chain ${o.chainId}`,a),n.push(o.chainId),null}}))).filter(o=>o!==null),failedChains:n}}async isMigratedAllChains(){var e=this;const r=[];return{migratedAllChains:(await Promise.all(this.networks.map(async function(s){try{return await e.status(s.chainId)}catch(o){return r.push(s.chainId),console.warn(`Failed to get status for chain ${s.chainId}`,o),{fullyMigrated:!0}}}))).every(s=>s.fullyMigrated),failedChains:r}}async sendSignedTransactions(e,r,n,i,s){if(!Array.isArray(e))return this.sendSignedTransactions([e],r,n,i,s);const o=i||await this.status(r);this.mustBeFullyMigrated(o);const a=await this.decorateTransactions(e,o,r);return s==null||s(a),this.relayer(r).relay(a,n)}async fillGasLimits(e,r,n){return this.walletForStatus(r,n||await this.status(r)).fillGasLimits(e)}async gasRefundQuotes(e,r,n,i,s){const o=i||await this.status(r),a=this.walletForStatus(r,o),c=await this.predecorateTransactions(e,o,r),l=de.transaction.fromTransactionish(this.address,c),u=a.coders.config.buildStubSignature(a.config,n),f=te(ro(32)),d={chainId:r,intent:{id:f,wallet:this.address},signature:u,transactions:l,entrypoint:this.address,nonce:0},h=await this.decorateTransactions(d,o),p=de.transaction.encodeBundleExecData(h),v=await this.relayer(r).getFeeOptionsRaw(h.entrypoint,p,s);return $o({},v,{decorated:h})}async prepareTransactions(e){const r=await this.status(e.chainId),n=await this.fillGasLimits(e.txs,e.chainId,r),i=await this.gasRefundQuotes(n,e.chainId,e.stubSignatureOverrides,r,{simulate:e.simulateForFeeOptions}),s=de.transaction.unwind(this.address,i.decorated.transactions);return{transactions:n,flatDecorated:s,feeOptions:i.options,feeQuote:i.quote}}async sendTransaction(e,r,n,i=!1,s,o){const a=await this.status(r),c=i?e:await this.predecorateTransactions(e,a,r),u=de.transaction.fromTransactionish(this.address,c).length>0?await this.signTransactions(c,r,void 0,o):void 0,f=await this.orchestrator.predecorateSignedTransactions({chainId:r}),d=[];return u!==void 0&&u.transactions.length>0&&d.push(u),d.push(...f.filter(h=>h.transactions.length>0)),this.sendSignedTransactions(d,r,n,void 0,s)}async signTypedData(e,r,n,i,s="ignore"){const o=sp({domain:e,types:r,message:n});return this.signDigest(o,i,!0,s)}async getSigners(){var e=this;const r=n=>n.length?n[n.length-1]:void 0;return(await Promise.all(this.networks.map(async function({chainId:n,name:i}){try{var s;const o=await e.status(n);let a=(s=r(o.presignedConfigurations))==null?void 0:s.nextImageHash;if(!a&&o.onChain.version!==o.version){const f=r(o.signedMigrations);if(f){const{toVersion:d,toConfig:h}=f;a=nn.genericCoderFor(d).config.imageHashOf(h)}}a||(a=o.onChain.imageHash);const c=await e.tracker.configOfImageHash({imageHash:a});if(!c)throw new Error(`unable to find config for image hash ${a}`);return nn.genericCoderFor(c.version).config.signersOf(c).map(f=>$o({},f,{network:n}))}catch(o){return console.warn(`unable to get signers on network ${n} ${i}`,o),[]}}))).flat()}async getAllSigners(){var e=this;const r=[];return await Promise.all(this.networks.map(async function(n){const i=n.chainId,s=await e.status(i,!0),o=[s.onChain.imageHash,...s.onChain.version!==s.version?s.signedMigrations.map(a=>nn.coderFor(a.toVersion).config.imageHashOf(a.toConfig)):[],...s.presignedConfigurations.map(a=>a.nextImageHash)];return Promise.all(o.map(async function(a,c){const l=c===o.length-1,u=await e.tracker.configOfImageHash({imageHash:a});if(!u){console.warn(`AllSigners may be incomplete, config not found for imageHash ${a}`);return}nn.genericCoderFor(u.version).config.signersOf(u).forEach(h=>{const p=r.find(v=>v.address===h.address&&v.network===i);if(p&&l&&p.flaggedForRemoval){p.flaggedForRemoval=!1;return}p||r.push({address:h.address,weight:h.weight,network:i,flaggedForRemoval:!l})})}))})),r}}function Xhe(t){return t instanceof Uo}const Zhe=Object.freeze(Object.defineProperty({__proto__:null,Account:Uo,isAccount:Xhe},Symbol.toStringTag,{value:"Module"}));function Fy(){return Fy=Object.assign?Object.assign.bind():function(t){for(var e=1;ethis.fetch(this.url("Ping"),qr({},n)).then(i=>Vr(i).then(s=>({status:s.status}))),this.version=n=>this.fetch(this.url("Version"),qr({},n)).then(i=>Vr(i).then(s=>({version:s.version}))),this.runtimeStatus=n=>this.fetch(this.url("RuntimeStatus"),qr({},n)).then(i=>Vr(i).then(s=>({status:s.status}))),this.getChainID=n=>this.fetch(this.url("GetChainID"),qr({},n)).then(i=>Vr(i).then(s=>({chainID:s.chainID}))),this.getEtherBalance=(n,i)=>this.fetch(this.url("GetEtherBalance"),qr(n,i)).then(s=>Vr(s).then(o=>({balance:o.balance}))),this.getTokenBalances=(n,i)=>this.fetch(this.url("GetTokenBalances"),qr(n,i)).then(s=>Vr(s).then(o=>({page:o.page,balances:o.balances}))),this.getTokenSupplies=(n,i)=>this.fetch(this.url("GetTokenSupplies"),qr(n,i)).then(s=>Vr(s).then(o=>({page:o.page,contractType:o.contractType,tokenIDs:o.tokenIDs}))),this.getTokenSuppliesMap=(n,i)=>this.fetch(this.url("GetTokenSuppliesMap"),qr(n,i)).then(s=>Vr(s).then(o=>({supplies:o.supplies}))),this.getBalanceUpdates=(n,i)=>this.fetch(this.url("GetBalanceUpdates"),qr(n,i)).then(s=>Vr(s).then(o=>({page:o.page,balances:o.balances}))),this.getTransactionHistory=(n,i)=>this.fetch(this.url("GetTransactionHistory"),qr(n,i)).then(s=>Vr(s).then(o=>({page:o.page,transactions:o.transactions}))),this.syncBalance=(n,i)=>this.fetch(this.url("SyncBalance"),qr(n,i)).then(s=>Vr(s).then(o=>({}))),this.fetchTransactionReceipt=(n,i)=>this.fetch(this.url("FetchTransactionReceipt"),qr(n,i)).then(s=>Vr(s).then(o=>({receipt:o.receipt}))),this.fetchTransactionReceiptWithFilter=(n,i)=>this.fetch(this.url("FetchTransactionReceiptWithFilter"),qr(n,i)).then(s=>Vr(s).then(o=>({receipt:o.receipt}))),this.getAllWebhookListeners=(n,i)=>this.fetch(this.url("GetAllWebhookListeners"),qr(n,i)).then(s=>Vr(s).then(o=>({listeners:o.listeners}))),this.getWebhookListener=(n,i)=>this.fetch(this.url("GetWebhookListener"),qr(n,i)).then(s=>Vr(s).then(o=>({listener:o.listener}))),this.addWebhookListener=(n,i)=>this.fetch(this.url("AddWebhookListener"),qr(n,i)).then(s=>Vr(s).then(o=>({status:o.status,listener:o.listener}))),this.updateWebhookListener=(n,i)=>this.fetch(this.url("UpdateWebhookListener"),qr(n,i)).then(s=>Vr(s).then(o=>({status:o.status}))),this.removeWebhookListener=(n,i)=>this.fetch(this.url("RemoveWebhookListener"),qr(n,i)).then(s=>Vr(s).then(o=>({status:o.status}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const qr=(t={},e={})=>({method:"POST",headers:Fy({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{})}),Vr=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch{throw{code:"unknown",msg:`expecting JSON, got: ${e}`,status:t.status}}if(!t.ok)throw r;return r}),M_=typeof global=="object"?global.fetch:window.fetch;class C4 extends ZF{constructor(e,r,n){super(e.endsWith("/")?e.slice(0,-1):e,M_),this.projectAccessKey=r,this.jwtAuth=n,this._fetch=(i,s)=>{const o={},a=this.jwtAuth,c=this.projectAccessKey;return a&&a.length>0&&(o.Authorization=`BEARER ${a}`),c&&c.length>0&&(o["X-Access-Key"]=c),s.headers=Fy({},s.headers,o),M_(i,s)},this.fetch=this._fetch}}const c0e=Object.freeze(Object.defineProperty({__proto__:null,ContractType:E4,EventLogDataType:i0e,EventLogType:n0e,Indexer:ZF,SequenceIndexer:C4,SortOrder:a0e,TransactionStatus:s0e,TransactionType:o0e,TxnTransferType:hs,WebRPCSchemaHash:r0e,WebRPCSchemaVersion:t0e,WebRPCVersion:e0e},Symbol.toStringTag,{value:"Module"}));function jy(){return jy=Object.assign?Object.assign.bind():function(t){for(var e=1;ethis.fetch(this.url("Ping"),Gr({},n)).then(i=>Kr(i).then(s=>({status:s.status}))),this.version=n=>this.fetch(this.url("Version"),Gr({},n)).then(i=>Kr(i).then(s=>({version:s.version}))),this.runtimeStatus=n=>this.fetch(this.url("RuntimeStatus"),Gr({},n)).then(i=>Kr(i).then(s=>({status:s.status}))),this.getTokenMetadata=(n,i)=>this.fetch(this.url("GetTokenMetadata"),Gr(n,i)).then(s=>Kr(s).then(o=>({tokenMetadata:o.tokenMetadata}))),this.refreshTokenMetadata=(n,i)=>this.fetch(this.url("RefreshTokenMetadata"),Gr(n,i)).then(s=>Kr(s).then(o=>({status:o.status}))),this.getTokenMetadataBatch=(n,i)=>this.fetch(this.url("GetTokenMetadataBatch"),Gr(n,i)).then(s=>Kr(s).then(o=>({contractTokenMetadata:o.contractTokenMetadata}))),this.searchTokenMetadata=(n,i)=>this.fetch(this.url("SearchTokenMetadata"),Gr(n,i)).then(s=>Kr(s).then(o=>({page:o.page,tokenMetadata:o.tokenMetadata}))),this.searchTokenIDs=(n,i)=>this.fetch(this.url("SearchTokenIDs"),Gr(n,i)).then(s=>Kr(s).then(o=>({page:o.page,tokenIds:o.tokenIds}))),this.tokenCollectionFilters=(n,i)=>this.fetch(this.url("TokenCollectionFilters"),Gr(n,i)).then(s=>Kr(s).then(o=>({filters:o.filters}))),this.getContractInfo=(n,i)=>this.fetch(this.url("GetContractInfo"),Gr(n,i)).then(s=>Kr(s).then(o=>({contractInfo:o.contractInfo}))),this.getContractInfoBatch=(n,i)=>this.fetch(this.url("GetContractInfoBatch"),Gr(n,i)).then(s=>Kr(s).then(o=>({contractInfoMap:o.contractInfoMap}))),this.searchContractInfo=(n,i)=>this.fetch(this.url("SearchContractInfo"),Gr(n,i)).then(s=>Kr(s).then(o=>({contractInfoList:o.contractInfoList}))),this.searchContractInfoBatch=(n,i)=>this.fetch(this.url("SearchContractInfoBatch"),Gr(n,i)).then(s=>Kr(s).then(o=>({contractInfoByChain:o.contractInfoByChain}))),this.searchMetadata=(n,i)=>this.fetch(this.url("SearchMetadata"),Gr(n,i)).then(s=>Kr(s).then(o=>({tokenMetadata:o.tokenMetadata,contractInfo:o.contractInfo}))),this.projectSetTokenMetadata=(n,i)=>this.fetch(this.url("ProjectSetTokenMetadata"),Gr(n,i)).then(s=>Kr(s).then(o=>({ok:o.ok}))),this.getNiftyswapTokenQuantity=(n,i)=>this.fetch(this.url("GetNiftyswapTokenQuantity"),Gr(n,i)).then(s=>Kr(s).then(o=>({quantity:o.quantity}))),this.getNiftyswapUnitPrices=(n,i)=>this.fetch(this.url("GetNiftyswapUnitPrices"),Gr(n,i)).then(s=>Kr(s).then(o=>({prices:o.prices}))),this.getNiftyswapUnitPricesWithQuantities=(n,i)=>this.fetch(this.url("GetNiftyswapUnitPricesWithQuantities"),Gr(n,i)).then(s=>Kr(s).then(o=>({prices:o.prices}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const Gr=(t={},e={})=>({method:"POST",headers:jy({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{})}),Kr=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch{throw{code:"unknown",msg:`expecting JSON, got: ${e}`,status:t.status}}if(!t.ok)throw r;return r}),N_=typeof global=="object"?global.fetch:window.fetch;class S4 extends ej{constructor(e="https://metadata.sequence.app",r,n){super(e.endsWith("/")?e.slice(0,-1):e,N_),this.projectAccessKey=r,this.jwtAuth=n,this._fetch=(i,s)=>{const o={},a=this.jwtAuth,c=this.projectAccessKey;return a&&a.length>0&&(o.Authorization=`BEARER ${a}`),c&&c.length>0&&(o["X-Access-Key"]=c),s.headers=jy({},s.headers,o),N_(i,s)},this.fetch=this._fetch}}const m0e=Object.freeze(Object.defineProperty({__proto__:null,ContractType:d0e,Metadata:ej,PropertyType:h0e,SequenceMetadata:S4,SortOrder:v0e,SwapType:p0e,WebRPCSchemaHash:f0e,WebRPCSchemaVersion:u0e,WebRPCVersion:l0e},Symbol.toStringTag,{value:"Module"}));function y0e(t,e){const r=t.replace("ipfs://ipfs/","").replace("ipfs://","");return t.startsWith("ipfs://")?`${e}${r}`:t}function g0e(t){return t.startsWith("ipfs://")}class b0e{constructor(e,r,n=1e3){this.provider=e,this.solver=r,this.window=n,this.pending=new Map}async runByEIP5719(e,r,n){const i=`${e}-${r}-${n}`,s=Date.now();if(this.pending.has(i)&&s-this.pending.get(i).timestamp10)throw new Error("EIP5719 - Too many tries");if(de.signer.canRecover(n)){const c=de.signer.recoverSigner(r,n);if(c&&c.toLowerCase()===t.toLowerCase())return n}try{if(await de.signer.isValidSignature(t,r,n,e))return n}catch{}const o=await x0e(w0e(t,e).getAlternativeSignature(r));if(!o||o==="")throw new Error("EIP5719 - Invalid signature and no alternative signature");const a=te(await(i||new E0e).resolve(o));if(!a||a==="")throw new Error("EIP5719 - Empty alternative signature");if(a===te(n))throw new Error("EIP5719 - Alternative signature is invalid or the same");return tj(t,e,r,a,i,s+1)}class E0e{constructor(e="https://cloudflare-ipfs.com/ipfs/"){var r=this;this.gateway=e,this.uri=n=>g0e(n)?y0e(n,this.gateway):n,this.resolve=async function(n){const i=r.uri(n),s=await fetch(i);if(!s.ok)throw new Error(`URISolverIPFS - Failed to fetch ${i}`);return await s.text()}}}const C0e=(t,e)=>e.some(r=>t instanceof r);let D_,L_;function S0e(){return D_||(D_=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function k0e(){return L_||(L_=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const rj=new WeakMap,c3=new WeakMap,nj=new WeakMap,ux=new WeakMap,k4=new WeakMap;function A0e(t){const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("success",s),t.removeEventListener("error",o)},s=()=>{r(yc(t.result)),i()},o=()=>{n(t.error),i()};t.addEventListener("success",s),t.addEventListener("error",o)});return e.then(r=>{r instanceof IDBCursor&&rj.set(r,t)}).catch(()=>{}),k4.set(e,t),e}function _0e(t){if(c3.has(t))return;const e=new Promise((r,n)=>{const i=()=>{t.removeEventListener("complete",s),t.removeEventListener("error",o),t.removeEventListener("abort",o)},s=()=>{r(),i()},o=()=>{n(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",s),t.addEventListener("error",o),t.addEventListener("abort",o)});c3.set(t,e)}let l3={get(t,e,r){if(t instanceof IDBTransaction){if(e==="done")return c3.get(t);if(e==="objectStoreNames")return t.objectStoreNames||nj.get(t);if(e==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return yc(t[e])},set(t,e,r){return t[e]=r,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function P0e(t){l3=t(l3)}function T0e(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...r){const n=t.call(fx(this),e,...r);return nj.set(n,e.sort?e.sort():[e]),yc(n)}:k0e().includes(t)?function(...e){return t.apply(fx(this),e),yc(rj.get(this))}:function(...e){return yc(t.apply(fx(this),e))}}function I0e(t){return typeof t=="function"?T0e(t):(t instanceof IDBTransaction&&_0e(t),C0e(t,S0e())?new Proxy(t,l3):t)}function yc(t){if(t instanceof IDBRequest)return A0e(t);if(ux.has(t))return ux.get(t);const e=I0e(t);return e!==t&&(ux.set(t,e),k4.set(e,t)),e}const fx=t=>k4.get(t);function O0e(t,e,{blocked:r,upgrade:n,blocking:i,terminated:s}={}){const o=indexedDB.open(t,e),a=yc(o);return n&&o.addEventListener("upgradeneeded",c=>{n(yc(o.result),c.oldVersion,c.newVersion,yc(o.transaction),c)}),r&&o.addEventListener("blocked",c=>r(c.oldVersion,c.newVersion,c)),a.then(c=>{s&&c.addEventListener("close",()=>s()),i&&c.addEventListener("versionchange",l=>i(l.oldVersion,l.newVersion,l))}).catch(()=>{}),a}const R0e=["get","getKey","getAll","getAllKeys","count"],$0e=["put","add","delete","clear"],dx=new Map;function B_(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(dx.get(e))return dx.get(e);const r=e.replace(/FromIndex$/,""),n=e!==r,i=$0e.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(i||R0e.includes(r)))return;const s=async function(o,...a){const c=this.transaction(o,i?"readwrite":"readonly");let l=c.store;return n&&(l=l.index(a.shift())),(await Promise.all([l[r](...a),i&&c.done]))[0]};return dx.set(e,s),s}P0e(t=>({...t,get:(e,r,n)=>B_(e,r)||t.get(e,r,n),has:(e,r)=>!!B_(e,r)||t.has(e,r)}));class M0e{constructor(){this.loadPresignedConfiguration=void 0,this.savePresignedConfiguration=void 0,this.saveWitnesses=void 0,this.configOfImageHash=void 0,this.saveWalletConfig=void 0,this.imageHashOfCounterfactualWallet=void 0,this.saveCounterfactualWallet=void 0,this.walletsOfSigner=void 0}}var N0e=Object.freeze({__proto__:null,ConfigTracker:M0e});class D0e{constructor(e){this.tracker=e}async loadPresignedConfiguration(e){return console.debug("? loadPresignedConfiguration"),Tn(e,"? "),Tn(await this.tracker.loadPresignedConfiguration(e),"! ")}savePresignedConfiguration(e){return console.debug("? savePresignedConfiguration"),Tn(e,"? "),this.tracker.savePresignedConfiguration(e)}saveWitnesses(e){return console.debug("? saveWitnesses"),Tn(e,"? "),this.tracker.saveWitnesses(e)}async configOfImageHash(e){return console.debug("? configOfImageHash"),Tn(e,"? "),Tn(await this.tracker.configOfImageHash(e),"! ")}saveWalletConfig(e){return console.debug("? saveWalletConfig"),Tn(e,"? "),this.tracker.saveWalletConfig(e)}async imageHashOfCounterfactualWallet(e){return console.debug("? imageHashOfCounterfactualWallet"),Tn(e,"? "),Tn(await this.tracker.imageHashOfCounterfactualWallet(e),"! ")}saveCounterfactualWallet(e){return console.debug("? saveCounterfactualWallet"),Tn(e,"? "),this.tracker.saveCounterfactualWallet(e)}async walletsOfSigner(e){return console.debug("? walletsOfSigner"),Tn(e,"? "),Tn(await this.tracker.walletsOfSigner(e),"! ")}async getMigration(e,r,n,i){return console.debug("? getMigration"),Tn({address:e,fromImageHash:r,fromVersion:n,chainId:i},"? "),Tn(await this.tracker.getMigration(e,r,n,i),"! ")}saveMigration(e,r,n){return console.debug("? saveMigration"),Tn({address:e,signed:r,contexts:n},"? "),this.tracker.saveMigration(e,r,n)}}function Tn(t,e=""){switch(t){case void 0:console.debug(e+"undefined");break;default:JSON.stringify(t,void 0,2).split(` -`).map(r=>e+r).forEach(r=>console.debug(r));break}return t}var L0e=Object.freeze({__proto__:null,DebugConfigTracker:D0e});function Ic(){return Ic=Object.assign?Object.assign.bind():function(t){for(var e=1;ePromise.resolve(this.configs[e]),this.saveConfig=(e,r)=>(this.configs[e]=r,Promise.resolve()),this.loadV2Node=e=>Promise.resolve(this.v2Nodes[e]),this.saveV2Node=(e,r)=>(this.v2Nodes[e]=r,Promise.resolve()),this.loadCounterfactualWallet=e=>Promise.resolve(this.counterfactualWallets[e]),this.saveCounterfactualWallet=(e,r,n)=>(this.counterfactualWallets[e]={imageHash:r,context:n},Promise.resolve()),this.loadPayloadOfSubdigest=e=>Promise.resolve(this.payloads[e]),this.savePayloadOfSubdigest=(e,r)=>(this.payloads[e]=r,Promise.resolve()),this.loadSubdigestsOfSigner=e=>Promise.resolve(Object.keys(this.signatures[e]||{})),this.loadSignatureOfSubdigest=(e,r)=>{var n;return Promise.resolve((n=this.signatures[e])==null?void 0:n[r])},this.saveSignatureOfSubdigest=(e,r,n)=>(this.signatures[e]||(this.signatures[e]={}),this.signatures[e][r]=n,Promise.resolve()),this.loadMigrationsSubdigest=(e,r,n)=>{var i;return Promise.resolve(((i=this.migrations[e])==null||(i=i[r])==null?void 0:i[n])||[])},this.saveMigrationsSubdigest=(e,r,n,i,s)=>(this.migrations[e]||(this.migrations[e]={}),this.migrations[e][r]||(this.migrations[e][r]={}),this.migrations[e][r][n]||(this.migrations[e][r][n]=[]),this.migrations[e][r][n].push({subdigest:i,toImageHash:s}),Promise.resolve())}}function Lf(t){if(t===void 0)return;const e={};for(const r of Object.keys(t)){const n=t[r];n._isBigNumber===!0&&n._hex!==void 0&&typeof n._hex=="string"&&n._hex.length!==""?e[r]=Z.from(n):Array.isArray(n)?e[r]=n.map(i=>Lf(i)):typeof n=="object"&&n!==null?e[r]=Lf(n):e[r]=n}return e}class B0e{constructor(e){var r=this;this.dbName=e,this._lazyDb=void 0,this.loadConfig=async function(n){return(await r.getDb()).get("configs",n).then(s=>Lf(s))},this.saveConfig=async function(n,i){await(await r.getDb()).put("configs",i,n)},this.loadV2Node=async function(n){return(await r.getDb()).get("v2Nodes",n).then(s=>Lf(s))},this.saveV2Node=async function(n,i){await(await r.getDb()).put("v2Nodes",i,n)},this.loadCounterfactualWallet=async function(n){return(await r.getDb()).get("counterfactualWallets",n)},this.saveCounterfactualWallet=async function(n,i,s){await(await r.getDb()).put("counterfactualWallets",{imageHash:i,context:s},n)},this.loadPayloadOfSubdigest=async function(n){return(await r.getDb()).get("payloads",n).then(s=>Lf(s))},this.savePayloadOfSubdigest=async function(n,i){await(await r.getDb()).put("payloads",i,n)},this.loadSubdigestsOfSigner=async function(n){return(await(await r.getDb()).getAllKeysFromIndex("signatures","signer",IDBKeyRange.only(n))).map(o=>o.split("-")[0])},this.loadSignatureOfSubdigest=async function(n,i){const o=await(await r.getDb()).get("signatures",[i,n].join("-"));return o==null?void 0:o.signature},this.saveSignatureOfSubdigest=async function(n,i,s){await(await r.getDb()).put("signatures",{signature:s,signer:n},[i,n].join("-"))},this.loadMigrationsSubdigest=async function(n,i,s){return(await(await r.getDb()).getAllFromIndex("migrations","jump",IDBKeyRange.only([n,i,s]))).map(c=>({subdigest:c.subdigest,toImageHash:c.toImageHash}))},this.saveMigrationsSubdigest=async function(n,i,s,o,a){await(await r.getDb()).put("migrations",{wallet:n,fromVersion:i,toVersion:s,subdigest:o,toImageHash:a},o)}}async getDb(){if(this._lazyDb)return this._lazyDb;const e=this.dbName;return this._lazyDb=await O0e(e,1,{upgrade(r,n,i,s){console.log(`upgrading ${e} from ${n} to ${i} - ${s}`),n===0&&(r.createObjectStore("configs"),r.createObjectStore("v2Nodes"),r.createObjectStore("counterfactualWallets"),r.createObjectStore("payloads"),r.createObjectStore("signatures").createIndex("signer","signer",{unique:!1}),r.createObjectStore("migrations").createIndex("jump",["wallet","fromVersion","toVersion"]))}}),this._lazyDb}}function sj(t){return t.left!==void 0&&t.right!==void 0}function oj(t){return t.weight!==void 0&&t.threshold!==void 0&&t.tree!==void 0}function u3(t){return t.version===2&&t.threshold!==void 0&&t.checkpoint!==void 0&&t.tree!==void 0&&typeof t.tree=="string"}var F0e=Object.freeze({__proto__:null,isPlainNode:sj,isPlainNested:oj,isPlainV2Config:u3,MemoryTrackerStore:ij,recreateBigNumbers:Lf,IndexedDBStore:B0e});class A4{constructor(e,r=new ij,n=!1){var i=this;this.provider=e,this.store=r,this.useEIP5719=n,this.cachedEIP5719=void 0,this.loadTopology=async function(s){const o=await i.store.loadV2Node(s);if(!o)return{nodeHash:s};if(sj(o)){const[a,c]=await Promise.all([i.loadTopology(o.left),i.loadTopology(o.right)]);return{left:a,right:c}}return oj(o)?{weight:Z.from(o.weight),threshold:Z.from(o.threshold),tree:await i.loadTopology(o.tree)}:o},this.saveTopology=async function(s){if(Ge.config.isNodeLeaf(s))return;const o=Ge.config.hashNode(s);if(Ge.config.isNode(s)){const a=i.saveTopology(s.left),c=i.saveTopology(s.right),l=i.store.saveV2Node(o,{left:Ge.config.hashNode(s.left),right:Ge.config.hashNode(s.right)});await Promise.all([a,c,l]);return}if(Ge.config.isNestedLeaf(s)){const a=i.saveTopology(s.tree),c=i.store.saveV2Node(o,{weight:Z.from(s.weight).toString(),threshold:Z.from(s.threshold).toString(),tree:Ge.config.hashNode(s.tree)});await Promise.all([a,c]);return}if(Ge.config.isSignerLeaf(s))return i.store.saveV2Node(o,{address:s.address,weight:s.weight});if(Ge.config.isSubdigestLeaf(s))return i.store.saveV2Node(o,{subdigest:s.subdigest});throw new Error(`Unknown topology type: ${s}`)},this.saveWalletConfig=async function(s){const{config:o}=s;if(Bo.config.ConfigCoder.isWalletConfig(o)){const a=Bo.config.ConfigCoder.imageHashOf(o);return i.store.saveConfig(a,o)}if(Ge.config.ConfigCoder.isWalletConfig(o)){const a=Ge.config.ConfigCoder.imageHashOf(o);if(Ge.config.isComplete(o.tree))return i.store.saveConfig(a,o)}},this.configOfImageHashCache={},this.configOfImageHash=async function(s){const{imageHash:o}=s;if(i.configOfImageHashCache[s.imageHash])return i.configOfImageHashCache[s.imageHash];const a=await i.store.loadConfig(o);if(a){if(a.version===1||a.version===2&&!u3(a))return i.configOfImageHashCache[s.imageHash]=a,a;if(u3(a)){const c={version:2,threshold:Z.from(a.threshold),checkpoint:Z.from(a.checkpoint),tree:await i.loadTopology(a.tree)};return i.configOfImageHashCache[s.imageHash]=c,c}throw new Error(`Unknown config type: ${a}`)}},this.saveCounterfactualWallet=async function(s){const{config:o,context:a}=s,c=nn.genericCoderFor(o.version).config.imageHashOf(o);await Promise.all([i.saveWalletConfig({config:o}),...a.map(l=>{const u=de.context.addressOf(l,c);return i.store.saveCounterfactualWallet(u,c,l)})])},this.imageHashOfCounterfactualWallet=async function(s){const{wallet:o}=s,a=await i.store.loadCounterfactualWallet(o);if(a)return{imageHash:a.imageHash,context:a.context}},this.savePayload=async function(s){const{payload:o}=s,a=de.signature.subdigestOf(o);await i.store.savePayloadOfSubdigest(a,o)},this.payloadOfSubdigestCache={},this.payloadOfSubdigest=async function(s){if(i.payloadOfSubdigestCache[s.subdigest])return i.payloadOfSubdigestCache[s.subdigest];const{subdigest:o}=s,a=await i.store.loadPayloadOfSubdigest(o);return a&&(i.payloadOfSubdigestCache[o]=a),a},this.savePresignedConfiguration=async function(s){const o=Ge.signature.SignatureCoder.decode(s.signature),a=nn.genericCoderFor(s.nextConfig.version).config.imageHashOf(s.nextConfig),c=Ge.chained.messageSetImageHash(a),l=Ee(c),u={message:c,address:s.wallet,chainId:0,digest:l},f=i.savePayload({payload:u}),d=i.saveWalletConfig({config:s.nextConfig}),h=await Ge.signature.SignatureCoder.recover(o,u,i.provider),p=Ge.signature.signaturesOf(h.config.tree);await Promise.all([f,d,i.saveWalletConfig({config:h.config}),...p.map(v=>i.store.saveSignatureOfSubdigest(v.address,h.subdigest,v.signature))])},this.loadPresignedConfiguration=async function(s){const{wallet:o,fromImageHash:a,longestPath:c}=s,l=await i.configOfImageHash({imageHash:a});if(!l||!Ge.config.ConfigCoder.isWalletConfig(l))return[];const u=Ge.config.signersOf(l.tree).map(b=>b.address),f=await Promise.all(u.map(b=>i.store.loadSubdigestsOfSigner(b))),d=[...new Set(f.flat())],p=(await Promise.all([...new Set(d)].map(async function(b){return Ic({},await i.payloadOfSubdigest({subdigest:b}),{subdigest:b})}))).filter(b=>(b==null?void 0:b.message)&&(b==null?void 0:b.address)&&b.address===o).map(b=>({payload:b,nextImageHash:Ge.chained.decodeMessageSetImageHash(b.message)})).filter(b=>b==null?void 0:b.nextImageHash);let v;const g=(await Promise.all(p.map(async function({nextImageHash:b,payload:C}){const A=await i.configOfImageHash({imageHash:b});if(!A||!Ge.config.isWalletConfig(A))return;const O=Z.from(A.checkpoint);return{nextConfig:A,nextCheckpoint:O,nextImageHash:b,payload:C}}))).filter(b=>b!==void 0).filter(b=>b.nextCheckpoint.gt(l.checkpoint)).sort((b,C)=>b.nextCheckpoint.gt(C.nextCheckpoint)?c?1:-1:c?-1:1);for(const b of g){const{nextConfig:C,nextCheckpoint:A,nextImageHash:O,payload:w}=b;if(v){const z=v.checkpoint;if(c){if(A.gte(z))continue}else if(A.lte(z))continue}const I=new Map((await Promise.all(u.map(async function(z){const H=await i.store.loadSignatureOfSubdigest(z,w.subdigest);if(!H)return[z,void 0];const K=te(i.useEIP5719?await i.cachedEIP5719.runByEIP5719(z,w.subdigest,H):H),F=de.signer.tryRecoverSigner(w.subdigest,K)!==z;return[z,{isDynamic:F,signature:K}]}))).filter(z=>!!z[1]));if(I.size===0)continue;const B=Ge.signature.SignatureCoder.encodeSigners(l,I,[],0);B.weight.lt(l.threshold)||(v={nextImageHash:O,checkpoint:Z.from(C.checkpoint),signature:B.encoded})}if(!v)return[];const y=await i.loadPresignedConfiguration({wallet:o,fromImageHash:v.nextImageHash,longestPath:c});return[{wallet:o,nextImageHash:v.nextImageHash,signature:v.signature},...y]},this.saveWitnesses=async function(s){const o={digest:s.digest,address:s.wallet,chainId:s.chainId},a=de.signature.subdigestOf(o);await Promise.all([i.savePayload({payload:o}),...s.signatures.filter(c=>de.signer.canRecover(c)).map(c=>{const l=de.signer.recoverSigner(a,c);return i.store.saveSignatureOfSubdigest(l,a,c)})])},this.walletsOfSigner=async function(s){const o=await i.store.loadSubdigestsOfSigner(s.signer),a=await Promise.all(o.map(l=>i.payloadOfSubdigest({subdigest:l}))).then(l=>l.filter(u=>u!==void 0)),c=[];for(const l of a){const u=l.address;if(c.find(h=>h.wallet===u))continue;const f=de.signature.subdigestOf(l),d=await i.store.loadSignatureOfSubdigest(s.signer,f);d&&c.push({wallet:u,proof:{digest:l.digest,chainId:Z.from(l.chainId),signature:te(d)}})}return c},this.cachedEIP5719=new b0e(e)}async saveMigration(e,r,n){const i=r.fromVersion;if(i!==1)throw new Error("Migration not supported");if(!Ge.config.isWalletConfig(r.toConfig))throw new Error("Invalid to config");const{newImageHash:s,address:o}=HF.v1v2.decodeTransaction(r.tx,n);if(o!==e)throw new Error("Invalid migration transaction - address");if(Ge.config.ConfigCoder.imageHashOf(r.toConfig)!=s)throw new Error("Invalid migration transaction - config");const a=de.transaction.packMetaTransactionsData(r.tx.nonce,r.tx.transactions),c=Ee(a),l={chainId:r.tx.chainId,message:a,address:e,digest:c},u=de.signature.subdigestOf(l),f=this.savePayload({payload:l}),d=this.saveWalletConfig({config:r.toConfig}),h=Bo.signature.SignatureCoder.decode(r.tx.signature),p=await Bo.signature.SignatureCoder.recover(h,l,this.provider),v=Bo.signature.SignatureCoder.signaturesOf(p.config);await Promise.all([f,d,this.saveWalletConfig({config:p.config}),this.store.saveMigrationsSubdigest(e,i,i+1,u,s),...v.map(m=>this.store.saveSignatureOfSubdigest(m.address,p.subdigest,m.signature))])}async getMigration(e,r,n,i){var s=this;const[o,a]=await Promise.all([this.configOfImageHash({imageHash:r}),this.store.loadMigrationsSubdigest(e,n,n+1)]),c=nn.coderFor(n);return!o||!c.config.isWalletConfig(o)?void 0:(await Promise.all(a.map(async function(u){const{subdigest:f,toImageHash:d}=u,h=await s.payloadOfSubdigest({subdigest:f});if(!h||!h.message||!Z.from(i).eq(h.chainId))return;const p=c.config.signersOf(o).map(b=>b.address),v=new Map((await Promise.all(p.map(async function(b){const C=await s.store.loadSignatureOfSubdigest(b,f);if(!C)return[b,void 0];const A=te(s.useEIP5719?await s.cachedEIP5719.runByEIP5719(b,f,C):C),O=de.signer.tryRecoverSigner(f,A)!==b;return[b,{isDynamic:O,signature:A}]}))).filter(b=>!!b[1])),m=c.signature.encodeSigners(o,v,[],i);if(!m||m.weightu.filter(f=>f!==void 0)))[0]}updateProvider(e){this.provider=e}}var j0e=Object.freeze({__proto__:null,LocalConfigTracker:A4});let hx=function(t){return t.EIP712="EIP712",t.EthSign="EthSign",t.EIP1271="EIP1271",t}({});class U0e{constructor(e,r){this.hostname=void 0,this.fetch=void 0,this.path="/rpc/Sessions/",this.ping=n=>this.fetch(this.url("Ping"),ls({},n)).then(i=>us(i).then(s=>({}))),this.config=(n,i)=>this.fetch(this.url("Config"),ls(n,i)).then(s=>us(s).then(o=>({version:o.version,config:o.config}))),this.wallets=(n,i)=>this.fetch(this.url("Wallets"),ls(n,i)).then(s=>us(s).then(o=>({wallets:o.wallets}))),this.deployHash=(n,i)=>this.fetch(this.url("DeployHash"),ls(n,i)).then(s=>us(s).then(o=>({deployHash:o.deployHash,context:o.context}))),this.configUpdates=(n,i)=>this.fetch(this.url("ConfigUpdates"),ls(n,i)).then(s=>us(s).then(o=>({updates:o.updates}))),this.migrations=(n,i)=>this.fetch(this.url("Migrations"),ls(n,i)).then(s=>us(s).then(o=>({migrations:o.migrations}))),this.saveConfig=(n,i)=>this.fetch(this.url("SaveConfig"),ls(n,i)).then(s=>us(s).then(o=>({}))),this.saveWallet=(n,i)=>this.fetch(this.url("SaveWallet"),ls(n,i)).then(s=>us(s).then(o=>({}))),this.saveSignature=(n,i)=>this.fetch(this.url("SaveSignature"),ls(n,i)).then(s=>us(s).then(o=>({}))),this.saveSignerSignatures=(n,i)=>this.fetch(this.url("SaveSignerSignatures"),ls(n,i)).then(s=>us(s).then(o=>({}))),this.saveMigration=(n,i)=>this.fetch(this.url("SaveMigration"),ls(n,i)).then(s=>us(s).then(o=>({}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const ls=(t={},e={})=>({method:"POST",headers:Ic({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{})}),us=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch{throw{code:"unknown",msg:`expecting JSON, got: ${e}`,status:t.status}}if(!t.ok)throw r;return r});class z0e{constructor(e,r=!0){this.onlyRecoverable=r,this.sessions=void 0,this.sessions=new U0e(e,fetch)}async loadPresignedConfiguration(e){try{const{updates:r}=await this.sessions.configUpdates({wallet:e.wallet,fromImageHash:e.fromImageHash,allUpdates:e.longestPath});return r.map(({toImageHash:n,signature:i})=>({wallet:e.wallet,nextImageHash:n,signature:i}))}catch(r){if(px(r))return[];throw r}}async savePresignedConfiguration(e){const r=e.nextConfig,n=nn.genericCoderFor(r.version).config.imageHashOf(r),i=Ge.signature.setImageHashStruct(n),s=Ee(i);await this.sessions.saveSignature({wallet:e.wallet,digest:s,chainID:"0",signature:e.signature,toConfig:wv(r)})}async saveWitnesses(e){let r=e.signatures;this.onlyRecoverable&&(r=r.filter(n=>de.signer.canRecover(n))),await this.sessions.saveSignerSignatures({wallet:e.wallet,digest:e.digest,chainID:gf(e.chainId),signatures:r})}async configOfImageHash(e){try{const{version:r,config:n}=await this.sessions.config(e);return W0e(r,n)}catch(r){if(px(r))return;throw r}}async saveWalletConfig(e){const r=wv(e.config);await this.sessions.saveConfig({version:e.config.version,config:r})}async imageHashOfCounterfactualWallet(e){try{const{deployHash:r,context:n}=await this.sessions.deployHash(e);return{imageHash:r,context:n}}catch(r){if(px(r))return;throw r}}async saveCounterfactualWallet(e){const r=wv(e.config);await this.sessions.saveWallet({version:e.config.version,deployConfig:r})}async walletsOfSigner(e){const{wallets:r}=await this.sessions.wallets(e);return Object.entries(r).map(([n,{digest:i,chainID:s,type:o,signature:a}])=>{switch(o){case hx.EIP712:a+=te(de.signer.SigType.EIP712).slice(2);break;case hx.EthSign:a+=te(de.signer.SigType.ETH_SIGN).slice(2);break;case hx.EIP1271:a+=te(de.signer.SigType.WALLET_BYTES32).slice(2);break}return{wallet:n,proof:{digest:i,signature:a,chainId:Z.from(s)}}})}async getMigration(e,r,n,i){var s=this;const o=gf(i),{migrations:a}=await this.sessions.migrations({wallet:e,fromVersion:n,fromImageHash:r,chainID:o}),c=async function(f){const d=a[f];if(d){const h=Object.keys(d).map(Number).sort((p,v)=>v-p);for(const p of h)for(const[v,m]of Object.entries(d[p]))try{const g=await s.configOfImageHash({imageHash:v});if(g)return{fromVersion:n,toVersion:p,toConfig:g,tx:{entrypoint:m.executor,transactions:m.transactions,nonce:m.nonce,signature:m.signature,chainId:f,intent:{id:de.transaction.subdigestOfTransactions(e,f,m.nonce,m.transactions),wallet:e}}}}catch(g){console.error(g)}}},l=await c(o);if(l)return l;for(const u in a)if(u!==o){const f=await c(u);if(f)return f}}async saveMigration(e,r,n){await this.sessions.saveMigration({wallet:e,fromVersion:r.fromVersion,toVersion:r.toVersion,toConfig:wv(r.toConfig),executor:r.tx.entrypoint,transactions:r.tx.transactions.map(H0e),nonce:gf(r.tx.nonce),signature:r.tx.signature,chainID:gf(r.tx.chainId)})}}function wv(t){switch(t.version){case 1:if(Bo.config.ConfigCoder.isWalletConfig(t))return{threshold:Tl(t.threshold),signers:t.signers.map(({weight:e,address:r})=>({weight:Tl(e),address:r}))};throw new Error(`not a v${t.version} config: ${t}`);case 2:if(Ge.config.ConfigCoder.isWalletConfig(t))return{threshold:Tl(t.threshold),checkpoint:Tl(t.checkpoint),tree:fm(t.tree)};throw new Error(`not a v${t.version} config: ${t}`);default:throw new Error(`unknown version ${t.version}`)}}function fm(t){return Ge.config.isNode(t)?{left:fm(t.left),right:fm(t.right)}:Ge.config.isSignerLeaf(t)?{weight:Tl(t.weight),address:t.address}:Ge.config.isNestedLeaf(t)?{weight:Tl(t.weight),threshold:Tl(t.threshold),tree:fm(t.tree)}:Ge.config.isNodeLeaf(t)?{node:t.nodeHash}:Ic({},t)}function W0e(t,e){switch(t){case 1:return Ic({},e,{version:t});case 2:return Ic({},e,{version:t,tree:dm(e.tree)});default:throw new Error(`unknown version ${t}`)}}function dm(t){switch(typeof t){case"object":const e=Ic({},t);return e.left!==void 0&&(e.left=dm(e.left)),e.right!==void 0&&(e.right=dm(e.right)),e.tree!==void 0&&(e.tree=dm(e.tree)),e.node!==void 0&&(e.nodeHash=e.node,delete e.node),e;default:throw new Error(`v2 config tree ${t} is not an object`)}}function H0e(t){return{to:t.to,value:t.value!==void 0?gf(t.value):void 0,data:t.data!==void 0?te(t.data):void 0,gasLimit:t.gasLimit!==void 0?gf(t.gasLimit):void 0,delegateCall:t.delegateCall,revertOnError:t.revertOnError}}function Tl(t){return Z.from(t).toNumber()}function gf(t){return Z.from(t).toString()}function px(t){return typeof t=="object"&&t.status===404}var q0e=Object.freeze({__proto__:null,RemoteConfigTracker:z0e});function f3(t,e,r){return new Promise(n=>{let i=0;t.forEach(s=>s.then(o=>{r(o)?n(o):(i++,i===t.length&&n(e))}).catch(()=>{i++,i===t.length&&n(e)}))})}async function jh(t,e){return Promise.all(t.map(r=>r.catch(()=>e)))}class V0e{constructor(e){this.trackers=e}async configOfImageHash(e){const r=this.trackers.map(async function(a,c){return{res:await a.configOfImageHash(e),i:c}}),n=await f3(r,void 0,a=>(a==null?void 0:a.res)===void 0?!1:nn.genericCoderFor(a.res.version).config.isComplete(a.res));if(n!=null&&n.res)return this.saveWalletConfig({config:n.res,skipTracker:n.i}),n.res;const i=new A4(void 0),s=await jh(r,void 0);for(const a of s)a!=null&&a.res&&await i.saveWalletConfig({config:a.res});const o=await i.configOfImageHash(e);return o&&this.saveWalletConfig({config:o}),o}async saveWalletConfig(e){await Promise.all(this.trackers.map((r,n)=>{if(n!==e.skipTracker)return r.saveWalletConfig(e)}))}async imageHashOfCounterfactualWallet(e){const r=await f3(this.trackers.map(n=>n.imageHashOfCounterfactualWallet(e)),void 0,n=>!!n);return r&&this.configOfImageHash({imageHash:r.imageHash}).then(n=>{n&&this.saveCounterfactualWallet({config:n,context:[r.context]})}),r}async saveCounterfactualWallet(e){await Promise.all(this.trackers.map((r,n)=>{if(n!==e.skipTracker)return r.saveCounterfactualWallet(e)}))}async walletsOfSigner(e){const r=await jh(this.trackers.map(o=>o.walletsOfSigner(e)),[]).then(o=>o.flat()),n={};for(const o of r)n[o.wallet]=o.proof;const i=Object.keys(n).map(o=>({wallet:o,proof:n[o]})),s=new Map;return i.forEach(({wallet:o,proof:{digest:a,chainId:c,signature:l}})=>{const u=`${o}-${a}-${c}`;let f=s.get(u);f||(f={wallet:o,digest:a,chainId:c,signatures:[]},s.set(u,f)),f.signatures.push(l)}),s.forEach(o=>this.saveWitnesses(o)),i}async saveWitnesses(e){await Promise.all(this.trackers.map(r=>r.saveWitnesses(e)))}async loadPresignedConfiguration(e){var r=this;const n=await jh(this.trackers.map(c=>c.loadPresignedConfiguration(e)),[]),s=(await jh(n.map(async function(c){const l=c[c.length-1],u=await r.configOfImageHash({imageHash:l.nextImageHash});if(u)return{checkpoint:nn.genericCoderFor(u.version).config.checkpointOf(u),result:c}}),void 0)).reduce((c,l)=>l&&(!c||l.checkpoint.gt(c.checkpoint))?l:c);if(!s)return[];const o=new Map,a=c=>(o.has(c)||o.set(c,this.configOfImageHash({imageHash:c})),o.get(c));return s.result.forEach(async function(c){const l=await a(c.nextImageHash);l&&r.savePresignedConfiguration({wallet:e.wallet,nextConfig:l,signature:c.signature})}),s.result}async savePresignedConfiguration(e){await Promise.all(this.trackers.map(r=>r.savePresignedConfiguration(e)))}async getMigration(e,r,n,i){return(await Promise.all(this.trackers.map(o=>o.getMigration(e,r,n,i)))).find(o=>!!o)}async saveMigration(e,r,n){await Promise.all(this.trackers.map(i=>i.saveMigration(e,r,n)))}}class G0e{constructor(e,r,n){this.tracker=e,this.cache=r,this.contexts=n}async loadPresignedConfiguration(e){var r=this;const n=[this.tracker.loadPresignedConfiguration(e),this.cache.loadPresignedConfiguration(e)];let i;const[s,o]=await Promise.all(n);if(s.length>0&&o.length>0&&s[s.length-1].nextImageHash===o[o.length-1].nextImageHash)i=e.longestPath===!0?s.length>o.length?s:o:s.lengthf&&(!u||f.checkpoint.gt(u.checkpoint))?f:u))==null?void 0:c.result)!=null?a:[]}return i||[]}async savePresignedConfiguration(e){await Promise.all([this.tracker.savePresignedConfiguration(e),this.cache.savePresignedConfiguration(e)])}async configOfImageHash(e){if(e.noCache!==!0){const n=await this.cache.configOfImageHash(e);if(n)return n}const r=await this.tracker.configOfImageHash(e);return r&&await this.cache.saveWalletConfig({config:r}),r}async saveWalletConfig(e){await Promise.all([this.tracker.saveWalletConfig(e),this.cache.saveWalletConfig(e)])}async imageHashOfCounterfactualWallet(e){if(e.noCache!==!0){const n=await this.cache.imageHashOfCounterfactualWallet(e);if(n)return n}const r=await this.tracker.imageHashOfCounterfactualWallet(e);if(r){const n=await this.configOfImageHash({imageHash:r.imageHash});n&&await this.cache.saveCounterfactualWallet({config:n,context:[r.context]})}return r}async saveCounterfactualWallet(e){await Promise.all([this.tracker.saveCounterfactualWallet(e),this.cache.saveCounterfactualWallet(e)])}async walletsOfSigner(e){if(e.noCache)return this.tracker.walletsOfSigner(e);const r=await Promise.all([this.tracker.walletsOfSigner(e),this.cache.walletsOfSigner(e)]),n=new Map;for(const i of r)for(const s of i)n.set(s.wallet,s);return Array.from(n.values())}async saveWitnesses(e){await Promise.all([this.tracker.saveWitnesses(e),this.cache.saveWitnesses(e)])}async getMigration(e,r,n,i){const s=await this.cache.getMigration(e,r,n,i);if(s)return s;const o=await this.tracker.getMigration(e,r,n,i);return o&&await this.cache.saveMigration(e,o,this.contexts),o}async saveMigration(e,r,n){await Promise.all([this.tracker.saveMigration(e,r,n),this.cache.saveMigration(e,r,n)])}}class F_{constructor(){this.cache=void 0,this.cache=new Map}do(e,r,n,...i){e=`${e}:${Ee(vt(JSON.stringify(i,K0e)))}`;let s=this.cache.get(e);if(s&&s.expiration&&new Date>=s.expiration&&(s=void 0,this.cache.delete(e)),!s){const o={promise:n(...i)};r!==void 0&&(o.promise=o.promise.then(a=>(o.expiration=new Date(Date.now()+r),a))),s=o,this.cache.set(e,s)}return s.promise}}function K0e(t,e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?Object.fromEntries(Object.entries(e).sort()):e}function Q0e(t){return t instanceof aj}class aj{constructor(e,r=50,n=!1){this.tracker=e,this.window=r,this.verbose=n,this.cache=new F_}invalidateCache(){this.cache=new F_}configOfImageHash(e){return this.cache.do("configOfImageHash",this.window,r=>this.tracker.configOfImageHash(r),e)}getMigration(e,r,n,i){return this.cache.do("getMigration",this.window,(...s)=>this.tracker.getMigration(...s),e,r,n,i)}saveMigration(e,r,n){return this.cache.do("saveMigration",void 0,(...i)=>this.tracker.saveMigration(...i),e,r,n)}loadPresignedConfiguration(e){return this.cache.do("loadPresignedConfiguration",this.window,r=>this.tracker.loadPresignedConfiguration(r),e)}savePresignedConfiguration(e){return this.cache.do("savePresignedConfiguration",void 0,r=>this.tracker.savePresignedConfiguration(r),e)}saveWitnesses(e){return this.cache.do("saveWitnesses",void 0,r=>this.tracker.saveWitnesses(r),e)}saveWalletConfig(e){return this.cache.do("saveWalletConfig",void 0,r=>this.tracker.saveWalletConfig(r),e)}imageHashOfCounterfactualWallet(e){return this.cache.do("imageHashOfCounterfactualWallet",void 0,r=>this.tracker.imageHashOfCounterfactualWallet(r),e)}saveCounterfactualWallet(e){return this.cache.do("saveCounterfactualWallet",void 0,r=>this.tracker.saveCounterfactualWallet(r),e)}walletsOfSigner(e){return this.cache.do("walletsOfSigner",this.window,r=>this.tracker.walletsOfSigner(r),e)}updateProvider(e){this.tracker instanceof A4&&this.tracker.updateProvider(e)}}var _4=Object.freeze({__proto__:null,debug:L0e,local:j0e,remote:q0e,stores:F0e,raceUntil:f3,allSafe:jh,MultipleTracker:V0e,CachedTracker:G0e,isDedupedTracker:Q0e,DedupedTracker:aj});const Y0e=Object.freeze(Object.defineProperty({__proto__:null,tracker:N0e,trackers:_4},Symbol.toStringTag,{value:"Module"})),cj=60*60*24*7,J0e=60;class j_{constructor(e,r,n={},i){this.account=e,this.settings=r,this.status=n,this._initialAuthRequest=void 0,this.proofStrings=new Map,this.onAuthCallbacks=[],this.apiClient=void 0,this.metadataClient=void 0,this.indexerClients=new Map,this.projectAccessKey=void 0,this.projectAccessKey=i}now(){return Math.floor(Date.now()/1e3)}get expiration(){var e;return Math.max((e=this.settings.metadata.expiration)!=null?e:cj,120)}onAuth(e){return this.onAuthCallbacks.push(e),()=>this.onAuthCallbacks=this.onAuthCallbacks.filter(r=>r!==e)}async dump(){return this.status.jwt?{jwt:{token:await this.status.jwt.token,expiration:this.status.jwt.expiration},metadata:this.status.metadata}:{metadata:this.settings.metadata}}auth(e=5){var r=this;return this._initialAuthRequest?this._initialAuthRequest:(this._initialAuthRequest=async function(){const n=r.settings.sequenceApiUrl;if(!n)throw Error("No sequence api url");let i;for(let s=1;;s++)try{i=(await r.getJWT(!0)).token;break}catch(o){if(s===e)throw console.error(`couldn't authenticate after ${e} attempts`,o),o}return new d0(n,void 0,i)}(),this._initialAuthRequest)}async getJWT(e){var r=this;const n=this.settings.sequenceApiUrl;if(!n)throw Error("No sequence api url");if(this.status.jwt){const l=this.status.jwt,u=await l.token;if(this.now(){throw this.status.jwt=void 0,l}),expiration:o};return this.status.jwt=a,a.token.then(l=>{this.onAuthCallbacks.forEach(u=>{try{u({status:"fulfilled",value:l})}catch{}})}).catch(l=>{this.onAuthCallbacks.forEach(u=>{try{u({status:"rejected",reason:l})}catch{}})}),{token:await a.token,expiration:o}}getProofStringKey(){return`${this.account.address} - ${this.settings.metadata.name}`}async isProofStringValid(e){try{const r=new c1,n=Z.from(this.settings.sequenceApiChainId),i=_s(this.account.networks,n);if(!i)throw Error("No network found");return r.chainId=n.toNumber(),r.provider=new uy(l1(i.rpcUrl,this.projectAccessKey),{name:"",chainId:n.toNumber()}),await r.decodeProof(e),!0}catch{return!1}}async getAPIClient(e=!0){if(!this.apiClient){const r=this.settings.sequenceApiUrl;if(!r)throw Error("No sequence api url");const n=(await this.getJWT(e)).token;this.apiClient=new d0(r,void 0,n)}return this.apiClient}async getMetadataClient(e=!0){if(!this.metadataClient){const r=(await this.getJWT(e)).token;this.metadataClient=new S4(this.settings.sequenceMetadataUrl,void 0,r)}return this.metadataClient}async getIndexerClient(e,r=!0){const n=_s(this.account.networks,e);if(!n)throw Error(`No network for chain ${e}`);if(!this.indexerClients.has(n.chainId))if(n.indexer)this.indexerClients.set(n.chainId,n.indexer);else if(n.indexerUrl){const i=(await this.getJWT(r)).token;this.indexerClients.set(n.chainId,new C4(n.indexerUrl,void 0,i))}else throw Error(`No indexer url for chain ${e}`);return this.indexerClients.get(n.chainId)}getProofString(e){if(this.proofStrings.has(e)){const c=this.proofStrings.get(e);if(this.now()(r.signature=c,n.encodeProof(r,!0))).catch(c=>{throw this.proofStrings.delete(e),c}),expiration:o};return this.proofStrings.set(e,a),a}}const lj=async(t,e,r)=>{const n=Ie(await t.getAddress());if(!n||n===""||n==="0x")throw uj;const i=new Mb;if(i.address=n,!r||!r.app||r.app==="")throw new P4("authorization options requires app to be set");i.claims.app=r.app,i.claims.ogn=r.origin,i.claims.n=r.nonce,i.setExpiryIn(r.expiry?Math.max(r.expiry,200):cj);const s=i.messageTypedData(),o=XB(e);i.signature=await(t instanceof Uo?t.signTypedData(s.domain,s.types,s.message,o,"eip6492"):t.signTypedData(s.domain,s.types,s.message,o));const c=await new c1().encodeProof(i,!0);return{typedData:s,proofString:c}};class P4 extends Error{constructor(e){super(e),this.name="AuthError"}}const uj=new P4("auth error: account address is empty");function xl(){return xl=Object.assign?Object.assign.bind():function(t){for(var e=1;ez.wallet));let I;if(w){if(f==null||f(w),I=new Uo({address:w,tracker:b,networks:y,contexts:g,orchestrator:v,projectAccessKey:m}),l&&l.length>0){let z=await I.status(A);if(z.original.version!==z.version||I.version!==z.version){const{migratedAllChains:F,failedChains:x}=await I.isMigratedAllChains();if(x.some(P=>d3.includes(P)))throw Error(`Failed to fetch account status on ${x.join(", ")}`);if(!F){if(p&&!await p(I))throw Error("Migration cancelled, cannot open session");const{failedChains:P}=await I.signAllMigrations(h||(D=>D));if(P.some(D=>d3.includes(D)))throw Error(`Failed to sign migrations on ${P.join(", ")}`);_4.isDedupedTracker(b)&&b.invalidateCache();let $;if([$,z]=await Promise.all([I.isMigratedAllChains().then(D=>D.migratedAllChains),I.status(A)]),!$)throw Error("Failed to migrate account")}}z.onChain.version!==z.version&&await I.doBootstrap(A,void 0,z);const H=z.config,K=I.coders.config.editConfig(H,{add:l,threshold:c});if(I.coders.config.imageHashOf(H)!==I.coders.config.imageHashOf(K)){const F=I.coders.config.editConfig(K,{checkpoint:I.coders.config.checkpointOf(H).add(1)});await I.updateConfig(F)}}}else{if(!l||l.length===0)throw Error("Cannot create new account without signers");if(!c)throw Error("Cannot create new account without threshold");if(I=await Uo.new({config:{threshold:c,checkpoint:0,signers:l},tracker:b,contexts:g,orchestrator:v,networks:y,projectAccessKey:m}),f==null||f(I.address),await I.publishWitness(),!(await b.walletsOfSigner({signer:a,noCache:!0})).some(H=>H.wallet===I.address))throw Error("Account not found on tracker")}let B;return C&&(B=new j_(I,C),B.auth(),B.onAuth(z=>{z.status==="fulfilled"&&I.setJwt(z.value)})),new E0(y,g,I,B)}static async load(e){const{dump:r,settings:n,editConfigOnMigration:i,onMigration:s,orchestrator:o}=e,{contexts:a,networks:c,tracker:l,services:u}=xl({},hm,n);let f;if(fj(r)){var d,h,p;const C=r.config.address||de.context.addressOf(a[1],Bo.config.ConfigCoder.imageHashOf(xl({},r.config,{version:1}))),A=((d=(h=r.jwt)==null?void 0:h.expiration)!=null?d:0)O.migratedAllChains)){if(s&&!await s(f))throw Error("Migration cancelled, cannot open session");if(console.log("Migrating account..."),await f.signAllMigrations(i),!await f.isMigratedAllChains().then(O=>O.migratedAllChains))throw Error("Failed to migrate account")}}else if(dj(r)){var v,m,g;const C=((v=(m=r.jwt)==null?void 0:m.expiration)!=null?v:0)async(n,i,s)=>{const o=s.messageDigest();return{isValid:await t(i).isValidSignature(s.address,o,s.signature)}},Z0e=Object.freeze(Object.defineProperty({__proto__:null,AuthError:P4,CRITICAL_CHAINS:d3,ErrAccountIsRequired:uj,Session:E0,SessionSettingsDefault:hm,ValidateSequenceWalletProof:X0e,isSessionDumpV1:fj,isSessionDumpV2:dj,signAuthorization:lj},Symbol.toStringTag,{value:"Module"}));function Uy(){return Uy=Object.assign?Object.assign.bind():function(t){for(var e=1;ethis.fetch(this.url("Ping"),In({},n)).then(i=>On(i).then(s=>({status:s.status}))),this.version=n=>this.fetch(this.url("Version"),In({},n)).then(i=>On(i).then(s=>({version:s.version}))),this.runtimeStatus=n=>this.fetch(this.url("RuntimeStatus"),In({},n)).then(i=>On(i).then(s=>({status:s.status}))),this.getSignerConfig=(n,i)=>this.fetch(this.url("GetSignerConfig"),In(n,i)).then(s=>On(s).then(o=>({signerConfig:o.signerConfig}))),this.sign=(n,i)=>this.fetch(this.url("Sign"),In(n,i)).then(s=>On(s).then(o=>({sig:o.sig}))),this.signWith=(n,i)=>this.fetch(this.url("SignWith"),In(n,i)).then(s=>On(s).then(o=>({sig:o.sig}))),this.authMethods=(n,i)=>this.fetch(this.url("AuthMethods"),In(n,i)).then(s=>On(s).then(o=>({methods:o.methods,active:o.active}))),this.setPIN=(n,i)=>this.fetch(this.url("SetPIN"),In(n,i)).then(s=>On(s).then(o=>({}))),this.resetPIN=(n,i)=>this.fetch(this.url("ResetPIN"),In(n,i)).then(s=>On(s).then(o=>({}))),this.createTOTP=(n,i)=>this.fetch(this.url("CreateTOTP"),In(n,i)).then(s=>On(s).then(o=>({uri:o.uri}))),this.commitTOTP=(n,i)=>this.fetch(this.url("CommitTOTP"),In(n,i)).then(s=>On(s).then(o=>({codes:o.codes}))),this.resetTOTP=(n,i)=>this.fetch(this.url("ResetTOTP"),In(n,i)).then(s=>On(s).then(o=>({}))),this.reset2FA=(n,i)=>this.fetch(this.url("Reset2FA"),In(n,i)).then(s=>On(s).then(o=>({}))),this.recoveryCodes=(n,i)=>this.fetch(this.url("RecoveryCodes"),In(n,i)).then(s=>On(s).then(o=>({codes:o.codes}))),this.resetRecoveryCodes=(n,i)=>this.fetch(this.url("ResetRecoveryCodes"),In(n,i)).then(s=>On(s).then(o=>({codes:o.codes}))),this.hostname=e,this.fetch=(n,i)=>r(n,i)}url(e){return this.hostname+this.path+e}}const In=(t={},e={})=>({method:"POST",headers:Uy({},e,{"Content-Type":"application/json"}),body:JSON.stringify(t||{})}),On=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch{throw{code:"unknown",msg:`expecting JSON, got: ${e}`,status:t.status}}if(!t.ok)throw r;return r}),t1e=typeof global=="object"?global.fetch:window.fetch;class r1e{constructor(e,r,n=!1){this.address=e,this.url=r,this.appendSuffix=n,this.guard=void 0,this.guard=new e1e(r,t1e)}async getAddress(){return this.address}async buildDeployTransaction(e){}async predecorateSignedTransactions(e){return[]}async decorateTransactions(e,r){return e}async sign(e,r){var n;if(!de.isWalletSignRequestMetadata(r))throw new Error("expected sequence signature request metadata");const i=r.guardTotpCode,s=nn.genericCoderFor(r.config.version),{encoded:o}=s.signature.encodeSigners(r.config,(n=r.parts)!=null?n:new Map,[],r.chainId);return(await this.guard.signWith({signer:this.address,request:{msg:te(e),auxData:this.packMsgAndSig(r.address,r.digest,o,r.chainId),chainId:Z.from(r.chainId).toNumber()},token:i?{id:zy.TOTP,token:i}:void 0})).sig}notifyStatusChange(e,r,n){}async getAuthMethods(e){let r;if("jwt"in e)r=await this.guard.authMethods({},{Authorization:`BEARER ${e.jwt}`});else{const n=await U_(e);r=await this.guard.authMethods({proof:{wallet:n.walletAddress,timestamp:n.timestamp.getTime(),signer:n.signerAddress,signature:n.signature}})}return Uy({},r,{methods:r.methods.map(n1e)})}async setPin(e,r){const n=await Eh(r);e===void 0?await this.guard.resetPIN({timestamp:n.timestamp.getTime(),signature:n.signature},{Authorization:`BEARER ${r.jwt}`}):await this.guard.setPIN({pin:e,timestamp:n.timestamp.getTime(),signature:n.signature},{Authorization:`BEARER ${r.jwt}`})}resetPin(e){return this.setPin(void 0,e)}async createTotp(e){const r=await Eh(e),{uri:n}=await this.guard.createTOTP({timestamp:r.timestamp.getTime(),signature:r.signature},{Authorization:`BEARER ${e.jwt}`});return new URL(n)}async commitTotp(e,r){const{codes:n}=await this.guard.commitTOTP({token:e},{Authorization:`BEARER ${r}`});return n}async resetTotp(e){const r=await Eh(e);await this.guard.resetTOTP({timestamp:r.timestamp.getTime(),signature:r.signature},{Authorization:`BEARER ${e.jwt}`})}async reset2fa(e,r){if("jwt"in r)await this.guard.reset2FA({code:e},{Authorization:`BEARER ${r.jwt}`});else{const n=await U_(r);await this.guard.reset2FA({code:e,proof:{wallet:n.walletAddress,timestamp:n.timestamp.getTime(),signer:n.signerAddress,signature:n.signature}})}}async getRecoveryCodes(e){const r=await Eh(e),{codes:n}=await this.guard.recoveryCodes({timestamp:r.timestamp.getTime(),signature:r.signature},{Authorization:`BEARER ${e.jwt}`});return n}async resetRecoveryCodes(e){const r=await Eh(e),{codes:n}=await this.guard.resetRecoveryCodes({timestamp:r.timestamp.getTime(),signature:r.signature},{Authorization:`BEARER ${e.jwt}`});return n}packMsgAndSig(e,r,n,i){return zn.encode(["address","uint256","bytes","bytes"],[e,i,r,n])}suffix(){return this.appendSuffix?[3]:[]}}let zy=function(t){return t.PIN="PIN",t.TOTP="TOTP",t}({});function n1e(t){switch(t){case zy.PIN:case zy.TOTP:return t;default:throw new Error(`unknown auth method '${t}'`)}}function i1e(t){return"signerAddress"in t&&typeof t.signerAddress=="string"}async function U_(t){if(i1e(t))return t;{const e=a3.isSapientSigner(t.signer)?t.signer:new a3.SignerWrapper(t.signer),r=await e.getAddress(),n=new Date,i=hj(t.walletAddress,n),s=sp(i);return{walletAddress:t.walletAddress,timestamp:n,signerAddress:r,signature:te(await e.sign(s,{}))}}}async function Eh(t){if("wallet"in t){var e;const r=new Date,n=pj(r),i=await t.wallet.signTypedData(n.domain,n.types,n.message,(e=n.domain.chainId)!=null?e:1,"eip6492");return{jwt:t.jwt,timestamp:r,signature:i}}else return t}function hj(t,e){return{domain:vj,types:{AuthMethods:[{name:"wallet",type:"address"},{name:"timestamp",type:"string"}]},message:{wallet:Ie(t),timestamp:mj(e)}}}function pj(t){return{domain:vj,types:{AuthUpdate:[{name:"timestamp",type:"string"}]},message:{timestamp:mj(t)}}}const vj={name:"Sequence Guard",version:"1",chainId:1};function mj(t){return t.toUTCString().replace("GMT","UTC")}const s1e=Object.freeze(Object.defineProperty({__proto__:null,AuthMethod:zy,GuardSigner:r1e,getAuthUpdateProofTypedData:pj,getOwnershipProofTypedData:hj},Symbol.toStringTag,{value:"Module"}));function Wy(){return Wy=Object.assign?Object.assign.bind():function(t){for(var e=1;e{this.queue.length>0&&(this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(this.run,this.options.timeWindow))},this.handle=(n,i,s)=>{if(this.batchableJsonRpcMethods.find(o=>o===i.method)){this.queue.push({request:i,callback:s,next:n}),this.options.verbose&&console.log("Scheduling call",i.method),this.scheduleExecution();return}return this.options.verbose&&console.log("Forwarded call",i.method),n(i,s)},this.run=async function(){r.options.verbose&&console.log("Processing multicall");const n=Math.min(r.options.batchSize,r.queue.length);if(n===0){r.options.verbose&&console.log("Skip multicall, empty queue");return}if(n===1){r.forward(r.queue[0]),r.queue=[],r.options.verbose&&console.log("Skip multicall, single item");return}r.options.verbose&&console.log("Resolving",n);var a=r.queue.slice(0,n);r.queue=n===r.queue.length?[]:r.queue.slice(n),r.options.verbose&&console.log("Updated queue",r.queue.length),r.queue.length!==0&&(r.options.verbose&&console.log("Scheduling next batch"),r.scheduleExecution());const i=a[0].next;let s;var[a,c]=z_(a,h=>{try{if(h.next!==i)return!1;switch(h.request.method){case Dr.ethCall:if(h.request.params[0].from||h.request.params[0].gasPrice||h.request.params[0].value)return!1;case Dr.ethGetBalance:case Dr.ethGetCode:const p=a1e(h.request.params[1]);if(s===void 0&&(s=p),!c1e(p,s))return!1}return!0}catch{return!1}});if(c.length!==0&&(r.options.verbose&&console.log("Forwarding incompatible calls",c.length),r.forward(c),a.length===0)){r.options.verbose&&console.log("Skip multicall, all calls are incompatible");return}let o=a.map(h=>{try{switch(h.request.method){case Dr.ethCall:return{delegateCall:!1,revertOnError:!1,target:h.request.params[0].to,data:h.request.params[0].data,gasLimit:h.request.params[0].gas?h.request.params[0].gas:0,value:0};case Dr.ethGetCode:return{delegateCall:!1,revertOnError:!1,target:r.options.contract,gasLimit:0,value:0,data:r.multicallInterface.encodeFunctionData(r.multicallInterface.getFunction("callCode"),[h.request.params[0]])};case Dr.ethGetBalance:return{delegateCall:!1,revertOnError:!1,target:r.options.contract,gasLimit:0,value:0,data:r.multicallInterface.encodeFunctionData(r.multicallInterface.getFunction("callBalanceOf"),[h.request.params[0]])};default:return null}}catch{return null}});var[a,c]=z_(a,(h,p)=>o[p]!==void 0);if(o=o.filter(h=>h),c.length!==0&&(r.options.verbose&&console.log("Forwarding calls on error",c.length),r.forward(c),a.length===0)){r.options.verbose&&console.log("Skip multicall, all calls had encoding errors");return}let l;try{r.options.verbose&&console.log("Encoding multicall"),l=r.multicallInterface.encodeFunctionData(r.multicallInterface.getFunction("multiCall"),[o])}catch(h){r.options.verbose&&console.warn("Error encoding multicall, forwarding one by one",h),r.forward(a);return}const u=t4(),f=await o1e(e4(i)({id:u,jsonrpc:ud,method:Dr.ethCall,params:[{to:r.options.contract,value:0,data:l},Z.isBigNumber(s)?s.toNumber():s]}),h=>({jsonrpc:ud,id:u,result:void 0,error:h}));if(f.error)return r.options.verbose&&console.warn("Error calling multicall, forwarding one by one",f.error),r.forward(a);let d;try{d=r.multicallInterface.decodeFunctionResult(r.multicallInterface.getFunction("multiCall"),f.result)}catch(h){r.options.verbose&&console.warn("Error decoding multicall result, forwarding one by one",h),r.forward(a);return}r.options.verbose&&console.log("Got response for",a.length),a.forEach((h,p)=>{if(!d[0][p])r.options.verbose&&console.warn(`Multicall error for ${h.request.method} not found`),r.forward(h);else switch(h.request.method){case Dr.ethCall:h.callback(void 0,{jsonrpc:h.request.jsonrpc,id:h.request.id,result:d[1][p]});break;case Dr.ethGetCode:h.callback(void 0,{jsonrpc:h.request.jsonrpc,id:h.request.id,result:zn.decode(["bytes"],d[1][p])[0]});break;case Dr.ethGetBalance:h.callback(void 0,{jsonrpc:h.request.jsonrpc,id:h.request.id,result:zn.decode(["uint256"],d[1][p])[0]});break}})},this.options=e?Wy({},Hi.DefaultOptions,e):Hi.DefaultOptions,this.options.batchSize<=0)throw new Error(`Invalid batch size of ${this.options.batchSize}`)}forward(e){Array.isArray(e)?e.forEach(r=>r.next(r.request,r.callback)):e.next(e.request,e.callback)}static isMulticall(e){return e&&e.handle!==void 0&&e.conf!==void 0&&Hi.isMulticallOptions(e.options)}static isMulticallOptions(e){return e!==void 0&&e.batchSize!==void 0&&e.timeWindow!==void 0&&e.contract!==void 0}}Hi.DefaultOptions=Wy({},l1e);const yj=["getNetwork","getBlockNumber","getGasPrice","getTransactionCount","getStorageAt","sendTransaction","estimateGas","getBlock","getTransaction","getTransactionReceipt","getLogs","emit","litenerCount","addListener","removeListener","waitForTransaction","detectNetwork","getBlockWithTransactions"];class u1e extends rb{constructor(e,r){var n;super(e.getNetwork()),n=this,this.provider=e,this.multicall=void 0,this.getResolver=async function(i){const s=n.provider;if(s.getResolver){const o=await s.getResolver(await i);return o?new l6(n,o.address,o.name):null}return s.getResolver(await i)},this.next=async function(i,s){try{switch(i.method){case Dr.ethCall:n.callback(i,s,await n.provider.call(i.params[0],i.params[1]));break;case Dr.ethGetCode:n.callback(i,s,await n.provider.getCode(i.params[0],i.params[1]));break;case Dr.ethGetBalance:n.callback(i,s,await n.provider.getBalance(i.params[0],i.params[1]));break}}catch(o){n.callback(i,s,void 0,o)}},this.listenerCount=e.listenerCount.bind(e),this.multicall=Hi.isMulticall(r)?r:new Hi(r),yj.forEach(i=>{e[i]!==void 0&&(this[i]=(...s)=>e[i](...s))})}callback(e,r,n,i){r(i,{jsonrpc:ud,id:e.id,result:n,error:i})}async call(e,r){return this.rpcCall(Dr.ethCall,e,r)}async getCode(e,r){return this.rpcCall(Dr.ethGetCode,e,r)}async getBalance(e,r){return this.rpcCall(Dr.ethGetBalance,e,r)}async rpcCall(e,...r){const n=t4();return(await e4(this.multicall.handle)(this.next,{jsonrpc:ud,id:n,method:e,params:r})).result}}class f1e{constructor(e,r){if(this.provider=e,this.multicall=void 0,this.multicall=Hi.isMulticall(r)?r:new Hi(r),e.send){const n=async function(s,o){e.send(s,o)};this.send=(i,s)=>{this.multicall.handle(n,i,s)}}if(e.sendAsync){const n=async function(s,o){e.sendAsync(s,o)};this.sendAsync=(i,s)=>{this.multicall.handle(n,i,s)}}}get isMetaMask(){return this.provider.isMetaMask}get isStatus(){return this.provider.isStatus}}const d1e=t=>e=>{const r=Hi.isMulticall(t)?t:new Hi(t);return(n,i)=>r.handle(e,n,i)};var h1e=Object.freeze({__proto__:null,ProxyMethods:yj,MulticallProvider:u1e,MulticallExternalProvider:f1e,multicallMiddleware:d1e});const p1e=Object.freeze(Object.defineProperty({__proto__:null,Multicall:Hi,providers:h1e},Symbol.toStringTag,{value:"Module"}));var gj={exports:{}};/*! - * EventEmitter2 - * https://github.com/hij1nx/EventEmitter2 - * - * Copyright (c) 2013 hij1nx - * Licensed under the MIT license. - */(function(t,e){(function(r){var n=Object.hasOwnProperty,i=Array.isArray?Array.isArray:function(N){return Object.prototype.toString.call(N)==="[object Array]"},s=10,o=typeof process=="object"&&typeof process.nextTick=="function",a=typeof Symbol=="function",c=typeof Reflect=="object",l=typeof setImmediate=="function",u=l?setImmediate:setTimeout,f=a?c&&typeof Reflect.ownKeys=="function"?Reflect.ownKeys:function(_){var N=Object.getOwnPropertyNames(_);return N.push.apply(N,Object.getOwnPropertySymbols(_)),N}:Object.keys;function d(){this._events={},this._conf&&h.call(this,this._conf)}function h(_){_&&(this._conf=_,_.delimiter&&(this.delimiter=_.delimiter),_.maxListeners!==r&&(this._maxListeners=_.maxListeners),_.wildcard&&(this.wildcard=_.wildcard),_.newListener&&(this._newListener=_.newListener),_.removeListener&&(this._removeListener=_.removeListener),_.verboseMemoryLeak&&(this.verboseMemoryLeak=_.verboseMemoryLeak),_.ignoreErrors&&(this.ignoreErrors=_.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function p(_,N){var L="(node) warning: possible EventEmitter memory leak detected. "+_+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(L+=" Event name: "+N+"."),typeof process<"u"&&process.emitWarning){var R=new Error(L);R.name="MaxListenersExceededWarning",R.emitter=this,R.count=_,process.emitWarning(R)}else console.error(L),console.trace&&console.trace()}var v=function(_,N,L){var R=arguments.length;switch(R){case 0:return[];case 1:return[_];case 2:return[_,N];case 3:return[_,N,L];default:for(var E=new Array(R);R--;)E[R]=arguments[R];return E}};function m(_,N){for(var L={},R,E=_.length,M=N?N.length:0,j=0;j0;)_=M[U],j.call(T,_,L[_]);this._listeners={},this._listenersCount=0,W()}}});function y(_,N,L,R){var E=Object.assign({},N);if(!_)return E;if(typeof _!="object")throw TypeError("options must be an object");var M=Object.keys(_),j=M.length,T,U,W;function V(J){throw Error('Invalid "'+T+'" option value'+(J?". Reason: "+J:""))}for(var G=0;G0;)if(T===_[U])return M;j(N)}}var A=C(["function"]),O=C(["object","function"]);function w(_,N,L){var R,E,M=0,j,T=new _(function(U,W,V){L=y(L,{timeout:0,overload:!1},{timeout:function(X,ae){return X*=1,(typeof X!="number"||X<0||!Number.isFinite(X))&&ae("timeout must be a positive number"),X}}),R=!L.overload&&typeof _.prototype.cancel=="function"&&typeof V=="function";function G(){E&&(E=null),M&&(clearTimeout(M),M=0)}var J=function(X){G(),U(X)},Y=function(X){G(),W(X)};R?N(J,Y,V):(E=[function(X){Y(X||Error("canceled"))}],N(J,Y,function(X){if(j)throw Error("Unable to subscribe on cancel event asynchronously");if(typeof X!="function")throw TypeError("onCancel callback must be a function");E.push(X)}),j=!0),L.timeout>0&&(M=setTimeout(function(){var X=Error("timeout");X.code="ETIMEDOUT",M=0,T.cancel(X),W(X)},L.timeout))});return R||(T.cancel=function(U){if(E){for(var W=E.length,V=1;V0;)Y=Pe[T],Y!=="_listeners"&&(ct=B(_,N,L[Y],R+1,E),ct&&(J?J.push.apply(J,ct):J=ct));return J}else if(tt==="**"){for(ue=R+1===E||R+2===E&&Oe==="*",ue&&L._listeners&&(J=B(_,N,L,E,E)),Pe=f(L),T=Pe.length;T-- >0;)Y=Pe[T],Y!=="_listeners"&&(Y==="*"||Y==="**"?(L[Y]._listeners&&!ue&&(ct=B(_,N,L[Y],E,E),ct&&(J?J.push.apply(J,ct):J=ct)),ct=B(_,N,L[Y],R,E)):Y===Oe?ct=B(_,N,L[Y],R+2,E):ct=B(_,N,L[Y],R,E),ct&&(J?J.push.apply(J,ct):J=ct));return J}else L[tt]&&(J=B(_,N,L[tt],R+1,E));if(X=L["*"],X&&B(_,N,X,R+1,E),ae=L["**"],ae)if(R0;)Y=Pe[T],Y!=="_listeners"&&(Y===Oe?B(_,N,ae[Y],R+2,E):Y===tt?B(_,N,ae[Y],R+1,E):(oe={},oe[Y]=ae[Y],B(_,N,{"**":oe},R+1,E)));else ae._listeners?B(_,N,ae,E,E):ae["*"]&&ae["*"]._listeners&&B(_,N,ae["*"],E,E);return J}function z(_,N,L){var R=0,E=0,M,j=this.delimiter,T=j.length,U;if(typeof _=="string")if((M=_.indexOf(j))!==-1){U=new Array(5);do U[R++]=_.slice(E,M),E=M+T;while((M=_.indexOf(j,E))!==-1);U[R++]=_.slice(E)}else U=[_],R=1;else U=_,R=_.length;if(R>1){for(M=0;M+10&&W._listeners.length>this._maxListeners&&(W._listeners.warned=!0,p.call(this,W._listeners.length,V))):W._listeners=N,!0;return!0}function H(_,N,L,R){for(var E=f(_),M=E.length,j,T,U,W=_._listeners,V;M-- >0;)T=E[M],j=_[T],T==="_listeners"?U=L:U=L?L.concat(T):[T],V=R||typeof T=="symbol",W&&N.push(V?U:U.join(this.delimiter)),typeof j=="object"&&H.call(this,j,N,U,V);return N}function K(_){for(var N=f(_),L=N.length,R,E,M;L-- >0;)E=N[L],R=_[E],R&&(M=!0,E!=="_listeners"&&!K(R)&&delete _[E]);return M}function F(_,N,L){this.emitter=_,this.event=N,this.listener=L}F.prototype.off=function(){return this.emitter.off(this.event,this.listener),this};function x(_,N,L){if(L===!0)E=!0;else if(L===!1)R=!0;else{if(!L||typeof L!="object")throw TypeError("options should be an object or true");var R=L.async,E=L.promisify,M=L.nextTick,j=L.objectify}if(R||M||E){var T=N,U=N._origin||N;if(M&&!o)throw Error("process.nextTick is not supported");E===r&&(E=N.constructor.name==="AsyncFunction"),N=function(){var W=arguments,V=this,G=this.event;return E?M?Promise.resolve():new Promise(function(J){u(J)}).then(function(){return V.event=G,T.apply(V,W)}):(M?process.nextTick:u)(function(){V.event=G,T.apply(V,W)})},N._async=!0,N._origin=U}return[N,j?new F(this,_,N):this]}function P(_){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,h.call(this,_)}P.EventEmitter2=P,P.prototype.listenTo=function(_,N,L){if(typeof _!="object")throw TypeError("target musts be an object");var R=this;L=y(L,{on:r,off:r,reducers:r},{on:A,off:A,reducers:O});function E(M){if(typeof M!="object")throw TypeError("events must be an object");var j=L.reducers,T=I.call(R,_),U;T===-1?U=new g(R,_,L):U=R._observers[T];for(var W=f(M),V=W.length,G,J=typeof j=="function",Y=0;Y0;)E=L[R],(!_||E._target===_)&&(E.unsubscribe(N),M=!0);return M},P.prototype.delimiter=".",P.prototype.setMaxListeners=function(_){_!==r&&(this._maxListeners=_,this._conf||(this._conf={}),this._conf.maxListeners=_)},P.prototype.getMaxListeners=function(){return this._maxListeners},P.prototype.event="",P.prototype.once=function(_,N,L){return this._once(_,N,!1,L)},P.prototype.prependOnceListener=function(_,N,L){return this._once(_,N,!0,L)},P.prototype._once=function(_,N,L,R){return this._many(_,1,N,L,R)},P.prototype.many=function(_,N,L,R){return this._many(_,N,L,!1,R)},P.prototype.prependMany=function(_,N,L,R){return this._many(_,N,L,!0,R)},P.prototype._many=function(_,N,L,R,E){var M=this;if(typeof L!="function")throw new Error("many only accepts instances of Function");function j(){return--N===0&&M.off(_,j),L.apply(this,arguments)}return j._origin=L,this._on(_,j,R,E)},P.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||d.call(this);var _=arguments[0],N,L=this.wildcard,R,E,M,j,T;if(_==="newListener"&&!this._newListener&&!this._events.newListener)return!1;if(L&&(N=_,_!=="newListener"&&_!=="removeListener"&&typeof _=="object")){if(E=_.length,a){for(M=0;M3)for(R=new Array(U-1),j=1;j3)for(E=new Array(W-1),T=1;T0&&this._events[_].length>this._maxListeners&&(this._events[_].warned=!0,p.call(this,this._events[_].length,_))):this._events[_]=N,E)},P.prototype.off=function(_,N){if(typeof N!="function")throw new Error("removeListener only takes instances of Function");var L,R=[];if(this.wildcard){var E=typeof _=="string"?_.split(this.delimiter):_.slice();if(R=B.call(this,null,E,this.listenerTree,0),!R)return this}else{if(!this._events[_])return this;L=this._events[_],R.push({_listeners:L})}for(var M=0;M0){for(R=this._all,N=0,L=R.length;N0;)R=N[L[M]],typeof R=="function"?E.push(R):E.push.apply(E,R);return E}else{if(this.wildcard){if(j=this.listenerTree,!j)return[];var T=[],U=typeof _=="string"?_.split(this.delimiter):_.slice();return B.call(this,T,U,j,0),T}return N?(R=N[_],R?typeof R=="function"?[R]:R:[]):[]}},P.prototype.eventNames=function(_){var N=this._events;return this.wildcard?H.call(this,this.listenerTree,[],null,_):N?f(N):[]},P.prototype.listenerCount=function(_){return this.listeners(_).length},P.prototype.hasListeners=function(_){if(this.wildcard){var N=[],L=typeof _=="string"?_.split(this.delimiter):_.slice();return B.call(this,N,L,this.listenerTree,0),N.length>0}var R=this._events,E=this._all;return!!(E&&E.length||R&&(_===r?f(R).length:R[_]))},P.prototype.listenersAny=function(){return this._all?this._all:[]},P.prototype.waitFor=function(_,N){var L=this,R=typeof N;return R==="number"?N={timeout:N}:R==="function"&&(N={filter:N}),N=y(N,{timeout:0,filter:r,handleError:!1,Promise,overload:!1},{filter:A,Promise:b}),w(N.Promise,function(E,M,j){function T(){var U=N.filter;if(!(U&&!U.apply(L,arguments)))if(L.off(_,T),N.handleError){var W=arguments[0];W?M(W):E(v.apply(null,arguments).slice(1))}else E(v.apply(null,arguments))}j(function(){L.off(_,T)}),L._on(_,T,!1)},{timeout:N.timeout,overload:N.overload})};function $(_,N,L){L=y(L,{Promise,timeout:0,overload:!1},{Promise:b});var R=L.Promise;return w(R,function(E,M,j){var T;if(typeof _.addEventListener=="function"){T=function(){E(v.apply(null,arguments))},j(function(){_.removeEventListener(N,T)}),_.addEventListener(N,T,{once:!0});return}var U=function(){W&&_.removeListener("error",W),E(v.apply(null,arguments))},W;N!=="error"&&(W=function(V){_.removeListener(N,U),M(V)},_.once("error",W)),j(function(){W&&_.removeListener("error",W),_.removeListener(N,U)}),_.once(N,U)},{timeout:L.timeout,overload:L.overload})}var D=P.prototype;Object.defineProperties(P,{defaultMaxListeners:{get:function(){return D._maxListeners},set:function(_){if(typeof _!="number"||_<0||Number.isNaN(_))throw TypeError("n must be a non-negative number");D._maxListeners=_},enumerable:!0},once:{value:$,writable:!0,configurable:!0}}),Object.defineProperties(D,{_maxListeners:{value:s,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),typeof r=="function"&&r.amd?r(function(){return P}):t.exports=P})()})(gj);var Wb=gj.exports;function W_(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function bj(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function Hy(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function wj(t,e){bj(t);const r=e.outputLen;if(t.lengtht instanceof Uint8Array,v1e=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),vx=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),js=(t,e)=>t<<32-e|t>>>e,m1e=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!m1e)throw new Error("Non little-endian hardware is not supported");const y1e=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function g1e(t){if(!xj(t))throw new Error("Uint8Array expected");let e="";for(let r=0;rt().update(T4(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function w1e(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),s=BigInt(4294967295),o=Number(r>>i&s),a=Number(r&s),c=n?4:0,l=n?0:4;t.setUint32(e+c,o,n),t.setUint32(e+l,a,n)}class x1e extends Ej{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=vx(this.buffer)}update(e){Hy(this);const{view:r,buffer:n,blockLen:i}=this;e=T4(e);const s=e.length;for(let o=0;oi-o&&(this.process(n,0),o=0);for(let f=o;fu.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;ft&e^~t&r,C1e=(t,e,r)=>t&e^t&r^e&r,S1e=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),$a=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ma=new Uint32Array(64);class k1e extends x1e{constructor(){super(64,32,8,!1),this.A=$a[0]|0,this.B=$a[1]|0,this.C=$a[2]|0,this.D=$a[3]|0,this.E=$a[4]|0,this.F=$a[5]|0,this.G=$a[6]|0,this.H=$a[7]|0}get(){const{A:e,B:r,C:n,D:i,E:s,F:o,G:a,H:c}=this;return[e,r,n,i,s,o,a,c]}set(e,r,n,i,s,o,a,c){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,r){for(let f=0;f<16;f++,r+=4)Ma[f]=e.getUint32(r,!1);for(let f=16;f<64;f++){const d=Ma[f-15],h=Ma[f-2],p=js(d,7)^js(d,18)^d>>>3,v=js(h,17)^js(h,19)^h>>>10;Ma[f]=v+Ma[f-7]+p+Ma[f-16]|0}let{A:n,B:i,C:s,D:o,E:a,F:c,G:l,H:u}=this;for(let f=0;f<64;f++){const d=js(a,6)^js(a,11)^js(a,25),h=u+d+E1e(a,c,l)+S1e[f]+Ma[f]|0,v=(js(n,2)^js(n,13)^js(n,22))+C1e(n,i,s)|0;u=l,l=c,c=a,a=o+h|0,o=s,s=i,i=n,n=h+v|0}n=n+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,l=l+this.G|0,u=u+this.H|0,this.set(n,i,s,o,a,c,l,u)}roundClean(){Ma.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const A1e=Cj(()=>new k1e);var _1e=class{constructor(t,e){st(this,"hostname");st(this,"fetch");st(this,"path","/rpc/Databeat/");st(this,"ping",(t,e)=>this.fetch(this.url("Ping"),Ch({},t,e)).then(r=>Sh(r).then(n=>({status:n.status})),r=>{throw Qu.new({cause:`fetch(): ${r.message||""}`})}));st(this,"version",(t,e)=>this.fetch(this.url("Version"),Ch({},t,e)).then(r=>Sh(r).then(n=>({version:n.version})),r=>{throw Qu.new({cause:`fetch(): ${r.message||""}`})}));st(this,"runtimeStatus",(t,e)=>this.fetch(this.url("RuntimeStatus"),Ch({},t,e)).then(r=>Sh(r).then(n=>({status:n.status})),r=>{throw Qu.new({cause:`fetch(): ${r.message||""}`})}));st(this,"tick",(t,e,r)=>this.fetch(this.url("Tick"),Ch(t,e,r)).then(n=>Sh(n).then(i=>({ok:i.ok})),n=>{throw Qu.new({cause:`fetch(): ${n.message||""}`})}));st(this,"rawEvents",(t,e,r)=>this.fetch(this.url("RawEvents"),Ch(t,e,r)).then(n=>Sh(n).then(i=>({ok:i.ok})),n=>{throw Qu.new({cause:`fetch(): ${n.message||""}`})}));this.hostname=t,this.fetch=(r,n)=>e(r,n)}url(t){return this.hostname+this.path+t}},Ch=(t={},e={},r=null)=>({method:"POST",headers:{...e,"Content-Type":"application/json"},body:JSON.stringify(t||{}),signal:r}),Sh=t=>t.text().then(e=>{let r;try{r=JSON.parse(e)}catch(n){let i="";throw n instanceof Error&&(i=n.message),Ij.new({status:t.status,cause:`JSON.parse(): ${i}: response text: ${e}`})}if(!t.ok){const n=typeof r.code=="number"?r.code:0;throw(H1e[n]||Hr).new(r)}return r}),Hr=class Sj extends Error{constructor(r,n,i,s,o){super(i);st(this,"name");st(this,"code");st(this,"message");st(this,"status");st(this,"cause");st(this,"msg");this.name=r||"WebrpcError",this.code=typeof n=="number"?n:0,this.message=i||`endpoint error ${this.code}`,this.msg=this.message,this.status=typeof s=="number"?s:0,this.cause=o,Object.setPrototypeOf(this,Sj.prototype)}static new(r){return new this(r.error,r.code,r.message||r.msg,r.status,r.cause)}},P1e=class kj extends Hr{constructor(e="WebrpcEndpoint",r=0,n="endpoint error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,kj.prototype)}},Qu=class Aj extends Hr{constructor(e="WebrpcRequestFailed",r=-1,n="request failed",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Aj.prototype)}},T1e=class _j extends Hr{constructor(e="WebrpcBadRoute",r=-2,n="bad route",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,_j.prototype)}},I1e=class Pj extends Hr{constructor(e="WebrpcBadMethod",r=-3,n="bad method",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Pj.prototype)}},O1e=class Tj extends Hr{constructor(e="WebrpcBadRequest",r=-4,n="bad request",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Tj.prototype)}},Ij=class Oj extends Hr{constructor(e="WebrpcBadResponse",r=-5,n="bad response",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Oj.prototype)}},R1e=class Rj extends Hr{constructor(e="WebrpcServerPanic",r=-6,n="server panic",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Rj.prototype)}},$1e=class $j extends Hr{constructor(e="WebrpcInternalError",r=-7,n="internal error",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,$j.prototype)}},M1e=class Mj extends Hr{constructor(e="WebrpcClientDisconnected",r=-8,n="client disconnected",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Mj.prototype)}},N1e=class Nj extends Hr{constructor(e="WebrpcStreamLost",r=-9,n="stream lost",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Nj.prototype)}},D1e=class Dj extends Hr{constructor(e="WebrpcStreamFinished",r=-10,n="stream finished",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Dj.prototype)}},L1e=class Lj extends Hr{constructor(e="Unauthorized",r=1e3,n="Unauthorized access",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Lj.prototype)}},B1e=class Bj extends Hr{constructor(e="PermissionDenied",r=2e3,n="Permission denied",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Bj.prototype)}},F1e=class Fj extends Hr{constructor(e="SessionExpired",r=2001,n="Session expired",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Fj.prototype)}},j1e=class jj extends Hr{constructor(e="NotFound",r=3e3,n="Resource not found",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,jj.prototype)}},U1e=class Uj extends Hr{constructor(e="InvalidAppKey",r=4e3,n="Invalid app key",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Uj.prototype)}},z1e=class zj extends Hr{constructor(e="QueryFailed",r=4001,n="DB query failed",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,zj.prototype)}},W1e=class Wj extends Hr{constructor(e="InvalidProjectId",r=4002,n="Invalid project id",i=0,s){super(e,r,n,i,s),Object.setPrototypeOf(this,Wj.prototype)}},H1e={0:P1e,[-1]:Qu,[-2]:T1e,[-3]:I1e,[-4]:O1e,[-5]:Ij,[-6]:R1e,[-7]:$1e,[-8]:M1e,[-9]:N1e,[-10]:D1e,1e3:L1e,2e3:B1e,2001:F1e,3e3:j1e,4e3:U1e,4001:z1e,4002:W1e},H_=typeof global=="object"?global.fetch:window.fetch,q1e=class extends _1e{constructor(e,r){super(e.endsWith("/")?e.slice(0,-1):e,H_);st(this,"_fetch",(e,r)=>{var n;if(this.auth){let i={};((n=this.auth.jwt)==null?void 0:n.length)>0&&(i.Authorization=`BEARER ${this.auth.jwt}`),this.auth.headers&&(i={...i,...this.auth.headers}),r.headers={...r.headers,...i}}return H_(e,r)});this.auth=r,this.fetch=this._fetch}},q_=150,ul={defaultEnabled:!0,noop:!1,privacy:{userIdHash:!0,userAgentSalt:!1},userIdentTracking:!1,strictMode:!1,flushInterval:500,initProps:()=>({})},V1e=class{constructor(t,e,r){st(this,"rpc");st(this,"auth");st(this,"options");st(this,"enabled");st(this,"ident");st(this,"userId");st(this,"sessionId");st(this,"allowUserTracking");st(this,"projectId");st(this,"queue");st(this,"flushTimeout");st(this,"defaultProps");st(this,"previousPageKey");st(this,"ts");st(this,"flush",async()=>{if(this.flushTimeout!==null&&(clearTimeout(this.flushTimeout),this.flushTimeout=null),!this.enabled||this.options.noop||this.options.strictMode&&!this.allowUserTracking||this.queue.length===0)return;const t=this.dedupedQueue();this.queue=[];try{await this.rpc.tick({events:t})}catch(e){console.warn(`databeat flush failed: ${e}`)}});st(this,"dedupedQueue",()=>{const t=new Map;for(let e=0;eq_&&(this.queue=this.queue.splice(this.queue.length-q_)),this.enabled&&(e&&e.flush?await this.flush():this.flushTimeout===null&&(this.flushTimeout=setTimeout(()=>{this.flush()},this.options.flushInterval)))}trackView(t={}){const e={...this.defaultProps,...t},r=G_(),n=`${r}:${JSON.stringify(e)}:${this.userId}:${this.sessionId}`;this.previousPageKey!==n&&(this.previousPageKey=n,this.track({event:"VIEW",source:r,props:e}))}isEnabled(){return this.enabled}isAnon(){return this.ident===0}getIdent(){return this.ident}getUserId(){return this.userId}getSessionId(){return this.sessionId}getStorageTS(){if(this.ts)return this.ts;const t=h3();if(!(t==null||t.id===null))return this.ts=t.ts,this.ts}enable(){if(!Hj(this.auth)){this.enabled=!1;return}zo()&&(this.enabled=!0,this.ts=Nu({on:this.enabled,id:this.userId,it:this.ident,ut:this.allowUserTracking}),this.identify())}disable(){zo()&&(this.enabled=!1,this.ts=Nu({on:this.enabled,id:this.userId,it:this.ident,ut:this.allowUserTracking}))}},zo=()=>typeof window=="object"&&typeof window.localStorage=="object"&&typeof window.localStorage.getItem=="function"&&typeof window.localStorage.setItem=="function",V_=(t,e)=>{if(!Hj(e))return!1;if(!zo())return!0;const r=h3();return r===null?t??!0:r.on},Hj=t=>{var e;return!!(((e=t==null?void 0:t.jwt)==null?void 0:e.length)>0||t!=null&&t.headers&&Object.keys(t.headers).length>0)},G_=()=>{try{return window.location.pathname}catch{return""}},G1e=()=>{if(!zo())return{};const t=new URL(window.location.href).searchParams,e={};return e.origin=window.location.origin,t.get("ref")&&t.get("ref")!==""&&(e.ref=t.get("ref")||""),t.get("source")&&t.get("source")!==""&&(e.source=t.get("source")||""),t.get("utm_source")&&t.get("utm_source")!==""&&(e.utmSource=t.get("utm_source")||""),t.get("utm_campaign")&&t.get("utm_campaign")!==""&&(e.utmCampaign=t.get("utm_campaign")||""),t.get("utm_medium")&&t.get("utm_medium")!==""&&(e.utmMedium=t.get("utm_medium")||""),t.get("utm_content")&&t.get("utm_content")!==""&&(e.utmContent=t.get("utm_content")||""),t.get("utm_term")&&t.get("utm_term")!==""&&(e.utmTerm=t.get("utm_term")||""),document.referrer&&document.referrer!==""&&(e.referrer=document.referrer),e},qy="_dbeat",h3=()=>{try{return JSON.parse(window.localStorage.getItem(qy))}catch{return null}},Nu=t=>{try{return t.ts||(t.ts=Math.floor(Date.now()/1e3)),window.localStorage.setItem(qy,JSON.stringify(t)),t.ts}catch{return}},K1e=(t,e,r)=>{if(!t||t===null||t==="")return{userId:`${Math.floor(Math.random()*1e14)}`,ident:0};if(r.userIdentTracking&&e)return{userId:t,ident:2};if(r.privacy.userIdHash===!0||!r.userIdentTracking||!e)return zo()&&r.privacy.userAgentSalt===!0&&(t=t+":"+navigator.userAgent),r.privacy.extraSalt&&r.privacy.extraSalt.length>0&&(t=t+":"+r.privacy.extraSalt),{userId:g1e(A1e(t)).substring(0,50),ident:1};throw new Error("invalid configuration")},Q1e=()=>{if(zo()&&typeof window.sessionStorage=="object"&&typeof window.sessionStorage.getItem=="function"&&typeof window.sessionStorage.setItem=="function"){const e=window.sessionStorage.getItem(qy);if(e&&e.length>0)return e;{const r=K_(16);return window.sessionStorage.setItem(qy,r),r}}else return K_(16)},K_=t=>{let e="";for(let r=0;r++Y1e;class fp{constructor(){var e=this;this.pendingMessageRequests=[],this.responseCallbacks=new Map,this.state=void 0,this.confirmationOnly=!1,this.events=new Wb.EventEmitter2,this.openPayload=void 0,this.connectPayload=void 0,this.accountsChangedPayload=void 0,this.networksPayload=void 0,this.walletContextPayload=void 0,this._sessionId=void 0,this._init=void 0,this._registered=void 0,this.sendAsync=async function(r,n,i){e.state===Ni.CLOSED&&(e.confirmationOnly=!0),e.openWallet(void 0,{type:"jsonRpcRequest",method:r.method},i);try{e.isOpened()||await e.waitUntilOpened();const s=await e.sendMessageRequest({idx:Kj(),type:Ye.MESSAGE,data:r,chainId:i});n(void 0,s.data)}catch(s){n(s)}},this.sendMessageRequest=async function(r){return new Promise((n,i)=>{(!r.idx||r.idx<=0)&&r.type!=="init"&&i(new Error("message idx not set"));const s=(a,c)=>{if(a)i(a);else if(c)n(c);else throw new Error("no valid response to return")},o=r.idx;e.responseCallbacks.get(o)?i(new Error("duplicate message idx, should never happen")):e.responseCallbacks.set(o,s),e.isOpened()?e.sendMessage(r):(ge.debug("pushing to pending requests",r),e.pendingMessageRequests.push(r))})},this.waitUntilOpened=async function(r=I4){let n=!1;return Promise.race([new Promise((i,s)=>{const o=setTimeout(()=>{clearTimeout(o),n||(e.state=Ni.CLOSED,e.events.emit("close",{code:1005,message:"opening wallet timed out"})),s(new Error("opening wallet timed out"))},r)}),new Promise(i=>{if(e.isOpened()){var s;n=!0,i((s=e.openPayload)==null?void 0:s.session);return}e.events.once("open",o=>{e.openPayload=o,n=!0,i(o.session)})})])},this.waitUntilConnected=async function(){await e.waitUntilOpened();const r=new Promise(i=>{if(e.connectPayload){i(e.connectPayload);return}e.events.once("connect",s=>{e.connectPayload=s,i(s)})}),n=new Promise((i,s)=>{e.events.once("close",o=>{s(o?new Error(`wallet closed due to ${JSON.stringify(o)}`):new Error("user closed the wallet"))})});return Promise.race([r,n])},this.state=Ni.CLOSED,this._registered=!1,this._init=qt.NIL}get registered(){return this._registered}register(){throw new Error("abstract method")}unregister(){throw new Error("abstract method")}openWallet(e,r,n){throw new Error("abstract method")}closeWallet(){throw new Error("abstract method")}isOpened(){return this.registered&&this.state===Ni.OPENED}isConnected(){var e;const r=(e=this.openPayload)==null?void 0:e.session;return this.registered&&r!==void 0&&!!r.accountAddress&&r.accountAddress.length===42&&!!r.networks&&r.networks.length>0}handleMessage(e){var r=this;if(e.type===Ye.INIT){ge.debug("MessageProvider, received INIT message",e);const{nonce:c}=e.data;if(!c||c.length==0){ge.error("invalid init nonce");return}this._init=qt.OK,this.sendMessage({idx:-1,type:Ye.INIT,data:{sessionId:this._sessionId,nonce:c}})}if(this._init!==qt.OK)return;ge.debug("RECEIVED MESSAGE FROM WALLET",e.idx,e);const n=e.idx,i=this.responseCallbacks.get(n);if(n&&this.responseCallbacks.delete(n),e.type===Ye.OPEN&&!this.isOpened()){var s,o;if(this._sessionId&&this._sessionId!==((s=e.data)==null?void 0:s.sessionId)){ge.debug("open event received from wallet, but does not match sessionId",this._sessionId);return}if((o=e.data)!=null&&o.error){var a;const c=new Error(`opening wallet failed: received ${(a=e.data)==null?void 0:a.error}`);throw ge.error(c),this.close(),c}this.state=Ni.OPENED,this.openPayload=e.data,this.events.emit("open",this.openPayload),this.pendingMessageRequests.length!==0&&this.pendingMessageRequests.splice(0,this.pendingMessageRequests.length).forEach(async function(l){r.sendMessage(l)});return}if(e.type===Ye.MESSAGE){if(this.confirmationOnly&&setTimeout(()=>{this.responseCallbacks.size===0&&this.closeWallet()},500),!i)throw new Error("impossible state");if(i){this.events.emit("message",e),i(e.data.error,e);return}}if(e.type===Ye.ACCOUNTS_CHANGED){this.accountsChangedPayload={accounts:[]},e.data&&e.data.length>0?(this.accountsChangedPayload={accounts:[Ie(e.data[0])],origin:e.origin},this.events.emit("accountsChanged",this.accountsChangedPayload.accounts,this.accountsChangedPayload.origin)):this.events.emit("accountsChanged",[],e.origin);return}if(e.type===Ye.CHAIN_CHANGED){this.events.emit("chainChanged",e.data,e.origin);return}if(e.type===Ye.NETWORKS){this.networksPayload=e.data,this.events.emit("networks",this.networksPayload);return}if(e.type===Ye.WALLET_CONTEXT){this.walletContextPayload=e.data,this.events.emit("walletContext",this.walletContextPayload);return}e.type===Ye.CLOSE&&this.state!==Ni.CLOSED&&this.close(e.data),e.type===Ye.CONNECT&&(this.connectPayload=e.data,this.events.emit("connect",this.connectPayload)),e.type===Ye.DISCONNECT&&this.isConnected()&&(this.events.emit("disconnect",e.data,e.origin),this.close())}sendMessage(e){throw new Error("abstract method")}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}emit(e,...r){return this.events.emit(e,...r)}close(e){this.state!==Ni.CLOSED&&(this.state=Ni.CLOSED,this.confirmationOnly=!1,this._sessionId=void 0,ge.info("closing wallet and flushing!"),this.pendingMessageRequests.length=0,this.responseCallbacks.forEach(r=>{r(Zn({},new Error("wallet closed"),{code:4001}))}),this.responseCallbacks.clear(),this.connectPayload=void 0,this.openPayload=void 0,this.accountsChangedPayload=void 0,this.networksPayload=void 0,this.walletContextPayload=void 0,this.events.emit("close",e))}}function J1e(t){return X1e.some(e=>e.predicate(t))}const X1e=[{name:"Decentraland Exception",predicate:epe},{name:"0x v3 Exception",predicate:tpe}],Z1e=/^Decentraland Login\nEphemeral address: 0x[a-fA-F0-9]{40}\nExpiration: (\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)((-(\d{2}):(\d{2})|Z)?)$/;function epe(t){try{const e=ya(t);return Z1e.test(e)}catch{return!1}}function tpe(t){const e=new $r(rpe);try{return e.decodeFunctionData("OrderWithHash",t),!0}catch{return!1}}const rpe=[{inputs:[{components:[{internalType:"address",name:"makerAddress",type:"address"},{internalType:"address",name:"takerAddress",type:"address"},{internalType:"address",name:"feeRecipientAddress",type:"address"},{internalType:"address",name:"senderAddress",type:"address"},{internalType:"uint256",name:"makerAssetAmount",type:"uint256"},{internalType:"uint256",name:"takerAssetAmount",type:"uint256"},{internalType:"uint256",name:"makerFee",type:"uint256"},{internalType:"uint256",name:"takerFee",type:"uint256"},{internalType:"uint256",name:"expirationTimeSeconds",type:"uint256"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes",name:"makerAssetData",type:"bytes"},{internalType:"bytes",name:"takerAssetData",type:"bytes"},{internalType:"bytes",name:"makerFeeAssetData",type:"bytes"},{internalType:"bytes",name:"takerFeeAssetData",type:"bytes"}],internalType:"struct IEIP1271Data.Order",name:"order",type:"tuple"},{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderWithHash",outputs:[],stateMutability:"pure",type:"function"}],pm=vt(`Ethereum Signed Message: -`),Qj=t=>va(t)||Ue(t)?re(t):vt(t),Hb=t=>{const e=Qj(t);return J1e(e)?e:ht([pm,vt(String(e.length)),e])},npe=t=>{if(JSON.stringify(t.slice(0,pm.length))!==JSON.stringify(pm))return t;const e=t.slice(pm.length),r=String(e.length).length;let n,i;try{i=Number(ya(e.slice(0,r)))}catch{i=Number(te(e.slice(0,r)))}return i>e.length||!Number.isInteger(i)?n=r-1:n=r,e.slice(n)},dd=async(t,e,r,n)=>new de.reader.OnChainReader(n).isValidSignature(t,e,r),Yj=async(t,e,r,n)=>{const i=Hb(e),s=ZC(i);return dd(t,s,r,n)},Jj=(t,e,r,n)=>dd(t,sp(e),r,n),Vy=()=>window.location.protocol==="chrome-extension:"||window.location.protocol==="moz-extension:",Xj=()=>!!navigator.userAgent.match(/UnitySequence/i),Zj=t=>t.onChain.deployed&&t.fullyMigrated;class eU{constructor(){this.callbacks=[],this.store={}}getItem(e){return this.store[e]||null}setItem(e,r){this.store[e]=r,this.callbacks.filter(n=>n.key===e).forEach(n=>n.cb(r))}removeItem(e){delete this.store[e]}onItemChange(e,r){return this.callbacks.push({key:e,cb:r}),()=>{this.callbacks=this.callbacks.filter(n=>n.cb!==r)}}}class d1{static isAvailable(){return typeof window=="object"&&typeof window.localStorage=="object"}constructor(){if(this.callbacks=[],!d1.isAvailable())throw new Error("LocalStorage is not available");window.addEventListener("storage",e=>{const{key:r}=e;this.callbacks.filter(i=>i.key===r).forEach(i=>i.cb(this.getItem(r)))})}getItem(e){return window.localStorage.getItem(e)}setItem(e,r){window.localStorage.setItem(e,r),this.callbacks.filter(n=>n.key===e).forEach(n=>n.cb(r))}removeItem(e){window.localStorage.removeItem(e),this.callbacks.filter(r=>r.key===e).forEach(r=>r.cb(null))}onItemChange(e,r){return this.callbacks.push({key:e,cb:r}),()=>{this.callbacks=this.callbacks.filter(n=>n.cb!==r)}}}function Gy(){return d1.isAvailable()?new d1:new eU}async function tU(t){return Array.isArray(t)?Promise.all(t.map(e=>mt(e))):mt(t)}const Q_="@sequence.transportSession";class dp{constructor(e){var r=this;this.walletRequestHandler=void 0,this._sessionId=void 0,this._registered=void 0,this._init=void 0,this._initNonce=void 0,this._initCallback=void 0,this.appOrigin=void 0,this.sendAsync=async function(n,i,s){throw new Error("abstract method")},this.handleMessage=async function(n){const i=n;if(r._init!==qt.OK){if(i.type===Ye.INIT)if(r.isValidInitAck(n))r._initCallback&&r._initCallback();else{r._initCallback&&r._initCallback("invalid init");return}return}switch(i.type){case Ye.OPEN:{if(r._init!==qt.OK)return;const s={sessionId:i.data.sessionId,intent:i.data.intent,networkId:i.data.networkId};await r.open(s);return}case Ye.CLOSE:return r._init!==qt.OK,void 0;case Ye.MESSAGE:{const s=await r.walletRequestHandler.sendMessageRequest(i);r.sendMessage(s),s.data.error;return}default:ge.error(`unexpected payload type ${i.type}`)}},this.sendMessageRequest=async function(n){return r.walletRequestHandler.sendMessageRequest(n)},this.open=async function({sessionId:n,intent:i,networkId:s}){n&&(r._sessionId=UB(n),r.saveTransportSession({sessionId:n,intent:i,networkId:s})),r.walletRequestHandler.setOpenIntent(i),await r.init();let o;try{if(s){const a=n4(s);if(a)o=a.chainId;else throw new Error(`unknown network ${s}`)}else o=r.walletRequestHandler.defaultChainId()}catch(a){console.error(a)}if(i&&i.type==="connect"&&i.options){const a=i.options,c=a;if(r.appOrigin&&c!=null&&c.origin){if(!Vy()&&c.origin!==r.appOrigin)throw new Error("origin is invalid")}else!r.appOrigin&&c!=null&&c.origin?a.origin=WB(c.origin):r.appOrigin&&(a.origin=r.appOrigin);a.app&&(a.app=zB(a.app)),a.networkId?s=a.networkId:s&&(a.networkId=s),r.walletRequestHandler.setConnectOptions(a)}else r.walletRequestHandler.setConnectOptions(void 0);if(await r.walletRequestHandler.getAccount(),await r.walletRequestHandler.isSignedIn())if(i&&i.type==="connect"){(!o||o<=0)&&console.log("Failed to set default network on open"),r.notifyOpen({sessionId:r._sessionId});try{const a=await r.walletRequestHandler.promptConnect(i.options);a.connected&&r.walletRequestHandler.notifyConnect(a)}catch(a){ge.warn("promptConnect not connected:",a)}finally{(!i.options||i.options.keepWalletOpened!==!0)&&r.notifyClose()}}else{if(!o||o<=0)return r.notifyOpen({sessionId:r._sessionId,error:`failed to open wallet on network ${s}`}),!1;r.notifyOpen({sessionId:r._sessionId,chainId:`${o}`,session:await r.walletRequestHandler.walletSession(o)})}else return r.notifyOpen({sessionId:r._sessionId}),!0;return!0},this.saveTransportSession=n=>{Gy().setItem(Q_,JSON.stringify(n))},this.getCachedTransportSession=async function(){const n=Gy().getItem(Q_);try{return n?JSON.parse(n):null}catch{return console.error(`unable to parse transport session: ${n}`),null}},this.walletRequestHandler=e,this._init=qt.NIL,this.walletRequestHandler.on("connect",n=>{this.registered&&this.notifyConnect(n)}),this.walletRequestHandler.on("disconnect",(n,i)=>{this.registered&&this.notifyDisconnect(n,i)}),this.walletRequestHandler.on("accountsChanged",(n,i)=>{this.registered&&this.notifyAccountsChanged(n,i)}),this.walletRequestHandler.on("networks",n=>{this.registered&&(this.notifyNetworks(n),!n||n.length===0?this.notifyChainChanged("0x0"):this.notifyChainChanged(As(n.find(i=>i.isDefaultChain).chainId)))}),this.walletRequestHandler.on("chainChanged",(n,i)=>{this.notifyChainChanged(n,i)}),this.walletRequestHandler.on("walletContext",n=>{!this.registered||!n||this.notifyWalletContext(n)}),this.walletRequestHandler.on("close",n=>{this.registered&&this.notifyClose(n)})}get registered(){return this._registered}register(){throw new Error("abstract method")}unregister(){throw new Error("abstract method")}sendMessage(e){throw new Error("abstract method")}notifyOpen(e){const{chainId:r,sessionId:n,session:i,error:s}=e;this.sendMessage({idx:-1,type:Ye.OPEN,data:{chainId:r,sessionId:n,session:i,error:s}})}notifyClose(e){this.sendMessage({idx:-1,type:Ye.CLOSE,data:e?{error:e}:null})}notifyConnect(e){this.sendMessage({idx:-1,type:Ye.CONNECT,data:e})}notifyDisconnect(e,r){this.sendMessage({idx:-1,type:Ye.DISCONNECT,data:e?{error:e}:null,origin:r})}notifyAccountsChanged(e,r){this.sendMessage({idx:-1,type:Ye.ACCOUNTS_CHANGED,data:e,origin:r})}notifyChainChanged(e,r){this.sendMessage({idx:-1,type:Ye.CHAIN_CHANGED,data:e,origin:r})}notifyNetworks(e){this.sendMessage({idx:-1,type:Ye.NETWORKS,data:e})}notifyWalletContext(e){this.sendMessage({idx:-1,type:Ye.WALLET_CONTEXT,data:e})}isValidInitAck(e){if(this._init===qt.OK)return ge.warn("isValidInitAck, already in init'd state, so inquiry is invalid."),!1;if(e.type!==Ye.INIT)return ge.warn("isValidInitAck, invalid message type, expecting init"),!1;const{sessionId:r,nonce:n}=e.data;return!r||r.length===0||!n||n.length===0?(ge.error("invalid init ack"),!1):r!==this._sessionId||n!==this._initNonce?(ge.error("invalid init ack match"),!1):!0}init(){return new Promise((e,r)=>{if(this._init===qt.OK){e();return}if(this._init!==qt.NIL||this._initCallback){r("transport init is in progress");return}const n=setTimeout(()=>{ge.warn("transport init timed out"),this._initCallback&&this._initCallback("transport init timed out")},I4/2);this._initCallback=i=>{this._initCallback=void 0,clearTimeout(n),i?r(i):(this._init=qt.OK,e())},this._initNonce=`${performance.now()}`,this.sendMessage({idx:-1,type:Ye.INIT,data:{nonce:this._initNonce}}),this._init=qt.SENT_NONCE})}}class ipe{constructor(){this.app=void 0,this.wallet=void 0;const e=new p3,r=new p3;e.conn=r,r.conn=e,this.app=e,this.wallet=r}}class p3{constructor(){this.conn=void 0,this.events=new Wb.EventEmitter2,this.handleMessage=e=>{throw new Error("ProxyMessageChannelPort is not registered")},this.sendMessage=e=>{this.conn.handleMessage(e),e.type==="open"&&this.events.emit("open",e),e.type==="close"&&this.events.emit("close",e),e.type==="connect"&&this.events.emit("connect",e),e.type==="disconnect"&&this.events.emit("disconnect",e)}}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}}class rU extends fp{constructor(e){if(super(),this.port=void 0,this.register=()=>{this.port.handleMessage=r=>{this.handleMessage(r)},this.on("open",(...r)=>{this.port.events.emit("open",...r)}),this.on("close",(...r)=>{this.port.events.emit("close",...r)}),this.on("connect",(...r)=>{this.port.events.emit("connect",...r)}),this.on("disconnect",(...r)=>{this.port.events.emit("disconnect",...r)}),this._registered=!0},this.unregister=()=>{this._registered=!1,this.closeWallet(),this.events.removeAllListeners(),this.port.handleMessage=void 0},this.openWallet=(r,n,i)=>{if(this.state===Ni.CLOSED){this.state=Ni.OPENING;const s=`${performance.now()}`;this._sessionId=s,this.sendMessage({idx:-1,type:Ye.OPEN,data:{path:r,intent:n,networkId:i,sessionId:s}})}},this.state=Ni.CLOSED,this.port=e,!e)throw new Error("port argument cannot be empty");this._init=qt.OK}closeWallet(){this.sendMessage({idx:-1,type:Ye.CLOSE,data:null}),this.close()}sendMessage(e){if(!e.idx)throw new Error("message idx is empty");this.port.sendMessage(e)}}class spe extends dp{constructor(e,r){super(e),this.port=void 0,this.port=r,this._init=qt.OK}register(){this.port.handleMessage=e=>{this.handleMessage(e)},this._registered=!0}async restoreSession(){const e=await this.getCachedTransportSession();e&&this.open(e)}unregister(){this.port.handleMessage=void 0,this._registered=!1}sendMessage(e){this.port.sendMessage(e)}}function nU(t){var e;if((e=window.ue)!=null&&e.sequencewallettransport&&!window.logsOverriddenForUnreal){var r;const n=(r=window.ue)==null?void 0:r.sequencewallettransport;console.log=(...i)=>{n.logfromjs(`${t}: ${mx(i)}`)},console.warn=(...i)=>{n.warnfromjs(`${t}: ${mx(i)}`)},console.error=(...i)=>{n.errorfromjs(`${t}: ${mx(i)}`)},window.logsOverriddenForUnreal=!0}}function mx(t){return t.map(e=>typeof e=="object"?e instanceof Error?e.message:JSON.stringify(e):String(e)).join(" ")}let Du;class iU extends fp{constructor(e){super(),this.walletURL=void 0,this.register=()=>{var r;nU("dapp"),Du&&(Du.unregister(),Du=this),(r=window.ue)!=null&&r.sequencewallettransport&&(window.ue.sequencewallettransport.onmessagefromwallet=this.onUnrealCallback),Du=this,this._registered=!0,console.log("registering transport!")},this.unregister=()=>{var r;this._registered=!1,this.closeWallet(),Du===this&&(Du=void 0),((r=window.ue)==null||(r=r.sequencewallettransport)==null?void 0:r.onmessagefromwallet)===this.onUnrealCallback&&delete window.ue.sequencewallettransport.onmessagefromwallet,this.events.removeAllListeners()},this.openWallet=(r,n,i)=>{if(this.isOpened()){console.log("wallet already open!");return}console.log("opening wallet!");const s=new URL(this.walletURL.href),o=new up;r&&(s.pathname=r.toLowerCase()),this._init=qt.NIL,this._sessionId=`${performance.now()}`,o.set("sid",this._sessionId),n&&o.set("intent",JC(n)),i&&o.set("net",`${i}`),s.search=o.toString(),console.log("opening wallet to",s.href),window.open(s.href)},this.onUnrealCallback=r=>{if(!r)throw new Error("ProviderMessage object is empty");this.handleMessage(r)},this.walletURL=new URL(e)}closeWallet(){this.close()}sendMessage(e){var r;const n=typeof e!="string"?JSON.stringify(e):e;console.log("Sending message to wallet:",n),(r=window.ue)==null||(r=r.sequencewallettransport)==null||r.sendmessagetowallet(n)}}class ope extends dp{constructor(e){super(e),this.onMessageFromUnreal=r=>{ge.debug("RECEIVED MESSAGE",r),this.handleMessage(r)},this.getUnrealTransportSession=r=>{const n=new up(r);return{sessionId:n.get("sid"),networkId:n.get("net"),intent:XC(n.get("intent"))}},this._init=qt.NIL}async register(e){var r;if(((r=window.ue)==null?void 0:r.sequencewallettransport)===void 0)return;nU("wallet");const{search:n}=new URL(e||window.location.href);let i=this.getUnrealTransportSession(n);if(!!i.sessionId||(i=await this.getCachedTransportSession()),!i){ge.error("unreal session is undefined");return}window.ue.sequencewallettransport.onmessagefromsequencejs=this.onMessageFromUnreal,this._registered=!0,this.open(i).then(o=>{if(!o){var a;const c=`failed to open to network ${(a=i)==null?void 0:a.networkId}`;ge.error(c),this.notifyClose({message:c}),window.close()}}).catch(o=>{var a;const c=`failed to open to network ${(a=i)==null?void 0:a.networkId}, due to: ${o}`;ge.error(c),this.notifyClose({message:c}),window.close()})}unregister(){var e;((e=window.ue)==null||(e=e.sequencewallettransport)==null?void 0:e.onmessagefromsequencejs)===this.onMessageFromUnreal&&delete window.ue.sequencewallettransport.onmessagefromsequencejs,this._registered=!1}sendMessage(e){var r;if(e.type!==Ye.INIT&&this._init!==qt.OK){ge.error("impossible state, should not be calling postMessage until inited");return}const n=JSON.stringify(e);(r=window.ue)==null||(r=r.sequencewallettransport)==null||r.sendmessagetosequencejs(n)}}const O4="sequence-extension-message-handler";class ape extends dp{constructor(e,r){super(e),this.runtime=r,this.port=void 0,this._init=qt.OK}register(){this._registered=!0,this.port=this.runtime.connect({name:O4})}sendMessage(e){ge.info("[ExtensionMessageHandler send]",e),this.port.postMessage(e)}}class sU extends fp{constructor(e){super(),this.register=()=>{this._registered=!0},e.onConnect.addListener(r=>{r.name===O4&&(this._init=qt.OK,r.onMessage.addListener(n=>{this.handleMessage(n)}))})}sendMessage(e){}unregister(){}openWallet(e,r,n){}closeWallet(){}}class cpe extends Wb.EventEmitter2{constructor(e){var r;super(),r=this,this.stream=e,this.responseCallbacks=new Map,this._messageIdx=0,this.nextMessageIdx=()=>++this._messageIdx,this.handleMessage=n=>{if(!n.type||!n.data)return;ge.info("[received message]",n);const i=n.idx,s=this.responseCallbacks.get(i);switch(i&&this.responseCallbacks.delete(i),n.type){case Ye.MESSAGE:if(s)this.emit(Ye.MESSAGE,n),s(n.data.error,n);else throw new Error("impossible state");break;case Ye.DISCONNECT:case Ye.ACCOUNTS_CHANGED:case Ye.CHAIN_CHANGED:this.emit(n.type,n.data);break;default:console.error("unknown message type",n);break}},this.sendMessageRequest=async function(n){return new Promise((i,s)=>{(!n.idx||n.idx<=0)&&s(new Error("message idx not set"));const o=(c,l)=>{if(c)s(c);else if(l)i(l);else throw new Error("no valid response to return")},{idx:a}=n;r.responseCallbacks.get(a)?s(new Error("duplicate message idx, should never happen")):r.responseCallbacks.set(a,o),r.sendMessage(n)})},this.stream.on("data",this.handleMessage)}sendMessage(e){this.stream.writable||console.error("window post message stream is not writable"),this.stream.write(e)}}let Lu;class oU extends fp{constructor(e){super(),this.walletURL=void 0,this.walletWindow=void 0,this.register=()=>{Lu&&(Lu.unregister(),Lu=this),window.addEventListener("message",this.onWindowEvent),Lu=this,this.on("open",()=>{const r=this.walletWindow,n=setInterval(()=>{r&&r.closed&&(clearInterval(n),this.close())},500)}),this.on("close",()=>{this.walletWindow&&(this.walletWindow.close(),this.walletWindow=null)}),this._registered=!0},this.unregister=()=>{this._registered=!1,this.closeWallet(),Lu===this&&(Lu=void 0),window.removeEventListener("message",this.onWindowEvent),this.events.removeAllListeners()},this.openWallet=(r,n,i)=>{if(this.walletWindow&&this.isOpened()){this.walletWindow.focus();return}const s=new URL(this.walletURL.href),o=new up;r&&r!==""&&(s.pathname=r.toLowerCase()),this._init=qt.NIL,this._sessionId=`${performance.now()}`,o.set("sid",this._sessionId),n&&(n.type==="connect"&&(n.options||(n.options={app:window.location.origin}),!Vy()&&!Xj()&&n.options&&(n.options.origin=window.location.origin)),o.set("intent",JC(n))),i&&o.set("net",`${i}`);let a,c;Vy()?(a=[450,750],c=[Math.abs(window.screen.width/2-a[0]/2),Math.abs(window.screen.height/2-a[1]/2)]):(a=[450,750],c=[Math.abs(window.screenX+window.innerWidth/2-a[0]/2),Math.abs(window.screenY+window.innerHeight/2-a[1]/2)]);const l=`toolbar=0,location=0,menubar=0,scrollbars=yes,status=yes,width=${a[0]},height=${a[1]},left=${c[0]},top=${c[1]}`;s.search=o.toString(),this.walletWindow=window.open(s.href,"sequence.app",l)},this.onWindowEvent=r=>{if(r.origin!==this.walletURL.origin)return;let n;try{n=JSON.parse(r.data)}catch{return}if(!n)throw new Error("ProviderMessage object is empty");this.handleMessage(n)},this.walletURL=new URL(e)}closeWallet(){var e;this.close(),(e=this.walletWindow)==null||e.close()}sendMessage(e){if(!this.walletWindow){ge.warn("WindowMessageProvider: sendMessage failed as walletWindow is unavailable");return}const r=typeof e!="string"?JSON.stringify(e):e;this.walletWindow.postMessage(r,this.walletURL.origin)}}class lpe extends dp{constructor(e){var r;super(e),r=this,this.parentWindow=void 0,this._isPopup=!1,this.onWindowEvent=async function(n){if(!n.origin||n.origin===""||r.appOrigin&&n.origin!==r.appOrigin)return;let i;try{i=JSON.parse(n.data)}catch{return}if(ge.debug("RECEIVED MESSAGE",i),r._init!==qt.OK&&r.isValidInitAck(i)&&(r.appOrigin=n.origin),r._init===qt.OK&&(!r.appOrigin||r.appOrigin.length<8)){ge.error("impossible state, init.OK and appOrigin required");return}r.handleMessage(i)},this.getWindowTransportSession=n=>{const i=new up(n);return{sessionId:i.get("sid"),networkId:i.get("net"),intent:XC(i.get("intent"))}},this._init=qt.NIL}async register(e){const r=parent.window.opener!==null;if(this._isPopup=r,r!==!0)return;const{pathname:n,search:i}=new URL(e||window.location.href);let s=this.getWindowTransportSession(i);if(!!s.sessionId||(s=await this.getCachedTransportSession()),!s){ge.error("window session is undefined");return}this.parentWindow=parent.window.opener,window.addEventListener("message",this.onWindowEvent,!1),this._registered=!0,this.open(s).then(a=>{if(!a){var c;const l=`failed to open to network ${(c=s)==null?void 0:c.networkId}`;ge.error(l),this.notifyClose({message:l}),window.close()}}).catch(a=>{var c;const l=`failed to open to network ${(c=s)==null?void 0:c.networkId}, due to: ${a}`;ge.error(l),this.notifyClose({message:l}),window.close()})}unregister(){window.removeEventListener("message",this.onWindowEvent),this._registered=!1}sendMessage(e){const r=JSON.stringify(e);e.type===Ye.INIT?this.postMessage(r,!0):this.postMessage(r)}get isPopup(){return this._isPopup}postMessage(e,r=!1){if(r!==!0&&this._init!==qt.OK){ge.error("impossible state, should not be calling postMessage until inited");return}r?this.parentWindow.postMessage(e,"*"):this.appOrigin&&this.appOrigin.length>4?this.parentWindow.postMessage(e,this.appOrigin):ge.error("unable to postMessage as parentOrigin is invalid")}}function aU(t){return t&&typeof t=="object"&&(t.windowTransport&&typeof t.windowTransport=="object"||t.proxyTransport&&typeof t.proxyTransport=="object"||t.extensionTransport&&typeof t.extensionTransport=="object"||t.unrealTransport&&typeof t.unrealTransport=="object")&&(t.windowTransport&&t.windowTransport.enabled||t.proxyTransport&&t.proxyTransport.enabled||t.extensionTransport&&t.extensionTransport.enabled||t.unrealTransport&&t.unrealTransport.enabled)}class qb{constructor(...e){var r=this;this.messageProviders=void 0,this.provider=void 0,this.register=()=>{if(this.messageProviders.length===1){this.provider=this.messageProviders[0],this.provider.register();return}this.messageProviders.forEach(n=>{n.register(),n.once("open",()=>{this.provider||(this.provider=n,this.messageProviders.forEach(i=>{this.provider!==i&&i.unregister()}))})})},this.unregister=()=>{this.messageProviders.forEach(n=>n.unregister()),this.provider=void 0},this.openWallet=(n,i,s)=>{if(this.provider){this.provider.openWallet(n,i,s);return}this.messageProviders.forEach(o=>o.openWallet(n,i,s))},this.sendAsync=async function(n,i,s){if(r.provider){r.provider.sendAsync(n,i,s);return}throw new Error("impossible state, wallet must be opened first")},this.sendMessageRequest=async function(n){if(r.provider)return r.provider.sendMessageRequest(n);throw new Error("impossible state, wallet must be opened first")},this.waitUntilOpened=async function(){return r.provider?r.provider.waitUntilOpened():Promise.race(r.messageProviders.map(n=>n.waitUntilOpened()))},this.waitUntilConnected=async function(){if(r.provider)return r.provider.waitUntilConnected();throw new Error("impossible state, wallet must be opened first")},this.messageProviders=e,this.provider=void 0}static new(e){var r,n,i,s;const o=new qb;if((r=e.windowTransport)!=null&&r.enabled&&typeof window=="object"&&e.walletAppURL){const a=new oU(e.walletAppURL);o.add(a)}if((n=e.proxyTransport)!=null&&n.enabled){const a=new rU(e.proxyTransport.appPort);o.add(a)}if((i=e.extensionTransport)!=null&&i.enabled){const a=new sU(e.extensionTransport.runtime);o.add(a)}if((s=e.unrealTransport)!=null&&s.enabled&&e.windowTransport&&e.walletAppURL){const a=new iU(e.walletAppURL);o.add(a)}return o.register(),o}add(...e){this.messageProviders.push(...e)}closeWallet(){this.provider&&this.provider.closeWallet()}isOpened(){return this.provider?this.provider.isOpened():!1}isConnected(){return this.provider?this.provider.isConnected():!1}on(e,r){if(this.provider){this.provider.on(e,r);return}this.messageProviders.forEach(n=>{n.on(e,r)})}once(e,r){if(this.provider){this.provider.once(e,r);return}this.messageProviders.forEach(n=>{n.once(e,r)})}emit(e,...r){if(this.provider)return this.provider.emit(e,...r);for(let n=0;ndpe(t,i))}function dpe(t,e){if(e.to.toLowerCase()===t.toLowerCase()&&e.data){const r=re(e.data);if(r.length>=4&&!hpe(r))throw new Error("self calls are forbidden")}if(e.delegateCall)throw new Error("delegate calls are forbidden")}function hpe(t){const e=new $r(Xr.mainModule.abi);try{return e.decodeFunctionData("createContract",t),!0}catch{return!1}}const ppe=1e4;class vpe{constructor(e,r,n){var i=this;this.account=void 0,this.signerReadyCallbacks=[],this.prompter=void 0,this.networks=void 0,this._openIntent=void 0,this._connectOptions=void 0,this.events=new Wb.EventEmitter2,this.onConnectOptionsChange=void 0,this.promptConnect=async function(s){if(!s&&!i._connectOptions)throw new Error("prompter connect options are empty");if(!i.prompter)return i.connect(s);const o=await i.prompter.promptConnect(s||i._connectOptions).catch(c=>({connected:!1})),a=o;return a.connected&&!a.session&&(a.session=await i.walletSession(s==null?void 0:s.networkId)),o},this.sendAsync=async function(s,o,a){const c={jsonrpc:"2.0",id:s.id,result:null};await i.getAccount();try{var l;if((!i.account||i.account===null)&&!mpe.includes(s.method))throw Gj;const f=i.account;if(!f)throw new Error("WalletRequestHandler: wallet account is not configured");const d=(l=i.account)==null?void 0:l.providerFor(a??i.defaultChainId());if(!d)throw new Error(`WalletRequestHandler: wallet provider is not configured for chainId ${a}`);const h=d instanceof ta?d:void 0;switch(s.method){case"net_version":{if(!h)throw new Error("Account provider doesn't support send method");const p=await h.send("net_version",[]);c.result=p;break}case"eth_chainId":{if(!h)throw new Error("Account provider doesn't support send method");const p=await h.send("eth_chainId",[]);c.result=p;break}case"eth_accounts":{const p=f.address;c.result=[p];break}case"eth_getBalance":{const[p,v]=s.params,m=await d.getBalance(p,v);c.result=m.toHexString();break}case"sequence_sign":case"personal_sign":case"eth_sign":{let p;switch(s.method){case"sequence_sign":case"personal_sign":{const[y,b]=s.params;p=y;break}case"eth_sign":{const[y,b]=s.params;p=b;break}}let v="";const m=Hb(p),g=s.method==="sequence_sign";if(i.prompter===null?v=await f.signMessage(m,a??i.defaultChainId(),g?"eip6492":"ignore"):v=await i.prompter.promptSignMessage({chainId:a,message:m,eip6492:g},i.connectOptions),v&&v.length>0)c.result=v;else throw new Error("declined by user");break}case"sequence_signTypedData_v4":case"eth_signTypedData":case"eth_signTypedData_v4":{const[p,v]=s.params;let m;if(typeof v=="string")try{m=JSON.parse(v)}catch(b){console.warn("walletRequestHandler: error parsing typedData",b)}else m=v;if(!m||!m.domain||!m.types||!m.message)throw new Error("invalid typedData object");let g="";const y=s.method==="sequence_signTypedData_v4";if(i.prompter===null?g=await f.signTypedData(m.domain,m.types,m.message,a??i.defaultChainId(),y?"eip6492":"ignore"):g=await i.prompter.promptSignMessage({chainId:a,typedData:m,eip6492:y},i.connectOptions),g&&g.length>0)c.result=g;else throw new Error("declined by user");break}case"eth_sendTransaction":{const p=fpe(s.params[0]).map(m=>("gas"in m&&m.gasLimit===void 0&&(m.gasLimit=m.gas,delete m.gas),m));Y_(f.address,p);let v="";if(i.prompter===null){var u;const m=await f.sendTransaction(p,a??i.defaultChainId());v=(u=m==null?void 0:m.hash)!=null?u:""}else v=await i.prompter.promptSendTransaction(p,a,i.connectOptions);if(v)c.result=v;else throw new Error("declined by user");break}case"eth_signTransaction":{const[p]=s.params;if(Ie(p.from)!==f.address)throw new Error("sender address does not match wallet");Y_(f.address,p),i.prompter===null?c.result=await f.signTransactions(p,a??i.defaultChainId()):c.result=await i.prompter.promptSignTransaction(p,a,i.connectOptions);break}case"eth_sendRawTransaction":{if(de.transaction.isSignedTransactionBundle(s.params[0])){const p=Z.from(s.params[0].chainId).toNumber(),v=await f.relayer(p).relay(s.params[0]);c.result=v.hash}else{const p=await d.sendTransaction(s.params[0]);c.result=p.hash}break}case"eth_getTransactionCount":{const p=Ie(s.params[0]),v=s.params[1],m=await d.getTransactionCount(p,v);c.result=Z.from(m).toHexString();break}case"eth_blockNumber":{c.result=await d.getBlockNumber();break}case"eth_getBlockByNumber":{c.result=await d.getBlock(s.params[0]);break}case"eth_getBlockByHash":{c.result=await d.getBlock(s.params[0]);break}case"eth_getTransactionByHash":{c.result=await d.getTransaction(s.params[0]);break}case"eth_call":{const[p,v]=s.params;c.result=await d.call(p,v);break}case"eth_getCode":{const[p,v]=s.params;c.result=await d.getCode(p,v);break}case"eth_estimateGas":{const[p]=s.params;c.result=await d.estimateGas(p);break}case"eth_gasPrice":{const p=await d.getGasPrice();c.result=p.toHexString();break}case"wallet_switchEthereumChain":{const[p]=s.params;if(!p.chainId||p.chainId.length===0)throw new Error("invalid chainId");const v=Z.from(p.chainId);i.setDefaultChainId(v.toNumber()),c.result=null;break}case"sequence_getWalletContext":{c.result=f.contexts;break}case"sequence_getWalletConfig":{const[p]=s.params;p?c.result=[(await f.status(p)).onChain.config]:c.result=await Promise.all(f.networks.map(async function(v){return(await f.status(v.chainId)).onChain.config}));break}case"sequence_getWalletState":{const[p]=s.params;p?c.result=[J_(p,await f.status(p))]:c.result=await Promise.all(f.networks.map(async function(v){const m=await f.status(v.chainId);return J_(v.chainId,m)}));break}case"sequence_getNetworks":{c.result=await i.getNetworks(!0);break}case"sequence_isSequence":{c.result=!0;break}case"sequence_updateConfig":throw new Error("sequence_updateConfig method is not allowed from a dapp");case"sequence_publishConfig":throw new Error("sequence_publishConfig method is not allowed from a dapp");case"sequence_gasRefundOptions":break;case"sequence_getNonce":break;case"sequence_relay":break;case"sequence_setDefaultNetwork":{const[p]=s.params;if(!p)throw new Error("invalid request, method argument defaultChainId cannot be empty");i.setDefaultChainId(p),c.result=await i.getNetworks(!0);break}default:{if(!h)throw new Error("Account provider doesn't support send method");const p=await h.send(s.method,s.params);c.result=p}}}catch(f){ge.error(f),c.result=null,c.error=Zn({},new Error(f),{code:4001})}o(void 0,c)},this.isSignedIn=async function(){return await i.signerReady(),!!i.account},this.getAccount=async function(){if(await i.signerReady(),i.account===void 0)throw new Error("signerReady failed resolve");return i.account},this.account=e,this.prompter=r,this.networks=n}defaultChainId(){var e,r;return(e=(r=this.prompter)==null?void 0:r.getDefaultChainId())!=null?e:this.networks[0].chainId}async signIn(e,r={}){this.setAccount(e);const{connect:n,defaultNetworkId:i}=r;if(n){const a=this._connectOptions;let c;if(this.prompter!==null){var s;c=await((s=this.prompter)==null?void 0:s.promptSignInConnect(a))}else c=await this.connect(a);this.notifyConnect(c),(!a||a.keepWalletOpened!==!0)&&this.notifyClose()}if(i&&this.defaultChainId()!==i){var o;await((o=this.prompter)==null?void 0:o.promptChangeNetwork(i))}}signOut(){this.account&&this.notifyDisconnect(),this.setAccount(null)}signerReset(){this.account=void 0}signerReady(e=ppe){return new Promise((r,n)=>{this.account!==void 0?r():(setTimeout(()=>{this.account===void 0&&(this.signerReadyCallbacks=[],n("signerReady timed out"))},e),this.signerReadyCallbacks.push(r))})}async connect(e){var r,n;if(!this.account)return{connected:!1,chainId:"0x0",error:"unable to connect without signed in account"};const i=(r=(n=e==null?void 0:e.networkId)!=null?n:this.defaultChainId())!=null?r:se.MAINNET,s=n4(i).chainId,o={connected:!0,chainId:As(s)};if(e&&e.authorize){const a={app:e.app,origin:e.origin,expiry:e.expiry,nonce:e.authorizeNonce};try{o.proof=await lj(this.account,s,a)}catch(c){return ge.warn(`connect, signAuthorization failed for options: ${JSON.stringify(e)}, due to: ${c.message}`),{connected:!1,chainId:"0x0",error:`signAuthorization failed: ${c.message}`}}}return o.session=this.walletSession(s),o}sendMessageRequest(e){return new Promise(r=>{this.sendAsync(e.data,(n,i)=>{const s=Zn({},e,{data:i});r(s)},e.chainId)})}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}async getAddress(){var e,r;return(e=(r=this.account)==null?void 0:r.address)!=null?e:""}get openIntent(){return this._openIntent}setOpenIntent(e){this._openIntent=e}get connectOptions(){return this._connectOptions}setConnectOptions(e){var r;this._connectOptions=e,(r=this.onConnectOptionsChange)==null||r.call(this,e)}async setDefaultChainId(e){var r;return await((r=this.prompter)==null?void 0:r.promptChangeNetwork(e)),this.defaultChainId()}async getNetworks(e){return this.account?e?this.account.networks.map(r=>{const n=Zn({},r);return n.provider=void 0,n.relayer=void 0,n}):this.account.networks:(ge.warn("signer not set: getNetworks is returning an empty list"),[])}walletSession(e){if(!this.account)return;const r={walletContext:this.account.contexts,accountAddress:this.account.address,networks:this.account.networks.map(i=>Zn({},i,{provider:void 0,relayer:void 0}))};if(e){const i=_s(r.networks,e);if(i){var n;(n=r.networks)==null||n.forEach(s=>delete s.isDefaultChain),i.isDefaultChain=!0}}return r}notifyConnect(e,r){var n;if(console.log("emit connect",e),this.events.emit("connect",e),(n=e.session)!=null&&n.accountAddress){var i;this.events.emit("accountsChanged",[(i=e.session)==null?void 0:i.accountAddress],r)}}notifyDisconnect(e){this.events.emit("accountsChanged",[],e),this.events.emit("disconnect",void 0,e)}notifyChainChanged(e,r){this.events.emit("chainChanged",As(e),r)}async notifyNetworks(e){const r=e||await this.getNetworks(!0);if(this.events.emit("networks",r),r.length>0){const n=r.find(i=>i.chainId===this.defaultChainId());n&&this.events.emit("chainChanged",As(n.chainId))}else this.events.emit("chainChanged","0x0")}async notifyWalletContext(){if(!this.account){ge.warn("signer not set: skipping to notify wallet context");return}const e=this.account.contexts;this.events.emit("walletContext",e)}notifyClose(e){this.events.emit("close",e)}setAccount(e){if(this.account=e,e!==void 0){for(let r=0;rc.canOnchainValidate||c.original.version===2&&n,o=await r.status(i);if(s(o))return!0;if(await e.promptConfirmWalletDeploy(i,this.connectOptions)){const c=await r.status(i);return s(c)?!0:(ge.error("WalletRequestHandler: result for promptConfirmWalletDeploy is not correct"),!1)}return!1}}function J_(t,e){return{context:e.original.context,config:e.onChain.config,address:de.context.addressOf(e.original.context,e.original.imageHash),chainId:t,deployed:e.onChain.deployed,imageHash:e.imageHash,lastImageHash:e.onChain.imageHash,published:!0,status:e}}const mpe=["net_version","eth_chainId","eth_getBalance","eth_getTransactionCount","eth_blockNumber","eth_getBlockByNumber","eth_getBlockByHash","eth_getTransactionByHash","eth_getCode","eth_estimateGas","eth_gasPrice","sequence_getWalletContext","sequence_getNetworks","sequence_setDefaultNetwork"];class Fd{get utils(){return this.provider.utils}constructor(e,r){this.client=e,this.provider=r,this.singleNetworkSigners={},this._isSigner=!0,this._isSequenceSigner=!0}async getAddress(){return this.client.getAddress()}connect(e){if(!jd.is(e))throw new Error("SequenceSigner can only be connected to a SequenceProvider");return new Fd(this.client,e)}getSigner(e){if(!e)return this;const r=this.provider.toChainId(e);return this.singleNetworkSigners[r]||(this.singleNetworkSigners[r]=new R4(this.client,this.provider,r)),this.singleNetworkSigners[r]}useChainId(e){return this.provider.toChainId(e)||this.client.getChainId()}async signMessage(e,r){const{eip6492:n=!0}=r||{},i=this.useChainId(r==null?void 0:r.chainId);return this.client.signMessage(e,{eip6492:n,chainId:i})}async signTypedData(e,r,n,i){const{eip6492:s=!0}=i||{},o=this.useChainId(i==null?void 0:i.chainId);return this.client.signTypedData({domain:e,types:r,message:n},{eip6492:s,chainId:o})}getProvider(e){return this.provider.getProvider(e)}async sendTransaction(e,r){const n=this.useChainId(r==null?void 0:r.chainId),i=await tU(e),s=await this.client.sendTransaction(i,{chainId:n}),o=this.getProvider(n);try{return await Za(async function(){const a=await o.getTransaction(s);return a?o._wrapTransaction(a,s):void 0},{onceBlock:o})}catch(a){throw a.transactionHash=s,a}}async getWalletConfig(e){const r=this.useChainId(e);return this.client.getOnchainWalletConfig({chainId:r})}getNetworks(){return this.client.getNetworks()}async getBalance(e,r){return this.getProvider(r==null?void 0:r.chainId).getBalance(this.getAddress(),e)}async estimateGas(e,r){return this.getProvider(r==null?void 0:r.chainId).estimateGas(e)}async call(e,r,n){return this.getProvider(n==null?void 0:n.chainId).call(e,r)}getChainId(){return Promise.resolve(this.client.getChainId())}async getGasPrice(e){return this.getProvider(e==null?void 0:e.chainId).getGasPrice()}async getFeeData(e){return this.getProvider(e==null?void 0:e.chainId).getFeeData()}async resolveName(e){const r=await this.provider.resolveName(e);if(r===null)throw new Error(`ENS name not found: ${e}`);return r}_checkProvider(e){}populateTransaction(e){throw new Error("SequenceSigner does not support populateTransaction")}checkTransaction(e){throw new Error("SequenceSigner does not support checkTransaction")}getTransactionCount(e){throw new Error("SequenceSigner does not support getTransactionCount")}signTransaction(e){throw new Error("SequenceWallet does not support signTransaction, use sendTransaction instead.")}static is(e){return e&&typeof e=="object"&&e._isSequenceSigner===!0}}class R4 extends Fd{constructor(e,r,n){super(e,r.getProvider(n)),this.chainId=n,this._isSingleNetworkSequenceSigner=!0}_useChainId(e){const r=this.provider.toChainId(e);if(r&&r!==this.chainId)throw new Error(`This signer only supports the network ${this.chainId}, but ${r} was requested.`);return r||this.provider.toChainId(this.chainId)}useChainId(e){return this._useChainId(e)}getChainId(){return Promise.resolve(this.provider.toChainId(this.chainId))}getProvider(e){return super.getProvider(this._useChainId(e))}getSigner(e){if(this._useChainId(e)!==this.chainId)throw new Error("Unreachable code");return this}static is(e){return e&&typeof e=="object"&&e._isSingleNetworkSequenceSigner===!0}}class ype{constructor(e){if(this.signer=e,R4.is(e))throw new Error("WalletUtils does not support SingleNetworkSequenceSigner")}signMessage(e,r,n){return this.signer.signMessage(e,{chainId:r,eip6492:n})}signTypedData(e,r,n,i,s){return this.signer.signTypedData(e,r,n,{chainId:i,eip6492:s})}async isValidSignature(e,r,n,i){return dd(e,r,n,this.signer.getProvider(i))}async isValidMessageSignature(e,r,n,i){const s=this.signer.getProvider(i),o=Hb(r),a=ZC(o);return dd(e,a,n,s)}isValidTypedDataSignature(e,r,n,i){return this.isValidSignature(e,sp(r),n,i)}}class jd extends rb{constructor(e,r,n=ld){super(e.getChainId()),this.client=e,this.providerFor=r,this.networks=n,this.singleNetworkProviders={},this._isSequenceProvider=!0,this.utils=void 0,this.signer=void 0,e.onConnect(i=>{this.emit("connect",i)}),e.onDisconnect(i=>{this.emit("disconnect",i)}),e.onDefaultChainIdChanged(i=>{this.emit("chainChanged",i)}),e.onAccountsChanged(i=>{this.emit("accountsChanged",i)}),this.signer=new Fd(this.client,this),this.utils=new ype(this.signer)}getSigner(e){return this.signer.getSigner(e)}connect(e){return this.client.connect(e)}disconnect(){return this.client.disconnect()}isConnected(){return this.client.isConnected()}getSession(){return this.client.getSession()}listAccounts(){return[this.client.getAddress()]}getAddress(){return this.client.getAddress()}getNetworks(){return this.client.getNetworks()}getChainId(){return this.client.getChainId()}setDefaultChainId(e){return this.client.setDefaultChainId(this.toChainId(e))}isOpened(){return this.client.isOpened()}closeWallet(){return this.client.closeWallet()}getWalletContext(){return this.client.getWalletContext()}async getWalletConfig(e){const r=await this.useChainId(e);return this.client.getOnchainWalletConfig({chainId:r})}authorize(e){return this.client.connect(Zn({},e,{authorize:!0}))}async openWallet(e,r){return await this.client.openWallet(e,r),!0}toChainId(e){if(e===void 0)return;const r=_s(this.networks,e);if(!r)throw new Error(`Unsupported network ${e}`);return r.chainId}async useChainId(e){return this.toChainId(e)||this.client.getChainId()}getProvider(e){if(!e)return this;const r=this.toChainId(e);return this.singleNetworkProviders[r]||(this.singleNetworkProviders[r]=new lU(this.client,this.providerFor,r)),this.singleNetworkProviders[r]}async _getSubprovider(e){const r=await this.useChainId(e),n=this.providerFor(r);if(!n)throw new Error(`Unsupported network ${r}`);return n}async perform(e,r){var n;if(e==="eth_chainId")return As(await this.useChainId());if(e==="eth_accounts")return[this.client.getAddress()];if(e==="wallet_switchEthereumChain"){const o=r[0],a=cU(o);return this.setDefaultChainId(a)}if(e==="eth_sendTransaction"||e==="eth_sign"||e==="eth_signTypedData"||e==="eth_signTypedData_v4"||e==="personal_sign"||e==="sequence_sign"||e==="sequence_signTypedData_v4")return this.client.send({method:e,params:r},this.getChainId());const i=await this._getSubprovider(),s=(n=i.prepareRequest(e,r))!=null?n:[e,r];return i.send(s[0],s[1])}send(e,r){return this.perform(e,r)}request(e){return this.perform(e.method,e.params)}async detectNetwork(){const e=this.client.getChainId(),r=_s(this.networks,e);if(!r)throw new Error(`Unknown network ${e}`);return r}async waitForTransaction(e,r,n,i){return(await this._getSubprovider(i==null?void 0:i.chainId)).waitForTransaction(e,r,n)}async getBlockNumber(e){return(await this._getSubprovider(e==null?void 0:e.chainId)).getBlockNumber()}async getGasPrice(e){return(await this._getSubprovider(e==null?void 0:e.chainId)).getGasPrice()}async getBalance(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).getBalance(e,r)}async getTransactionCount(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).getTransactionCount(e,r)}async getCode(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).getCode(e,r)}async getStorageAt(e,r,n,i){return(await this._getSubprovider(i==null?void 0:i.chainId)).getStorageAt(e,r,n)}async call(e,r,n){return(await this._getSubprovider(n==null?void 0:n.chainId)).call(e,r)}async estimateGas(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).estimateGas(e)}async getBlock(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).getBlock(e)}async getTransaction(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).getTransaction(e)}async getLogs(e,r){return(await this._getSubprovider(r==null?void 0:r.chainId)).getLogs(e)}async supportsENS(){return(await this.getNetworks()).some(r=>r.chainId===1)}async getResolver(e){return await this.supportsENS()?(await this._getSubprovider(1)).getResolver(e):null}async resolveName(e){return A$(await e)?e:await this.supportsENS()?(await this._getSubprovider(1)).resolveName(e):null}async lookupAddress(e){return await this.supportsENS()?(await this._getSubprovider(1)).lookupAddress(e):null}async getAvatar(e){return await this.supportsENS()?(await this._getSubprovider(1)).getAvatar(e):null}}jd.is=t=>t&&typeof t=="object"&&t._isSequenceProvider===!0;function cU(t){return typeof t=="object"?cU(t.chainId):Z.from(t).toNumber()}class lU extends jd{constructor(e,r,n){super(e,r),this.chainId=n,this._isSingleNetworkSequenceProvider=!0}_useChainId(e){const r=this.toChainId(e);if(r&&r!==this.chainId)throw new Error(`This provider only supports the network ${this.chainId}, but ${r} was requested.`);return r||super.toChainId(this.chainId)}useChainId(e){return Promise.resolve(this._useChainId(e))}getChainId(){return super.toChainId(this.chainId)}async getNetwork(){const e=await this.client.getNetworks(),r=_s(e,this.chainId);if(!r)throw new Error(`Unsupported network ${this.chainId}`);return r}getProvider(e){if(this._useChainId(e)!==this.chainId)throw new Error("Unreachable code");return this}getSigner(e){return super.getSigner(this._useChainId(e))}setDefaultChainId(e){throw new Error(`This provider only supports the network ${this.chainId}; use the parent provider to switch networks.`)}static is(e){return e&&typeof e=="object"&&e._isSingleNetworkSequenceProvider===!0}}class gpe extends V1e{}const bpe=(t,e)=>{e||(e="https://nodes.sequence.app");const r=!t,n={};return t&&(n.headers={"X-Access-Key":t}),new gpe(e,n,{noop:r,defaultEnabled:!0,privacy:{userIdHash:!0,userAgentSalt:!1},initProps:()=>zo()?{origin:window.location.origin}:{}})};var wpe={name:"@0xsequence/provider",version:"1.8.2",description:"provider sub-package for Sequence",repository:"https://github.com/0xsequence/sequence.js/tree/master/packages/provider",source:"src/index.ts",main:"dist/0xsequence-provider.cjs.js",module:"dist/0xsequence-provider.esm.js",author:"Horizon Blockchain Games",license:"Apache-2.0",scripts:{test:"pnpm test:concurrently 'pnpm test:run'","test:run":"pnpm test:file tests/**/*.spec.ts","test:file":"NODE_OPTIONS='--import tsx' mocha --timeout 30000",typecheck:"tsc --noEmit","test:concurrently":"concurrently -k --success first 'pnpm start:hardhat1' 'pnpm start:hardhat2'","start:hardhat1":"pnpm start:hardhat1:verbose > /dev/null 2>&1","start:hardhat2":"pnpm start:hardhat2:verbose > /dev/null 2>&1","start:hardhat1:verbose":"hardhat node --config hardhat1.config.js --hostname 0.0.0.0 --port 9595","start:hardhat2:verbose":"hardhat node --config hardhat2.config.js --hostname 0.0.0.0 --port 8595"},dependencies:{"@0xsequence/abi":"workspace:*","@0xsequence/account":"workspace:*","@0xsequence/auth":"workspace:*","@0xsequence/core":"workspace:*","@0xsequence/migration":"workspace:*","@0xsequence/network":"workspace:*","@0xsequence/relayer":"workspace:*","@0xsequence/utils":"workspace:*","@0xsequence/wallet":"workspace:*","@databeat/tracker":"^0.8.1",eventemitter2:"^6.4.5","webextension-polyfill":"^0.10.0"},peerDependencies:{ethers:">=5.5 < 6"},devDependencies:{"@types/webextension-polyfill":"^0.10.0",ethers:"^5.7.2",hardhat:"^2.12.2"},files:["src","dist"]};class Fl{constructor(e){this.store=e}connectedSession(){const e=this.getSession();if(e&&e.accountAddress&&e.walletContext&&e.networks)return{accountAddress:e.accountAddress,walletContext:e.walletContext,networks:e.networks};throw new Error("Sequence session not connected")}hasSession(){var e;return((e=this.getSession())==null?void 0:e.accountAddress)!==void 0}setSession(e){return this.store.setItem(Fl.SESSION_LOCALSTORE_KEY,JSON.stringify(e))}getSession(){const e=this.store.getItem(Fl.SESSION_LOCALSTORE_KEY);if(e)return JSON.parse(e)}async clearSession(){return this.store.removeItem(Fl.SESSION_LOCALSTORE_KEY)}}Fl.SESSION_LOCALSTORE_KEY="@sequence.session";class jl{constructor(e,r=1){this.store=e,this.startingChainId=r,this.callbacks=[],e.onItemChange(jl.SESSION_CHAIN_ID_KEY,n=>{if(n){const i=parseInt(n);this.callbacks.forEach(s=>s(i))}})}onDefaultChainIdChanged(e){return this.callbacks.push(e),()=>{this.callbacks=this.callbacks.filter(r=>r!==e)}}setDefaultChainId(e){e!==this.getDefaultChainId()&&this.store.setItem(jl.SESSION_CHAIN_ID_KEY,e.toString())}getDefaultChainId(){const e=this.store.getItem(jl.SESSION_CHAIN_ID_KEY);return!e||e.length===0?this.startingChainId:parseInt(e)}}jl.SESSION_CHAIN_ID_KEY="@sequence.session.defaultChainId";class $4{constructor(e,r,n){var i,s;if(this.session=void 0,this.defaultChainId=void 0,this.callbacks={},this.transport=void 0,this.defaultEIP6492=void 0,this.projectAccessKey=void 0,this.analytics=void 0,aU(e))this.transport=qb.new(e);else if(qj(e))this.transport=e;else throw new Error("Invalid transport");const o=n==null?void 0:n.defaultChainId;if(this.defaultEIP6492=(i=n==null?void 0:n.defaultEIP6492)!=null?i:!1,this.session=new Fl(r),this.defaultChainId=new jl(r,o),this.transport.on("accountsChanged",l=>{var u;l.length>1&&console.warn("SequenceClient: wallet-webapp returned more than one account"),(u=this.callbacks.accountsChanged)==null||u.forEach(f=>f(l))}),this.transport.on("connect",l=>{var u;const f=As(this.getChainId());(u=this.callbacks.connect)==null||u.forEach(d=>d(Zn({},l,{chainId:f})))}),this.transport.on("disconnect",(l,u)=>{var f;(f=this.callbacks.disconnect)==null||f.forEach(d=>d(l,u))}),this.transport.on("networks",l=>{var u;(u=this.callbacks.networks)==null||u.forEach(f=>f(l))}),this.transport.on("walletContext",l=>{var u;(u=this.callbacks.walletContext)==null||u.forEach(f=>f(l))}),this.transport.on("open",l=>{var u;(u=this.callbacks.open)==null||u.forEach(f=>f(l))}),this.transport.on("close",()=>{var l;(l=this.callbacks.close)==null||l.forEach(u=>u())}),this.transport.on("chainChanged",(l,u)=>{var f;(f=this.callbacks.chainChanged)==null||f.forEach(d=>d(l,u))}),this.defaultChainId.onDefaultChainIdChanged(l=>{var u;const f=As(l);(u=this.callbacks.chainChanged)==null||u.forEach(d=>d(f))}),n!=null&&n.projectAccessKey&&(this.projectAccessKey=n.projectAccessKey),this.projectAccessKey&&n!=null&&n.analytics&&(this.analytics=bpe(this.projectAccessKey)),(s=this.session.getSession())!=null&&s.accountAddress){var a,c;(a=this.analytics)==null||a.identify((c=this.session.getSession())==null?void 0:c.accountAddress)}}registerCallback(e,r){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(r),()=>{this.callbacks[e]=this.callbacks[e].filter(n=>n!==r)}}onOpen(e){return this.registerCallback("open",e)}onClose(e){return this.registerCallback("close",e)}onConnect(e){return this.registerCallback("connect",e)}onDisconnect(e){return this.registerCallback("disconnect",e)}onNetworks(e){return this.registerCallback("networks",e)}onAccountsChanged(e){return this.registerCallback("accountsChanged",e)}onWalletContext(e){return this.registerCallback("walletContext",e)}onChainChanged(e){return this.registerCallback("chainChanged",e)}onDefaultChainIdChanged(e){return this.registerCallback("chainChanged",e)}getChainId(){return this.defaultChainId.getDefaultChainId()}setDefaultChainId(e){return this.defaultChainId.setDefaultChainId(e)}async openWallet(e,r){return this.transport.openWallet(e,r,this.getChainId()),await this.transport.waitUntilOpened(),this.isOpened()}closeWallet(){return this.transport.closeWallet()}isOpened(){return this.transport.isOpened()}isConnected(){return this.session.hasSession()}getSession(){return this.session.getSession()}getAddress(){return this.session.connectedSession().accountAddress}async connect(e){if((e==null?void 0:e.authorizeVersion)===void 0&&(e.authorizeVersion=2),(e==null?void 0:e.refresh)===!0&&this.disconnect(),e.projectAccessKey=this.projectAccessKey,e&&e.authorize){if(!e.app)throw new Error("connecting with 'authorize' option also requires 'app' to be set");e.authorizeVersion===void 0&&(e.authorizeVersion=2)}await this.openWallet(void 0,{type:"connect",options:Zn({},e,{networkId:this.getChainId(),clientVersion:wpe.version})});const r=await this.transport.waitUntilConnected().catch(s=>s instanceof Error?{connected:!1,error:s.message}:{connected:!1,error:JSON.stringify(s)});if(r.chainId&&(r.chainId=Z.from(r.chainId).toString()),r.connected){var n;if(!r.session)throw new Error("impossible state, connect response is missing session");if(this.session.setSession(r.session),(n=r.session)!=null&&n.accountAddress){var i;(i=this.analytics)==null||i.identify(r.session.accountAddress)}}return r}disconnect(){var e;return this.isOpened()&&this.closeWallet(),(e=this.analytics)==null||e.reset(),this.session.clearSession()}send(e,r){return e.method=this.mapSignMethod(e.method),new Promise((n,i)=>{this.transport.sendAsync(e,(s,o)=>{s?i(s):o===void 0?i(new Error(`Got undefined response for request: ${e}`)):typeof o=="object"&&o.error?i(o.error):typeof o=="object"&&o.result?n(o.result):i(new Error(`Got invalid response for request: ${e}`))},r||this.getChainId())})}async getNetworks(e){const r=this.session.connectedSession();return e&&(r.networks=await this.send({method:"sequence_getNetworks"}),this.session.setSession(r)),r.networks}signMethod(e){return(e==null?void 0:e.eip6492)===void 0?"personal_sign":e.eip6492?"sequence_sign":"legacy_sign"}signTypedDataMethod(e){return(e==null?void 0:e.eip6492)===void 0?"eth_signTypedData_v4":e.eip6492?"sequence_signTypedData_v4":"legacy_signTypedData_v4"}mapSignMethod(e){return e==="personal_sign"?this.defaultEIP6492?"sequence_sign":"personal_sign":e==="eth_signTypedData_v4"?this.defaultEIP6492?"sequence_signTypedData_v4":"eth_signTypedData_v4":e==="legacy_sign"?"personal_sign":e==="legacy_signTypedData_v4"?"eth_signTypedData_v4":e}async signMessage(e,r){var n;const i=this.signMethod(r);return(n=this.analytics)==null||n.track({event:"SIGN_MESSAGE_REQUEST",props:{chainId:`${(r==null?void 0:r.chainId)||this.getChainId()}`}}),this.send({method:i,params:[e,this.getAddress()]},r==null?void 0:r.chainId)}async signTypedData(e,r){var n;const i=this.signTypedDataMethod(r),s=_r.getPayload(e.domain,e.types,e.message);return(n=this.analytics)==null||n.track({event:"SIGN_TYPED_DATA_REQUEST",props:{chainId:`${(r==null?void 0:r.chainId)||this.getChainId()}`}}),this.send({method:i,params:[this.getAddress(),s]},(r==null?void 0:r.chainId)||e.domain.chainId&&Z.from(e.domain.chainId).toNumber()||this.getChainId())}async sendTransaction(e,r){var n;const i=Array.isArray(e)?e:[e],s=upe(i);return(n=this.analytics)==null||n.track({event:"SEND_TRANSACTION_REQUEST",props:{chainId:`${(r==null?void 0:r.chainId)||this.getChainId()}`}}),this.send({method:"eth_sendTransaction",params:[s]},r==null?void 0:r.chainId)}async getWalletContext(){return this.send({method:"sequence_getWalletContext"})}async getOnchainWalletConfig(e){const r=await this.send({method:"sequence_getWalletConfig",params:[(e==null?void 0:e.chainId)||this.getChainId()]},e==null?void 0:e.chainId);return Array.isArray(r)?r[0]:r}}const v3={transports:{walletAppURL:"https://sequence.app",windowTransport:{enabled:!0},proxyTransport:{enabled:!1}},defaultNetwork:1,analytics:!0};let io;const uU=(t,e)=>{var r,n,i;if(!t||typeof t!="string")throw new Error("Please pass a projectAccessKey in initWallet.");if(io)return io;const s=Zn({},v3,e,{transports:Zn({},v3.transports,e==null?void 0:e.transports)}),o={},a=(r=(n=s.networks)==null?void 0:n.filter(h=>{h.rpcUrl!==void 0&&h.chainId!==void 0&&ld.find(p=>p.chainId===h.chainId)}))!=null?r:[],c=ld.map(h=>{var p;const v=(p=s.networks)==null?void 0:p.find(m=>m.chainId===h.chainId);return v?Zn({},h,v):h}).concat(a).map(h=>(h.rpcUrl=h.rpcUrl+`/${t}`,h)),l=h=>{if(!o[h]){var p;const v=(p=c.find(y=>y.chainId===h))==null?void 0:p.rpcUrl;if(!v)throw new Error(`no rpcUrl found for chainId: ${h}`);const m=new ta(v),g=new i4([iF,nF,new s4],new $y(m));o[h]=new VM(g,h)}return o[h]},u=s.defaultNetwork?(i=_s(c,s.defaultNetwork))==null?void 0:i.chainId:void 0;if(!u&&s.defaultNetwork)throw new Error(`defaultNetwork not found for chainId: ${s.defaultNetwork}`);const f=s.localStorage||Gy(),d=new $4(s.transports,f,{defaultChainId:u,defaultEIP6492:s.defaultEIP6492,projectAccessKey:t,analytics:s.analytics});return io=new jd(d,l),io},fU=()=>{io&&(io.client.closeWallet(),io.client.transport.unregister(),io=void 0)},dU=()=>{if(!io)throw new Error("Wallet has not been initialized, call sequence.initWallet(config) first.");return io},xpe=Object.freeze(Object.defineProperty({__proto__:null,BaseInjectedTransport:cpe,BaseProviderTransport:fp,BaseWalletTransport:dp,CHANNEL_ID:O4,DefaultChainIdTracker:jl,DefaultProviderConfig:v3,ErrSignedInRequired:Gj,EventType:Ye,ExtensionMessageHandler:ape,ExtensionMessageProvider:sU,InitState:qt,LocalStorage:d1,MemoryItemStore:eU,MuxMessageProvider:qb,OpenState:Ni,PROVIDER_OPEN_TIMEOUT:I4,ProviderError:Vj,ProxyMessageChannel:ipe,ProxyMessageChannelPort:p3,ProxyMessageHandler:spe,ProxyMessageProvider:rU,SequenceClient:$4,SequenceClientSession:Fl,SequenceProvider:jd,SequenceSigner:Fd,SingleNetworkSequenceProvider:lU,SingleNetworkSequenceSigner:R4,UnrealMessageHandler:ope,UnrealMessageProvider:iU,WalletRequestHandler:vpe,WindowMessageHandler:lpe,WindowMessageProvider:oU,WindowSessionParams:up,getWallet:dU,initWallet:uU,isBrowserExtension:Vy,isMuxTransportTemplate:aU,isProviderTransport:qj,isUnityPlugin:Xj,isValidMessageSignature:Yj,isValidSignature:dd,isValidTypedDataSignature:Jj,isWalletUpToDate:Zj,messageToBytes:Qj,nextMessageIdx:Kj,prefixEIP191Message:Hb,resolveArrayProperties:tU,trimEIP191Prefix:npe,unregisterWallet:fU,useBestStore:Gy},Symbol.toStringTag,{value:"Module"}));function Pn(t,e){return e.forEach(function(r){r&&typeof r!="string"&&!Array.isArray(r)&&Object.keys(r).forEach(function(n){if(n!=="default"&&!(n in t)){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}})}),Object.freeze(t)}var Epe=Pn({__proto__:null},[Rfe]),Cpe=Pn({__proto__:null},[Ffe]),Spe=Pn({__proto__:null},[Z0e]),kpe=Pn({__proto__:null},[s1e]),Ape=Pn({__proto__:null},[c0e]),_pe=Pn({__proto__:null},[m0e]),Ppe=Pn({__proto__:null},[p1e]),Tpe=Pn({__proto__:null},[Nde]),Ipe=Pn({__proto__:null},[xpe]),Ope=Pn({__proto__:null},[qhe]);const Rpe=de.transaction;var $pe=Object.freeze({__proto__:null,transactions:Rpe}),Mpe=Pn({__proto__:null,isValidSignature:dd,isValidMessageSignature:Yj,isValidTypedDataSignature:Jj,isWalletUpToDate:Zj},[wde]),Npe=Pn({__proto__:null},[She]),Dpe=Pn({__proto__:null},[Vhe]),Lpe=Pn({__proto__:null},[Y0e]),Bpe=Pn({__proto__:null},[Ihe]),Fpe=Pn({__proto__:null},[Zhe]),M4=Object.freeze({__proto__:null,abi:Epe,api:Cpe,auth:Spe,guard:kpe,indexer:Ape,metadata:_pe,multicall:Ppe,network:Tpe,provider:Ipe,relayer:Ope,transactions:$pe,utils:Mpe,core:Npe,signhub:Dpe,sessions:Lpe,migration:Bpe,account:Fpe,initWallet:uU,getWallet:dU,unregisterWallet:fU,SequenceProvider:jd,SequenceClient:$4,SequenceSigner:Fd});function jpe({storage:t,key:e="REACT_QUERY_OFFLINE_CACHE",throttleTime:r=1e3,serialize:n=JSON.stringify,deserialize:i=JSON.parse,retry:s}){if(t){const o=a=>{try{t.setItem(e,n(a));return}catch(c){return c}};return{persistClient:Upe(a=>{let c=a,l=o(c),u=0;for(;l&&c;)u++,c=s==null?void 0:s({persistedClient:c,error:l,errorCount:u}),c&&(l=o(c))},r),restoreClient:()=>{const a=t.getItem(e);if(a)return i(a)},removeClient:()=>{t.removeItem(e)}}}return{persistClient:X_,restoreClient:()=>{},removeClient:X_}}function Upe(t,e=100){let r=null,n;return function(...i){n=i,r===null&&(r=setTimeout(()=>{t(...n),r=null},e))}}function X_(){}class Ud{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){const r={listener:e};return this.listeners.add(r),this.onSubscribe(),()=>{this.listeners.delete(r),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}const h1=typeof window>"u"||"Deno"in window;function Di(){}function zpe(t,e){return typeof t=="function"?t(e):t}function m3(t){return typeof t=="number"&&t>=0&&t!==1/0}function hU(t,e){return Math.max(t+(e||0)-Date.now(),0)}function bf(t,e,r){return hp(t)?typeof e=="function"?{...r,queryKey:t,queryFn:e}:{...e,queryKey:t}:t}function pU(t,e,r){return hp(t)?typeof e=="function"?{...r,mutationKey:t,mutationFn:e}:{...e,mutationKey:t}:typeof t=="function"?{...e,mutationFn:t}:{...t}}function Ha(t,e,r){return hp(t)?[{...e,queryKey:t},r]:[t||{},e]}function Z_(t,e){const{type:r="all",exact:n,fetchStatus:i,predicate:s,queryKey:o,stale:a}=t;if(hp(o)){if(n){if(e.queryHash!==N4(o,e.options))return!1}else if(!Ky(e.queryKey,o))return!1}if(r!=="all"){const c=e.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||typeof i<"u"&&i!==e.state.fetchStatus||s&&!s(e))}function eP(t,e){const{exact:r,fetching:n,predicate:i,mutationKey:s}=t;if(hp(s)){if(!e.options.mutationKey)return!1;if(r){if(Il(e.options.mutationKey)!==Il(s))return!1}else if(!Ky(e.options.mutationKey,s))return!1}return!(typeof n=="boolean"&&e.state.status==="loading"!==n||i&&!i(e))}function N4(t,e){return((e==null?void 0:e.queryKeyHashFn)||Il)(t)}function Il(t){return JSON.stringify(t,(e,r)=>y3(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function Ky(t,e){return vU(t,e)}function vU(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(r=>!vU(t[r],e[r])):!1}function mU(t,e){if(t===e)return t;const r=tP(t)&&tP(e);if(r||y3(t)&&y3(e)){const n=r?t.length:Object.keys(t).length,i=r?e:Object.keys(e),s=i.length,o=r?[]:{};let a=0;for(let c=0;c"u")return!0;const r=e.prototype;return!(!rP(r)||!r.hasOwnProperty("isPrototypeOf"))}function rP(t){return Object.prototype.toString.call(t)==="[object Object]"}function hp(t){return Array.isArray(t)}function yU(t){return new Promise(e=>{setTimeout(e,t)})}function nP(t){yU(0).then(t)}function Wpe(){if(typeof AbortController=="function")return new AbortController}function g3(t,e,r){return r.isDataEqual!=null&&r.isDataEqual(t,e)?t:typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?mU(t,e):e}class Hpe extends Ud{constructor(){super(),this.setup=e=>{if(!h1&&window.addEventListener){const r=()=>e();return window.addEventListener("visibilitychange",r,!1),window.addEventListener("focus",r,!1),()=>{window.removeEventListener("visibilitychange",r),window.removeEventListener("focus",r)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var e;(e=this.cleanup)==null||e.call(this),this.cleanup=void 0}}setEventListener(e){var r;this.setup=e,(r=this.cleanup)==null||r.call(this),this.cleanup=e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()})}setFocused(e){this.focused!==e&&(this.focused=e,this.onFocus())}onFocus(){this.listeners.forEach(({listener:e})=>{e()})}isFocused(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)}}const Yy=new Hpe,iP=["online","offline"];class qpe extends Ud{constructor(){super(),this.setup=e=>{if(!h1&&window.addEventListener){const r=()=>e();return iP.forEach(n=>{window.addEventListener(n,r,!1)}),()=>{iP.forEach(n=>{window.removeEventListener(n,r)})}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var e;(e=this.cleanup)==null||e.call(this),this.cleanup=void 0}}setEventListener(e){var r;this.setup=e,(r=this.cleanup)==null||r.call(this),this.cleanup=e(n=>{typeof n=="boolean"?this.setOnline(n):this.onOnline()})}setOnline(e){this.online!==e&&(this.online=e,this.onOnline())}onOnline(){this.listeners.forEach(({listener:e})=>{e()})}isOnline(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine}}const Jy=new qpe;function Vpe(t){return Math.min(1e3*2**t,3e4)}function Vb(t){return(t??"online")==="online"?Jy.isOnline():!0}class gU{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}}function vm(t){return t instanceof gU}function bU(t){let e=!1,r=0,n=!1,i,s,o;const a=new Promise((m,g)=>{s=m,o=g}),c=m=>{n||(h(new gU(m)),t.abort==null||t.abort())},l=()=>{e=!0},u=()=>{e=!1},f=()=>!Yy.isFocused()||t.networkMode!=="always"&&!Jy.isOnline(),d=m=>{n||(n=!0,t.onSuccess==null||t.onSuccess(m),i==null||i(),s(m))},h=m=>{n||(n=!0,t.onError==null||t.onError(m),i==null||i(),o(m))},p=()=>new Promise(m=>{i=g=>{const y=n||!f();return y&&m(g),y},t.onPause==null||t.onPause()}).then(()=>{i=void 0,n||t.onContinue==null||t.onContinue()}),v=()=>{if(n)return;let m;try{m=t.fn()}catch(g){m=Promise.reject(g)}Promise.resolve(m).then(d).catch(g=>{var y,b;if(n)return;const C=(y=t.retry)!=null?y:3,A=(b=t.retryDelay)!=null?b:Vpe,O=typeof A=="function"?A(r,g):A,w=C===!0||typeof C=="number"&&r{if(f())return p()}).then(()=>{e?h(g):v()})})};return Vb(t.networkMode)?v():p().then(v),{promise:a,cancel:c,continue:()=>(i==null?void 0:i())?a:Promise.resolve(),cancelRetry:l,continueRetry:u}}const D4=console;function Gpe(){let t=[],e=0,r=u=>{u()},n=u=>{u()};const i=u=>{let f;e++;try{f=u()}finally{e--,e||a()}return f},s=u=>{e?t.push(u):nP(()=>{r(u)})},o=u=>(...f)=>{s(()=>{u(...f)})},a=()=>{const u=t;t=[],u.length&&nP(()=>{n(()=>{u.forEach(f=>{r(f)})})})};return{batch:i,batchCalls:o,schedule:s,setNotifyFunction:u=>{r=u},setBatchNotifyFunction:u=>{n=u}}}const wt=Gpe();class wU{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),m3(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(e){this.cacheTime=Math.max(this.cacheTime||0,e??(h1?1/0:5*60*1e3))}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class Kpe extends wU{constructor(e){super(),this.abortSignalConsumed=!1,this.defaultOptions=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.cache=e.cache,this.logger=e.logger||D4,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.initialState=e.state||Qpe(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(e){this.options={...this.defaultOptions,...e},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.cache.remove(this)}setData(e,r){const n=g3(this.state.data,e,this.options);return this.dispatch({data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(e,r){this.dispatch({type:"setState",state:e,setStateOptions:r})}cancel(e){var r;const n=this.promise;return(r=this.retryer)==null||r.cancel(e),n?n.then(Di).catch(Di):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(e=>e.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(e=>e.getCurrentResult().isStale)}isStaleByTime(e=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!hU(this.state.dataUpdatedAt,e)}onFocus(){var e;const r=this.observers.find(n=>n.shouldFetchOnWindowFocus());r&&r.refetch({cancelRefetch:!1}),(e=this.retryer)==null||e.continue()}onOnline(){var e;const r=this.observers.find(n=>n.shouldFetchOnReconnect());r&&r.refetch({cancelRefetch:!1}),(e=this.retryer)==null||e.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(r=>r!==e),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(e,r){var n,i;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&r!=null&&r.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var s;return(s=this.retryer)==null||s.continueRetry(),this.promise}}if(e&&this.setOptions(e),!this.options.queryFn){const h=this.observers.find(p=>p.options.queryFn);h&&this.setOptions(h.options)}const o=Wpe(),a={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},c=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>{if(o)return this.abortSignalConsumed=!0,o.signal}})};c(a);const l=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(a)):Promise.reject("Missing queryFn for queryKey '"+this.options.queryHash+"'"),u={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:l};if(c(u),(n=this.options.behavior)==null||n.onFetch(u),this.revertState=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==((i=u.fetchOptions)==null?void 0:i.meta)){var f;this.dispatch({type:"fetch",meta:(f=u.fetchOptions)==null?void 0:f.meta})}const d=h=>{if(vm(h)&&h.silent||this.dispatch({type:"error",error:h}),!vm(h)){var p,v,m,g;(p=(v=this.cache.config).onError)==null||p.call(v,h,this),(m=(g=this.cache.config).onSettled)==null||m.call(g,this.state.data,h,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=bU({fn:u.fetchFn,abort:o==null?void 0:o.abort.bind(o),onSuccess:h=>{var p,v,m,g;if(typeof h>"u"){d(new Error(this.queryHash+" data is undefined"));return}this.setData(h),(p=(v=this.cache.config).onSuccess)==null||p.call(v,h,this),(m=(g=this.cache.config).onSettled)==null||m.call(g,h,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:d,onFail:(h,p)=>{this.dispatch({type:"failed",failureCount:h,error:p})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(e){const r=n=>{var i,s;switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:(i=e.meta)!=null?i:null,fetchStatus:Vb(this.options.networkMode)?"fetching":"paused",...!n.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:(s=e.dataUpdatedAt)!=null?s:Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=e.error;return vm(o)&&o.revert&&this.revertState?{...this.revertState,fetchStatus:"idle"}:{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=r(this.state),wt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate(e)}),this.cache.notify({query:this,type:"updated",action:e})})}}function Qpe(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,r=typeof e<"u",n=r?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"loading",fetchStatus:"idle"}}class Ype extends Ud{constructor(e){super(),this.config=e||{},this.queries=[],this.queriesMap={}}build(e,r,n){var i;const s=r.queryKey,o=(i=r.queryHash)!=null?i:N4(s,r);let a=this.get(o);return a||(a=new Kpe({cache:this,logger:e.getLogger(),queryKey:s,queryHash:o,options:e.defaultQueryOptions(r),state:n,defaultOptions:e.getQueryDefaults(s)}),this.add(a)),a}add(e){this.queriesMap[e.queryHash]||(this.queriesMap[e.queryHash]=e,this.queries.push(e),this.notify({type:"added",query:e}))}remove(e){const r=this.queriesMap[e.queryHash];r&&(e.destroy(),this.queries=this.queries.filter(n=>n!==e),r===e&&delete this.queriesMap[e.queryHash],this.notify({type:"removed",query:e}))}clear(){wt.batch(()=>{this.queries.forEach(e=>{this.remove(e)})})}get(e){return this.queriesMap[e]}getAll(){return this.queries}find(e,r){const[n]=Ha(e,r);return typeof n.exact>"u"&&(n.exact=!0),this.queries.find(i=>Z_(n,i))}findAll(e,r){const[n]=Ha(e,r);return Object.keys(n).length>0?this.queries.filter(i=>Z_(n,i)):this.queries}notify(e){wt.batch(()=>{this.listeners.forEach(({listener:r})=>{r(e)})})}onFocus(){wt.batch(()=>{this.queries.forEach(e=>{e.onFocus()})})}onOnline(){wt.batch(()=>{this.queries.forEach(e=>{e.onOnline()})})}}class Jpe extends wU{constructor(e){super(),this.defaultOptions=e.defaultOptions,this.mutationId=e.mutationId,this.mutationCache=e.mutationCache,this.logger=e.logger||D4,this.observers=[],this.state=e.state||xU(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options={...this.defaultOptions,...e},this.updateCacheTime(this.options.cacheTime)}get meta(){return this.options.meta}setState(e){this.dispatch({type:"setState",state:e})}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.observers=this.observers.filter(r=>r!==e),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.observers.length||(this.state.status==="loading"?this.scheduleGc():this.mutationCache.remove(this))}continue(){var e,r;return(e=(r=this.retryer)==null?void 0:r.continue())!=null?e:this.execute()}async execute(){const e=()=>{var w;return this.retryer=bU({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(I,B)=>{this.dispatch({type:"failed",failureCount:I,error:B})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:(w=this.options.retry)!=null?w:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},r=this.state.status==="loading";try{var n,i,s,o,a,c,l,u;if(!r){var f,d,h,p;this.dispatch({type:"loading",variables:this.options.variables}),await((f=(d=this.mutationCache.config).onMutate)==null?void 0:f.call(d,this.state.variables,this));const I=await((h=(p=this.options).onMutate)==null?void 0:h.call(p,this.state.variables));I!==this.state.context&&this.dispatch({type:"loading",context:I,variables:this.state.variables})}const w=await e();return await((n=(i=this.mutationCache.config).onSuccess)==null?void 0:n.call(i,w,this.state.variables,this.state.context,this)),await((s=(o=this.options).onSuccess)==null?void 0:s.call(o,w,this.state.variables,this.state.context)),await((a=(c=this.mutationCache.config).onSettled)==null?void 0:a.call(c,w,null,this.state.variables,this.state.context,this)),await((l=(u=this.options).onSettled)==null?void 0:l.call(u,w,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:w}),w}catch(w){try{var v,m,g,y,b,C,A,O;throw await((v=(m=this.mutationCache.config).onError)==null?void 0:v.call(m,w,this.state.variables,this.state.context,this)),await((g=(y=this.options).onError)==null?void 0:g.call(y,w,this.state.variables,this.state.context)),await((b=(C=this.mutationCache.config).onSettled)==null?void 0:b.call(C,void 0,w,this.state.variables,this.state.context,this)),await((A=(O=this.options).onSettled)==null?void 0:A.call(O,void 0,w,this.state.variables,this.state.context)),w}finally{this.dispatch({type:"error",error:w})}}}dispatch(e){const r=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"loading":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!Vb(this.options.networkMode),status:"loading",variables:e.variables};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"};case"setState":return{...n,...e.state}}};this.state=r(this.state),wt.batch(()=>{this.observers.forEach(n=>{n.onMutationUpdate(e)}),this.mutationCache.notify({mutation:this,type:"updated",action:e})})}}function xU(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class Xpe extends Ud{constructor(e){super(),this.config=e||{},this.mutations=[],this.mutationId=0}build(e,r,n){const i=new Jpe({mutationCache:this,logger:e.getLogger(),mutationId:++this.mutationId,options:e.defaultMutationOptions(r),state:n,defaultOptions:r.mutationKey?e.getMutationDefaults(r.mutationKey):void 0});return this.add(i),i}add(e){this.mutations.push(e),this.notify({type:"added",mutation:e})}remove(e){this.mutations=this.mutations.filter(r=>r!==e),this.notify({type:"removed",mutation:e})}clear(){wt.batch(()=>{this.mutations.forEach(e=>{this.remove(e)})})}getAll(){return this.mutations}find(e){return typeof e.exact>"u"&&(e.exact=!0),this.mutations.find(r=>eP(e,r))}findAll(e){return this.mutations.filter(r=>eP(e,r))}notify(e){wt.batch(()=>{this.listeners.forEach(({listener:r})=>{r(e)})})}resumePausedMutations(){var e;return this.resuming=((e=this.resuming)!=null?e:Promise.resolve()).then(()=>{const r=this.mutations.filter(n=>n.state.isPaused);return wt.batch(()=>r.reduce((n,i)=>n.then(()=>i.continue().catch(Di)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function b3(){return{onFetch:t=>{t.fetchFn=()=>{var e,r,n,i,s,o;const a=(e=t.fetchOptions)==null||(r=e.meta)==null?void 0:r.refetchPage,c=(n=t.fetchOptions)==null||(i=n.meta)==null?void 0:i.fetchMore,l=c==null?void 0:c.pageParam,u=(c==null?void 0:c.direction)==="forward",f=(c==null?void 0:c.direction)==="backward",d=((s=t.state.data)==null?void 0:s.pages)||[],h=((o=t.state.data)==null?void 0:o.pageParams)||[];let p=h,v=!1;const m=O=>{Object.defineProperty(O,"signal",{enumerable:!0,get:()=>{var w;if((w=t.signal)!=null&&w.aborted)v=!0;else{var I;(I=t.signal)==null||I.addEventListener("abort",()=>{v=!0})}return t.signal}})},g=t.options.queryFn||(()=>Promise.reject("Missing queryFn for queryKey '"+t.options.queryHash+"'")),y=(O,w,I,B)=>(p=B?[w,...p]:[...p,w],B?[I,...O]:[...O,I]),b=(O,w,I,B)=>{if(v)return Promise.reject("Cancelled");if(typeof I>"u"&&!w&&O.length)return Promise.resolve(O);const z={queryKey:t.queryKey,pageParam:I,meta:t.options.meta};m(z);const H=g(z);return Promise.resolve(H).then(F=>y(O,I,F,B))};let C;if(!d.length)C=b([]);else if(u){const O=typeof l<"u",w=O?l:w3(t.options,d);C=b(d,O,w)}else if(f){const O=typeof l<"u",w=O?l:EU(t.options,d);C=b(d,O,w,!0)}else{p=[];const O=typeof t.options.getNextPageParam>"u";C=(a&&d[0]?a(d[0],0,d):!0)?b([],O,h[0]):Promise.resolve(y([],h[0],d[0]));for(let I=1;I{if(a&&d[I]?a(d[I],I,d):!0){const H=O?h[I]:w3(t.options,B);return b(B,O,H)}return Promise.resolve(y(B,h[I],d[I]))})}return C.then(O=>({pages:O,pageParams:p}))}}}}function w3(t,e){return t.getNextPageParam==null?void 0:t.getNextPageParam(e[e.length-1],e)}function EU(t,e){return t.getPreviousPageParam==null?void 0:t.getPreviousPageParam(e[0],e)}function Zpe(t,e){if(t.getNextPageParam&&Array.isArray(e)){const r=w3(t,e);return typeof r<"u"&&r!==null&&r!==!1}}function eve(t,e){if(t.getPreviousPageParam&&Array.isArray(e)){const r=EU(t,e);return typeof r<"u"&&r!==null&&r!==!1}}class L4{constructor(e={}){this.queryCache=e.queryCache||new Ype,this.mutationCache=e.mutationCache||new Xpe,this.logger=e.logger||D4,this.defaultOptions=e.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=Yy.subscribe(()=>{Yy.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=Jy.subscribe(()=>{Jy.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var e,r;this.mountCount--,this.mountCount===0&&((e=this.unsubscribeFocus)==null||e.call(this),this.unsubscribeFocus=void 0,(r=this.unsubscribeOnline)==null||r.call(this),this.unsubscribeOnline=void 0)}isFetching(e,r){const[n]=Ha(e,r);return n.fetchStatus="fetching",this.queryCache.findAll(n).length}isMutating(e){return this.mutationCache.findAll({...e,fetching:!0}).length}getQueryData(e,r){var n;return(n=this.queryCache.find(e,r))==null?void 0:n.state.data}ensureQueryData(e,r,n){const i=bf(e,r,n),s=this.getQueryData(i.queryKey);return s?Promise.resolve(s):this.fetchQuery(i)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:r,state:n})=>{const i=n.data;return[r,i]})}setQueryData(e,r,n){const i=this.queryCache.find(e),s=i==null?void 0:i.state.data,o=zpe(r,s);if(typeof o>"u")return;const a=bf(e),c=this.defaultQueryOptions(a);return this.queryCache.build(this,c).setData(o,{...n,manual:!0})}setQueriesData(e,r,n){return wt.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,r,n)]))}getQueryState(e,r){var n;return(n=this.queryCache.find(e,r))==null?void 0:n.state}removeQueries(e,r){const[n]=Ha(e,r),i=this.queryCache;wt.batch(()=>{i.findAll(n).forEach(s=>{i.remove(s)})})}resetQueries(e,r,n){const[i,s]=Ha(e,r,n),o=this.queryCache,a={type:"active",...i};return wt.batch(()=>(o.findAll(i).forEach(c=>{c.reset()}),this.refetchQueries(a,s)))}cancelQueries(e,r,n){const[i,s={}]=Ha(e,r,n);typeof s.revert>"u"&&(s.revert=!0);const o=wt.batch(()=>this.queryCache.findAll(i).map(a=>a.cancel(s)));return Promise.all(o).then(Di).catch(Di)}invalidateQueries(e,r,n){const[i,s]=Ha(e,r,n);return wt.batch(()=>{var o,a;if(this.queryCache.findAll(i).forEach(l=>{l.invalidate()}),i.refetchType==="none")return Promise.resolve();const c={...i,type:(o=(a=i.refetchType)!=null?a:i.type)!=null?o:"active"};return this.refetchQueries(c,s)})}refetchQueries(e,r,n){const[i,s]=Ha(e,r,n),o=wt.batch(()=>this.queryCache.findAll(i).filter(c=>!c.isDisabled()).map(c=>{var l;return c.fetch(void 0,{...s,cancelRefetch:(l=s==null?void 0:s.cancelRefetch)!=null?l:!0,meta:{refetchPage:i.refetchPage}})}));let a=Promise.all(o).then(Di);return s!=null&&s.throwOnError||(a=a.catch(Di)),a}fetchQuery(e,r,n){const i=bf(e,r,n),s=this.defaultQueryOptions(i);typeof s.retry>"u"&&(s.retry=!1);const o=this.queryCache.build(this,s);return o.isStaleByTime(s.staleTime)?o.fetch(s):Promise.resolve(o.state.data)}prefetchQuery(e,r,n){return this.fetchQuery(e,r,n).then(Di).catch(Di)}fetchInfiniteQuery(e,r,n){const i=bf(e,r,n);return i.behavior=b3(),this.fetchQuery(i)}prefetchInfiniteQuery(e,r,n){return this.fetchInfiniteQuery(e,r,n).then(Di).catch(Di)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(e){this.defaultOptions=e}setQueryDefaults(e,r){const n=this.queryDefaults.find(i=>Il(e)===Il(i.queryKey));n?n.defaultOptions=r:this.queryDefaults.push({queryKey:e,defaultOptions:r})}getQueryDefaults(e){if(!e)return;const r=this.queryDefaults.find(n=>Ky(e,n.queryKey));return r==null?void 0:r.defaultOptions}setMutationDefaults(e,r){const n=this.mutationDefaults.find(i=>Il(e)===Il(i.mutationKey));n?n.defaultOptions=r:this.mutationDefaults.push({mutationKey:e,defaultOptions:r})}getMutationDefaults(e){if(!e)return;const r=this.mutationDefaults.find(n=>Ky(e,n.mutationKey));return r==null?void 0:r.defaultOptions}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const r={...this.defaultOptions.queries,...this.getQueryDefaults(e==null?void 0:e.queryKey),...e,_defaulted:!0};return!r.queryHash&&r.queryKey&&(r.queryHash=N4(r.queryKey,r)),typeof r.refetchOnReconnect>"u"&&(r.refetchOnReconnect=r.networkMode!=="always"),typeof r.useErrorBoundary>"u"&&(r.useErrorBoundary=!!r.suspense),r}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...this.defaultOptions.mutations,...this.getMutationDefaults(e==null?void 0:e.mutationKey),...e,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}class B4 extends Ud{constructor(e,r){super(),this.client=e,this.options=r,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(r)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.currentQuery.addObserver(this),sP(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return x3(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return x3(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(e,r){const n=this.options,i=this.currentQuery;if(this.options=this.client.defaultQueryOptions(e),Qy(n,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=n.queryKey),this.updateQuery();const s=this.hasListeners();s&&oP(this.currentQuery,i,this.options,n)&&this.executeFetch(),this.updateResult(r),s&&(this.currentQuery!==i||this.options.enabled!==n.enabled||this.options.staleTime!==n.staleTime)&&this.updateStaleTimeout();const o=this.computeRefetchInterval();s&&(this.currentQuery!==i||this.options.enabled!==n.enabled||o!==this.currentRefetchInterval)&&this.updateRefetchInterval(o)}getOptimisticResult(e){const r=this.client.getQueryCache().build(this.client,e),n=this.createResult(r,e);return rve(this,n,e)&&(this.currentResult=n,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),n}getCurrentResult(){return this.currentResult}trackResult(e){const r={};return Object.keys(e).forEach(n=>{Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(n),e[n])})}),r}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:e,...r}={}){return this.fetch({...r,meta:{refetchPage:e}})}fetchOptimistic(e){const r=this.client.defaultQueryOptions(e),n=this.client.getQueryCache().build(this.client,r);return n.isFetchingOptimistic=!0,n.fetch().then(()=>this.createResult(n,r))}fetch(e){var r;return this.executeFetch({...e,cancelRefetch:(r=e.cancelRefetch)!=null?r:!0}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(e){this.updateQuery();let r=this.currentQuery.fetch(this.options,e);return e!=null&&e.throwOnError||(r=r.catch(Di)),r}updateStaleTimeout(){if(this.clearStaleTimeout(),h1||this.currentResult.isStale||!m3(this.options.staleTime))return;const r=hU(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},r)}computeRefetchInterval(){var e;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(e=this.options.refetchInterval)!=null?e:!1}updateRefetchInterval(e){this.clearRefetchInterval(),this.currentRefetchInterval=e,!(h1||this.options.enabled===!1||!m3(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||Yy.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(e,r){const n=this.currentQuery,i=this.options,s=this.currentResult,o=this.currentResultState,a=this.currentResultOptions,c=e!==n,l=c?e.state:this.currentQueryInitialState,u=c?this.currentResult:this.previousQueryResult,{state:f}=e;let{dataUpdatedAt:d,error:h,errorUpdatedAt:p,fetchStatus:v,status:m}=f,g=!1,y=!1,b;if(r._optimisticResults){const I=this.hasListeners(),B=!I&&sP(e,r),z=I&&oP(e,n,r,i);(B||z)&&(v=Vb(e.options.networkMode)?"fetching":"paused",d||(m="loading")),r._optimisticResults==="isRestoring"&&(v="idle")}if(r.keepPreviousData&&!f.dataUpdatedAt&&u!=null&&u.isSuccess&&m!=="error")b=u.data,d=u.dataUpdatedAt,m=u.status,g=!0;else if(r.select&&typeof f.data<"u")if(s&&f.data===(o==null?void 0:o.data)&&r.select===this.selectFn)b=this.selectResult;else try{this.selectFn=r.select,b=r.select(f.data),b=g3(s==null?void 0:s.data,b,r),this.selectResult=b,this.selectError=null}catch(I){this.selectError=I}else b=f.data;if(typeof r.placeholderData<"u"&&typeof b>"u"&&m==="loading"){let I;if(s!=null&&s.isPlaceholderData&&r.placeholderData===(a==null?void 0:a.placeholderData))I=s.data;else if(I=typeof r.placeholderData=="function"?r.placeholderData():r.placeholderData,r.select&&typeof I<"u")try{I=r.select(I),this.selectError=null}catch(B){this.selectError=B}typeof I<"u"&&(m="success",b=g3(s==null?void 0:s.data,I,r),y=!0)}this.selectError&&(h=this.selectError,b=this.selectResult,p=Date.now(),m="error");const C=v==="fetching",A=m==="loading",O=m==="error";return{status:m,fetchStatus:v,isLoading:A,isSuccess:m==="success",isError:O,isInitialLoading:A&&C,data:b,dataUpdatedAt:d,error:h,errorUpdatedAt:p,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>l.dataUpdateCount||f.errorUpdateCount>l.errorUpdateCount,isFetching:C,isRefetching:C&&!A,isLoadingError:O&&f.dataUpdatedAt===0,isPaused:v==="paused",isPlaceholderData:y,isPreviousData:g,isRefetchError:O&&f.dataUpdatedAt!==0,isStale:F4(e,r),refetch:this.refetch,remove:this.remove}}updateResult(e){const r=this.currentResult,n=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,Qy(n,r))return;this.currentResult=n;const i={cache:!0},s=()=>{if(!r)return!0;const{notifyOnChangeProps:o}=this.options,a=typeof o=="function"?o():o;if(a==="all"||!a&&!this.trackedProps.size)return!0;const c=new Set(a??this.trackedProps);return this.options.useErrorBoundary&&c.add("error"),Object.keys(this.currentResult).some(l=>{const u=l;return this.currentResult[u]!==r[u]&&c.has(u)})};(e==null?void 0:e.listeners)!==!1&&s()&&(i.listeners=!0),this.notify({...i,...e})}updateQuery(){const e=this.client.getQueryCache().build(this.client,this.options);if(e===this.currentQuery)return;const r=this.currentQuery;this.currentQuery=e,this.currentQueryInitialState=e.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(r==null||r.removeObserver(this),e.addObserver(this))}onQueryUpdate(e){const r={};e.type==="success"?r.onSuccess=!e.manual:e.type==="error"&&!vm(e.error)&&(r.onError=!0),this.updateResult(r),this.hasListeners()&&this.updateTimers()}notify(e){wt.batch(()=>{if(e.onSuccess){var r,n,i,s;(r=(n=this.options).onSuccess)==null||r.call(n,this.currentResult.data),(i=(s=this.options).onSettled)==null||i.call(s,this.currentResult.data,null)}else if(e.onError){var o,a,c,l;(o=(a=this.options).onError)==null||o.call(a,this.currentResult.error),(c=(l=this.options).onSettled)==null||c.call(l,void 0,this.currentResult.error)}e.listeners&&this.listeners.forEach(({listener:u})=>{u(this.currentResult)}),e.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function tve(t,e){return e.enabled!==!1&&!t.state.dataUpdatedAt&&!(t.state.status==="error"&&e.retryOnMount===!1)}function sP(t,e){return tve(t,e)||t.state.dataUpdatedAt>0&&x3(t,e,e.refetchOnMount)}function x3(t,e,r){if(e.enabled!==!1){const n=typeof r=="function"?r(t):r;return n==="always"||n!==!1&&F4(t,e)}return!1}function oP(t,e,r,n){return r.enabled!==!1&&(t!==e||n.enabled===!1)&&(!r.suspense||t.state.status!=="error")&&F4(t,r)}function F4(t,e){return t.isStaleByTime(e.staleTime)}function rve(t,e,r){return r.keepPreviousData?!1:r.placeholderData!==void 0?e.isPlaceholderData:!Qy(t.getCurrentResult(),e)}class nve extends B4{constructor(e,r){super(e,r)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e,r){super.setOptions({...e,behavior:b3()},r)}getOptimisticResult(e){return e.behavior=b3(),super.getOptimisticResult(e)}fetchNextPage({pageParam:e,...r}={}){return this.fetch({...r,meta:{fetchMore:{direction:"forward",pageParam:e}}})}fetchPreviousPage({pageParam:e,...r}={}){return this.fetch({...r,meta:{fetchMore:{direction:"backward",pageParam:e}}})}createResult(e,r){var n,i,s,o,a,c;const{state:l}=e,u=super.createResult(e,r),{isFetching:f,isRefetching:d}=u,h=f&&((n=l.fetchMeta)==null||(i=n.fetchMore)==null?void 0:i.direction)==="forward",p=f&&((s=l.fetchMeta)==null||(o=s.fetchMore)==null?void 0:o.direction)==="backward";return{...u,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Zpe(r,(a=l.data)==null?void 0:a.pages),hasPreviousPage:eve(r,(c=l.data)==null?void 0:c.pages),isFetchingNextPage:h,isFetchingPreviousPage:p,isRefetching:d&&!h&&!p}}}let ive=class extends Ud{constructor(e,r){super(),this.client=e,this.setOptions(r),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){var r;const n=this.options;this.options=this.client.defaultMutationOptions(e),Qy(n,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this}),(r=this.currentMutation)==null||r.setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners()){var e;(e=this.currentMutation)==null||e.removeObserver(this)}}onMutationUpdate(e){this.updateResult();const r={listeners:!0};e.type==="success"?r.onSuccess=!0:e.type==="error"&&(r.onError=!0),this.notify(r)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(e,r){return this.mutateOptions=r,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:typeof e<"u"?e:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){const e=this.currentMutation?this.currentMutation.state:xU(),r={...e,isLoading:e.status==="loading",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset};this.currentResult=r}notify(e){wt.batch(()=>{if(this.mutateOptions&&this.hasListeners()){if(e.onSuccess){var r,n,i,s;(r=(n=this.mutateOptions).onSuccess)==null||r.call(n,this.currentResult.data,this.currentResult.variables,this.currentResult.context),(i=(s=this.mutateOptions).onSettled)==null||i.call(s,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)}else if(e.onError){var o,a,c,l;(o=(a=this.mutateOptions).onError)==null||o.call(a,this.currentResult.error,this.currentResult.variables,this.currentResult.context),(c=(l=this.mutateOptions).onSettled)==null||c.call(l,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context)}}e.listeners&&this.listeners.forEach(({listener:u})=>{u(this.currentResult)})})}};function sve(t){return{mutationKey:t.options.mutationKey,state:t.state}}function ove(t){return{state:t.state,queryKey:t.queryKey,queryHash:t.queryHash}}function ave(t){return t.state.isPaused}function cve(t){return t.state.status==="success"}function lve(t,e={}){const r=[],n=[];if(e.dehydrateMutations!==!1){const i=e.shouldDehydrateMutation||ave;t.getMutationCache().getAll().forEach(s=>{i(s)&&r.push(sve(s))})}if(e.dehydrateQueries!==!1){const i=e.shouldDehydrateQuery||cve;t.getQueryCache().getAll().forEach(s=>{i(s)&&n.push(ove(s))})}return{mutations:r,queries:n}}function uve(t,e,r){if(typeof e!="object"||e===null)return;const n=t.getMutationCache(),i=t.getQueryCache(),s=e.mutations||[],o=e.queries||[];s.forEach(a=>{var c;n.build(t,{...r==null||(c=r.defaultOptions)==null?void 0:c.mutations,mutationKey:a.mutationKey},a.state)}),o.forEach(({queryKey:a,state:c,queryHash:l})=>{var u;const f=i.get(l);if(f){if(f.state.dataUpdatedAt"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?gve:yve;SU.useSyncExternalStore=hd.useSyncExternalStore!==void 0?hd.useSyncExternalStore:bve;CU.exports=SU;var j4=CU.exports;const kU=j4.useSyncExternalStore,aP=k.createContext(void 0),AU=k.createContext(!1);function _U(t,e){return t||(e&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=aP),window.ReactQueryClientContext):aP)}const Gb=({context:t}={})=>{const e=k.useContext(_U(t,k.useContext(AU)));if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},U4=({client:t,children:e,context:r,contextSharing:n=!1})=>{k.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]);const i=_U(r,n);return k.createElement(AU.Provider,{value:!r&&n},k.createElement(i.Provider,{value:t},e))},PU=k.createContext(!1),TU=()=>k.useContext(PU);PU.Provider;function wve(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}const xve=k.createContext(wve()),IU=()=>k.useContext(xve);function OU(t,e){return typeof t=="function"?t(...e):!!t}const Eve=(t,e)=>{(t.suspense||t.useErrorBoundary)&&(e.isReset()||(t.retryOnMount=!1))},Cve=t=>{k.useEffect(()=>{t.clearReset()},[t])},Sve=({result:t,errorResetBoundary:e,useErrorBoundary:r,query:n})=>t.isError&&!e.isReset()&&!t.isFetching&&OU(r,[t.error,n]),kve=t=>{t.suspense&&typeof t.staleTime!="number"&&(t.staleTime=1e3)},Ave=(t,e)=>t.isLoading&&t.isFetching&&!e,_ve=(t,e,r)=>(t==null?void 0:t.suspense)&&Ave(e,r),Pve=(t,e,r)=>e.fetchOptimistic(t).then(({data:n})=>{t.onSuccess==null||t.onSuccess(n),t.onSettled==null||t.onSettled(n,null)}).catch(n=>{r.clearReset(),t.onError==null||t.onError(n),t.onSettled==null||t.onSettled(void 0,n)});function RU(t,e){const r=Gb({context:t.context}),n=TU(),i=IU(),s=r.defaultQueryOptions(t);s._optimisticResults=n?"isRestoring":"optimistic",s.onError&&(s.onError=wt.batchCalls(s.onError)),s.onSuccess&&(s.onSuccess=wt.batchCalls(s.onSuccess)),s.onSettled&&(s.onSettled=wt.batchCalls(s.onSettled)),kve(s),Eve(s,i),Cve(i);const[o]=k.useState(()=>new e(r,s)),a=o.getOptimisticResult(s);if(kU(k.useCallback(c=>{const l=n?()=>{}:o.subscribe(wt.batchCalls(c));return o.updateResult(),l},[o,n]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),k.useEffect(()=>{o.setOptions(s,{listeners:!1})},[s,o]),_ve(s,a,n))throw Pve(s,o,i);if(Sve({result:a,errorResetBoundary:i,useErrorBoundary:s.useErrorBoundary,query:o.getCurrentQuery()}))throw a.error;return s.notifyOnChangeProps?a:o.trackResult(a)}function li(t,e,r){const n=bf(t,e,r);return RU(n,B4)}function Tve(t,e,r){const n=pU(t,e,r),i=Gb({context:n.context}),[s]=k.useState(()=>new ive(i,n));k.useEffect(()=>{s.setOptions(n)},[s,n]);const o=kU(k.useCallback(c=>s.subscribe(wt.batchCalls(c)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),a=k.useCallback((c,l)=>{s.mutate(c,l).catch(Ive)},[s]);if(o.error&&OU(s.options.useErrorBoundary,[o.error]))throw o.error;return{...o,mutate:a,mutateAsync:o.mutate}}function Ive(){}function Ove(t,e,r){const n=bf(t,e,r);return RU(n,nve)}const Rve=["added","removed","updated"];function cP(t){return Rve.includes(t)}async function $ve({queryClient:t,persister:e,maxAge:r=1e3*60*60*24,buster:n="",hydrateOptions:i}){try{const s=await e.restoreClient();if(s)if(s.timestamp){const o=Date.now()-s.timestamp>r,a=s.buster!==n;o||a?e.removeClient():uve(t,s.clientState,i)}else e.removeClient()}catch{e.removeClient()}}async function lP({queryClient:t,persister:e,buster:r="",dehydrateOptions:n}){const i={buster:r,timestamp:Date.now(),clientState:lve(t,n)};await e.persistClient(i)}function Mve(t){const e=t.queryClient.getQueryCache().subscribe(n=>{cP(n.type)&&lP(t)}),r=t.queryClient.getMutationCache().subscribe(n=>{cP(n.type)&&lP(t)});return()=>{e(),r()}}function Nve(t){let e=!1,r;const n=()=>{e=!0,r==null||r()},i=$ve(t).then(()=>{e||(r=Mve(t))});return[n,i]}var $U={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(c,l,u){this.fn=c,this.context=l,this.once=u||!1}function s(c,l,u,f,d){if(typeof u!="function")throw new TypeError("The listener must be a function");var h=new i(u,f||c,d),p=r?r+l:l;return c._events[p]?c._events[p].fn?c._events[p]=[c._events[p],h]:c._events[p].push(h):(c._events[p]=h,c._eventsCount++),c}function o(c,l){--c._eventsCount===0?c._events=new n:delete c._events[l]}function a(){this._events=new n,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],u,f;if(this._eventsCount===0)return l;for(f in u=this._events)e.call(u,f)&&l.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(u)):l},a.prototype.listeners=function(l){var u=r?r+l:l,f=this._events[u];if(!f)return[];if(f.fn)return[f.fn];for(var d=0,h=f.length,p=new Array(h);dt,Kb=t=>t,Fve=()=>`viem@${Lve}`;class le extends Error{constructor(e,r={}){var s;super(),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ViemError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:Fve()});const n=r.cause instanceof le?r.cause.details:(s=r.cause)!=null&&s.message?r.cause.message:r.details,i=r.cause instanceof le&&r.cause.docsPath||r.docsPath;this.message=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...i?[`Docs: https://viem.sh${i}.html${r.docsSlug?`#${r.docsSlug}`:""}`]:[],...n?[`Details: ${n}`]:[],`Version: ${this.version}`].join(` -`),r.cause&&(this.cause=r.cause),this.details=n,this.docsPath=i,this.metaMessages=r.metaMessages,this.shortMessage=e}walk(e){return NU(this,e)}}function NU(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t?NU(t.cause,e):e?null:t}class E3 extends le{constructor({blockNumber:e,chain:r,contract:n}){super(`Chain "${r.name}" does not support contract "${n.name}".`,{metaMessages:["This could be due to any of the following:",...e&&n.blockCreated&&n.blockCreated>e?[`- The contract "${n.name}" was not deployed until block ${n.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${n.name}" configured.`]]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDoesNotSupportContract"})}}class jve extends le{constructor({chain:e,currentChainId:r}){super(`The current chain of the wallet (id: ${r}) does not match the target chain for the transaction (id: ${e.id} – ${e.name}).`,{metaMessages:[`Current Chain ID: ${r}`,`Expected Chain ID: ${e.id} – ${e.name}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainMismatchError"})}}class Uve extends le{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(` -`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotFoundError"})}}class DU extends le{constructor(){super("No chain was provided to the Client."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ClientChainNotConfiguredError"})}}function LU({chain:t,currentChainId:e}){if(!t)throw new Uve;if(e!==t.id)throw new jve({chain:t,currentChainId:e})}function z4(t,e={}){const{fees:r=t.fees,formatters:n=t.formatters,serializers:i=t.serializers}=e;return{...t,fees:r,formatters:n,serializers:i}}function zd({blockNumber:t,chain:e,contract:r}){var i;const n=(i=e==null?void 0:e.contracts)==null?void 0:i[r];if(!n)throw new E3({chain:e,contract:{name:r}});if(t&&n.blockCreated&&n.blockCreated>t)throw new E3({blockNumber:t,chain:e,contract:{name:r,blockCreated:n.blockCreated}});return n.address}class zve extends le{constructor({max:e,min:r,signed:n,size:i,value:s}){super(`Number "${s}" is not in safe ${i?`${i*8}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${r} to ${e})`:`(above ${r})`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntegerOutOfRangeError"})}}class Wve extends le{constructor(e){super(`Hex value "${e}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidHexBooleanError"})}}class Hve extends le{constructor({givenSize:e,maxSize:r}){super(`Size cannot exceed ${r} bytes. Given size: ${e} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeOverflowError"})}}function So(t,{strict:e=!0}={}){return!t||typeof t!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x")}function Wr(t){return So(t,{strict:!1})?Math.ceil((t.length-2)/2):t.length}function Bf(t,{dir:e="left"}={}){let r=typeof t=="string"?t.replace("0x",""):t,n=0;for(let i=0;ir*2)throw new FU({size:Math.ceil(n.length/2),targetSize:r,type:"hex"});return`0x${n[e==="right"?"padEnd":"padStart"](r*2,"0")}`}function qve(t,{dir:e,size:r=32}={}){if(r===null)return t;if(t.length>r)throw new FU({size:t.length,targetSize:r,type:"bytes"});const n=new Uint8Array(r);for(let i=0;ie.toString(16).padStart(2,"0"));function Ca(t,e={}){return typeof t=="number"||typeof t=="bigint"?ze(t,e):typeof t=="string"?W4(t,e):typeof t=="boolean"?jU(t,e):p1(t,e)}function jU(t,e={}){const r=`0x${Number(t)}`;return typeof e.size=="number"?(Vc(r,{size:e.size}),Wd(r,{size:e.size})):r}function p1(t,e={}){let r="";for(let i=0;is||ie)throw new Hve({givenSize:Wr(t),maxSize:e})}function Qb(t,e={}){const{signed:r}=e;e.size&&Vc(t,{size:e.size});const n=BigInt(t);if(!r)return n;const i=(t.length-2)/2,s=(1n<typeof n=="string"?n:zU(n));return{...t,baseFeePerGas:t.baseFeePerGas?BigInt(t.baseFeePerGas):null,difficulty:t.difficulty?BigInt(t.difficulty):void 0,gasLimit:t.gasLimit?BigInt(t.gasLimit):void 0,gasUsed:t.gasUsed?BigInt(t.gasUsed):void 0,hash:t.hash?t.hash:null,logsBloom:t.logsBloom?t.logsBloom:null,nonce:t.nonce?t.nonce:null,number:t.number?BigInt(t.number):null,size:t.size?BigInt(t.size):void 0,timestamp:t.timestamp?BigInt(t.timestamp):void 0,transactions:e,totalDifficulty:t.totalDifficulty?BigInt(t.totalDifficulty):null}}function Os(t,{args:e,eventName:r}={}){return{...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,logIndex:t.logIndex?Number(t.logIndex):null,transactionHash:t.transactionHash?t.transactionHash:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,...r?{args:e,eventName:r}:{}}}const Zve={"0x0":"reverted","0x1":"success"};function eme(t){return{...t,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,contractAddress:t.contractAddress?t.contractAddress:null,cumulativeGasUsed:t.cumulativeGasUsed?BigInt(t.cumulativeGasUsed):null,effectiveGasPrice:t.effectiveGasPrice?BigInt(t.effectiveGasPrice):null,gasUsed:t.gasUsed?BigInt(t.gasUsed):null,logs:t.logs?t.logs.map(e=>Os(e)):null,to:t.to?t.to:null,transactionIndex:t.transactionIndex?Fn(t.transactionIndex):null,status:t.status?Zve[t.status]:null,type:t.type?UU[t.type]||t.type:null}}const tme={legacy:"0x0",eip2930:"0x1",eip1559:"0x2"};function Yb(t){return{...t,gas:typeof t.gas<"u"?ze(t.gas):void 0,gasPrice:typeof t.gasPrice<"u"?ze(t.gasPrice):void 0,maxFeePerGas:typeof t.maxFeePerGas<"u"?ze(t.maxFeePerGas):void 0,maxPriorityFeePerGas:typeof t.maxPriorityFeePerGas<"u"?ze(t.maxPriorityFeePerGas):void 0,nonce:typeof t.nonce<"u"?ze(t.nonce):void 0,type:typeof t.type<"u"?tme[t.type]:void 0,value:typeof t.value<"u"?ze(t.value):void 0}}class v1 extends le{constructor({address:e}){super(`Address "${e}" is invalid.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAddressError"})}}const rme={gwei:9,wei:18},nme={ether:-9,wei:9};function HU(t,e){let r=t.toString();const n=r.startsWith("-");n&&(r=r.slice(1)),r=r.padStart(e,"0");let[i,s]=[r.slice(0,r.length-e),r.slice(r.length-e)];return s=s.replace(/(0+)$/,""),`${n?"-":""}${i||"0"}${s?`.${s}`:""}`}function ii(t,e="wei"){return HU(t,nme[e])}class wf extends le{constructor({cause:e,message:r}={}){var i;const n=(i=r==null?void 0:r.replace("execution reverted: ",""))==null?void 0:i.replace("execution reverted","");super(`Execution reverted ${n?`with reason: ${n}`:"for an unknown reason"}.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ExecutionRevertedError"})}}Object.defineProperty(wf,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(wf,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class Xy extends le{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${ii(r)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooHigh"})}}Object.defineProperty(Xy,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class C3 extends le{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${ii(r)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooLow"})}}Object.defineProperty(C3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class S3 extends le{constructor({cause:e,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}is higher than the next one expected.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooHighError"})}}Object.defineProperty(S3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class k3 extends le{constructor({cause:e,nonce:r}={}){super([`Nonce provided for the transaction ${r?`(${r}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(` -`),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooLowError"})}}Object.defineProperty(k3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class A3 extends le{constructor({cause:e,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}exceeds the maximum allowed nonce.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceMaxValueError"})}}Object.defineProperty(A3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class _3 extends le{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(` -`),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InsufficientFundsError"})}}Object.defineProperty(_3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds/});class P3 extends le{constructor({cause:e,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooHighError"})}}Object.defineProperty(P3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class T3 extends le{constructor({cause:e,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction is too low.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooLowError"})}}Object.defineProperty(T3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class I3 extends le{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionTypeNotSupportedError"})}}Object.defineProperty(I3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class Zy extends le{constructor({cause:e,maxPriorityFeePerGas:r,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${r?` = ${ii(r)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${ii(n)} gwei`:""}).`].join(` -`),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TipAboveFeeCapError"})}}Object.defineProperty(Zy,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class Jb extends le{constructor({cause:e}){super(`An error occurred while executing: ${e==null?void 0:e.shortMessage}`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownNodeError"})}}const ime=/^0x[a-fA-F0-9]{40}$/;function pd(t){return ime.test(t)}function oa(t){return typeof t[0]=="string"?q4(t):sme(t)}function sme(t){let e=0;for(const i of t)e+=i.length;const r=new Uint8Array(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function q4(t){return`0x${t.reduce((e,r)=>e+r.replace("0x",""),"")}`}function V4(t,e="wei"){return HU(t,rme[e])}function pp(t){const e=Object.entries(t).map(([n,i])=>i===void 0||i===!1?null:[n,i]).filter(Boolean),r=e.reduce((n,[i])=>Math.max(n,i.length),0);return e.map(([n,i])=>` ${`${n}:`.padEnd(r+1)} ${i}`).join(` -`)}class ome extends le{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(` -`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeConflictError"})}}class ame extends le{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",pp(e),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- a Legacy Transaction with `gasPrice`"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSerializableTransactionError"})}}class cme extends le{constructor(e,{account:r,docsPath:n,chain:i,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d}){const h=pp({chain:i&&`${i==null?void 0:i.name} (id: ${i==null?void 0:i.id})`,from:r==null?void 0:r.address,to:f,value:typeof d<"u"&&`${V4(d)} ${(i==null?void 0:i.nativeCurrency.symbol)||"ETH"}`,data:s,gas:o,gasPrice:typeof a<"u"&&`${ii(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${ii(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${ii(l)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Request Arguments:",h].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionExecutionError"}),this.cause=e}}class qU extends le{constructor({blockHash:e,blockNumber:r,blockTag:n,hash:i,index:s}){let o="Transaction";n&&s!==void 0&&(o=`Transaction at block time "${n}" at index "${s}"`),e&&s!==void 0&&(o=`Transaction at block hash "${e}" at index "${s}"`),r&&s!==void 0&&(o=`Transaction at block number "${r}" at index "${s}"`),i&&(o=`Transaction with hash "${i}"`),super(`${o} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionNotFoundError"})}}class VU extends le{constructor({hash:e}){super(`Transaction receipt with hash "${e}" could not be found. The Transaction may not be processed on a block yet.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionReceiptNotFoundError"})}}class lme extends le{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WaitForTransactionReceiptTimeoutError"})}}function ume(t){if(t.type)return t.type;if(typeof t.maxFeePerGas<"u"||typeof t.maxPriorityFeePerGas<"u")return"eip1559";if(typeof t.gasPrice<"u")return typeof t.accessList<"u"?"eip2930":"legacy";throw new ame({transaction:t})}const fme=z4({id:5,network:"goerli",name:"Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://eth-goerli.g.alchemy.com/v2"],webSocket:["wss://eth-goerli.g.alchemy.com/v2"]},infura:{http:["https://goerli.infura.io/v3"],webSocket:["wss://goerli.infura.io/ws/v3"]},default:{http:["https://rpc.ankr.com/eth_goerli"]},public:{http:["https://rpc.ankr.com/eth_goerli"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://goerli.etherscan.io"},default:{name:"Etherscan",url:"https://goerli.etherscan.io"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0x56522D00C410a43BFfDF00a9A569489297385790",blockCreated:8765204},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:6507670}},testnet:!0}),dme=z4({id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xc0497E381f536Be9ce14B0dD3817cBcAe57d2F62",blockCreated:16966585},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),hme=z4({id:137,name:"Polygon",network:"matic",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}});var pme=Object.defineProperty,vme=(t,e,r)=>e in t?pme(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ke=(t,e,r)=>(vme(t,typeof e!="symbol"?e+"":e,r),r),G4=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},He=(t,e,r)=>(G4(t,e,"read from private field"),r?r.call(t):e.get(t)),Br=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},Es=(t,e,r,n)=>(G4(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),Lr=(t,e,r)=>(G4(t,e,"access private method"),r),vp=class extends MU{constructor({chains:t=[dme,fme],options:e}){super(),Ke(this,"chains"),Ke(this,"options"),Ke(this,"storage"),this.chains=t,this.options=e}getBlockExplorerUrls(t){const{default:e,...r}=t.blockExplorers??{};if(e)return[e.url,...Object.values(r).map(n=>n.url)]}isChainUnsupported(t){return!this.chains.some(e=>e.id===t)}setStorage(t){this.storage=t}},GU=class extends Error{constructor({chainId:t,connectorId:e}){super(`Chain "${t}" not configured for connector "${e}".`),Ke(this,"name","ChainNotConfiguredForConnectorError")}},qa=class extends Error{constructor(){super(...arguments),Ke(this,"name","ConnectorNotFoundError"),Ke(this,"message","Connector not found")}};function Ul(t){return typeof t=="string"?Number.parseInt(t,t.trim().substring(0,2)==="0x"?16:10):typeof t=="bigint"?Number(t):t}function Gc(t,{includeName:e=!1}={}){if(t.type!=="function"&&t.type!=="event"&&t.type!=="error")throw new Pme(t.type);return`${t.name}(${Xb(t.inputs,{includeName:e})})`}function Xb(t,{includeName:e=!1}={}){return t?t.map(r=>mme(r,{includeName:e})).join(e?", ":","):""}function mme(t,{includeName:e}){return t.type.startsWith("tuple")?`(${Xb(t.components,{includeName:e})})${t.type.slice(5)}`:t.type+(e&&t.name?` ${t.name}`:"")}class yme extends le{constructor({docsPath:e}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(` -`),{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorNotFoundError"})}}class uP extends le{constructor({docsPath:e}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(` -`),{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorParamsNotFoundError"})}}class K4 extends le{constructor({data:e,params:r,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join(` -`),{metaMessages:[`Params: (${Xb(r,{includeName:!0})})`,`Data: ${e} (${n} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e,this.params=r,this.size=n}}class Zb extends le{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingZeroDataError"})}}class gme extends le{constructor({expectedLength:e,givenLength:r,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${e}`,`Given length: ${r}`].join(` -`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingArrayLengthMismatchError"})}}class bme extends le{constructor({expectedSize:e,value:r}){super(`Size of bytes "${r}" (bytes${Wr(r)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingBytesSizeMismatchError"})}}class wme extends le{constructor({expectedLength:e,givenLength:r}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${r}`].join(` -`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingLengthMismatchError"})}}class KU extends le{constructor(e,{docsPath:r}){super([`Encoded error signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${e}.`].join(` -`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}}class xme extends le{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureEmptyTopicsError"})}}class Eme extends le{constructor(e,{docsPath:r}){super([`Encoded event signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${e}.`].join(` -`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureNotFoundError"})}}class fP extends le{constructor(e,{docsPath:r}={}){super([`Event ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(` -`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventNotFoundError"})}}class eg extends le{constructor(e,{docsPath:r}={}){super([`Function ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(` -`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionNotFoundError"})}}class Cme extends le{constructor(e,{docsPath:r}){super([`Function "${e}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(` -`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionOutputsNotFoundError"})}}class Sme extends le{constructor({expectedSize:e,givenSize:r}){super(`Expected bytes${e}, got bytes${r}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BytesSizeMismatchError"})}}class su extends le{constructor({abiItem:e,data:r,params:n,size:i}){super([`Data size of ${i} bytes is too small for non-indexed event parameters.`].join(` -`),{metaMessages:[`Params: (${Xb(n,{includeName:!0})})`,`Data: ${r} (${i} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e,this.data=r,this.params=n,this.size=i}}class Hd extends le{constructor({abiItem:e,param:r}){super([`Expected a topic for indexed event parameter${r.name?` "${r.name}"`:""} on event "${Gc(e,{includeName:!0})}".`].join(` -`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e}}class kme extends le{constructor(e,{docsPath:r}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(` -`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiEncodingType"})}}class Ame extends le{constructor(e,{docsPath:r}){super([`Type "${e}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(` -`),{docsPath:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiDecodingType"})}}class _me extends le{constructor(e){super([`Value "${e}" is not a valid array.`].join(` -`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidArrayError"})}}class Pme extends le{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(` -`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidDefinitionTypeError"})}}class Tme extends le{constructor(e){super(`Filter type "${e}" is not supported.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FilterTypeNotSupportedError"})}}const Ime=/((function|event)\s)?(.*)(\((.*)\))/;function QU(t){const e=t.match(Ime),r=(e==null?void 0:e[2])||void 0,n=e==null?void 0:e[3],i=(e==null?void 0:e[5])||void 0;return{type:r,name:n,params:i}}function Ome(t){return QU(t).name}function Rme(t){const e=QU(t).params,r=e==null?void 0:e.split(",").map(n=>n.trim().split(" "));return r==null?void 0:r.map(n=>({type:n[0],name:n[1]==="indexed"?n[2]:n[1],...n[1]==="indexed"?{indexed:!0}:{}}))}const xv=BigInt(2**32-1),dP=BigInt(32);function $me(t,e=!1){return e?{h:Number(t&xv),l:Number(t>>dP&xv)}:{h:Number(t>>dP&xv)|0,l:Number(t&xv)|0}}function Mme(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;it<>>32-r,Dme=(t,e,r)=>e<>>32-r,Lme=(t,e,r)=>e<>>64-r,Bme=(t,e,r)=>t<>>64-r,[YU,JU,XU]=[[],[],[]],Fme=BigInt(0),kh=BigInt(1),jme=BigInt(2),Ume=BigInt(7),zme=BigInt(256),Wme=BigInt(113);for(let t=0,e=kh,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],YU.push(2*(5*n+r)),JU.push((t+1)*(t+2)/2%64);let i=Fme;for(let s=0;s<7;s++)e=(e<>Ume)*Wme)%zme,e&jme&&(i^=kh<<(kh<r>32?Lme(t,e,r):Nme(t,e,r),pP=(t,e,r)=>r>32?Bme(t,e,r):Dme(t,e,r);function Vme(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)r[o]=t[o]^t[o+10]^t[o+20]^t[o+30]^t[o+40];for(let o=0;o<10;o+=2){const a=(o+8)%10,c=(o+2)%10,l=r[c],u=r[c+1],f=hP(l,u,1)^r[a],d=pP(l,u,1)^r[a+1];for(let h=0;h<50;h+=10)t[o+h]^=f,t[o+h+1]^=d}let i=t[2],s=t[3];for(let o=0;o<24;o++){const a=JU[o],c=hP(i,s,a),l=pP(i,s,a),u=YU[o];i=t[u],s=t[u+1],t[u]=c,t[u+1]=l}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)r[a]=t[o+a];for(let a=0;a<10;a++)t[o+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=Hme[n],t[1]^=qme[n]}r.fill(0)}class Q4 extends Ej{constructor(e,r,n,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,W_(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=v1e(this.state)}keccak(){Vme(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Hy(this);const{blockLen:r,state:n}=this;e=T4(e);const i=e.length;for(let s=0;s=n&&this.keccak();const o=Math.min(n-this.posOut,s-i);e.set(r.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 W_(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(wj(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,this.state.fill(0)}_cloneInto(e){const{blockLen:r,suffix:n,outputLen:i,rounds:s,enableXOF:o}=this;return e||(e=new Q4(r,n,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=n,e.outputLen=i,e.enableXOF=o,e.destroyed=this.destroyed,e}}const Gme=(t,e,r)=>Cj(()=>new Q4(e,t,r)),Kme=Gme(1,136,256/8);function ei(t,e){const r=e||"hex",n=Kme(So(t,{strict:!1})?iu(t):t);return r==="bytes"?n:Ca(n)}const ZU=t=>ei(iu(t));function ez(t){const e=Ome(t),r=Rme(t)||[];return ZU(`${e}(${r.map(({type:n})=>n).join(",")})`)}function tz(t){return ZU(Gc(t))}const Y4=t=>typeof t=="string"?ez(t):tz(t);function Cr(t,e,r,{strict:n}={}){return So(t,{strict:!1})?Yme(t,e,r,{strict:n}):Qme(t,e,r,{strict:n})}function rz(t,e){if(typeof e=="number"&&e>0&&e>Wr(t)-1)throw new BU({offset:e,position:"start",size:Wr(t)})}function nz(t,e,r){if(typeof e=="number"&&typeof r=="number"&&Wr(t)!==r-e)throw new BU({offset:r,position:"end",size:Wr(t)})}function Qme(t,e,r,{strict:n}={}){rz(t,e);const i=t.slice(e,r);return n&&nz(i,e,r),i}function Yme(t,e,r,{strict:n}={}){rz(t,e);const i=`0x${t.replace("0x","").slice((e??0)*2,(r??t.length)*2)}`;return n&&nz(i,e,r),i}function mp(t,e){if(t.length!==e.length)throw new wme({expectedLength:t.length,givenLength:e.length});const r=Jme({params:t,values:e}),n=X4(r);return n.length===0?"0x":n}function Jme({params:t,values:e}){const r=[];for(let n=0;n0?oa([a,o]):a}}if(i)return{dynamic:!0,encoded:o}}return{dynamic:!1,encoded:oa(s.map(({encoded:o})=>o))}}function eye(t,{param:e}){const[,r]=e.type.split("bytes"),n=Wr(t);if(!r){let i=t;return n%32!==0&&(i=gc(i,{dir:"right",size:Math.ceil((t.length-2)/2/32)*32})),{dynamic:!0,encoded:oa([gc(ze(n,{size:32})),i])}}if(n!==parseInt(r))throw new bme({expectedSize:parseInt(r),value:t});return{dynamic:!1,encoded:gc(t,{dir:"right"})}}function tye(t){return{dynamic:!1,encoded:gc(jU(t))}}function rye(t,{signed:e}){return{dynamic:!1,encoded:ze(t,{size:32,signed:e})}}function nye(t){const e=W4(t),r=Math.ceil(Wr(e)/32),n=[];for(let i=0;ii))}}function e2(t){const e=t.match(/^(.*)\[(\d+)?\]$/);return e?[e[2]?Number(e[2]):null,e[1]]:void 0}const Z4=t=>Cr(typeof t=="string"?ez(t):tz(t),0,4);function yp({abi:t,args:e=[],name:r}){const n=So(r,{strict:!1}),i=t.filter(s=>n?s.type==="function"?Z4(s)===r:s.type==="event"?Y4(s)===r:!1:"name"in s&&s.name===r);if(i.length!==0){if(i.length===1)return i[0];for(const s of i){if(!("inputs"in s))continue;if(!e||e.length===0){if(!s.inputs||s.inputs.length===0)return s;continue}if(!s.inputs||s.inputs.length===0||s.inputs.length!==e.length)continue;if(e.every((a,c)=>{const l="inputs"in s&&s.inputs[c];return l?O3(a,l):!1}))return s}return i[0]}}function O3(t,e){const r=typeof t,n=e.type;switch(n){case"address":return pd(t);case"bool":return r==="boolean";case"function":return r==="string";case"string":return r==="string";default:return n==="tuple"&&"components"in e?Object.values(e.components).every((i,s)=>O3(Object.values(t)[s],i)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(n)?r==="number"||r==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(n)?r==="string"||t instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(n)?Array.isArray(t)&&t.every(i=>O3(i,{...e,type:n.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function gp({abi:t,eventName:e,args:r}){var a;let n=t[0];if(e&&(n=yp({abi:t,args:r,name:e}),!n))throw new fP(e,{docsPath:"/docs/contract/encodeEventTopics"});if(n.type!=="event")throw new fP(void 0,{docsPath:"/docs/contract/encodeEventTopics"});const i=Gc(n),s=Y4(i);let o=[];if(r&&"inputs"in n){const c=(a=n.inputs)==null?void 0:a.filter(u=>"indexed"in u&&u.indexed),l=Array.isArray(r)?r:Object.values(r).length>0?(c==null?void 0:c.map(u=>r[u.name]))??[]:[];l.length>0&&(o=(c==null?void 0:c.map((u,f)=>Array.isArray(l[f])?l[f].map((d,h)=>vP({param:u,value:l[f][h]})):l[f]?vP({param:u,value:l[f]}):null))??[])}return[s,...o]}function vP({param:t,value:e}){if(t.type==="string"||t.type==="bytes")return ei(iu(e));if(t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/))throw new Tme(t.type);return mp([t],[e])}function t2(t,{method:e}){var n,i;const r={};return t.transport.type==="fallback"&&((i=(n=t.transport).onResponse)==null||i.call(n,({method:s,response:o,status:a,transport:c})=>{a==="success"&&e===s&&(r[o]=c.request)})),s=>r[s]||t.request}async function iz(t,{address:e,abi:r,args:n,eventName:i,fromBlock:s,strict:o,toBlock:a}){const c=t2(t,{method:"eth_newFilter"}),l=i?gp({abi:r,args:n,eventName:i}):void 0,u=await t.request({method:"eth_newFilter",params:[{address:e,fromBlock:typeof s=="bigint"?ze(s):s,toBlock:typeof a=="bigint"?ze(a):a,topics:l}]});return{abi:r,args:n,eventName:i,id:u,request:c(u),strict:o,type:"event"}}function ts(t){return typeof t=="string"?{address:t,type:"json-rpc"}:t}function Kc({abi:t,args:e,functionName:r}){let n=t[0];if(r&&(n=yp({abi:t,args:e,name:r}),!n))throw new eg(r,{docsPath:"/docs/contract/encodeFunctionData"});if(n.type!=="function")throw new eg(void 0,{docsPath:"/docs/contract/encodeFunctionData"});const i=Gc(n),s=Z4(i),o="inputs"in n&&n.inputs?mp(n.inputs,e??[]):void 0;return q4([s,o??"0x"])}const sz={1:"An `assert` condition failed.",17:"Arithmic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},sye={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},oye={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function eS(t,e){const r=e?`${e}${t.toLowerCase()}`:t.substring(2).toLowerCase(),n=ei(Vo(r),"bytes"),i=(e?r.substring(`${e}0x`.length):r).split("");for(let s=0;s<40;s+=2)n[s>>1]>>4>=8&&i[s]&&(i[s]=i[s].toUpperCase()),(n[s>>1]&15)>=8&&i[s+1]&&(i[s+1]=i[s+1].toUpperCase());return`0x${i.join("")}`}function jn(t,e){if(!pd(t))throw new v1({address:t});return eS(t,e)}function r2(t,e){if(e==="0x"&&t.length>0)throw new Zb;if(Wr(e)&&Wr(e)<32)throw new K4({data:e,params:t,size:Wr(e)});return aye({data:e,params:t})}function aye({data:t,params:e}){const r=[];let n=0;for(let i=0;i=Wr(t))throw new K4({data:t,params:e,size:Wr(t)});const s=e[i],{consumed:o,value:a}=Ff({data:t,param:s,position:n});r.push(a),n+=o}return r}function Ff({data:t,param:e,position:r}){const n=e2(e.type);if(n){const[s,o]=n;return lye(t,{length:s,param:{...e,type:o},position:r})}if(e.type==="tuple")return pye(t,{param:e,position:r});if(e.type==="string")return hye(t,{position:r});if(e.type.startsWith("bytes"))return fye(t,{param:e,position:r});const i=Cr(t,r,r+32,{strict:!0});if(e.type.startsWith("uint")||e.type.startsWith("int"))return dye(i,{param:e});if(e.type==="address")return cye(i);if(e.type==="bool")return uye(i);throw new Ame(e.type,{docsPath:"/docs/contract/decodeAbiParameters"})}function cye(t){return{consumed:32,value:eS(Cr(t,-20))}}function lye(t,{param:e,length:r,position:n}){if(!r){const o=Fn(Cr(t,n,n+32,{strict:!0})),a=Fn(Cr(t,o,o+32,{strict:!0}));let c=0;const l=[];for(let u=0;u48?Qb(t,{signed:r}):Fn(t,{signed:r})}}function hye(t,{position:e}){const r=Fn(Cr(t,e,e+32,{strict:!0})),n=Fn(Cr(t,r,r+32,{strict:!0}));return n===0?{consumed:32,value:""}:{consumed:32,value:Xve(Bf(Cr(t,r+32,r+32+n,{strict:!0})))}}function pye(t,{param:e,position:r}){const n=e.components.length===0||e.components.some(({name:o})=>!o),i=n?[]:{};let s=0;if(tg(e)){const o=Fn(Cr(t,r,r+32,{strict:!0}));for(let a=0;as.type==="error"&&r===Z4(Gc(s)));if(!i)throw new KU(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:i,args:"inputs"in i&&i.inputs&&i.inputs.length>0?r2(i.inputs,Cr(e,4)):void 0,errorName:i.name}}const Un=(t,e,r)=>JSON.stringify(t,(n,i)=>{const s=typeof i=="bigint"?i.toString():i;return typeof e=="function"?e(n,s):s},r);function oz({abiItem:t,args:e,includeFunctionName:r=!0,includeName:n=!1}){if("name"in t&&"inputs"in t&&t.inputs)return`${r?t.name:""}(${t.inputs.map((i,s)=>`${n&&i.name?`${i.name}: `:""}${typeof e[s]=="object"?Un(e[s]):e[s]}`).join(", ")})`}class az extends le{constructor(e,{account:r,docsPath:n,chain:i,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d}){const h=r?ts(r):void 0,p=pp({from:h==null?void 0:h.address,to:f,value:typeof d<"u"&&`${V4(d)} ${(i==null?void 0:i.nativeCurrency.symbol)||"ETH"}`,data:s,gas:o,gasPrice:typeof a<"u"&&`${ii(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${ii(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${ii(l)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",p].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CallExecutionError"}),this.cause=e}}class mye extends le{constructor(e,{abi:r,args:n,contractAddress:i,docsPath:s,functionName:o,sender:a}){const c=yp({abi:r,args:n,name:o}),l=c?oz({abiItem:c,args:n,includeFunctionName:!1,includeName:!1}):void 0,u=c?Gc(c,{includeName:!0}):void 0,f=pp({address:i&&Bve(i),function:u,args:l&&l!=="()"&&`${[...Array((o==null?void 0:o.length)??0).keys()].map(()=>" ").join("")}${l}`,sender:a});super(e.shortMessage||`An unknown error occurred while executing the contract function "${o}".`,{cause:e,docsPath:s,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Contract Call:",f].filter(Boolean)}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionExecutionError"}),this.abi=r,this.args=n,this.cause=e,this.contractAddress=i,this.functionName=o,this.sender=a}}class R3 extends le{constructor({abi:e,data:r,functionName:n,message:i}){let s,o,a,c;if(r&&r!=="0x")try{o=vye({abi:e,data:r});const{abiItem:u,errorName:f,args:d}=o;if(f==="Error")c=d[0];else if(f==="Panic"){const[h]=d;c=sz[h]}else{const h=u?Gc(u,{includeName:!0}):void 0,p=u&&d?oz({abiItem:u,args:d,includeFunctionName:!1,includeName:!1}):void 0;a=[h?`Error: ${h}`:"",p&&p!=="()"?` ${[...Array((f==null?void 0:f.length)??0).keys()].map(()=>" ").join("")}${p}`:""]}}catch(u){s=u}else i&&(c=i);let l;s instanceof KU&&(l=s.signature,a=[`Unable to decode signature "${l}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${l}.`]),super(c&&c!=="execution reverted"||l?[`The contract function "${n}" reverted with the following ${l?"signature":"reason"}:`,c||l].join(` -`):`The contract function "${n}" reverted.`,{cause:s,metaMessages:a}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=o,this.reason=c,this.signature=l}}class yye extends le{constructor({functionName:e}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${e}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionZeroDataError"})}}class tS extends le{constructor({data:e,message:r}){super(r||""),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RawContractError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}class C0 extends le{constructor({body:e,details:r,headers:n,status:i,url:s}){super("HTTP request failed.",{details:r,metaMessages:[i&&`Status: ${i}`,`URL: ${Kb(s)}`,e&&`Request body: ${Un(e)}`].filter(Boolean)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"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=n,this.status=i,this.url=s}}class gye extends le{constructor({body:e,details:r,url:n}){super("WebSocket request failed.",{details:r,metaMessages:[`URL: ${Kb(n)}`,`Request body: ${Un(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WebSocketRequestError"})}}class rS extends le{constructor({body:e,error:r,url:n}){super("RPC Request failed.",{cause:r,details:r.message,metaMessages:[`URL: ${Kb(n)}`,`Request body: ${Un(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=r.code}}class $3 extends le{constructor({body:e,url:r}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${Kb(r)}`,`Request body: ${Un(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TimeoutError"})}}const bye=-1;class ui extends le{constructor(e,{code:r,docsPath:n,metaMessages:i,shortMessage:s}){super(s,{cause:e,docsPath:n,metaMessages:i||(e==null?void 0:e.metaMessages)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=e.name,this.code=e instanceof rS?e.code:r??bye}}class qd extends ui{constructor(e,r){super(e,r),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderRpcError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=r.data}}class m1 extends ui{constructor(e){super(e,{code:m1.code,shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ParseRpcError"})}}Object.defineProperty(m1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class y1 extends ui{constructor(e){super(e,{code:y1.code,shortMessage:"JSON is not a valid request object."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidRequestRpcError"})}}Object.defineProperty(y1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class g1 extends ui{constructor(e){super(e,{code:g1.code,shortMessage:"The method does not exist / is not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotFoundRpcError"})}}Object.defineProperty(g1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class b1 extends ui{constructor(e){super(e,{code:b1.code,shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(` -`)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParamsRpcError"})}}Object.defineProperty(b1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class vd extends ui{constructor(e){super(e,{code:vd.code,shortMessage:"An internal error was received."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InternalRpcError"})}}Object.defineProperty(vd,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class ou extends ui{constructor(e){super(e,{code:ou.code,shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(` -`)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidInputRpcError"})}}Object.defineProperty(ou,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class w1 extends ui{constructor(e){super(e,{code:w1.code,shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(w1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class Oc extends ui{constructor(e){super(e,{code:Oc.code,shortMessage:"Requested resource not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceUnavailableRpcError"})}}Object.defineProperty(Oc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class x1 extends ui{constructor(e){super(e,{code:x1.code,shortMessage:"Transaction creation failed."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionRejectedRpcError"})}}Object.defineProperty(x1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class E1 extends ui{constructor(e){super(e,{code:E1.code,shortMessage:"Method is not implemented."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotSupportedRpcError"})}}Object.defineProperty(E1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class C1 extends ui{constructor(e){super(e,{code:C1.code,shortMessage:"Request exceeds defined limit."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"LimitExceededRpcError"})}}Object.defineProperty(C1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class S1 extends ui{constructor(e){super(e,{code:S1.code,shortMessage:"Version of JSON-RPC protocol is not supported."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"JsonRpcVersionUnsupportedError"})}}Object.defineProperty(S1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class Or extends qd{constructor(e){super(e,{code:Or.code,shortMessage:"User rejected the request."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UserRejectedRequestError"})}}Object.defineProperty(Or,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class k1 extends qd{constructor(e){super(e,{code:k1.code,shortMessage:"The requested method and/or account has not been authorized by the user."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnauthorizedProviderError"})}}Object.defineProperty(k1,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class A1 extends qd{constructor(e){super(e,{code:A1.code,shortMessage:"The Provider does not support the requested method."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnsupportedProviderMethodError"})}}Object.defineProperty(A1,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class _1 extends qd{constructor(e){super(e,{code:_1.code,shortMessage:"The Provider is disconnected from all chains."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderDisconnectedError"})}}Object.defineProperty(_1,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class P1 extends qd{constructor(e){super(e,{code:P1.code,shortMessage:"The Provider is not connected to the requested chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDisconnectedError"})}}Object.defineProperty(P1,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class aa extends qd{constructor(e){super(e,{code:aa.code,shortMessage:"An error occurred when attempting to switch chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainError"})}}Object.defineProperty(aa,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class wye extends ui{constructor(e){super(e,{shortMessage:"An unknown RPC error occurred."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownRpcError"})}}const xye=3;function T1(t,{abi:e,address:r,args:n,docsPath:i,functionName:s,sender:o}){const{code:a,data:c,message:l,shortMessage:u}=t instanceof tS?t:t instanceof le?t.walk(d=>"data"in d)||t.walk():{};let f=t;return t instanceof Zb?f=new yye({functionName:s}):[xye,vd.code].includes(a)&&(c||l||u)&&(f=new R3({abi:e,data:typeof c=="object"?c.data:c,functionName:s,message:u??l})),new mye(f,{abi:e,args:n,contractAddress:r,docsPath:i,functionName:s,sender:o})}class Vd extends le{constructor({docsPath:e}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the WalletClient."].join(` -`),{docsPath:e,docsSlug:"account"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountNotFoundError"})}}class Eye extends le{constructor(e,{account:r,docsPath:n,chain:i,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d}){const h=pp({from:r==null?void 0:r.address,to:f,value:typeof d<"u"&&`${V4(d)} ${(i==null?void 0:i.nativeCurrency.symbol)||"ETH"}`,data:s,gas:o,gasPrice:typeof a<"u"&&`${ii(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${ii(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${ii(l)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",h].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EstimateGasExecutionError"}),this.cause=e}}function nS(t,e){const r=(t.details||"").toLowerCase(),n=t.walk(i=>i.code===wf.code);return n instanceof le?new wf({cause:t,message:n.details}):wf.nodeMessage.test(r)?new wf({cause:t,message:t.details}):Xy.nodeMessage.test(r)?new Xy({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):C3.nodeMessage.test(r)?new C3({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):S3.nodeMessage.test(r)?new S3({cause:t,nonce:e==null?void 0:e.nonce}):k3.nodeMessage.test(r)?new k3({cause:t,nonce:e==null?void 0:e.nonce}):A3.nodeMessage.test(r)?new A3({cause:t,nonce:e==null?void 0:e.nonce}):_3.nodeMessage.test(r)?new _3({cause:t}):P3.nodeMessage.test(r)?new P3({cause:t,gas:e==null?void 0:e.gas}):T3.nodeMessage.test(r)?new T3({cause:t,gas:e==null?void 0:e.gas}):I3.nodeMessage.test(r)?new I3({cause:t}):Zy.nodeMessage.test(r)?new Zy({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas,maxPriorityFeePerGas:e==null?void 0:e.maxPriorityFeePerGas}):new Jb({cause:t})}function Cye(t,{docsPath:e,...r}){let n=nS(t,r);return n instanceof Jb&&(n=t),new Eye(n,{docsPath:e,...r})}function iS(t,{format:e}){return e?Object.keys(e({})).reduce((n,i)=>(t!=null&&t.hasOwnProperty(i)&&(n[i]=t[i]),n),{}):{}}function bp(t){const{account:e,gasPrice:r,maxFeePerGas:n,maxPriorityFeePerGas:i,to:s}=t,o=e?ts(e):void 0;if(o&&!pd(o.address))throw new v1({address:o.address});if(s&&!pd(s))throw new v1({address:s});if(typeof r<"u"&&(typeof n<"u"||typeof i<"u"))throw new ome;if(n&&n>2n**256n-1n)throw new Xy({maxFeePerGas:n});if(i&&n&&i>n)throw new Zy({maxFeePerGas:n,maxPriorityFeePerGas:i})}class Sye extends le{constructor(){super("`baseFeeMultiplier` must be greater than 1."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseFeeScalarError"})}}class sS extends le{constructor(){super("Chain does not support EIP-1559 fees."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip1559FeesNotSupportedError"})}}class kye extends le{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${ii(e)} gwei).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MaxFeePerGasTooLowError"})}}class Aye extends le{constructor({blockHash:e,blockNumber:r}){let n="Block";e&&(n=`Block at hash "${e}"`),r&&(n=`Block at number "${r}"`),super(`${n} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlockNotFoundError"})}}async function Rc(t,{blockHash:e,blockNumber:r,blockTag:n,includeTransactions:i}={}){var u,f,d;const s=n??"latest",o=i??!1,a=r!==void 0?ze(r):void 0;let c=null;if(e?c=await t.request({method:"eth_getBlockByHash",params:[e,o]}):c=await t.request({method:"eth_getBlockByNumber",params:[a||s,o]}),!c)throw new Aye({blockHash:e,blockNumber:r});return(((d=(f=(u=t.chain)==null?void 0:u.formatters)==null?void 0:f.block)==null?void 0:d.format)||WU)(c)}async function oS(t){const e=await t.request({method:"eth_gasPrice"});return BigInt(e)}async function _ye(t,e){return cz(t,e)}async function cz(t,e){var s,o,a;const{block:r,chain:n=t.chain,request:i}=e||{};if(typeof((s=n==null?void 0:n.fees)==null?void 0:s.defaultPriorityFee)=="function"){const c=r||await Rc(t);return n.fees.defaultPriorityFee({block:c,client:t,request:i})}else if((o=n==null?void 0:n.fees)!=null&&o.defaultPriorityFee)return(a=n==null?void 0:n.fees)==null?void 0:a.defaultPriorityFee;try{const c=await t.request({method:"eth_maxPriorityFeePerGas"});return Qb(c)}catch{const[c,l]=await Promise.all([r?Promise.resolve(r):Rc(t),oS(t)]);if(typeof c.baseFeePerGas!="bigint")throw new sS;const u=l-c.baseFeePerGas;return u<0n?0n:u}}async function Pye(t,e){return M3(t,e)}async function M3(t,e){var d;const{block:r,chain:n=t.chain,request:i,type:s="eip1559"}=e||{},o=await(async()=>{var h,p;return typeof((h=n==null?void 0:n.fees)==null?void 0:h.baseFeeMultiplier)=="function"?n.fees.baseFeeMultiplier({block:r,client:t,request:i}):((p=n==null?void 0:n.fees)==null?void 0:p.baseFeeMultiplier)??1.2})();if(o<1)throw new Sye;const c=10**o.toString().split(".")[1].length,l=h=>h*BigInt(o*c)/BigInt(c),u=r||await Rc(t);if(typeof((d=n==null?void 0:n.fees)==null?void 0:d.estimateFeesPerGas)=="function")return n.fees.estimateFeesPerGas({block:r,client:t,multiply:l,request:i,type:s});if(s==="eip1559"){if(typeof u.baseFeePerGas!="bigint")throw new sS;const h=i!=null&&i.maxPriorityFeePerGas?i.maxPriorityFeePerGas:await cz(t,{block:u,chain:n,request:i}),p=l(u.baseFeePerGas);return{maxFeePerGas:(i==null?void 0:i.maxFeePerGas)??p+h,maxPriorityFeePerGas:h}}return{gasPrice:(i==null?void 0:i.gasPrice)??l(await oS(t))}}async function lz(t,{address:e,blockTag:r="latest",blockNumber:n}){const i=await t.request({method:"eth_getTransactionCount",params:[e,n?ze(n):r]});return Fn(i)}async function n2(t,e){const{account:r=t.account,chain:n,gas:i,nonce:s,type:o}=e;if(!r)throw new Vd;const a=ts(r),c=await Rc(t,{blockTag:"latest"}),l={...e,from:a.address};if(typeof s>"u"&&(l.nonce=await lz(t,{address:a.address,blockTag:"pending"})),typeof o>"u")try{l.type=ume(l)}catch{l.type=typeof c.baseFeePerGas=="bigint"?"eip1559":"legacy"}if(l.type==="eip1559"){const{maxFeePerGas:u,maxPriorityFeePerGas:f}=await M3(t,{block:c,chain:n,request:l});if(typeof e.maxPriorityFeePerGas>"u"&&e.maxFeePerGas&&e.maxFeePerGas"u"&&(l.gas=await aS(t,{...l,account:{address:a.address,type:"json-rpc"}})),bp(l),l}async function aS(t,e){var i,s,o;const r=e.account??t.account;if(!r)throw new Vd({docsPath:"/docs/actions/public/estimateGas"});const n=ts(r);try{const{accessList:a,blockNumber:c,blockTag:l,data:u,gas:f,gasPrice:d,maxFeePerGas:h,maxPriorityFeePerGas:p,nonce:v,to:m,value:g,...y}=n.type==="local"?await n2(t,e):e,C=(c?ze(c):void 0)||l;bp(e);const A=((o=(s=(i=t.chain)==null?void 0:i.formatters)==null?void 0:s.transactionRequest)==null?void 0:o.format)||Yb,O=A({...iS(y,{format:A}),from:n.address,accessList:a,data:u,gas:f,gasPrice:d,maxFeePerGas:h,maxPriorityFeePerGas:p,nonce:v,to:m,value:g}),w=await t.request({method:"eth_estimateGas",params:C?[O,C]:[O]});return BigInt(w)}catch(a){throw Cye(a,{...e,account:n,chain:t.chain})}}async function Tye(t,{abi:e,address:r,args:n,functionName:i,...s}){const o=Kc({abi:e,args:n,functionName:i});try{return await aS(t,{data:o,to:r,...s})}catch(a){const c=s.account?ts(s.account):void 0;throw T1(a,{abi:e,address:r,args:n,docsPath:"/docs/contract/estimateContractGas",functionName:i,sender:c==null?void 0:c.address})}}const gx="/docs/contract/decodeFunctionResult";function Gd({abi:t,args:e,functionName:r,data:n}){let i=t[0];if(r&&(i=yp({abi:t,args:e,name:r}),!i))throw new eg(r,{docsPath:gx});if(i.type!=="function")throw new eg(void 0,{docsPath:gx});if(!i.outputs)throw new Cme(i.name,{docsPath:gx});const s=r2(i.outputs,n);if(s&&s.length>1)return s;if(s&&s.length===1)return s[0]}const Iye="modulepreload",Oye=function(t,e){return new URL(t,e).href},mP={},cS=function(e,r,n){if(!r||r.length===0)return e();const i=document.getElementsByTagName("link");return Promise.all(r.map(s=>{if(s=Oye(s,n),s in mP)return;mP[s]=!0;const o=s.endsWith(".css"),a=o?'[rel="stylesheet"]':"";if(!!n)for(let u=i.length-1;u>=0;u--){const f=i[u];if(f.href===s&&(!o||f.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${s}"]${a}`))return;const l=document.createElement("link");if(l.rel=o?"stylesheet":Iye,o||(l.as="script",l.crossOrigin=""),l.href=s,document.head.appendChild(l),o)return new Promise((u,f)=>{l.addEventListener("load",u),l.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>e()).catch(s=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s})},N3=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],uz=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"}],fz=[...uz,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],Rye=[...uz,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],yP=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],gP=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],$ye=[{inputs:[{internalType:"address",name:"_signer",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"bytes",name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"}],Mye="0x82ad56cb";function Nye(t,{docsPath:e,...r}){let n=nS(t,r);return n instanceof Jb&&(n=t),new az(n,{docsPath:e,...r})}const bx=new Map;function lS({fn:t,id:e,shouldSplitBatch:r,wait:n=0}){const i=async()=>{const l=a();s();const u=l.map(({args:f})=>f);u.length!==0&&t(u).then(f=>{l.forEach(({pendingPromise:d},h)=>{var p;return(p=d.resolve)==null?void 0:p.call(d,[f[h],f])})}).catch(f=>{l.forEach(({pendingPromise:d})=>{var h;return(h=d.reject)==null?void 0:h.call(d,f)})})},s=()=>bx.delete(e),o=()=>a().map(({args:l})=>l),a=()=>bx.get(e)||[],c=l=>bx.set(e,[...a(),l]);return{flush:s,async schedule(l){const u={},f=new Promise((p,v)=>{u.resolve=p,u.reject=v});return(r==null?void 0:r([...o(),l]))&&i(),a().length>0?(c({args:l,pendingPromise:u}),f):(c({args:l,pendingPromise:u}),setTimeout(i,n),f)}}}async function i2(t,e){var g,y,b,C;const{account:r=t.account,batch:n=!!((g=t.batch)!=null&&g.multicall),blockNumber:i,blockTag:s="latest",accessList:o,data:a,gas:c,gasPrice:l,maxFeePerGas:u,maxPriorityFeePerGas:f,nonce:d,to:h,value:p,...v}=e,m=r?ts(r):void 0;try{bp(e);const O=(i?ze(i):void 0)||s,w=((C=(b=(y=t.chain)==null?void 0:y.formatters)==null?void 0:b.transactionRequest)==null?void 0:C.format)||Yb,I=w({...iS(v,{format:w}),from:m==null?void 0:m.address,accessList:o,data:a,gas:c,gasPrice:l,maxFeePerGas:u,maxPriorityFeePerGas:f,nonce:d,to:h,value:p});if(n&&Dye({request:I}))try{return await Lye(t,{...I,blockNumber:i,blockTag:s})}catch(z){if(!(z instanceof DU)&&!(z instanceof E3))throw z}const B=await t.request({method:"eth_call",params:O?[I,O]:[I]});return B==="0x"?{data:void 0}:{data:B}}catch(A){const O=Bye(A),{offchainLookup:w,offchainLookupSignature:I}=await cS(()=>import("./ccip-70098440.js"),[],import.meta.url);if((O==null?void 0:O.slice(0,10))===I&&h)return{data:await w(t,{data:O,to:h})};throw Nye(A,{...e,account:m,chain:t.chain})}}function Dye({request:t}){const{data:e,to:r,...n}=t;return!(!e||e.startsWith(Mye)||!r||Object.values(n).filter(i=>typeof i<"u").length>0)}async function Lye(t,e){var v;const{batchSize:r=1024,wait:n=0}=typeof((v=t.batch)==null?void 0:v.multicall)=="object"?t.batch.multicall:{},{blockNumber:i,blockTag:s="latest",data:o,multicallAddress:a,to:c}=e;let l=a;if(!l){if(!t.chain)throw new DU;l=zd({blockNumber:i,chain:t.chain,contract:"multicall3"})}const f=(i?ze(i):void 0)||s,{schedule:d}=lS({id:`${t.uid}.${f}`,wait:n,shouldSplitBatch(m){return m.reduce((y,{data:b})=>y+(b.length-2),0)>r*2},fn:async m=>{const g=m.map(C=>({allowFailure:!0,callData:C.data,target:C.to})),y=Kc({abi:N3,args:[g],functionName:"aggregate3"}),b=await t.request({method:"eth_call",params:[{data:y,to:l},f]});return Gd({abi:N3,args:[g],functionName:"aggregate3",data:b||"0x"})}}),[{returnData:h,success:p}]=await d({data:o,to:c});if(!p)throw new tS({data:h});return h==="0x"?{data:void 0}:{data:h}}function Bye(t){if(!(t instanceof le))return;const e=t.walk();return typeof e.data=="object"?e.data.data:e.data}async function $c(t,{abi:e,address:r,args:n,functionName:i,...s}){const o=Kc({abi:e,args:n,functionName:i});try{const{data:a}=await i2(t,{data:o,to:r,...s});return Gd({abi:e,args:n,functionName:i,data:a||"0x"})}catch(a){throw T1(a,{abi:e,address:r,args:n,docsPath:"/docs/contract/readContract",functionName:i})}}async function Fye(t,{abi:e,address:r,args:n,dataSuffix:i,functionName:s,...o}){const a=o.account?ts(o.account):void 0,c=Kc({abi:e,args:n,functionName:s});try{const{data:l}=await i2(t,{batch:!1,data:`${c}${i?i.replace("0x",""):""}`,to:r,...o});return{result:Gd({abi:e,args:n,functionName:s,data:l||"0x"}),request:{abi:e,address:r,args:n,dataSuffix:i,functionName:s,...o}}}catch(l){throw T1(l,{abi:e,address:r,args:n,docsPath:"/docs/contract/simulateContract",functionName:s,sender:a==null?void 0:a.address})}}const wx=new Map,bP=new Map;let jye=0;function Kd(t,e,r){const n=++jye,i=()=>wx.get(t)||[],s=()=>{const u=i();wx.set(t,u.filter(f=>f.id!==n))},o=()=>{const u=bP.get(t);i().length===1&&u&&u(),s()},a=i();if(wx.set(t,[...a,{id:n,fns:e}]),a&&a.length>0)return o;const c={};for(const u in e)c[u]=(...f)=>{const d=i();d.length!==0&&d.forEach(h=>{var p,v;return(v=(p=h.fns)[u])==null?void 0:v.call(p,...f)})};const l=r(c);return typeof l=="function"&&bP.set(t,l),o}async function rg(t){return new Promise(e=>setTimeout(e,t))}function wp(t,{emitOnBegin:e,initialWaitTime:r,interval:n}){let i=!0;const s=()=>i=!1;return(async()=>{let a;e&&(a=await t({unpoll:s}));const c=await(r==null?void 0:r(a))??n;await rg(c);const l=async()=>{i&&(await t({unpoll:s}),await rg(n),l())};l()})(),s}const wP="/docs/contract/decodeEventLog";function xp({abi:t,data:e,strict:r,topics:n}){const i=r??!0,[s,...o]=n;if(!s)throw new xme({docsPath:wP});const a=t.find(p=>p.type==="event"&&s===Y4(Gc(p)));if(!(a&&"name"in a)||a.type!=="event")throw new Eme(s,{docsPath:wP});const{name:c,inputs:l}=a,u=l==null?void 0:l.some(p=>!("name"in p&&p.name));let f=u?[]:{};const d=l.filter(p=>"indexed"in p&&p.indexed);if(o.length>0)for(let p=0;p!("indexed"in p&&p.indexed));if(h.length>0){if(e&&e!=="0x")try{const p=r2(h,e);if(p)if(u)f=[...f,...p];else for(let v=0;v0?f:void 0}}function Uye({param:t,value:e}){return t.type==="string"||t.type==="bytes"||t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/)?e:(r2([t],e)||[])[0]}const zye=new Map,Wye=new Map;function Hye(t){const e=(i,s)=>({clear:()=>s.delete(i),get:()=>s.get(i),set:o=>s.set(i,o)}),r=e(t,zye),n=e(t,Wye);return{clear:()=>{r.clear(),n.clear()},promise:r,response:n}}async function qye(t,{cacheKey:e,cacheTime:r=1/0}){const n=Hye(e),i=n.response.get();if(i&&r>0&&new Date().getTime()-i.created.getTime()`blockNumber.${t}`;async function Ep(t,{cacheTime:e=t.cacheTime,maxAge:r}={}){const n=await qye(()=>t.request({method:"eth_blockNumber"}),{cacheKey:Vye(t.uid),cacheTime:r??e});return BigInt(n)}async function s2(t,{filter:e}){const r="strict"in e&&e.strict;return(await e.request({method:"eth_getFilterChanges",params:[e.id]})).map(i=>{var s;if(typeof i=="string")return i;try{const{eventName:o,args:a}="abi"in e&&e.abi?xp({abi:e.abi,data:i.data,topics:i.topics,strict:r}):{eventName:void 0,args:void 0};return Os(i,{args:a,eventName:o})}catch(o){let a,c;if(o instanceof su||o instanceof Hd){if("strict"in e&&e.strict)return;a=o.abiItem.name,c=(s=o.abiItem.inputs)==null?void 0:s.some(l=>!("name"in l&&l.name))}return Os(i,{args:c?[]:{},eventName:a})}}).filter(Boolean)}async function uS(t,{address:e,blockHash:r,fromBlock:n,toBlock:i,event:s,events:o,args:a,strict:c}={}){const l=c??!1,u=o??(s?[s]:void 0);let f=[];u&&(f=[u.flatMap(h=>gp({abi:[h],eventName:h.name,args:a}))],s&&(f=f[0]));let d;return r?d=await t.request({method:"eth_getLogs",params:[{address:e,topics:f,blockHash:r}]}):d=await t.request({method:"eth_getLogs",params:[{address:e,topics:f,fromBlock:typeof n=="bigint"?ze(n):n,toBlock:typeof i=="bigint"?ze(i):i}]}),d.map(h=>{var p;try{const{eventName:v,args:m}=u?xp({abi:u,data:h.data,topics:h.topics,strict:l}):{eventName:void 0,args:void 0};return Os(h,{args:m,eventName:v})}catch(v){let m,g;if(v instanceof su||v instanceof Hd){if(l)return;m=v.abiItem.name,g=(p=v.abiItem.inputs)==null?void 0:p.some(y=>!("name"in y&&y.name))}return Os(h,{args:g?[]:{},eventName:m})}}).filter(Boolean)}async function o2(t,{filter:e}){return e.request({method:"eth_uninstallFilter",params:[e.id]})}function Gye(t,{abi:e,address:r,args:n,batch:i=!0,eventName:s,onError:o,onLogs:a,poll:c,pollingInterval:l=t.pollingInterval,strict:u}){return(typeof c<"u"?c:t.transport.type!=="webSocket")?(()=>{const p=Un(["watchContractEvent",r,n,i,t.uid,s,l]),v=u??!1;return Kd(p,{onLogs:a,onError:o},m=>{let g,y,b=!1;const C=wp(async()=>{var A;if(!b){try{y=await iz(t,{abi:e,address:r,args:n,eventName:s,strict:v})}catch{}b=!0;return}try{let O;if(y)O=await s2(t,{filter:y});else{const w=await Ep(t);g&&g!==w?O=await uS(t,{address:r,args:n,fromBlock:g+1n,toBlock:w,event:yp({abi:e,name:s})}):O=[],g=w}if(O.length===0)return;i?m.onLogs(O):O.forEach(w=>m.onLogs([w]))}catch(O){y&&O instanceof ou&&(b=!1),(A=m.onError)==null||A.call(m,O)}},{emitOnBegin:!0,interval:l});return async()=>{y&&await o2(t,{filter:y}),C()}})})():(()=>{let p=!0,v=()=>p=!1;return(async()=>{try{const m=s?gp({abi:e,eventName:s,args:n}):[],{unsubscribe:g}=await t.transport.subscribe({params:["logs",{address:r,topics:m}],onData(y){var C;if(!p)return;const b=y.result;try{const{eventName:A,args:O}=xp({abi:e,data:b.data,topics:b.topics,strict:u}),w=Os(b,{args:O,eventName:A});a([w])}catch(A){let O,w;if(A instanceof su||A instanceof Hd){if(u)return;O=A.abiItem.name,w=(C=A.abiItem.inputs)==null?void 0:C.some(B=>!("name"in B&&B.name))}const I=Os(b,{args:w?[]:{},eventName:O});a([I])}},onError(y){o==null||o(y)}});v=g,p||v()}catch(m){o==null||o(m)}})(),v})()}function Kye(t,{docsPath:e,...r}){let n=nS(t,r);return n instanceof Jb&&(n=t),new cme(n,{docsPath:e,...r})}async function I1(t){const e=await t.request({method:"eth_chainId"});return Fn(e)}async function fS(t,{serializedTransaction:e}){return t.request({method:"eth_sendRawTransaction",params:[e]})}async function dS(t,e){var v,m,g;const{account:r=t.account,chain:n=t.chain,accessList:i,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d,...h}=e;if(!r)throw new Vd({docsPath:"/docs/actions/wallet/sendTransaction"});const p=ts(r);try{bp(e);let y;if(n!==null&&(y=await I1(t),LU({currentChainId:y,chain:n})),p.type==="local"){const A=await n2(t,{account:p,accessList:i,chain:n,data:s,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d,...h});y||(y=await I1(t));const O=(v=n==null?void 0:n.serializers)==null?void 0:v.transaction,w=await p.signTransaction({...A,chainId:y},{serializer:O});return await fS(t,{serializedTransaction:w})}const b=((g=(m=n==null?void 0:n.formatters)==null?void 0:m.transactionRequest)==null?void 0:g.format)||Yb,C=b({...iS(h,{format:b}),accessList:i,data:s,from:p.address,gas:o,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:f,value:d});return await t.request({method:"eth_sendTransaction",params:[C]})}catch(y){throw Kye(y,{...e,account:p,chain:e.chain||void 0})}}async function Qye(t,{abi:e,address:r,args:n,dataSuffix:i,functionName:s,...o}){const a=Kc({abi:e,args:n,functionName:s});return await dS(t,{data:`${a}${i?i.replace("0x",""):""}`,to:r,...o})}async function Yye(t,{chain:e}){const{id:r,name:n,nativeCurrency:i,rpcUrls:s,blockExplorers:o}=e;await t.request({method:"wallet_addEthereumChain",params:[{chainId:ze(r),chainName:n,nativeCurrency:i,rpcUrls:s.default.http,blockExplorerUrls:o?Object.values(o).map(({url:a})=>a):void 0}]})}const D3=256;let Ev=D3,Cv;function Jye(t=11){if(!Cv||Ev+t>D3*2){Cv="",Ev=0;for(let e=0;e{const g=m(v);for(const b in h)delete g[b];const y={...v,...g};return Object.assign(y,{extend:p(y)})}}return Object.assign(h,{extend:p(h)})}function hz(t,{delay:e=100,retryCount:r=2,shouldRetry:n=()=>!0}={}){return new Promise((i,s)=>{const o=async({count:a=0}={})=>{const c=async({error:l})=>{const u=typeof e=="function"?e({count:a,error:l}):e;u&&await rg(u),o({count:a+1})};try{const l=await t();i(l)}catch(l){if(a"code"in t?t.code!==-1&&t.code!==-32004&&t.code!==-32005&&t.code!==-32042&&t.code!==-32603:t instanceof C0&&t.status?t.status!==403&&t.status!==408&&t.status!==413&&t.status!==429&&t.status!==500&&t.status!==502&&t.status!==503&&t.status!==504:!1;function Xye(t,{retryDelay:e=150,retryCount:r=3}={}){return async n=>hz(async()=>{try{return await t(n)}catch(i){const s=i;switch(s.code){case m1.code:throw new m1(s);case y1.code:throw new y1(s);case g1.code:throw new g1(s);case b1.code:throw new b1(s);case vd.code:throw new vd(s);case ou.code:throw new ou(s);case w1.code:throw new w1(s);case Oc.code:throw new Oc(s);case x1.code:throw new x1(s);case E1.code:throw new E1(s);case C1.code:throw new C1(s);case S1.code:throw new S1(s);case Or.code:throw new Or(s);case k1.code:throw new k1(s);case A1.code:throw new A1(s);case _1.code:throw new _1(s);case P1.code:throw new P1(s);case aa.code:throw new aa(s);case 5e3:throw new Or(s);default:throw i instanceof le?i:new wye(s)}}},{delay:({count:i,error:s})=>{var o;if(s&&s instanceof C0){const a=(o=s==null?void 0:s.headers)==null?void 0:o.get("Retry-After");if(a!=null&&a.match(/\d/))return parseInt(a)*1e3}return~~(1<!pz(i)})}function a2({key:t,name:e,request:r,retryCount:n=3,retryDelay:i=150,timeout:s,type:o},a){return{config:{key:t,name:e,request:r,retryCount:n,retryDelay:i,timeout:s,type:o},request:Xye(r,{retryCount:n,retryDelay:i}),value:a}}function c2(t,e={}){const{key:r="custom",name:n="Custom Provider",retryDelay:i}=e;return({retryCount:s})=>a2({key:r,name:n,request:t.request.bind(t),retryCount:e.retryCount??s,retryDelay:i,type:"custom"})}function xP(t,e={}){const{key:r="fallback",name:n="Fallback",rank:i=!1,retryCount:s,retryDelay:o}=e;return({chain:a,pollingInterval:c=4e3,timeout:l})=>{let u=t,f=()=>{};const d=a2({key:r,name:n,async request({method:h,params:p}){const v=async(m=0)=>{const g=u[m]({chain:a,retryCount:0,timeout:l});try{const y=await g.request({method:h,params:p});return f({method:h,params:p,response:y,transport:g,status:"success"}),y}catch(y){if(f({error:y,method:h,params:p,transport:g,status:"error"}),pz(y)||m===u.length-1)throw y;return v(m+1)}};return v()},retryCount:s,retryDelay:o,type:"fallback"},{onResponse:h=>f=h,transports:u.map(h=>h({chain:a,retryCount:0}))});if(i){const h=typeof i=="object"?i:{};Zye({chain:a,interval:h.interval??c,onTransports:p=>u=p,sampleCount:h.sampleCount,timeout:h.timeout,transports:u,weights:h.weights})}return d}}function Zye({chain:t,interval:e=4e3,onTransports:r,sampleCount:n=10,timeout:i=1e3,transports:s,weights:o={}}){const{stability:a=.7,latency:c=.3}=o,l=[],u=async()=>{const f=await Promise.all(s.map(async p=>{const v=p({chain:t,retryCount:0,timeout:i}),m=Date.now();let g,y;try{await v.request({method:"net_listening"}),y=1}catch{y=0}finally{g=Date.now()}return{latency:g-m,success:y}}));l.push(f),l.length>n&&l.shift();const d=Math.max(...l.map(p=>Math.max(...p.map(({latency:v})=>v)))),h=s.map((p,v)=>{const m=l.map(A=>A[v].latency),y=1-m.reduce((A,O)=>A+O,0)/m.length/d,b=l.map(A=>A[v].success),C=b.reduce((A,O)=>A+O,0)/b.length;return C===0?[0,v]:[c*y+a*C,v]}).sort((p,v)=>v[0]-p[0]);r(h.map(([,p])=>s[p])),await rg(e),u()};u()}class vz extends le{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro"})}}var Yu=null;typeof WebSocket<"u"?Yu=WebSocket:typeof MozWebSocket<"u"?Yu=MozWebSocket:typeof global<"u"?Yu=global.WebSocket||global.MozWebSocket:typeof window<"u"?Yu=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(Yu=self.WebSocket||self.MozWebSocket);const EP=Yu;function mz(t,{errorInstance:e,timeout:r,signal:n}){return new Promise((i,s)=>{(async()=>{let o;try{const a=new AbortController;r>0&&(o=setTimeout(()=>{n?a.abort():s(e)},r)),i(await t({signal:a==null?void 0:a.signal}))}catch(a){a.name==="AbortError"&&s(e),s(a)}finally{clearTimeout(o)}})()})}let L3=0;async function ege(t,{body:e,fetchOptions:r={},timeout:n=1e4}){var a;const{headers:i,method:s,signal:o}=r;try{const c=await mz(async({signal:u})=>await fetch(t,{...r,body:Array.isArray(e)?Un(e.map(d=>({jsonrpc:"2.0",id:d.id??L3++,...d}))):Un({jsonrpc:"2.0",id:e.id??L3++,...e}),headers:{...i,"Content-Type":"application/json"},method:s||"POST",signal:o||(n>0?u:void 0)}),{errorInstance:new $3({body:e,url:t}),timeout:n,signal:!0});let l;if((a=c.headers.get("Content-Type"))!=null&&a.startsWith("application/json")?l=await c.json():l=await c.text(),!c.ok)throw new C0({body:e,details:Un(l.error)||c.statusText,headers:c.headers,status:c.status,url:t});return l}catch(c){throw c instanceof C0||c instanceof $3?c:new C0({body:e,details:c.message,url:t})}}const xx=new Map;async function Ex(t){let e=xx.get(t);if(e)return e;const{schedule:r}=lS({id:t,fn:async()=>{const s=new EP(t),o=new Map,a=new Map,c=({data:u})=>{const f=JSON.parse(u),d=f.method==="eth_subscription",h=d?f.params.subscription:f.id,p=d?a:o,v=p.get(h);v&&v({data:u}),d||p.delete(h)},l=()=>{xx.delete(t),s.removeEventListener("close",l),s.removeEventListener("message",c)};return s.addEventListener("close",l),s.addEventListener("message",c),s.readyState===EP.CONNECTING&&await new Promise((u,f)=>{s&&(s.onopen=u,s.onerror=f)}),e=Object.assign(s,{requests:o,subscriptions:a}),xx.set(t,e),[e]}}),[n,[i]]=await r();return i}function tge(t,{body:e,onResponse:r}){if(t.readyState===t.CLOSED||t.readyState===t.CLOSING)throw new gye({body:e,url:t.url,details:"Socket is closed."});const n=L3++,i=({data:s})=>{var a;const o=JSON.parse(s);typeof o.id=="number"&&n!==o.id||(r==null||r(o),e.method==="eth_subscribe"&&typeof o.result=="string"&&t.subscriptions.set(o.result,i),e.method==="eth_unsubscribe"&&t.subscriptions.delete((a=e.params)==null?void 0:a[0]))};return t.requests.set(n,i),t.send(JSON.stringify({jsonrpc:"2.0",...e,id:n})),t}async function rge(t,{body:e,timeout:r=1e4}){return mz(()=>new Promise(n=>jf.webSocket(t,{body:e,onResponse:n})),{errorInstance:new $3({body:e,url:t.url}),timeout:r})}const jf={http:ege,webSocket:tge,webSocketAsync:rge};function yz(t,e={}){const{batch:r,fetchOptions:n,key:i="http",name:s="HTTP JSON-RPC",retryDelay:o}=e;return({chain:a,retryCount:c,timeout:l})=>{const{batchSize:u=1e3,wait:f=0}=typeof r=="object"?r:{},d=e.retryCount??c,h=l??e.timeout??1e4,p=t||(a==null?void 0:a.rpcUrls.default.http[0]);if(!p)throw new vz;return a2({key:i,name:s,async request({method:v,params:m}){const g={method:v,params:m},{schedule:y}=lS({id:`${t}`,wait:f,shouldSplitBatch(O){return O.length>u},fn:O=>jf.http(p,{body:O,fetchOptions:n,timeout:h})}),b=async O=>r?y(O):[await jf.http(p,{body:O,fetchOptions:n,timeout:h})],[{error:C,result:A}]=await b(g);if(C)throw new rS({body:g,error:C,url:p});return A},retryCount:d,retryDelay:o,timeout:h,type:"http"},{url:t})}}function hS(t,e){var n,i,s;if(!(t instanceof le))return!1;const r=t.walk(o=>o instanceof R3);return r instanceof R3?!!(((n=r.data)==null?void 0:n.errorName)==="ResolverNotFound"||((i=r.data)==null?void 0:i.errorName)==="ResolverWildcardNotSupported"||(s=r.reason)!=null&&s.includes("Wildcard on non-extended resolvers is not supported")||e==="reverse"&&r.reason===sz[50]):!1}function gz(t){if(t.length!==66||t.indexOf("[")!==0||t.indexOf("]")!==65)return null;const e=`0x${t.slice(1,65)}`;return So(e)?e:null}function mm(t){let e=new Uint8Array(32).fill(0);if(!t)return p1(e);const r=t.split(".");for(let n=r.length-1;n>=0;n-=1){const i=gz(r[n]),s=i?iu(i):ei(Vo(r[n]),"bytes");e=ei(oa([e,s]),"bytes")}return p1(e)}function nge(t){return`[${t.slice(2)}]`}function ige(t){const e=new Uint8Array(32).fill(0);return t?gz(t)||ei(Vo(t)):p1(e)}function l2(t){const e=t.replace(/^\.|\.$/gm,"");if(e.length===0)return new Uint8Array(1);const r=new Uint8Array(Vo(e).byteLength+2);let n=0;const i=e.split(".");for(let s=0;s255&&(o=Vo(nge(ige(i[s])))),r[n]=o.length,r.set(o,n+1),n+=o.length+1}return r.byteLength!==n+1?r.slice(0,n+1):r}async function sge(t,{blockNumber:e,blockTag:r,coinType:n,name:i,universalResolverAddress:s}){let o=s;if(!o){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");o=zd({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const a=Kc({abi:gP,functionName:"addr",...n!=null?{args:[mm(i),BigInt(n)]}:{args:[mm(i)]}}),c=await $c(t,{address:o,abi:fz,functionName:"resolve",args:[Ca(l2(i)),a],blockNumber:e,blockTag:r});if(c[0]==="0x")return null;const l=Gd({abi:gP,args:n!=null?[mm(i),BigInt(n)]:void 0,functionName:"addr",data:c[0]});return l==="0x"||Bf(l)==="0x00"?null:l}catch(a){if(hS(a,"resolve"))return null;throw a}}class oge extends le{constructor({data:e}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidMetadataError"})}}class Ah extends le{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidNftUriError"})}}class pS extends le{constructor({uri:e}){super(`Unable to resolve ENS avatar URI "${e}". The URI may be malformed, invalid, or does not respond with a valid image.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUriResolutionError"})}}class age extends le{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUnsupportedNamespaceError"})}}const cge=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,lge=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?[\w\-.]+))?(?\/.*)?$/,uge=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,fge=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function dge(t){try{const e=await fetch(t,{method:"HEAD"});if(e.status===200){const r=e.headers.get("content-type");return r==null?void 0:r.startsWith("image/")}return!1}catch(e){return typeof e=="object"&&typeof e.response<"u"||!globalThis.hasOwnProperty("Image")?!1:new Promise(r=>{const n=new Image;n.onload=()=>{r(!0)},n.onerror=()=>{r(!1)},n.src=t})}}function CP(t,e){return t?t.endsWith("/")?t.slice(0,-1):t:e}function bz({uri:t,gatewayUrls:e}){const r=uge.test(t);if(r)return{uri:t,isOnChain:!0,isEncoded:r};const n=CP(e==null?void 0:e.ipfs,"https://ipfs.io"),i=CP(e==null?void 0:e.arweave,"https://arweave.net"),s=t.match(cge),{protocol:o,subpath:a,target:c,subtarget:l=""}=(s==null?void 0:s.groups)||{},u=o==="ipns:/"||a==="ipns/",f=o==="ipfs:/"||a==="ipfs/"||lge.test(t);if(t.startsWith("http")&&!u&&!f){let h=t;return e!=null&&e.arweave&&(h=t.replace(/https:\/\/arweave.net/g,e==null?void 0:e.arweave)),{uri:h,isOnChain:!1,isEncoded:!1}}if((u||f)&&c)return{uri:`${n}/${u?"ipns":"ipfs"}/${c}${l}`,isOnChain:!1,isEncoded:!1};if(o==="ar:/"&&c)return{uri:`${i}/${c}${l||""}`,isOnChain:!1,isEncoded:!1};let d=t.replace(fge,"");if(d.startsWith("i.json());return await vS({gatewayUrls:t,uri:wz(r)})}catch{throw new pS({uri:e})}}async function vS({gatewayUrls:t,uri:e}){const{uri:r,isOnChain:n}=bz({uri:e,gatewayUrls:t});if(n||await dge(r))return r;throw new pS({uri:e})}function pge(t){let e=t;e.startsWith("did:nft:")&&(e=e.replace("did:nft:","").replace(/_/g,"/"));const[r,n,i]=e.split("/"),[s,o]=r.split(":"),[a,c]=n.split(":");if(!s||s.toLowerCase()!=="eip155")throw new Ah({reason:"Only EIP-155 supported"});if(!o)throw new Ah({reason:"Chain ID not found"});if(!c)throw new Ah({reason:"Contract address not found"});if(!i)throw new Ah({reason:"Token ID not found"});if(!a)throw new Ah({reason:"ERC namespace not found"});return{chainID:parseInt(o),namespace:a.toLowerCase(),contractAddress:c,tokenID:i}}async function vge(t,{nft:e}){if(e.namespace==="erc721")return $c(t,{address:e.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(e.tokenID)]});if(e.namespace==="erc1155")return $c(t,{address:e.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(e.tokenID)]});throw new age({namespace:e.namespace})}async function mge(t,{gatewayUrls:e,record:r}){return/eip155:/i.test(r)?yge(t,{gatewayUrls:e,record:r}):vS({uri:r,gatewayUrls:e})}async function yge(t,{gatewayUrls:e,record:r}){const n=pge(r),i=await vge(t,{nft:n}),{uri:s,isOnChain:o,isEncoded:a}=bz({uri:i,gatewayUrls:e});if(o&&(s.includes("data:application/json;base64,")||s.startsWith("{"))){const l=a?atob(s.replace("data:application/json;base64,","")):s,u=JSON.parse(l);return vS({uri:wz(u),gatewayUrls:e})}let c=n.tokenID;return n.namespace==="erc1155"&&(c=c.replace("0x","").padStart(64,"0")),hge({gatewayUrls:e,uri:s.replace(/(?:0x)?{id}/,c)})}async function xz(t,{blockNumber:e,blockTag:r,name:n,key:i,universalResolverAddress:s}){let o=s;if(!o){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");o=zd({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const a=await $c(t,{address:o,abi:fz,functionName:"resolve",args:[Ca(l2(n)),Kc({abi:yP,functionName:"text",args:[mm(n),i]})],blockNumber:e,blockTag:r});if(a[0]==="0x")return null;const c=Gd({abi:yP,functionName:"text",data:a[0]});return c===""?null:c}catch(a){if(hS(a,"resolve"))return null;throw a}}async function gge(t,{blockNumber:e,blockTag:r,gatewayUrls:n,name:i,universalResolverAddress:s}){const o=await xz(t,{blockNumber:e,blockTag:r,key:"avatar",name:i,universalResolverAddress:s});if(!o)return null;try{return await mge(t,{record:o,gatewayUrls:n})}catch{return null}}async function bge(t,{address:e,blockNumber:r,blockTag:n,universalResolverAddress:i}){let s=i;if(!s){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");s=zd({blockNumber:r,chain:t.chain,contract:"ensUniversalResolver"})}const o=`${e.toLowerCase().substring(2)}.addr.reverse`;try{return(await $c(t,{address:s,abi:Rye,functionName:"reverse",args:[Ca(l2(o))],blockNumber:r,blockTag:n}))[0]}catch(a){if(hS(a,"reverse"))return null;throw a}}async function wge(t,{blockNumber:e,blockTag:r,name:n,universalResolverAddress:i}){let s=i;if(!s){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");s=zd({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}const[o]=await $c(t,{address:s,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[Ca(l2(n))],blockNumber:e,blockTag:r});return o}async function xge(t){const e=t2(t,{method:"eth_newBlockFilter"}),r=await t.request({method:"eth_newBlockFilter"});return{id:r,request:e(r),type:"block"}}async function Ez(t,{address:e,args:r,event:n,events:i,fromBlock:s,strict:o,toBlock:a}={}){const c=i??(n?[n]:void 0),l=t2(t,{method:"eth_newFilter"});let u=[];c&&(u=[c.flatMap(d=>gp({abi:[d],eventName:d.name,args:r}))],n&&(u=u[0]));const f=await t.request({method:"eth_newFilter",params:[{address:e,fromBlock:typeof s=="bigint"?ze(s):s,toBlock:typeof a=="bigint"?ze(a):a,...u.length?{topics:u}:{}}]});return{abi:c,args:r,eventName:n?n.name:void 0,fromBlock:s,id:f,request:l(f),strict:o,toBlock:a,type:"event"}}async function Cz(t){const e=t2(t,{method:"eth_newPendingTransactionFilter"}),r=await t.request({method:"eth_newPendingTransactionFilter"});return{id:r,request:e(r),type:"transaction"}}async function Ege(t,{address:e,blockNumber:r,blockTag:n="latest"}){const i=r?ze(r):void 0,s=await t.request({method:"eth_getBalance",params:[e,i||n]});return BigInt(s)}async function Cge(t,{blockHash:e,blockNumber:r,blockTag:n="latest"}={}){const i=r!==void 0?ze(r):void 0;let s;return e?s=await t.request({method:"eth_getBlockTransactionCountByHash",params:[e]}):s=await t.request({method:"eth_getBlockTransactionCountByNumber",params:[i||n]}),Fn(s)}async function Sge(t,{address:e,blockNumber:r,blockTag:n="latest"}){const i=r!==void 0?ze(r):void 0,s=await t.request({method:"eth_getCode",params:[e,i||n]});if(s!=="0x")return s}function kge(t){var e;return{baseFeePerGas:t.baseFeePerGas.map(r=>BigInt(r)),gasUsedRatio:t.gasUsedRatio,oldestBlock:BigInt(t.oldestBlock),reward:(e=t.reward)==null?void 0:e.map(r=>r.map(n=>BigInt(n)))}}async function Age(t,{blockCount:e,blockNumber:r,blockTag:n="latest",rewardPercentiles:i}){const s=r?ze(r):void 0,o=await t.request({method:"eth_feeHistory",params:[ze(e),s||n,i]});return kge(o)}async function _ge(t,{filter:e}){const r=e.strict??!1;return(await e.request({method:"eth_getFilterLogs",params:[e.id]})).map(i=>{var s;try{const{eventName:o,args:a}="abi"in e&&e.abi?xp({abi:e.abi,data:i.data,topics:i.topics,strict:r}):{eventName:void 0,args:void 0};return Os(i,{args:a,eventName:o})}catch(o){let a,c;if(o instanceof su||o instanceof Hd){if("strict"in e&&e.strict)return;a=o.abiItem.name,c=(s=o.abiItem.inputs)==null?void 0:s.some(l=>!("name"in l&&l.name))}return Os(i,{args:c?[]:{},eventName:a})}}).filter(Boolean)}async function Pge(t,{address:e,blockNumber:r,blockTag:n="latest",slot:i}){const s=r!==void 0?ze(r):void 0;return await t.request({method:"eth_getStorageAt",params:[e,i,s||n]})}async function mS(t,{blockHash:e,blockNumber:r,blockTag:n,hash:i,index:s}){var u,f,d;const o=n||"latest",a=r!==void 0?ze(r):void 0;let c=null;if(i?c=await t.request({method:"eth_getTransactionByHash",params:[i]}):e?c=await t.request({method:"eth_getTransactionByBlockHashAndIndex",params:[e,ze(s)]}):(a||o)&&(c=await t.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[a||o,ze(s)]})),!c)throw new qU({blockHash:e,blockNumber:r,blockTag:o,hash:i,index:s});return(((d=(f=(u=t.chain)==null?void 0:u.formatters)==null?void 0:f.transaction)==null?void 0:d.format)||zU)(c)}async function Tge(t,{hash:e,transactionReceipt:r}){const[n,i]=await Promise.all([Ep(t),e?mS(t,{hash:e}):void 0]),s=(r==null?void 0:r.blockNumber)||(i==null?void 0:i.blockNumber);return s?n-s+1n:0n}async function B3(t,{hash:e}){var i,s,o;const r=await t.request({method:"eth_getTransactionReceipt",params:[e]});if(!r)throw new VU({hash:e});return(((o=(s=(i=t.chain)==null?void 0:i.formatters)==null?void 0:s.transactionReceipt)==null?void 0:o.format)||eme)(r)}async function Ige(t,e){var v;const{allowFailure:r=!0,batchSize:n,blockNumber:i,blockTag:s,contracts:o,multicallAddress:a}=e,c=n??(typeof((v=t.batch)==null?void 0:v.multicall)=="object"&&t.batch.multicall.batchSize||1024);let l=a;if(!l){if(!t.chain)throw new Error("client chain not configured. multicallAddress is required.");l=zd({blockNumber:i,chain:t.chain,contract:"multicall3"})}const u=[[]];let f=0,d=0;for(let m=0;m0&&d>c&&u[f].length>0&&(f++,d=(A.length-2)/2,u[f]=[]),u[f]=[...u[f],{allowFailure:!0,callData:A,target:y}]}catch(A){const O=T1(A,{abi:g,address:y,args:b,docsPath:"/docs/contract/multicall",functionName:C});if(!r)throw O;u[f]=[...u[f],{allowFailure:!0,callData:"0x",target:y}]}}const h=await Promise.allSettled(u.map(m=>$c(t,{abi:N3,address:l,args:[m],blockNumber:i,blockTag:s,functionName:"aggregate3"}))),p=[];for(let m=0;m"u"?{}:t,s={EIP712Domain:Tz({domain:i}),...n};Pz({domain:i,message:e,primaryType:r,types:s});const o=["0x1901"];return i&&o.push(Mge({domain:i,types:s})),r!=="EIP712Domain"&&o.push(Sz({data:e,primaryType:r,types:s})),ei(oa(o))}function Mge({domain:t,types:e}){return Sz({data:t,primaryType:"EIP712Domain",types:e})}function Sz({data:t,primaryType:e,types:r}){const n=kz({data:t,primaryType:e,types:r});return ei(n)}function kz({data:t,primaryType:e,types:r}){const n=[{type:"bytes32"}],i=[Nge({primaryType:e,types:r})];for(const s of r[e]){const[o,a]=_z({types:r,name:s.name,type:s.type,value:t[s.name]});n.push(o),i.push(a)}return mp(n,i)}function Nge({primaryType:t,types:e}){const r=Ca(Dge({primaryType:t,types:e}));return ei(r)}function Dge({primaryType:t,types:e}){let r="";const n=Az({primaryType:t,types:e});n.delete(t);const i=[t,...Array.from(n).sort()];for(const s of i)r+=`${s}(${e[s].map(({name:o,type:a})=>`${a} ${o}`).join(",")})`;return r}function Az({primaryType:t,types:e},r=new Set){const n=t.match(/^\w*/u),i=n==null?void 0:n[0];if(r.has(i)||e[i]===void 0)return r;r.add(i);for(const s of e[i])Az({primaryType:s.type,types:e},r);return r}function _z({types:t,name:e,type:r,value:n}){if(t[r]!==void 0)return[{type:"bytes32"},ei(kz({data:n,primaryType:r,types:t}))];if(r==="bytes")return n=`0x${(n.length%2?"0":"")+n.slice(2)}`,[{type:"bytes32"},ei(n)];if(r==="string")return[{type:"bytes32"},ei(Ca(n))];if(r.lastIndexOf("]")===r.length-1){const i=r.slice(0,r.lastIndexOf("[")),s=n.map(o=>_z({name:e,type:i,types:t,value:o}));return[{type:"bytes32"},ei(mp(s.map(([o])=>o),s.map(([,o])=>o)))]}return[{type:r},n]}function Pz({domain:t,message:e,primaryType:r,types:n}){const i=n,s=(o,a)=>{for(const c of o){const{name:l,type:u}=c,f=u,d=a[l],h=f.match(Rge);if(h&&(typeof d=="number"||typeof d=="bigint")){const[m,g,y]=h;ze(d,{signed:g==="int",size:parseInt(y)/8})}if(f==="address"&&typeof d=="string"&&!pd(d))throw new v1({address:d});const p=f.match(Oge);if(p){const[m,g]=p;if(g&&Wr(d)!==parseInt(g))throw new Sme({expectedSize:parseInt(g),givenSize:Wr(d)})}const v=i[f];v&&s(v,d)}};if(i.EIP712Domain&&t&&s(i.EIP712Domain,t),r!=="EIP712Domain"){const o=i[r];s(o,e)}}function Tz({domain:t}){return[typeof(t==null?void 0:t.name)=="string"&&{name:"name",type:"string"},(t==null?void 0:t.version)&&{name:"version",type:"string"},typeof(t==null?void 0:t.chainId)=="number"&&{name:"chainId",type:"uint256"},(t==null?void 0:t.verifyingContract)&&{name:"verifyingContract",type:"address"},(t==null?void 0:t.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}const Cx="/docs/contract/encodeDeployData";function Iz({abi:t,args:e,bytecode:r}){if(!e||e.length===0)return r;const n=t.find(s=>"type"in s&&s.type==="constructor");if(!n)throw new yme({docsPath:Cx});if(!("inputs"in n))throw new uP({docsPath:Cx});if(!n.inputs||n.inputs.length===0)throw new uP({docsPath:Cx});const i=mp(n.inputs,e);return q4([r,i])}function Lge(t,e){const r=(()=>typeof t=="string"?Vo(t):t.raw instanceof Uint8Array?t.raw:iu(t.raw))(),n=Vo(`Ethereum Signed Message: -${r.length}`);return ei(oa([n,r]),e)}const Bge="0x60806040523480156200001157600080fd5b50604051620007003803806200070083398101604081905262000034916200056f565b6000620000438484846200004f565b9050806000526001601ff35b600080846001600160a01b0316803b806020016040519081016040528181526000908060200190933c90507f6492649264926492649264926492649264926492649264926492649264926492620000a68462000451565b036200021f57600060608085806020019051810190620000c79190620005ce565b8651929550909350915060000362000192576000836001600160a01b031683604051620000f5919062000643565b6000604051808303816000865af19150503d806000811462000134576040519150601f19603f3d011682016040523d82523d6000602084013e62000139565b606091505b5050905080620001905760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b505b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90620001c4908b90869060040162000661565b602060405180830381865afa158015620001e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020891906200069d565b6001600160e01b031916149450505050506200044a565b805115620002b157604051630b135d3f60e11b808252906001600160a01b03871690631626ba7e9062000259908890889060040162000661565b602060405180830381865afa15801562000277573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029d91906200069d565b6001600160e01b031916149150506200044a565b8251604114620003195760405162461bcd60e51b815260206004820152603a6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e677468000000000000606482015260840162000187565b620003236200046b565b506020830151604080850151855186939260009185919081106200034b576200034b620006c9565b016020015160f81c9050601b81148015906200036b57508060ff16601c14155b15620003cf5760405162461bcd60e51b815260206004820152603b6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c75650000000000606482015260840162000187565b6040805160008152602081018083528a905260ff83169181019190915260608101849052608081018390526001600160a01b038a169060019060a0016020604051602081039080840390855afa1580156200042e573d6000803e3d6000fd5b505050602060405103516001600160a01b031614955050505050505b9392505050565b60006020825110156200046357600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b03811681146200049f57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004d5578181015183820152602001620004bb565b50506000910152565b600082601f830112620004f057600080fd5b81516001600160401b03808211156200050d576200050d620004a2565b604051601f8301601f19908116603f01168101908282118183101715620005385762000538620004a2565b816040528381528660208588010111156200055257600080fd5b62000565846020830160208901620004b8565b9695505050505050565b6000806000606084860312156200058557600080fd5b8351620005928162000489565b6020850151604086015191945092506001600160401b03811115620005b657600080fd5b620005c486828701620004de565b9150509250925092565b600080600060608486031215620005e457600080fd5b8351620005f18162000489565b60208501519093506001600160401b03808211156200060f57600080fd5b6200061d87838801620004de565b935060408601519150808211156200063457600080fd5b50620005c486828701620004de565b6000825162000657818460208701620004b8565b9190910192915050565b828152604060208201526000825180604084015262000688816060850160208701620004b8565b601f01601f1916919091016060019392505050565b600060208284031215620006b057600080fd5b81516001600160e01b0319811681146200044a57600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */BigInt(0);BigInt(1);BigInt(2);function Fge(t,e){if(t.length!==e.length)return!1;for(let r=0;r{const f=Un(["watchBlockNumber",t.uid,e,r,o]);return Kd(f,{onBlockNumber:n,onError:i},d=>wp(async()=>{var h;try{const p=await Ep(t,{cacheTime:0});if(c){if(p===c)return;if(p-c>1&&r)for(let v=c+1n;vc)&&(d.onBlockNumber(p,c),c=p)}catch(p){(h=d.onError)==null||h.call(d,p)}},{emitOnBegin:e,interval:o}))})():(()=>{let f=!0,d=()=>f=!1;return(async()=>{try{const{unsubscribe:h}=await t.transport.subscribe({params:["newHeads"],onData(p){var m;if(!f)return;const v=Qb((m=p.result)==null?void 0:m.number);n(v,c),c=v},onError(p){i==null||i(p)}});d=h,f||d()}catch(h){i==null||i(h)}})(),d})()}async function Wge(t,{confirmations:e=1,hash:r,onReplaced:n,pollingInterval:i=t.pollingInterval,timeout:s}){const o=Un(["waitForTransactionReceipt",t.uid,r]);let a,c,l,u=!1;return new Promise((f,d)=>{s&&setTimeout(()=>d(new lme({hash:r})),s);const h=Kd(o,{onReplaced:n,resolve:f,reject:d},p=>{const v=Rz(t,{emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:i,async onBlockNumber(m){if(u)return;let g=m;const y=b=>{v(),b(),h()};try{if(l){if(g-l.blockNumber+1np.resolve(l));return}if(a||(u=!0,await hz(async()=>{a=await mS(t,{hash:r}),a.blockNumber&&(g=a.blockNumber)},{delay:({count:b})=>~~(1<0&&g-l.blockNumber+1np.resolve(l))}catch(b){if(a&&(b instanceof qU||b instanceof VU))try{c=a;const A=(await Rc(t,{blockNumber:g,includeTransactions:!0})).transactions.find(({from:w,nonce:I})=>w===c.from&&I===c.nonce);if(!A||(l=await B3(t,{hash:A.hash}),g-l.blockNumber+1n{var w;(w=p.onReplaced)==null||w.call(p,{reason:O,replacedTransaction:c,transaction:A,transactionReceipt:l}),p.resolve(l)})}catch(C){y(()=>p.reject(C))}else y(()=>p.reject(b))}}})})})}function Hge(t,{blockTag:e="latest",emitMissed:r=!1,emitOnBegin:n=!1,onBlock:i,onError:s,includeTransactions:o,poll:a,pollingInterval:c=t.pollingInterval}){const l=typeof a<"u"?a:t.transport.type!=="webSocket",u=o??!1;let f;return l?(()=>{const p=Un(["watchBlocks",t.uid,r,n,u,c]);return Kd(p,{onBlock:i,onError:s},v=>wp(async()=>{var m;try{const g=await Rc(t,{blockTag:e,includeTransactions:u});if(g.number&&(f!=null&&f.number)){if(g.number===f.number)return;if(g.number-f.number>1&&r)for(let y=(f==null?void 0:f.number)+1n;yf.number)&&(v.onBlock(g,f),f=g)}catch(g){(m=v.onError)==null||m.call(v,g)}},{emitOnBegin:n,interval:c}))})():(()=>{let p=!0,v=()=>p=!1;return(async()=>{try{const{unsubscribe:m}=await t.transport.subscribe({params:["newHeads"],onData(g){var C,A,O;if(!p)return;const b=(((O=(A=(C=t.chain)==null?void 0:C.formatters)==null?void 0:A.block)==null?void 0:O.format)||WU)(g.result);i(b,f),f=b},onError(g){s==null||s(g)}});v=m,p||v()}catch(m){s==null||s(m)}})(),v})()}function qge(t,{address:e,args:r,batch:n=!0,event:i,events:s,onError:o,onLogs:a,poll:c,pollingInterval:l=t.pollingInterval,strict:u}){const f=typeof c<"u"?c:t.transport.type!=="webSocket",d=u??!1;return f?(()=>{const v=Un(["watchEvent",e,r,n,t.uid,i,l]);return Kd(v,{onLogs:a,onError:o},m=>{let g,y,b=!1;const C=wp(async()=>{var A;if(!b){try{y=await Ez(t,{address:e,args:r,event:i,events:s,strict:d})}catch{}b=!0;return}try{let O;if(y)O=await s2(t,{filter:y});else{const w=await Ep(t);g&&g!==w?O=await uS(t,{address:e,args:r,event:i,events:s,fromBlock:g+1n,toBlock:w}):O=[],g=w}if(O.length===0)return;n?m.onLogs(O):O.forEach(w=>m.onLogs([w]))}catch(O){y&&O instanceof ou&&(b=!1),(A=m.onError)==null||A.call(m,O)}},{emitOnBegin:!0,interval:l});return async()=>{y&&await o2(t,{filter:y}),C()}})})():(()=>{let v=!0,m=()=>v=!1;return(async()=>{try{const g=s??(i?[i]:void 0);let y=[];g&&(y=[g.flatMap(C=>gp({abi:[C],eventName:C.name,args:r}))],i&&(y=y[0]));const{unsubscribe:b}=await t.transport.subscribe({params:["logs",{address:e,topics:y}],onData(C){var O;if(!v)return;const A=C.result;try{const{eventName:w,args:I}=xp({abi:g,data:A.data,topics:A.topics,strict:d}),B=Os(A,{args:I,eventName:w});a([B])}catch(w){let I,B;if(w instanceof su||w instanceof Hd){if(u)return;I=w.abiItem.name,B=(O=w.abiItem.inputs)==null?void 0:O.some(H=>!("name"in H&&H.name))}const z=Os(A,{args:B?[]:{},eventName:I});a([z])}},onError(C){o==null||o(C)}});m=b,v||m()}catch(g){o==null||o(g)}})(),m})()}function Vge(t,{batch:e=!0,onError:r,onTransactions:n,poll:i,pollingInterval:s=t.pollingInterval}){return(typeof i<"u"?i:t.transport.type!=="webSocket")?(()=>{const l=Un(["watchPendingTransactions",t.uid,e,s]);return Kd(l,{onTransactions:n,onError:r},u=>{let f;const d=wp(async()=>{var h;try{if(!f)try{f=await Cz(t);return}catch(v){throw d(),v}const p=await s2(t,{filter:f});if(p.length===0)return;e?u.onTransactions(p):p.forEach(v=>u.onTransactions([v]))}catch(p){(h=u.onError)==null||h.call(u,p)}},{emitOnBegin:!0,interval:s});return async()=>{f&&await o2(t,{filter:f}),d()}})})():(()=>{let l=!0,u=()=>l=!1;return(async()=>{try{const{unsubscribe:f}=await t.transport.subscribe({params:["newPendingTransactions"],onData(d){if(!l)return;const h=d.result;n([h])},onError(d){r==null||r(d)}});u=f,l||u()}catch(f){r==null||r(f)}})(),u})()}function Gge(t){return{call:e=>i2(t,e),createBlockFilter:()=>xge(t),createContractEventFilter:e=>iz(t,e),createEventFilter:e=>Ez(t,e),createPendingTransactionFilter:()=>Cz(t),estimateContractGas:e=>Tye(t,e),estimateGas:e=>aS(t,e),getBalance:e=>Ege(t,e),getBlock:e=>Rc(t,e),getBlockNumber:e=>Ep(t,e),getBlockTransactionCount:e=>Cge(t,e),getBytecode:e=>Sge(t,e),getChainId:()=>I1(t),getEnsAddress:e=>sge(t,e),getEnsAvatar:e=>gge(t,e),getEnsName:e=>bge(t,e),getEnsResolver:e=>wge(t,e),getEnsText:e=>xz(t,e),getFeeHistory:e=>Age(t,e),estimateFeesPerGas:e=>Pye(t,e),getFilterChanges:e=>s2(t,e),getFilterLogs:e=>_ge(t,e),getGasPrice:()=>oS(t),getLogs:e=>uS(t,e),estimateMaxPriorityFeePerGas:e=>_ye(t,e),getStorageAt:e=>Pge(t,e),getTransaction:e=>mS(t,e),getTransactionConfirmations:e=>Tge(t,e),getTransactionCount:e=>lz(t,e),getTransactionReceipt:e=>B3(t,e),multicall:e=>Ige(t,e),prepareTransactionRequest:e=>n2(t,e),readContract:e=>$c(t,e),sendRawTransaction:e=>fS(t,e),simulateContract:e=>Fye(t,e),verifyMessage:e=>Uge(t,e),verifyTypedData:e=>zge(t,e),uninstallFilter:e=>o2(t,e),waitForTransactionReceipt:e=>Wge(t,e),watchBlocks:e=>Hge(t,e),watchBlockNumber:e=>Rz(t,e),watchContractEvent:e=>Gye(t,e),watchEvent:e=>qge(t,e),watchPendingTransactions:e=>Vge(t,e)}}function SP(t){const{key:e="public",name:r="Public Client"}=t;return dz({...t,key:e,name:r,type:"publicClient"}).extend(Gge)}function Kge(t,{abi:e,args:r,bytecode:n,...i}){const s=Iz({abi:e,args:r,bytecode:n});return dS(t,{...i,data:s})}async function Qge(t){return(await t.request({method:"eth_accounts"})).map(r=>eS(r))}async function Yge(t){return await t.request({method:"wallet_getPermissions"})}async function Jge(t){return(await t.request({method:"eth_requestAccounts"})).map(r=>jn(r))}async function Xge(t,e){return t.request({method:"wallet_requestPermissions",params:[e]})}async function Zge(t,{account:e=t.account,message:r}){if(!e)throw new Vd({docsPath:"/docs/actions/wallet/signMessage"});const n=ts(e);if(n.type==="local")return n.signMessage({message:r});const i=(()=>typeof r=="string"?W4(r):r.raw instanceof Uint8Array?Ca(r.raw):r.raw)();return t.request({method:"personal_sign",params:[i,n.address]})}async function ebe(t,e){var l,u,f,d;const{account:r=t.account,chain:n=t.chain,...i}=e;if(!r)throw new Vd({docsPath:"/docs/actions/wallet/signTransaction"});const s=ts(r);bp({account:s,...e});const o=await I1(t);n!==null&&LU({currentChainId:o,chain:n});const a=(n==null?void 0:n.formatters)||((l=t.chain)==null?void 0:l.formatters),c=((u=a==null?void 0:a.transactionRequest)==null?void 0:u.format)||Yb;return s.type==="local"?s.signTransaction({chainId:o,...i},{serializer:(d=(f=t.chain)==null?void 0:f.serializers)==null?void 0:d.transaction}):await t.request({method:"eth_signTransaction",params:[{...c(i),chainId:ze(o),from:s.address}]})}async function tbe(t,{account:e=t.account,domain:r,message:n,primaryType:i,types:s}){if(!e)throw new Vd({docsPath:"/docs/actions/wallet/signTypedData"});const o=ts(e),a={EIP712Domain:Tz({domain:r}),...s};if(Pz({domain:r,message:n,primaryType:i,types:a}),o.type==="local")return o.signTypedData({domain:r,primaryType:i,types:a,message:n});const c=Un({domain:r??{},primaryType:i,types:a,message:n},(l,u)=>So(u)?u.toLowerCase():u);return t.request({method:"eth_signTypedData_v4",params:[o.address,c]})}async function rbe(t,{id:e}){await t.request({method:"wallet_switchEthereumChain",params:[{chainId:ze(e)}]})}async function nbe(t,e){return await t.request({method:"wallet_watchAsset",params:e})}function ibe(t){return{addChain:e=>Yye(t,e),deployContract:e=>Kge(t,e),getAddresses:()=>Qge(t),getChainId:()=>I1(t),getPermissions:()=>Yge(t),prepareTransactionRequest:e=>n2(t,e),requestAddresses:()=>Jge(t),requestPermissions:e=>Xge(t,e),sendRawTransaction:e=>fS(t,e),sendTransaction:e=>dS(t,e),signMessage:e=>Zge(t,e),signTransaction:e=>ebe(t,e),signTypedData:e=>tbe(t,e),switchChain:e=>rbe(t,e),watchAsset:e=>nbe(t,e),writeContract:e=>Qye(t,e)}}function Cp(t){const{key:e="wallet",name:r="Wallet Client",transport:n}=t;return dz({...t,key:e,name:r,transport:s=>n({...s,retryCount:0}),type:"walletClient"}).extend(ibe)}function sbe(t,e={}){const{key:r="webSocket",name:n="WebSocket JSON-RPC",retryDelay:i}=e;return({chain:s,retryCount:o,timeout:a})=>{var f;const c=e.retryCount??o,l=a??e.timeout??1e4,u=t||((f=s==null?void 0:s.rpcUrls.default.webSocket)==null?void 0:f[0]);if(!u)throw new vz;return a2({key:r,name:n,async request({method:d,params:h}){const p={method:d,params:h},v=await Ex(u),{error:m,result:g}=await jf.webSocketAsync(v,{body:p,timeout:l});if(m)throw new rS({body:p,error:m,url:u});return g},retryCount:c,retryDelay:i,timeout:l,type:"webSocket"},{getSocket(){return Ex(u)},async subscribe({params:d,onData:h,onError:p}){const v=await Ex(u),{result:m}=await new Promise((g,y)=>jf.webSocket(v,{body:{method:"eth_subscribe",params:d},onResponse(b){if(b.error){y(b.error),p==null||p(b.error);return}if(typeof b.id=="number"){g(b);return}b.method==="eth_subscription"&&h(b.params)}}));return{subscriptionId:m,async unsubscribe(){return new Promise(g=>jf.webSocket(v,{body:{method:"eth_unsubscribe",params:[m]},onResponse:g}))}}}})}}function obe(t){var r;if(!t)return"Injected";const e=n=>{if(n.isApexWallet)return"Apex Wallet";if(n.isAvalanche)return"Core Wallet";if(n.isBackpack)return"Backpack";if(n.isBifrost)return"Bifrost Wallet";if(n.isBitKeep)return"BitKeep";if(n.isBitski)return"Bitski";if(n.isBlockWallet)return"BlockWallet";if(n.isBraveWallet)return"Brave Wallet";if(n.isCoinbaseWallet)return"Coinbase Wallet";if(n.isDawn)return"Dawn Wallet";if(n.isDefiant)return"Defiant";if(n.isEnkrypt)return"Enkrypt";if(n.isExodus)return"Exodus";if(n.isFrame)return"Frame";if(n.isFrontier)return"Frontier Wallet";if(n.isGamestop)return"GameStop Wallet";if(n.isHaqqWallet)return"HAQQ Wallet";if(n.isHyperPay)return"HyperPay Wallet";if(n.isImToken)return"ImToken";if(n.isHaloWallet)return"Halo Wallet";if(n.isKuCoinWallet)return"KuCoin Wallet";if(n.isMathWallet)return"MathWallet";if(n.isNovaWallet)return"Nova Wallet";if(n.isOkxWallet||n.isOKExWallet)return"OKX Wallet";if(n.isOneInchIOSWallet||n.isOneInchAndroidWallet)return"1inch Wallet";if(n.isOpera)return"Opera";if(n.isPhantom)return"Phantom";if(n.isPortal)return"Ripio Portal";if(n.isRabby)return"Rabby Wallet";if(n.isRainbow)return"Rainbow";if(n.isStatus)return"Status";if(n.isTalisman)return"Talisman";if(n.isTally)return"Taho";if(n.isTokenPocket)return"TokenPocket";if(n.isTokenary)return"Tokenary";if(n.isTrust||n.isTrustWallet)return"Trust Wallet";if(n.isTTWallet)return"TTWallet";if(n.isXDEFI)return"XDEFI Wallet";if(n.isZerion)return"Zerion";if(n.isMetaMask)return"MetaMask"};if((r=t.providers)!=null&&r.length){const n=new Set;let i=1;for(const o of t.providers){let a=e(o);a||(a=`Unknown Wallet #${i}`,i+=1),n.add(a)}const s=[...n];return s.length?s:s[0]??"Injected"}return e(t)??"Injected"}var ym,$z=class extends vp{constructor({chains:t,options:e}={}){const r={shimDisconnect:!0,getProvider(){if(typeof window>"u")return;const i=window.ethereum;return i!=null&&i.providers?i.providers[0]:i},...e};super({chains:t,options:r}),Ke(this,"id","injected"),Ke(this,"name"),Ke(this,"ready"),Br(this,ym,void 0),Ke(this,"shimDisconnectKey",`${this.id}.shimDisconnect`),Ke(this,"onAccountsChanged",i=>{i.length===0?this.emit("disconnect"):this.emit("change",{account:jn(i[0])})}),Ke(this,"onChainChanged",i=>{const s=Ul(i),o=this.isChainUnsupported(s);this.emit("change",{chain:{id:s,unsupported:o}})}),Ke(this,"onDisconnect",async i=>{var s;i.code===1013&&await this.getProvider()&&await this.getAccount()||(this.emit("disconnect"),this.options.shimDisconnect&&((s=this.storage)==null||s.removeItem(this.shimDisconnectKey)))});const n=r.getProvider();if(typeof r.name=="string")this.name=r.name;else if(n){const i=obe(n);r.name?this.name=r.name(i):typeof i=="string"?this.name=i:this.name=i[0]}else this.name="Injected";this.ready=!!n}async connect({chainId:t}={}){var e;try{const r=await this.getProvider();if(!r)throw new qa;r.on&&(r.on("accountsChanged",this.onAccountsChanged),r.on("chainChanged",this.onChainChanged),r.on("disconnect",this.onDisconnect)),this.emit("message",{type:"connecting"});const n=await r.request({method:"eth_requestAccounts"}),i=jn(n[0]);let s=await this.getChainId(),o=this.isChainUnsupported(s);return t&&s!==t&&(s=(await this.switchChain(t)).id,o=this.isChainUnsupported(s)),this.options.shimDisconnect&&((e=this.storage)==null||e.setItem(this.shimDisconnectKey,!0)),{account:i,chain:{id:s,unsupported:o}}}catch(r){throw this.isUserRejectedRequestError(r)?new Or(r):r.code===-32002?new Oc(r):r}}async disconnect(){var e;const t=await this.getProvider();t!=null&&t.removeListener&&(t.removeListener("accountsChanged",this.onAccountsChanged),t.removeListener("chainChanged",this.onChainChanged),t.removeListener("disconnect",this.onDisconnect),this.options.shimDisconnect&&((e=this.storage)==null||e.removeItem(this.shimDisconnectKey)))}async getAccount(){const t=await this.getProvider();if(!t)throw new qa;const e=await t.request({method:"eth_accounts"});return jn(e[0])}async getChainId(){const t=await this.getProvider();if(!t)throw new qa;return t.request({method:"eth_chainId"}).then(Ul)}async getProvider(){const t=this.options.getProvider();return t&&Es(this,ym,t),He(this,ym)}async getWalletClient({chainId:t}={}){const[e,r]=await Promise.all([this.getProvider(),this.getAccount()]),n=this.chains.find(i=>i.id===t);if(!e)throw new Error("provider is required.");return Cp({account:r,chain:n,transport:c2(e)})}async isAuthorized(){var t;try{if(this.options.shimDisconnect&&!((t=this.storage)!=null&&t.getItem(this.shimDisconnectKey)))return!1;if(!await this.getProvider())throw new qa;return!!await this.getAccount()}catch{return!1}}async switchChain(t){var n,i,s;const e=await this.getProvider();if(!e)throw new qa;const r=ze(t);try{return await Promise.all([e.request({method:"wallet_switchEthereumChain",params:[{chainId:r}]}),new Promise(o=>this.on("change",({chain:a})=>{(a==null?void 0:a.id)===t&&o()}))]),this.chains.find(o=>o.id===t)??{id:t,name:`Chain ${r}`,network:`${r}`,nativeCurrency:{name:"Ether",decimals:18,symbol:"ETH"},rpcUrls:{default:{http:[""]},public:{http:[""]}}}}catch(o){const a=this.chains.find(c=>c.id===t);if(!a)throw new GU({chainId:t,connectorId:this.id});if(o.code===4902||((i=(n=o==null?void 0:o.data)==null?void 0:n.originalError)==null?void 0:i.code)===4902)try{if(await e.request({method:"wallet_addEthereumChain",params:[{chainId:r,chainName:a.name,nativeCurrency:a.nativeCurrency,rpcUrls:[((s=a.rpcUrls.public)==null?void 0:s.http[0])??""],blockExplorerUrls:this.getBlockExplorerUrls(a)}]}),await this.getChainId()!==t)throw new Or(new Error("User rejected switch after adding network."));return a}catch(c){throw new Or(c)}throw this.isUserRejectedRequestError(o)?new Or(o):new aa(o)}}async watchAsset({address:t,decimals:e=18,image:r,symbol:n}){const i=await this.getProvider();if(!i)throw new qa;return i.request({method:"wallet_watchAsset",params:{type:"ERC20",options:{address:t,decimals:e,image:r,symbol:n}}})}isUserRejectedRequestError(t){return t.code===4001}};ym=new WeakMap;var yS=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},Sx=(t,e,r)=>(yS(t,e,"read from private field"),r?r.call(t):e.get(t)),kx=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},Sv=(t,e,r,n)=>(yS(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),abe=(t,e,r)=>(yS(t,e,"access private method"),r);const cbe=t=>(e,r,n)=>{const i=n.subscribe;return n.subscribe=(o,a,c)=>{let l=o;if(a){const u=(c==null?void 0:c.equalityFn)||Object.is;let f=o(n.getState());l=d=>{const h=o(d);if(!u(f,h)){const p=f;a(f=h,p)}},c!=null&&c.fireImmediately&&a(f,f)}return i(l)},t(e,r,n)},lbe=cbe;function ube(t,e){let r;try{r=t()}catch{return}return{getItem:i=>{var s;const o=c=>c===null?null:JSON.parse(c,e==null?void 0:e.reviver),a=(s=r.getItem(i))!=null?s:null;return a instanceof Promise?a.then(o):o(a)},setItem:(i,s)=>r.setItem(i,JSON.stringify(s,e==null?void 0:e.replacer)),removeItem:i=>r.removeItem(i)}}const O1=t=>e=>{try{const r=t(e);return r instanceof Promise?r:{then(n){return O1(n)(r)},catch(n){return this}}}catch(r){return{then(n){return this},catch(n){return O1(n)(r)}}}},fbe=(t,e)=>(r,n,i)=>{let s={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:m=>m,version:0,merge:(m,g)=>({...g,...m}),...e},o=!1;const a=new Set,c=new Set;let l;try{l=s.getStorage()}catch{}if(!l)return t((...m)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),r(...m)},n,i);const u=O1(s.serialize),f=()=>{const m=s.partialize({...n()});let g;const y=u({state:m,version:s.version}).then(b=>l.setItem(s.name,b)).catch(b=>{g=b});if(g)throw g;return y},d=i.setState;i.setState=(m,g)=>{d(m,g),f()};const h=t((...m)=>{r(...m),f()},n,i);let p;const v=()=>{var m;if(!l)return;o=!1,a.forEach(y=>y(n()));const g=((m=s.onRehydrateStorage)==null?void 0:m.call(s,n()))||void 0;return O1(l.getItem.bind(l))(s.name).then(y=>{if(y)return s.deserialize(y)}).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==s.version){if(s.migrate)return s.migrate(y.state,y.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return y.state}).then(y=>{var b;return p=s.merge(y,(b=n())!=null?b:h),r(p,!0),f()}).then(()=>{g==null||g(p,void 0),o=!0,c.forEach(y=>y(p))}).catch(y=>{g==null||g(void 0,y)})};return i.persist={setOptions:m=>{s={...s,...m},m.getStorage&&(l=m.getStorage())},clearStorage:()=>{l==null||l.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>v(),hasHydrated:()=>o,onHydrate:m=>(a.add(m),()=>{a.delete(m)}),onFinishHydration:m=>(c.add(m),()=>{c.delete(m)})},v(),p||h},dbe=(t,e)=>(r,n,i)=>{let s={storage:ube(()=>localStorage),partialize:v=>v,version:0,merge:(v,m)=>({...m,...v}),...e},o=!1;const a=new Set,c=new Set;let l=s.storage;if(!l)return t((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),r(...v)},n,i);const u=()=>{const v=s.partialize({...n()});return l.setItem(s.name,{state:v,version:s.version})},f=i.setState;i.setState=(v,m)=>{f(v,m),u()};const d=t((...v)=>{r(...v),u()},n,i);let h;const p=()=>{var v,m;if(!l)return;o=!1,a.forEach(y=>{var b;return y((b=n())!=null?b:d)});const g=((m=s.onRehydrateStorage)==null?void 0:m.call(s,(v=n())!=null?v:d))||void 0;return O1(l.getItem.bind(l))(s.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==s.version){if(s.migrate)return s.migrate(y.state,y.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return y.state}).then(y=>{var b;return h=s.merge(y,(b=n())!=null?b:d),r(h,!0),u()}).then(()=>{g==null||g(h,void 0),h=n(),o=!0,c.forEach(y=>y(h))}).catch(y=>{g==null||g(void 0,y)})};return i.persist={setOptions:v=>{s={...s,...v},v.storage&&(l=v.storage)},clearStorage:()=>{l==null||l.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>p(),hasHydrated:()=>o,onHydrate:v=>(a.add(v),()=>{a.delete(v)}),onFinishHydration:v=>(c.add(v),()=>{c.delete(v)})},s.skipHydration||p(),h||d},hbe=(t,e)=>"getStorage"in e||"serialize"in e||"deserialize"in e?fbe(t,e):dbe(t,e),pbe=hbe,kP=t=>{let e;const r=new Set,n=(c,l)=>{const u=typeof c=="function"?c(e):c;if(!Object.is(u,e)){const f=e;e=l??typeof u!="object"?u:Object.assign({},e,u),r.forEach(d=>d(e,f))}},i=()=>e,a={setState:n,getState:i,subscribe:c=>(r.add(c),()=>r.delete(c)),destroy:()=>{r.clear()}};return e=t(n,i,a),a},vbe=t=>t?kP(t):kP;function gS(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[n,i]of t)if(!Object.is(i,e.get(n)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!1;for(let n=0;nv===f.id)||(c=[...c,p.chain]),l[f.id]=[...l[f.id]||[],...p.rpcUrls.http],p.rpcUrls.webSocket&&(u[f.id]=[...u[f.id]||[],...p.rpcUrls.webSocket]))}if(!d)throw new Error([`Could not find valid provider configuration for chain "${f.name}". -`,"You may need to add `jsonRpcProvider` to `configureChains` with the chain's RPC URLs.","Read more: https://wagmi.sh/core/providers/jsonRpc"].join(` -`))}return{chains:c,publicClient:({chainId:f})=>{const d=c.find(v=>v.id===f)??t[0],h=l[d.id];if(!h||!h[0])throw new Error(`No providers configured for chain "${d.id}"`);const p=SP({batch:r,chain:d,transport:xP(h.map(v=>yz(v,{timeout:a})),{rank:i,retryCount:s,retryDelay:o}),pollingInterval:n});return Object.assign(p,{chains:c})},webSocketPublicClient:({chainId:f})=>{const d=c.find(v=>v.id===f)??t[0],h=u[d.id];if(!h||!h[0])return;const p=SP({batch:r,chain:d,transport:xP(h.map(v=>sbe(v,{timeout:a})),{rank:i,retryCount:s,retryDelay:o}),pollingInterval:n});return Object.assign(p,{chains:c})}}}var ybe=class extends Error{constructor(){super(...arguments),this.name="ConnectorAlreadyConnectedError",this.message="Connector already connected"}},gbe=class extends Error{constructor({connector:t}){super(`"${t.name}" does not support programmatic chain switching.`),this.name="SwitchChainNotSupportedError"}};function F3(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;let r,n;if(Array.isArray(t)&&Array.isArray(e)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!F3(t[n],e[n]))return!1;return!0}if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();const i=Object.keys(t);if(r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){const s=i[n];if(s&&!F3(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}var j3=(t,{find:e,replace:r})=>t&&e(t)?r(t):typeof t!="object"?t:Array.isArray(t)?t.map(n=>j3(n,{find:e,replace:r})):t instanceof Object?Object.entries(t).reduce((n,[i,s])=>({...n,[i]:j3(s,{find:e,replace:r})}),{}):t;function bbe(t){const e=JSON.parse(t);return j3(e,{find:n=>typeof n=="string"&&n.startsWith("#bigint."),replace:n=>BigInt(n.replace("#bigint.",""))})}function AP(t,e){return t.slice(0,e).join(".")||"."}function _P(t,e){const{length:r}=t;for(let n=0;n{const o=typeof s=="bigint"?`#bigint.${s.toString()}`:s;return(e==null?void 0:e(i,o))||o},n),r??void 0)}var Mz={getItem:t=>"",setItem:(t,e)=>null,removeItem:t=>null};function Nz({deserialize:t=bbe,key:e="wagmi",serialize:r=xbe,storage:n}){return{...n,getItem:(i,s=null)=>{const o=n.getItem(`${e}.${i}`);try{return o?t(o):s}catch(a){return console.warn(a),s}},setItem:(i,s)=>{if(s===null)n.removeItem(`${e}.${i}`);else try{n.setItem(`${e}.${i}`,r(s))}catch(o){console.error(o)}},removeItem:i=>n.removeItem(`${e}.${i}`)}}var PP="store",Ju,Uh,U3,Dz,Ebe=class{constructor({autoConnect:e=!1,connectors:r=[new $z],publicClient:n,storage:i=Nz({storage:typeof window<"u"?window.localStorage:Mz}),logger:s={warn:console.warn},webSocketPublicClient:o}){var u,f;kx(this,U3),this.publicClients=new Map,this.webSocketPublicClients=new Map,kx(this,Ju,void 0),kx(this,Uh,void 0),this.args={autoConnect:e,connectors:r,logger:s,publicClient:n,storage:i,webSocketPublicClient:o};let a="disconnected",c;if(e)try{const d=i.getItem(PP),h=(u=d==null?void 0:d.state)==null?void 0:u.data;a=h!=null&&h.account?"reconnecting":"connecting",c=(f=h==null?void 0:h.chain)==null?void 0:f.id}catch{}const l=typeof r=="function"?r():r;l.forEach(d=>d.setStorage(i)),this.store=vbe(lbe(pbe(()=>({connectors:l,publicClient:this.getPublicClient({chainId:c}),status:a,webSocketPublicClient:this.getWebSocketPublicClient({chainId:c})}),{name:PP,storage:i,partialize:d=>{var h,p;return{...e&&{data:{account:(h=d==null?void 0:d.data)==null?void 0:h.account,chain:(p=d==null?void 0:d.data)==null?void 0:p.chain}},chains:d==null?void 0:d.chains}},version:2}))),this.storage=i,Sv(this,Uh,i==null?void 0:i.getItem("wallet")),abe(this,U3,Dz).call(this),e&&typeof window<"u"&&setTimeout(async()=>await this.autoConnect(),0)}get chains(){return this.store.getState().chains}get connectors(){return this.store.getState().connectors}get connector(){return this.store.getState().connector}get data(){return this.store.getState().data}get error(){return this.store.getState().error}get lastUsedChainId(){var e,r;return(r=(e=this.data)==null?void 0:e.chain)==null?void 0:r.id}get publicClient(){return this.store.getState().publicClient}get status(){return this.store.getState().status}get subscribe(){return this.store.subscribe}get webSocketPublicClient(){return this.store.getState().webSocketPublicClient}setState(e){const r=typeof e=="function"?e(this.store.getState()):e;this.store.setState(r,!0)}clearState(){this.setState(e=>({...e,chains:void 0,connector:void 0,data:void 0,error:void 0,status:"disconnected"}))}async destroy(){var e,r;this.connector&&await((r=(e=this.connector).disconnect)==null?void 0:r.call(e)),Sv(this,Ju,!1),this.clearState(),this.store.destroy()}async autoConnect(){if(Sx(this,Ju))return;Sv(this,Ju,!0),this.setState(n=>{var i;return{...n,status:(i=n.data)!=null&&i.account?"reconnecting":"connecting"}});const e=Sx(this,Uh)?[...this.connectors].sort(n=>n.id===Sx(this,Uh)?-1:1):this.connectors;let r=!1;for(const n of e){if(!n.ready||!n.isAuthorized||!await n.isAuthorized())continue;const s=await n.connect();this.setState(o=>({...o,connector:n,chains:n==null?void 0:n.chains,data:s,status:"connected"})),r=!0;break}return r||this.setState(n=>({...n,data:void 0,status:"disconnected"})),Sv(this,Ju,!1),this.data}setConnectors(e){this.args={...this.args,connectors:e};const r=typeof e=="function"?e():e;r.forEach(n=>n.setStorage(this.args.storage)),this.setState(n=>({...n,connectors:r}))}getPublicClient({chainId:e}={}){let r=this.publicClients.get(-1);if(r&&(r==null?void 0:r.chain.id)===e||(r=this.publicClients.get(e??-1),r))return r;const{publicClient:n}=this.args;return r=typeof n=="function"?n({chainId:e}):n,this.publicClients.set(e??-1,r),r}setPublicClient(e){var n,i;const r=(i=(n=this.data)==null?void 0:n.chain)==null?void 0:i.id;this.args={...this.args,publicClient:e},this.publicClients.clear(),this.setState(s=>({...s,publicClient:this.getPublicClient({chainId:r})}))}getWebSocketPublicClient({chainId:e}={}){let r=this.webSocketPublicClients.get(-1);if(r&&(r==null?void 0:r.chain.id)===e||(r=this.webSocketPublicClients.get(e??-1),r))return r;const{webSocketPublicClient:n}=this.args;return r=typeof n=="function"?n({chainId:e}):n,r&&this.webSocketPublicClients.set(e??-1,r),r}setWebSocketPublicClient(e){var n,i;const r=(i=(n=this.data)==null?void 0:n.chain)==null?void 0:i.id;this.args={...this.args,webSocketPublicClient:e},this.webSocketPublicClients.clear(),this.setState(s=>({...s,webSocketPublicClient:this.getWebSocketPublicClient({chainId:r})}))}setLastUsedConnector(e=null){var r;(r=this.storage)==null||r.setItem("wallet",e)}};Ju=new WeakMap;Uh=new WeakMap;U3=new WeakSet;Dz=function(){const t=a=>{this.setState(c=>({...c,data:{...c.data,...a}}))},e=()=>{this.clearState()},r=a=>{this.setState(c=>({...c,error:a}))};this.store.subscribe(({connector:a})=>a,(a,c)=>{var l,u,f,d,h,p;(l=c==null?void 0:c.off)==null||l.call(c,"change",t),(u=c==null?void 0:c.off)==null||u.call(c,"disconnect",e),(f=c==null?void 0:c.off)==null||f.call(c,"error",r),a&&((d=a.on)==null||d.call(a,"change",t),(h=a.on)==null||h.call(a,"disconnect",e),(p=a.on)==null||p.call(a,"error",r))});const{publicClient:n,webSocketPublicClient:i}=this.args;(typeof n=="function"||typeof i=="function")&&this.store.subscribe(({data:a})=>{var c;return(c=a==null?void 0:a.chain)==null?void 0:c.id},a=>{this.setState(c=>({...c,publicClient:this.getPublicClient({chainId:a}),webSocketPublicClient:this.getWebSocketPublicClient({chainId:a})}))})};var z3;function Cbe(t){const e=new Ebe(t);return z3=e,e}function Ji(){if(!z3)throw new Error("No wagmi config found. Ensure you have set up a config: https://wagmi.sh/react/config");return z3}async function Sbe({chainId:t,connector:e}){const r=Ji(),n=r.connector;if(n&&e.id===n.id)throw new ybe;try{r.setState(s=>({...s,status:"connecting"}));const i=await e.connect({chainId:t});return r.setLastUsedConnector(e.id),r.setState(s=>({...s,connector:e,chains:e==null?void 0:e.chains,data:i,status:"connected"})),r.storage.setItem("connected",!0),{...i,connector:e}}catch(i){throw r.setState(s=>({...s,status:s.connector?"connected":"disconnected"})),i}}async function kbe(){const t=Ji();t.connector&&await t.connector.disconnect(),t.clearState(),t.storage.removeItem("connected")}function W3({chainId:t}={}){const e=Ji();return t&&e.getPublicClient({chainId:t})||e.publicClient}async function Lz({chainId:t}={}){var n,i;return await((i=(n=Ji().connector)==null?void 0:n.getWalletClient)==null?void 0:i.call(n,{chainId:t}))||null}function Abe(t,e){const r=Ji(),n=async()=>e(W3(t));return r.subscribe(({publicClient:s})=>s,n)}function _be({chainId:t},e){const r=Ji(),n=async({chainId:s})=>{if(t&&s&&t!==s)return;const o=await Lz({chainId:t});return Ji().connector?e(o):e(null)};return r.subscribe(({data:s,connector:o})=>{var a;return{account:s==null?void 0:s.account,chainId:(a=s==null?void 0:s.chain)==null?void 0:a.id,connector:o}},n,{equalityFn:gS})}function Bz(){const{data:t,connector:e,status:r}=Ji();switch(r){case"connected":return{address:t==null?void 0:t.account,connector:e,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:r};case"reconnecting":return{address:t==null?void 0:t.account,connector:e,isConnected:!!(t!=null&&t.account),isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:r};case"connecting":return{address:t==null?void 0:t.account,connector:e,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:r};case"disconnected":return{address:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:r}}}function Fz(){var i,s,o,a;const t=Ji(),e=(s=(i=t.data)==null?void 0:i.chain)==null?void 0:s.id,r=t.chains??[],n=[...((o=t.publicClient)==null?void 0:o.chains)||[],...r].find(c=>c.id===e)??{id:e,name:`Chain ${e}`,network:`${e}`,nativeCurrency:{name:"Ether",decimals:18,symbol:"ETH"},rpcUrls:{default:{http:[""]},public:{http:[""]}}};return{chain:e?{...n,...(a=t.data)==null?void 0:a.chain,id:e}:void 0,chains:r}}async function Pbe({chainId:t}){const{connector:e}=Ji();if(!e)throw new qa;if(!e.switchChain)throw new gbe({connector:e});return e.switchChain(t)}function Tbe(t,{selector:e=r=>r}={}){const r=Ji(),n=()=>t(Bz());return r.subscribe(({data:s,connector:o,status:a})=>e({address:s==null?void 0:s.account,connector:o,status:a}),n,{equalityFn:gS})}function Ibe(t,{selector:e=r=>r}={}){const r=Ji(),n=()=>t(Fz());return r.subscribe(({data:s,chains:o})=>{var a;return e({chainId:(a=s==null?void 0:s.chain)==null?void 0:a.id,chains:o})},n,{equalityFn:gS})}var Obe={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xc0497E381f536Be9ce14B0dD3817cBcAe57d2F62",blockCreated:16966585},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}},TP={id:137,name:"Polygon",network:"matic",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}},jz={exports:{}},Uz={};/** - * @license React - * use-sync-external-store-shim/with-selector.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var u2=k,Rbe=j4;function $be(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Mbe=typeof Object.is=="function"?Object.is:$be,Nbe=Rbe.useSyncExternalStore,Dbe=u2.useRef,Lbe=u2.useEffect,Bbe=u2.useMemo,Fbe=u2.useDebugValue;Uz.useSyncExternalStoreWithSelector=function(t,e,r,n,i){var s=Dbe(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=Bbe(function(){function c(h){if(!l){if(l=!0,u=h,h=n(h),i!==void 0&&o.hasValue){var p=o.value;if(i(p,h))return f=p}return f=h}if(p=f,Mbe(u,h))return p;var v=n(h);return i!==void 0&&i(p,v)?p:(u=h,f=v)}var l=!1,u,f,d=r===void 0?null:r;return[function(){return c(e())},d===null?void 0:function(){return c(d())}]},[e,r,n,i]);var a=Nbe(t,s[0],s[1]);return Lbe(function(){o.hasValue=!0,o.value=a},[a]),Fbe(a),a};jz.exports=Uz;var zz=jz.exports;function jbe({queryClient:t=new L4({defaultOptions:{queries:{cacheTime:1e3*60*60*24,networkMode:"offlineFirst",refetchOnWindowFocus:!1,retry:0},mutations:{networkMode:"offlineFirst"}}}),storage:e=Nz({storage:typeof window<"u"&&window.localStorage?window.localStorage:Mz}),persister:r=typeof window<"u"?jpe({key:"cache",storage:e,serialize:i=>i,deserialize:i=>i}):void 0,...n}){const i=Cbe({...n,storage:e});return r&&Nve({queryClient:t,persister:r,dehydrateOptions:{shouldDehydrateQuery:s=>s.cacheTime!==0&&s.queryKey[0].persist!==!1}}),Object.assign(i,{queryClient:t})}var Wz=k.createContext(void 0),f2=k.createContext(void 0);function Ube({children:t,config:e}){return k.createElement(Wz.Provider,{children:k.createElement(U4,{children:t,client:e.queryClient,context:f2}),value:e})}function d2(){const t=k.useContext(Wz);if(!t)throw new Error(["`useConfig` must be used within `WagmiConfig`.\n","Read more: https://wagmi.sh/react/WagmiConfig"].join(` -`));return t}var zbe=j4.useSyncExternalStore;function Wbe(t){return Array.isArray(t)}function Hbe(t){if(!IP(t))return!1;const e=t.constructor;if(typeof e>"u")return!0;const r=e.prototype;return!(!IP(r)||!r.hasOwnProperty("isPrototypeOf"))}function IP(t){return Object.prototype.toString.call(t)==="[object Object]"}function qbe(t,e,r){return Wbe(t)?typeof e=="function"?{...r,queryKey:t,queryFn:e}:{...e,queryKey:t}:t}function Vbe(t){return JSON.stringify(t,(e,r)=>Hbe(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):typeof r=="bigint"?r.toString():r)}function Gbe(t,e){return typeof t=="function"?t(...e):!!t}function Kbe(t,e){const r={};return Object.keys(t).forEach(n=>{Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:()=>(e.trackedProps.add(n),t[n])})}),r}function Qbe(t,e){const r=Gb({context:t.context}),n=TU(),i=IU(),s=r.defaultQueryOptions({...t,queryKeyHashFn:Vbe});s._optimisticResults=n?"isRestoring":"optimistic",s.onError&&(s.onError=wt.batchCalls(s.onError)),s.onSuccess&&(s.onSuccess=wt.batchCalls(s.onSuccess)),s.onSettled&&(s.onSettled=wt.batchCalls(s.onSettled)),s.suspense&&typeof s.staleTime!="number"&&(s.staleTime=1e3),(s.suspense||s.useErrorBoundary)&&(i.isReset()||(s.retryOnMount=!1));const[o]=k.useState(()=>new e(r,s)),a=o.getOptimisticResult(s);if(zbe(k.useCallback(f=>n?()=>{}:o.subscribe(wt.batchCalls(f)),[o,n]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),k.useEffect(()=>{i.clearReset()},[i]),k.useEffect(()=>{o.setOptions(s,{listeners:!1})},[s,o]),s.suspense&&a.isLoading&&a.isFetching&&!n)throw o.fetchOptimistic(s).then(({data:f})=>{var d,h;(d=s.onSuccess)==null||d.call(s,f),(h=s.onSettled)==null||h.call(s,f,null)}).catch(f=>{var d,h;i.clearReset(),(d=s.onError)==null||d.call(s,f),(h=s.onSettled)==null||h.call(s,void 0,f)});if(a.isError&&!i.isReset()&&!a.isFetching&&Gbe(s.useErrorBoundary,[a.error,o.getCurrentQuery()]))throw a.error;const c=a.status==="loading"&&a.fetchStatus==="idle"?"idle":a.status,l=c==="idle",u=c==="loading"&&a.fetchStatus==="fetching";return{...a,defaultedOptions:s,isIdle:l,isLoading:u,observer:o,status:c}}function bS(t,e,r){const n=pU(t,e,r);return Tve({context:f2,...n})}function Ybe(t,e,r){const n=qbe(t,e,r),i=Qbe({context:f2,...n},B4),s={data:i.data,error:i.error,fetchStatus:i.fetchStatus,isError:i.isError,isFetched:i.isFetched,isFetchedAfterMount:i.isFetchedAfterMount,isFetching:i.isFetching,isIdle:i.isIdle,isLoading:i.isLoading,isRefetching:i.isRefetching,isSuccess:i.isSuccess,refetch:i.refetch,status:i.status,internal:{dataUpdatedAt:i.dataUpdatedAt,errorUpdatedAt:i.errorUpdatedAt,failureCount:i.failureCount,isFetchedAfterMount:i.isFetchedAfterMount,isLoadingError:i.isLoadingError,isPaused:i.isPaused,isPlaceholderData:i.isPlaceholderData,isPreviousData:i.isPreviousData,isRefetchError:i.isRefetchError,isStale:i.isStale,remove:i.remove}};return i.defaultedOptions.notifyOnChangeProps?s:Kbe(s,i.observer)}var Jbe=()=>Gb({context:f2});function Hz({chainId:t}={}){return zz.useSyncExternalStoreWithSelector(e=>Abe({chainId:t},e),()=>W3({chainId:t}),()=>W3({chainId:t}),e=>e,(e,r)=>e.uid===r.uid)}function Ax({chainId:t}){return[{entity:"walletClient",chainId:t,persist:!1}]}function Xbe({queryKey:[{chainId:t}]}){return Lz({chainId:t})}function wS({chainId:t,suspense:e,onError:r,onSettled:n,onSuccess:i}={}){const{connector:s}=fn(),o=h2({chainId:t}),a=Ybe(Ax({chainId:o}),Xbe,{cacheTime:0,enabled:!!s,staleTime:1/0,suspense:e,onError:r,onSettled:n,onSuccess:i}),c=Jbe();return k.useEffect(()=>_be({chainId:o},u=>{u?c.invalidateQueries(Ax({chainId:o})):c.removeQueries(Ax({chainId:o}))}),[c,o]),a}function h2({chainId:t}={}){return Hz({chainId:t}).chain.id}function Zbe(){const[,t]=k.useReducer(e=>e+1,0);return t}var _x=t=>typeof t=="object"&&!Array.isArray(t);function qz(t,e,r=e,n=F3){const i=k.useRef([]),s=zz.useSyncExternalStoreWithSelector(t,e,r,o=>o,(o,a)=>{if(_x(o)&&_x(a)&&i.current.length){for(const c of i.current)if(!n(o[c],a[c]))return!1;return!0}return n(o,a)});if(_x(s)){const o={...s};return Object.defineProperties(o,Object.entries(o).reduce((a,[c,l])=>({...a,[c]:{configurable:!1,enumerable:!0,get:()=>(i.current.includes(c)||i.current.push(c),l)}}),{})),o}return s}function fn({onConnect:t,onDisconnect:e}={}){const r=d2(),n=k.useCallback(a=>Tbe(a),[r]),i=qz(n,Bz),s=k.useRef(),o=s.current;return k.useEffect(()=>{(o==null?void 0:o.status)!=="connected"&&i.status==="connected"&&(t==null||t({address:i.address,connector:i.connector,isReconnected:(o==null?void 0:o.status)==="reconnecting"||(o==null?void 0:o.status)===void 0})),(o==null?void 0:o.status)==="connected"&&i.status==="disconnected"&&(e==null||e()),s.current=i},[t,e,o,i]),i}var e2e=t=>[{entity:"connect",...t}],t2e=t=>{const{connector:e,chainId:r}=t;if(!e)throw new Error("connector is required");return Sbe({connector:e,chainId:r})};function Vz({chainId:t,connector:e,onError:r,onMutate:n,onSettled:i,onSuccess:s}={}){const o=d2(),{data:a,error:c,isError:l,isIdle:u,isLoading:f,isSuccess:d,mutate:h,mutateAsync:p,reset:v,status:m,variables:g}=bS(e2e({connector:e,chainId:t}),t2e,{onError:r,onMutate:n,onSettled:i,onSuccess:s}),y=k.useCallback(C=>h({chainId:(C==null?void 0:C.chainId)??t,connector:(C==null?void 0:C.connector)??e}),[t,e,h]),b=k.useCallback(C=>p({chainId:(C==null?void 0:C.chainId)??t,connector:(C==null?void 0:C.connector)??e}),[t,e,p]);return{connect:y,connectAsync:b,connectors:o.connectors,data:a,error:c,isError:l,isIdle:u,isLoading:f,isSuccess:d,pendingConnector:g==null?void 0:g.connector,reset:v,status:m,variables:g}}var r2e=[{entity:"disconnect"}],n2e=()=>kbe();function Gz({onError:t,onMutate:e,onSettled:r,onSuccess:n}={}){const{error:i,isError:s,isIdle:o,isLoading:a,isSuccess:c,mutate:l,mutateAsync:u,reset:f,status:d}=bS(r2e,n2e,{...t?{onError(h,p,v){t(h,v)}}:{},onMutate:e,...r?{onSettled(h,p,v,m){r(p,m)}}:{},...n?{onSuccess(h,p,v){n(v)}}:{}});return{disconnect:l,disconnectAsync:u,error:i,isError:s,isIdle:o,isLoading:a,isSuccess:c,reset:f,status:d}}function dn(){const t=d2(),e=k.useCallback(r=>Ibe(r),[t]);return qz(e,Fz)}var i2e=t=>[{entity:"switchNetwork",...t}],s2e=t=>{const{chainId:e}=t;if(!e)throw new Error("chainId is required");return Pbe({chainId:e})};function xS({chainId:t,throwForSwitchChainNotSupported:e,onError:r,onMutate:n,onSettled:i,onSuccess:s}={}){var I;const o=d2(),a=Zbe(),{data:c,error:l,isError:u,isIdle:f,isLoading:d,isSuccess:h,mutate:p,mutateAsync:v,reset:m,status:g,variables:y}=bS(i2e({chainId:t}),s2e,{onError:r,onMutate:n,onSettled:i,onSuccess:s}),b=k.useCallback(B=>p({chainId:B??t}),[t,p]),C=k.useCallback(B=>v({chainId:B??t}),[t,v]);k.useEffect(()=>o.subscribe(({chains:z,connector:H})=>({chains:z,connector:H}),a),[o,a]);let A,O;const w=!!((I=o.connector)!=null&&I.switchChain);return(e||w)&&(A=b,O=C),{chains:o.chains??[],data:c,error:l,isError:u,isIdle:f,isLoading:d,isSuccess:h,pendingChainId:y==null?void 0:y.chainId,reset:m,status:g,switchNetwork:A,switchNetworkAsync:O,variables:y}}var zh,Xu,o2e=class extends vp{constructor({chains:t,options:e}){super({chains:t,options:{reloadOnDisconnect:!1,...e}}),Ke(this,"id","coinbaseWallet"),Ke(this,"name","Coinbase Wallet"),Ke(this,"ready",!0),Br(this,zh,void 0),Br(this,Xu,void 0),Ke(this,"onAccountsChanged",r=>{r.length===0?this.emit("disconnect"):this.emit("change",{account:jn(r[0])})}),Ke(this,"onChainChanged",r=>{const n=Ul(r),i=this.isChainUnsupported(n);this.emit("change",{chain:{id:n,unsupported:i}})}),Ke(this,"onDisconnect",()=>{this.emit("disconnect")})}async connect({chainId:t}={}){try{const e=await this.getProvider();e.on("accountsChanged",this.onAccountsChanged),e.on("chainChanged",this.onChainChanged),e.on("disconnect",this.onDisconnect),this.emit("message",{type:"connecting"});const r=await e.enable(),n=jn(r[0]);let i=await this.getChainId(),s=this.isChainUnsupported(i);return t&&i!==t&&(i=(await this.switchChain(t)).id,s=this.isChainUnsupported(i)),{account:n,chain:{id:i,unsupported:s}}}catch(e){throw/(user closed modal|accounts received is empty)/i.test(e.message)?new Or(e):e}}async disconnect(){if(!He(this,Xu))return;const t=await this.getProvider();t.removeListener("accountsChanged",this.onAccountsChanged),t.removeListener("chainChanged",this.onChainChanged),t.removeListener("disconnect",this.onDisconnect),t.disconnect(),t.close()}async getAccount(){const e=await(await this.getProvider()).request({method:"eth_accounts"});return jn(e[0])}async getChainId(){const t=await this.getProvider();return Ul(t.chainId)}async getProvider(){var t;if(!He(this,Xu)){let e=(await cS(()=>import("./index-d66c3ebc.js").then(o=>o.i),["./index-d66c3ebc.js","./events-fe40c1a3.js","./index-cc134824.js"],import.meta.url)).default;typeof e!="function"&&typeof e.default=="function"&&(e=e.default),Es(this,zh,new e(this.options));const r=(t=He(this,zh).walletExtension)==null?void 0:t.getChainId(),n=this.chains.find(o=>this.options.chainId?o.id===this.options.chainId:o.id===r)||this.chains[0],i=this.options.chainId||(n==null?void 0:n.id),s=this.options.jsonRpcUrl||(n==null?void 0:n.rpcUrls.default.http[0]);Es(this,Xu,He(this,zh).makeWeb3Provider(s,i))}return He(this,Xu)}async getWalletClient({chainId:t}={}){const[e,r]=await Promise.all([this.getProvider(),this.getAccount()]),n=this.chains.find(i=>i.id===t);if(!e)throw new Error("provider is required.");return Cp({account:r,chain:n,transport:c2(e)})}async isAuthorized(){try{return!!await this.getAccount()}catch{return!1}}async switchChain(t){var n;const e=await this.getProvider(),r=ze(t);try{return await e.request({method:"wallet_switchEthereumChain",params:[{chainId:r}]}),this.chains.find(i=>i.id===t)??{id:t,name:`Chain ${r}`,network:`${r}`,nativeCurrency:{name:"Ether",decimals:18,symbol:"ETH"},rpcUrls:{default:{http:[""]},public:{http:[""]}}}}catch(i){const s=this.chains.find(o=>o.id===t);if(!s)throw new GU({chainId:t,connectorId:this.id});if(i.code===4902)try{return await e.request({method:"wallet_addEthereumChain",params:[{chainId:r,chainName:s.name,nativeCurrency:s.nativeCurrency,rpcUrls:[((n=s.rpcUrls.public)==null?void 0:n.http[0])??""],blockExplorerUrls:this.getBlockExplorerUrls(s)}]}),s}catch(o){throw new Or(o)}throw new aa(i)}}async watchAsset({address:t,decimals:e=18,image:r,symbol:n}){return(await this.getProvider()).request({method:"wallet_watchAsset",params:{type:"ERC20",options:{address:t,decimals:e,image:r,symbol:n}}})}};zh=new WeakMap;Xu=new WeakMap;var gm,a2e=class extends $z{constructor({chains:t,options:e}={}){const r={name:"MetaMask",shimDisconnect:!0,getProvider(){function n(s){if(s!=null&&s.isMetaMask&&!(s.isBraveWallet&&!s._events&&!s._state)&&!s.isApexWallet&&!s.isAvalanche&&!s.isBitKeep&&!s.isBlockWallet&&!s.isMathWallet&&!(s.isOkxWallet||s.isOKExWallet)&&!(s.isOneInchIOSWallet||s.isOneInchAndroidWallet)&&!s.isOpera&&!s.isPortal&&!s.isRabby&&!s.isDefiant&&!s.isTokenPocket&&!s.isTokenary&&!s.isZerion)return s}if(typeof window>"u")return;const i=window.ethereum;return i!=null&&i.providers?i.providers.find(n):n(i)},...e};super({chains:t,options:r}),Ke(this,"id","metaMask"),Ke(this,"shimDisconnectKey",`${this.id}.shimDisconnect`),Br(this,gm,void 0),Es(this,gm,r.UNSTABLE_shimOnConnectSelectAccount)}async connect({chainId:t}={}){var e,r,n,i;try{const s=await this.getProvider();if(!s)throw new qa;s.on&&(s.on("accountsChanged",this.onAccountsChanged),s.on("chainChanged",this.onChainChanged),s.on("disconnect",this.onDisconnect)),this.emit("message",{type:"connecting"});let o=null;if(He(this,gm)&&((e=this.options)!=null&&e.shimDisconnect)&&!((r=this.storage)!=null&&r.getItem(this.shimDisconnectKey))&&(o=await this.getAccount().catch(()=>null),!!o))try{await s.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}),o=await this.getAccount()}catch(u){if(this.isUserRejectedRequestError(u))throw new Or(u);if(u.code===new Oc(u).code)throw u}if(!o){const l=await s.request({method:"eth_requestAccounts"});o=jn(l[0])}let a=await this.getChainId(),c=this.isChainUnsupported(a);return t&&a!==t&&(a=(await this.switchChain(t)).id,c=this.isChainUnsupported(a)),(n=this.options)!=null&&n.shimDisconnect&&((i=this.storage)==null||i.setItem(this.shimDisconnectKey,!0)),{account:o,chain:{id:a,unsupported:c},provider:s}}catch(s){throw this.isUserRejectedRequestError(s)?new Or(s):s.code===-32002?new Oc(s):s}}};gm=new WeakMap;var yl,Hs,c2e=class{constructor(t){Ke(this,"events",new MU),Ke(this,"chainId"),Br(this,yl,void 0),Br(this,Hs,void 0),this.chainId=t.chainId,Es(this,yl,t)}async enable(){var e;if((e=He(this,yl).flags)!=null&&e.failConnect)throw new Or(new Error("Failed to connect."));He(this,Hs)||Es(this,Hs,He(this,yl).walletClient);const t=He(this,Hs).account.address;return this.events.emit("accountsChanged",[t]),[t]}async disconnect(){this.events.emit("disconnect"),Es(this,Hs,void 0)}async getAccounts(){var e;const t=(e=He(this,Hs))==null?void 0:e.account.address;return t?[jn(t)]:[]}getWalletClient(){const t=He(this,Hs);if(!t)throw new Error("walletClient not found");return t}async switchChain(t){var e;if((e=He(this,yl).flags)!=null&&e.failSwitchChain)throw new Or(new Error("Failed to switch chain."));He(this,yl).chainId=t,this.chainId=t,this.events.emit("chainChanged",t)}async switchWalletClient(t){const e=t.account.address;Es(this,Hs,t),this.events.emit("accountsChanged",[e])}async watchAsset(t){return!0}async request({method:t,params:e}){var r;return(r=He(this,Hs))==null?void 0:r.transport.request({method:t,params:e})}on(t,e){return this.events.on(t,e),this}removeListener(t,e){return this.events.removeListener(t,e),this}toJSON(){return""}};yl=new WeakMap;Hs=new WeakMap;var Wh,H3,Kz,l2e=class extends vp{constructor({chains:t,options:e}){var r;super({chains:t,options:{...e,chainId:e.chainId??((r=t==null?void 0:t[0])==null?void 0:r.id)}}),Br(this,H3),Ke(this,"id","mock"),Ke(this,"name","Mock"),Ke(this,"ready",!0),Br(this,Wh,void 0),Ke(this,"onAccountsChanged",n=>{n.length===0?this.emit("disconnect"):this.emit("change",{account:jn(n[0])})}),Ke(this,"onChainChanged",n=>{const i=Ul(n),s=this.isChainUnsupported(i);this.emit("change",{chain:{id:i,unsupported:s}})}),Ke(this,"onDisconnect",()=>{this.emit("disconnect")})}async connect({chainId:t}={}){var a;const e=await this.getProvider({chainId:t});e.on("accountsChanged",this.onAccountsChanged),e.on("chainChanged",this.onChainChanged),e.on("disconnect",this.onDisconnect),this.emit("message",{type:"connecting"});const r=await e.enable(),n=jn(r[0]),i=Ul(e.chainId),s=this.isChainUnsupported(i),o={account:n,chain:{id:i,unsupported:s},provider:e};return(a=this.options.flags)!=null&&a.noSwitchChain||(this.switchChain=Lr(this,H3,Kz)),new Promise(c=>setTimeout(()=>c(o),100))}async disconnect(){const t=await this.getProvider();await t.disconnect(),t.removeListener("accountsChanged",this.onAccountsChanged),t.removeListener("chainChanged",this.onChainChanged),t.removeListener("disconnect",this.onDisconnect)}async getAccount(){const r=(await(await this.getProvider()).getAccounts())[0];if(!r)throw new Error("Failed to get account");return jn(r)}async getChainId(){const t=await this.getProvider();return Ul(t.chainId)}async getProvider({chainId:t}={}){return(!He(this,Wh)||t)&&Es(this,Wh,new c2e({...this.options,chainId:t??this.options.chainId??this.chains[0].id})),He(this,Wh)}async getWalletClient(){return(await this.getProvider()).getWalletClient()}async isAuthorized(){var t;try{const r=await(await this.getProvider()).getAccounts();return((t=this.options.flags)==null?void 0:t.isAuthorized)??!!r}catch{return!1}}async watchAsset(t){return(await this.getProvider()).watchAsset(t)}toJSON(){return""}};Wh=new WeakMap;H3=new WeakSet;Kz=async function(t){return await(await this.getProvider()).switchChain(t),this.chains.find(r=>r.id===t)??{id:t,name:`Chain ${t}`,network:`${t}`,nativeCurrency:{name:"Ether",decimals:18,symbol:"ETH"},rpcUrls:{default:{http:[""]},public:{http:[""]}}}};var ES={},p2={},We={},Qz={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(a,c){var l=a>>>16&65535,u=a&65535,f=c>>>16&65535,d=c&65535;return u*d+(l*d+u*f<<16>>>0)|0}t.mul=Math.imul||e;function r(a,c){return a+c|0}t.add=r;function n(a,c){return a-c|0}t.sub=n;function i(a,c){return a<>>32-c}t.rotl=i;function s(a,c){return a<<32-c|a>>>c}t.rotr=s;function o(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a}t.isInteger=Number.isInteger||o,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(a){return t.isInteger(a)&&a>=-t.MAX_SAFE_INTEGER&&a<=t.MAX_SAFE_INTEGER}})(Qz);Object.defineProperty(We,"__esModule",{value:!0});var Yz=Qz;function u2e(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}We.readInt16BE=u2e;function f2e(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}We.readUint16BE=f2e;function d2e(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}We.readInt16LE=d2e;function h2e(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}We.readUint16LE=h2e;function Jz(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}We.writeUint16BE=Jz;We.writeInt16BE=Jz;function Xz(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}We.writeUint16LE=Xz;We.writeInt16LE=Xz;function q3(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}We.readInt32BE=q3;function V3(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}We.readUint32BE=V3;function G3(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}We.readInt32LE=G3;function K3(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}We.readUint32LE=K3;function ng(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}We.writeUint32BE=ng;We.writeInt32BE=ng;function ig(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}We.writeUint32LE=ig;We.writeInt32LE=ig;function p2e(t,e){e===void 0&&(e=0);var r=q3(t,e),n=q3(t,e+4);return r*4294967296+n-(n>>31)*4294967296}We.readInt64BE=p2e;function v2e(t,e){e===void 0&&(e=0);var r=V3(t,e),n=V3(t,e+4);return r*4294967296+n}We.readUint64BE=v2e;function m2e(t,e){e===void 0&&(e=0);var r=G3(t,e),n=G3(t,e+4);return n*4294967296+r-(r>>31)*4294967296}We.readInt64LE=m2e;function y2e(t,e){e===void 0&&(e=0);var r=K3(t,e),n=K3(t,e+4);return n*4294967296+r}We.readUint64LE=y2e;function Zz(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),ng(t/4294967296>>>0,e,r),ng(t>>>0,e,r+4),e}We.writeUint64BE=Zz;We.writeInt64BE=Zz;function eW(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),ig(t>>>0,e,r),ig(t/4294967296>>>0,e,r+4),e}We.writeUint64LE=eW;We.writeInt64LE=eW;function g2e(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,s=t/8+r-1;s>=r;s--)n+=e[s]*i,i*=256;return n}We.readUintBE=g2e;function b2e(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,s=r;s=n;s--)r[s]=e/i&255,i*=256;return r}We.writeUintBE=w2e;function x2e(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!Yz.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,s=n;s>>32-16|P<<16,H=H+P|0,w^=H,w=w>>>32-12|w<<12,C=C+I|0,$^=C,$=$>>>32-16|$<<16,K=K+$|0,I^=K,I=I>>>32-12|I<<12,A=A+B|0,D^=A,D=D>>>32-16|D<<16,F=F+D|0,B^=F,B=B>>>32-12|B<<12,O=O+z|0,_^=O,_=_>>>32-16|_<<16,x=x+_|0,z^=x,z=z>>>32-12|z<<12,A=A+B|0,D^=A,D=D>>>32-8|D<<8,F=F+D|0,B^=F,B=B>>>32-7|B<<7,O=O+z|0,_^=O,_=_>>>32-8|_<<8,x=x+_|0,z^=x,z=z>>>32-7|z<<7,C=C+I|0,$^=C,$=$>>>32-8|$<<8,K=K+$|0,I^=K,I=I>>>32-7|I<<7,b=b+w|0,P^=b,P=P>>>32-8|P<<8,H=H+P|0,w^=H,w=w>>>32-7|w<<7,b=b+I|0,_^=b,_=_>>>32-16|_<<16,F=F+_|0,I^=F,I=I>>>32-12|I<<12,C=C+B|0,P^=C,P=P>>>32-16|P<<16,x=x+P|0,B^=x,B=B>>>32-12|B<<12,A=A+z|0,$^=A,$=$>>>32-16|$<<16,H=H+$|0,z^=H,z=z>>>32-12|z<<12,O=O+w|0,D^=O,D=D>>>32-16|D<<16,K=K+D|0,w^=K,w=w>>>32-12|w<<12,A=A+z|0,$^=A,$=$>>>32-8|$<<8,H=H+$|0,z^=H,z=z>>>32-7|z<<7,O=O+w|0,D^=O,D=D>>>32-8|D<<8,K=K+D|0,w^=K,w=w>>>32-7|w<<7,C=C+B|0,P^=C,P=P>>>32-8|P<<8,x=x+P|0,B^=x,B=B>>>32-7|B<<7,b=b+I|0,_^=b,_=_>>>32-8|_<<8,F=F+_|0,I^=F,I=I>>>32-7|I<<7;yn.writeUint32LE(b+n|0,t,0),yn.writeUint32LE(C+i|0,t,4),yn.writeUint32LE(A+s|0,t,8),yn.writeUint32LE(O+o|0,t,12),yn.writeUint32LE(w+a|0,t,16),yn.writeUint32LE(I+c|0,t,20),yn.writeUint32LE(B+l|0,t,24),yn.writeUint32LE(z+u|0,t,28),yn.writeUint32LE(H+f|0,t,32),yn.writeUint32LE(K+d|0,t,36),yn.writeUint32LE(F+h|0,t,40),yn.writeUint32LE(x+p|0,t,44),yn.writeUint32LE(P+v|0,t,48),yn.writeUint32LE($+m|0,t,52),yn.writeUint32LE(D+g|0,t,56),yn.writeUint32LE(_+y|0,t,60)}function tW(t,e,r,n,i){if(i===void 0&&(i=0),t.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}var rW={},Qc={};Object.defineProperty(Qc,"__esModule",{value:!0});function N2e(t,e,r){return~(t-1)&e|t-1&r}Qc.select=N2e;function D2e(t,e){return(t|0)-(e|0)-1>>>31&1}Qc.lessOrEqual=D2e;function nW(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n>>8}Qc.compare=nW;function L2e(t,e){return t.length===0||e.length===0?!1:nW(t,e)!==0}Qc.equal=L2e;(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Qc,r=Ms;t.DIGEST_LENGTH=16;var n=function(){function o(a){this.digestLength=t.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var c=a[0]|a[1]<<8;this._r[0]=c&8191;var l=a[2]|a[3]<<8;this._r[1]=(c>>>13|l<<3)&8191;var u=a[4]|a[5]<<8;this._r[2]=(l>>>10|u<<6)&7939;var f=a[6]|a[7]<<8;this._r[3]=(u>>>7|f<<9)&8191;var d=a[8]|a[9]<<8;this._r[4]=(f>>>4|d<<12)&255,this._r[5]=d>>>1&8190;var h=a[10]|a[11]<<8;this._r[6]=(d>>>14|h<<2)&8191;var p=a[12]|a[13]<<8;this._r[7]=(h>>>11|p<<5)&8065;var v=a[14]|a[15]<<8;this._r[8]=(p>>>8|v<<8)&8191,this._r[9]=v>>>5&127,this._pad[0]=a[16]|a[17]<<8,this._pad[1]=a[18]|a[19]<<8,this._pad[2]=a[20]|a[21]<<8,this._pad[3]=a[22]|a[23]<<8,this._pad[4]=a[24]|a[25]<<8,this._pad[5]=a[26]|a[27]<<8,this._pad[6]=a[28]|a[29]<<8,this._pad[7]=a[30]|a[31]<<8}return o.prototype._blocks=function(a,c,l){for(var u=this._fin?0:2048,f=this._h[0],d=this._h[1],h=this._h[2],p=this._h[3],v=this._h[4],m=this._h[5],g=this._h[6],y=this._h[7],b=this._h[8],C=this._h[9],A=this._r[0],O=this._r[1],w=this._r[2],I=this._r[3],B=this._r[4],z=this._r[5],H=this._r[6],K=this._r[7],F=this._r[8],x=this._r[9];l>=16;){var P=a[c+0]|a[c+1]<<8;f+=P&8191;var $=a[c+2]|a[c+3]<<8;d+=(P>>>13|$<<3)&8191;var D=a[c+4]|a[c+5]<<8;h+=($>>>10|D<<6)&8191;var _=a[c+6]|a[c+7]<<8;p+=(D>>>7|_<<9)&8191;var N=a[c+8]|a[c+9]<<8;v+=(_>>>4|N<<12)&8191,m+=N>>>1&8191;var L=a[c+10]|a[c+11]<<8;g+=(N>>>14|L<<2)&8191;var R=a[c+12]|a[c+13]<<8;y+=(L>>>11|R<<5)&8191;var E=a[c+14]|a[c+15]<<8;b+=(R>>>8|E<<8)&8191,C+=E>>>5|u;var M=0,j=M;j+=f*A,j+=d*(5*x),j+=h*(5*F),j+=p*(5*K),j+=v*(5*H),M=j>>>13,j&=8191,j+=m*(5*z),j+=g*(5*B),j+=y*(5*I),j+=b*(5*w),j+=C*(5*O),M+=j>>>13,j&=8191;var T=M;T+=f*O,T+=d*A,T+=h*(5*x),T+=p*(5*F),T+=v*(5*K),M=T>>>13,T&=8191,T+=m*(5*H),T+=g*(5*z),T+=y*(5*B),T+=b*(5*I),T+=C*(5*w),M+=T>>>13,T&=8191;var U=M;U+=f*w,U+=d*O,U+=h*A,U+=p*(5*x),U+=v*(5*F),M=U>>>13,U&=8191,U+=m*(5*K),U+=g*(5*H),U+=y*(5*z),U+=b*(5*B),U+=C*(5*I),M+=U>>>13,U&=8191;var W=M;W+=f*I,W+=d*w,W+=h*O,W+=p*A,W+=v*(5*x),M=W>>>13,W&=8191,W+=m*(5*F),W+=g*(5*K),W+=y*(5*H),W+=b*(5*z),W+=C*(5*B),M+=W>>>13,W&=8191;var V=M;V+=f*B,V+=d*I,V+=h*w,V+=p*O,V+=v*A,M=V>>>13,V&=8191,V+=m*(5*x),V+=g*(5*F),V+=y*(5*K),V+=b*(5*H),V+=C*(5*z),M+=V>>>13,V&=8191;var G=M;G+=f*z,G+=d*B,G+=h*I,G+=p*w,G+=v*O,M=G>>>13,G&=8191,G+=m*A,G+=g*(5*x),G+=y*(5*F),G+=b*(5*K),G+=C*(5*H),M+=G>>>13,G&=8191;var J=M;J+=f*H,J+=d*z,J+=h*B,J+=p*I,J+=v*w,M=J>>>13,J&=8191,J+=m*O,J+=g*A,J+=y*(5*x),J+=b*(5*F),J+=C*(5*K),M+=J>>>13,J&=8191;var Y=M;Y+=f*K,Y+=d*H,Y+=h*z,Y+=p*B,Y+=v*I,M=Y>>>13,Y&=8191,Y+=m*w,Y+=g*O,Y+=y*A,Y+=b*(5*x),Y+=C*(5*F),M+=Y>>>13,Y&=8191;var X=M;X+=f*F,X+=d*K,X+=h*H,X+=p*z,X+=v*B,M=X>>>13,X&=8191,X+=m*I,X+=g*w,X+=y*O,X+=b*A,X+=C*(5*x),M+=X>>>13,X&=8191;var ae=M;ae+=f*x,ae+=d*F,ae+=h*K,ae+=p*H,ae+=v*z,M=ae>>>13,ae&=8191,ae+=m*B,ae+=g*I,ae+=y*w,ae+=b*O,ae+=C*A,M+=ae>>>13,ae&=8191,M=(M<<2)+M|0,M=M+j|0,j=M&8191,M=M>>>13,T+=M,f=j,d=T,h=U,p=W,v=V,m=G,g=J,y=Y,b=X,C=ae,c+=16,l-=16}this._h[0]=f,this._h[1]=d,this._h[2]=h,this._h[3]=p,this._h[4]=v,this._h[5]=m,this._h[6]=g,this._h[7]=y,this._h[8]=b,this._h[9]=C},o.prototype.finish=function(a,c){c===void 0&&(c=0);var l=new Uint16Array(10),u,f,d,h;if(this._leftover){for(h=this._leftover,this._buffer[h++]=1;h<16;h++)this._buffer[h]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(u=this._h[1]>>>13,this._h[1]&=8191,h=2;h<10;h++)this._h[h]+=u,u=this._h[h]>>>13,this._h[h]&=8191;for(this._h[0]+=u*5,u=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=u,u=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=u,l[0]=this._h[0]+5,u=l[0]>>>13,l[0]&=8191,h=1;h<10;h++)l[h]=this._h[h]+u,u=l[h]>>>13,l[h]&=8191;for(l[9]-=8192,f=(u^1)-1,h=0;h<10;h++)l[h]&=f;for(f=~f,h=0;h<10;h++)this._h[h]=this._h[h]&f|l[h];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,d=this._h[0]+this._pad[0],this._h[0]=d&65535,h=1;h<8;h++)d=(this._h[h]+this._pad[h]|0)+(d>>>16)|0,this._h[h]=d&65535;return a[c+0]=this._h[0]>>>0,a[c+1]=this._h[0]>>>8,a[c+2]=this._h[1]>>>0,a[c+3]=this._h[1]>>>8,a[c+4]=this._h[2]>>>0,a[c+5]=this._h[2]>>>8,a[c+6]=this._h[3]>>>0,a[c+7]=this._h[3]>>>8,a[c+8]=this._h[4]>>>0,a[c+9]=this._h[4]>>>8,a[c+10]=this._h[5]>>>0,a[c+11]=this._h[5]>>>8,a[c+12]=this._h[6]>>>0,a[c+13]=this._h[6]>>>8,a[c+14]=this._h[7]>>>0,a[c+15]=this._h[7]>>>8,this._finished=!0,this},o.prototype.update=function(a){var c=0,l=a.length,u;if(this._leftover){u=16-this._leftover,u>l&&(u=l);for(var f=0;f=16&&(u=l-l%16,this._blocks(a,c,u),c+=u,l-=u),l){for(var f=0;f16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var h=new Uint8Array(16);h.set(l,h.length-l.length);var p=new Uint8Array(32);e.stream(this._key,h,p,4);var v=u.length+this.tagLength,m;if(d){if(d.length!==v)throw new Error("ChaCha20Poly1305: incorrect destination length");m=d}else m=new Uint8Array(v);return e.streamXOR(this._key,h,u,m,4),this._authenticate(m.subarray(m.length-this.tagLength,m.length),p,m.subarray(0,m.length-this.tagLength),f),n.wipe(h),m},c.prototype.open=function(l,u,f,d){if(l.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(u.length0&&h.update(o.subarray(d.length%16))),h.update(f),f.length%16>0&&h.update(o.subarray(f.length%16));var p=new Uint8Array(8);d&&i.writeUint64LE(d.length,p),h.update(p),i.writeUint64LE(f.length,p),h.update(p);for(var v=h.digest(),m=0;mthis.blockSize?this._inner.update(r).finish(n).clean():n.set(r);for(var i=0;i1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},t.prototype.expand=function(e){for(var r=new Uint8Array(e),n=0;n256)throw new Error("randomString charset is too long");let d="";const h=u.length,p=256-256%h;for(;l>0;){const v=i(Math.ceil(l*256/p),f);for(let m=0;m0;m++){const g=v[m];g0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=c[u++],l--;this._bufferLength===this.blockSize&&(s(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(l>=this.blockSize&&(u=s(this._temp,this._state,c,u,l),l%=this.blockSize);l>0;)this._buffer[this._bufferLength++]=c[u++],l--;return this},a.prototype.finish=function(c){if(!this._finished){var l=this._bytesHashed,u=this._bufferLength,f=l/536870912|0,d=l<<3,h=l%64<56?64:128;this._buffer[u]=128;for(var p=u+1;p0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},a.prototype.restoreState=function(c){return this._state.set(c.state),this._bufferLength=c.bufferLength,c.buffer&&this._buffer.set(c.buffer),this._bytesHashed=c.bytesHashed,this._finished=!1,this},a.prototype.cleanSavedState=function(c){r.wipe(c.state),c.buffer&&r.wipe(c.buffer),c.bufferLength=0,c.bytesHashed=0},a}();t.SHA256=n;var i=new Int32Array([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]);function s(a,c,l,u,f){for(;f>=64;){for(var d=c[0],h=c[1],p=c[2],v=c[3],m=c[4],g=c[5],y=c[6],b=c[7],C=0;C<16;C++){var A=u+C*4;a[C]=e.readUint32BE(l,A)}for(var C=16;C<64;C++){var O=a[C-2],w=(O>>>17|O<<32-17)^(O>>>19|O<<32-19)^O>>>10;O=a[C-15];var I=(O>>>7|O<<32-7)^(O>>>18|O<<32-18)^O>>>3;a[C]=(w+a[C-7]|0)+(I+a[C-16]|0)}for(var C=0;C<64;C++){var w=(((m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7))+(m&g^~m&y)|0)+(b+(i[C]+a[C]|0)|0)|0,I=((d>>>2|d<<32-2)^(d>>>13|d<<32-13)^(d>>>22|d<<32-22))+(d&h^d&p^h&p)|0;b=y,y=g,g=m,m=v+w|0,v=p,p=h,h=d,d=w+I|0}c[0]+=d,c[1]+=h,c[2]+=p,c[3]+=v,c[4]+=m,c[5]+=g,c[6]+=y,c[7]+=b,u+=64,f-=64}return u}function o(a){var c=new n;c.update(a);var l=c.digest();return c.clean(),l}t.hash=o})(b2);var SS={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.sharedKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.scalarMultBase=t.scalarMult=t.SHARED_KEY_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=void 0;const e=v2,r=Ms;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n(C){const A=new Float64Array(16);if(C)for(let O=0;O>16&1),O[z-1]&=65535;O[15]=w[15]-32767-(O[14]>>16&1);const B=O[15]>>16&1;O[14]&=65535,a(w,O,1-B)}for(let I=0;I<16;I++)C[2*I]=w[I]&255,C[2*I+1]=w[I]>>8}function l(C,A){for(let O=0;O<16;O++)C[O]=A[2*O]+(A[2*O+1]<<8);C[15]&=32767}function u(C,A,O){for(let w=0;w<16;w++)C[w]=A[w]+O[w]}function f(C,A,O){for(let w=0;w<16;w++)C[w]=A[w]-O[w]}function d(C,A,O){let w,I,B=0,z=0,H=0,K=0,F=0,x=0,P=0,$=0,D=0,_=0,N=0,L=0,R=0,E=0,M=0,j=0,T=0,U=0,W=0,V=0,G=0,J=0,Y=0,X=0,ae=0,oe=0,ue=0,tt=0,Oe=0,Pe=0,ct=0,Ce=O[0],be=O[1],Qt=O[2],Re=O[3],$e=O[4],Yt=O[5],Me=O[6],Ne=O[7],Jt=O[8],De=O[9],Le=O[10],Xt=O[11],Be=O[12],Fe=O[13],Zt=O[14],je=O[15];w=A[0],B+=w*Ce,z+=w*be,H+=w*Qt,K+=w*Re,F+=w*$e,x+=w*Yt,P+=w*Me,$+=w*Ne,D+=w*Jt,_+=w*De,N+=w*Le,L+=w*Xt,R+=w*Be,E+=w*Fe,M+=w*Zt,j+=w*je,w=A[1],z+=w*Ce,H+=w*be,K+=w*Qt,F+=w*Re,x+=w*$e,P+=w*Yt,$+=w*Me,D+=w*Ne,_+=w*Jt,N+=w*De,L+=w*Le,R+=w*Xt,E+=w*Be,M+=w*Fe,j+=w*Zt,T+=w*je,w=A[2],H+=w*Ce,K+=w*be,F+=w*Qt,x+=w*Re,P+=w*$e,$+=w*Yt,D+=w*Me,_+=w*Ne,N+=w*Jt,L+=w*De,R+=w*Le,E+=w*Xt,M+=w*Be,j+=w*Fe,T+=w*Zt,U+=w*je,w=A[3],K+=w*Ce,F+=w*be,x+=w*Qt,P+=w*Re,$+=w*$e,D+=w*Yt,_+=w*Me,N+=w*Ne,L+=w*Jt,R+=w*De,E+=w*Le,M+=w*Xt,j+=w*Be,T+=w*Fe,U+=w*Zt,W+=w*je,w=A[4],F+=w*Ce,x+=w*be,P+=w*Qt,$+=w*Re,D+=w*$e,_+=w*Yt,N+=w*Me,L+=w*Ne,R+=w*Jt,E+=w*De,M+=w*Le,j+=w*Xt,T+=w*Be,U+=w*Fe,W+=w*Zt,V+=w*je,w=A[5],x+=w*Ce,P+=w*be,$+=w*Qt,D+=w*Re,_+=w*$e,N+=w*Yt,L+=w*Me,R+=w*Ne,E+=w*Jt,M+=w*De,j+=w*Le,T+=w*Xt,U+=w*Be,W+=w*Fe,V+=w*Zt,G+=w*je,w=A[6],P+=w*Ce,$+=w*be,D+=w*Qt,_+=w*Re,N+=w*$e,L+=w*Yt,R+=w*Me,E+=w*Ne,M+=w*Jt,j+=w*De,T+=w*Le,U+=w*Xt,W+=w*Be,V+=w*Fe,G+=w*Zt,J+=w*je,w=A[7],$+=w*Ce,D+=w*be,_+=w*Qt,N+=w*Re,L+=w*$e,R+=w*Yt,E+=w*Me,M+=w*Ne,j+=w*Jt,T+=w*De,U+=w*Le,W+=w*Xt,V+=w*Be,G+=w*Fe,J+=w*Zt,Y+=w*je,w=A[8],D+=w*Ce,_+=w*be,N+=w*Qt,L+=w*Re,R+=w*$e,E+=w*Yt,M+=w*Me,j+=w*Ne,T+=w*Jt,U+=w*De,W+=w*Le,V+=w*Xt,G+=w*Be,J+=w*Fe,Y+=w*Zt,X+=w*je,w=A[9],_+=w*Ce,N+=w*be,L+=w*Qt,R+=w*Re,E+=w*$e,M+=w*Yt,j+=w*Me,T+=w*Ne,U+=w*Jt,W+=w*De,V+=w*Le,G+=w*Xt,J+=w*Be,Y+=w*Fe,X+=w*Zt,ae+=w*je,w=A[10],N+=w*Ce,L+=w*be,R+=w*Qt,E+=w*Re,M+=w*$e,j+=w*Yt,T+=w*Me,U+=w*Ne,W+=w*Jt,V+=w*De,G+=w*Le,J+=w*Xt,Y+=w*Be,X+=w*Fe,ae+=w*Zt,oe+=w*je,w=A[11],L+=w*Ce,R+=w*be,E+=w*Qt,M+=w*Re,j+=w*$e,T+=w*Yt,U+=w*Me,W+=w*Ne,V+=w*Jt,G+=w*De,J+=w*Le,Y+=w*Xt,X+=w*Be,ae+=w*Fe,oe+=w*Zt,ue+=w*je,w=A[12],R+=w*Ce,E+=w*be,M+=w*Qt,j+=w*Re,T+=w*$e,U+=w*Yt,W+=w*Me,V+=w*Ne,G+=w*Jt,J+=w*De,Y+=w*Le,X+=w*Xt,ae+=w*Be,oe+=w*Fe,ue+=w*Zt,tt+=w*je,w=A[13],E+=w*Ce,M+=w*be,j+=w*Qt,T+=w*Re,U+=w*$e,W+=w*Yt,V+=w*Me,G+=w*Ne,J+=w*Jt,Y+=w*De,X+=w*Le,ae+=w*Xt,oe+=w*Be,ue+=w*Fe,tt+=w*Zt,Oe+=w*je,w=A[14],M+=w*Ce,j+=w*be,T+=w*Qt,U+=w*Re,W+=w*$e,V+=w*Yt,G+=w*Me,J+=w*Ne,Y+=w*Jt,X+=w*De,ae+=w*Le,oe+=w*Xt,ue+=w*Be,tt+=w*Fe,Oe+=w*Zt,Pe+=w*je,w=A[15],j+=w*Ce,T+=w*be,U+=w*Qt,W+=w*Re,V+=w*$e,G+=w*Yt,J+=w*Me,Y+=w*Ne,X+=w*Jt,ae+=w*De,oe+=w*Le,ue+=w*Xt,tt+=w*Be,Oe+=w*Fe,Pe+=w*Zt,ct+=w*je,B+=38*T,z+=38*U,H+=38*W,K+=38*V,F+=38*G,x+=38*J,P+=38*Y,$+=38*X,D+=38*ae,_+=38*oe,N+=38*ue,L+=38*tt,R+=38*Oe,E+=38*Pe,M+=38*ct,I=1,w=B+I+65535,I=Math.floor(w/65536),B=w-I*65536,w=z+I+65535,I=Math.floor(w/65536),z=w-I*65536,w=H+I+65535,I=Math.floor(w/65536),H=w-I*65536,w=K+I+65535,I=Math.floor(w/65536),K=w-I*65536,w=F+I+65535,I=Math.floor(w/65536),F=w-I*65536,w=x+I+65535,I=Math.floor(w/65536),x=w-I*65536,w=P+I+65535,I=Math.floor(w/65536),P=w-I*65536,w=$+I+65535,I=Math.floor(w/65536),$=w-I*65536,w=D+I+65535,I=Math.floor(w/65536),D=w-I*65536,w=_+I+65535,I=Math.floor(w/65536),_=w-I*65536,w=N+I+65535,I=Math.floor(w/65536),N=w-I*65536,w=L+I+65535,I=Math.floor(w/65536),L=w-I*65536,w=R+I+65535,I=Math.floor(w/65536),R=w-I*65536,w=E+I+65535,I=Math.floor(w/65536),E=w-I*65536,w=M+I+65535,I=Math.floor(w/65536),M=w-I*65536,w=j+I+65535,I=Math.floor(w/65536),j=w-I*65536,B+=I-1+37*(I-1),I=1,w=B+I+65535,I=Math.floor(w/65536),B=w-I*65536,w=z+I+65535,I=Math.floor(w/65536),z=w-I*65536,w=H+I+65535,I=Math.floor(w/65536),H=w-I*65536,w=K+I+65535,I=Math.floor(w/65536),K=w-I*65536,w=F+I+65535,I=Math.floor(w/65536),F=w-I*65536,w=x+I+65535,I=Math.floor(w/65536),x=w-I*65536,w=P+I+65535,I=Math.floor(w/65536),P=w-I*65536,w=$+I+65535,I=Math.floor(w/65536),$=w-I*65536,w=D+I+65535,I=Math.floor(w/65536),D=w-I*65536,w=_+I+65535,I=Math.floor(w/65536),_=w-I*65536,w=N+I+65535,I=Math.floor(w/65536),N=w-I*65536,w=L+I+65535,I=Math.floor(w/65536),L=w-I*65536,w=R+I+65535,I=Math.floor(w/65536),R=w-I*65536,w=E+I+65535,I=Math.floor(w/65536),E=w-I*65536,w=M+I+65535,I=Math.floor(w/65536),M=w-I*65536,w=j+I+65535,I=Math.floor(w/65536),j=w-I*65536,B+=I-1+37*(I-1),C[0]=B,C[1]=z,C[2]=H,C[3]=K,C[4]=F,C[5]=x,C[6]=P,C[7]=$,C[8]=D,C[9]=_,C[10]=N,C[11]=L,C[12]=R,C[13]=E,C[14]=M,C[15]=j}function h(C,A){d(C,A,A)}function p(C,A){const O=n();for(let w=0;w<16;w++)O[w]=A[w];for(let w=253;w>=0;w--)h(O,O),w!==2&&w!==4&&d(O,O,A);for(let w=0;w<16;w++)C[w]=O[w]}function v(C,A){const O=new Uint8Array(32),w=new Float64Array(80),I=n(),B=n(),z=n(),H=n(),K=n(),F=n();for(let D=0;D<31;D++)O[D]=C[D];O[31]=C[31]&127|64,O[0]&=248,l(w,A);for(let D=0;D<16;D++)B[D]=w[D];I[0]=H[0]=1;for(let D=254;D>=0;--D){const _=O[D>>>3]>>>(D&7)&1;a(I,B,_),a(z,H,_),u(K,I,z),f(I,I,z),u(z,B,H),f(B,B,H),h(H,K),h(F,I),d(I,z,I),d(z,B,K),u(K,I,z),f(I,I,z),h(B,I),f(z,H,F),d(I,z,s),u(I,I,H),d(z,z,I),d(I,H,F),d(H,B,w),h(B,K),a(I,B,_),a(z,H,_)}for(let D=0;D<16;D++)w[D+16]=I[D],w[D+32]=z[D],w[D+48]=B[D],w[D+64]=H[D];const x=w.subarray(32),P=w.subarray(16);p(x,x),d(P,P,x);const $=new Uint8Array(32);return c($,P),$}t.scalarMult=v;function m(C){return v(C,i)}t.scalarMultBase=m;function g(C){if(C.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const A=new Uint8Array(C);return{publicKey:m(A),secretKey:A}}t.generateKeyPairFromSeed=g;function y(C){const A=(0,e.randomBytes)(32,C),O=g(A);return(0,r.wipe)(A),O}t.generateKeyPair=y;function b(C,A,O=!1){if(C.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(A.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const w=v(C,A);if(O){let I=0;for(let B=0;Bi+s.length,0));const r=oW(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return kS(r)}function J2e(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,C=new Uint8Array(b);g!==y;){for(var A=p[g],O=0,w=b-1;(A!==0||O>>0,C[w]=A%a>>>0,A=A/a>>>0;if(A!==0)throw new Error("Non-zero carry");m=O,g++}for(var I=b-m;I!==b&&C[I]===0;)I++;for(var B=c.repeat(v);I>>0,b=new Uint8Array(y);p[v];){var C=r[p.charCodeAt(v)];if(C===255)return;for(var A=0,O=y-1;(C!==0||A>>0,b[O]=C%256>>>0,C=C/256>>>0;if(C!==0)throw new Error("Non-zero carry");g=A,v++}if(p[v]!==" "){for(var w=y-g;w!==y&&b[w]===0;)w++;for(var I=new Uint8Array(m+(y-w)),B=m;w!==y;)I[B++]=b[w++];return I}}}function h(p){var v=d(p);if(v)return v;throw new Error(`Non-${e} character`)}return{encode:f,decodeUnsafe:d,decode:h}}var X2e=J2e,Z2e=X2e;const ewe=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},twe=t=>new TextEncoder().encode(t),rwe=t=>new TextDecoder().decode(t);class nwe{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class iwe{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}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 aW(this,e)}}class swe{constructor(e){this.decoders=e}or(e){return aW(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const aW=(t,e)=>new swe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class owe{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new nwe(e,r,n),this.decoder=new iwe(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const w2=({name:t,prefix:e,encode:r,decode:n})=>new owe(t,e,r,n),kp=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=Z2e(r,e);return w2({prefix:t,name:e,encode:n,decode:s=>ewe(i(s))})},awe=(t,e,r,n)=>{const i={};for(let u=0;u=8&&(a-=8,o[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return o},cwe=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<r;)o-=r,s+=e[i&a>>o];if(o&&(s+=e[i&a<w2({prefix:e,name:t,encode(i){return cwe(i,n,r)},decode(i){return awe(i,n,r,t)}}),lwe=w2({prefix:"\0",name:"identity",encode:t=>rwe(t),decode:t=>twe(t)}),uwe=Object.freeze(Object.defineProperty({__proto__:null,identity:lwe},Symbol.toStringTag,{value:"Module"})),fwe=hn({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),dwe=Object.freeze(Object.defineProperty({__proto__:null,base2:fwe},Symbol.toStringTag,{value:"Module"})),hwe=hn({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),pwe=Object.freeze(Object.defineProperty({__proto__:null,base8:hwe},Symbol.toStringTag,{value:"Module"})),vwe=kp({prefix:"9",name:"base10",alphabet:"0123456789"}),mwe=Object.freeze(Object.defineProperty({__proto__:null,base10:vwe},Symbol.toStringTag,{value:"Module"})),ywe=hn({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),gwe=hn({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),bwe=Object.freeze(Object.defineProperty({__proto__:null,base16:ywe,base16upper:gwe},Symbol.toStringTag,{value:"Module"})),wwe=hn({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),xwe=hn({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Ewe=hn({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Cwe=hn({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Swe=hn({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),kwe=hn({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Awe=hn({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),_we=hn({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Pwe=hn({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),Twe=Object.freeze(Object.defineProperty({__proto__:null,base32:wwe,base32hex:Swe,base32hexpad:Awe,base32hexpadupper:_we,base32hexupper:kwe,base32pad:Ewe,base32padupper:Cwe,base32upper:xwe,base32z:Pwe},Symbol.toStringTag,{value:"Module"})),Iwe=kp({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Owe=kp({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),Rwe=Object.freeze(Object.defineProperty({__proto__:null,base36:Iwe,base36upper:Owe},Symbol.toStringTag,{value:"Module"})),$we=kp({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Mwe=kp({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),Nwe=Object.freeze(Object.defineProperty({__proto__:null,base58btc:$we,base58flickr:Mwe},Symbol.toStringTag,{value:"Module"})),Dwe=hn({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Lwe=hn({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Bwe=hn({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Fwe=hn({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),jwe=Object.freeze(Object.defineProperty({__proto__:null,base64:Dwe,base64pad:Lwe,base64url:Bwe,base64urlpad:Fwe},Symbol.toStringTag,{value:"Module"})),cW=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),Uwe=cW.reduce((t,e,r)=>(t[r]=e,t),[]),zwe=cW.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function Wwe(t){return t.reduce((e,r)=>(e+=Uwe[r],e),"")}function Hwe(t){const e=[];for(const r of t){const n=zwe[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const qwe=w2({prefix:"🚀",name:"base256emoji",encode:Wwe,decode:Hwe}),Vwe=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:qwe},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const NP={...uwe,...dwe,...pwe,...mwe,...bwe,...Twe,...Rwe,...Nwe,...jwe,...Vwe};function lW(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const DP=lW("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),Px=lW("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);const e=oW(t.length);for(let r=0;r"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Jwe:typeof navigator<"u"?jP(navigator.userAgent):ixe()}function rxe(t){return t!==""&&exe.reduce(function(e,r){var n=r[0],i=r[1];if(e)return e;var s=i.exec(t);return!!s&&[n,s]},!1)}function jP(t){var e=rxe(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new Ywe;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function lxe(t,e){return function(r,n){e(r,n,t)}}function uxe(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function fxe(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(f){o(f)}}function c(u){try{l(n.throw(u))}catch(f){o(f)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(t,e||[])).next())})}function dxe(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,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(l){return function(u){return c([l,u])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function fW(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function vxe(){for(var t=[],e=0;e1||a(d,h)})})}function a(d,h){try{c(n[d](h))}catch(p){f(s[0][3],p)}}function c(d){d.value instanceof R1?Promise.resolve(d.value.v).then(l,u):f(s[0][2],d)}function l(d){a("next",d)}function u(d){a("throw",d)}function f(d,h){d(h),s.shift(),s.length&&a(s[0][0],s[0][1])}}function gxe(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=t[i]?function(o){return(r=!r)?{value:R1(t[i](o)),done:i==="return"}:s?s(o):o}:s}}function bxe(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof X3=="function"?X3(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function wxe(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function xxe(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function Exe(t){return t&&t.__esModule?t:{default:t}}function Cxe(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function Sxe(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}const kxe=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return J3},__asyncDelegator:gxe,__asyncGenerator:yxe,__asyncValues:bxe,__await:R1,__awaiter:fxe,__classPrivateFieldGet:Cxe,__classPrivateFieldSet:Sxe,__createBinding:hxe,__decorate:cxe,__exportStar:pxe,__extends:oxe,__generator:dxe,__importDefault:Exe,__importStar:xxe,__makeTemplateObject:wxe,__metadata:uxe,__param:lxe,__read:fW,__rest:axe,__spread:vxe,__spreadArrays:mxe,__values:X3},Symbol.toStringTag,{value:"Module"})),x2=QI(kxe);var Tx={},_h={},UP;function Axe(){if(UP)return _h;UP=1,Object.defineProperty(_h,"__esModule",{value:!0}),_h.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return _h.delay=t,_h}var fl={},Ix={},dl={},zP;function _xe(){return zP||(zP=1,Object.defineProperty(dl,"__esModule",{value:!0}),dl.ONE_THOUSAND=dl.ONE_HUNDRED=void 0,dl.ONE_HUNDRED=100,dl.ONE_THOUSAND=1e3),dl}var Ox={},WP;function Pxe(){return WP||(WP=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=t.ONE_MINUTE*5,t.TEN_MINUTES=t.ONE_MINUTE*10,t.THIRTY_MINUTES=t.ONE_MINUTE*30,t.SIXTY_MINUTES=t.ONE_MINUTE*60,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=t.ONE_HOUR*3,t.SIX_HOURS=t.ONE_HOUR*6,t.TWELVE_HOURS=t.ONE_HOUR*12,t.TWENTY_FOUR_HOURS=t.ONE_HOUR*24,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=t.ONE_DAY*3,t.FIVE_DAYS=t.ONE_DAY*5,t.SEVEN_DAYS=t.ONE_DAY*7,t.THIRTY_DAYS=t.ONE_DAY*30,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=t.ONE_WEEK*2,t.THREE_WEEKS=t.ONE_WEEK*3,t.FOUR_WEEKS=t.ONE_WEEK*4,t.ONE_YEAR=t.ONE_DAY*365}(Ox)),Ox}var HP;function dW(){return HP||(HP=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=x2;e.__exportStar(_xe(),t),e.__exportStar(Pxe(),t)}(Ix)),Ix}var qP;function Txe(){if(qP)return fl;qP=1,Object.defineProperty(fl,"__esModule",{value:!0}),fl.fromMiliseconds=fl.toMiliseconds=void 0;const t=dW();function e(n){return n*t.ONE_THOUSAND}fl.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return fl.fromMiliseconds=r,fl}var VP;function Ixe(){return VP||(VP=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=x2;e.__exportStar(Axe(),t),e.__exportStar(Txe(),t)}(Tx)),Tx}var Bu={},GP;function Oxe(){if(GP)return Bu;GP=1,Object.defineProperty(Bu,"__esModule",{value:!0}),Bu.Watch=void 0;class t{constructor(){this.timestamps=new Map}start(r){if(this.timestamps.has(r))throw new Error(`Watch already started for label: ${r}`);this.timestamps.set(r,{started:Date.now()})}stop(r){const n=this.get(r);if(typeof n.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const i=Date.now()-n.started;this.timestamps.set(r,{started:n.started,elapsed:i})}get(r){const n=this.timestamps.get(r);if(typeof n>"u")throw new Error(`No timestamp found for label: ${r}`);return n}elapsed(r){const n=this.get(r);return n.elapsed||Date.now()-n.started}}return Bu.Watch=t,Bu.default=t,Bu}var Rx={},Ph={},KP;function Rxe(){if(KP)return Ph;KP=1,Object.defineProperty(Ph,"__esModule",{value:!0}),Ph.IWatch=void 0;class t{}return Ph.IWatch=t,Ph}var QP;function $xe(){return QP||(QP=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),x2.__exportStar(Rxe(),t)}(Rx)),Rx}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=x2;e.__exportStar(Ixe(),t),e.__exportStar(Oxe(),t),e.__exportStar($xe(),t),e.__exportStar(dW(),t)})(zl);var gt={};Object.defineProperty(gt,"__esModule",{value:!0});gt.getLocalStorage=gt.getLocalStorageOrThrow=gt.getCrypto=gt.getCryptoOrThrow=pW=gt.getLocation=gt.getLocationOrThrow=AS=gt.getNavigator=gt.getNavigatorOrThrow=hW=gt.getDocument=gt.getDocumentOrThrow=gt.getFromWindowOrThrow=gt.getFromWindow=void 0;function Eu(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}gt.getFromWindow=Eu;function Qd(t){const e=Eu(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}gt.getFromWindowOrThrow=Qd;function Mxe(){return Qd("document")}gt.getDocumentOrThrow=Mxe;function Nxe(){return Eu("document")}var hW=gt.getDocument=Nxe;function Dxe(){return Qd("navigator")}gt.getNavigatorOrThrow=Dxe;function Lxe(){return Eu("navigator")}var AS=gt.getNavigator=Lxe;function Bxe(){return Qd("location")}gt.getLocationOrThrow=Bxe;function Fxe(){return Eu("location")}var pW=gt.getLocation=Fxe;function jxe(){return Qd("crypto")}gt.getCryptoOrThrow=jxe;function Uxe(){return Eu("crypto")}gt.getCrypto=Uxe;function zxe(){return Qd("localStorage")}gt.getLocalStorageOrThrow=zxe;function Wxe(){return Eu("localStorage")}gt.getLocalStorage=Wxe;var _S={};Object.defineProperty(_S,"__esModule",{value:!0});var vW=_S.getWindowMetadata=void 0;const YP=gt;function Hxe(){let t,e;try{t=YP.getDocumentOrThrow(),e=YP.getLocationOrThrow()}catch{return null}function r(){const f=t.getElementsByTagName("link"),d=[];for(let h=0;h-1){const m=p.getAttribute("href");if(m)if(m.toLowerCase().indexOf("https:")===-1&&m.toLowerCase().indexOf("http:")===-1&&m.indexOf("//")!==0){let g=e.protocol+"//"+e.host;if(m.indexOf("/")===0)g+=m;else{const y=e.pathname.split("/");y.pop();const b=y.join("/");g+=b+"/"+m}d.push(g)}else if(m.indexOf("//")===0){const g=e.protocol+m;d.push(g)}else d.push(m)}}return d}function n(...f){const d=t.getElementsByTagName("meta");for(let h=0;hp.getAttribute(m)).filter(m=>m?f.includes(m):!1);if(v.length&&v){const m=p.getAttribute("content");if(m)return m}}return""}function i(){let f=n("name","og:site_name","og:title","twitter:title");return f||(f=t.title),f}function s(){return n("description","og:description","twitter:description","keywords")}const o=i(),a=s(),c=e.origin,l=r();return{description:a,url:c,icons:l,name:o}}vW=_S.getWindowMetadata=Hxe;var $1={},qxe=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),mW="%[a-f0-9]{2}",JP=new RegExp("("+mW+")|([^%]+?)","gi"),XP=new RegExp("("+mW+")+","gi");function Z3(t,e){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;e=e||1;var r=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],Z3(r),Z3(n))}function Vxe(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(JP)||[],r=1;r{if(!(typeof t=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[t];const r=t.indexOf(e);return r===-1?[t]:[t.slice(0,r),t.slice(r+e.length)]},Yxe=function(t,e){for(var r={},n=Object.keys(t),i=Array.isArray(e),s=0;sy==null,o=Symbol("encodeFragmentIdentifier");function a(y){switch(y.arrayFormat){case"index":return b=>(C,A)=>{const O=C.length;return A===void 0||y.skipNull&&A===null||y.skipEmptyString&&A===""?C:A===null?[...C,[u(b,y),"[",O,"]"].join("")]:[...C,[u(b,y),"[",u(O,y),"]=",u(A,y)].join("")]};case"bracket":return b=>(C,A)=>A===void 0||y.skipNull&&A===null||y.skipEmptyString&&A===""?C:A===null?[...C,[u(b,y),"[]"].join("")]:[...C,[u(b,y),"[]=",u(A,y)].join("")];case"colon-list-separator":return b=>(C,A)=>A===void 0||y.skipNull&&A===null||y.skipEmptyString&&A===""?C:A===null?[...C,[u(b,y),":list="].join("")]:[...C,[u(b,y),":list=",u(A,y)].join("")];case"comma":case"separator":case"bracket-separator":{const b=y.arrayFormat==="bracket-separator"?"[]=":"=";return C=>(A,O)=>O===void 0||y.skipNull&&O===null||y.skipEmptyString&&O===""?A:(O=O===null?"":O,A.length===0?[[u(C,y),b,u(O,y)].join("")]:[[A,u(O,y)].join(y.arrayFormatSeparator)])}default:return b=>(C,A)=>A===void 0||y.skipNull&&A===null||y.skipEmptyString&&A===""?C:A===null?[...C,u(b,y)]:[...C,[u(b,y),"=",u(A,y)].join("")]}}function c(y){let b;switch(y.arrayFormat){case"index":return(C,A,O)=>{if(b=/\[(\d*)\]$/.exec(C),C=C.replace(/\[\d*\]$/,""),!b){O[C]=A;return}O[C]===void 0&&(O[C]={}),O[C][b[1]]=A};case"bracket":return(C,A,O)=>{if(b=/(\[\])$/.exec(C),C=C.replace(/\[\]$/,""),!b){O[C]=A;return}if(O[C]===void 0){O[C]=[A];return}O[C]=[].concat(O[C],A)};case"colon-list-separator":return(C,A,O)=>{if(b=/(:list)$/.exec(C),C=C.replace(/:list$/,""),!b){O[C]=A;return}if(O[C]===void 0){O[C]=[A];return}O[C]=[].concat(O[C],A)};case"comma":case"separator":return(C,A,O)=>{const w=typeof A=="string"&&A.includes(y.arrayFormatSeparator),I=typeof A=="string"&&!w&&f(A,y).includes(y.arrayFormatSeparator);A=I?f(A,y):A;const B=w||I?A.split(y.arrayFormatSeparator).map(z=>f(z,y)):A===null?A:f(A,y);O[C]=B};case"bracket-separator":return(C,A,O)=>{const w=/(\[\])$/.test(C);if(C=C.replace(/\[\]$/,""),!w){O[C]=A&&f(A,y);return}const I=A===null?[]:A.split(y.arrayFormatSeparator).map(B=>f(B,y));if(O[C]===void 0){O[C]=I;return}O[C]=[].concat(O[C],I)};default:return(C,A,O)=>{if(O[C]===void 0){O[C]=A;return}O[C]=[].concat(O[C],A)}}}function l(y){if(typeof y!="string"||y.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function u(y,b){return b.encode?b.strict?e(y):encodeURIComponent(y):y}function f(y,b){return b.decode?r(y):y}function d(y){return Array.isArray(y)?y.sort():typeof y=="object"?d(Object.keys(y)).sort((b,C)=>Number(b)-Number(C)).map(b=>y[b]):y}function h(y){const b=y.indexOf("#");return b!==-1&&(y=y.slice(0,b)),y}function p(y){let b="";const C=y.indexOf("#");return C!==-1&&(b=y.slice(C)),b}function v(y){y=h(y);const b=y.indexOf("?");return b===-1?"":y.slice(b+1)}function m(y,b){return b.parseNumbers&&!Number.isNaN(Number(y))&&typeof y=="string"&&y.trim()!==""?y=Number(y):b.parseBooleans&&y!==null&&(y.toLowerCase()==="true"||y.toLowerCase()==="false")&&(y=y.toLowerCase()==="true"),y}function g(y,b){b=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},b),l(b.arrayFormatSeparator);const C=c(b),A=Object.create(null);if(typeof y!="string"||(y=y.trim().replace(/^[?#&]/,""),!y))return A;for(const O of y.split("&")){if(O==="")continue;let[w,I]=n(b.decode?O.replace(/\+/g," "):O,"=");I=I===void 0?null:["comma","separator","bracket-separator"].includes(b.arrayFormat)?I:f(I,b),C(f(w,b),I,A)}for(const O of Object.keys(A)){const w=A[O];if(typeof w=="object"&&w!==null)for(const I of Object.keys(w))w[I]=m(w[I],b);else A[O]=m(w,b)}return b.sort===!1?A:(b.sort===!0?Object.keys(A).sort():Object.keys(A).sort(b.sort)).reduce((O,w)=>{const I=A[w];return I&&typeof I=="object"&&!Array.isArray(I)?O[w]=d(I):O[w]=I,O},Object.create(null))}t.extract=v,t.parse=g,t.stringify=(y,b)=>{if(!y)return"";b=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},b),l(b.arrayFormatSeparator);const C=I=>b.skipNull&&s(y[I])||b.skipEmptyString&&y[I]==="",A=a(b),O={};for(const I of Object.keys(y))C(I)||(O[I]=y[I]);const w=Object.keys(O);return b.sort!==!1&&w.sort(b.sort),w.map(I=>{const B=y[I];return B===void 0?"":B===null?u(I,b):Array.isArray(B)?B.length===0&&b.arrayFormat==="bracket-separator"?u(I,b)+"[]":B.reduce(A(I),[]).join("&"):u(I,b)+"="+u(B,b)}).filter(I=>I.length>0).join("&")},t.parseUrl=(y,b)=>{b=Object.assign({decode:!0},b);const[C,A]=n(y,"#");return Object.assign({url:C.split("?")[0]||"",query:g(v(y),b)},b&&b.parseFragmentIdentifier&&A?{fragmentIdentifier:f(A,b)}:{})},t.stringifyUrl=(y,b)=>{b=Object.assign({encode:!0,strict:!0,[o]:!0},b);const C=h(y.url).split("?")[0]||"",A=t.extract(y.url),O=t.parse(A,{sort:!1}),w=Object.assign(O,y.query);let I=t.stringify(w,b);I&&(I=`?${I}`);let B=p(y.url);return y.fragmentIdentifier&&(B=`#${b[o]?u(y.fragmentIdentifier,b):y.fragmentIdentifier}`),`${C}${I}${B}`},t.pick=(y,b,C)=>{C=Object.assign({parseFragmentIdentifier:!0,[o]:!1},C);const{url:A,query:O,fragmentIdentifier:w}=t.parseUrl(y,C);return t.stringifyUrl({url:A,query:i(O,b),fragmentIdentifier:w},C)},t.exclude=(y,b,C)=>{const A=Array.isArray(b)?O=>!b.includes(O):(O,w)=>!b(O,w);return t.pick(y,A,C)}})($1);const Jxe={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe"}};function _Te(t,e=[]){const r=[];return Object.keys(t).forEach(n=>{if(e.length&&!e.includes(n))return;const i=t[n];r.push(...i.accounts)}),r}function yW(t,e){return t.includes(":")?[t]:e.chains||[]}const gW="base10",si="base16",e8="base64pad",PS="utf8",bW=0,Ap=1,Xxe=0,ZP=1,t8=12,TS=32;function PTe(){const t=SS.generateKeyPair();return{privateKey:Rs(t.secretKey,si),publicKey:Rs(t.publicKey,si)}}function TTe(){const t=v2.randomBytes(TS);return Rs(t,si)}function ITe(t,e){const r=SS.sharedKey(Cs(t,si),Cs(e,si)),n=new W2e(b2.SHA256,r).expand(TS);return Rs(n,si)}function OTe(t){const e=b2.hash(Cs(t,si));return Rs(e,si)}function RTe(t){const e=b2.hash(Cs(t,PS));return Rs(e,si)}function Zxe(t){return Cs(`${t}`,gW)}function E2(t){return Number(Rs(t,gW))}function $Te(t){const e=Zxe(typeof t.type<"u"?t.type:bW);if(E2(e)===Ap&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?Cs(t.senderPublicKey,si):void 0,n=typeof t.iv<"u"?Cs(t.iv,si):v2.randomBytes(t8),i=new ES.ChaCha20Poly1305(Cs(t.symKey,si)).seal(n,Cs(t.message,PS));return e5e({type:e,sealed:i,iv:n,senderPublicKey:r})}function MTe(t){const e=new ES.ChaCha20Poly1305(Cs(t.symKey,si)),{sealed:r,iv:n}=wW(t.encoded),i=e.open(n,r);if(i===null)throw new Error("Failed to decrypt");return Rs(i,PS)}function e5e(t){if(E2(t.type)===Ap){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Rs(MP([t.type,t.senderPublicKey,t.iv,t.sealed]),e8)}return Rs(MP([t.type,t.iv,t.sealed]),e8)}function wW(t){const e=Cs(t,e8),r=e.slice(Xxe,ZP),n=ZP;if(E2(r)===Ap){const a=n+TS,c=a+t8,l=e.slice(n,a),u=e.slice(a,c),f=e.slice(c);return{type:r,sealed:f,iv:u,senderPublicKey:l}}const i=n+t8,s=e.slice(n,i),o=e.slice(i);return{type:r,sealed:o,iv:s}}function NTe(t,e){const r=wW(t);return t5e({type:E2(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?Rs(r.senderPublicKey,si):void 0,receiverPublicKey:e==null?void 0:e.receiverPublicKey})}function t5e(t){const e=(t==null?void 0:t.type)||bW;if(e===Ap){if(typeof(t==null?void 0:t.senderPublicKey)>"u")throw new Error("missing sender public key");if(typeof(t==null?void 0:t.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:t==null?void 0:t.senderPublicKey,receiverPublicKey:t==null?void 0:t.receiverPublicKey}}function DTe(t){return t.type===Ap&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}var r5e=Object.defineProperty,eT=Object.getOwnPropertySymbols,n5e=Object.prototype.hasOwnProperty,i5e=Object.prototype.propertyIsEnumerable,tT=(t,e,r)=>e in t?r5e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,rT=(t,e)=>{for(var r in e||(e={}))n5e.call(e,r)&&tT(t,r,e[r]);if(eT)for(var r of eT(e))i5e.call(e,r)&&tT(t,r,e[r]);return t};const s5e="ReactNative",nc={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},o5e="js";function xW(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function a5e(){return!hW()&&!!AS()&&navigator.product===s5e}function c5e(){return!xW()&&!!AS()}function IS(){return a5e()?nc.reactNative:xW()?nc.node:c5e()?nc.browser:nc.unknown}function l5e(t,e){let r=$1.parse(t);return r=rT(rT({},r),e),t=$1.stringify(r),t}function LTe(){return vW()||{name:"",description:"",url:"",icons:[""]}}function u5e(){if(IS()===nc.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:r,Version:n}=global.Platform;return[r,n].join("-")}const t=txe();if(t===null)return"unknown";const e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return t.type==="browser"?[e,t.name,t.version].join("-"):[e,t.version].join("-")}function f5e(){var t;const e=IS();return e===nc.browser?[e,((t=pW())==null?void 0:t.host)||"unknown"].join(":"):e}function d5e(t,e,r){const n=u5e(),i=f5e();return[[t,e].join("-"),[o5e,r].join("-"),n,i].join("/")}function BTe({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:s,useOnCloseEvent:o}){const a=r.split("?"),c=d5e(t,e,n),l={auth:i,ua:c,projectId:s,useOnCloseEvent:o||void 0},u=l5e(a[1]||"",l);return a[0]+"?"+u}function Ol(t,e){return t.filter(r=>e.includes(r)).length===t.length}function FTe(t){return Object.fromEntries(t.entries())}function jTe(t){return new Map(Object.entries(t))}function UTe(t=zl.FIVE_MINUTES,e){const r=zl.toMiliseconds(t||zl.FIVE_MINUTES);let n,i,s;return{resolve:o=>{s&&n&&(clearTimeout(s),n(o))},reject:o=>{s&&i&&(clearTimeout(s),i(o))},done:()=>new Promise((o,a)=>{s=setTimeout(()=>{a(new Error(e))},r),n=o,i=a})}}function zTe(t,e,r){return new Promise(async(n,i)=>{const s=setTimeout(()=>i(new Error(r)),e);try{const o=await t;n(o)}catch(o){i(o)}clearTimeout(s)})}function EW(t,e){if(typeof e=="string"&&e.startsWith(`${t}:`))return e;if(t.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(t.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: ${t}`)}function WTe(t){return EW("topic",t)}function HTe(t){return EW("id",t)}function qTe(t){const[e,r]=t.split(":"),n={id:void 0,topic:void 0};if(e==="topic"&&typeof r=="string")n.topic=r;else if(e==="id"&&Number.isInteger(Number(r)))n.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return n}function VTe(t,e){return zl.fromMiliseconds((e||Date.now())+zl.toMiliseconds(t))}function GTe(t){return Date.now()>=zl.toMiliseconds(t)}function KTe(t,e){return`${t}${e?`:${e}`:""}`}function $x(t=[],e=[]){return[...new Set([...t,...e])]}async function QTe({id:t,topic:e,wcDeepLink:r}){try{if(!r)return;const n=typeof r=="string"?JSON.parse(r):r;let i=n==null?void 0:n.href;if(typeof i!="string")return;i.endsWith("/")&&(i=i.slice(0,-1));const s=`${i}/wc?requestId=${t}&sessionTopic=${e}`,o=IS();o===nc.browser?s.startsWith("https://")?window.open(s,"_blank","noreferrer noopener"):window.open(s,"_self","noreferrer noopener"):o===nc.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(s)}catch(n){console.error(n)}}const h5e="irn";function YTe(t){return(t==null?void 0:t.relay)||{protocol:h5e}}function JTe(t){const e=Jxe[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var p5e=Object.defineProperty,nT=Object.getOwnPropertySymbols,v5e=Object.prototype.hasOwnProperty,m5e=Object.prototype.propertyIsEnumerable,iT=(t,e,r)=>e in t?p5e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,y5e=(t,e)=>{for(var r in e||(e={}))v5e.call(e,r)&&iT(t,r,e[r]);if(nT)for(var r of nT(e))m5e.call(e,r)&&iT(t,r,e[r]);return t};function g5e(t,e="-"){const r={},n="relay"+e;return Object.keys(t).forEach(i=>{if(i.startsWith(n)){const s=i.replace(n,""),o=t[i];r[s]=o}}),r}function XTe(t){const e=t.indexOf(":"),r=t.indexOf("?")!==-1?t.indexOf("?"):void 0,n=t.substring(0,e),i=t.substring(e+1,r).split("@"),s=typeof r<"u"?t.substring(r):"",o=$1.parse(s);return{protocol:n,topic:b5e(i[0]),version:parseInt(i[1],10),symKey:o.symKey,relay:g5e(o)}}function b5e(t){return t.startsWith("//")?t.substring(2):t}function w5e(t,e="-"){const r="relay",n={};return Object.keys(t).forEach(i=>{const s=r+e+i;t[i]&&(n[s]=t[i])}),n}function ZTe(t){return`${t.protocol}:${t.topic}@${t.version}?`+$1.stringify(y5e({symKey:t.symKey},w5e(t.relay)))}var x5e=Object.defineProperty,E5e=Object.defineProperties,C5e=Object.getOwnPropertyDescriptors,sT=Object.getOwnPropertySymbols,S5e=Object.prototype.hasOwnProperty,k5e=Object.prototype.propertyIsEnumerable,oT=(t,e,r)=>e in t?x5e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,A5e=(t,e)=>{for(var r in e||(e={}))S5e.call(e,r)&&oT(t,r,e[r]);if(sT)for(var r of sT(e))k5e.call(e,r)&&oT(t,r,e[r]);return t},_5e=(t,e)=>E5e(t,C5e(e));function Yd(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function P5e(t){const e=[];return Object.values(t).forEach(r=>{e.push(...Yd(r.accounts))}),e}function T5e(t,e){const r=[];return Object.values(t).forEach(n=>{Yd(n.accounts).includes(e)&&r.push(...n.methods)}),r}function I5e(t,e){const r=[];return Object.values(t).forEach(n=>{Yd(n.accounts).includes(e)&&r.push(...n.events)}),r}function eIe(t,e){const r=j5e(t,e);if(r)throw new Error(r.message);const n={};for(const[i,s]of Object.entries(t))n[i]={methods:s.methods,events:s.events,chains:s.accounts.map(o=>`${o.split(":")[0]}:${o.split(":")[1]}`)};return n}function CW(t){return t.includes(":")}function O5e(t){return CW(t)?t.split(":")[0]:t}function SW(t){var e,r,n;const i={};if(!OS(t))return i;for(const[s,o]of Object.entries(t)){const a=CW(s)?[s]:o.chains,c=o.methods||[],l=o.events||[],u=O5e(s);i[u]=_5e(A5e({},i[u]),{chains:$x(a,(e=i[u])==null?void 0:e.chains),methods:$x(c,(r=i[u])==null?void 0:r.methods),events:$x(l,(n=i[u])==null?void 0:n.events)})}return i}const R5e={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}},$5e={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 Ka(t,e){const{message:r,code:n}=$5e[t];return{message:e?`${r} ${e}`:r,code:n}}function md(t,e){const{message:r,code:n}=R5e[t];return{message:e?`${r} ${e}`:r,code:n}}function C2(t,e){return Array.isArray(t)?typeof e<"u"&&t.length?t.every(e):!0:!1}function OS(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function Wl(t){return typeof t>"u"}function rs(t,e){return e&&Wl(t)?!0:typeof t=="string"&&!!t.trim().length}function RS(t,e){return e&&Wl(t)?!0:typeof t=="number"&&!isNaN(t)}function tIe(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let s=!0;return Ol(i,n)?(n.forEach(o=>{const{accounts:a,methods:c,events:l}=t.namespaces[o],u=Yd(a),f=r[o];(!Ol(yW(o,f),u)||!Ol(f.methods,c)||!Ol(f.events,l))&&(s=!1)}),s):!1}function sg(t){return rs(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function M5e(t){if(rs(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&sg(r)}}return!1}function rIe(t){if(rs(t,!1))try{return typeof new URL(t)<"u"}catch{return!1}return!1}function nIe(t){var e;return(e=t==null?void 0:t.proposer)==null?void 0:e.publicKey}function iIe(t){return t==null?void 0:t.topic}function sIe(t,e){let r=null;return rs(t==null?void 0:t.publicKey,!1)||(r=Ka("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function aT(t){let e=!0;return C2(t)?t.length&&(e=t.every(r=>rs(r,!1))):e=!1,e}function N5e(t,e,r){let n=null;return C2(e)&&e.length?e.forEach(i=>{n||sg(i)||(n=md("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):sg(t)||(n=md("UNSUPPORTED_CHAINS",`${r}, 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"] }`)),n}function D5e(t,e,r){let n=null;return Object.entries(t).forEach(([i,s])=>{if(n)return;const o=N5e(i,yW(i,s),`${e} ${r}`);o&&(n=o)}),n}function L5e(t,e){let r=null;return C2(t)?t.forEach(n=>{r||M5e(n)||(r=md("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=md("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function B5e(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=L5e(n==null?void 0:n.accounts,`${e} namespace`);i&&(r=i)}),r}function F5e(t,e){let r=null;return aT(t==null?void 0:t.methods)?aT(t==null?void 0:t.events)||(r=md("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=md("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function kW(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=F5e(n,`${e}, namespace`);i&&(r=i)}),r}function oIe(t,e,r){let n=null;if(t&&OS(t)){const i=kW(t,e);i&&(n=i);const s=D5e(t,e,r);s&&(n=s)}else n=Ka("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function j5e(t,e){let r=null;if(t&&OS(t)){const n=kW(t,e);n&&(r=n);const i=B5e(t,e);i&&(r=i)}else r=Ka("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function U5e(t){return rs(t.protocol,!0)}function aIe(t,e){let r=!1;return e&&!t?r=!0:t&&C2(t)&&t.length&&t.forEach(n=>{r=U5e(n)}),r}function cIe(t){return typeof t=="number"}function lIe(t){return typeof t<"u"&&typeof t!==null}function uIe(t){return!(!t||typeof t!="object"||!t.code||!RS(t.code,!1)||!t.message||!rs(t.message,!1))}function fIe(t){return!(Wl(t)||!rs(t.method,!1))}function dIe(t){return!(Wl(t)||Wl(t.result)&&Wl(t.error)||!RS(t.id,!1)||!rs(t.jsonrpc,!1))}function hIe(t){return!(Wl(t)||!rs(t.name,!1))}function pIe(t,e){return!(!sg(e)||!P5e(t).includes(e))}function vIe(t,e,r){return rs(r,!1)?T5e(t,e).includes(r):!1}function mIe(t,e,r){return rs(r,!1)?I5e(t,e).includes(r):!1}function yIe(t,e,r){let n=null;const i=z5e(t),s=W5e(e),o=Object.keys(i),a=Object.keys(s),c=cT(Object.keys(t)),l=cT(Object.keys(e)),u=c.filter(f=>!l.includes(f));return u.length&&(n=Ka("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces. - Required: ${u.toString()} - Received: ${Object.keys(e).toString()}`)),Ol(o,a)||(n=Ka("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces. - Required: ${o.toString()} - Approved: ${a.toString()}`)),Object.keys(e).forEach(f=>{if(!f.includes(":")||n)return;const d=Yd(e[f].accounts);d.includes(f)||(n=Ka("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${f} - Required: ${f} - Approved: ${d.toString()}`))}),o.forEach(f=>{n||(Ol(i[f].methods,s[f].methods)?Ol(i[f].events,s[f].events)||(n=Ka("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${f}`)):n=Ka("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${f}`))}),n}function z5e(t){const e={};return Object.keys(t).forEach(r=>{var n;r.includes(":")?e[r]=t[r]:(n=t[r].chains)==null||n.forEach(i=>{e[i]={methods:t[r].methods,events:t[r].events}})}),e}function cT(t){return[...new Set(t.map(e=>e.includes(":")?e.split(":")[0]:e))]}function W5e(t){const e={};return Object.keys(t).forEach(r=>{if(r.includes(":"))e[r]=t[r];else{const n=Yd(t[r].accounts);n==null||n.forEach(i=>{e[i]={accounts:t[r].accounts.filter(s=>s.includes(`${i}:`)),methods:t[r].methods,events:t[r].events}})}}),e}function gIe(t,e){return RS(t,!1)&&t<=e.max&&t>=e.min}var AW="eip155",H5e="store",_W="requestedChains",r8="wallet_addEthereumChain",ar,S0,bm,n8,$S,PW,wm,i8,s8,TW,og,MS,Zu,Hh,ag,NS,cg,DS,lg,LS,q5e=class extends vp{constructor(t){super({...t,options:{isNewChainsStale:!0,...t.options}}),Br(this,bm),Br(this,$S),Br(this,wm),Br(this,s8),Br(this,og),Br(this,Zu),Br(this,ag),Br(this,cg),Br(this,lg),Ke(this,"id","walletConnect"),Ke(this,"name","WalletConnect"),Ke(this,"ready",!0),Br(this,ar,void 0),Br(this,S0,void 0),Ke(this,"onAccountsChanged",e=>{e.length===0?this.emit("disconnect"):this.emit("change",{account:jn(e[0])})}),Ke(this,"onChainChanged",e=>{const r=Number(e),n=this.isChainUnsupported(r);this.emit("change",{chain:{id:r,unsupported:n}})}),Ke(this,"onDisconnect",()=>{Lr(this,Zu,Hh).call(this,[]),this.emit("disconnect")}),Ke(this,"onDisplayUri",e=>{this.emit("message",{type:"display_uri",data:e})}),Ke(this,"onConnect",()=>{this.emit("connect",{})}),Lr(this,bm,n8).call(this)}async connect({chainId:t,pairingTopic:e}={}){var r,n,i,s,o;try{let a=t;if(!a){const p=(r=this.storage)==null?void 0:r.getItem(H5e),v=(s=(i=(n=p==null?void 0:p.state)==null?void 0:n.data)==null?void 0:i.chain)==null?void 0:s.id;v&&!this.isChainUnsupported(v)?a=v:a=(o=this.chains[0])==null?void 0:o.id}if(!a)throw new Error("No chains found on connector.");const c=await this.getProvider();Lr(this,s8,TW).call(this);const l=Lr(this,wm,i8).call(this);if(c.session&&l&&await c.disconnect(),!c.session||l){const p=this.chains.filter(v=>v.id!==a).map(v=>v.id);this.emit("message",{type:"connecting"}),await c.connect({pairingTopic:e,chains:[a],optionalChains:p.length?p:void 0}),Lr(this,Zu,Hh).call(this,this.chains.map(({id:v})=>v))}const u=await c.enable(),f=jn(u[0]),d=await this.getChainId(),h=this.isChainUnsupported(d);return{account:f,chain:{id:d,unsupported:h}}}catch(a){throw/user rejected/i.test(a==null?void 0:a.message)?new Or(a):a}}async disconnect(){const t=await this.getProvider();try{await t.disconnect()}catch(e){if(!/No matching key/i.test(e.message))throw e}finally{Lr(this,og,MS).call(this),Lr(this,Zu,Hh).call(this,[])}}async getAccount(){const{accounts:t}=await this.getProvider();return jn(t[0])}async getChainId(){const{chainId:t}=await this.getProvider();return t}async getProvider({chainId:t}={}){return He(this,ar)||await Lr(this,bm,n8).call(this),t&&await this.switchChain(t),He(this,ar)}async getWalletClient({chainId:t}={}){const[e,r]=await Promise.all([this.getProvider({chainId:t}),this.getAccount()]),n=this.chains.find(i=>i.id===t);if(!e)throw new Error("provider is required.");return Cp({account:r,chain:n,transport:c2(e)})}async isAuthorized(){try{const[t,e]=await Promise.all([this.getAccount(),this.getProvider()]),r=Lr(this,wm,i8).call(this);if(!t)return!1;if(r&&e.session){try{await e.disconnect()}catch{}return!1}return!0}catch{return!1}}async switchChain(t){var r,n;const e=this.chains.find(i=>i.id===t);if(!e)throw new aa(new Error("chain not found on connector."));try{const i=await this.getProvider(),s=Lr(this,cg,DS).call(this),o=Lr(this,lg,LS).call(this);if(!s.includes(t)&&o.includes(r8)){await i.request({method:r8,params:[{chainId:ze(e.id),blockExplorerUrls:[(n=(r=e.blockExplorers)==null?void 0:r.default)==null?void 0:n.url],chainName:e.name,nativeCurrency:e.nativeCurrency,rpcUrls:[...e.rpcUrls.default.http]}]});const c=Lr(this,ag,NS).call(this);c.push(t),Lr(this,Zu,Hh).call(this,c)}return await i.request({method:"wallet_switchEthereumChain",params:[{chainId:ze(t)}]}),e}catch(i){const s=typeof i=="string"?i:i==null?void 0:i.message;throw/user rejected request/i.test(s)?new Or(i):new aa(i)}}};ar=new WeakMap;S0=new WeakMap;bm=new WeakSet;n8=async function(){return!He(this,S0)&&typeof window<"u"&&Es(this,S0,Lr(this,$S,PW).call(this)),He(this,S0)};$S=new WeakSet;PW=async function(){const{EthereumProvider:t,OPTIONAL_EVENTS:e,OPTIONAL_METHODS:r}=await cS(()=>import("./index.es-044e61fa.js"),["./index.es-044e61fa.js","./events-fe40c1a3.js"],import.meta.url),[n,...i]=this.chains.map(({id:s})=>s);if(n){const{projectId:s,showQrModal:o=!0,qrModalOptions:a,metadata:c,relayUrl:l}=this.options;Es(this,ar,await t.init({showQrModal:o,qrModalOptions:a,projectId:s,optionalMethods:r,optionalEvents:e,chains:[n],optionalChains:i.length?i:void 0,rpcMap:Object.fromEntries(this.chains.map(u=>[u.id,u.rpcUrls.default.http[0]])),metadata:c,relayUrl:l}))}};wm=new WeakSet;i8=function(){if(Lr(this,lg,LS).call(this).includes(r8)||!this.options.isNewChainsStale)return!1;const e=Lr(this,ag,NS).call(this),r=this.chains.map(({id:i})=>i),n=Lr(this,cg,DS).call(this);return n.length&&!n.some(i=>r.includes(i))?!1:!r.every(i=>e.includes(i))};s8=new WeakSet;TW=function(){He(this,ar)&&(Lr(this,og,MS).call(this),He(this,ar).on("accountsChanged",this.onAccountsChanged),He(this,ar).on("chainChanged",this.onChainChanged),He(this,ar).on("disconnect",this.onDisconnect),He(this,ar).on("session_delete",this.onDisconnect),He(this,ar).on("display_uri",this.onDisplayUri),He(this,ar).on("connect",this.onConnect))};og=new WeakSet;MS=function(){He(this,ar)&&(He(this,ar).removeListener("accountsChanged",this.onAccountsChanged),He(this,ar).removeListener("chainChanged",this.onChainChanged),He(this,ar).removeListener("disconnect",this.onDisconnect),He(this,ar).removeListener("session_delete",this.onDisconnect),He(this,ar).removeListener("display_uri",this.onDisplayUri),He(this,ar).removeListener("connect",this.onConnect))};Zu=new WeakSet;Hh=function(t){var e;(e=this.storage)==null||e.setItem(_W,t)};ag=new WeakSet;NS=function(){var t;return((t=this.storage)==null?void 0:t.getItem(_W))??[]};cg=new WeakSet;DS=function(){var n,i,s;if(!He(this,ar))return[];const t=(n=He(this,ar).session)==null?void 0:n.namespaces;return t?((s=(i=SW(t)[AW])==null?void 0:i.chains)==null?void 0:s.map(o=>parseInt(o.split(":")[1]||"")))??[]:[]};lg=new WeakSet;LS=function(){var n,i;if(!He(this,ar))return[];const t=(n=He(this,ar).session)==null?void 0:n.namespaces;return t?((i=SW(t)[AW])==null?void 0:i.methods)??[]:[]};function Ae(){return Ae=Object.assign?Object.assign.bind():function(t){for(var e=1;e({account:l[0]}),this.onDisconnect=()=>{this==null||this.emit("disconnect")};const o=(r==null||(n=r.connect)==null||(n=n.settings)==null?void 0:n.signInOptions)||[],a=r==null||(i=r.connect)==null||(i=i.settings)==null?void 0:i.signInWith;if(r==null||(s=r.connect)==null||(s=s.settings)==null?void 0:s.signInWithEmail)this.id="email",this.name="Email";else if(a)this.id=a,this.name=`${a[0].toUpperCase()}${a.slice(1)}`;else if(o.length>0){const l=o[0],u=`${l[0].toUpperCase()}${l.slice(1)}`;this.id=l,this.name=u}this.provider=M4.initWallet(r.projectAccessKey,{defaultNetwork:r==null?void 0:r.defaultNetwork,transports:{walletAppURL:"https://sequence.app"},defaultEIP6492:!0,analytics:!1}),this.provider.on("chainChanged",l=>{this==null||this.emit("change",{chain:{id:o8(l),unsupported:!1}})}),this.provider.on("accountsChanged",l=>{this==null||this.emit("accountsChanged",this.onAccountsChanged(l))}),this.provider.on("disconnect",()=>{this.onDisconnect()})}async connect(){if(!this.provider.isConnected()){var e,r,n;this==null||this.emit("message",{type:"connecting"});const s=(e=this.options)==null?void 0:e.connect,o=localStorage.getItem(Dn.Theme),a=localStorage.getItem(Dn.EthAuthSettings),c=a?JSON.parse(a):{},l=Ae({authorize:!0},c,s,{settings:Ae({theme:o||"dark"},s==null?void 0:s.settings)}),u=await this.provider.connect(l);if(u.error)throw new Or(new Error(u.error));if(!u.connected)throw new Or(new Error("Wallet connection rejected"));const f=(r=u.proof)==null?void 0:r.proofString,d=(n=u.proof)==null?void 0:n.typedData;if(f){const h=JSON.stringify({proofString:f,typedData:d});localStorage.setItem(Dn.EthAuthProof,h)}}return{account:await this.getAccount(),chain:{id:this.provider.getChainId(),unsupported:this.isChainUnsupported(this.provider.getChainId())}}}async getWalletClient({chainId:e}={}){const r=this.chains.find(n=>n.id===e);return Cp({chain:r,account:await this.getAccount(),transport:c2(this.provider)})}onChainChanged(e){this.provider.setDefaultChainId(o8(e))}async switchChain(e){if(this.isChainUnsupported(e))throw new Error("Unsupported chain");return this.provider.setDefaultChainId(e),this.chains.find(r=>r.id===e)}async disconnect(){localStorage.removeItem(Dn.EthAuthProof),this.provider.disconnect()}getAccount(){return this.provider.getSigner().getAddress()}async getChainId(){return this.provider.getChainId()}async getProvider(){return this.provider}async getSigner(){return this.provider.getSigner()}async isAuthorized(){try{return!!await this.getAccount()}catch{return!1}}isChainUnsupported(e){return this.provider.networks.findIndex(r=>r.chainId===e)===-1}}const o8=t=>typeof t=="object"?o8(t.chainId):typeof t=="string"?Number.parseInt(t,t.trim().substring(0,2)==="0x"?16:10):typeof t=="bigint"?Number(t):t;function ns(t){if(t==null)throw new TypeError("Cannot destructure "+t)}const lT=({isDarkMode:t})=>{const e=t?"white":"black";return n=>{let i=Ae({},(ns(n),n));return S.createElement(S.Fragment,null,S.createElement("svg",Ae({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 29 34",fill:"none"},i),S.createElement("path",{d:"M27.702 11.5918C27.5049 11.7448 24.0243 13.7068 24.0243 18.0694C24.0243 23.1155 28.4532 24.9007 28.5858 24.9449C28.5654 25.0537 27.8822 27.3897 26.2506 29.77C24.7958 31.8646 23.2765 33.9558 20.9651 33.9558C18.6538 33.9558 18.0589 32.6127 15.3907 32.6127C12.7904 32.6127 11.8659 34 9.75169 34C7.63748 34 6.1623 32.0618 4.46618 29.6816C2.50154 26.8865 0.914185 22.5443 0.914185 18.423C0.914185 11.8128 5.21057 8.30703 9.43897 8.30703C11.6857 8.30703 13.5586 9.78278 14.9692 9.78278C16.3118 9.78278 18.4056 8.21862 20.9617 8.21862C21.9304 8.21862 25.4111 8.30703 27.702 11.5918ZM19.7483 5.42014C20.8054 4.16542 21.5532 2.42444 21.5532 0.683468C21.5532 0.442044 21.5328 0.19722 21.4886 0C19.7687 0.0646065 17.7224 1.14591 16.4886 2.57746C15.5199 3.67917 14.6157 5.42014 14.6157 7.18492C14.6157 7.45014 14.6599 7.71537 14.6803 7.80038C14.7891 7.82078 14.9658 7.84458 15.1426 7.84458C16.6857 7.84458 18.6266 6.81088 19.7483 5.42014Z",fill:e})))}},uT=({isDarkMode:t})=>{const e=t?"#FFFFFF":"#000000";return n=>{let i=Ae({},(ns(n),n));return S.createElement(S.Fragment,null,S.createElement("svg",Ae({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 41 40",fill:"none"},i),S.createElement("path",{d:"M27.166 20.8774C27.1338 17.335 30.0617 15.633 30.1936 15.5493C28.5463 13.1395 25.9852 12.8113 25.0714 12.7727C22.8932 12.5507 20.8179 14.0565 19.7111 14.0565C18.6043 14.0565 16.8991 12.8049 15.0909 12.8403C12.7131 12.8757 10.5221 14.2205 9.2962 16.3505C6.8284 20.6297 8.66557 26.9777 11.0722 30.4557C12.2498 32.1545 13.6494 34.0689 15.493 33.9981C17.2691 33.9273 17.9383 32.8495 20.0811 32.8495C22.224 32.8495 22.8289 33.9981 24.7014 33.9627C26.6094 33.9241 27.8191 32.2253 28.9871 30.5201C30.3352 28.5478 30.8918 26.6366 30.924 26.5369C30.8822 26.5208 27.2046 25.1116 27.166 20.8774Z",fill:e}),S.createElement("path",{d:"M23.6429 10.4722C24.621 9.28822 25.2806 7.64089 25.1004 6C23.6911 6.05791 21.9859 6.93949 20.9756 8.12351C20.0715 9.16917 19.2768 10.8455 19.4923 12.4542C21.0592 12.5764 22.6648 11.653 23.6429 10.4722Z",fill:e})))}},V5e=({chains:t,options:e})=>({id:"apple",isSequenceBased:!0,logoDark:lT({isDarkMode:!0}),logoLight:lT({isDarkMode:!1}),monochromeLogoDark:uT({isDarkMode:!0}),monochromeLogoLight:uT({isDarkMode:!1}),name:"Apple",createConnector:()=>{var r;return new Jd({chains:t,options:Ae({},e,{connect:Ae({},e==null?void 0:e.connect,{settings:Ae({},e==null||(r=e.connect)==null?void 0:r.settings,{signInWith:"apple"})})})})}}),fT=t=>{let e=Ae({},(ns(t),t));return S.createElement(S.Fragment,null,S.createElement("svg",Ae({viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),S.createElement("rect",{width:"28",height:"28",fill:"#2C5FF6"}),S.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14 23.8C19.4124 23.8 23.8 19.4124 23.8 14C23.8 8.58761 19.4124 4.2 14 4.2C8.58761 4.2 4.2 8.58761 4.2 14C4.2 19.4124 8.58761 23.8 14 23.8ZM11.55 10.8C11.1358 10.8 10.8 11.1358 10.8 11.55V16.45C10.8 16.8642 11.1358 17.2 11.55 17.2H16.45C16.8642 17.2 17.2 16.8642 17.2 16.45V11.55C17.2 11.1358 16.8642 10.8 16.45 10.8H11.55Z",fill:"white"})))},G5e=t=>({id:"coinbase-wallet",logoDark:fT,logoLight:fT,name:"Coinbase Wallet",createConnector:()=>new o2e(Ae({},t))}),dT=({isDarkMode:t})=>{const e=t?"white":"black";return n=>{let i=Ae({},(ns(n),n));return S.createElement(S.Fragment,null,S.createElement("svg",Ae({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 35 34",fill:"none"},i),S.createElement("path",{d:"M17.0826 16.3805C17.1802 16.4598 17.32 16.4598 17.4176 16.3805L30.1401 6.04341C30.5283 5.72801 30.3053 5.09985 29.8051 5.09985H4.69499C4.19482 5.09985 3.9718 5.72801 4.35998 6.04341L17.0826 16.3805Z",fill:e}),S.createElement("path",{d:"M19.7626 19.2667L33.3838 8.19943C33.731 7.91735 34.2501 8.16441 34.2501 8.61174V24.2249C34.2501 26.5721 32.3473 28.4749 30.0001 28.4749H4.50006C2.15285 28.4749 0.250061 26.5721 0.250061 24.2249V8.61174C0.250061 8.16441 0.769134 7.91735 1.11631 8.19943L14.7375 19.2667C16.2014 20.4561 18.2987 20.4561 19.7626 19.2667Z",fill:e})))}},a8="@sequence.kit.connector.email",K5e=({chains:t,options:e})=>({id:"email",isSequenceBased:!0,logoDark:dT({isDarkMode:!0}),logoLight:dT({isDarkMode:!1}),name:"Email",createConnector:()=>{var r;const n=localStorage.getItem(a8);return new Jd({chains:t,options:Ae({},e,{connect:Ae({},e==null?void 0:e.connect,{settings:Ae({},e==null||(r=e.connect)==null?void 0:r.settings,{signInOptions:["email"],signInWithEmail:n||""})})})})}}),hT=t=>{let e=Ae({},(ns(t),t));return S.createElement(S.Fragment,null,S.createElement("svg",Ae({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 41 40",fill:"none"},e),S.createElement("path",{d:"M17.4214 36.9716C9.27855 35.5145 3.10712 28.4859 3.10712 20.0001C3.10712 10.5715 10.8214 2.85718 20.25 2.85718C29.6785 2.85718 37.3928 10.5715 37.3928 20.0001C37.3928 28.4859 31.2214 35.5145 23.0785 36.9716L22.1357 36.2002H18.3643L17.4214 36.9716Z",fill:"url(#paint0_linear_193_14528)"}),S.createElement("path",{d:"M26.9357 24.7999L27.7072 19.9999H23.1643V16.657C23.1643 15.2856 23.6786 14.257 25.7357 14.257H27.9643V9.88558C26.7643 9.71415 25.3929 9.54272 24.1929 9.54272C20.25 9.54272 17.5071 11.9427 17.5071 16.2285V19.9999H13.2214V24.7999H17.5071V36.8857C18.45 37.0571 19.3929 37.1429 20.3357 37.1429C21.2786 37.1429 22.2214 37.0571 23.1643 36.8857V24.7999H26.9357Z",fill:"white"}),S.createElement("defs",null,S.createElement("linearGradient",{id:"paint0_linear_193_14528",x1:"20.2508",y1:"35.9507",x2:"20.2508",y2:"2.85086",gradientUnits:"userSpaceOnUse"},S.createElement("stop",{"stop-color":"#0062E0"}),S.createElement("stop",{offset:"1","stop-color":"#19AFFF"})))))},pT=({isDarkMode:t})=>{const e=t?"#FFFFFF":"#000000";return n=>{let i=Ae({},(ns(n),n));return S.createElement(S.Fragment,null,S.createElement("svg",Ae({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 41 40",fill:"none"},i),S.createElement("path",{d:"M25.8582 10.4398C24.1222 10.4398 23.6288 11.2098 23.6288 12.9073V15.709H28.246L27.791 20.2476H23.6279V34H18.1024V20.2468H14.375V15.7081H18.1042V12.9851C18.1042 8.40625 19.9399 6 25.0891 6C26.1942 6 27.5163 6.0875 28.3055 6.19775V10.459",fill:e})))}},Q5e=({chains:t,options:e})=>({id:"facebook",isSequenceBased:!0,logoDark:hT,logoLight:hT,monochromeLogoDark:pT({isDarkMode:!0}),monochromeLogoLight:pT({isDarkMode:!1}),name:"Facebook",createConnector:()=>{var r;return new Jd({chains:t,options:Ae({},e,{connect:Ae({},e==null?void 0:e.connect,{settings:Ae({},e==null||(r=e.connect)==null?void 0:r.settings,{signInWith:"facebook"})})})})}}),vT=t=>{let e=Ae({},(ns(t),t));return S.createElement(S.Fragment,null,S.createElement("svg",Ae({viewBox:"0 0 41 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),S.createElement("g",{id:"Frame 2114"},S.createElement("g",{id:"Group"},S.createElement("path",{id:"Vector",d:"M20.7497 16.8828V23.5218H29.9756C29.5705 25.6568 28.3548 27.4647 26.5314 28.6803L32.095 32.9972C35.3366 30.0051 37.2068 25.6102 37.2068 20.3895C37.2068 19.1739 37.0977 18.005 36.895 16.883L20.7497 16.8828Z",fill:"#4285F4"}),S.createElement("path",{id:"Vector_2",d:"M11.1424 23.2627L9.88756 24.2232L5.44592 27.6829C8.2667 33.2777 14.0481 37.1427 20.7493 37.1427C25.3778 37.1427 29.2583 35.6154 32.0947 32.9973L26.5311 28.6803C25.0038 29.7089 23.0557 30.3324 20.7493 30.3324C16.2922 30.3324 12.5053 27.3246 11.1494 23.2726L11.1424 23.2627Z",fill:"#34A853"}),S.createElement("path",{id:"Vector_3",d:"M5.44594 12.3169C4.27718 14.6233 3.60712 17.2259 3.60712 19.9999C3.60712 22.7739 4.27718 25.3765 5.44594 27.6829C5.44594 27.6984 11.1499 23.2569 11.1499 23.2569C10.8071 22.2284 10.6044 21.1375 10.6044 19.9997C10.6044 18.8619 10.8071 17.7711 11.1499 16.7425L5.44594 12.3169Z",fill:"#FBBC05"}),S.createElement("path",{id:"Vector_4",d:"M20.7497 9.6829C23.2744 9.6829 25.5185 10.5556 27.3107 12.2387L32.2198 7.32972C29.2431 4.55574 25.3783 2.85693 20.7497 2.85693C14.0484 2.85693 8.2667 6.70628 5.44592 12.3167L11.1497 16.7427C12.5055 12.6907 16.2926 9.6829 20.7497 9.6829Z",fill:"#EA4335"})))))},mT=({isDarkMode:t})=>{const e=t?"white":"black";return n=>{let i=Ae({},(ns(n),n));return S.createElement("svg",Ae({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 41 40",fill:"none"},i),S.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M25.8355 14.7613C24.5584 13.5329 22.9441 12.9032 21.1356 12.9032C17.9377 12.9032 15.2302 15.0813 14.2595 18.0232L14.2593 18.023C14.0142 18.7662 13.8712 19.5609 13.8712 20.3866C13.8712 21.2124 14.004 22.0072 14.2594 22.7504L14.2587 22.751H14.2595C15.2302 25.6929 17.9377 27.871 21.1356 27.871C22.7907 27.871 24.1904 27.4168 25.2939 26.6736V26.6732C26.5812 25.7958 27.4497 24.5055 27.746 22.9777H21.1355V18.3223H32.6808C32.8034 19.0758 32.875 19.85 32.875 20.6655C32.875 24.4332 31.5467 27.6126 29.2377 29.77L29.2378 29.7703C27.2148 31.6594 24.446 32.7742 21.1356 32.7742C16.3438 32.7742 12.2059 29.9871 10.1931 25.9407V25.94L10.193 25.9401C9.35521 24.2678 8.875 22.3891 8.875 20.3866C8.875 18.384 9.35521 16.5053 10.193 14.833H10.1934C12.2063 10.7869 16.344 8 21.1356 8C24.446 8 27.2148 9.22839 29.3298 11.231L25.8355 14.7613Z",fill:e}))}},Y5e=({chains:t,options:e})=>({id:"google",isSequenceBased:!0,logoDark:vT,logoLight:vT,monochromeLogoDark:mT({isDarkMode:!0}),monochromeLogoLight:mT({isDarkMode:!1}),name:"Google",createConnector:()=>{var r;return new Jd({chains:t,options:Ae({},e,{connect:Ae({},e==null?void 0:e.connect,{settings:Ae({},e==null||(r=e.connect)==null?void 0:r.settings,{signInWith:"google"})})})})}}),yT=t=>{let e=Ae({},(ns(t),t));return S.createElement(S.Fragment,null,S.createElement("svg",Ae({viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),S.createElement("rect",{width:"28",height:"28"}),S.createElement("path",{d:"M24.0891 3.1199L15.3446 9.61456L16.9617 5.7828L24.0891 3.1199Z",fill:"#E2761B",stroke:"#E2761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M3.90207 3.1199L12.5763 9.67608L11.0383 5.7828L3.90207 3.1199Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M20.9429 18.1745L18.6139 21.7426L23.597 23.1136L25.0295 18.2536L20.9429 18.1745Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M2.97929 18.2536L4.40301 23.1136L9.38607 21.7426L7.05713 18.1745L2.97929 18.2536Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M9.10483 12.1456L7.71626 14.2461L12.6642 14.4658L12.4884 9.14877L9.10483 12.1456Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M18.8864 12.1456L15.4589 9.08725L15.3446 14.4658L20.2837 14.2461L18.8864 12.1456Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M9.38606 21.7426L12.3566 20.2925L9.79033 18.2888L9.38606 21.7426Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M15.6347 20.2925L18.6139 21.7426L18.2009 18.2888L15.6347 20.2925Z",fill:"#E4761B",stroke:"#E4761B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M18.6139 21.7426L15.6347 20.2925L15.8719 22.2348L15.8456 23.0521L18.6139 21.7426Z",fill:"#D7C1B3",stroke:"#D7C1B3",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M9.38606 21.7426L12.1544 23.0521L12.1368 22.2348L12.3566 20.2925L9.38606 21.7426Z",fill:"#D7C1B3",stroke:"#D7C1B3",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M12.1984 17.0056L9.72002 16.2762L11.4689 15.4765L12.1984 17.0056Z",fill:"#233447",stroke:"#233447",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M15.7928 17.0056L16.5223 15.4765L18.28 16.2762L15.7928 17.0056Z",fill:"#233447",stroke:"#233447",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M9.38606 21.7426L9.80791 18.1745L7.05712 18.2536L9.38606 21.7426Z",fill:"#CD6116",stroke:"#CD6116",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M18.1921 18.1745L18.6139 21.7426L20.9429 18.2536L18.1921 18.1745Z",fill:"#CD6116",stroke:"#CD6116",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M20.2837 14.2461L15.3446 14.4658L15.8016 17.0057L16.5311 15.4765L18.2888 16.2762L20.2837 14.2461Z",fill:"#CD6116",stroke:"#CD6116",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M9.72002 16.2762L11.4777 15.4765L12.1984 17.0057L12.6642 14.4658L7.71626 14.2461L9.72002 16.2762Z",fill:"#CD6116",stroke:"#CD6116",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M7.71626 14.2461L9.79033 18.2888L9.72002 16.2762L7.71626 14.2461Z",fill:"#E4751F",stroke:"#E4751F",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M18.2888 16.2762L18.2009 18.2888L20.2837 14.2461L18.2888 16.2762Z",fill:"#E4751F",stroke:"#E4751F",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M12.6642 14.4658L12.1984 17.0057L12.7784 20.0025L12.9102 16.0565L12.6642 14.4658Z",fill:"#E4751F",stroke:"#E4751F",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M15.3446 14.4658L15.1073 16.0477L15.2128 20.0025L15.8016 17.0057L15.3446 14.4658Z",fill:"#E4751F",stroke:"#E4751F",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M15.8016 17.0056L15.2128 20.0025L15.6347 20.2925L18.2009 18.2888L18.2888 16.2762L15.8016 17.0056Z",fill:"#F6851B",stroke:"#F6851B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M9.72002 16.2762L9.79033 18.2888L12.3566 20.2925L12.7784 20.0025L12.1984 17.0056L9.72002 16.2762Z",fill:"#F6851B",stroke:"#F6851B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M15.8456 23.0521L15.8719 22.2348L15.6522 22.0414H12.339L12.1368 22.2348L12.1544 23.0521L9.38606 21.7426L10.3528 22.5336L12.3126 23.8958H15.6786L17.6472 22.5336L18.6139 21.7426L15.8456 23.0521Z",fill:"#C0AD9E",stroke:"#C0AD9E",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M15.6347 20.2925L15.2128 20.0025H12.7784L12.3566 20.2925L12.1368 22.2348L12.339 22.0414H15.6522L15.8719 22.2348L15.6347 20.2925Z",fill:"#161616",stroke:"#161616",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M24.4583 10.0364L25.2053 6.45072L24.0891 3.1199L15.6347 9.39485L18.8864 12.1456L23.4827 13.4903L24.5022 12.3038L24.0628 11.9874L24.7658 11.3459L24.221 10.924L24.924 10.3879L24.4583 10.0364Z",fill:"#763D16",stroke:"#763D16",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M2.79472 6.45072L3.54174 10.0364L3.06717 10.3879L3.77024 10.924L3.23415 11.3459L3.93722 11.9874L3.4978 12.3038L4.50847 13.4903L9.10483 12.1456L12.3566 9.39485L3.90207 3.1199L2.79472 6.45072Z",fill:"#763D16",stroke:"#763D16",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M23.4827 13.4903L18.8864 12.1456L20.2837 14.2461L18.2009 18.2888L20.9429 18.2536H25.0295L23.4827 13.4903Z",fill:"#F6851B",stroke:"#F6851B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M9.10484 12.1456L4.50848 13.4903L2.97929 18.2536H7.05713L9.79033 18.2888L7.71626 14.2461L9.10484 12.1456Z",fill:"#F6851B",stroke:"#F6851B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"}),S.createElement("path",{d:"M15.3446 14.4658L15.6347 9.39485L16.9705 5.7828H11.0383L12.3566 9.39485L12.6642 14.4658L12.7696 16.0653L12.7784 20.0025H15.2128L15.2304 16.0653L15.3446 14.4658Z",fill:"#F6851B",stroke:"#F6851B",strokeWidth:"0.0878845",strokeLinecap:"round",strokeLinejoin:"round"})))},ug=t=>{let e=Ae({},(ns(t),t));return S.createElement(S.Fragment,null,S.createElement("svg",Ae({xmlns:"http://www.w3.org/2000/svg",style:{fill:"none"},id:"svg1316",version:"1.1",viewBox:"0 0 396 396"},e),S.createElement("g",{transform:"translate(0,38)",id:"g1256",clipPath:"url(#clip0_5_131)"},S.createElement("g",{id:"g1254",clipPath:"url(#clip1_5_131)"},S.createElement("path",{style:{fill:"#111111"},id:"path1232",d:"M 0,67.5049 V 250.165 c 0,37.282 30.1402,67.505 67.32,67.505 h 261.36 c 37.18,0 67.32,-30.223 67.32,-67.505 V 67.5049 C 396,30.223 365.86,0 328.68,0 H 67.32 C 30.1402,0 0,30.223 0,67.5049 Z"}),S.createElement("path",{style:{fill:"url(#paint0_linear_5_13"},id:"path1234",d:"M 0,67.5049 V 250.165 c 0,37.282 30.1402,67.505 67.32,67.505 h 261.36 c 37.18,0 67.32,-30.223 67.32,-67.505 V 67.5049 C 396,30.223 365.86,0 328.68,0 H 67.32 C 30.1402,0 0,30.223 0,67.5049 Z"}),S.createElement("path",{style:{fill:"url(#paint1_linear_5_131"},id:"path1236",d:"m 98.9999,79.4176 c 0,-10.9653 -8.8648,-19.8544 -19.8,-19.8544 -10.9352,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.8648,19.8544 19.8,19.8544 10.9352,0 19.8,-8.8892 19.8,-19.8544 z"}),S.createElement("path",{style:{fill:"url(#paint2_linear_5_131)"},id:"path1238",d:"m 98.9999,79.4176 c 0,-10.9653 -8.8648,-19.8544 -19.8,-19.8544 -10.9352,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.8648,19.8544 19.8,19.8544 10.9352,0 19.8,-8.8892 19.8,-19.8544 z"}),S.createElement("path",{style:{fill:"url(#paint3_linear_5_131)"},id:"path1240",d:"m 98.9999,79.4176 c 0,-10.9653 -8.8648,-19.8544 -19.8,-19.8544 -10.9352,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.8648,19.8544 19.8,19.8544 10.9352,0 19.8,-8.8892 19.8,-19.8544 z"}),S.createElement("path",{style:{fill:"url(#paint4_linear_5_131)"},id:"path1242",d:"m 98.9999,238.126 c 0,-10.965 -8.8648,-19.854 -19.8,-19.854 -10.9352,0 -19.8,8.889 -19.8,19.854 0,10.966 8.8648,19.855 19.8,19.855 10.9352,0 19.8,-8.889 19.8,-19.855 z"}),S.createElement("path",{style:{fill:"url(#paint5_linear_5_131)"},id:"path1244",d:"m 336.6,158.835 c 0,-10.965 -8.865,-19.854 -19.8,-19.854 -10.935,0 -19.8,8.889 -19.8,19.854 0,10.965 8.865,19.855 19.8,19.855 10.935,0 19.8,-8.89 19.8,-19.855 z"}),S.createElement("path",{style:{fill:"url(#paint6_linear_5_131)"},id:"path1246",d:"m 336.6,158.835 c 0,-10.965 -8.865,-19.854 -19.8,-19.854 -10.935,0 -19.8,8.889 -19.8,19.854 0,10.965 8.865,19.855 19.8,19.855 10.935,0 19.8,-8.89 19.8,-19.855 z"}),S.createElement("path",{style:{fill:"url(#paint7_linear_5_131)"},id:"path1248",d:"M 316.8,59.5632 H 158.4 c -10.935,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.865,19.8544 19.8,19.8544 h 158.4 c 10.935,0 19.8,-8.8892 19.8,-19.8544 0,-10.9653 -8.865,-19.8544 -19.8,-19.8544 z"}),S.createElement("path",{style:{fill:"url(#paint8_linear_5_131)"},id:"path1250",d:"M 316.8,218.272 H 158.4 c -10.935,0 -19.8,8.889 -19.8,19.854 0,10.966 8.865,19.855 19.8,19.855 h 158.4 c 10.935,0 19.8,-8.889 19.8,-19.855 0,-10.965 -8.865,-19.854 -19.8,-19.854 z"}),S.createElement("path",{style:{fill:"url(#paint9_linear_5_131)"},id:"path1252",d:"M 237.6,138.981 H 79.2 c -10.9352,0 -19.8,8.889 -19.8,19.854 0,10.965 8.8648,19.855 19.8,19.855 h 158.4 c 10.935,0 19.8,-8.89 19.8,-19.855 0,-10.965 -8.865,-19.854 -19.8,-19.854 z"}))),S.createElement("defs",{id:"defs1314"},S.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"318",x2:"198",y1:"4.0585401e-05",x1:"198",id:"paint0_linear_5_131"},S.createElement("stop",{id:"stop1258",stopColor:"#1D273D"}),S.createElement("stop",{id:"stop1260",stopColor:"#0D0F13",offset:"1"})),S.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"63",x2:"92.5",y1:"99",x1:"65.5",id:"paint1_linear_5_131"},S.createElement("stop",{id:"stop1263",stopColor:"#4462FE"}),S.createElement("stop",{id:"stop1265",stopColor:"#7D69FA",offset:"1"})),S.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"97.591103",x2:"96.137703",y1:"99.291199",x1:"62.879902",id:"paint2_linear_5_131"},S.createElement("stop",{id:"stop1268",stopColor:"#3757FD"}),S.createElement("stop",{id:"stop1270",stopColor:"#6980FA",offset:"1"})),S.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"97.591103",x2:"96.137703",y1:"99.291199",x1:"62.879902",id:"paint3_linear_5_131"},S.createElement("stop",{id:"stop1273",stopColor:"#2447FF"}),S.createElement("stop",{id:"stop1275",stopColor:"#6980FA",offset:"1"})),S.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"223.5",x2:"91.5",y1:"251.5",x1:"65",id:"paint4_linear_5_131"},S.createElement("stop",{id:"stop1278",stopColor:"#BC3EE6"}),S.createElement("stop",{id:"stop1280",stopColor:"#D972F1",offset:"1"})),S.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"146",x2:"329.5",y1:"172",x1:"305",id:"paint5_linear_5_131"},S.createElement("stop",{id:"stop1283",stopColor:"#29BDFF"}),S.createElement("stop",{id:"stop1285",stopColor:"#96E7FB",offset:"1"})),S.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"176.772",x2:"334.56699",y1:"178.418",x1:"300.17999",id:"paint6_linear_5_131"},S.createElement("stop",{id:"stop1288",stopColor:"#23BBFF"}),S.createElement("stop",{id:"stop1290",stopColor:"#85E7FF",offset:"1"})),S.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"60",x2:"317.5",y1:"99",x1:"154.5",id:"paint7_linear_5_131"},S.createElement("stop",{id:"stop1293",stopColor:"#23BBFF"}),S.createElement("stop",{id:"stop1295",stopColor:"#85E7FF",offset:"1"})),S.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"218",x2:"312.5",y1:"258",x1:"156",id:"paint8_linear_5_131"},S.createElement("stop",{id:"stop1298",stopColor:"#2447FF"}),S.createElement("stop",{id:"stop1300",stopColor:"#6980FA",offset:"1"})),S.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"139",x2:"235.5",y1:"179",x1:"86.000099",id:"paint9_linear_5_131"},S.createElement("stop",{id:"stop1303",stopColor:"#6634FF"}),S.createElement("stop",{id:"stop1305",stopColor:"#9C6DFF",offset:"1"})),S.createElement("clipPath",{id:"clip0_5_131"},S.createElement("rect",{style:{fill:"#ffffff"},y:"0",x:"0",id:"rect1308",height:"317.67001",width:"396"})),S.createElement("clipPath",{id:"clip1_5_131"},S.createElement("rect",{style:{fill:"#ffffff"},y:"0",x:"0",id:"rect1311",height:"317.67001",width:"396"})))))};window.ethereum=window.ethereum||{};const J5e=({chains:t})=>({id:"metamask",logoDark:yT,logoLight:yT,name:"Metamask",createConnector:()=>new a2e({chains:t,options:{shimDisconnect:!0}})}),X5e=({chains:t,options:e})=>({id:"mock",isSequenceBased:!0,logoDark:ug,logoLight:ug,name:"Mock",createConnector:()=>{var r;return new l2e({chains:t,options:Ae({chainId:(e==null||(r=e.chain)==null?void 0:r.id)||137,walletClient:Cp({account:e.account,chain:(e==null?void 0:e.chain)||hme,transport:e.transport})},e)})}}),Z5e=({chains:t,options:e})=>({id:"sequence",isSequenceBased:!0,logoDark:ug,logoLight:ug,name:"Sequence",createConnector:()=>new Jd({chains:t,options:e})}),kv=({isDarkMode:t})=>{let e;return t===void 0?e="#9146FF":e=t?"white":"black",n=>(Ae({},(ns(n),n)),S.createElement(S.Fragment,null,S.createElement("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 2400 2800",transform:"scale(0.80)"},S.createElement("g",null,S.createElement("g",{id:"Layer_1-2"},S.createElement("path",{fill:e,d:"M500,0L0,500v1800h600v500l500-500h400l900-900V0H500z M2200,1300l-400,400h-400l-350,350v-350H600V200h1600 V1300z"}),S.createElement("rect",{x:"1700",y:"550",fill:e,width:"200",height:"600"}),S.createElement("rect",{x:"1150",y:"550",fill:e,width:"200",height:"600"}))))))},e6e=({chains:t,options:e})=>({id:"twitch",isSequenceBased:!0,logoDark:kv({}),logoLight:kv({}),monochromeLogoDark:kv({isDarkMode:!0}),monochromeLogoLight:kv({isDarkMode:!1}),name:"Twitch",createConnector:()=>{var r;return new Jd({chains:t,options:Ae({},e,{connect:Ae({},e==null?void 0:e.connect,{settings:Ae({},e==null||(r=e.connect)==null?void 0:r.settings,{signInWith:"twitch"})})})})}}),gT=t=>{let e=Ae({},(ns(t),t));return S.createElement(S.Fragment,null,S.createElement("svg",Ae({fill:"none",viewBox:"0 0 480 332",xmlns:"http://www.w3.org/2000/svg"},e),S.createElement("path",{d:"m126.613 93.9842c62.622-61.3123 164.152-61.3123 226.775 0l7.536 7.3788c3.131 3.066 3.131 8.036 0 11.102l-25.781 25.242c-1.566 1.533-4.104 1.533-5.67 0l-10.371-10.154c-43.687-42.7734-114.517-42.7734-158.204 0l-11.107 10.874c-1.565 1.533-4.103 1.533-5.669 0l-25.781-25.242c-3.132-3.066-3.132-8.036 0-11.102zm280.093 52.2038 22.946 22.465c3.131 3.066 3.131 8.036 0 11.102l-103.463 101.301c-3.131 3.065-8.208 3.065-11.339 0l-73.432-71.896c-.783-.767-2.052-.767-2.835 0l-73.43 71.896c-3.131 3.065-8.208 3.065-11.339 0l-103.4657-101.302c-3.1311-3.066-3.1311-8.036 0-11.102l22.9456-22.466c3.1311-3.065 8.2077-3.065 11.3388 0l73.4333 71.897c.782.767 2.051.767 2.834 0l73.429-71.897c3.131-3.065 8.208-3.065 11.339 0l73.433 71.897c.783.767 2.052.767 2.835 0l73.431-71.895c3.132-3.066 8.208-3.066 11.339 0z",fill:"#3396ff"})))},t6e=({chains:t,options:e})=>({id:"wallet-connect",logoDark:gT,logoLight:gT,name:"Walletconnect",createConnector:()=>new q5e({chains:t,options:e})}),r6e=({chains:t,walletConnectProjectId:e,defaultChainId:r,projectAccessKey:n,appName:i})=>{let s=t[0].id;if(r){const a=t.find(c=>c.id===r);a&&(s=a.id)}return KW([G5e({chains:t,options:{appName:i}}),K5e({chains:t,options:{defaultNetwork:s,projectAccessKey:n,connect:{app:i,projectAccessKey:n}}}),Y5e({chains:t,options:{defaultNetwork:s,projectAccessKey:n,connect:{app:i,projectAccessKey:n}}}),Q5e({chains:t,options:{defaultNetwork:s,projectAccessKey:n,connect:{app:i,projectAccessKey:n}}}),e6e({chains:t,options:{defaultNetwork:s,projectAccessKey:n,connect:{app:i,projectAccessKey:n}}}),V5e({chains:t,options:{defaultNetwork:s,projectAccessKey:n,connect:{app:i,projectAccessKey:n}}}),J5e({chains:t}),t6e({chains:t,options:{projectId:e}}),Z5e({chains:t,options:{defaultNetwork:s,projectAccessKey:n,connect:{app:i,projectAccessKey:n}}})])};function BS(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function Av(){}function bT(){return typeof WeakMap<"u"?new WeakMap:n6e()}function n6e(){return{add:Av,delete:Av,get:Av,set:Av,has:function(t){return!1}}}var i6e=Object.prototype.hasOwnProperty,c8=function(t,e){return i6e.call(t,e)};function Mx(t,e){for(var r in e)c8(e,r)&&(t[r]=e[r]);return t}var s6e=/^[ \t]*(?:\r\n|\r|\n)/,o6e=/(?:\r\n|\r|\n)[ \t]*$/,a6e=/^(?:[\r\n]|$)/,c6e=/(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/,l6e=/^[ \t]*[\r\n][ \t\r\n]*$/;function wT(t,e,r){var n=0,i=t[0].match(c6e);i&&(n=i[1].length);var s="(\\r\\n|\\r|\\n).{0,"+n+"}",o=new RegExp(s,"g");e&&(t=t.slice(1));var a=r.newline,c=r.trimLeadingNewline,l=r.trimTrailingNewline,u=typeof a=="string",f=t.length,d=t.map(function(h,p){return h=h.replace(o,"$1"),p===0&&c&&(h=h.replace(s6e,"")),p===f-1&&l&&(h=h.replace(o6e,"")),u&&(h=h.replace(/\r\n|\n|\r/g,function(v){return a})),h});return d}function u6e(t,e){for(var r="",n=0,i=t.length;n{},registerClassName:()=>{},onEndFileScope:()=>{},registerComposition:()=>{},markCompositionUsed:()=>{},getIdentOption:()=>"short"},xm=[d6e],Cu=()=>{if(xm.length<1)throw new Error("No adapter configured");return xm[xm.length-1]},OW=!1,h6e=t=>{OW||p6e(t)},p6e=t=>{if(!t)throw new Error('No adapter provided when calling "setAdapter"');OW=!0,xm.push(t)},S2=function(){return Cu().appendCss(...arguments)},RW=function(){return Cu().registerClassName(...arguments)},v6e=function(){return Cu().registerComposition(...arguments)},$W=function(){return Cu().markCompositionUsed(...arguments)},m6e=function(){for(var e,r,n=arguments.length,i=new Array(n),s=0;s{var{fileScope:e,css:r}=t,n=e.packageName?[e.packageName,e.filePath].join("/"):e.filePath,i=ET[n];if(!i){var s=document.createElement("style");e.packageName&&s.setAttribute("data-package",e.packageName),s.setAttribute("data-file",e.filePath),s.setAttribute("type","text/css"),i=ET[n]=s,document.head.appendChild(s)}i.innerHTML=r};function x6e(t){var e=t.match(/^var\((.*)\)$/);return e?e[1]:t}/*! https://mths.be/cssesc v3.0.0 by @mathias */var E6e={},C6e=E6e.hasOwnProperty,S6e=function(e,r){if(!e)return r;var n={};for(var i in r)n[i]=C6e.call(e,i)?e[i]:r[i];return n},k6e=/[ -,\.\/:-@\[-\^`\{-~]/,A6e=/[ -,\.\/:-@\[\]\^`\{-~]/,_6e=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g,jS=function t(e,r){r=S6e(r,t.options),r.quotes!="single"&&r.quotes!="double"&&(r.quotes="single");for(var n=r.quotes=="double"?'"':"'",i=r.isIdentifier,s=e.charAt(0),o="",a=0,c=e.length;a126){if(u>=55296&&u<=56319&&a0;){const a=o.shift();if(a!==void 0)for(const c in r[a]){const l=r[a][c];o.push(l);let u=s[a];for(;u>0&&!(c in r[u]);)u=s[u];if(c in r[u]){const f=r[u][c];s[l]=f,n[l]=[...n[l],...n[f]]}else s[l]=0}}return{gotoFn:r,output:n,failure:s}}search(e){let r=0;const n=[];for(let i=0;i0&&!(s in this.gotoFn[r]);)r=this.failure[r];if(s in this.gotoFn[r]&&(r=this.gotoFn[r][s],this.output[r].length>0)){const o=this.output[r];n.push([i,o])}}return n}}var sr;(function(t){t.Attribute="attribute",t.Pseudo="pseudo",t.PseudoElement="pseudo-element",t.Tag="tag",t.Universal="universal",t.Adjacent="adjacent",t.Child="child",t.Descendant="descendant",t.Parent="parent",t.Sibling="sibling",t.ColumnCombinator="column-combinator"})(sr||(sr={}));var Fi;(function(t){t.Any="any",t.Element="element",t.End="end",t.Equals="equals",t.Exists="exists",t.Hyphen="hyphen",t.Not="not",t.Start="start"})(Fi||(Fi={}));const CT=/^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,I6e=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,O6e=new Map([[126,Fi.Element],[94,Fi.Start],[36,Fi.End],[42,Fi.Any],[33,Fi.Not],[124,Fi.Hyphen]]),R6e=new Set(["has","not","matches","is","where","host","host-context"]);function $6e(t){switch(t.type){case sr.Adjacent:case sr.Child:case sr.Descendant:case sr.Parent:case sr.Sibling:case sr.ColumnCombinator:return!0;default:return!1}}const M6e=new Set(["contains","icontains"]);function N6e(t,e,r){const n=parseInt(e,16)-65536;return n!==n||r?e:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,n&1023|56320)}function Th(t){return t.replace(I6e,N6e)}function Nx(t){return t===39||t===34}function ST(t){return t===32||t===9||t===10||t===12||t===13}function D6e(t){const e=[],r=MW(e,`${t}`,0);if(r0&&r0&&$6e(n[n.length-1]))throw new Error("Did not expect successive traversals.")}function l(d){if(n.length>0&&n[n.length-1].type===sr.Descendant){n[n.length-1].type=d;return}c(),n.push({type:d})}function u(d,h){n.push({type:sr.Attribute,name:d,action:h,value:i(1),namespace:null,ignoreCase:"quirks"})}function f(){if(n.length&&n[n.length-1].type===sr.Descendant&&n.pop(),n.length===0)throw new Error("Empty sub-selector");t.push(n)}if(s(0),e.length===r)return r;e:for(;r=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Fr(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}var B6e=/(\u000D|\u000C|\u000D\u000A)/g,F6e=/[\u0000\uD800-\uDFFF]/g,j6e=/(\/\*)[\s\S]*?(\*\/)/g,U6e=function(e,r){r===void 0&&(r=0),e=e.replace(B6e,` -`).replace(F6e,"�"),e=e.replace(j6e,"");for(var n=[];r"})}else if(i===34){var o=kT(e,r);if(o===null)return null;var a=Fr(o,2),c=a[0],l=a[1];n.push({type:"",value:l}),r=c}else if(i===35){if(r+1=65&&u<=90||u>=97&&u<=122||u>=128||u>=48&&u<=57||u===92&&r+2",value:l.toLowerCase(),flag:f}),r=c;continue}}}n.push({type:"",value:i})}else if(i===39){var o=kT(e,r);if(o===null)return null;var h=Fr(o,2),c=h[0],l=h[1];n.push({type:"",value:l}),r=c}else if(i===40)n.push({type:"<(-token>"});else if(i===41)n.push({type:"<)-token>"});else if(i===43){var p=_v(e,r);if(p===null)n.push({type:"",value:i});else{var v=Fr(p,2),c=v[0],m=v[1];m[0]===""?n.push({type:"",value:m[1],unit:m[2].toLowerCase(),flag:"number"}):m[0]===""?n.push({type:m[0],value:m[1],flag:m[2]}):n.push({type:m[0],value:m[1],flag:"number"}),r=c}}else if(i===44)n.push({type:""});else if(i===45){var g=_v(e,r);if(g!==null){var y=Fr(g,2),c=y[0],m=y[1];m[0]===""?n.push({type:"",value:m[1],unit:m[2].toLowerCase(),flag:"number"}):m[0]===""?n.push({type:m[0],value:m[1],flag:m[2]}):n.push({type:m[0],value:m[1],flag:"number"}),r=c;continue}if(r+2"}),r+=2;continue}}var o=AT(e,r);if(o!==null){var C=Fr(o,3),c=C[0],l=C[1],A=C[2];n.push({type:A,value:l}),r=c;continue}n.push({type:"",value:i})}else if(i===46){var g=_v(e,r);if(g===null)n.push({type:"",value:i});else{var O=Fr(g,2),c=O[0],m=O[1];m[0]===""?n.push({type:"",value:m[1],unit:m[2].toLowerCase(),flag:"number"}):m[0]===""?n.push({type:m[0],value:m[1],flag:m[2]}):n.push({type:m[0],value:m[1],flag:"number"}),r=c;continue}}else if(i===58)n.push({type:""});else if(i===59)n.push({type:""});else if(i===60){if(r+3"}),r+=3;continue}}n.push({type:"",value:i})}else if(i===64){var o=zS(e,r+1);if(o!==null){var I=Fr(o,2),c=I[0],l=I[1];n.push({type:"",value:l.toLowerCase()}),r=c;continue}n.push({type:"",value:i})}else if(i===91)n.push({type:"<[-token>"});else if(i===92){var o=_p(e,r);if(o===null)return null;var B=Fr(o,2),c=B[0],l=B[1];e=e.slice(0,r)+l+e.slice(c+1),r-=1}else if(i===93)n.push({type:"<]-token>"});else if(i===123)n.push({type:"<{-token>"});else if(i===125)n.push({type:"<}-token>"});else if(i>=48&&i<=57){var o=_v(e,r),z=Fr(o,2),c=z[0],m=z[1];m[0]===""?n.push({type:"",value:m[1],unit:m[2].toLowerCase(),flag:"number"}):m[0]===""?n.push({type:m[0],value:m[1],flag:m[2]}):n.push({type:m[0],value:m[1],flag:"number"}),r=c}else if(i===95||i>=65&&i<=90||i>=97&&i<=122||i>=128){var o=AT(e,r);if(o===null)return null;var H=Fr(o,3),c=H[0],l=H[1],A=H[2];n.push({type:A,value:l}),r=c}else n.push({type:"",value:i})}return n.push({type:""}),n},kT=function(e,r){if(e.length<=r+1)return null;for(var n=e.charCodeAt(r),i=[],s=r+1;s=65&&i<=90||i>=97&&i<=122||i>=128)return!0;if(i===92){if(e.length<=r+2)return!1;var s=e.charCodeAt(r+2);return s!==10}else return!1}else{if(n===95||n>=65&&n<=90||n>=97&&n<=122||n>=128)return!0;if(n===92){if(e.length<=r+1)return!1;var i=e.charCodeAt(r+1);return i!==10}else return!1}},_p=function(e,r){if(e.length<=r+1||e.charCodeAt(r)!==92)return null;var n=e.charCodeAt(r+1);if(n===10)return null;if(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102){for(var i=[n],s=Math.min(r+7,e.length),o=r+2;o=48&&a<=57||a>=65&&a<=70||a>=97&&a<=102)i.push(a);else break}if(o",o,f]]}return s+1",o]]:[s,["",o,a]]},z6e=function(e,r){if(e.length<=r)return null;var n="integer",i=[],s=e.charCodeAt(r);for((s===43||s===45)&&(r+=1,s===45&&i.push(45));r=48&&o<=57)i.push(o),r+=1;else break}if(r+1=48&&c<=57)for(i.push(a,c),n="number",r+=2;r=48&&o<=57)i.push(o),r+=1;else break}}if(r+1=48&&c<=57;if(u||(c===43||c===45)&&l>=48&&l<=57)for(n="number",u?(i.push(69,c),r+=2):c===45?(i.push(69,45,l),r+=3):(i.push(69,l),r+=3);r=48&&o<=57)i.push(o),r+=1;else break}}}var f=String.fromCharCode.apply(null,i),d=n==="number"?parseFloat(f):parseInt(f);return d===-0&&(d=0),Number.isNaN(d)?null:[r-1,d,n]},W6e=function(e,r){if(e.length<=r)return null;for(var n=[],i=e.charCodeAt(r);r=65&&i<=90||i>=97&&i<=122||i>=128||i>=48&&i<=57){n.push(i);continue}else{var s=_p(e,r);if(s!==null){var o=Fr(s,2),a=o[0],c=o[1];n.push(c),r=a;continue}}break}return r===0?null:[r-1,String.fromCharCode.apply(null,n)]},zS=function(e,r){if(e.length<=r||!NW(e,r))return null;for(var n=[],i=e.charCodeAt(r);r=65&&i<=90||i>=97&&i<=122||i>=128||i>=48&&i<=57){n.push(i);continue}else{var s=_p(e,r);if(s!==null){var o=Fr(s,2),a=o[0],c=o[1];n.push(c),r=a;continue}}break}return[r-1,String.fromCharCode.apply(null,n)]},H6e=function(e,r){for(var n=e.charCodeAt(r);n===9||n===32||n===10;)n=e.charCodeAt(++r);for(var i=[],s=!1;rs+1){var a=e.charCodeAt(s+1);if(a===40){for(var c=2;s+c"];if(l!==9&&l!==32&&l!==10){var u=H6e(e,s+c);if(u===null)return null;var f=Fr(u,2),d=f[0],h=f[1];return[d,h,""]}}return[s+1,o.toLowerCase(),""]}}}else if(e.length>s+1){var a=e.charCodeAt(s+1);if(a===40)return[s+1,o.toLowerCase(),""]}return[s,o.toLowerCase(),""]},q6e=function(e){for(var r=e.length-1;r>=0;r--)e[r]=V6e(e[r]);return e},V6e=function(e){if(e.mediaCondition===null)return e;var r=G6e(e.mediaCondition);return r.operator===null&&r.children.length===1&&"children"in r.children[0]&&(r=r.children[0]),{mediaPrefix:e.mediaPrefix,mediaType:e.mediaType,mediaCondition:r}},G6e=function t(e){for(var r=e.children.length-1;r>=0;r--){var n=e.children[r];if(!("context"in n)){var i=t(n);if(i.operator===null&&i.children.length===1)e.children[r]=i.children[0];else if(i.operator===e.operator&&(i.operator==="and"||i.operator==="or")){for(var s=[r,1],o=0;o"&&r[0].value==="media"){if(r[1].type!=="")throw Kn("Expected whitespace after media");n=2;for(var s=2;s"){i=s;break}else if(o.type==="")throw Kn("Expected '{' in media query but found ';'")}}return r=r.slice(n,i),J6e(r)},Y6e=function(e){for(var r=[],n=!1,i=0;i"?(n=!0,r.length>0&&(r[r.length-1].wsAfter=!0)):(r.push(dg(dg({},e[i]),{wsBefore:n,wsAfter:!1})),n=!1);return r},J6e=function(e){for(var r,n,i=[[]],s=0;s"?i.push([]):i[i.length-1].push(o)}var a=i.map(Y6e);if(a.length===1&&a[0].length===0)return[{mediaCondition:null,mediaPrefix:null,mediaType:"all"}];var c=a.map(function(h){return h.length===0?null:X6e(h)}),l=[];try{for(var u=L6e(c),f=u.next();!f.done;f=u.next()){var d=f.value;d!==null&&l.push(d)}}catch(h){r={error:h}}finally{try{f&&!f.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}if(l.length===0)throw Kn("No valid media queries");return l},X6e=function(e){var r=e[0];if(r.type==="<(-token>")try{return{mediaPrefix:null,mediaType:"all",mediaCondition:Dx(e,!0)}}catch(f){throw Kn("Expected media condition after '('",f)}else if(r.type===""){var n=null,i=void 0,s=r.value;(s==="only"||s==="not")&&(n=s);var o=n===null?0:1;if(e.length<=o)throw Kn("Expected extra token in media query");var a=e[o];if(a.type===""){var c=a.value;if(c==="all")i="all";else if(c==="print"||c==="screen")i=c;else if(c==="tty"||c==="tv"||c==="projection"||c==="handheld"||c==="braille"||c==="embossed"||c==="aural"||c==="speech")n=n==="not"?null:"not",i="all";else throw Kn("Unknown ident '".concat(c,"' in media query"))}else if(n==="not"&&a.type==="<(-token>"){var l=[{type:"<(-token>",wsBefore:!1,wsAfter:!1}];l.push.apply(l,e),l.push({type:"<)-token>",wsBefore:!1,wsAfter:!1});try{return{mediaPrefix:null,mediaType:"all",mediaCondition:Dx(l,!0)}}catch(f){throw Kn("Expected media condition after '('",f)}}else throw Kn("Invalid media query");if(o+1===e.length)return{mediaPrefix:n,mediaType:i,mediaCondition:null};if(o+4"&&u.value==="and")try{return{mediaPrefix:n,mediaType:i,mediaCondition:Dx(e.slice(o+2),!1)}}catch(f){throw Kn("Expected media condition after 'and'",f)}else throw Kn("Expected 'and' after media prefix")}else throw Kn("Expected media condition after media prefix")}else throw Kn("Expected media condition or media prefix")},Dx=function t(e,r,n){if(n===void 0&&(n=null),e.length<3||e[0].type!=="<(-token>"||e[e.length-1].type!=="<)-token>")throw new Error("Invalid media condition");for(var i=e.length-1,s=0,o=0,a=0;a"?(o+=1,s=Math.max(s,o)):c.type==="<)-token>"&&(o-=1),o===0){i=a;break}}if(o!==0)throw new Error(`Mismatched parens -Invalid media condition`);var l,u=e.slice(0,i+1);if(s===1?l=Z6e(u):u[1].type===""&&u[1].value==="not"?l=t(u.slice(2,-1),!0,"not"):l=t(u.slice(1,-1),!0),i===e.length-1)return{operator:n,children:[l]};var f=e[i+1];if(f.type!=="")throw new Error(`Invalid operator -Invalid media condition`);if(n!==null&&n!==f.value)throw new Error("'".concat(f.value,"' and '").concat(n,`' must not be at same level -Invalid media condition`));if(f.value==="or"&&!r)throw new Error(`Cannot use 'or' at top level of a media query -Invalid media condition`);if(f.value!=="and"&&f.value!=="or")throw new Error("Invalid operator: '".concat(f.value,`' -Invalid media condition`));var d=t(e.slice(i+2),r,f.value);return{operator:f.value,children:[l].concat(d.children)}},Z6e=function(e){if(e.length<3||e[0].type!=="<(-token>"||e[e.length-1].type!=="<)-token>")throw new Error("Invalid media feature");for(var r=[e[0]],n=1;n"&&i.value>0&&s.type===""&&s.value===47&&o.type===""&&o.value>0){r.push({type:"",numerator:i.value,denominator:o.value,wsBefore:i.wsBefore,wsAfter:o.wsAfter}),n+=2;continue}}r.push(e[n])}var a=r[1];if(a.type===""&&r.length===3)return{context:"boolean",feature:a.value};if(r.length===5&&r[1].type===""&&r[2].type===""){var c=r[3];if(c.type===""||c.type===""||c.type===""||c.type===""){var l=r[1].value,u=null,f=l.slice(0,4);f==="min-"?(u="min",l=l.slice(4)):f==="max-"&&(u="max",l=l.slice(4)),c.wsBefore,c.wsAfter;var d=l8(c,["wsBefore","wsAfter"]);return{context:"value",prefix:u,feature:l,value:d}}}else if(r.length>=5)try{var h=e3e(r);return{context:"range",feature:h.featureName,range:h}}catch(p){throw Kn("Invalid media feature",p)}throw new Error("Invalid media feature")},e3e=function(e){var r,n,i,s;if(e.length<5||e[0].type!=="<(-token>"||e[e.length-1].type!=="<)-token>")throw new Error("Invalid range");var o={leftToken:null,leftOp:null,featureName:"",rightOp:null,rightToken:null},a=e[1].type===""||e[1].type===""||e[1].type===""||e[1].type===""&&e[1].value==="infinite";if(e[2].type===""){if(e[2].value===60)e[3].type===""&&e[3].value===61&&!e[3].wsBefore?o[a?"leftOp":"rightOp"]="<=":o[a?"leftOp":"rightOp"]="<";else if(e[2].value===62)e[3].type===""&&e[3].value===61&&!e[3].wsBefore?o[a?"leftOp":"rightOp"]=">=":o[a?"leftOp":"rightOp"]=">";else if(e[2].value===61)o[a?"leftOp":"rightOp"]="=";else throw new Error("Invalid range");if(a)o.leftToken=e[1];else if(e[1].type==="")o.featureName=e[1].value;else throw new Error("Invalid range");var c=2+((n=(r=o[a?"leftOp":"rightOp"])===null||r===void 0?void 0:r.length)!==null&&n!==void 0?n:0),l=e[c];if(a)if(l.type===""){if(o.featureName=l.value,e.length>=7){var u=e[c+1],f=e[c+2];if(u.type===""){var d=u.value;if(d===60)f.type===""&&f.value===61&&!f.wsBefore?o.rightOp="<=":o.rightOp="<";else if(d===62)f.type===""&&f.value===61&&!f.wsBefore?o.rightOp=">=":o.rightOp=">";else throw new Error("Invalid range");var h=e[c+1+((s=(i=o.rightOp)===null||i===void 0?void 0:i.length)!==null&&s!==void 0?s:0)];o.rightToken=h}else throw new Error("Invalid range")}else if(c+2!==e.length)throw new Error("Invalid range")}else throw new Error("Invalid range");else o.rightToken=l;var p=null,v=o.leftToken,m=o.leftOp,g=o.featureName,y=o.rightOp,b=o.rightToken,C=null;if(v!==null){if(v.type===""){var A=v.type,O=v.value;O==="infinite"&&(C={type:A,value:O})}else if(v.type===""||v.type===""||v.type===""){v.wsBefore,v.wsAfter;var w=l8(v,["wsBefore","wsAfter"]);C=w}}var I=null;if(b!==null){if(b.type===""){var A=b.type,O=b.value;O==="infinite"&&(I={type:A,value:O})}else if(b.type===""||b.type===""||b.type===""){b.wsBefore,b.wsAfter;var B=l8(b,["wsBefore","wsAfter"]);I=B}}if(C!==null&&I!==null)if((m==="<"||m==="<=")&&(y==="<"||y==="<="))p={leftToken:C,leftOp:m,featureName:g,rightOp:y,rightToken:I};else if((m===">"||m===">=")&&(y===">"||y===">="))p={leftToken:C,leftOp:m,featureName:g,rightOp:y,rightToken:I};else throw new Error("Invalid range");else C===null&&m===null&&y!==null&&I!==null?p={leftToken:C,leftOp:m,featureName:g,rightOp:y,rightToken:I}:C!==null&&m!==null&&y===null&&I===null&&(p={leftToken:C,leftOp:m,featureName:g,rightOp:y,rightToken:I});return p}else throw new Error("Invalid range")};function t3e(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function r3e(t){var e=t3e(t,"string");return typeof e=="symbol"?e:String(e)}function n3e(t,e,r){return e=r3e(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _T(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function k0(t){for(var e=1;e=0)&&(r[i]=t[i]);return r}function PT(t,e){if(t==null)return{};var r=i3e(t,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Ih(t,e){for(var r in t)e(t[r],r)}function Fu(t,e){var r={};for(var n in t)e.indexOf(n)===-1&&(r[n]=t[n]);return r}function s3e(t,e){var r={};for(var n in t)r[e(t[n],n)]=t[n];return r}function u8(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n{var r=()=>{var i=new RegExp(".".concat(a3e(US(e,{isIdentifier:!0}))),"g");return t.replace(i,"&")},n;try{n=D6e(t)}catch{throw new Error("Invalid selector: ".concat(r()))}n.forEach(i=>{try{for(var s=i.length-1;s>=-1;s--){if(!i[s])throw new Error;var o=i[s];if(o.type==="child"||o.type==="parent"||o.type==="sibling"||o.type==="adjacent"||o.type==="descendant")throw new Error;if(o.type==="attribute"&&o.name==="class"&&o.value===e)return}}catch{throw new Error(Qs(TT||(TT=BS([` - Invalid selector: `,` - - Style selectors must target the '&' character (along with any modifiers), e.g. `," or ",`. - - This is to ensure that each style block only affects the styling of a single class. - - If your selector is targeting another class, you should move it to the style definition for that class, e.g. given we have styles for 'parent' and 'child' elements, instead of adding a selector of `,") to 'parent', you should add ",` to 'child'). - - If your selector is targeting something global, use the 'globalStyle' function instead, e.g. if you wanted to write `,", you should instead write 'globalStyle(",`, { ... })' - `])),r(),"`${parent} &`","`${parent} &:hover`","`& ${child}`","`${parent} &`","`& h1`","`${parent} h1`"))}})};class hg{constructor(){this.ruleset=new Map,this.precedenceLookup=new Map}findOrCreateCondition(e){var r=this.ruleset.get(e);return r||(r={query:e,rules:[],children:new hg},this.ruleset.set(e,r)),r}getConditionalRulesetByPath(e){var r=this;for(var n of e){var i=r.findOrCreateCondition(n);r=i.children}return r}addRule(e,r,n){var i=this.getConditionalRulesetByPath(n),s=i.findOrCreateCondition(r);if(!s)throw new Error("Failed to add conditional rule");s.rules.push(e)}addConditionPrecedence(e,r){for(var n=this.getConditionalRulesetByPath(e),i=0;ia.has(u.query));l>-1?r.splice(l,0,c):r.push(c)};for(var[i,s]of this.precedenceLookup.entries())n(s);return r}renderToArray(){var e=[];for(var{query:r,rules:n,children:i}of this.getSortedRuleset()){var s={};for(var o of n)s[o.selector]=o.rule;Object.assign(s,...i.renderToArray()),e.push({[r]:s})}return e}}var DW={":-moz-any-link":!0,":-moz-full-screen":!0,":-moz-placeholder":!0,":-moz-read-only":!0,":-moz-read-write":!0,":-ms-fullscreen":!0,":-ms-input-placeholder":!0,":-webkit-any-link":!0,":-webkit-full-screen":!0,"::-moz-color-swatch":!0,"::-moz-list-bullet":!0,"::-moz-list-number":!0,"::-moz-page-sequence":!0,"::-moz-page":!0,"::-moz-placeholder":!0,"::-moz-progress-bar":!0,"::-moz-range-progress":!0,"::-moz-range-thumb":!0,"::-moz-range-track":!0,"::-moz-scrolled-page-sequence":!0,"::-moz-selection":!0,"::-ms-backdrop":!0,"::-ms-browse":!0,"::-ms-check":!0,"::-ms-clear":!0,"::-ms-fill-lower":!0,"::-ms-fill-upper":!0,"::-ms-fill":!0,"::-ms-reveal":!0,"::-ms-thumb":!0,"::-ms-ticks-after":!0,"::-ms-ticks-before":!0,"::-ms-tooltip":!0,"::-ms-track":!0,"::-ms-value":!0,"::-webkit-backdrop":!0,"::-webkit-inner-spin-button":!0,"::-webkit-input-placeholder":!0,"::-webkit-meter-bar":!0,"::-webkit-meter-even-less-good-value":!0,"::-webkit-meter-inner-element":!0,"::-webkit-meter-optimum-value":!0,"::-webkit-meter-suboptimum-value":!0,"::-webkit-outer-spin-button":!0,"::-webkit-progress-bar":!0,"::-webkit-progress-inner-element":!0,"::-webkit-progress-inner-value":!0,"::-webkit-progress-value":!0,"::-webkit-resizer":!0,"::-webkit-scrollbar-button":!0,"::-webkit-scrollbar-corner":!0,"::-webkit-scrollbar-thumb":!0,"::-webkit-scrollbar-track-piece":!0,"::-webkit-scrollbar-track":!0,"::-webkit-scrollbar":!0,"::-webkit-search-cancel-button":!0,"::-webkit-search-results-button":!0,"::-webkit-slider-runnable-track":!0,"::-webkit-slider-thumb":!0,"::after":!0,"::backdrop":!0,"::before":!0,"::cue":!0,"::file-selector-button":!0,"::first-letter":!0,"::first-line":!0,"::grammar-error":!0,"::marker":!0,"::placeholder":!0,"::selection":!0,"::spelling-error":!0,"::target-text":!0,"::view-transition-group":!0,"::view-transition-image-pair":!0,"::view-transition-new":!0,"::view-transition-old":!0,"::view-transition":!0,":active":!0,":after":!0,":any-link":!0,":before":!0,":blank":!0,":checked":!0,":default":!0,":defined":!0,":disabled":!0,":empty":!0,":enabled":!0,":first-child":!0,":first-letter":!0,":first-line":!0,":first-of-type":!0,":first":!0,":focus-visible":!0,":focus-within":!0,":focus":!0,":fullscreen":!0,":hover":!0,":in-range":!0,":indeterminate":!0,":invalid":!0,":last-child":!0,":last-of-type":!0,":left":!0,":link":!0,":only-child":!0,":only-of-type":!0,":optional":!0,":out-of-range":!0,":placeholder-shown":!0,":read-only":!0,":read-write":!0,":required":!0,":right":!0,":root":!0,":scope":!0,":target":!0,":valid":!0,":visited":!0},l3e=Object.keys(DW),u3e=DW,IT,OT=(t,e)=>new Error(Qs(IT||(IT=BS([` - Invalid media query: "`,`" - - `,` - - Read more on MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries - `])),t,e)),f3e=t=>{if(t==="@media ")throw OT(t,"Query is empty");try{K6e(t)}catch(e){throw OT(t,e.message)}},d3e=["vars"],h3e=["content"],LW="__DECLARATION",p3e={animationIterationCount:!0,borderImage:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,initialLetter:!0,lineClamp:!0,lineHeight:!0,maxLines:!0,opacity:!0,order:!0,orphans:!0,scale:!0,tabSize:!0,WebkitLineClamp:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,maskBorder:!0,maskBorderOutset:!0,maskBorderSlice:!0,maskBorderWidth:!0,shapeImageThreshold:!0,stopOpacity:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};function v3e(t){return t.replace(/([A-Z])/g,"-$1").replace(/^ms-/,"-ms-").toLowerCase()}function m3e(t,e,r,n){var i=t.slice(0,e),s=t.slice(r);return"".concat(i).concat(n).concat(s)}var y3e=" ",ju=[...l3e,"@layer","@media","@supports","@container","selectors"];class g3e{constructor(e,r){this.rules=[],this.conditionalRulesets=[new hg],this.fontFaceRules=[],this.keyframesRules=[],this.localClassNamesMap=new Map(e.map(n=>[n,n])),this.localClassNamesSearch=new T6e(e),this.layers=new Map,this.composedClassLists=r.map(n=>{var{identifier:i,classList:s}=n;return{identifier:i,regex:RegExp("(".concat(s,")"),"g")}}).reverse()}processCssObj(e){if(e.type==="fontFace"){this.fontFaceRules.push(e.rule);return}if(e.type==="keyframes"){e.rule=Object.fromEntries(Object.entries(e.rule).map(s=>{var[o,a]=s;return[o,this.transformProperties(a)]})),this.keyframesRules.push(e);return}if(this.currConditionalRuleset=new hg,e.type==="layer"){var r="@layer ".concat(e.name);this.addLayer([r])}else{var n=Fu(e.rule,ju);this.addRule({selector:e.selector,rule:n}),this.transformLayer(e,e.rule["@layer"]),this.transformMedia(e,e.rule["@media"]),this.transformSupports(e,e.rule["@supports"]),this.transformContainer(e,e.rule["@container"]),this.transformSimplePseudos(e,e.rule),this.transformSelectors(e,e.rule)}var i=this.conditionalRulesets[this.conditionalRulesets.length-1];i.mergeIfCompatible(this.currConditionalRuleset)||this.conditionalRulesets.push(this.currConditionalRuleset)}addConditionalRule(e,r){var n=this.transformVars(this.transformProperties(e.rule)),i=this.transformSelector(e.selector);if(!this.currConditionalRuleset)throw new Error("Couldn't add conditional rule");var s=r[r.length-1],o=r.slice(0,r.length-1);this.currConditionalRuleset.addRule({selector:i,rule:n},s,o)}addRule(e){var r=this.transformVars(this.transformProperties(e.rule)),n=this.transformSelector(e.selector);this.rules.push({selector:n,rule:r})}addLayer(e){var r=e.join(" - ");this.layers.set(r,e)}transformProperties(e){return this.transformContent(this.pixelifyProperties(e))}pixelifyProperties(e){return Ih(e,(r,n)=>{typeof r=="number"&&r!==0&&!p3e[n]&&(e[n]="".concat(r,"px"))}),e}transformVars(e){var{vars:r}=e,n=PT(e,d3e);return r?k0(k0({},s3e(r,(i,s)=>x6e(s))),n):n}transformContent(e){var{content:r}=e,n=PT(e,h3e);if(typeof r>"u")return n;var i=Array.isArray(r)?r:[r];return k0({content:i.map(s=>s&&(s.includes('"')||s.includes("'")||/^([A-Za-z\-]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)(\s|$)/.test(s))?s:'"'.concat(s,'"'))},n)}transformClassname(e){return".".concat(US(e,{isIdentifier:!0}))}transformSelector(e){var r=e,n=function(h){r=r.replace(s,()=>($W(h),h))};for(var{identifier:i,regex:s}of this.composedClassLists)n(i);if(this.localClassNamesMap.has(r))return this.transformClassname(r);for(var o=this.localClassNamesSearch.search(r),a=r.length,c=o.length-1;c>=0;c--){var[l,[u]]=o[c],f=l-u.length+1;f>=a||(a=f,r[f-1]!=="."&&(r=m3e(r,f,l+1,this.transformClassname(u))))}return r}transformSelectors(e,r,n){Ih(r.selectors,(i,s)=>{if(e.type!=="local")throw new Error("Selectors are not allowed within ".concat(e.type==="global"?'"globalStyle"':'"selectors"'));var o=this.transformSelector(s.replace(RegExp("&","g"),e.selector));c3e(o,e.selector);var a={selector:o,rule:Fu(i,ju)};n?this.addConditionalRule(a,n):this.addRule(a);var c={type:"selector",selector:o,rule:i};this.transformLayer(c,i["@layer"],n),this.transformSupports(c,i["@supports"],n),this.transformMedia(c,i["@media"],n)})}transformMedia(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(r){var i;(i=this.currConditionalRuleset)===null||i===void 0||i.addConditionPrecedence(n,Object.keys(r).map(l=>"@media ".concat(l)));for(var[s,o]of Object.entries(r)){var a="@media ".concat(s);f3e(a);var c=[...n,a];this.addConditionalRule({selector:e.selector,rule:Fu(o,ju)},c),e.type==="local"&&(this.transformSimplePseudos(e,o,c),this.transformSelectors(e,o,c)),this.transformLayer(e,o["@layer"],c),this.transformSupports(e,o["@supports"],c),this.transformContainer(e,o["@container"],c)}}}transformContainer(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(r){var i;(i=this.currConditionalRuleset)===null||i===void 0||i.addConditionPrecedence(n,Object.keys(r).map(s=>"@container ".concat(s))),Ih(r,(s,o)=>{var a="@container ".concat(o),c=[...n,a];this.addConditionalRule({selector:e.selector,rule:Fu(s,ju)},c),e.type==="local"&&(this.transformSimplePseudos(e,s,c),this.transformSelectors(e,s,c)),this.transformLayer(e,s["@layer"],c),this.transformSupports(e,s["@supports"],c),this.transformMedia(e,s["@media"],c)})}}transformLayer(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(r){var i;(i=this.currConditionalRuleset)===null||i===void 0||i.addConditionPrecedence(n,Object.keys(r).map(s=>"@layer ".concat(s))),Ih(r,(s,o)=>{var a=[...n,"@layer ".concat(o)];this.addLayer(a),this.addConditionalRule({selector:e.selector,rule:Fu(s,ju)},a),e.type==="local"&&(this.transformSimplePseudos(e,s,a),this.transformSelectors(e,s,a)),this.transformMedia(e,s["@media"],a),this.transformSupports(e,s["@supports"],a),this.transformContainer(e,s["@container"],a)})}}transformSupports(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(r){var i;(i=this.currConditionalRuleset)===null||i===void 0||i.addConditionPrecedence(n,Object.keys(r).map(s=>"@supports ".concat(s))),Ih(r,(s,o)=>{var a=[...n,"@supports ".concat(o)];this.addConditionalRule({selector:e.selector,rule:Fu(s,ju)},a),e.type==="local"&&(this.transformSimplePseudos(e,s,a),this.transformSelectors(e,s,a)),this.transformLayer(e,s["@layer"],a),this.transformMedia(e,s["@media"],a),this.transformContainer(e,s["@container"],a)})}}transformSimplePseudos(e,r,n){for(var i of Object.keys(r))if(u3e[i]){if(e.type!=="local")throw new Error("Simple pseudos are not valid in ".concat(e.type==="global"?'"globalStyle"':'"selectors"'));n?this.addConditionalRule({selector:"".concat(e.selector).concat(i),rule:r[i]},n):this.addRule({conditions:n,selector:"".concat(e.selector).concat(i),rule:r[i]})}}toCss(){var e=[];for(var r of this.fontFaceRules)e.push(El({"@font-face":r}));for(var n of this.keyframesRules)e.push(El({["@keyframes ".concat(n.name)]:n.rule}));for(var i of this.layers.values()){var[s,...o]=i.reverse(),a={[s]:LW};for(var c of o)a={[c]:a};e.push(El(a))}for(var l of this.rules)e.push(El({[l.selector]:l.rule}));for(var u of this.conditionalRulesets)for(var f of u.renderToArray())e.push(El(f));return e.filter(Boolean)}}function El(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=[],n=function(o){var a=t[o];if(a&&Array.isArray(a))r.push(...a.map(l=>El({[o]:l},e)));else if(a&&typeof a=="object"){var c=Object.keys(a).length===0;c||r.push("".concat(e).concat(o,` { -`).concat(El(a,e+y3e),` -`).concat(e,"}"))}else a===LW?r.push("".concat(e).concat(o,";")):r.push("".concat(e).concat(o.startsWith("--")?o:v3e(o),": ").concat(a,";"))};for(var i of Object.keys(t))n(i);return r.join(` -`)}function b3e(t){var{localClassNames:e,cssObjs:r,composedClassLists:n}=t,i=new g3e(e,n);for(var s of r)i.processCssObj(s);return i.toCss()}function BW(t){for(var e=0,r,n=0,i=t.length;i>=4;++n,i-=4)r=t.charCodeAt(n)&255|(t.charCodeAt(++n)&255)<<8|(t.charCodeAt(++n)&255)<<16|(t.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,e=(r&65535)*1540483477+((r>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(t.charCodeAt(n+2)&255)<<16;case 2:e^=(t.charCodeAt(n+1)&255)<<8;case 1:e^=t.charCodeAt(n)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var WS={exports:{}},Lx,RT;function w3e(){return RT||(RT=1,Lx={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}),Lx}var Bx,$T;function FW(){if($T)return Bx;$T=1;const t=w3e(),e={};for(const i of Object.keys(t))e[t[i]]=i;const r={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};Bx=r;for(const i of Object.keys(r)){if(!("channels"in r[i]))throw new Error("missing channels property: "+i);if(!("labels"in r[i]))throw new Error("missing channel labels property: "+i);if(r[i].labels.length!==r[i].channels)throw new Error("channel and label counts mismatch: "+i);const{channels:s,labels:o}=r[i];delete r[i].channels,delete r[i].labels,Object.defineProperty(r[i],"channels",{value:s}),Object.defineProperty(r[i],"labels",{value:o})}r.rgb.hsl=function(i){const s=i[0]/255,o=i[1]/255,a=i[2]/255,c=Math.min(s,o,a),l=Math.max(s,o,a),u=l-c;let f,d;l===c?f=0:s===l?f=(o-a)/u:o===l?f=2+(a-s)/u:a===l&&(f=4+(s-o)/u),f=Math.min(f*60,360),f<0&&(f+=360);const h=(c+l)/2;return l===c?d=0:h<=.5?d=u/(l+c):d=u/(2-l-c),[f,d*100,h*100]},r.rgb.hsv=function(i){let s,o,a,c,l;const u=i[0]/255,f=i[1]/255,d=i[2]/255,h=Math.max(u,f,d),p=h-Math.min(u,f,d),v=function(m){return(h-m)/6/p+1/2};return p===0?(c=0,l=0):(l=p/h,s=v(u),o=v(f),a=v(d),u===h?c=a-o:f===h?c=1/3+s-a:d===h&&(c=2/3+o-s),c<0?c+=1:c>1&&(c-=1)),[c*360,l*100,h*100]},r.rgb.hwb=function(i){const s=i[0],o=i[1];let a=i[2];const c=r.rgb.hsl(i)[0],l=1/255*Math.min(s,Math.min(o,a));return a=1-1/255*Math.max(s,Math.max(o,a)),[c,l*100,a*100]},r.rgb.cmyk=function(i){const s=i[0]/255,o=i[1]/255,a=i[2]/255,c=Math.min(1-s,1-o,1-a),l=(1-s-c)/(1-c)||0,u=(1-o-c)/(1-c)||0,f=(1-a-c)/(1-c)||0;return[l*100,u*100,f*100,c*100]};function n(i,s){return(i[0]-s[0])**2+(i[1]-s[1])**2+(i[2]-s[2])**2}return r.rgb.keyword=function(i){const s=e[i];if(s)return s;let o=1/0,a;for(const c of Object.keys(t)){const l=t[c],u=n(i,l);u.04045?((s+.055)/1.055)**2.4:s/12.92,o=o>.04045?((o+.055)/1.055)**2.4:o/12.92,a=a>.04045?((a+.055)/1.055)**2.4:a/12.92;const c=s*.4124+o*.3576+a*.1805,l=s*.2126+o*.7152+a*.0722,u=s*.0193+o*.1192+a*.9505;return[c*100,l*100,u*100]},r.rgb.lab=function(i){const s=r.rgb.xyz(i);let o=s[0],a=s[1],c=s[2];o/=95.047,a/=100,c/=108.883,o=o>.008856?o**(1/3):7.787*o+16/116,a=a>.008856?a**(1/3):7.787*a+16/116,c=c>.008856?c**(1/3):7.787*c+16/116;const l=116*a-16,u=500*(o-a),f=200*(a-c);return[l,u,f]},r.hsl.rgb=function(i){const s=i[0]/360,o=i[1]/100,a=i[2]/100;let c,l,u;if(o===0)return u=a*255,[u,u,u];a<.5?c=a*(1+o):c=a+o-a*o;const f=2*a-c,d=[0,0,0];for(let h=0;h<3;h++)l=s+1/3*-(h-1),l<0&&l++,l>1&&l--,6*l<1?u=f+(c-f)*6*l:2*l<1?u=c:3*l<2?u=f+(c-f)*(2/3-l)*6:u=f,d[h]=u*255;return d},r.hsl.hsv=function(i){const s=i[0];let o=i[1]/100,a=i[2]/100,c=o;const l=Math.max(a,.01);a*=2,o*=a<=1?a:2-a,c*=l<=1?l:2-l;const u=(a+o)/2,f=a===0?2*c/(l+c):2*o/(a+o);return[s,f*100,u*100]},r.hsv.rgb=function(i){const s=i[0]/60,o=i[1]/100;let a=i[2]/100;const c=Math.floor(s)%6,l=s-Math.floor(s),u=255*a*(1-o),f=255*a*(1-o*l),d=255*a*(1-o*(1-l));switch(a*=255,c){case 0:return[a,d,u];case 1:return[f,a,u];case 2:return[u,a,d];case 3:return[u,f,a];case 4:return[d,u,a];case 5:return[a,u,f]}},r.hsv.hsl=function(i){const s=i[0],o=i[1]/100,a=i[2]/100,c=Math.max(a,.01);let l,u;u=(2-o)*a;const f=(2-o)*c;return l=o*c,l/=f<=1?f:2-f,l=l||0,u/=2,[s,l*100,u*100]},r.hwb.rgb=function(i){const s=i[0]/360;let o=i[1]/100,a=i[2]/100;const c=o+a;let l;c>1&&(o/=c,a/=c);const u=Math.floor(6*s),f=1-a;l=6*s-u,u&1&&(l=1-l);const d=o+l*(f-o);let h,p,v;switch(u){default:case 6:case 0:h=f,p=d,v=o;break;case 1:h=d,p=f,v=o;break;case 2:h=o,p=f,v=d;break;case 3:h=o,p=d,v=f;break;case 4:h=d,p=o,v=f;break;case 5:h=f,p=o,v=d;break}return[h*255,p*255,v*255]},r.cmyk.rgb=function(i){const s=i[0]/100,o=i[1]/100,a=i[2]/100,c=i[3]/100,l=1-Math.min(1,s*(1-c)+c),u=1-Math.min(1,o*(1-c)+c),f=1-Math.min(1,a*(1-c)+c);return[l*255,u*255,f*255]},r.xyz.rgb=function(i){const s=i[0]/100,o=i[1]/100,a=i[2]/100;let c,l,u;return c=s*3.2406+o*-1.5372+a*-.4986,l=s*-.9689+o*1.8758+a*.0415,u=s*.0557+o*-.204+a*1.057,c=c>.0031308?1.055*c**(1/2.4)-.055:c*12.92,l=l>.0031308?1.055*l**(1/2.4)-.055:l*12.92,u=u>.0031308?1.055*u**(1/2.4)-.055:u*12.92,c=Math.min(Math.max(0,c),1),l=Math.min(Math.max(0,l),1),u=Math.min(Math.max(0,u),1),[c*255,l*255,u*255]},r.xyz.lab=function(i){let s=i[0],o=i[1],a=i[2];s/=95.047,o/=100,a/=108.883,s=s>.008856?s**(1/3):7.787*s+16/116,o=o>.008856?o**(1/3):7.787*o+16/116,a=a>.008856?a**(1/3):7.787*a+16/116;const c=116*o-16,l=500*(s-o),u=200*(o-a);return[c,l,u]},r.lab.xyz=function(i){const s=i[0],o=i[1],a=i[2];let c,l,u;l=(s+16)/116,c=o/500+l,u=l-a/200;const f=l**3,d=c**3,h=u**3;return l=f>.008856?f:(l-16/116)/7.787,c=d>.008856?d:(c-16/116)/7.787,u=h>.008856?h:(u-16/116)/7.787,c*=95.047,l*=100,u*=108.883,[c,l,u]},r.lab.lch=function(i){const s=i[0],o=i[1],a=i[2];let c;c=Math.atan2(a,o)*360/2/Math.PI,c<0&&(c+=360);const u=Math.sqrt(o*o+a*a);return[s,u,c]},r.lch.lab=function(i){const s=i[0],o=i[1],c=i[2]/360*2*Math.PI,l=o*Math.cos(c),u=o*Math.sin(c);return[s,l,u]},r.rgb.ansi16=function(i,s=null){const[o,a,c]=i;let l=s===null?r.rgb.hsv(i)[2]:s;if(l=Math.round(l/50),l===0)return 30;let u=30+(Math.round(c/255)<<2|Math.round(a/255)<<1|Math.round(o/255));return l===2&&(u+=60),u},r.hsv.ansi16=function(i){return r.rgb.ansi16(r.hsv.rgb(i),i[2])},r.rgb.ansi256=function(i){const s=i[0],o=i[1],a=i[2];return s===o&&o===a?s<8?16:s>248?231:Math.round((s-8)/247*24)+232:16+36*Math.round(s/255*5)+6*Math.round(o/255*5)+Math.round(a/255*5)},r.ansi16.rgb=function(i){let s=i%10;if(s===0||s===7)return i>50&&(s+=3.5),s=s/10.5*255,[s,s,s];const o=(~~(i>50)+1)*.5,a=(s&1)*o*255,c=(s>>1&1)*o*255,l=(s>>2&1)*o*255;return[a,c,l]},r.ansi256.rgb=function(i){if(i>=232){const l=(i-232)*10+8;return[l,l,l]}i-=16;let s;const o=Math.floor(i/36)/5*255,a=Math.floor((s=i%36)/6)/5*255,c=s%6/5*255;return[o,a,c]},r.rgb.hex=function(i){const o=(((Math.round(i[0])&255)<<16)+((Math.round(i[1])&255)<<8)+(Math.round(i[2])&255)).toString(16).toUpperCase();return"000000".substring(o.length)+o},r.hex.rgb=function(i){const s=i.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!s)return[0,0,0];let o=s[0];s[0].length===3&&(o=o.split("").map(f=>f+f).join(""));const a=parseInt(o,16),c=a>>16&255,l=a>>8&255,u=a&255;return[c,l,u]},r.rgb.hcg=function(i){const s=i[0]/255,o=i[1]/255,a=i[2]/255,c=Math.max(Math.max(s,o),a),l=Math.min(Math.min(s,o),a),u=c-l;let f,d;return u<1?f=l/(1-u):f=0,u<=0?d=0:c===s?d=(o-a)/u%6:c===o?d=2+(a-s)/u:d=4+(s-o)/u,d/=6,d%=1,[d*360,u*100,f*100]},r.hsl.hcg=function(i){const s=i[1]/100,o=i[2]/100,a=o<.5?2*s*o:2*s*(1-o);let c=0;return a<1&&(c=(o-.5*a)/(1-a)),[i[0],a*100,c*100]},r.hsv.hcg=function(i){const s=i[1]/100,o=i[2]/100,a=s*o;let c=0;return a<1&&(c=(o-a)/(1-a)),[i[0],a*100,c*100]},r.hcg.rgb=function(i){const s=i[0]/360,o=i[1]/100,a=i[2]/100;if(o===0)return[a*255,a*255,a*255];const c=[0,0,0],l=s%1*6,u=l%1,f=1-u;let d=0;switch(Math.floor(l)){case 0:c[0]=1,c[1]=u,c[2]=0;break;case 1:c[0]=f,c[1]=1,c[2]=0;break;case 2:c[0]=0,c[1]=1,c[2]=u;break;case 3:c[0]=0,c[1]=f,c[2]=1;break;case 4:c[0]=u,c[1]=0,c[2]=1;break;default:c[0]=1,c[1]=0,c[2]=f}return d=(1-o)*a,[(o*c[0]+d)*255,(o*c[1]+d)*255,(o*c[2]+d)*255]},r.hcg.hsv=function(i){const s=i[1]/100,o=i[2]/100,a=s+o*(1-s);let c=0;return a>0&&(c=s/a),[i[0],c*100,a*100]},r.hcg.hsl=function(i){const s=i[1]/100,a=i[2]/100*(1-s)+.5*s;let c=0;return a>0&&a<.5?c=s/(2*a):a>=.5&&a<1&&(c=s/(2*(1-a))),[i[0],c*100,a*100]},r.hcg.hwb=function(i){const s=i[1]/100,o=i[2]/100,a=s+o*(1-s);return[i[0],(a-s)*100,(1-a)*100]},r.hwb.hcg=function(i){const s=i[1]/100,a=1-i[2]/100,c=a-s;let l=0;return c<1&&(l=(a-c)/(1-c)),[i[0],c*100,l*100]},r.apple.rgb=function(i){return[i[0]/65535*255,i[1]/65535*255,i[2]/65535*255]},r.rgb.apple=function(i){return[i[0]/255*65535,i[1]/255*65535,i[2]/255*65535]},r.gray.rgb=function(i){return[i[0]/100*255,i[0]/100*255,i[0]/100*255]},r.gray.hsl=function(i){return[0,0,i[0]]},r.gray.hsv=r.gray.hsl,r.gray.hwb=function(i){return[0,100,i[0]]},r.gray.cmyk=function(i){return[0,0,0,i[0]]},r.gray.lab=function(i){return[i[0],0,0]},r.gray.hex=function(i){const s=Math.round(i[0]/100*255)&255,a=((s<<16)+(s<<8)+s).toString(16).toUpperCase();return"000000".substring(a.length)+a},r.rgb.gray=function(i){return[(i[0]+i[1]+i[2])/3/255*100]},Bx}var Fx,MT;function x3e(){if(MT)return Fx;MT=1;const t=FW();function e(){const s={},o=Object.keys(t);for(let a=o.length,c=0;c1&&(c=l),o(c))};return"conversion"in o&&(a.conversion=o.conversion),a}function s(o){const a=function(...c){const l=c[0];if(l==null)return l;l.length>1&&(c=l);const u=o(c);if(typeof u=="object")for(let f=u.length,d=0;d{r[o]={},Object.defineProperty(r[o],"channels",{value:t[o].channels}),Object.defineProperty(r[o],"labels",{value:t[o].labels});const a=e(o);Object.keys(a).forEach(l=>{const u=a[l];r[o][l]=s(u),r[o][l].raw=i(u)})}),jx=r,jx}WS.exports;(function(t){const e=(u,f)=>(...d)=>`\x1B[${u(...d)+f}m`,r=(u,f)=>(...d)=>{const h=u(...d);return`\x1B[${38+f};5;${h}m`},n=(u,f)=>(...d)=>{const h=u(...d);return`\x1B[${38+f};2;${h[0]};${h[1]};${h[2]}m`},i=u=>u,s=(u,f,d)=>[u,f,d],o=(u,f,d)=>{Object.defineProperty(u,f,{get:()=>{const h=d();return Object.defineProperty(u,f,{value:h,enumerable:!0,configurable:!0}),h},enumerable:!0,configurable:!0})};let a;const c=(u,f,d,h)=>{a===void 0&&(a=E3e());const p=h?10:0,v={};for(const[m,g]of Object.entries(a)){const y=m==="ansi16"?"ansi":m;m===f?v[y]=u(d,p):typeof g=="object"&&(v[y]=u(g[f],p))}return v};function l(){const u=new Map,f={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};f.color.gray=f.color.blackBright,f.bgColor.bgGray=f.bgColor.bgBlackBright,f.color.grey=f.color.blackBright,f.bgColor.bgGrey=f.bgColor.bgBlackBright;for(const[d,h]of Object.entries(f)){for(const[p,v]of Object.entries(h))f[p]={open:`\x1B[${v[0]}m`,close:`\x1B[${v[1]}m`},h[p]=f[p],u.set(v[0],v[1]);Object.defineProperty(f,d,{value:h,enumerable:!1})}return Object.defineProperty(f,"codes",{value:u,enumerable:!1}),f.color.close="\x1B[39m",f.bgColor.close="\x1B[49m",o(f.color,"ansi",()=>c(e,"ansi16",i,!1)),o(f.color,"ansi256",()=>c(r,"ansi256",i,!1)),o(f.color,"ansi16m",()=>c(n,"rgb",s,!1)),o(f.bgColor,"ansi",()=>c(e,"ansi16",i,!0)),o(f.bgColor,"ansi256",()=>c(r,"ansi256",i,!0)),o(f.bgColor,"ansi16m",()=>c(n,"rgb",s,!0)),f}Object.defineProperty(t,"exports",{enumerable:!0,get:l})})(WS);var C3e=WS.exports,S3e={stdout:!1,stderr:!1};const k3e=(t,e,r)=>{let n=t.indexOf(e);if(n===-1)return t;const i=e.length;let s=0,o="";do o+=t.substr(s,n-s)+e+r,s=n+i,n=t.indexOf(e,s);while(n!==-1);return o+=t.substr(s),o},A3e=(t,e,r,n)=>{let i=0,s="";do{const o=t[n-1]==="\r";s+=t.substr(i,(o?n-1:n)-i)+e+(o?`\r -`:` -`)+r,i=n+1,n=t.indexOf(` -`,i)}while(n!==-1);return s+=t.substr(i),s};var _3e={stringReplaceAll:k3e,stringEncaseCRLFWithFirstIndex:A3e},Ux,DT;function P3e(){if(DT)return Ux;DT=1;const t=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,e=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,r=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,n=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,i=new Map([["n",` -`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function s(l){const u=l[0]==="u",f=l[1]==="{";return u&&!f&&l.length===5||l[0]==="x"&&l.length===3?String.fromCharCode(parseInt(l.slice(1),16)):u&&f?String.fromCodePoint(parseInt(l.slice(2,-1),16)):i.get(l)||l}function o(l,u){const f=[],d=u.trim().split(/\s*,\s*/g);let h;for(const p of d){const v=Number(p);if(!Number.isNaN(v))f.push(v);else if(h=p.match(r))f.push(h[2].replace(n,(m,g,y)=>g?s(g):y));else throw new Error(`Invalid Chalk template style argument: ${p} (in style '${l}')`)}return f}function a(l){e.lastIndex=0;const u=[];let f;for(;(f=e.exec(l))!==null;){const d=f[1];if(f[2]){const h=o(d,f[2]);u.push([d].concat(h))}else u.push([d])}return u}function c(l,u){const f={};for(const h of u)for(const p of h.styles)f[p[0]]=h.inverse?null:p.slice(1);let d=l;for(const[h,p]of Object.entries(f))if(Array.isArray(p)){if(!(h in d))throw new Error(`Unknown Chalk style: ${h}`);d=p.length>0?d[h](...p):d[h]}return d}return Ux=(l,u)=>{const f=[],d=[];let h=[];if(u.replace(t,(p,v,m,g,y,b)=>{if(v)h.push(s(v));else if(g){const C=h.join("");h=[],d.push(f.length===0?C:c(l,f)(C)),f.push({inverse:m,styles:a(g)})}else if(y){if(f.length===0)throw new Error("Found extraneous } in Chalk template literal");d.push(c(l,f)(h.join(""))),h=[],f.pop()}else h.push(b)}),d.push(h.join("")),f.length>0){const p=`Chalk template literal is missing ${f.length} closing bracket${f.length===1?"":"s"} (\`}\`)`;throw new Error(p)}return d.join("")},Ux}const M1=C3e,{stdout:f8,stderr:d8}=S3e,{stringReplaceAll:T3e,stringEncaseCRLFWithFirstIndex:I3e}=_3e,{isArray:pg}=Array,jW=["ansi","ansi","ansi256","ansi16m"],Xd=Object.create(null),O3e=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const r=f8?f8.level:0;t.level=e.level===void 0?r:e.level};class R3e{constructor(e){return UW(e)}}const UW=t=>{const e={};return O3e(e,t),e.template=(...r)=>WW(e.template,...r),Object.setPrototypeOf(e,k2.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},e.template.Instance=R3e,e.template};function k2(t){return UW(t)}for(const[t,e]of Object.entries(M1))Xd[t]={get(){const r=A2(this,HS(e.open,e.close,this._styler),this._isEmpty);return Object.defineProperty(this,t,{value:r}),r}};Xd.visible={get(){const t=A2(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:t}),t}};const zW=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(const t of zW)Xd[t]={get(){const{level:e}=this;return function(...r){const n=HS(M1.color[jW[e]][t](...r),M1.color.close,this._styler);return A2(this,n,this._isEmpty)}}};for(const t of zW){const e="bg"+t[0].toUpperCase()+t.slice(1);Xd[e]={get(){const{level:r}=this;return function(...n){const i=HS(M1.bgColor[jW[r]][t](...n),M1.bgColor.close,this._styler);return A2(this,i,this._isEmpty)}}}}const $3e=Object.defineProperties(()=>{},{...Xd,level:{enumerable:!0,get(){return this._generator.level},set(t){this._generator.level=t}}}),HS=(t,e,r)=>{let n,i;return r===void 0?(n=t,i=e):(n=r.openAll+t,i=e+r.closeAll),{open:t,close:e,openAll:n,closeAll:i,parent:r}},A2=(t,e,r)=>{const n=(...i)=>pg(i[0])&&pg(i[0].raw)?LT(n,WW(n,...i)):LT(n,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(n,$3e),n._generator=t,n._styler=e,n._isEmpty=r,n},LT=(t,e)=>{if(t.level<=0||!e)return t._isEmpty?"":e;let r=t._styler;if(r===void 0)return e;const{openAll:n,closeAll:i}=r;if(e.indexOf("\x1B")!==-1)for(;r!==void 0;)e=T3e(e,r.close,r.open),r=r.parent;const s=e.indexOf(` -`);return s!==-1&&(e=I3e(e,i,n,s)),n+e+i};let zx;const WW=(t,...e)=>{const[r]=e;if(!pg(r)||!pg(r.raw))return e.join(" ");const n=e.slice(1),i=[r.raw[0]];for(let s=1;s{Wx.push(t)},registerClassName:t=>{FT.add(t)},registerComposition:t=>{jT.push(t)},markCompositionUsed:()=>{},onEndFileScope:t=>{var e=b3e({localClassNames:Array.from(FT),composedClassLists:jT,cssObjs:Wx}).join(` -`);w6e({fileScope:t,css:e}),Wx=[]},getIdentOption:()=>"short"};h6e(Q3e);function vg(t,e){return vg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},vg(t,e)}function Y3e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&vg(t,e)}function h8(){h8=function(i,s){return new r(i,void 0,s)};var t=RegExp.prototype,e=new WeakMap;function r(i,s,o){var a=new RegExp(i,s);return e.set(a,o||e.get(i)),vg(a,r.prototype)}function n(i,s){var o=e.get(s);return Object.keys(o).reduce(function(a,c){var l=o[c];if(typeof l=="number")a[c]=i[l];else{for(var u=0;i[l[u]]===void 0&&u+1]+)>/g,function(c,l){var u=o[l];return"$"+(Array.isArray(u)?u.join("$"):u)}))}if(typeof s=="function"){var a=this;return t[Symbol.replace].call(this,i,function(){var c=arguments;return typeof c[c.length-1]!="object"&&(c=[].slice.call(c)).push(n(c,a)),s.apply(this,c)})}return t[Symbol.replace].call(this,i,s)},h8.apply(this,arguments)}function J3e(t){var{debugId:e,debugFileName:r}=t,n=e?[e.replace(/\s/g,"_")]:[];if(r){var{filePath:i}=po(),s=i.match(h8(/([^\/\\]*)?[\/\\]?([^\/\\]*)\.css\.(ts|js|tsx|jsx|cjs|mjs)$/,{dir:1,file:2}));if(s&&s.groups){var{dir:o,file:a}=s.groups;n.unshift(a&&a!=="index"?a:o)}}return n.join("_")}function UT(t){return t.match(/^[0-9]/)?"_".concat(t):t}function VS(t){var e=g6e(),{debugId:r,debugFileName:n=!0}=k0(k0({},typeof t=="string"?{debugId:t}:null),typeof t=="object"?t:null),i=b6e().toString(36),{filePath:s,packageName:o}=po(),a=BW(o?"".concat(o).concat(s):s),c="".concat(a).concat(i);if(e==="debug"){var l=J3e({debugId:r,debugFileName:n});return l&&(c="".concat(l,"__").concat(c)),UT(c)}if(typeof e=="function"){if(c=e({hash:c,debugId:r,filePath:s,packageName:o}),!c.match(/^[A-Z_][0-9A-Z_]+$/i))throw new Error('Identifier function returned invalid indentifier: "'.concat(c,'"'));return c}return UT(c)}function X3e(t,e){var r=VS(e);RW(r,po());var n=[],i=[];for(var s of t)typeof s=="string"?n.push(s):i.push(s);var o=r;if(n.length>0&&(o="".concat(r," ").concat(o3e(n)),v6e({identifier:r,classList:o},po()),i.length>0&&$W(r)),i.length>0){var a=K3e.all(i,{arrayMerge:(c,l)=>l});S2({type:"local",selector:r,rule:a},po())}return o}function Ii(t,e){if(Array.isArray(t))return X3e(t,e);var r=VS(e);return RW(r,po()),S2({type:"local",selector:r,rule:t},po()),r}function Ns(t,e){S2({type:"global",selector:t,rule:e},po())}function qW(t,e){var r=US(VS(e),{isIdentifier:!0});return S2({type:"keyframes",name:r,rule:t},po()),r}function Mc(){return Mc=Object.assign?Object.assign.bind():function(t){for(var e=1;e svg`,{width:"20px",height:"20px"});ku();const e8e=({onConnect:t,connectors:e})=>{const{theme:r}=ip(),{isLoading:n}=Vz();return S.createElement(q,{flexDirection:"column",gap:"2",marginTop:"5"},e.map(i=>{const s=r==="dark"?i._wallet.logoDark:i._wallet.logoLight,o=i._wallet.name;return S.createElement(q,{key:i.id,as:"button",flexDirection:"row",alignItems:"center",justifyContent:"space-between",background:"backgroundSecondary",color:"text100",borderRadius:"md",padding:"4",style:{height:"60px"},className:Z3e,onClick:()=>t(i)},S.createElement(ie,{variant:"medium",color:"text100"},o,n),S.createElement(q,{justifyContent:"center",alignItems:"center",style:{backgroundColor:i._wallet.iconBackground},borderRadius:"md",className:VW},S.createElement(s,null)))}))},t8e=({config:t={}})=>{const{signIn:e={}}=t,{logoUrl:r}=e;return S.createElement(S.Fragment,null,r&&S.createElement(q,{marginTop:"5",justifyContent:"center",alignItems:"center"},S.createElement(gr,{src:r,style:{height:"110px"}})))};let Dn=function(t){return t.Settings="@kit.settings",t.Theme="@kit.theme",t.EthAuthProof="@kit.ethAuthProof",t.EthAuthSettings="@kit.ethAuthSettings",t.ProjectAccessKey="@kit.projectAccessKey",t}({});const Hx={showEmailInput:!0,walletAuthOptions:["sequence","metamask","wallet-connect","coinbase-wallet"],socialAuthOptions:["google","facebook","twitch","apple"]},GW=60*60*24*7;function r8e(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,s;for(s=0;s=0)&&(r[i]=t[i]);return r}const n8e=["createConnector"],KW=t=>{const e=[],r=t.find(i=>i.id==="injected");return t.filter(i=>!r||!r.hideConnectorId?!0:i.id!==r.hideConnectorId).forEach(i=>{const s=r8e(i,n8e),o=i.createConnector(),a=Mc({},s),l=((u,f)=>{const d=u;return d._wallet=Mc({},f),d})(o,a);e.push(l)}),e},i8e=t=>/^\S+@\S+\.\S{2,}$/.test(t),v8={1:{name:"Ethereum",symbol:"ETH",logoURI:"https://assets.coingecko.com/coins/images/279/thumb/ethereum.png",decimals:18,blockExplorerName:"Etherscan",blockExplorerUrl:"https://etherscan.io"},5:{name:"Goerli",symbol:"ETH",decimals:18,logoURI:"https://assets.coingecko.com/coins/images/279/thumb/ethereum.png",blockExplorerName:"Etherscan (Goerli)",blockExplorerUrl:"https://goerli.etherscan.io"},10:{name:"Optimism",symbol:"OP",logoURI:"https://assets.coingecko.com/coins/images/25244/small/Optimism.png",decimals:18,blockExplorerName:"Etherscan (Optimism)",blockExplorerUrl:"https://optimistic.etherscan.io"},56:{name:"BNB",symbol:"BNB",logoURI:"https://assets.coingecko.com/coins/images/825/thumb/bnb-icon2_2x.png",decimals:18,blockExplorerName:"BscScan",blockExplorerUrl:"https://bscscan.com"},100:{name:"Gnosis",symbol:"GNO",logoURI:"https://assets.coingecko.com/coins/images/662/small/logo_square_simple_300px.png",decimals:18,blockExplorerUrl:"https://gnosisscan.io",blockExplorerName:"Gnosis Scan"},137:{name:"Polygon",symbol:"MATIC",logoURI:"https://assets.coingecko.com/coins/images/4713/thumb/matic-token-icon.png",decimals:18,blockExplorerName:"Polyscan",blockExplorerUrl:"https://polygonscan.com"},1101:{name:"Polygon zkEVM",symbol:"ETH",logoURI:"https://assets.coingecko.com/coins/images/4713/thumb/matic-token-icon.png",decimals:18,blockExplorerName:"PolygonScan",blockExplorerUrl:"https://zkevm.polygonscan.com"},42161:{name:"Arbitrum",symbol:"ARB",logoURI:"https://assets.coingecko.com/asset_platforms/images/33/small/arbitrum-one.png",decimals:18,blockExplorerName:"Arbiscan",blockExplorerUrl:"https://arbiscan.io"},43114:{name:"Avalanche",symbol:"AVAX",logoURI:"https://assets.coingecko.com/coins/images/12559/small/Avalanche_Circle_RedWhite_Trans.png",decimals:18,blockExplorerName:"Snowtrace",blockExplorerUrl:"https://snowtrace.io"},80001:{name:"Mumbai",symbol:"MATIC",logoURI:"https://assets.coingecko.com/coins/images/4713/thumb/matic-token-icon.png",decimals:18,blockExplorerName:"Polyscan (Mumbai)",blockExplorerUrl:"https://mumbai.polygonscan.com"}},s8e=(t,e)=>{const r=e.find(s=>s.id===t);if(r){var n,i;return{name:r.name,symbol:r.nativeCurrency.symbol,decimals:r.nativeCurrency.decimals,logoURI:v8[1].logoURI,blockExplorerName:(n=r.blockExplorers)==null?void 0:n.default.name,blockExplorerUrl:(i=r.blockExplorers)==null?void 0:i.default.url}}},Rr=(t,e)=>v8[t]||s8e(t,e)||v8[1],Yc=()=>{const t=S.createContext(void 0);return[()=>{const r=S.useContext(t);if(!r)throw new Error("useGenericContext must be used within a Provider");return r},t.Provider]},KS=t=>{switch(t){case"top-right":return{top:"0px",right:"0px"};case"top-left":return{top:"0px",left:"0px"};case"top-center":return{top:"0px"};case"bottom-right":return{bottom:"0px",right:"0px"};case"bottom-left":return{bottom:"0px",left:"0px"};case"bottom-center":return{bottom:"0px"};case"middle-right":return{right:"0px"};case"middle-left":return{left:"0px"};case"center":default:return{}}},o8e=(t,e="light")=>{switch(t){case 1:return"#abf";case 137:return"#c7a6ff";case 42161:return"#52A7E6";case 10:return"#DB3132";case 56:return e==="light"?"#CB9C1D":"#EEB445";case 43114:return"#E84142";case 100:return e==="light"?"#00193C":"#D8E8FF";case 5:return e==="light"?"#A77A00":"#FFA700";case 80001:return e==="light"?"#D68828":"#FFA700";default:return"#abf"}},a8e=(t,e="light")=>{switch(t){case 1:return"#132362";case 137:return"#350881";case 42161:return e==="light"?"#EDF7FF":"#0C3754";case 10:return e==="light"?"#FFEAE9":"#390B0C";case 56:return e==="light"?"#FFE8AB":"#554018";case 43114:return e==="light"?"#FBDFDF":"#390B0C";case 100:return e==="light"?"#D8E8FF":"#00193C";case 5:return e==="light"?"#FFD871":"#554018";case 80001:return e==="light"?"#FFE8CD":"#554018";default:return"#132362"}};function c8e(t){var e;const{account:r,chain:n,transport:i}=t,s={chainId:n.id,name:n.name,ensAddress:(e=n.contracts)==null||(e=e.ensRegistry)==null?void 0:e.address};return new VM(i,s).getSigner(r.address)}function l8e(t){var e;const{chain:r,transport:n}=t,i={chainId:r.id,name:r.name,ensAddress:(e=r.contracts)==null||(e=e.ensRegistry)==null?void 0:e.address};return n.type==="fallback"?new _Z(n.transports.map(({value:s})=>new ta(s==null?void 0:s.url,i))):new ta(n.url,i)}const u8e=async t=>{const e=localStorage.getItem(Dn.EthAuthProof);if(e)return JSON.parse(e);const r=localStorage.getItem(Dn.EthAuthSettings);if(!r)throw new Error("No ETHAuth settings found");const n=JSON.parse(r),i=t.account.address,s=new Mb;s.address=i,s.claims.app=n.app||"app",s.claims.ogn=n.origin,s.claims.n=n.nonce,s.setExpiryIn(n.expiry?Math.max(n.expiry,200):GW);const o=s.messageTypedData();o.domain.verifyingContract;const c=await c8e(t)._signTypedData(o.domain,o.types,o.message);s.signature=c;const u=await new c1().encodeProof(s,!0);return{typedData:o,proofString:u}},f8e=async(t,e,r)=>{const n=t.account.address,s=await new c1().decodeProof(r.proofString,!0),o=l8e(e);return await M4.utils.isValidTypedDataSignature(n,r.typedData,s.signature,o)},pn=t=>{const e=Wt[t];if(!e)throw"invalid network";const r=localStorage.getItem(Dn.ProjectAccessKey)||void 0,n=new S4("https://metadata.sequence.app",r),i=new C4(r4(e.name),r),s=new d0("https://api.sequence.app",r);return{network:e,metadataClient:n,indexerClient:i,apiClient:s}},d8e=t=>{const{isConnected:e}=fn(),{theme:r}=ip(),{config:n={}}=t,{signIn:i={}}=n,{showEmailInput:s=Hx.showEmailInput,socialAuthOptions:o=Hx.socialAuthOptions,walletAuthOptions:a=Hx.walletAuthOptions}=i,{openConnectModal:c,setOpenConnectModal:l}=t,[u,f]=k.useState(""),{connectors:d,connect:h,isLoading:p}=Vz(),v=d,[m,g]=k.useState(!1),y=v.find(B=>B.id==="mock"),b=v.find(B=>B._wallet.id==="email"),C=v.filter(B=>!!a.find(H=>H===B._wallet.id)).sort((B,z)=>a.indexOf(B._wallet.id)-a.indexOf(z._wallet.id)),A=v.filter(B=>!!o.find(H=>H===B._wallet.id)).sort((B,z)=>o.indexOf(B._wallet.id)-o.indexOf(z._wallet.id));C.length>4;const O=B=>{f(B.target.value)};k.useEffect(()=>{e&&c&&l(!1)},[e,c]);const w=B=>{if(i.useMock&&y){h({connector:y});return}if(B._wallet.id==="email"){const z=prompt("Auto-email login, please specify the email address:");localStorage.setItem(a8,z||"")}h({connector:B})},I=B=>{if(i.useMock&&y){h({connector:y});return}B.preventDefault(),localStorage.setItem(a8,u),h({connector:b})};return m?S.createElement(S.Fragment,null,S.createElement(q,{as:"button",position:"absolute",style:{top:"20px"},onClick:()=>g(!1),className:Em},S.createElement(yb,null)),S.createElement(e8e,{connectors:C,onConnect:w})):S.createElement(S.Fragment,null,S.createElement(t8e,{config:n}),S.createElement(q,{marginTop:"5"},b&&s&&S.createElement(S.Fragment,null,S.createElement("form",{onSubmit:I},S.createElement(qc,{onChange:O,value:u,name:"email",placeholder:"Enter email","data-1p-ignore":!0}),S.createElement(nt,{type:"submit",disabled:!i8e(u),marginTop:"4",width:"full",label:"Continue",rightIcon:qo}))),A.length>0&&S.createElement(S.Fragment,null,b&&s&&S.createElement(S.Fragment,null,S.createElement(q,{style:{marginBottom:"-4px"}},S.createElement(i1,{color:"backgroundSecondary"})),S.createElement(q,{justifyContent:"center",alignItems:"center"},S.createElement(ie,{variant:"small",color:"text50"},"or sign in via"))),S.createElement(q,{marginTop:"3",gap:"2",flexDirection:"row",justifyContent:"center",alignItems:"center",flexWrap:"wrap"},A.map(B=>{const z=r==="dark"?B._wallet.monochromeLogoDark:B._wallet.monochromeLogoLight;return S.createElement(Eo,{key:B._wallet.id,className:Em,justifyContent:"center",alignItems:"center",onClick:()=>w(B),aspectRatio:"1/1",style:{width:`calc(25% - ${ve.space[2]})`}},S.createElement(q,{className:p8,flexDirection:"column",alignItems:"center",justifyContent:"center"},S.createElement(z,null)))}))),C.length>0&&S.createElement(S.Fragment,null,(b&&s||A.length>0)&&S.createElement(S.Fragment,null,S.createElement(q,{style:{marginBottom:"-4px"}},S.createElement(i1,{color:"backgroundSecondary"})),S.createElement(q,{justifyContent:"center",alignItems:"center"},S.createElement(ie,{variant:"small",color:"text50"},"or select a wallet"))),S.createElement(q,{marginTop:"3",gap:"2",flexDirection:"row",justifyContent:"center",alignItems:"center"},C.map(B=>{const z=r==="dark"?B._wallet.logoDark||B._wallet.logoDark:B._wallet.logoLight||B._wallet.logoLight;return S.createElement(Eo,{key:B._wallet.id,className:Em,justifyContent:"center",alignItems:"center",onClick:()=>w(B),aspectRatio:"1/1",style:{width:`calc(25% - ${ve.space[2]})`}},S.createElement(q,{className:p8,flexDirection:"column",alignItems:"center",justifyContent:"center"},S.createElement(z,null)))})))))};function h8e(t){if(t==null)throw new TypeError("Cannot destructure "+t)}const p8e=t=>{let e=Mc({},(h8e(t),t));return S.createElement(S.Fragment,null,S.createElement("svg",Mc({xmlns:"http://www.w3.org/2000/svg",style:{fill:"none"},id:"svg1316",version:"1.1",viewBox:"0 0 396 396"},e),S.createElement("g",{transform:"translate(0,38)",id:"g1256",clipPath:"url(#clip0_5_131)"},S.createElement("g",{id:"g1254",clipPath:"url(#clip1_5_131)"},S.createElement("path",{style:{fill:"#111111"},id:"path1232",d:"M 0,67.5049 V 250.165 c 0,37.282 30.1402,67.505 67.32,67.505 h 261.36 c 37.18,0 67.32,-30.223 67.32,-67.505 V 67.5049 C 396,30.223 365.86,0 328.68,0 H 67.32 C 30.1402,0 0,30.223 0,67.5049 Z"}),S.createElement("path",{style:{fill:"url(#paint0_linear_5_13"},id:"path1234",d:"M 0,67.5049 V 250.165 c 0,37.282 30.1402,67.505 67.32,67.505 h 261.36 c 37.18,0 67.32,-30.223 67.32,-67.505 V 67.5049 C 396,30.223 365.86,0 328.68,0 H 67.32 C 30.1402,0 0,30.223 0,67.5049 Z"}),S.createElement("path",{style:{fill:"url(#paint1_linear_5_131"},id:"path1236",d:"m 98.9999,79.4176 c 0,-10.9653 -8.8648,-19.8544 -19.8,-19.8544 -10.9352,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.8648,19.8544 19.8,19.8544 10.9352,0 19.8,-8.8892 19.8,-19.8544 z"}),S.createElement("path",{style:{fill:"url(#paint2_linear_5_131)"},id:"path1238",d:"m 98.9999,79.4176 c 0,-10.9653 -8.8648,-19.8544 -19.8,-19.8544 -10.9352,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.8648,19.8544 19.8,19.8544 10.9352,0 19.8,-8.8892 19.8,-19.8544 z"}),S.createElement("path",{style:{fill:"url(#paint3_linear_5_131)"},id:"path1240",d:"m 98.9999,79.4176 c 0,-10.9653 -8.8648,-19.8544 -19.8,-19.8544 -10.9352,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.8648,19.8544 19.8,19.8544 10.9352,0 19.8,-8.8892 19.8,-19.8544 z"}),S.createElement("path",{style:{fill:"url(#paint4_linear_5_131)"},id:"path1242",d:"m 98.9999,238.126 c 0,-10.965 -8.8648,-19.854 -19.8,-19.854 -10.9352,0 -19.8,8.889 -19.8,19.854 0,10.966 8.8648,19.855 19.8,19.855 10.9352,0 19.8,-8.889 19.8,-19.855 z"}),S.createElement("path",{style:{fill:"url(#paint5_linear_5_131)"},id:"path1244",d:"m 336.6,158.835 c 0,-10.965 -8.865,-19.854 -19.8,-19.854 -10.935,0 -19.8,8.889 -19.8,19.854 0,10.965 8.865,19.855 19.8,19.855 10.935,0 19.8,-8.89 19.8,-19.855 z"}),S.createElement("path",{style:{fill:"url(#paint6_linear_5_131)"},id:"path1246",d:"m 336.6,158.835 c 0,-10.965 -8.865,-19.854 -19.8,-19.854 -10.935,0 -19.8,8.889 -19.8,19.854 0,10.965 8.865,19.855 19.8,19.855 10.935,0 19.8,-8.89 19.8,-19.855 z"}),S.createElement("path",{style:{fill:"url(#paint7_linear_5_131)"},id:"path1248",d:"M 316.8,59.5632 H 158.4 c -10.935,0 -19.8,8.8891 -19.8,19.8544 0,10.9652 8.865,19.8544 19.8,19.8544 h 158.4 c 10.935,0 19.8,-8.8892 19.8,-19.8544 0,-10.9653 -8.865,-19.8544 -19.8,-19.8544 z"}),S.createElement("path",{style:{fill:"url(#paint8_linear_5_131)"},id:"path1250",d:"M 316.8,218.272 H 158.4 c -10.935,0 -19.8,8.889 -19.8,19.854 0,10.966 8.865,19.855 19.8,19.855 h 158.4 c 10.935,0 19.8,-8.889 19.8,-19.855 0,-10.965 -8.865,-19.854 -19.8,-19.854 z"}),S.createElement("path",{style:{fill:"url(#paint9_linear_5_131)"},id:"path1252",d:"M 237.6,138.981 H 79.2 c -10.9352,0 -19.8,8.889 -19.8,19.854 0,10.965 8.8648,19.855 19.8,19.855 h 158.4 c 10.935,0 19.8,-8.89 19.8,-19.855 0,-10.965 -8.865,-19.854 -19.8,-19.854 z"}))),S.createElement("defs",{id:"defs1314"},S.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"318",x2:"198",y1:"4.0585401e-05",x1:"198",id:"paint0_linear_5_131"},S.createElement("stop",{id:"stop1258",stopColor:"#1D273D"}),S.createElement("stop",{id:"stop1260",stopColor:"#0D0F13",offset:"1"})),S.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"63",x2:"92.5",y1:"99",x1:"65.5",id:"paint1_linear_5_131"},S.createElement("stop",{id:"stop1263",stopColor:"#4462FE"}),S.createElement("stop",{id:"stop1265",stopColor:"#7D69FA",offset:"1"})),S.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"97.591103",x2:"96.137703",y1:"99.291199",x1:"62.879902",id:"paint2_linear_5_131"},S.createElement("stop",{id:"stop1268",stopColor:"#3757FD"}),S.createElement("stop",{id:"stop1270",stopColor:"#6980FA",offset:"1"})),S.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"97.591103",x2:"96.137703",y1:"99.291199",x1:"62.879902",id:"paint3_linear_5_131"},S.createElement("stop",{id:"stop1273",stopColor:"#2447FF"}),S.createElement("stop",{id:"stop1275",stopColor:"#6980FA",offset:"1"})),S.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"223.5",x2:"91.5",y1:"251.5",x1:"65",id:"paint4_linear_5_131"},S.createElement("stop",{id:"stop1278",stopColor:"#BC3EE6"}),S.createElement("stop",{id:"stop1280",stopColor:"#D972F1",offset:"1"})),S.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"146",x2:"329.5",y1:"172",x1:"305",id:"paint5_linear_5_131"},S.createElement("stop",{id:"stop1283",stopColor:"#29BDFF"}),S.createElement("stop",{id:"stop1285",stopColor:"#96E7FB",offset:"1"})),S.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"176.772",x2:"334.56699",y1:"178.418",x1:"300.17999",id:"paint6_linear_5_131"},S.createElement("stop",{id:"stop1288",stopColor:"#23BBFF"}),S.createElement("stop",{id:"stop1290",stopColor:"#85E7FF",offset:"1"})),S.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"60",x2:"317.5",y1:"99",x1:"154.5",id:"paint7_linear_5_131"},S.createElement("stop",{id:"stop1293",stopColor:"#23BBFF"}),S.createElement("stop",{id:"stop1295",stopColor:"#85E7FF",offset:"1"})),S.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"218",x2:"312.5",y1:"258",x1:"156",id:"paint8_linear_5_131"},S.createElement("stop",{id:"stop1298",stopColor:"#2447FF"}),S.createElement("stop",{id:"stop1300",stopColor:"#6980FA",offset:"1"})),S.createElement("linearGradient",{gradientUnits:"userSpaceOnUse",y2:"139",x2:"235.5",y1:"179",x1:"86.000099",id:"paint9_linear_5_131"},S.createElement("stop",{id:"stop1303",stopColor:"#6634FF"}),S.createElement("stop",{id:"stop1305",stopColor:"#9C6DFF",offset:"1"})),S.createElement("clipPath",{id:"clip0_5_131"},S.createElement("rect",{style:{fill:"#ffffff"},y:"0",x:"0",id:"rect1308",height:"317.67001",width:"396"})),S.createElement("clipPath",{id:"clip1_5_131"},S.createElement("rect",{style:{fill:"#ffffff"},y:"0",x:"0",id:"rect1311",height:"317.67001",width:"396"})))))},[QW,v8e]=Yc(),[m8e,y8e]=Yc(),[g8e,b8e]=Yc(),[w8e,x8e]=Yc(),E8e={dark:"dark",light:"light"},C8e=t=>{const{config:e,children:r}=t,{projectAccessKey:n,defaultTheme:i="dark",signIn:s={},position:o="center",displayedAssets:a=[],ethAuth:c={},disableAnalytics:l=!1}=e,u=s.projectName||"app",{expiry:f=GW,app:d=u,origin:h=location.origin,nonce:p}=c,{projectName:v}=s,[m,g]=k.useState(!1),[y,b]=k.useState(i||E8e.dark),[C,A]=k.useState(o),[O,w]=k.useState(a),[I,B]=k.useState(),{address:z,isConnected:H}=fn(),K=x=>{const $=M4.initWallet(x).client.analytics;B($)};k.useEffect(()=>{if(!H){I==null||I.reset();return}z&&(I==null||I.identify(z.toLowerCase()))},[I,z,H]);const F=()=>{window.open("https://sequence.xyz")};return k.useEffect(()=>{l||K(n),localStorage.setItem(Dn.ProjectAccessKey,n)},[n]),k.useEffect(()=>{y!==i&&b(i)},[i]),k.useEffect(()=>{C!==o&&A(o)},[o]),k.useEffect(()=>{typeof y=="object"||localStorage.setItem(Dn.Theme,y),localStorage.setItem(Dn.EthAuthSettings,JSON.stringify({expiry:f,app:d,origin:h,nonce:p}))},[y,c]),k.useEffect(()=>{w(O)},[a]),S.createElement(b8e,{value:{theme:y,setTheme:b,position:C,setPosition:A}},S.createElement(y8e,{value:{setOpenConnectModal:g,openConnectModalState:m}},S.createElement(x8e,{value:{setDisplayedAssets:w,displayedAssets:O}},S.createElement(v8e,{value:{setAnalytics:B,analytics:I}},S.createElement("div",{id:"kit-provider"},S.createElement(_b,{root:"#kit-provider",scope:"kit",theme:y},S.createElement(db,null,m&&S.createElement(HC,{scroll:!1,backdropColor:"backgroundBackdrop",size:"sm",contentProps:{style:Mc({maxWidth:"364px"},KS(o))},onClose:()=>g(!1)},S.createElement(q,{padding:"4",className:GS},S.createElement(q,{justifyContent:"center",color:"text100",alignItems:"center",fontWeight:"medium",style:{marginTop:"4px"}},S.createElement(ie,null,"Sign in ",v?`to ${v}`:"")),S.createElement(d8e,Mc({openConnectModal:m,setOpenConnectModal:g},t)),S.createElement(q,{onClick:F,className:Em,gap:"1",marginTop:"2",flexDirection:"row",alignItems:"center",justifyContent:"center"},S.createElement(ie,{fontSize:"small",color:"text100"},"Powered by Sequence"),S.createElement(q,{height:"5",width:"5"},S.createElement(p8e,null)))))))),r))))},S8e=()=>{const{setOpenConnectModal:t,openConnectModalState:e}=m8e();return{setOpenConnectModal:t,openConnectModalState:e}},Pp=()=>{const{setTheme:t,theme:e,position:r,setPosition:n}=g8e();return{setTheme:t,theme:e,position:r,setPosition:n}},k8e=()=>{const{setDisplayedAssets:t,displayedAssets:e}=w8e();return{displayedAssets:e,setDisplayedAssets:t}};function A8e(t,e,r){return t===t&&(r!==void 0&&(t=t<=r?t:r),e!==void 0&&(t=t>=e?t:e)),t}var YW=A8e;function _8e(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r-1&&t%1==0&&t-1&&t%1==0&&t<=IEe}var sH=OEe,REe=_2,$Ee=sH,MEe=P2,NEe="[object Arguments]",DEe="[object Array]",LEe="[object Boolean]",BEe="[object Date]",FEe="[object Error]",jEe="[object Function]",UEe="[object Map]",zEe="[object Number]",WEe="[object Object]",HEe="[object RegExp]",qEe="[object Set]",VEe="[object String]",GEe="[object WeakMap]",KEe="[object ArrayBuffer]",QEe="[object DataView]",YEe="[object Float32Array]",JEe="[object Float64Array]",XEe="[object Int8Array]",ZEe="[object Int16Array]",eCe="[object Int32Array]",tCe="[object Uint8Array]",rCe="[object Uint8ClampedArray]",nCe="[object Uint16Array]",iCe="[object Uint32Array]",Ht={};Ht[YEe]=Ht[JEe]=Ht[XEe]=Ht[ZEe]=Ht[eCe]=Ht[tCe]=Ht[rCe]=Ht[nCe]=Ht[iCe]=!0;Ht[NEe]=Ht[DEe]=Ht[KEe]=Ht[LEe]=Ht[QEe]=Ht[BEe]=Ht[FEe]=Ht[jEe]=Ht[UEe]=Ht[zEe]=Ht[WEe]=Ht[HEe]=Ht[qEe]=Ht[VEe]=Ht[GEe]=!1;function sCe(t){return MEe(t)&&$Ee(t.length)&&!!Ht[REe(t)]}var oCe=sCe;function aCe(t){return function(e){return t(e)}}var cCe=aCe,yg={exports:{}};yg.exports;(function(t,e){var r=XW,n=e&&!e.nodeType&&e,i=n&&!0&&t&&!t.nodeType&&t,s=i&&i.exports===n,o=s&&r.process,a=function(){try{var c=i&&i.require&&i.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();t.exports=a})(yg,yg.exports);var lCe=yg.exports,uCe=oCe,fCe=cCe,VT=lCe,GT=VT&&VT.isTypedArray,dCe=GT?fCe(GT):uCe,hCe=dCe,pCe=V8e,vCe=EEe,mCe=nH,yCe=AEe,gCe=iH,bCe=hCe,wCe=Object.prototype,xCe=wCe.hasOwnProperty;function ECe(t,e){var r=mCe(t),n=!r&&vCe(t),i=!r&&!n&&yCe(t),s=!r&&!n&&!i&&bCe(t),o=r||n||i||s,a=o?pCe(t.length,String):[],c=a.length;for(var l in t)(e||xCe.call(t,l))&&!(o&&(l=="length"||i&&(l=="offset"||l=="parent")||s&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||gCe(l,c)))&&a.push(l);return a}var CCe=ECe,SCe=Object.prototype;function kCe(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||SCe;return t===r}var ACe=kCe;function _Ce(t,e){return function(r){return t(e(r))}}var PCe=_Ce,TCe=PCe,ICe=TCe(Object.keys,Object),OCe=ICe,RCe=ACe,$Ce=OCe,MCe=Object.prototype,NCe=MCe.hasOwnProperty;function DCe(t){if(!RCe(t))return $Ce(t);var e=[];for(var r in Object(t))NCe.call(t,r)&&r!="constructor"&&e.push(r);return e}var LCe=DCe;function BCe(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var QS=BCe,FCe=_2,jCe=QS,UCe="[object AsyncFunction]",zCe="[object Function]",WCe="[object GeneratorFunction]",HCe="[object Proxy]";function qCe(t){if(!jCe(t))return!1;var e=FCe(t);return e==zCe||e==WCe||e==UCe||e==HCe}var VCe=qCe,GCe=VCe,KCe=sH;function QCe(t){return t!=null&&KCe(t.length)&&!GCe(t)}var oH=QCe,YCe=CCe,JCe=LCe,XCe=oH;function ZCe(t){return XCe(t)?YCe(t):JCe(t)}var e4e=ZCe,t4e=H8e,r4e=e4e;function n4e(t){return t==null?[]:t4e(t,r4e(t))}var i4e=n4e,s4e=YW,o4e=JW,a4e=i4e;function c4e(t,e){var r=a4e(t);return o4e(r,s4e(e,0,r.length))}var l4e=c4e;function u4e(t,e){return t===e||t!==t&&e!==e}var f4e=u4e,d4e=f4e,h4e=oH,p4e=iH,v4e=QS;function m4e(t,e,r){if(!v4e(r))return!1;var n=typeof e;return(n=="number"?h4e(r)&&p4e(e,r.length):n=="string"&&e in r)?d4e(r[e],t):!1}var y4e=m4e,g4e=/\s/;function b4e(t){for(var e=t.length;e--&&g4e.test(t.charAt(e)););return e}var w4e=b4e,x4e=w4e,E4e=/^\s+/;function C4e(t){return t&&t.slice(0,x4e(t)+1).replace(E4e,"")}var S4e=C4e,k4e=_2,A4e=P2,_4e="[object Symbol]";function P4e(t){return typeof t=="symbol"||A4e(t)&&k4e(t)==_4e}var T4e=P4e,I4e=S4e,KT=QS,O4e=T4e,QT=0/0,R4e=/^[-+]0x[0-9a-f]+$/i,$4e=/^0b[01]+$/i,M4e=/^0o[0-7]+$/i,N4e=parseInt;function D4e(t){if(typeof t=="number")return t;if(O4e(t))return QT;if(KT(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=KT(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=I4e(t);var r=$4e.test(t);return r||M4e.test(t)?N4e(t.slice(2),r?2:8):R4e.test(t)?QT:+t}var L4e=D4e,B4e=L4e,YT=1/0,F4e=17976931348623157e292;function j4e(t){if(!t)return t===0?t:0;if(t=B4e(t),t===YT||t===-YT){var e=t<0?-1:1;return e*F4e}return t===t?t:0}var U4e=j4e,z4e=U4e;function W4e(t){var e=z4e(t),r=e%1;return e===e?r?e-r:e:0}var H4e=W4e,q4e=F8e,V4e=l4e,G4e=nH,K4e=y4e,Q4e=H4e;function Y4e(t,e,r){(r?K4e(t,e,r):e===void 0)?e=1:e=Q4e(e);var n=G4e(t)?q4e:V4e;return n(t,e)}var J4e=Y4e;const X4e=ki(J4e);var T2={},Z4e=function(){var t=document.getSelection();if(!t.rangeCount)return function(){};for(var e=document.activeElement,r=[],n=0;n"u"){r&&console.warn("unable to use e.clipboardData"),r&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var f=JT[e.format]||JT.default;window.clipboardData.setData(f,t)}else u.clipboardData.clearData(),u.clipboardData.setData(e.format,t);e.onCopy&&(u.preventDefault(),e.onCopy(u.clipboardData))}),document.body.appendChild(a),s.selectNodeContents(a),o.addRange(s);var l=document.execCommand("copy");if(!l)throw new Error("copy command was unsuccessful");c=!0}catch(u){r&&console.error("unable to copy using execCommand: ",u),r&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(e.format||"text",t),e.onCopy&&e.onCopy(window.clipboardData),c=!0}catch(f){r&&console.error("unable to copy using clipboardData: ",f),r&&console.error("falling back to prompt"),n=rSe("message"in e?e.message:tSe),window.prompt(n,t)}}finally{o&&(typeof o.removeRange=="function"?o.removeRange(s):o.removeAllRanges()),a&&document.body.removeChild(a),i()}return c}var iSe=nSe;function m8(t){"@babel/helpers - typeof";return m8=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m8(t)}Object.defineProperty(T2,"__esModule",{value:!0});T2.CopyToClipboard=void 0;var Pv=aH(k),sSe=aH(iSe),oSe=["text","onCopy","options","children"];function aH(t){return t&&t.__esModule?t:{default:t}}function XT(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ZT(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function cSe(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,s;for(s=0;s=0)&&(r[i]=t[i]);return r}function lSe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function eI(t,e){for(var r=0;r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function gg(t){return gg=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},gg(t)}function YS(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var lH=function(t){fSe(r,t);var e=dSe(r);function r(){var n;lSe(this,r);for(var i=arguments.length,s=new Array(i),o=0;oe in t?mSe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,D1=(t,e)=>{for(var r in e||(e={}))fH.call(e,r)&&tI(t,r,e[r]);if(bg)for(var r of bg(e))dH.call(e,r)&&tI(t,r,e[r]);return t},JS=(t,e)=>{var r={};for(var n in t)fH.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&bg)for(var n of bg(t))e.indexOf(n)<0&&dH.call(t,n)&&(r[n]=t[n]);return r};/** - * @license QR Code generator library (TypeScript) - * Copyright (c) Project Nayuki. - * SPDX-License-Identifier: MIT - */var au;(t=>{const e=class{constructor(c,l,u,f){if(this.version=c,this.errorCorrectionLevel=l,this.modules=[],this.isFunction=[],ce.MAX_VERSION)throw new RangeError("Version value out of range");if(f<-1||f>7)throw new RangeError("Mask value out of range");this.size=c*4+17;let d=[];for(let p=0;p7)throw new RangeError("Invalid value");let p,v;for(p=u;;p++){const b=e.getNumDataCodewords(p,l)*8,C=a.getTotalBits(c,p);if(C<=b){v=C;break}if(p>=f)throw new RangeError("Data too long")}for(const b of[e.Ecc.MEDIUM,e.Ecc.QUARTILE,e.Ecc.HIGH])h&&v<=e.getNumDataCodewords(p,b)*8&&(l=b);let m=[];for(const b of c){n(b.mode.modeBits,4,m),n(b.numChars,b.mode.numCharCountBits(p),m);for(const C of b.getData())m.push(C)}s(m.length==v);const g=e.getNumDataCodewords(p,l)*8;s(m.length<=g),n(0,Math.min(4,g-m.length),m),n(0,(8-m.length%8)%8,m),s(m.length%8==0);for(let b=236;m.lengthy[C>>>3]|=b<<7-(C&7)),new e(p,l,y,d)}getModule(c,l){return 0<=c&&c>>9)*1335;const f=(l<<10|u)^21522;s(f>>>15==0);for(let d=0;d<=5;d++)this.setFunctionModule(8,d,i(f,d));this.setFunctionModule(8,7,i(f,6)),this.setFunctionModule(8,8,i(f,7)),this.setFunctionModule(7,8,i(f,8));for(let d=9;d<15;d++)this.setFunctionModule(14-d,8,i(f,d));for(let d=0;d<8;d++)this.setFunctionModule(this.size-1-d,8,i(f,d));for(let d=8;d<15;d++)this.setFunctionModule(8,this.size-15+d,i(f,d));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let c=this.version;for(let u=0;u<12;u++)c=c<<1^(c>>>11)*7973;const l=this.version<<12|c;s(l>>>18==0);for(let u=0;u<18;u++){const f=i(l,u),d=this.size-11+u%3,h=Math.floor(u/3);this.setFunctionModule(d,h,f),this.setFunctionModule(h,d,f)}}drawFinderPattern(c,l){for(let u=-4;u<=4;u++)for(let f=-4;f<=4;f++){const d=Math.max(Math.abs(f),Math.abs(u)),h=c+f,p=l+u;0<=h&&h{(b!=v-d||A>=p)&&y.push(C[b])});return s(y.length==h),y}drawCodewords(c){if(c.length!=Math.floor(e.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let l=0;for(let u=this.size-1;u>=1;u-=2){u==6&&(u=5);for(let f=0;f>>3],7-(l&7)),l++)}}s(l==c.length*8)}applyMask(c){if(c<0||c>7)throw new RangeError("Mask value out of range");for(let l=0;l5&&c++):(this.finderPenaltyAddHistory(p,v),h||(c+=this.finderPenaltyCountPatterns(v)*e.PENALTY_N3),h=this.modules[d][m],p=1);c+=this.finderPenaltyTerminateAndCount(h,p,v)*e.PENALTY_N3}for(let d=0;d5&&c++):(this.finderPenaltyAddHistory(p,v),h||(c+=this.finderPenaltyCountPatterns(v)*e.PENALTY_N3),h=this.modules[m][d],p=1);c+=this.finderPenaltyTerminateAndCount(h,p,v)*e.PENALTY_N3}for(let d=0;dh+(p?1:0),l);const u=this.size*this.size,f=Math.ceil(Math.abs(l*20-u*10)/u)-1;return s(0<=f&&f<=9),c+=f*e.PENALTY_N4,s(0<=c&&c<=2568888),c}getAlignmentPatternPositions(){if(this.version==1)return[];{const c=Math.floor(this.version/7)+2,l=this.version==32?26:Math.ceil((this.version*4+4)/(c*2-2))*2;let u=[6];for(let f=this.size-7;u.lengthe.MAX_VERSION)throw new RangeError("Version number out of range");let l=(16*c+128)*c+64;if(c>=2){const u=Math.floor(c/7)+2;l-=(25*u-10)*u-55,c>=7&&(l-=36)}return s(208<=l&&l<=29648),l}static getNumDataCodewords(c,l){return Math.floor(e.getNumRawDataModules(c)/8)-e.ECC_CODEWORDS_PER_BLOCK[l.ordinal][c]*e.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][c]}static reedSolomonComputeDivisor(c){if(c<1||c>255)throw new RangeError("Degree out of range");let l=[];for(let f=0;f0);for(const f of c){const d=f^u.shift();u.push(0),l.forEach((h,p)=>u[p]^=e.reedSolomonMultiply(h,d))}return u}static reedSolomonMultiply(c,l){if(c>>>8||l>>>8)throw new RangeError("Byte out of range");let u=0;for(let f=7;f>=0;f--)u=u<<1^(u>>>7)*285,u^=(l>>>f&1)*c;return s(u>>>8==0),u}finderPenaltyCountPatterns(c){const l=c[1];s(l<=this.size*3);const u=l>0&&c[2]==l&&c[3]==l*3&&c[4]==l&&c[5]==l;return(u&&c[0]>=l*4&&c[6]>=l?1:0)+(u&&c[6]>=l*4&&c[0]>=l?1:0)}finderPenaltyTerminateAndCount(c,l,u){return c&&(this.finderPenaltyAddHistory(l,u),l=0),l+=this.size,this.finderPenaltyAddHistory(l,u),this.finderPenaltyCountPatterns(u)}finderPenaltyAddHistory(c,l){l[0]==0&&(c+=this.size),l.pop(),l.unshift(c)}};let r=e;r.MIN_VERSION=1,r.MAX_VERSION=40,r.PENALTY_N1=3,r.PENALTY_N2=3,r.PENALTY_N3=40,r.PENALTY_N4=10,r.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],r.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],t.QrCode=r;function n(c,l,u){if(l<0||l>31||c>>>l)throw new RangeError("Value out of range");for(let f=l-1;f>=0;f--)u.push(c>>>f&1)}function i(c,l){return(c>>>l&1)!=0}function s(c){if(!c)throw new Error("Assertion error")}const o=class{constructor(c,l,u){if(this.mode=c,this.numChars=l,this.bitData=u,l<0)throw new RangeError("Invalid argument");this.bitData=u.slice()}static makeBytes(c){let l=[];for(const u of c)n(u,8,l);return new o(o.Mode.BYTE,c.length,l)}static makeNumeric(c){if(!o.isNumeric(c))throw new RangeError("String contains non-numeric characters");let l=[];for(let u=0;u=1<{(e=>{const r=class{constructor(i,s){this.ordinal=i,this.formatBits=s}};let n=r;n.LOW=new r(0,1),n.MEDIUM=new r(1,0),n.QUARTILE=new r(2,3),n.HIGH=new r(3,2),e.Ecc=n})(t.QrCode||(t.QrCode={}))})(au||(au={}));(t=>{(e=>{const r=class{constructor(i,s){this.modeBits=i,this.numBitsCharCount=s}numCharCountBits(i){return this.numBitsCharCount[Math.floor((i+7)/17)]}};let n=r;n.NUMERIC=new r(1,[10,12,14]),n.ALPHANUMERIC=new r(2,[9,11,13]),n.BYTE=new r(4,[8,16,16]),n.KANJI=new r(8,[8,10,12]),n.ECI=new r(7,[0,0,0]),e.Mode=n})(t.QrSegment||(t.QrSegment={}))})(au||(au={}));var xf=au;/** - * @license qrcode.react - * Copyright (c) Paul O'Shannessy - * SPDX-License-Identifier: ISC - */var hH={L:xf.QrCode.Ecc.LOW,M:xf.QrCode.Ecc.MEDIUM,Q:xf.QrCode.Ecc.QUARTILE,H:xf.QrCode.Ecc.HIGH},pH=128,vH="L",mH="#FFFFFF",yH="#000000",gH=!1,XS=4,ySe=.1;function bH(t,e=0){const r=[];return t.forEach(function(n,i){let s=null;n.forEach(function(o,a){if(!o&&s!==null){r.push(`M${s+e} ${i+e}h${a-s}v1H${s+e}z`),s=null;return}if(a===n.length-1){if(!o)return;s===null?r.push(`M${a+e},${i+e} h1v1H${a+e}z`):r.push(`M${s+e},${i+e} h${a+1-s}v1H${s+e}z`);return}o&&s===null&&(s=a)})}),r.join("")}function wH(t,e){return t.slice().map((r,n)=>n=e.y+e.h?r:r.map((i,s)=>s=e.x+e.w?i:!1))}function xH(t,e,r,n){if(n==null)return null;const i=r?XS:0,s=t.length+i*2,o=Math.floor(e*ySe),a=s/e,c=(n.width||o)*a,l=(n.height||o)*a,u=n.x==null?t.length/2-c/2:n.x*a,f=n.y==null?t.length/2-l/2:n.y*a;let d=null;if(n.excavate){let h=Math.floor(u),p=Math.floor(f),v=Math.ceil(c+u-h),m=Math.ceil(l+f-p);d={x:h,y:p,w:v,h:m}}return{x:u,y:f,h:l,w:c,excavation:d}}var gSe=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}();function bSe(t){const e=t,{value:r,size:n=pH,level:i=vH,bgColor:s=mH,fgColor:o=yH,includeMargin:a=gH,style:c,imageSettings:l}=e,u=JS(e,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),f=l==null?void 0:l.src,d=k.useRef(null),h=k.useRef(null),[p,v]=k.useState(!1);k.useEffect(()=>{if(d.current!=null){const y=d.current,b=y.getContext("2d");if(!b)return;let C=xf.QrCode.encodeText(r,hH[i]).getModules();const A=a?XS:0,O=C.length+A*2,w=xH(C,n,a,l),I=h.current,B=w!=null&&I!==null&&I.complete&&I.naturalHeight!==0&&I.naturalWidth!==0;B&&w.excavation!=null&&(C=wH(C,w.excavation));const z=window.devicePixelRatio||1;y.height=y.width=n*z;const H=n/O*z;b.scale(H,H),b.fillStyle=s,b.fillRect(0,0,O,O),b.fillStyle=o,gSe?b.fill(new Path2D(bH(C,A))):C.forEach(function(K,F){K.forEach(function(x,P){x&&b.fillRect(P+A,F+A,1,1)})}),B&&b.drawImage(I,w.x+A,w.y+A,w.w,w.h)}}),k.useEffect(()=>{v(!1)},[f]);const m=D1({height:n,width:n},c);let g=null;return f!=null&&(g=S.createElement("img",{src:f,key:f,style:{display:"none"},onLoad:()=>{v(!0)},ref:h})),S.createElement(S.Fragment,null,S.createElement("canvas",D1({style:m,height:n,width:n,ref:d},u)),g)}function wSe(t){const e=t,{value:r,size:n=pH,level:i=vH,bgColor:s=mH,fgColor:o=yH,includeMargin:a=gH,imageSettings:c}=e,l=JS(e,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let u=xf.QrCode.encodeText(r,hH[i]).getModules();const f=a?XS:0,d=u.length+f*2,h=xH(u,n,a,c);let p=null;c!=null&&h!=null&&(h.excavation!=null&&(u=wH(u,h.excavation)),p=S.createElement("image",{xlinkHref:c.src,height:h.h,width:h.w,x:h.x+f,y:h.y+f,preserveAspectRatio:"none"}));const v=bH(u,f);return S.createElement("svg",D1({height:n,width:n,viewBox:`0 0 ${d} ${d}`},l),S.createElement("path",{fill:s,d:`M0,0 h${d}v${d}H0z`,shapeRendering:"crispEdges"}),S.createElement("path",{fill:o,d:v,shapeRendering:"crispEdges"}),p)}var xSe=t=>{const e=t,{renderAs:r}=e,n=JS(e,["renderAs"]);return r==="svg"?S.createElement(wSe,D1({},n)):S.createElement(bSe,D1({},n))},EH={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Sl,function(){var r=1e3,n=6e4,i=36e5,s="millisecond",o="second",a="minute",c="hour",l="day",u="week",f="month",d="quarter",h="year",p="date",v="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|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,y={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(x){var P=["th","st","nd","rd"],$=x%100;return"["+x+(P[($-20)%10]||P[$]||P[0])+"]"}},b=function(x,P,$){var D=String(x);return!D||D.length>=P?x:""+Array(P+1-D.length).join($)+x},C={s:b,z:function(x){var P=-x.utcOffset(),$=Math.abs(P),D=Math.floor($/60),_=$%60;return(P<=0?"+":"-")+b(D,2,"0")+":"+b(_,2,"0")},m:function x(P,$){if(P.date()<$.date())return-x($,P);var D=12*($.year()-P.year())+($.month()-P.month()),_=P.clone().add(D,f),N=$-_<0,L=P.clone().add(D+(N?-1:1),f);return+(-(D+($-_)/(N?_-L:L-_))||0)},a:function(x){return x<0?Math.ceil(x)||0:Math.floor(x)},p:function(x){return{M:f,y:h,w:u,d:l,D:p,h:c,m:a,s:o,ms:s,Q:d}[x]||String(x||"").toLowerCase().replace(/s$/,"")},u:function(x){return x===void 0}},A="en",O={};O[A]=y;var w="$isDayjsObject",I=function(x){return x instanceof K||!(!x||!x[w])},B=function x(P,$,D){var _;if(!P)return A;if(typeof P=="string"){var N=P.toLowerCase();O[N]&&(_=N),$&&(O[N]=$,_=N);var L=P.split("-");if(!_&&L.length>1)return x(L[0])}else{var R=P.name;O[R]=P,_=R}return!D&&_&&(A=_),_||!D&&A},z=function(x,P){if(I(x))return x.clone();var $=typeof P=="object"?P:{};return $.date=x,$.args=arguments,new K($)},H=C;H.l=B,H.i=I,H.w=function(x,P){return z(x,{locale:P.$L,utc:P.$u,x:P.$x,$offset:P.$offset})};var K=function(){function x($){this.$L=B($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[w]=!0}var P=x.prototype;return P.parse=function($){this.$d=function(D){var _=D.date,N=D.utc;if(_===null)return new Date(NaN);if(H.u(_))return new Date;if(_ instanceof Date)return new Date(_);if(typeof _=="string"&&!/Z$/i.test(_)){var L=_.match(m);if(L){var R=L[2]-1||0,E=(L[7]||"0").substring(0,3);return N?new Date(Date.UTC(L[1],R,L[3]||1,L[4]||0,L[5]||0,L[6]||0,E)):new Date(L[1],R,L[3]||1,L[4]||0,L[5]||0,L[6]||0,E)}}return new Date(_)}($),this.init()},P.init=function(){var $=this.$d;this.$y=$.getFullYear(),this.$M=$.getMonth(),this.$D=$.getDate(),this.$W=$.getDay(),this.$H=$.getHours(),this.$m=$.getMinutes(),this.$s=$.getSeconds(),this.$ms=$.getMilliseconds()},P.$utils=function(){return H},P.isValid=function(){return this.$d.toString()!==v},P.isSame=function($,D){var _=z($);return this.startOf(D)<=_&&_<=this.endOf(D)},P.isAfter=function($,D){return z($)`Invalid value for key ${t}`,ISe=t=>`Pattern length exceeds max of ${t}.`,OSe=t=>`Missing ${t} property in key`,RSe=t=>`Property 'weight' in key '${t}' must be a positive integer`,rI=Object.prototype.hasOwnProperty;class $Se{constructor(e){this._keys=[],this._keyMap={};let r=0;e.forEach(n=>{let i=_H(n);r+=i.weight,this._keys.push(i),this._keyMap[i.id]=i,r+=i.weight}),this._keys.forEach(n=>{n.weight/=r})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function _H(t){let e=null,r=null,n=null,i=1,s=null;if(so(t)||ca(t))n=t,e=nI(t),r=b8(t);else{if(!rI.call(t,"name"))throw new Error(OSe("name"));const o=t.name;if(n=o,rI.call(t,"weight")&&(i=t.weight,i<=0))throw new Error(RSe(o));e=nI(o),r=b8(o),s=t.getFn}return{path:e,id:r,weight:i,src:n,getFn:s}}function nI(t){return ca(t)?t:t.split(".")}function b8(t){return ca(t)?t.join("."):t}function MSe(t,e){let r=[],n=!1;const i=(s,o,a)=>{if(vi(s))if(!o[a])r.push(s);else{let c=o[a];const l=s[c];if(!vi(l))return;if(a===o.length-1&&(so(l)||SH(l)||ASe(l)))r.push(kSe(l));else if(ca(l)){n=!0;for(let u=0,f=l.length;ut.score===e.score?t.idx{this._keysMap[r.id]=n})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,so(this.docs[0])?this.docs.forEach((e,r)=>{this._addString(e,r)}):this.docs.forEach((e,r)=>{this._addObject(e,r)}),this.norm.clear())}add(e){const r=this.size();so(e)?this._addString(e,r):this._addObject(e,r)}removeAt(e){this.records.splice(e,1);for(let r=e,n=this.size();r{let o=i.getFn?i.getFn(e):this.getFn(e,i.path);if(vi(o)){if(ca(o)){let a=[];const c=[{nestedArrIndex:-1,value:o}];for(;c.length;){const{nestedArrIndex:l,value:u}=c.pop();if(vi(u))if(so(u)&&!qx(u)){let f={v:u,i:l,n:this.norm.get(u)};a.push(f)}else ca(u)&&u.forEach((f,d)=>{c.push({nestedArrIndex:d,value:f})})}n.$[s]=a}else if(so(o)&&!qx(o)){let a={v:o,n:this.norm.get(o)};n.$[s]=a}}}),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}}function PH(t,e,{getFn:r=Se.getFn,fieldNormWeight:n=Se.fieldNormWeight}={}){const i=new ZS({getFn:r,fieldNormWeight:n});return i.setKeys(t.map(_H)),i.setSources(e),i.create(),i}function USe(t,{getFn:e=Se.getFn,fieldNormWeight:r=Se.fieldNormWeight}={}){const{keys:n,records:i}=t,s=new ZS({getFn:e,fieldNormWeight:r});return s.setKeys(n),s.setIndexRecords(i),s}function Tv(t,{errors:e=0,currentLocation:r=0,expectedLocation:n=0,distance:i=Se.distance,ignoreLocation:s=Se.ignoreLocation}={}){const o=e/t.length;if(s)return o;const a=Math.abs(n-r);return i?o+a/i:a?1:o}function zSe(t=[],e=Se.minMatchCharLength){let r=[],n=-1,i=-1,s=0;for(let o=t.length;s=e&&r.push([n,i]),n=-1)}return t[s-1]&&s-n>=e&&r.push([n,s-1]),r}const Cl=32;function WSe(t,e,r,{location:n=Se.location,distance:i=Se.distance,threshold:s=Se.threshold,findAllMatches:o=Se.findAllMatches,minMatchCharLength:a=Se.minMatchCharLength,includeMatches:c=Se.includeMatches,ignoreLocation:l=Se.ignoreLocation}={}){if(e.length>Cl)throw new Error(ISe(Cl));const u=e.length,f=t.length,d=Math.max(0,Math.min(n,f));let h=s,p=d;const v=a>1||c,m=v?Array(f):[];let g;for(;(g=t.indexOf(e,p))>-1;){let w=Tv(e,{currentLocation:g,expectedLocation:d,distance:i,ignoreLocation:l});if(h=Math.min(w,h),p=g+u,v){let I=0;for(;I=z;x-=1){let P=x-1,$=r[t.charAt(P)];if(v&&(m[P]=+!!$),K[x]=(K[x+1]<<1|1)&$,w&&(K[x]|=(y[x+1]|y[x])<<1|1|y[x+1]),K[x]&A&&(b=Tv(e,{errors:w,currentLocation:P,expectedLocation:d,distance:i,ignoreLocation:l}),b<=h)){if(h=b,p=P,p<=d)break;z=Math.max(1,2*d-p)}}if(Tv(e,{errors:w+1,currentLocation:d,expectedLocation:d,distance:i,ignoreLocation:l})>h)break;y=K}const O={isMatch:p>=0,score:Math.max(.001,b)};if(v){const w=zSe(m,a);w.length?c&&(O.indices=w):O.isMatch=!1}return O}function HSe(t){let e={};for(let r=0,n=t.length;r{this.chunks.push({pattern:d,alphabet:HSe(d),startIndex:h})},f=this.pattern.length;if(f>Cl){let d=0;const h=f%Cl,p=f-h;for(;d{const{isMatch:g,score:y,indices:b}=WSe(e,p,v,{location:i+m,distance:s,threshold:o,findAllMatches:a,minMatchCharLength:c,includeMatches:n,ignoreLocation:l});g&&(d=!0),f+=y,g&&b&&(u=[...u,...b])});let h={isMatch:d,score:d?f/this.chunks.length:1};return d&&n&&(h.indices=u),h}}class Jc{constructor(e){this.pattern=e}static isMultiMatch(e){return iI(e,this.multiRegex)}static isSingleMatch(e){return iI(e,this.singleRegex)}search(){}}function iI(t,e){const r=t.match(e);return r?r[1]:null}class qSe extends Jc{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const r=e===this.pattern;return{isMatch:r,score:r?0:1,indices:[0,this.pattern.length-1]}}}class VSe extends Jc{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const n=e.indexOf(this.pattern)===-1;return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class GSe extends Jc{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const r=e.startsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,this.pattern.length-1]}}}class KSe extends Jc{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const r=!e.startsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}}class QSe extends Jc{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const r=e.endsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class YSe extends Jc{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const r=!e.endsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}}class IH extends Jc{constructor(e,{location:r=Se.location,threshold:n=Se.threshold,distance:i=Se.distance,includeMatches:s=Se.includeMatches,findAllMatches:o=Se.findAllMatches,minMatchCharLength:a=Se.minMatchCharLength,isCaseSensitive:c=Se.isCaseSensitive,ignoreLocation:l=Se.ignoreLocation}={}){super(e),this._bitapSearch=new TH(e,{location:r,threshold:n,distance:i,includeMatches:s,findAllMatches:o,minMatchCharLength:a,isCaseSensitive:c,ignoreLocation:l})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class OH extends Jc{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let r=0,n;const i=[],s=this.pattern.length;for(;(n=e.indexOf(this.pattern,r))>-1;)r=n+s,i.push([n,r-1]);const o=!!i.length;return{isMatch:o,score:o?0:1,indices:i}}}const w8=[qSe,OH,GSe,KSe,YSe,QSe,VSe,IH],sI=w8.length,JSe=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,XSe="|";function ZSe(t,e={}){return t.split(XSe).map(r=>{let n=r.trim().split(JSe).filter(s=>s&&!!s.trim()),i=[];for(let s=0,o=n.length;s!!(t[wg.AND]||t[wg.OR]),n9e=t=>!!t[C8.PATH],i9e=t=>!ca(t)&&kH(t)&&!S8(t),oI=t=>({[wg.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function RH(t,e,{auto:r=!0}={}){const n=i=>{let s=Object.keys(i);const o=n9e(i);if(!o&&s.length>1&&!S8(i))return n(oI(i));if(i9e(i)){const c=o?i[C8.PATH]:s[0],l=o?i[C8.PATTERN]:i[c];if(!so(l))throw new Error(TSe(c));const u={keyId:b8(c),pattern:l};return r&&(u.searcher=E8(l,e)),u}let a={children:[],operator:s[0]};return s.forEach(c=>{const l=i[c];ca(l)&&l.forEach(u=>{a.children.push(n(u))})}),a};return S8(t)||(t=oI(t)),n(t)}function s9e(t,{ignoreFieldNorm:e=Se.ignoreFieldNorm}){t.forEach(r=>{let n=1;r.matches.forEach(({key:i,norm:s,score:o})=>{const a=i?i.weight:null;n*=Math.pow(o===0&&a?Number.EPSILON:o,(a||1)*(e?1:s))}),r.score=n})}function o9e(t,e){const r=t.matches;e.matches=[],vi(r)&&r.forEach(n=>{if(!vi(n.indices)||!n.indices.length)return;const{indices:i,value:s}=n;let o={indices:i,value:s};n.key&&(o.key=n.key.src),n.idx>-1&&(o.refIndex=n.idx),e.matches.push(o)})}function a9e(t,e){e.score=t.score}function c9e(t,e,{includeMatches:r=Se.includeMatches,includeScore:n=Se.includeScore}={}){const i=[];return r&&i.push(o9e),n&&i.push(a9e),t.map(s=>{const{idx:o}=s,a={item:e[o],refIndex:o};return i.length&&i.forEach(c=>{c(s,a)}),a})}class la{constructor(e,r={},n){this.options={...Se,...r},this.options.useExtendedSearch,this._keyStore=new $Se(this.options.keys),this.setCollection(e,n)}setCollection(e,r){if(this._docs=e,r&&!(r instanceof ZS))throw new Error(PSe);this._myIndex=r||PH(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){vi(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const r=[];for(let n=0,i=this._docs.length;n-1&&(c=c.slice(0,r)),c9e(c,this._docs,{includeMatches:n,includeScore:i})}_searchStringList(e){const r=E8(e,this.options),{records:n}=this._myIndex,i=[];return n.forEach(({v:s,i:o,n:a})=>{if(!vi(s))return;const{isMatch:c,score:l,indices:u}=r.searchIn(s);c&&i.push({item:s,idx:o,matches:[{score:l,value:s,norm:a,indices:u}]})}),i}_searchLogical(e){const r=RH(e,this.options),n=(a,c,l)=>{if(!a.children){const{keyId:f,searcher:d}=a,h=this._findMatches({key:this._keyStore.get(f),value:this._myIndex.getValueForItemAtKeyId(c,f),searcher:d});return h&&h.length?[{idx:l,item:c,matches:h}]:[]}const u=[];for(let f=0,d=a.children.length;f{if(vi(a)){let l=n(r,a,c);l.length&&(s[c]||(s[c]={idx:c,item:a,matches:[]},o.push(s[c])),l.forEach(({matches:u})=>{s[c].matches.push(...u)}))}}),o}_searchObjectList(e){const r=E8(e,this.options),{keys:n,records:i}=this._myIndex,s=[];return i.forEach(({$:o,i:a})=>{if(!vi(o))return;let c=[];n.forEach((l,u)=>{c.push(...this._findMatches({key:l,value:o[u],searcher:r}))}),c.length&&s.push({idx:a,item:o,matches:c})}),s}_findMatches({key:e,value:r,searcher:n}){if(!vi(r))return[];let i=[];if(ca(r))r.forEach(({v:s,i:o,n:a})=>{if(!vi(s))return;const{isMatch:c,score:l,indices:u}=n.searchIn(s);c&&i.push({score:l,key:e,value:s,idx:o,norm:a,indices:u})});else{const{v:s,n:o}=r,{isMatch:a,score:c,indices:l}=n.searchIn(s);a&&i.push({score:c,key:e,value:s,norm:o,indices:l})}return i}}la.version="6.6.2";la.createIndex=PH;la.parseIndex=USe;la.config=Se;la.parseQuery=RH;r9e(t9e);function $H(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;et.forEach(r=>u9e(r,e))}function Au(...t){return k.useCallback(MH(...t),t)}function NH(t,e=[]){let r=[];function n(s,o){const a=k.createContext(o),c=r.length;r=[...r,o];function l(f){const{scope:d,children:h,...p}=f,v=(d==null?void 0:d[t][c])||a,m=k.useMemo(()=>p,Object.values(p));return k.createElement(v.Provider,{value:m},h)}function u(f,d){const h=(d==null?void 0:d[t][c])||a,p=k.useContext(h);if(p)return p;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${s}\``)}return l.displayName=s+"Provider",[l,u]}const i=()=>{const s=r.map(o=>k.createContext(o));return function(a){const c=(a==null?void 0:a[t])||s;return k.useMemo(()=>({[`__scope${t}`]:{...a,[t]:c}}),[a,c])}};return i.scopeName=t,[n,f9e(i,...e)]}function f9e(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=n.reduce((a,{useScope:c,scopeName:l})=>{const f=c(s)[`__scope${l}`];return{...a,...f}},{});return k.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return r.scopeName=e.scopeName,r}const e9=k.forwardRef((t,e)=>{const{children:r,...n}=t,i=k.Children.toArray(r),s=i.find(h9e);if(s){const o=s.props.children,a=i.map(c=>c===s?k.Children.count(o)>1?k.Children.only(null):k.isValidElement(o)?o.props.children:null:c);return k.createElement(k8,ln({},n,{ref:e}),k.isValidElement(o)?k.cloneElement(o,void 0,a):null)}return k.createElement(k8,ln({},n,{ref:e}),r)});e9.displayName="Slot";const k8=k.forwardRef((t,e)=>{const{children:r,...n}=t;return k.isValidElement(r)?k.cloneElement(r,{...p9e(n,r.props),ref:e?MH(e,r.ref):r.ref}):k.Children.count(r)>1?k.Children.only(null):null});k8.displayName="SlotClone";const d9e=({children:t})=>k.createElement(k.Fragment,null,t);function h9e(t){return k.isValidElement(t)&&t.type===d9e}function p9e(t,e){const r={...e};for(const n in e){const i=t[n],s=e[n];/^on[A-Z]/.test(n)?i&&s?r[n]=(...a)=>{s(...a),i(...a)}:i&&(r[n]=i):n==="style"?r[n]={...i,...s}:n==="className"&&(r[n]=[i,s].filter(Boolean).join(" "))}return{...t,...r}}const v9e=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Tp=v9e.reduce((t,e)=>{const r=k.forwardRef((n,i)=>{const{asChild:s,...o}=n,a=s?e9:e;return k.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),k.createElement(a,ln({},o,{ref:i}))});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function m9e(t,e){t&&$s.flushSync(()=>t.dispatchEvent(e))}function Nc(t){const e=k.useRef(t);return k.useEffect(()=>{e.current=t}),k.useMemo(()=>(...r)=>{var n;return(n=e.current)===null||n===void 0?void 0:n.call(e,...r)},[])}function y9e(t,e=globalThis==null?void 0:globalThis.document){const r=Nc(t);k.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)},[r,e])}const A8="dismissableLayer.update",g9e="dismissableLayer.pointerDownOutside",b9e="dismissableLayer.focusOutside";let aI;const w9e=k.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),x9e=k.forwardRef((t,e)=>{var r;const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:c,...l}=t,u=k.useContext(w9e),[f,d]=k.useState(null),h=(r=f==null?void 0:f.ownerDocument)!==null&&r!==void 0?r:globalThis==null?void 0:globalThis.document,[,p]=k.useState({}),v=Au(e,I=>d(I)),m=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(g),b=f?m.indexOf(f):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,A=b>=y,O=E9e(I=>{const B=I.target,z=[...u.branches].some(H=>H.contains(B));!A||z||(s==null||s(I),a==null||a(I),I.defaultPrevented||c==null||c())},h),w=C9e(I=>{const B=I.target;[...u.branches].some(H=>H.contains(B))||(o==null||o(I),a==null||a(I),I.defaultPrevented||c==null||c())},h);return y9e(I=>{b===u.layers.size-1&&(i==null||i(I),!I.defaultPrevented&&c&&(I.preventDefault(),c()))},h),k.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(aI=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),cI(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=aI)}},[f,h,n,u]),k.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),cI())},[f,u]),k.useEffect(()=>{const I=()=>p({});return document.addEventListener(A8,I),()=>document.removeEventListener(A8,I)},[]),k.createElement(Tp.div,ln({},l,{ref:v,style:{pointerEvents:C?A?"auto":"none":void 0,...t.style},onFocusCapture:Hl(t.onFocusCapture,w.onFocusCapture),onBlurCapture:Hl(t.onBlurCapture,w.onBlurCapture),onPointerDownCapture:Hl(t.onPointerDownCapture,O.onPointerDownCapture)}))});function E9e(t,e=globalThis==null?void 0:globalThis.document){const r=Nc(t),n=k.useRef(!1),i=k.useRef(()=>{});return k.useEffect(()=>{const s=a=>{if(a.target&&!n.current){let l=function(){DH(g9e,r,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=l,e.addEventListener("click",i.current,{once:!0})):l()}else e.removeEventListener("click",i.current);n.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function C9e(t,e=globalThis==null?void 0:globalThis.document){const r=Nc(t),n=k.useRef(!1);return k.useEffect(()=>{const i=s=>{s.target&&!n.current&&DH(b9e,r,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function cI(){const t=new CustomEvent(A8);document.dispatchEvent(t)}function DH(t,e,r,{discrete:n}){const i=r.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&i.addEventListener(t,e,{once:!0}),n?m9e(i,s):i.dispatchEvent(s)}let Vx=0;function S9e(){k.useEffect(()=>{var t,e;const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(t=r[0])!==null&&t!==void 0?t:lI()),document.body.insertAdjacentElement("beforeend",(e=r[1])!==null&&e!==void 0?e:lI()),Vx++,()=>{Vx===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),Vx--}},[])}function lI(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",t}const Gx="focusScope.autoFocusOnMount",Kx="focusScope.autoFocusOnUnmount",uI={bubbles:!1,cancelable:!0},k9e=k.forwardRef((t,e)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=t,[a,c]=k.useState(null),l=Nc(i),u=Nc(s),f=k.useRef(null),d=Au(e,v=>c(v)),h=k.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;k.useEffect(()=>{if(n){let v=function(b){if(h.paused||!a)return;const C=b.target;a.contains(C)?f.current=C:La(f.current,{select:!0})},m=function(b){if(h.paused||!a)return;const C=b.relatedTarget;C!==null&&(a.contains(C)||La(f.current,{select:!0}))},g=function(b){if(document.activeElement===document.body)for(const A of b)A.removedNodes.length>0&&La(a)};document.addEventListener("focusin",v),document.addEventListener("focusout",m);const y=new MutationObserver(g);return a&&y.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",m),y.disconnect()}}},[n,a,h.paused]),k.useEffect(()=>{if(a){dI.add(h);const v=document.activeElement;if(!a.contains(v)){const g=new CustomEvent(Gx,uI);a.addEventListener(Gx,l),a.dispatchEvent(g),g.defaultPrevented||(A9e(O9e(LH(a)),{select:!0}),document.activeElement===v&&La(a))}return()=>{a.removeEventListener(Gx,l),setTimeout(()=>{const g=new CustomEvent(Kx,uI);a.addEventListener(Kx,u),a.dispatchEvent(g),g.defaultPrevented||La(v??document.body,{select:!0}),a.removeEventListener(Kx,u),dI.remove(h)},0)}}},[a,l,u,h]);const p=k.useCallback(v=>{if(!r&&!n||h.paused)return;const m=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,g=document.activeElement;if(m&&g){const y=v.currentTarget,[b,C]=_9e(y);b&&C?!v.shiftKey&&g===C?(v.preventDefault(),r&&La(b,{select:!0})):v.shiftKey&&g===b&&(v.preventDefault(),r&&La(C,{select:!0})):g===y&&v.preventDefault()}},[r,n,h.paused]);return k.createElement(Tp.div,ln({tabIndex:-1},o,{ref:d,onKeyDown:p}))});function A9e(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(La(n,{select:e}),document.activeElement!==r)return}function _9e(t){const e=LH(t),r=fI(e,t),n=fI(e.reverse(),t);return[r,n]}function LH(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function fI(t,e){for(const r of t)if(!P9e(r,{upTo:e}))return r}function P9e(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function T9e(t){return t instanceof HTMLInputElement&&"select"in t}function La(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&T9e(t)&&e&&t.select()}}const dI=I9e();function I9e(){let t=[];return{add(e){const r=t[0];e!==r&&(r==null||r.pause()),t=hI(t,e),t.unshift(e)},remove(e){var r;t=hI(t,e),(r=t[0])===null||r===void 0||r.resume()}}}function hI(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function O9e(t){return t.filter(e=>e.tagName!=="A")}const gd=globalThis!=null&&globalThis.document?k.useLayoutEffect:()=>{},R9e=sO["useId".toString()]||(()=>{});let $9e=0;function M9e(t){const[e,r]=k.useState(R9e());return gd(()=>{t||r(n=>n??String($9e++))},[t]),t||(e?`radix-${e}`:"")}const N9e=["top","right","bottom","left"],Dc=Math.min,mi=Math.max,xg=Math.round,Iv=Math.floor,Lc=t=>({x:t,y:t}),D9e={left:"right",right:"left",bottom:"top",top:"bottom"},L9e={start:"end",end:"start"};function _8(t,e,r){return mi(t,Dc(e,r))}function ua(t,e){return typeof t=="function"?t(e):t}function fa(t){return t.split("-")[0]}function Zd(t){return t.split("-")[1]}function t9(t){return t==="x"?"y":"x"}function r9(t){return t==="y"?"height":"width"}function eh(t){return["top","bottom"].includes(fa(t))?"y":"x"}function n9(t){return t9(eh(t))}function B9e(t,e,r){r===void 0&&(r=!1);const n=Zd(t),i=n9(t),s=r9(i);let o=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=Eg(o)),[o,Eg(o)]}function F9e(t){const e=Eg(t);return[P8(t),e,P8(e)]}function P8(t){return t.replace(/start|end/g,e=>L9e[e])}function j9e(t,e,r){const n=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return r?e?i:n:e?n:i;case"left":case"right":return e?s:o;default:return[]}}function U9e(t,e,r,n){const i=Zd(t);let s=j9e(fa(t),r==="start",n);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(P8)))),s}function Eg(t){return t.replace(/left|right|bottom|top/g,e=>D9e[e])}function z9e(t){return{top:0,right:0,bottom:0,left:0,...t}}function BH(t){return typeof t!="number"?z9e(t):{top:t,right:t,bottom:t,left:t}}function Cg(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function pI(t,e,r){let{reference:n,floating:i}=t;const s=eh(e),o=n9(e),a=r9(o),c=fa(e),l=s==="y",u=n.x+n.width/2-i.width/2,f=n.y+n.height/2-i.height/2,d=n[a]/2-i[a]/2;let h;switch(c){case"top":h={x:u,y:n.y-i.height};break;case"bottom":h={x:u,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:f};break;case"left":h={x:n.x-i.width,y:f};break;default:h={x:n.x,y:n.y}}switch(Zd(e)){case"start":h[o]-=d*(r&&l?-1:1);break;case"end":h[o]+=d*(r&&l?-1:1);break}return h}const W9e=async(t,e,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:o}=r,a=s.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(e));let l=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=pI(l,n,c),d=n,h={},p=0;for(let v=0;v({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:i,rects:s,platform:o,elements:a,middlewareData:c}=e,{element:l,padding:u=0}=ua(t,e)||{};if(l==null)return{};const f=BH(u),d={x:r,y:n},h=n9(i),p=r9(h),v=await o.getDimensions(l),m=h==="y",g=m?"top":"left",y=m?"bottom":"right",b=m?"clientHeight":"clientWidth",C=s.reference[p]+s.reference[h]-d[h]-s.floating[p],A=d[h]-s.reference[h],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l));let w=O?O[b]:0;(!w||!await(o.isElement==null?void 0:o.isElement(O)))&&(w=a.floating[b]||s.floating[p]);const I=C/2-A/2,B=w/2-v[p]/2-1,z=Dc(f[g],B),H=Dc(f[y],B),K=z,F=w-v[p]-H,x=w/2-v[p]/2+I,P=_8(K,x,F),$=!c.arrow&&Zd(i)!=null&&x!=P&&s.reference[p]/2-(xK<=0)){var B,z;const K=(((B=s.flip)==null?void 0:B.index)||0)+1,F=A[K];if(F)return{data:{index:K,overflows:I},reset:{placement:F}};let x=(z=I.filter(P=>P.overflows[0]<=0).sort((P,$)=>P.overflows[1]-$.overflows[1])[0])==null?void 0:z.placement;if(!x)switch(h){case"bestFit":{var H;const P=(H=I.map($=>[$.placement,$.overflows.filter(D=>D>0).reduce((D,_)=>D+_,0)]).sort(($,D)=>$[1]-D[1])[0])==null?void 0:H[0];P&&(x=P);break}case"initialPlacement":x=a;break}if(i!==x)return{reset:{placement:x}}}return{}}}};function mI(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function yI(t){return N9e.some(e=>t[e]>=0)}const q9e=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...i}=ua(t,e);switch(n){case"referenceHidden":{const s=await L1(e,{...i,elementContext:"reference"}),o=mI(s,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:yI(o)}}}case"escaped":{const s=await L1(e,{...i,altBoundary:!0}),o=mI(s,r.floating);return{data:{escapedOffsets:o,escaped:yI(o)}}}default:return{}}}}};async function V9e(t,e){const{placement:r,platform:n,elements:i}=t,s=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=fa(r),a=Zd(r),c=eh(r)==="y",l=["left","top"].includes(o)?-1:1,u=s&&c?-1:1,f=ua(e,t);let{mainAxis:d,crossAxis:h,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof p=="number"&&(h=a==="end"?p*-1:p),c?{x:h*u,y:d*l}:{x:d*l,y:h*u}}const G9e=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){const{x:r,y:n}=e,i=await V9e(e,t);return{x:r+i.x,y:n+i.y,data:i}}}},K9e=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:m=>{let{x:g,y}=m;return{x:g,y}}},...c}=ua(t,e),l={x:r,y:n},u=await L1(e,c),f=eh(fa(i)),d=t9(f);let h=l[d],p=l[f];if(s){const m=d==="y"?"top":"left",g=d==="y"?"bottom":"right",y=h+u[m],b=h-u[g];h=_8(y,h,b)}if(o){const m=f==="y"?"top":"left",g=f==="y"?"bottom":"right",y=p+u[m],b=p-u[g];p=_8(y,p,b)}const v=a.fn({...e,[d]:h,[f]:p});return{...v,data:{x:v.x-r,y:v.y-n}}}}},Q9e=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=ua(t,e),u={x:r,y:n},f=eh(i),d=t9(f);let h=u[d],p=u[f];const v=ua(a,e),m=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const b=d==="y"?"height":"width",C=s.reference[d]-s.floating[b]+m.mainAxis,A=s.reference[d]+s.reference[b]-m.mainAxis;hA&&(h=A)}if(l){var g,y;const b=d==="y"?"width":"height",C=["top","left"].includes(fa(i)),A=s.reference[f]-s.floating[b]+(C&&((g=o.offset)==null?void 0:g[f])||0)+(C?0:m.crossAxis),O=s.reference[f]+s.reference[b]+(C?0:((y=o.offset)==null?void 0:y[f])||0)-(C?m.crossAxis:0);pO&&(p=O)}return{[d]:h,[f]:p}}}},Y9e=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:r,rects:n,platform:i,elements:s}=e,{apply:o=()=>{},...a}=ua(t,e),c=await L1(e,a),l=fa(r),u=Zd(r),f=eh(r)==="y",{width:d,height:h}=n.floating;let p,v;l==="top"||l==="bottom"?(p=l,v=u===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(v=l,p=u==="end"?"top":"bottom");const m=h-c[p],g=d-c[v],y=!e.middlewareData.shift;let b=m,C=g;if(f){const O=d-c.left-c.right;C=u||y?Dc(g,O):O}else{const O=h-c.top-c.bottom;b=u||y?Dc(m,O):O}if(y&&!u){const O=mi(c.left,0),w=mi(c.right,0),I=mi(c.top,0),B=mi(c.bottom,0);f?C=d-2*(O!==0||w!==0?O+w:mi(c.left,c.right)):b=h-2*(I!==0||B!==0?I+B:mi(c.top,c.bottom))}await o({...e,availableWidth:C,availableHeight:b});const A=await i.getDimensions(s.floating);return d!==A.width||h!==A.height?{reset:{rects:!0}}:{}}}};function Bc(t){return FH(t)?(t.nodeName||"").toLowerCase():"#document"}function xi(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Sa(t){var e;return(e=(FH(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function FH(t){return t instanceof Node||t instanceof xi(t).Node}function da(t){return t instanceof Element||t instanceof xi(t).Element}function ko(t){return t instanceof HTMLElement||t instanceof xi(t).HTMLElement}function gI(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof xi(t).ShadowRoot}function Ip(t){const{overflow:e,overflowX:r,overflowY:n,display:i}=Xi(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!["inline","contents"].includes(i)}function J9e(t){return["table","td","th"].includes(Bc(t))}function i9(t){const e=s9(),r=Xi(t);return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function X9e(t){let e=bd(t);for(;ko(e)&&!I2(e);){if(i9(e))return e;e=bd(e)}return null}function s9(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function I2(t){return["html","body","#document"].includes(Bc(t))}function Xi(t){return xi(t).getComputedStyle(t)}function O2(t){return da(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function bd(t){if(Bc(t)==="html")return t;const e=t.assignedSlot||t.parentNode||gI(t)&&t.host||Sa(t);return gI(e)?e.host:e}function jH(t){const e=bd(t);return I2(e)?t.ownerDocument?t.ownerDocument.body:t.body:ko(e)&&Ip(e)?e:jH(e)}function B1(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const i=jH(t),s=i===((n=t.ownerDocument)==null?void 0:n.body),o=xi(i);return s?e.concat(o,o.visualViewport||[],Ip(i)?i:[],o.frameElement&&r?B1(o.frameElement):[]):e.concat(i,B1(i,[],r))}function UH(t){const e=Xi(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=ko(t),s=i?t.offsetWidth:r,o=i?t.offsetHeight:n,a=xg(r)!==s||xg(n)!==o;return a&&(r=s,n=o),{width:r,height:n,$:a}}function o9(t){return da(t)?t:t.contextElement}function Uf(t){const e=o9(t);if(!ko(e))return Lc(1);const r=e.getBoundingClientRect(),{width:n,height:i,$:s}=UH(e);let o=(s?xg(r.width):r.width)/n,a=(s?xg(r.height):r.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const Z9e=Lc(0);function zH(t){const e=xi(t);return!s9()||!e.visualViewport?Z9e:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function e7e(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==xi(t)?!1:e}function cu(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const i=t.getBoundingClientRect(),s=o9(t);let o=Lc(1);e&&(n?da(n)&&(o=Uf(n)):o=Uf(t));const a=e7e(s,r,n)?zH(s):Lc(0);let c=(i.left+a.x)/o.x,l=(i.top+a.y)/o.y,u=i.width/o.x,f=i.height/o.y;if(s){const d=xi(s),h=n&&da(n)?xi(n):n;let p=d.frameElement;for(;p&&n&&h!==d;){const v=Uf(p),m=p.getBoundingClientRect(),g=Xi(p),y=m.left+(p.clientLeft+parseFloat(g.paddingLeft))*v.x,b=m.top+(p.clientTop+parseFloat(g.paddingTop))*v.y;c*=v.x,l*=v.y,u*=v.x,f*=v.y,c+=y,l+=b,p=xi(p).frameElement}}return Cg({width:u,height:f,x:c,y:l})}function t7e(t){let{rect:e,offsetParent:r,strategy:n}=t;const i=ko(r),s=Sa(r);if(r===s)return e;let o={scrollLeft:0,scrollTop:0},a=Lc(1);const c=Lc(0);if((i||!i&&n!=="fixed")&&((Bc(r)!=="body"||Ip(s))&&(o=O2(r)),ko(r))){const l=cu(r);a=Uf(r),c.x=l.x+r.clientLeft,c.y=l.y+r.clientTop}return{width:e.width*a.x,height:e.height*a.y,x:e.x*a.x-o.scrollLeft*a.x+c.x,y:e.y*a.y-o.scrollTop*a.y+c.y}}function r7e(t){return Array.from(t.getClientRects())}function WH(t){return cu(Sa(t)).left+O2(t).scrollLeft}function n7e(t){const e=Sa(t),r=O2(t),n=t.ownerDocument.body,i=mi(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=mi(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+WH(t);const a=-r.scrollTop;return Xi(n).direction==="rtl"&&(o+=mi(e.clientWidth,n.clientWidth)-i),{width:i,height:s,x:o,y:a}}function i7e(t,e){const r=xi(t),n=Sa(t),i=r.visualViewport;let s=n.clientWidth,o=n.clientHeight,a=0,c=0;if(i){s=i.width,o=i.height;const l=s9();(!l||l&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:s,height:o,x:a,y:c}}function s7e(t,e){const r=cu(t,!0,e==="fixed"),n=r.top+t.clientTop,i=r.left+t.clientLeft,s=ko(t)?Uf(t):Lc(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,c=i*s.x,l=n*s.y;return{width:o,height:a,x:c,y:l}}function bI(t,e,r){let n;if(e==="viewport")n=i7e(t,r);else if(e==="document")n=n7e(Sa(t));else if(da(e))n=s7e(e,r);else{const i=zH(t);n={...e,x:e.x-i.x,y:e.y-i.y}}return Cg(n)}function HH(t,e){const r=bd(t);return r===e||!da(r)||I2(r)?!1:Xi(r).position==="fixed"||HH(r,e)}function o7e(t,e){const r=e.get(t);if(r)return r;let n=B1(t,[],!1).filter(a=>da(a)&&Bc(a)!=="body"),i=null;const s=Xi(t).position==="fixed";let o=s?bd(t):t;for(;da(o)&&!I2(o);){const a=Xi(o),c=i9(o);!c&&a.position==="fixed"&&(i=null),(s?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Ip(o)&&!c&&HH(t,o))?n=n.filter(u=>u!==o):i=a,o=bd(o)}return e.set(t,n),n}function a7e(t){let{element:e,boundary:r,rootBoundary:n,strategy:i}=t;const o=[...r==="clippingAncestors"?o7e(e,this._c):[].concat(r),n],a=o[0],c=o.reduce((l,u)=>{const f=bI(e,u,i);return l.top=mi(f.top,l.top),l.right=Dc(f.right,l.right),l.bottom=Dc(f.bottom,l.bottom),l.left=mi(f.left,l.left),l},bI(e,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function c7e(t){return UH(t)}function l7e(t,e,r){const n=ko(e),i=Sa(e),s=r==="fixed",o=cu(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const c=Lc(0);if(n||!n&&!s)if((Bc(e)!=="body"||Ip(i))&&(a=O2(e)),n){const l=cu(e,!0,s,e);c.x=l.x+e.clientLeft,c.y=l.y+e.clientTop}else i&&(c.x=WH(i));return{x:o.left+a.scrollLeft-c.x,y:o.top+a.scrollTop-c.y,width:o.width,height:o.height}}function wI(t,e){return!ko(t)||Xi(t).position==="fixed"?null:e?e(t):t.offsetParent}function qH(t,e){const r=xi(t);if(!ko(t))return r;let n=wI(t,e);for(;n&&J9e(n)&&Xi(n).position==="static";)n=wI(n,e);return n&&(Bc(n)==="html"||Bc(n)==="body"&&Xi(n).position==="static"&&!i9(n))?r:n||X9e(t)||r}const u7e=async function(t){let{reference:e,floating:r,strategy:n}=t;const i=this.getOffsetParent||qH,s=this.getDimensions;return{reference:l7e(e,await i(r),n),floating:{x:0,y:0,...await s(r)}}};function f7e(t){return Xi(t).direction==="rtl"}const d7e={convertOffsetParentRelativeRectToViewportRelativeRect:t7e,getDocumentElement:Sa,getClippingRect:a7e,getOffsetParent:qH,getElementRects:u7e,getClientRects:r7e,getDimensions:c7e,getScale:Uf,isElement:da,isRTL:f7e};function h7e(t,e){let r=null,n;const i=Sa(t);function s(){clearTimeout(n),r&&r.disconnect(),r=null}function o(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const{left:l,top:u,width:f,height:d}=t.getBoundingClientRect();if(a||e(),!f||!d)return;const h=Iv(u),p=Iv(i.clientWidth-(l+f)),v=Iv(i.clientHeight-(u+d)),m=Iv(l),y={rootMargin:-h+"px "+-p+"px "+-v+"px "+-m+"px",threshold:mi(0,Dc(1,c))||1};let b=!0;function C(A){const O=A[0].intersectionRatio;if(O!==c){if(!b)return o();O?o(!1,O):n=setTimeout(()=>{o(!1,1e-7)},100)}b=!1}try{r=new IntersectionObserver(C,{...y,root:i.ownerDocument})}catch{r=new IntersectionObserver(C,y)}r.observe(t)}return o(!0),s}function p7e(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,l=o9(t),u=i||s?[...l?B1(l):[],...B1(e)]:[];u.forEach(g=>{i&&g.addEventListener("scroll",r,{passive:!0}),s&&g.addEventListener("resize",r)});const f=l&&a?h7e(l,r):null;let d=-1,h=null;o&&(h=new ResizeObserver(g=>{let[y]=g;y&&y.target===l&&h&&(h.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{h&&h.observe(e)})),r()}),l&&!c&&h.observe(l),h.observe(e));let p,v=c?cu(t):null;c&&m();function m(){const g=cu(t);v&&(g.x!==v.x||g.y!==v.y||g.width!==v.width||g.height!==v.height)&&r(),v=g,p=requestAnimationFrame(m)}return r(),()=>{u.forEach(g=>{i&&g.removeEventListener("scroll",r),s&&g.removeEventListener("resize",r)}),f&&f(),h&&h.disconnect(),h=null,c&&cancelAnimationFrame(p)}}const v7e=(t,e,r)=>{const n=new Map,i={platform:d7e,...r},s={...i.platform,_c:n};return W9e(t,e,{...i,platform:s})},m7e=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:i}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?vI({element:n.current,padding:i}).fn(r):{}:n?vI({element:n,padding:i}).fn(r):{}}}};var Cm=typeof document<"u"?k.useLayoutEffect:k.useEffect;function Sg(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!Sg(t[n],e[n]))return!1;return!0}if(i=Object.keys(t),r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){const s=i[n];if(!(s==="_owner"&&t.$$typeof)&&!Sg(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function VH(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function xI(t,e){const r=VH(t);return Math.round(e*r)/r}function EI(t){const e=k.useRef(t);return Cm(()=>{e.current=t}),e}function y7e(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:c,open:l}=t,[u,f]=k.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[d,h]=k.useState(n);Sg(d,n)||h(n);const[p,v]=k.useState(null),[m,g]=k.useState(null),y=k.useCallback($=>{$!=O.current&&(O.current=$,v($))},[v]),b=k.useCallback($=>{$!==w.current&&(w.current=$,g($))},[g]),C=s||p,A=o||m,O=k.useRef(null),w=k.useRef(null),I=k.useRef(u),B=EI(c),z=EI(i),H=k.useCallback(()=>{if(!O.current||!w.current)return;const $={placement:e,strategy:r,middleware:d};z.current&&($.platform=z.current),v7e(O.current,w.current,$).then(D=>{const _={...D,isPositioned:!0};K.current&&!Sg(I.current,_)&&(I.current=_,$s.flushSync(()=>{f(_)}))})},[d,e,r,z]);Cm(()=>{l===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,f($=>({...$,isPositioned:!1})))},[l]);const K=k.useRef(!1);Cm(()=>(K.current=!0,()=>{K.current=!1}),[]),Cm(()=>{if(C&&(O.current=C),A&&(w.current=A),C&&A){if(B.current)return B.current(C,A,H);H()}},[C,A,H,B]);const F=k.useMemo(()=>({reference:O,floating:w,setReference:y,setFloating:b}),[y,b]),x=k.useMemo(()=>({reference:C,floating:A}),[C,A]),P=k.useMemo(()=>{const $={position:r,left:0,top:0};if(!x.floating)return $;const D=xI(x.floating,u.x),_=xI(x.floating,u.y);return a?{...$,transform:"translate("+D+"px, "+_+"px)",...VH(x.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:D,top:_}},[r,a,x.floating,u.x,u.y]);return k.useMemo(()=>({...u,update:H,refs:F,elements:x,floatingStyles:P}),[u,H,F,x,P])}function g7e(t){const[e,r]=k.useState(void 0);return gd(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const c=s.borderBoxSize,l=Array.isArray(c)?c[0]:c;o=l.inlineSize,a=l.blockSize}else o=t.offsetWidth,a=t.offsetHeight;r({width:o,height:a})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}const GH="Popper",[KH,QH]=NH(GH),[b7e,YH]=KH(GH),w7e=t=>{const{__scopePopper:e,children:r}=t,[n,i]=k.useState(null);return k.createElement(b7e,{scope:e,anchor:n,onAnchorChange:i},r)},x7e="PopperAnchor",E7e=k.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...i}=t,s=YH(x7e,r),o=k.useRef(null),a=Au(e,o);return k.useEffect(()=>{s.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:k.createElement(Tp.div,ln({},i,{ref:a}))}),JH="PopperContent",[C7e,bIe]=KH(JH),S7e=k.forwardRef((t,e)=>{var r,n,i,s,o,a,c,l;const{__scopePopper:u,side:f="bottom",sideOffset:d=0,align:h="center",alignOffset:p=0,arrowPadding:v=0,avoidCollisions:m=!0,collisionBoundary:g=[],collisionPadding:y=0,sticky:b="partial",hideWhenDetached:C=!1,updatePositionStrategy:A="optimized",onPlaced:O,...w}=t,I=YH(JH,u),[B,z]=k.useState(null),H=Au(e,ue=>z(ue)),[K,F]=k.useState(null),x=g7e(K),P=(r=x==null?void 0:x.width)!==null&&r!==void 0?r:0,$=(n=x==null?void 0:x.height)!==null&&n!==void 0?n:0,D=f+(h!=="center"?"-"+h:""),_=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},N=Array.isArray(g)?g:[g],L=N.length>0,R={padding:_,boundary:N.filter(k7e),altBoundary:L},{refs:E,floatingStyles:M,placement:j,isPositioned:T,middlewareData:U}=y7e({strategy:"fixed",placement:D,whileElementsMounted:(...ue)=>p7e(...ue,{animationFrame:A==="always"}),elements:{reference:I.anchor},middleware:[G9e({mainAxis:d+$,alignmentAxis:p}),m&&K9e({mainAxis:!0,crossAxis:!1,limiter:b==="partial"?Q9e():void 0,...R}),m&&H9e({...R}),Y9e({...R,apply:({elements:ue,rects:tt,availableWidth:Oe,availableHeight:Pe})=>{const{width:ct,height:Ce}=tt.reference,be=ue.floating.style;be.setProperty("--radix-popper-available-width",`${Oe}px`),be.setProperty("--radix-popper-available-height",`${Pe}px`),be.setProperty("--radix-popper-anchor-width",`${ct}px`),be.setProperty("--radix-popper-anchor-height",`${Ce}px`)}}),K&&m7e({element:K,padding:v}),A7e({arrowWidth:P,arrowHeight:$}),C&&q9e({strategy:"referenceHidden",...R})]}),[W,V]=XH(j),G=Nc(O);gd(()=>{T&&(G==null||G())},[T,G]);const J=(i=U.arrow)===null||i===void 0?void 0:i.x,Y=(s=U.arrow)===null||s===void 0?void 0:s.y,X=((o=U.arrow)===null||o===void 0?void 0:o.centerOffset)!==0,[ae,oe]=k.useState();return gd(()=>{B&&oe(window.getComputedStyle(B).zIndex)},[B]),k.createElement("div",{ref:E.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:T?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ae,"--radix-popper-transform-origin":[(a=U.transformOrigin)===null||a===void 0?void 0:a.x,(c=U.transformOrigin)===null||c===void 0?void 0:c.y].join(" ")},dir:t.dir},k.createElement(C7e,{scope:u,placedSide:W,onArrowChange:F,arrowX:J,arrowY:Y,shouldHideArrow:X},k.createElement(Tp.div,ln({"data-side":W,"data-align":V},w,{ref:H,style:{...w.style,animation:T?void 0:"none",opacity:(l=U.hide)!==null&&l!==void 0&&l.referenceHidden?0:void 0}}))))});function k7e(t){return t!==null}const A7e=t=>({name:"transformOrigin",options:t,fn(e){var r,n,i,s,o;const{placement:a,rects:c,middlewareData:l}=e,f=((r=l.arrow)===null||r===void 0?void 0:r.centerOffset)!==0,d=f?0:t.arrowWidth,h=f?0:t.arrowHeight,[p,v]=XH(a),m={start:"0%",center:"50%",end:"100%"}[v],g=((n=(i=l.arrow)===null||i===void 0?void 0:i.x)!==null&&n!==void 0?n:0)+d/2,y=((s=(o=l.arrow)===null||o===void 0?void 0:o.y)!==null&&s!==void 0?s:0)+h/2;let b="",C="";return p==="bottom"?(b=f?m:`${g}px`,C=`${-h}px`):p==="top"?(b=f?m:`${g}px`,C=`${c.floating.height+h}px`):p==="right"?(b=`${-h}px`,C=f?m:`${y}px`):p==="left"&&(b=`${c.floating.width+h}px`,C=f?m:`${y}px`),{data:{x:b,y:C}}}});function XH(t){const[e,r="center"]=t.split("-");return[e,r]}const _7e=w7e,ZH=E7e,P7e=S7e;function T7e(t,e){return k.useReducer((r,n)=>{const i=e[r][n];return i??r},t)}const eq=t=>{const{present:e,children:r}=t,n=I7e(e),i=typeof r=="function"?r({present:n.isPresent}):k.Children.only(r),s=Au(n.ref,i.ref);return typeof r=="function"||n.isPresent?k.cloneElement(i,{ref:s}):null};eq.displayName="Presence";function I7e(t){const[e,r]=k.useState(),n=k.useRef({}),i=k.useRef(t),s=k.useRef("none"),o=t?"mounted":"unmounted",[a,c]=T7e(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return k.useEffect(()=>{const l=Ov(n.current);s.current=a==="mounted"?l:"none"},[a]),gd(()=>{const l=n.current,u=i.current;if(u!==t){const d=s.current,h=Ov(l);t?c("MOUNT"):h==="none"||(l==null?void 0:l.display)==="none"?c("UNMOUNT"):c(u&&d!==h?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,c]),gd(()=>{if(e){const l=f=>{const h=Ov(n.current).includes(f.animationName);f.target===e&&h&&$s.flushSync(()=>c("ANIMATION_END"))},u=f=>{f.target===e&&(s.current=Ov(n.current))};return e.addEventListener("animationstart",u),e.addEventListener("animationcancel",l),e.addEventListener("animationend",l),()=>{e.removeEventListener("animationstart",u),e.removeEventListener("animationcancel",l),e.removeEventListener("animationend",l)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:k.useCallback(l=>{l&&(n.current=getComputedStyle(l)),r(l)},[])}}function Ov(t){return(t==null?void 0:t.animationName)||"none"}function O7e({prop:t,defaultProp:e,onChange:r=()=>{}}){const[n,i]=R7e({defaultProp:e,onChange:r}),s=t!==void 0,o=s?t:n,a=Nc(r),c=k.useCallback(l=>{if(s){const f=typeof l=="function"?l(t):l;f!==t&&a(f)}else i(l)},[s,t,i,a]);return[o,c]}function R7e({defaultProp:t,onChange:e}){const r=k.useState(t),[n]=r,i=k.useRef(n),s=Nc(e);return k.useEffect(()=>{i.current!==n&&(s(n),i.current=n)},[n,i,s]),r}var $7e=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Uu=new WeakMap,Rv=new WeakMap,$v={},Qx=0,tq=function(t){return t&&(t.host||tq(t.parentNode))},M7e=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=tq(r);return n&&t.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},N7e=function(t,e,r,n){var i=M7e(e,Array.isArray(t)?t:[t]);$v[r]||($v[r]=new WeakMap);var s=$v[r],o=[],a=new Set,c=new Set(i),l=function(f){!f||a.has(f)||(a.add(f),l(f.parentNode))};i.forEach(l);var u=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(d){if(a.has(d))u(d);else{var h=d.getAttribute(n),p=h!==null&&h!=="false",v=(Uu.get(d)||0)+1,m=(s.get(d)||0)+1;Uu.set(d,v),s.set(d,m),o.push(d),v===1&&p&&Rv.set(d,!0),m===1&&d.setAttribute(r,"true"),p||d.setAttribute(n,"true")}})};return u(e),a.clear(),Qx++,function(){o.forEach(function(f){var d=Uu.get(f)-1,h=s.get(f)-1;Uu.set(f,d),s.set(f,h),d||(Rv.has(f)||f.removeAttribute(n),Rv.delete(f)),h||f.removeAttribute(r)}),Qx--,Qx||(Uu=new WeakMap,Uu=new WeakMap,Rv=new WeakMap,$v={})}},D7e=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),i=e||$7e(t);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live]"))),N7e(n,i,r,"aria-hidden")):function(){return null}},Sm="right-scroll-bar-position",km="width-before-scroll-bar",L7e="with-scroll-bars-hidden",B7e="--removed-body-scroll-bar-size";function F7e(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function j7e(t,e){var r=k.useState(function(){return{value:t,callback:e,facade:{get current(){return r.value},set current(n){var i=r.value;i!==n&&(r.value=n,r.callback(n,i))}}}})[0];return r.callback=e,r.facade}function U7e(t,e){return j7e(e||null,function(r){return t.forEach(function(n){return F7e(n,r)})})}function z7e(t){return t}function W7e(t,e){e===void 0&&(e=z7e);var r=[],n=!1,i={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:t},useMedium:function(s){var o=e(s,n);return r.push(o),function(){r=r.filter(function(a){return a!==o})}},assignSyncMedium:function(s){for(n=!0;r.length;){var o=r;r=[],o.forEach(s)}r={push:function(a){return s(a)},filter:function(){return r}}},assignMedium:function(s){n=!0;var o=[];if(r.length){var a=r;r=[],a.forEach(s),o=r}var c=function(){var u=o;o=[],u.forEach(s)},l=function(){return Promise.resolve().then(c)};l(),r={push:function(u){o.push(u),l()},filter:function(u){return o=o.filter(u),r}}}};return i}function H7e(t){t===void 0&&(t={});var e=W7e(null);return e.options=ji({async:!0,ssr:!1},t),e}var rq=function(t){var e=t.sideCar,r=hb(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=e.read();if(!n)throw new Error("Sidecar medium not found");return k.createElement(n,ji({},r))};rq.isSideCarExport=!0;function q7e(t,e){return t.useMedium(e),rq}var nq=H7e(),Yx=function(){},R2=k.forwardRef(function(t,e){var r=k.useRef(null),n=k.useState({onScrollCapture:Yx,onWheelCapture:Yx,onTouchMoveCapture:Yx}),i=n[0],s=n[1],o=t.forwardProps,a=t.children,c=t.className,l=t.removeScrollBar,u=t.enabled,f=t.shards,d=t.sideCar,h=t.noIsolation,p=t.inert,v=t.allowPinchZoom,m=t.as,g=m===void 0?"div":m,y=hb(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),b=d,C=U7e([r,e]),A=ji(ji({},y),i);return k.createElement(k.Fragment,null,u&&k.createElement(b,{sideCar:nq,removeScrollBar:l,shards:f,noIsolation:h,inert:p,setCallbacks:s,allowPinchZoom:!!v,lockRef:r}),o?k.cloneElement(k.Children.only(a),ji(ji({},A),{ref:C})):k.createElement(g,ji({},A,{className:c,ref:C}),a))});R2.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};R2.classNames={fullWidth:km,zeroRight:Sm};var CI,V7e=function(){if(CI)return CI;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function G7e(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=V7e();return e&&t.setAttribute("nonce",e),t}function K7e(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function Q7e(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var Y7e=function(){var t=0,e=null;return{add:function(r){t==0&&(e=G7e())&&(K7e(e,r),Q7e(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},J7e=function(){var t=Y7e();return function(e,r){k.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&r])}},iq=function(){var t=J7e(),e=function(r){var n=r.styles,i=r.dynamic;return t(n,i),null};return e},X7e={left:0,top:0,right:0,gap:0},Jx=function(t){return parseInt(t||"",10)||0},Z7e=function(t){var e=window.getComputedStyle(document.body),r=e[t==="padding"?"paddingLeft":"marginLeft"],n=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[Jx(r),Jx(n),Jx(i)]},eke=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return X7e;var e=Z7e(t),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}},tke=iq(),rke=function(t,e,r,n){var i=t.left,s=t.top,o=t.right,a=t.gap;return r===void 0&&(r="margin"),` - .`.concat(L7e,` { - overflow: hidden `).concat(n,`; - padding-right: `).concat(a,"px ").concat(n,`; - } - body { - overflow: hidden `).concat(n,`; - overscroll-behavior: contain; - `).concat([e&&"position: relative ".concat(n,";"),r==="margin"&&` - padding-left: `.concat(i,`px; - padding-top: `).concat(s,`px; - padding-right: `).concat(o,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(a,"px ").concat(n,`; - `),r==="padding"&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),` - } - - .`).concat(Sm,` { - right: `).concat(a,"px ").concat(n,`; - } - - .`).concat(km,` { - margin-right: `).concat(a,"px ").concat(n,`; - } - - .`).concat(Sm," .").concat(Sm,` { - right: 0 `).concat(n,`; - } - - .`).concat(km," .").concat(km,` { - margin-right: 0 `).concat(n,`; - } - - body { - `).concat(B7e,": ").concat(a,`px; - } -`)},nke=function(t){var e=t.noRelative,r=t.noImportant,n=t.gapMode,i=n===void 0?"margin":n,s=k.useMemo(function(){return eke(i)},[i]);return k.createElement(tke,{styles:rke(s,!e,i,r?"":"!important")})},T8=!1;if(typeof window<"u")try{var Mv=Object.defineProperty({},"passive",{get:function(){return T8=!0,!0}});window.addEventListener("test",Mv,Mv),window.removeEventListener("test",Mv,Mv)}catch{T8=!1}var zu=T8?{passive:!1}:!1,ike=function(t){return t.tagName==="TEXTAREA"},sq=function(t,e){var r=window.getComputedStyle(t);return r[e]!=="hidden"&&!(r.overflowY===r.overflowX&&!ike(t)&&r[e]==="visible")},ske=function(t){return sq(t,"overflowY")},oke=function(t){return sq(t,"overflowX")},SI=function(t,e){var r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var n=oq(t,r);if(n){var i=aq(t,r),s=i[1],o=i[2];if(s>o)return!0}r=r.parentNode}while(r&&r!==document.body);return!1},ake=function(t){var e=t.scrollTop,r=t.scrollHeight,n=t.clientHeight;return[e,r,n]},cke=function(t){var e=t.scrollLeft,r=t.scrollWidth,n=t.clientWidth;return[e,r,n]},oq=function(t,e){return t==="v"?ske(e):oke(e)},aq=function(t,e){return t==="v"?ake(e):cke(e)},lke=function(t,e){return t==="h"&&e==="rtl"?-1:1},uke=function(t,e,r,n,i){var s=lke(t,window.getComputedStyle(e).direction),o=s*n,a=r.target,c=e.contains(a),l=!1,u=o>0,f=0,d=0;do{var h=aq(t,a),p=h[0],v=h[1],m=h[2],g=v-m-s*p;(p||g)&&oq(t,a)&&(f+=g,d+=p),a=a.parentNode}while(!c&&a!==document.body||c&&(e.contains(a)||e===a));return(u&&(i&&f===0||!i&&o>f)||!u&&(i&&d===0||!i&&-o>d))&&(l=!0),l},Nv=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},kI=function(t){return[t.deltaX,t.deltaY]},AI=function(t){return t&&"current"in t?t.current:t},fke=function(t,e){return t[0]===e[0]&&t[1]===e[1]},dke=function(t){return` - .block-interactivity-`.concat(t,` {pointer-events: none;} - .allow-interactivity-`).concat(t,` {pointer-events: all;} -`)},hke=0,Wu=[];function pke(t){var e=k.useRef([]),r=k.useRef([0,0]),n=k.useRef(),i=k.useState(hke++)[0],s=k.useState(function(){return iq()})[0],o=k.useRef(t);k.useEffect(function(){o.current=t},[t]),k.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var v=IC([t.lockRef.current],(t.shards||[]).map(AI),!0).filter(Boolean);return v.forEach(function(m){return m.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),v.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var a=k.useCallback(function(v,m){if("touches"in v&&v.touches.length===2)return!o.current.allowPinchZoom;var g=Nv(v),y=r.current,b="deltaX"in v?v.deltaX:y[0]-g[0],C="deltaY"in v?v.deltaY:y[1]-g[1],A,O=v.target,w=Math.abs(b)>Math.abs(C)?"h":"v";if("touches"in v&&w==="h"&&O.type==="range")return!1;var I=SI(w,O);if(!I)return!0;if(I?A=w:(A=w==="v"?"h":"v",I=SI(w,O)),!I)return!1;if(!n.current&&"changedTouches"in v&&(b||C)&&(n.current=A),!A)return!0;var B=n.current||A;return uke(B,m,v,B==="h"?b:C,!0)},[]),c=k.useCallback(function(v){var m=v;if(!(!Wu.length||Wu[Wu.length-1]!==s)){var g="deltaY"in m?kI(m):Nv(m),y=e.current.filter(function(A){return A.name===m.type&&A.target===m.target&&fke(A.delta,g)})[0];if(y&&y.should){m.cancelable&&m.preventDefault();return}if(!y){var b=(o.current.shards||[]).map(AI).filter(Boolean).filter(function(A){return A.contains(m.target)}),C=b.length>0?a(m,b[0]):!o.current.noIsolation;C&&m.cancelable&&m.preventDefault()}}},[]),l=k.useCallback(function(v,m,g,y){var b={name:v,delta:m,target:g,should:y};e.current.push(b),setTimeout(function(){e.current=e.current.filter(function(C){return C!==b})},1)},[]),u=k.useCallback(function(v){r.current=Nv(v),n.current=void 0},[]),f=k.useCallback(function(v){l(v.type,kI(v),v.target,a(v,t.lockRef.current))},[]),d=k.useCallback(function(v){l(v.type,Nv(v),v.target,a(v,t.lockRef.current))},[]);k.useEffect(function(){return Wu.push(s),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:d}),document.addEventListener("wheel",c,zu),document.addEventListener("touchmove",c,zu),document.addEventListener("touchstart",u,zu),function(){Wu=Wu.filter(function(v){return v!==s}),document.removeEventListener("wheel",c,zu),document.removeEventListener("touchmove",c,zu),document.removeEventListener("touchstart",u,zu)}},[]);var h=t.removeScrollBar,p=t.inert;return k.createElement(k.Fragment,null,p?k.createElement(s,{styles:dke(i)}):null,h?k.createElement(nke,{gapMode:"margin"}):null)}const vke=q7e(nq,pke);var cq=k.forwardRef(function(t,e){return k.createElement(R2,ji({},t,{ref:e,sideCar:vke}))});cq.classNames=R2.classNames;const mke=cq,lq="Popover",[uq,wIe]=NH(lq,[QH]),$2=QH(),[yke,th]=uq(lq),gke=t=>{const{__scopePopover:e,children:r,open:n,defaultOpen:i,onOpenChange:s,modal:o=!1}=t,a=$2(e),c=k.useRef(null),[l,u]=k.useState(!1),[f=!1,d]=O7e({prop:n,defaultProp:i,onChange:s});return k.createElement(_7e,a,k.createElement(yke,{scope:e,contentId:M9e(),triggerRef:c,open:f,onOpenChange:d,onOpenToggle:k.useCallback(()=>d(h=>!h),[d]),hasCustomAnchor:l,onCustomAnchorAdd:k.useCallback(()=>u(!0),[]),onCustomAnchorRemove:k.useCallback(()=>u(!1),[]),modal:o},r))},bke="PopoverAnchor",wke=k.forwardRef((t,e)=>{const{__scopePopover:r,...n}=t,i=th(bke,r),s=$2(r),{onCustomAnchorAdd:o,onCustomAnchorRemove:a}=i;return k.useEffect(()=>(o(),()=>a()),[o,a]),k.createElement(ZH,ln({},s,n,{ref:e}))}),xke="PopoverTrigger",Eke=k.forwardRef((t,e)=>{const{__scopePopover:r,...n}=t,i=th(xke,r),s=$2(r),o=Au(e,i.triggerRef),a=k.createElement(Tp.button,ln({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":dq(i.open)},n,{ref:o,onClick:Hl(t.onClick,i.onOpenToggle)}));return i.hasCustomAnchor?a:k.createElement(ZH,ln({asChild:!0},s),a)}),Cke="PopoverPortal",[xIe,Ske]=uq(Cke,{forceMount:void 0}),F1="PopoverContent",kke=k.forwardRef((t,e)=>{const r=Ske(F1,t.__scopePopover),{forceMount:n=r.forceMount,...i}=t,s=th(F1,t.__scopePopover);return k.createElement(eq,{present:n||s.open},s.modal?k.createElement(Ake,ln({},i,{ref:e})):k.createElement(_ke,ln({},i,{ref:e})))}),Ake=k.forwardRef((t,e)=>{const r=th(F1,t.__scopePopover),n=k.useRef(null),i=Au(e,n),s=k.useRef(!1);return k.useEffect(()=>{const o=n.current;if(o)return D7e(o)},[]),k.createElement(mke,{as:e9,allowPinchZoom:!0},k.createElement(fq,ln({},t,{ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Hl(t.onCloseAutoFocus,o=>{var a;o.preventDefault(),s.current||(a=r.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:Hl(t.onPointerDownOutside,o=>{const a=o.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0,l=a.button===2||c;s.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:Hl(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})))}),_ke=k.forwardRef((t,e)=>{const r=th(F1,t.__scopePopover),n=k.useRef(!1),i=k.useRef(!1);return k.createElement(fq,ln({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o;if((o=t.onCloseAutoFocus)===null||o===void 0||o.call(t,s),!s.defaultPrevented){var a;n.current||(a=r.triggerRef.current)===null||a===void 0||a.focus(),s.preventDefault()}n.current=!1,i.current=!1},onInteractOutside:s=>{var o,a;(o=t.onInteractOutside)===null||o===void 0||o.call(t,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const c=s.target;((a=r.triggerRef.current)===null||a===void 0?void 0:a.contains(c))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}}))}),fq=k.forwardRef((t,e)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:o,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...f}=t,d=th(F1,r),h=$2(r);return S9e(),k.createElement(k9e,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:s},k.createElement(x9e,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>d.onOpenChange(!1)},k.createElement(P7e,ln({"data-state":dq(d.open),role:"dialog",id:d.contentId},h,f,{ref:e,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}))))});function dq(t){return t?"open":"closed"}const Pke=gke,Tke=wke,Ike=Eke,Oke=kke,[Rke,$ke]=Yc(),Op=()=>{const{setOpenWalletModal:t,openWalletModalState:e}=Rke();return{setOpenWalletModal:t,openWalletModalState:e}};function Cn(){return Cn=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(r[i]=t[i]);return r}const cr=(t,e)=>t.toLowerCase()===e.toLowerCase(),a9=(t,e)=>{let r=t;return t.length>=e&&(r=t.slice(0,e/2)+"..."+t.slice(t.length-e/2,t.length)),r},hq=t=>`0x${a9((t==null?void 0:t.substring(2))||"",8)}`;var Ba=function(t){return t[t.VERY_LARGE=0]="VERY_LARGE",t[t.FRACTION=1]="FRACTION",t[t.VERY_TINY=2]="VERY_TINY",t[t.MIXED=3]="MIXED",t}(Ba||{});const ha=t=>{if(isNaN(Number(t)))return console.error(`display format error ${t} is not a number`),"NaN";const e=Number(t);if(e===0)return"0";let r;e>1e8?r=Ba.VERY_LARGE:e<1e-10?r=Ba.VERY_TINY:e<1?r=Ba.FRACTION:r=Ba.MIXED;let n,i;switch(r){case Ba.VERY_LARGE:n="compact",i={maximumFractionDigits:4};break;case Ba.VERY_TINY:n="scientific",i={maximumFractionDigits:4};break;case Ba.FRACTION:n="standard",i={maximumSignificantDigits:4};break;default:n="standard",i={maximumFractionDigits:2}}return Intl.NumberFormat("en-US",Cn({notation:n},i)).format(e)},Mke=t=>t.charAt(0).toUpperCase()+t.slice(1),pq=(t,e)=>{const r=t.split(".");return r.length===1?t:`${r[0]}.${r[1].slice(0,e)}`},kg=t=>/0x[a-fA-F0-9]{40}/.test(t),Nke=t=>t>0?ve.colors.positive:t<0?ve.colors.negative:ve.colors.text50,_I=(t,e)=>{var r;const n=e.find(s=>cr(s.token.contractAddress,t.contractAddress));return n&&(n==null||(r=n.price24hChange)==null?void 0:r.value)||0},Ao=({balance:t,prices:e,decimals:r,conversionRate:n})=>{var i;let s=0;const o=e.find(f=>cr(f.token.contractAddress,t.contractAddress));if(!o)return"0.00";const a=((i=o.price)==null?void 0:i.value)||0,c=Sr(t.balance,r),l=parseFloat(c)*a;return s+=l,`${(s*n).toFixed(2)}`},vq=t=>{const e=[],r=[],n=[];return t.forEach(i=>{i.contractAddress===ur?e.push(i):i.contractType==="ERC20"?r.push(i):(i.contractType==="ERC721"||i.contractType==="ERC1155")&&n.push(i)}),{nativeTokens:e,erc20Tokens:r,collectibles:n}},mq=t=>{const e=[];return t==null||t.pages.forEach(r=>{e.push(...r.transactions)}),e},Ag=async({accountAddress:t,chainId:e})=>{try{const{indexerClient:r}=await pn(e),n=await r.getEtherBalance({accountAddress:t});return[{chainId:e,contractAddress:ur,accountAddress:t,balance:(n==null?void 0:n.balance.balanceWei)||"0",contractType:E4.UNKNOWN,blockHash:"",blockNumber:0,tokenID:""}]}catch(r){return console.error(r),[]}},c9=async({tokens:t})=>{try{if(t.length===0)return[];const e=t[0].chainId,{apiClient:r}=await pn(e),n=await r.getCoinPrices({tokens:t});return(n==null?void 0:n.tokenPrices)||[]}catch(e){console.error(e);return}},_g=async({accountAddress:t,chainId:e,contractAddress:r},{hideUnlistedTokens:n,hideCollectibles:i,includeMetadata:s=!0})=>{try{const{indexerClient:o}=await pn(e),a=await o.getTokenBalances(Cn({accountAddress:t,includeMetadata:s},r?{contractAddress:r}:{}));let c=(a==null?void 0:a.balances)||[];if(n&&c.length>0){const l=await c9({tokens:c.map(u=>({chainId:u.chainId,contractAddress:u.contractAddress,tokenId:u.tokenID}))});c=c.filter(u=>{const f=l==null?void 0:l.find(d=>cr(d.token.contractAddress,u.contractAddress)&&d.token.chainId===u.chainId);return u.contractType!=="ERC20"||!!f&&f.price!==null})}return i&&c.length>0&&(c=c.filter(l=>l.contractType!=="ERC721"&&l.contractType!=="ERC1155")),c}catch(o){return console.error(o),[]}},Dke=async({accountAddress:t,chainId:e},{hideUnlistedTokens:r,hideCollectibles:n})=>{try{return(await Promise.all([Ag({accountAddress:t,chainId:e}),_g({accountAddress:t,chainId:e},{hideUnlistedTokens:r,hideCollectibles:n})])).flat()}catch(i){return console.error(i),[]}},yq=async({accountAddress:t,chainId:e,collectionAddress:r,includeMetadata:n=!0})=>{try{const{indexerClient:i}=await pn(e),s=await i.getTokenBalances({accountAddress:t,includeMetadata:n,contractAddress:r});return(s==null?void 0:s.balances)||[]}catch(i){return console.error(i),[]}},Lke=async({accountAddress:t,chainIds:e,displayAssets:r},{hideUnlistedTokens:n,hideCollectibles:i})=>{let o=[];const a=r.length>0;try{if(a){const C=r.filter(I=>cr(I.contractAddress,ur)),A=r.filter(I=>!cr(I.contractAddress,ur)),O={},w={};C.forEach(I=>{O[I.chainId]||(O[I.chainId]=[]),O[I.chainId].push(I)}),A.forEach(I=>{w[I.chainId]||(w[I.chainId]=[]),w[I.chainId].push(I)}),o=(await Promise.all([...Object.keys(O).map(I=>Ag({accountAddress:t,chainId:Number(I)})),...Object.keys(w).map(I=>w[Number(I)].map(B=>_g({accountAddress:t,chainId:Number(I),contractAddress:B.contractAddress},{hideUnlistedTokens:n,hideCollectibles:i,includeMetadata:!1}))).flat()])).flat()}else o=(await Promise.all([...e.map(C=>Ag({accountAddress:t,chainId:C})),...e.map(C=>_g({accountAddress:t,chainId:C},{hideUnlistedTokens:n,hideCollectibles:i,includeMetadata:!1}))])).flat();const{nativeTokens:c,erc20Tokens:l,collectibles:u}=vq(o),f=new Promise(async(C,A)=>{if(l.length>0){const O=l.map(I=>({chainId:I.chainId,contractAddress:I.contractAddress})),w=await c9({tokens:O})||[];C(w)}else C([])}),d=u.map(async C=>a?C:await yq({accountAddress:t,chainId:C.chainId,collectionAddress:C.contractAddress,includeMetadata:!1})),h=async()=>{const C={},A={};l.forEach(w=>{A[w.chainId]?A[w.chainId].push(w):A[w.chainId]=[w]});const O=Object.keys(A).map(async w=>{const{metadataClient:I}=pn(w),z=A[Number(w)].map(K=>K.contractAddress),H=await I.getContractInfoBatch({chainID:String(w),contractAddresses:z});C[Number(w)]=H});return await Promise.all([...O]),C},[p,v,...m]=await Promise.all([f,h(),...d]),g=l.sort((C,A)=>{var O,w;const I=p.find(_=>cr(_.token.contractAddress,C.contractAddress)),B=p.find(_=>cr(_.token.contractAddress,A.contractAddress)),z=I!=null&&I.price?I.price.value:0,H=B!=null&&B.price?B.price.value:0,K=(O=v[C.chainId].contractInfoMap[C.contractAddress])==null?void 0:O.decimals,F=(w=v[A.chainId].contractInfoMap[A.contractAddress])==null?void 0:w.decimals,x=K===void 0?0:Number(Sr(C.balance,K)),P=F===void 0?0:Number(Sr(A.balance,F)),$=x*z;return P*H-$}),y=X4e(m.flat(),10).sort((C,A)=>C.contractAddress.localeCompare(A.contractAddress));return i?[...c.length>0?[c[0]]:[],...g.length>0?g.slice(0,11):[]]:[...c.length>0?[c[0]]:[],...g.length>0?[g[0]]:[],...y.length>0?[...y]:[]]}catch(c){return console.error(c),[]}},Bke=async({accountAddress:t,chainId:e,collectionAddress:r,tokenId:n})=>{const{indexerClient:i}=await pn(e);return(await i.getTokenBalances({accountAddress:t,includeMetadata:!0,contractAddress:r,tokenID:n})).balances[0]},Fke=async({tokens:t})=>{try{if(t.length===0)return[];const e=t[0].chainId,{apiClient:r}=await pn(e),n=await r.getCollectiblePrices({tokens:t});return(n==null?void 0:n.tokenPrices)||[]}catch(e){console.error(e);return}},gq=async({chainId:t,contractAddress:e,accountAddress:r,tokenId:n,page:i})=>{const{indexerClient:s}=pn(t);return s.getTransactionHistory({includeMetadata:!0,page:i,filter:{accountAddress:r,contractAddress:e,tokenID:n}})},jke=async({chainIds:t,accountAddress:e})=>(await Promise.all([...t.map(s=>gq({chainId:s,accountAddress:e,page:{page:1}}))])).map(s=>s.transactions).flat().sort((s,o)=>{const a=new Date(s.timestamp).getTime();return new Date(o.timestamp).getTime()-a}),Uke=async({toCurrency:t})=>{if(t==="USD")return 1;const{apiClient:e}=pn(137);return(await e.getExchangeRate({toCurrency:t})).exchangeRate.value},zke=async({tokens:t})=>{const{metadataClient:e}=pn(t.chainId);return(await e.getTokenMetadata({chainID:t.chainId.toString(),contractAddress:t.contractAddress,tokenIDs:t.tokenIds})).tokenMetadata},Wke=async t=>{const{metadataClient:e}=pn(Number(t.chainID));return(await e.getContractInfo(t)).contractInfo},Hke=["chainIds"],qke=["disabled"],is={oneSecond:1*1e3,oneMinute:60*1e3,oneHour:60*60*1e3},l9=(t,e)=>li({queryKey:["balances",t,e],queryFn:async()=>{const{chainIds:r}=t,n=M2(t,Hke);return(await Promise.all(r.map(s=>Dke(Cn({},n,{chainId:s}),e)))).flat()},retry:!0,staleTime:10*is.oneMinute,enabled:t.chainIds.length>0&&!!t.accountAddress}),Vke=t=>li({queryKey:["collectionBalance",t],queryFn:()=>yq(t),retry:!0,staleTime:10*is.oneMinute,enabled:!!t.chainId&&!!t.accountAddress&&!!t.collectionAddress}),_u=t=>{let{disabled:e}=t,r=M2(t,qke);return li({queryKey:["coinPrices",r],queryFn:()=>c9(r),retry:!0,staleTime:1*is.oneMinute,enabled:r.tokens.length>0&&!e})},Gke=(t,e)=>li({queryKey:["balancesAssetsSummary",t,e],queryFn:()=>Lke(t,e),retry:!0,staleTime:10*is.oneMinute,enabled:t.chainIds.length>0&&!!t.accountAddress}),Kke=(t,e)=>li({queryKey:["coinBalance",t,e],queryFn:()=>cr((t==null?void 0:t.contractAddress)||"",ur)?Ag({accountAddress:t.accountAddress,chainId:t.chainId}).then(i=>i[0]):_g(t,e).then(n=>n[0]),retry:!0,staleTime:1*is.oneMinute,enabled:!!t.chainId&&!!t.accountAddress}),bq=t=>li({queryKey:["collectibleBalance",t],queryFn:()=>Bke(t),retry:!0,staleTime:5*is.oneMinute,enabled:!!t.chainId&&!!t.accountAddress&&!!t.collectionAddress&&!!t.tokenId}),wq=t=>li({queryKey:["useCollectiblePrices",t],queryFn:()=>Fke(t),retry:!0,staleTime:5*is.oneMinute,enabled:t.tokens.length>0}),xq=t=>Ove({queryKey:["transactionHistory",t],queryFn:({pageParam:e})=>gq(Cn({},t,e?{page:{page:e}}:{page:{page:1}})),getNextPageParam:({page:e})=>{if(e.more)return(e==null?void 0:e.page)||1},retry:!0,staleTime:10*is.oneMinute,enabled:!!t.chainId&&!t.disabled&&!!t.accountAddress}),Qke=t=>li({queryKey:["transactionHistorySummary",t],queryFn:()=>jke(t),retry:!0,staleTime:10*is.oneMinute,enabled:t.chainIds.length>0&&!!t.accountAddress}),Xc=t=>li({queryKey:["useConversionRate",t],queryFn:()=>Uke(t),retry:!0,staleTime:60*is.oneMinute}),Yke=t=>li({queryKey:["useTokenMetadata",t],queryFn:()=>zke(t),retry:!0,staleTime:60*is.oneMinute,enabled:!!t.tokens.chainId&&!!t.tokens.contractAddress}),Jke=t=>li({queryKey:["useContractInfo",t],queryFn:()=>Wke(t),retry:!0,staleTime:60*is.oneMinute,enabled:!!t.chainID&&!!t.contractAddress}),[Xke,Zke]=Yc(),Ds=()=>{const{setHistory:t,history:e}=Xke();return{setNavigation:i=>{const s=document.getElementById("sequence-kit-wallet-content"),o=s==null?void 0:s.parentElement;o==null||o.scrollTo(0,0);const a=[...e,i];t(a)},history:e,setHistory:t,goBack:()=>{const i=[...e];i.pop(),t(i)}}},eAe=[{inputs:[{internalType:"address",name:"_from",type:"address"},{internalType:"address",name:"_to",type:"address"},{internalType:"uint256[]",name:"_ids",type:"uint256[]"},{internalType:"uint256[]",name:"_amounts",type:"uint256[]"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"}],tAe=[{constant:!1,inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],rAe=[{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"}],Eq=[{symbol:"USD",sign:"$",name:{message:"US Dollar"},decimals:2},{symbol:"CAD",sign:"$",name:{message:"Canadian Dollar"},decimals:2},{symbol:"GBP",sign:"£",name:{message:"British Pound Sterling"},decimals:2},{symbol:"EUR",sign:"€",name:{message:"Euro"},decimals:2},{symbol:"CNY",sign:"¥",name:{message:"Chinese Yuan"},decimals:2},{symbol:"JPY",sign:"¥",name:{message:"Japanese Yen"},decimals:2},{symbol:"KRW",sign:"₩",name:{message:"South Korean Won"},decimals:2},{symbol:"SGD",sign:"$",name:{message:"Singapore Dollar"},decimals:2},{symbol:"CHF",sign:"CHF ",name:{message:"Swiss Franc"},decimals:2},{symbol:"AUD",sign:"$",name:{message:"Australian Dollar"},decimals:2},{symbol:"NZD",sign:"$",name:{message:"New Zealand Dollar"},decimals:2},{symbol:"SEK",sign:"kr ",name:{message:"Swedish Krona"},decimals:2},{symbol:"NOK",sign:"kr ",name:{message:"Norwegian Krone"},decimals:2},{symbol:"MXN",sign:"$",name:{message:"Mexican Peso"},decimals:2},{symbol:"INR",sign:"₹",name:{message:"Indian Rupee"},decimals:2},{symbol:"ZAR",sign:"R ",name:{message:"South African Rand"},decimals:2},{symbol:"TRY",sign:"₺",name:{message:"Turkish Lira"},decimals:2},{symbol:"BRL",sign:"R$",name:{message:"Brazilian Real"},decimals:2},{symbol:"DKK",sign:"kr ",name:{message:"Danish Krone"},decimals:2},{symbol:"PLN",sign:"zł ",name:{message:"Polish Zloty"},decimals:2},{symbol:"THB",sign:"฿",name:{message:"Thai Baht"},decimals:2},{symbol:"IDR",sign:"Rp",name:{message:"Indonesian Rupiah"},decimals:2}],nAe=Eq[0],Oi="54px",Ls=navigator.userAgent.match(/chrome|chromium|crios/i)?"13px":"0px",qn=()=>{const{chains:t}=dn(),e=()=>{let l=!0,u=!1,f=nAe,d=t.map(h=>h.id);try{const h=localStorage.getItem(Dn.Settings),p=JSON.parse(h||"{}");if((p==null?void 0:p.hideUnlistedTokens)!==void 0&&(l=p==null?void 0:p.hideUnlistedTokens),(p==null?void 0:p.hideCollectibles)!==void 0&&(u=p==null?void 0:p.hideCollectibles),(p==null?void 0:p.fiatCurrency)!==void 0&&(f=p==null?void 0:p.fiatCurrency),(p==null?void 0:p.selectedNetworks)!==void 0){let v=!0;p.selectedNetworks.forEach(m=>{t.find(g=>g.id===m)===void 0&&(v=!1)}),v&&(d=p==null?void 0:p.selectedNetworks)}}catch(h){console.error(h,"Failed to fetch settings")}return{hideUnlistedTokens:l,hideCollectibles:u,fiatCurrency:f,selectedNetworks:d}},r=e(),[n,i]=k.useState(r);return Cn({},n,{setFiatCurrency:l=>{const u=e(),f=Cn({},u,{fiatCurrency:l});localStorage.setItem(Dn.Settings,JSON.stringify(f)),i(f)},setHideCollectibles:l=>{const u=e(),f=Cn({},u,{hideCollectibles:l});localStorage.setItem(Dn.Settings,JSON.stringify(f)),i(f)},setHideUnlistedTokens:l=>{const u=e(),f=Cn({},u,{hideUnlistedTokens:l});localStorage.setItem(Dn.Settings,JSON.stringify(f)),i(f)},setSelectedNetworks:l=>{const u=e(),f=Cn({},u,{selectedNetworks:l});localStorage.setItem(Dn.Settings,JSON.stringify(f)),i(f)}})},iAe=({size:t=30})=>S.createElement(q,{alignItems:"center",justifyContent:"center",borderRadius:"circle",background:"backgroundInverse",flexShrink:"0",style:{width:`${t}px`,height:`${t}px`}},S.createElement(ie,{variant:"large",color:"textInverse100"},"?")),lu=({imageUrl:t,size:e=30})=>t?S.createElement(gr,{src:t,borderRadius:"circle",style:{width:`${e}px`,height:`${e}px`}}):S.createElement(iAe,{size:e}),PI=({networkLogoUrl:t,logoUrl:e,tokenName:r,balance:n,balanceFiat:i,priceChangePercentage:s,symbol:o})=>{const{fiatCurrency:a}=qn(),c=s>0?"+":"";return S.createElement(q,{background:"backgroundSecondary",width:"full",height:"full",borderRadius:"md",padding:"4",flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"1"},S.createElement(q,{marginBottom:"1"},S.createElement(lu,{size:36,imageUrl:e})),S.createElement(q,{marginBottom:"3"},S.createElement(q,{flexDirection:"row",gap:"1",justifyContent:"flex-start",alignItems:"center"},S.createElement(ie,{fontWeight:"bold",whiteSpace:"nowrap",color:"text100",style:{maxWidth:"130px",textOverflow:"ellipsis",overflow:"hidden"}},r),S.createElement(lu,{size:12,imageUrl:t})),S.createElement(ie,{color:"text50",whiteSpace:"nowrap",style:{display:"block",maxWidth:"150px",textOverflow:"ellipsis",overflow:"hidden"}},`${n} ${o}`)),S.createElement(q,null,S.createElement(q,null,S.createElement(ie,{fontWeight:"bold",color:"text100"},`${a.sign}${i}`)),S.createElement(ie,{style:{color:Nke(s)}},`${c}${s.toFixed(2)}%`)))},TI=({balance:t})=>{var e;const{chains:r=[]}=dn(),{fiatCurrency:n}=qn(),i=cr(t.contractAddress,ur),s=Rr(t.chainId,r),{data:o=[],isLoading:a}=_u({tokens:[{chainId:t.chainId,contractAddress:t.contractAddress}]}),{data:c=1,isLoading:l}=Xc({toCurrency:n.symbol}),{data:u,isLoading:f}=Jke({chainID:String(t.chainId),contractAddress:t.contractAddress});if(a||l||f)return S.createElement(q,{background:"backgroundSecondary",width:"full",height:"full",borderRadius:"md"});if(i){const A=Ao({balance:t,prices:o,conversionRate:c,decimals:s.decimals}),O=_I(t,o),w=Sr(t.balance,s.decimals),I=ha(w);return S.createElement(PI,{networkLogoUrl:s.logoURI,logoUrl:s.logoURI,tokenName:s.name,balance:I,balanceFiat:A,priceChangePercentage:O,symbol:s.symbol})}const h=(e=u==null?void 0:u.decimals)!=null?e:18,p=Ao({balance:t,prices:o,conversionRate:c,decimals:h}),v=_I(t,o),m=Sr(t.balance,h),g=ha(m),y=(u==null?void 0:u.name)||"Unknown",b=(u==null?void 0:u.name)||"TOKEN",C=u==null?void 0:u.logoURI;return S.createElement(PI,{networkLogoUrl:s.logoURI,logoUrl:C,tokenName:y,balance:g,balanceFiat:p,priceChangePercentage:v,symbol:b})},u9=({imageUrl:t})=>S.createElement(Eo,{padding:"0",aspectRatio:"1/1",justifyContent:"center",alignItems:"center",overflow:"hidden",borderRadius:"md",background:"backgroundSecondary"},S.createElement(gr,{style:{height:"100%"},src:t})),sAe=({balance:t})=>{var e;const{data:r}=Yke({tokens:{chainId:t.chainId,contractAddress:t.contractAddress,tokenIds:[t.tokenID]}}),n=r==null||(e=r[0])==null?void 0:e.image;return S.createElement(u9,{imageUrl:n})};Su("packages/wallet/src/shared/Skeleton/styles.css.ts","kit");const oAe=qW({"0%":{opacity:.25},"50%":{opacity:.1},"100%":{opacity:.25}},"PulseSimple"),aAe=Ii({height:"76px",backgroundColor:"#909090",animation:`${oAe} 2s ease-in-out infinite`},"skeleton");ku();const Et=({width:t="100%",height:e="100%",borderRadius:r="md",aspectRatio:n})=>S.createElement(q,{className:aAe,borderRadius:r,aspectRatio:n,style:{width:t,height:e}}),cAe=()=>S.createElement(q,{style:{display:"grid",gridTemplateColumns:`calc(50% - ${ve.space[1]}) calc(50% - ${ve.space[1]})`,gap:ve.space[2]}},Array(12).fill(null).map((t,e)=>S.createElement(q,{key:e},S.createElement(Et,{height:"100%",width:"100%",aspectRatio:"1/1"}))));Su("packages/wallet/src/shared/styles.css.ts","kit");const vo=Ii({":hover":{cursor:"pointer",opacity:"0.8",userSelect:"none"}},"clickable"),f9=Ii({"> div":{overflowY:"scroll"}},"scrollbar");Ns(`html:not(.is-apple) ${f9} > div::-webkit-scrollbar-thumb`,{background:"none",backgroundClip:"content-box",transition:"background 0.5s linear"});Ns(`html:not(.is-apple) ${f9} > div:hover::-webkit-scrollbar-thumb`,{background:ve.colors.text50,backgroundClip:"content-box"});const d9=Ii({},"walletContent");Ns(`${d9} + button`,{backgroundColor:"transparent"});Ns(`${d9} + button > svg`,{width:"20px",height:"20px"});ku();const lAe=()=>{const{address:t}=fn(),{setNavigation:e}=Ds(),{displayedAssets:r}=k8e(),{hideUnlistedTokens:n,hideCollectibles:i,selectedNetworks:s}=qn(),{data:o=[],isLoading:a}=Gke({accountAddress:t||"",chainIds:s,displayAssets:r},{hideUnlistedTokens:n,hideCollectibles:i});if(a)return S.createElement(cAe,null);const{nativeTokens:c,erc20Tokens:l,collectibles:u}=vq(o),f=d=>{d.contractType==="ERC1155"||d.contractType==="ERC721"?e&&e({location:"collectible-details",params:{contractAddress:d.contractAddress,chainId:d.chainId,tokenId:d.tokenID}}):d.contractType==="ERC20"?e&&e({location:"coin-details",params:{contractAddress:d.contractAddress,chainId:d.chainId}}):e&&e({location:"coin-details",params:{contractAddress:d.contractAddress,chainId:d.chainId}})};return S.createElement(q,{style:{display:"grid",gridTemplateColumns:`calc(50% - ${ve.space[1]}) calc(50% - ${ve.space[1]})`,gap:ve.space[2]}},c.map(d=>S.createElement(q,{key:d.contractAddress,className:vo,aspectRatio:"1/1",onClick:()=>f(d)},S.createElement(TI,{balance:d}))),l.map(d=>S.createElement(q,{className:vo,key:d.contractAddress,aspectRatio:"1/1",onClick:()=>f(d)},S.createElement(TI,{balance:d}))),u.map(d=>S.createElement(q,{className:vo,aspectRatio:"1/1",key:`${d.contractAddress}-${d.tokenID}}`,onClick:()=>f(d)},S.createElement(sAe,{balance:d}))))},uAe=()=>S.createElement(q,{paddingLeft:"5",paddingBottom:"5",gap:"4",flexDirection:"column",style:{paddingRight:`calc(${ve.space[5]} - ${Ls})`}},S.createElement(lAe,null)),fAe=()=>{const{address:t}=fn(),{chain:e,chains:r=[]}=dn(),[n,i]=k.useState(!1),s=Rr((e==null?void 0:e.id)||1,r);k.useEffect(()=>{n&&setTimeout(()=>{i(!1)},4e3)},[n]);const o=()=>{i(!0)},a=()=>{window.open(`https://twitter.com/intent/tweet?text=Here%20is%20my%20address%20${t}`)};return S.createElement(q,{style:{paddingTop:Oi}},S.createElement(q,{padding:"5",paddingTop:"3",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"4"},S.createElement(q,{marginTop:"1",width:"fit",background:"white",borderRadius:"md",alignItems:"center",justifyContent:"center",padding:"4"},S.createElement(xSe,{value:t||"",size:200,bgColor:"white",fgColor:"black","data-id":"receiveQR"})),S.createElement(q,null,S.createElement(q,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"2"},S.createElement(ie,{variant:"medium",color:"text100",textAlign:"center",lineHeight:"inherit",style:{fontWeight:"700"}},"My Wallet"),S.createElement(gr,{width:"5",src:s.logoURI,alt:"icon"})),S.createElement(q,{marginTop:"2",style:{maxWidth:"180px",textAlign:"center"}},S.createElement(ie,{textAlign:"center",color:"text50",style:{fontSize:"14px",maxWidth:"180px",overflowWrap:"anywhere"}},t))),S.createElement(q,{gap:"3"},S.createElement(uH.CopyToClipboard,{text:t||""},S.createElement(nt,{onClick:o,leftIcon:gb,label:n?"Copied!":"Copy"})),S.createElement(nt,{onClick:a,leftIcon:Cse,label:"Share"})),S.createElement(q,{justifyContent:"center",alignItems:"center",style:{maxWidth:"260px",textAlign:"center"}},S.createElement(ie,{color:"text100",variant:"small",style:{maxWidth:"260px",overflowWrap:"anywhere"}},`This is a ${s.name} address. Please only send assets on the ${s.name} network.`))))},Cq=({imageUrl:t,name:e,decimals:r,balance:n,symbol:i,fiatValue:s,chainId:o,showSquareImage:a})=>{const{chains:c=[]}=dn(),{fiatCurrency:l}=qn(),u=Sr(n,r),f=ha(u),d=Rr(o,c);return S.createElement(q,{alignItems:"flex-end",justifyContent:"space-between"},S.createElement(q,{justifyContent:"space-between",alignItems:"center",gap:"2"},a?S.createElement(q,{style:{width:"40px"}},S.createElement(u9,{imageUrl:t})):S.createElement(lu,{imageUrl:t,size:40}),S.createElement(q,{flexDirection:"column",alignItems:"flex-start"},S.createElement(q,{flexDirection:"row",alignItems:"center",gap:"1"},S.createElement(ie,{variant:"medium",color:"text100"},e),S.createElement(lu,{imageUrl:d.logoURI,size:12})),S.createElement(ie,{color:"text50",variant:"normal"}," ",`${f} ${i} available`))),S.createElement(q,{flexDirection:"column",alignItems:"flex-end",justifyContent:"flex-end"},s&&S.createElement(ie,{variant:"normal",color:"text100"},`${l.sign}${s}`)))},dAe=({chainId:t,contractAddress:e})=>{var r,n,i,s,o;const{analytics:a}=QW(),{chains:c=[]}=dn(),l=h2(),{address:u="",connector:f}=fn(),d=!!(f!=null&&(r=f._wallet)!=null&&r.isSequenceBased),h=l===t,p=!h&&!d,{switchNetwork:v}=xS(),m=k.useRef(null),{setOpenWalletModal:g}=Op(),{fiatCurrency:y}=qn(),[b,C]=k.useState("0"),[A,O]=k.useState(""),{data:w}=wS(),{data:I=[],isLoading:B}=l9({accountAddress:u,chainIds:[t],contractAddress:e},{hideUnlistedTokens:!1}),z=Rr(t,c),H=I.find(X=>X.contractAddress===e),{data:K=[],isLoading:F}=_u({tokens:[{chainId:t,contractAddress:e}]}),{data:x=1,isLoading:P}=Xc({toCurrency:y.symbol});if(B||F||P)return null;const D=cr(e,ur),_=D?z.decimals:(H==null||(n=H.contractInfo)==null?void 0:n.decimals)||18,N=D?z.name:(H==null||(i=H.contractInfo)==null?void 0:i.name)||"",L=D?z.logoURI:H==null||(s=H.contractInfo)==null?void 0:s.logoURI,R=D?z.symbol:(H==null||(o=H.contractInfo)==null?void 0:o.symbol)||"",E=b===""?"0":b,M=rd(E,_),j=Ao({balance:Cn({},H,{balance:M.toString()}),prices:K,conversionRate:x,decimals:_}),T=M.gt((H==null?void 0:H.balance)||"0"),U=M.gt(0),W=X=>{const{value:ae}=X.target,oe=pq(ae,_);C(oe)},V=()=>{var X;(X=m.current)==null||X.focus();const ae=Sr((H==null?void 0:H.balance)||0,_).toString();C(ae)},G=async()=>{const X=await navigator.clipboard.readText();O(X)},J=()=>{O("")},Y=async X=>{!h&&d&&v&&v(t),X.preventDefault();const ae=rd(E,_);if(D){var oe;a==null||a.track({event:"SEND_TRANSACTION_REQUEST",props:{walletClient:(f==null||(oe=f._wallet)==null?void 0:oe.id)||"unknown"}}),w==null||w.sendTransaction({to:A,value:BigInt(ae.toString())}).catch(tt=>console.error("User rejected transaction",tt))}else{var ue;a==null||a.track({event:"SEND_TRANSACTION_REQUEST",props:{walletClient:(f==null||(ue=f._wallet)==null?void 0:ue.id)||"unknown"}}),w==null||w.sendTransaction({to:H==null?void 0:H.contractAddress,data:new $r(tAe).encodeFunctionData("transfer",[A,ae.toHexString()])}).catch(tt=>console.error("User rejected transaction",tt))}g(!1)};return S.createElement(q,{padding:"5",paddingTop:"3",style:{marginTop:Oi},gap:"2",flexDirection:"column",as:"form",onSubmit:Y},S.createElement(q,{background:"backgroundSecondary",borderRadius:"md",padding:"4",gap:"2",flexDirection:"column"},S.createElement(Cq,{imageUrl:L,decimals:_,name:N,symbol:R,balance:(H==null?void 0:H.balance)||"0",fiatValue:Ao({balance:H,prices:K,conversionRate:x,decimals:_}),chainId:t}),S.createElement(QL,{ref:m,style:{fontSize:ve.fontSizes.xlarge,fontWeight:ve.fontWeights.bold},name:"amount",value:b,onChange:W,controls:S.createElement(S.Fragment,null,S.createElement(ie,{variant:"small",color:"text50",whiteSpace:"nowrap"},`~${y.sign}${j}`),S.createElement(nt,{size:"xs",shape:"square",label:"Max",onClick:V,"data-id":"maxCoin",flexShrink:"0"}),S.createElement(ie,{fontSize:"xlarge",fontWeight:"bold",color:"text100"},R))}),T&&S.createElement(ie,{as:"div",variant:"normal",color:"negative",marginTop:"2"},"Insufficient Funds")),S.createElement(q,{background:"backgroundSecondary",borderRadius:"md",padding:"4",gap:"2",flexDirection:"column"},S.createElement(ie,{fontSize:"normal",color:"text50"},"To"),kg(A)?S.createElement(q,{borderRadius:"md",background:"backgroundSecondary",width:"full",flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:"4",className:vo,onClick:J,style:{height:"52px"}},S.createElement(q,{flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"2"},S.createElement(np,{address:A,style:{width:"20px"}}),S.createElement(ie,{color:"text100"},`0x${a9(A.substring(2),8)}`)),S.createElement(bu,{size:"xs"})):S.createElement(qc,{value:A,onChange:X=>O(X.target.value),placeholder:`${z.name} Address (0x...)`,name:"to-address","data-1p-ignore":!0,controls:S.createElement(nt,{size:"xs",shape:"square",label:"Paste",onClick:G,"data-id":"to-address",flexShrink:"0",leftIcon:gb})})),p&&S.createElement(q,{marginTop:"3"},S.createElement(ie,{color:"negative"},"The wallet is connected to the wrong network. Please switch network before proceeding"),S.createElement(nt,{marginTop:"2",width:"full",variant:"primary",type:"button",label:"Switch Network",onClick:()=>v&&v(t),disabled:h,style:{height:"52px",borderRadius:ve.radii.md}})),S.createElement(nt,{color:"text100",marginTop:"3",width:"full",variant:"primary",type:"submit",disabled:!U||!kg(A)||T||!h&&!d,label:"Send",rightIcon:qo,style:{height:"52px",borderRadius:ve.radii.md}}))},hAe=({chainId:t,contractAddress:e,tokenId:r})=>{var n,i,s,o,a;const{analytics:c}=QW(),{chains:l=[]}=dn(),u=h2(),{address:f="",connector:d}=fn(),h=!!(d!=null&&(n=d._wallet)!=null&&n.isSequenceBased),p=u===t,v=!p&&!h,{switchNetwork:m}=xS(),g=k.useRef(null),{setOpenWalletModal:y}=Op(),[b,C]=k.useState("0"),[A,O]=k.useState(""),{data:w}=wS(),{data:I,isLoading:B}=bq({accountAddress:f,chainId:t,collectionAddress:e,tokenId:r}),z=Rr(t,l);if(B)return null;const K=(I==null||(i=I.tokenMetadata)==null?void 0:i.decimals)||0,F=(I==null||(s=I.tokenMetadata)==null?void 0:s.name)||"Unknown",x=(I==null||(o=I.tokenMetadata)==null?void 0:o.image)||(I==null||(a=I.contractInfo)==null?void 0:a.logoURI)||"",P=b===""?"0":b,$=rd(P,K),D=$.gt((I==null?void 0:I.balance)||"0"),_=$.gt(0),N=G=>{const{value:J}=G.target,Y=pq(J,K);C(Y)},L=()=>{var G;(G=g.current)==null||G.focus();const J=Number(b)-1,Y=Math.max(J,0).toString();C(Y)},R=()=>{var G;(G=g.current)==null||G.focus();const J=Number(b)+1,Y=Number(Sr((I==null?void 0:I.balance)||0,K)),X=Math.min(J,Y).toString();C(X)},E=()=>{var G;(G=g.current)==null||G.focus();const J=Sr((I==null?void 0:I.balance)||0,K).toString();C(J)},M=async()=>{const G=await navigator.clipboard.readText();O(G)},j=()=>{O("")},T=async G=>{var J,Y;G.preventDefault(),!p&&h&&m&&m(t);const X=rd(P,K),{contractType:ae}=I;switch(ae){case"ERC721":c==null||c.track({event:"SEND_TRANSACTION_REQUEST",props:{walletClient:(d==null||(J=d._wallet)==null?void 0:J.id)||"unknown"}}),w==null||w.sendTransaction({to:I.contractAddress,data:new $r(rAe).encodeFunctionData("safeTransferFrom",[f,A,r])}).catch(oe=>console.error("User rejected transaction",oe));break;case"ERC1155":default:c==null||c.track({event:"SEND_TRANSACTION_REQUEST",props:{walletClient:(d==null||(Y=d._wallet)==null?void 0:Y.id)||"unknown"}}),w==null||w.sendTransaction({to:I.contractAddress,data:new $r(eAe).encodeFunctionData("safeBatchTransferFrom",[f,A,[r],[X.toHexString()],[]])}).catch(oe=>console.error("User rejected transaction",oe))}y(!1)},U=Sr((I==null?void 0:I.balance)||0,K).toString(),W=Number(b)===0,V=Number(b)>=Number(U);return S.createElement(q,{padding:"5",paddingTop:"3",style:{marginTop:Oi},gap:"2",flexDirection:"column",as:"form",onSubmit:T},S.createElement(q,{background:"backgroundSecondary",borderRadius:"md",padding:"4",gap:"2",flexDirection:"column"},S.createElement(Cq,{imageUrl:x,showSquareImage:!0,decimals:K,name:F,symbol:"",balance:(I==null?void 0:I.balance)||"0",chainId:t}),S.createElement(QL,{ref:g,style:{fontSize:ve.fontSizes.xlarge,fontWeight:ve.fontWeights.bold},name:"amount",value:b,onChange:N,controls:S.createElement(q,{gap:"2"},S.createElement(nt,{disabled:W,size:"xs",onClick:L,leftIcon:Ase}),S.createElement(nt,{disabled:V,size:"xs",onClick:R,leftIcon:Zie}),S.createElement(nt,{size:"xs",shape:"square",label:"Max",onClick:E,"data-id":"maxCoin",flexShrink:"0"}))}),D&&S.createElement(ie,{as:"div",variant:"normal",color:"negative",marginTop:"2"},"Insufficient Balance")),S.createElement(q,{background:"backgroundSecondary",borderRadius:"md",padding:"4",gap:"2",flexDirection:"column"},S.createElement(ie,{fontSize:"normal",color:"text50"},"To"),kg(A)?S.createElement(q,{borderRadius:"md",background:"backgroundSecondary",width:"full",flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:"4",className:vo,onClick:j,style:{height:"52px"}},S.createElement(q,{flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"2"},S.createElement(np,{address:A,style:{width:"20px"}}),S.createElement(ie,{color:"text100"},`0x${a9(A.substring(2),8)}`)),S.createElement(bu,{size:"xs"})):S.createElement(qc,{value:A,onChange:G=>O(G.target.value),placeholder:`${z.name} Address (0x...)`,name:"to-address","data-1p-ignore":!0,controls:S.createElement(nt,{size:"xs",shape:"square",label:"Paste",onClick:M,"data-id":"to-address",flexShrink:"0",leftIcon:gb})})),v&&S.createElement(q,{marginTop:"3"},S.createElement(ie,{color:"negative"},"The wallet is connected to the wrong network. Please switch network before proceeding"),S.createElement(nt,{marginTop:"2",width:"full",variant:"primary",type:"button",label:"Switch Network",onClick:()=>m&&m(t),disabled:p,style:{height:"52px",borderRadius:ve.radii.md}})),S.createElement(nt,{color:"text100",marginTop:"3",width:"full",variant:"primary",type:"submit",disabled:!_||!kg(A)||D||!p&&!h,label:"Send",rightIcon:qo,style:{height:"52px",borderRadius:ve.radii.md}}))},pAe=({transaction:t})=>{var e;const{chains:r=[]}=dn(),{fiatCurrency:n}=qn(),{setNavigation:i}=Ds(),s=()=>{i({location:"transaction-details",params:{transaction:t}})};let o=[];(e=t.transfers)==null||e.forEach(y=>{const b=y.contractAddress;o.includes(b)||o.push(b)});const{data:a=[],isLoading:c}=_u({tokens:o.map(y=>({contractAddress:y,chainId:t.chainId}))}),{data:l=1,isLoading:u}=Xc({toCurrency:n.symbol}),f=c||u,{transfers:d}=t,h=Rr(t.chainId,r),p=y=>{switch(y){case hs.SEND:return S.createElement(M6,{style:{transform:"rotate(270deg)",width:"16px"}});case hs.RECEIVE:return S.createElement(M6,{style:{transform:"rotate(90deg)",width:"16px"}});case hs.UNKNOWN:default:return S.createElement(QD,{style:{width:"14px"}})}},v=y=>{switch(y){case hs.SEND:return"Sent";case hs.RECEIVE:return"Received";case hs.UNKNOWN:default:return"Transacted"}},m=(y,b,C)=>{let A="";C===hs.SEND?A="-":C===hs.RECEIVE&&(A="+");let O="text50";return C===hs.SEND?O=ve.colors.negative:C===hs.RECEIVE&&(O=ve.colors.positive),S.createElement(ie,{fontWeight:"bold",fontSize:"normal",style:{color:O}},`${A}${y} ${b}`)},g=({transfer:y,isFirstItem:b})=>{const{amounts:C}=y,A=CH(t.timestamp).format("MMM DD, YYYY");return S.createElement(q,{gap:"2",width:"full",flexDirection:"column",justifyContent:"space-between"},S.createElement(q,{flexDirection:"row",justifyContent:"space-between"},S.createElement(q,{color:"text50",gap:"1",flexDirection:"row",justifyContent:"center",alignItems:"center"},p(y.transferType),S.createElement(ie,{fontWeight:"medium",fontSize:"normal",color:"text100"},v(y.transferType)),S.createElement(gr,{src:h.logoURI,width:"3"})),b&&S.createElement(q,null,S.createElement(ie,{fontWeight:"medium",fontSize:"normal",color:"text50"},A))),C.map((O,w)=>{var I,B,z,H,K,F;const x=Rr(t.chainId,r),P=cr(y.contractAddress,ur),$=((I=y.contractInfo)==null?void 0:I.type)==="ERC721"||((B=y.contractInfo)==null?void 0:B.type)==="ERC1155";let D;const _=(z=y.tokenIds)==null?void 0:z[w];if($&&_){var N;D=((N=y.tokenMetadata)==null||(N=N[_])==null?void 0:N.decimals)||0}else{var L;D=P?x.decimals:(L=y.contractInfo)==null?void 0:L.decimals}const R=Sr(O,D),E=P?x.symbol:((H=y.contractInfo)==null?void 0:H.symbol)||"",M=P?x.logoURI:(K=y.contractInfo)==null?void 0:K.logoURI,j=(F=a.find(T=>cr(T.token.contractAddress,y.contractAddress)))==null||(F=F.price)==null?void 0:F.value;return S.createElement(q,{key:w,flexDirection:"row",justifyContent:"space-between"},S.createElement(q,{flexDirection:"row",gap:"2",justifyContent:"center",alignItems:"center"},M&&S.createElement(gr,{src:M,width:"5",alt:"token logo"}),m(ha(R),E,y.transferType)),f&&S.createElement(Et,{width:"35px",height:"20px"}),j&&S.createElement(ie,{fontWeight:"medium",fontSize:"normal",color:"text50"},`${n.sign}${(Number(R)*j*l).toFixed(2)}`))}))};return S.createElement(q,{background:"backgroundSecondary",borderRadius:"md",padding:"4",gap:"2",alignItems:"center",justifyContent:"center",flexDirection:"column",className:vo,onClick:()=>s()},d==null?void 0:d.map((y,b)=>S.createElement(q,{key:`${t.txnHash}-${b}`,width:"full"},g({transfer:y,isFirstItem:b===0}))))},h9=()=>{const t=()=>S.createElement(q,{flexDirection:"column",gap:"2",width:"full",justifyContent:"space-between"},S.createElement(q,{flexDirection:"row",justifyContent:"space-between"},S.createElement(Et,{width:"65px",height:"20px"}),S.createElement(Et,{width:"75px",height:"17px"})),S.createElement(q,{flexDirection:"row",justifyContent:"space-between"},S.createElement(Et,{width:"120px",height:"20px"}),S.createElement(Et,{width:"35px",height:"17px"})));return S.createElement(q,{flexDirection:"column",gap:"3"},S.createElement(Et,{width:"70px",height:"17px"}),S.createElement(q,{flexDirection:"column",gap:"2"},Array(8).fill(null).map((e,r)=>S.createElement(q,{borderRadius:"md",padding:"4",gap:"2",alignItems:"center",justifyContent:"center",flexDirection:"column",background:"backgroundSecondary",key:r},t()))))},p9=({transactions:t,isLoading:e,isFetchingNextPage:r})=>{const n=[{id:"today",label:"Today"},{id:"yesterday",label:"Yesterday"},{id:"week",label:"Last Week"},{id:"month",label:"Last Month"},{id:"year",label:"Last Year"},{id:"years",label:"Past Years"}],i=k.useMemo(()=>{const a=new Date(new Date().setHours(0,0,0,0)).getTime(),c=new Date(new Date().setDate(new Date(a).getDate()-1)).getTime(),l=new Date(new Date().setDate(new Date().getDate()-7)).getTime(),u=new Date(new Date().setDate(new Date().getDate()-30)).getTime(),f=new Date(new Date().setDate(new Date().getDate()-365)).getTime(),d={today:[],yesterday:[],week:[],month:[],year:[],years:[]};return t.forEach(h=>{const p=new Date(h.timestamp).getTime();p>a?d.today.push(h):p>c?d.yesterday.push(h):p>l?d.week.push(h):p>u?d.month.push(h):p>f?d.year.push(h):d.years.push(h)}),d},[t]);if(e)return S.createElement(q,{flexDirection:"column",gap:"2"},S.createElement(h9,null));const s=({label:a})=>S.createElement(q,null,S.createElement(ie,{color:"text50",fontWeight:"medium",fontSize:"normal"},a)),o=({transactions:a})=>S.createElement(q,{flexDirection:"column",gap:"2"},a.map((c,l)=>S.createElement(q,{key:`${c.txnHash}-${l}`,flexDirection:"column",gap:"2"},S.createElement(pAe,{transaction:c}))));return S.createElement(q,{flexDirection:"column",gap:"5"},n.map(a=>{const c=i[a.id];return c.length===0?null:S.createElement(q,{key:a.id,flexDirection:"column",gap:"3"},S.createElement(s,{label:a.label}),S.createElement(o,{transactions:c}))}),t.length===0&&S.createElement(q,{flexDirection:"column",gap:"3"},S.createElement(s,{label:"History"}),S.createElement(ie,{color:"text100"},"No Recent Transaction History Found")),r&&S.createElement(q,{margin:"4",alignItems:"center",justifyContent:"center"},S.createElement(GC,null)))},vAe=()=>{const{selectedNetworks:t}=qn(),{address:e}=fn(),{data:r=[],isLoading:n}=Qke({accountAddress:e||"",chainIds:t});return S.createElement(q,null,S.createElement(q,{paddingLeft:"5",paddingBottom:"5",paddingTop:"3",style:{paddingRight:`calc(${ve.space[5]} - ${Ls})`}},S.createElement(p9,{transactions:r,isLoading:n,isFetchingNextPage:!1})))},Pg=({balance:t})=>{var e,r;const{chains:n=[]}=dn(),{setNavigation:i}=Ds(),s=cr(t.contractAddress,ur),o=Rr(t.chainId,n),a=s?o.logoURI:t==null||(e=t.contractInfo)==null?void 0:e.logoURI,c=s?o.name:(t==null||(r=t.contractInfo)==null?void 0:r.name)||"Unknown",l=()=>{var f,d;if(t.contractType==="ERC721"||t.contractType==="ERC1155")return t.balance;const h=s?o.decimals:t==null||(f=t.contractInfo)==null?void 0:f.decimals,p=Sr(t.balance,h||0),v=ha(p),m=s?o.symbol:t==null||(d=t.contractInfo)==null?void 0:d.symbol;return`${v} ${m}`},u=()=>{const f=t.contractType==="ERC721"||t.contractType==="ERC1155";i(f?{location:"collection-details",params:{contractAddress:t.contractAddress,chainId:t.chainId}}:{location:"coin-details",params:{contractAddress:t.contractAddress,chainId:t.chainId}})};return S.createElement(q,{key:t.contractAddress,onClick:u,width:"full",flexDirection:"row",justifyContent:"space-between",alignItems:"center",className:vo},S.createElement(q,{gap:"3",flexDirection:"row",alignItems:"center",justifyContent:"center"},S.createElement(lu,{imageUrl:a,size:30}),S.createElement(q,{gap:"1",flexDirection:"row",alignItems:"center",justifyContent:"center"},S.createElement(ie,{color:"text100",fontWeight:"bold",fontSize:"normal",style:{textOverflow:"ellipsis",overflow:"hidden",maxWidth:"250px",textWrap:"nowrap"}},c),S.createElement(gr,{src:o.logoURI,alt:"network logo",style:{width:"12px",height:"12px"}}))),S.createElement(q,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"1"},S.createElement(ie,{color:"text50",fontWeight:"bold",fontSize:"normal"},l()),S.createElement(qo,{color:"text50"})))},II=({toLocation:t,label:e})=>{const{setNavigation:r}=Ds(),n=()=>{r(t)};return S.createElement(q,{onClick:n,width:"full",flexDirection:"row",justifyContent:"space-between",alignItems:"center",className:vo},S.createElement(ie,{color:"text50",fontSize:"normal",fontWeight:"medium"},e),S.createElement(q,{flexDirection:"row",justifyContent:"center",alignItems:"center"},S.createElement(ie,{color:"text50",fontSize:"normal",fontWeight:"medium"},"View all"),S.createElement(qo,{color:"text50",size:"sm"})))},mAe=()=>{const{chains:t=[]}=dn(),{fiatCurrency:e,hideUnlistedTokens:r,selectedNetworks:n}=qn(),[i,s]=k.useState(""),{address:o}=fn(),{data:a,isLoading:c}=l9({accountAddress:o||"",chainIds:n},{hideUnlistedTokens:r}),l=(a==null?void 0:a.filter(z=>z.contractType==="ERC20"||cr(z.contractAddress,ur)))||[],{data:u=[],isLoading:f}=_u({tokens:l.map(z=>({chainId:z.chainId,contractAddress:z.contractAddress}))}),{data:d=1,isLoading:h}=Xc({toCurrency:e.symbol}),p=l.sort((z,H)=>{var K,F;return Number(Ao({balance:H,prices:u,conversionRate:d,decimals:((K=H.contractInfo)==null?void 0:K.decimals)||18}))-Number(Ao({balance:z,prices:u,conversionRate:d,decimals:((F=H.contractInfo)==null?void 0:F.decimals)||18}))}),m=((a==null?void 0:a.filter(z=>z.contractType==="ERC721"||z.contractType==="ERC1155"))||[]).sort((z,H)=>Number(H.balance)-Number(z.balance)),g=c||f||h,y=m.map((z,H)=>{var K;return{index:H,name:((K=z.contractInfo)==null?void 0:K.name)||"Unknown"}}),b=p.map((z,H)=>{if(cr(z.contractAddress,ur)){const F=Rr(z.chainId,t);return{index:H,name:F.name}}else{var K;return{index:H,name:((K=z.contractInfo)==null?void 0:K.name)||"Unknown"}}}),C=p.length,A=m.length,O=new la(b,{keys:["name"]}),w=new la(y,{keys:["name"]}),I=(i===""?b:O.search(i).map(z=>z.item)).slice(0,5),B=(i===""?y:w.search(i).map(z=>z.item)).slice(0,5);return S.createElement(q,{paddingLeft:"5",paddingBottom:"5",paddingTop:"3",flexDirection:"column",gap:"10",alignItems:"center",justifyContent:"center",style:{paddingRight:`calc(${ve.space[5]} - ${Ls})`}},S.createElement(q,{width:"full"},S.createElement(qc,{autoFocus:!0,name:"search wallet",leftIcon:bb,value:i,onChange:z=>s(z.target.value),placeholder:"Search your wallet","data-1p-ignore":!0})),S.createElement(q,{width:"full",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"5"},S.createElement(II,{toLocation:{location:"search-view-all",params:{defaultTab:"collections"}},label:`Collections (${A})`}),g?Array(5).fill(null).map((z,H)=>S.createElement(Et,{key:H,width:"100%",height:"32px"})):B.length===0?S.createElement(ie,{color:"text100"},"No collections found"):B.map(z=>{const H=m[z.index];return S.createElement(Pg,{key:H.contractAddress,balance:H})})),S.createElement(q,{width:"full",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"5"},S.createElement(II,{toLocation:{location:"search-view-all",params:{defaultTab:"coins"}},label:`Coins (${C})`}),g?Array(5).fill(null).map((z,H)=>S.createElement(Et,{key:H,width:"100%",height:"32px"})):I.length===0?S.createElement(ie,{color:"text100"},"No coins found"):I.map(z=>{const H=p[z.index];return S.createElement(Pg,{key:H.contractAddress,balance:H})})))},yAe=({defaultTab:t})=>{const{chains:e=[]}=dn(),{fiatCurrency:r,hideUnlistedTokens:n,selectedNetworks:i}=qn(),[s,o]=k.useState(""),[a,c]=k.useState(t);k.useEffect(()=>{o("")},[a]);const{address:l}=fn(),{data:u,isLoading:f}=l9({accountAddress:l||"",chainIds:i},{hideUnlistedTokens:n}),d=(u==null?void 0:u.filter(P=>P.contractType==="ERC20"||cr(P.contractAddress,ur)))||[],{data:h=[],isLoading:p}=_u({tokens:d.map(P=>({chainId:P.chainId,contractAddress:P.contractAddress}))}),{data:v=1,isLoading:m}=Xc({toCurrency:r.symbol}),g=d.sort((P,$)=>{var D,_;return Number(Ao({balance:$,prices:h,conversionRate:v,decimals:((D=$.contractInfo)==null?void 0:D.decimals)||18}))-Number(Ao({balance:P,prices:h,conversionRate:v,decimals:((_=P.contractInfo)==null?void 0:_.decimals)||18}))}),b=((u==null?void 0:u.filter(P=>P.contractType==="ERC721"||P.contractType==="ERC1155"))||[]).sort((P,$)=>Number($.balance)-Number(P.balance)),C=g.length,A=b.length,O=f||p||m,w=b.map((P,$)=>{var D;return{index:$,name:((D=P.contractInfo)==null?void 0:D.name)||"Unknown"}}),I=g.map((P,$)=>{if(cr(P.contractAddress,ur)){const _=Rr(P.chainId,e);return{index:$,name:_.name}}else{var D;return{index:$,name:((D=P.contractInfo)==null?void 0:D.name)||"Unknown"}}}),B=new la(I,{keys:["name"]}),z=new la(w,{keys:["name"]}),H=s===""?I:B.search(s).map(P=>P.item),K=s===""?w:z.search(s).map(P=>P.item),F=()=>S.createElement(Et,{width:"360px",height:"48px"}),x=()=>S.createElement(S.Fragment,null,Array(8).fill(null).map((P,$)=>S.createElement(Et,{key:$,width:"full",height:"32px"})));return S.createElement(q,{paddingLeft:"5",paddingBottom:"5",paddingTop:"3",flexDirection:"column",gap:"5",alignItems:"center",justifyContent:"center",style:{paddingRight:`calc(${ve.space[5]} - ${Ls})`}},S.createElement(q,{width:"full"},S.createElement(qc,{autoFocus:!0,name:"search wallet",leftIcon:bb,value:s,onChange:P=>o(P.target.value),placeholder:"Search your wallet","data-1p-ignore":!0})),S.createElement(q,{width:"full"},S.createElement(zue,{value:a,onValueChange:P=>c(P)},S.createElement(q,{marginBottom:"5"},!O&&S.createElement(Uue,{value:a,tabs:[{label:`Collections (${A})`,value:"collections"},{label:`Coins (${C})`,value:"coins"}]}),O&&S.createElement(F,null)),S.createElement(x_,{value:"collections"},S.createElement(q,{flexDirection:"column",gap:"3"},O&&S.createElement(x,null),!O&&K.length===0&&S.createElement(ie,{color:"text100"},"No Collectibles Found"),!O&&K.length>0&&K.map(P=>{const $=b[P.index];return S.createElement(Pg,{key:$.contractAddress,balance:$})}))),S.createElement(x_,{value:"coins"},S.createElement(q,{flexDirection:"column",gap:"3"},O&&S.createElement(x,null),!O&&g.length==0&&S.createElement(ie,{color:"text100"},"No Coins Found"),!O&&H.length>0&&H.map(P=>{const $=g[P.index];return S.createElement(Pg,{key:$.contractAddress,balance:$})}))))))},gAe=()=>{const{setNavigation:t}=Ds(),e=()=>{t({location:"settings-general"})},r=()=>{t({location:"settings-currency"})},n=()=>{t({location:"settings-networks"})};return S.createElement(q,{style:{paddingTop:Oi}},S.createElement(q,{padding:"5",paddingTop:"3"},S.createElement(q,{flexDirection:"column",gap:"2"},S.createElement(nt,{onClick:e,leftIcon:GD,rightIcon:qo,width:"full",label:"General",style:{height:"52px",borderRadius:ve.radii.md}}),S.createElement(nt,{onClick:r,leftIcon:cse,rightIcon:qo,width:"full",label:"Currency",style:{height:"52px",borderRadius:ve.radii.md}}),S.createElement(nt,{onClick:n,leftIcon:mse,rightIcon:qo,width:"full",label:"Networks",style:{height:"52px",borderRadius:ve.radii.md}}))))},bAe=()=>{Pp();const{hideUnlistedTokens:t,setHideUnlistedTokens:e,hideCollectibles:r,setHideCollectibles:n}=qn(),i=()=>{e(!t)},s=()=>{n(!r)};return S.createElement(q,{style:{paddingTop:Oi}},S.createElement(q,{gap:"2",padding:"5",paddingTop:"3",flexDirection:"column"},S.createElement(Eo,{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},S.createElement(ie,{color:"text100",fontWeight:"bold"},"Hide unlisted tokens"),S.createElement(w_,{checked:t,onCheckedChange:i})),S.createElement(Eo,{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},S.createElement(ie,{color:"text100",fontWeight:"bold"},"Hide collectibles"),S.createElement(w_,{checked:r,onCheckedChange:s}))))},wAe=t=>{const{selected:e,className:r,squareIndicator:n=!1}=t;return S.createElement(q,{borderStyle:"solid",borderColor:n&&e?"transparent":"borderNormal",borderWidth:"thin",position:"relative",alignItems:"center",justifyContent:"center",flexShrink:"0",className:r,style:{borderRadius:n?"4px":ve.radii.circle,width:"20px",height:"20px"}},S.createElement(q,{as:n1.div,background:n?"borderNormal":"backgroundInverse",position:"absolute",color:"textInverse100",initial:{opacity:e?1:0,scale:e?1:.5},animate:{opacity:e?1:0,scale:e?1:.5},transition:{ease:"backOut"},style:{borderRadius:n?"4px":ve.radii.circle,width:n?"20px":"14px",height:n?"20px":"14px"},justifyContent:"center",alignItems:"center"},n&&S.createElement(Od,{color:"white",style:{width:"14px",height:"14px"}})))},xAe=["value","selected","children","disabled","onClick","className","hideIndicator","squareIndicator"],Sq=t=>{const{value:e,selected:r,children:n,disabled:i,onClick:s,className:o,hideIndicator:a,squareIndicator:c=!1}=t,l=M2(t,xAe);return S.createElement(Eo,Cn({as:"button",clickable:!0,className:l9e(o),disabled:i,onClick:()=>s(e),userSelect:"none",alignItems:"center",justifyContent:"space-between",textAlign:"left",width:"full",style:{appearance:"none"}},l),n,!a&&S.createElement(wAe,{selected:r,squareIndicator:c}))},EAe=()=>{const{fiatCurrency:t,setFiatCurrency:e}=qn();return S.createElement(q,{paddingBottom:"5",paddingLeft:"5",paddingTop:"3",style:{paddingRight:`calc(${ve.space[5]} - ${Ls})`}},S.createElement(q,{flexDirection:"column",gap:"2"},Eq.map(r=>S.createElement(Sq,{key:r.symbol,value:r.symbol,selected:r.symbol===t.symbol,onClick:()=>e&&e(r)},S.createElement(q,{gap:"2",justifyContent:"flex-start",alignItems:"center"},S.createElement(ie,{color:"text100",fontWeight:"bold"},r.symbol),S.createElement(ie,{color:"text50"},r.name.message))))))},CAe=()=>{const{selectedNetworks:t,setSelectedNetworks:e}=qn(),{chains:r=[]}=dn(),n=i=>{if(t.includes(i)){if(t.length===1)return;e(t.filter(s=>s!==i))}else e([...t,i])};return S.createElement(q,{style:{paddingTop:Oi}},S.createElement(q,{padding:"5",paddingTop:"3"},S.createElement(ie,{variant:"small",color:"text50"},"Networks"),S.createElement(q,{flexDirection:"column",gap:"2"},r.map(i=>{const s=Rr(i.id,r);return S.createElement(Sq,{disabled:t.length===1&&t.includes(i.id),key:i.id,selected:t.includes(i.id),onClick:()=>n(i.id),value:i.id,squareIndicator:!0},S.createElement(q,{gap:"2",justifyContent:"center",alignItems:"center"},S.createElement(gr,{width:"3",height:"3",src:s.logoURI,alt:"network"}),S.createElement(ie,{color:"text100",variant:"small"},s.name)))}))))},Rp=({chainId:t})=>{const{chains:e=[]}=dn(),{network:r}=pn(t),n=Rr(t,e),i=o8e(t),s=a8e(t);return S.createElement(q,{height:"6",paddingY:"1",paddingLeft:"1.5",paddingRight:"2",gap:"1",style:{background:s},borderRadius:"xs",flexDirection:"row",justifyContent:"center",alignItems:"center",width:"min"},S.createElement(gr,{style:{width:"14px"},src:n.logoURI}),S.createElement(ie,{fontWeight:"bold",fontSize:"xsmall",style:{color:i}},Mke(r.name)))},SAe=({chainId:t})=>S.createElement(q,{style:{paddingTop:Oi}},S.createElement(q,{flexDirection:"column",gap:"10",paddingBottom:"5",paddingLeft:"5",paddingTop:"0",style:{marginTop:"-20px",paddingRight:`calc(${ve.space[5]} - ${Ls})`}},S.createElement(q,{marginBottom:"10",gap:"2",alignItems:"center",justifyContent:"center",flexDirection:"column"},S.createElement(Et,{width:"32px",height:"32px"}),S.createElement(Et,{height:"24px",width:"70px"}),S.createElement(Rp,{chainId:t})),S.createElement(q,null,S.createElement(ie,{fontWeight:"medium",color:"text50",fontSize:"normal"},"Balance"),S.createElement(q,{flexDirection:"row",alignItems:"flex-end",justifyContent:"space-between"},S.createElement(Et,{width:"150px",height:"36px"}),S.createElement(Et,{width:"33px",height:"17px"}))),S.createElement(nt,{color:"text100",marginTop:"4",marginBottom:"10",width:"full",variant:"primary",leftIcon:wb,label:"Send",disabled:!0,onClick:()=>{}}),S.createElement(q,null,S.createElement(h9,null)))),kAe=(t,e)=>{var r;const[n,i]=k.useState(null),s=k.useMemo(()=>new IntersectionObserver(([o])=>i(o),e),[]);return k.useEffect(()=>(t.current&&s.observe(t.current),()=>{t.current&&s.disconnect()}),[t.current,s]),(r=n==null?void 0:n.isIntersecting)!=null?r:!1},kq=t=>{const{onLoad:e,hasMore:r=!0,children:n}=t,[i,s]=k.useState(0),[o,a]=k.useState(!1),c=k.useRef(null),l=kAe(c);k.useEffect(()=>{l&&r&&!o&&u()},[l]);const u=async()=>{a(!0),await e(i),s(f=>f+1),a(!1)};return S.createElement(S.Fragment,null,n,S.createElement("div",{ref:c}))},AAe=({contractAddress:t,chainId:e})=>{var r,n,i,s;const{chains:o=[]}=dn(),{setNavigation:a}=Ds(),{fiatCurrency:c,hideUnlistedTokens:l}=qn(),{address:u}=fn(),{data:f,isLoading:d,fetchNextPage:h,hasNextPage:p,isFetchingNextPage:v}=xq({chainId:e,accountAddress:u||"",contractAddress:t}),m=mq(f),{data:g,isLoading:y}=Kke({accountAddress:u||"",contractAddress:t,chainId:e},{hideUnlistedTokens:l}),{data:b,isLoading:C}=_u({tokens:[{chainId:e,contractAddress:t}]}),{data:A=1,isLoading:O}=Xc({toCurrency:c.symbol});if(y||C||O)return S.createElement(SAe,{chainId:e});const I=cr(t,ur),B=I?Rr(e,o).logoURI:g==null||(r=g.contractInfo)==null?void 0:r.logoURI,z=I?Rr(e,o).symbol:g==null||(n=g.contractInfo)==null?void 0:n.symbol,H=I?Rr(e,o).name:g==null||(i=g.contractInfo)==null?void 0:i.name,K=I?Rr(e,o).decimals:g==null||(s=g.contractInfo)==null?void 0:s.decimals,F=Sr((g==null?void 0:g.balance)||"0",K),x=ha(F),P=g?Ao({balance:g,prices:b||[],conversionRate:A,decimals:K||0}):"0",$=()=>{a({location:"send-coin",params:{chainId:e,contractAddress:t}})};return S.createElement(q,{style:{paddingTop:Oi}},S.createElement(q,{flexDirection:"column",gap:"10",paddingBottom:"5",paddingLeft:"5",paddingTop:"0",style:{marginTop:"-20px",paddingRight:`calc(${ve.space[5]} - ${Ls})`}},S.createElement(q,{marginBottom:"10",gap:"2",alignItems:"center",justifyContent:"center",flexDirection:"column"},S.createElement(gr,{width:"8",src:B,alt:"logo"}),S.createElement(ie,{color:"text100",fontWeight:"bold",fontSize:"large"},H),S.createElement(Rp,{chainId:e})),S.createElement(q,null,S.createElement(ie,{fontWeight:"medium",color:"text50",fontSize:"normal"},"Balance"),S.createElement(q,{flexDirection:"row",alignItems:"flex-end",justifyContent:"space-between"},S.createElement(ie,{fontWeight:"bold",color:"text100",fontSize:"xlarge"},`${x} ${z}`),S.createElement(ie,{fontWeight:"medium",color:"text50",fontSize:"normal"},`${c.sign}${P}`))),S.createElement(nt,{width:"full",variant:"primary",leftIcon:wb,color:"text100",label:"Send",onClick:$}),S.createElement(q,null,S.createElement(kq,{onLoad:()=>h(),hasMore:p},S.createElement(p9,{transactions:m,isLoading:d,isFetchingNextPage:v})))))},_Ae=({chainId:t})=>S.createElement(q,{paddingLeft:"5",paddingBottom:"5",paddingTop:"3",marginTop:"8",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"10",style:{paddingRight:`calc(${ve.space[5]} - ${Ls})`}},S.createElement(q,{flexDirection:"column",gap:"2",justifyContent:"center",alignItems:"center"},S.createElement(Et,{width:"32px",height:"32px"}),S.createElement(Et,{width:"100px",height:"24px"}),S.createElement(Rp,{chainId:t}),S.createElement(Et,{width:"142px",height:"17px"})),S.createElement(q,{width:"full"},S.createElement(Et,{width:"168px",height:"20px"}),S.createElement(q,{style:{display:"grid",gridTemplateColumns:`calc(50% - ${ve.space[1]}) calc(50% - ${ve.space[1]})`,gap:ve.space[2]},width:"full",marginTop:"3"},Array(8).fill(null).map((e,r)=>S.createElement(Et,{width:"full",aspectRatio:"1/1"}))))),PAe=({chainId:t,contractAddress:e})=>{var r;const{setNavigation:n}=Ds(),{address:i}=fn(),{data:s,isLoading:o}=Vke({chainId:t,accountAddress:i||"",collectionAddress:e}),a=s==null||(r=s[0])==null?void 0:r.contractInfo,c=a==null?void 0:a.logoURI;if(o)return S.createElement(_Ae,{chainId:t});const l=u=>{n&&n({location:"collectible-details",params:{contractAddress:u.contractAddress,chainId:u.chainId,tokenId:u.tokenID}})};return S.createElement(q,{paddingLeft:"5",paddingBottom:"5",paddingTop:"3",marginTop:"8",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"10",style:{paddingRight:`calc(${ve.space[5]} - ${Ls})`}},S.createElement(q,{flexDirection:"column",gap:"2",justifyContent:"center",alignItems:"center"},S.createElement(lu,{imageUrl:c,size:32}),S.createElement(ie,{fontWeight:"bold",fontSize:"large",color:"text100"},(a==null?void 0:a.name)||"Unknown"),S.createElement(Rp,{chainId:t}),S.createElement(ie,{fontWeight:"medium",fontSize:"normal",color:"text50"},`${(s==null?void 0:s.length)||0} Unique Collectibles`)),S.createElement(q,{width:"full"},S.createElement(ie,{fontWeight:"medium",fontSize:"normal",color:"text50"},`Owned (${(s==null?void 0:s.length)||0})`),S.createElement(q,{style:{display:"grid",gridTemplateColumns:`calc(50% - ${ve.space[1]}) calc(50% - ${ve.space[1]})`,gap:ve.space[2]},width:"full",marginTop:"3"},s==null?void 0:s.map(u=>{var f,d,h;const p=u.balance,v=(u==null||(f=u.tokenMetadata)==null?void 0:f.decimals)||0,m=ha(Sr(p,v));return S.createElement(q,{key:`${u.contractAddress}-${u.tokenID}`,onClick:()=>l(u),className:vo},S.createElement(q,{background:"backgroundSecondary",aspectRatio:"1/1",width:"full",borderRadius:"md",justifyContent:"center",alignItems:"center",marginBottom:"2"},S.createElement(gr,{style:{height:"100%"},src:(d=u.tokenMetadata)==null?void 0:d.image})),S.createElement(q,null,S.createElement(ie,{fontWeight:"bold",fontSize:"normal",color:"text100"},`${(h=u.tokenMetadata)==null?void 0:h.name}`)),S.createElement(q,null,S.createElement(ie,{marginTop:"1",fontWeight:"medium",fontSize:"normal",color:"text50"},m," Owned")))}))))},TAe=()=>S.createElement(q,{style:{paddingTop:Oi}},S.createElement(q,{flexDirection:"column",gap:"10",paddingBottom:"5",paddingLeft:"5",paddingTop:"0",style:{marginTop:"-20px",paddingRight:`calc(${ve.space[5]} - ${Ls})`}},S.createElement(q,{gap:"3",alignItems:"center",justifyContent:"center",flexDirection:"column"},S.createElement(Et,{width:"120px",height:"30px"}),S.createElement(Et,{width:"140px",height:"40px"})),S.createElement(q,null,S.createElement(Et,{width:"347px",height:"347px"})),S.createElement(q,null,S.createElement(q,null,S.createElement(ie,{fontWeight:"medium",color:"text50",fontSize:"normal"},"Balance"),S.createElement(q,{flexDirection:"row",alignItems:"flex-end",justifyContent:"space-between"},S.createElement(Et,{width:"44px",height:"36px"}),S.createElement(Et,{width:"34px",height:"17px"}))),S.createElement(nt,{color:"text100",marginTop:"4",width:"full",variant:"primary",leftIcon:wb,label:"Send",onClick:()=>{}})),S.createElement(q,null,S.createElement(ie,{fontSize:"normal",color:"text50",fontWeight:"medium"},"This week"),S.createElement(h9,null)))),IAe=({contractAddress:t,chainId:e,tokenId:r})=>{var n,i,s,o,a,c;const{chains:l=[]}=dn(),{address:u}=fn(),{fiatCurrency:f}=qn(),{setNavigation:d}=Ds(),{data:h,isLoading:p,fetchNextPage:v,hasNextPage:m,isFetchingNextPage:g}=xq({chainId:e,accountAddress:u||"",contractAddress:t,tokenId:r}),y=mq(h),{data:b,isLoading:C}=bq({accountAddress:u||"",collectionAddress:t,chainId:e,tokenId:r}),{data:A,isLoading:O}=wq({tokens:[{chainId:e,contractAddress:t,tokenId:r}]}),{data:w=1,isLoading:I}=Xc({toCurrency:f.symbol});if(C||O||I)return S.createElement(TAe,null);const z=()=>{d({location:"send-collectible",params:{chainId:e,contractAddress:t,tokenId:r}})},H=Rr(e,l),K=b==null||(n=b.contractInfo)==null?void 0:n.logoURI,F=(b==null||(i=b.contractInfo)==null?void 0:i.name)||"Unknown Collection",x=(b==null||(s=b.tokenMetadata)==null?void 0:s.decimals)||0,P=(b==null?void 0:b.balance)||"0",$=Sr(P,x),D=ha(Number($)),_=b?Ao({balance:b,prices:A||[],conversionRate:w,decimals:x}):"0";return S.createElement(q,{style:{paddingTop:Oi}},S.createElement(q,{flexDirection:"column",gap:"10",paddingBottom:"5",paddingLeft:"5",paddingTop:"0",style:{marginTop:"-20px",paddingRight:`calc(${ve.space[5]} - ${Ls})`}},S.createElement(q,{gap:"3",alignItems:"center",justifyContent:"center",flexDirection:"column"},S.createElement(q,{flexDirection:"row",gap:"2",justifyContent:"center",alignItems:"center"},S.createElement(gr,{borderRadius:"circle",width:"8",src:K,alt:"collection logo",style:{objectFit:"cover"}}),S.createElement(q,{gap:"1",flexDirection:"row",justifyContent:"center",alignItems:"center"},S.createElement(ie,{fontWeight:"bold",fontSize:"small",color:"text100"},F),S.createElement(gr,{width:"3",src:H.logoURI,alt:"collection logo"}))),S.createElement(q,{flexDirection:"column",justifyContent:"center",alignItems:"center"},S.createElement(ie,{color:"text100",fontWeight:"bold",fontSize:"large"},(b==null||(o=b.tokenMetadata)==null?void 0:o.name)||"Unknown Collectible"),S.createElement(ie,{color:"text50",fontSize:"small",fontWeight:"medium"},`#${r}`))),S.createElement(q,null,S.createElement(u9,{imageUrl:b==null||(a=b.tokenMetadata)==null?void 0:a.image})),S.createElement(q,null,S.createElement(q,null,S.createElement(ie,{fontWeight:"medium",color:"text50",fontSize:"normal"},"Balance"),S.createElement(q,{flexDirection:"row",alignItems:"flex-end",justifyContent:"space-between"},S.createElement(ie,{fontWeight:"bold",color:"text100",fontSize:"xlarge"},D),A&&((c=A[0].price)==null?void 0:c.value)&&S.createElement(ie,{fontWeight:"medium",color:"text50",fontSize:"normal"},`${f.symbol} ${_}`))),S.createElement(nt,{color:"text100",marginTop:"4",width:"full",variant:"primary",leftIcon:wb,label:"Send",onClick:z})),S.createElement(q,null,S.createElement(kq,{onLoad:()=>v(),hasMore:m},S.createElement(p9,{transactions:y,isLoading:p,isFetchingNextPage:g})))))},OAe=["buttonVariant","text","size"],Aq=t=>{const{buttonVariant:e="icon",text:r,size:n="xs"}=t,i=M2(t,OAe),[s,o]=k.useState(!1);k.useEffect(()=>{s&&setTimeout(()=>{o(!1)},4e3)},[s]);const a=()=>{o(!0)},c=s?"Copied!":"Copy",l=e==="icon"?"rgba(0,0,0,0)":ve.colors.buttonGlass;return S.createElement(uH.CopyToClipboard,{text:r,onCopy:a},S.createElement(sa,Cn({size:n,icon:s?Od:gb},i,{style:Cn({background:l},t==null?void 0:t.style),label:e==="with-label"?c:void 0})))},RAe=({transaction:t})=>{var e,r;const{chains:n=[]}=dn(),{fiatCurrency:i}=qn(),s=[],o=[];(e=t.transfers)==null||e.forEach(y=>{var b,C;if(((b=y.contractInfo)==null?void 0:b.type)==="ERC721"||((C=y.contractInfo)==null?void 0:C.type)==="ERC1155"){var A;(A=y.tokenIds)==null||A.forEach(w=>{if(!o.find(z=>{var H;return z.chainId===t.chainId&&cr(z.contractAddress,((H=y.contractInfo)==null?void 0:H.address)||"")&&z.tokenId===w})){var B;o.push({chainId:t.chainId,contractAddress:((B=y.contractInfo)==null?void 0:B.address)||"",tokenId:w})}})}else{var O;const w=(y==null||(O=y.contractInfo)==null?void 0:O.address)||ur;s.find(B=>B.chainId===t.chainId&&cr(B.contractAddress,w))||s.push({chainId:t.chainId,contractAddress:w})}});const{data:a,isLoading:c}=_u({tokens:s}),{data:l,isLoading:u}=wq({tokens:o}),{data:f=1,isLoading:d}=Xc({toCurrency:i.symbol}),h=s.length>0&&c||o.length>0&&u||d,p=Rr(t.chainId,n),v=CH(t.timestamp).format("ddd MMM DD YYYY, h:m:s a"),m=()=>{window.open(`${p.blockExplorerUrl}/tx/${t.txnHash}`,"_blank")},g=({transfer:y})=>{var b,C,A,O;const w=y.to,I=w.substring(0,10)+"..."+w.substring(y.to.length-4,y.to.length),B=cr((y==null||(b=y.contractInfo)==null?void 0:b.address)||"",ur),z=B?p.logoURI:y==null||(C=y.contractInfo)==null?void 0:C.logoURI,H=B?p.symbol:(y==null||(A=y.contractInfo)==null?void 0:A.symbol)||"";return S.createElement(S.Fragment,null,(O=y.amounts)==null?void 0:O.map((K,F)=>{var x,P,$,D,_;const N=y.contractType==="ERC721"||y.contractType==="ERC1155",L=((x=y.tokenIds)==null?void 0:x[F])||"0",R=(y==null||(P=y.tokenMetadata)==null||(P=P[L])==null?void 0:P.decimals)||0,E=B?p.decimals:(y==null||($=y.contractInfo)==null?void 0:$.decimals)||0,j=Sr(K,N?R:E),T=ha(j),U=N?l==null||(D=l.find(V=>{var G,J;return cr(V.token.contractAddress,((G=y.contractInfo)==null?void 0:G.address)||"")&&V.token.tokenId===((J=y.tokenIds)==null?void 0:J[F])&&V.token.chainId===t.chainId}))==null||(D=D.price)==null?void 0:D.value:a==null||(_=a.find(V=>{var G;return cr(V.token.contractAddress,((G=y.contractInfo)==null?void 0:G.address)||ur)&&V.token.chainId===t.chainId}))==null||(_=_.price)==null?void 0:_.value,W=(parseFloat(j)*(f*(U||0))).toFixed(2);return S.createElement(q,{key:F,width:"full",flexDirection:"row",gap:"2",justifyContent:"space-between",alignItems:"center"},S.createElement(q,{flexDirection:"row",justifyContent:"flex-start",alignItems:"center",gap:"2",height:"12",borderRadius:"md",background:"buttonGlass",padding:"2",style:{flexBasis:"100%"}},S.createElement(lu,{imageUrl:z,size:20}),S.createElement(q,{gap:"0.5",flexDirection:"column",alignItems:"flex-start",justifyContent:"center"},S.createElement(ie,{fontWeight:"bold",fontSize:"xsmall",color:"text100"},`${T} ${H}`),h?S.createElement(Et,{width:"44px",height:"12px"}):S.createElement(ie,{fontWeight:"bold",fontSize:"xsmall",color:"text50"},U?`${i.sign}${W}`:""))),S.createElement(M6,{color:"text50",style:{width:"16px"}}),S.createElement(q,{flexDirection:"row",justifyContent:"flex-start",alignItems:"center",gap:"2",height:"12",borderRadius:"md",background:"buttonGlass",padding:"2",style:{flexBasis:"100%"}},S.createElement(np,{address:w,style:{width:"20px"}}),S.createElement(ie,{fontWeight:"bold",fontSize:"xsmall",color:"text100"},I)))}))};return S.createElement(q,{padding:"5",paddingTop:"3",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"10",marginTop:"5"},S.createElement(q,{marginTop:"6",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"1"},S.createElement(ie,{fontSize:"normal",fontWeight:"medium"},"Transaction details"),S.createElement(ie,{marginBottom:"1",fontSize:"small",fontWeight:"medium",color:"text50"},v),S.createElement(Rp,{chainId:t.chainId})),S.createElement(q,{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"4",width:"full",padding:"4",background:"backgroundSecondary",borderRadius:"md"},S.createElement(q,{width:"full",gap:"1",flexDirection:"row",alignItems:"center",justifyContent:"flex-start"},S.createElement(ie,{fontSize:"normal",fontWeight:"medium",color:"text50"},"Transfer"),S.createElement(gr,{width:"3",src:p.logoURI,alt:"network logo"})),(r=t.transfers)==null?void 0:r.map((y,b)=>S.createElement(q,{width:"full",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"4",key:`transfer-${b}`},S.createElement(g,{transfer:y})))),S.createElement(nt,{onClick:m,width:"full",borderRadius:"md",rightIcon:dse,label:`View on ${p.blockExplorerName}`}),S.createElement(q,null,S.createElement(q,{width:"full",flexDirection:"column",gap:"2",justifyContent:"center",alignItems:"flex-start"},S.createElement(i1,{width:"full",margin:"0",style:{marginBottom:"-4px"}}),S.createElement(ie,{color:"text50",fontSize:"normal",fontWeight:"medium"},"Status"),S.createElement(ie,{fontSize:"normal",fontWeight:"medium",color:"text100"},"Complete")),S.createElement(q,{width:"full",flexDirection:"column",gap:"2",justifyContent:"center",alignItems:"flex-start"},S.createElement(i1,{width:"full",margin:"0",style:{marginBottom:"-4px"}}),S.createElement(ie,{color:"text50",fontSize:"normal",fontWeight:"medium"},"Transaction Hash"),S.createElement(ie,{color:"text100",fontSize:"normal",fontWeight:"medium",style:{overflowWrap:"anywhere"}},t.txnHash),S.createElement(Aq,{marginTop:"2",buttonVariant:"with-label",text:t.txnHash}))))},$Ae=k.forwardRef(({onClickAccount:t},e)=>{const{address:r}=fn();return S.createElement(q,{gap:"2",alignItems:"center"},S.createElement(q,{width:"full",flexDirection:"column",alignItems:"center",justifyContent:"center"},S.createElement(q,{onClick:t,gap:"2",alignItems:"center",justifyContent:"center",className:vo,position:"relative",ref:e},S.createElement(np,{size:"sm",address:r||""}),S.createElement(ie,{color:"text100",fontWeight:"medium",variant:"normal"},hq(r||"")),S.createElement(VD,{color:"text100"}))))}),MAe=k.forwardRef(({setOpenWalletDropdown:t},e)=>{const{setNavigation:r}=Ds(),{setOpenWalletModal:n}=Op(),{address:i}=fn(),{disconnect:s}=Gz(),{theme:o}=Pp(),a=()=>{t(!1),r({location:"receive"})},c=()=>{t(!1),r({location:"history"})},l=()=>{t(!1),r({location:"settings"})},u=()=>{n(!1),t(!1),s()},f=()=>{switch(o){case"dark":return"rgba(38, 38, 38, 0.85)";case"light":return"rgba(217, 217, 217, 0.85)";default:return ve.colors.transparent}};return S.createElement(q,{padding:"3",ref:e,zIndex:"30",borderRadius:"md",style:{position:"relative",pointerEvents:"auto",width:"370px",backdropFilter:"blur(12.5px)",top:"16px",left:"15px",background:f()}},S.createElement(q,{flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start"},S.createElement(q,{flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"3",marginLeft:"2",color:"text100"},S.createElement(np,{style:{width:"28px"},size:"md",address:i||""}),S.createElement(ie,{fontSize:"large",style:{fontWeight:"700"},color:"text100"},hq(i||"")),S.createElement(Aq,{buttonVariant:"icon",size:"md",text:i||"",color:"text100",style:{marginLeft:"-16px"}})),S.createElement(sa,{onClick:()=>t(!1),size:"xs",background:"buttonGlass",icon:bu})),S.createElement(q,{gap:"2",marginTop:"3",flexDirection:"column"},S.createElement(nt,{variant:"glass",style:{borderRadius:ve.radii.md},width:"full",leftIcon:gse,label:"Receive",onClick:a}),S.createElement(nt,{style:{borderRadius:ve.radii.md},width:"full",leftIcon:QD,label:"History",onClick:c}),S.createElement(nt,{style:{borderRadius:ve.radii.md},width:"full",leftIcon:GD,label:"Settings",onClick:l}),S.createElement(nt,{label:"Sign Out",style:{borderRadius:ve.radii.md},width:"full",leftIcon:KD,onClick:u})))});Su("packages/wallet/src/shared/WalletHeader/styles.css.ts","kit");const NAe=Ii({":focus-visible":{boxShadow:"none"}},"searchButton");ku();const Xx=({})=>{const{openWalletModalState:t}=Op(),[e,r]=k.useState(!1),{goBack:n,history:i,setNavigation:s}=Ds(),o=k.useRef(!1);k.useEffect(()=>{t||r(!1)},[t]),k.useEffect(()=>{e?o.current?r(!1):o.current=!0:o.current=!1},[i.length,e]);const a=()=>{r(!0)},c=()=>{n()},l=()=>{s({location:"search"})};return S.createElement(q,{as:n1.div},S.createElement(Pke,{open:e},S.createElement(Tke,null),S.createElement(q,{background:"backgroundPrimary",zIndex:"20",position:"fixed",flexDirection:"row",alignItems:"center",justifyContent:"space-between",width:"full",style:{height:Oi,paddingTop:"6px"}},i.length>0?S.createElement(sa,{onClick:c,icon:yb,style:{backgroundColor:ve.colors.backgroundPrimary,width:"44px"}}):S.createElement(sa,{onClick:l,icon:bb,className:NAe,style:{backgroundColor:ve.colors.backgroundPrimary,width:"44px"}}),S.createElement(Ike,{asChild:!0},S.createElement($Ae,{onClickAccount:a})),S.createElement(q,{style:{width:"44px"}})),S.createElement(db,null,e&&S.createElement(Oke,{asChild:!0,side:"bottom",align:"start"},S.createElement(MAe,{setOpenWalletDropdown:r})))))},zs=({secondaryText:t,primaryText:e})=>{const{goBack:r,history:n}=Ds(),i=()=>{r()};return S.createElement(q,{background:"backgroundPrimary",zIndex:"20",position:"fixed",width:"full",flexDirection:"row",alignItems:"center",justifyContent:"space-between",style:{height:Oi,paddingTop:"6px",backgroundColor:ve.colors.backgroundPrimary}},n.length>0?S.createElement(sa,{onClick:i,icon:yb,size:"sm",style:{background:"rgba(0,0,0,0)",width:"44px"}}):S.createElement(q,null),S.createElement(q,null,S.createElement(ie,{fontWeight:"medium",variant:"small",color:"text50"},t),S.createElement(ie,{fontWeight:"medium",variant:"small",color:"text100"},e)),S.createElement(q,{style:{width:"44px"}}))},OI=t=>{const{location:e}=t;switch(e){case"send-coin":return S.createElement(dAe,{chainId:t.params.chainId,contractAddress:t.params.contractAddress});case"send-collectible":return S.createElement(hAe,{chainId:t.params.chainId,contractAddress:t.params.contractAddress,tokenId:t.params.tokenId});case"receive":return S.createElement(fAe,null);case"history":return S.createElement(vAe,null);case"search":return S.createElement(mAe,null);case"search-view-all":return S.createElement(yAe,{defaultTab:t.params.defaultTab});case"settings":return S.createElement(gAe,null);case"settings-general":return S.createElement(bAe,null);case"settings-currency":return S.createElement(EAe,null);case"settings-networks":return S.createElement(CAe,null);case"coin-details":return S.createElement(AAe,{contractAddress:t.params.contractAddress,chainId:t.params.chainId});case"collectible-details":return S.createElement(IAe,{contractAddress:t.params.contractAddress,chainId:t.params.chainId,tokenId:t.params.tokenId});case"collection-details":return S.createElement(PAe,{contractAddress:t.params.contractAddress,chainId:t.params.chainId});case"transaction-details":return S.createElement(RAe,{transaction:t.params.transaction});case"home":default:return S.createElement(uAe,null)}},DAe=t=>{const{location:e}=t;switch(e){case"search":return S.createElement(zs,{primaryText:"Search wallet"});case"search-view-all":return S.createElement(zs,{secondaryText:"Search wallet / ",primaryText:"View all"});case"settings":return S.createElement(zs,{secondaryText:"Wallet / ",primaryText:"Settings"});case"settings-general":return S.createElement(zs,{secondaryText:"Wallet / Settings / ",primaryText:"General"});case"settings-currency":return S.createElement(zs,{secondaryText:"Wallet / Settings / ",primaryText:"Currency"});case"settings-networks":return S.createElement(zs,{secondaryText:"Wallet / Settings / ",primaryText:"Networks"});case"receive":return S.createElement(zs,{secondaryText:"Wallet / ",primaryText:"Receive"});case"history":return S.createElement(zs,{secondaryText:"Wallet / ",primaryText:"History"});case"coin-details":return S.createElement(Xx,null);case"collectible-details":return S.createElement(Xx,null);case"transaction-details":return S.createElement(zs,{secondaryText:"",primaryText:""});case"send-collectible":case"send-coin":return S.createElement(zs,{secondaryText:"Wallet /",primaryText:"Send"});case"home":default:return S.createElement(Xx,null)}},LAe={location:"home"},BAe=t=>{const e=new L4;return S.createElement(U4,{client:e},S.createElement(FAe,t))},FAe=({children:t})=>{const{theme:e,position:r}=Pp(),[n,i]=k.useState(!1),[s,o]=k.useState([]),a=s.length>0?s[s.length-1]:LAe,c=a.location==="home"||a.location==="collection-details"||a.location==="collectible-details"||a.location==="coin-details"||a.location==="history"||a.location==="search"||a.location==="search-view-all"||a.location==="settings-currency";return k.useEffect(()=>{n&&o([])},[n]),S.createElement($ke,{value:{setOpenWalletModal:i,openWalletModalState:n}},S.createElement(Zke,{value:{setHistory:o,history:s}},S.createElement("div",{id:"kit-wallet"},S.createElement(_b,{root:"#kit-wallet",scope:"kit",theme:e},S.createElement(db,null,n&&S.createElement(HC,{contentProps:{style:Cn({maxWidth:"400px",height:"fit-content"},KS(r))},scroll:!1,backdropColor:"backgroundBackdrop",onClose:()=>i(!1)},S.createElement(q,{className:d9,id:"sequence-kit-wallet-content"},DAe(a),c?S.createElement(qL,{className:f9,style:{paddingTop:Oi,height:"min(800px, 80vh)"}},OI(a)):OI(a)))))),t))};var jAe=()=>typeof window<"u"&&window.localStorage.getItem("IS_PAPER_DEV")==="true",UAe=()=>typeof window<"u"&&window.location.origin.includes("paper.xyz"),_q=()=>{var t;return jAe()?(t=window.localStorage.getItem("PAPER_DEV_URL"))!=null?t:"http://localhost:3000":UAe()?window.location.origin:"https://withpaper.com"},Pq={colorPrimary:"#cf3781",colorBackground:"#ffffff",colorText:"#1a202c",borderRadius:12,fontFamily:"Open Sans"},zAe=Object.defineProperty,WAe=Object.defineProperties,HAe=Object.getOwnPropertyDescriptors,RI=Object.getOwnPropertySymbols,qAe=Object.prototype.hasOwnProperty,VAe=Object.prototype.propertyIsEnumerable,$I=(t,e,r)=>e in t?zAe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Gn=(t,e)=>{for(var r in e||(e={}))qAe.call(e,r)&&$I(t,r,e[r]);if(RI)for(var r of RI(e))VAe.call(e,r)&&$I(t,r,e[r]);return t},MI=(t,e)=>WAe(t,HAe(e)),GAe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Tq=GAe((t,e)=>{e.exports={name:"@paperxyz/js-client-sdk",description:"Paper JS SDK for Checkout Elements",version:"0.2.5",license:"Apache-2.0",main:"dist/index.js",module:"dist/index.mjs",types:"dist/index.d.ts",files:["dist/**"],bugs:{url:"https://github.com/paperxyz/js-sdk/issues"},homepage:"https://github.com/paperxyz/js-sdk",repository:{type:"git",url:"git+https://github.com/paperxyz/js-sdk.git"},author:"Paper ",scripts:{build:"tsup src/index.ts --env.NODE_ENV production","build-package-checkout":"yarn build","dev-checkout":"tsup src/index.ts --env.NODE_ENV development --watch",lint:'eslint "src/**/*.ts*"',"lint:fix":"yarn lint --fix",clean:"rm -rf .turbo && rm -rf node_modules && rm -rf dist",prepare:"cd ../../ && node ./scripts/postInstall && cd ./packages/js-client-sdk"},keywords:[],devDependencies:{"@paperxyz/tsconfig":"*","eslint-config-paperxyz":"*",typescript:"^4.7.4"},dependencies:{"@paperxyz/sdk-common-utilities":"*",ethers:"^5.7.2"},publishConfig:{access:"public"}}}),Iq=_q(),KAe="/sdk/2022-08-12/checkout-with-card",QAe=(t=>(t.UserAbandonedCheckout="User abandoned the checkout",t.UserLoginFailed="User login failed",t.InvalidProps="The props you passed in to this component are not valid.",t.InvalidCard="The card information is invalid. Please double check that the Card, CVC, and Zip code are all correct.",t.EmailNotVerified="The email was unable to be verified.",t.NotEnoughSupply="There is not enough supply to claim.",t.AddressNotAllowed="This address is not on the allowlist.",t.NoActiveClaimPhase="There is no active claim phase at the moment.",t))(QAe||{}),YAe=(t=>(t.ErrorConnectingToWallet="Error connecting to wallet",t.ErrorSendingTransaction="Something went wrong sending transaction",t.InsufficientBalance="Insufficient ETH",t.TransactionCancelled="Transaction Cancelled",t.WrongChain="Wrong Chain Detected",t.ChainSwitchUnderway="There is a network switch already underway",t.PendingSignature="Pending Signature",t))(YAe||{}),JAe=class{constructor(t){this.link=t}addStylingOptions(t){t.colorPrimary&&this.link.searchParams.set("colorPrimary",t.colorPrimary),t.colorBackground&&this.link.searchParams.set("colorBackground",t.colorBackground),t.colorText&&this.link.searchParams.set("colorText",t.colorText),t.borderRadius!==void 0&&this.link.searchParams.set("borderRadius",t.borderRadius.toString()),t.fontFamily&&this.link.searchParams.set("fontFamily",t.fontFamily),t.inputBackgroundColor&&this.link.searchParams.set("inputBackgroundColor",t.inputBackgroundColor),t.inputBorderColor&&this.link.searchParams.set("inputBorderColor",t.inputBorderColor)}addClientSecret(t){this.link.searchParams.set("sdkClientSecret",t)}addLocale(t){t&&this.link.searchParams.set("locale",t.toString())}addOTP(){this.link.searchParams.set("withOTP","true")}addAppName(t){t&&this.link.searchParams.set("appName",t)}addShowConnectWalletOptions(t){this.link.searchParams.append("showConnectWalletOptions",t.toString())}addReceivingWalletType(t){this.link.searchParams.append("walletType",t||"Preset")}addRecipientWalletAddress(t){this.link.searchParams.set("recipientWalletAddress",t)}addPayerWalletAddress(t){this.link.searchParams.append("payerWalletAddress",t)}addDate(t){this.link.searchParams.set("date",t?t.toString():Date.now().toString())}getLink(){return this.link}},XAe=({url:t,width:e=440,height:r=700})=>{if(!(window!=null&&window.top))return null;let n=window.top.outerHeight/2+window.top.screenY-r/2,i=window.top.outerWidth/2+window.top.screenX-e/2;return window.open(t,"_blank",`popup=true,width=${e},height=${r},top=${n},left=${i}`)};function NI(t,e,r){var n;(n=t.contentWindow)==null||n.postMessage(Gn({eventType:e},r),"*")}var ZAe=Tq(),e_e=class{constructor({elementOrId:e,onLoad:r}){this.elementOrId=e,this.onLoad=r}createPaymentElement({handler:e,link:r,iframeId:n}){let i=document.createElement("iframe");if(i.src=r.href,i.id=n,i.allow="payment",i.setAttribute("style","margin-left:auto; margin-right:auto; width:100%; height: 100%; min-height:375px; transition-property:all; transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1); transition-duration:150ms; color-scheme: light;"),i.onload=a=>{this.onLoad&&this.onLoad(a)},i.setAttribute("data-paper-sdk-version",`@paperxyz/js-client-sdk@${ZAe.version}`),!this.elementOrId)return window.addEventListener("message",e(i)),i;let s=this.elementOrId;if(typeof s=="string"){let a=document.getElementById(s);if(!a)throw new Error("Invalid id given");s=a}let o=s.querySelector("#"+n);return o?(o.src===r.href||(o.src=r.href),o):(window.addEventListener("message",e(i)),s.appendChild(i))}},DI={top:"0px",left:"0px",right:"0px",bottom:"0px"},t_e=()=>({main:MI(Gn({},DI),{position:"fixed",zIndex:"10000",display:"flex",alignItems:"center",justifyContent:"center"}),overlay:MI(Gn({},DI),{position:"absolute",backgroundColor:"rgba(0, 0, 0, 0.33)"}),body:{background:"transparent",borderRadius:"12px",position:"relative",overflow:"hidden",width:"100%",maxWidth:"500px",height:"700px",maxHeight:"80%",animation:"pew-modal-slideIn 0.2s forwards"},spinner:{position:"absolute",top:"0",bottom:"0",left:"0",right:"0",margin:"auto",borderWidth:"3px",borderColor:"#2D3748 #2D3748 transparent transparent",borderRadius:"50%",width:"30px",height:"30px",animation:"spin 1s linear infinite"},iframe:{position:"relative",height:"100%",width:"100%",border:"none",background:"transparent"}}),r_e=` - @keyframes pew-modal-slideIn { - from {opacity: 0; transform: translate3d(0, 20px, 0);} - to {opacity: 1; transform: translate3d(0, 0, 0);} - } - - @keyframes pew-modal-slideOut { - from {opacity: 1; transform: translate3d(0, 0, 0);} - to {opacity: 0; transform: translate3d(0, 20px, 0);} - } - - @keyframes spin { - to { transform: rotate(360deg); } - } -`,Rh="paper-js-sdk-modal",n_e=class{constructor(t,e){this.styles=t_e(),this.container=t||document.body,e&&this.mergeStyles(e),this.main=document.createElement("div"),this.main.id=Rh,this.overlay=document.createElement("div"),this.overlay.id=`${Rh}-overlay`,this.body=document.createElement("div"),this.body.id=`${Rh}-body`,this.spinner=document.createElement("div"),this.spinner.id=`${Rh}-spinner`,this.iframe=document.createElement("iframe"),this.iframe.id=`${Rh}-iframe`,this.iframe.allow="camera; microphone; payment",this.style=document.createElement("style"),this.style.innerHTML=r_e,this.assignStyles(this.main,this.styles.main),this.assignStyles(this.overlay,this.styles.overlay),this.assignStyles(this.body,this.styles.body),this.assignStyles(this.spinner,this.styles.spinner),this.assignStyles(this.iframe,this.styles.iframe)}open({iframeUrl:t}={}){t&&(this.body.appendChild(this.spinner),this.iframe.src=t,this.iframe.onload=()=>this.body.removeChild(this.spinner),this.body.appendChild(this.iframe)),this.addAccessibility(),this.main.appendChild(this.overlay),this.main.appendChild(this.style),this.main.appendChild(this.body),this.container.appendChild(this.main),document.body.style.overflow="hidden"}close(){this.body.style.animation="pew-modal-slideOut 0.2s forwards",window.setTimeout(()=>this.main.remove(),250)}mergeStyles(t){this.styles.body=Gn(Gn({},this.styles.body),t.body||{}),this.styles.spinner=Gn(Gn({},this.styles.spinner),t.spinner||{}),this.styles.overlay=Gn(Gn({},this.styles.overlay),t.overlay||{}),this.styles.main=Gn(Gn({},this.styles.main),t.main||{}),this.styles.iframe=Gn(Gn({},this.styles.iframe),t.iframe||{})}addAccessibility(){this.main.setAttribute("aria-hidden","true"),this.overlay.setAttribute("aria-hidden","true"),this.body.setAttribute("aria-modal","true"),this.body.setAttribute("role","dialog")}assignStyles(t,e){Object.assign(t.style,e)}};function i_e({sdkClientSecret:t,appName:e,options:r=Gn({},Pq),locale:n,configs:i}){let s=new URL(KAe,Iq),o=t;if(!o&&i&&(o=btoa(JSON.stringify(i))),!o){let c="/error?errorMessage=Must have either sdkClientSecret or configs field set. Received neither",l=_q();return new URL(c,l)}let a=new JAe(s);return a.addClientSecret(o??""),a.addStylingOptions(r),a.addLocale(n),a.addAppName(e),a.getLink()}function s_e({iframe:t,onError:e,onReview:r,onPaymentSuccess:n,onBeforeModalOpen:i,onPriceUpdate:s}){let o;return a=>{if(!a.origin.startsWith(Iq))return;let{data:c}=a;switch(c.eventType){case"checkoutWithCardError":e&&e({code:c.code,error:c.error});break;case"paymentSuccess":n&&n({transactionId:c.id,id:c.id}),c.postToIframe&&NI(t,c.eventType,c);break;case"reviewComplete":r&&r({id:c.id,cardholderName:c.cardholderName});break;case"openModalWithUrl":i&&c.url&&c.url.includes("promptKYCModal")?i({url:c.url}):(o=new n_e(void 0,{body:{colorScheme:"light"}}),o.open({iframeUrl:c.url}));break;case"completedSDKModal":o.close(),c.postToIframe&&NI(t,c.eventType,c);break;case"requestedPopup":{XAe({url:c.url,width:c.width,height:c.height})||console.error("CheckoutWithCard: Unable to open popup.");break}case"sizing":t.style.height=c.height+"px",t.style.maxHeight=c.height+"px";break;case"onPriceUpdate":{s==null||s(c);break}}}}function o_e({onCloseKycModal:t,onOpenKycModal:e,sdkClientSecret:r,appName:n,elementOrId:i,onLoad:s,onError:o,locale:a,options:c,onPaymentSuccess:l,onReview:u,onBeforeModalOpen:f,onPriceUpdate:d,useAltDomain:h=!0,configs:p}){let v="checkout-with-card-iframe",m=y=>s_e({iframe:y,onCloseKycModal:t,onOpenKycModal:e,onError:o,onPaymentSuccess:l,onReview:u,onBeforeModalOpen:f,onPriceUpdate:d,useAltDomain:h}),g=i_e({sdkClientSecret:r,appName:n,locale:a,options:c,useAltDomain:h,configs:p});return new e_e({onLoad:s,elementOrId:i}).createPaymentElement({handler:m,iframeId:v,link:g})}Tq();function a_e(t){if(t.sheet)return t.sheet;for(var e=0;e0?sn(rh,--ci):0,wd--,Tr===10&&(wd=1,D2--),Tr}function Ei(){return Tr=ci2||U1(Tr)>3?"":" "}function w_e(t,e){for(;--e&&Ei()&&!(Tr<48||Tr>102||Tr>57&&Tr<65||Tr>70&&Tr<97););return $p(t,Am()+(e<6&&mo()==32&&Ei()==32))}function O8(t){for(;Ei();)switch(Tr){case t:return ci;case 34:case 39:t!==34&&t!==39&&O8(Tr);break;case 40:t===41&&O8(t);break;case 92:Ei();break}return ci}function x_e(t,e){for(;Ei()&&t+Tr!==47+10;)if(t+Tr===42+42&&mo()===47)break;return"/*"+$p(e,ci-1)+"*"+N2(t===47?t:Ei())}function E_e(t){for(;!U1(mo());)Ei();return $p(t,ci)}function C_e(t){return Dq(Pm("",null,null,null,[""],t=Nq(t),0,[0],t))}function Pm(t,e,r,n,i,s,o,a,c){for(var l=0,u=0,f=o,d=0,h=0,p=0,v=1,m=1,g=1,y=0,b="",C=i,A=s,O=n,w=b;m;)switch(p=y,y=Ei()){case 40:if(p!=108&&sn(w,f-1)==58){I8(w+=at(_m(y),"&","&\f"),"&\f")!=-1&&(g=-1);break}case 34:case 39:case 91:w+=_m(y);break;case 9:case 10:case 13:case 32:w+=b_e(p);break;case 92:w+=w_e(Am()-1,7);continue;case 47:switch(mo()){case 42:case 47:Dv(S_e(x_e(Ei(),Am()),e,r),c);break;default:w+="/"}break;case 123*v:a[l++]=Ys(w)*g;case 125*v:case 59:case 0:switch(y){case 0:case 125:m=0;case 59+u:g==-1&&(w=at(w,/\f/g,"")),h>0&&Ys(w)-f&&Dv(h>32?BI(w+";",n,r,f-1):BI(at(w," ","")+";",n,r,f-2),c);break;case 59:w+=";";default:if(Dv(O=LI(w,e,r,l,u,i,a,b,C=[],A=[],f),s),y===123)if(u===0)Pm(w,e,O,O,C,s,f,a,A);else switch(d===99&&sn(w,3)===110?100:d){case 100:case 108:case 109:case 115:Pm(t,O,O,n&&Dv(LI(t,O,O,0,0,i,a,b,i,C=[],f),A),i,A,f,a,n?C:A);break;default:Pm(w,O,O,O,[""],A,0,a,A)}}l=u=h=0,v=g=1,b=w="",f=o;break;case 58:f=1+Ys(w),h=p;default:if(v<1){if(y==123)--v;else if(y==125&&v++==0&&g_e()==125)continue}switch(w+=N2(y),y*v){case 38:g=u>0?1:(w+="\f",-1);break;case 44:a[l++]=(Ys(w)-1)*g,g=1;break;case 64:mo()===45&&(w+=_m(Ei())),d=mo(),u=f=Ys(b=w+=E_e(Am())),y++;break;case 45:p===45&&Ys(w)==2&&(v=0)}}return s}function LI(t,e,r,n,i,s,o,a,c,l,u){for(var f=i-1,d=i===0?s:[""],h=y9(d),p=0,v=0,m=0;p0?d[g]+" "+y:at(y,/&\f/g,d[g])))&&(c[m++]=b);return L2(t,e,r,i===0?v9:a,c,l,u)}function S_e(t,e,r){return L2(t,e,r,Oq,N2(y_e()),j1(t,2,-2),0)}function BI(t,e,r,n){return L2(t,e,r,m9,j1(t,0,n),j1(t,n+1,-1),n)}function zf(t,e){for(var r="",n=y9(t),i=0;i6)switch(sn(t,e+1)){case 109:if(sn(t,e+4)!==45)break;case 102:return at(t,/(.+:)(.+)-([^]+)/,"$1"+ot+"$2-$3$1"+Tg+(sn(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~I8(t,"stretch")?Lq(at(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(sn(t,e+1)!==115)break;case 6444:switch(sn(t,Ys(t)-3-(~I8(t,"!important")&&10))){case 107:return at(t,":",":"+ot)+t;case 101:return at(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ot+(sn(t,14)===45?"inline-":"")+"box$3$1"+ot+"$2$3$1"+bn+"$2box$3")+t}break;case 5936:switch(sn(t,e+11)){case 114:return ot+t+bn+at(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return ot+t+bn+at(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return ot+t+bn+at(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return ot+t+bn+t+t}return t}var M_e=function(e,r,n,i){if(e.length>-1&&!e.return)switch(e.type){case m9:e.return=Lq(e.value,e.length);break;case Rq:return zf([$h(e,{value:at(e.value,"@","@"+ot)})],i);case v9:if(e.length)return m_e(e.props,function(s){switch(v_e(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return zf([$h(e,{props:[at(s,/:(read-\w+)/,":"+Tg+"$1")]})],i);case"::placeholder":return zf([$h(e,{props:[at(s,/:(plac\w+)/,":"+ot+"input-$1")]}),$h(e,{props:[at(s,/:(plac\w+)/,":"+Tg+"$1")]}),$h(e,{props:[at(s,/:(plac\w+)/,bn+"input-$1")]})],i)}return""})}},N_e=[M_e],D_e=function(e){var r=e.key;if(r==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(v){var m=v.getAttribute("data-emotion");m.indexOf(" ")!==-1&&(document.head.appendChild(v),v.setAttribute("data-s",""))})}var i=e.stylisPlugins||N_e,s={},o,a=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(v){for(var m=v.getAttribute("data-emotion").split(" "),g=1;ge in t?K_e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,J_e=(t,e)=>{for(var r in e||(e={}))Q_e.call(e,r)&&VI(t,r,e[r]);if(qI)for(var r of qI(e))Y_e.call(e,r)&&VI(t,r,e[r]);return t},X_e=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),b9=X_e((t,e)=>{e.exports={name:"@paperxyz/react-client-sdk",version:"1.1.3",description:"Paper React Client SDK for Checkout Elements",license:"Apache-2.0",main:"dist/index.js",types:"./dist/index.d.ts",type:"module",files:["dist/**"],exports:{".":{import:"./dist/index.js",types:"./dist/index.d.ts"}},bugs:{url:"https://github.com/paperxyz/js-sdk/issues"},homepage:"https://github.com/paperxyz/js-sdk",repository:{type:"git",url:"git+https://github.com/paperxyz/js-sdk.git"},author:"Paper ",keywords:[],scripts:{build:"tsup-node src/index.ts --env.NODE_ENV production --env.ESM_ONLY true ","build-package-checkout":"yarn build","dev-checkout":"tsup-node src/index.ts --env.NODE_ENV development --watch --env.ESM_ONLY true",lint:'eslint "src/**/*.ts*"',"lint:fix":"yarn lint --fix",clean:"rm -rf .turbo && rm -rf node_modules && rm -rf dist",prepare:"cd ../../ && node ./scripts/postInstall && cd ./packages/react-client-sdk"},peerDependencies:{react:">=16.0.0","react-dom":">=16.0.0"},devDependencies:{"@paperxyz/tsconfig":"*","@types/react":"18.0.26","eslint-config-paperxyz":"*",react:"^18.2.0","react-dom":"^18.2.0",typescript:"^4.7.4"},dependencies:{"@emotion/css":"11.10.5","@headlessui/react":"1.7.6","@paperxyz/js-client-sdk":"*","@paperxyz/sdk-common-utilities":"*"}}}),Z_e=k.createContext({chainName:"Polygon",setChainName:()=>{},clientId:"",appName:""}),ePe=()=>k.useContext(Z_e);Bs` - opacity: 0; -`;Bs` - opacity: 1; -`;var tPe=Bs` - position: relative; - width: 100%; - height: 100%; -`;Bs` - display: grid; - position: relative; - width: 100%; -`;Bs` - transition-delay: 150ms; - transition-property: opacity; - transition-duration: 75ms; -`;Bs` - transition-property: opacity; - transition-duration: 150ms; -`;Bs` - background-color: transparent; - grid-column-start: 1; - grid-row-start: 1; -`;var rPe=({className:t})=>pe("div",{id:"loader",className:V_e(iPe,t)}),nPe=G_e` - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -`,iPe=Bs` - border: 0.15rem solid #f3f3f300; - border-top: 0.15rem solid #000000; - border-left: 0.15rem solid #000000; - border-radius: 50%; - width: 4rem; - height: 4rem; - animation: ${nPe} 1s linear infinite; -`,sPe=()=>pe("div",{className:oPe,children:pe(rPe,{className:aPe})}),oPe=Bs` - position: absolute; - top: 50%; - left: 50%; - transform: translate3d(-50%, -50%, 0); -`,aPe=Bs` - color: #000000; - width: 2rem; - height: 2rem; -`,cPe=b9(),lPe=({sdkClientSecret:t,appName:e,options:r=J_e({},Pq),onPaymentSuccess:n,onReview:i,onError:s,onBeforeModalOpen:o,onPriceUpdate:a,locale:c,configs:l})=>{let{appName:u}=ePe(),[f,d]=k.useState(!0),h=k.useCallback(()=>{d(!1)},[]),p=k.useRef(null),v=e||u;return k.useEffect(()=>{let m=setTimeout(()=>{d(!1)},1e3);return()=>{clearTimeout(m)}},[]),k.useEffect(()=>{p.current&&o_e({sdkClientSecret:t,appName:v,elementOrId:p.current,locale:c,onError:s,onLoad:h,onPaymentSuccess:n,onReview:i,onBeforeModalOpen:o,onPriceUpdate:a,options:r,configs:l})},[p.current]),pe(hV,{children:pe("div",{className:tPe,ref:p,"data-paper-sdk-version":`@paperxyz/react-client-sdk@${cPe.version}`,children:f&&pe(sPe,{})})})};Bs` - padding-top: 0.625rem; - padding-bottom: 0.625rem; - padding-left: 1.25rem; - padding-right: 1.25rem; - background-color: #1f2937; - color: #ffffff; - font-size: 0.875rem; - line-height: 1.25rem; - font-weight: 600; - justify-content: flex-start; - align-items: center; - border-radius: 0.5rem; - border: none; - cursor: pointer; -`;b9();b9();var uPe=(t=>(t.THIRDWEB_NFT_DROP_V2="THIRDWEB_NFT_DROP_V2",t.THIRDWEB_EDITION_DROP_V2="THIRDWEB_EDITION_DROP_V2",t.THIRDWEB_SIGNATURE="THIRDWEB_SIGNATURE",t.CANDY_MACHINE="CANDY_MACHINE",t.AUCTION_HOUSE="AUCTION_HOUSE",t))(uPe||{}),fPe=(t=>(t.POPUP="POPUP",t.NEW_TAB="NEW_TAB",t.MODAL="MODAL",t.DRAWER="DRAWER",t.EMBED="EMBED",t))(fPe||{});const[dPe,hPe]=Yc(),Mp=()=>{const{triggerCheckout:t,closeCheckout:e,settings:r}=dPe();return{triggerCheckout:t,closeCheckout:e,settings:r}};function uu(){return uu=Object.assign?Object.assign.bind():function(t){for(var e=1;et.toLowerCase()===e.toLowerCase();var Fa=function(t){return t[t.VERY_LARGE=0]="VERY_LARGE",t[t.FRACTION=1]="FRACTION",t[t.VERY_TINY=2]="VERY_TINY",t[t.MIXED=3]="MIXED",t}(Fa||{});const R8=t=>{if(isNaN(Number(t)))return console.error(`display format error ${t} is not a number`),"NaN";const e=Number(t);if(e===0)return"0";let r;e>1e8?r=Fa.VERY_LARGE:e<1e-10?r=Fa.VERY_TINY:e<1?r=Fa.FRACTION:r=Fa.MIXED;let n,i;switch(r){case Fa.VERY_LARGE:n="compact",i={maximumFractionDigits:4};break;case Fa.VERY_TINY:n="scientific",i={maximumFractionDigits:4};break;case Fa.FRACTION:n="standard",i={maximumSignificantDigits:4};break;default:n="standard",i={maximumFractionDigits:2}}return Intl.NumberFormat("en-US",uu({notation:n},i)).format(e)},pPe=t=>t.charAt(0).toUpperCase()+t.slice(1),vPe=t=>t.chainId===1?"Ethereum":pPe(t.name),mPe=async({accountAddress:t,chainId:e})=>{try{const{indexerClient:r}=await pn(e),n=await r.getEtherBalance({accountAddress:t});return[{chainId:e,contractAddress:ur,accountAddress:t,balance:(n==null?void 0:n.balance.balanceWei)||"0",contractType:E4.UNKNOWN,blockHash:"",blockNumber:0,tokenID:""}]}catch(r){return console.error(r),[]}},yPe=async({accountAddress:t,chainId:e})=>{try{const{indexerClient:r}=await pn(e),n=await r.getTokenBalances({accountAddress:t,includeMetadata:!0});return(n==null?void 0:n.balances)||[]}catch(r){return console.error(r),[]}},gPe=async({accountAddress:t,chainId:e})=>{try{return(await Promise.all([mPe({accountAddress:t,chainId:e}),yPe({accountAddress:t,chainId:e})])).flat()}catch(r){return console.error(r),[]}},bPe=async({chainId:t,tokenId:e,contractAddress:r})=>{const{metadataClient:n}=await pn(t);return(await n.getTokenMetadata({chainID:String(t),contractAddress:r,tokenIDs:[e]})).tokenMetadata[0]},wPe=async({chainID:t,contractAddress:e})=>{const{metadataClient:r}=await pn(t);return(await r.getContractInfo({chainID:t,contractAddress:e})).contractInfo},xPe=async({chainId:t,email:e,contractAddress:r,abi:n,receiptTitle:i,collectionContractAddress:s,methodArguments:o,currency:a,currencyAmount:c,methodName:l,recipientAddress:u})=>{const{network:f,apiClient:d}=await pn(t),h=vPe(f),p=JSON.stringify(uu({title:i,email:e,limitPerTransaction:1,quantity:1,mintMethod:{args:o,payment:{currency:a,value:`${c} * $QUANTITY`},name:l},walletAddress:u},s?{contractArgs:{collectionContractAddress:s}}:{})),{secret:v}=await d.paperSessionSecret2({chainName:h,contractAddress:r,abi:n,paramsJson:p});return v},w9={oneSecond:1*1e3,oneMinute:60*1e3,oneHour:60*60*1e3},EPe=t=>li({queryKey:["balances",t],queryFn:()=>gPe(t),retry:!0,staleTime:10*w9.oneMinute,enabled:!!t.chainId&&!!t.accountAddress}),CPe=t=>li({queryKey:["useTokenMetadata",t],queryFn:()=>bPe(t),retry:!0,staleTime:10*w9.oneMinute,enabled:!!t.chainId&&!!t.contractAddress}),jq=t=>li({queryKey:["useContractInfo",t],queryFn:()=>wPe(t),retry:!0,staleTime:60*w9.oneMinute,enabled:!!t.chainID&&!!t.contractAddress}),[SPe,kPe]=Yc(),APe=({settings:t})=>{var e,r;const[n,i]=k.useState(!0),[s,o]=k.useState(((e=t.creditCardCheckout)==null?void 0:e.email)||""),[a,c]=k.useState(s),[l,u]=k.useState(null),[f,d]=k.useState(!1),{setNavigation:h}=nh(),p=()=>{n&&o(a||""),n||c(s),i(!n)},v=async()=>{d(!0);try{if(!s)throw"No email address found";if(!t.creditCardCheckout)throw"No credit card checkout settings found";const A=await xPe(uu({email:s},t.creditCardCheckout));u(A)}catch(A){console.error("Failed to fetch paper secret",A),h({location:"transaction-error",params:{error:A}})}d(!1)};k.useEffect(()=>{const A=setInterval(()=>{const O=document.getElementById("paper-js-sdk-modal");O&&(O.style.pointerEvents="visible")},100);return()=>{clearInterval(A)}},[]),k.useEffect(()=>{s!==""&&v()},[s]);const m=()=>/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+$/.test(a||""),g=A=>{c(A.target.value)},y=A=>{h({location:"transaction-pending",params:{transactionId:A}})},b=A=>{h({location:"transaction-error",params:{error:A}})},C=()=>n?S.createElement(q,{as:"form",flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start",onSubmit:p},S.createElement(q,{flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"2"},S.createElement(ie,{fontSize:"normal",fontWeight:"normal",color:"text50"},"Receipt email address"),S.createElement(qc,{autoFocus:!0,name:"email",type:"email",placeholder:"Email Address",value:a,onChange:g,"data-1p-ignore":!0})),S.createElement(nt,{size:"xs",label:"Save",leftIcon:Od,disabled:!m(),type:"submit"})):S.createElement(q,{flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start"},S.createElement(q,{flexDirection:"column",justifyContent:"center",alignItems:"flex-start",gap:"2"},S.createElement(ie,{fontSize:"normal",fontWeight:"normal",color:"text50"},"Receipt email address"),S.createElement(ie,{fontSize:"normal",fontWeight:"bold",color:"text100"},s)),S.createElement(nt,{size:"xs",label:"Edit",leftIcon:use,onClick:p}));return S.createElement(q,null,C(),f&&S.createElement(q,{width:"full",height:"full",flexDirection:"column",alignItems:"center",justifyContent:"center",style:{height:"200px"}},S.createElement(GC,{size:"lg",style:{width:"60px",height:"60px"}})),l&&!f&&S.createElement(Eo,{marginY:"4",flexDirection:"column"},S.createElement(lPe,{sdkClientSecret:l,appName:t==null||(r=t.creditCardCheckout)==null?void 0:r.receiptTitle,onReview:()=>{},onPaymentSuccess:A=>{y(A.id)},onError:A=>{console.error("Payment error:",A),b(A.error)},options:{colorPrimary:"#447dd1",colorText:"#ffffff",borderRadius:12}})))},x9="54px",_Pe=()=>{const{settings:t}=Mp();return S.createElement(q,{paddingX:"4",paddingBottom:"8",gap:"4",flexDirection:"column",style:{marginTop:x9}},t&&S.createElement(APe,{settings:t}))},PPe=10*1e3,TPe=()=>{const t=nh(),{params:{transactionId:e}}=t.navigation,{setNavigation:r}=t,n=`https://withpaper.com/api/v1/transaction-status/${e}`,i=async()=>{try{console.log("Polling for transaction status");const s=await fetch(n,{method:"GET",headers:{accept:"application/json"}}).then(c=>c.json()),o=s.result.status,a=s.result.transactionHash;if(console.log("transaction status poll response:",o),o==="PENDING")return;if(o==="TRANSFER_SUCCEEDED"){r&&r({location:"transaction-success",params:{transactionHash:a}});return}if(o==="TRANSFER_FAILED"||o==="PAYMENT_FAILED"){r&&r({location:"transaction-error",params:{error:new Error("Failed to transfer collectible")}});return}}catch(s){console.error("An error occurred while fetching the transaction status"),r&&r({location:"transaction-error",params:{error:s}})}};return k.useEffect(()=>{const s=setInterval(()=>{i()},PPe);return()=>{clearInterval(s)}},[]),S.createElement(q,{style:{height:"500px"}},S.createElement(q,{position:"absolute",top:"0",left:"0",width:"full",height:"full",flexDirection:"column",alignItems:"center",justifyContent:"center"},S.createElement(GC,{size:"lg",style:{width:"60px",height:"60px"}}),S.createElement(ie,{variant:"medium",color:"text50",textAlign:"center",marginTop:"8"},"Transaction in progress. ",S.createElement("br",null),"This may take a few minutes.")))},IPe=()=>{const{closeCheckout:t,settings:e}=Mp(),n=nh().navigation;return k.useEffect(()=>{setTimeout(()=>{var i,s;t(),!(e==null||(i=e.creditCardCheckout)==null)&&i.onSuccess&&(e==null||(s=e.creditCardCheckout)==null||s.onSuccess(n.params.transactionHash))},3e3)},[]),S.createElement(q,{style:{height:"500px"}},S.createElement(q,{flexDirection:"column",alignItems:"center",position:"absolute",style:{top:"50%",right:"50%",transform:"translate(50%, -50%)"}},S.createElement(OPe,null),S.createElement(ie,{fontSize:"xlarge"},"Success!"),S.createElement(ie,{textAlign:"center",variant:"normal",color:"text80"},"The transaction was successful.")))},OPe=()=>S.createElement(q,{color:"white",background:"positive",alignItems:"center",justifyContent:"center",width:"16",height:"16",borderRadius:"circle",marginBottom:"2"},S.createElement(Od,{size:"xl"})),RPe=()=>{const{closeCheckout:t,settings:e}=Mp(),n=nh().navigation;return k.useEffect(()=>{setTimeout(()=>{var i,s;t(),!(e==null||(i=e.creditCardCheckout)==null)&&i.onError&&(e==null||(s=e.creditCardCheckout)==null||s.onError(n.params.error))},3e3)},[]),S.createElement(q,{style:{height:"500px"}},S.createElement(q,{flexDirection:"column",alignItems:"center",position:"absolute",style:{top:"50%",right:"50%",transform:"translate(50%, -50%)"}},S.createElement($Pe,null),S.createElement(ie,{fontSize:"xlarge"},"Error"),S.createElement(ie,{textAlign:"center",variant:"normal",color:"text80"},"An error occurred while processing the transaction.")))},$Pe=()=>S.createElement(q,{color:"white",alignItems:"center",justifyContent:"center",width:"16",height:"16",borderRadius:"circle",marginBottom:"2",background:"negative"},S.createElement(bu,{size:"xl"})),MPe=({size:t=30})=>S.createElement(q,{alignItems:"center",justifyContent:"center",borderRadius:"circle",background:"backgroundInverse",style:{width:`${t}px`,height:`${t}px`}},S.createElement(ie,{style:{fontSize:`${t-4}px`},display:"inline-block",variant:"large",color:"textInverse100"},"?")),A0=({imageUrl:t,size:e=30})=>t?S.createElement(gr,{src:t,borderRadius:"circle",style:{width:`${e}px`,height:`${e}px`}}):S.createElement(MPe,{size:e});Su("packages/checkout/src/shared/components/Skeleton/styles.css.ts","kit");const NPe=qW({"0%":{opacity:.25},"50%":{opacity:.1},"100%":{opacity:.25}},"PulseSimple"),DPe=Ii({height:"76px",backgroundColor:"#909090",animation:`${NPe} 2s ease-in-out infinite`},"skeleton");ku();const Ef=({width:t="100%",height:e="100%",borderRadius:r="md"})=>S.createElement(q,{className:DPe,borderRadius:r,style:{width:t,height:e}}),LPe=({contractAddress:t,tokenId:e,quantityRaw:r,chainId:n})=>{const{chains:i=[]}=dn(),{data:s,isLoading:o}=CPe({chainId:n,contractAddress:t,tokenId:e}),{data:a,isLoading:c}=jq({chainID:String(n),contractAddress:t});if(o||c)return S.createElement(BPe,null);const u=Rr(n,i),{name:f="unknown",image:d,decimals:h=0}=s||{},{logoURI:p,name:v="Unknown Collection"}=a||{},m=Sr(r,h);return S.createElement(Eo,{flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between"},S.createElement(q,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"2"},S.createElement(q,{aspectRatio:"1/1",height:"full",justifyContent:"center",alignItems:"center",style:{width:"80px"}},S.createElement(gr,{src:d,borderRadius:"md",style:{height:"80px"}})),S.createElement(q,{flexDirection:"column",alignItems:"flex-start",justifyContent:"center",gap:"2"},S.createElement(q,{gap:"1",alignItems:"center"},S.createElement(A0,{size:12,imageUrl:p}),S.createElement(ie,{marginLeft:"1",fontSize:"small",color:"text80",fontWeight:"bold"},v),S.createElement(A0,{size:12,imageUrl:u.logoURI})),S.createElement(q,{flexDirection:"column",alignItems:"flex-start",justifyContent:"center",style:{width:"180px"}},S.createElement(ie,{color:"text100",fontSize:"normal",fontWeight:"normal"},f),S.createElement(ie,{color:"text50",fontSize:"normal",fontWeight:"normal"},`#${e}`)))),S.createElement(q,{height:"full",fontSize:"small",color:"text50",fontWeight:"bold"},`x${R8(m)}`))},BPe=()=>S.createElement(Eo,{flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between"},S.createElement(q,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"2"},S.createElement(Ef,{height:"80px",width:"80px"}),S.createElement(q,{flexDirection:"column",alignItems:"flex-start",justifyContent:"center",gap:"2"},S.createElement(Ef,{width:"100px",height:"14px"}),S.createElement(Ef,{width:"180px",height:"34px"}))),S.createElement(Ef,{height:"14px",width:"14px"}));Su("packages/checkout/src/views/CheckoutSelection/styles.css.ts","kit");const Uq=Ii({},"insufficientBalanceButton");Ns(`${Uq} > div`,{justifyContent:"center"});ku();const FPe=()=>{var t,e,r,n;const{chains:i=[]}=dn();nh();const{closeCheckout:s,settings:o}=Mp(),{address:a}=fn(),c=o==null?void 0:o.cryptoCheckout,l=!!c,{data:u,isLoading:f}=jq({contractAddress:(c==null||(t=c.coinQuantity)==null?void 0:t.contractAddress)||"",chainID:String((c==null?void 0:c.chainId)||1)}),{data:d,isLoading:h}=EPe({accountAddress:a||"",chainId:(c==null?void 0:c.chainId)||1}),p=(f||h)&&c,v=GI((c==null||(e=c.coinQuantity)==null?void 0:e.contractAddress)||"",ur),m=Rr((c==null?void 0:c.chainId)||1,i),g=v?m.decimals:(u==null?void 0:u.decimals)||0,y=v?m.symbol:(u==null?void 0:u.symbol)||"COIN",b=v?m.logoURI:(u==null?void 0:u.logoURI)||"",C=d==null?void 0:d.find(F=>{var x;return GI(F.contractAddress,(c==null||(x=c.coinQuantity)==null?void 0:x.contractAddress)||"")}),A=C?C.balance:"0",O=(c==null||(r=c.coinQuantity)==null?void 0:r.amountRequiredRaw)||"0",w=Sr(A,g),I=Sr(O,g),B=Z.from(A).lt(Z.from(O)),z=(o==null?void 0:o.orderSummaryItems)||[],H=(o==null||(n=o.cryptoCheckout)==null?void 0:n.chainId)||1,K=()=>{var F;console.log("trigger transaction");const x=o==null||(F=o.cryptoCheckout)==null?void 0:F.triggerTransaction;x&&x(),s()};return S.createElement(q,{paddingX:"5",paddingBottom:"5",style:{marginTop:x9},flexDirection:"column",gap:"3"},z.length>0&&S.createElement(S.Fragment,null,S.createElement(ie,{fontWeight:"normal",fontSize:"normal",color:"text50"},"Order summary"),S.createElement(q,{flexDirection:"column",gap:"2"},z.map((F,x)=>S.createElement(LPe,uu({key:x},F,{chainId:H})))),S.createElement(q,{marginTop:"2"},S.createElement(i1,{color:"backgroundSecondary",style:{margin:"0px"}}))),l&&S.createElement(q,{justifyContent:"space-between",alignItems:"center"},S.createElement(ie,{fontWeight:"normal",fontSize:"normal",color:"text50"},"Total"),p?S.createElement(Ef,{width:"100px",height:"17px"}):S.createElement(q,{flexDirection:"row",gap:"1",alignItems:"center"},S.createElement(A0,{imageUrl:b,size:12}),S.createElement(ie,{fontWeight:"normal",fontSize:"normal",color:"text100"},`${R8(I)} ${y}`))),S.createElement(q,{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"2"},l&&!B&&!p&&S.createElement(nt,{style:{borderRadius:ve.radii.md,height:"56px"},width:"full",leftIcon:()=>S.createElement(A0,{size:20,imageUrl:b}),variant:"primary",label:`Pay with ${y}`,rightIcon:qo,onClick:K}),l&&(B||p)&&S.createElement(nt,{className:Uq,style:{borderRadius:ve.radii.md,height:"56px",justifyContent:"center"},width:"full",leftIcon:()=>S.createElement(A0,{size:20,imageUrl:b}),variant:"glass",label:`Insufficient ${y}`,onClick:K,disabled:!0})),l&&S.createElement(q,{width:"full",justifyContent:"flex-end"},p?S.createElement(Ef,{width:"102px",height:"14px"}):S.createElement(ie,{fontWeight:"bold",fontSize:"small",color:"text50"},"Balance: ",`${R8(w)} ${y}`)))},t5=({secondaryText:t,primaryText:e,disableBack:r=!1})=>{const{goBack:n,history:i}=nh(),s=()=>{n()};return S.createElement(q,{background:"backgroundPrimary",zIndex:"20",position:"fixed",width:"full",flexDirection:"row",alignItems:"center",justifyContent:"space-between",style:{height:x9,paddingTop:"6px",backgroundColor:ve.colors.backgroundPrimary}},i.length>0&&!r?S.createElement(sa,{onClick:s,icon:yb,size:"sm",style:{background:"rgba(0,0,0,0)",width:"44px"}}):S.createElement(q,null),S.createElement(q,null,S.createElement(ie,{fontWeight:"medium",variant:"small",color:"text50"},t),S.createElement(ie,{fontWeight:"medium",variant:"small",color:"text100"},e)),S.createElement(q,{style:{width:"44px"}}))};Su("packages/checkout/src/shared/styles.css.ts","kit");const E9=Ii({},"walletContent");Ns(`${E9} + button`,{backgroundColor:"transparent"});Ns(`${E9} + button > svg`,{width:"20px",height:"20px"});ku();const zq={location:"select-method-checkout"},jPe=t=>{const e=new L4;return S.createElement(U4,{client:e},S.createElement(UPe,t))},UPe=({children:t})=>{const{theme:e,position:r}=Pp(),[n,i]=k.useState(!1),[s,o]=k.useState(),[a,c]=k.useState([]),l=a.length>0?a[a.length-1]:zq,u=p=>{o(p),i(!0)},f=()=>{i(!1)},d=()=>{const{location:p}=l;switch(p){case"select-method-checkout":return S.createElement(FPe,null);case"transaction-pending":return S.createElement(TPe,null);case"transaction-success":return S.createElement(IPe,null);case"transaction-error":return S.createElement(RPe,null);case"transaction-form":default:return S.createElement(_Pe,null)}},h=()=>{const{location:p}=l;switch(p){case"select-method-checkout":return S.createElement(t5,{primaryText:"Checkout"});case"transaction-success":case"transaction-error":case"transaction-pending":return S.createElement(t5,{disableBack:!0,primaryText:"Pay with credit or debit card"});case"transaction-form":default:return S.createElement(t5,{primaryText:"Pay with credit or debit card"})}};return k.useEffect(()=>{n&&c([])},[n]),S.createElement(hPe,{value:{triggerCheckout:u,closeCheckout:f,settings:s,theme:e}},S.createElement(kPe,{value:{history:a,setHistory:c}},S.createElement("div",{id:"kit-checkout"},S.createElement(_b,{root:"#kit-checkout",scope:"kit",theme:e},S.createElement(db,null,n&&S.createElement(HC,{contentProps:{style:uu({maxWidth:"400px",height:"auto"},KS(r))},scroll:!1,backdropColor:"backgroundBackdrop",onClose:()=>i(!1)},S.createElement(q,{id:"sequence-kit-checkout-content",className:E9},h(),d()))))),t))},nh=()=>{const{setHistory:t,history:e}=SPe(),r=s=>{const o=document.getElementById("sequence-kit-wallet-content"),a=o==null?void 0:o.parentElement;a==null||a.scrollTo(0,0);const c=[...e,s];t(c)},n=()=>{const s=[...e];s.pop(),t(s)},i=e.length>0?e[e.length-1]:zq;return{setNavigation:r,history:e,setHistory:t,goBack:n,navigation:i}},zPe=`Two roads diverged in a yellow wood, -Robert Frost poet - -And sorry I could not travel both -And be one traveler, long I stood -And looked down one as far as I could -To where it bent in the undergrowth; - -Then took the other, as just as fair, -And having perhaps the better claim, -Because it was grassy and wanted wear; -Though as for that the passing there -Had worn them really about the same, - -And both that morning equally lay -In leaves no step had trodden black. -Oh, I kept the first for another day! -Yet knowing how way leads on to way, -I doubted if I should ever come back. - -I shall be telling this with a sigh -Somewhere ages and ages hence: -Two roads diverged in a wood, and I— -I took the one less traveled by, -And that has made all the difference.`,WPe=[{label:"Terms",url:"https://sequence.xyz/terms"},{label:"About",url:"https://github.com/0xsequence/kit"},{label:"Blog",url:"https://sequence.xyz/blog"},{label:"Builder",url:"https://sequence.build"},{label:"Docs",url:"https://docs.sequence.xyz/wallet/connectors/kit/kit/overview"}],HPe=[{id:"discord",url:"https://discord.gg/sequence",icon:"img/social/discord.svg"},{id:"twitter",url:"https://www.twitter.com/0xsequence",icon:"img/social/twitter.svg"},{id:"youtube",url:"https://www.youtube.com/channel/UC1zHgUyV-doddTcnFNqt62Q",icon:"img/social/youtube.svg"},{id:"github",url:"https://github.com/0xsequence",icon:"img/social/github.svg"}];var KI="u3q5o00";const qPe=()=>{const{theme:t}=ip(),e=pfe("isMobile"),r=s=>{window.open(s)},n=()=>pe(q,{flexDirection:"row",gap:"4",children:WPe.map((s,o)=>pe(q,{onClick:()=>r(s.url),className:KI,gap:"4",children:pe(ie,{fontWeight:"normal",fontSize:"small",color:"text50",children:s.label})},o))}),i=()=>pe(q,{gap:"4",justifyContent:"center",alignItems:"center",children:HPe.map((s,o)=>pe(q,{className:KI,onClick:()=>window.open(s.url),children:pe(gr,{height:"3",src:s.icon,alt:s.id,style:{filter:t==="dark"?"invert(0)":"invert(1)"}})},o))});return e?Mi(q,{flexDirection:"column",padding:"5",gap:"2",style:{height:"60px"},position:"fixed",bottom:"0",width:"full",justifyContent:"center",alignItems:"center",children:[pe(n,{}),pe(i,{})]}):Mi(q,{padding:"5",style:{height:"60px"},position:"fixed",bottom:"0",width:"full",justifyContent:"space-between",children:[pe(n,{}),pe(i,{})]})},VPe=t=>({cryptoCheckout:{chainId:137,triggerTransaction:async()=>{console.log("triggered transaction")},coinQuantity:{contractAddress:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",amountRequiredRaw:"10000000000"}},orderSummaryItems:[{contractAddress:"0x631998e91476da5b870d741192fc5cbc55f5a52e",tokenId:"66597",quantityRaw:"100"},{contractAddress:"0x624e4fa6980afcf8ea27bfe08e2fb5979b64df1c",tokenId:"1741",quantityRaw:"100"}]}),GPe=(t,e)=>{let r=t;return t.length>=e&&(r=t.slice(0,e/2)+"..."+t.slice(t.length-e/2,t.length)),r},KPe=t=>`0x${GPe((t==null?void 0:t.substring(2))||"",8)}`;function QPe(){const{theme:t,setTheme:e}=ip(),{setTheme:r}=Pp(),{address:n,connector:i,isConnected:s}=fn(),{setOpenConnectModal:o}=S8e(),{setOpenWalletModal:a}=Op(),{triggerCheckout:c}=Mp(),{disconnect:l}=Gz(),{data:u}=wS(),{switchNetwork:f}=xS(),d=h2(),h=Hz(),{debug:p}=sN.parse(location.search),v=p==="true",m=async()=>{if(!(!u||!h))try{const B=await u8e(u);console.log("proof:",B);const z=await f8e(u,h,B);console.log("isValid?:",z)}catch(B){console.error(B)}},g=async()=>{if(u)try{const B=zPe,z=await u.signMessage({account:n||"",message:B});console.log("signature:",z);const[H]=await u.getAddresses(),K=await h.verifyMessage({address:H,message:B,signature:z});console.log("isValid?",K)}catch(B){console.error(B)}},y=()=>{e(t==="dark"?"light":"dark"),r(t==="dark"?"light":"dark")},b=()=>s?Mi(q,{padding:"5",justifyContent:"space-between",children:[Mi(q,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"3",children:[pe(gr,{style:{width:"36px"},src:"kit-logo.svg"}),pe(gr,{style:{width:"24px",filter:t==="dark"?"invert(0)":"invert(1)"},src:"kit-logo-text.svg"})]}),pe(q,{children:Mi(q,{flexDirection:"column",children:[Mi(q,{flexDirection:"row",gap:"2",justifyContent:"flex-end",alignItems:"center",children:[pe(q,{style:{marginRight:"-12px"},children:pe(w,{})}),pe(ie,{fontWeight:"medium",fontSize:"normal",color:"text100",children:KPe(n||"")})]}),pe(q,{alignItems:"center",justifyContent:"flex-end",flexDirection:"row",children:pe(ie,{fontWeight:"medium",fontSize:"normal",color:"text50",children:i==null?void 0:i.name})})]})})]}):pe(q,{padding:"5",justifyContent:"flex-end",children:pe(q,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"3",children:pe(w,{})})}),C=({title:B,description:z,onClick:H})=>Mi(Eo,{style:{width:"332px"},clickable:!0,onClick:H,children:[pe(ie,{color:"text100",lineHeight:"5",fontSize:"normal",fontWeight:"bold",children:B}),pe(q,{marginTop:"1",children:pe(ie,{fontWeight:"medium",lineHeight:"5",color:"text50",fontSize:"normal",children:z})})]}),A=()=>{o(!0)},O=()=>{c(VPe())},w=()=>pe(nt,{variant:"base",style:{color:ve.colors.text100},onClick:y,leftIcon:t==="dark"?Pse:pse});return Mi(q,{background:"backgroundPrimary",children:[v&&pe(q,{justifyContent:"center",alignItems:"center",children:pe(ie,{children:"Debug mode"})}),pe(q,{style:{height:"72px"},position:"fixed",width:"full",top:"0",children:pe(b,{})}),pe(q,{style:{height:"100vh"},flexDirection:"column",justifyContent:"center",alignItems:"center",children:s?Mi(q,{flexDirection:"column",gap:"4",children:[Mi(q,{flexDirection:"column",gap:"2",children:[pe(ie,{color:"text50",fontSize:"small",fontWeight:"medium",children:"Demos"}),pe(C,{title:"Embedded wallet",description:"Connect a Sequence wallet to view, swap, send, and receive collections",onClick:()=>a(!0)}),pe(C,{title:"Checkout",description:"Checkout screen before placing a purchase on coins or collections",onClick:O}),pe(C,{title:"Sign message",description:"Sign a message with your wallet",onClick:g}),v&&pe(C,{title:"Generate EthAuth proof",description:"Generate EthAuth proof",onClick:m}),v&&pe(C,{title:"Switch network",description:"Switch network",onClick:()=>{f(d===1?137:1)}})]}),pe(q,{width:"full",gap:"2",flexDirection:"row",justifyContent:"flex-end",children:pe(nt,{onClick:()=>l(),leftIcon:KD,label:"Sign out"})})]}):pe(q,{children:Mi(q,{flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"5",children:[Mi(q,{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:"3",children:[pe(gr,{style:{width:"48px"},src:"kit-logo.svg"}),pe(gr,{style:{width:"32px",filter:t==="dark"?"invert(0)":"invert(1)"},src:"kit-logo-text.svg"})]}),pe(q,{gap:"2",flexDirection:"row",alignItems:"center",children:pe(nt,{onClick:A,variant:"feature",label:"Connect"})})]})})}),pe(qPe,{})]})}function YPe(){return function(t){return t.rpcUrls.public.http[0]?{chain:t,rpcUrls:t.rpcUrls.public}:null}}function JPe(){const{debug:t}=sN.parse(location.search),e=t==="true",{chains:r,publicClient:n,webSocketPublicClient:i}=mbe([TP,Obe],[YPe()]),s=[...r6e({chains:r,walletConnectProjectId:"c65a6cb1aa83c4e24500130f23a437d8",defaultChainId:137,appName:"demo app",projectAccessKey:"iK0DPkHRt0IFo8o4M3fZIIOAAAAAAAAAA"}),...e?KW([X5e({chains:r,options:{chain:TP,account:"0xCb88b6315507e9d8c35D81AFB7F190aB6c3227C9",transport:yz()}})]):[]],o=jbe({autoConnect:!0,publicClient:n,webSocketPublicClient:i,connectors:s});return pe(Ube,{config:o,children:pe(C8e,{config:{projectAccessKey:"iK0DPkHRt0IFo8o4M3fZIIOAAAAAAAAAA",defaultTheme:"dark",signIn:{projectName:"Skyweaver",useMock:e},displayedAssets:[{contractAddress:ur,chainId:137},{contractAddress:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",chainId:137},{contractAddress:"0x631998e91476da5b870d741192fc5cbc55f5a52e",chainId:137}]},children:pe(BAe,{children:pe(jPe,{children:pe("div",{id:"app",children:pe(_b,{root:"#app",scope:"app",theme:"dark",children:pe(QPe,{})})})})})})})}const XPe=r5.createRoot(document.getElementById("root"));XPe.render(pe(S.StrictMode,{children:pe(JPe,{})}));export{E2 as $,nIe as A,ZTe as B,MTe as C,NTe as D,XTe as E,KTe as F,md as G,GTe as H,Wl as I,lIe as J,rIe as K,rs as L,qTe as M,WTe as N,HTe as O,t5e as P,a5e as Q,c5e as R,xW as S,FTe as T,iIe as U,DTe as V,RTe as W,UTe as X,jTe as Y,wW as Z,oxe as _,ki as a,YTe as a0,JTe as a1,C2 as a2,LTe as a3,OS as a4,eIe as a5,QTe as a6,tIe as a7,aIe as a8,oIe as a9,mp as aA,C0 as aB,So as aC,j5e as aa,yIe as ab,uIe as ac,U5e as ad,sIe as ae,pIe as af,fIe as ag,vIe as ah,gIe as ai,dIe as aj,hIe as ak,mIe as al,cIe as am,O5e as an,CW as ao,$x as ap,_Te as aq,cS as ar,le as as,Kb as at,Un as au,pd as av,v1 as aw,vye as ax,i2 as ay,oa as az,wK as b,Sl as c,x2 as d,zl as e,We as f,QI as g,v2 as h,dY as i,Cs as j,Rs as k,MP as l,Ka as m,PTe as n,TTe as o,ITe as p,OTe as q,u$ as r,$Te as s,nTe as t,si as u,zTe as v,Ms as w,BTe as x,Ap as y,VTe as z}; diff --git a/assets/index-371e0848.js b/assets/index-7c6a5327.js similarity index 54% rename from assets/index-371e0848.js rename to assets/index-7c6a5327.js index 908e4160..0f023c4a 100644 --- a/assets/index-371e0848.js +++ b/assets/index-7c6a5327.js @@ -1,4 +1,4 @@ -import{X as _t,Q as ce,N,G as U,i as E,Y as ot,$ as Do,c as q,C as gt}from"./index-e5e7bd9b.js";import"./index-6a2af3e6.js";import"./index-cc134824.js";function Uo(e,t){e.indexOf(t)===-1&&e.push(t)}const oo=(e,t,r)=>Math.min(Math.max(r,e),t),H={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},he=e=>typeof e=="number",Et=e=>Array.isArray(e)&&!he(e[0]),jo=(e,t,r)=>{const n=t-e;return((r-e)%n+n)%n+e};function Wo(e,t){return Et(e)?e[jo(0,e.length,t)]:e}const no=(e,t,r)=>-r*e+r*t+e,io=()=>{},it=e=>e,pr=(e,t,r)=>t-e===0?1:(r-e)/(t-e);function so(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const o=pr(0,t,n);e.push(no(r,1,o))}}function Ho(e){const t=[0];return so(t,e-1),t}function zo(e,t=Ho(e.length),r=it){const n=e.length,o=n-t.length;return o>0&&so(t,o),i=>{let s=0;for(;sArray.isArray(e)&&he(e[0]),sr=e=>typeof e=="object"&&!!e.createAnimation,Ot=e=>typeof e=="function",Fo=e=>typeof e=="string",zt={ms:e=>e*1e3,s:e=>e/1e3},lo=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,Zo=1e-7,Vo=12;function Ko(e,t,r,n,o){let i,s,a=0;do s=t+(r-t)/2,i=lo(s,n,o)-e,i>0?r=s:t=s;while(Math.abs(i)>Zo&&++aKo(i,0,1,e,r);return i=>i===0||i===1?i:lo(o(i),t,n)}const qo=(e,t="end")=>r=>{r=t==="end"?Math.min(r,.999):Math.max(r,.001);const n=r*e,o=t==="end"?Math.floor(n):Math.ceil(n);return oo(0,1,o/e)},Ar={ease:Ht(.25,.1,.25,1),"ease-in":Ht(.42,0,1,1),"ease-in-out":Ht(.42,0,.58,1),"ease-out":Ht(0,0,.58,1)},Yo=/\((.*?)\)/;function _r(e){if(Ot(e))return e;if(ao(e))return Ht(...e);if(Ar[e])return Ar[e];if(e.startsWith("steps")){const t=Yo.exec(e);if(t){const r=t[1].split(",");return qo(parseFloat(r[0]),r[1].trim())}}return it}class co{constructor(t,r=[0,1],{easing:n,duration:o=H.duration,delay:i=H.delay,endDelay:s=H.endDelay,repeat:a=H.repeat,offset:l,direction:c="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=it,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((b,h)=>{this.resolve=b,this.reject=h}),n=n||H.easing,sr(n)){const b=n.createAnimation(r);n=b.easing,r=b.keyframes||r,o=b.duration||o}this.repeat=a,this.easing=Et(n)?it:_r(n),this.updateDuration(o);const d=zo(r,l,Et(n)?n.map(_r):it);this.tick=b=>{var h;i=i;let u=0;this.pauseTime!==void 0?u=this.pauseTime:u=(b-this.startTime)*this.rate,this.t=u,u/=1e3,u=Math.max(u-i,0),this.playState==="finished"&&this.pauseTime===void 0&&(u=this.totalDuration);const p=u/this.duration;let g=Math.floor(p),$=p%1;!$&&p>=1&&($=1),$===1&&g--;const f=g%2;(c==="reverse"||c==="alternate"&&f||c==="alternate-reverse"&&!f)&&($=1-$);const y=u>=this.totalDuration?1:Math.min($,1),v=d(this.easing(y));t(v),this.pauseTime===void 0&&(this.playState==="finished"||u>=this.totalDuration+s)?(this.playState="finished",(h=this.resolve)===null||h===void 0||h.call(this,v)):this.playState!=="idle"&&(this.frameRequestId=requestAnimationFrame(this.tick))},this.play()}play(){const t=performance.now();this.playState="running",this.pauseTime!==void 0?this.startTime=t-this.pauseTime:this.startTime||(this.startTime=t),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var t;this.playState="idle",this.frameRequestId!==void 0&&cancelAnimationFrame(this.frameRequestId),(t=this.reject)===null||t===void 0||t.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(t){this.duration=t,this.totalDuration=t*(this.repeat+1)}get currentTime(){return this.t}set currentTime(t){this.pauseTime!==void 0||this.rate===0?this.pauseTime=t:this.startTime=performance.now()-t/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}class Go{setAnimation(t){this.animation=t,t==null||t.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const Ce=new WeakMap;function ho(e){return Ce.has(e)||Ce.set(e,{transforms:[],values:new Map}),Ce.get(e)}function Qo(e,t){return e.has(t)||e.set(t,new Go),e.get(t)}const Jo=["","X","Y","Z"],Xo=["translate","scale","rotate","skew"],ue={x:"translateX",y:"translateY",z:"translateZ"},Or={syntax:"",initialValue:"0deg",toDefaultUnit:e=>e+"deg"},tn={translate:{syntax:"",initialValue:"0px",toDefaultUnit:e=>e+"px"},rotate:Or,scale:{syntax:"",initialValue:1,toDefaultUnit:it},skew:Or},Zt=new Map,wr=e=>`--motion-${e}`,me=["x","y","z"];Xo.forEach(e=>{Jo.forEach(t=>{me.push(e+t),Zt.set(wr(e+t),tn[e])})});const en=(e,t)=>me.indexOf(e)-me.indexOf(t),rn=new Set(me),uo=e=>rn.has(e),on=(e,t)=>{ue[t]&&(t=ue[t]);const{transforms:r}=ho(e);Uo(r,t),e.style.transform=nn(r)},nn=e=>e.sort(en).reduce(sn,"").trim(),sn=(e,t)=>`${e} ${t}(var(${wr(t)}))`,ar=e=>e.startsWith("--"),kr=new Set;function an(e){if(!kr.has(e)){kr.add(e);try{const{syntax:t,initialValue:r}=Zt.has(e)?Zt.get(e):{};CSS.registerProperty({name:e,inherits:!1,syntax:t,initialValue:r})}catch{}}}const Ee=(e,t)=>document.createElement("div").animate(e,t),Ir={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{Ee({opacity:[1]})}catch{return!1}return!0},finished:()=>!!Ee({opacity:[0,1]},{duration:.001}).finished,linearEasing:()=>{try{Ee({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},Ae={},Ct={};for(const e in Ir)Ct[e]=()=>(Ae[e]===void 0&&(Ae[e]=Ir[e]()),Ae[e]);const ln=.015,cn=(e,t)=>{let r="";const n=Math.round(t/ln);for(let o=0;oOt(e)?Ct.linearEasing()?`linear(${cn(e,t)})`:H.easing:ao(e)?dn(e):e,dn=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`;function hn(e,t){for(let r=0;rArray.isArray(e)?e:[e];function lr(e){return ue[e]&&(e=ue[e]),uo(e)?wr(e):e}const Xt={get:(e,t)=>{t=lr(t);let r=ar(t)?e.style.getPropertyValue(t):getComputedStyle(e)[t];if(!r&&r!==0){const n=Zt.get(t);n&&(r=n.initialValue)}return r},set:(e,t,r)=>{t=lr(t),ar(t)?e.style.setProperty(t,r):e.style[t]=r}};function mo(e,t=!0){if(!(!e||e.playState==="finished"))try{e.stop?e.stop():(t&&e.commitStyles(),e.cancel())}catch{}}function mn(e,t){var r;let n=(t==null?void 0:t.toDefaultUnit)||it;const o=e[e.length-1];if(Fo(o)){const i=((r=o.match(/(-?[\d.]+)([a-z%]*)/))===null||r===void 0?void 0:r[2])||"";i&&(n=s=>s+i)}return n}function gn(){return window.__MOTION_DEV_TOOLS_RECORD}function fn(e,t,r,n={},o){const i=gn(),s=n.record!==!1&&i;let a,{duration:l=H.duration,delay:c=H.delay,endDelay:d=H.endDelay,repeat:b=H.repeat,easing:h=H.easing,persist:u=!1,direction:p,offset:g,allowWebkitAcceleration:$=!1}=n;const f=ho(e),y=uo(t);let v=Ct.waapi();y&&on(e,t);const w=lr(t),k=Qo(f.values,w),I=Zt.get(w);return mo(k.animation,!(sr(h)&&k.generator)&&n.record!==!1),()=>{const R=()=>{var P,F;return(F=(P=Xt.get(e,w))!==null&&P!==void 0?P:I==null?void 0:I.initialValue)!==null&&F!==void 0?F:0};let T=hn(un(r),R);const z=mn(T,I);if(sr(h)){const P=h.createAnimation(T,t!=="opacity",R,w,k);h=P.easing,T=P.keyframes||T,l=P.duration||l}if(ar(w)&&(Ct.cssRegisterProperty()?an(w):v=!1),y&&!Ct.linearEasing()&&(Ot(h)||Et(h)&&h.some(Ot))&&(v=!1),v){I&&(T=T.map(Z=>he(Z)?I.toDefaultUnit(Z):Z)),T.length===1&&(!Ct.partialKeyframes()||s)&&T.unshift(R());const P={delay:zt.ms(c),duration:zt.ms(l),endDelay:zt.ms(d),easing:Et(h)?void 0:Tr(h,l),direction:p,iterations:b+1,fill:"both"};a=e.animate({[w]:T,offset:g,easing:Et(h)?h.map(Z=>Tr(Z,l)):void 0},P),a.finished||(a.finished=new Promise((Z,V)=>{a.onfinish=Z,a.oncancel=V}));const F=T[T.length-1];a.finished.then(()=>{u||(Xt.set(e,w,F),a.cancel())}).catch(io),$||(a.playbackRate=1.000001)}else if(o&&y)T=T.map(P=>typeof P=="string"?parseFloat(P):P),T.length===1&&T.unshift(parseFloat(R())),a=new o(P=>{Xt.set(e,w,z?z(P):P)},T,Object.assign(Object.assign({},n),{duration:l,easing:h}));else{const P=T[T.length-1];Xt.set(e,w,I&&he(P)?I.toDefaultUnit(P):P)}return s&&i(e,t,T,{duration:l,delay:c,easing:h,repeat:b,offset:g},"motion-one"),k.setAnimation(a),a}}const pn=(e,t)=>e[t]?Object.assign(Object.assign({},e),e[t]):Object.assign({},e);function wn(e,t){var r;return typeof e=="string"?t?((r=t[e])!==null&&r!==void 0||(t[e]=document.querySelectorAll(e)),e=t[e]):e=document.querySelectorAll(e):e instanceof Element&&(e=[e]),Array.from(e||[])}const vn=e=>e(),go=(e,t,r=H.duration)=>new Proxy({animations:e.map(vn).filter(Boolean),duration:r,options:t},yn),bn=e=>e.animations[0],yn={get:(e,t)=>{const r=bn(e);switch(t){case"duration":return e.duration;case"currentTime":return zt.s((r==null?void 0:r[t])||0);case"playbackRate":case"playState":return r==null?void 0:r[t];case"finished":return e.finished||(e.finished=Promise.all(e.animations.map(xn)).catch(io)),e.finished;case"stop":return()=>{e.animations.forEach(n=>mo(n))};case"forEachNative":return n=>{e.animations.forEach(o=>n(o,e))};default:return typeof(r==null?void 0:r[t])>"u"?void 0:()=>e.animations.forEach(n=>n[t]())}},set:(e,t,r)=>{switch(t){case"currentTime":r=zt.ms(r);case"playbackRate":for(let n=0;ne.finished;function $n(e,t,r){return Ot(e)?e(t,r):e}function Cn(e){return function(r,n,o={}){r=wn(r);const i=r.length,s=[];for(let a=0;aMath.min(Math.max(r,e),t),H={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},he=e=>typeof e=="number",Et=e=>Array.isArray(e)&&!he(e[0]),jo=(e,t,r)=>{const n=t-e;return((r-e)%n+n)%n+e};function Wo(e,t){return Et(e)?e[jo(0,e.length,t)]:e}const no=(e,t,r)=>-r*e+r*t+e,io=()=>{},it=e=>e,pr=(e,t,r)=>t-e===0?1:(r-e)/(t-e);function so(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const o=pr(0,t,n);e.push(no(r,1,o))}}function Ho(e){const t=[0];return so(t,e-1),t}function zo(e,t=Ho(e.length),r=it){const n=e.length,o=n-t.length;return o>0&&so(t,o),i=>{let s=0;for(;sArray.isArray(e)&&he(e[0]),sr=e=>typeof e=="object"&&!!e.createAnimation,Ot=e=>typeof e=="function",Fo=e=>typeof e=="string",zt={ms:e=>e*1e3,s:e=>e/1e3},lo=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,Zo=1e-7,Vo=12;function Ko(e,t,r,n,o){let i,s,a=0;do s=t+(r-t)/2,i=lo(s,n,o)-e,i>0?r=s:t=s;while(Math.abs(i)>Zo&&++aKo(i,0,1,e,r);return i=>i===0||i===1?i:lo(o(i),t,n)}const qo=(e,t="end")=>r=>{r=t==="end"?Math.min(r,.999):Math.max(r,.001);const n=r*e,o=t==="end"?Math.floor(n):Math.ceil(n);return oo(0,1,o/e)},Ar={ease:Ht(.25,.1,.25,1),"ease-in":Ht(.42,0,1,1),"ease-in-out":Ht(.42,0,.58,1),"ease-out":Ht(0,0,.58,1)},Yo=/\((.*?)\)/;function _r(e){if(Ot(e))return e;if(ao(e))return Ht(...e);if(Ar[e])return Ar[e];if(e.startsWith("steps")){const t=Yo.exec(e);if(t){const r=t[1].split(",");return qo(parseFloat(r[0]),r[1].trim())}}return it}class co{constructor(t,r=[0,1],{easing:n,duration:o=H.duration,delay:i=H.delay,endDelay:s=H.endDelay,repeat:a=H.repeat,offset:l,direction:c="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=it,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((b,h)=>{this.resolve=b,this.reject=h}),n=n||H.easing,sr(n)){const b=n.createAnimation(r);n=b.easing,r=b.keyframes||r,o=b.duration||o}this.repeat=a,this.easing=Et(n)?it:_r(n),this.updateDuration(o);const d=zo(r,l,Et(n)?n.map(_r):it);this.tick=b=>{var h;i=i;let u=0;this.pauseTime!==void 0?u=this.pauseTime:u=(b-this.startTime)*this.rate,this.t=u,u/=1e3,u=Math.max(u-i,0),this.playState==="finished"&&this.pauseTime===void 0&&(u=this.totalDuration);const p=u/this.duration;let g=Math.floor(p),$=p%1;!$&&p>=1&&($=1),$===1&&g--;const f=g%2;(c==="reverse"||c==="alternate"&&f||c==="alternate-reverse"&&!f)&&($=1-$);const y=u>=this.totalDuration?1:Math.min($,1),v=d(this.easing(y));t(v),this.pauseTime===void 0&&(this.playState==="finished"||u>=this.totalDuration+s)?(this.playState="finished",(h=this.resolve)===null||h===void 0||h.call(this,v)):this.playState!=="idle"&&(this.frameRequestId=requestAnimationFrame(this.tick))},this.play()}play(){const t=performance.now();this.playState="running",this.pauseTime!==void 0?this.startTime=t-this.pauseTime:this.startTime||(this.startTime=t),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var t;this.playState="idle",this.frameRequestId!==void 0&&cancelAnimationFrame(this.frameRequestId),(t=this.reject)===null||t===void 0||t.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(t){this.duration=t,this.totalDuration=t*(this.repeat+1)}get currentTime(){return this.t}set currentTime(t){this.pauseTime!==void 0||this.rate===0?this.pauseTime=t:this.startTime=performance.now()-t/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}class Jo{setAnimation(t){this.animation=t,t==null||t.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const Ce=new WeakMap;function ho(e){return Ce.has(e)||Ce.set(e,{transforms:[],values:new Map}),Ce.get(e)}function Go(e,t){return e.has(t)||e.set(t,new Jo),e.get(t)}const Qo=["","X","Y","Z"],Xo=["translate","scale","rotate","skew"],ue={x:"translateX",y:"translateY",z:"translateZ"},Or={syntax:"",initialValue:"0deg",toDefaultUnit:e=>e+"deg"},tn={translate:{syntax:"",initialValue:"0px",toDefaultUnit:e=>e+"px"},rotate:Or,scale:{syntax:"",initialValue:1,toDefaultUnit:it},skew:Or},Zt=new Map,wr=e=>`--motion-${e}`,me=["x","y","z"];Xo.forEach(e=>{Qo.forEach(t=>{me.push(e+t),Zt.set(wr(e+t),tn[e])})});const en=(e,t)=>me.indexOf(e)-me.indexOf(t),rn=new Set(me),uo=e=>rn.has(e),on=(e,t)=>{ue[t]&&(t=ue[t]);const{transforms:r}=ho(e);Uo(r,t),e.style.transform=nn(r)},nn=e=>e.sort(en).reduce(sn,"").trim(),sn=(e,t)=>`${e} ${t}(var(${wr(t)}))`,ar=e=>e.startsWith("--"),kr=new Set;function an(e){if(!kr.has(e)){kr.add(e);try{const{syntax:t,initialValue:r}=Zt.has(e)?Zt.get(e):{};CSS.registerProperty({name:e,inherits:!1,syntax:t,initialValue:r})}catch{}}}const Ee=(e,t)=>document.createElement("div").animate(e,t),Ir={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{Ee({opacity:[1]})}catch{return!1}return!0},finished:()=>!!Ee({opacity:[0,1]},{duration:.001}).finished,linearEasing:()=>{try{Ee({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},Ae={},Ct={};for(const e in Ir)Ct[e]=()=>(Ae[e]===void 0&&(Ae[e]=Ir[e]()),Ae[e]);const ln=.015,cn=(e,t)=>{let r="";const n=Math.round(t/ln);for(let o=0;oOt(e)?Ct.linearEasing()?`linear(${cn(e,t)})`:H.easing:ao(e)?dn(e):e,dn=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`;function hn(e,t){for(let r=0;rArray.isArray(e)?e:[e];function lr(e){return ue[e]&&(e=ue[e]),uo(e)?wr(e):e}const Xt={get:(e,t)=>{t=lr(t);let r=ar(t)?e.style.getPropertyValue(t):getComputedStyle(e)[t];if(!r&&r!==0){const n=Zt.get(t);n&&(r=n.initialValue)}return r},set:(e,t,r)=>{t=lr(t),ar(t)?e.style.setProperty(t,r):e.style[t]=r}};function mo(e,t=!0){if(!(!e||e.playState==="finished"))try{e.stop?e.stop():(t&&e.commitStyles(),e.cancel())}catch{}}function mn(e,t){var r;let n=(t==null?void 0:t.toDefaultUnit)||it;const o=e[e.length-1];if(Fo(o)){const i=((r=o.match(/(-?[\d.]+)([a-z%]*)/))===null||r===void 0?void 0:r[2])||"";i&&(n=s=>s+i)}return n}function gn(){return window.__MOTION_DEV_TOOLS_RECORD}function fn(e,t,r,n={},o){const i=gn(),s=n.record!==!1&&i;let a,{duration:l=H.duration,delay:c=H.delay,endDelay:d=H.endDelay,repeat:b=H.repeat,easing:h=H.easing,persist:u=!1,direction:p,offset:g,allowWebkitAcceleration:$=!1}=n;const f=ho(e),y=uo(t);let v=Ct.waapi();y&&on(e,t);const w=lr(t),k=Go(f.values,w),I=Zt.get(w);return mo(k.animation,!(sr(h)&&k.generator)&&n.record!==!1),()=>{const R=()=>{var P,F;return(F=(P=Xt.get(e,w))!==null&&P!==void 0?P:I==null?void 0:I.initialValue)!==null&&F!==void 0?F:0};let T=hn(un(r),R);const z=mn(T,I);if(sr(h)){const P=h.createAnimation(T,t!=="opacity",R,w,k);h=P.easing,T=P.keyframes||T,l=P.duration||l}if(ar(w)&&(Ct.cssRegisterProperty()?an(w):v=!1),y&&!Ct.linearEasing()&&(Ot(h)||Et(h)&&h.some(Ot))&&(v=!1),v){I&&(T=T.map(Z=>he(Z)?I.toDefaultUnit(Z):Z)),T.length===1&&(!Ct.partialKeyframes()||s)&&T.unshift(R());const P={delay:zt.ms(c),duration:zt.ms(l),endDelay:zt.ms(d),easing:Et(h)?void 0:Tr(h,l),direction:p,iterations:b+1,fill:"both"};a=e.animate({[w]:T,offset:g,easing:Et(h)?h.map(Z=>Tr(Z,l)):void 0},P),a.finished||(a.finished=new Promise((Z,V)=>{a.onfinish=Z,a.oncancel=V}));const F=T[T.length-1];a.finished.then(()=>{u||(Xt.set(e,w,F),a.cancel())}).catch(io),$||(a.playbackRate=1.000001)}else if(o&&y)T=T.map(P=>typeof P=="string"?parseFloat(P):P),T.length===1&&T.unshift(parseFloat(R())),a=new o(P=>{Xt.set(e,w,z?z(P):P)},T,Object.assign(Object.assign({},n),{duration:l,easing:h}));else{const P=T[T.length-1];Xt.set(e,w,I&&he(P)?I.toDefaultUnit(P):P)}return s&&i(e,t,T,{duration:l,delay:c,easing:h,repeat:b,offset:g},"motion-one"),k.setAnimation(a),a}}const pn=(e,t)=>e[t]?Object.assign(Object.assign({},e),e[t]):Object.assign({},e);function wn(e,t){var r;return typeof e=="string"?t?((r=t[e])!==null&&r!==void 0||(t[e]=document.querySelectorAll(e)),e=t[e]):e=document.querySelectorAll(e):e instanceof Element&&(e=[e]),Array.from(e||[])}const vn=e=>e(),go=(e,t,r=H.duration)=>new Proxy({animations:e.map(vn).filter(Boolean),duration:r,options:t},yn),bn=e=>e.animations[0],yn={get:(e,t)=>{const r=bn(e);switch(t){case"duration":return e.duration;case"currentTime":return zt.s((r==null?void 0:r[t])||0);case"playbackRate":case"playState":return r==null?void 0:r[t];case"finished":return e.finished||(e.finished=Promise.all(e.animations.map(xn)).catch(io)),e.finished;case"stop":return()=>{e.animations.forEach(n=>mo(n))};case"forEachNative":return n=>{e.animations.forEach(o=>n(o,e))};default:return typeof(r==null?void 0:r[t])>"u"?void 0:()=>e.animations.forEach(n=>n[t]())}},set:(e,t,r)=>{switch(t){case"currentTime":r=zt.ms(r);case"playbackRate":for(let n=0;ne.finished;function $n(e,t,r){return Ot(e)?e(t,r):e}function Cn(e){return function(r,n,o={}){r=wn(r);const i=r.length,s=[];for(let a=0;ae}):void 0,hr="$lit$",rt=`lit$${(Math.random()+"").slice(9)}$`,wo="?"+rt,kn=`<${wo}>`,ft=document,Vt=()=>ft.createComment(""),Kt=e=>e===null||typeof e!="object"&&typeof e!="function",vo=Array.isArray,In=e=>vo(e)||typeof(e==null?void 0:e[Symbol.iterator])=="function",Ie=`[ \f\r]`,Rt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Nr=/-->/g,Br=/>/g,lt=RegExp(`>|${Ie}(?:([^\\s"'>=/]+)(${Ie}*=${Ie}*(?:[^ -\f\r"'\`<>=]|("|')|))|$)`,"g"),Dr=/'/g,Ur=/"/g,bo=/^(?:script|style|textarea|title)$/i,yo=e=>(t,...r)=>({_$litType$:e,strings:t,values:r}),m=yo(1),L=yo(2),pt=Symbol.for("lit-noChange"),B=Symbol.for("lit-nothing"),jr=new WeakMap,ut=ft.createTreeWalker(ft,129,null,!1);function xo(e,t){if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return Lr!==void 0?Lr.createHTML(t):t}const Tn=(e,t)=>{const r=e.length-1,n=[];let o,i=t===2?"":"",s=Rt;for(let a=0;a"?(s=o??Rt,b=-1):d[1]===void 0?b=-2:(b=s.lastIndex-d[2].length,c=d[1],s=d[3]===void 0?lt:d[3]==='"'?Ur:Dr):s===Ur||s===Dr?s=lt:s===Nr||s===Br?s=Rt:(s=lt,o=void 0);const u=s===lt&&e[a+1].startsWith("/>")?" ":"";i+=s===Rt?l+kn:b>=0?(n.push(c),l.slice(0,b)+hr+l.slice(b)+rt+u):l+rt+(b===-2?(n.push(void 0),a):u)}return[xo(e,i+(e[r]||"")+(t===2?"":"")),n]};class qt{constructor({strings:t,_$litType$:r},n){let o;this.parts=[];let i=0,s=0;const a=t.length-1,l=this.parts,[c,d]=Tn(t,r);if(this.el=qt.createElement(c,n),ut.currentNode=this.el.content,r===2){const b=this.el.content,h=b.firstChild;h.remove(),b.append(...h.childNodes)}for(;(o=ut.nextNode())!==null&&l.length0){o.textContent=kt?kt.emptyScript:"";for(let u=0;u2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=B}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,r=this,n,o){const i=this.strings;let s=!1;if(i===void 0)t=It(this,t,r,0),s=!Kt(t)||t!==this._$AH&&t!==pt,s&&(this._$AH=t);else{const a=t;let l,c;for(t=i[0],l=0;l{var n,o;const i=(n=r==null?void 0:r.renderBefore)!==null&&n!==void 0?n:t;let s=i._$litPart$;if(s===void 0){const a=(o=r==null?void 0:r.renderBefore)!==null&&o!==void 0?o:null;i._$litPart$=s=new Gt(t.insertBefore(Vt(),a),a,void 0,r??{})}return s._$AI(e),s};/** +\f\r"'\`<>=]|("|')|))|$)`,"g"),Dr=/'/g,Ur=/"/g,bo=/^(?:script|style|textarea|title)$/i,yo=e=>(t,...r)=>({_$litType$:e,strings:t,values:r}),m=yo(1),L=yo(2),pt=Symbol.for("lit-noChange"),B=Symbol.for("lit-nothing"),jr=new WeakMap,ut=ft.createTreeWalker(ft,129,null,!1);function xo(e,t){if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return Lr!==void 0?Lr.createHTML(t):t}const Tn=(e,t)=>{const r=e.length-1,n=[];let o,i=t===2?"":"",s=Rt;for(let a=0;a"?(s=o??Rt,b=-1):d[1]===void 0?b=-2:(b=s.lastIndex-d[2].length,c=d[1],s=d[3]===void 0?lt:d[3]==='"'?Ur:Dr):s===Ur||s===Dr?s=lt:s===Nr||s===Br?s=Rt:(s=lt,o=void 0);const u=s===lt&&e[a+1].startsWith("/>")?" ":"";i+=s===Rt?l+kn:b>=0?(n.push(c),l.slice(0,b)+hr+l.slice(b)+rt+u):l+rt+(b===-2?(n.push(void 0),a):u)}return[xo(e,i+(e[r]||"")+(t===2?"":"")),n]};class qt{constructor({strings:t,_$litType$:r},n){let o;this.parts=[];let i=0,s=0;const a=t.length-1,l=this.parts,[c,d]=Tn(t,r);if(this.el=qt.createElement(c,n),ut.currentNode=this.el.content,r===2){const b=this.el.content,h=b.firstChild;h.remove(),b.append(...h.childNodes)}for(;(o=ut.nextNode())!==null&&l.length0){o.textContent=kt?kt.emptyScript:"";for(let u=0;u2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=B}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,r=this,n,o){const i=this.strings;let s=!1;if(i===void 0)t=It(this,t,r,0),s=!Kt(t)||t!==this._$AH&&t!==pt,s&&(this._$AH=t);else{const a=t;let l,c;for(t=i[0],l=0;l{var n,o;const i=(n=r==null?void 0:r.renderBefore)!==null&&n!==void 0?n:t;let s=i._$litPart$;if(s===void 0){const a=(o=r==null?void 0:r.renderBefore)!==null&&o!==void 0?o:null;i._$litPart$=s=new Jt(t.insertBefore(Vt(),a),a,void 0,r??{})}return s._$AI(e),s};/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause @@ -40,15 +40,15 @@ import{X as _t,Q as ce,N,G as U,i as E,Y as ot,$ as Do,c as q,C as gt}from"./ind * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const Q=Wn(class extends Hn{constructor(e){var t;if(super(e),e.type!==jn.ATTRIBUTE||e.name!=="class"||((t=e.strings)===null||t===void 0?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter(t=>e[t]).join(" ")+" "}update(e,[t]){var r,n;if(this.it===void 0){this.it=new Set,e.strings!==void 0&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter(i=>i!=="")));for(const i in t)t[i]&&!(!((r=this.nt)===null||r===void 0)&&r.has(i))&&this.it.add(i);return this.render(t)}const o=e.element.classList;this.it.forEach(i=>{i in t||(o.remove(i),this.it.delete(i))});for(const i in t){const s=!!t[i];s===this.it.has(i)||!((n=this.nt)===null||n===void 0)&&n.has(i)||(s?(o.add(i),this.it.add(i)):(o.remove(i),this.it.delete(i)))}return pt}});function zn(e,t={}){return go([()=>{const r=new co(e,[0,1],t);return r.finished.catch(()=>{}),r}],t,t.duration)}function mt(e,t,r){return(Ot(e)?zn:En)(e,t,r)}/** + */const G=Wn(class extends Hn{constructor(e){var t;if(super(e),e.type!==jn.ATTRIBUTE||e.name!=="class"||((t=e.strings)===null||t===void 0?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter(t=>e[t]).join(" ")+" "}update(e,[t]){var r,n;if(this.it===void 0){this.it=new Set,e.strings!==void 0&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter(i=>i!=="")));for(const i in t)t[i]&&!(!((r=this.nt)===null||r===void 0)&&r.has(i))&&this.it.add(i);return this.render(t)}const o=e.element.classList;this.it.forEach(i=>{i in t||(o.remove(i),this.it.delete(i))});for(const i in t){const s=!!t[i];s===this.it.has(i)||!((n=this.nt)===null||n===void 0)&&n.has(i)||(s?(o.add(i),this.it.add(i)):(o.remove(i),this.it.delete(i)))}return pt}});function zn(e,t={}){return go([()=>{const r=new co(e,[0,1],t);return r.finished.catch(()=>{}),r}],t,t.duration)}function mt(e,t,r){return(Ot(e)?zn:En)(e,t,r)}/** * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const D=e=>e??B;var Qt={},Fn=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},$o={},W={};let yr;const Zn=[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];W.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return t*4+17};W.getSymbolTotalCodewords=function(t){return Zn[t]};W.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t};W.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');yr=t};W.isKanjiModeEnabled=function(){return typeof yr<"u"};W.toSJIS=function(t){return yr(t)};var be={};(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+r)}}e.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},e.from=function(n,o){if(e.isValid(n))return n;try{return t(n)}catch{return o}}})(be);function Co(){this.buffer=[],this.length=0}Co.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-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++}};var Vn=Co;function Jt(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)}Jt.prototype.set=function(e,t,r,n){const o=e*this.size+t;this.data[o]=r,n&&(this.reservedBit[o]=!0)};Jt.prototype.get=function(e,t){return this.data[e*this.size+t]};Jt.prototype.xor=function(e,t,r){this.data[e*this.size+t]^=r};Jt.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var Kn=Jt,Eo={};(function(e){const t=W.getSymbolSize;e.getRowColCoords=function(n){if(n===1)return[];const o=Math.floor(n/7)+2,i=t(n),s=i===145?26:Math.ceil((i-13)/(2*o-2))*2,a=[i-7];for(let l=1;l=0&&o<=7},e.from=function(o){return e.isValid(o)?parseInt(o,10):void 0},e.getPenaltyN1=function(o){const i=o.size;let s=0,a=0,l=0,c=null,d=null;for(let b=0;b=5&&(s+=t.N1+(a-5)),c=u,a=1),u=o.get(h,b),u===d?l++:(l>=5&&(s+=t.N1+(l-5)),d=u,l=1)}a>=5&&(s+=t.N1+(a-5)),l>=5&&(s+=t.N1+(l-5))}return s},e.getPenaltyN2=function(o){const i=o.size;let s=0;for(let a=0;a=10&&(a===1488||a===93)&&s++,l=l<<1&2047|o.get(d,c),d>=10&&(l===1488||l===93)&&s++}return s*t.N3},e.getPenaltyN4=function(o){let i=0;const s=o.data.length;for(let l=0;l=0;){const s=i[0];for(let l=0;l0){const i=new Uint8Array(this.degree);return i.set(n,o),i}return n};var Yn=xr,Io={},at={},$r={};$r.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40};var Y={};const To="[0-9]+",Gn="[A-Z $%*+\\-./:]+";let Yt="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Yt=Yt.replace(/u/g,"\\u");const Qn="(?:(?![A-Z0-9 $%*+\\-./:]|"+Yt+`)(?:.|[\r -]))+`;Y.KANJI=new RegExp(Yt,"g");Y.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");Y.BYTE=new RegExp(Qn,"g");Y.NUMERIC=new RegExp(To,"g");Y.ALPHANUMERIC=new RegExp(Gn,"g");const Jn=new RegExp("^"+Yt+"$"),Xn=new RegExp("^"+To+"$"),ti=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Y.testKanji=function(t){return Jn.test(t)};Y.testNumeric=function(t){return Xn.test(t)};Y.testAlphanumeric=function(t){return ti.test(t)};(function(e){const t=$r,r=Y;e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(i,s){if(!i.ccBits)throw new Error("Invalid mode: "+i);if(!t.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?i.ccBits[0]:s<27?i.ccBits[1]:i.ccBits[2]},e.getBestModeForData=function(i){return r.testNumeric(i)?e.NUMERIC:r.testAlphanumeric(i)?e.ALPHANUMERIC:r.testKanji(i)?e.KANJI:e.BYTE},e.toString=function(i){if(i&&i.id)return i.id;throw new Error("Invalid mode")},e.isValid=function(i){return i&&i.bit&&i.ccBits};function n(o){if(typeof o!="string")throw new Error("Param is not a string");switch(o.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+o)}}e.from=function(i,s){if(e.isValid(i))return i;try{return n(i)}catch{return s}}})(at);(function(e){const t=W,r=ye,n=be,o=at,i=$r,s=7973,a=t.getBCHDigit(s);function l(h,u,p){for(let g=1;g<=40;g++)if(u<=e.getCapacity(g,p,h))return g}function c(h,u){return o.getCharCountIndicator(h,u)+4}function d(h,u){let p=0;return h.forEach(function(g){const $=c(g.mode,u);p+=$+g.getBitsLength()}),p}function b(h,u){for(let p=1;p<=40;p++)if(d(h,p)<=e.getCapacity(p,u,o.MIXED))return p}e.from=function(u,p){return i.isValid(u)?parseInt(u,10):p},e.getCapacity=function(u,p,g){if(!i.isValid(u))throw new Error("Invalid QR Code version");typeof g>"u"&&(g=o.BYTE);const $=t.getSymbolTotalCodewords(u),f=r.getTotalCodewordsCount(u,p),y=($-f)*8;if(g===o.MIXED)return y;const v=y-c(g,u);switch(g){case o.NUMERIC:return Math.floor(v/10*3);case o.ALPHANUMERIC:return Math.floor(v/11*2);case o.KANJI:return Math.floor(v/13);case o.BYTE:default:return Math.floor(v/8)}},e.getBestVersionForData=function(u,p){let g;const $=n.from(p,n.M);if(Array.isArray(u)){if(u.length>1)return b(u,$);if(u.length===0)return 1;g=u[0]}else g=u;return l(g.mode,g.getLength(),$)},e.getEncodedBits=function(u){if(!i.isValid(u)||u<7)throw new Error("Invalid QR Code version");let p=u<<12;for(;t.getBCHDigit(p)-a>=0;)p^=s<=0;)o^=Mo<0&&(n=this.data.substr(r),o=parseInt(n,10),t.put(o,i*3+1))};var oi=Tt;const ni=at,Se=["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 Pt(e){this.mode=ni.ALPHANUMERIC,this.data=e}Pt.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};Pt.prototype.getLength=function(){return this.data.length};Pt.prototype.getBitsLength=function(){return Pt.getBitsLength(this.data.length)};Pt.prototype.write=function(t){let r;for(r=0;r+2<=this.data.length;r+=2){let n=Se.indexOf(this.data[r])*45;n+=Se.indexOf(this.data[r+1]),t.put(n,11)}this.data.length%2&&t.put(Se.indexOf(this.data[r]),6)};var ii=Pt,si=function(t){for(var r=[],n=t.length,o=0;o=55296&&i<=56319&&n>o+1){var s=t.charCodeAt(o+1);s>=56320&&s<=57343&&(i=(i-55296)*1024+s-56320+65536,o+=1)}if(i<128){r.push(i);continue}if(i<2048){r.push(i>>6|192),r.push(i&63|128);continue}if(i<55296||i>=57344&&i<65536){r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128);continue}if(i>=65536&&i<=1114111){r.push(i>>18|240),r.push(i>>12&63|128),r.push(i>>6&63|128),r.push(i&63|128);continue}r.push(239,191,189)}return new Uint8Array(r).buffer};const ai=si,li=at;function Mt(e){this.mode=li.BYTE,typeof e=="string"&&(e=ai(e)),this.data=new Uint8Array(e)}Mt.getBitsLength=function(t){return t*8};Mt.prototype.getLength=function(){return this.data.length};Mt.prototype.getBitsLength=function(){return Mt.getBitsLength(this.data.length)};Mt.prototype.write=function(e){for(let t=0,r=this.data.length;t=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+` + */const D=e=>e??B;var Gt={},Fn=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},$o={},W={};let yr;const Zn=[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];W.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return t*4+17};W.getSymbolTotalCodewords=function(t){return Zn[t]};W.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t};W.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');yr=t};W.isKanjiModeEnabled=function(){return typeof yr<"u"};W.toSJIS=function(t){return yr(t)};var be={};(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+r)}}e.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},e.from=function(n,o){if(e.isValid(n))return n;try{return t(n)}catch{return o}}})(be);function Co(){this.buffer=[],this.length=0}Co.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-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++}};var Vn=Co;function Qt(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)}Qt.prototype.set=function(e,t,r,n){const o=e*this.size+t;this.data[o]=r,n&&(this.reservedBit[o]=!0)};Qt.prototype.get=function(e,t){return this.data[e*this.size+t]};Qt.prototype.xor=function(e,t,r){this.data[e*this.size+t]^=r};Qt.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var Kn=Qt,Eo={};(function(e){const t=W.getSymbolSize;e.getRowColCoords=function(n){if(n===1)return[];const o=Math.floor(n/7)+2,i=t(n),s=i===145?26:Math.ceil((i-13)/(2*o-2))*2,a=[i-7];for(let l=1;l=0&&o<=7},e.from=function(o){return e.isValid(o)?parseInt(o,10):void 0},e.getPenaltyN1=function(o){const i=o.size;let s=0,a=0,l=0,c=null,d=null;for(let b=0;b=5&&(s+=t.N1+(a-5)),c=u,a=1),u=o.get(h,b),u===d?l++:(l>=5&&(s+=t.N1+(l-5)),d=u,l=1)}a>=5&&(s+=t.N1+(a-5)),l>=5&&(s+=t.N1+(l-5))}return s},e.getPenaltyN2=function(o){const i=o.size;let s=0;for(let a=0;a=10&&(a===1488||a===93)&&s++,l=l<<1&2047|o.get(d,c),d>=10&&(l===1488||l===93)&&s++}return s*t.N3},e.getPenaltyN4=function(o){let i=0;const s=o.data.length;for(let l=0;l=0;){const s=i[0];for(let l=0;l0){const i=new Uint8Array(this.degree);return i.set(n,o),i}return n};var Yn=xr,Io={},at={},$r={};$r.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40};var Y={};const To="[0-9]+",Jn="[A-Z $%*+\\-./:]+";let Yt="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Yt=Yt.replace(/u/g,"\\u");const Gn="(?:(?![A-Z0-9 $%*+\\-./:]|"+Yt+`)(?:.|[\r +]))+`;Y.KANJI=new RegExp(Yt,"g");Y.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");Y.BYTE=new RegExp(Gn,"g");Y.NUMERIC=new RegExp(To,"g");Y.ALPHANUMERIC=new RegExp(Jn,"g");const Qn=new RegExp("^"+Yt+"$"),Xn=new RegExp("^"+To+"$"),ti=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Y.testKanji=function(t){return Qn.test(t)};Y.testNumeric=function(t){return Xn.test(t)};Y.testAlphanumeric=function(t){return ti.test(t)};(function(e){const t=$r,r=Y;e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(i,s){if(!i.ccBits)throw new Error("Invalid mode: "+i);if(!t.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?i.ccBits[0]:s<27?i.ccBits[1]:i.ccBits[2]},e.getBestModeForData=function(i){return r.testNumeric(i)?e.NUMERIC:r.testAlphanumeric(i)?e.ALPHANUMERIC:r.testKanji(i)?e.KANJI:e.BYTE},e.toString=function(i){if(i&&i.id)return i.id;throw new Error("Invalid mode")},e.isValid=function(i){return i&&i.bit&&i.ccBits};function n(o){if(typeof o!="string")throw new Error("Param is not a string");switch(o.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+o)}}e.from=function(i,s){if(e.isValid(i))return i;try{return n(i)}catch{return s}}})(at);(function(e){const t=W,r=ye,n=be,o=at,i=$r,s=7973,a=t.getBCHDigit(s);function l(h,u,p){for(let g=1;g<=40;g++)if(u<=e.getCapacity(g,p,h))return g}function c(h,u){return o.getCharCountIndicator(h,u)+4}function d(h,u){let p=0;return h.forEach(function(g){const $=c(g.mode,u);p+=$+g.getBitsLength()}),p}function b(h,u){for(let p=1;p<=40;p++)if(d(h,p)<=e.getCapacity(p,u,o.MIXED))return p}e.from=function(u,p){return i.isValid(u)?parseInt(u,10):p},e.getCapacity=function(u,p,g){if(!i.isValid(u))throw new Error("Invalid QR Code version");typeof g>"u"&&(g=o.BYTE);const $=t.getSymbolTotalCodewords(u),f=r.getTotalCodewordsCount(u,p),y=($-f)*8;if(g===o.MIXED)return y;const v=y-c(g,u);switch(g){case o.NUMERIC:return Math.floor(v/10*3);case o.ALPHANUMERIC:return Math.floor(v/11*2);case o.KANJI:return Math.floor(v/13);case o.BYTE:default:return Math.floor(v/8)}},e.getBestVersionForData=function(u,p){let g;const $=n.from(p,n.M);if(Array.isArray(u)){if(u.length>1)return b(u,$);if(u.length===0)return 1;g=u[0]}else g=u;return l(g.mode,g.getLength(),$)},e.getEncodedBits=function(u){if(!i.isValid(u)||u<7)throw new Error("Invalid QR Code version");let p=u<<12;for(;t.getBCHDigit(p)-a>=0;)p^=s<=0;)o^=Mo<0&&(n=this.data.substr(r),o=parseInt(n,10),t.put(o,i*3+1))};var oi=Tt;const ni=at,Se=["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 Pt(e){this.mode=ni.ALPHANUMERIC,this.data=e}Pt.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};Pt.prototype.getLength=function(){return this.data.length};Pt.prototype.getBitsLength=function(){return Pt.getBitsLength(this.data.length)};Pt.prototype.write=function(t){let r;for(r=0;r+2<=this.data.length;r+=2){let n=Se.indexOf(this.data[r])*45;n+=Se.indexOf(this.data[r+1]),t.put(n,11)}this.data.length%2&&t.put(Se.indexOf(this.data[r]),6)};var ii=Pt,si=function(t){for(var r=[],n=t.length,o=0;o=55296&&i<=56319&&n>o+1){var s=t.charCodeAt(o+1);s>=56320&&s<=57343&&(i=(i-55296)*1024+s-56320+65536,o+=1)}if(i<128){r.push(i);continue}if(i<2048){r.push(i>>6|192),r.push(i&63|128);continue}if(i<55296||i>=57344&&i<65536){r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128);continue}if(i>=65536&&i<=1114111){r.push(i>>18|240),r.push(i>>12&63|128),r.push(i>>6&63|128),r.push(i&63|128);continue}r.push(239,191,189)}return new Uint8Array(r).buffer};const ai=si,li=at;function Mt(e){this.mode=li.BYTE,typeof e=="string"&&(e=ai(e)),this.data=new Uint8Array(e)}Mt.getBitsLength=function(t){return t*8};Mt.prototype.getLength=function(){return this.data.length};Mt.prototype.getBitsLength=function(){return Mt.getBitsLength(this.data.length)};Mt.prototype.write=function(e){for(let t=0,r=this.data.length;t=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+` Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),e.put(r,13)}};var ui=St,Ro={exports:{}};(function(e){var t={single_source_shortest_paths:function(r,n,o){var i={},s={};s[n]=0;var a=t.PriorityQueue.make();a.push(n,0);for(var l,c,d,b,h,u,p,g,$;!a.empty();){l=a.pop(),c=l.value,b=l.cost,h=r[c]||{};for(d in h)h.hasOwnProperty(d)&&(u=h[d],p=b+u,g=s[d],$=typeof s[d]>"u",($||g>p)&&(s[d]=p,a.push(d,p),i[d]=c))}if(typeof o<"u"&&typeof s[o]>"u"){var f=["Could not find a path from ",n," to ",o,"."].join("");throw new Error(f)}return i},extract_shortest_path_from_predecessor_list:function(r,n){for(var o=[],i=n;i;)o.push(i),r[i],i=r[i];return o.reverse(),o},find_path:function(r,n,o){var i=t.single_source_shortest_paths(r,n,o);return t.extract_shortest_path_from_predecessor_list(i,o)},PriorityQueue:{make:function(r){var n=t.PriorityQueue,o={},i;r=r||{};for(i in n)n.hasOwnProperty(i)&&(o[i]=n[i]);return o.queue=[],o.sorter=r.sorter||n.default_sorter,o},default_sorter:function(r,n){return r.cost-n.cost},push:function(r,n){var o={value:r,cost:n};this.queue.push(o),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(Ro);var mi=Ro.exports;(function(e){const t=at,r=oi,n=ii,o=ci,i=ui,s=Y,a=W,l=mi;function c(f){return unescape(encodeURIComponent(f)).length}function d(f,y,v){const w=[];let k;for(;(k=f.exec(v))!==null;)w.push({data:k[0],index:k.index,mode:y,length:k[0].length});return w}function b(f){const y=d(s.NUMERIC,t.NUMERIC,f),v=d(s.ALPHANUMERIC,t.ALPHANUMERIC,f);let w,k;return a.isKanjiModeEnabled()?(w=d(s.BYTE,t.BYTE,f),k=d(s.KANJI,t.KANJI,f)):(w=d(s.BYTE_KANJI,t.BYTE,f),k=[]),y.concat(v,w,k).sort(function(R,T){return R.index-T.index}).map(function(R){return{data:R.data,mode:R.mode,length:R.length}})}function h(f,y){switch(y){case t.NUMERIC:return r.getBitsLength(f);case t.ALPHANUMERIC:return n.getBitsLength(f);case t.KANJI:return i.getBitsLength(f);case t.BYTE:return o.getBitsLength(f)}}function u(f){return f.reduce(function(y,v){const w=y.length-1>=0?y[y.length-1]:null;return w&&w.mode===v.mode?(y[y.length-1].data+=v.data,y):(y.push(v),y)},[])}function p(f){const y=[];for(let v=0;v=0&&a<=6&&(l===0||l===6)||l>=0&&l<=6&&(a===0||a===6)||a>=2&&a<=4&&l>=2&&l<=4?e.set(i+a,s+l,!0,!0):e.set(i+a,s+l,!1,!0))}}function $i(e){const t=e.size;for(let r=8;r>a&1)===1,e.set(o,i,s,!0),e.set(i,o,s,!0)}function Ne(e,t,r){const n=e.size,o=bi.getEncodedBits(t,r);let i,s;for(i=0;i<15;i++)s=(o>>i&1)===1,i<6?e.set(i,8,s,!0):i<8?e.set(i+1,8,s,!0):e.set(n-15+i,8,s,!0),i<8?e.set(8,n-i-1,s,!0):i<9?e.set(8,15-i-1+1,s,!0):e.set(8,15-i-1,s,!0);e.set(n-8,8,1,!0)}function Ai(e,t){const r=e.size;let n=-1,o=r-1,i=7,s=0;for(let a=r-1;a>0;a-=2)for(a===6&&a--;;){for(let l=0;l<2;l++)if(!e.isReserved(o,a-l)){let c=!1;s>>i&1)===1),e.set(o,a-l,c),i--,i===-1&&(s++,i=7)}if(o+=n,o<0||r<=o){o-=n,n=-n;break}}}function _i(e,t,r){const n=new gi;r.forEach(function(l){n.put(l.mode.bit,4),n.put(l.getLength(),yi.getCharCountIndicator(l.mode,e)),l.write(n)});const o=$e.getSymbolTotalCodewords(e),i=gr.getTotalCodewordsCount(e,t),s=(o-i)*8;for(n.getLengthInBits()+4<=s&&n.put(0,4);n.getLengthInBits()%8!==0;)n.putBit(0);const a=(s-n.getLengthInBits())/8;for(let l=0;l=7&&Ei(l,t),Ai(l,s),isNaN(n)&&(n=mr.getBestMask(l,Ne.bind(null,l,r))),mr.applyMask(n,l),Ne(l,r,n),{modules:l,version:t,errorCorrectionLevel:r,maskPattern:n,segments:o}}$o.create=function(t,r){if(typeof t>"u"||t==="")throw new Error("No input text");let n=Re.M,o,i;return typeof r<"u"&&(n=Re.from(r.errorCorrectionLevel,Re.M),o=we.from(r.version),i=mr.from(r.maskPattern),r.toSJISFunc&&$e.setToSJISFunction(r.toSJISFunc)),ki(t,o,n,i)};var Lo={},Cr={};(function(e){function t(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let n=r.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+r);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(i){return[i,i]}))),n.length===6&&n.push("F","F");const o=parseInt(n.join(""),16);return{r:o>>24&255,g:o>>16&255,b:o>>8&255,a:o&255,hex:"#"+n.slice(0,6).join("")}}e.getOptions=function(n){n||(n={}),n.color||(n.color={});const o=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,i=n.width&&n.width>=21?n.width:void 0,s=n.scale||4;return{width:i,scale:i?4:s,margin:o,color:{dark:t(n.color.dark||"#000000ff"),light:t(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},e.getScale=function(n,o){return o.width&&o.width>=n+o.margin*2?o.width/(n+o.margin*2):o.scale},e.getImageWidth=function(n,o){const i=e.getScale(n,o);return Math.floor((n+o.margin*2)*i)},e.qrToImageData=function(n,o,i){const s=o.modules.size,a=o.modules.data,l=e.getScale(s,i),c=Math.floor((s+i.margin*2)*l),d=i.margin*l,b=[i.color.light,i.color.dark];for(let h=0;h=d&&u>=d&&h"u"&&(!s||!s.getContext)&&(l=s,s=void 0),s||(c=n()),l=t.getOptions(l);const d=t.getImageWidth(i.modules.size,l),b=c.getContext("2d"),h=b.createImageData(d,d);return t.qrToImageData(h.data,i,l),r(b,c,d),b.putImageData(h,0,0),c},e.renderToDataURL=function(i,s,a){let l=a;typeof l>"u"&&(!s||!s.getContext)&&(l=s,s=void 0),l||(l={});const c=e.render(i,s,l),d=l.type||"image/png",b=l.rendererOpts||{};return c.toDataURL(d,b.quality)}})(Lo);var No={};const Ii=Cr;function Zr(e,t){const r=e.a/255,n=t+'="'+e.hex+'"';return r<1?n+" "+t+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function Be(e,t,r){let n=e+t;return typeof r<"u"&&(n+=" "+r),n}function Ti(e,t,r){let n="",o=0,i=!1,s=0;for(let a=0;a0&&l>0&&e[a-1]||(n+=i?Be("M",l+r,.5+c+r):Be("m",o,0),o=0,i=!1),l+1':"",c="',d='viewBox="0 0 '+a+" "+a+'"',h=''+l+c+` -`;return typeof n=="function"&&n(null,h),h};const Pi=Fn,fr=$o,Bo=Lo,Mi=No;function Er(e,t,r,n,o){const i=[].slice.call(arguments,1),s=i.length,a=typeof i[s-1]=="function";if(!a&&!Pi())throw new Error("Callback required as last argument");if(a){if(s<2)throw new Error("Too few arguments provided");s===2?(o=r,r=t,t=n=void 0):s===3&&(t.getContext&&typeof o>"u"?(o=n,n=void 0):(o=n,n=r,r=t,t=void 0))}else{if(s<1)throw new Error("Too few arguments provided");return s===1?(r=t,t=n=void 0):s===2&&!t.getContext&&(n=r,r=t,t=void 0),new Promise(function(l,c){try{const d=fr.create(r,n);l(e(d,t,n))}catch(d){c(d)}})}try{const l=fr.create(r,n);o(null,e(l,t,n))}catch(l){o(l)}}Qt.create=fr.create;Qt.toCanvas=Er.bind(null,Bo.render);Qt.toDataURL=Er.bind(null,Bo.renderToDataURL);Qt.toString=Er.bind(null,function(e,t,r){return Mi.render(e,r)});var Si=Object.defineProperty,Vr=Object.getOwnPropertySymbols,Ri=Object.prototype.hasOwnProperty,Li=Object.prototype.propertyIsEnumerable,Kr=(e,t,r)=>t in e?Si(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,De=(e,t)=>{for(var r in t||(t={}))Ri.call(t,r)&&Kr(e,r,t[r]);if(Vr)for(var r of Vr(t))Li.call(t,r)&&Kr(e,r,t[r]);return e};function Ni(){var e;const t=(e=_t.state.themeMode)!=null?e:"dark",r={light:{foreground:{1:"rgb(20,20,20)",2:"rgb(121,134,134)",3:"rgb(158,169,169)"},background:{1:"rgb(255,255,255)",2:"rgb(241,243,243)",3:"rgb(228,231,231)"},overlay:"rgba(0,0,0,0.1)"},dark:{foreground:{1:"rgb(228,231,231)",2:"rgb(148,158,158)",3:"rgb(110,119,119)"},background:{1:"rgb(20,20,20)",2:"rgb(39,42,42)",3:"rgb(59,64,64)"},overlay:"rgba(255,255,255,0.1)"}}[t];return{"--wcm-color-fg-1":r.foreground[1],"--wcm-color-fg-2":r.foreground[2],"--wcm-color-fg-3":r.foreground[3],"--wcm-color-bg-1":r.background[1],"--wcm-color-bg-2":r.background[2],"--wcm-color-bg-3":r.background[3],"--wcm-color-overlay":r.overlay}}function qr(){return{"--wcm-accent-color":"#3396FF","--wcm-accent-fill-color":"#FFFFFF","--wcm-z-index":"89","--wcm-background-color":"#3396FF","--wcm-background-border-radius":"8px","--wcm-container-border-radius":"30px","--wcm-wallet-icon-border-radius":"15px","--wcm-wallet-icon-large-border-radius":"30px","--wcm-wallet-icon-small-border-radius":"7px","--wcm-input-border-radius":"28px","--wcm-button-border-radius":"10px","--wcm-notification-border-radius":"36px","--wcm-secondary-button-border-radius":"28px","--wcm-icon-button-border-radius":"50%","--wcm-button-hover-highlight-border-radius":"10px","--wcm-text-big-bold-size":"20px","--wcm-text-big-bold-weight":"600","--wcm-text-big-bold-line-height":"24px","--wcm-text-big-bold-letter-spacing":"-0.03em","--wcm-text-big-bold-text-transform":"none","--wcm-text-xsmall-bold-size":"10px","--wcm-text-xsmall-bold-weight":"700","--wcm-text-xsmall-bold-line-height":"12px","--wcm-text-xsmall-bold-letter-spacing":"0.02em","--wcm-text-xsmall-bold-text-transform":"uppercase","--wcm-text-xsmall-regular-size":"12px","--wcm-text-xsmall-regular-weight":"600","--wcm-text-xsmall-regular-line-height":"14px","--wcm-text-xsmall-regular-letter-spacing":"-0.03em","--wcm-text-xsmall-regular-text-transform":"none","--wcm-text-small-thin-size":"14px","--wcm-text-small-thin-weight":"500","--wcm-text-small-thin-line-height":"16px","--wcm-text-small-thin-letter-spacing":"-0.03em","--wcm-text-small-thin-text-transform":"none","--wcm-text-small-regular-size":"14px","--wcm-text-small-regular-weight":"600","--wcm-text-small-regular-line-height":"16px","--wcm-text-small-regular-letter-spacing":"-0.03em","--wcm-text-small-regular-text-transform":"none","--wcm-text-medium-regular-size":"16px","--wcm-text-medium-regular-weight":"600","--wcm-text-medium-regular-line-height":"20px","--wcm-text-medium-regular-letter-spacing":"-0.03em","--wcm-text-medium-regular-text-transform":"none","--wcm-font-family":"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif","--wcm-font-feature-settings":"'tnum' on, 'lnum' on, 'case' on","--wcm-success-color":"rgb(38,181,98)","--wcm-error-color":"rgb(242, 90, 103)","--wcm-overlay-background-color":"rgba(0, 0, 0, 0.3)","--wcm-overlay-backdrop-filter":"none"}}const _={getPreset(e){return qr()[e]},setTheme(){const e=document.querySelector(":root"),{themeVariables:t}=_t.state;if(e){const r=De(De(De({},Ni()),qr()),t);Object.entries(r).forEach(([n,o])=>e.style.setProperty(n,o))}},globalCss:M`*,::after,::before{margin:0;padding:0;box-sizing:border-box;font-style:normal;text-rendering:optimizeSpeed;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-tap-highlight-color:transparent;backface-visibility:hidden}button{cursor:pointer;display:flex;justify-content:center;align-items:center;position:relative;border:none;background-color:transparent;transition:all .2s ease}@media (hover:hover) and (pointer:fine){button:active{transition:all .1s ease;transform:scale(.93)}}button::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;transition:background-color,.2s ease}button:disabled{cursor:not-allowed}button svg,button wcm-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--wcm-accent-fill-color);background:var(--wcm-accent-color)}`},Bi=M`button{border-radius:var(--wcm-secondary-button-border-radius);height:28px;padding:0 10px;background-color:var(--wcm-accent-color)}button path{fill:var(--wcm-accent-fill-color)}button::after{border-radius:inherit;border:1px solid var(--wcm-color-overlay)}button:disabled::after{background-color:transparent}.wcm-icon-left svg{margin-right:5px}.wcm-icon-right svg{margin-left:5px}button:active::after{background-color:var(--wcm-color-overlay)}.wcm-ghost,.wcm-ghost:active::after,.wcm-outline{background-color:transparent}.wcm-ghost:active{opacity:.5}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}.wcm-ghost:hover::after{background-color:transparent}.wcm-ghost:hover{opacity:.5}}button:disabled{background-color:var(--wcm-color-bg-3);pointer-events:none}.wcm-ghost::after{border-color:transparent}.wcm-ghost path{fill:var(--wcm-color-fg-2)}.wcm-outline path{fill:var(--wcm-accent-color)}.wcm-outline:disabled{background-color:transparent;opacity:.5}`;var Di=Object.defineProperty,Ui=Object.getOwnPropertyDescriptor,wt=(e,t,r,n)=>{for(var o=n>1?void 0:n?Ui(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Di(t,r,o),o};let J=class extends A{constructor(){super(...arguments),this.disabled=!1,this.iconLeft=void 0,this.iconRight=void 0,this.onClick=()=>null,this.variant="default"}render(){const e={"wcm-icon-left":this.iconLeft!==void 0,"wcm-icon-right":this.iconRight!==void 0,"wcm-ghost":this.variant==="ghost","wcm-outline":this.variant==="outline"};let t="inverse";return this.variant==="ghost"&&(t="secondary"),this.variant==="outline"&&(t="accent"),m``}};J.styles=[_.globalCss,Bi],wt([C({type:Boolean})],J.prototype,"disabled",2),wt([C()],J.prototype,"iconLeft",2),wt([C()],J.prototype,"iconRight",2),wt([C()],J.prototype,"onClick",2),wt([C()],J.prototype,"variant",2),J=wt([O("wcm-button")],J);const ji=M`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:var(--wcm-button-border-radius);color:var(--wcm-accent-fill-color);background-color:var(--wcm-accent-color)}button::after{content:'';top:0;bottom:0;left:0;right:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--wcm-color-overlay)}button:active::after{background-color:var(--wcm-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--wcm-color-bg-3);color:var(--wcm-color-fg-3)}.wcm-secondary{color:var(--wcm-accent-color);background-color:transparent}.wcm-secondary::after{display:none}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}}`;var Wi=Object.defineProperty,Hi=Object.getOwnPropertyDescriptor,Ue=(e,t,r,n)=>{for(var o=n>1?void 0:n?Hi(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Wi(t,r,o),o};let Lt=class extends A{constructor(){super(...arguments),this.disabled=!1,this.variant="primary"}render(){const e={"wcm-secondary":this.variant==="secondary"};return m``}};Lt.styles=[_.globalCss,ji],Ue([C({type:Boolean})],Lt.prototype,"disabled",2),Ue([C()],Lt.prototype,"variant",2),Lt=Ue([O("wcm-button-big")],Lt);const zi=M`:host{background-color:var(--wcm-color-bg-2);border-top:1px solid var(--wcm-color-bg-3)}div{padding:10px 20px;display:inherit;flex-direction:inherit;align-items:inherit;width:inherit;justify-content:inherit}`;var Fi=Object.defineProperty,Zi=Object.getOwnPropertyDescriptor,Vi=(e,t,r,n)=>{for(var o=n>1?void 0:n?Zi(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Fi(t,r,o),o};let je=class extends A{render(){return m`
`}};je.styles=[_.globalCss,zi],je=Vi([O("wcm-info-footer")],je);const S={CROSS_ICON:L``,WALLET_CONNECT_LOGO:L``,WALLET_CONNECT_ICON:L``,WALLET_CONNECT_ICON_COLORED:L``,BACK_ICON:L``,COPY_ICON:L``,RETRY_ICON:L``,DESKTOP_ICON:L``,MOBILE_ICON:L``,ARROW_DOWN_ICON:L``,ARROW_UP_RIGHT_ICON:L``,ARROW_RIGHT_ICON:L``,QRCODE_ICON:L``,SCAN_ICON:L``,CHECKMARK_ICON:L``,SEARCH_ICON:L``,WALLET_PLACEHOLDER:L``,GLOBE_ICON:L``},Ki=M`.wcm-toolbar-placeholder{top:0;bottom:0;left:0;right:0;width:100%;position:absolute;display:block;pointer-events:none;height:100px;border-radius:calc(var(--wcm-background-border-radius) * .9);background-color:var(--wcm-background-color);background-position:center;background-size:cover}.wcm-toolbar{height:38px;display:flex;position:relative;margin:5px 15px 5px 5px;justify-content:space-between;align-items:center}.wcm-toolbar img,.wcm-toolbar svg{height:28px;object-position:left center;object-fit:contain}#wcm-wc-logo path{fill:var(--wcm-accent-fill-color)}button{width:28px;height:28px;border-radius:var(--wcm-icon-button-border-radius);border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:var(--wcm-color-bg-1);box-shadow:0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-bg-2)}button svg{display:block;object-position:center}button path{fill:var(--wcm-color-fg-1)}.wcm-toolbar div{display:flex}@media(hover:hover){button:hover{background-color:var(--wcm-color-bg-2)}}`;var qi=Object.defineProperty,Yi=Object.getOwnPropertyDescriptor,Gi=(e,t,r,n)=>{for(var o=n>1?void 0:n?Yi(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&qi(t,r,o),o};let We=class extends A{render(){return m`
${S.WALLET_CONNECT_LOGO}
`}};We.styles=[_.globalCss,Ki],We=Gi([O("wcm-modal-backcard")],We);const Qi=M`main{padding:20px;padding-top:0;width:100%}`;var Ji=Object.defineProperty,Xi=Object.getOwnPropertyDescriptor,ts=(e,t,r,n)=>{for(var o=n>1?void 0:n?Xi(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Ji(t,r,o),o};let He=class extends A{render(){return m`
`}};He.styles=[_.globalCss,Qi],He=ts([O("wcm-modal-content")],He);const es=M`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--wcm-color-bg-2)}`;var rs=Object.defineProperty,os=Object.getOwnPropertyDescriptor,ns=(e,t,r,n)=>{for(var o=n>1?void 0:n?os(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&rs(t,r,o),o};let ze=class extends A{render(){return m`
`}};ze.styles=[_.globalCss,es],ze=ns([O("wcm-modal-footer")],ze);const is=M`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.wcm-border{border-bottom:1px solid var(--wcm-color-bg-2);margin-bottom:20px}header button{padding:15px 20px}header button:active{opacity:.5}@media(hover:hover){header button:hover{opacity:.5}}.wcm-back-btn{position:absolute;left:0}.wcm-action-btn{position:absolute;right:0}path{fill:var(--wcm-accent-color)}`;var ss=Object.defineProperty,as=Object.getOwnPropertyDescriptor,Nt=(e,t,r,n)=>{for(var o=n>1?void 0:n?as(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&ss(t,r,o),o};let ct=class extends A{constructor(){super(...arguments),this.title="",this.onAction=void 0,this.actionIcon=void 0,this.border=!1}backBtnTemplate(){return m``}actionBtnTemplate(){return m``}render(){const e={"wcm-border":this.border},t=N.state.history.length>1,r=this.title?m`${this.title}`:m``;return m`
${t?this.backBtnTemplate():null} ${r} ${this.onAction?this.actionBtnTemplate():null}
`}};ct.styles=[_.globalCss,is],Nt([C()],ct.prototype,"title",2),Nt([C()],ct.prototype,"onAction",2),Nt([C()],ct.prototype,"actionIcon",2),Nt([C({type:Boolean})],ct.prototype,"border",2),ct=Nt([O("wcm-modal-header")],ct);const x={MOBILE_BREAKPOINT:600,WCM_RECENT_WALLET_DATA:"WCM_RECENT_WALLET_DATA",EXPLORER_WALLET_URL:"https://explorer.walletconnect.com/?type=wallet",getShadowRootElement(e,t){const r=e.renderRoot.querySelector(t);if(!r)throw new Error(`${t} not found`);return r},getWalletIcon({id:e,image_id:t}){const{walletImages:r}=gt.state;return r!=null&&r[e]?r[e]:t?U.getWalletImageUrl(t):""},getWalletName(e,t=!1){return t?e.split(" ")[0]:e},isMobileAnimation(){return window.innerWidth<=x.MOBILE_BREAKPOINT},async preloadImage(e){const t=new Promise((r,n)=>{const o=new Image;o.onload=r,o.onerror=n,o.src=e});return Promise.race([t,E.wait(3e3)])},getErrorMessage(e){return e instanceof Error?e.message:"Unknown Error"},debounce(e,t=500){let r;return(...n)=>{function o(){e(...n)}r&&clearTimeout(r),r=setTimeout(o,t)}},handleMobileLinking(e){const{walletConnectUri:t}=q.state,{mobile:r,name:n}=e,o=r==null?void 0:r.native,i=r==null?void 0:r.universal;x.setRecentWallet(e);function s(a){let l="";o?l=E.formatUniversalUrl(o,a,n):i&&(l=E.formatNativeUrl(i,a,n)),E.openHref(l,"_self")}t&&s(t)},handleAndroidLinking(){const{walletConnectUri:e}=q.state;e&&(E.setWalletConnectAndroidDeepLink(e),E.openHref(e,"_self"))},async handleUriCopy(){const{walletConnectUri:e}=q.state;if(e)try{await navigator.clipboard.writeText(e),ot.openToast("Link copied","success")}catch{ot.openToast("Failed to copy","error")}},getCustomImageUrls(){const{walletImages:e}=gt.state,t=Object.values(e??{});return Object.values(t)},truncate(e,t=8){return e.length<=t?e:`${e.substring(0,4)}...${e.substring(e.length-4)}`},setRecentWallet(e){try{localStorage.setItem(x.WCM_RECENT_WALLET_DATA,JSON.stringify(e))}catch{console.info("Unable to set recent wallet")}},getRecentWallet(){try{const e=localStorage.getItem(x.WCM_RECENT_WALLET_DATA);return e?JSON.parse(e):void 0}catch{console.info("Unable to get recent wallet")}},caseSafeIncludes(e,t){return e.toUpperCase().includes(t.toUpperCase())},openWalletExplorerUrl(){E.openHref(x.EXPLORER_WALLET_URL,"_blank")},getCachedRouterWalletPlatforms(){const{desktop:e,mobile:t}=E.getWalletRouterData(),r=!!(e!=null&&e.native),n=!!(e!=null&&e.universal),o=!!(t!=null&&t.native)||!!(t!=null&&t.universal);return{isDesktop:r,isMobile:o,isWeb:n}},goToConnectingView(e){N.setData({Wallet:e});const t=E.isMobile(),{isDesktop:r,isWeb:n,isMobile:o}=x.getCachedRouterWalletPlatforms();t?o?N.push("MobileConnecting"):n?N.push("WebConnecting"):N.push("InstallWallet"):r?N.push("DesktopConnecting"):n?N.push("WebConnecting"):o?N.push("MobileQrcodeConnecting"):N.push("InstallWallet")}},ls=M`.wcm-router{overflow:hidden;will-change:transform}.wcm-content{display:flex;flex-direction:column}`;var cs=Object.defineProperty,ds=Object.getOwnPropertyDescriptor,Fe=(e,t,r,n)=>{for(var o=n>1?void 0:n?ds(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&cs(t,r,o),o};let Bt=class extends A{constructor(){super(),this.view=N.state.view,this.prevView=N.state.view,this.unsubscribe=void 0,this.oldHeight="0px",this.resizeObserver=void 0,this.unsubscribe=N.subscribe(e=>{this.view!==e.view&&this.onChangeRoute()})}firstUpdated(){this.resizeObserver=new ResizeObserver(([e])=>{const t=`${e.contentRect.height}px`;this.oldHeight!=="0px"&&mt(this.routerEl,{height:[this.oldHeight,t]},{duration:.2}),this.oldHeight=t}),this.resizeObserver.observe(this.contentEl)}disconnectedCallback(){var e,t;(e=this.unsubscribe)==null||e.call(this),(t=this.resizeObserver)==null||t.disconnect()}get routerEl(){return x.getShadowRootElement(this,".wcm-router")}get contentEl(){return x.getShadowRootElement(this,".wcm-content")}viewTemplate(){switch(this.view){case"ConnectWallet":return m``;case"DesktopConnecting":return m``;case"MobileConnecting":return m``;case"WebConnecting":return m``;case"MobileQrcodeConnecting":return m``;case"WalletExplorer":return m``;case"Qrcode":return m``;case"InstallWallet":return m``;default:return m`
Not Found
`}}async onChangeRoute(){await mt(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15,delay:.1}).finished,this.view=N.state.view,mt(this.routerEl,{opacity:[0,1],scale:[.99,1]},{duration:.37,delay:.05})}render(){return m`
${this.viewTemplate()}
`}};Bt.styles=[_.globalCss,ls],Fe([j()],Bt.prototype,"view",2),Fe([j()],Bt.prototype,"prevView",2),Bt=Fe([O("wcm-modal-router")],Bt);const hs=M`div{height:36px;width:max-content;display:flex;justify-content:center;align-items:center;padding:9px 15px 11px;position:absolute;top:12px;box-shadow:0 6px 14px -6px rgba(10,16,31,.3),0 10px 32px -4px rgba(10,16,31,.15);z-index:2;left:50%;transform:translateX(-50%);pointer-events:none;backdrop-filter:blur(20px) saturate(1.8);-webkit-backdrop-filter:blur(20px) saturate(1.8);border-radius:var(--wcm-notification-border-radius);border:1px solid var(--wcm-color-overlay);background-color:var(--wcm-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--wcm-color-bg-3)}}.wcm-success path{fill:var(--wcm-accent-color)}.wcm-error path{fill:var(--wcm-error-color)}`;var us=Object.defineProperty,ms=Object.getOwnPropertyDescriptor,Yr=(e,t,r,n)=>{for(var o=n>1?void 0:n?ms(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&us(t,r,o),o};let re=class extends A{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=ot.subscribe(e=>{e.open?(this.open=!0,this.timeout=setTimeout(()=>ot.closeToast(),2200)):(this.open=!1,clearTimeout(this.timeout))})}disconnectedCallback(){var e;(e=this.unsubscribe)==null||e.call(this),clearTimeout(this.timeout),ot.closeToast()}render(){const{message:e,variant:t}=ot.state,r={"wcm-success":t==="success","wcm-error":t==="error"};return this.open?m`
${t==="success"?S.CHECKMARK_ICON:null} ${t==="error"?S.CROSS_ICON:null}${e}
`:null}};re.styles=[_.globalCss,hs],Yr([j()],re.prototype,"open",2),re=Yr([O("wcm-modal-toast")],re);const gs=.1,Gr=2.5,G=7;function Ze(e,t,r){return e===t?!1:(e-t<0?t-e:e-t)<=r+gs}function fs(e,t){const r=Array.prototype.slice.call(Qt.create(e,{errorCorrectionLevel:t}).modules.data,0),n=Math.sqrt(r.length);return r.reduce((o,i,s)=>(s%n===0?o.push([i]):o[o.length-1].push(i))&&o,[])}const ps={generate(e,t,r){const n="#141414",o="#ffffff",i=[],s=fs(e,"Q"),a=t/s.length,l=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];l.forEach(({x:p,y:g})=>{const $=(s.length-G)*a*p,f=(s.length-G)*a*g,y=.45;for(let v=0;v`)}});const c=Math.floor((r+25)/a),d=s.length/2-c/2,b=s.length/2+c/2-1,h=[];s.forEach((p,g)=>{p.forEach(($,f)=>{if(s[g][f]&&!(gs.length-(G+1)&&fs.length-(G+1))&&!(g>d&&gd&&f{u[p]?u[p].push(g):u[p]=[g]}),Object.entries(u).map(([p,g])=>{const $=g.filter(f=>g.every(y=>!Ze(f,y,a)));return[Number(p),$]}).forEach(([p,g])=>{g.forEach($=>{i.push(L``)})}),Object.entries(u).filter(([p,g])=>g.length>1).map(([p,g])=>{const $=g.filter(f=>g.some(y=>Ze(f,y,a)));return[Number(p),$]}).map(([p,g])=>{g.sort((f,y)=>fv.some(w=>Ze(f,w,a)));y?y.push(f):$.push([f])}return[p,$.map(f=>[f[0],f[f.length-1]])]}).forEach(([p,g])=>{g.forEach(([$,f])=>{i.push(L``)})}),i}},ws=M`@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}div{position:relative;user-select:none;display:block;overflow:hidden;aspect-ratio:1/1;animation:fadeIn ease .2s}.wcm-dark{background-color:#fff;border-radius:var(--wcm-container-border-radius);padding:18px;box-shadow:0 2px 5px #000}svg:first-child,wcm-wallet-image{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{width:25%;height:25%;border-radius:var(--wcm-wallet-icon-border-radius)}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--wcm-accent-color)}svg:first-child path:last-child{stroke:var(--wcm-color-overlay)}`;var vs=Object.defineProperty,bs=Object.getOwnPropertyDescriptor,vt=(e,t,r,n)=>{for(var o=n>1?void 0:n?bs(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&vs(t,r,o),o};let X=class extends A{constructor(){super(...arguments),this.uri="",this.size=0,this.imageId=void 0,this.walletId=void 0,this.imageUrl=void 0}svgTemplate(){const e=_t.state.themeMode==="light"?this.size:this.size-36;return L`${ps.generate(this.uri,e,e/4)}`}render(){const e={"wcm-dark":_t.state.themeMode==="dark"};return m`
${this.walletId||this.imageUrl?m``:S.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}
`}};X.styles=[_.globalCss,ws],vt([C()],X.prototype,"uri",2),vt([C({type:Number})],X.prototype,"size",2),vt([C()],X.prototype,"imageId",2),vt([C()],X.prototype,"walletId",2),vt([C()],X.prototype,"imageUrl",2),X=vt([O("wcm-qrcode")],X);const ys=M`:host{position:relative;height:28px;width:80%}input{width:100%;height:100%;line-height:28px!important;border-radius:var(--wcm-input-border-radius);font-style:normal;font-family:-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,Ubuntu,'Helvetica Neue',sans-serif;font-feature-settings:'case' on;font-weight:500;font-size:16px;letter-spacing:-.03em;padding:0 10px 0 34px;transition:.2s all ease;color:var(--wcm-color-fg-1);background-color:var(--wcm-color-bg-3);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay);caret-color:var(--wcm-accent-color)}input::placeholder{color:var(--wcm-color-fg-2)}svg{left:10px;top:4px;pointer-events:none;position:absolute;width:20px;height:20px}input:focus-within{box-shadow:inset 0 0 0 1px var(--wcm-accent-color)}path{fill:var(--wcm-color-fg-2)}`;var xs=Object.defineProperty,$s=Object.getOwnPropertyDescriptor,Qr=(e,t,r,n)=>{for(var o=n>1?void 0:n?$s(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&xs(t,r,o),o};let oe=class extends A{constructor(){super(...arguments),this.onChange=()=>null}render(){return m` ${S.SEARCH_ICON}`}};oe.styles=[_.globalCss,ys],Qr([C()],oe.prototype,"onChange",2),oe=Qr([O("wcm-search-input")],oe);const Cs=M`@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}svg{animation:rotate 2s linear infinite;display:flex;justify-content:center;align-items:center}svg circle{stroke-linecap:round;animation:dash 1.5s ease infinite;stroke:var(--wcm-accent-color)}`;var Es=Object.defineProperty,As=Object.getOwnPropertyDescriptor,_s=(e,t,r,n)=>{for(var o=n>1?void 0:n?As(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Es(t,r,o),o};let Ve=class extends A{render(){return m``}};Ve.styles=[_.globalCss,Cs],Ve=_s([O("wcm-spinner")],Ve);const Os=M`span{font-style:normal;font-family:var(--wcm-font-family);font-feature-settings:var(--wcm-font-feature-settings)}.wcm-xsmall-bold{font-family:var(--wcm-text-xsmall-bold-font-family);font-weight:var(--wcm-text-xsmall-bold-weight);font-size:var(--wcm-text-xsmall-bold-size);line-height:var(--wcm-text-xsmall-bold-line-height);letter-spacing:var(--wcm-text-xsmall-bold-letter-spacing);text-transform:var(--wcm-text-xsmall-bold-text-transform)}.wcm-xsmall-regular{font-family:var(--wcm-text-xsmall-regular-font-family);font-weight:var(--wcm-text-xsmall-regular-weight);font-size:var(--wcm-text-xsmall-regular-size);line-height:var(--wcm-text-xsmall-regular-line-height);letter-spacing:var(--wcm-text-xsmall-regular-letter-spacing);text-transform:var(--wcm-text-xsmall-regular-text-transform)}.wcm-small-thin{font-family:var(--wcm-text-small-thin-font-family);font-weight:var(--wcm-text-small-thin-weight);font-size:var(--wcm-text-small-thin-size);line-height:var(--wcm-text-small-thin-line-height);letter-spacing:var(--wcm-text-small-thin-letter-spacing);text-transform:var(--wcm-text-small-thin-text-transform)}.wcm-small-regular{font-family:var(--wcm-text-small-regular-font-family);font-weight:var(--wcm-text-small-regular-weight);font-size:var(--wcm-text-small-regular-size);line-height:var(--wcm-text-small-regular-line-height);letter-spacing:var(--wcm-text-small-regular-letter-spacing);text-transform:var(--wcm-text-small-regular-text-transform)}.wcm-medium-regular{font-family:var(--wcm-text-medium-regular-font-family);font-weight:var(--wcm-text-medium-regular-weight);font-size:var(--wcm-text-medium-regular-size);line-height:var(--wcm-text-medium-regular-line-height);letter-spacing:var(--wcm-text-medium-regular-letter-spacing);text-transform:var(--wcm-text-medium-regular-text-transform)}.wcm-big-bold{font-family:var(--wcm-text-big-bold-font-family);font-weight:var(--wcm-text-big-bold-weight);font-size:var(--wcm-text-big-bold-size);line-height:var(--wcm-text-big-bold-line-height);letter-spacing:var(--wcm-text-big-bold-letter-spacing);text-transform:var(--wcm-text-big-bold-text-transform)}:host(*){color:var(--wcm-color-fg-1)}.wcm-color-primary{color:var(--wcm-color-fg-1)}.wcm-color-secondary{color:var(--wcm-color-fg-2)}.wcm-color-tertiary{color:var(--wcm-color-fg-3)}.wcm-color-inverse{color:var(--wcm-accent-fill-color)}.wcm-color-accnt{color:var(--wcm-accent-color)}.wcm-color-error{color:var(--wcm-error-color)}`;var ks=Object.defineProperty,Is=Object.getOwnPropertyDescriptor,Ke=(e,t,r,n)=>{for(var o=n>1?void 0:n?Is(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&ks(t,r,o),o};let Dt=class extends A{constructor(){super(...arguments),this.variant="medium-regular",this.color="primary"}render(){const e={"wcm-big-bold":this.variant==="big-bold","wcm-medium-regular":this.variant==="medium-regular","wcm-small-regular":this.variant==="small-regular","wcm-small-thin":this.variant==="small-thin","wcm-xsmall-regular":this.variant==="xsmall-regular","wcm-xsmall-bold":this.variant==="xsmall-bold","wcm-color-primary":this.color==="primary","wcm-color-secondary":this.color==="secondary","wcm-color-tertiary":this.color==="tertiary","wcm-color-inverse":this.color==="inverse","wcm-color-accnt":this.color==="accent","wcm-color-error":this.color==="error"};return m``}};Dt.styles=[_.globalCss,Os],Ke([C()],Dt.prototype,"variant",2),Ke([C()],Dt.prototype,"color",2),Dt=Ke([O("wcm-text")],Dt);const Ts=M`button{width:100%;height:100%;border-radius:var(--wcm-button-hover-highlight-border-radius);display:flex;align-items:flex-start}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}wcm-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}wcm-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:var(--wcm-wallet-icon-border-radius);margin-bottom:5px}.wcm-sublabel{margin-top:2px}`;var Ps=Object.defineProperty,Ms=Object.getOwnPropertyDescriptor,tt=(e,t,r,n)=>{for(var o=n>1?void 0:n?Ms(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Ps(t,r,o),o};let K=class extends A{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.walletId="",this.label=void 0,this.imageId=void 0,this.installed=!1,this.recent=!1}sublabelTemplate(){return this.recent?m`RECENT`:this.installed?m`INSTALLED`:null}handleClick(){Do.click({name:"WALLET_BUTTON",walletId:this.walletId}),this.onClick()}render(){var e;return m``}};K.styles=[_.globalCss,Ts],tt([C()],K.prototype,"onClick",2),tt([C()],K.prototype,"name",2),tt([C()],K.prototype,"walletId",2),tt([C()],K.prototype,"label",2),tt([C()],K.prototype,"imageId",2),tt([C({type:Boolean})],K.prototype,"installed",2),tt([C({type:Boolean})],K.prototype,"recent",2),K=tt([O("wcm-wallet-button")],K);const Ss=M`:host{display:block}div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%;background-color:var(--wcm-color-overlay)}svg{position:relative;width:100%;height:100%}div::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;border-radius:inherit;border:1px solid var(--wcm-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var Rs=Object.defineProperty,Ls=Object.getOwnPropertyDescriptor,ne=(e,t,r,n)=>{for(var o=n>1?void 0:n?Ls(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Rs(t,r,o),o};let bt=class extends A{constructor(){super(...arguments),this.walletId="",this.imageId=void 0,this.imageUrl=void 0}render(){var e;const t=(e=this.imageUrl)!=null&&e.length?this.imageUrl:x.getWalletIcon({id:this.walletId,image_id:this.imageId});return m`${t.length?m`
${this.id}
`:S.WALLET_PLACEHOLDER}`}};bt.styles=[_.globalCss,Ss],ne([C()],bt.prototype,"walletId",2),ne([C()],bt.prototype,"imageId",2),ne([C()],bt.prototype,"imageUrl",2),bt=ne([O("wcm-wallet-image")],bt);var Ns=Object.defineProperty,Bs=Object.getOwnPropertyDescriptor,Jr=(e,t,r,n)=>{for(var o=n>1?void 0:n?Bs(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Ns(t,r,o),o};let qe=class extends A{constructor(){super(),this.preload=!0,this.preloadData()}async loadImages(e){try{e!=null&&e.length&&await Promise.all(e.map(async t=>x.preloadImage(t)))}catch{console.info("Unsuccessful attempt at preloading some images",e)}}async preloadListings(){if(gt.state.enableExplorer){await U.getRecomendedWallets(),q.setIsDataLoaded(!0);const{recomendedWallets:e}=U.state,t=e.map(r=>x.getWalletIcon(r));await this.loadImages(t)}else q.setIsDataLoaded(!0)}async preloadCustomImages(){const e=x.getCustomImageUrls();await this.loadImages(e)}async preloadData(){try{this.preload&&(this.preload=!1,await Promise.all([this.preloadListings(),this.preloadCustomImages()]))}catch(e){console.error(e),ot.openToast("Failed preloading","error")}}};Jr([j()],qe.prototype,"preload",2),qe=Jr([O("wcm-explorer-context")],qe);var Ds=Object.defineProperty,Us=Object.getOwnPropertyDescriptor,js=(e,t,r,n)=>{for(var o=n>1?void 0:n?Us(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Ds(t,r,o),o};let Xr=class extends A{constructor(){super(),this.unsubscribeTheme=void 0,_.setTheme(),this.unsubscribeTheme=_t.subscribe(_.setTheme)}disconnectedCallback(){var e;(e=this.unsubscribeTheme)==null||e.call(this)}};Xr=js([O("wcm-theme-context")],Xr);const Ws=M`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 9),0,0)}}.wcm-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px;width:calc(100% + 40px)}.wcm-track{display:flex;width:calc(70px * 18);animation:scroll 20s linear infinite;opacity:.7}.wcm-track svg{margin:0 5px}wcm-wallet-image{width:60px;height:60px;margin:0 5px;border-radius:var(--wcm-wallet-icon-border-radius)}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-title{display:flex;align-items:center;margin-bottom:10px}.wcm-title svg{margin-right:6px}.wcm-title path{fill:var(--wcm-accent-color)}wcm-modal-footer .wcm-title{padding:0 10px}wcm-button-big{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);filter:drop-shadow(0 0 17px var(--wcm-color-bg-1))}wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-info-footer wcm-text{text-align:center;margin-bottom:15px}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var Hs=Object.defineProperty,zs=Object.getOwnPropertyDescriptor,Fs=(e,t,r,n)=>{for(var o=n>1?void 0:n?zs(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Hs(t,r,o),o};let Ye=class extends A{onGoToQrcode(){N.push("Qrcode")}render(){const{recomendedWallets:e}=U.state,t=[...e,...e],r=E.RECOMMENDED_WALLET_AMOUNT*2;return m`
${S.MOBILE_ICON}WalletConnect
${[...Array(r)].map((n,o)=>{const i=t[o%t.length];return i?m``:S.WALLET_PLACEHOLDER})}
Select Wallet
Choose WalletConnect to see supported apps on your device`}};Ye.styles=[_.globalCss,Ws],Ye=Fs([O("wcm-android-wallet-selection")],Ye);const Zs=M`@keyframes loading{to{stroke-dashoffset:0}}@keyframes shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(1px,0,0)}30%,50%,70%{transform:translate3d(-2px,0,0)}40%,60%{transform:translate3d(2px,0,0)}}:host{display:flex;flex-direction:column;align-items:center}div{position:relative;width:110px;height:110px;display:flex;justify-content:center;align-items:center;margin:40px 0 20px 0;transform:translate3d(0,0,0)}svg{position:absolute;width:110px;height:110px;fill:none;stroke:transparent;stroke-linecap:round;stroke-width:2px;top:0;left:0}use{stroke:var(--wcm-accent-color);animation:loading 1s linear infinite}wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:90px;height:90px}wcm-text{margin-bottom:40px}.wcm-error svg{stroke:var(--wcm-error-color)}.wcm-error use{display:none}.wcm-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}.wcm-stale svg,.wcm-stale use{display:none}`;var Vs=Object.defineProperty,Ks=Object.getOwnPropertyDescriptor,yt=(e,t,r,n)=>{for(var o=n>1?void 0:n?Ks(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Vs(t,r,o),o};let et=class extends A{constructor(){super(...arguments),this.walletId=void 0,this.imageId=void 0,this.isError=!1,this.isStale=!1,this.label=""}svgLoaderTemplate(){var e,t;const r=(t=(e=_t.state.themeVariables)==null?void 0:e["--wcm-wallet-icon-large-border-radius"])!=null?t:_.getPreset("--wcm-wallet-icon-large-border-radius");let n=0;r.includes("%")?n=88/100*parseInt(r,10):n=parseInt(r,10),n*=1.17;const o=317-n*1.57,i=425-n*1.8;return m``}render(){const e={"wcm-error":this.isError,"wcm-stale":this.isStale};return m`
${this.svgLoaderTemplate()}
${this.isError?"Connection declined":this.label}`}};et.styles=[_.globalCss,Zs],yt([C()],et.prototype,"walletId",2),yt([C()],et.prototype,"imageId",2),yt([C({type:Boolean})],et.prototype,"isError",2),yt([C({type:Boolean})],et.prototype,"isStale",2),yt([C()],et.prototype,"label",2),et=yt([O("wcm-connector-waiting")],et);const At={manualWallets(){var e,t;const{mobileWallets:r,desktopWallets:n}=gt.state,o=(e=At.recentWallet())==null?void 0:e.id,i=E.isMobile()?r:n,s=i==null?void 0:i.filter(a=>o!==a.id);return(t=E.isMobile()?s==null?void 0:s.map(({id:a,name:l,links:c})=>({id:a,name:l,mobile:c,links:c})):s==null?void 0:s.map(({id:a,name:l,links:c})=>({id:a,name:l,desktop:c,links:c})))!=null?t:[]},recentWallet(){return x.getRecentWallet()},recomendedWallets(e=!1){var t;const r=e||(t=At.recentWallet())==null?void 0:t.id,{recomendedWallets:n}=U.state;return n.filter(o=>r!==o.id)}},st={onConnecting(e){x.goToConnectingView(e)},manualWalletsTemplate(){return At.manualWallets().map(e=>m``)},recomendedWalletsTemplate(e=!1){return At.recomendedWallets(e).map(t=>m``)},recentWalletTemplate(){const e=At.recentWallet();if(e)return m``}},qs=M`.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-desktop-title,.wcm-mobile-title{display:flex;align-items:center}.wcm-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.wcm-desktop-title{margin-bottom:10px;padding:0 10px}.wcm-subtitle{display:flex;align-items:center}.wcm-subtitle:last-child path{fill:var(--wcm-color-fg-3)}.wcm-desktop-title svg,.wcm-mobile-title svg{margin-right:6px}.wcm-desktop-title path,.wcm-mobile-title path{fill:var(--wcm-accent-color)}`;var Ys=Object.defineProperty,Gs=Object.getOwnPropertyDescriptor,Qs=(e,t,r,n)=>{for(var o=n>1?void 0:n?Gs(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Ys(t,r,o),o};let Ge=class extends A{render(){const{explorerExcludedWalletIds:e,enableExplorer:t}=gt.state,r=e!=="ALL"&&t,n=st.manualWalletsTemplate(),o=st.recomendedWalletsTemplate();let i=[st.recentWalletTemplate(),...n,...o];i=i.filter(Boolean);const s=i.length>4||r;let a=[];s?a=i.slice(0,3):a=i;const l=!!a.length;return m`
${S.MOBILE_ICON}Mobile
${S.SCAN_ICON}Scan with your wallet
${l?m`
${S.DESKTOP_ICON}Desktop
${a} ${s?m``:null}
`:null}`}};Ge.styles=[_.globalCss,qs],Ge=Qs([O("wcm-desktop-wallet-selection")],Ge);const Js=M`div{background-color:var(--wcm-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--wcm-color-bg-3);text-align:center}a{color:var(--wcm-accent-color);text-decoration:none;transition:opacity .2s ease-in-out;display:inline}a:active{opacity:.8}@media(hover:hover){a:hover{opacity:.8}}`;var Xs=Object.defineProperty,ta=Object.getOwnPropertyDescriptor,ea=(e,t,r,n)=>{for(var o=n>1?void 0:n?ta(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Xs(t,r,o),o};let Qe=class extends A{render(){const{termsOfServiceUrl:e,privacyPolicyUrl:t}=gt.state;return e??t?m`
By connecting your wallet to this app, you agree to the app's ${e?m`Terms of Service`:null} ${e&&t?"and":null} ${t?m`Privacy Policy`:null}
`:null}};Qe.styles=[_.globalCss,Js],Qe=ea([O("wcm-legal-notice")],Qe);const ra=M`div{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;var oa=Object.defineProperty,na=Object.getOwnPropertyDescriptor,ia=(e,t,r,n)=>{for(var o=n>1?void 0:n?na(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&oa(t,r,o),o};let Je=class extends A{onQrcode(){N.push("Qrcode")}render(){const{explorerExcludedWalletIds:e,enableExplorer:t}=gt.state,r=e!=="ALL"&&t,n=st.manualWalletsTemplate(),o=st.recomendedWalletsTemplate();let i=[st.recentWalletTemplate(),...n,...o];i=i.filter(Boolean);const s=i.length>8||r;let a=[];s?a=i.slice(0,7):a=i;const l=!!a.length;return m`${l?m`
${a} ${s?m``:null}
`:null}`}};Je.styles=[_.globalCss,ra],Je=ia([O("wcm-mobile-wallet-selection")],Je);const sa=M`:host{all:initial}.wcm-overlay{top:0;bottom:0;left:0;right:0;position:fixed;z-index:var(--wcm-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;opacity:0;pointer-events:none;background-color:var(--wcm-overlay-background-color);backdrop-filter:var(--wcm-overlay-backdrop-filter)}@media(max-height:720px) and (orientation:landscape){.wcm-overlay{overflow:scroll;align-items:flex-start;padding:20px 0}}.wcm-active{pointer-events:auto}.wcm-container{position:relative;max-width:360px;width:100%;outline:0;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) var(--wcm-container-border-radius) var(--wcm-container-border-radius);border:1px solid var(--wcm-color-overlay);overflow:hidden}.wcm-card{width:100%;position:relative;border-radius:var(--wcm-container-border-radius);overflow:hidden;box-shadow:0 6px 14px -6px rgba(10,16,31,.12),0 10px 32px -4px rgba(10,16,31,.1),0 0 0 1px var(--wcm-color-overlay);background-color:var(--wcm-color-bg-1);color:var(--wcm-color-fg-1)}@media(max-width:600px){.wcm-container{max-width:440px;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) 0 0}.wcm-card{border-radius:var(--wcm-container-border-radius) var(--wcm-container-border-radius) 0 0}.wcm-overlay{align-items:flex-end}}@media(max-width:440px){.wcm-container{border:0}}`;var aa=Object.defineProperty,la=Object.getOwnPropertyDescriptor,Xe=(e,t,r,n)=>{for(var o=n>1?void 0:n?la(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&aa(t,r,o),o};let Ut=class extends A{constructor(){super(),this.open=!1,this.active=!1,this.unsubscribeModal=void 0,this.abortController=void 0,this.unsubscribeModal=ce.subscribe(e=>{e.open?this.onOpenModalEvent():this.onCloseModalEvent()})}disconnectedCallback(){var e;(e=this.unsubscribeModal)==null||e.call(this)}get overlayEl(){return x.getShadowRootElement(this,".wcm-overlay")}get containerEl(){return x.getShadowRootElement(this,".wcm-container")}toggleBodyScroll(e){if(document.querySelector("body"))if(e){const t=document.getElementById("wcm-styles");t==null||t.remove()}else document.head.insertAdjacentHTML("beforeend",'')}onCloseModal(e){e.target===e.currentTarget&&ce.close()}onOpenModalEvent(){this.toggleBodyScroll(!1),this.addKeyboardEvents(),this.open=!0,setTimeout(async()=>{const e=x.isMobileAnimation()?{y:["50vh","0vh"]}:{scale:[.98,1]},t=.1,r=.2;await Promise.all([mt(this.overlayEl,{opacity:[0,1]},{delay:t,duration:r}).finished,mt(this.containerEl,e,{delay:t,duration:r}).finished]),this.active=!0},0)}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents();const e=x.isMobileAnimation()?{y:["0vh","50vh"]}:{scale:[1,.98]},t=.2;await Promise.all([mt(this.overlayEl,{opacity:[1,0]},{duration:t}).finished,mt(this.containerEl,e,{duration:t}).finished]),this.containerEl.removeAttribute("style"),this.active=!1,this.open=!1}addKeyboardEvents(){this.abortController=new AbortController,window.addEventListener("keydown",e=>{var t;e.key==="Escape"?ce.close():e.key==="Tab"&&((t=e.target)!=null&&t.tagName.includes("wcm-")||this.containerEl.focus())},this.abortController),this.containerEl.focus()}removeKeyboardEvents(){var e;(e=this.abortController)==null||e.abort(),this.abortController=void 0}render(){const e={"wcm-overlay":!0,"wcm-active":this.active};return m`
${this.open?m`
`:null}
`}};Ut.styles=[_.globalCss,sa],Xe([j()],Ut.prototype,"open",2),Xe([j()],Ut.prototype,"active",2),Ut=Xe([O("wcm-modal")],Ut);const ca=M`div{display:flex;margin-top:15px}slot{display:inline-block;margin:0 5px}wcm-button{margin:0 5px}`;var da=Object.defineProperty,ha=Object.getOwnPropertyDescriptor,jt=(e,t,r,n)=>{for(var o=n>1?void 0:n?ha(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&da(t,r,o),o};let dt=class extends A{constructor(){super(...arguments),this.isMobile=!1,this.isDesktop=!1,this.isWeb=!1,this.isRetry=!1}onMobile(){E.isMobile()?N.replace("MobileConnecting"):N.replace("MobileQrcodeConnecting")}onDesktop(){N.replace("DesktopConnecting")}onWeb(){N.replace("WebConnecting")}render(){return m`
${this.isRetry?m``:null} ${this.isMobile?m`Mobile`:null} ${this.isDesktop?m`Desktop`:null} ${this.isWeb?m`Web`:null}
`}};dt.styles=[_.globalCss,ca],jt([C({type:Boolean})],dt.prototype,"isMobile",2),jt([C({type:Boolean})],dt.prototype,"isDesktop",2),jt([C({type:Boolean})],dt.prototype,"isWeb",2),jt([C({type:Boolean})],dt.prototype,"isRetry",2),dt=jt([O("wcm-platform-selection")],dt);const ua=M`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:var(--wcm-button-hover-highlight-border-radius);height:100%;justify-content:flex-start}.wcm-icons{width:60px;height:60px;display:flex;flex-wrap:wrap;padding:7px;border-radius:var(--wcm-wallet-icon-border-radius);justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--wcm-color-bg-2);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}.wcm-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:calc(var(--wcm-wallet-icon-border-radius)/ 2);border:1px solid var(--wcm-color-overlay)}.wcm-icons svg{width:21px;height:21px}.wcm-icons img:nth-child(1),.wcm-icons img:nth-child(2),.wcm-icons svg:nth-child(1),.wcm-icons svg:nth-child(2){margin-bottom:4px}wcm-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var ma=Object.defineProperty,ga=Object.getOwnPropertyDescriptor,fa=(e,t,r,n)=>{for(var o=n>1?void 0:n?ga(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&ma(t,r,o),o};let tr=class extends A{onClick(){N.push("WalletExplorer")}render(){const{recomendedWallets:e}=U.state,t=At.manualWallets(),r=[...e,...t].reverse().slice(0,4);return m``}};tr.styles=[_.globalCss,ua],tr=fa([O("wcm-view-all-wallets-button")],tr);const pa=M`.wcm-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var wa=Object.defineProperty,va=Object.getOwnPropertyDescriptor,ie=(e,t,r,n)=>{for(var o=n>1?void 0:n?va(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&wa(t,r,o),o};let xt=class extends A{constructor(){super(),this.walletId="",this.imageId="",this.uri="",setTimeout(()=>{const{walletConnectUri:e}=q.state;this.uri=e},0)}get overlayEl(){return x.getShadowRootElement(this,".wcm-qr-container")}render(){return m`
${this.uri?m``:m``}
`}};xt.styles=[_.globalCss,pa],ie([C()],xt.prototype,"walletId",2),ie([C()],xt.prototype,"imageId",2),ie([j()],xt.prototype,"uri",2),xt=ie([O("wcm-walletconnect-qr")],xt);var ba=Object.defineProperty,ya=Object.getOwnPropertyDescriptor,xa=(e,t,r,n)=>{for(var o=n>1?void 0:n?ya(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&ba(t,r,o),o};let er=class extends A{viewTemplate(){return E.isAndroid()?m``:E.isMobile()?m``:m``}render(){return m`${this.viewTemplate()}`}};er.styles=[_.globalCss],er=xa([O("wcm-connect-wallet-view")],er);const $a=M`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var Ca=Object.defineProperty,Ea=Object.getOwnPropertyDescriptor,to=(e,t,r,n)=>{for(var o=n>1?void 0:n?Ea(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Ca(t,r,o),o};let se=class extends A{constructor(){super(),this.isError=!1,this.openDesktopApp()}onFormatAndRedirect(e){const{desktop:t,name:r}=E.getWalletRouterData(),n=t==null?void 0:t.native;if(n){const o=E.formatNativeUrl(n,e,r);E.openHref(o,"_self")}}openDesktopApp(){const{walletConnectUri:e}=q.state,t=E.getWalletRouterData();x.setRecentWallet(t),e&&this.onFormatAndRedirect(e)}render(){const{name:e,id:t,image_id:r}=E.getWalletRouterData(),{isMobile:n,isWeb:o}=x.getCachedRouterWalletPlatforms();return m`${`Connection can continue loading if ${e} is not installed on your device`}Retry`}};se.styles=[_.globalCss,$a],to([j()],se.prototype,"isError",2),se=to([O("wcm-desktop-connecting-view")],se);const Aa=M`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}wcm-button{margin-top:15px}`;var _a=Object.defineProperty,Oa=Object.getOwnPropertyDescriptor,ka=(e,t,r,n)=>{for(var o=n>1?void 0:n?Oa(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&_a(t,r,o),o};let rr=class extends A{onInstall(e){e&&E.openHref(e,"_blank")}render(){const{name:e,id:t,image_id:r,homepage:n}=E.getWalletRouterData();return m`${`Download ${e} to continue. If multiple browser extensions are installed, disable non ${e} ones and try again`}Download`}};rr.styles=[_.globalCss,Aa],rr=ka([O("wcm-install-wallet-view")],rr);const Ia=M`wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:96px;height:96px;margin-bottom:20px}wcm-info-footer{display:flex;width:100%}.wcm-app-store{justify-content:space-between}.wcm-app-store wcm-wallet-image{margin-right:10px;margin-bottom:0;width:28px;height:28px;border-radius:var(--wcm-wallet-icon-small-border-radius)}.wcm-app-store div{display:flex;align-items:center}.wcm-app-store wcm-button{margin-right:-10px}.wcm-note{flex-direction:column;align-items:center;padding:5px 0}.wcm-note wcm-text{text-align:center}wcm-platform-selection{margin-top:-15px}.wcm-note wcm-text{margin-top:15px}.wcm-note wcm-text span{color:var(--wcm-accent-color)}`;var Ta=Object.defineProperty,Pa=Object.getOwnPropertyDescriptor,eo=(e,t,r,n)=>{for(var o=n>1?void 0:n?Pa(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Ta(t,r,o),o};let ae=class extends A{constructor(){super(),this.isError=!1,this.openMobileApp()}onFormatAndRedirect(e,t=!1){const{mobile:r,name:n}=E.getWalletRouterData(),o=r==null?void 0:r.native,i=r==null?void 0:r.universal;if(o&&!t){const s=E.formatNativeUrl(o,e,n);E.openHref(s,"_self")}else if(i){const s=E.formatUniversalUrl(i,e,n);E.openHref(s,"_self")}}openMobileApp(e=!1){const{walletConnectUri:t}=q.state,r=E.getWalletRouterData();x.setRecentWallet(r),t&&this.onFormatAndRedirect(t,e)}onGoToAppStore(e){e&&E.openHref(e,"_blank")}render(){const{name:e,id:t,image_id:r,app:n,mobile:o}=E.getWalletRouterData(),{isWeb:i}=x.getCachedRouterWalletPlatforms(),s=n==null?void 0:n.ios,a=o==null?void 0:o.universal;return m`Retry${a?m`Still doesn't work? Try this alternate link`:null}
${`Get ${e}`}
App Store
`}};ae.styles=[_.globalCss,Ia],eo([j()],ae.prototype,"isError",2),ae=eo([O("wcm-mobile-connecting-view")],ae);const Ma=M`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var Sa=Object.defineProperty,Ra=Object.getOwnPropertyDescriptor,La=(e,t,r,n)=>{for(var o=n>1?void 0:n?Ra(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Sa(t,r,o),o};let or=class extends A{render(){const{name:e,id:t,image_id:r}=E.getWalletRouterData(),{isDesktop:n,isWeb:o}=x.getCachedRouterWalletPlatforms();return m`${`Scan this QR Code with your phone's camera or inside ${e} app`}`}};or.styles=[_.globalCss,Ma],or=La([O("wcm-mobile-qr-connecting-view")],or);var Na=Object.defineProperty,Ba=Object.getOwnPropertyDescriptor,Da=(e,t,r,n)=>{for(var o=n>1?void 0:n?Ba(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Na(t,r,o),o};let nr=class extends A{render(){return m``}};nr.styles=[_.globalCss],nr=Da([O("wcm-qrcode-view")],nr);const Ua=M`wcm-modal-content{height:clamp(200px,60vh,600px);display:block;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px;padding-top:20px}wcm-modal-content::after,wcm-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}wcm-modal-content::before{box-shadow:0 -1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(var(--wcm-color-bg-1),rgba(255,255,255,0))}wcm-modal-content::after{box-shadow:0 1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--wcm-color-bg-1));top:calc(100% - 20px)}wcm-modal-content::-webkit-scrollbar{display:none}.wcm-placeholder-block{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.wcm-empty,.wcm-loading{display:flex}.wcm-loading .wcm-placeholder-block{height:100%}.wcm-end-reached .wcm-placeholder-block{height:0;opacity:0}.wcm-empty .wcm-placeholder-block{opacity:1;height:100%}wcm-wallet-button{margin:calc((100% - 60px)/ 3) 0}`;var ja=Object.defineProperty,Wa=Object.getOwnPropertyDescriptor,Wt=(e,t,r,n)=>{for(var o=n>1?void 0:n?Wa(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&ja(t,r,o),o};const ir=40;let ht=class extends A{constructor(){super(...arguments),this.loading=!U.state.wallets.listings.length,this.firstFetch=!U.state.wallets.listings.length,this.search="",this.endReached=!1,this.intersectionObserver=void 0,this.searchDebounce=x.debounce(e=>{e.length>=3?(this.firstFetch=!0,this.endReached=!1,this.search=e,U.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),U.resetSearch())})}firstUpdated(){this.createPaginationObserver()}disconnectedCallback(){var e;(e=this.intersectionObserver)==null||e.disconnect()}get placeholderEl(){return x.getShadowRootElement(this,".wcm-placeholder-block")}createPaginationObserver(){this.intersectionObserver=new IntersectionObserver(([e])=>{e.isIntersecting&&!(this.search&&this.firstFetch)&&this.fetchWallets()}),this.intersectionObserver.observe(this.placeholderEl)}isLastPage(){const{wallets:e,search:t}=U.state,{listings:r,total:n}=this.search?t:e;return n<=ir||r.length>=n}async fetchWallets(){var e;const{wallets:t,search:r}=U.state,{listings:n,total:o,page:i}=this.search?r:t;if(!this.endReached&&(this.firstFetch||o>ir&&n.lengthx.getWalletIcon(c));await Promise.all([...l.map(async c=>x.preloadImage(c)),E.wait(300)]),this.endReached=this.isLastPage()}catch(s){console.error(s),ot.openToast(x.getErrorMessage(s),"error")}finally{this.loading=!1,this.firstFetch=!1}}onConnect(e){E.isAndroid()?x.handleMobileLinking(e):x.goToConnectingView(e)}onSearchChange(e){const{value:t}=e.target;this.searchDebounce(t)}render(){const{wallets:e,search:t}=U.state,{listings:r}=this.search?t:e,n=this.loading&&!r.length,o=this.search.length>=3;let i=st.manualWalletsTemplate(),s=st.recomendedWalletsTemplate(!0);o&&(i=i.filter(({values:c})=>x.caseSafeIncludes(c[0],this.search)),s=s.filter(({values:c})=>x.caseSafeIncludes(c[0],this.search)));const a=!this.loading&&!r.length&&!s.length,l={"wcm-loading":n,"wcm-end-reached":this.endReached||!this.loading,"wcm-empty":a};return m`
${n?null:i} ${n?null:s} ${n?null:r.map(c=>m`${c?m``:null}`)}
${a?m`No results found`:null} ${!a&&this.loading?m``:null}
`}};ht.styles=[_.globalCss,Ua],Wt([j()],ht.prototype,"loading",2),Wt([j()],ht.prototype,"firstFetch",2),Wt([j()],ht.prototype,"search",2),Wt([j()],ht.prototype,"endReached",2),ht=Wt([O("wcm-wallet-explorer-view")],ht);const Ha=M`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var za=Object.defineProperty,Fa=Object.getOwnPropertyDescriptor,ro=(e,t,r,n)=>{for(var o=n>1?void 0:n?Fa(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&za(t,r,o),o};let le=class extends A{constructor(){super(),this.isError=!1,this.openWebWallet()}onFormatAndRedirect(e){const{desktop:t,name:r}=E.getWalletRouterData(),n=t==null?void 0:t.universal;if(n){const o=E.formatUniversalUrl(n,e,r);E.openHref(o,"_blank")}}openWebWallet(){const{walletConnectUri:e}=q.state,t=E.getWalletRouterData();x.setRecentWallet(t),e&&this.onFormatAndRedirect(e)}render(){const{name:e,id:t,image_id:r}=E.getWalletRouterData(),{isMobile:n,isDesktop:o}=x.getCachedRouterWalletPlatforms(),i=E.isMobile();return m`${`${e} web app has opened in a new tab. Go there, accept the connection, and come back`}Retry`}};le.styles=[_.globalCss,Ha],ro([j()],le.prototype,"isError",2),le=ro([O("wcm-web-connecting-view")],le);export{Ut as WcmModal,X as WcmQrCode}; +`;return typeof n=="function"&&n(null,h),h};const Pi=Fn,fr=$o,Bo=Lo,Mi=No;function Er(e,t,r,n,o){const i=[].slice.call(arguments,1),s=i.length,a=typeof i[s-1]=="function";if(!a&&!Pi())throw new Error("Callback required as last argument");if(a){if(s<2)throw new Error("Too few arguments provided");s===2?(o=r,r=t,t=n=void 0):s===3&&(t.getContext&&typeof o>"u"?(o=n,n=void 0):(o=n,n=r,r=t,t=void 0))}else{if(s<1)throw new Error("Too few arguments provided");return s===1?(r=t,t=n=void 0):s===2&&!t.getContext&&(n=r,r=t,t=void 0),new Promise(function(l,c){try{const d=fr.create(r,n);l(e(d,t,n))}catch(d){c(d)}})}try{const l=fr.create(r,n);o(null,e(l,t,n))}catch(l){o(l)}}Gt.create=fr.create;Gt.toCanvas=Er.bind(null,Bo.render);Gt.toDataURL=Er.bind(null,Bo.renderToDataURL);Gt.toString=Er.bind(null,function(e,t,r){return Mi.render(e,r)});var Si=Object.defineProperty,Vr=Object.getOwnPropertySymbols,Ri=Object.prototype.hasOwnProperty,Li=Object.prototype.propertyIsEnumerable,Kr=(e,t,r)=>t in e?Si(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,De=(e,t)=>{for(var r in t||(t={}))Ri.call(t,r)&&Kr(e,r,t[r]);if(Vr)for(var r of Vr(t))Li.call(t,r)&&Kr(e,r,t[r]);return e};function Ni(){var e;const t=(e=_t.state.themeMode)!=null?e:"dark",r={light:{foreground:{1:"rgb(20,20,20)",2:"rgb(121,134,134)",3:"rgb(158,169,169)"},background:{1:"rgb(255,255,255)",2:"rgb(241,243,243)",3:"rgb(228,231,231)"},overlay:"rgba(0,0,0,0.1)"},dark:{foreground:{1:"rgb(228,231,231)",2:"rgb(148,158,158)",3:"rgb(110,119,119)"},background:{1:"rgb(20,20,20)",2:"rgb(39,42,42)",3:"rgb(59,64,64)"},overlay:"rgba(255,255,255,0.1)"}}[t];return{"--wcm-color-fg-1":r.foreground[1],"--wcm-color-fg-2":r.foreground[2],"--wcm-color-fg-3":r.foreground[3],"--wcm-color-bg-1":r.background[1],"--wcm-color-bg-2":r.background[2],"--wcm-color-bg-3":r.background[3],"--wcm-color-overlay":r.overlay}}function qr(){return{"--wcm-accent-color":"#3396FF","--wcm-accent-fill-color":"#FFFFFF","--wcm-z-index":"89","--wcm-background-color":"#3396FF","--wcm-background-border-radius":"8px","--wcm-container-border-radius":"30px","--wcm-wallet-icon-border-radius":"15px","--wcm-wallet-icon-large-border-radius":"30px","--wcm-wallet-icon-small-border-radius":"7px","--wcm-input-border-radius":"28px","--wcm-button-border-radius":"10px","--wcm-notification-border-radius":"36px","--wcm-secondary-button-border-radius":"28px","--wcm-icon-button-border-radius":"50%","--wcm-button-hover-highlight-border-radius":"10px","--wcm-text-big-bold-size":"20px","--wcm-text-big-bold-weight":"600","--wcm-text-big-bold-line-height":"24px","--wcm-text-big-bold-letter-spacing":"-0.03em","--wcm-text-big-bold-text-transform":"none","--wcm-text-xsmall-bold-size":"10px","--wcm-text-xsmall-bold-weight":"700","--wcm-text-xsmall-bold-line-height":"12px","--wcm-text-xsmall-bold-letter-spacing":"0.02em","--wcm-text-xsmall-bold-text-transform":"uppercase","--wcm-text-xsmall-regular-size":"12px","--wcm-text-xsmall-regular-weight":"600","--wcm-text-xsmall-regular-line-height":"14px","--wcm-text-xsmall-regular-letter-spacing":"-0.03em","--wcm-text-xsmall-regular-text-transform":"none","--wcm-text-small-thin-size":"14px","--wcm-text-small-thin-weight":"500","--wcm-text-small-thin-line-height":"16px","--wcm-text-small-thin-letter-spacing":"-0.03em","--wcm-text-small-thin-text-transform":"none","--wcm-text-small-regular-size":"14px","--wcm-text-small-regular-weight":"600","--wcm-text-small-regular-line-height":"16px","--wcm-text-small-regular-letter-spacing":"-0.03em","--wcm-text-small-regular-text-transform":"none","--wcm-text-medium-regular-size":"16px","--wcm-text-medium-regular-weight":"600","--wcm-text-medium-regular-line-height":"20px","--wcm-text-medium-regular-letter-spacing":"-0.03em","--wcm-text-medium-regular-text-transform":"none","--wcm-font-family":"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif","--wcm-font-feature-settings":"'tnum' on, 'lnum' on, 'case' on","--wcm-success-color":"rgb(38,181,98)","--wcm-error-color":"rgb(242, 90, 103)","--wcm-overlay-background-color":"rgba(0, 0, 0, 0.3)","--wcm-overlay-backdrop-filter":"none"}}const _={getPreset(e){return qr()[e]},setTheme(){const e=document.querySelector(":root"),{themeVariables:t}=_t.state;if(e){const r=De(De(De({},Ni()),qr()),t);Object.entries(r).forEach(([n,o])=>e.style.setProperty(n,o))}},globalCss:M`*,::after,::before{margin:0;padding:0;box-sizing:border-box;font-style:normal;text-rendering:optimizeSpeed;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-tap-highlight-color:transparent;backface-visibility:hidden}button{cursor:pointer;display:flex;justify-content:center;align-items:center;position:relative;border:none;background-color:transparent;transition:all .2s ease}@media (hover:hover) and (pointer:fine){button:active{transition:all .1s ease;transform:scale(.93)}}button::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;transition:background-color,.2s ease}button:disabled{cursor:not-allowed}button svg,button wcm-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--wcm-accent-fill-color);background:var(--wcm-accent-color)}`},Bi=M`button{border-radius:var(--wcm-secondary-button-border-radius);height:28px;padding:0 10px;background-color:var(--wcm-accent-color)}button path{fill:var(--wcm-accent-fill-color)}button::after{border-radius:inherit;border:1px solid var(--wcm-color-overlay)}button:disabled::after{background-color:transparent}.wcm-icon-left svg{margin-right:5px}.wcm-icon-right svg{margin-left:5px}button:active::after{background-color:var(--wcm-color-overlay)}.wcm-ghost,.wcm-ghost:active::after,.wcm-outline{background-color:transparent}.wcm-ghost:active{opacity:.5}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}.wcm-ghost:hover::after{background-color:transparent}.wcm-ghost:hover{opacity:.5}}button:disabled{background-color:var(--wcm-color-bg-3);pointer-events:none}.wcm-ghost::after{border-color:transparent}.wcm-ghost path{fill:var(--wcm-color-fg-2)}.wcm-outline path{fill:var(--wcm-accent-color)}.wcm-outline:disabled{background-color:transparent;opacity:.5}`;var Di=Object.defineProperty,Ui=Object.getOwnPropertyDescriptor,wt=(e,t,r,n)=>{for(var o=n>1?void 0:n?Ui(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Di(t,r,o),o};let Q=class extends A{constructor(){super(...arguments),this.disabled=!1,this.iconLeft=void 0,this.iconRight=void 0,this.onClick=()=>null,this.variant="default"}render(){const e={"wcm-icon-left":this.iconLeft!==void 0,"wcm-icon-right":this.iconRight!==void 0,"wcm-ghost":this.variant==="ghost","wcm-outline":this.variant==="outline"};let t="inverse";return this.variant==="ghost"&&(t="secondary"),this.variant==="outline"&&(t="accent"),m``}};Q.styles=[_.globalCss,Bi],wt([C({type:Boolean})],Q.prototype,"disabled",2),wt([C()],Q.prototype,"iconLeft",2),wt([C()],Q.prototype,"iconRight",2),wt([C()],Q.prototype,"onClick",2),wt([C()],Q.prototype,"variant",2),Q=wt([O("wcm-button")],Q);const ji=M`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:var(--wcm-button-border-radius);color:var(--wcm-accent-fill-color);background-color:var(--wcm-accent-color)}button::after{content:'';top:0;bottom:0;left:0;right:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--wcm-color-overlay)}button:active::after{background-color:var(--wcm-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--wcm-color-bg-3);color:var(--wcm-color-fg-3)}.wcm-secondary{color:var(--wcm-accent-color);background-color:transparent}.wcm-secondary::after{display:none}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}}`;var Wi=Object.defineProperty,Hi=Object.getOwnPropertyDescriptor,Ue=(e,t,r,n)=>{for(var o=n>1?void 0:n?Hi(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Wi(t,r,o),o};let Lt=class extends A{constructor(){super(...arguments),this.disabled=!1,this.variant="primary"}render(){const e={"wcm-secondary":this.variant==="secondary"};return m``}};Lt.styles=[_.globalCss,ji],Ue([C({type:Boolean})],Lt.prototype,"disabled",2),Ue([C()],Lt.prototype,"variant",2),Lt=Ue([O("wcm-button-big")],Lt);const zi=M`:host{background-color:var(--wcm-color-bg-2);border-top:1px solid var(--wcm-color-bg-3)}div{padding:10px 20px;display:inherit;flex-direction:inherit;align-items:inherit;width:inherit;justify-content:inherit}`;var Fi=Object.defineProperty,Zi=Object.getOwnPropertyDescriptor,Vi=(e,t,r,n)=>{for(var o=n>1?void 0:n?Zi(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Fi(t,r,o),o};let je=class extends A{render(){return m`
`}};je.styles=[_.globalCss,zi],je=Vi([O("wcm-info-footer")],je);const S={CROSS_ICON:L``,WALLET_CONNECT_LOGO:L``,WALLET_CONNECT_ICON:L``,WALLET_CONNECT_ICON_COLORED:L``,BACK_ICON:L``,COPY_ICON:L``,RETRY_ICON:L``,DESKTOP_ICON:L``,MOBILE_ICON:L``,ARROW_DOWN_ICON:L``,ARROW_UP_RIGHT_ICON:L``,ARROW_RIGHT_ICON:L``,QRCODE_ICON:L``,SCAN_ICON:L``,CHECKMARK_ICON:L``,SEARCH_ICON:L``,WALLET_PLACEHOLDER:L``,GLOBE_ICON:L``},Ki=M`.wcm-toolbar-placeholder{top:0;bottom:0;left:0;right:0;width:100%;position:absolute;display:block;pointer-events:none;height:100px;border-radius:calc(var(--wcm-background-border-radius) * .9);background-color:var(--wcm-background-color);background-position:center;background-size:cover}.wcm-toolbar{height:38px;display:flex;position:relative;margin:5px 15px 5px 5px;justify-content:space-between;align-items:center}.wcm-toolbar img,.wcm-toolbar svg{height:28px;object-position:left center;object-fit:contain}#wcm-wc-logo path{fill:var(--wcm-accent-fill-color)}button{width:28px;height:28px;border-radius:var(--wcm-icon-button-border-radius);border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:var(--wcm-color-bg-1);box-shadow:0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-bg-2)}button svg{display:block;object-position:center}button path{fill:var(--wcm-color-fg-1)}.wcm-toolbar div{display:flex}@media(hover:hover){button:hover{background-color:var(--wcm-color-bg-2)}}`;var qi=Object.defineProperty,Yi=Object.getOwnPropertyDescriptor,Ji=(e,t,r,n)=>{for(var o=n>1?void 0:n?Yi(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&qi(t,r,o),o};let We=class extends A{render(){return m`
${S.WALLET_CONNECT_LOGO}
`}};We.styles=[_.globalCss,Ki],We=Ji([O("wcm-modal-backcard")],We);const Gi=M`main{padding:20px;padding-top:0;width:100%}`;var Qi=Object.defineProperty,Xi=Object.getOwnPropertyDescriptor,ts=(e,t,r,n)=>{for(var o=n>1?void 0:n?Xi(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Qi(t,r,o),o};let He=class extends A{render(){return m`
`}};He.styles=[_.globalCss,Gi],He=ts([O("wcm-modal-content")],He);const es=M`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--wcm-color-bg-2)}`;var rs=Object.defineProperty,os=Object.getOwnPropertyDescriptor,ns=(e,t,r,n)=>{for(var o=n>1?void 0:n?os(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&rs(t,r,o),o};let ze=class extends A{render(){return m`
`}};ze.styles=[_.globalCss,es],ze=ns([O("wcm-modal-footer")],ze);const is=M`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.wcm-border{border-bottom:1px solid var(--wcm-color-bg-2);margin-bottom:20px}header button{padding:15px 20px}header button:active{opacity:.5}@media(hover:hover){header button:hover{opacity:.5}}.wcm-back-btn{position:absolute;left:0}.wcm-action-btn{position:absolute;right:0}path{fill:var(--wcm-accent-color)}`;var ss=Object.defineProperty,as=Object.getOwnPropertyDescriptor,Nt=(e,t,r,n)=>{for(var o=n>1?void 0:n?as(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&ss(t,r,o),o};let ct=class extends A{constructor(){super(...arguments),this.title="",this.onAction=void 0,this.actionIcon=void 0,this.border=!1}backBtnTemplate(){return m``}actionBtnTemplate(){return m``}render(){const e={"wcm-border":this.border},t=N.state.history.length>1,r=this.title?m`${this.title}`:m``;return m`
${t?this.backBtnTemplate():null} ${r} ${this.onAction?this.actionBtnTemplate():null}
`}};ct.styles=[_.globalCss,is],Nt([C()],ct.prototype,"title",2),Nt([C()],ct.prototype,"onAction",2),Nt([C()],ct.prototype,"actionIcon",2),Nt([C({type:Boolean})],ct.prototype,"border",2),ct=Nt([O("wcm-modal-header")],ct);const x={MOBILE_BREAKPOINT:600,WCM_RECENT_WALLET_DATA:"WCM_RECENT_WALLET_DATA",EXPLORER_WALLET_URL:"https://explorer.walletconnect.com/?type=wallet",getShadowRootElement(e,t){const r=e.renderRoot.querySelector(t);if(!r)throw new Error(`${t} not found`);return r},getWalletIcon({id:e,image_id:t}){const{walletImages:r}=gt.state;return r!=null&&r[e]?r[e]:t?U.getWalletImageUrl(t):""},getWalletName(e,t=!1){return t&&e.length>8?`${e.substring(0,8)}..`:e},isMobileAnimation(){return window.innerWidth<=x.MOBILE_BREAKPOINT},async preloadImage(e){const t=new Promise((r,n)=>{const o=new Image;o.onload=r,o.onerror=n,o.crossOrigin="anonymous",o.src=e});return Promise.race([t,E.wait(3e3)])},getErrorMessage(e){return e instanceof Error?e.message:"Unknown Error"},debounce(e,t=500){let r;return(...n)=>{function o(){e(...n)}r&&clearTimeout(r),r=setTimeout(o,t)}},handleMobileLinking(e){const{walletConnectUri:t}=q.state,{mobile:r,name:n}=e,o=r==null?void 0:r.native,i=r==null?void 0:r.universal;x.setRecentWallet(e);function s(a){let l="";o?l=E.formatUniversalUrl(o,a,n):i&&(l=E.formatNativeUrl(i,a,n)),E.openHref(l,"_self")}t&&s(t)},handleAndroidLinking(){const{walletConnectUri:e}=q.state;e&&(E.setWalletConnectAndroidDeepLink(e),E.openHref(e,"_self"))},async handleUriCopy(){const{walletConnectUri:e}=q.state;if(e)try{await navigator.clipboard.writeText(e),ot.openToast("Link copied","success")}catch{ot.openToast("Failed to copy","error")}},getCustomImageUrls(){const{walletImages:e}=gt.state,t=Object.values(e??{});return Object.values(t)},truncate(e,t=8){return e.length<=t?e:`${e.substring(0,4)}...${e.substring(e.length-4)}`},setRecentWallet(e){try{localStorage.setItem(x.WCM_RECENT_WALLET_DATA,JSON.stringify(e))}catch{console.info("Unable to set recent wallet")}},getRecentWallet(){try{const e=localStorage.getItem(x.WCM_RECENT_WALLET_DATA);return e?JSON.parse(e):void 0}catch{console.info("Unable to get recent wallet")}},caseSafeIncludes(e,t){return e.toUpperCase().includes(t.toUpperCase())},openWalletExplorerUrl(){E.openHref(x.EXPLORER_WALLET_URL,"_blank")},getCachedRouterWalletPlatforms(){const{desktop:e,mobile:t}=E.getWalletRouterData(),r=!!(e!=null&&e.native),n=!!(e!=null&&e.universal),o=!!(t!=null&&t.native)||!!(t!=null&&t.universal);return{isDesktop:r,isMobile:o,isWeb:n}},goToConnectingView(e){N.setData({Wallet:e});const t=E.isMobile(),{isDesktop:r,isWeb:n,isMobile:o}=x.getCachedRouterWalletPlatforms();t?o?N.push("MobileConnecting"):n?N.push("WebConnecting"):N.push("InstallWallet"):r?N.push("DesktopConnecting"):n?N.push("WebConnecting"):o?N.push("MobileQrcodeConnecting"):N.push("InstallWallet")}},ls=M`.wcm-router{overflow:hidden;will-change:transform}.wcm-content{display:flex;flex-direction:column}`;var cs=Object.defineProperty,ds=Object.getOwnPropertyDescriptor,Fe=(e,t,r,n)=>{for(var o=n>1?void 0:n?ds(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&cs(t,r,o),o};let Bt=class extends A{constructor(){super(),this.view=N.state.view,this.prevView=N.state.view,this.unsubscribe=void 0,this.oldHeight="0px",this.resizeObserver=void 0,this.unsubscribe=N.subscribe(e=>{this.view!==e.view&&this.onChangeRoute()})}firstUpdated(){this.resizeObserver=new ResizeObserver(([e])=>{const t=`${e.contentRect.height}px`;this.oldHeight!=="0px"&&mt(this.routerEl,{height:[this.oldHeight,t]},{duration:.2}),this.oldHeight=t}),this.resizeObserver.observe(this.contentEl)}disconnectedCallback(){var e,t;(e=this.unsubscribe)==null||e.call(this),(t=this.resizeObserver)==null||t.disconnect()}get routerEl(){return x.getShadowRootElement(this,".wcm-router")}get contentEl(){return x.getShadowRootElement(this,".wcm-content")}viewTemplate(){switch(this.view){case"ConnectWallet":return m``;case"DesktopConnecting":return m``;case"MobileConnecting":return m``;case"WebConnecting":return m``;case"MobileQrcodeConnecting":return m``;case"WalletExplorer":return m``;case"Qrcode":return m``;case"InstallWallet":return m``;default:return m`
Not Found
`}}async onChangeRoute(){await mt(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15,delay:.1}).finished,this.view=N.state.view,mt(this.routerEl,{opacity:[0,1],scale:[.99,1]},{duration:.37,delay:.05})}render(){return m`
${this.viewTemplate()}
`}};Bt.styles=[_.globalCss,ls],Fe([j()],Bt.prototype,"view",2),Fe([j()],Bt.prototype,"prevView",2),Bt=Fe([O("wcm-modal-router")],Bt);const hs=M`div{height:36px;width:max-content;display:flex;justify-content:center;align-items:center;padding:9px 15px 11px;position:absolute;top:12px;box-shadow:0 6px 14px -6px rgba(10,16,31,.3),0 10px 32px -4px rgba(10,16,31,.15);z-index:2;left:50%;transform:translateX(-50%);pointer-events:none;backdrop-filter:blur(20px) saturate(1.8);-webkit-backdrop-filter:blur(20px) saturate(1.8);border-radius:var(--wcm-notification-border-radius);border:1px solid var(--wcm-color-overlay);background-color:var(--wcm-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--wcm-color-bg-3)}}.wcm-success path{fill:var(--wcm-accent-color)}.wcm-error path{fill:var(--wcm-error-color)}`;var us=Object.defineProperty,ms=Object.getOwnPropertyDescriptor,Yr=(e,t,r,n)=>{for(var o=n>1?void 0:n?ms(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&us(t,r,o),o};let re=class extends A{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=ot.subscribe(e=>{e.open?(this.open=!0,this.timeout=setTimeout(()=>ot.closeToast(),2200)):(this.open=!1,clearTimeout(this.timeout))})}disconnectedCallback(){var e;(e=this.unsubscribe)==null||e.call(this),clearTimeout(this.timeout),ot.closeToast()}render(){const{message:e,variant:t}=ot.state,r={"wcm-success":t==="success","wcm-error":t==="error"};return this.open?m`
${t==="success"?S.CHECKMARK_ICON:null} ${t==="error"?S.CROSS_ICON:null}${e}
`:null}};re.styles=[_.globalCss,hs],Yr([j()],re.prototype,"open",2),re=Yr([O("wcm-modal-toast")],re);const gs=.1,Jr=2.5,J=7;function Ze(e,t,r){return e===t?!1:(e-t<0?t-e:e-t)<=r+gs}function fs(e,t){const r=Array.prototype.slice.call(Gt.create(e,{errorCorrectionLevel:t}).modules.data,0),n=Math.sqrt(r.length);return r.reduce((o,i,s)=>(s%n===0?o.push([i]):o[o.length-1].push(i))&&o,[])}const ps={generate(e,t,r){const n="#141414",o="#ffffff",i=[],s=fs(e,"Q"),a=t/s.length,l=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];l.forEach(({x:p,y:g})=>{const $=(s.length-J)*a*p,f=(s.length-J)*a*g,y=.45;for(let v=0;v`)}});const c=Math.floor((r+25)/a),d=s.length/2-c/2,b=s.length/2+c/2-1,h=[];s.forEach((p,g)=>{p.forEach(($,f)=>{if(s[g][f]&&!(gs.length-(J+1)&&fs.length-(J+1))&&!(g>d&&gd&&f{u[p]?u[p].push(g):u[p]=[g]}),Object.entries(u).map(([p,g])=>{const $=g.filter(f=>g.every(y=>!Ze(f,y,a)));return[Number(p),$]}).forEach(([p,g])=>{g.forEach($=>{i.push(L``)})}),Object.entries(u).filter(([p,g])=>g.length>1).map(([p,g])=>{const $=g.filter(f=>g.some(y=>Ze(f,y,a)));return[Number(p),$]}).map(([p,g])=>{g.sort((f,y)=>fv.some(w=>Ze(f,w,a)));y?y.push(f):$.push([f])}return[p,$.map(f=>[f[0],f[f.length-1]])]}).forEach(([p,g])=>{g.forEach(([$,f])=>{i.push(L``)})}),i}},ws=M`@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}div{position:relative;user-select:none;display:block;overflow:hidden;aspect-ratio:1/1;animation:fadeIn ease .2s}.wcm-dark{background-color:#fff;border-radius:var(--wcm-container-border-radius);padding:18px;box-shadow:0 2px 5px #000}svg:first-child,wcm-wallet-image{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{width:25%;height:25%;border-radius:var(--wcm-wallet-icon-border-radius)}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--wcm-accent-color)}svg:first-child path:last-child{stroke:var(--wcm-color-overlay)}`;var vs=Object.defineProperty,bs=Object.getOwnPropertyDescriptor,vt=(e,t,r,n)=>{for(var o=n>1?void 0:n?bs(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&vs(t,r,o),o};let X=class extends A{constructor(){super(...arguments),this.uri="",this.size=0,this.imageId=void 0,this.walletId=void 0,this.imageUrl=void 0}svgTemplate(){const e=_t.state.themeMode==="light"?this.size:this.size-36;return L`${ps.generate(this.uri,e,e/4)}`}render(){const e={"wcm-dark":_t.state.themeMode==="dark"};return m`
${this.walletId||this.imageUrl?m``:S.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}
`}};X.styles=[_.globalCss,ws],vt([C()],X.prototype,"uri",2),vt([C({type:Number})],X.prototype,"size",2),vt([C()],X.prototype,"imageId",2),vt([C()],X.prototype,"walletId",2),vt([C()],X.prototype,"imageUrl",2),X=vt([O("wcm-qrcode")],X);const ys=M`:host{position:relative;height:28px;width:80%}input{width:100%;height:100%;line-height:28px!important;border-radius:var(--wcm-input-border-radius);font-style:normal;font-family:-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,Ubuntu,'Helvetica Neue',sans-serif;font-feature-settings:'case' on;font-weight:500;font-size:16px;letter-spacing:-.03em;padding:0 10px 0 34px;transition:.2s all ease;color:var(--wcm-color-fg-1);background-color:var(--wcm-color-bg-3);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay);caret-color:var(--wcm-accent-color)}input::placeholder{color:var(--wcm-color-fg-2)}svg{left:10px;top:4px;pointer-events:none;position:absolute;width:20px;height:20px}input:focus-within{box-shadow:inset 0 0 0 1px var(--wcm-accent-color)}path{fill:var(--wcm-color-fg-2)}`;var xs=Object.defineProperty,$s=Object.getOwnPropertyDescriptor,Gr=(e,t,r,n)=>{for(var o=n>1?void 0:n?$s(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&xs(t,r,o),o};let oe=class extends A{constructor(){super(...arguments),this.onChange=()=>null}render(){return m` ${S.SEARCH_ICON}`}};oe.styles=[_.globalCss,ys],Gr([C()],oe.prototype,"onChange",2),oe=Gr([O("wcm-search-input")],oe);const Cs=M`@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}svg{animation:rotate 2s linear infinite;display:flex;justify-content:center;align-items:center}svg circle{stroke-linecap:round;animation:dash 1.5s ease infinite;stroke:var(--wcm-accent-color)}`;var Es=Object.defineProperty,As=Object.getOwnPropertyDescriptor,_s=(e,t,r,n)=>{for(var o=n>1?void 0:n?As(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Es(t,r,o),o};let Ve=class extends A{render(){return m``}};Ve.styles=[_.globalCss,Cs],Ve=_s([O("wcm-spinner")],Ve);const Os=M`span{font-style:normal;font-family:var(--wcm-font-family);font-feature-settings:var(--wcm-font-feature-settings)}.wcm-xsmall-bold{font-family:var(--wcm-text-xsmall-bold-font-family);font-weight:var(--wcm-text-xsmall-bold-weight);font-size:var(--wcm-text-xsmall-bold-size);line-height:var(--wcm-text-xsmall-bold-line-height);letter-spacing:var(--wcm-text-xsmall-bold-letter-spacing);text-transform:var(--wcm-text-xsmall-bold-text-transform)}.wcm-xsmall-regular{font-family:var(--wcm-text-xsmall-regular-font-family);font-weight:var(--wcm-text-xsmall-regular-weight);font-size:var(--wcm-text-xsmall-regular-size);line-height:var(--wcm-text-xsmall-regular-line-height);letter-spacing:var(--wcm-text-xsmall-regular-letter-spacing);text-transform:var(--wcm-text-xsmall-regular-text-transform)}.wcm-small-thin{font-family:var(--wcm-text-small-thin-font-family);font-weight:var(--wcm-text-small-thin-weight);font-size:var(--wcm-text-small-thin-size);line-height:var(--wcm-text-small-thin-line-height);letter-spacing:var(--wcm-text-small-thin-letter-spacing);text-transform:var(--wcm-text-small-thin-text-transform)}.wcm-small-regular{font-family:var(--wcm-text-small-regular-font-family);font-weight:var(--wcm-text-small-regular-weight);font-size:var(--wcm-text-small-regular-size);line-height:var(--wcm-text-small-regular-line-height);letter-spacing:var(--wcm-text-small-regular-letter-spacing);text-transform:var(--wcm-text-small-regular-text-transform)}.wcm-medium-regular{font-family:var(--wcm-text-medium-regular-font-family);font-weight:var(--wcm-text-medium-regular-weight);font-size:var(--wcm-text-medium-regular-size);line-height:var(--wcm-text-medium-regular-line-height);letter-spacing:var(--wcm-text-medium-regular-letter-spacing);text-transform:var(--wcm-text-medium-regular-text-transform)}.wcm-big-bold{font-family:var(--wcm-text-big-bold-font-family);font-weight:var(--wcm-text-big-bold-weight);font-size:var(--wcm-text-big-bold-size);line-height:var(--wcm-text-big-bold-line-height);letter-spacing:var(--wcm-text-big-bold-letter-spacing);text-transform:var(--wcm-text-big-bold-text-transform)}:host(*){color:var(--wcm-color-fg-1)}.wcm-color-primary{color:var(--wcm-color-fg-1)}.wcm-color-secondary{color:var(--wcm-color-fg-2)}.wcm-color-tertiary{color:var(--wcm-color-fg-3)}.wcm-color-inverse{color:var(--wcm-accent-fill-color)}.wcm-color-accnt{color:var(--wcm-accent-color)}.wcm-color-error{color:var(--wcm-error-color)}`;var ks=Object.defineProperty,Is=Object.getOwnPropertyDescriptor,Ke=(e,t,r,n)=>{for(var o=n>1?void 0:n?Is(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&ks(t,r,o),o};let Dt=class extends A{constructor(){super(...arguments),this.variant="medium-regular",this.color="primary"}render(){const e={"wcm-big-bold":this.variant==="big-bold","wcm-medium-regular":this.variant==="medium-regular","wcm-small-regular":this.variant==="small-regular","wcm-small-thin":this.variant==="small-thin","wcm-xsmall-regular":this.variant==="xsmall-regular","wcm-xsmall-bold":this.variant==="xsmall-bold","wcm-color-primary":this.color==="primary","wcm-color-secondary":this.color==="secondary","wcm-color-tertiary":this.color==="tertiary","wcm-color-inverse":this.color==="inverse","wcm-color-accnt":this.color==="accent","wcm-color-error":this.color==="error"};return m``}};Dt.styles=[_.globalCss,Os],Ke([C()],Dt.prototype,"variant",2),Ke([C()],Dt.prototype,"color",2),Dt=Ke([O("wcm-text")],Dt);const Ts=M`button{width:100%;height:100%;border-radius:var(--wcm-button-hover-highlight-border-radius);display:flex;align-items:flex-start}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}wcm-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}wcm-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:var(--wcm-wallet-icon-border-radius);margin-bottom:5px}.wcm-sublabel{margin-top:2px}`;var Ps=Object.defineProperty,Ms=Object.getOwnPropertyDescriptor,tt=(e,t,r,n)=>{for(var o=n>1?void 0:n?Ms(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Ps(t,r,o),o};let K=class extends A{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.walletId="",this.label=void 0,this.imageId=void 0,this.installed=!1,this.recent=!1}sublabelTemplate(){return this.recent?m`RECENT`:this.installed?m`INSTALLED`:null}handleClick(){Do.click({name:"WALLET_BUTTON",walletId:this.walletId}),this.onClick()}render(){var e;return m``}};K.styles=[_.globalCss,Ts],tt([C()],K.prototype,"onClick",2),tt([C()],K.prototype,"name",2),tt([C()],K.prototype,"walletId",2),tt([C()],K.prototype,"label",2),tt([C()],K.prototype,"imageId",2),tt([C({type:Boolean})],K.prototype,"installed",2),tt([C({type:Boolean})],K.prototype,"recent",2),K=tt([O("wcm-wallet-button")],K);const Ss=M`:host{display:block}div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%;background-color:var(--wcm-color-overlay)}svg{position:relative;width:100%;height:100%}div::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;border-radius:inherit;border:1px solid var(--wcm-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var Rs=Object.defineProperty,Ls=Object.getOwnPropertyDescriptor,ne=(e,t,r,n)=>{for(var o=n>1?void 0:n?Ls(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Rs(t,r,o),o};let bt=class extends A{constructor(){super(...arguments),this.walletId="",this.imageId=void 0,this.imageUrl=void 0}render(){var e;const t=(e=this.imageUrl)!=null&&e.length?this.imageUrl:x.getWalletIcon({id:this.walletId,image_id:this.imageId});return m`${t.length?m`
${this.id}
`:S.WALLET_PLACEHOLDER}`}};bt.styles=[_.globalCss,Ss],ne([C()],bt.prototype,"walletId",2),ne([C()],bt.prototype,"imageId",2),ne([C()],bt.prototype,"imageUrl",2),bt=ne([O("wcm-wallet-image")],bt);var Ns=Object.defineProperty,Bs=Object.getOwnPropertyDescriptor,Qr=(e,t,r,n)=>{for(var o=n>1?void 0:n?Bs(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Ns(t,r,o),o};let qe=class extends A{constructor(){super(),this.preload=!0,this.preloadData()}async loadImages(e){try{e!=null&&e.length&&await Promise.all(e.map(async t=>x.preloadImage(t)))}catch{console.info("Unsuccessful attempt at preloading some images",e)}}async preloadListings(){if(gt.state.enableExplorer){await U.getRecomendedWallets(),q.setIsDataLoaded(!0);const{recomendedWallets:e}=U.state,t=e.map(r=>x.getWalletIcon(r));await this.loadImages(t)}else q.setIsDataLoaded(!0)}async preloadCustomImages(){const e=x.getCustomImageUrls();await this.loadImages(e)}async preloadData(){try{this.preload&&(this.preload=!1,await Promise.all([this.preloadListings(),this.preloadCustomImages()]))}catch(e){console.error(e),ot.openToast("Failed preloading","error")}}};Qr([j()],qe.prototype,"preload",2),qe=Qr([O("wcm-explorer-context")],qe);var Ds=Object.defineProperty,Us=Object.getOwnPropertyDescriptor,js=(e,t,r,n)=>{for(var o=n>1?void 0:n?Us(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Ds(t,r,o),o};let Xr=class extends A{constructor(){super(),this.unsubscribeTheme=void 0,_.setTheme(),this.unsubscribeTheme=_t.subscribe(_.setTheme)}disconnectedCallback(){var e;(e=this.unsubscribeTheme)==null||e.call(this)}};Xr=js([O("wcm-theme-context")],Xr);const Ws=M`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 9),0,0)}}.wcm-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px;width:calc(100% + 40px)}.wcm-track{display:flex;width:calc(70px * 18);animation:scroll 20s linear infinite;opacity:.7}.wcm-track svg{margin:0 5px}wcm-wallet-image{width:60px;height:60px;margin:0 5px;border-radius:var(--wcm-wallet-icon-border-radius)}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-title{display:flex;align-items:center;margin-bottom:10px}.wcm-title svg{margin-right:6px}.wcm-title path{fill:var(--wcm-accent-color)}wcm-modal-footer .wcm-title{padding:0 10px}wcm-button-big{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);filter:drop-shadow(0 0 17px var(--wcm-color-bg-1))}wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-info-footer wcm-text{text-align:center;margin-bottom:15px}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var Hs=Object.defineProperty,zs=Object.getOwnPropertyDescriptor,Fs=(e,t,r,n)=>{for(var o=n>1?void 0:n?zs(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Hs(t,r,o),o};let Ye=class extends A{onGoToQrcode(){N.push("Qrcode")}render(){const{recomendedWallets:e}=U.state,t=[...e,...e],r=E.RECOMMENDED_WALLET_AMOUNT*2;return m`
${S.MOBILE_ICON}WalletConnect
${[...Array(r)].map((n,o)=>{const i=t[o%t.length];return i?m``:S.WALLET_PLACEHOLDER})}
Select Wallet
Choose WalletConnect to see supported apps on your device`}};Ye.styles=[_.globalCss,Ws],Ye=Fs([O("wcm-android-wallet-selection")],Ye);const Zs=M`@keyframes loading{to{stroke-dashoffset:0}}@keyframes shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(1px,0,0)}30%,50%,70%{transform:translate3d(-2px,0,0)}40%,60%{transform:translate3d(2px,0,0)}}:host{display:flex;flex-direction:column;align-items:center}div{position:relative;width:110px;height:110px;display:flex;justify-content:center;align-items:center;margin:40px 0 20px 0;transform:translate3d(0,0,0)}svg{position:absolute;width:110px;height:110px;fill:none;stroke:transparent;stroke-linecap:round;stroke-width:2px;top:0;left:0}use{stroke:var(--wcm-accent-color);animation:loading 1s linear infinite}wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:90px;height:90px}wcm-text{margin-bottom:40px}.wcm-error svg{stroke:var(--wcm-error-color)}.wcm-error use{display:none}.wcm-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}.wcm-stale svg,.wcm-stale use{display:none}`;var Vs=Object.defineProperty,Ks=Object.getOwnPropertyDescriptor,yt=(e,t,r,n)=>{for(var o=n>1?void 0:n?Ks(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Vs(t,r,o),o};let et=class extends A{constructor(){super(...arguments),this.walletId=void 0,this.imageId=void 0,this.isError=!1,this.isStale=!1,this.label=""}svgLoaderTemplate(){var e,t;const r=(t=(e=_t.state.themeVariables)==null?void 0:e["--wcm-wallet-icon-large-border-radius"])!=null?t:_.getPreset("--wcm-wallet-icon-large-border-radius");let n=0;r.includes("%")?n=88/100*parseInt(r,10):n=parseInt(r,10),n*=1.17;const o=317-n*1.57,i=425-n*1.8;return m``}render(){const e={"wcm-error":this.isError,"wcm-stale":this.isStale};return m`
${this.svgLoaderTemplate()}
${this.isError?"Connection declined":this.label}`}};et.styles=[_.globalCss,Zs],yt([C()],et.prototype,"walletId",2),yt([C()],et.prototype,"imageId",2),yt([C({type:Boolean})],et.prototype,"isError",2),yt([C({type:Boolean})],et.prototype,"isStale",2),yt([C()],et.prototype,"label",2),et=yt([O("wcm-connector-waiting")],et);const At={manualWallets(){var e,t;const{mobileWallets:r,desktopWallets:n}=gt.state,o=(e=At.recentWallet())==null?void 0:e.id,i=E.isMobile()?r:n,s=i==null?void 0:i.filter(a=>o!==a.id);return(t=E.isMobile()?s==null?void 0:s.map(({id:a,name:l,links:c})=>({id:a,name:l,mobile:c,links:c})):s==null?void 0:s.map(({id:a,name:l,links:c})=>({id:a,name:l,desktop:c,links:c})))!=null?t:[]},recentWallet(){return x.getRecentWallet()},recomendedWallets(e=!1){var t;const r=e||(t=At.recentWallet())==null?void 0:t.id,{recomendedWallets:n}=U.state;return n.filter(o=>r!==o.id)}},st={onConnecting(e){x.goToConnectingView(e)},manualWalletsTemplate(){return At.manualWallets().map(e=>m``)},recomendedWalletsTemplate(e=!1){return At.recomendedWallets(e).map(t=>m``)},recentWalletTemplate(){const e=At.recentWallet();if(e)return m``}},qs=M`.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-desktop-title,.wcm-mobile-title{display:flex;align-items:center}.wcm-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.wcm-desktop-title{margin-bottom:10px;padding:0 10px}.wcm-subtitle{display:flex;align-items:center}.wcm-subtitle:last-child path{fill:var(--wcm-color-fg-3)}.wcm-desktop-title svg,.wcm-mobile-title svg{margin-right:6px}.wcm-desktop-title path,.wcm-mobile-title path{fill:var(--wcm-accent-color)}`;var Ys=Object.defineProperty,Js=Object.getOwnPropertyDescriptor,Gs=(e,t,r,n)=>{for(var o=n>1?void 0:n?Js(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Ys(t,r,o),o};let Je=class extends A{render(){const{explorerExcludedWalletIds:e,enableExplorer:t}=gt.state,r=e!=="ALL"&&t,n=st.manualWalletsTemplate(),o=st.recomendedWalletsTemplate();let i=[st.recentWalletTemplate(),...n,...o];i=i.filter(Boolean);const s=i.length>4||r;let a=[];s?a=i.slice(0,3):a=i;const l=!!a.length;return m`
${S.MOBILE_ICON}Mobile
${S.SCAN_ICON}Scan with your wallet
${l?m`
${S.DESKTOP_ICON}Desktop
${a} ${s?m``:null}
`:null}`}};Je.styles=[_.globalCss,qs],Je=Gs([O("wcm-desktop-wallet-selection")],Je);const Qs=M`div{background-color:var(--wcm-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--wcm-color-bg-3);text-align:center}a{color:var(--wcm-accent-color);text-decoration:none;transition:opacity .2s ease-in-out;display:inline}a:active{opacity:.8}@media(hover:hover){a:hover{opacity:.8}}`;var Xs=Object.defineProperty,ta=Object.getOwnPropertyDescriptor,ea=(e,t,r,n)=>{for(var o=n>1?void 0:n?ta(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Xs(t,r,o),o};let Ge=class extends A{render(){const{termsOfServiceUrl:e,privacyPolicyUrl:t}=gt.state;return e??t?m`
By connecting your wallet to this app, you agree to the app's ${e?m`Terms of Service`:null} ${e&&t?"and":null} ${t?m`Privacy Policy`:null}
`:null}};Ge.styles=[_.globalCss,Qs],Ge=ea([O("wcm-legal-notice")],Ge);const ra=M`div{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;var oa=Object.defineProperty,na=Object.getOwnPropertyDescriptor,ia=(e,t,r,n)=>{for(var o=n>1?void 0:n?na(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&oa(t,r,o),o};let Qe=class extends A{onQrcode(){N.push("Qrcode")}render(){const{explorerExcludedWalletIds:e,enableExplorer:t}=gt.state,r=e!=="ALL"&&t,n=st.manualWalletsTemplate(),o=st.recomendedWalletsTemplate();let i=[st.recentWalletTemplate(),...n,...o];i=i.filter(Boolean);const s=i.length>8||r;let a=[];s?a=i.slice(0,7):a=i;const l=!!a.length;return m`${l?m`
${a} ${s?m``:null}
`:null}`}};Qe.styles=[_.globalCss,ra],Qe=ia([O("wcm-mobile-wallet-selection")],Qe);const sa=M`:host{all:initial}.wcm-overlay{top:0;bottom:0;left:0;right:0;position:fixed;z-index:var(--wcm-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;opacity:0;pointer-events:none;background-color:var(--wcm-overlay-background-color);backdrop-filter:var(--wcm-overlay-backdrop-filter)}@media(max-height:720px) and (orientation:landscape){.wcm-overlay{overflow:scroll;align-items:flex-start;padding:20px 0}}.wcm-active{pointer-events:auto}.wcm-container{position:relative;max-width:360px;width:100%;outline:0;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) var(--wcm-container-border-radius) var(--wcm-container-border-radius);border:1px solid var(--wcm-color-overlay);overflow:hidden}.wcm-card{width:100%;position:relative;border-radius:var(--wcm-container-border-radius);overflow:hidden;box-shadow:0 6px 14px -6px rgba(10,16,31,.12),0 10px 32px -4px rgba(10,16,31,.1),0 0 0 1px var(--wcm-color-overlay);background-color:var(--wcm-color-bg-1);color:var(--wcm-color-fg-1)}@media(max-width:600px){.wcm-container{max-width:440px;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) 0 0}.wcm-card{border-radius:var(--wcm-container-border-radius) var(--wcm-container-border-radius) 0 0}.wcm-overlay{align-items:flex-end}}@media(max-width:440px){.wcm-container{border:0}}`;var aa=Object.defineProperty,la=Object.getOwnPropertyDescriptor,Xe=(e,t,r,n)=>{for(var o=n>1?void 0:n?la(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&aa(t,r,o),o};let Ut=class extends A{constructor(){super(),this.open=!1,this.active=!1,this.unsubscribeModal=void 0,this.abortController=void 0,this.unsubscribeModal=ce.subscribe(e=>{e.open?this.onOpenModalEvent():this.onCloseModalEvent()})}disconnectedCallback(){var e;(e=this.unsubscribeModal)==null||e.call(this)}get overlayEl(){return x.getShadowRootElement(this,".wcm-overlay")}get containerEl(){return x.getShadowRootElement(this,".wcm-container")}toggleBodyScroll(e){if(document.querySelector("body"))if(e){const t=document.getElementById("wcm-styles");t==null||t.remove()}else document.head.insertAdjacentHTML("beforeend",'')}onCloseModal(e){e.target===e.currentTarget&&ce.close()}onOpenModalEvent(){this.toggleBodyScroll(!1),this.addKeyboardEvents(),this.open=!0,setTimeout(async()=>{const e=x.isMobileAnimation()?{y:["50vh","0vh"]}:{scale:[.98,1]},t=.1,r=.2;await Promise.all([mt(this.overlayEl,{opacity:[0,1]},{delay:t,duration:r}).finished,mt(this.containerEl,e,{delay:t,duration:r}).finished]),this.active=!0},0)}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents();const e=x.isMobileAnimation()?{y:["0vh","50vh"]}:{scale:[1,.98]},t=.2;await Promise.all([mt(this.overlayEl,{opacity:[1,0]},{duration:t}).finished,mt(this.containerEl,e,{duration:t}).finished]),this.containerEl.removeAttribute("style"),this.active=!1,this.open=!1}addKeyboardEvents(){this.abortController=new AbortController,window.addEventListener("keydown",e=>{var t;e.key==="Escape"?ce.close():e.key==="Tab"&&((t=e.target)!=null&&t.tagName.includes("wcm-")||this.containerEl.focus())},this.abortController),this.containerEl.focus()}removeKeyboardEvents(){var e;(e=this.abortController)==null||e.abort(),this.abortController=void 0}render(){const e={"wcm-overlay":!0,"wcm-active":this.active};return m`
${this.open?m`
`:null}
`}};Ut.styles=[_.globalCss,sa],Xe([j()],Ut.prototype,"open",2),Xe([j()],Ut.prototype,"active",2),Ut=Xe([O("wcm-modal")],Ut);const ca=M`div{display:flex;margin-top:15px}slot{display:inline-block;margin:0 5px}wcm-button{margin:0 5px}`;var da=Object.defineProperty,ha=Object.getOwnPropertyDescriptor,jt=(e,t,r,n)=>{for(var o=n>1?void 0:n?ha(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&da(t,r,o),o};let dt=class extends A{constructor(){super(...arguments),this.isMobile=!1,this.isDesktop=!1,this.isWeb=!1,this.isRetry=!1}onMobile(){E.isMobile()?N.replace("MobileConnecting"):N.replace("MobileQrcodeConnecting")}onDesktop(){N.replace("DesktopConnecting")}onWeb(){N.replace("WebConnecting")}render(){return m`
${this.isRetry?m``:null} ${this.isMobile?m`Mobile`:null} ${this.isDesktop?m`Desktop`:null} ${this.isWeb?m`Web`:null}
`}};dt.styles=[_.globalCss,ca],jt([C({type:Boolean})],dt.prototype,"isMobile",2),jt([C({type:Boolean})],dt.prototype,"isDesktop",2),jt([C({type:Boolean})],dt.prototype,"isWeb",2),jt([C({type:Boolean})],dt.prototype,"isRetry",2),dt=jt([O("wcm-platform-selection")],dt);const ua=M`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:var(--wcm-button-hover-highlight-border-radius);height:100%;justify-content:flex-start}.wcm-icons{width:60px;height:60px;display:flex;flex-wrap:wrap;padding:7px;border-radius:var(--wcm-wallet-icon-border-radius);justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--wcm-color-bg-2);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}.wcm-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:calc(var(--wcm-wallet-icon-border-radius)/ 2);border:1px solid var(--wcm-color-overlay)}.wcm-icons svg{width:21px;height:21px}.wcm-icons img:nth-child(1),.wcm-icons img:nth-child(2),.wcm-icons svg:nth-child(1),.wcm-icons svg:nth-child(2){margin-bottom:4px}wcm-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var ma=Object.defineProperty,ga=Object.getOwnPropertyDescriptor,fa=(e,t,r,n)=>{for(var o=n>1?void 0:n?ga(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&ma(t,r,o),o};let tr=class extends A{onClick(){N.push("WalletExplorer")}render(){const{recomendedWallets:e}=U.state,t=At.manualWallets(),r=[...e,...t].reverse().slice(0,4);return m``}};tr.styles=[_.globalCss,ua],tr=fa([O("wcm-view-all-wallets-button")],tr);const pa=M`.wcm-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var wa=Object.defineProperty,va=Object.getOwnPropertyDescriptor,ie=(e,t,r,n)=>{for(var o=n>1?void 0:n?va(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&wa(t,r,o),o};let xt=class extends A{constructor(){super(),this.walletId="",this.imageId="",this.uri="",setTimeout(()=>{const{walletConnectUri:e}=q.state;this.uri=e},0)}get overlayEl(){return x.getShadowRootElement(this,".wcm-qr-container")}render(){return m`
${this.uri?m``:m``}
`}};xt.styles=[_.globalCss,pa],ie([C()],xt.prototype,"walletId",2),ie([C()],xt.prototype,"imageId",2),ie([j()],xt.prototype,"uri",2),xt=ie([O("wcm-walletconnect-qr")],xt);var ba=Object.defineProperty,ya=Object.getOwnPropertyDescriptor,xa=(e,t,r,n)=>{for(var o=n>1?void 0:n?ya(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&ba(t,r,o),o};let er=class extends A{viewTemplate(){return E.isAndroid()?m``:E.isMobile()?m``:m``}render(){return m`${this.viewTemplate()}`}};er.styles=[_.globalCss],er=xa([O("wcm-connect-wallet-view")],er);const $a=M`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var Ca=Object.defineProperty,Ea=Object.getOwnPropertyDescriptor,to=(e,t,r,n)=>{for(var o=n>1?void 0:n?Ea(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Ca(t,r,o),o};let se=class extends A{constructor(){super(),this.isError=!1,this.openDesktopApp()}onFormatAndRedirect(e){const{desktop:t,name:r}=E.getWalletRouterData(),n=t==null?void 0:t.native;if(n){const o=E.formatNativeUrl(n,e,r);E.openHref(o,"_self")}}openDesktopApp(){const{walletConnectUri:e}=q.state,t=E.getWalletRouterData();x.setRecentWallet(t),e&&this.onFormatAndRedirect(e)}render(){const{name:e,id:t,image_id:r}=E.getWalletRouterData(),{isMobile:n,isWeb:o}=x.getCachedRouterWalletPlatforms();return m`${`Connection can continue loading if ${e} is not installed on your device`}Retry`}};se.styles=[_.globalCss,$a],to([j()],se.prototype,"isError",2),se=to([O("wcm-desktop-connecting-view")],se);const Aa=M`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}wcm-button{margin-top:15px}`;var _a=Object.defineProperty,Oa=Object.getOwnPropertyDescriptor,ka=(e,t,r,n)=>{for(var o=n>1?void 0:n?Oa(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&_a(t,r,o),o};let rr=class extends A{onInstall(e){e&&E.openHref(e,"_blank")}render(){const{name:e,id:t,image_id:r,homepage:n}=E.getWalletRouterData();return m`${`Download ${e} to continue. If multiple browser extensions are installed, disable non ${e} ones and try again`}Download`}};rr.styles=[_.globalCss,Aa],rr=ka([O("wcm-install-wallet-view")],rr);const Ia=M`wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:96px;height:96px;margin-bottom:20px}wcm-info-footer{display:flex;width:100%}.wcm-app-store{justify-content:space-between}.wcm-app-store wcm-wallet-image{margin-right:10px;margin-bottom:0;width:28px;height:28px;border-radius:var(--wcm-wallet-icon-small-border-radius)}.wcm-app-store div{display:flex;align-items:center}.wcm-app-store wcm-button{margin-right:-10px}.wcm-note{flex-direction:column;align-items:center;padding:5px 0}.wcm-note wcm-text{text-align:center}wcm-platform-selection{margin-top:-15px}.wcm-note wcm-text{margin-top:15px}.wcm-note wcm-text span{color:var(--wcm-accent-color)}`;var Ta=Object.defineProperty,Pa=Object.getOwnPropertyDescriptor,eo=(e,t,r,n)=>{for(var o=n>1?void 0:n?Pa(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Ta(t,r,o),o};let ae=class extends A{constructor(){super(),this.isError=!1,this.openMobileApp()}onFormatAndRedirect(e,t=!1){const{mobile:r,name:n}=E.getWalletRouterData(),o=r==null?void 0:r.native,i=r==null?void 0:r.universal;if(o&&!t){const s=E.formatNativeUrl(o,e,n);E.openHref(s,"_self")}else if(i){const s=E.formatUniversalUrl(i,e,n);E.openHref(s,"_self")}}openMobileApp(e=!1){const{walletConnectUri:t}=q.state,r=E.getWalletRouterData();x.setRecentWallet(r),t&&this.onFormatAndRedirect(t,e)}onGoToAppStore(e){e&&E.openHref(e,"_blank")}render(){const{name:e,id:t,image_id:r,app:n,mobile:o}=E.getWalletRouterData(),{isWeb:i}=x.getCachedRouterWalletPlatforms(),s=n==null?void 0:n.ios,a=o==null?void 0:o.universal;return m`Retry${a?m`Still doesn't work? Try this alternate link`:null}
${`Get ${e}`}
App Store
`}};ae.styles=[_.globalCss,Ia],eo([j()],ae.prototype,"isError",2),ae=eo([O("wcm-mobile-connecting-view")],ae);const Ma=M`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var Sa=Object.defineProperty,Ra=Object.getOwnPropertyDescriptor,La=(e,t,r,n)=>{for(var o=n>1?void 0:n?Ra(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Sa(t,r,o),o};let or=class extends A{render(){const{name:e,id:t,image_id:r}=E.getWalletRouterData(),{isDesktop:n,isWeb:o}=x.getCachedRouterWalletPlatforms();return m`${`Scan this QR Code with your phone's camera or inside ${e} app`}`}};or.styles=[_.globalCss,Ma],or=La([O("wcm-mobile-qr-connecting-view")],or);var Na=Object.defineProperty,Ba=Object.getOwnPropertyDescriptor,Da=(e,t,r,n)=>{for(var o=n>1?void 0:n?Ba(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Na(t,r,o),o};let nr=class extends A{render(){return m``}};nr.styles=[_.globalCss],nr=Da([O("wcm-qrcode-view")],nr);const Ua=M`wcm-modal-content{height:clamp(200px,60vh,600px);display:block;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px;padding-top:20px}wcm-modal-content::after,wcm-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}wcm-modal-content::before{box-shadow:0 -1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(var(--wcm-color-bg-1),rgba(255,255,255,0))}wcm-modal-content::after{box-shadow:0 1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--wcm-color-bg-1));top:calc(100% - 20px)}wcm-modal-content::-webkit-scrollbar{display:none}.wcm-placeholder-block{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.wcm-empty,.wcm-loading{display:flex}.wcm-loading .wcm-placeholder-block{height:100%}.wcm-end-reached .wcm-placeholder-block{height:0;opacity:0}.wcm-empty .wcm-placeholder-block{opacity:1;height:100%}wcm-wallet-button{margin:calc((100% - 60px)/ 3) 0}`;var ja=Object.defineProperty,Wa=Object.getOwnPropertyDescriptor,Wt=(e,t,r,n)=>{for(var o=n>1?void 0:n?Wa(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&ja(t,r,o),o};const ir=40;let ht=class extends A{constructor(){super(...arguments),this.loading=!U.state.wallets.listings.length,this.firstFetch=!U.state.wallets.listings.length,this.search="",this.endReached=!1,this.intersectionObserver=void 0,this.searchDebounce=x.debounce(e=>{e.length>=1?(this.firstFetch=!0,this.endReached=!1,this.search=e,U.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),U.resetSearch())})}firstUpdated(){this.createPaginationObserver()}disconnectedCallback(){var e;(e=this.intersectionObserver)==null||e.disconnect()}get placeholderEl(){return x.getShadowRootElement(this,".wcm-placeholder-block")}createPaginationObserver(){this.intersectionObserver=new IntersectionObserver(([e])=>{e.isIntersecting&&!(this.search&&this.firstFetch)&&this.fetchWallets()}),this.intersectionObserver.observe(this.placeholderEl)}isLastPage(){const{wallets:e,search:t}=U.state,{listings:r,total:n}=this.search?t:e;return n<=ir||r.length>=n}async fetchWallets(){var e;const{wallets:t,search:r}=U.state,{listings:n,total:o,page:i}=this.search?r:t;if(!this.endReached&&(this.firstFetch||o>ir&&n.lengthx.getWalletIcon(c));await Promise.all([...l.map(async c=>x.preloadImage(c)),E.wait(300)]),this.endReached=this.isLastPage()}catch(s){console.error(s),ot.openToast(x.getErrorMessage(s),"error")}finally{this.loading=!1,this.firstFetch=!1}}onConnect(e){E.isAndroid()?x.handleMobileLinking(e):x.goToConnectingView(e)}onSearchChange(e){const{value:t}=e.target;this.searchDebounce(t)}render(){const{wallets:e,search:t}=U.state,{listings:r}=this.search?t:e,n=this.loading&&!r.length,o=this.search.length>=3;let i=st.manualWalletsTemplate(),s=st.recomendedWalletsTemplate(!0);o&&(i=i.filter(({values:c})=>x.caseSafeIncludes(c[0],this.search)),s=s.filter(({values:c})=>x.caseSafeIncludes(c[0],this.search)));const a=!this.loading&&!r.length&&!s.length,l={"wcm-loading":n,"wcm-end-reached":this.endReached||!this.loading,"wcm-empty":a};return m`
${n?null:i} ${n?null:s} ${n?null:r.map(c=>m`${c?m``:null}`)}
${a?m`No results found`:null} ${!a&&this.loading?m``:null}
`}};ht.styles=[_.globalCss,Ua],Wt([j()],ht.prototype,"loading",2),Wt([j()],ht.prototype,"firstFetch",2),Wt([j()],ht.prototype,"search",2),Wt([j()],ht.prototype,"endReached",2),ht=Wt([O("wcm-wallet-explorer-view")],ht);const Ha=M`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var za=Object.defineProperty,Fa=Object.getOwnPropertyDescriptor,ro=(e,t,r,n)=>{for(var o=n>1?void 0:n?Fa(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&za(t,r,o),o};let le=class extends A{constructor(){super(),this.isError=!1,this.openWebWallet()}onFormatAndRedirect(e){const{desktop:t,name:r}=E.getWalletRouterData(),n=t==null?void 0:t.universal;if(n){const o=E.formatUniversalUrl(n,e,r);E.openHref(o,"_blank")}}openWebWallet(){const{walletConnectUri:e}=q.state,t=E.getWalletRouterData();x.setRecentWallet(t),e&&this.onFormatAndRedirect(e)}render(){const{name:e,id:t,image_id:r}=E.getWalletRouterData(),{isMobile:n,isDesktop:o}=x.getCachedRouterWalletPlatforms(),i=E.isMobile();return m`${`${e} web app has opened in a new tab. Go there, accept the connection, and come back`}Retry`}};le.styles=[_.globalCss,Ha],ro([j()],le.prototype,"isError",2),le=ro([O("wcm-web-connecting-view")],le);export{Ut as WcmModal,X as WcmQrCode}; diff --git a/assets/index-cc134824.js b/assets/index-cc134824.js deleted file mode 100644 index 34f41eb5..00000000 --- a/assets/index-cc134824.js +++ /dev/null @@ -1,6 +0,0 @@ -var Cr={},G={};G.byteLength=Lr;G.toByteArray=Mr;G.fromByteArray=Dr;var S=[],R=[],Sr=typeof Uint8Array<"u"?Uint8Array:Array,H="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var b=0,_r=H.length;b<_r;++b)S[b]=H[b],R[H.charCodeAt(b)]=b;R["-".charCodeAt(0)]=62;R["_".charCodeAt(0)]=63;function ur(p){var f=p.length;if(f%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var l=p.indexOf("=");l===-1&&(l=f);var x=l===f?0:4-l%4;return[l,x]}function Lr(p){var f=ur(p),l=f[0],x=f[1];return(l+x)*3/4-x}function Nr(p,f,l){return(f+l)*3/4-l}function Mr(p){var f,l=ur(p),x=l[0],y=l[1],a=new Sr(Nr(p,x,y)),c=0,o=y>0?x-4:x,B;for(B=0;B>16&255,a[c++]=f>>8&255,a[c++]=f&255;return y===2&&(f=R[p.charCodeAt(B)]<<2|R[p.charCodeAt(B+1)]>>4,a[c++]=f&255),y===1&&(f=R[p.charCodeAt(B)]<<10|R[p.charCodeAt(B+1)]<<4|R[p.charCodeAt(B+2)]>>2,a[c++]=f>>8&255,a[c++]=f&255),a}function kr(p){return S[p>>18&63]+S[p>>12&63]+S[p>>6&63]+S[p&63]}function br(p,f,l){for(var x,y=[],a=f;ao?o:c+a));return x===1?(f=p[l-1],y.push(S[f>>2]+S[f<<4&63]+"==")):x===2&&(f=(p[l-2]<<8)+p[l-1],y.push(S[f>>10]+S[f>>4&63]+S[f<<2&63]+"=")),y.join("")}var V={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */V.read=function(p,f,l,x,y){var a,c,o=y*8-x-1,B=(1<>1,I=-7,F=l?y-1:0,_=l?-1:1,A=p[f+F];for(F+=_,a=A&(1<<-I)-1,A>>=-I,I+=o;I>0;a=a*256+p[f+F],F+=_,I-=8);for(c=a&(1<<-I)-1,a>>=-I,I+=x;I>0;c=c*256+p[f+F],F+=_,I-=8);if(a===0)a=1-T;else{if(a===B)return c?NaN:(A?-1:1)*(1/0);c=c+Math.pow(2,x),a=a-T}return(A?-1:1)*c*Math.pow(2,a-x)};V.write=function(p,f,l,x,y,a){var c,o,B,T=a*8-y-1,I=(1<>1,_=y===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=x?0:a-1,D=x?1:-1,$=f<0||f===0&&1/f<0?1:0;for(f=Math.abs(f),isNaN(f)||f===1/0?(o=isNaN(f)?1:0,c=I):(c=Math.floor(Math.log(f)/Math.LN2),f*(B=Math.pow(2,-c))<1&&(c--,B*=2),c+F>=1?f+=_/B:f+=_*Math.pow(2,1-F),f*B>=2&&(c++,B/=2),c+F>=I?(o=0,c=I):c+F>=1?(o=(f*B-1)*Math.pow(2,y),c=c+F):(o=f*Math.pow(2,F-1)*Math.pow(2,y),c=0));y>=8;p[l+A]=o&255,A+=D,o/=256,y-=8);for(c=c<0;p[l+A]=c&255,A+=D,c/=256,T-=8);p[l+A-D]|=$*128};/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */(function(p){const f=G,l=V,x=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;p.Buffer=o,p.SlowBuffer=fr,p.INSPECT_MAX_BYTES=50;const y=2147483647;p.kMaxLength=y,o.TYPED_ARRAY_SUPPORT=a(),!o.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 a(){try{const i=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(i,r),i.foo()===42}catch{return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function c(i){if(i>y)throw new RangeError('The value "'+i+'" is invalid for option "size"');const r=new Uint8Array(i);return Object.setPrototypeOf(r,o.prototype),r}function o(i,r,t){if(typeof i=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return F(i)}return B(i,r,t)}o.poolSize=8192;function B(i,r,t){if(typeof i=="string")return _(i,r);if(ArrayBuffer.isView(i))return D(i);if(i==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i);if(C(i,ArrayBuffer)||i&&C(i.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(C(i,SharedArrayBuffer)||i&&C(i.buffer,SharedArrayBuffer)))return $(i,r,t);if(typeof i=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const n=i.valueOf&&i.valueOf();if(n!=null&&n!==i)return o.from(n,r,t);const e=hr(i);if(e)return e;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof i[Symbol.toPrimitive]=="function")return o.from(i[Symbol.toPrimitive]("string"),r,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i)}o.from=function(i,r,t){return B(i,r,t)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function T(i){if(typeof i!="number")throw new TypeError('"size" argument must be of type number');if(i<0)throw new RangeError('The value "'+i+'" is invalid for option "size"')}function I(i,r,t){return T(i),i<=0?c(i):r!==void 0?typeof t=="string"?c(i).fill(r,t):c(i).fill(r):c(i)}o.alloc=function(i,r,t){return I(i,r,t)};function F(i){return T(i),c(i<0?0:Y(i)|0)}o.allocUnsafe=function(i){return F(i)},o.allocUnsafeSlow=function(i){return F(i)};function _(i,r){if((typeof r!="string"||r==="")&&(r="utf8"),!o.isEncoding(r))throw new TypeError("Unknown encoding: "+r);const t=X(i,r)|0;let n=c(t);const e=n.write(i,r);return e!==t&&(n=n.slice(0,e)),n}function A(i){const r=i.length<0?0:Y(i.length)|0,t=c(r);for(let n=0;n=y)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+y.toString(16)+" bytes");return i|0}function fr(i){return+i!=i&&(i=0),o.alloc(+i)}o.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==o.prototype},o.compare=function(r,t){if(C(r,Uint8Array)&&(r=o.from(r,r.offset,r.byteLength)),C(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(r)||!o.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===t)return 0;let n=r.length,e=t.length;for(let u=0,h=Math.min(n,e);ue.length?(o.isBuffer(h)||(h=o.from(h)),h.copy(e,u)):Uint8Array.prototype.set.call(e,h,u);else if(o.isBuffer(h))h.copy(e,u);else throw new TypeError('"list" argument must be an Array of Buffers');u+=h.length}return e};function X(i,r){if(o.isBuffer(i))return i.length;if(ArrayBuffer.isView(i)||C(i,ArrayBuffer))return i.byteLength;if(typeof i!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof i);const t=i.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&t===0)return 0;let e=!1;for(;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return j(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return or(i).length;default:if(e)return n?-1:j(i).length;r=(""+r).toLowerCase(),e=!0}}o.byteLength=X;function cr(i,r,t){let n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return"";for(i||(i="utf8");;)switch(i){case"hex":return dr(this,r,t);case"utf8":case"utf-8":return K(this,r,t);case"ascii":return Br(this,r,t);case"latin1":case"binary":return Er(this,r,t);case"base64":return wr(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return gr(this,r,t);default:if(n)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),n=!0}}o.prototype._isBuffer=!0;function N(i,r,t){const n=i[r];i[r]=i[t],i[t]=n}o.prototype.swap16=function(){const r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tt&&(r+=" ... "),""},x&&(o.prototype[x]=o.prototype.inspect),o.prototype.compare=function(r,t,n,e,u){if(C(r,Uint8Array)&&(r=o.from(r,r.offset,r.byteLength)),!o.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(t===void 0&&(t=0),n===void 0&&(n=r?r.length:0),e===void 0&&(e=0),u===void 0&&(u=this.length),t<0||n>r.length||e<0||u>this.length)throw new RangeError("out of range index");if(e>=u&&t>=n)return 0;if(e>=u)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,e>>>=0,u>>>=0,this===r)return 0;let h=u-e,s=n-t;const d=Math.min(h,s),E=this.slice(e,u),g=r.slice(t,n);for(let w=0;w2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,q(t)&&(t=e?0:i.length-1),t<0&&(t=i.length+t),t>=i.length){if(e)return-1;t=i.length-1}else if(t<0)if(e)t=0;else return-1;if(typeof r=="string"&&(r=o.from(r,n)),o.isBuffer(r))return r.length===0?-1:z(i,r,t,n,e);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?e?Uint8Array.prototype.indexOf.call(i,r,t):Uint8Array.prototype.lastIndexOf.call(i,r,t):z(i,[r],t,n,e);throw new TypeError("val must be string, number or Buffer")}function z(i,r,t,n,e){let u=1,h=i.length,s=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(i.length<2||r.length<2)return-1;u=2,h/=2,s/=2,t/=2}function d(g,w){return u===1?g[w]:g.readUInt16BE(w*u)}let E;if(e){let g=-1;for(E=t;Eh&&(t=h-s),E=t;E>=0;E--){let g=!0;for(let w=0;we&&(n=e)):n=e;const u=r.length;n>u/2&&(n=u/2);let h;for(h=0;h>>0,isFinite(n)?(n=n>>>0,e===void 0&&(e="utf8")):(e=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const u=this.length-t;if((n===void 0||n>u)&&(n=u),r.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");e||(e="utf8");let h=!1;for(;;)switch(e){case"hex":return pr(this,r,t,n);case"utf8":case"utf-8":return sr(this,r,t,n);case"ascii":case"latin1":case"binary":return lr(this,r,t,n);case"base64":return ar(this,r,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return yr(this,r,t,n);default:if(h)throw new TypeError("Unknown encoding: "+e);e=(""+e).toLowerCase(),h=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function wr(i,r,t){return r===0&&t===i.length?f.fromByteArray(i):f.fromByteArray(i.slice(r,t))}function K(i,r,t){t=Math.min(i.length,t);const n=[];let e=r;for(;e239?4:u>223?3:u>191?2:1;if(e+s<=t){let d,E,g,w;switch(s){case 1:u<128&&(h=u);break;case 2:d=i[e+1],(d&192)===128&&(w=(u&31)<<6|d&63,w>127&&(h=w));break;case 3:d=i[e+1],E=i[e+2],(d&192)===128&&(E&192)===128&&(w=(u&15)<<12|(d&63)<<6|E&63,w>2047&&(w<55296||w>57343)&&(h=w));break;case 4:d=i[e+1],E=i[e+2],g=i[e+3],(d&192)===128&&(E&192)===128&&(g&192)===128&&(w=(u&15)<<18|(d&63)<<12|(E&63)<<6|g&63,w>65535&&w<1114112&&(h=w))}}h===null?(h=65533,s=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|h&1023),n.push(h),e+=s}return xr(n)}const Z=4096;function xr(i){const r=i.length;if(r<=Z)return String.fromCharCode.apply(String,i);let t="",n=0;for(;nn)&&(t=n);let e="";for(let u=r;un&&(r=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),tt)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(r,t,n){r=r>>>0,t=t>>>0,n||m(r,t,this.length);let e=this[r],u=1,h=0;for(;++h>>0,t=t>>>0,n||m(r,t,this.length);let e=this[r+--t],u=1;for(;t>0&&(u*=256);)e+=this[r+--t]*u;return e},o.prototype.readUint8=o.prototype.readUInt8=function(r,t){return r=r>>>0,t||m(r,1,this.length),this[r]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(r,t){return r=r>>>0,t||m(r,2,this.length),this[r]|this[r+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(r,t){return r=r>>>0,t||m(r,2,this.length),this[r]<<8|this[r+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(r,t){return r=r>>>0,t||m(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(r,t){return r=r>>>0,t||m(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])},o.prototype.readBigUInt64LE=L(function(r){r=r>>>0,k(r,"offset");const t=this[r],n=this[r+7];(t===void 0||n===void 0)&&P(r,this.length-8);const e=t+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24,u=this[++r]+this[++r]*2**8+this[++r]*2**16+n*2**24;return BigInt(e)+(BigInt(u)<>>0,k(r,"offset");const t=this[r],n=this[r+7];(t===void 0||n===void 0)&&P(r,this.length-8);const e=t*2**24+this[++r]*2**16+this[++r]*2**8+this[++r],u=this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+n;return(BigInt(e)<>>0,t=t>>>0,n||m(r,t,this.length);let e=this[r],u=1,h=0;for(;++h=u&&(e-=Math.pow(2,8*t)),e},o.prototype.readIntBE=function(r,t,n){r=r>>>0,t=t>>>0,n||m(r,t,this.length);let e=t,u=1,h=this[r+--e];for(;e>0&&(u*=256);)h+=this[r+--e]*u;return u*=128,h>=u&&(h-=Math.pow(2,8*t)),h},o.prototype.readInt8=function(r,t){return r=r>>>0,t||m(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]},o.prototype.readInt16LE=function(r,t){r=r>>>0,t||m(r,2,this.length);const n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n},o.prototype.readInt16BE=function(r,t){r=r>>>0,t||m(r,2,this.length);const n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n},o.prototype.readInt32LE=function(r,t){return r=r>>>0,t||m(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24},o.prototype.readInt32BE=function(r,t){return r=r>>>0,t||m(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]},o.prototype.readBigInt64LE=L(function(r){r=r>>>0,k(r,"offset");const t=this[r],n=this[r+7];(t===void 0||n===void 0)&&P(r,this.length-8);const e=this[r+4]+this[r+5]*2**8+this[r+6]*2**16+(n<<24);return(BigInt(e)<>>0,k(r,"offset");const t=this[r],n=this[r+7];(t===void 0||n===void 0)&&P(r,this.length-8);const e=(t<<24)+this[++r]*2**16+this[++r]*2**8+this[++r];return(BigInt(e)<>>0,t||m(r,4,this.length),l.read(this,r,!0,23,4)},o.prototype.readFloatBE=function(r,t){return r=r>>>0,t||m(r,4,this.length),l.read(this,r,!1,23,4)},o.prototype.readDoubleLE=function(r,t){return r=r>>>0,t||m(r,8,this.length),l.read(this,r,!0,52,8)},o.prototype.readDoubleBE=function(r,t){return r=r>>>0,t||m(r,8,this.length),l.read(this,r,!1,52,8)};function U(i,r,t,n,e,u){if(!o.isBuffer(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>e||ri.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(r,t,n,e){if(r=+r,t=t>>>0,n=n>>>0,!e){const s=Math.pow(2,8*n)-1;U(this,r,t,n,s,0)}let u=1,h=0;for(this[t]=r&255;++h>>0,n=n>>>0,!e){const s=Math.pow(2,8*n)-1;U(this,r,t,n,s,0)}let u=n-1,h=1;for(this[t+u]=r&255;--u>=0&&(h*=256);)this[t+u]=r/h&255;return t+n},o.prototype.writeUint8=o.prototype.writeUInt8=function(r,t,n){return r=+r,t=t>>>0,n||U(this,r,t,1,255,0),this[t]=r&255,t+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(r,t,n){return r=+r,t=t>>>0,n||U(this,r,t,2,65535,0),this[t]=r&255,this[t+1]=r>>>8,t+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(r,t,n){return r=+r,t=t>>>0,n||U(this,r,t,2,65535,0),this[t]=r>>>8,this[t+1]=r&255,t+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(r,t,n){return r=+r,t=t>>>0,n||U(this,r,t,4,4294967295,0),this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255,t+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(r,t,n){return r=+r,t=t>>>0,n||U(this,r,t,4,4294967295,0),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};function Q(i,r,t,n,e){er(r,n,e,i,t,7);let u=Number(r&BigInt(4294967295));i[t++]=u,u=u>>8,i[t++]=u,u=u>>8,i[t++]=u,u=u>>8,i[t++]=u;let h=Number(r>>BigInt(32)&BigInt(4294967295));return i[t++]=h,h=h>>8,i[t++]=h,h=h>>8,i[t++]=h,h=h>>8,i[t++]=h,t}function v(i,r,t,n,e){er(r,n,e,i,t,7);let u=Number(r&BigInt(4294967295));i[t+7]=u,u=u>>8,i[t+6]=u,u=u>>8,i[t+5]=u,u=u>>8,i[t+4]=u;let h=Number(r>>BigInt(32)&BigInt(4294967295));return i[t+3]=h,h=h>>8,i[t+2]=h,h=h>>8,i[t+1]=h,h=h>>8,i[t]=h,t+8}o.prototype.writeBigUInt64LE=L(function(r,t=0){return Q(this,r,t,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=L(function(r,t=0){return v(this,r,t,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(r,t,n,e){if(r=+r,t=t>>>0,!e){const d=Math.pow(2,8*n-1);U(this,r,t,n,d-1,-d)}let u=0,h=1,s=0;for(this[t]=r&255;++u>0)-s&255;return t+n},o.prototype.writeIntBE=function(r,t,n,e){if(r=+r,t=t>>>0,!e){const d=Math.pow(2,8*n-1);U(this,r,t,n,d-1,-d)}let u=n-1,h=1,s=0;for(this[t+u]=r&255;--u>=0&&(h*=256);)r<0&&s===0&&this[t+u+1]!==0&&(s=1),this[t+u]=(r/h>>0)-s&255;return t+n},o.prototype.writeInt8=function(r,t,n){return r=+r,t=t>>>0,n||U(this,r,t,1,127,-128),r<0&&(r=255+r+1),this[t]=r&255,t+1},o.prototype.writeInt16LE=function(r,t,n){return r=+r,t=t>>>0,n||U(this,r,t,2,32767,-32768),this[t]=r&255,this[t+1]=r>>>8,t+2},o.prototype.writeInt16BE=function(r,t,n){return r=+r,t=t>>>0,n||U(this,r,t,2,32767,-32768),this[t]=r>>>8,this[t+1]=r&255,t+2},o.prototype.writeInt32LE=function(r,t,n){return r=+r,t=t>>>0,n||U(this,r,t,4,2147483647,-2147483648),this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24,t+4},o.prototype.writeInt32BE=function(r,t,n){return r=+r,t=t>>>0,n||U(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4},o.prototype.writeBigInt64LE=L(function(r,t=0){return Q(this,r,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=L(function(r,t=0){return v(this,r,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function rr(i,r,t,n,e,u){if(t+n>i.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function tr(i,r,t,n,e){return r=+r,t=t>>>0,e||rr(i,r,t,4),l.write(i,r,t,n,23,4),t+4}o.prototype.writeFloatLE=function(r,t,n){return tr(this,r,t,!0,n)},o.prototype.writeFloatBE=function(r,t,n){return tr(this,r,t,!1,n)};function ir(i,r,t,n,e){return r=+r,t=t>>>0,e||rr(i,r,t,8),l.write(i,r,t,n,52,8),t+8}o.prototype.writeDoubleLE=function(r,t,n){return ir(this,r,t,!0,n)},o.prototype.writeDoubleBE=function(r,t,n){return ir(this,r,t,!1,n)},o.prototype.copy=function(r,t,n,e){if(!o.isBuffer(r))throw new TypeError("argument should be a Buffer");if(n||(n=0),!e&&e!==0&&(e=this.length),t>=r.length&&(t=r.length),t||(t=0),e>0&&e=this.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("sourceEnd out of bounds");e>this.length&&(e=this.length),r.length-t>>0,n=n===void 0?this.length:n>>>0,r||(r=0);let u;if(typeof r=="number")for(u=t;u2**32?e=nr(String(t)):typeof t=="bigint"&&(e=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(e=nr(e)),e+="n"),n+=` It must be ${r}. Received ${e}`,n},RangeError);function nr(i){let r="",t=i.length;const n=i[0]==="-"?1:0;for(;t>=n+4;t-=3)r=`_${i.slice(t-3,t)}${r}`;return`${i.slice(0,t)}${r}`}function mr(i,r,t){k(r,"offset"),(i[r]===void 0||i[r+t]===void 0)&&P(r,i.length-(t+1))}function er(i,r,t,n,e,u){if(i>t||i3?r===0||r===BigInt(0)?s=`>= 0${h} and < 2${h} ** ${(u+1)*8}${h}`:s=`>= -(2${h} ** ${(u+1)*8-1}${h}) and < 2 ** ${(u+1)*8-1}${h}`:s=`>= ${r}${h} and <= ${t}${h}`,new M.ERR_OUT_OF_RANGE("value",s,i)}mr(n,e,u)}function k(i,r){if(typeof i!="number")throw new M.ERR_INVALID_ARG_TYPE(r,"number",i)}function P(i,r,t){throw Math.floor(i)!==i?(k(i,t),new M.ERR_OUT_OF_RANGE(t||"offset","an integer",i)):r<0?new M.ERR_BUFFER_OUT_OF_BOUNDS:new M.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${r}`,i)}const Ir=/[^+/0-9A-Za-z-_]/g;function Fr(i){if(i=i.split("=")[0],i=i.trim().replace(Ir,""),i.length<2)return"";for(;i.length%4!==0;)i=i+"=";return i}function j(i,r){r=r||1/0;let t;const n=i.length;let e=null;const u=[];for(let h=0;h55295&&t<57344){if(!e){if(t>56319){(r-=3)>-1&&u.push(239,191,189);continue}else if(h+1===n){(r-=3)>-1&&u.push(239,191,189);continue}e=t;continue}if(t<56320){(r-=3)>-1&&u.push(239,191,189),e=t;continue}t=(e-55296<<10|t-56320)+65536}else e&&(r-=3)>-1&&u.push(239,191,189);if(e=null,t<128){if((r-=1)<0)break;u.push(t)}else if(t<2048){if((r-=2)<0)break;u.push(t>>6|192,t&63|128)}else if(t<65536){if((r-=3)<0)break;u.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((r-=4)<0)break;u.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return u}function Ar(i){const r=[];for(let t=0;t>8,e=t%256,u.push(e),u.push(n);return u}function or(i){return f.toByteArray(Fr(i))}function O(i,r,t,n){let e;for(e=0;e=r.length||e>=i.length);++e)r[e+t]=i[e];return e}function C(i,r){return i instanceof r||i!=null&&i.constructor!=null&&i.constructor.name!=null&&i.constructor.name===r.name}function q(i){return i!==i}const Rr=function(){const i="0123456789abcdef",r=new Array(256);for(let t=0;t<16;++t){const n=t*16;for(let e=0;e<16;++e)r[n+e]=i[t]+i[e]}return r}();function L(i){return typeof BigInt>"u"?Tr:i}function Tr(){throw new Error("BigInt not supported")}})(Cr);export{Cr as b}; diff --git a/assets/index-d66c3ebc.js b/assets/index-d66c3ebc.js deleted file mode 100644 index 5cae3c59..00000000 --- a/assets/index-d66c3ebc.js +++ /dev/null @@ -1,25 +0,0 @@ -import{i as bt,c as F,r as Oc,b as ds,g as xr,t as D0,_ as I,a as j0}from"./index-6a2af3e6.js";import{e as Nc}from"./events-fe40c1a3.js";import{b as ps}from"./index-cc134824.js";function B0(t,e){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Lc={},Qn={},bs={};Object.defineProperty(bs,"__esModule",{value:!0});bs.walletLogo=void 0;const F0=(t,e)=>{let r;switch(t){case"standard":return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};bs.walletLogo=F0;var gs={};Object.defineProperty(gs,"__esModule",{value:!0});gs.LINK_API_URL=void 0;gs.LINK_API_URL="https://www.walletlink.org";var ys={};Object.defineProperty(ys,"__esModule",{value:!0});ys.ScopedLocalStorage=void 0;class W0{constructor(e){this.scope=e}setItem(e,r){localStorage.setItem(this.scopedKey(e),r)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),r=[];for(let n=0;nlocalStorage.removeItem(n))}scopedKey(e){return`${this.scope}:${e}`}}ys.ScopedLocalStorage=W0;var tn={},Ir={};Object.defineProperty(Ir,"__esModule",{value:!0});const H0=Nc;function qu(t,e,r){try{Reflect.apply(t,e,r)}catch(n){setTimeout(()=>{throw n})}}function V0(t){const e=t.length,r=new Array(e);for(let n=0;n0&&([o]=r),o instanceof Error)throw o;const a=new Error(`Unhandled error.${o?` (${o.message})`:""}`);throw a.context=o,a}const s=i[e];if(s===void 0)return!1;if(typeof s=="function")qu(s,this,r);else{const o=s.length,a=V0(s);for(let c=0;c"u"&&(n=wh()),nc(t,"",0,[],void 0,0,n);var i;try{br.length===0?i=JSON.stringify(t,e,r):i=JSON.stringify(t,Eh(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;_r.length!==0;){var s=_r.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function Qr(t,e,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:t}),_r.push([n,r,e,i])):br.push([e,r,t]):(n[r]=t,_r.push([n,r,e]))}function nc(t,e,r,n,i,s,o){s+=1;var a;if(typeof t=="object"&&t!==null){for(a=0;ao.depthLimit){Qr(Xi,t,e,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){Qr(Xi,t,e,i);return}if(n.push(t),Array.isArray(t))for(a=0;ae?1:0}function Sh(t,e,r,n){typeof n>"u"&&(n=wh());var i=ic(t,"",0,[],void 0,0,n)||t,s;try{br.length===0?s=JSON.stringify(i,e,r):s=JSON.stringify(i,Eh(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;_r.length!==0;){var o=_r.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return s}function ic(t,e,r,n,i,s,o){s+=1;var a;if(typeof t=="object"&&t!==null){for(a=0;ao.depthLimit){Qr(Xi,t,e,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){Qr(Xi,t,e,i);return}if(n.push(t),Array.isArray(t))for(a=0;a0)for(var n=0;n=1e3&&t<=4999}function Z0(t,e){if(e!=="[Circular]")return e}var $c={},er={};Object.defineProperty(er,"__esModule",{value:!0});er.errorValues=er.errorCodes=void 0;er.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};er.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=er,r=Xt,n=e.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:n,message:o(n)};t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function o(h,p=i){if(Number.isInteger(h)){const v=h.toString();if(f(e.errorValues,v))return e.errorValues[v].message;if(u(h))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return p}t.getMessageFromCode=o;function a(h){if(!Number.isInteger(h))return!1;const p=h.toString();return!!(e.errorValues[p]||u(h))}t.isValidCode=a;function c(h,{fallbackError:p=s,shouldIncludeStack:v=!1}={}){var E,_;if(!p||!Number.isInteger(p.code)||typeof p.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(h instanceof r.EthereumRpcError)return h.serialize();const d={};if(h&&typeof h=="object"&&!Array.isArray(h)&&f(h,"code")&&a(h.code)){const m=h;d.code=m.code,m.message&&typeof m.message=="string"?(d.message=m.message,f(m,"data")&&(d.data=m.data)):(d.message=o(d.code),d.data={originalError:l(h)})}else{d.code=p.code;const m=(E=h)===null||E===void 0?void 0:E.message;d.message=m&&typeof m=="string"?m:p.message,d.data={originalError:l(h)}}const y=(_=h)===null||_===void 0?void 0:_.stack;return v&&h&&y&&typeof y=="string"&&(d.stack=y),d}t.serializeError=c;function u(h){return h>=-32099&&h<=-32e3}function l(h){return h&&typeof h=="object"&&!Array.isArray(h)?Object.assign({},h):h}function f(h,p){return Object.prototype.hasOwnProperty.call(h,p)}})($c);var vs={};Object.defineProperty(vs,"__esModule",{value:!0});vs.ethErrors=void 0;const Dc=Xt,xh=$c,De=er;vs.ethErrors={rpc:{parse:t=>Xe(De.errorCodes.rpc.parse,t),invalidRequest:t=>Xe(De.errorCodes.rpc.invalidRequest,t),invalidParams:t=>Xe(De.errorCodes.rpc.invalidParams,t),methodNotFound:t=>Xe(De.errorCodes.rpc.methodNotFound,t),internal:t=>Xe(De.errorCodes.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Xe(e,t)},invalidInput:t=>Xe(De.errorCodes.rpc.invalidInput,t),resourceNotFound:t=>Xe(De.errorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>Xe(De.errorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>Xe(De.errorCodes.rpc.transactionRejected,t),methodNotSupported:t=>Xe(De.errorCodes.rpc.methodNotSupported,t),limitExceeded:t=>Xe(De.errorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>Nn(De.errorCodes.provider.userRejectedRequest,t),unauthorized:t=>Nn(De.errorCodes.provider.unauthorized,t),unsupportedMethod:t=>Nn(De.errorCodes.provider.unsupportedMethod,t),disconnected:t=>Nn(De.errorCodes.provider.disconnected,t),chainDisconnected:t=>Nn(De.errorCodes.provider.chainDisconnected,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:r,data:n}=t;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new Dc.EthereumProviderError(e,r,n)}}};function Xe(t,e){const[r,n]=Ih(e);return new Dc.EthereumRpcError(t,r||xh.getMessageFromCode(t),n)}function Nn(t,e){const[r,n]=Ih(e);return new Dc.EthereumProviderError(t,r||xh.getMessageFromCode(t),n)}function Ih(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:r}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageFromCode=t.serializeError=t.EthereumProviderError=t.EthereumRpcError=t.ethErrors=t.errorCodes=void 0;const e=Xt;Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return e.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return e.EthereumProviderError}});const r=$c;Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=vs;Object.defineProperty(t,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=er;Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(Pc);var be={},ms={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Web3Method=void 0,function(e){e.requestEthereumAccounts="requestEthereumAccounts",e.signEthereumMessage="signEthereumMessage",e.signEthereumTransaction="signEthereumTransaction",e.submitEthereumTransaction="submitEthereumTransaction",e.ethereumAddressFromSignedMessage="ethereumAddressFromSignedMessage",e.scanQRCode="scanQRCode",e.generic="generic",e.childRequestEthereumAccounts="childRequestEthereumAccounts",e.addEthereumChain="addEthereumChain",e.switchEthereumChain="switchEthereumChain",e.makeEthereumJSONRPCRequest="makeEthereumJSONRPCRequest",e.watchAsset="watchAsset",e.selectProvider="selectProvider"}(t.Web3Method||(t.Web3Method={}))})(ms);Object.defineProperty(be,"__esModule",{value:!0});be.EthereumAddressFromSignedMessageResponse=be.SubmitEthereumTransactionResponse=be.SignEthereumTransactionResponse=be.SignEthereumMessageResponse=be.isRequestEthereumAccountsResponse=be.SelectProviderResponse=be.WatchAssetReponse=be.RequestEthereumAccountsResponse=be.SwitchEthereumChainResponse=be.AddEthereumChainResponse=be.isErrorResponse=void 0;const Tt=ms;function Y0(t){var e,r;return((e=t)===null||e===void 0?void 0:e.method)!==void 0&&((r=t)===null||r===void 0?void 0:r.errorMessage)!==void 0}be.isErrorResponse=Y0;function K0(t){return{method:Tt.Web3Method.addEthereumChain,result:t}}be.AddEthereumChainResponse=K0;function X0(t){return{method:Tt.Web3Method.switchEthereumChain,result:t}}be.SwitchEthereumChainResponse=X0;function eb(t){return{method:Tt.Web3Method.requestEthereumAccounts,result:t}}be.RequestEthereumAccountsResponse=eb;function tb(t){return{method:Tt.Web3Method.watchAsset,result:t}}be.WatchAssetReponse=tb;function rb(t){return{method:Tt.Web3Method.selectProvider,result:t}}be.SelectProviderResponse=rb;function nb(t){return t&&t.method===Tt.Web3Method.requestEthereumAccounts}be.isRequestEthereumAccountsResponse=nb;function ib(t){return{method:Tt.Web3Method.signEthereumMessage,result:t}}be.SignEthereumMessageResponse=ib;function sb(t){return{method:Tt.Web3Method.signEthereumTransaction,result:t}}be.SignEthereumTransactionResponse=sb;function ob(t){return{method:Tt.Web3Method.submitEthereumTransaction,result:t}}be.SubmitEthereumTransactionResponse=ob;function ab(t){return{method:Tt.Web3Method.ethereumAddressFromSignedMessage,result:t}}be.EthereumAddressFromSignedMessageResponse=ab;var mn={};Object.defineProperty(mn,"__esModule",{value:!0});mn.LIB_VERSION=void 0;mn.LIB_VERSION="3.7.2";(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCode=t.serializeError=t.standardErrors=t.standardErrorMessage=t.standardErrorCodes=void 0;const e=Pc,r=be,n=mn;t.standardErrorCodes=Object.freeze(Object.assign(Object.assign({},e.errorCodes),{provider:Object.freeze(Object.assign(Object.assign({},e.errorCodes.provider),{unsupportedChain:4902}))}));function i(l){return l!==void 0?(0,e.getMessageFromCode)(l):"Unknown error"}t.standardErrorMessage=i,t.standardErrors=Object.freeze(Object.assign(Object.assign({},e.ethErrors),{provider:Object.freeze(Object.assign(Object.assign({},e.ethErrors.provider),{unsupportedChain:(l="")=>e.ethErrors.provider.custom({code:t.standardErrorCodes.provider.unsupportedChain,message:`Unrecognized chain ID ${l}. Try adding the chain using wallet_addEthereumChain first.`})}))}));function s(l,f){const h=(0,e.serializeError)(o(l),{shouldIncludeStack:!0}),p=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");p.searchParams.set("version",n.LIB_VERSION),p.searchParams.set("code",h.code.toString());const v=a(h.data,f);return v&&p.searchParams.set("method",v),p.searchParams.set("message",h.message),Object.assign(Object.assign({},h),{docUrl:p.href})}t.serializeError=s;function o(l){return typeof l=="string"?{message:l,code:t.standardErrorCodes.rpc.internal}:(0,r.isErrorResponse)(l)?Object.assign(Object.assign({},l),{message:l.errorMessage,code:l.errorCode,data:{method:l.method,result:l.result}}):l}function a(l,f){var h;const p=(h=l)===null||h===void 0?void 0:h.method;if(p)return p;if(f!==void 0)return typeof f=="string"?f:Array.isArray(f)?f.length>0?f[0].method:void 0:f.method}function c(l){var f;if(typeof l=="number")return l;if(u(l))return(f=l.code)!==null&&f!==void 0?f:l.errorCode}t.getErrorCode=c;function u(l){return typeof l=="object"&&l!==null&&(typeof l.code=="number"||typeof l.errorCode=="number")}})(ni);var _n={},Rh={exports:{}},sc={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh */(function(t,e){var r=ps,n=r.Buffer;function i(o,a){for(var c in o)a[c]=o[c]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,e),e.Buffer=s);function s(o,a,c){return n(o,a,c)}s.prototype=Object.create(n.prototype),i(n,s),s.from=function(o,a,c){if(typeof o=="number")throw new TypeError("Argument must not be a number");return n(o,a,c)},s.alloc=function(o,a,c){if(typeof o!="number")throw new TypeError("Argument must be a number");var u=n(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 n(o)},s.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(o)}})(sc,sc.exports);var ir=sc.exports,Ah=ir.Buffer;function _s(t,e){this._block=Ah.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}_s.prototype.update=function(t,e){typeof t=="string"&&(e=e||"utf8",t=Ah.from(t,e));for(var r=this._block,n=this._blockSize,i=t.length,s=this._len,o=0;o=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(r&4294967295)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var s=this._hash();return t?s.toString(t):s};_s.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var wn=_s,cb=bt,Mh=wn,ub=ir.Buffer,lb=[1518500249,1859775393,-1894007588,-899497514],fb=new Array(80);function ii(){this.init(),this._w=fb,Mh.call(this,64,56)}cb(ii,Mh);ii.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function hb(t){return t<<5|t>>>27}function db(t){return t<<30|t>>>2}function pb(t,e,r,n){return t===0?e&r|~e&n:t===2?e&r|e&n|r&n:e^r^n}ii.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=0;a<16;++a)e[a]=t.readInt32BE(a*4);for(;a<80;++a)e[a]=e[a-3]^e[a-8]^e[a-14]^e[a-16];for(var c=0;c<80;++c){var u=~~(c/20),l=hb(r)+pb(u,n,i,s)+o+e[c]+lb[u]|0;o=s,s=i,i=db(n),n=r,r=l}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0};ii.prototype._hash=function(){var t=ub.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};var bb=ii,gb=bt,kh=wn,yb=ir.Buffer,vb=[1518500249,1859775393,-1894007588,-899497514],mb=new Array(80);function si(){this.init(),this._w=mb,kh.call(this,64,56)}gb(si,kh);si.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function _b(t){return t<<1|t>>>31}function wb(t){return t<<5|t>>>27}function Sb(t){return t<<30|t>>>2}function Eb(t,e,r,n){return t===0?e&r|~e&n:t===2?e&r|e&n|r&n:e^r^n}si.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=0;a<16;++a)e[a]=t.readInt32BE(a*4);for(;a<80;++a)e[a]=_b(e[a-3]^e[a-8]^e[a-14]^e[a-16]);for(var c=0;c<80;++c){var u=~~(c/20),l=wb(r)+Eb(u,n,i,s)+o+e[c]+vb[u]|0;o=s,s=i,i=Sb(n),n=r,r=l}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0};si.prototype._hash=function(){var t=yb.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};var Cb=si,xb=bt,Th=wn,Ib=ir.Buffer,Rb=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Ab=new Array(64);function oi(){this.init(),this._w=Ab,Th.call(this,64,56)}xb(oi,Th);oi.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function Mb(t,e,r){return r^t&(e^r)}function kb(t,e,r){return t&e|r&(t|e)}function Tb(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function Ob(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function Nb(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}function Lb(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10}oi.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=this._f|0,c=this._g|0,u=this._h|0,l=0;l<16;++l)e[l]=t.readInt32BE(l*4);for(;l<64;++l)e[l]=Lb(e[l-2])+e[l-7]+Nb(e[l-15])+e[l-16]|0;for(var f=0;f<64;++f){var h=u+Ob(o)+Mb(o,a,c)+Rb[f]+e[f]|0,p=Tb(r)+kb(r,n,i)|0;u=c,c=a,a=o,o=s+h|0,s=i,i=n,n=r,r=h+p|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0,this._f=a+this._f|0,this._g=c+this._g|0,this._h=u+this._h|0};oi.prototype._hash=function(){var t=Ib.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t};var Oh=oi,Pb=bt,$b=Oh,Db=wn,jb=ir.Buffer,Bb=new Array(64);function ws(){this.init(),this._w=Bb,Db.call(this,64,56)}Pb(ws,$b);ws.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};ws.prototype._hash=function(){var t=jb.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t};var Fb=ws,Wb=bt,Nh=wn,Hb=ir.Buffer,Gu=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],Vb=new Array(160);function ai(){this.init(),this._w=Vb,Nh.call(this,128,112)}Wb(ai,Nh);ai.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function Ju(t,e,r){return r^t&(e^r)}function Qu(t,e,r){return t&e|r&(t|e)}function Zu(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function Yu(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function Ub(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function zb(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function qb(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function Gb(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function Ae(t,e){return t>>>0>>0?1:0}ai.prototype._update=function(t){for(var e=this._w,r=this._ah|0,n=this._bh|0,i=this._ch|0,s=this._dh|0,o=this._eh|0,a=this._fh|0,c=this._gh|0,u=this._hh|0,l=this._al|0,f=this._bl|0,h=this._cl|0,p=this._dl|0,v=this._el|0,E=this._fl|0,_=this._gl|0,d=this._hl|0,y=0;y<32;y+=2)e[y]=t.readInt32BE(y*4),e[y+1]=t.readInt32BE(y*4+4);for(;y<160;y+=2){var m=e[y-30],x=e[y-15*2+1],C=Ub(m,x),T=zb(x,m);m=e[y-2*2],x=e[y-2*2+1];var j=qb(m,x),$=Gb(x,m),A=e[y-7*2],U=e[y-7*2+1],ce=e[y-16*2],Z=e[y-16*2+1],R=T+U|0,M=C+A+Ae(R,T)|0;R=R+$|0,M=M+j+Ae(R,$)|0,R=R+Z|0,M=M+ce+Ae(R,Z)|0,e[y]=M,e[y+1]=R}for(var N=0;N<160;N+=2){M=e[N],R=e[N+1];var L=Qu(r,n,i),B=Qu(l,f,h),D=Zu(r,l),H=Zu(l,r),Y=Yu(o,v),J=Yu(v,o),se=Gu[N],he=Gu[N+1],le=Ju(o,a,c),We=Ju(v,E,_),w=d+J|0,S=u+Y+Ae(w,d)|0;w=w+We|0,S=S+le+Ae(w,We)|0,w=w+he|0,S=S+se+Ae(w,he)|0,w=w+R|0,S=S+M+Ae(w,R)|0;var O=H+B|0,z=D+L+Ae(O,H)|0;u=c,d=_,c=a,_=E,a=o,E=v,v=p+w|0,o=s+S+Ae(v,p)|0,s=i,p=h,i=n,h=f,n=r,f=l,l=w+O|0,r=S+z+Ae(l,w)|0}this._al=this._al+l|0,this._bl=this._bl+f|0,this._cl=this._cl+h|0,this._dl=this._dl+p|0,this._el=this._el+v|0,this._fl=this._fl+E|0,this._gl=this._gl+_|0,this._hl=this._hl+d|0,this._ah=this._ah+r+Ae(this._al,l)|0,this._bh=this._bh+n+Ae(this._bl,f)|0,this._ch=this._ch+i+Ae(this._cl,h)|0,this._dh=this._dh+s+Ae(this._dl,p)|0,this._eh=this._eh+o+Ae(this._el,v)|0,this._fh=this._fh+a+Ae(this._fl,E)|0,this._gh=this._gh+c+Ae(this._gl,_)|0,this._hh=this._hh+u+Ae(this._hl,d)|0};ai.prototype._hash=function(){var t=Hb.allocUnsafe(64);function e(r,n,i){t.writeInt32BE(r,i),t.writeInt32BE(n,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t};var Lh=ai,Jb=bt,Qb=Lh,Zb=wn,Yb=ir.Buffer,Kb=new Array(160);function Ss(){this.init(),this._w=Kb,Zb.call(this,128,112)}Jb(Ss,Qb);Ss.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};Ss.prototype._hash=function(){var t=Yb.allocUnsafe(48);function e(r,n,i){t.writeInt32BE(r,i),t.writeInt32BE(n,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t};var Xb=Ss,Rr=Rh.exports=function(e){e=e.toLowerCase();var r=Rr[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r};Rr.sha=bb;Rr.sha1=Cb;Rr.sha224=Fb;Rr.sha256=Oh;Rr.sha384=Xb;Rr.sha512=Lh;var eg=Rh.exports,W={},tg=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[r]=i;for(r in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,r);if(o.value!==i||o.enumerable!==!0)return!1}return!0},Ku=typeof Symbol<"u"&&Symbol,rg=tg,ng=function(){return typeof Ku!="function"||typeof Symbol!="function"||typeof Ku("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:rg()},Xu={foo:{}},ig=Object,sg=function(){return{__proto__:Xu}.foo===Xu.foo&&!({__proto__:null}instanceof ig)},og="Function.prototype.bind called on incompatible ",ag=Object.prototype.toString,cg=Math.max,ug="[object Function]",el=function(e,r){for(var n=[],i=0;i"u"||!Te?ne:Te(Uint8Array),mr={"%AggregateError%":typeof AggregateError>"u"?ne:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ne:ArrayBuffer,"%ArrayIteratorPrototype%":jr&&Te?Te([][Symbol.iterator]()):ne,"%AsyncFromSyncIteratorPrototype%":ne,"%AsyncFunction%":zr,"%AsyncGenerator%":zr,"%AsyncGeneratorFunction%":zr,"%AsyncIteratorPrototype%":zr,"%Atomics%":typeof Atomics>"u"?ne:Atomics,"%BigInt%":typeof BigInt>"u"?ne:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ne:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ne:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ne:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?ne:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ne:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ne:FinalizationRegistry,"%Function%":Ph,"%GeneratorFunction%":zr,"%Int8Array%":typeof Int8Array>"u"?ne:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ne:Int16Array,"%Int32Array%":typeof Int32Array>"u"?ne:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":jr&&Te?Te(Te([][Symbol.iterator]())):ne,"%JSON%":typeof JSON=="object"?JSON:ne,"%Map%":typeof Map>"u"?ne:Map,"%MapIteratorPrototype%":typeof Map>"u"||!jr||!Te?ne:Te(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ne:Promise,"%Proxy%":typeof Proxy>"u"?ne:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?ne:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ne:Set,"%SetIteratorPrototype%":typeof Set>"u"||!jr||!Te?ne:Te(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ne:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":jr&&Te?Te(""[Symbol.iterator]()):ne,"%Symbol%":jr?Symbol:ne,"%SyntaxError%":rn,"%ThrowTypeError%":vg,"%TypedArray%":_g,"%TypeError%":Zr,"%Uint8Array%":typeof Uint8Array>"u"?ne:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ne:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ne:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ne:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?ne:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ne:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ne:WeakSet};if(Te)try{null.error}catch(t){var wg=Te(Te(t));mr["%Error.prototype%"]=wg}var Sg=function t(e){var r;if(e==="%AsyncFunction%")r=pa("async function () {}");else if(e==="%GeneratorFunction%")r=pa("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=pa("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&Te&&(r=Te(i.prototype))}return mr[e]=r,r},tl={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},ci=jc,es=yg,Eg=ci.call(Function.call,Array.prototype.concat),Cg=ci.call(Function.apply,Array.prototype.splice),rl=ci.call(Function.call,String.prototype.replace),ts=ci.call(Function.call,String.prototype.slice),xg=ci.call(Function.call,RegExp.prototype.exec),Ig=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Rg=/\\(\\)?/g,Ag=function(e){var r=ts(e,0,1),n=ts(e,-1);if(r==="%"&&n!=="%")throw new rn("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new rn("invalid intrinsic syntax, expected opening `%`");var i=[];return rl(e,Ig,function(s,o,a,c){i[i.length]=a?rl(c,Rg,"$1"):o||s}),i},Mg=function(e,r){var n=e,i;if(es(tl,n)&&(i=tl[n],n="%"+i[0]+"%"),es(mr,n)){var s=mr[n];if(s===zr&&(s=Sg(n)),typeof s>"u"&&!r)throw new Zr("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new rn("intrinsic "+e+" does not exist!")},Ar=function(e,r){if(typeof e!="string"||e.length===0)throw new Zr("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Zr('"allowMissing" argument must be a boolean');if(xg(/^%?[^%]*%?$/,e)===null)throw new rn("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Ag(e),i=n.length>0?n[0]:"",s=Mg("%"+i+"%",r),o=s.name,a=s.value,c=!1,u=s.alias;u&&(i=u[0],Cg(n,Eg([0,1],u)));for(var l=1,f=!0;l=n.length){var E=vr(a,h);f=!!E,f&&"get"in E&&!("originalValue"in E.get)?a=E.get:a=a[h]}else f=es(a,h),a=a[h];f&&!c&&(mr[o]=a)}}return a},$h={exports:{}},kg=Ar,oc=kg("%Object.defineProperty%",!0),ac=function(){if(oc)try{return oc({},"a",{value:1}),!0}catch{return!1}return!1};ac.hasArrayLengthDefineBug=function(){if(!ac())return null;try{return oc([],"length",{value:1}).length!==1}catch{return!0}};var Dh=ac,Tg=Ar,qi=Tg("%Object.getOwnPropertyDescriptor%",!0);if(qi)try{qi([],"length")}catch{qi=null}var jh=qi,Og=Dh(),Bc=Ar,Fn=Og&&Bc("%Object.defineProperty%",!0);if(Fn)try{Fn({},"a",{value:1})}catch{Fn=!1}var Ng=Bc("%SyntaxError%"),Br=Bc("%TypeError%"),nl=jh,Lg=function(e,r,n){if(!e||typeof e!="object"&&typeof e!="function")throw new Br("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new Br("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Br("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Br("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Br("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Br("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,a=arguments.length>6?arguments[6]:!1,c=!!nl&&nl(e,r);if(Fn)Fn(e,r,{configurable:o===null&&c?c.configurable:!o,enumerable:i===null&&c?c.enumerable:!i,value:n,writable:s===null&&c?c.writable:!s});else if(a||!i&&!s&&!o)e[r]=n;else throw new Ng("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Bh=Ar,il=Lg,Pg=Dh(),sl=jh,ol=Bh("%TypeError%"),$g=Bh("%Math.floor%"),Dg=function(e,r){if(typeof e!="function")throw new ol("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||$g(r)!==r)throw new ol("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],i=!0,s=!0;if("length"in e&&sl){var o=sl(e,"length");o&&!o.configurable&&(i=!1),o&&!o.writable&&(s=!1)}return(i||s||!n)&&(Pg?il(e,"length",r,!0,!0):il(e,"length",r)),e};(function(t){var e=jc,r=Ar,n=Dg,i=r("%TypeError%"),s=r("%Function.prototype.apply%"),o=r("%Function.prototype.call%"),a=r("%Reflect.apply%",!0)||e.call(o,s),c=r("%Object.defineProperty%",!0),u=r("%Math.max%");if(c)try{c({},"a",{value:1})}catch{c=null}t.exports=function(h){if(typeof h!="function")throw new i("a function is required");var p=a(e,o,arguments);return n(p,1+u(0,h.length-(arguments.length-1)),!0)};var l=function(){return a(e,s,arguments)};c?c(t.exports,"apply",{value:l}):t.exports.apply=l})($h);var jg=$h.exports,Fh=Ar,Wh=jg,Bg=Wh(Fh("String.prototype.indexOf")),Fg=function(e,r){var n=Fh(e,!!r);return typeof n=="function"&&Bg(e,".prototype.")>-1?Wh(n):n},Fc=typeof Map=="function"&&Map.prototype,ga=Object.getOwnPropertyDescriptor&&Fc?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,rs=Fc&&ga&&typeof ga.get=="function"?ga.get:null,al=Fc&&Map.prototype.forEach,Wc=typeof Set=="function"&&Set.prototype,ya=Object.getOwnPropertyDescriptor&&Wc?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,ns=Wc&&ya&&typeof ya.get=="function"?ya.get:null,cl=Wc&&Set.prototype.forEach,Wg=typeof WeakMap=="function"&&WeakMap.prototype,Wn=Wg?WeakMap.prototype.has:null,Hg=typeof WeakSet=="function"&&WeakSet.prototype,Hn=Hg?WeakSet.prototype.has:null,Vg=typeof WeakRef=="function"&&WeakRef.prototype,ul=Vg?WeakRef.prototype.deref:null,Ug=Boolean.prototype.valueOf,zg=Object.prototype.toString,qg=Function.prototype.toString,Gg=String.prototype.match,Hc=String.prototype.slice,Yt=String.prototype.replace,Jg=String.prototype.toUpperCase,ll=String.prototype.toLowerCase,Hh=RegExp.prototype.test,fl=Array.prototype.concat,xt=Array.prototype.join,Qg=Array.prototype.slice,hl=Math.floor,cc=typeof BigInt=="function"?BigInt.prototype.valueOf:null,va=Object.getOwnPropertySymbols,uc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,nn=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Fe=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===nn||"symbol")?Symbol.toStringTag:null,Vh=Object.prototype.propertyIsEnumerable,dl=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function pl(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||Hh.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-hl(-t):hl(t);if(n!==t){var i=String(n),s=Hc.call(e,i.length+1);return Yt.call(i,r,"$&_")+"."+Yt.call(Yt.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Yt.call(e,r,"$&_")}var lc=Oc,bl=lc.custom,gl=zh(bl)?bl:null,Zg=function t(e,r,n,i){var s=r||{};if(Jt(s,"quoteStyle")&&s.quoteStyle!=="single"&&s.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Jt(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=Jt(s,"customInspect")?s.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Jt(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Jt(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=s.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Gh(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var c=String(e);return a?pl(e,c):c}if(typeof e=="bigint"){var u=String(e)+"n";return a?pl(e,u):u}var l=typeof s.depth>"u"?5:s.depth;if(typeof n>"u"&&(n=0),n>=l&&l>0&&typeof e=="object")return fc(e)?"[Array]":"[Object]";var f=py(s,n);if(typeof i>"u")i=[];else if(qh(i,e)>=0)return"[Circular]";function h(R,M,N){if(M&&(i=Qg.call(i),i.push(M)),N){var L={depth:s.depth};return Jt(s,"quoteStyle")&&(L.quoteStyle=s.quoteStyle),t(R,L,n+1,i)}return t(R,s,n+1,i)}if(typeof e=="function"&&!yl(e)){var p=sy(e),v=ki(e,h);return"[Function"+(p?": "+p:" (anonymous)")+"]"+(v.length>0?" { "+xt.call(v,", ")+" }":"")}if(zh(e)){var E=nn?Yt.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):uc.call(e);return typeof e=="object"&&!nn?Ln(E):E}if(fy(e)){for(var _="<"+ll.call(String(e.nodeName)),d=e.attributes||[],y=0;y",_}if(fc(e)){if(e.length===0)return"[]";var m=ki(e,h);return f&&!dy(m)?"["+hc(m,f)+"]":"[ "+xt.call(m,", ")+" ]"}if(Xg(e)){var x=ki(e,h);return!("cause"in Error.prototype)&&"cause"in e&&!Vh.call(e,"cause")?"{ ["+String(e)+"] "+xt.call(fl.call("[cause]: "+h(e.cause),x),", ")+" }":x.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+xt.call(x,", ")+" }"}if(typeof e=="object"&&o){if(gl&&typeof e[gl]=="function"&&lc)return lc(e,{depth:l-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(oy(e)){var C=[];return al&&al.call(e,function(R,M){C.push(h(M,e,!0)+" => "+h(R,e))}),vl("Map",rs.call(e),C,f)}if(uy(e)){var T=[];return cl&&cl.call(e,function(R){T.push(h(R,e))}),vl("Set",ns.call(e),T,f)}if(ay(e))return ma("WeakMap");if(ly(e))return ma("WeakSet");if(cy(e))return ma("WeakRef");if(ty(e))return Ln(h(Number(e)));if(ny(e))return Ln(h(cc.call(e)));if(ry(e))return Ln(Ug.call(e));if(ey(e))return Ln(h(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(e===F)return"{ [object globalThis] }";if(!Kg(e)&&!yl(e)){var j=ki(e,h),$=dl?dl(e)===Object.prototype:e instanceof Object||e.constructor===Object,A=e instanceof Object?"":"null prototype",U=!$&&Fe&&Object(e)===e&&Fe in e?Hc.call(sr(e),8,-1):A?"Object":"",ce=$||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",Z=ce+(U||A?"["+xt.call(fl.call([],U||[],A||[]),": ")+"] ":"");return j.length===0?Z+"{}":f?Z+"{"+hc(j,f)+"}":Z+"{ "+xt.call(j,", ")+" }"}return String(e)};function Uh(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}function Yg(t){return Yt.call(String(t),/"/g,""")}function fc(t){return sr(t)==="[object Array]"&&(!Fe||!(typeof t=="object"&&Fe in t))}function Kg(t){return sr(t)==="[object Date]"&&(!Fe||!(typeof t=="object"&&Fe in t))}function yl(t){return sr(t)==="[object RegExp]"&&(!Fe||!(typeof t=="object"&&Fe in t))}function Xg(t){return sr(t)==="[object Error]"&&(!Fe||!(typeof t=="object"&&Fe in t))}function ey(t){return sr(t)==="[object String]"&&(!Fe||!(typeof t=="object"&&Fe in t))}function ty(t){return sr(t)==="[object Number]"&&(!Fe||!(typeof t=="object"&&Fe in t))}function ry(t){return sr(t)==="[object Boolean]"&&(!Fe||!(typeof t=="object"&&Fe in t))}function zh(t){if(nn)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!uc)return!1;try{return uc.call(t),!0}catch{}return!1}function ny(t){if(!t||typeof t!="object"||!cc)return!1;try{return cc.call(t),!0}catch{}return!1}var iy=Object.prototype.hasOwnProperty||function(t){return t in this};function Jt(t,e){return iy.call(t,e)}function sr(t){return zg.call(t)}function sy(t){if(t.name)return t.name;var e=Gg.call(qg.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function qh(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return Gh(Hc.call(t,0,e.maxStringLength),e)+n}var i=Yt.call(Yt.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,hy);return Uh(i,"single",e)}function hy(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+Jg.call(e.toString(16))}function Ln(t){return"Object("+t+")"}function ma(t){return t+" { ? }"}function vl(t,e,r,n){var i=n?hc(r,n):xt.call(r,", ");return t+" ("+e+") {"+i+"}"}function dy(t){for(var e=0;e=0)return!1;return!0}function py(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=xt.call(Array(t.indent+1)," ");else return null;return{base:r,prev:xt.call(Array(e+1),r)}}function hc(t,e){if(t.length===0)return"";var r=` -`+e.prev+e.base;return r+xt.call(t,","+r)+` -`+e.prev}function ki(t,e){var r=fc(t),n=[];if(r){n.length=t.length;for(var i=0;i1;){var r=e.pop(),n=r.obj[r.prop];if(lr(n)){for(var i=[],s=0;s=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||s===My.RFC1738&&(u===40||u===41)){a+=o.charAt(c);continue}if(u<128){a=a+mt[u];continue}if(u<2048){a=a+(mt[192|u>>6]+mt[128|u&63]);continue}if(u<55296||u>=57344){a=a+(mt[224|u>>12]+mt[128|u>>6&63]+mt[128|u&63]);continue}c+=1,u=65536+((u&1023)<<10|o.charCodeAt(c)&1023),a+=mt[240|u>>18]+mt[128|u>>12&63]+mt[128|u>>6&63]+mt[128|u&63]}return a},Py=function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],i=0;i"u"&&(m=0)}if(typeof c=="function"?d=c(r,d):d instanceof Date?d=f(d):n==="comma"&&$t(d)&&(d=Gi.maybeMap(d,function(L){return L instanceof Date?f(L):L})),d===null){if(s)return a&&!v?a(r,Be.encoder,E,"key",h):r;d=""}if(Vy(d)||Gi.isBuffer(d)){if(a){var T=v?r:a(r,Be.encoder,E,"key",h);return[p(T)+"="+p(a(d,Be.encoder,E,"value",h))]}return[p(r)+"="+p(String(d))]}var j=[];if(typeof d>"u")return j;var $;if(n==="comma"&&$t(d))v&&a&&(d=Gi.maybeMap(d,a)),$=[{value:d.length>0?d.join(",")||null:void 0}];else if($t(c))$=c;else{var A=Object.keys(d);$=u?A.sort(u):A}for(var U=i&&$t(d)&&d.length===1?r+"[]":r,ce=0;ce<$.length;++ce){var Z=$[ce],R=typeof Z=="object"&&typeof Z.value<"u"?Z.value:d[Z];if(!(o&&R===null)){var M=$t(d)?typeof n=="function"?n(U,Z):U:U+(l?"."+Z:"["+Z+"]");_.set(e,m);var N=Zh();N.set(Sa,_),Yh(j,t(R,M,n,i,s,o,n==="comma"&&v&&$t(d)?null:a,c,u,l,f,h,p,v,E,N))}}return j},zy=function(e){if(!e)return Be;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=e.charset||Be.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=Vn.default;if(typeof e.format<"u"){if(!Fy.call(Vn.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=Vn.formatters[n],s=Be.filter;return(typeof e.filter=="function"||$t(e.filter))&&(s=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:Be.addQueryPrefix,allowDots:typeof e.allowDots>"u"?Be.allowDots:!!e.allowDots,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Be.charsetSentinel,delimiter:typeof e.delimiter>"u"?Be.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:Be.encode,encoder:typeof e.encoder=="function"?e.encoder:Be.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:Be.encodeValuesOnly,filter:s,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:Be.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:Be.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Be.strictNullHandling}},qy=function(t,e){var r=t,n=zy(e),i,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):$t(n.filter)&&(s=n.filter,i=s);var o=[];if(typeof r!="object"||r===null)return"";var a;e&&e.arrayFormat in ml?a=e.arrayFormat:e&&"indices"in e?a=e.indices?"indices":"repeat":a="indices";var c=ml[a];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var u=c==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var l=Zh(),f=0;f0?v+p:""},sn=Qh,dc=Object.prototype.hasOwnProperty,Gy=Array.isArray,Me={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:sn.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Jy=function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},Kh=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},Qy="utf8=%26%2310003%3B",Zy="utf8=%E2%9C%93",Yy=function(e,r){var n={__proto__:null},i=r.ignoreQueryPrefix?e.replace(/^\?/,""):e,s=r.parameterLimit===1/0?void 0:r.parameterLimit,o=i.split(r.delimiter,s),a=-1,c,u=r.charset;if(r.charsetSentinel)for(c=0;c-1&&(v=Gy(v)?[v]:v),dc.call(n,p)?n[p]=sn.combine(n[p],v):n[p]=v}return n},Ky=function(t,e,r,n){for(var i=n?e:Kh(e,r),s=t.length-1;s>=0;--s){var o,a=t[s];if(a==="[]"&&r.parseArrays)o=[].concat(i);else{o=r.plainObjects?Object.create(null):{};var c=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,u=parseInt(c,10);!r.parseArrays&&c===""?o={0:i}:!isNaN(u)&&a!==c&&String(u)===c&&u>=0&&r.parseArrays&&u<=r.arrayLimit?(o=[],o[u]=i):c!=="__proto__"&&(o[c]=i)}i=o}return i},Xy=function(e,r,n,i){if(e){var s=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,c=n.depth>0&&o.exec(s),u=c?s.slice(0,c.index):s,l=[];if(u){if(!n.plainObjects&&dc.call(Object.prototype,u)&&!n.allowPrototypes)return;l.push(u)}for(var f=0;n.depth>0&&(c=a.exec(s))!==null&&f"u"?Me.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?Me.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:Me.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:Me.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:Me.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Me.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:Me.comma,decoder:typeof e.decoder=="function"?e.decoder:Me.decoder,delimiter:typeof e.delimiter=="string"||sn.isRegExp(e.delimiter)?e.delimiter:Me.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:Me.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:Me.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:Me.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:Me.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Me.strictNullHandling}},tv=function(t,e){var r=ev(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof t=="string"?Yy(t,r):t,i=r.plainObjects?Object.create(null):{},s=Object.keys(n),o=0;on}t.OpaqueType=e,t.HexString=e(),t.AddressString=e(),t.BigIntString=e();function r(n){return Math.floor(n)}t.IntNumber=r,t.RegExpString=e(),function(n){n.CoinbaseWallet="CoinbaseWallet",n.MetaMask="MetaMask",n.Unselected=""}(t.ProviderType||(t.ProviderType={}))})(ui);var ov=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(W,"__esModule",{value:!0});W.isInIFrame=W.createQrUrl=W.getFavicon=W.range=W.isBigNumber=W.ensureParsedJSONObject=W.ensureBN=W.ensureRegExpString=W.ensureIntNumber=W.ensureBuffer=W.ensureAddressString=W.ensureEvenLengthHexString=W.ensureHexString=W.isHexString=W.prepend0x=W.strip0x=W.has0xPrefix=W.hexStringFromIntNumber=W.intNumberFromHexString=W.bigIntStringFromBN=W.hexStringFromBuffer=W.hexStringToUint8Array=W.uint8ArrayToHex=W.randomBytesHex=void 0;const Qt=ov(ds),av=sv,Mr=ni,st=ui,Xh=/^[0-9]*$/,ed=/^[a-f0-9]*$/;function cv(t){return td(crypto.getRandomValues(new Uint8Array(t)))}W.randomBytesHex=cv;function td(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}W.uint8ArrayToHex=td;function uv(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>parseInt(e,16)))}W.hexStringToUint8Array=uv;function lv(t,e=!1){const r=t.toString("hex");return(0,st.HexString)(e?"0x"+r:r)}W.hexStringFromBuffer=lv;function fv(t){return(0,st.BigIntString)(t.toString(10))}W.bigIntStringFromBN=fv;function hv(t){return(0,st.IntNumber)(new Qt.default(fi(t,!1),16).toNumber())}W.intNumberFromHexString=hv;function dv(t){return(0,st.HexString)("0x"+new Qt.default(t).toString(16))}W.hexStringFromIntNumber=dv;function qc(t){return t.startsWith("0x")||t.startsWith("0X")}W.has0xPrefix=qc;function Es(t){return qc(t)?t.slice(2):t}W.strip0x=Es;function rd(t){return qc(t)?"0x"+t.slice(2):"0x"+t}W.prepend0x=rd;function li(t){if(typeof t!="string")return!1;const e=Es(t).toLowerCase();return ed.test(e)}W.isHexString=li;function nd(t,e=!1){if(typeof t=="string"){const r=Es(t).toLowerCase();if(ed.test(r))return(0,st.HexString)(e?"0x"+r:r)}throw Mr.standardErrors.rpc.invalidParams(`"${String(t)}" is not a hexadecimal string`)}W.ensureHexString=nd;function fi(t,e=!1){let r=nd(t,!1);return r.length%2===1&&(r=(0,st.HexString)("0"+r)),e?(0,st.HexString)("0x"+r):r}W.ensureEvenLengthHexString=fi;function pv(t){if(typeof t=="string"){const e=Es(t).toLowerCase();if(li(e)&&e.length===40)return(0,st.AddressString)(rd(e))}throw Mr.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(t)}`)}W.ensureAddressString=pv;function bv(t){if(Buffer.isBuffer(t))return t;if(typeof t=="string")if(li(t)){const e=fi(t,!1);return Buffer.from(e,"hex")}else return Buffer.from(t,"utf8");throw Mr.standardErrors.rpc.invalidParams(`Not binary data: ${String(t)}`)}W.ensureBuffer=bv;function id(t){if(typeof t=="number"&&Number.isInteger(t))return(0,st.IntNumber)(t);if(typeof t=="string"){if(Xh.test(t))return(0,st.IntNumber)(Number(t));if(li(t))return(0,st.IntNumber)(new Qt.default(fi(t,!1),16).toNumber())}throw Mr.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}W.ensureIntNumber=id;function gv(t){if(t instanceof RegExp)return(0,st.RegExpString)(t.toString());throw Mr.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(t)}`)}W.ensureRegExpString=gv;function yv(t){if(t!==null&&(Qt.default.isBN(t)||sd(t)))return new Qt.default(t.toString(10),10);if(typeof t=="number")return new Qt.default(id(t));if(typeof t=="string"){if(Xh.test(t))return new Qt.default(t,10);if(li(t))return new Qt.default(fi(t,!1),16)}throw Mr.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}W.ensureBN=yv;function vv(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw Mr.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(t)}`)}W.ensureParsedJSONObject=vv;function sd(t){if(t==null||typeof t.constructor!="function")return!1;const{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}W.isBigNumber=sd;function mv(t,e){return Array.from({length:e-t},(r,n)=>t+n)}W.range=mv;function _v(){const t=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:r}=document.location,n=t?t.getAttribute("href"):null;return!n||n.startsWith("javascript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?e+n:`${e}//${r}${n}`}W.getFavicon=_v;function wv(t,e,r,n,i,s){const o=n?"parent-id":"id",a=(0,av.stringify)({[o]:t,secret:e,server:r,v:i,chainId:s});return`${r}/#/link?${a}`}W.createQrUrl=wv;function Sv(){try{return window.frameElement!==null}catch{return!1}}W.isInIFrame=Sv;Object.defineProperty(_n,"__esModule",{value:!0});_n.Session=void 0;const wl=eg,Sl=W,El="session:id",Cl="session:secret",xl="session:linked";class Gc{constructor(e,r,n,i){this._storage=e,this._id=r||(0,Sl.randomBytesHex)(16),this._secret=n||(0,Sl.randomBytesHex)(32),this._key=new wl.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(e){const r=e.getItem(El),n=e.getItem(xl),i=e.getItem(Cl);return r&&i?new Gc(e,r,i,n==="1"):null}static hash(e){return new wl.sha256().update(e).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this._storage.setItem(El,this._id),this._storage.setItem(Cl,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(xl,this._linked?"1":"0")}}_n.Session=Gc;var pt={};Object.defineProperty(pt,"__esModule",{value:!0});pt.WalletSDKRelayAbstract=pt.APP_VERSION_KEY=pt.LOCAL_STORAGE_ADDRESSES_KEY=pt.WALLET_USER_NAME_KEY=void 0;const Il=ni;pt.WALLET_USER_NAME_KEY="walletUsername";pt.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";pt.APP_VERSION_KEY="AppVersion";class Ev{async makeEthereumJSONRPCRequest(e,r){if(!r)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(r,{method:"POST",body:JSON.stringify(e),mode:"cors",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{if(!n)throw Il.standardErrors.rpc.parse({});const i=n,{error:s}=i;if(s)throw(0,Il.serializeError)(s,e.method);return i})}}pt.WalletSDKRelayAbstract=Ev;var pc={exports:{}},od=Nc.EventEmitter,Ea,Rl;function Cv(){if(Rl)return Ea;Rl=1;function t(v,E){var _=Object.keys(v);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(v);E&&(d=d.filter(function(y){return Object.getOwnPropertyDescriptor(v,y).enumerable})),_.push.apply(_,d)}return _}function e(v){for(var E=1;E0?this.tail.next=d:this.head=d,this.tail=d,++this.length}},{key:"unshift",value:function(_){var d={data:_,next:this.head};this.length===0&&(this.tail=d),this.head=d,++this.length}},{key:"shift",value:function(){if(this.length!==0){var _=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,_}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(_){if(this.length===0)return"";for(var d=this.head,y=""+d.data;d=d.next;)y+=_+d.data;return y}},{key:"concat",value:function(_){if(this.length===0)return u.alloc(0);for(var d=u.allocUnsafe(_>>>0),y=this.head,m=0;y;)p(y.data,d,m),m+=y.data.length,y=y.next;return d}},{key:"consume",value:function(_,d){var y;return _x.length?x.length:_;if(C===x.length?m+=x:m+=x.slice(0,_),_-=C,_===0){C===x.length?(++y,d.next?this.head=d.next:this.head=this.tail=null):(this.head=d,d.data=x.slice(C));break}++y}return this.length-=y,m}},{key:"_getBuffer",value:function(_){var d=u.allocUnsafe(_),y=this.head,m=1;for(y.data.copy(d),_-=y.data.length;y=y.next;){var x=y.data,C=_>x.length?x.length:_;if(x.copy(d,d.length-_,0,C),_-=C,_===0){C===x.length?(++m,y.next?this.head=y.next:this.head=this.tail=null):(this.head=y,y.data=x.slice(C));break}++m}return this.length-=m,d}},{key:h,value:function(_,d){return f(this,e(e({},d),{},{depth:0,customInspect:!1}))}}]),v}(),Ea}function xv(t,e){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(bc,this,t)):process.nextTick(bc,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(s){!e&&s?r._writableState?r._writableState.errorEmitted?process.nextTick(Ji,r):(r._writableState.errorEmitted=!0,process.nextTick(Al,r,s)):process.nextTick(Al,r,s):e?(process.nextTick(Ji,r),e(s)):process.nextTick(Ji,r)}),this)}function Al(t,e){bc(t,e),Ji(t)}function Ji(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function Iv(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function bc(t,e){t.emit("error",e)}function Rv(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}var ad={destroy:xv,undestroy:Iv,errorOrDestroy:Rv},kr={};function Av(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var cd={};function at(t,e,r){r||(r=Error);function n(s,o,a){return typeof e=="string"?e:e(s,o,a)}var i=function(s){Av(o,s);function o(a,c,u){return s.call(this,n(a,c,u))||this}return o}(r);i.prototype.name=r.name,i.prototype.code=t,cd[t]=i}function Ml(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map(function(n){return String(n)}),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:r===2?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}else return"of ".concat(e," ").concat(String(t))}function Mv(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function kv(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function Tv(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}at("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);at("ERR_INVALID_ARG_TYPE",function(t,e,r){var n;typeof e=="string"&&Mv(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";var i;if(kv(t," argument"))i="The ".concat(t," ").concat(n," ").concat(Ml(e,"type"));else{var s=Tv(t,".")?"property":"argument";i='The "'.concat(t,'" ').concat(s," ").concat(n," ").concat(Ml(e,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);at("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");at("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});at("ERR_STREAM_PREMATURE_CLOSE","Premature close");at("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});at("ERR_MULTIPLE_CALLBACK","Callback called multiple times");at("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");at("ERR_STREAM_WRITE_AFTER_END","write after end");at("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);at("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);at("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");kr.codes=cd;var Ov=kr.codes.ERR_INVALID_OPT_VALUE;function Nv(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function Lv(t,e,r,n){var i=Nv(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var s=n?r:"highWaterMark";throw new Ov(s,i)}return Math.floor(i)}return t.objectMode?16:16*1024}var ud={getHighWaterMark:Lv},Pv=$v;function $v(t,e){if(Ca("noDeprecation"))return t;var r=!1;function n(){if(!r){if(Ca("throwDeprecation"))throw new Error(e);Ca("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}return n}function Ca(t){try{if(!F.localStorage)return!1}catch{return!1}var e=F.localStorage[t];return e==null?!1:String(e).toLowerCase()==="true"}var xa,kl;function ld(){if(kl)return xa;kl=1,xa=$;function t(w){var S=this;this.next=null,this.entry=null,this.finish=function(){We(S,w)}}var e;$.WritableState=T;var r={deprecate:Pv},n=od,i=ps.Buffer,s=(typeof F<"u"?F:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function o(w){return i.from(w)}function a(w){return i.isBuffer(w)||w instanceof s}var c=ad,u=ud,l=u.getHighWaterMark,f=kr.codes,h=f.ERR_INVALID_ARG_TYPE,p=f.ERR_METHOD_NOT_IMPLEMENTED,v=f.ERR_MULTIPLE_CALLBACK,E=f.ERR_STREAM_CANNOT_PIPE,_=f.ERR_STREAM_DESTROYED,d=f.ERR_STREAM_NULL_VALUES,y=f.ERR_STREAM_WRITE_AFTER_END,m=f.ERR_UNKNOWN_ENCODING,x=c.errorOrDestroy;bt($,n);function C(){}function T(w,S,O){e=e||on(),w=w||{},typeof O!="boolean"&&(O=S instanceof e),this.objectMode=!!w.objectMode,O&&(this.objectMode=this.objectMode||!!w.writableObjectMode),this.highWaterMark=l(this,w,"writableHighWaterMark",O),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var z=w.decodeStrings===!1;this.decodeStrings=!z,this.defaultEncoding=w.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(te){L(S,te)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=w.emitClose!==!1,this.autoDestroy=!!w.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}T.prototype.getBuffer=function(){for(var S=this.bufferedRequest,O=[];S;)O.push(S),S=S.next;return O},function(){try{Object.defineProperty(T.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var j;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(j=Function.prototype[Symbol.hasInstance],Object.defineProperty($,Symbol.hasInstance,{value:function(S){return j.call(this,S)?!0:this!==$?!1:S&&S._writableState instanceof T}})):j=function(S){return S instanceof this};function $(w){e=e||on();var S=this instanceof e;if(!S&&!j.call($,this))return new $(w);this._writableState=new T(w,this,S),this.writable=!0,w&&(typeof w.write=="function"&&(this._write=w.write),typeof w.writev=="function"&&(this._writev=w.writev),typeof w.destroy=="function"&&(this._destroy=w.destroy),typeof w.final=="function"&&(this._final=w.final)),n.call(this)}$.prototype.pipe=function(){x(this,new E)};function A(w,S){var O=new y;x(w,O),process.nextTick(S,O)}function U(w,S,O,z){var te;return O===null?te=new d:typeof O!="string"&&!S.objectMode&&(te=new h("chunk",["string","Buffer"],O)),te?(x(w,te),process.nextTick(z,te),!1):!0}$.prototype.write=function(w,S,O){var z=this._writableState,te=!1,b=!z.objectMode&&a(w);return b&&!i.isBuffer(w)&&(w=o(w)),typeof S=="function"&&(O=S,S=null),b?S="buffer":S||(S=z.defaultEncoding),typeof O!="function"&&(O=C),z.ending?A(this,O):(b||U(this,z,w,O))&&(z.pendingcb++,te=Z(this,z,b,w,S,O)),te},$.prototype.cork=function(){this._writableState.corked++},$.prototype.uncork=function(){var w=this._writableState;w.corked&&(w.corked--,!w.writing&&!w.corked&&!w.bufferProcessing&&w.bufferedRequest&&H(this,w))},$.prototype.setDefaultEncoding=function(S){if(typeof S=="string"&&(S=S.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((S+"").toLowerCase())>-1))throw new m(S);return this._writableState.defaultEncoding=S,this},Object.defineProperty($.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function ce(w,S,O){return!w.objectMode&&w.decodeStrings!==!1&&typeof S=="string"&&(S=i.from(S,O)),S}Object.defineProperty($.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Z(w,S,O,z,te,b){if(!O){var g=ce(S,z,te);z!==g&&(O=!0,te="buffer",z=g)}var k=S.objectMode?1:z.length;S.length+=k;var P=S.length>5===6?2:d>>4===14?3:d>>3===30?4:d>>6===2?-1:-2}function o(d,y,m){var x=y.length-1;if(x=0?(C>0&&(d.lastNeed=C-1),C):--x=0?(C>0&&(d.lastNeed=C-2),C):--x=0?(C>0&&(C===2?C=0:d.lastNeed=C-3),C):0))}function a(d,y,m){if((y[0]&192)!==128)return d.lastNeed=0,"�";if(d.lastNeed>1&&y.length>1){if((y[1]&192)!==128)return d.lastNeed=1,"�";if(d.lastNeed>2&&y.length>2&&(y[2]&192)!==128)return d.lastNeed=2,"�"}}function c(d){var y=this.lastTotal-this.lastNeed,m=a(this,d);if(m!==void 0)return m;if(this.lastNeed<=d.length)return d.copy(this.lastChar,y,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);d.copy(this.lastChar,y,0,d.length),this.lastNeed-=d.length}function u(d,y){var m=o(this,d,y);if(!this.lastNeed)return d.toString("utf8",y);this.lastTotal=m;var x=d.length-(m-this.lastNeed);return d.copy(this.lastChar,0,x),d.toString("utf8",y,x)}function l(d){var y=d&&d.length?this.write(d):"";return this.lastNeed?y+"�":y}function f(d,y){if((d.length-y)%2===0){var m=d.toString("utf16le",y);if(m){var x=m.charCodeAt(m.length-1);if(x>=55296&&x<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=d[d.length-2],this.lastChar[1]=d[d.length-1],m.slice(0,-1)}return m}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=d[d.length-1],d.toString("utf16le",y,d.length-1)}function h(d){var y=d&&d.length?this.write(d):"";if(this.lastNeed){var m=this.lastTotal-this.lastNeed;return y+this.lastChar.toString("utf16le",0,m)}return y}function p(d,y){var m=(d.length-y)%3;return m===0?d.toString("base64",y):(this.lastNeed=3-m,this.lastTotal=3,m===1?this.lastChar[0]=d[d.length-1]:(this.lastChar[0]=d[d.length-2],this.lastChar[1]=d[d.length-1]),d.toString("base64",y,d.length-m))}function v(d){var y=d&&d.length?this.write(d):"";return this.lastNeed?y+this.lastChar.toString("base64",0,3-this.lastNeed):y}function E(d){return d.toString(this.encoding)}function _(d){return d&&d.length?this.write(d):""}return Ra}var Ll=kr.codes.ERR_STREAM_PREMATURE_CLOSE;function Dv(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i0)if(typeof g!="string"&&!K.objectMode&&Object.getPrototypeOf(g)!==n.prototype&&(g=s(g)),P)K.endEmitted?C(b,new d):ce(b,K,g,!0);else if(K.ended)C(b,new E);else{if(K.destroyed)return!1;K.reading=!1,K.decoder&&!k?(g=K.decoder.write(g),K.objectMode||g.length!==0?ce(b,K,g,!1):H(b,K)):ce(b,K,g,!1)}else P||(K.reading=!1,H(b,K))}return!K.ended&&(K.length=R?b=R:(b--,b|=b>>>1,b|=b>>>2,b|=b>>>4,b|=b>>>8,b|=b>>>16,b++),b}function N(b,g){return b<=0||g.length===0&&g.ended?0:g.objectMode?1:b!==b?g.flowing&&g.length?g.buffer.head.data.length:g.length:(b>g.highWaterMark&&(g.highWaterMark=M(b)),b<=g.length?b:g.ended?g.length:(g.needReadable=!0,0))}A.prototype.read=function(b){c("read",b),b=parseInt(b,10);var g=this._readableState,k=b;if(b!==0&&(g.emittedReadable=!1),b===0&&g.needReadable&&((g.highWaterMark!==0?g.length>=g.highWaterMark:g.length>0)||g.ended))return c("read: emitReadable",g.length,g.ended),g.length===0&&g.ended?O(this):B(this),null;if(b=N(b,g),b===0&&g.ended)return g.length===0&&O(this),null;var P=g.needReadable;c("need readable",P),(g.length===0||g.length-b0?ge=S(b,g):ge=null,ge===null?(g.needReadable=g.length<=g.highWaterMark,b=0):(g.length-=b,g.awaitDrain=0),g.length===0&&(g.ended||(g.needReadable=!0),k!==b&&g.ended&&O(this)),ge!==null&&this.emit("data",ge),ge};function L(b,g){if(c("onEofChunk"),!g.ended){if(g.decoder){var k=g.decoder.end();k&&k.length&&(g.buffer.push(k),g.length+=g.objectMode?1:k.length)}g.ended=!0,g.sync?B(b):(g.needReadable=!1,g.emittedReadable||(g.emittedReadable=!0,D(b)))}}function B(b){var g=b._readableState;c("emitReadable",g.needReadable,g.emittedReadable),g.needReadable=!1,g.emittedReadable||(c("emitReadable",g.flowing),g.emittedReadable=!0,process.nextTick(D,b))}function D(b){var g=b._readableState;c("emitReadable_",g.destroyed,g.length,g.ended),!g.destroyed&&(g.length||g.ended)&&(b.emit("readable"),g.emittedReadable=!1),g.needReadable=!g.flowing&&!g.ended&&g.length<=g.highWaterMark,w(b)}function H(b,g){g.readingMore||(g.readingMore=!0,process.nextTick(Y,b,g))}function Y(b,g){for(;!g.reading&&!g.ended&&(g.length1&&te(P.pipes,b)!==-1)&&!Tn&&(c("false write response, pause",P.awaitDrain),P.awaitDrain++),k.pause())}function Pr(Nt){c("onerror",Nt),Ut(),b.removeListener("error",Pr),e(b,"error")===0&&C(b,Nt)}j(b,"error",Pr);function $r(){b.removeListener("finish",Dr),Ut()}b.once("close",$r);function Dr(){c("onfinish"),b.removeListener("close",$r),Ut()}b.once("finish",Dr);function Ut(){c("unpipe"),k.unpipe(b)}return b.emit("pipe",k),P.flowing||(c("pipe resume"),k.resume()),b};function J(b){return function(){var k=b._readableState;c("pipeOnDrain",k.awaitDrain),k.awaitDrain&&k.awaitDrain--,k.awaitDrain===0&&e(b,"data")&&(k.flowing=!0,w(b))}}A.prototype.unpipe=function(b){var g=this._readableState,k={hasUnpiped:!1};if(g.pipesCount===0)return this;if(g.pipesCount===1)return b&&b!==g.pipes?this:(b||(b=g.pipes),g.pipes=null,g.pipesCount=0,g.flowing=!1,b&&b.emit("unpipe",this,k),this);if(!b){var P=g.pipes,ge=g.pipesCount;g.pipes=null,g.pipesCount=0,g.flowing=!1;for(var K=0;K0,P.flowing!==!1&&this.resume()):b==="readable"&&!P.endEmitted&&!P.readableListening&&(P.readableListening=P.needReadable=!0,P.flowing=!1,P.emittedReadable=!1,c("on readable",P.length,P.reading),P.length?B(this):P.reading||process.nextTick(he,this)),k},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(b,g){var k=r.prototype.removeListener.call(this,b,g);return b==="readable"&&process.nextTick(se,this),k},A.prototype.removeAllListeners=function(b){var g=r.prototype.removeAllListeners.apply(this,arguments);return(b==="readable"||b===void 0)&&process.nextTick(se,this),g};function se(b){var g=b._readableState;g.readableListening=b.listenerCount("readable")>0,g.resumeScheduled&&!g.paused?g.flowing=!0:b.listenerCount("data")>0&&b.resume()}function he(b){c("readable nexttick read 0"),b.read(0)}A.prototype.resume=function(){var b=this._readableState;return b.flowing||(c("resume"),b.flowing=!b.readableListening,le(this,b)),b.paused=!1,this};function le(b,g){g.resumeScheduled||(g.resumeScheduled=!0,process.nextTick(We,b,g))}function We(b,g){c("resume",g.reading),g.reading||b.read(0),g.resumeScheduled=!1,b.emit("resume"),w(b),g.flowing&&!g.reading&&b.read(0)}A.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function w(b){var g=b._readableState;for(c("flow",g.flowing);g.flowing&&b.read()!==null;);}A.prototype.wrap=function(b){var g=this,k=this._readableState,P=!1;b.on("end",function(){if(c("wrapped end"),k.decoder&&!k.ended){var fe=k.decoder.end();fe&&fe.length&&g.push(fe)}g.push(null)}),b.on("data",function(fe){if(c("wrapped data"),k.decoder&&(fe=k.decoder.write(fe)),!(k.objectMode&&fe==null)&&!(!k.objectMode&&(!fe||!fe.length))){var Ot=g.push(fe);Ot||(P=!0,b.pause())}});for(var ge in b)this[ge]===void 0&&typeof b[ge]=="function"&&(this[ge]=function(Ot){return function(){return b[Ot].apply(b,arguments)}}(ge));for(var K=0;K=g.length?(g.decoder?k=g.buffer.join(""):g.buffer.length===1?k=g.buffer.first():k=g.buffer.concat(g.length),g.buffer.clear()):k=g.buffer.consume(b,g.decoder),k}function O(b){var g=b._readableState;c("endReadable",g.endEmitted),g.endEmitted||(g.ended=!0,process.nextTick(z,g,b))}function z(b,g){if(c("endReadableNT",b.endEmitted,b.length),!b.endEmitted&&b.length===0&&(b.endEmitted=!0,g.readable=!1,g.emit("end"),b.autoDestroy)){var k=g._writableState;(!k||k.autoDestroy&&k.finished)&&g.destroy()}}typeof Symbol=="function"&&(A.from=function(b,g){return x===void 0&&(x=Wv()),x(A,b,g)});function te(b,g){for(var k=0,P=b.length;k0;return Xv(o,c,u,function(l){i||(i=l),l&&s.forEach(Fl),!c&&(s.forEach(Fl),n(i))})});return e.reduce(em)}var nm=rm;(function(t,e){e=t.exports=hd(),e.Stream=e,e.Readable=e,e.Writable=ld(),e.Duplex=on(),e.Transform=dd,e.PassThrough=Jv,e.finished=Jc,e.pipeline=nm})(pc,pc.exports);var gd=pc.exports;const{Transform:im}=gd;var sm=t=>class yd extends im{constructor(r,n,i,s,o){super(o),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._hashBitLength=s,this._options=o,this._state=new t,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(o){s=o}i(s)}_flush(r){let n=null;try{this.push(this.digest())}catch(i){n=i}r(n)}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}digest(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let n=this._state.squeeze(this._hashBitLength/8);return r!==void 0&&(n=n.toString(r)),this._resetState(),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new yd(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:om}=gd;var am=t=>class vd extends om{constructor(r,n,i,s){super(s),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._options=s,this._state=new t,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(o){s=o}i(s)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}squeeze(r,n){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let i=this._state.squeeze(r);return n!==void 0&&(i=i.toString(n)),i}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new vd(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const cm=sm,um=am;var lm=function(t){const e=cm(t),r=um(t);return function(n,i){switch(typeof n=="string"?n.toLowerCase():n){case"keccak224":return new e(1152,448,null,224,i);case"keccak256":return new e(1088,512,null,256,i);case"keccak384":return new e(832,768,null,384,i);case"keccak512":return new e(576,1024,null,512,i);case"sha3-224":return new e(1152,448,6,224,i);case"sha3-256":return new e(1088,512,6,256,i);case"sha3-384":return new e(832,768,6,384,i);case"sha3-512":return new e(576,1024,6,512,i);case"shake128":return new r(1344,256,31,i);case"shake256":return new r(1088,512,31,i);default:throw new Error("Invald algorithm: "+n)}}},md={};const Wl=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];md.p1600=function(t){for(let e=0;e<24;++e){const r=t[0]^t[10]^t[20]^t[30]^t[40],n=t[1]^t[11]^t[21]^t[31]^t[41],i=t[2]^t[12]^t[22]^t[32]^t[42],s=t[3]^t[13]^t[23]^t[33]^t[43],o=t[4]^t[14]^t[24]^t[34]^t[44],a=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],u=t[7]^t[17]^t[27]^t[37]^t[47],l=t[8]^t[18]^t[28]^t[38]^t[48],f=t[9]^t[19]^t[29]^t[39]^t[49];let h=l^(i<<1|s>>>31),p=f^(s<<1|i>>>31);const v=t[0]^h,E=t[1]^p,_=t[10]^h,d=t[11]^p,y=t[20]^h,m=t[21]^p,x=t[30]^h,C=t[31]^p,T=t[40]^h,j=t[41]^p;h=r^(o<<1|a>>>31),p=n^(a<<1|o>>>31);const $=t[2]^h,A=t[3]^p,U=t[12]^h,ce=t[13]^p,Z=t[22]^h,R=t[23]^p,M=t[32]^h,N=t[33]^p,L=t[42]^h,B=t[43]^p;h=i^(c<<1|u>>>31),p=s^(u<<1|c>>>31);const D=t[4]^h,H=t[5]^p,Y=t[14]^h,J=t[15]^p,se=t[24]^h,he=t[25]^p,le=t[34]^h,We=t[35]^p,w=t[44]^h,S=t[45]^p;h=o^(l<<1|f>>>31),p=a^(f<<1|l>>>31);const O=t[6]^h,z=t[7]^p,te=t[16]^h,b=t[17]^p,g=t[26]^h,k=t[27]^p,P=t[36]^h,ge=t[37]^p,K=t[46]^h,fe=t[47]^p;h=c^(r<<1|n>>>31),p=u^(n<<1|r>>>31);const Ot=t[8]^h,or=t[9]^p,Tn=t[18]^h,Mi=t[19]^p,On=t[28]^h,Pr=t[29]^p,$r=t[38]^h,Dr=t[39]^p,Ut=t[48]^h,Nt=t[49]^p,vt=v,mo=E,_o=d<<4|_>>>28,wo=_<<4|d>>>28,So=y<<3|m>>>29,Eo=m<<3|y>>>29,Co=C<<9|x>>>23,xo=x<<9|C>>>23,Io=T<<18|j>>>14,Ro=j<<18|T>>>14,Ao=$<<1|A>>>31,Mo=A<<1|$>>>31,ko=ce<<12|U>>>20,To=U<<12|ce>>>20,Oo=Z<<10|R>>>22,No=R<<10|Z>>>22,Lo=N<<13|M>>>19,Po=M<<13|N>>>19,$o=L<<2|B>>>30,Do=B<<2|L>>>30,jo=H<<30|D>>>2,Bo=D<<30|H>>>2,Fo=Y<<6|J>>>26,Wo=J<<6|Y>>>26,Ho=he<<11|se>>>21,Vo=se<<11|he>>>21,Uo=le<<15|We>>>17,zo=We<<15|le>>>17,qo=S<<29|w>>>3,Go=w<<29|S>>>3,Jo=O<<28|z>>>4,Qo=z<<28|O>>>4,Zo=b<<23|te>>>9,Yo=te<<23|b>>>9,Ko=g<<25|k>>>7,Xo=k<<25|g>>>7,ea=P<<21|ge>>>11,ta=ge<<21|P>>>11,ra=fe<<24|K>>>8,na=K<<24|fe>>>8,ia=Ot<<27|or>>>5,sa=or<<27|Ot>>>5,oa=Tn<<20|Mi>>>12,aa=Mi<<20|Tn>>>12,ca=Pr<<7|On>>>25,ua=On<<7|Pr>>>25,la=$r<<8|Dr>>>24,fa=Dr<<8|$r>>>24,ha=Ut<<14|Nt>>>18,da=Nt<<14|Ut>>>18;t[0]=vt^~ko&Ho,t[1]=mo^~To&Vo,t[10]=Jo^~oa&So,t[11]=Qo^~aa&Eo,t[20]=Ao^~Fo&Ko,t[21]=Mo^~Wo&Xo,t[30]=ia^~_o&Oo,t[31]=sa^~wo&No,t[40]=jo^~Zo&ca,t[41]=Bo^~Yo&ua,t[2]=ko^~Ho&ea,t[3]=To^~Vo&ta,t[12]=oa^~So&Lo,t[13]=aa^~Eo&Po,t[22]=Fo^~Ko&la,t[23]=Wo^~Xo&fa,t[32]=_o^~Oo&Uo,t[33]=wo^~No&zo,t[42]=Zo^~ca&Co,t[43]=Yo^~ua&xo,t[4]=Ho^~ea&ha,t[5]=Vo^~ta&da,t[14]=So^~Lo&qo,t[15]=Eo^~Po&Go,t[24]=Ko^~la&Io,t[25]=Xo^~fa&Ro,t[34]=Oo^~Uo&ra,t[35]=No^~zo&na,t[44]=ca^~Co&$o,t[45]=ua^~xo&Do,t[6]=ea^~ha&vt,t[7]=ta^~da&mo,t[16]=Lo^~qo&Jo,t[17]=Po^~Go&Qo,t[26]=la^~Io&Ao,t[27]=fa^~Ro&Mo,t[36]=Uo^~ra&ia,t[37]=zo^~na&sa,t[46]=Co^~$o&jo,t[47]=xo^~Do&Bo,t[8]=ha^~vt&ko,t[9]=da^~mo&To,t[18]=qo^~Jo&oa,t[19]=Go^~Qo&aa,t[28]=Io^~Ao&Fo,t[29]=Ro^~Mo&Wo,t[38]=ra^~ia&_o,t[39]=na^~sa&wo,t[48]=$o^~jo&Zo,t[49]=Do^~Bo&Yo,t[0]^=Wl[e*2],t[1]^=Wl[e*2+1]}};const is=md;function En(){this.state=[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],this.blockSize=null,this.count=0,this.squeezing=!1}En.prototype.initialize=function(t,e){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=t/8,this.count=0,this.squeezing=!1};En.prototype.absorb=function(t){for(let e=0;e>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(is.p1600(this.state),this.count=0);return e};En.prototype.copy=function(t){for(let e=0;e<50;++e)t.state[e]=this.state[e];t.blockSize=this.blockSize,t.count=this.count,t.squeezing=this.squeezing};var fm=En,hm=lm(fm);const dm=hm,pm=ds;function _d(t){return Buffer.allocUnsafe(t).fill(0)}function wd(t,e,r){const n=_d(e);return t=Is(t),r?t.length"u")throw new Error("Not an array?");if(r=Id(t),r!=="dynamic"&&r!==0&&e.length>r)throw new Error("Elements exceed array size: "+r);i=[],t=t.slice(0,t.lastIndexOf("[")),typeof e=="string"&&(e=JSON.parse(e));for(s in e)i.push(Et(t,e[s]));if(r==="dynamic"){var o=Et("uint256",e.length);i.unshift(o)}return Buffer.concat(i)}else{if(t==="bytes")return e=new Buffer(e),i=Buffer.concat([Et("uint256",e.length),e]),e.length%32!==0&&(i=Buffer.concat([i,wr.zeros(32-e.length%32)])),i;if(t.startsWith("bytes")){if(r=Yr(t),r<1||r>32)throw new Error("Invalid bytes width: "+r);return wr.setLengthRight(e,32)}else if(t.startsWith("uint")){if(r=Yr(t),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);if(n=fr(e),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(Buffer,"be",32)}else if(t.startsWith("int")){if(r=Yr(t),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);if(n=fr(e),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(Buffer,"be",32)}else if(t.startsWith("ufixed")){if(r=Hl(t),n=fr(e),n<0)throw new Error("Supplied ufixed is negative");return Et("uint256",n.mul(new gr(2).pow(new gr(r[1]))))}else if(t.startsWith("fixed"))return r=Hl(t),Et("int256",fr(e).mul(new gr(2).pow(new gr(r[1]))))}throw new Error("Unsupported or invalid type: "+t)}function mm(t){return t==="string"||t==="bytes"||Id(t)==="dynamic"}function _m(t){return t.lastIndexOf("]")===t.length-1}function wm(t,e){var r=[],n=[],i=32*t.length;for(var s in t){var o=xd(t[s]),a=e[s],c=Et(o,a);mm(o)?(r.push(Et("uint256",i)),n.push(c),i+=c.length):r.push(c)}return Buffer.concat(r.concat(n))}function Rd(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var r,n,i=[],s=0;s32)throw new Error("Invalid bytes width: "+r);i.push(wr.setLengthRight(a,r))}else if(o.startsWith("uint")){if(r=Yr(o),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);if(n=fr(a),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());i.push(n.toArrayLike(Buffer,"be",r/8))}else if(o.startsWith("int")){if(r=Yr(o),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);if(n=fr(a),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());i.push(n.toTwos(r).toArrayLike(Buffer,"be",r/8))}else throw new Error("Unsupported or invalid type: "+o)}return Buffer.concat(i)}function Sm(t,e){return wr.keccak(Rd(t,e))}var Em={rawEncode:wm,solidityPack:Rd,soliditySHA3:Sm};const ft=Cd,Un=Em,Ad={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},Oa={encodeData(t,e,r,n=!0){const i=["bytes32"],s=[this.hashType(t,r)];if(n){const o=(a,c,u)=>{if(r[c]!==void 0)return["bytes32",u==null?"0x0000000000000000000000000000000000000000000000000000000000000000":ft.keccak(this.encodeData(c,u,r,n))];if(u===void 0)throw new Error(`missing value for field ${a} of type ${c}`);if(c==="bytes")return["bytes32",ft.keccak(u)];if(c==="string")return typeof u=="string"&&(u=Buffer.from(u,"utf8")),["bytes32",ft.keccak(u)];if(c.lastIndexOf("]")===c.length-1){const l=c.slice(0,c.lastIndexOf("[")),f=u.map(h=>o(a,l,h));return["bytes32",ft.keccak(Un.rawEncode(f.map(([h])=>h),f.map(([,h])=>h)))]}return[c,u]};for(const a of r[t]){const[c,u]=o(a.name,a.type,e[a.name]);i.push(c),s.push(u)}}else for(const o of r[t]){let a=e[o.name];if(a!==void 0)if(o.type==="bytes")i.push("bytes32"),a=ft.keccak(a),s.push(a);else if(o.type==="string")i.push("bytes32"),typeof a=="string"&&(a=Buffer.from(a,"utf8")),a=ft.keccak(a),s.push(a);else if(r[o.type]!==void 0)i.push("bytes32"),a=ft.keccak(this.encodeData(o.type,a,r,n)),s.push(a);else{if(o.type.lastIndexOf("]")===o.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(o.type),s.push(a)}}return Un.rawEncode(i,s)},encodeType(t,e){let r="",n=this.findTypeDependencies(t,e).filter(i=>i!==t);n=[t].concat(n.sort());for(const i of n){if(!e[i])throw new Error("No type definition specified: "+i);r+=i+"("+e[i].map(({name:o,type:a})=>a+" "+o).join(",")+")"}return r},findTypeDependencies(t,e,r=[]){if(t=t.match(/^\w*/)[0],r.includes(t)||e[t]===void 0)return r;r.push(t);for(const n of e[t])for(const i of this.findTypeDependencies(n.type,e,r))!r.includes(i)&&r.push(i);return r},hashStruct(t,e,r,n=!0){return ft.keccak(this.encodeData(t,e,r,n))},hashType(t,e){return ft.keccak(this.encodeType(t,e))},sanitizeData(t){const e={};for(const r in Ad.properties)t[r]&&(e[r]=t[r]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash(t,e=!0){const r=this.sanitizeData(t),n=[Buffer.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,e)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,e)),ft.keccak(Buffer.concat(n))}};var Cm={TYPED_MESSAGE_SCHEMA:Ad,TypedDataUtils:Oa,hashForSignTypedDataLegacy:function(t){return xm(t.data)},hashForSignTypedData_v3:function(t){return Oa.hash(t.data,!1)},hashForSignTypedData_v4:function(t){return Oa.hash(t.data)}};function xm(t){const e=new Error("Expect argument to be non-empty array");if(typeof t!="object"||!t.length)throw e;const r=t.map(function(s){return s.type==="bytes"?ft.toBuffer(s.value):s.value}),n=t.map(function(s){return s.type}),i=t.map(function(s){if(!s.name)throw e;return s.type+" "+s.name});return Un.soliditySHA3(["bytes32","bytes32"],[Un.soliditySHA3(new Array(t.length).fill("string"),i),Un.soliditySHA3(n,r)])}var an={};Object.defineProperty(an,"__esModule",{value:!0});an.filterFromParam=an.FilterPolyfill=void 0;const qr=ui,He=W,Im=5*60*1e3,hr={jsonrpc:"2.0",id:0};class Rm{constructor(e){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,qr.IntNumber)(1),this.provider=e}async newFilter(e){const r=Md(e),n=this.makeFilterId(),i=await this.setInitialCursorPosition(n,r.fromBlock);return console.log(`Installing new log filter(${n}):`,r,"initial cursor position:",i),this.logFilters.set(n,r),this.setFilterTimeout(n),(0,He.hexStringFromIntNumber)(n)}async newBlockFilter(){const e=this.makeFilterId(),r=await this.setInitialCursorPosition(e,"latest");return console.log(`Installing new block filter (${e}) with initial cursor position:`,r),this.blockFilters.add(e),this.setFilterTimeout(e),(0,He.hexStringFromIntNumber)(e)}async newPendingTransactionFilter(){const e=this.makeFilterId(),r=await this.setInitialCursorPosition(e,"latest");return console.log(`Installing new block filter (${e}) with initial cursor position:`,r),this.pendingTransactionFilters.add(e),this.setFilterTimeout(e),(0,He.hexStringFromIntNumber)(e)}uninstallFilter(e){const r=(0,He.intNumberFromHexString)(e);return console.log(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(e){const r=(0,He.intNumberFromHexString)(e);return this.timeouts.has(r)&&this.setFilterTimeout(r),this.logFilters.has(r)?this.getLogFilterChanges(r):this.blockFilters.has(r)?this.getBlockFilterChanges(r):this.pendingTransactionFilters.has(r)?this.getPendingTransactionFilterChanges(r):Promise.resolve(Ni())}async getFilterLogs(e){const r=(0,He.intNumberFromHexString)(e),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},hr),{method:"eth_getLogs",params:[Vl(n)]})):Ni()}makeFilterId(){return(0,qr.IntNumber)(++this.nextFilterId)}sendAsyncPromise(e){return new Promise((r,n)=>{this.provider.sendAsync(e,(i,s)=>{if(i)return n(i);if(Array.isArray(s)||s==null)return n(new Error(`unexpected response received: ${JSON.stringify(s)}`));r(s)})})}deleteFilter(e){console.log(`Deleting filter (${e})`),this.logFilters.delete(e),this.blockFilters.delete(e),this.pendingTransactionFilters.delete(e),this.cursors.delete(e),this.timeouts.delete(e)}async getLogFilterChanges(e){const r=this.logFilters.get(e),n=this.cursors.get(e);if(!n||!r)return Ni();const i=await this.getCurrentBlockHeight(),s=r.toBlock==="latest"?i:r.toBlock;if(n>i||n>r.toBlock)return Li();console.log(`Fetching logs from ${n} to ${s} for filter ${e}`);const o=await this.sendAsyncPromise(Object.assign(Object.assign({},hr),{method:"eth_getLogs",params:[Vl(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:s}))]}));if(Array.isArray(o.result)){const a=o.result.map(u=>(0,He.intNumberFromHexString)(u.blockNumber||"0x0")),c=Math.max(...a);if(c&&c>n){const u=(0,qr.IntNumber)(c+1);console.log(`Moving cursor position for filter (${e}) from ${n} to ${u}`),this.cursors.set(e,u)}}return o}async getBlockFilterChanges(e){const r=this.cursors.get(e);if(!r)return Ni();const n=await this.getCurrentBlockHeight();if(r>n)return Li();console.log(`Fetching blocks from ${r} to ${n} for filter (${e})`);const i=(await Promise.all((0,He.range)(r,n+1).map(o=>this.getBlockHashByNumber((0,qr.IntNumber)(o))))).filter(o=>!!o),s=(0,qr.IntNumber)(r+i.length);return console.log(`Moving cursor position for filter (${e}) from ${r} to ${s}`),this.cursors.set(e,s),Object.assign(Object.assign({},hr),{result:i})}async getPendingTransactionFilterChanges(e){return Promise.resolve(Li())}async setInitialCursorPosition(e,r){const n=await this.getCurrentBlockHeight(),i=typeof r=="number"&&r>n?r:n;return this.cursors.set(e,i),i}setFilterTimeout(e){const r=this.timeouts.get(e);r&&window.clearTimeout(r);const n=window.setTimeout(()=>{console.log(`Filter (${e}) timed out`),this.deleteFilter(e)},Im);this.timeouts.set(e,n)}async getCurrentBlockHeight(){const{result:e}=await this.sendAsyncPromise(Object.assign(Object.assign({},hr),{method:"eth_blockNumber",params:[]}));return(0,He.intNumberFromHexString)((0,He.ensureHexString)(e))}async getBlockHashByNumber(e){const r=await this.sendAsyncPromise(Object.assign(Object.assign({},hr),{method:"eth_getBlockByNumber",params:[(0,He.hexStringFromIntNumber)(e),!1]}));return r.result&&typeof r.result.hash=="string"?(0,He.ensureHexString)(r.result.hash):null}}an.FilterPolyfill=Rm;function Md(t){return{fromBlock:Ul(t.fromBlock),toBlock:Ul(t.toBlock),addresses:t.address===void 0?null:Array.isArray(t.address)?t.address:[t.address],topics:t.topics||[]}}an.filterFromParam=Md;function Vl(t){const e={fromBlock:zl(t.fromBlock),toBlock:zl(t.toBlock),topics:t.topics};return t.addresses!==null&&(e.address=t.addresses),e}function Ul(t){if(t===void 0||t==="latest"||t==="pending")return"latest";if(t==="earliest")return(0,qr.IntNumber)(0);if((0,He.isHexString)(t))return(0,He.intNumberFromHexString)(t);throw new Error(`Invalid block option: ${String(t)}`)}function zl(t){return t==="latest"?t:(0,He.hexStringFromIntNumber)(t)}function Ni(){return Object.assign(Object.assign({},hr),{error:{code:-32e3,message:"filter not found"}})}function Li(){return Object.assign(Object.assign({},hr),{result:[]})}var kd={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.JSONRPCMethod=void 0,function(e){e.eth_accounts="eth_accounts",e.eth_coinbase="eth_coinbase",e.net_version="net_version",e.eth_chainId="eth_chainId",e.eth_uninstallFilter="eth_uninstallFilter",e.eth_requestAccounts="eth_requestAccounts",e.eth_sign="eth_sign",e.eth_ecRecover="eth_ecRecover",e.personal_sign="personal_sign",e.personal_ecRecover="personal_ecRecover",e.eth_signTransaction="eth_signTransaction",e.eth_sendRawTransaction="eth_sendRawTransaction",e.eth_sendTransaction="eth_sendTransaction",e.eth_signTypedData_v1="eth_signTypedData_v1",e.eth_signTypedData_v2="eth_signTypedData_v2",e.eth_signTypedData_v3="eth_signTypedData_v3",e.eth_signTypedData_v4="eth_signTypedData_v4",e.eth_signTypedData="eth_signTypedData",e.cbWallet_arbitrary="walletlink_arbitrary",e.wallet_addEthereumChain="wallet_addEthereumChain",e.wallet_switchEthereumChain="wallet_switchEthereumChain",e.wallet_watchAsset="wallet_watchAsset",e.eth_subscribe="eth_subscribe",e.eth_unsubscribe="eth_unsubscribe",e.eth_newFilter="eth_newFilter",e.eth_newBlockFilter="eth_newBlockFilter",e.eth_newPendingTransactionFilter="eth_newPendingTransactionFilter",e.eth_getFilterChanges="eth_getFilterChanges",e.eth_getFilterLogs="eth_getFilterLogs"}(t.JSONRPCMethod||(t.JSONRPCMethod={}))})(kd);var Rs={},Td={},As={},Qc=Am;function Am(t){t=t||{};var e=t.max||Number.MAX_SAFE_INTEGER,r=typeof t.start<"u"?t.start:Math.floor(Math.random()*e);return function(){return r=r%e,r++}}const ql=(t,e)=>function(){const r=e.promiseModule,n=new Array(arguments.length);for(let i=0;i{e.errorFirst?n.push(function(o,a){if(e.multiArgs){const c=new Array(arguments.length-1);for(let u=1;u{e=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},e);const r=i=>{const s=o=>typeof o=="string"?i===o:o.test(i);return e.include?e.include.some(s):!e.exclude.some(s)};let n;typeof t=="function"?n=function(){return e.excludeMain?t.apply(this,arguments):ql(t,e).apply(this,arguments)}:n=Object.create(Object.getPrototypeOf(t));for(const i in t){const s=t[i];n[i]=typeof s=="function"&&r(i)?ql(s,e):s}return n},hi={},km=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(hi,"__esModule",{value:!0});hi.BaseBlockTracker=void 0;const Tm=km(Ir),Om=1e3,Nm=(t,e)=>t+e,Gl=["sync","latest"];class Lm extends Tm.default{constructor(e){super(),this._blockResetDuration=e.blockResetDuration||20*Om,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(r=>this.once("latest",r))}removeAllListeners(e){return e?super.removeAllListeners(e):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(e){Gl.includes(e)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return Gl.map(e=>this.listenerCount(e)).reduce(Nm)}_newPotentialLatest(e){const r=this._currentBlock;r&&Jl(e)<=Jl(r)||this._setCurrentBlock(e)}_setCurrentBlock(e){const r=this._currentBlock;this._currentBlock=e,this.emit("latest",e),this.emit("sync",{oldBlock:r,newBlock:e})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}hi.BaseBlockTracker=Lm;function Jl(t){return Number.parseInt(t,16)}var Od={},Nd={},$e={};class Ld extends TypeError{constructor(e,r){let n;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=()=>n??(n=[e,...r()])}}function Pm(t){return ot(t)&&typeof t[Symbol.iterator]=="function"}function ot(t){return typeof t=="object"&&t!=null}function Ql(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function Re(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function $m(t){const{done:e,value:r}=t.next();return e?void 0:r}function Dm(t,e,r,n){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:i,branch:s}=e,{type:o}=r,{refinement:a,message:c=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${Re(n)}\``}=t;return{value:n,type:o,refinement:a,key:i[i.length-1],path:i,branch:s,...t,message:c}}function*gc(t,e,r,n){Pm(t)||(t=[t]);for(const i of t){const s=Dm(i,e,r,n);s&&(yield s)}}function*Zc(t,e,r={}){const{path:n=[],branch:i=[t],coerce:s=!1,mask:o=!1}=r,a={path:n,branch:i};if(s&&(t=e.coercer(t,a),o&&e.type!=="type"&&ot(e.schema)&&ot(t)&&!Array.isArray(t)))for(const u in t)e.schema[u]===void 0&&delete t[u];let c="valid";for(const u of e.validator(t,a))u.explanation=r.message,c="not_valid",yield[u,void 0];for(let[u,l,f]of e.entries(t,a)){const h=Zc(l,f,{path:u===void 0?n:[...n,u],branch:u===void 0?i:[...i,l],coerce:s,mask:o,message:r.message});for(const p of h)p[0]?(c=p[0].refinement!=null?"not_refined":"not_valid",yield[p[0],void 0]):s&&(l=p[1],u===void 0?t=l:t instanceof Map?t.set(u,l):t instanceof Set?t.add(l):ot(t)&&(l!==void 0||u in t)&&(t[u]=l))}if(c!=="not_valid")for(const u of e.refiner(t,a))u.explanation=r.message,c="not_refined",yield[u,void 0];c==="valid"&&(yield[void 0,t])}class Ce{constructor(e){const{type:r,schema:n,validator:i,refiner:s,coercer:o=c=>c,entries:a=function*(){}}=e;this.type=r,this.schema=n,this.entries=a,this.coercer=o,i?this.validator=(c,u)=>{const l=i(c,u);return gc(l,u,this,c)}:this.validator=()=>[],s?this.refiner=(c,u)=>{const l=s(c,u);return gc(l,u,this,c)}:this.refiner=()=>[]}assert(e,r){return Pd(e,this,r)}create(e,r){return $d(e,this,r)}is(e){return Yc(e,this)}mask(e,r){return Dd(e,this,r)}validate(e,r={}){return Cn(e,this,r)}}function Pd(t,e,r){const n=Cn(t,e,{message:r});if(n[0])throw n[0]}function $d(t,e,r){const n=Cn(t,e,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function Dd(t,e,r){const n=Cn(t,e,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function Yc(t,e){return!Cn(t,e)[0]}function Cn(t,e,r={}){const n=Zc(t,e,r),i=$m(n);return i[0]?[new Ld(i[0],function*(){for(const o of n)o[0]&&(yield o[0])}),void 0]:[void 0,i[1]]}function jm(...t){const e=t[0].type==="type",r=t.map(i=>i.schema),n=Object.assign({},...r);return e?Xc(n):di(n)}function Je(t,e){return new Ce({type:t,schema:null,validator:e})}function Bm(t,e){return new Ce({...t,refiner:(r,n)=>r===void 0||t.refiner(r,n),validator(r,n){return r===void 0?!0:(e(r,n),t.validator(r,n))}})}function Fm(t){return new Ce({type:"dynamic",schema:null,*entries(e,r){yield*t(e,r).entries(e,r)},validator(e,r){return t(e,r).validator(e,r)},coercer(e,r){return t(e,r).coercer(e,r)},refiner(e,r){return t(e,r).refiner(e,r)}})}function Wm(t){let e;return new Ce({type:"lazy",schema:null,*entries(r,n){e??(e=t()),yield*e.entries(r,n)},validator(r,n){return e??(e=t()),e.validator(r,n)},coercer(r,n){return e??(e=t()),e.coercer(r,n)},refiner(r,n){return e??(e=t()),e.refiner(r,n)}})}function Hm(t,e){const{schema:r}=t,n={...r};for(const i of e)delete n[i];switch(t.type){case"type":return Xc(n);default:return di(n)}}function Vm(t){const e=t instanceof Ce?{...t.schema}:{...t};for(const r in e)e[r]=jd(e[r]);return di(e)}function Um(t,e){const{schema:r}=t,n={};for(const i of e)n[i]=r[i];return di(n)}function zm(t,e){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),Je(t,e)}function qm(){return Je("any",()=>!0)}function Gm(t){return new Ce({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[r,n]of e.entries())yield[r,n,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${Re(e)}`}})}function Jm(){return Je("bigint",t=>typeof t=="bigint")}function Qm(){return Je("boolean",t=>typeof t=="boolean")}function Zm(){return Je("date",t=>t instanceof Date&&!isNaN(t.getTime())||`Expected a valid \`Date\` object, but received: ${Re(t)}`)}function Ym(t){const e={},r=t.map(n=>Re(n)).join();for(const n of t)e[n]=n;return new Ce({type:"enums",schema:e,validator(n){return t.includes(n)||`Expected one of \`${r}\`, but received: ${Re(n)}`}})}function Km(){return Je("func",t=>typeof t=="function"||`Expected a function, but received: ${Re(t)}`)}function Xm(t){return Je("instance",e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${Re(e)}`)}function e1(){return Je("integer",t=>typeof t=="number"&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${Re(t)}`)}function t1(t){return new Ce({type:"intersection",schema:null,*entries(e,r){for(const n of t)yield*n.entries(e,r)},*validator(e,r){for(const n of t)yield*n.validator(e,r)},*refiner(e,r){for(const n of t)yield*n.refiner(e,r)}})}function r1(t){const e=Re(t),r=typeof t;return new Ce({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(n){return n===t||`Expected the literal \`${e}\`, but received: ${Re(n)}`}})}function n1(t,e){return new Ce({type:"map",schema:null,*entries(r){if(t&&e&&r instanceof Map)for(const[n,i]of r.entries())yield[n,n,t],yield[n,i,e]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${Re(r)}`}})}function Kc(){return Je("never",()=>!1)}function i1(t){return new Ce({...t,validator:(e,r)=>e===null||t.validator(e,r),refiner:(e,r)=>e===null||t.refiner(e,r)})}function s1(){return Je("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${Re(t)}`)}function di(t){const e=t?Object.keys(t):[],r=Kc();return new Ce({type:"object",schema:t||null,*entries(n){if(t&&ot(n)){const i=new Set(Object.keys(n));for(const s of e)i.delete(s),yield[s,n[s],t[s]];for(const s of i)yield[s,n[s],r]}},validator(n){return ot(n)||`Expected an object, but received: ${Re(n)}`},coercer(n){return ot(n)?{...n}:n}})}function jd(t){return new Ce({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function o1(t,e){return new Ce({type:"record",schema:null,*entries(r){if(ot(r))for(const n in r){const i=r[n];yield[n,n,t],yield[n,i,e]}},validator(r){return ot(r)||`Expected an object, but received: ${Re(r)}`}})}function a1(){return Je("regexp",t=>t instanceof RegExp)}function c1(t){return new Ce({type:"set",schema:null,*entries(e){if(t&&e instanceof Set)for(const r of e)yield[r,r,t]},coercer(e){return e instanceof Set?new Set(e):e},validator(e){return e instanceof Set||`Expected a \`Set\` object, but received: ${Re(e)}`}})}function Bd(){return Je("string",t=>typeof t=="string"||`Expected a string, but received: ${Re(t)}`)}function u1(t){const e=Kc();return new Ce({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(t.length,r.length);for(let i=0;ir.type).join(" | ");return new Ce({type:"union",schema:null,coercer(r){for(const n of t){const[i,s]=n.validate(r,{coerce:!0});if(!i)return s}return r},validator(r,n){const i=[];for(const s of t){const[...o]=Zc(r,s,n),[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: ${Re(r)}`,...i]}})}function Fd(){return Je("unknown",()=>!0)}function eu(t,e,r){return new Ce({...t,coercer:(n,i)=>Yc(n,e)?t.coercer(r(n,i),i):t.coercer(n,i)})}function f1(t,e,r={}){return eu(t,Fd(),n=>{const i=typeof e=="function"?e():e;if(n===void 0)return i;if(!r.strict&&Ql(n)&&Ql(i)){const s={...n};let o=!1;for(const a in i)s[a]===void 0&&(s[a]=i[a],o=!0);if(o)return s}return n})}function h1(t){return eu(t,Bd(),e=>e.trim())}function d1(t){return Tr(t,"empty",e=>{const r=Wd(e);return r===0||`Expected an empty ${t.type} but received one with a size of \`${r}\``})}function Wd(t){return t instanceof Map||t instanceof Set?t.size:t.length}function p1(t,e,r={}){const{exclusive:n}=r;return Tr(t,"max",i=>n?in?i>e:i>=e||`Expected a ${t.type} greater than ${n?"":"or equal to "}${e} but received \`${i}\``)}function g1(t){return Tr(t,"nonempty",e=>Wd(e)>0||`Expected a nonempty ${t.type} but received an empty one`)}function y1(t,e){return Tr(t,"pattern",r=>e.test(r)||`Expected a ${t.type} matching \`/${e.source}/\` but received "${r}"`)}function v1(t,e,r=e){const n=`Expected a ${t.type}`,i=e===r?`of \`${e}\``:`between \`${e}\` and \`${r}\``;return Tr(t,"size",s=>{if(typeof s=="number"||s instanceof Date)return e<=s&&s<=r||`${n} ${i} but received \`${s}\``;if(s instanceof Map||s instanceof Set){const{size:o}=s;return e<=o&&o<=r||`${n} with a size ${i} but received one with a size of \`${o}\``}else{const{length:o}=s;return e<=o&&o<=r||`${n} with a length ${i} but received one with a length of \`${o}\``}})}function Tr(t,e,r){return new Ce({...t,*refiner(n,i){yield*t.refiner(n,i);const s=r(n,i),o=gc(s,i,t,n);for(const a of o)yield{...a,refinement:e}}})}const m1=Object.freeze(Object.defineProperty({__proto__:null,Struct:Ce,StructError:Ld,any:qm,array:Gm,assert:Pd,assign:jm,bigint:Jm,boolean:Qm,coerce:eu,create:$d,date:Zm,defaulted:f1,define:Je,deprecated:Bm,dynamic:Fm,empty:d1,enums:Ym,func:Km,instance:Xm,integer:e1,intersection:t1,is:Yc,lazy:Wm,literal:r1,map:n1,mask:Dd,max:p1,min:b1,never:Kc,nonempty:g1,nullable:i1,number:s1,object:di,omit:Hm,optional:jd,partial:Vm,pattern:y1,pick:Um,record:o1,refine:Tr,regexp:a1,set:c1,size:v1,string:Bd,struct:zm,trimmed:h1,tuple:u1,type:Xc,union:l1,unknown:Fd,validate:Cn},Symbol.toStringTag,{value:"Module"})),Or=xr(m1);Object.defineProperty($e,"__esModule",{value:!0});$e.assertExhaustive=$e.assertStruct=$e.assert=$e.AssertionError=void 0;const _1=Or;function w1(t){return typeof t=="object"&&t!==null&&"message"in t}function S1(t){var e,r;return typeof((r=(e=t==null?void 0:t.prototype)===null||e===void 0?void 0:e.constructor)===null||r===void 0?void 0:r.name)=="string"}function E1(t){const e=w1(t)?t.message:String(t);return e.endsWith(".")?e.slice(0,-1):e}function Hd(t,e){return S1(t)?new t({message:e}):t({message:e})}class tu extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}$e.AssertionError=tu;function C1(t,e="Assertion failed.",r=tu){if(!t)throw e instanceof Error?e:Hd(r,e)}$e.assert=C1;function x1(t,e,r="Assertion failed",n=tu){try{(0,_1.assert)(t,e)}catch(i){throw Hd(n,`${r}: ${E1(i)}.`)}}$e.assertStruct=x1;function I1(t){throw new Error("Invalid branch reached. Should be detected during compilation.")}$e.assertExhaustive=I1;var pi={};Object.defineProperty(pi,"__esModule",{value:!0});pi.base64=void 0;const R1=Or,A1=$e,M1=(t,e={})=>{var r,n;const i=(r=e.paddingRequired)!==null&&r!==void 0?r:!1,s=(n=e.characterSet)!==null&&n!==void 0?n:"base64";let o;s==="base64"?o=String.raw`[A-Za-z0-9+\/]`:((0,A1.assert)(s==="base64url"),o=String.raw`[-_A-Za-z0-9]`);let a;return i?a=new RegExp(`^(?:${o}{4})*(?:${o}{3}=|${o}{2}==)?$`,"u"):a=new RegExp(`^(?:${o}{4})*(?:${o}{2,3}|${o}{3}=|${o}{2}==)?$`,"u"),(0,R1.pattern)(t,a)};pi.base64=M1;var oe={},bi={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.remove0x=t.add0x=t.assertIsStrictHexString=t.assertIsHexString=t.isStrictHexString=t.isHexString=t.StrictHexStruct=t.HexStruct=void 0;const e=Or,r=$e;t.HexStruct=(0,e.pattern)((0,e.string)(),/^(?:0x)?[0-9a-f]+$/iu),t.StrictHexStruct=(0,e.pattern)((0,e.string)(),/^0x[0-9a-f]+$/iu);function n(u){return(0,e.is)(u,t.HexStruct)}t.isHexString=n;function i(u){return(0,e.is)(u,t.StrictHexStruct)}t.isStrictHexString=i;function s(u){(0,r.assert)(n(u),"Value must be a hexadecimal string.")}t.assertIsHexString=s;function o(u){(0,r.assert)(i(u),'Value must be a hexadecimal string, starting with "0x".')}t.assertIsStrictHexString=o;function a(u){return u.startsWith("0x")?u:u.startsWith("0X")?`0x${u.substring(2)}`:`0x${u}`}t.add0x=a;function c(u){return u.startsWith("0x")||u.startsWith("0X")?u.substring(2):u}t.remove0x=c})(bi);Object.defineProperty(oe,"__esModule",{value:!0});oe.createDataView=oe.concatBytes=oe.valueToBytes=oe.stringToBytes=oe.numberToBytes=oe.signedBigIntToBytes=oe.bigIntToBytes=oe.hexToBytes=oe.bytesToString=oe.bytesToNumber=oe.bytesToSignedBigInt=oe.bytesToBigInt=oe.bytesToHex=oe.assertIsBytes=oe.isBytes=void 0;const Ze=$e,yc=bi,Zl=48,Yl=58,Kl=87;function k1(){const t=[];return()=>{if(t.length===0)for(let e=0;e<256;e++)t.push(e.toString(16).padStart(2,"0"));return t}}const T1=k1();function ru(t){return t instanceof Uint8Array}oe.isBytes=ru;function xn(t){(0,Ze.assert)(ru(t),"Value must be a Uint8Array.")}oe.assertIsBytes=xn;function Vd(t){if(xn(t),t.length===0)return"0x";const e=T1(),r=new Array(t.length);for(let n=0;n=BigInt(0),"Value must be a non-negative bigint.");const e=t.toString(16);return Ms(e)}oe.bigIntToBytes=zd;function P1(t,e){(0,Ze.assert)(e>0);const r=t>>BigInt(31);return!((~t&r)+(t&~r)>>BigInt(e*8+-1))}function $1(t,e){(0,Ze.assert)(typeof t=="bigint","Value must be a bigint."),(0,Ze.assert)(typeof e=="number","Byte length must be a number."),(0,Ze.assert)(e>0,"Byte length must be greater than 0."),(0,Ze.assert)(P1(t,e),"Byte length is too small to represent the given value.");let r=t;const n=new Uint8Array(e);for(let i=0;i>=BigInt(8);return n.reverse()}oe.signedBigIntToBytes=$1;function qd(t){(0,Ze.assert)(typeof t=="number","Value must be a number."),(0,Ze.assert)(t>=0,"Value must be a non-negative number."),(0,Ze.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToBytes` instead.");const e=t.toString(16);return Ms(e)}oe.numberToBytes=qd;function Gd(t){return(0,Ze.assert)(typeof t=="string","Value must be a string."),new TextEncoder().encode(t)}oe.stringToBytes=Gd;function Jd(t){if(typeof t=="bigint")return zd(t);if(typeof t=="number")return qd(t);if(typeof t=="string")return t.startsWith("0x")?Ms(t):Gd(t);if(ru(t))return t;throw new TypeError(`Unsupported value type: "${typeof t}".`)}oe.valueToBytes=Jd;function D1(t){const e=new Array(t.length);let r=0;for(let i=0;ie.call(r,n,i,this))}get(e){return Ve(this,ut,"f").get(e)}has(e){return Ve(this,ut,"f").has(e)}keys(){return Ve(this,ut,"f").keys()}values(){return Ve(this,ut,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([e,r])=>`${String(e)} => ${String(r)}`).join(", ")} `:""}}`}}cn.FrozenMap=nu;class iu{constructor(e){_t.set(this,void 0),Yd(this,_t,new Set(e),"f"),Object.freeze(this)}get size(){return Ve(this,_t,"f").size}[(_t=new WeakMap,Symbol.iterator)](){return Ve(this,_t,"f")[Symbol.iterator]()}entries(){return Ve(this,_t,"f").entries()}forEach(e,r){return Ve(this,_t,"f").forEach((n,i,s)=>e.call(r,n,i,this))}has(e){return Ve(this,_t,"f").has(e)}keys(){return Ve(this,_t,"f").keys()}values(){return Ve(this,_t,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(e=>String(e)).join(", ")} `:""}}`}}cn.FrozenSet=iu;Object.freeze(nu);Object.freeze(nu.prototype);Object.freeze(iu);Object.freeze(iu.prototype);var Kd={},su={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.calculateNumberSize=t.calculateStringSize=t.isASCII=t.isPlainObject=t.ESCAPE_CHARACTERS_REGEXP=t.JsonSize=t.hasProperty=t.isObject=t.isNullOrUndefined=t.isNonEmptyArray=void 0;function e(u){return Array.isArray(u)&&u.length>0}t.isNonEmptyArray=e;function r(u){return u==null}t.isNullOrUndefined=r;function n(u){return!!u&&typeof u=="object"&&!Array.isArray(u)}t.isObject=n;const i=(u,l)=>Object.hasOwnProperty.call(u,l);t.hasProperty=i,function(u){u[u.Null=4]="Null",u[u.Comma=1]="Comma",u[u.Wrapper=1]="Wrapper",u[u.True=4]="True",u[u.False=5]="False",u[u.Quote=1]="Quote",u[u.Colon=1]="Colon",u[u.Date=24]="Date"}(t.JsonSize||(t.JsonSize={})),t.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function s(u){if(typeof u!="object"||u===null)return!1;try{let l=u;for(;Object.getPrototypeOf(l)!==null;)l=Object.getPrototypeOf(l);return Object.getPrototypeOf(u)===l}catch{return!1}}t.isPlainObject=s;function o(u){return u.charCodeAt(0)<=127}t.isASCII=o;function a(u){var l;return u.split("").reduce((h,p)=>o(p)?h+1:h+2,0)+((l=u.match(t.ESCAPE_CHARACTERS_REGEXP))!==null&&l!==void 0?l:[]).length}t.calculateStringSize=a;function c(u){return u.toString().length}t.calculateNumberSize=c})(su);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.validateJsonAndGetSize=t.getJsonRpcIdValidator=t.assertIsJsonRpcError=t.isJsonRpcError=t.assertIsJsonRpcFailure=t.isJsonRpcFailure=t.assertIsJsonRpcSuccess=t.isJsonRpcSuccess=t.assertIsJsonRpcResponse=t.isJsonRpcResponse=t.assertIsPendingJsonRpcResponse=t.isPendingJsonRpcResponse=t.JsonRpcResponseStruct=t.JsonRpcFailureStruct=t.JsonRpcSuccessStruct=t.PendingJsonRpcResponseStruct=t.assertIsJsonRpcRequest=t.isJsonRpcRequest=t.assertIsJsonRpcNotification=t.isJsonRpcNotification=t.JsonRpcNotificationStruct=t.JsonRpcRequestStruct=t.JsonRpcParamsStruct=t.JsonRpcErrorStruct=t.JsonRpcIdStruct=t.JsonRpcVersionStruct=t.jsonrpc2=t.isValidJson=t.JsonStruct=void 0;const e=Or,r=$e,n=su;t.JsonStruct=(0,e.define)("Json",C=>{const[T]=x(C,!0);return T?!0:"Expected a valid JSON-serializable value"});function i(C){return(0,e.is)(C,t.JsonStruct)}t.isValidJson=i,t.jsonrpc2="2.0",t.JsonRpcVersionStruct=(0,e.literal)(t.jsonrpc2),t.JsonRpcIdStruct=(0,e.nullable)((0,e.union)([(0,e.number)(),(0,e.string)()])),t.JsonRpcErrorStruct=(0,e.object)({code:(0,e.integer)(),message:(0,e.string)(),data:(0,e.optional)(t.JsonStruct),stack:(0,e.optional)((0,e.string)())}),t.JsonRpcParamsStruct=(0,e.optional)((0,e.union)([(0,e.record)((0,e.string)(),t.JsonStruct),(0,e.array)(t.JsonStruct)])),t.JsonRpcRequestStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,method:(0,e.string)(),params:t.JsonRpcParamsStruct}),t.JsonRpcNotificationStruct=(0,e.omit)(t.JsonRpcRequestStruct,["id"]);function s(C){return(0,e.is)(C,t.JsonRpcNotificationStruct)}t.isJsonRpcNotification=s;function o(C,T){(0,r.assertStruct)(C,t.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",T)}t.assertIsJsonRpcNotification=o;function a(C){return(0,e.is)(C,t.JsonRpcRequestStruct)}t.isJsonRpcRequest=a;function c(C,T){(0,r.assertStruct)(C,t.JsonRpcRequestStruct,"Invalid JSON-RPC request",T)}t.assertIsJsonRpcRequest=c,t.PendingJsonRpcResponseStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:(0,e.optional)((0,e.unknown)()),error:(0,e.optional)(t.JsonRpcErrorStruct)}),t.JsonRpcSuccessStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:t.JsonStruct}),t.JsonRpcFailureStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,error:t.JsonRpcErrorStruct}),t.JsonRpcResponseStruct=(0,e.union)([t.JsonRpcSuccessStruct,t.JsonRpcFailureStruct]);function u(C){return(0,e.is)(C,t.PendingJsonRpcResponseStruct)}t.isPendingJsonRpcResponse=u;function l(C,T){(0,r.assertStruct)(C,t.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",T)}t.assertIsPendingJsonRpcResponse=l;function f(C){return(0,e.is)(C,t.JsonRpcResponseStruct)}t.isJsonRpcResponse=f;function h(C,T){(0,r.assertStruct)(C,t.JsonRpcResponseStruct,"Invalid JSON-RPC response",T)}t.assertIsJsonRpcResponse=h;function p(C){return(0,e.is)(C,t.JsonRpcSuccessStruct)}t.isJsonRpcSuccess=p;function v(C,T){(0,r.assertStruct)(C,t.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",T)}t.assertIsJsonRpcSuccess=v;function E(C){return(0,e.is)(C,t.JsonRpcFailureStruct)}t.isJsonRpcFailure=E;function _(C,T){(0,r.assertStruct)(C,t.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",T)}t.assertIsJsonRpcFailure=_;function d(C){return(0,e.is)(C,t.JsonRpcErrorStruct)}t.isJsonRpcError=d;function y(C,T){(0,r.assertStruct)(C,t.JsonRpcErrorStruct,"Invalid JSON-RPC error",T)}t.assertIsJsonRpcError=y;function m(C){const{permitEmptyString:T,permitFractions:j,permitNull:$}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},C);return U=>!!(typeof U=="number"&&(j||Number.isInteger(U))||typeof U=="string"&&(T||U.length>0)||$&&U===null)}t.getJsonRpcIdValidator=m;function x(C,T=!1){const j=new Set;function $(A,U){if(A===void 0)return[!1,0];if(A===null)return[!0,U?0:n.JsonSize.Null];const ce=typeof A;try{if(ce==="function")return[!1,0];if(ce==="string"||A instanceof String)return[!0,U?0:(0,n.calculateStringSize)(A)+n.JsonSize.Quote*2];if(ce==="boolean"||A instanceof Boolean)return U?[!0,0]:[!0,A==!0?n.JsonSize.True:n.JsonSize.False];if(ce==="number"||A instanceof Number)return U?[!0,0]:[!0,(0,n.calculateNumberSize)(A)];if(A instanceof Date)return U?[!0,0]:[!0,isNaN(A.getDate())?n.JsonSize.Null:n.JsonSize.Date+n.JsonSize.Quote*2]}catch{return[!1,0]}if(!(0,n.isPlainObject)(A)&&!Array.isArray(A))return[!1,0];if(j.has(A))return[!1,0];j.add(A);try{return[!0,Object.entries(A).reduce((Z,[R,M],N,L)=>{let[B,D]=$(M,U);if(!B)throw new Error("JSON validation did not pass. Validation process stopped.");if(j.delete(A),U)return 0;const H=Array.isArray(A)?0:R.length+n.JsonSize.Comma+n.JsonSize.Colon*2,Y=N0)return o(l);if(h==="number"&&isFinite(l))return f.long?c(l):a(l);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(l))};function o(l){if(l=String(l),!(l.length>100)){var f=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(l);if(f){var h=parseFloat(f[1]),p=(f[2]||"ms").toLowerCase();switch(p){case"years":case"year":case"yrs":case"yr":case"y":return h*s;case"weeks":case"week":case"w":return h*i;case"days":case"day":case"d":return h*n;case"hours":case"hour":case"hrs":case"hr":case"h":return h*r;case"minutes":case"minute":case"mins":case"min":case"m":return h*e;case"seconds":case"second":case"secs":case"sec":case"s":return h*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return h;default:return}}}}function a(l){var f=Math.abs(l);return f>=n?Math.round(l/n)+"d":f>=r?Math.round(l/r)+"h":f>=e?Math.round(l/e)+"m":f>=t?Math.round(l/t)+"s":l+"ms"}function c(l){var f=Math.abs(l);return f>=n?u(l,f,n,"day"):f>=r?u(l,f,r,"hour"):f>=e?u(l,f,e,"minute"):f>=t?u(l,f,t,"second"):l+" ms"}function u(l,f,h,p){var v=f>=h*1.5;return Math.round(l/h)+" "+p+(v?"s":"")}return Na}function Z1(t){r.debug=r,r.default=r,r.coerce=c,r.disable=s,r.enable=i,r.enabled=o,r.humanize=Q1(),r.destroy=u,Object.keys(t).forEach(l=>{r[l]=t[l]}),r.names=[],r.skips=[],r.formatters={};function e(l){let f=0;for(let h=0;h{if(T==="%%")return"%";x++;const $=r.formatters[j];if(typeof $=="function"){const A=_[x];T=$.call(d,A),_.splice(x,1),x--}return T}),r.formatArgs.call(d,_),(d.log||r.log).apply(d,_)}return E.namespace=l,E.useColors=r.useColors(),E.color=r.selectColor(l),E.extend=n,E.destroy=r.destroy,Object.defineProperty(E,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(p!==r.namespaces&&(p=r.namespaces,v=r.enabled(l)),v),set:_=>{h=_}}),typeof r.init=="function"&&r.init(E),E}function n(l,f){const h=r(this.namespace+(typeof f>"u"?":":f)+l);return h.log=this.log,h}function i(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f;const h=(typeof l=="string"?l:"").split(/[\s,]+/),p=h.length;for(f=0;f"-"+f)].join(",");return r.enable(""),l}function o(l){if(l[l.length-1]==="*")return!0;let f,h;for(f=0,h=r.skips.length;f{let c=!1;return()=>{c||(c=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function n(c){if(c[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+c[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const u="color: "+this.color;c.splice(1,0,u,"color: inherit");let l=0,f=0;c[0].replace(/%[a-zA-Z%]/g,h=>{h!=="%%"&&(l++,h==="%c"&&(f=l))}),c.splice(f,0,u)}e.log=console.debug||console.log||(()=>{});function i(c){try{c?e.storage.setItem("debug",c):e.storage.removeItem("debug")}catch{}}function s(){let c;try{c=e.storage.getItem("debug")}catch{}return!c&&typeof process<"u"&&"env"in process&&(c={}.DEBUG),c}function o(){try{return localStorage}catch{}}t.exports=Y1(e);const{formatters:a}=t.exports;a.j=function(c){try{return JSON.stringify(c)}catch(u){return"[UnexpectedJSONParseError]: "+u.message}}})(vc,vc.exports);var K1=vc.exports,X1=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(un,"__esModule",{value:!0});un.createModuleLogger=un.createProjectLogger=void 0;const e_=X1(K1),t_=(0,e_.default)("metamask");function r_(t){return t_.extend(t)}un.createProjectLogger=r_;function n_(t,e){return t.extend(e)}un.createModuleLogger=n_;var At={};Object.defineProperty(At,"__esModule",{value:!0});At.hexToBigInt=At.hexToNumber=At.bigIntToHex=At.numberToHex=void 0;const Kr=$e,Kn=bi,i_=t=>((0,Kr.assert)(typeof t=="number","Value must be a number."),(0,Kr.assert)(t>=0,"Value must be a non-negative number."),(0,Kr.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Kn.add0x)(t.toString(16)));At.numberToHex=i_;const s_=t=>((0,Kr.assert)(typeof t=="bigint","Value must be a bigint."),(0,Kr.assert)(t>=0,"Value must be a non-negative bigint."),(0,Kn.add0x)(t.toString(16)));At.bigIntToHex=s_;const o_=t=>{(0,Kn.assertIsHexString)(t);const e=parseInt(t,16);return(0,Kr.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `hexToBigInt` instead."),e};At.hexToNumber=o_;const a_=t=>((0,Kn.assertIsHexString)(t),BigInt((0,Kn.add0x)(t)));At.hexToBigInt=a_;var Xd={};Object.defineProperty(Xd,"__esModule",{value:!0});var ep={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.timeSince=t.inMilliseconds=t.Duration=void 0,function(s){s[s.Millisecond=1]="Millisecond",s[s.Second=1e3]="Second",s[s.Minute=6e4]="Minute",s[s.Hour=36e5]="Hour",s[s.Day=864e5]="Day",s[s.Week=6048e5]="Week",s[s.Year=31536e6]="Year"}(t.Duration||(t.Duration={}));const e=s=>Number.isInteger(s)&&s>=0,r=(s,o)=>{if(!e(s))throw new Error(`"${o}" must be a non-negative integer. Received: "${s}".`)};function n(s,o){return r(s,"count"),s*o}t.inMilliseconds=n;function i(s){return r(s,"timestamp"),Date.now()-s}t.timeSince=i})(ep);var tp={},mc={exports:{}};const c_="2.0.0",rp=256,u_=Number.MAX_SAFE_INTEGER||9007199254740991,l_=16,f_=rp-6,h_=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var Os={MAX_LENGTH:rp,MAX_SAFE_COMPONENT_LENGTH:l_,MAX_SAFE_BUILD_LENGTH:f_,MAX_SAFE_INTEGER:u_,RELEASE_TYPES:h_,SEMVER_SPEC_VERSION:c_,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const d_=typeof process=="object"&&process.env&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};var Ns=d_;(function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=Os,s=Ns;e=t.exports={};const o=e.re=[],a=e.safeRe=[],c=e.src=[],u=e.t={};let l=0;const f="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",i],[f,n]],p=E=>{for(const[_,d]of h)E=E.split(`${_}*`).join(`${_}{0,${d}}`).split(`${_}+`).join(`${_}{1,${d}}`);return E},v=(E,_,d)=>{const y=p(_),m=l++;s(E,m,_),u[E]=m,c[m]=_,o[m]=new RegExp(_,d?"g":void 0),a[m]=new RegExp(y,d?"g":void 0)};v("NUMERICIDENTIFIER","0|[1-9]\\d*"),v("NUMERICIDENTIFIERLOOSE","\\d+"),v("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),v("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),v("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),v("PRERELEASEIDENTIFIER",`(?:${c[u.NUMERICIDENTIFIER]}|${c[u.NONNUMERICIDENTIFIER]})`),v("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NUMERICIDENTIFIERLOOSE]}|${c[u.NONNUMERICIDENTIFIER]})`),v("PRERELEASE",`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),v("PRERELEASELOOSE",`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),v("BUILDIDENTIFIER",`${f}+`),v("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),v("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),v("FULL",`^${c[u.FULLPLAIN]}$`),v("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),v("LOOSE",`^${c[u.LOOSEPLAIN]}$`),v("GTLT","((?:<|>)?=?)"),v("XRANGEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),v("XRANGEIDENTIFIER",`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),v("XRANGEPLAIN",`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),v("XRANGEPLAINLOOSE",`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),v("XRANGE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),v("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),v("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),v("COERCERTL",c[u.COERCE],!0),v("LONETILDE","(?:~>?)"),v("TILDETRIM",`(\\s*)${c[u.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",v("TILDE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),v("TILDELOOSE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),v("LONECARET","(?:\\^)"),v("CARETTRIM",`(\\s*)${c[u.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",v("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),v("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),v("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),v("COMPARATOR",`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),v("COMPARATORTRIM",`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",v("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),v("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),v("STAR","(<|>)?=?\\s*\\*"),v("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),v("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(mc,mc.exports);var gi=mc.exports;const p_=Object.freeze({loose:!0}),b_=Object.freeze({}),g_=t=>t?typeof t!="object"?p_:t:b_;var ou=g_;const tf=/^[0-9]+$/,np=(t,e)=>{const r=tf.test(t),n=tf.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:tnp(e,t);var ip={compareIdentifiers:np,rcompareIdentifiers:y_};const Pi=Ns,{MAX_LENGTH:rf,MAX_SAFE_INTEGER:$i}=Os,{safeRe:nf,t:sf}=gi,v_=ou,{compareIdentifiers:Fr}=ip;let m_=class St{constructor(e,r){if(r=v_(r),e instanceof St){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>rf)throw new TypeError(`version is longer than ${rf} characters`);Pi("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=e.trim().match(r.loose?nf[sf.LOOSE]:nf[sf.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>$i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>$i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>$i||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const s=+i;if(s>=0&&s<$i)return s}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(Pi("SemVer.compare",this.version,this.options,e),!(e instanceof St)){if(typeof e=="string"&&e===this.version)return 0;e=new St(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof St||(e=new St(e,this.options)),Fr(this.major,e.major)||Fr(this.minor,e.minor)||Fr(this.patch,e.patch)}comparePre(e){if(e instanceof St||(e=new St(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{const n=this.prerelease[r],i=e.prerelease[r];if(Pi("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Fr(n,i)}while(++r)}compareBuild(e){e instanceof St||(e=new St(e,this.options));let r=0;do{const n=this.build[r],i=e.build[r];if(Pi("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Fr(n,i)}while(++r)}inc(e,r,n){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const i=Number(n)?1:0;if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let s=[r,i];n===!1&&(s=[r]),Fr(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var qe=m_;const of=qe,__=(t,e,r=!1)=>{if(t instanceof of)return t;try{return new of(t,e)}catch(n){if(!r)return null;throw n}};var In=__;const w_=In,S_=(t,e)=>{const r=w_(t,e);return r?r.version:null};var E_=S_;const C_=In,x_=(t,e)=>{const r=C_(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};var I_=x_;const af=qe,R_=(t,e,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new af(t instanceof af?t.version:t,r).inc(e,n,i).version}catch{return null}};var A_=R_;const cf=In,M_=(t,e)=>{const r=cf(t,null,!0),n=cf(e,null,!0),i=r.compare(n);if(i===0)return null;const s=i>0,o=s?r:n,a=s?n:r,c=!!o.prerelease.length;if(!!a.prerelease.length&&!c)return!a.patch&&!a.minor?"major":o.patch?"patch":o.minor?"minor":"major";const l=c?"pre":"";return r.major!==n.major?l+"major":r.minor!==n.minor?l+"minor":r.patch!==n.patch?l+"patch":"prerelease"};var k_=M_;const T_=qe,O_=(t,e)=>new T_(t,e).major;var N_=O_;const L_=qe,P_=(t,e)=>new L_(t,e).minor;var $_=P_;const D_=qe,j_=(t,e)=>new D_(t,e).patch;var B_=j_;const F_=In,W_=(t,e)=>{const r=F_(t,e);return r&&r.prerelease.length?r.prerelease:null};var H_=W_;const uf=qe,V_=(t,e,r)=>new uf(t,r).compare(new uf(e,r));var gt=V_;const U_=gt,z_=(t,e,r)=>U_(e,t,r);var q_=z_;const G_=gt,J_=(t,e)=>G_(t,e,!0);var Q_=J_;const lf=qe,Z_=(t,e,r)=>{const n=new lf(t,r),i=new lf(e,r);return n.compare(i)||n.compareBuild(i)};var au=Z_;const Y_=au,K_=(t,e)=>t.sort((r,n)=>Y_(r,n,e));var X_=K_;const ew=au,tw=(t,e)=>t.sort((r,n)=>ew(n,r,e));var rw=tw;const nw=gt,iw=(t,e,r)=>nw(t,e,r)>0;var Ls=iw;const sw=gt,ow=(t,e,r)=>sw(t,e,r)<0;var cu=ow;const aw=gt,cw=(t,e,r)=>aw(t,e,r)===0;var sp=cw;const uw=gt,lw=(t,e,r)=>uw(t,e,r)!==0;var op=lw;const fw=gt,hw=(t,e,r)=>fw(t,e,r)>=0;var uu=hw;const dw=gt,pw=(t,e,r)=>dw(t,e,r)<=0;var lu=pw;const bw=sp,gw=op,yw=Ls,vw=uu,mw=cu,_w=lu,ww=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return bw(t,r,n);case"!=":return gw(t,r,n);case">":return yw(t,r,n);case">=":return vw(t,r,n);case"<":return mw(t,r,n);case"<=":return _w(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};var ap=ww;const Sw=qe,Ew=In,{safeRe:Di,t:ji}=gi,Cw=(t,e)=>{if(t instanceof Sw)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(Di[ji.COERCE]);else{let n;for(;(n=Di[ji.COERCERTL].exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||n.index+n[0].length!==r.index+r[0].length)&&(r=n),Di[ji.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;Di[ji.COERCERTL].lastIndex=-1}return r===null?null:Ew(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,e)};var xw=Cw,La,ff;function Iw(){return ff||(ff=1,La=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),La}var Rw=ae;ae.Node=Sr;ae.create=ae;function ae(t){var e=this;if(e instanceof ae||(e=new ae),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach=="function")t.forEach(function(i){e.push(i)});else if(arguments.length>0)for(var r=0,n=arguments.length;r1)r=e;else if(this.head)n=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;n!==null;i++)r=t(r,n.value,i),n=n.next;return r};ae.prototype.reduceReverse=function(t,e){var r,n=this.tail;if(arguments.length>1)r=e;else if(this.tail)n=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;n!==null;i--)r=t(r,n.value,i),n=n.prev;return r};ae.prototype.toArray=function(){for(var t=new Array(this.length),e=0,r=this.head;r!==null;e++)t[e]=r.value,r=r.next;return t};ae.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,r=this.tail;r!==null;e++)t[e]=r.value,r=r.prev;return t};ae.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new ae;if(ethis.length&&(e=this.length);for(var n=0,i=this.head;i!==null&&nthis.length&&(e=this.length);for(var n=this.length,i=this.tail;i!==null&&n>e;n--)i=i.prev;for(;i!==null&&n>t;n--,i=i.prev)r.push(i.value);return r};ae.prototype.splice=function(t,e,...r){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var n=0,i=this.head;i!==null&&n1;class Ow{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");this[dr]=e.max||1/0;const r=e.length||Pa;if(this[Wr]=typeof r!="function"?Pa:r,this[zn]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[yr]=e.maxAge||0,this[Lt]=e.dispose,this[hf]=e.noDisposeOnSet||!1,this[cp]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[dr]=e||1/0,Pn(this)}get max(){return this[dr]}set allowStale(e){this[zn]=!!e}get allowStale(){return this[zn]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[yr]=e,Pn(this)}get maxAge(){return this[yr]}set lengthCalculator(e){typeof e!="function"&&(e=Pa),e!==this[Wr]&&(this[Wr]=e,this[Dt]=0,this[ke].forEach(r=>{r.length=this[Wr](r.value,r.key),this[Dt]+=r.length})),Pn(this)}get lengthCalculator(){return this[Wr]}get length(){return this[Dt]}get itemCount(){return this[ke].length}rforEach(e,r){r=r||this;for(let n=this[ke].tail;n!==null;){const i=n.prev;df(this,e,n,r),n=i}}forEach(e,r){r=r||this;for(let n=this[ke].head;n!==null;){const i=n.next;df(this,e,n,r),n=i}}keys(){return this[ke].toArray().map(e=>e.key)}values(){return this[ke].toArray().map(e=>e.value)}reset(){this[Lt]&&this[ke]&&this[ke].length&&this[ke].forEach(e=>this[Lt](e.key,e.value)),this[ht]=new Map,this[ke]=new Tw,this[Dt]=0}dump(){return this[ke].map(e=>ss(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[ke]}set(e,r,n){if(n=n||this[yr],n&&typeof n!="number")throw new TypeError("maxAge must be a number");const i=n?Date.now():0,s=this[Wr](r,e);if(this[ht].has(e)){if(s>this[dr])return Xr(this,this[ht].get(e)),!1;const c=this[ht].get(e).value;return this[Lt]&&(this[hf]||this[Lt](e,c.value)),c.now=i,c.maxAge=n,c.value=r,this[Dt]+=s-c.length,c.length=s,this.get(e),Pn(this),!0}const o=new Nw(e,r,s,i,n);return o.length>this[dr]?(this[Lt]&&this[Lt](e,r),!1):(this[Dt]+=o.length,this[ke].unshift(o),this[ht].set(e,this[ke].head),Pn(this),!0)}has(e){if(!this[ht].has(e))return!1;const r=this[ht].get(e).value;return!ss(this,r)}get(e){return $a(this,e,!0)}peek(e){return $a(this,e,!1)}pop(){const e=this[ke].tail;return e?(Xr(this,e),e.value):null}del(e){Xr(this,this[ht].get(e))}load(e){this.reset();const r=Date.now();for(let n=e.length-1;n>=0;n--){const i=e[n],s=i.e||0;if(s===0)this.set(i.k,i.v);else{const o=s-r;o>0&&this.set(i.k,i.v,o)}}}prune(){this[ht].forEach((e,r)=>$a(this,r,!1))}}const $a=(t,e,r)=>{const n=t[ht].get(e);if(n){const i=n.value;if(ss(t,i)){if(Xr(t,n),!t[zn])return}else r&&(t[cp]&&(n.value.now=Date.now()),t[ke].unshiftNode(n));return i.value}},ss=(t,e)=>{if(!e||!e.maxAge&&!t[yr])return!1;const r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t[yr]&&r>t[yr]},Pn=t=>{if(t[Dt]>t[dr])for(let e=t[ke].tail;t[Dt]>t[dr]&&e!==null;){const r=e.prev;Xr(t,e),e=r}},Xr=(t,e)=>{if(e){const r=e.value;t[Lt]&&t[Lt](r.key,r.value),t[Dt]-=r.length,t[ht].delete(r.key),t[ke].removeNode(e)}};class Nw{constructor(e,r,n,i,s){this.key=e,this.value=r,this.length=n,this.now=i,this.maxAge=s||0}}const df=(t,e,r,n)=>{let i=r.value;ss(t,i)&&(Xr(t,r),t[zn]||(i=void 0)),i&&e.call(n,i.value,i.key,t)};var Lw=Ow,Da,pf;function yt(){if(pf)return Da;pf=1;class t{constructor(M,N){if(N=n(N),M instanceof t)return M.loose===!!N.loose&&M.includePrerelease===!!N.includePrerelease?M:new t(M.raw,N);if(M instanceof i)return this.raw=M.value,this.set=[[M]],this.format(),this;if(this.options=N,this.loose=!!N.loose,this.includePrerelease=!!N.includePrerelease,this.raw=M.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(L=>this.parseRange(L.trim())).filter(L=>L.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const L=this.set[0];if(this.set=this.set.filter(B=>!v(B[0])),this.set.length===0)this.set=[L];else if(this.set.length>1){for(const B of this.set)if(B.length===1&&E(B[0])){this.set=[B];break}}}this.format()}format(){return this.range=this.set.map(M=>M.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(M){const L=((this.options.includePrerelease&&h)|(this.options.loose&&p))+":"+M,B=r.get(L);if(B)return B;const D=this.options.loose,H=D?a[c.HYPHENRANGELOOSE]:a[c.HYPHENRANGE];M=M.replace(H,ce(this.options.includePrerelease)),s("hyphen replace",M),M=M.replace(a[c.COMPARATORTRIM],u),s("comparator trim",M),M=M.replace(a[c.TILDETRIM],l),s("tilde trim",M),M=M.replace(a[c.CARETTRIM],f),s("caret trim",M);let Y=M.split(" ").map(le=>d(le,this.options)).join(" ").split(/\s+/).map(le=>U(le,this.options));D&&(Y=Y.filter(le=>(s("loose invalid filter",le,this.options),!!le.match(a[c.COMPARATORLOOSE])))),s("range list",Y);const J=new Map,se=Y.map(le=>new i(le,this.options));for(const le of se){if(v(le))return[le];J.set(le.value,le)}J.size>1&&J.has("")&&J.delete("");const he=[...J.values()];return r.set(L,he),he}intersects(M,N){if(!(M instanceof t))throw new TypeError("a Range is required");return this.set.some(L=>_(L,N)&&M.set.some(B=>_(B,N)&&L.every(D=>B.every(H=>D.intersects(H,N)))))}test(M){if(!M)return!1;if(typeof M=="string")try{M=new o(M,this.options)}catch{return!1}for(let N=0;NR.value==="<0.0.0-0",E=R=>R.value==="",_=(R,M)=>{let N=!0;const L=R.slice();let B=L.pop();for(;N&&L.length;)N=L.every(D=>B.intersects(D,M)),B=L.pop();return N},d=(R,M)=>(s("comp",R,M),R=C(R,M),s("caret",R),R=m(R,M),s("tildes",R),R=j(R,M),s("xrange",R),R=A(R,M),s("stars",R),R),y=R=>!R||R.toLowerCase()==="x"||R==="*",m=(R,M)=>R.trim().split(/\s+/).map(N=>x(N,M)).join(" "),x=(R,M)=>{const N=M.loose?a[c.TILDELOOSE]:a[c.TILDE];return R.replace(N,(L,B,D,H,Y)=>{s("tilde",R,L,B,D,H,Y);let J;return y(B)?J="":y(D)?J=`>=${B}.0.0 <${+B+1}.0.0-0`:y(H)?J=`>=${B}.${D}.0 <${B}.${+D+1}.0-0`:Y?(s("replaceTilde pr",Y),J=`>=${B}.${D}.${H}-${Y} <${B}.${+D+1}.0-0`):J=`>=${B}.${D}.${H} <${B}.${+D+1}.0-0`,s("tilde return",J),J})},C=(R,M)=>R.trim().split(/\s+/).map(N=>T(N,M)).join(" "),T=(R,M)=>{s("caret",R,M);const N=M.loose?a[c.CARETLOOSE]:a[c.CARET],L=M.includePrerelease?"-0":"";return R.replace(N,(B,D,H,Y,J)=>{s("caret",R,B,D,H,Y,J);let se;return y(D)?se="":y(H)?se=`>=${D}.0.0${L} <${+D+1}.0.0-0`:y(Y)?D==="0"?se=`>=${D}.${H}.0${L} <${D}.${+H+1}.0-0`:se=`>=${D}.${H}.0${L} <${+D+1}.0.0-0`:J?(s("replaceCaret pr",J),D==="0"?H==="0"?se=`>=${D}.${H}.${Y}-${J} <${D}.${H}.${+Y+1}-0`:se=`>=${D}.${H}.${Y}-${J} <${D}.${+H+1}.0-0`:se=`>=${D}.${H}.${Y}-${J} <${+D+1}.0.0-0`):(s("no pr"),D==="0"?H==="0"?se=`>=${D}.${H}.${Y}${L} <${D}.${H}.${+Y+1}-0`:se=`>=${D}.${H}.${Y}${L} <${D}.${+H+1}.0-0`:se=`>=${D}.${H}.${Y} <${+D+1}.0.0-0`),s("caret return",se),se})},j=(R,M)=>(s("replaceXRanges",R,M),R.split(/\s+/).map(N=>$(N,M)).join(" ")),$=(R,M)=>{R=R.trim();const N=M.loose?a[c.XRANGELOOSE]:a[c.XRANGE];return R.replace(N,(L,B,D,H,Y,J)=>{s("xRange",R,L,B,D,H,Y,J);const se=y(D),he=se||y(H),le=he||y(Y),We=le;return B==="="&&We&&(B=""),J=M.includePrerelease?"-0":"",se?B===">"||B==="<"?L="<0.0.0-0":L="*":B&&We?(he&&(H=0),Y=0,B===">"?(B=">=",he?(D=+D+1,H=0,Y=0):(H=+H+1,Y=0)):B==="<="&&(B="<",he?D=+D+1:H=+H+1),B==="<"&&(J="-0"),L=`${B+D}.${H}.${Y}${J}`):he?L=`>=${D}.0.0${J} <${+D+1}.0.0-0`:le&&(L=`>=${D}.${H}.0${J} <${D}.${+H+1}.0-0`),s("xRange return",L),L})},A=(R,M)=>(s("replaceStars",R,M),R.trim().replace(a[c.STAR],"")),U=(R,M)=>(s("replaceGTE0",R,M),R.trim().replace(a[M.includePrerelease?c.GTE0PRE:c.GTE0],"")),ce=R=>(M,N,L,B,D,H,Y,J,se,he,le,We,w)=>(y(L)?N="":y(B)?N=`>=${L}.0.0${R?"-0":""}`:y(D)?N=`>=${L}.${B}.0${R?"-0":""}`:H?N=`>=${N}`:N=`>=${N}${R?"-0":""}`,y(se)?J="":y(he)?J=`<${+se+1}.0.0-0`:y(le)?J=`<${se}.${+he+1}.0-0`:We?J=`<=${se}.${he}.${le}-${We}`:R?J=`<${se}.${he}.${+le+1}-0`:J=`<=${J}`,`${N} ${J}`.trim()),Z=(R,M,N)=>{for(let L=0;L0){const B=R[L].semver;if(B.major===M.major&&B.minor===M.minor&&B.patch===M.patch)return!0}return!1}return!0};return Da}var ja,bf;function Ps(){if(bf)return ja;bf=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(l,f){if(f=r(f),l instanceof e){if(l.loose===!!f.loose)return l;l=l.value}l=l.trim().split(/\s+/).join(" "),o("comparator",l,f),this.options=f,this.loose=!!f.loose,this.parse(l),this.semver===t?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(l){const f=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],h=l.match(f);if(!h)throw new TypeError(`Invalid comparator: ${l}`);this.operator=h[1]!==void 0?h[1]:"",this.operator==="="&&(this.operator=""),h[2]?this.semver=new a(h[2],this.options.loose):this.semver=t}toString(){return this.value}test(l){if(o("Comparator.test",l,this.options.loose),this.semver===t||l===t)return!0;if(typeof l=="string")try{l=new a(l,this.options)}catch{return!1}return s(l,this.operator,this.semver,this.options)}intersects(l,f){if(!(l instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(l.value,f).test(this.value):l.operator===""?l.value===""?!0:new c(this.value,f).test(l.semver):(f=r(f),f.includePrerelease&&(this.value==="<0.0.0-0"||l.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||l.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&l.operator.startsWith(">")||this.operator.startsWith("<")&&l.operator.startsWith("<")||this.semver.version===l.semver.version&&this.operator.includes("=")&&l.operator.includes("=")||s(this.semver,"<",l.semver,f)&&this.operator.startsWith(">")&&l.operator.startsWith("<")||s(this.semver,">",l.semver,f)&&this.operator.startsWith("<")&&l.operator.startsWith(">")))}}ja=e;const r=ou,{safeRe:n,t:i}=gi,s=ap,o=Ns,a=qe,c=yt();return ja}const Pw=yt(),$w=(t,e,r)=>{try{e=new Pw(e,r)}catch{return!1}return e.test(t)};var $s=$w;const Dw=yt(),jw=(t,e)=>new Dw(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var Bw=jw;const Fw=qe,Ww=yt(),Hw=(t,e,r)=>{let n=null,i=null,s=null;try{s=new Ww(e,r)}catch{return null}return t.forEach(o=>{s.test(o)&&(!n||i.compare(o)===-1)&&(n=o,i=new Fw(n,r))}),n};var Vw=Hw;const Uw=qe,zw=yt(),qw=(t,e,r)=>{let n=null,i=null,s=null;try{s=new zw(e,r)}catch{return null}return t.forEach(o=>{s.test(o)&&(!n||i.compare(o)===1)&&(n=o,i=new Uw(n,r))}),n};var Gw=qw;const Ba=qe,Jw=yt(),gf=Ls,Qw=(t,e)=>{t=new Jw(t,e);let r=new Ba("0.0.0");if(t.test(r)||(r=new Ba("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n{const a=new Ba(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||gf(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!r||gf(r,s))&&(r=s)}return r&&t.test(r)?r:null};var Zw=Qw;const Yw=yt(),Kw=(t,e)=>{try{return new Yw(t,e).range||"*"}catch{return null}};var Xw=Kw;const eS=qe,up=Ps(),{ANY:tS}=up,rS=yt(),nS=$s,yf=Ls,vf=cu,iS=lu,sS=uu,oS=(t,e,r,n)=>{t=new eS(t,n),e=new rS(e,n);let i,s,o,a,c;switch(r){case">":i=yf,s=iS,o=vf,a=">",c=">=";break;case"<":i=vf,s=sS,o=yf,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(nS(t,e,n))return!1;for(let u=0;u{p.semver===tS&&(p=new up(">=0.0.0")),f=f||p,h=h||p,i(p.semver,f.semver,n)?f=p:o(p.semver,h.semver,n)&&(h=p)}),f.operator===a||f.operator===c||(!h.operator||h.operator===a)&&s(t,h.semver))return!1;if(h.operator===c&&o(t,h.semver))return!1}return!0};var fu=oS;const aS=fu,cS=(t,e,r)=>aS(t,e,">",r);var uS=cS;const lS=fu,fS=(t,e,r)=>lS(t,e,"<",r);var hS=fS;const mf=yt(),dS=(t,e,r)=>(t=new mf(t,r),e=new mf(e,r),t.intersects(e,r));var pS=dS;const bS=$s,gS=gt;var yS=(t,e,r)=>{const n=[];let i=null,s=null;const o=t.sort((l,f)=>gS(l,f,r));for(const l of o)bS(l,e,r)?(s=l,i||(i=l)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);const a=[];for(const[l,f]of n)l===f?a.push(l):!f&&l===o[0]?a.push("*"):f?l===o[0]?a.push(`<=${f}`):a.push(`${l} - ${f}`):a.push(`>=${l}`);const c=a.join(" || "),u=typeof e.raw=="string"?e.raw:String(e);return c.length{if(t===e)return!0;t=new _f(t,r),e=new _f(e,r);let n=!1;e:for(const i of t.set){for(const s of e.set){const o=_S(i,s,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},mS=[new hu(">=0.0.0-0")],wf=[new hu(">=0.0.0")],_S=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Fa){if(e.length===1&&e[0].semver===Fa)return!0;r.includePrerelease?t=mS:t=wf}if(e.length===1&&e[0].semver===Fa){if(r.includePrerelease)return!0;e=wf}const n=new Set;let i,s;for(const p of t)p.operator===">"||p.operator===">="?i=Sf(i,p,r):p.operator==="<"||p.operator==="<="?s=Ef(s,p,r):n.add(p.semver);if(n.size>1)return null;let o;if(i&&s){if(o=du(i.semver,s.semver,r),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(const p of n){if(i&&!$n(p,String(i),r)||s&&!$n(p,String(s),r))return null;for(const v of e)if(!$n(p,String(v),r))return!1;return!0}let a,c,u,l,f=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,h=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;f&&f.prerelease.length===1&&s.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(const p of e){if(l=l||p.operator===">"||p.operator===">=",u=u||p.operator==="<"||p.operator==="<=",i){if(h&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===h.major&&p.semver.minor===h.minor&&p.semver.patch===h.patch&&(h=!1),p.operator===">"||p.operator===">="){if(a=Sf(i,p,r),a===p&&a!==i)return!1}else if(i.operator===">="&&!$n(i.semver,String(p),r))return!1}if(s){if(f&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===f.major&&p.semver.minor===f.minor&&p.semver.patch===f.patch&&(f=!1),p.operator==="<"||p.operator==="<="){if(c=Ef(s,p,r),c===p&&c!==s)return!1}else if(s.operator==="<="&&!$n(s.semver,String(p),r))return!1}if(!p.operator&&(s||i)&&o!==0)return!1}return!(i&&u&&!s&&o!==0||s&&l&&!i&&o!==0||h||f)},Sf=(t,e,r)=>{if(!t)return e;const n=du(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},Ef=(t,e,r)=>{if(!t)return e;const n=du(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};var wS=vS;const Wa=gi,Cf=Os,SS=qe,xf=ip,ES=In,CS=E_,xS=I_,IS=A_,RS=k_,AS=N_,MS=$_,kS=B_,TS=H_,OS=gt,NS=q_,LS=Q_,PS=au,$S=X_,DS=rw,jS=Ls,BS=cu,FS=sp,WS=op,HS=uu,VS=lu,US=ap,zS=xw,qS=Ps(),GS=yt(),JS=$s,QS=Bw,ZS=Vw,YS=Gw,KS=Zw,XS=Xw,e2=fu,t2=uS,r2=hS,n2=pS,i2=yS,s2=wS;var o2={parse:ES,valid:CS,clean:xS,inc:IS,diff:RS,major:AS,minor:MS,patch:kS,prerelease:TS,compare:OS,rcompare:NS,compareLoose:LS,compareBuild:PS,sort:$S,rsort:DS,gt:jS,lt:BS,eq:FS,neq:WS,gte:HS,lte:VS,cmp:US,coerce:zS,Comparator:qS,Range:GS,satisfies:JS,toComparators:QS,maxSatisfying:ZS,minSatisfying:YS,minVersion:KS,validRange:XS,outside:e2,gtr:t2,ltr:r2,intersects:n2,simplifyRange:i2,subset:s2,SemVer:SS,re:Wa.re,src:Wa.src,tokens:Wa.t,SEMVER_SPEC_VERSION:Cf.SEMVER_SPEC_VERSION,RELEASE_TYPES:Cf.RELEASE_TYPES,compareIdentifiers:xf.compareIdentifiers,rcompareIdentifiers:xf.rcompareIdentifiers};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.satisfiesVersionRange=t.gtRange=t.gtVersion=t.assertIsSemVerRange=t.assertIsSemVerVersion=t.isValidSemVerRange=t.isValidSemVerVersion=t.VersionRangeStruct=t.VersionStruct=void 0;const e=o2,r=Or,n=$e;t.VersionStruct=(0,r.refine)((0,r.string)(),"Version",f=>(0,e.valid)(f)===null?`Expected SemVer version, got "${f}"`:!0),t.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",f=>(0,e.validRange)(f)===null?`Expected SemVer range, got "${f}"`:!0);function i(f){return(0,r.is)(f,t.VersionStruct)}t.isValidSemVerVersion=i;function s(f){return(0,r.is)(f,t.VersionRangeStruct)}t.isValidSemVerRange=s;function o(f){(0,n.assertStruct)(f,t.VersionStruct)}t.assertIsSemVerVersion=o;function a(f){(0,n.assertStruct)(f,t.VersionRangeStruct)}t.assertIsSemVerRange=a;function c(f,h){return(0,e.gt)(f,h)}t.gtVersion=c;function u(f,h){return(0,e.gtr)(f,h)}t.gtRange=u;function l(f,h){return(0,e.satisfies)(f,h,{includePrerelease:!0})}t.satisfiesVersionRange=l})(tp);(function(t){var e=F&&F.__createBinding||(Object.create?function(n,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(n,o,a)}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=F&&F.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r($e,t),r(pi,t),r(oe,t),r(ks,t),r(Rt,t),r(cn,t),r(bi,t),r(Kd,t),r(un,t),r(su,t),r(At,t),r(Xd,t),r(ep,t),r(tp,t)})(Nd);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createModuleLogger=t.projectLogger=void 0;const e=Nd;Object.defineProperty(t,"createModuleLogger",{enumerable:!0,get:function(){return e.createModuleLogger}}),t.projectLogger=(0,e.createProjectLogger)("eth-block-tracker")})(Od);var lp=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(As,"__esModule",{value:!0});As.PollingBlockTracker=void 0;const a2=lp(Qc),c2=lp(Mm),u2=hi,If=Od,Rf=(0,If.createModuleLogger)(If.projectLogger,"polling-block-tracker"),l2=(0,a2.default)(),f2=1e3;class h2 extends u2.BaseBlockTracker{constructor(e={}){var r;if(!e.provider)throw new Error("PollingBlockTracker - no provider specified.");super({blockResetDuration:(r=e.blockResetDuration)!==null&&r!==void 0?r:e.pollingInterval}),this._provider=e.provider,this._pollingInterval=e.pollingInterval||20*f2,this._retryTimeout=e.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=e.keepEventLoopActive===void 0?!0:e.keepEventLoopActive,this._setSkipCacheFlag=e.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var e;this._isRunning;)try{await this._updateLatestBlock();const r=Af(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await r}catch(r){const n=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block: -${(e=r.stack)!==null&&e!==void 0?e:r}`);try{this.emit("error",n)}catch{console.error(n)}const i=Af(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await i}}async _updateLatestBlock(){const e=await this._fetchLatestBlock();this._newPotentialLatest(e)}async _fetchLatestBlock(){const e={jsonrpc:"2.0",id:l2(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(e.skipCache=!0),Rf("Making request",e);const r=await(0,c2.default)(n=>this._provider.sendAsync(e,n))();if(Rf("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block: -${r.error.message}`);return r.result}}As.PollingBlockTracker=h2;function Af(t,e){return new Promise(r=>{const n=setTimeout(r,t);n.unref&&e&&n.unref()})}var Ds={},d2=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ds,"__esModule",{value:!0});Ds.SubscribeBlockTracker=void 0;const p2=d2(Qc),b2=hi,g2=(0,p2.default)();class y2 extends b2.BaseBlockTracker{constructor(e={}){if(!e.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(e),this._provider=e.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const e=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(e)}catch(e){this.emit("error",e)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(e){this.emit("error",e)}}_call(e,...r){return new Promise((n,i)=>{this._provider.sendAsync({id:g2(),method:e,params:r,jsonrpc:"2.0"},(s,o)=>{s?i(s):n(o.result)})})}_handleSubData(e,r){var n;r.method==="eth_subscription"&&((n=r.params)===null||n===void 0?void 0:n.subscription)===this._subscriptionId&&this._newPotentialLatest(r.params.result.number)}}Ds.SubscribeBlockTracker=y2;var fp={};Object.defineProperty(fp,"__esModule",{value:!0});(function(t){var e=F&&F.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s),Object.defineProperty(n,o,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=F&&F.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(As,t),r(Ds,t),r(fp,t)})(Td);var pu={},js={},yi={};Object.defineProperty(yi,"__esModule",{value:!0});yi.getUniqueId=void 0;const hp=4294967295;let Ha=Math.floor(Math.random()*hp);function v2(){return Ha=(Ha+1)%hp,Ha}yi.getUniqueId=v2;Object.defineProperty(js,"__esModule",{value:!0});js.createIdRemapMiddleware=void 0;const m2=yi;function _2(){return(t,e,r,n)=>{const i=t.id,s=m2.getUniqueId();t.id=s,e.id=s,r(o=>{t.id=i,e.id=i,o()})}}js.createIdRemapMiddleware=_2;var Bs={};Object.defineProperty(Bs,"__esModule",{value:!0});Bs.createAsyncMiddleware=void 0;function w2(t){return async(e,r,n,i)=>{let s;const o=new Promise(l=>{s=l});let a=null,c=!1;const u=async()=>{c=!0,n(l=>{a=l,s()}),await o};try{await t(e,r,u),c?(await o,a(null)):i(null)}catch(l){a?a(l):i(l)}}}Bs.createAsyncMiddleware=w2;var Fs={};Object.defineProperty(Fs,"__esModule",{value:!0});Fs.createScaffoldMiddleware=void 0;function S2(t){return(e,r,n,i)=>{const s=t[e.method];return s===void 0?n():typeof s=="function"?s(e,r,n,i):(r.result=s,i())}}Fs.createScaffoldMiddleware=S2;var vi={},E2=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(vi,"__esModule",{value:!0});vi.JsonRpcEngine=void 0;const C2=E2(Ir),et=Pc;class Pt extends C2.default{constructor(){super(),this._middleware=[]}push(e){this._middleware.push(e)}handle(e,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(e)?r?this._handleBatch(e,r):this._handleBatch(e):r?this._handle(e,r):this._promiseHandle(e)}asMiddleware(){return async(e,r,n,i)=>{try{const[s,o,a]=await Pt._runAllMiddleware(e,r,this._middleware);return o?(await Pt._runReturnHandlers(a),i(s)):n(async c=>{try{await Pt._runReturnHandlers(a)}catch(u){return c(u)}return c()})}catch(s){return i(s)}}}async _handleBatch(e,r){try{const n=await Promise.all(e.map(this._promiseHandle.bind(this)));return r?r(null,n):n}catch(n){if(r)return r(n);throw n}}_promiseHandle(e){return new Promise(r=>{this._handle(e,(n,i)=>{r(i)})})}async _handle(e,r){if(!e||Array.isArray(e)||typeof e!="object"){const o=new et.EthereumRpcError(et.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof e}`,{request:e});return r(o,{id:void 0,jsonrpc:"2.0",error:o})}if(typeof e.method!="string"){const o=new et.EthereumRpcError(et.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof e.method}`,{request:e});return r(o,{id:e.id,jsonrpc:"2.0",error:o})}const n=Object.assign({},e),i={id:n.id,jsonrpc:n.jsonrpc};let s=null;try{await this._processRequest(n,i)}catch(o){s=o}return s&&(delete i.result,i.error||(i.error=et.serializeError(s))),r(s,i)}async _processRequest(e,r){const[n,i,s]=await Pt._runAllMiddleware(e,r,this._middleware);if(Pt._checkForCompletion(e,r,i),await Pt._runReturnHandlers(s),n)throw n}static async _runAllMiddleware(e,r,n){const i=[];let s=null,o=!1;for(const a of n)if([s,o]=await Pt._runMiddleware(e,r,a,i),o)break;return[s,o,i.reverse()]}static _runMiddleware(e,r,n,i){return new Promise(s=>{const o=c=>{const u=c||r.error;u&&(r.error=et.serializeError(u)),s([u,!0])},a=c=>{r.error?o(r.error):(c&&(typeof c!="function"&&o(new et.EthereumRpcError(et.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof c}" for request: -${Va(e)}`,{request:e})),i.push(c)),s([null,!1]))};try{n(e,r,a,o)}catch(c){o(c)}})}static async _runReturnHandlers(e){for(const r of e)await new Promise((n,i)=>{r(s=>s?i(s):n())})}static _checkForCompletion(e,r,n){if(!("result"in r)&&!("error"in r))throw new et.EthereumRpcError(et.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request: -${Va(e)}`,{request:e});if(!n)throw new et.EthereumRpcError(et.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request: -${Va(e)}`,{request:e})}}vi.JsonRpcEngine=Pt;function Va(t){return JSON.stringify(t,null,2)}var Ws={};Object.defineProperty(Ws,"__esModule",{value:!0});Ws.mergeMiddleware=void 0;const x2=vi;function I2(t){const e=new x2.JsonRpcEngine;return t.forEach(r=>e.push(r)),e.asMiddleware()}Ws.mergeMiddleware=I2;(function(t){var e=F&&F.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s),Object.defineProperty(n,o,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=F&&F.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(js,t),r(Bs,t),r(Fs,t),r(yi,t),r(vi,t),r(Ws,t)})(pu);var dp={},bu={};const gu=xr(D0);var Hs={};Object.defineProperty(Hs,"__esModule",{value:!0});var Mf=gu,R2=function(){function t(e){if(this._maxConcurrency=e,this._queue=[],e<=0)throw new Error("semaphore must be initialized to a positive value");this._value=e}return t.prototype.acquire=function(){var e=this,r=this.isLocked(),n=new Promise(function(i){return e._queue.push(i)});return r||this._dispatch(),n},t.prototype.runExclusive=function(e){return Mf.__awaiter(this,void 0,void 0,function(){var r,n,i;return Mf.__generator(this,function(s){switch(s.label){case 0:return[4,this.acquire()];case 1:r=s.sent(),n=r[0],i=r[1],s.label=2;case 2:return s.trys.push([2,,4,5]),[4,e(n)];case 3:return[2,s.sent()];case 4:return i(),[7];case 5:return[2]}})})},t.prototype.isLocked=function(){return this._value<=0},t.prototype.release=function(){if(this._maxConcurrency>1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var e=this._currentReleaser;this._currentReleaser=void 0,e()}},t.prototype._dispatch=function(){var e=this,r=this._queue.shift();if(r){var n=!1;this._currentReleaser=function(){n||(n=!0,e._value++,e._dispatch())},r([this._value--,this._currentReleaser])}},t}();Hs.default=R2;Object.defineProperty(bu,"__esModule",{value:!0});var kf=gu,A2=Hs,M2=function(){function t(){this._semaphore=new A2.default(1)}return t.prototype.acquire=function(){return kf.__awaiter(this,void 0,void 0,function(){var e,r;return kf.__generator(this,function(n){switch(n.label){case 0:return[4,this._semaphore.acquire()];case 1:return e=n.sent(),r=e[1],[2,r]}})})},t.prototype.runExclusive=function(e){return this._semaphore.runExclusive(function(){return e()})},t.prototype.isLocked=function(){return this._semaphore.isLocked()},t.prototype.release=function(){this._semaphore.release()},t}();bu.default=M2;var Vs={};Object.defineProperty(Vs,"__esModule",{value:!0});Vs.withTimeout=void 0;var Bi=gu;function k2(t,e,r){var n=this;return r===void 0&&(r=new Error("timeout")),{acquire:function(){return new Promise(function(i,s){return Bi.__awaiter(n,void 0,void 0,function(){var o,a,c;return Bi.__generator(this,function(u){switch(u.label){case 0:return o=!1,setTimeout(function(){o=!0,s(r)},e),[4,t.acquire()];case 1:return a=u.sent(),o?(c=Array.isArray(a)?a[1]:a,c()):i(a),[2]}})})})},runExclusive:function(i){return Bi.__awaiter(this,void 0,void 0,function(){var s,o;return Bi.__generator(this,function(a){switch(a.label){case 0:s=function(){},a.label=1;case 1:return a.trys.push([1,,7,8]),[4,this.acquire()];case 2:return o=a.sent(),Array.isArray(o)?(s=o[1],[4,i(o[0])]):[3,4];case 3:return[2,a.sent()];case 4:return s=o,[4,i()];case 5:return[2,a.sent()];case 6:return[3,8];case 7:return s(),[7];case 8:return[2]}})})},release:function(){t.release()},isLocked:function(){return t.isLocked()}}}Vs.withTimeout=k2;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.withTimeout=t.Semaphore=t.Mutex=void 0;var e=bu;Object.defineProperty(t,"Mutex",{enumerable:!0,get:function(){return e.default}});var r=Hs;Object.defineProperty(t,"Semaphore",{enumerable:!0,get:function(){return r.default}});var n=Vs;Object.defineProperty(t,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}})})(dp);var T2=N2,O2=Object.prototype.hasOwnProperty;function N2(){for(var t={},e=0;efunction(...i){const s=e.promiseModule;return new s((o,a)=>{e.multiArgs?i.push((...u)=>{e.errorFirst?u[0]?a(u):(u.shift(),o(u)):o(u)}):e.errorFirst?i.push((u,l)=>{u?a(u):o(l)}):i.push(o),Reflect.apply(t,this===r?n:this,i)})},Of=new WeakMap;var j2=(t,e)=>{e={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...e};const r=typeof t;if(!(t!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${t===null?"null":r}\``);const n=(o,a)=>{let c=Of.get(o);if(c||(c={},Of.set(o,c)),a in c)return c[a];const u=v=>typeof v=="string"||typeof a=="symbol"?a===v:v.test(a),l=Reflect.getOwnPropertyDescriptor(o,a),f=l===void 0||l.writable||l.configurable,p=(e.include?e.include.some(u):!e.exclude.some(u))&&f;return c[a]=p,p},i=new WeakMap,s=new Proxy(t,{apply(o,a,c){const u=i.get(o);if(u)return Reflect.apply(u,a,c);const l=e.excludeMain?o:Tf(o,e,s,o);return i.set(o,l),Reflect.apply(l,a,c)},get(o,a){const c=o[a];if(!n(o,a)||c===Function.prototype[a])return c;const u=i.get(c);if(u)return u;if(typeof c=="function"){const l=Tf(c,e,s,o);return i.set(c,l),l}return c}});return s};const B2=Ir.default;let F2=class extends B2{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(e){this.updates=this.updates.concat(e),e.forEach(r=>this.emit("update",r))}addInitialResults(e){}getChangesAndClear(){const e=this.updates;return this.updates=[],e}};var yu=F2;const W2=yu;let H2=class extends W2{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(e){this.allResults=this.allResults.concat(e),super.addResults(e)}addInitialResults(e){this.allResults=this.allResults.concat(e),super.addInitialResults(e)}getAllResults(){return this.allResults}};var V2=H2,_i={minBlockRef:U2,maxBlockRef:z2,sortBlockRefs:vu,bnToHex:q2,blockRefIsNumber:G2,hexToInt:os,incrementHexInt:J2,intToHex:pp,unsafeRandomBytes:Q2};function U2(...t){return vu(t)[0]}function z2(...t){const e=vu(t);return e[e.length-1]}function vu(t){return t.sort((e,r)=>e==="latest"||r==="earliest"?1:r==="latest"||e==="earliest"?-1:os(e)-os(r))}function q2(t){return"0x"+t.toString(16)}function G2(t){return t&&!["earliest","latest","pending"].includes(t)}function os(t){return t==null?t:Number.parseInt(t,16)}function J2(t){if(t==null)return t;const e=os(t);return pp(e+1)}function pp(t){if(t==null)return t;let e=t.toString(16);return e.length%2&&(e="0"+e),"0x"+e}function Q2(t){let e="0x";for(let r=0;rn.toLowerCase()))}async initialize({currentBlock:e}){let r=this.params.fromBlock;["latest","pending"].includes(r)&&(r=e),r==="earliest"&&(r="0x0"),this.params.fromBlock=r;const n=eE(this.params.toBlock,e),i=Object.assign({},this.params,{toBlock:n}),s=await this._fetchLogs(i);this.addInitialResults(s)}async update({oldBlock:e,newBlock:r}){const n=r;let i;e?i=X2(e):i=r;const s=Object.assign({},this.params,{fromBlock:i,toBlock:n}),a=(await this._fetchLogs(s)).filter(c=>this.matchLog(c));this.addResults(a)}async _fetchLogs(e){return await Y2(n=>this.ethQuery.getLogs(e,n))()}matchLog(e){if(Fi(this.params.fromBlock)>=Fi(e.blockNumber)||tE(this.params.toBlock)&&Fi(this.params.toBlock)<=Fi(e.blockNumber))return!1;const r=e.address&&e.address.toLowerCase();return this.params.address&&r&&!this.params.address.includes(r)?!1:this.params.topics.every((i,s)=>{let o=e.topics[s];if(!o)return!1;o=o.toLowerCase();let a=Array.isArray(i)?i:[i];return a.includes(null)?!0:(a=a.map(l=>l.toLowerCase()),a.includes(o))})}};var nE=rE,mu=iE;async function iE({provider:t,fromBlock:e,toBlock:r}){e||(e=r);const n=Lf(e),s=Lf(r)-n+1,o=Array(s).fill().map((c,u)=>n+u).map(sE);return await Promise.all(o.map(c=>aE(t,"eth_getBlockByNumber",[c,!1])))}function Lf(t){return t==null?t:Number.parseInt(t,16)}function sE(t){return t==null?t:"0x"+t.toString(16)}function oE(t,e){return new Promise((r,n)=>{t.sendAsync(e,(i,s)=>{i?n(i):s.error?n(s.error):s.result?r(s.result):n(new Error("Result was empty"))})})}async function aE(t,e,r){for(let n=0;n<3;n++)try{return await oE(t,{id:1,jsonrpc:"2.0",method:e,params:r})}catch(i){console.error(`provider.sendAsync failed: ${i.stack||i.message||i}`)}throw new Error(`Block not found for params: ${JSON.stringify(r)}`)}const cE=yu,uE=mu,{incrementHexInt:lE}=_i;let fE=class extends cE{constructor({provider:e,params:r}){super(),this.type="block",this.provider=e}async update({oldBlock:e,newBlock:r}){const n=r,i=lE(e),o=(await uE({provider:this.provider,fromBlock:i,toBlock:n})).map(a=>a.hash);this.addResults(o)}};var hE=fE;const dE=yu,pE=mu,{incrementHexInt:bE}=_i;let gE=class extends dE{constructor({provider:e}){super(),this.type="tx",this.provider=e}async update({oldBlock:e}){const r=e,n=bE(e),i=await pE({provider:this.provider,fromBlock:n,toBlock:r}),s=[];for(const o of i)s.push(...o.transactions);this.addResults(s)}};var yE=gE;const vE=dp.Mutex,{createAsyncMiddleware:mE,createScaffoldMiddleware:_E}=pu,wE=nE,SE=hE,EE=yE,{intToHex:bp,hexToInt:Ua}=_i;var CE=xE;function xE({blockTracker:t,provider:e}){let r=0,n={};const i=new vE,s=IE({mutex:i}),o=_E({eth_newFilter:s(za(c)),eth_newBlockFilter:s(za(u)),eth_newPendingTransactionFilter:s(za(l)),eth_uninstallFilter:s(Qi(p)),eth_getFilterChanges:s(Qi(f)),eth_getFilterLogs:s(Qi(h))}),a=async({oldBlock:y,newBlock:m})=>{if(n.length===0)return;const x=await i.acquire();try{await Promise.all(Hr(n).map(async C=>{try{await C.update({oldBlock:y,newBlock:m})}catch(T){console.error(T)}}))}catch(C){console.error(C)}x()};return o.newLogFilter=c,o.newBlockFilter=u,o.newPendingTransactionFilter=l,o.uninstallFilter=p,o.getFilterChanges=f,o.getFilterLogs=h,o.destroy=()=>{_()},o;async function c(y){const m=new wE({provider:e,params:y});return await v(m),m}async function u(){const y=new SE({provider:e});return await v(y),y}async function l(){const y=new EE({provider:e});return await v(y),y}async function f(y){const m=Ua(y),x=n[m];if(!x)throw new Error(`No filter for index "${m}"`);return x.getChangesAndClear()}async function h(y){const m=Ua(y),x=n[m];if(!x)throw new Error(`No filter for index "${m}"`);let C=[];return x.type==="log"&&(C=x.getAllResults()),C}async function p(y){const m=Ua(y),C=!!n[m];return C&&await E(m),C}async function v(y){const m=Hr(n).length,x=await t.getLatestBlock();await y.initialize({currentBlock:x}),r++,n[r]=y,y.id=r,y.idHex=bp(r);const C=Hr(n).length;return d({prevFilterCount:m,newFilterCount:C}),r}async function E(y){const m=Hr(n).length;delete n[y];const x=Hr(n).length;d({prevFilterCount:m,newFilterCount:x})}async function _(){const y=Hr(n).length;n={},d({prevFilterCount:y,newFilterCount:0})}function d({prevFilterCount:y,newFilterCount:m}){if(y===0&&m>0){t.on("sync",a);return}if(y>0&&m===0){t.removeListener("sync",a);return}}}function za(t){return Qi(async(...e)=>{const r=await t(...e);return bp(r.id)})}function Qi(t){return mE(async(e,r)=>{const n=await t.apply(null,e.params);r.result=n})}function IE({mutex:t}){return e=>async(r,n,i,s)=>{(await t.acquire())(),e(r,n,i,s)}}function Hr(t,e){const r=[];for(let n in t)r.push(t[n]);return r}const RE=Ir.default,{createAsyncMiddleware:Pf,createScaffoldMiddleware:AE}=pu,ME=CE,{unsafeRandomBytes:kE,incrementHexInt:TE}=_i,OE=mu;var NE=LE;function LE({blockTracker:t,provider:e}){const r={},n=ME({blockTracker:t,provider:e});let i=!1;const s=new RE,o=AE({eth_subscribe:Pf(a),eth_unsubscribe:Pf(c)});return o.destroy=l,{events:s,middleware:o};async function a(f,h){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const p=f.params[0],v=kE(16);let E;switch(p){case"newHeads":E=_({subId:v});break;case"logs":const y=f.params[1],m=await n.newLogFilter(y);E=d({subId:v,filter:m});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${p}"`)}r[v]=E,h.result=v;return;function _({subId:y}){const m={type:p,destroy:async()=>{t.removeListener("sync",m.update)},update:async({oldBlock:x,newBlock:C})=>{const T=C,j=TE(x);(await OE({provider:e,fromBlock:j,toBlock:T})).map(PE).filter(U=>U!==null).forEach(U=>{u(y,U)})}};return t.on("sync",m.update),m}function d({subId:y,filter:m}){return m.on("update",C=>u(y,C)),{type:p,destroy:async()=>await n.uninstallFilter(m.idHex)}}}async function c(f,h){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const p=f.params[0],v=r[p];if(!v){h.result=!1;return}delete r[p],await v.destroy(),h.result=!0}function u(f,h){s.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:f,result:h}})}function l(){s.removeAllListeners();for(const f in r)r[f].destroy(),delete r[f];i=!0}}function PE(t){return t==null?null:{hash:t.hash,parentHash:t.parentHash,sha3Uncles:t.sha3Uncles,miner:t.miner,stateRoot:t.stateRoot,transactionsRoot:t.transactionsRoot,receiptsRoot:t.receiptsRoot,logsBloom:t.logsBloom,difficulty:t.difficulty,number:t.number,gasLimit:t.gasLimit,gasUsed:t.gasUsed,nonce:t.nonce,mixHash:t.mixHash,timestamp:t.timestamp,extraData:t.extraData}}Object.defineProperty(Rs,"__esModule",{value:!0});Rs.SubscriptionManager=void 0;const $E=Td,DE=NE,$f=()=>{};class jE{constructor(e){const r=new $E.PollingBlockTracker({provider:e,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:n,middleware:i}=DE({blockTracker:r,provider:e});this.events=n,this.subscriptionMiddleware=i}async handleRequest(e){const r={};return await this.subscriptionMiddleware(e,r,$f,$f),r}destroy(){this.subscriptionMiddleware.destroy()}}Rs.SubscriptionManager=jE;var _u=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(tn,"__esModule",{value:!0});tn.CoinbaseWalletProvider=void 0;const BE=_u(Ir),FE=_u(ds),qa=vn,de=ni,Df=_n,jf=pt,Ga=ms,WE=be,X=W,Ja=_u(Cm),HE=an,ue=kd,VE=Rs,Bf="DefaultChainId",Ff="DefaultJsonRpcUrl";class UE extends BE.default{constructor(e){var r,n;super(),this._filterPolyfill=new HE.FilterPolyfill(this),this._subscriptionManager=new VE.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=e.chainId,this._jsonRpcUrlFromOpts=e.jsonRpcUrl,this._overrideIsMetaMask=e.overrideIsMetaMask,this._relayProvider=e.relayProvider,this._storage=e.storage,this._relayEventManager=e.relayEventManager,this.diagnostic=e.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=(r=e.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this.isCoinbaseBrowser=(n=e.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this.qrUrl=e.qrUrl;const i=this.getChainId(),s=(0,X.prepend0x)(i.toString(16));this.emit("connect",{chainIdStr:s});const o=this._storage.getItem(jf.LOCAL_STORAGE_ADDRESSES_KEY);if(o){const a=o.split(" ");a[0]!==""&&(this._addresses=a.map(c=>(0,X.ensureAddressString)(c)),this.emit("accountsChanged",a))}this._subscriptionManager.events.on("notification",a=>{this.emit("message",{type:a.method,data:a.params})}),this._isAuthorized()&&this.initializeRelay(),window.addEventListener("message",a=>{var c;if(!(a.origin!==location.origin||a.source!==window)&&a.data.type==="walletLinkMessage"){if(a.data.data.action==="dappChainSwitched"){const u=a.data.data.chainId,l=(c=a.data.data.jsonRpcUrl)!==null&&c!==void 0?c:this.jsonRpcUrl;this.updateProviderInfo(l,Number(u))}a.data.data.action==="addressChanged"&&this._setAddresses([a.data.data.address])}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,X.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var e;return(e=this._storage.getItem(Ff))!==null&&e!==void 0?e:this._jsonRpcUrlFromOpts}set jsonRpcUrl(e){this._storage.setItem(Ff,e)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(e,r){this.isCoinbaseBrowser||(this._chainIdFromOpts=r,this._jsonRpcUrlFromOpts=e),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(e,r){this.jsonRpcUrl=e;const n=this.getChainId();this._storage.setItem(Bf,r.toString(10)),((0,X.ensureIntNumber)(r)!==n||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(e,r,n,i,s,o){return!!(await(await this.initializeRelay()).watchAsset(e,r,n,i,s,o==null?void 0:o.toString()).promise).result}async addEthereumChain(e,r,n,i,s,o){var a,c;if((0,X.ensureIntNumber)(e)===this.getChainId())return!1;const u=await this.initializeRelay(),l=u.inlineAddEthereumChain(e.toString());!this._isAuthorized()&&!l&&await u.requestEthereumAccounts().promise;const f=await u.addEthereumChain(e.toString(),r,s,n,i,o).promise;return((a=f.result)===null||a===void 0?void 0:a.isApproved)===!0&&this.updateProviderInfo(r[0],e),((c=f.result)===null||c===void 0?void 0:c.isApproved)===!0}async switchEthereumChain(e){const n=await(await this.initializeRelay()).switchEthereumChain(e.toString(10),this.selectedAddress||void 0).promise;if((0,WE.isErrorResponse)(n)&&n.errorCode)throw n.errorCode===de.standardErrorCodes.provider.unsupportedChain?de.standardErrors.provider.unsupportedChain(e):de.standardErrors.provider.custom({message:n.errorMessage,code:n.errorCode});const i=n.result;i.isApproved&&i.rpcUrl.length>0&&this.updateProviderInfo(i.rpcUrl,e)}setAppInfo(e,r){this.initializeRelay().then(n=>n.setAppInfo(e,r))}async enable(){var e;return(e=this.diagnostic)===null||e===void 0||e.log(qa.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?Df.Session.hash(this._relay.session.id):void 0}),this._isAuthorized()?[...this._addresses]:await this.send(ue.JSONRPCMethod.eth_requestAccounts)}async close(){(await this.initializeRelay()).resetAndReload()}send(e,r){try{const n=this._send(e,r);if(n instanceof Promise)return n.catch(i=>{throw(0,de.serializeError)(i,e)})}catch(n){throw(0,de.serializeError)(n,e)}}_send(e,r){if(typeof e=="string"){const i=e,s=Array.isArray(r)?r:r!==void 0?[r]:[],o={jsonrpc:"2.0",id:0,method:i,params:s};return this._sendRequestAsync(o).then(a=>a.result)}if(typeof r=="function"){const i=e,s=r;return this._sendAsync(i,s)}if(Array.isArray(e))return e.map(s=>this._sendRequest(s));const n=e;return this._sendRequest(n)}async sendAsync(e,r){try{return this._sendAsync(e,r).catch(n=>{throw(0,de.serializeError)(n,e)})}catch(n){return Promise.reject((0,de.serializeError)(n,e))}}async _sendAsync(e,r){if(typeof r!="function")throw new Error("callback is required");if(Array.isArray(e)){const i=r;this._sendMultipleRequestsAsync(e).then(s=>i(null,s)).catch(s=>i(s,null));return}const n=r;return this._sendRequestAsync(e).then(i=>n(null,i)).catch(i=>n(i,null))}async request(e){try{return this._request(e).catch(r=>{throw(0,de.serializeError)(r,e.method)})}catch(r){return Promise.reject((0,de.serializeError)(r,e.method))}}async _request(e){if(!e||typeof e!="object"||Array.isArray(e))throw de.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:e});const{method:r,params:n}=e;if(typeof r!="string"||r.length===0)throw de.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:e});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw de.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:e});const i=n===void 0?[]:n,s=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:r,params:i,jsonrpc:"2.0",id:s})).result}async scanQRCode(e){var r;const i=await(await this.initializeRelay()).scanQRCode((0,X.ensureRegExpString)(e)).promise;if(typeof i.result!="string")throw(0,de.serializeError)((r=i.errorMessage)!==null&&r!==void 0?r:"result was not a string",Ga.Web3Method.scanQRCode);return i.result}async genericRequest(e,r){var n;const s=await(await this.initializeRelay()).genericRequest(e,r).promise;if(typeof s.result!="string")throw(0,de.serializeError)((n=s.errorMessage)!==null&&n!==void 0?n:"result was not a string",Ga.Web3Method.generic);return s.result}async selectProvider(e){var r;const i=await(await this.initializeRelay()).selectProvider(e).promise;if(typeof i.result!="string")throw(0,de.serializeError)((r=i.errorMessage)!==null&&r!==void 0?r:"result was not a string",Ga.Web3Method.selectProvider);return i.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(e){const r={jsonrpc:"2.0",id:e.id},{method:n}=e;if(r.result=this._handleSynchronousMethods(e),r.result===void 0)throw new Error(`Coinbase Wallet does not support calling ${n} synchronously without a callback. Please provide a callback parameter to call ${n} asynchronously.`);return r}_setAddresses(e,r){if(!Array.isArray(e))throw new Error("addresses is not an array");const n=e.map(i=>(0,X.ensureAddressString)(i));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(jf.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" ")))}_sendRequestAsync(e){return new Promise((r,n)=>{try{const i=this._handleSynchronousMethods(e);if(i!==void 0)return r({jsonrpc:"2.0",id:e.id,result:i});const s=this._handleAsynchronousFilterMethods(e);if(s!==void 0){s.then(a=>r(Object.assign(Object.assign({},a),{id:e.id}))).catch(a=>n(a));return}const o=this._handleSubscriptionMethods(e);if(o!==void 0){o.then(a=>r({jsonrpc:"2.0",id:e.id,result:a.result})).catch(a=>n(a));return}}catch(i){return n(i)}this._handleAsynchronousMethods(e).then(i=>i&&r(Object.assign(Object.assign({},i),{id:e.id}))).catch(i=>n(i))})}_sendMultipleRequestsAsync(e){return Promise.all(e.map(r=>this._sendRequestAsync(r)))}_handleSynchronousMethods(e){const{method:r}=e,n=e.params||[];switch(r){case ue.JSONRPCMethod.eth_accounts:return this._eth_accounts();case ue.JSONRPCMethod.eth_coinbase:return this._eth_coinbase();case ue.JSONRPCMethod.eth_uninstallFilter:return this._eth_uninstallFilter(n);case ue.JSONRPCMethod.net_version:return this._net_version();case ue.JSONRPCMethod.eth_chainId:return this._eth_chainId();default:return}}async _handleAsynchronousMethods(e){const{method:r}=e,n=e.params||[];switch(r){case ue.JSONRPCMethod.eth_requestAccounts:return this._eth_requestAccounts();case ue.JSONRPCMethod.eth_sign:return this._eth_sign(n);case ue.JSONRPCMethod.eth_ecRecover:return this._eth_ecRecover(n);case ue.JSONRPCMethod.personal_sign:return this._personal_sign(n);case ue.JSONRPCMethod.personal_ecRecover:return this._personal_ecRecover(n);case ue.JSONRPCMethod.eth_signTransaction:return this._eth_signTransaction(n);case ue.JSONRPCMethod.eth_sendRawTransaction:return this._eth_sendRawTransaction(n);case ue.JSONRPCMethod.eth_sendTransaction:return this._eth_sendTransaction(n);case ue.JSONRPCMethod.eth_signTypedData_v1:return this._eth_signTypedData_v1(n);case ue.JSONRPCMethod.eth_signTypedData_v2:return this._throwUnsupportedMethodError();case ue.JSONRPCMethod.eth_signTypedData_v3:return this._eth_signTypedData_v3(n);case ue.JSONRPCMethod.eth_signTypedData_v4:case ue.JSONRPCMethod.eth_signTypedData:return this._eth_signTypedData_v4(n);case ue.JSONRPCMethod.cbWallet_arbitrary:return this._cbwallet_arbitrary(n);case ue.JSONRPCMethod.wallet_addEthereumChain:return this._wallet_addEthereumChain(n);case ue.JSONRPCMethod.wallet_switchEthereumChain:return this._wallet_switchEthereumChain(n);case ue.JSONRPCMethod.wallet_watchAsset:return this._wallet_watchAsset(n)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(e,this.jsonRpcUrl)}_handleAsynchronousFilterMethods(e){const{method:r}=e,n=e.params||[];switch(r){case ue.JSONRPCMethod.eth_newFilter:return this._eth_newFilter(n);case ue.JSONRPCMethod.eth_newBlockFilter:return this._eth_newBlockFilter();case ue.JSONRPCMethod.eth_newPendingTransactionFilter:return this._eth_newPendingTransactionFilter();case ue.JSONRPCMethod.eth_getFilterChanges:return this._eth_getFilterChanges(n);case ue.JSONRPCMethod.eth_getFilterLogs:return this._eth_getFilterLogs(n)}}_handleSubscriptionMethods(e){switch(e.method){case ue.JSONRPCMethod.eth_subscribe:case ue.JSONRPCMethod.eth_unsubscribe:return this._subscriptionManager.handleRequest(e)}}_isKnownAddress(e){try{const r=(0,X.ensureAddressString)(e);return this._addresses.map(i=>(0,X.ensureAddressString)(i)).includes(r)}catch{}return!1}_ensureKnownAddress(e){var r;if(!this._isKnownAddress(e))throw(r=this.diagnostic)===null||r===void 0||r.log(qa.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const r=e.from?(0,X.ensureAddressString)(e.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);const n=e.to?(0,X.ensureAddressString)(e.to):null,i=e.value!=null?(0,X.ensureBN)(e.value):new FE.default(0),s=e.data?(0,X.ensureBuffer)(e.data):Buffer.alloc(0),o=e.nonce!=null?(0,X.ensureIntNumber)(e.nonce):null,a=e.gasPrice!=null?(0,X.ensureBN)(e.gasPrice):null,c=e.maxFeePerGas!=null?(0,X.ensureBN)(e.maxFeePerGas):null,u=e.maxPriorityFeePerGas!=null?(0,X.ensureBN)(e.maxPriorityFeePerGas):null,l=e.gas!=null?(0,X.ensureBN)(e.gas):null,f=this.getChainId();return{fromAddress:r,toAddress:n,weiValue:i,data:s,nonce:o,gasPriceInWei:a,maxFeePerGas:c,maxPriorityFeePerGas:u,gasLimit:l,chainId:f}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw de.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw de.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(e,r,n,i){this._ensureKnownAddress(r);try{return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).signEthereumMessage(e,r,n,i).promise).result}}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?de.standardErrors.provider.userRejectedRequest("User denied message signature"):s}}async _ethereumAddressFromSignedMessage(e,r,n){return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).ethereumAddressFromSignedMessage(e,r,n).promise).result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,X.hexStringFromIntNumber)(this.getChainId())}getChainId(){const e=this._storage.getItem(Bf);if(!e)return(0,X.ensureIntNumber)(this._chainIdFromOpts);const r=parseInt(e,10);return(0,X.ensureIntNumber)(r)}async _eth_requestAccounts(){var e;if((e=this.diagnostic)===null||e===void 0||e.log(qa.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?Df.Session.hash(this._relay.session.id):void 0}),this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let r;try{r=await(await this.initializeRelay()).requestEthereumAccounts().promise}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?de.standardErrors.provider.userRejectedRequest("User denied account authorization"):n}if(!r.result)throw new Error("accounts received is empty");return this._setAddresses(r.result),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(e){this._requireAuthorization();const r=(0,X.ensureAddressString)(e[0]),n=(0,X.ensureBuffer)(e[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(e){const r=(0,X.ensureBuffer)(e[0]),n=(0,X.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(e){this._requireAuthorization();const r=(0,X.ensureBuffer)(e[0]),n=(0,X.ensureAddressString)(e[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(e){const r=(0,X.ensureBuffer)(e[0]),n=(0,X.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(r,n,!0)}async _eth_signTransaction(e){this._requireAuthorization();const r=this._prepareTransactionParams(e[0]||{});try{return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).signEthereumTransaction(r).promise).result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?de.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(e){const r=(0,X.ensureBuffer)(e[0]);return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).submitEthereumTransaction(r,this.getChainId()).promise).result}}async _eth_sendTransaction(e){this._requireAuthorization();const r=this._prepareTransactionParams(e[0]||{});try{return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).signAndSubmitEthereumTransaction(r).promise).result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?de.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(e){this._requireAuthorization();const r=(0,X.ensureParsedJSONObject)(e[0]),n=(0,X.ensureAddressString)(e[1]);this._ensureKnownAddress(n);const i=Ja.default.hashForSignTypedDataLegacy({data:r}),s=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,s)}async _eth_signTypedData_v3(e){this._requireAuthorization();const r=(0,X.ensureAddressString)(e[0]),n=(0,X.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);const i=Ja.default.hashForSignTypedData_v3({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _eth_signTypedData_v4(e){this._requireAuthorization();const r=(0,X.ensureAddressString)(e[0]),n=(0,X.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);const i=Ja.default.hashForSignTypedData_v4({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _cbwallet_arbitrary(e){const r=e[0],n=e[1];if(typeof n!="string")throw new Error("parameter must be a string");if(typeof r!="object"||r===null)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(r,n)}}async _wallet_addEthereumChain(e){var r,n,i,s;const o=e[0];if(((r=o.rpcUrls)===null||r===void 0?void 0:r.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!o.chainName||o.chainName.trim()==="")throw de.standardErrors.rpc.invalidParams("chainName is a required field");if(!o.nativeCurrency)throw de.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const a=parseInt(o.chainId,16);return await this.addEthereumChain(a,(n=o.rpcUrls)!==null&&n!==void 0?n:[],(i=o.blockExplorerUrls)!==null&&i!==void 0?i:[],o.chainName,(s=o.iconUrls)!==null&&s!==void 0?s:[],o.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(e){const r=e[0];return await this.switchEthereumChain(parseInt(r.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(e){const r=Array.isArray(e)?e[0]:e;if(!r.type)throw de.standardErrors.rpc.invalidParams("Type is required");if((r==null?void 0:r.type)!=="ERC20")throw de.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!(r!=null&&r.options))throw de.standardErrors.rpc.invalidParams("Options are required");if(!(r!=null&&r.options.address))throw de.standardErrors.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:i,symbol:s,image:o,decimals:a}=r.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(r.type,i,s,a,o,n)}}_eth_uninstallFilter(e){const r=(0,X.ensureHexString)(e[0]);return this._filterPolyfill.uninstallFilter(r)}async _eth_newFilter(e){const r=e[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(r)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(e){const r=(0,X.ensureHexString)(e[0]);return this._filterPolyfill.getFilterChanges(r)}_eth_getFilterLogs(e){const r=(0,X.ensureHexString)(e[0]);return this._filterPolyfill.getFilterLogs(r)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(e=>(e.setAccountsCallback((r,n)=>this._setAddresses(r,n)),e.setChainCallback((r,n)=>{this.updateProviderInfo(n,parseInt(r,10))}),e.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=e,e))}}tn.CoinbaseWalletProvider=UE;var Us={},zs={},wi,G,gp,yp,pr,Wf,vp,_c,mp,Xn={},_p=[],zE=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,qs=Array.isArray;function jt(t,e){for(var r in e)t[r]=e[r];return t}function wp(t){var e=t.parentNode;e&&e.removeChild(t)}function wc(t,e,r){var n,i,s,o={};for(s in e)s=="key"?n=e[s]:s=="ref"?i=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?wi.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)o[s]===void 0&&(o[s]=t.defaultProps[s]);return qn(t,o,n,i,null)}function qn(t,e,r,n,i){var s={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++gp,__i:-1,__u:0};return i==null&&G.vnode!=null&&G.vnode(s),s}function qE(){return{current:null}}function Si(t){return t.children}function Gn(t,e){this.props=t,this.context=e}function ln(t,e){if(e==null)return t.__?ln(t.__,t.__i+1):null;for(var r;ee&&pr.sort(_c));as.__r=0}function Ep(t,e,r,n,i,s,o,a,c,u,l){var f,h,p,v,E,_=n&&n.__k||_p,d=e.length;for(r.__d=c,GE(r,e,_),c=r.__d,f=0;f0?qn(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=t,i.__b=t.__b+1,a=JE(i,r,o=n+f,l),i.__i=a,s=null,a!==-1&&(l--,(s=r[a])&&(s.__u|=131072)),s==null||s.__v===null?(a==-1&&f--,typeof i.type!="function"&&(i.__u|=65536)):a!==o&&(a===o+1?f++:a>o?l>c-o?f+=a-o:f--:f=a(c!=null&&!(131072&c.__u)?1:0))for(;o>=0||a=0){if((c=e[o])&&!(131072&c.__u)&&i==c.key&&s===c.type)return o;o--}if(a2&&(a.children=arguments.length>3?wi.call(arguments,2):r),qn(t.type,a,n||t.key,i||t.ref,null)}function KE(t,e){var r={__c:e="__cC"+mp++,__:t,Consumer:function(n,i){return n.children(i)},Provider:function(n){var i,s;return this.getChildContext||(i=[],(s={})[e]=this,this.getChildContext=function(){return s},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&i.some(function(a){a.__e=!0,Sc(a)})},this.sub=function(o){i.push(o);var a=o.componentWillUnmount;o.componentWillUnmount=function(){i.splice(i.indexOf(o),1),a&&a.call(o)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}wi=_p.slice,G={__e:function(t,e,r,n){for(var i,s,o;e=e.__;)if((i=e.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(t)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,n||{}),o=i.__d),o)return i.__E=i}catch(a){t=a}throw t}},gp=0,yp=function(t){return t!=null&&t.constructor==null},Gn.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=jt({},this.state),typeof t=="function"&&(t=t(jt({},r),this.props)),t&&jt(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),Sc(this))},Gn.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Sc(this))},Gn.prototype.render=Si,pr=[],vp=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,_c=function(t,e){return t.__v.__b-e.__v.__b},as.__r=0,mp=0;const XE=Object.freeze(Object.defineProperty({__proto__:null,Component:Gn,Fragment:Si,cloneElement:YE,createContext:KE,createElement:wc,createRef:qE,h:wc,hydrate:Ap,get isValidElement(){return yp},get options(){return G},render:Rp,toChildArray:xp},Symbol.toStringTag,{value:"Module"})),Ke=xr(XE);function fn(t){return typeof t=="function"}var zf=!1,rt={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){if(t){var e=new Error;""+e.stack}zf=t},get useDeprecatedSynchronousErrorHandling(){return zf}};function Gr(t){setTimeout(function(){throw t},0)}var cs={closed:!0,next:function(t){},error:function(t){if(rt.useDeprecatedSynchronousErrorHandling)throw t;Gr(t)},complete:function(){}},Ue=function(){return Array.isArray||function(t){return t&&typeof t.length=="number"}}();function Eu(t){return t!==null&&typeof t=="object"}var e3=function(){function t(e){return Error.call(this),this.message=e?e.length+` errors occurred during unsubscription: -`+e.map(function(r,n){return n+1+") "+r.toString()}).join(` - `):"",this.name="UnsubscriptionError",this.errors=e,this}return t.prototype=Object.create(Error.prototype),t}(),Jn=e3,_e=function(){function t(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return t.prototype.unsubscribe=function(){var e;if(!this.closed){var r=this,n=r._parentOrParents,i=r._ctorUnsubscribe,s=r._unsubscribe,o=r._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof t)n.remove(this);else if(n!==null)for(var a=0;a1){this.connection=null;return}var i=this.connection,s=r._connection;this.connection=null,s&&(!i||s===i)&&s.unsubscribe()},e}(V),Op=function(t){I(e,t);function e(r,n){var i=t.call(this)||this;return i.source=r,i.subjectFactory=n,i._refCount=0,i._isComplete=!1,i}return e.prototype._subscribe=function(r){return this.getSubject().subscribe(r)},e.prototype.getSubject=function(){var r=this._subject;return(!r||r.isStopped)&&(this._subject=this.subjectFactory()),this._subject},e.prototype.connect=function(){var r=this._connection;return r||(this._isComplete=!1,r=this._connection=new _e,r.add(this.source.subscribe(new o3(this.getSubject(),this))),r.closed&&(this._connection=null,r=_e.EMPTY)),r},e.prototype.refCount=function(){return xu()(this)},e}(ee),s3=function(){var t=Op.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:t._subscribe},_isComplete:{value:t._isComplete,writable:!0},getSubject:{value:t.getSubject},connect:{value:t.connect},refCount:{value:t.refCount}}}(),o3=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.connectable=n,i}return e.prototype._error=function(r){this._unsubscribe(),t.prototype._error.call(this,r)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var r=this.connectable;if(r){this.connectable=null;var n=r._connection;r._refCount=0,r._subject=null,r._connection=null,n&&n.unsubscribe()}},e}(Tp);function a3(t,e,r,n){return function(i){return i.lift(new c3(t,e,r,n))}}var c3=function(){function t(e,r,n,i){this.keySelector=e,this.elementSelector=r,this.durationSelector=n,this.subjectSelector=i}return t.prototype.call=function(e,r){return r.subscribe(new u3(e,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},t}(),u3=function(t){I(e,t);function e(r,n,i,s,o){var a=t.call(this,r)||this;return a.keySelector=n,a.elementSelector=i,a.durationSelector=s,a.subjectSelector=o,a.groups=null,a.attemptedToUnsubscribe=!1,a.count=0,a}return e.prototype._next=function(r){var n;try{n=this.keySelector(r)}catch(i){this.error(i);return}this._group(r,n)},e.prototype._group=function(r,n){var i=this.groups;i||(i=this.groups=new Map);var s=i.get(n),o;if(this.elementSelector)try{o=this.elementSelector(r)}catch(u){this.error(u)}else o=r;if(!s){s=this.subjectSelector?this.subjectSelector():new Ne,i.set(n,s);var a=new xc(n,s,this);if(this.destination.next(a),this.durationSelector){var c=void 0;try{c=this.durationSelector(new xc(n,s))}catch(u){this.error(u);return}this.add(c.subscribe(new l3(n,s,this)))}}s.closed||s.next(o)},e.prototype._error=function(r){var n=this.groups;n&&(n.forEach(function(i,s){i.error(r)}),n.clear()),this.destination.error(r)},e.prototype._complete=function(){var r=this.groups;r&&(r.forEach(function(n,i){n.complete()}),r.clear()),this.destination.complete()},e.prototype.removeGroup=function(r){this.groups.delete(r)},e.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,this.count===0&&t.prototype.unsubscribe.call(this))},e}(V),l3=function(t){I(e,t);function e(r,n,i){var s=t.call(this,n)||this;return s.key=r,s.group=n,s.parent=i,s}return e.prototype._next=function(r){this.complete()},e.prototype._unsubscribe=function(){var r=this,n=r.parent,i=r.key;this.key=this.parent=null,n&&n.removeGroup(i)},e}(V),xc=function(t){I(e,t);function e(r,n,i){var s=t.call(this)||this;return s.key=r,s.groupSubject=n,s.refCountSubscription=i,s}return e.prototype._subscribe=function(r){var n=new _e,i=this,s=i.refCountSubscription,o=i.groupSubject;return s&&!s.closed&&n.add(new f3(s)),n.add(o.subscribe(r)),n},e}(ee),f3=function(t){I(e,t);function e(r){var n=t.call(this)||this;return n.parent=r,r.count++,n}return e.prototype.unsubscribe=function(){var r=this.parent;!r.closed&&!this.closed&&(t.prototype.unsubscribe.call(this),r.count-=1,r.count===0&&r.attemptedToUnsubscribe&&r.unsubscribe())},e}(_e),Np=function(t){I(e,t);function e(r){var n=t.call(this)||this;return n._value=r,n}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(r){var n=t.prototype._subscribe.call(this,r);return n&&!n.closed&&r.next(this._value),n},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new Zt;return this._value},e.prototype.next=function(r){t.prototype.next.call(this,this._value=r)},e}(Ne),h3=function(t){I(e,t);function e(r,n){return t.call(this)||this}return e.prototype.schedule=function(r,n){return this},e}(_e),Ei=function(t){I(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i.pending=!1,i}return e.prototype.schedule=function(r,n){if(n===void 0&&(n=0),this.closed)return this;this.state=r;var i=this.id,s=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(s,i,n)),this.pending=!0,this.delay=n,this.id=this.id||this.requestAsyncId(s,this.id,n),this},e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),setInterval(r.flush.bind(r,this),i)},e.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!==null&&this.delay===i&&this.pending===!1)return n;clearInterval(n)},e.prototype.execute=function(r,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(r,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(r,n){var i=!1,s=void 0;try{this.work(r)}catch(o){i=!0,s=!!o&&o||new Error(o)}if(i)return this.unsubscribe(),s},e.prototype._unsubscribe=function(){var r=this.id,n=this.scheduler,i=n.actions,s=i.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,s!==-1&&i.splice(s,1),r!=null&&(this.id=this.recycleAsyncId(n,r,null)),this.delay=null},e}(h3),d3=function(t){I(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i}return e.prototype.schedule=function(r,n){return n===void 0&&(n=0),n>0?t.prototype.schedule.call(this,r,n):(this.delay=n,this.state=r,this.scheduler.flush(this),this)},e.prototype.execute=function(r,n){return n>0||this.closed?t.prototype.execute.call(this,r,n):this._execute(r,n)},e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!==null&&i>0||i===null&&this.delay>0?t.prototype.requestAsyncId.call(this,r,n,i):r.flush(this)},e}(Ei),Ic=function(){function t(e,r){r===void 0&&(r=t.now),this.SchedulerAction=e,this.now=r}return t.prototype.schedule=function(e,r,n){return r===void 0&&(r=0),new this.SchedulerAction(this,e).schedule(n,r)},t.now=function(){return Date.now()},t}(),Ci=function(t){I(e,t);function e(r,n){n===void 0&&(n=Ic.now);var i=t.call(this,r,function(){return e.delegate&&e.delegate!==i?e.delegate.now():n()})||this;return i.actions=[],i.active=!1,i.scheduled=void 0,i}return e.prototype.schedule=function(r,n,i){return n===void 0&&(n=0),e.delegate&&e.delegate!==this?e.delegate.schedule(r,n,i):t.prototype.schedule.call(this,r,n,i)},e.prototype.flush=function(r){var n=this.actions;if(this.active){n.push(r);return}var i;this.active=!0;do if(i=r.execute(r.state,r.delay))break;while(r=n.shift());if(this.active=!1,i){for(;r=n.shift();)r.unsubscribe();throw i}},e}(Ic),p3=function(t){I(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Ci),Lp=new p3(d3),Pp=Lp,hn=new ee(function(t){return t.complete()});function An(t){return t?b3(t):hn}function b3(t){return new ee(function(e){return t.schedule(function(){return e.complete()})})}function Ye(t){return t&&typeof t.schedule=="function"}var $p=function(t){return function(e){for(var r=0,n=t.length;rthis._bufferSize&&n.shift()}t.prototype.next.call(this,r)},e.prototype.nextTimeWindow=function(r){this.isStopped||(this._events.push(new _3(this._getNow(),r)),this._trimBufferThenGetEvents()),t.prototype.next.call(this,r)},e.prototype._subscribe=function(r){var n=this._infiniteTimeWindow,i=n?this._events:this._trimBufferThenGetEvents(),s=this.scheduler,o=i.length,a;if(this.closed)throw new Zt;if(this.isStopped||this.hasError?a=_e.EMPTY:(this.observers.push(r),a=new kp(this,r)),s&&r.add(r=new Dp(r,s)),n)for(var c=0;cn&&(a=Math.max(a,o-n)),a>0&&s.splice(0,a),s},e}(Ne),_3=function(){function t(e,r){this.time=e,this.value=r}return t}(),Mn=function(t){I(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.value=null,r.hasNext=!1,r.hasCompleted=!1,r}return e.prototype._subscribe=function(r){return this.hasError?(r.error(this.thrownError),_e.EMPTY):this.hasCompleted&&this.hasNext?(r.next(this.value),r.complete(),_e.EMPTY):t.prototype._subscribe.call(this,r)},e.prototype.next=function(r){this.hasCompleted||(this.value=r,this.hasNext=!0)},e.prototype.error=function(r){this.hasCompleted||t.prototype.error.call(this,r)},e.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&t.prototype.next.call(this,this.value),t.prototype.complete.call(this)},e}(Ne),w3=1,S3=function(){return Promise.resolve()}(),Ac={};function Zf(t){return t in Ac?(delete Ac[t],!0):!1}var Yf={setImmediate:function(t){var e=w3++;return Ac[e]=!0,S3.then(function(){return Zf(e)&&t()}),e},clearImmediate:function(t){Zf(t)}},E3=function(t){I(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i}return e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!==null&&i>0?t.prototype.requestAsyncId.call(this,r,n,i):(r.actions.push(this),r.scheduled||(r.scheduled=Yf.setImmediate(r.flush.bind(r,null))))},e.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!==null&&i>0||i===null&&this.delay>0)return t.prototype.recycleAsyncId.call(this,r,n,i);r.actions.length===0&&(Yf.clearImmediate(n),r.scheduled=void 0)},e}(Ei),C3=function(t){I(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.flush=function(r){this.active=!0,this.scheduled=void 0;var n=this.actions,i,s=-1,o=n.length;r=r||n.shift();do if(i=r.execute(r.state,r.delay))break;while(++s0?t.prototype.requestAsyncId.call(this,r,n,i):(r.actions.push(this),r.scheduled||(r.scheduled=requestAnimationFrame(function(){return r.flush(null)})))},e.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!==null&&i>0||i===null&&this.delay>0)return t.prototype.recycleAsyncId.call(this,r,n,i);r.actions.length===0&&(cancelAnimationFrame(n),r.scheduled=void 0)},e}(Ei),I3=function(t){I(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.flush=function(r){this.active=!0,this.scheduled=void 0;var n=this.actions,i,s=-1,o=n.length;r=r||n.shift();do if(i=r.execute(r.state,r.delay))break;while(++sn.index?1:-1:r.delay>n.delay?1:-1},e}(Ei);function Ct(){}function M3(t){return!!t&&(t instanceof ee||typeof t.lift=="function"&&typeof t.subscribe=="function")}var k3=function(){function t(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return t.prototype=Object.create(Error.prototype),t}(),dn=k3,T3=function(){function t(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return t.prototype=Object.create(Error.prototype),t}(),Ii=T3,O3=function(){function t(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return t.prototype=Object.create(Error.prototype),t}(),Hp=O3;function ct(t,e){return function(n){if(typeof t!="function")throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new N3(t,e))}}var N3=function(){function t(e,r){this.project=e,this.thisArg=r}return t.prototype.call=function(e,r){return r.subscribe(new L3(e,this.project,this.thisArg))},t}(),L3=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.project=n,s.count=0,s.thisArg=i||s,s}return e.prototype._next=function(r){var n;try{n=this.project.call(this.thisArg,r,this.count++)}catch(i){this.destination.error(i);return}this.destination.next(n)},e}(V);function Vp(t,e,r){if(e)if(Ye(e))r=e;else return function(){for(var n=[],i=0;i0?this._next(r.shift()):this.active===0&&this.hasCompleted&&this.destination.complete()},e}(Se),X3=Er;function ku(t){return t===void 0&&(t=Number.POSITIVE_INFINITY),Er(tr,t)}function Jp(){return ku(1)}function ti(){for(var t=[],e=0;e1?i.next(Array.prototype.slice.call(arguments)):i.next(o)}Zp(t,e,s,i,r)})}function Zp(t,e,r,n,i){var s;if(n4(t)){var o=t;t.addEventListener(e,r,i),s=function(){return o.removeEventListener(e,r,i)}}else if(r4(t)){var a=t;t.on(e,r),s=function(){return a.off(e,r)}}else if(t4(t)){var c=t;t.addListener(e,r),s=function(){return c.removeListener(e,r)}}else if(t&&t.length)for(var u=0,l=t.length;u=0}function a4(t,e){return t===void 0&&(t=0),e===void 0&&(e=ze),(!pn(t)||t<0)&&(t=0),(!e||typeof e.schedule!="function")&&(e=ze),new ee(function(r){return r.add(e.schedule(c4,t,{subscriber:r,counter:0,period:t})),r})}function c4(t){var e=t.subscriber,r=t.counter,n=t.period;e.next(r),this.schedule({subscriber:e,counter:r+1,period:n},n)}function Kp(){for(var t=[],e=0;e1&&typeof t[t.length-1]=="number"&&(r=t.pop())):typeof i=="number"&&(r=t.pop()),n===null&&t.length===1&&t[0]instanceof ee?t[0]:ku(r)(xi(t,n))}var Xp=new ee(Ct);function u4(){return Xp}function Mc(){for(var t=[],e=0;e=e){n.complete();break}if(n.next(s++),n.closed)break}while(!0)})}function v4(t){var e=t.start,r=t.index,n=t.count,i=t.subscriber;if(r>=n){i.complete();return}i.next(e),!i.closed&&(t.index=r+1,t.start=e+1,this.schedule(t))}function r0(t,e,r){t===void 0&&(t=0);var n=-1;return pn(e)?n=Number(e)<1&&1||Number(e):Ye(e)&&(r=e),Ye(r)||(r=ze),new ee(function(i){var s=pn(t)?t:+t-r.now();return r.schedule(m4,s,{index:0,period:n,subscriber:i})})}function m4(t){var e=t.index,r=t.period,n=t.subscriber;if(n.next(e),!n.closed){if(r===-1)return n.complete();t.index=e+1,this.schedule(t,r)}}function _4(t,e){return new ee(function(r){var n;try{n=t()}catch(a){r.error(a);return}var i;try{i=e(n)}catch(a){r.error(a);return}var s=i?Vt(i):hn,o=s.subscribe(r);return function(){o.unsubscribe(),n&&n.unsubscribe()}})}function n0(){for(var t=[],e=0;ethis.index},t.prototype.hasCompleted=function(){return this.array.length===this.index},t}(),C4=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.parent=n,s.observable=i,s.stillUnsubscribed=!0,s.buffer=[],s.isComplete=!1,s}return e.prototype[rr]=function(){return this},e.prototype.next=function(){var r=this.buffer;return r.length===0&&this.isComplete?{value:null,done:!0}:{value:r.shift(),done:!1}},e.prototype.hasValue=function(){return this.buffer.length>0},e.prototype.hasCompleted=function(){return this.buffer.length===0&&this.isComplete},e.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},e.prototype.notifyNext=function(r){this.buffer.push(r),this.parent.checkIterators()},e.prototype.subscribe=function(){return Ee(this.observable,new we(this))},e}(Se);const x4=Object.freeze(Object.defineProperty({__proto__:null,ArgumentOutOfRangeError:dn,AsyncSubject:Mn,BehaviorSubject:Np,ConnectableObservable:Op,EMPTY:hn,EmptyError:Ii,GroupedObservable:xc,NEVER:Xp,Notification:Bt,get NotificationKind(){return Rc},ObjectUnsubscribedError:Zt,Observable:ee,ReplaySubject:Au,Scheduler:Ic,Subject:Ne,Subscriber:V,Subscription:_e,TimeoutError:Hp,UnsubscriptionError:Jn,VirtualAction:Wp,VirtualTimeScheduler:A3,animationFrame:R3,animationFrameScheduler:Fp,asap:Zi,asapScheduler:jp,async:ze,asyncScheduler:Bp,bindCallback:Vp,bindNodeCallback:Up,combineLatest:U3,concat:ti,config:rt,defer:Tu,empty:An,forkJoin:e4,from:Vt,fromEvent:Qp,fromEventPattern:Yp,generate:i4,identity:tr,iif:o4,interval:a4,isObservable:M3,merge:Kp,never:u4,noop:Ct,observable:Rn,of:Gs,onErrorResumeNext:Mc,pairs:l4,partition:p4,pipe:Cc,queue:Pp,queueScheduler:Lp,race:t0,range:y4,scheduled:Gp,throwError:Ru,timer:r0,using:_4,zip:n0},Symbol.toStringTag,{value:"Module"})),Js=xr(x4);var Qs={};function s0(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e=r.__.length&&r.__.push({__V:Yi}),r.__[t]}function a0(t){return bn=1,c0(l0,t)}function c0(t,e,r){var n=Lr(Ht++,2);if(n.t=t,!n.__c&&(n.__=[r?r(e):l0(void 0,e),function(a){var c=n.__N?n.__N[0]:n.__[0],u=n.t(c,a);c!==u&&(n.__N=[u,n.__[1]],n.__c.setState({}))}],n.__c=pe,!pe.u)){var i=function(a,c,u){if(!n.__c.__H)return!0;var l=n.__c.__H.__.filter(function(h){return h.__c});if(l.every(function(h){return!h.__N}))return!s||s.call(this,a,c,u);var f=!1;return l.forEach(function(h){if(h.__N){var p=h.__[0];h.__=h.__N,h.__N=void 0,p!==h.__[0]&&(f=!0)}}),!(!f&&n.__c.props===a)&&(!s||s.call(this,a,c,u))};pe.u=!0;var s=pe.shouldComponentUpdate,o=pe.componentWillUpdate;pe.componentWillUpdate=function(a,c,u){if(this.__e){var l=s;s=void 0,i(a,c,u),s=l}o&&o.call(this,a,c,u)},pe.shouldComponentUpdate=i}return n.__N||n.__}function R4(t,e){var r=Lr(Ht++,3);!G.__s&&Nu(r.__H,e)&&(r.__=t,r.i=e,pe.__H.__h.push(r))}function u0(t,e){var r=Lr(Ht++,4);!G.__s&&Nu(r.__H,e)&&(r.__=t,r.i=e,pe.__h.push(r))}function A4(t){return bn=5,Ou(function(){return{current:t}},[])}function M4(t,e,r){bn=6,u0(function(){return typeof t=="function"?(t(e()),function(){return t(null)}):t?(t.current=e(),function(){return t.current=null}):void 0},r==null?r:r.concat(t))}function Ou(t,e){var r=Lr(Ht++,7);return Nu(r.__H,e)?(r.__V=t(),r.i=e,r.__h=t,r.__V):r.__}function k4(t,e){return bn=8,Ou(function(){return t},e)}function T4(t){var e=pe.context[t.__c],r=Lr(Ht++,9);return r.c=t,e?(r.__==null&&(r.__=!0,e.sub(pe)),e.props.value):t.__}function O4(t,e){G.useDebugValue&&G.useDebugValue(e?e(t):t)}function N4(t){var e=Lr(Ht++,10),r=a0();return e.__=t,pe.componentDidCatch||(pe.componentDidCatch=function(n,i){e.__&&e.__(n,i),r[1](n)}),[r[0],function(){r[1](void 0)}]}function L4(){var t=Lr(Ht++,11);if(!t.__){for(var e=pe.__v;e!==null&&!e.__m&&e.__!==null;)e=e.__;var r=e.__m||(e.__m=[0,0]);t.__="P"+r[0]+"-"+r[1]++}return t.__}function P4(){for(var t;t=o0.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Ki),t.__H.__h.forEach(kc),t.__H.__h=[]}catch(e){t.__H.__h=[],G.__e(e,t.__v)}}G.__b=function(t){pe=null,rh&&rh(t)},G.__r=function(t){nh&&nh(t),Ht=0;var e=(pe=t.__c).__H;e&&(Qa===pe?(e.__h=[],pe.__h=[],e.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=Yi,r.__N=r.i=void 0})):(e.__h.forEach(Ki),e.__h.forEach(kc),e.__h=[],Ht=0)),Qa=pe},G.diffed=function(t){ih&&ih(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(o0.push(e)!==1&&th===G.requestAnimationFrame||((th=G.requestAnimationFrame)||$4)(P4)),e.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==Yi&&(r.__=r.__V),r.i=void 0,r.__V=Yi})),Qa=pe=null},G.__c=function(t,e){e.some(function(r){try{r.__h.forEach(Ki),r.__h=r.__h.filter(function(n){return!n.__||kc(n)})}catch(n){e.some(function(i){i.__h&&(i.__h=[])}),e=[],G.__e(n,r.__v)}}),sh&&sh(t,e)},G.unmount=function(t){oh&&oh(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Ki(n)}catch(i){e=i}}),r.__H=void 0,e&&G.__e(e,r.__v))};var ah=typeof requestAnimationFrame=="function";function $4(t){var e,r=function(){clearTimeout(n),ah&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,100);ah&&(e=requestAnimationFrame(r))}function Ki(t){var e=pe,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),pe=e}function kc(t){var e=pe;t.__c=t.__(),pe=e}function Nu(t,e){return!t||t.length!==e.length||e.some(function(r,n){return r!==t[n]})}function l0(t,e){return typeof e=="function"?e(t):e}const D4=Object.freeze(Object.defineProperty({__proto__:null,useCallback:k4,useContext:T4,useDebugValue:O4,useEffect:R4,useErrorBoundary:N4,useId:L4,useImperativeHandle:M4,useLayoutEffect:u0,useMemo:Ou,useReducer:c0,useRef:A4,useState:a0},Symbol.toStringTag,{value:"Module"})),Ri=xr(D4);var Mt={},Ys={};Object.defineProperty(Ys,"__esModule",{value:!0});Ys.CloseIcon=void 0;const ch=Ke;function j4(t){return(0,ch.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),(0,ch.h)("path",{d:"M13.7677 13L12.3535 14.4142L18.3535 20.4142L12.3535 26.4142L13.7677 27.8284L19.7677 21.8284L25.7677 27.8284L27.1819 26.4142L21.1819 20.4142L27.1819 14.4142L25.7677 13L19.7677 19L13.7677 13Z"}))}Ys.CloseIcon=j4;var Lu={};Object.defineProperty(Lu,"__esModule",{value:!0});Lu.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMTQuMDM3IDE4LjkyNmMtMi43NSAwLTQuOTA3LTIuMjA1LTQuOTA3LTQuOTI2IDAtMi43MiAyLjIzLTQuOTI2IDQuOTA3LTQuOTI2YTQuODY2IDQuODY2IDAgMCAxIDQuODMzIDQuMTE4aDQuOTgyYy0uNDQ2LTUuMDczLTQuNjg0LTkuMDQ0LTkuODE1LTkuMDQ0QzguNjEgNC4xNDggNC4xNDkgOC41NiA0LjE0OSAxNHM0LjM4NyA5Ljg1MiA5Ljg5IDkuODUyYzUuMjA0IDAgOS4zNjgtMy45NyA5LjgxNC05LjA0M0gxOC44N2E0Ljg2NiA0Ljg2NiAwIDAgMS00LjgzMyA0LjExN1oiIGZpbGw9IiNmZmYiLz48L3N2Zz4=";var Pu={};Object.defineProperty(Pu,"__esModule",{value:!0});Pu.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMjMuODUyIDE0QTkuODM0IDkuODM0IDAgMCAxIDE0IDIzLjg1MiA5LjgzNCA5LjgzNCAwIDAgMSA0LjE0OCAxNCA5LjgzNCA5LjgzNCAwIDAgMSAxNCA0LjE0OCA5LjgzNCA5LjgzNCAwIDAgMSAyMy44NTIgMTRaIiBmaWxsPSIjZmZmIi8+PHBhdGggZD0iTTExLjE4NSAxMi41MDRjMC0uNDU2IDAtLjcxLjA5OC0uODYyLjA5OC0uMTUyLjE5Ni0uMzA0LjM0My0uMzU1LjE5Ni0uMTAyLjM5Mi0uMTAyLjg4MS0uMTAyaDIuOTg2Yy40OSAwIC42ODYgMCAuODgyLjEwMi4xNDYuMTAxLjI5My4yMDMuMzQyLjM1NS4wOTguMjAzLjA5OC40MDYuMDk4Ljg2MnYyLjk5MmMwIC40NTcgMCAuNzEtLjA5OC44NjMtLjA5OC4xNTItLjE5NS4zMDQtLjM0Mi4zNTUtLjE5Ni4xMDEtLjM5Mi4xMDEtLjg4Mi4xMDFoLTIuOTg2Yy0uNDkgMC0uNjg1IDAtLjg4LS4xMDEtLjE0OC0uMTAyLS4yOTUtLjIwMy0uMzQ0LS4zNTUtLjA5OC0uMjAzLS4wOTgtLjQwNi0uMDk4LS44NjN2LTIuOTkyWiIgZmlsbD0iIzAwNTJGRiIvPjwvc3ZnPg==";var Ks={};Object.defineProperty(Ks,"__esModule",{value:!0});Ks.QRCodeIcon=void 0;const wt=Ke;function B4(t){return(0,wt.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},t),(0,wt.h)("path",{d:"M8.2271 1.77124L7.0271 1.77124V2.97124H8.2271V1.77124Z"}),(0,wt.h)("path",{d:"M5.44922 0.199219L5.44922 4.54922L9.79922 4.54922V0.199219L5.44922 0.199219ZM8.89922 3.64922L6.34922 3.64922L6.34922 1.09922L8.89922 1.09922V3.64922Z"}),(0,wt.h)("path",{d:"M2.97124 1.77124L1.77124 1.77124L1.77124 2.97124H2.97124V1.77124Z"}),(0,wt.h)("path",{d:"M0.199219 4.54922L4.54922 4.54922L4.54922 0.199219L0.199219 0.199219L0.199219 4.54922ZM1.09922 1.09922L3.64922 1.09922L3.64922 3.64922L1.09922 3.64922L1.09922 1.09922Z"}),(0,wt.h)("path",{d:"M2.97124 7.0271H1.77124L1.77124 8.2271H2.97124V7.0271Z"}),(0,wt.h)("path",{d:"M0.199219 9.79922H4.54922L4.54922 5.44922L0.199219 5.44922L0.199219 9.79922ZM1.09922 6.34922L3.64922 6.34922L3.64922 8.89922H1.09922L1.09922 6.34922Z"}),(0,wt.h)("path",{d:"M8.89922 7.39912H7.99922V5.40112H5.44922L5.44922 9.79912H6.34922L6.34922 6.30112H7.09922V8.29912H9.79922V5.40112H8.89922V7.39912Z"}),(0,wt.h)("path",{d:"M7.99912 8.89917H7.09912V9.79917H7.99912V8.89917Z"}),(0,wt.h)("path",{d:"M9.79917 8.89917H8.89917V9.79917H9.79917V8.89917Z"}))}Ks.QRCodeIcon=B4;var $u={};Object.defineProperty($u,"__esModule",{value:!0});const F4=` - - - - - -`;$u.default=F4;var Du={};Object.defineProperty(Du,"__esModule",{value:!0});Du.default=` - - - - - - -`;var Xs={};Object.defineProperty(Xs,"__esModule",{value:!0});Xs.StatusDotIcon=void 0;const uh=Ke;function W4(t){return(0,uh.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},t),(0,uh.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.29995 4.99995C2.29995 5.57985 1.82985 6.04995 1.24995 6.04995C0.670052 6.04995 0.199951 5.57985 0.199951 4.99995C0.199951 4.42005 0.670052 3.94995 1.24995 3.94995C1.82985 3.94995 2.29995 4.42005 2.29995 4.99995ZM4.99995 6.04995C5.57985 6.04995 6.04995 5.57985 6.04995 4.99995C6.04995 4.42005 5.57985 3.94995 4.99995 3.94995C4.42005 3.94995 3.94995 4.42005 3.94995 4.99995C3.94995 5.57985 4.42005 6.04995 4.99995 6.04995ZM8.74995 6.04995C9.32985 6.04995 9.79995 5.57985 9.79995 4.99995C9.79995 4.42005 9.32985 3.94995 8.74995 3.94995C8.17005 3.94995 7.69995 4.42005 7.69995 4.99995C7.69995 5.57985 8.17005 6.04995 8.74995 6.04995Z"}))}Xs.StatusDotIcon=W4;var eo={};function f0(t){this.mode=Qe.MODE_8BIT_BYTE,this.data=t,this.parsedData=[];for(var e=0,r=this.data.length;e65536?(n[0]=240|(i&1835008)>>>18,n[1]=128|(i&258048)>>>12,n[2]=128|(i&4032)>>>6,n[3]=128|i&63):i>2048?(n[0]=224|(i&61440)>>>12,n[1]=128|(i&4032)>>>6,n[2]=128|i&63):i>128?(n[0]=192|(i&1984)>>>6,n[1]=128|i&63):n[0]=i,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}f0.prototype={getLength:function(t){return this.parsedData.length},write:function(t){for(var e=0,r=this.parsedData.length;e=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=kt.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(t,e){for(var r=-1;r<=7;r++)if(!(t+r<=-1||this.moduleCount<=t+r))for(var n=-1;n<=7;n++)e+n<=-1||this.moduleCount<=e+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[t+r][e+n]=!0:this.modules[t+r][e+n]=!1)},getBestMaskPattern:function(){for(var t=0,e=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=ve.getLostPoint(this);(r==0||t>n)&&(t=n,e=r)}return e},createMovieClip:function(t,e,r){var n=t.createEmptyMovieClip(e,r),i=1;this.make();for(var s=0;s>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!t&&(e>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(t,e){for(var r=this.errorCorrectLevel<<3|e,n=ve.getBCHTypeInfo(r),i=0;i<15;i++){var s=!t&&(n>>i&1)==1;i<6?this.modules[i][8]=s:i<8?this.modules[i+1][8]=s:this.modules[this.moduleCount-15+i][8]=s}for(var i=0;i<15;i++){var s=!t&&(n>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=s:i<9?this.modules[8][15-i-1+1]=s:this.modules[8][15-i-1]=s}this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var r=-1,n=this.moduleCount-1,i=7,s=0,o=this.moduleCount-1;o>0;o-=2)for(o==6&&o--;;){for(var a=0;a<2;a++)if(this.modules[n][o-a]==null){var c=!1;s>>i&1)==1);var u=ve.getMask(e,n,o-a);u&&(c=!c),this.modules[n][o-a]=c,i--,i==-1&&(s++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};kt.PAD0=236;kt.PAD1=17;kt.createData=function(t,e,r){for(var n=It.getRSBlocks(t,e),i=new h0,s=0;sa*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+a*8+")");for(i.getLengthInBits()+4<=a*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=a*8||(i.put(kt.PAD0,8),i.getLengthInBits()>=a*8));)i.put(kt.PAD1,8);return kt.createBytes(i,n)};kt.createBytes=function(t,e){for(var r=0,n=0,i=0,s=new Array(e.length),o=new Array(e.length),a=0;a=0?p.get(v):0}}for(var E=0,l=0;l=0;)e^=ve.G15<=0;)e^=ve.G18<>>=1;return e},getPatternPosition:function(t){return ve.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,r){switch(t){case zt.PATTERN000:return(e+r)%2==0;case zt.PATTERN001:return e%2==0;case zt.PATTERN010:return r%3==0;case zt.PATTERN011:return(e+r)%3==0;case zt.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2==0;case zt.PATTERN101:return e*r%2+e*r%3==0;case zt.PATTERN110:return(e*r%2+e*r%3)%2==0;case zt.PATTERN111:return(e*r%3+(e+r)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new en([1],0),r=0;r5&&(r+=3+s-5)}for(var n=0;n=256;)t-=255;return Oe.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var Pe=0;Pe<8;Pe++)Oe.EXP_TABLE[Pe]=1<>>7-t%8&1)==1},put:function(t,e){for(var r=0;r>>e-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var Za=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function d0(t){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof t=="string"&&(t={content:t}),t)for(var e in t)this.options[e]=t[e];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function r(c){switch(c){case"L":return Kt.L;case"M":return Kt.M;case"Q":return Kt.Q;case"H":return Kt.H;default:throw new Error("Unknwon error correction level: "+c)}}function n(c,u){for(var l=i(c),f=1,h=0,p=0,v=Za.length;p<=v;p++){var E=Za[p];if(!E)throw new Error("Content too long: expected "+h+" but got "+l);switch(u){case"L":h=E[0];break;case"M":h=E[1];break;case"Q":h=E[2];break;case"H":h=E[3];break;default:throw new Error("Unknwon error correction level: "+u)}if(l<=h)break;f++}if(f>Za.length)throw new Error("Content too long");return f}function i(c){var u=encodeURI(c).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return u.length+(u.length!=c?3:0)}var s=this.options.content,o=n(s,this.options.ecl),a=r(this.options.ecl);this.qrcode=new kt(o,a),this.qrcode.addData(s),this.qrcode.make()}d0.prototype.svg=function(t){var e=this.options||{},r=this.qrcode.modules;typeof t>"u"&&(t={container:e.container||"svg"});for(var n=typeof e.pretty<"u"?!!e.pretty:!0,i=n?" ":"",s=n?`\r -`:"",o=e.width,a=e.height,c=r.length,u=o/(c+2*e.padding),l=a/(c+2*e.padding),f=typeof e.join<"u"?!!e.join:!1,h=typeof e.swap<"u"?!!e.swap:!1,p=typeof e.xmlDeclaration<"u"?!!e.xmlDeclaration:!0,v=typeof e.predefined<"u"?!!e.predefined:!1,E=v?i+''+s:"",_=i+''+s,d="",y="",m=0;m'+s:d+=i+''+s}}f&&(d=i+'');let ce="";if(this.options.image!==void 0&&this.options.image.svg){const R=o*this.options.image.width/100,M=a*this.options.image.height/100,N=o/2-R/2,L=a/2-M/2;ce+=``,ce+=this.options.image.svg+s,ce+=""}var Z="";switch(t.container){case"svg":p&&(Z+=''+s),Z+=''+s,Z+=E+_+d,Z+=ce,Z+="";break;case"svg-viewbox":p&&(Z+=''+s),Z+=''+s,Z+=E+_+d,Z+=ce,Z+="";break;case"g":Z+=''+s,Z+=E+_+d,Z+=ce,Z+="";break;default:Z+=(E+_+d+ce).replace(/^\s+/,"");break}return Z};var H4=d0,V4=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(eo,"__esModule",{value:!0});eo.QRCode=void 0;const U4=Ke,lh=Ri,z4=V4(H4),q4=t=>{const[e,r]=(0,lh.useState)("");return(0,lh.useEffect)(()=>{var n,i;const s=new z4.default({content:t.content,background:t.bgColor||"#ffffff",color:t.fgColor||"#000000",container:"svg",ecl:"M",width:(n=t.width)!==null&&n!==void 0?n:256,height:(i=t.height)!==null&&i!==void 0?i:256,padding:0,image:t.image}),o=Buffer.from(s.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${o}`)}),e?(0,U4.h)("img",{src:e,alt:"QR Code"}):null};eo.QRCode=q4;var to={},ju={};Object.defineProperty(ju,"__esModule",{value:!0});ju.default=".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}";var G4=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(to,"__esModule",{value:!0});to.Spinner=void 0;const Vi=Ke,J4=G4(ju),Q4=t=>{var e;const r=(e=t.size)!==null&&e!==void 0?e:64,n=t.color||"#000";return(0,Vi.h)("div",{class:"-cbwsdk-spinner"},(0,Vi.h)("style",null,J4.default),(0,Vi.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,Vi.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};to.Spinner=Q4;var Bu={};Object.defineProperty(Bu,"__esModule",{value:!0});Bu.default=".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-item.light.selected{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark.selected{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item.selected{border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}";var kn=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Mt,"__esModule",{value:!0});Mt.CoinbaseAppSteps=Mt.CoinbaseWalletSteps=Mt.ConnectItem=Mt.ConnectContent=void 0;const it=kn(Zs),q=Ke,fh=Ri,Z4=W,Y4=mn,K4=Ys,X4=kn(Lu),e5=kn(Pu),p0=Ks,t5=kn($u),r5=kn(Du),n5=Xs,i5=eo,s5=to,o5=kn(Bu),hh={"coinbase-wallet-app":{title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",icon:e5.default,steps:g0},"coinbase-app":{title:"Coinbase app",description:"Connect with your Coinbase account",icon:X4.default,steps:y0}},a5=t=>{switch(t){case"coinbase-app":return t5.default;case"coinbase-wallet-app":default:return r5.default}},Tc=t=>t==="light"?"#FFFFFF":"#0A0B0D";function c5(t){const{theme:e}=t,[r,n]=(0,fh.useState)("coinbase-wallet-app"),i=(0,fh.useCallback)(u=>{n(u)},[]),s=(0,Z4.createQrUrl)(t.sessionId,t.sessionSecret,t.linkAPIUrl,t.isParentConnection,t.version,t.chainId),o=hh[r];if(!r)return null;const a=o.steps,c=r==="coinbase-app";return(0,q.h)("div",{"data-testid":"connect-content",class:(0,it.default)("-cbwsdk-connect-content",e)},(0,q.h)("style",null,o5.default),(0,q.h)("div",{class:"-cbwsdk-connect-content-header"},(0,q.h)("h2",{class:(0,it.default)("-cbwsdk-connect-content-heading",e)},"Scan to connect with one of our mobile apps"),t.onCancel&&(0,q.h)("button",{type:"button",class:"-cbwsdk-cancel-button",onClick:t.onCancel},(0,q.h)(K4.CloseIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,q.h)("div",{class:"-cbwsdk-connect-content-layout"},(0,q.h)("div",{class:"-cbwsdk-connect-content-column-left"},(0,q.h)("div",null,Object.entries(hh).map(([u,l])=>(0,q.h)(b0,{key:u,title:l.title,description:l.description,icon:l.icon,selected:r===u,onClick:()=>i(u),theme:e}))),c&&(0,q.h)("div",{class:(0,it.default)("-cbwsdk-connect-content-update-app",e)},"Don’t see a ",(0,q.h)("strong",null,"Scan")," option? Update your Coinbase app to the latest version and try again.")),(0,q.h)("div",{class:"-cbwsdk-connect-content-column-right"},(0,q.h)("div",{class:"-cbwsdk-connect-content-qr-wrapper"},(0,q.h)(i5.QRCode,{content:s,width:200,height:200,fgColor:"#000",bgColor:"transparent",image:{svg:a5(r),width:25,height:25}}),(0,q.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:Y4.LIB_VERSION}),(0,q.h)("input",{type:"hidden",value:s})),(0,q.h)(a,{theme:e}),!t.isConnected&&(0,q.h)("div",{"data-testid":"connecting-spinner",class:(0,it.default)("-cbwsdk-connect-content-qr-connecting",e)},(0,q.h)(s5.Spinner,{size:36,color:e==="dark"?"#FFF":"#000"}),(0,q.h)("p",null,"Connecting...")))))}Mt.ConnectContent=c5;function b0({title:t,description:e,icon:r,selected:n,theme:i,onClick:s}){return(0,q.h)("div",{onClick:s,class:(0,it.default)("-cbwsdk-connect-item",i,{selected:n})},(0,q.h)("div",null,(0,q.h)("img",{src:r,alt:t})),(0,q.h)("div",{class:"-cbwsdk-connect-item-copy-wrapper"},(0,q.h)("h3",{class:"-cbwsdk-connect-item-title"},t),(0,q.h)("p",{class:"-cbwsdk-connect-item-description"},e)))}Mt.ConnectItem=b0;function g0({theme:t}){return(0,q.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,q.h)("li",{class:(0,it.default)("-cbwsdk-wallet-steps-item",t)},(0,q.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,q.h)("li",{class:(0,it.default)("-cbwsdk-wallet-steps-item",t)},(0,q.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,q.h)("span",null,"Tap ",(0,q.h)("strong",null,"Scan")," "),(0,q.h)("span",{class:(0,it.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,q.h)(p0.QRCodeIcon,{fill:Tc(t)})))))}Mt.CoinbaseWalletSteps=g0;function y0({theme:t}){return(0,q.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,q.h)("li",{class:(0,it.default)("-cbwsdk-wallet-steps-item",t)},(0,q.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase app")),(0,q.h)("li",{class:(0,it.default)("-cbwsdk-wallet-steps-item",t)},(0,q.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,q.h)("span",null,"Tap ",(0,q.h)("strong",null,"More")),(0,q.h)("span",{class:(0,it.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,q.h)(n5.StatusDotIcon,{fill:Tc(t)})),(0,q.h)("span",{class:"-cbwsdk-wallet-steps-pad-left"},"then ",(0,q.h)("strong",null,"Scan")),(0,q.h)("span",{class:(0,it.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,q.h)(p0.QRCodeIcon,{fill:Tc(t)})))))}Mt.CoinbaseAppSteps=y0;var ro={},no={};Object.defineProperty(no,"__esModule",{value:!0});no.ArrowLeftIcon=void 0;const dh=Ke;function u5(t){return(0,dh.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},t),(0,dh.h)("path",{d:"M8.60675 0.155884L7.37816 1.28209L12.7723 7.16662H0V8.83328H12.6548L6.82149 14.6666L8 15.8451L15.8201 8.02501L8.60675 0.155884Z"}))}no.ArrowLeftIcon=u5;var io={};Object.defineProperty(io,"__esModule",{value:!0});io.LaptopIcon=void 0;const Ya=Ke;function l5(t){return(0,Ya.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,Ya.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,Ya.h)("path",{d:"M13.4001 10.2002H0.600098C0.600098 11.0838 1.31644 11.8002 2.2001 11.8002H11.8001C12.6838 11.8002 13.4001 11.0838 13.4001 10.2002Z"}))}io.LaptopIcon=l5;var so={};Object.defineProperty(so,"__esModule",{value:!0});so.SafeIcon=void 0;const ph=Ke;function f5(t){return(0,ph.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,ph.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.600098 0.600098V11.8001H13.4001V0.600098H0.600098ZM7.0001 9.2001C5.3441 9.2001 4.0001 7.8561 4.0001 6.2001C4.0001 4.5441 5.3441 3.2001 7.0001 3.2001C8.6561 3.2001 10.0001 4.5441 10.0001 6.2001C10.0001 7.8561 8.6561 9.2001 7.0001 9.2001ZM0.600098 12.6001H3.8001V13.4001H0.600098V12.6001ZM10.2001 12.6001H13.4001V13.4001H10.2001V12.6001ZM8.8001 6.2001C8.8001 7.19421 7.99421 8.0001 7.0001 8.0001C6.00598 8.0001 5.2001 7.19421 5.2001 6.2001C5.2001 5.20598 6.00598 4.4001 7.0001 4.4001C7.99421 4.4001 8.8001 5.20598 8.8001 6.2001Z"}))}so.SafeIcon=f5;var Fu={};Object.defineProperty(Fu,"__esModule",{value:!0});Fu.default=".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}";var v0=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ro,"__esModule",{value:!0});ro.TryExtensionContent=void 0;const ar=v0(Zs),xe=Ke,Ka=Ri,h5=no,d5=io,p5=so,b5=v0(Fu);function g5({theme:t}){const[e,r]=(0,Ka.useState)(!1),n=(0,Ka.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,Ka.useCallback)(()=>{e?window.location.reload():(n(),r(!0))},[n,e]);return(0,xe.h)("div",{class:(0,ar.default)("-cbwsdk-try-extension",t)},(0,xe.h)("style",null,b5.default),(0,xe.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,xe.h)("h3",{class:(0,ar.default)("-cbwsdk-try-extension-heading",t)},"Or try the Coinbase Wallet browser extension"),(0,xe.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,xe.h)("button",{class:(0,ar.default)("-cbwsdk-try-extension-cta",t),onClick:i},e?"Refresh":"Install"),(0,xe.h)("div",null,!e&&(0,xe.h)(h5.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:t==="light"?"#0052FF":"#588AF5"})))),(0,xe.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,xe.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,xe.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,xe.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,xe.h)("span",{class:(0,ar.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,xe.h)(d5.LaptopIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,xe.h)("div",{class:(0,ar.default)("-cbwsdk-try-extension-list-item-copy",t)},"Connect with dapps with just one click on your desktop browser")),(0,xe.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,xe.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,xe.h)("span",{class:(0,ar.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,xe.h)(p5.SafeIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,xe.h)("div",{class:(0,ar.default)("-cbwsdk-try-extension-list-item-copy",t)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}ro.TryExtensionContent=g5;var Wu={};Object.defineProperty(Wu,"__esModule",{value:!0});Wu.default=".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}";var m0=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Qs,"__esModule",{value:!0});Qs.ConnectDialog=void 0;const Xa=m0(Zs),cr=Ke,ec=Ri,y5=Mt,v5=ro,m5=m0(Wu),_5=t=>{const{isOpen:e,darkMode:r}=t,[n,i]=(0,ec.useState)(!e),[s,o]=(0,ec.useState)(!e);(0,ec.useEffect)(()=>{const c=[window.setTimeout(()=>{o(!e)},10)];return e?i(!1):c.push(window.setTimeout(()=>{i(!0)},360)),()=>{c.forEach(window.clearTimeout)}},[t.isOpen]);const a=r?"dark":"light";return(0,cr.h)("div",{class:(0,Xa.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,cr.h)("style",null,m5.default),(0,cr.h)("div",{class:(0,Xa.default)("-cbwsdk-connect-dialog-backdrop",a,s&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,cr.h)("div",{class:"-cbwsdk-connect-dialog"},(0,cr.h)("div",{class:(0,Xa.default)("-cbwsdk-connect-dialog-box",s&&"-cbwsdk-connect-dialog-box-hidden")},t.connectDisabled?null:(0,cr.h)(y5.ConnectContent,{theme:a,version:t.version,sessionId:t.sessionId,sessionSecret:t.sessionSecret,linkAPIUrl:t.linkAPIUrl,isConnected:t.isConnected,isParentConnection:t.isParentConnection,chainId:t.chainId,onCancel:t.onCancel}),(0,cr.h)(v5.TryExtensionContent,{theme:a}))))};Qs.ConnectDialog=_5;Object.defineProperty(zs,"__esModule",{value:!0});zs.LinkFlow=void 0;const tc=Ke,bh=Js,w5=Qs;class S5{constructor(e){this.extensionUI$=new bh.BehaviorSubject({}),this.subscriptions=new bh.Subscription,this.isConnected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=e.darkMode,this.version=e.version,this.sessionId=e.sessionId,this.sessionSecret=e.sessionSecret,this.linkAPIUrl=e.linkAPIUrl,this.isParentConnection=e.isParentConnection,this.connected$=e.connected$,this.chainId$=e.chainId$}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",e.appendChild(this.root),this.render(),this.subscriptions.add(this.connected$.subscribe(r=>{this.isConnected!==r&&(this.isConnected=r,this.render())})),this.subscriptions.add(this.chainId$.subscribe(r=>{this.chainId!==r&&(this.chainId=r,this.render())}))}detach(){var e;this.root&&(this.subscriptions.unsubscribe(),(0,tc.render)(null,this.root),(e=this.root.parentElement)===null||e===void 0||e.removeChild(this.root))}setConnectDisabled(e){this.connectDisabled=e}open(e){this.isOpen=!0,this.onCancel=e.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){if(!this.root)return;const e=this.extensionUI$.subscribe(()=>{this.root&&(0,tc.render)((0,tc.h)(w5.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.isConnected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)});this.subscriptions.add(e)}}zs.LinkFlow=S5;var _0={},Hu={};Object.defineProperty(Hu,"__esModule",{value:!0});Hu.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}";(function(t){var e=F&&F.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(t,"__esModule",{value:!0}),t.SnackbarInstance=t.SnackbarContainer=t.Snackbar=void 0;const r=e(Zs),n=Ke,i=Ri,s=e(Hu),o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";function a(f){switch(f){case"coinbase-app":return"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE0LjY3NCAxOC44NThjLTIuMDQ1IDAtMy42NDgtMS43MjItMy42NDgtMy44NDVzMS42NTktMy44NDUgMy42NDgtMy44NDVjMS44MjQgMCAzLjMxNyAxLjM3NyAzLjU5MyAzLjIxNGgzLjcwM2MtLjMzMS0zLjk2LTMuNDgyLTcuMDU5LTcuMjk2LTcuMDU5LTQuMDM0IDAtNy4zNSAzLjQ0My03LjM1IDcuNjkgMCA0LjI0NiAzLjI2IDcuNjkgNy4zNSA3LjY5IDMuODcgMCA2Ljk2NS0zLjEgNy4yOTYtNy4wNTloLTMuNzAzYy0uMjc2IDEuODM2LTEuNzY5IDMuMjE0LTMuNTkzIDMuMjE0WiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0wIDEwLjY3OGMwLTMuNzExIDAtNS41OTYuNzQyLTcuMDIzQTYuNTMyIDYuNTMyIDAgMCAxIDMuNjU1Ljc0MkM1LjA4MiAwIDYuOTY3IDAgMTAuNjc4IDBoNy45MzhjMy43MTEgMCA1LjU5NiAwIDcuMDIzLjc0MmE2LjUzMSA2LjUzMSAwIDAgMSAyLjkxMyAyLjkxM2MuNzQyIDEuNDI3Ljc0MiAzLjMxMi43NDIgNy4wMjN2Ny45MzhjMCAzLjcxMSAwIDUuNTk2LS43NDIgNy4wMjNhNi41MzEgNi41MzEgMCAwIDEtMi45MTMgMi45MTNjLTEuNDI3Ljc0Mi0zLjMxMi43NDItNy4wMjMuNzQyaC03LjkzOGMtMy43MTEgMC01LjU5NiAwLTcuMDIzLS43NDJhNi41MzEgNi41MzEgMCAwIDEtMi45MTMtMi45MTNDMCAyNC4yMTIgMCAyMi4zODQgMCAxOC42MTZ2LTcuOTM4WiIgZmlsbD0iIzAwNTJGRiIvPjxwYXRoIGQ9Ik0xNC42ODQgMTkuNzczYy0yLjcyNyAwLTQuODY0LTIuMjk1LTQuODY0LTUuMTI2IDAtMi44MzEgMi4yMS01LjEyNyA0Ljg2NC01LjEyNyAyLjQzMiAwIDQuNDIyIDEuODM3IDQuNzkgNC4yODVoNC45MzhjLS40NDItNS4yOC00LjY0My05LjQxMS05LjcyOC05LjQxMS01LjM4IDAtOS44MDIgNC41OS05LjgwMiAxMC4yNTMgMCA1LjY2MiA0LjM0OCAxMC4yNTMgOS44MDIgMTAuMjUzIDUuMTU5IDAgOS4yODYtNC4xMzIgOS43MjgtOS40MTFoLTQuOTM4Yy0uMzY4IDIuNDQ4LTIuMzU4IDQuMjg0LTQuNzkgNC4yODRaIiBmaWxsPSIjZmZmIi8+PC9zdmc+";case"coinbase-wallet-app":default:return"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+"}}class c{constructor(h){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=h.darkMode}attach(h){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",h.appendChild(this.root),this.render()}presentItem(h){const p=this.nextItemKey++;return this.items.set(p,h),this.render(),()=>{this.items.delete(p),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(t.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([h,p])=>(0,n.h)(t.SnackbarInstance,Object.assign({},p,{key:h}))))),this.root)}}t.Snackbar=c;const u=f=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,n.h)("style",null,s.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},f.children));t.SnackbarContainer=u;const l=({autoExpand:f,message:h,menuItems:p,appSrc:v})=>{const[E,_]=(0,i.useState)(!0),[d,y]=(0,i.useState)(f??!1);(0,i.useEffect)(()=>{const x=[window.setTimeout(()=>{_(!1)},1),window.setTimeout(()=>{y(!0)},1e4)];return()=>{x.forEach(window.clearTimeout)}});const m=()=>{y(!d)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",E&&"-cbwsdk-snackbar-instance-hidden",d&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:m},(0,n.h)("img",{src:a(v),class:"-cbwsdk-snackbar-instance-header-cblogo"}),(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},h),(0,n.h)("div",{class:"-gear-container"},!d&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:o,class:"-gear-icon",title:"Expand"}))),p&&p.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},p.map((x,C)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",x.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:x.onClick,key:C},(0,n.h)("svg",{width:x.svgWidth,height:x.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":x.defaultFillRule,"clip-rule":x.defaultClipRule,d:x.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",x.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},x.info)))))};t.SnackbarInstance=l})(_0);var oo={},Vu={};Object.defineProperty(Vu,"__esModule",{value:!0});Vu.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';var E5=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(oo,"__esModule",{value:!0});oo.injectCssReset=void 0;const C5=E5(Vu);function x5(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(C5.default)),document.documentElement.appendChild(t)}oo.injectCssReset=x5;Object.defineProperty(Us,"__esModule",{value:!0});Us.WalletSDKUI=void 0;const I5=zs,R5=_0,A5=oo;class M5{constructor(e){this.standalone=null,this.attached=!1,this.appSrc=null,this.snackbar=new R5.Snackbar({darkMode:e.darkMode}),this.linkFlow=new I5.LinkFlow({darkMode:e.darkMode,version:e.version,sessionId:e.session.id,sessionSecret:e.session.secret,linkAPIUrl:e.linkAPIUrl,connected$:e.connected$,chainId$:e.chainId$,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",e.appendChild(r),this.linkFlow.attach(r),this.snackbar.attach(r),this.attached=!0,(0,A5.injectCssReset)()}setConnectDisabled(e){this.linkFlow.setConnectDisabled(e)}addEthereumChain(e){}watchAsset(e){}switchEthereumChain(e){}requestEthereumAccounts(e){this.linkFlow.open({onCancel:e.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(e){}signEthereumTransaction(e){}submitEthereumTransaction(e){}ethereumAddressFromSignedMessage(e){}showConnecting(e){let r;return e.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",appSrc:this.appSrc,menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:r={message:"Confirm on phone",appSrc:this.appSrc,menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(r)}setAppSrc(e){this.appSrc=e}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(e){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(e){this.standalone=e}isStandalone(){var e;return(e=this.standalone)!==null&&e!==void 0?e:!1}}Us.WalletSDKUI=M5;var ao={},co={};Object.defineProperty(co,"__esModule",{value:!0});var Jr;(function(t){t.typeOfFunction="function",t.boolTrue=!0})(Jr||(Jr={}));function w0(t,e,r){if(!r||typeof r.value!==Jr.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+e+"> is not a method!");return{configurable:Jr.boolTrue,get:function(){var n=r.value.bind(this);return Object.defineProperty(this,e,{value:n,configurable:Jr.boolTrue,writable:Jr.boolTrue}),n}}}co.bind=w0;co.default=w0;function S0(t){return function(r){return r.lift(new k5(t))}}var k5=function(){function t(e){this.durationSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new T5(e,this.durationSelector))},t}(),T5=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.durationSelector=n,i.hasValue=!1,i}return e.prototype._next=function(r){if(this.value=r,this.hasValue=!0,!this.throttled){var n=void 0;try{var i=this.durationSelector;n=i(r)}catch(o){return this.destination.error(o)}var s=Ee(n,new we(this));!s||s.closed?this.clearThrottle():this.add(this.throttled=s)}},e.prototype.clearThrottle=function(){var r=this,n=r.value,i=r.hasValue,s=r.throttled;s&&(this.remove(s),this.throttled=void 0,s.unsubscribe()),i&&(this.value=void 0,this.hasValue=!1,this.destination.next(n))},e.prototype.notifyNext=function(){this.clearThrottle()},e.prototype.notifyComplete=function(){this.clearThrottle()},e}(Se);function O5(t,e){return e===void 0&&(e=ze),S0(function(){return r0(t,e)})}function N5(t){return function(r){return r.lift(new L5(t))}}var L5=function(){function t(e){this.closingNotifier=e}return t.prototype.call=function(e,r){return r.subscribe(new P5(e,this.closingNotifier))},t}(),P5=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.buffer=[],i.add(Ee(n,new we(i))),i}return e.prototype._next=function(r){this.buffer.push(r)},e.prototype.notifyNext=function(){var r=this.buffer;this.buffer=[],this.destination.next(r)},e}(Se);function $5(t,e){return e===void 0&&(e=null),function(n){return n.lift(new D5(t,e))}}var D5=function(){function t(e,r){this.bufferSize=e,this.startBufferEvery=r,!r||e===r?this.subscriberClass=j5:this.subscriberClass=B5}return t.prototype.call=function(e,r){return r.subscribe(new this.subscriberClass(e,this.bufferSize,this.startBufferEvery))},t}(),j5=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.bufferSize=n,i.buffer=[],i}return e.prototype._next=function(r){var n=this.buffer;n.push(r),n.length==this.bufferSize&&(this.destination.next(n),this.buffer=[])},e.prototype._complete=function(){var r=this.buffer;r.length>0&&this.destination.next(r),t.prototype._complete.call(this)},e}(V),B5=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.bufferSize=n,s.startBufferEvery=i,s.buffers=[],s.count=0,s}return e.prototype._next=function(r){var n=this,i=n.bufferSize,s=n.startBufferEvery,o=n.buffers,a=n.count;this.count++,a%s===0&&o.push([]);for(var c=o.length;c--;){var u=o[c];u.push(r),u.length===i&&(o.splice(c,1),this.destination.next(u))}},e.prototype._complete=function(){for(var r=this,n=r.buffers,i=r.destination;n.length>0;){var s=n.shift();s.length>0&&i.next(s)}t.prototype._complete.call(this)},e}(V);function F5(t){var e=arguments.length,r=ze;Ye(arguments[arguments.length-1])&&(r=arguments[arguments.length-1],e--);var n=null;e>=2&&(n=arguments[1]);var i=Number.POSITIVE_INFINITY;return e>=3&&(i=arguments[2]),function(o){return o.lift(new W5(t,n,i,r))}}var W5=function(){function t(e,r,n,i){this.bufferTimeSpan=e,this.bufferCreationInterval=r,this.maxBufferSize=n,this.scheduler=i}return t.prototype.call=function(e,r){return r.subscribe(new V5(e,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},t}(),H5=function(){function t(){this.buffer=[]}return t}(),V5=function(t){I(e,t);function e(r,n,i,s,o){var a=t.call(this,r)||this;a.bufferTimeSpan=n,a.bufferCreationInterval=i,a.maxBufferSize=s,a.scheduler=o,a.contexts=[];var c=a.openContext();if(a.timespanOnly=i==null||i<0,a.timespanOnly){var u={subscriber:a,context:c,bufferTimeSpan:n};a.add(c.closeAction=o.schedule(gh,n,u))}else{var l={subscriber:a,context:c},f={bufferTimeSpan:n,bufferCreationInterval:i,subscriber:a,scheduler:o};a.add(c.closeAction=o.schedule(E0,n,l)),a.add(o.schedule(U5,i,f))}return a}return e.prototype._next=function(r){for(var n=this.contexts,i=n.length,s,o=0;o0;){var s=n.shift();i.next(s.buffer)}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.contexts=null},e.prototype.onBufferFull=function(r){this.closeContext(r);var n=r.closeAction;if(n.unsubscribe(),this.remove(n),!this.closed&&this.timespanOnly){r=this.openContext();var i=this.bufferTimeSpan,s={subscriber:this,context:r,bufferTimeSpan:i};this.add(r.closeAction=this.scheduler.schedule(gh,i,s))}},e.prototype.openContext=function(){var r=new H5;return this.contexts.push(r),r},e.prototype.closeContext=function(r){this.destination.next(r.buffer);var n=this.contexts,i=n?n.indexOf(r):-1;i>=0&&n.splice(n.indexOf(r),1)},e}(V);function gh(t){var e=t.subscriber,r=t.context;r&&e.closeContext(r),e.closed||(t.context=e.openContext(),t.context.closeAction=this.schedule(t,t.bufferTimeSpan))}function U5(t){var e=t.bufferCreationInterval,r=t.bufferTimeSpan,n=t.subscriber,i=t.scheduler,s=n.openContext(),o=this;n.closed||(n.add(s.closeAction=i.schedule(E0,r,{subscriber:n,context:s})),o.schedule(t,e))}function E0(t){var e=t.subscriber,r=t.context;e.closeContext(r)}function z5(t,e){return function(n){return n.lift(new q5(t,e))}}var q5=function(){function t(e,r){this.openings=e,this.closingSelector=r}return t.prototype.call=function(e,r){return r.subscribe(new G5(e,this.openings,this.closingSelector))},t}(),G5=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.closingSelector=i,s.contexts=[],s.add(Wt(s,n)),s}return e.prototype._next=function(r){for(var n=this.contexts,i=n.length,s=0;s0;){var i=n.shift();i.subscription.unsubscribe(),i.buffer=null,i.subscription=null}this.contexts=null,t.prototype._error.call(this,r)},e.prototype._complete=function(){for(var r=this.contexts;r.length>0;){var n=r.shift();this.destination.next(n.buffer),n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,t.prototype._complete.call(this)},e.prototype.notifyNext=function(r,n){r?this.closeBuffer(r):this.openBuffer(n)},e.prototype.notifyComplete=function(r){this.closeBuffer(r.context)},e.prototype.openBuffer=function(r){try{var n=this.closingSelector,i=n.call(this,r);i&&this.trySubscribe(i)}catch(s){this._error(s)}},e.prototype.closeBuffer=function(r){var n=this.contexts;if(n&&r){var i=r.buffer,s=r.subscription;this.destination.next(i),n.splice(n.indexOf(r),1),this.remove(s),s.unsubscribe()}},e.prototype.trySubscribe=function(r){var n=this.contexts,i=[],s=new _e,o={buffer:i,subscription:s};n.push(o);var a=Wt(this,r,o);!a||a.closed?this.closeBuffer(o):(a.context=o,this.add(a),s.add(a))},e}(Nr);function J5(t){return function(e){return e.lift(new Q5(t))}}var Q5=function(){function t(e){this.closingSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new Z5(e,this.closingSelector))},t}(),Z5=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.closingSelector=n,i.subscribing=!1,i.openBuffer(),i}return e.prototype._next=function(r){this.buffer.push(r)},e.prototype._complete=function(){var r=this.buffer;r&&this.destination.next(r),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.buffer=void 0,this.subscribing=!1},e.prototype.notifyNext=function(){this.openBuffer()},e.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},e.prototype.openBuffer=function(){var r=this.closingSubscription;r&&(this.remove(r),r.unsubscribe());var n=this.buffer;this.buffer&&this.destination.next(n),this.buffer=[];var i;try{var s=this.closingSelector;i=s()}catch(o){return this.error(o)}r=new _e,this.closingSubscription=r,this.add(r),this.subscribing=!0,r.add(Ee(i,new we(this))),this.subscribing=!1},e}(Se);function Y5(t){return function(r){var n=new K5(t),i=r.lift(n);return n.caught=i}}var K5=function(){function t(e){this.selector=e}return t.prototype.call=function(e,r){return r.subscribe(new X5(e,this.selector,this.caught))},t}(),X5=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.selector=n,s.caught=i,s}return e.prototype.error=function(r){if(!this.isStopped){var n=void 0;try{n=this.selector(r,this.caught)}catch(o){t.prototype.error.call(this,o);return}this._unsubscribeAndRecycle();var i=new we(this);this.add(i);var s=Ee(n,i);s!==i&&this.add(s)}},e}(Se);function eC(t){return function(e){return e.lift(new Mu(t))}}function tC(){for(var t=[],e=0;e0&&i[0].time-s.now()<=0;)i.shift().notification.observe(o);if(i.length>0){var a=Math.max(0,i[0].time-s.now());this.schedule(r,a)}else this.unsubscribe(),n.active=!1},e.prototype._schedule=function(r){this.active=!0;var n=this.destination;n.add(r.schedule(e.dispatch,this.delay,{source:this,destination:this.destination,scheduler:r}))},e.prototype.scheduleNotification=function(r){if(this.errored!==!0){var n=this.scheduler,i=new mC(n.now()+this.delay,r);this.queue.push(i),this.active===!1&&this._schedule(n)}},e.prototype._next=function(r){this.scheduleNotification(Bt.createNext(r))},e.prototype._error=function(r){this.errored=!0,this.queue=[],this.destination.error(r),this.unsubscribe()},e.prototype._complete=function(){this.scheduleNotification(Bt.createComplete()),this.unsubscribe()},e}(V),mC=function(){function t(e,r){this.time=e,this.notification=r}return t}();function _C(t,e){return e?function(r){return new SC(r,e).lift(new yh(t))}:function(r){return r.lift(new yh(t))}}var yh=function(){function t(e){this.delayDurationSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new wC(e,this.delayDurationSelector))},t}(),wC=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.delayDurationSelector=n,i.completed=!1,i.delayNotifierSubscriptions=[],i.index=0,i}return e.prototype.notifyNext=function(r,n,i,s,o){this.destination.next(r),this.removeSubscription(o),this.tryComplete()},e.prototype.notifyError=function(r,n){this._error(r)},e.prototype.notifyComplete=function(r){var n=this.removeSubscription(r);n&&this.destination.next(n),this.tryComplete()},e.prototype._next=function(r){var n=this.index++;try{var i=this.delayDurationSelector(r,n);i&&this.tryDelay(i,r)}catch(s){this.destination.error(s)}},e.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},e.prototype.removeSubscription=function(r){r.unsubscribe();var n=this.delayNotifierSubscriptions.indexOf(r);return n!==-1&&this.delayNotifierSubscriptions.splice(n,1),r.outerValue},e.prototype.tryDelay=function(r,n){var i=Wt(this,r,n);if(i&&!i.closed){var s=this.destination;s.add(i),this.delayNotifierSubscriptions.push(i)}},e.prototype.tryComplete=function(){this.completed&&this.delayNotifierSubscriptions.length===0&&this.destination.complete()},e}(Nr),SC=function(t){I(e,t);function e(r,n){var i=t.call(this)||this;return i.source=r,i.subscriptionDelay=n,i}return e.prototype._subscribe=function(r){this.subscriptionDelay.subscribe(new EC(r,this.source))},e}(ee),EC=function(t){I(e,t);function e(r,n){var i=t.call(this)||this;return i.parent=r,i.source=n,i.sourceSubscribed=!1,i}return e.prototype._next=function(r){this.subscribeToSource()},e.prototype._error=function(r){this.unsubscribe(),this.parent.error(r)},e.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},e.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},e}(V);function CC(){return function(e){return e.lift(new xC)}}var xC=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new IC(e))},t}(),IC=function(t){I(e,t);function e(r){return t.call(this,r)||this}return e.prototype._next=function(r){r.observe(this.destination)},e}(V);function RC(t,e){return function(r){return r.lift(new AC(t,e))}}var AC=function(){function t(e,r){this.keySelector=e,this.flushes=r}return t.prototype.call=function(e,r){return r.subscribe(new MC(e,this.keySelector,this.flushes))},t}(),MC=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.keySelector=n,s.values=new Set,i&&s.add(Ee(i,new we(s))),s}return e.prototype.notifyNext=function(){this.values.clear()},e.prototype.notifyError=function(r){this._error(r)},e.prototype._next=function(r){this.keySelector?this._useKeySelector(r):this._finalizeNext(r,r)},e.prototype._useKeySelector=function(r){var n,i=this.destination;try{n=this.keySelector(r)}catch(s){i.error(s);return}this._finalizeNext(n,r)},e.prototype._finalizeNext=function(r,n){var i=this.values;i.has(r)||(i.add(r),this.destination.next(n))},e}(Se);function I0(t,e){return function(r){return r.lift(new kC(t,e))}}var kC=function(){function t(e,r){this.compare=e,this.keySelector=r}return t.prototype.call=function(e,r){return r.subscribe(new TC(e,this.compare,this.keySelector))},t}(),TC=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.keySelector=i,s.hasKey=!1,typeof n=="function"&&(s.compare=n),s}return e.prototype.compare=function(r,n){return r===n},e.prototype._next=function(r){var n;try{var i=this.keySelector;n=i?i(r):r}catch(a){return this.destination.error(a)}var s=!1;if(this.hasKey)try{var o=this.compare;s=o(this.key,n)}catch(a){return this.destination.error(a)}else this.hasKey=!0;s||(this.key=n,this.destination.next(r))},e}(V);function OC(t,e){return I0(function(r,n){return e?e(r[t],n[t]):r[t]===n[t]})}function uo(t){return t===void 0&&(t=PC),function(e){return e.lift(new NC(t))}}var NC=function(){function t(e){this.errorFactory=e}return t.prototype.call=function(e,r){return r.subscribe(new LC(e,this.errorFactory))},t}(),LC=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.errorFactory=n,i.hasValue=!1,i}return e.prototype._next=function(r){this.hasValue=!0,this.destination.next(r)},e.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var r=void 0;try{r=this.errorFactory()}catch(n){r=n}this.destination.error(r)},e}(V);function PC(){return new Ii}function Uu(t){return function(e){return t===0?An():e.lift(new $C(t))}}var $C=function(){function t(e){if(this.total=e,this.total<0)throw new dn}return t.prototype.call=function(e,r){return r.subscribe(new DC(e,this.total))},t}(),DC=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.total=n,i.count=0,i}return e.prototype._next=function(r){var n=this.total,i=++this.count;i<=n&&(this.destination.next(r),i===n&&(this.destination.complete(),this.unsubscribe()))},e}(V);function jC(t,e){if(t<0)throw new dn;var r=arguments.length>=2;return function(n){return n.pipe(nr(function(i,s){return s===t}),Uu(1),r?Ai(e):uo(function(){return new dn}))}}function BC(){for(var t=[],e=0;e0&&this._next(r.shift()),this.hasCompleted&&this.active===0&&this.destination.complete()},e}(Se);function YC(t){return function(e){return e.lift(new KC(t))}}var KC=function(){function t(e){this.callback=e}return t.prototype.call=function(e,r){return r.subscribe(new XC(e,this.callback))},t}(),XC=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.add(new _e(n)),i}return e}(V);function ex(t,e){if(typeof t!="function")throw new TypeError("predicate is not a function");return function(r){return r.lift(new A0(t,r,!1,e))}}var A0=function(){function t(e,r,n,i){this.predicate=e,this.source=r,this.yieldIndex=n,this.thisArg=i}return t.prototype.call=function(e,r){return r.subscribe(new tx(e,this.predicate,this.source,this.yieldIndex,this.thisArg))},t}(),tx=function(t){I(e,t);function e(r,n,i,s,o){var a=t.call(this,r)||this;return a.predicate=n,a.source=i,a.yieldIndex=s,a.thisArg=o,a.index=0,a}return e.prototype.notifyComplete=function(r){var n=this.destination;n.next(r),n.complete(),this.unsubscribe()},e.prototype._next=function(r){var n=this,i=n.predicate,s=n.thisArg,o=this.index++;try{var a=i.call(s||this,r,o,this.source);a&&this.notifyComplete(this.yieldIndex?o:r)}catch(c){this.destination.error(c)}},e.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},e}(V);function rx(t,e){return function(r){return r.lift(new A0(t,r,!0,e))}}function nx(t,e){var r=arguments.length>=2;return function(n){return n.pipe(t?nr(function(i,s){return t(i,s,n)}):tr,Uu(1),r?Ai(e):uo(function(){return new Ii}))}}function ix(){return function(e){return e.lift(new sx)}}var sx=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new ox(e))},t}(),ox=function(t){I(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype._next=function(r){},e}(V);function ax(){return function(t){return t.lift(new cx)}}var cx=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new ux(e))},t}(),ux=function(t){I(e,t);function e(r){return t.call(this,r)||this}return e.prototype.notifyComplete=function(r){var n=this.destination;n.next(r),n.complete()},e.prototype._next=function(r){this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(V);function ls(t){return function(r){return t===0?An():r.lift(new lx(t))}}var lx=function(){function t(e){if(this.total=e,this.total<0)throw new dn}return t.prototype.call=function(e,r){return r.subscribe(new fx(e,this.total))},t}(),fx=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.total=n,i.ring=new Array,i.count=0,i}return e.prototype._next=function(r){var n=this.ring,i=this.total,s=this.count++;if(n.length0)for(var i=this.count>=this.total?this.total:this.count,s=this.ring,o=0;o=2;return function(n){return n.pipe(t?nr(function(i,s){return t(i,s,n)}):tr,ls(1),r?Ai(e):uo(function(){return new Ii}))}}function dx(t){return function(e){return e.lift(new px(t))}}var px=function(){function t(e){this.value=e}return t.prototype.call=function(e,r){return r.subscribe(new bx(e,this.value))},t}(),bx=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.value=n,i}return e.prototype._next=function(r){this.destination.next(this.value)},e}(V);function gx(){return function(e){return e.lift(new yx)}}var yx=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new vx(e))},t}(),vx=function(t){I(e,t);function e(r){return t.call(this,r)||this}return e.prototype._next=function(r){this.destination.next(Bt.createNext(r))},e.prototype._error=function(r){var n=this.destination;n.next(Bt.createError(r)),n.complete()},e.prototype._complete=function(){var r=this.destination;r.next(Bt.createComplete()),r.complete()},e}(V);function fs(t,e){var r=!1;return arguments.length>=2&&(r=!0),function(i){return i.lift(new mx(t,e,r))}}var mx=function(){function t(e,r,n){n===void 0&&(n=!1),this.accumulator=e,this.seed=r,this.hasSeed=n}return t.prototype.call=function(e,r){return r.subscribe(new _x(e,this.accumulator,this.seed,this.hasSeed))},t}(),_x=function(t){I(e,t);function e(r,n,i,s){var o=t.call(this,r)||this;return o.accumulator=n,o._seed=i,o.hasSeed=s,o.index=0,o}return Object.defineProperty(e.prototype,"seed",{get:function(){return this._seed},set:function(r){this.hasSeed=!0,this._seed=r},enumerable:!0,configurable:!0}),e.prototype._next=function(r){if(!this.hasSeed)this.seed=r,this.destination.next(r);else return this._tryNext(r)},e.prototype._tryNext=function(r){var n=this.index++,i;try{i=this.accumulator(this.seed,r,n)}catch(s){this.destination.error(s)}this.seed=i,this.destination.next(i)},e}(V);function lo(t,e){return arguments.length>=2?function(n){return Cc(fs(t,e),ls(1),Ai(e))(n)}:function(n){return Cc(fs(function(i,s,o){return t(i,s,o+1)}),ls(1))(n)}}function wx(t){var e=typeof t=="function"?function(r,n){return t(r,n)>0?r:n}:function(r,n){return r>n?r:n};return lo(e)}function Sx(){for(var t=[],e=0;e0?this._next(r.shift()):this.active===0&&this.hasCompleted&&(this.hasValue===!1&&this.destination.next(this.acc),this.destination.complete())},e}(Se);function Rx(t){var e=typeof t=="function"?function(r,n){return t(r,n)<0?r:n}:function(r,n){return r-1&&(this.count=i-1),n.subscribe(this._unsubscribeAndRecycle())}},e}(V);function zx(t){return function(e){return e.lift(new qx(t))}}var qx=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,r){return r.subscribe(new Gx(e,this.notifier,r))},t}(),Gx=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.notifier=n,s.source=i,s.sourceIsBeingSubscribedTo=!0,s}return e.prototype.notifyNext=function(){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},e.prototype.notifyComplete=function(){if(this.sourceIsBeingSubscribedTo===!1)return t.prototype.complete.call(this)},e.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return t.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next(void 0)}},e.prototype._unsubscribe=function(){var r=this,n=r.notifications,i=r.retriesSubscription;n&&(n.unsubscribe(),this.notifications=void 0),i&&(i.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},e.prototype._unsubscribeAndRecycle=function(){var r=this._unsubscribe;return this._unsubscribe=null,t.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=r,this},e.prototype.subscribeToRetries=function(){this.notifications=new Ne;var r;try{var n=this.notifier;r=n(this.notifications)}catch{return t.prototype.complete.call(this)}this.retries=r,this.retriesSubscription=Ee(r,new we(this))},e}(Se);function Jx(t){return t===void 0&&(t=-1),function(e){return e.lift(new Qx(t,e))}}var Qx=function(){function t(e,r){this.count=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new Zx(e,this.count,this.source))},t}(),Zx=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.count=n,s.source=i,s}return e.prototype.error=function(r){if(!this.isStopped){var n=this,i=n.source,s=n.count;if(s===0)return t.prototype.error.call(this,r);s>-1&&(this.count=s-1),i.subscribe(this._unsubscribeAndRecycle())}},e}(V);function Yx(t){return function(e){return e.lift(new Kx(t,e))}}var Kx=function(){function t(e,r){this.notifier=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new Xx(e,this.notifier,this.source))},t}(),Xx=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.notifier=n,s.source=i,s}return e.prototype.error=function(r){if(!this.isStopped){var n=this.errors,i=this.retries,s=this.retriesSubscription;if(i)this.errors=void 0,this.retriesSubscription=void 0;else{n=new Ne;try{var o=this.notifier;i=o(n)}catch(a){return t.prototype.error.call(this,a)}s=Ee(i,new we(this))}this._unsubscribeAndRecycle(),this.errors=n,this.retries=i,this.retriesSubscription=s,n.next(r)}},e.prototype._unsubscribe=function(){var r=this,n=r.errors,i=r.retriesSubscription;n&&(n.unsubscribe(),this.errors=void 0),i&&(i.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},e.prototype.notifyNext=function(){var r=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=r,this.source.subscribe(this)},e}(Se);function eI(t){return function(e){return e.lift(new tI(t))}}var tI=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,r){var n=new rI(e),i=r.subscribe(n);return i.add(Ee(this.notifier,new we(n))),i},t}(),rI=function(t){I(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.hasValue=!1,r}return e.prototype._next=function(r){this.value=r,this.hasValue=!0},e.prototype.notifyNext=function(){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},e}(Se);function nI(t,e){return e===void 0&&(e=ze),function(r){return r.lift(new iI(t,e))}}var iI=function(){function t(e,r){this.period=e,this.scheduler=r}return t.prototype.call=function(e,r){return r.subscribe(new sI(e,this.period,this.scheduler))},t}(),sI=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.period=n,s.scheduler=i,s.hasValue=!1,s.add(i.schedule(oI,n,{subscriber:s,period:n})),s}return e.prototype._next=function(r){this.lastValue=r,this.hasValue=!0},e.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},e}(V);function oI(t){var e=t.subscriber,r=t.period;e.notifyNext(),this.schedule(t,r)}function aI(t,e){return function(r){return r.lift(new cI(t,e))}}var cI=function(){function t(e,r){this.compareTo=e,this.comparator=r}return t.prototype.call=function(e,r){return r.subscribe(new uI(e,this.compareTo,this.comparator))},t}(),uI=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.compareTo=n,s.comparator=i,s._a=[],s._b=[],s._oneComplete=!1,s.destination.add(n.subscribe(new lI(r,s))),s}return e.prototype._next=function(r){this._oneComplete&&this._b.length===0?this.emit(!1):(this._a.push(r),this.checkValues())},e.prototype._complete=function(){this._oneComplete?this.emit(this._a.length===0&&this._b.length===0):this._oneComplete=!0,this.unsubscribe()},e.prototype.checkValues=function(){for(var r=this,n=r._a,i=r._b,s=r.comparator;n.length>0&&i.length>0;){var o=n.shift(),a=i.shift(),c=!1;try{c=s?s(o,a):o===a}catch(u){this.destination.error(u)}c||this.emit(!1)}},e.prototype.emit=function(r){var n=this.destination;n.next(r),n.complete()},e.prototype.nextB=function(r){this._oneComplete&&this._a.length===0?this.emit(!1):(this._b.push(r),this.checkValues())},e.prototype.completeB=function(){this._oneComplete?this.emit(this._a.length===0&&this._b.length===0):this._oneComplete=!0},e}(V),lI=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.parent=n,i}return e.prototype._next=function(r){this.parent.nextB(r)},e.prototype._error=function(r){this.parent.error(r),this.unsubscribe()},e.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},e}(V);function fI(){return new Ne}function hI(){return function(t){return xu()(Cr(fI)(t))}}function dI(t,e,r){var n;return t&&typeof t=="object"?n=t:n={bufferSize:t,windowTime:e,refCount:!1,scheduler:r},function(i){return i.lift(pI(n))}}function pI(t){var e=t.bufferSize,r=e===void 0?Number.POSITIVE_INFINITY:e,n=t.windowTime,i=n===void 0?Number.POSITIVE_INFINITY:n,s=t.refCount,o=t.scheduler,a,c=0,u,l=!1,f=!1;return function(p){c++;var v;!a||l?(l=!1,a=new Au(r,i,o),v=a.subscribe(this),u=p.subscribe({next:function(E){a.next(E)},error:function(E){l=!0,a.error(E)},complete:function(){f=!0,u=void 0,a.complete()}}),f&&(u=void 0)):v=a.subscribe(this),this.add(function(){c--,v.unsubscribe(),v=void 0,u&&!f&&s&&c===0&&(u.unsubscribe(),u=void 0,a=void 0)})}}function bI(t){return function(e){return e.lift(new gI(t,e))}}var gI=function(){function t(e,r){this.predicate=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new yI(e,this.predicate,this.source))},t}(),yI=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.predicate=n,s.source=i,s.seenValue=!1,s.index=0,s}return e.prototype.applySingleValue=function(r){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=r)},e.prototype._next=function(r){var n=this.index++;this.predicate?this.tryNext(r,n):this.applySingleValue(r)},e.prototype.tryNext=function(r,n){try{this.predicate(r,n,this.source)&&this.applySingleValue(r)}catch(i){this.destination.error(i)}},e.prototype._complete=function(){var r=this.destination;this.index>0?(r.next(this.seenValue?this.singleValue:void 0),r.complete()):r.error(new Ii)},e}(V);function vI(t){return function(e){return e.lift(new mI(t))}}var mI=function(){function t(e){this.total=e}return t.prototype.call=function(e,r){return r.subscribe(new _I(e,this.total))},t}(),_I=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i.total=n,i.count=0,i}return e.prototype._next=function(r){++this.count>this.total&&this.destination.next(r)},e}(V);function wI(t){return function(e){return e.lift(new SI(t))}}var SI=function(){function t(e){if(this._skipCount=e,this._skipCount<0)throw new dn}return t.prototype.call=function(e,r){return this._skipCount===0?r.subscribe(new V(e)):r.subscribe(new EI(e,this._skipCount))},t}(),EI=function(t){I(e,t);function e(r,n){var i=t.call(this,r)||this;return i._skipCount=n,i._count=0,i._ring=new Array(n),i}return e.prototype._next=function(r){var n=this._skipCount,i=this._count++;if(i0?this.startWindowEvery:this.windowSize,i=this.destination,s=this.windowSize,o=this.windows,a=o.length,c=0;c=0&&u%n===0&&!this.closed&&o.shift().complete(),++this.count%n===0&&!this.closed){var l=new Ne;o.push(l),i.next(l)}},e.prototype._error=function(r){var n=this.windows;if(n)for(;n.length>0&&!this.closed;)n.shift().error(r);this.destination.error(r)},e.prototype._complete=function(){var r=this.windows;if(r)for(;r.length>0&&!this.closed;)r.shift().complete();this.destination.complete()},e.prototype._unsubscribe=function(){this.count=0,this.windows=null},e}(V);function bR(t){var e=ze,r=null,n=Number.POSITIVE_INFINITY;return Ye(arguments[3])&&(e=arguments[3]),Ye(arguments[2])?e=arguments[2]:pn(arguments[2])&&(n=Number(arguments[2])),Ye(arguments[1])?e=arguments[1]:pn(arguments[1])&&(r=Number(arguments[1])),function(s){return s.lift(new gR(t,r,n,e))}}var gR=function(){function t(e,r,n,i){this.windowTimeSpan=e,this.windowCreationInterval=r,this.maxWindowSize=n,this.scheduler=i}return t.prototype.call=function(e,r){return r.subscribe(new vR(e,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},t}(),yR=function(t){I(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._numberOfNextedValues=0,r}return e.prototype.next=function(r){this._numberOfNextedValues++,t.prototype.next.call(this,r)},Object.defineProperty(e.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),e}(Ne),vR=function(t){I(e,t);function e(r,n,i,s,o){var a=t.call(this,r)||this;a.destination=r,a.windowTimeSpan=n,a.windowCreationInterval=i,a.maxWindowSize=s,a.scheduler=o,a.windows=[];var c=a.openWindow();if(i!==null&&i>=0){var u={subscriber:a,window:c,context:null},l={windowTimeSpan:n,windowCreationInterval:i,subscriber:a,scheduler:o};a.add(o.schedule(T0,n,u)),a.add(o.schedule(_R,i,l))}else{var f={subscriber:a,window:c,windowTimeSpan:n};a.add(o.schedule(mR,n,f))}return a}return e.prototype._next=function(r){for(var n=this.windows,i=n.length,s=0;s=this.maxWindowSize&&this.closeWindow(o))}},e.prototype._error=function(r){for(var n=this.windows;n.length>0;)n.shift().error(r);this.destination.error(r)},e.prototype._complete=function(){for(var r=this.windows;r.length>0;){var n=r.shift();n.closed||n.complete()}this.destination.complete()},e.prototype.openWindow=function(){var r=new yR;this.windows.push(r);var n=this.destination;return n.next(r),r},e.prototype.closeWindow=function(r){r.complete();var n=this.windows;n.splice(n.indexOf(r),1)},e}(V);function mR(t){var e=t.subscriber,r=t.windowTimeSpan,n=t.window;n&&e.closeWindow(n),t.window=e.openWindow(),this.schedule(t,r)}function _R(t){var e=t.windowTimeSpan,r=t.subscriber,n=t.scheduler,i=t.windowCreationInterval,s=r.openWindow(),o=this,a={action:o,subscription:null},c={subscriber:r,window:s,context:a};a.subscription=n.schedule(T0,e,c),o.add(a.subscription),o.schedule(t,i)}function T0(t){var e=t.subscriber,r=t.window,n=t.context;n&&n.action&&n.subscription&&n.action.remove(n.subscription),e.closeWindow(r)}function wR(t,e){return function(r){return r.lift(new SR(t,e))}}var SR=function(){function t(e,r){this.openings=e,this.closingSelector=r}return t.prototype.call=function(e,r){return r.subscribe(new ER(e,this.openings,this.closingSelector))},t}(),ER=function(t){I(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.openings=n,s.closingSelector=i,s.contexts=[],s.add(s.openSubscription=Wt(s,n,n)),s}return e.prototype._next=function(r){var n=this.contexts;if(n)for(var i=n.length,s=0;s0){var o=s.indexOf(i);o!==-1&&s.splice(o,1)}},e.prototype.notifyComplete=function(){},e.prototype._next=function(r){if(this.toRespond.length===0){var n=[r].concat(this.values);this.project?this._tryProject(n):this.destination.next(n)}},e.prototype._tryProject=function(r){var n;try{n=this.project.apply(this,r)}catch(i){this.destination.error(i);return}this.destination.next(n)},e}(Nr);function kR(){for(var t=[],e=0;e{let a;try{this.webSocket=a=new this.WebSocketClass(this.url)}catch(c){o.error(c);return}this.connectionStateSubject.next(n.CONNECTING),a.onclose=c=>{this.clearWebSocket(),o.error(new Error(`websocket error ${c.code}: ${c.reason}`)),this.connectionStateSubject.next(n.DISCONNECTED)},a.onopen=c=>{o.next(),o.complete(),this.connectionStateSubject.next(n.CONNECTED)},a.onmessage=c=>{this.incomingDataSubject.next(c.data)}}).pipe((0,r.take)(1))}disconnect(){const{webSocket:o}=this;if(o){this.clearWebSocket(),this.connectionStateSubject.next(n.DISCONNECTED);try{o.close()}catch{}}}get connectionState$(){return this.connectionStateSubject.asObservable()}get incomingData$(){return this.incomingDataSubject.asObservable()}get incomingJSONData$(){return this.incomingData$.pipe((0,r.flatMap)(o=>{let a;try{a=JSON.parse(o)}catch{return(0,e.empty)()}return(0,e.of)(a)}))}sendData(o){const{webSocket:a}=this;if(!a)throw new Error("websocket is not connected");a.send(o)}clearWebSocket(){const{webSocket:o}=this;o&&(this.webSocket=null,o.onclose=null,o.onerror=null,o.onmessage=null,o.onopen=null)}}t.RxWebSocket=i})(O0);var ho={};Object.defineProperty(ho,"__esModule",{value:!0});ho.isServerMessageFail=void 0;function jR(t){return t&&t.type==="Fail"&&typeof t.id=="number"&&typeof t.sessionId=="string"&&typeof t.error=="string"}ho.isServerMessageFail=jR;Object.defineProperty(fo,"__esModule",{value:!0});fo.WalletSDKConnection=void 0;const lt=Js,ie=zu,Dn=_n,Vr=ui,jn=nt,Bn=vn,Ui=O0,rc=ho,mh=1e4,BR=6e4;class FR{constructor(e,r,n,i,s=WebSocket){this.sessionId=e,this.sessionKey=r,this.diagnostic=i,this.subscriptions=new lt.Subscription,this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,Vr.IntNumber)(1),this.connectedSubject=new lt.BehaviorSubject(!1),this.linkedSubject=new lt.BehaviorSubject(!1),this.sessionConfigSubject=new lt.ReplaySubject(1);const o=new Ui.RxWebSocket(n+"/rpc",s);this.ws=o,this.subscriptions.add(o.connectionState$.pipe((0,ie.tap)(a=>{var c;return(c=this.diagnostic)===null||c===void 0?void 0:c.log(Bn.EVENTS.CONNECTED_STATE_CHANGE,{state:a,sessionIdHash:Dn.Session.hash(e)})}),(0,ie.skip)(1),(0,ie.filter)(a=>a===Ui.ConnectionState.DISCONNECTED&&!this.destroyed),(0,ie.delay)(5e3),(0,ie.filter)(a=>!this.destroyed),(0,ie.flatMap)(a=>o.connect()),(0,ie.retry)()).subscribe()),this.subscriptions.add(o.connectionState$.pipe((0,ie.skip)(2),(0,ie.switchMap)(a=>(0,lt.iif)(()=>a===Ui.ConnectionState.CONNECTED,this.authenticate().pipe((0,ie.tap)(c=>this.sendIsLinked()),(0,ie.tap)(c=>this.sendGetSessionConfig()),(0,ie.map)(c=>!0)),(0,lt.of)(!1))),(0,ie.distinctUntilChanged)(),(0,ie.catchError)(a=>(0,lt.of)(!1))).subscribe(a=>this.connectedSubject.next(a))),this.subscriptions.add(o.connectionState$.pipe((0,ie.skip)(1),(0,ie.switchMap)(a=>(0,lt.iif)(()=>a===Ui.ConnectionState.CONNECTED,(0,lt.timer)(0,mh)))).subscribe(a=>a===0?this.updateLastHeartbeat():this.heartbeat())),this.subscriptions.add(o.incomingData$.pipe((0,ie.filter)(a=>a==="h")).subscribe(a=>this.updateLastHeartbeat())),this.subscriptions.add(o.incomingJSONData$.pipe((0,ie.filter)(a=>["IsLinkedOK","Linked"].includes(a.type))).subscribe(a=>{var c;const u=a;(c=this.diagnostic)===null||c===void 0||c.log(Bn.EVENTS.LINKED,{sessionIdHash:Dn.Session.hash(e),linked:u.linked,type:a.type,onlineGuests:u.onlineGuests}),this.linkedSubject.next(u.linked||u.onlineGuests>0)})),this.subscriptions.add(o.incomingJSONData$.pipe((0,ie.filter)(a=>["GetSessionConfigOK","SessionConfigUpdated"].includes(a.type))).subscribe(a=>{var c;const u=a;(c=this.diagnostic)===null||c===void 0||c.log(Bn.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:Dn.Session.hash(e),metadata_keys:u&&u.metadata?Object.keys(u.metadata):void 0}),this.sessionConfigSubject.next({webhookId:u.webhookId,webhookUrl:u.webhookUrl,metadata:u.metadata})}))}connect(){var e;if(this.destroyed)throw new Error("instance is destroyed");(e=this.diagnostic)===null||e===void 0||e.log(Bn.EVENTS.STARTED_CONNECTING,{sessionIdHash:Dn.Session.hash(this.sessionId)}),this.ws.connect().subscribe()}destroy(){var e;this.subscriptions.unsubscribe(),this.ws.disconnect(),(e=this.diagnostic)===null||e===void 0||e.log(Bn.EVENTS.DISCONNECTED,{sessionIdHash:Dn.Session.hash(this.sessionId)}),this.destroyed=!0}get isDestroyed(){return this.destroyed}get connected$(){return this.connectedSubject.asObservable()}get onceConnected$(){return this.connected$.pipe((0,ie.filter)(e=>e),(0,ie.take)(1),(0,ie.map)(()=>{}))}get linked$(){return this.linkedSubject.asObservable()}get onceLinked$(){return this.linked$.pipe((0,ie.filter)(e=>e),(0,ie.take)(1),(0,ie.map)(()=>{}))}get sessionConfig$(){return this.sessionConfigSubject.asObservable()}get incomingEvent$(){return this.ws.incomingJSONData$.pipe((0,ie.filter)(e=>{if(e.type!=="Event")return!1;const r=e;return typeof r.sessionId=="string"&&typeof r.eventId=="string"&&typeof r.event=="string"&&typeof r.data=="string"}),(0,ie.map)(e=>e))}setSessionMetadata(e,r){const n=(0,jn.ClientMessageSetSessionConfig)({id:(0,Vr.IntNumber)(this.nextReqId++),sessionId:this.sessionId,metadata:{[e]:r}});return this.onceConnected$.pipe((0,ie.flatMap)(i=>this.makeRequest(n)),(0,ie.map)(i=>{if((0,rc.isServerMessageFail)(i))throw new Error(i.error||"failed to set session metadata")}))}publishEvent(e,r,n=!1){const i=(0,jn.ClientMessagePublishEvent)({id:(0,Vr.IntNumber)(this.nextReqId++),sessionId:this.sessionId,event:e,data:r,callWebhook:n});return this.onceLinked$.pipe((0,ie.flatMap)(s=>this.makeRequest(i)),(0,ie.map)(s=>{if((0,rc.isServerMessageFail)(s))throw new Error(s.error||"failed to publish event");return s.eventId}))}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>mh*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}makeRequest(e,r=BR){const n=e.id;try{this.sendData(e)}catch(i){return(0,lt.throwError)(i)}return this.ws.incomingJSONData$.pipe((0,ie.timeoutWith)(r,(0,lt.throwError)(new Error(`request ${n} timed out`))),(0,ie.filter)(i=>i.id===n),(0,ie.take)(1))}authenticate(){const e=(0,jn.ClientMessageHostSession)({id:(0,Vr.IntNumber)(this.nextReqId++),sessionId:this.sessionId,sessionKey:this.sessionKey});return this.makeRequest(e).pipe((0,ie.map)(r=>{if((0,rc.isServerMessageFail)(r))throw new Error(r.error||"failed to authentcate")}))}sendIsLinked(){const e=(0,jn.ClientMessageIsLinked)({id:(0,Vr.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(e)}sendGetSessionConfig(){const e=(0,jn.ClientMessageGetSessionConfig)({id:(0,Vr.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(e)}}fo.WalletSDKConnection=FR;var gn={};Object.defineProperty(gn,"__esModule",{value:!0});gn.decrypt=gn.encrypt=void 0;const hs=W;async function WR(t,e){if(e.length!==64)throw Error("secret must be 256 bits");const r=crypto.getRandomValues(new Uint8Array(12)),n=await crypto.subtle.importKey("raw",(0,hs.hexStringToUint8Array)(e),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,s=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:r},n,i.encode(t)),o=16,a=s.slice(s.byteLength-o),c=s.slice(0,s.byteLength-o),u=new Uint8Array(a),l=new Uint8Array(c),f=new Uint8Array([...r,...u,...l]);return(0,hs.uint8ArrayToHex)(f)}gn.encrypt=WR;function HR(t,e){if(e.length!==64)throw Error("secret must be 256 bits");return new Promise((r,n)=>{(async function(){const i=await crypto.subtle.importKey("raw",(0,hs.hexStringToUint8Array)(e),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=(0,hs.hexStringToUint8Array)(t),o=s.slice(0,12),a=s.slice(12,28),c=s.slice(28),u=new Uint8Array([...c,...a]),l={name:"AES-GCM",iv:new Uint8Array(o)};try{const f=await window.crypto.subtle.decrypt(l,i,u),h=new TextDecoder;r(h.decode(f))}catch(f){n(f)}})()})}gn.decrypt=HR;var po={},bo={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RelayMessageType=void 0,function(e){e.SESSION_ID_REQUEST="SESSION_ID_REQUEST",e.SESSION_ID_RESPONSE="SESSION_ID_RESPONSE",e.LINKED="LINKED",e.UNLINKED="UNLINKED",e.WEB3_REQUEST="WEB3_REQUEST",e.WEB3_REQUEST_CANCELED="WEB3_REQUEST_CANCELED",e.WEB3_RESPONSE="WEB3_RESPONSE"}(t.RelayMessageType||(t.RelayMessageType={}))})(bo);Object.defineProperty(po,"__esModule",{value:!0});po.Web3RequestCanceledMessage=void 0;const VR=bo;function UR(t){return{type:VR.RelayMessageType.WEB3_REQUEST_CANCELED,id:t}}po.Web3RequestCanceledMessage=UR;var go={};Object.defineProperty(go,"__esModule",{value:!0});go.Web3RequestMessage=void 0;const zR=bo;function qR(t){return Object.assign({type:zR.RelayMessageType.WEB3_REQUEST},t)}go.Web3RequestMessage=qR;var yn={};Object.defineProperty(yn,"__esModule",{value:!0});yn.isWeb3ResponseMessage=yn.Web3ResponseMessage=void 0;const N0=bo;function GR(t){return Object.assign({type:N0.RelayMessageType.WEB3_RESPONSE},t)}yn.Web3ResponseMessage=GR;function JR(t){return t&&t.type===N0.RelayMessageType.WEB3_RESPONSE}yn.isWeb3ResponseMessage=JR;var QR=F&&F.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),ZR=F&&F.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),L0=F&&F.__decorate||function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s},YR=F&&F.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&QR(e,t,r);return ZR(e,t),e},KR=F&&F.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ao,"__esModule",{value:!0});ao.WalletSDKRelay=void 0;const P0=KR(co),ur=Js,Ie=zu,je=vn,XR=fo,Ur=ni,e6=ui,ye=W,qt=YR(gn),Gt=_n,zi=pt,Le=ms,t6=po,r6=go,tt=be,Ge=yn;class dt extends zi.WalletSDKRelayAbstract{constructor(e){var r;super(),this.accountsCallback=null,this.chainCallback=null,this.dappDefaultChainSubject=new ur.BehaviorSubject(1),this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.subscriptions=new ur.Subscription,this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage,this.options=e;const{session:n,ui:i,connection:s}=this.subscribe();if(this._session=n,this.connection=s,this.relayEventManager=e.relayEventManager,e.diagnosticLogger&&e.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");e.eventListener?this.diagnostic={log:e.eventListener.onEvent}:this.diagnostic=e.diagnosticLogger,this._reloadOnDisconnect=(r=e.reloadOnDisconnect)!==null&&r!==void 0?r:!0,this.ui=i}subscribe(){this.subscriptions.add(this.dappDefaultChainSubject.subscribe(i=>{this.dappDefaultChain!==i&&(this.dappDefaultChain=i)}));const e=Gt.Session.load(this.storage)||new Gt.Session(this.storage).save(),r=new XR.WalletSDKConnection(e.id,e.key,this.linkAPIUrl,this.diagnostic);this.subscriptions.add(r.sessionConfig$.subscribe({next:i=>{this.onSessionConfigChanged(i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(je.EVENTS.GENERAL_ERROR,{message:"error while invoking session config callback"})}})),this.subscriptions.add(r.incomingEvent$.pipe((0,Ie.filter)(i=>i.event==="Web3Response")).subscribe({next:this.handleIncomingEvent})),this.subscriptions.add(r.linked$.pipe((0,Ie.skip)(1),(0,Ie.tap)(i=>{var s;this.isLinked=i;const o=this.storage.getItem(zi.LOCAL_STORAGE_ADDRESSES_KEY);if(i&&(this.session.linked=i),this.isUnlinkedErrorState=!1,o){const a=o.split(" "),c=this.storage.getItem("IsStandaloneSigning")==="true";if(a[0]!==""&&!i&&this.session.linked&&!c){this.isUnlinkedErrorState=!0;const u=this.getSessionIdHash();(s=this.diagnostic)===null||s===void 0||s.log(je.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:u})}}})).subscribe()),this.subscriptions.add(r.sessionConfig$.pipe((0,Ie.filter)(i=>!!i.metadata&&i.metadata.__destroyed==="1")).subscribe(()=>{var i;const s=r.isDestroyed;return(i=this.diagnostic)===null||i===void 0||i.log(je.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:s,sessionIdHash:this.getSessionIdHash()}),this.resetAndReload()})),this.subscriptions.add(r.sessionConfig$.pipe((0,Ie.filter)(i=>i.metadata&&i.metadata.WalletUsername!==void 0)).pipe((0,Ie.mergeMap)(i=>qt.decrypt(i.metadata.WalletUsername,e.secret))).subscribe({next:i=>{this.storage.setItem(zi.WALLET_USER_NAME_KEY,i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(je.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"username"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,Ie.filter)(i=>i.metadata&&i.metadata.AppVersion!==void 0)).pipe((0,Ie.mergeMap)(i=>qt.decrypt(i.metadata.AppVersion,e.secret))).subscribe({next:i=>{this.storage.setItem(zi.APP_VERSION_KEY,i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(je.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appversion"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,Ie.filter)(i=>i.metadata&&i.metadata.ChainId!==void 0&&i.metadata.JsonRpcUrl!==void 0)).pipe((0,Ie.mergeMap)(i=>(0,ur.zip)(qt.decrypt(i.metadata.ChainId,e.secret),qt.decrypt(i.metadata.JsonRpcUrl,e.secret)))).pipe((0,Ie.distinctUntilChanged)()).subscribe({next:([i,s])=>{this.chainCallback&&this.chainCallback(i,s)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(je.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,Ie.filter)(i=>i.metadata&&i.metadata.EthereumAddress!==void 0)).pipe((0,Ie.mergeMap)(i=>qt.decrypt(i.metadata.EthereumAddress,e.secret))).subscribe({next:i=>{this.accountsCallback&&this.accountsCallback([i]),dt.accountRequestCallbackIds.size>0&&(Array.from(dt.accountRequestCallbackIds.values()).forEach(s=>{const o=(0,Ge.Web3ResponseMessage)({id:s,response:(0,tt.RequestEthereumAccountsResponse)([i])});this.invokeCallback(Object.assign(Object.assign({},o),{id:s}))}),dt.accountRequestCallbackIds.clear())},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(je.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,Ie.filter)(i=>i.metadata&&i.metadata.AppSrc!==void 0)).pipe((0,Ie.mergeMap)(i=>qt.decrypt(i.metadata.AppSrc,e.secret))).subscribe({next:i=>{this.ui.setAppSrc(i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(je.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appSrc"})}}));const n=this.options.uiConstructor({linkAPIUrl:this.options.linkAPIUrl,version:this.options.version,darkMode:this.options.darkMode,session:e,connected$:r.connected$,chainId$:this.dappDefaultChainSubject});return r.connect(),{session:e,ui:n,connection:r}}attachUI(){this.ui.attach()}resetAndReload(){this.connection.setSessionMetadata("__destroyed","1").pipe((0,Ie.timeout)(1e3),(0,Ie.catchError)(e=>(0,ur.of)(null))).subscribe(e=>{var r,n,i;const s=this.ui.isStandalone();try{this.subscriptions.unsubscribe()}catch{(r=this.diagnostic)===null||r===void 0||r.log(je.EVENTS.GENERAL_ERROR,{message:"Had error unsubscribing"})}(n=this.diagnostic)===null||n===void 0||n.log(je.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const o=Gt.Session.load(this.storage);if((o==null?void 0:o.id)===this._session.id?this.storage.clear():o&&((i=this.diagnostic)===null||i===void 0||i.log(je.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:Gt.Session.hash(o.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0),this.subscriptions=new ur.Subscription;const{session:a,ui:c,connection:u}=this.subscribe();this._session=a,this.connection=u,this.ui=c,s&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.attachUI()},e=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(je.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${e}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(e,r){this.appName=e,this.appLogoUrl=r}getStorageItem(e){return this.storage.getItem(e)}get session(){return this._session}setStorageItem(e,r){this.storage.setItem(e,r)}signEthereumMessage(e,r,n,i){return this.sendRequest({method:Le.Web3Method.signEthereumMessage,params:{message:(0,ye.hexStringFromBuffer)(e,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(e,r,n){return this.sendRequest({method:Le.Web3Method.ethereumAddressFromSignedMessage,params:{message:(0,ye.hexStringFromBuffer)(e,!0),signature:(0,ye.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(e){return this.sendRequest({method:Le.Web3Method.signEthereumTransaction,params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,ye.bigIntStringFromBN)(e.weiValue),data:(0,ye.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,ye.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,ye.bigIntStringFromBN)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,ye.bigIntStringFromBN)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,ye.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:Le.Web3Method.signEthereumTransaction,params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,ye.bigIntStringFromBN)(e.weiValue),data:(0,ye.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,ye.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,ye.bigIntStringFromBN)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,ye.bigIntStringFromBN)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,ye.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,r){return this.sendRequest({method:Le.Web3Method.submitEthereumTransaction,params:{signedTransaction:(0,ye.hexStringFromBuffer)(e,!0),chainId:r}})}scanQRCode(e){return this.sendRequest({method:Le.Web3Method.scanQRCode,params:{regExp:e}})}getQRCodeUrl(){return(0,ye.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(e,r){return this.sendRequest({method:Le.Web3Method.generic,params:{action:r,data:e}})}sendGenericMessage(e){return this.sendRequest(e)}sendRequest(e){let r=null;const n=(0,ye.randomBytesHex)(8),i=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,o),r==null||r()};return{promise:new Promise((o,a)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,c=>{if(r==null||r(),c.errorMessage)return a(new Error(c.errorMessage));o(c)}),this.ui.isStandalone()?this.sendRequestStandalone(n,e):this.publishWeb3RequestEvent(n,e)}),cancel:i}}setConnectDisabled(e){this.ui.setConnectDisabled(e)}setAccountsCallback(e){this.accountsCallback=e}setChainCallback(e){this.chainCallback=e}setDappDefaultChainCallback(e){this.dappDefaultChainSubject.next(e)}publishWeb3RequestEvent(e,r){var n;const i=(0,r6.Web3RequestMessage)({id:e,request:r}),s=Gt.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(je.EVENTS.WEB3_REQUEST,{eventId:i.id,method:`relay::${i.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Gt.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()}),this.subscriptions.add(this.publishEvent("Web3Request",i,!0).subscribe({next:o=>{var a;(a=this.diagnostic)===null||a===void 0||a.log(je.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:`relay::${i.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Gt.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()})},error:o=>{this.handleWeb3ResponseMessage((0,Ge.Web3ResponseMessage)({id:i.id,response:{method:i.request.method,errorMessage:o.message}}))}}))}publishWeb3RequestCanceledEvent(e){const r=(0,t6.Web3RequestCanceledMessage)(e);this.subscriptions.add(this.publishEvent("Web3RequestCanceled",r,!1).subscribe())}publishEvent(e,r,n){const i=this.session.secret;return new ur.Observable(s=>{qt.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin})),i).then(o=>{s.next(o),s.complete()})}).pipe((0,Ie.mergeMap)(s=>this.connection.publishEvent(e,s,n)))}handleIncomingEvent(e){try{this.subscriptions.add((0,ur.from)(qt.decrypt(e.data,this.session.secret)).pipe((0,Ie.map)(r=>JSON.parse(r))).subscribe({next:r=>{const n=(0,Ge.isWeb3ResponseMessage)(r)?r:null;n&&this.handleWeb3ResponseMessage(n)},error:()=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(je.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}))}catch{return}}handleWeb3ResponseMessage(e){var r;const{response:n}=e;if((r=this.diagnostic)===null||r===void 0||r.log(je.EVENTS.WEB3_RESPONSE,{eventId:e.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),(0,tt.isRequestEthereumAccountsResponse)(n)){dt.accountRequestCallbackIds.forEach(i=>this.invokeCallback(Object.assign(Object.assign({},e),{id:i}))),dt.accountRequestCallbackIds.clear();return}this.invokeCallback(e)}handleErrorResponse(e,r,n,i){var s;const o=(s=n==null?void 0:n.message)!==null&&s!==void 0?s:(0,Ur.standardErrorMessage)(i);this.handleWeb3ResponseMessage((0,Ge.Web3ResponseMessage)({id:e,response:{method:r,errorMessage:o,errorCode:i}}))}invokeCallback(e){const r=this.relayEventManager.callbacks.get(e.id);r&&(r(e.response),this.relayEventManager.callbacks.delete(e.id))}requestEthereumAccounts(){const e={method:Le.Web3Method.requestEthereumAccounts,params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=(0,ye.randomBytesHex)(8),n=s=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,e.method,s)};return{promise:new Promise((s,o)=>{var a;this.relayEventManager.callbacks.set(r,u=>{if(this.ui.hideRequestEthereumAccounts(),u.errorMessage)return o(new Error(u.errorMessage));s(u)});const c=((a=window==null?void 0:window.navigator)===null||a===void 0?void 0:a.userAgent)||null;if(c&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(c)){let u;try{(0,ye.isInIFrame)()&&window.top?u=window.top.location:u=window.location}catch{u=window.location}u.href=`https://www.coinbase.com/connect-dapp?uri=${encodeURIComponent(u.href)}`;return}if(this.ui.inlineAccountsResponse()){const u=l=>{this.handleWeb3ResponseMessage((0,Ge.Web3ResponseMessage)({id:r,response:(0,tt.RequestEthereumAccountsResponse)(l)}))};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:u})}else{const u=Ur.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(u)})}dt.accountRequestCallbackIds.add(r),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(r,e)}),cancel:n}}selectProvider(e){const r={method:Le.Web3Method.selectProvider,params:{providerOptions:e}},n=(0,ye.randomBytesHex)(8),i=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,o)},s=new Promise((o,a)=>{this.relayEventManager.callbacks.set(n,l=>{if(l.errorMessage)return a(new Error(l.errorMessage));o(l)});const c=l=>{this.handleWeb3ResponseMessage((0,Ge.Web3ResponseMessage)({id:n,response:(0,tt.SelectProviderResponse)(e6.ProviderType.Unselected)}))},u=l=>{this.handleWeb3ResponseMessage((0,Ge.Web3ResponseMessage)({id:n,response:(0,tt.SelectProviderResponse)(l)}))};this.ui.selectProvider&&this.ui.selectProvider({onApprove:u,onCancel:c,providerOptions:e})});return{cancel:i,promise:s}}watchAsset(e,r,n,i,s,o){const a={method:Le.Web3Method.watchAsset,params:{type:e,options:{address:r,symbol:n,decimals:i,image:s},chainId:o}};let c=null;const u=(0,ye.randomBytesHex)(8),l=h=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,a.method,h),c==null||c()};this.ui.inlineWatchAsset()||(c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:l,onResetConnection:this.resetAndReload}));const f=new Promise((h,p)=>{this.relayEventManager.callbacks.set(u,_=>{if(c==null||c(),_.errorMessage)return p(new Error(_.errorMessage));h(_)});const v=_=>{this.handleWeb3ResponseMessage((0,Ge.Web3ResponseMessage)({id:u,response:(0,tt.WatchAssetReponse)(!1)}))},E=()=>{this.handleWeb3ResponseMessage((0,Ge.Web3ResponseMessage)({id:u,response:(0,tt.WatchAssetReponse)(!0)}))};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:E,onCancel:v,type:e,address:r,symbol:n,decimals:i,image:s,chainId:o}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(u,a)});return{cancel:l,promise:f}}addEthereumChain(e,r,n,i,s,o){const a={method:Le.Web3Method.addEthereumChain,params:{chainId:e,rpcUrls:r,blockExplorerUrls:i,chainName:s,iconUrls:n,nativeCurrency:o}};let c=null;const u=(0,ye.randomBytesHex)(8),l=h=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,a.method,h),c==null||c()};return this.ui.inlineAddEthereumChain(e)||(c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:l,onResetConnection:this.resetAndReload})),{promise:new Promise((h,p)=>{this.relayEventManager.callbacks.set(u,_=>{if(c==null||c(),_.errorMessage)return p(new Error(_.errorMessage));h(_)});const v=_=>{this.handleWeb3ResponseMessage((0,Ge.Web3ResponseMessage)({id:u,response:(0,tt.AddEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},E=_=>{this.handleWeb3ResponseMessage((0,Ge.Web3ResponseMessage)({id:u,response:(0,tt.AddEthereumChainResponse)({isApproved:!0,rpcUrl:_})}))};this.ui.inlineAddEthereumChain(e)&&this.ui.addEthereumChain({onCancel:v,onApprove:E,chainId:a.params.chainId,rpcUrls:a.params.rpcUrls,blockExplorerUrls:a.params.blockExplorerUrls,chainName:a.params.chainName,iconUrls:a.params.iconUrls,nativeCurrency:a.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(e)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(u,a)}),cancel:l}}switchEthereumChain(e,r){const n={method:Le.Web3Method.switchEthereumChain,params:Object.assign({chainId:e},{address:r})},i=(0,ye.randomBytesHex)(8),s=a=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,n.method,a)};return{promise:new Promise((a,c)=>{this.relayEventManager.callbacks.set(i,f=>{if((0,tt.isErrorResponse)(f)&&f.errorCode)return c(Ur.standardErrors.provider.custom({code:f.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if(f.errorMessage)return c(new Error(f.errorMessage));a(f)});const u=f=>{var h;if(f){const p=(h=(0,Ur.getErrorCode)(f))!==null&&h!==void 0?h:Ur.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(i,Le.Web3Method.switchEthereumChain,f instanceof Error?f:Ur.standardErrors.provider.unsupportedChain(e),p)}else this.handleWeb3ResponseMessage((0,Ge.Web3ResponseMessage)({id:i,response:(0,tt.SwitchEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},l=f=>{this.handleWeb3ResponseMessage((0,Ge.Web3ResponseMessage)({id:i,response:(0,tt.SwitchEthereumChainResponse)({isApproved:!0,rpcUrl:f})}))};this.ui.switchEthereumChain({onCancel:u,onApprove:l,chainId:n.params.chainId,address:n.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(i,n)}),cancel:s}}inlineAddEthereumChain(e){return this.ui.inlineAddEthereumChain(e)}getSessionIdHash(){return Gt.Session.hash(this._session.id)}sendRequestStandalone(e,r){const n=s=>{this.handleErrorResponse(e,r.method,s)},i=s=>{this.handleWeb3ResponseMessage((0,Ge.Web3ResponseMessage)({id:e,response:s}))};switch(r.method){case Le.Web3Method.signEthereumMessage:this.ui.signEthereumMessage({request:r,onSuccess:i,onCancel:n});break;case Le.Web3Method.signEthereumTransaction:this.ui.signEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case Le.Web3Method.submitEthereumTransaction:this.ui.submitEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case Le.Web3Method.ethereumAddressFromSignedMessage:this.ui.ethereumAddressFromSignedMessage({request:r,onSuccess:i});break;default:n();break}}onSessionConfigChanged(e){}}dt.accountRequestCallbackIds=new Set;L0([P0.default],dt.prototype,"resetAndReload",null);L0([P0.default],dt.prototype,"handleIncomingEvent",null);ao.WalletSDKRelay=dt;var yo={};Object.defineProperty(yo,"__esModule",{value:!0});yo.WalletSDKRelayEventManager=void 0;const n6=W;class i6{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,r=(0,n6.prepend0x)(e.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),e}}yo.WalletSDKRelayEventManager=i6;Object.defineProperty(Qn,"__esModule",{value:!0});Qn.CoinbaseWalletSDK=void 0;const s6=bs,o6=gs,a6=ys,c6=tn,u6=Us,l6=ao,f6=yo,h6=W,$0=mn;class vo{constructor(e){var r,n,i;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const s=e.linkAPIUrl||o6.LINK_API_URL;let o;if(e.uiConstructor?o=e.uiConstructor:o=u=>new u6.WalletSDKUI(u),typeof e.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=e.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(r=e.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this._overrideIsCoinbaseBrowser=(n=e.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,e.diagnosticLogger&&e.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");e.eventListener?this._diagnosticLogger={log:e.eventListener.onEvent}:this._diagnosticLogger=e.diagnosticLogger,this._reloadOnDisconnect=(i=e.reloadOnDisconnect)!==null&&i!==void 0?i:!0;const a=new URL(s),c=`${a.protocol}//${a.host}`;this._storage=new a6.ScopedLocalStorage(`-walletlink:${c}`),this._storage.setItem("version",vo.VERSION),!(this.walletExtension||this.coinbaseBrowser)&&(this._relayEventManager=new f6.WalletSDKRelayEventManager,this._relay=new l6.WalletSDKRelay({linkAPIUrl:s,version:$0.LIB_VERSION,darkMode:!!e.darkMode,uiConstructor:o,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect}),this.setAppInfo(e.appName,e.appLogoUrl),!e.headlessMode&&this._relay.attachUI())}makeWeb3Provider(e="",r=1){const n=this.walletExtension;if(n)return this.isCipherProvider(n)||n.setProviderInfo(e,r),this._reloadOnDisconnect===!1&&typeof n.disableReloadOnDisconnect=="function"&&n.disableReloadOnDisconnect(),n;const i=this.coinbaseBrowser;if(i)return i;const s=this._relay;if(!s||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return e||s.setConnectDisabled(!0),new c6.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(s),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:e,chainId:r,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(e,r){var n;this._appName=e||"DApp",this._appLogoUrl=r||(0,h6.getFavicon)();const i=this.walletExtension;i?this.isCipherProvider(i)||i.setAppInfo(this._appName,this._appLogoUrl):(n=this._relay)===null||n===void 0||n.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var e;const r=this.walletExtension;r?r.close():(e=this._relay)===null||e===void 0||e.resetAndReload()}getQrUrl(){var e,r;return(r=(e=this._relay)===null||e===void 0?void 0:e.getQRCodeUrl())!==null&&r!==void 0?r:null}getCoinbaseWalletLogo(e,r=240){return(0,s6.walletLogo)(e,r)}get walletExtension(){var e;return(e=window.coinbaseWalletExtension)!==null&&e!==void 0?e:window.walletLinkExtension}get coinbaseBrowser(){var e,r;try{const n=(e=window.ethereum)!==null&&e!==void 0?e:(r=window.top)===null||r===void 0?void 0:r.ethereum;return n&&"isCoinbaseBrowser"in n&&n.isCoinbaseBrowser?n:void 0}catch{return}}isCipherProvider(e){return typeof e.isCipher=="boolean"&&e.isCipher}}Qn.CoinbaseWalletSDK=vo;vo.VERSION=$0.LIB_VERSION;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletProvider=t.CoinbaseWalletSDK=void 0;const e=Qn,r=tn;var n=Qn;Object.defineProperty(t,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return n.CoinbaseWalletSDK}});var i=tn;Object.defineProperty(t,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return i.CoinbaseWalletProvider}}),t.default=e.CoinbaseWalletSDK,typeof window<"u"&&(window.CoinbaseWalletSDK=e.CoinbaseWalletSDK,window.CoinbaseWalletProvider=r.CoinbaseWalletProvider,window.WalletLink=e.CoinbaseWalletSDK,window.WalletLinkProvider=r.CoinbaseWalletProvider)})(Lc);const d6=j0(Lc),C6=B0({__proto__:null,default:d6},[Lc]);export{C6 as i}; diff --git a/assets/index-e5e7bd9b.js b/assets/index-e5e7bd9b.js deleted file mode 100644 index e3cb380f..00000000 --- a/assets/index-e5e7bd9b.js +++ /dev/null @@ -1 +0,0 @@ -import{ar as le}from"./index-6a2af3e6.js";import{b as ce}from"./index-cc134824.js";const de=Symbol(),X=Object.getPrototypeOf,F=new WeakMap,ue=e=>e&&(F.has(e)?F.get(e):X(e)===Object.prototype||X(e)===Array.prototype),fe=e=>ue(e)&&e[de]||null,Y=(e,t=!0)=>{F.set(e,t)},J=e=>typeof e=="object"&&e!==null,C=new WeakMap,B=new WeakSet,pe=(e=Object.is,t=(o,h)=>new Proxy(o,h),s=o=>J(o)&&!B.has(o)&&(Array.isArray(o)||!(Symbol.iterator in o))&&!(o instanceof WeakMap)&&!(o instanceof WeakSet)&&!(o instanceof Error)&&!(o instanceof Number)&&!(o instanceof Date)&&!(o instanceof String)&&!(o instanceof RegExp)&&!(o instanceof ArrayBuffer),r=o=>{switch(o.status){case"fulfilled":return o.value;case"rejected":throw o.reason;default:throw o}},l=new WeakMap,c=(o,h,I=r)=>{const w=l.get(o);if((w==null?void 0:w[0])===h)return w[1];const b=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o));return Y(b,!0),l.set(o,[h,b]),Reflect.ownKeys(o).forEach(P=>{if(Object.getOwnPropertyDescriptor(b,P))return;const O=Reflect.get(o,P),D={value:O,enumerable:!0,configurable:!0};if(B.has(O))Y(O,!1);else if(O instanceof Promise)delete D.value,D.get=()=>I(O);else if(C.has(O)){const[y,z]=C.get(O);D.value=c(y,z(),I)}Object.defineProperty(b,P,D)}),b},m=new WeakMap,f=[1,1],W=o=>{if(!J(o))throw new Error("object required");const h=m.get(o);if(h)return h;let I=f[0];const w=new Set,b=(i,a=++f[0])=>{I!==a&&(I=a,w.forEach(n=>n(i,a)))};let P=f[1];const O=(i=++f[1])=>(P!==i&&!w.size&&(P=i,y.forEach(([a])=>{const n=a[1](i);n>I&&(I=n)})),I),D=i=>(a,n)=>{const g=[...a];g[1]=[i,...g[1]],b(g,n)},y=new Map,z=(i,a)=>{if(w.size){const n=a[3](D(i));y.set(i,[a,n])}else y.set(i,[a])},Q=i=>{var a;const n=y.get(i);n&&(y.delete(i),(a=n[1])==null||a.call(n))},ae=i=>(w.add(i),w.size===1&&y.forEach(([n,g],R)=>{const k=n[3](D(R));y.set(R,[n,k])}),()=>{w.delete(i),w.size===0&&y.forEach(([n,g],R)=>{g&&(g(),y.set(R,[n]))})}),H=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o)),V=t(H,{deleteProperty(i,a){const n=Reflect.get(i,a);Q(a);const g=Reflect.deleteProperty(i,a);return g&&b(["delete",[a],n]),g},set(i,a,n,g){const R=Reflect.has(i,a),k=Reflect.get(i,a,g);if(R&&(e(k,n)||m.has(n)&&e(k,m.get(n))))return!0;Q(a),J(n)&&(n=fe(n)||n);let $=n;if(n instanceof Promise)n.then(A=>{n.status="fulfilled",n.value=A,b(["resolve",[a],A])}).catch(A=>{n.status="rejected",n.reason=A,b(["reject",[a],A])});else{!C.has(n)&&s(n)&&($=W(n));const A=!B.has($)&&C.get($);A&&z(a,A)}return Reflect.set(i,a,$,g),b(["set",[a],n,k]),!0}});m.set(o,V);const ie=[H,O,c,ae];return C.set(V,ie),Reflect.ownKeys(o).forEach(i=>{const a=Object.getOwnPropertyDescriptor(o,i);"value"in a&&(V[i]=o[i],delete a.value,delete a.writable),Object.defineProperty(H,i,a)}),V})=>[W,C,B,e,t,s,r,l,c,m,f],[me]=pe();function S(e={}){return me(e)}function j(e,t,s){const r=C.get(e);let l;const c=[],m=r[3];let f=!1;const o=m(h=>{if(c.push(h),s){t(c.splice(0));return}l||(l=Promise.resolve().then(()=>{l=void 0,f&&t(c.splice(0))}))});return f=!0,()=>{f=!1,o()}}function ge(e,t){const s=C.get(e),[r,l,c]=s;return c(r,l(),t)}const d=S({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),re={state:d,subscribe(e){return j(d,()=>e(d))},push(e,t){e!==d.view&&(d.view=e,t&&(d.data=t),d.history.push(e))},reset(e){d.view=e,d.history=[e]},replace(e){d.history.length>1&&(d.history[d.history.length-1]=e,d.view=e)},goBack(){if(d.history.length>1){d.history.pop();const[e]=d.history.slice(-1);d.view=e}},setData(e){d.data=e}},p={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return p.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return p.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},formatNativeUrl(e,t,s){if(p.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let r=e;r.includes("://")||(r=e.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,s);const l=encodeURIComponent(t);return`${r}wc?uri=${l}`},formatUniversalUrl(e,t,s){if(!p.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let r=e;r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,s);const l=encodeURIComponent(t);return`${r}wc?uri=${l}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){window.open(e,t,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(p.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(p.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(p.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(p.WCM_VERSION,"2.5.9")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=re.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},he=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),u=S({enabled:he,userSessionId:"",events:[],connectedWalletId:void 0}),we={state:u,subscribe(e){return j(u.events,()=>e(ge(u.events[u.events.length-1])))},initialize(){u.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(u.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){u.connectedWalletId=e},click(e){if(u.enabled){const t={type:"CLICK",name:e.name,userSessionId:u.userSessionId,timestamp:Date.now(),data:e};u.events.push(t)}},track(e){if(u.enabled){const t={type:"TRACK",name:e.name,userSessionId:u.userSessionId,timestamp:Date.now(),data:e};u.events.push(t)}},view(e){if(u.enabled){const t={type:"VIEW",name:e.name,userSessionId:u.userSessionId,timestamp:Date.now(),data:e};u.events.push(t)}}},E=S({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),v={state:E,subscribe(e){return j(E,()=>e(E))},setChains(e){E.chains=e},setWalletConnectUri(e){E.walletConnectUri=e},setIsCustomDesktop(e){E.isCustomDesktop=e},setIsCustomMobile(e){E.isCustomMobile=e},setIsDataLoaded(e){E.isDataLoaded=e},setIsUiLoaded(e){E.isUiLoaded=e},setIsAuth(e){E.isAuth=e}},x=S({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),N={state:x,subscribe(e){return j(x,()=>e(x))},setConfig(e){var t,s;we.initialize(),v.setChains(e.chains),v.setIsAuth(!!e.enableAuthMode),v.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),v.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),p.setModalVersionInStorage(),Object.assign(x,e)}},G="https://explorer-api.walletconnect.com";async function K(e,t){const s=new URL(e,G);return s.searchParams.append("projectId",N.state.projectId),Object.entries(t).forEach(([r,l])=>{l&&s.searchParams.append(r,String(l))}),(await fetch(s)).json()}const M={async getDesktopListings(e){return K("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return K("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return K("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return K("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${G}/w3m/v1/getWalletImage/${e}?projectId=${N.state.projectId}`},getAssetImageUrl(e){return`${G}/w3m/v1/getAssetImage/${e}?projectId=${N.state.projectId}`}};var be=Object.defineProperty,Z=Object.getOwnPropertySymbols,ye=Object.prototype.hasOwnProperty,ve=Object.prototype.propertyIsEnumerable,ee=(e,t,s)=>t in e?be(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Ie=(e,t)=>{for(var s in t||(t={}))ye.call(t,s)&&ee(e,s,t[s]);if(Z)for(var s of Z(t))ve.call(t,s)&&ee(e,s,t[s]);return e};const te=p.isMobile(),L=S({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),Ue={state:L,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=N.state;if(e==="NONE"||t==="ALL"&&!e)return L.recomendedWallets;if(p.isArray(e)){const s={recommendedIds:e.join(",")},{listings:r}=await M.getAllListings(s),l=Object.values(r);l.sort((c,m)=>{const f=e.indexOf(c.id),W=e.indexOf(m.id);return f-W}),L.recomendedWallets=l}else{const{chains:s,isAuth:r}=v.state,l=s==null?void 0:s.join(","),c=p.isArray(t),m={page:1,sdks:r?"auth_v1":void 0,entries:p.RECOMMENDED_WALLET_AMOUNT,chains:l,version:2,excludedIds:c?t.join(","):void 0},{listings:f}=te?await M.getMobileListings(m):await M.getDesktopListings(m);L.recomendedWallets=Object.values(f)}return L.recomendedWallets},async getWallets(e){const t=Ie({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:r}=N.state,{recomendedWallets:l}=L;if(r==="ALL")return L.wallets;l.length?t.excludedIds=l.map(I=>I.id).join(","):p.isArray(s)&&(t.excludedIds=s.join(",")),p.isArray(r)&&(t.excludedIds=[t.excludedIds,r].filter(Boolean).join(",")),v.state.isAuth&&(t.sdks="auth_v1");const{page:c,search:m}=e,{listings:f,total:W}=te?await M.getMobileListings(t):await M.getDesktopListings(t),o=Object.values(f),h=m?"search":"wallets";return L[h]={listings:[...L[h].listings,...o],total:W,page:c??1},{listings:o,total:W}},getWalletImageUrl(e){return M.getWalletImageUrl(e)},getAssetImageUrl(e){return M.getAssetImageUrl(e)},resetSearch(){L.search={listings:[],total:0,page:1}}},_=S({open:!1}),q={state:_,subscribe(e){return j(_,()=>e(_))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:r}=v.state;if(v.setWalletConnectUri(e==null?void 0:e.uri),v.setChains(e==null?void 0:e.chains),re.reset("ConnectWallet"),s&&r)_.open=!0,t();else{const l=setInterval(()=>{const c=v.state;c.isUiLoaded&&c.isDataLoaded&&(clearInterval(l),_.open=!0,t())},200)}})},close(){_.open=!1}};var Ee=Object.defineProperty,se=Object.getOwnPropertySymbols,Le=Object.prototype.hasOwnProperty,Oe=Object.prototype.propertyIsEnumerable,oe=(e,t,s)=>t in e?Ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,We=(e,t)=>{for(var s in t||(t={}))Le.call(t,s)&&oe(e,s,t[s]);if(se)for(var s of se(t))Oe.call(t,s)&&oe(e,s,t[s]);return e};function Ae(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const T=S({themeMode:Ae()?"dark":"light"}),ne={state:T,subscribe(e){return j(T,()=>e(T))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(T.themeMode=t),s&&(T.themeVariables=We({},s))}},U=S({open:!1,message:"",variant:"success"}),je={state:U,subscribe(e){return j(U,()=>e(U))},openToast(e,t){U.open=!0,U.message=e,U.variant=t},closeToast(){U.open=!1}};typeof window<"u"&&(window.Buffer||(window.Buffer=ce.Buffer),window.global||(window.global=window),window.process||(window.process={env:{}}),window.global||(window.global=window));class Ce{constructor(t){this.openModal=q.open,this.closeModal=q.close,this.subscribeModal=q.subscribe,this.setTheme=ne.setThemeConfig,ne.setThemeConfig(t),N.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await le(()=>import("./index-371e0848.js"),["./index-371e0848.js","./index-6a2af3e6.js","./index-f4824932.css","./index-cc134824.js"],import.meta.url);const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),v.setIsUiLoaded(!0)}}}const Pe=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:Ce},Symbol.toStringTag,{value:"Module"}));export{we as $,N as C,Ue as G,re as N,q as Q,ne as X,je as Y,Pe as a,v as c,p as i}; diff --git a/assets/index.es-044e61fa.js b/assets/index.es-044e61fa.js deleted file mode 100644 index 6bde7f9a..00000000 --- a/assets/index.es-044e61fa.js +++ /dev/null @@ -1,27 +0,0 @@ -import{g as im,d as ds,e as ne,f as sm,w as Dl,h as Fl,j as yc,k as fo,l as nm,c as Mr,a as Ll,I as _i,A as om,U as am,m as Q,n as cm,o as oc,p as um,q as hm,P as lm,V as Ah,s as fm,D as pm,C as dm,Z as Ch,$ as gm,u as ym,v as co,x as vm,y as $l,z as Lr,B as mm,E as wm,X as hs,F as Ft,G as tr,H as wi,J as ur,K as _m,L as ls,M as Ml,N as bm,O as Em,Q as Im,R as jl,S as xm,T as zl,Y as Ul,W as fs,a0 as ac,a1 as io,a2 as ps,a3 as Sm,a4 as so,a5 as Pm,a6 as Am,a7 as Cm,a8 as Om,a9 as Rm,aa as Ha,ab as Oh,ac as Tm,ad as Nm,ae as Dm,af as Rh,ag as Fm,ah as Lm,ai as $m,aj as Mm,ak as jm,al as zm,am as Um,an as no,ao as ql,ap as ka,aq as qm,ar as Bm}from"./index-6a2af3e6.js";import{e as Cr,N as vc}from"./events-fe40c1a3.js";const Hm=/"(?:_|\\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*:/,km=/"(?: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*:/,Km=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function Vm(c,r){if(c==="__proto__"||c==="constructor"&&r&&typeof r=="object"&&"prototype"in r){Gm(c);return}return r}function Gm(c){console.warn(`[destr] Dropping "${c}" key to prevent prototype pollution.`)}function Zn(c,r={}){if(typeof c!="string")return c;const i=c.trim();if(c[0]==='"'&&c.at(-1)==='"'&&!c.includes("\\"))return i.slice(1,-1);if(i.length<=9){const n=i.toLowerCase();if(n==="true")return!0;if(n==="false")return!1;if(n==="undefined")return;if(n==="null")return null;if(n==="nan")return Number.NaN;if(n==="infinity")return Number.POSITIVE_INFINITY;if(n==="-infinity")return Number.NEGATIVE_INFINITY}if(!Km.test(c)){if(r.strict)throw new SyntaxError("[destr] Invalid JSON");return c}try{if(Hm.test(c)||km.test(c)){if(r.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(c,Vm)}return JSON.parse(c)}catch(n){if(r.strict)throw n;return c}}function Wm(c){return!c||typeof c.then!="function"?Promise.resolve(c):c}function qt(c,...r){try{return Wm(c(...r))}catch(i){return Promise.reject(i)}}function Jm(c){const r=typeof c;return c===null||r!=="object"&&r!=="function"}function Ym(c){const r=Object.getPrototypeOf(c);return!r||r.isPrototypeOf(Object)}function oo(c){if(Jm(c))return String(c);if(Ym(c)||Array.isArray(c))return JSON.stringify(c);if(typeof c.toJSON=="function")return oo(c.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function Bl(){if(typeof Buffer===void 0)throw new TypeError("[unstorage] Buffer is not supported!")}const cc="base64:";function Xm(c){if(typeof c=="string")return c;Bl();const r=Buffer.from(c).toString("base64");return cc+r}function Zm(c){return typeof c!="string"||!c.startsWith(cc)?c:(Bl(),Buffer.from(c.slice(cc.length),"base64"))}function cr(c){return c?c.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function Qm(...c){return cr(c.join(":"))}function Qn(c){return c=cr(c),c?c+":":""}const e1="memory",t1=()=>{const c=new Map;return{name:e1,options:{},hasItem(r){return c.has(r)},getItem(r){return c.get(r)??null},getItemRaw(r){return c.get(r)??null},setItem(r,i){c.set(r,i)},setItemRaw(r,i){c.set(r,i)},removeItem(r){c.delete(r)},getKeys(){return Array.from(c.keys())},clear(){c.clear()},dispose(){c.clear()}}};function r1(c={}){const r={mounts:{"":c.driver||t1()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},i=m=>{for(const S of r.mountpoints)if(m.startsWith(S))return{base:S,relativeKey:m.slice(S.length),driver:r.mounts[S]};return{base:"",relativeKey:m,driver:r.mounts[""]}},n=(m,S)=>r.mountpoints.filter(O=>O.startsWith(m)||S&&m.startsWith(O)).map(O=>({relativeBase:m.length>O.length?m.slice(O.length):void 0,mountpoint:O,driver:r.mounts[O]})),o=(m,S)=>{if(r.watching){S=cr(S);for(const O of r.watchListeners)O(m,S)}},l=async()=>{if(!r.watching){r.watching=!0;for(const m in r.mounts)r.unwatch[m]=await Th(r.mounts[m],o,m)}},d=async()=>{if(r.watching){for(const m in r.unwatch)await r.unwatch[m]();r.unwatch={},r.watching=!1}},v=(m,S,O)=>{const F=new Map,z=R=>{let K=F.get(R.base);return K||(K={driver:R.driver,base:R.base,items:[]},F.set(R.base,K)),K};for(const R of m){const K=typeof R=="string",re=cr(K?R:R.key),he=K?void 0:R.value,le=K||!R.options?S:{...S,...R.options},fe=i(re);z(fe).items.push({key:re,value:he,relativeKey:fe.relativeKey,options:le})}return Promise.all([...F.values()].map(R=>O(R))).then(R=>R.flat())},b={hasItem(m,S={}){m=cr(m);const{relativeKey:O,driver:F}=i(m);return qt(F.hasItem,O,S)},getItem(m,S={}){m=cr(m);const{relativeKey:O,driver:F}=i(m);return qt(F.getItem,O,S).then(z=>Zn(z))},getItems(m,S){return v(m,S,O=>O.driver.getItems?qt(O.driver.getItems,O.items.map(F=>({key:F.relativeKey,options:F.options})),S).then(F=>F.map(z=>({key:Qm(O.base,z.key),value:Zn(z.value)}))):Promise.all(O.items.map(F=>qt(O.driver.getItem,F.relativeKey,F.options).then(z=>({key:F.key,value:Zn(z)})))))},getItemRaw(m,S={}){m=cr(m);const{relativeKey:O,driver:F}=i(m);return F.getItemRaw?qt(F.getItemRaw,O,S):qt(F.getItem,O,S).then(z=>Zm(z))},async setItem(m,S,O={}){if(S===void 0)return b.removeItem(m);m=cr(m);const{relativeKey:F,driver:z}=i(m);z.setItem&&(await qt(z.setItem,F,oo(S),O),z.watch||o("update",m))},async setItems(m,S){await v(m,S,async O=>{O.driver.setItems&&await qt(O.driver.setItems,O.items.map(F=>({key:F.relativeKey,value:oo(F.value),options:F.options})),S),O.driver.setItem&&await Promise.all(O.items.map(F=>qt(O.driver.setItem,F.relativeKey,oo(F.value),F.options)))})},async setItemRaw(m,S,O={}){if(S===void 0)return b.removeItem(m,O);m=cr(m);const{relativeKey:F,driver:z}=i(m);if(z.setItemRaw)await qt(z.setItemRaw,F,S,O);else if(z.setItem)await qt(z.setItem,F,Xm(S),O);else return;z.watch||o("update",m)},async removeItem(m,S={}){typeof S=="boolean"&&(S={removeMeta:S}),m=cr(m);const{relativeKey:O,driver:F}=i(m);F.removeItem&&(await qt(F.removeItem,O,S),(S.removeMeta||S.removeMata)&&await qt(F.removeItem,O+"$",S),F.watch||o("remove",m))},async getMeta(m,S={}){typeof S=="boolean"&&(S={nativeOnly:S}),m=cr(m);const{relativeKey:O,driver:F}=i(m),z=Object.create(null);if(F.getMeta&&Object.assign(z,await qt(F.getMeta,O,S)),!S.nativeOnly){const R=await qt(F.getItem,O+"$",S).then(K=>Zn(K));R&&typeof R=="object"&&(typeof R.atime=="string"&&(R.atime=new Date(R.atime)),typeof R.mtime=="string"&&(R.mtime=new Date(R.mtime)),Object.assign(z,R))}return z},setMeta(m,S,O={}){return this.setItem(m+"$",S,O)},removeMeta(m,S={}){return this.removeItem(m+"$",S)},async getKeys(m,S={}){m=Qn(m);const O=n(m,!0);let F=[];const z=[];for(const R of O){const re=(await qt(R.driver.getKeys,R.relativeBase,S)).map(he=>R.mountpoint+cr(he)).filter(he=>!F.some(le=>he.startsWith(le)));z.push(...re),F=[R.mountpoint,...F.filter(he=>!he.startsWith(R.mountpoint))]}return m?z.filter(R=>R.startsWith(m)&&!R.endsWith("$")):z.filter(R=>!R.endsWith("$"))},async clear(m,S={}){m=Qn(m),await Promise.all(n(m,!1).map(async O=>{if(O.driver.clear)return qt(O.driver.clear,O.relativeBase,S);if(O.driver.removeItem){const F=await O.driver.getKeys(O.relativeBase||"",S);return Promise.all(F.map(z=>O.driver.removeItem(z,S)))}}))},async dispose(){await Promise.all(Object.values(r.mounts).map(m=>Nh(m)))},async watch(m){return await l(),r.watchListeners.push(m),async()=>{r.watchListeners=r.watchListeners.filter(S=>S!==m),r.watchListeners.length===0&&await d()}},async unwatch(){r.watchListeners=[],await d()},mount(m,S){if(m=Qn(m),m&&r.mounts[m])throw new Error(`already mounted at ${m}`);return m&&(r.mountpoints.push(m),r.mountpoints.sort((O,F)=>F.length-O.length)),r.mounts[m]=S,r.watching&&Promise.resolve(Th(S,o,m)).then(O=>{r.unwatch[m]=O}).catch(console.error),b},async unmount(m,S=!0){m=Qn(m),!(!m||!r.mounts[m])&&(r.watching&&m in r.unwatch&&(r.unwatch[m](),delete r.unwatch[m]),S&&await Nh(r.mounts[m]),r.mountpoints=r.mountpoints.filter(O=>O!==m),delete r.mounts[m])},getMount(m=""){m=cr(m)+":";const S=i(m);return{driver:S.driver,base:S.base}},getMounts(m="",S={}){return m=cr(m),n(m,S.parents).map(F=>({driver:F.driver,base:F.mountpoint}))}};return b}function Th(c,r,i){return c.watch?c.watch((n,o)=>r(n,i+o)):()=>{}}async function Nh(c){typeof c.dispose=="function"&&await qt(c.dispose)}function qi(c){return new Promise((r,i)=>{c.oncomplete=c.onsuccess=()=>r(c.result),c.onabort=c.onerror=()=>i(c.error)})}function Hl(c,r){const i=indexedDB.open(c);i.onupgradeneeded=()=>i.result.createObjectStore(r);const n=qi(i);return(o,l)=>n.then(d=>l(d.transaction(r,o).objectStore(r)))}let Ka;function ks(){return Ka||(Ka=Hl("keyval-store","keyval")),Ka}function Dh(c,r=ks()){return r("readonly",i=>qi(i.get(c)))}function i1(c,r,i=ks()){return i("readwrite",n=>(n.put(r,c),qi(n.transaction)))}function s1(c,r=ks()){return r("readwrite",i=>(i.delete(c),qi(i.transaction)))}function n1(c=ks()){return c("readwrite",r=>(r.clear(),qi(r.transaction)))}function o1(c,r){return c.openCursor().onsuccess=function(){this.result&&(r(this.result),this.result.continue())},qi(c.transaction)}function a1(c=ks()){return c("readonly",r=>{if(r.getAllKeys)return qi(r.getAllKeys());const i=[];return o1(r,n=>i.push(n.key)).then(()=>i)})}const c1=c=>JSON.stringify(c,(r,i)=>typeof i=="bigint"?i.toString()+"n":i),u1=c=>{const r=/([\[:])?(\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,i=c.replace(r,'$1"$2n"$3');return JSON.parse(i,(n,o)=>typeof o=="string"&&o.match(/^\d+n$/)?BigInt(o.substring(0,o.length-1)):o)};function Ks(c){if(typeof c!="string")throw new Error(`Cannot safe json parse value of type ${typeof c}`);try{return u1(c)}catch{return c}}function Ui(c){return typeof c=="string"?c:c1(c)||""}const h1="idb-keyval";var l1=(c={})=>{const r=c.base&&c.base.length>0?`${c.base}:`:"",i=o=>r+o;let n;return c.dbName&&c.storeName&&(n=Hl(c.dbName,c.storeName)),{name:h1,options:c,async hasItem(o){return!(typeof await Dh(i(o),n)>"u")},async getItem(o){return await Dh(i(o),n)??null},setItem(o,l){return i1(i(o),l,n)},removeItem(o){return s1(i(o),n)},getKeys(){return a1(n)},clear(){return n1(n)}}};const f1="WALLET_CONNECT_V2_INDEXED_DB",p1="keyvaluestorage";let d1=class{constructor(){this.indexedDb=r1({driver:l1({dbName:f1,storeName:p1})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(r=>[r.key,r.value])}async getItem(r){const i=await this.indexedDb.getItem(r);if(i!==null)return i}async setItem(r,i){await this.indexedDb.setItem(r,Ui(i))}async removeItem(r){await this.indexedDb.removeItem(r)}};var Va=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ao={exports:{}};(function(){let c;function r(){}c=r,c.prototype.getItem=function(i){return this.hasOwnProperty(i)?String(this[i]):null},c.prototype.setItem=function(i,n){this[i]=String(n)},c.prototype.removeItem=function(i){delete this[i]},c.prototype.clear=function(){const i=this;Object.keys(i).forEach(function(n){i[n]=void 0,delete i[n]})},c.prototype.key=function(i){return i=i||0,Object.keys(this)[i]},c.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof Va<"u"&&Va.localStorage?ao.exports=Va.localStorage:typeof window<"u"&&window.localStorage?ao.exports=window.localStorage:ao.exports=new r})();function g1(c){var r;return[c[0],Ks((r=c[1])!=null?r:"")]}let y1=class{constructor(){this.localStorage=ao.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(g1)}async getItem(r){const i=this.localStorage.getItem(r);if(i!==null)return Ks(i)}async setItem(r,i){this.localStorage.setItem(r,Ui(i))}async removeItem(r){this.localStorage.removeItem(r)}};const v1="wc_storage_version",Fh=1,m1=async(c,r,i)=>{const n=v1,o=await r.getItem(n);if(o&&o>=Fh){i(r);return}const l=await c.getKeys();if(!l.length){i(r);return}const d=[];for(;l.length;){const v=l.shift();if(!v)continue;const b=v.toLowerCase();if(b.includes("wc@")||b.includes("walletconnect")||b.includes("wc_")||b.includes("wallet_connect")){const m=await c.getItem(v);await r.setItem(v,m),d.push(v)}}await r.setItem(n,Fh),i(r),w1(c,d)},w1=async(c,r)=>{r.length&&r.forEach(async i=>{await c.removeItem(i)})};let _1=class{constructor(){this.initialized=!1,this.setInitialized=i=>{this.storage=i,this.initialized=!0};const r=new y1;this.storage=r;try{const i=new d1;m1(r,i,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(r){return await this.initialize(),this.storage.getItem(r)}async setItem(r,i){return await this.initialize(),this.storage.setItem(r,i)}async removeItem(r){return await this.initialize(),this.storage.removeItem(r)}async initialize(){this.initialized||await new Promise(r=>{const i=setInterval(()=>{this.initialized&&(clearInterval(i),r())},20)})}};var gs={},Ls={},Ga={},$s={};let Bi=class{};const b1=Object.freeze(Object.defineProperty({__proto__:null,IEvents:Bi},Symbol.toStringTag,{value:"Module"})),E1=im(b1);var Lh;function I1(){if(Lh)return $s;Lh=1,Object.defineProperty($s,"__esModule",{value:!0}),$s.IHeartBeat=void 0;const c=E1;class r extends c.IEvents{constructor(n){super()}}return $s.IHeartBeat=r,$s}var $h;function kl(){return $h||($h=1,function(c){Object.defineProperty(c,"__esModule",{value:!0}),ds.__exportStar(I1(),c)}(Ga)),Ga}var Wa={},ji={},Mh;function x1(){if(Mh)return ji;Mh=1,Object.defineProperty(ji,"__esModule",{value:!0}),ji.HEARTBEAT_EVENTS=ji.HEARTBEAT_INTERVAL=void 0;const c=ne;return ji.HEARTBEAT_INTERVAL=c.FIVE_SECONDS,ji.HEARTBEAT_EVENTS={pulse:"heartbeat_pulse"},ji}var jh;function Kl(){return jh||(jh=1,function(c){Object.defineProperty(c,"__esModule",{value:!0}),ds.__exportStar(x1(),c)}(Wa)),Wa}var zh;function S1(){if(zh)return Ls;zh=1,Object.defineProperty(Ls,"__esModule",{value:!0}),Ls.HeartBeat=void 0;const c=ds,r=Cr,i=ne,n=kl(),o=Kl();class l extends n.IHeartBeat{constructor(v){super(v),this.events=new r.EventEmitter,this.interval=o.HEARTBEAT_INTERVAL,this.interval=(v==null?void 0:v.interval)||o.HEARTBEAT_INTERVAL}static init(v){return c.__awaiter(this,void 0,void 0,function*(){const b=new l(v);return yield b.init(),b})}init(){return c.__awaiter(this,void 0,void 0,function*(){yield this.initialize()})}stop(){clearInterval(this.intervalRef)}on(v,b){this.events.on(v,b)}once(v,b){this.events.once(v,b)}off(v,b){this.events.off(v,b)}removeListener(v,b){this.events.removeListener(v,b)}initialize(){return c.__awaiter(this,void 0,void 0,function*(){this.intervalRef=setInterval(()=>this.pulse(),i.toMiliseconds(this.interval))})}pulse(){this.events.emit(o.HEARTBEAT_EVENTS.pulse)}}return Ls.HeartBeat=l,Ls}(function(c){Object.defineProperty(c,"__esModule",{value:!0});const r=ds;r.__exportStar(S1(),c),r.__exportStar(kl(),c),r.__exportStar(Kl(),c)})(gs);var Re={},Ja,Uh;function P1(){if(Uh)return Ja;Uh=1;function c(i){try{return JSON.stringify(i)}catch{return'"[Circular]"'}}Ja=r;function r(i,n,o){var l=o&&o.stringify||c,d=1;if(typeof i=="object"&&i!==null){var v=n.length+d;if(v===1)return i;var b=new Array(v);b[0]=l(i);for(var m=1;m-1?z:0,i.charCodeAt(K+1)){case 100:case 102:if(F>=S||n[F]==null)break;z=S||n[F]==null)break;z=S||n[F]===void 0)break;z",z=K+2,K++;break}O+=l(n[F]),z=K+2,K++;break;case 115:if(F>=S)break;z-1&&(ue=!1);const Te=["error","fatal","warn","info","debug","trace"];typeof W=="function"&&(W.error=W.fatal=W.warn=W.info=W.debug=W.trace=W),L.enabled===!1&&(L.level="silent");const Ue=L.level||"info",y=Object.create(W);y.log||(y.log=re),Object.defineProperty(y,"levelVal",{get:X}),Object.defineProperty(y,"level",{get:ce,set:V});const I={transmit:q,serialize:ie,asObject:L.browser.asObject,levels:Te,timestamp:z(L)};y.levels=o.levels,y.level=Ue,y.setMaxListeners=y.getMaxListeners=y.emit=y.addListener=y.on=y.prependListener=y.once=y.prependOnceListener=y.removeListener=y.removeAllListeners=y.listeners=y.listenerCount=y.eventNames=y.write=y.flush=re,y.serializers=ve,y._serialize=ie,y._stdErrSerialize=ue,y.child=B,q&&(y._logEvent=O());function X(){return this.level==="silent"?1/0:this.levels.values[this.level]}function ce(){return this._level}function V(k){if(k!=="silent"&&!this.levels.values[k])throw Error("unknown level "+k);this._level=k,l(I,y,"error","log"),l(I,y,"fatal","error"),l(I,y,"warn","error"),l(I,y,"info","log"),l(I,y,"debug","log"),l(I,y,"trace","log")}function B(k,G){if(!k)throw new Error("missing bindings for child Pino");G=G||{},ie&&k.serializers&&(G.serializers=k.serializers);const Je=G.serializers;if(ie&&Je){var He=Object.assign({},ve,Je),jr=L.browser.serialize===!0?Object.keys(He):ie;delete k.serializers,b([k],jr,He,this._stdErrSerialize)}function Ie(xt){this._childLevel=(xt._childLevel|0)+1,this.error=m(xt,k,"error"),this.fatal=m(xt,k,"fatal"),this.warn=m(xt,k,"warn"),this.info=m(xt,k,"info"),this.debug=m(xt,k,"debug"),this.trace=m(xt,k,"trace"),He&&(this.serializers=He,this._serialize=jr),q&&(this._logEvent=O([].concat(xt._logEvent.bindings,k)))}return Ie.prototype=this,new Ie(this)}return y}o.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"}},o.stdSerializers=i,o.stdTimeFunctions=Object.assign({},{nullTime:he,epochTime:le,unixTime:fe,isoTime:pe});function l(L,q,W,ve){const ie=Object.getPrototypeOf(q);q[W]=q.levelVal>q.levels.values[W]?re:ie[W]?ie[W]:r[W]||r[ve]||re,d(L,q,W)}function d(L,q,W){!L.transmit&&q[W]===re||(q[W]=function(ve){return function(){const ue=L.timestamp(),Te=new Array(arguments.length),Ue=Object.getPrototypeOf&&Object.getPrototypeOf(this)===r?r:this;for(var y=0;y-1&&ue in W&&(L[ie][ue]=W[ue](L[ie][ue]))}function m(L,q,W){return function(){const ve=new Array(1+arguments.length);ve[0]=q;for(var ie=1;ie"u"?m=i(v,b):m=v.bindings().context||"",m}er.getLoggerContext=o;function l(v,b,m=c.PINO_CUSTOM_CONTEXT_KEY){const S=o(v,m);return S.trim()?`${S}/${b}`:b}er.formatChildLoggerContext=l;function d(v,b,m=c.PINO_CUSTOM_CONTEXT_KEY){const S=l(v,b,m),O=v.child({context:S});return n(O,S,m)}return er.generateChildLogger=d,er}(function(c){Object.defineProperty(c,"__esModule",{value:!0}),c.pino=void 0;const r=ds,i=r.__importDefault(A1());Object.defineProperty(c,"pino",{enumerable:!0,get:function(){return i.default}}),r.__exportStar(Vl(),c),r.__exportStar(C1(),c)})(Re);class O1 extends Bi{constructor(r){super(),this.opts=r,this.protocol="wc",this.version=2}}class R1 extends Bi{constructor(r,i){super(),this.core=r,this.logger=i,this.records=new Map}}class T1{constructor(r,i){this.logger=r,this.core=i}}let N1=class extends Bi{constructor(r,i){super(),this.relayer=r,this.logger=i}},D1=class extends Bi{constructor(r){super()}},F1=class{constructor(r,i,n,o){this.core=r,this.logger=i,this.name=n}};class L1 extends Bi{constructor(r,i){super(),this.relayer=r,this.logger=i}}let $1=class extends Bi{constructor(r,i){super(),this.core=r,this.logger=i}},M1=class{constructor(r,i){this.projectId=r,this.logger=i}},j1=class{constructor(r){this.opts=r,this.protocol="wc",this.version=2}},z1=class{constructor(r){this.client=r}};var mc={},Gl={};(function(c){Object.defineProperty(c,"__esModule",{value:!0});var r=sm,i=Dl;c.DIGEST_LENGTH=64,c.BLOCK_SIZE=128;var n=function(){function v(){this.digestLength=c.DIGEST_LENGTH,this.blockSize=c.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return v.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},v.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},v.prototype.clean=function(){i.wipe(this._buffer),i.wipe(this._tempHi),i.wipe(this._tempLo),this.reset()},v.prototype.update=function(b,m){if(m===void 0&&(m=b.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var S=0;if(this._bytesHashed+=m,this._bufferLength>0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=b[S++],m--;this._bufferLength===this.blockSize&&(l(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(m>=this.blockSize&&(S=l(this._tempHi,this._tempLo,this._stateHi,this._stateLo,b,S,m),m%=this.blockSize);m>0;)this._buffer[this._bufferLength++]=b[S++],m--;return this},v.prototype.finish=function(b){if(!this._finished){var m=this._bytesHashed,S=this._bufferLength,O=m/536870912|0,F=m<<3,z=m%128<112?128:256;this._buffer[S]=128;for(var R=S+1;R0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},v.prototype.restoreState=function(b){return this._stateHi.set(b.stateHi),this._stateLo.set(b.stateLo),this._bufferLength=b.bufferLength,b.buffer&&this._buffer.set(b.buffer),this._bytesHashed=b.bytesHashed,this._finished=!1,this},v.prototype.cleanSavedState=function(b){i.wipe(b.stateHi),i.wipe(b.stateLo),b.buffer&&i.wipe(b.buffer),b.bufferLength=0,b.bytesHashed=0},v}();c.SHA512=n;var o=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function l(v,b,m,S,O,F,z){for(var R=m[0],K=m[1],re=m[2],he=m[3],le=m[4],fe=m[5],pe=m[6],de=m[7],L=S[0],q=S[1],W=S[2],ve=S[3],ie=S[4],ue=S[5],Te=S[6],Ue=S[7],y,I,X,ce,V,B,k,G;z>=128;){for(var Je=0;Je<16;Je++){var He=8*Je+F;v[Je]=r.readUint32BE(O,He),b[Je]=r.readUint32BE(O,He+4)}for(var Je=0;Je<80;Je++){var jr=R,Ie=K,xt=re,D=he,N=le,C=fe,u=pe,E=de,ee=L,ge=q,be=W,Ne=ve,Fe=ie,Pe=ue,St=Te,mt=Ue;if(y=de,I=Ue,V=I&65535,B=I>>>16,k=y&65535,G=y>>>16,y=(le>>>14|ie<<32-14)^(le>>>18|ie<<32-18)^(ie>>>41-32|le<<32-(41-32)),I=(ie>>>14|le<<32-14)^(ie>>>18|le<<32-18)^(le>>>41-32|ie<<32-(41-32)),V+=I&65535,B+=I>>>16,k+=y&65535,G+=y>>>16,y=le&fe^~le&pe,I=ie&ue^~ie&Te,V+=I&65535,B+=I>>>16,k+=y&65535,G+=y>>>16,y=o[Je*2],I=o[Je*2+1],V+=I&65535,B+=I>>>16,k+=y&65535,G+=y>>>16,y=v[Je%16],I=b[Je%16],V+=I&65535,B+=I>>>16,k+=y&65535,G+=y>>>16,B+=V>>>16,k+=B>>>16,G+=k>>>16,X=k&65535|G<<16,ce=V&65535|B<<16,y=X,I=ce,V=I&65535,B=I>>>16,k=y&65535,G=y>>>16,y=(R>>>28|L<<32-28)^(L>>>34-32|R<<32-(34-32))^(L>>>39-32|R<<32-(39-32)),I=(L>>>28|R<<32-28)^(R>>>34-32|L<<32-(34-32))^(R>>>39-32|L<<32-(39-32)),V+=I&65535,B+=I>>>16,k+=y&65535,G+=y>>>16,y=R&K^R&re^K&re,I=L&q^L&W^q&W,V+=I&65535,B+=I>>>16,k+=y&65535,G+=y>>>16,B+=V>>>16,k+=B>>>16,G+=k>>>16,E=k&65535|G<<16,mt=V&65535|B<<16,y=D,I=Ne,V=I&65535,B=I>>>16,k=y&65535,G=y>>>16,y=X,I=ce,V+=I&65535,B+=I>>>16,k+=y&65535,G+=y>>>16,B+=V>>>16,k+=B>>>16,G+=k>>>16,D=k&65535|G<<16,Ne=V&65535|B<<16,K=jr,re=Ie,he=xt,le=D,fe=N,pe=C,de=u,R=E,q=ee,W=ge,ve=be,ie=Ne,ue=Fe,Te=Pe,Ue=St,L=mt,Je%16===15)for(var He=0;He<16;He++)y=v[He],I=b[He],V=I&65535,B=I>>>16,k=y&65535,G=y>>>16,y=v[(He+9)%16],I=b[(He+9)%16],V+=I&65535,B+=I>>>16,k+=y&65535,G+=y>>>16,X=v[(He+1)%16],ce=b[(He+1)%16],y=(X>>>1|ce<<32-1)^(X>>>8|ce<<32-8)^X>>>7,I=(ce>>>1|X<<32-1)^(ce>>>8|X<<32-8)^(ce>>>7|X<<32-7),V+=I&65535,B+=I>>>16,k+=y&65535,G+=y>>>16,X=v[(He+14)%16],ce=b[(He+14)%16],y=(X>>>19|ce<<32-19)^(ce>>>61-32|X<<32-(61-32))^X>>>6,I=(ce>>>19|X<<32-19)^(X>>>61-32|ce<<32-(61-32))^(ce>>>6|X<<32-6),V+=I&65535,B+=I>>>16,k+=y&65535,G+=y>>>16,B+=V>>>16,k+=B>>>16,G+=k>>>16,v[He]=k&65535|G<<16,b[He]=V&65535|B<<16}y=R,I=L,V=I&65535,B=I>>>16,k=y&65535,G=y>>>16,y=m[0],I=S[0],V+=I&65535,B+=I>>>16,k+=y&65535,G+=y>>>16,B+=V>>>16,k+=B>>>16,G+=k>>>16,m[0]=R=k&65535|G<<16,S[0]=L=V&65535|B<<16,y=K,I=q,V=I&65535,B=I>>>16,k=y&65535,G=y>>>16,y=m[1],I=S[1],V+=I&65535,B+=I>>>16,k+=y&65535,G+=y>>>16,B+=V>>>16,k+=B>>>16,G+=k>>>16,m[1]=K=k&65535|G<<16,S[1]=q=V&65535|B<<16,y=re,I=W,V=I&65535,B=I>>>16,k=y&65535,G=y>>>16,y=m[2],I=S[2],V+=I&65535,B+=I>>>16,k+=y&65535,G+=y>>>16,B+=V>>>16,k+=B>>>16,G+=k>>>16,m[2]=re=k&65535|G<<16,S[2]=W=V&65535|B<<16,y=he,I=ve,V=I&65535,B=I>>>16,k=y&65535,G=y>>>16,y=m[3],I=S[3],V+=I&65535,B+=I>>>16,k+=y&65535,G+=y>>>16,B+=V>>>16,k+=B>>>16,G+=k>>>16,m[3]=he=k&65535|G<<16,S[3]=ve=V&65535|B<<16,y=le,I=ie,V=I&65535,B=I>>>16,k=y&65535,G=y>>>16,y=m[4],I=S[4],V+=I&65535,B+=I>>>16,k+=y&65535,G+=y>>>16,B+=V>>>16,k+=B>>>16,G+=k>>>16,m[4]=le=k&65535|G<<16,S[4]=ie=V&65535|B<<16,y=fe,I=ue,V=I&65535,B=I>>>16,k=y&65535,G=y>>>16,y=m[5],I=S[5],V+=I&65535,B+=I>>>16,k+=y&65535,G+=y>>>16,B+=V>>>16,k+=B>>>16,G+=k>>>16,m[5]=fe=k&65535|G<<16,S[5]=ue=V&65535|B<<16,y=pe,I=Te,V=I&65535,B=I>>>16,k=y&65535,G=y>>>16,y=m[6],I=S[6],V+=I&65535,B+=I>>>16,k+=y&65535,G+=y>>>16,B+=V>>>16,k+=B>>>16,G+=k>>>16,m[6]=pe=k&65535|G<<16,S[6]=Te=V&65535|B<<16,y=de,I=Ue,V=I&65535,B=I>>>16,k=y&65535,G=y>>>16,y=m[7],I=S[7],V+=I&65535,B+=I>>>16,k+=y&65535,G+=y>>>16,B+=V>>>16,k+=B>>>16,G+=k>>>16,m[7]=de=k&65535|G<<16,S[7]=Ue=V&65535|B<<16,F+=128,z-=128}return F}function d(v){var b=new n;b.update(v);var m=b.digest();return b.clean(),m}c.hash=d})(Gl);(function(c){Object.defineProperty(c,"__esModule",{value:!0}),c.convertSecretKeyToX25519=c.convertPublicKeyToX25519=c.verify=c.sign=c.extractPublicKeyFromSecretKey=c.generateKeyPair=c.generateKeyPairFromSeed=c.SEED_LENGTH=c.SECRET_KEY_LENGTH=c.PUBLIC_KEY_LENGTH=c.SIGNATURE_LENGTH=void 0;const r=Fl,i=Gl,n=Dl;c.SIGNATURE_LENGTH=64,c.PUBLIC_KEY_LENGTH=32,c.SECRET_KEY_LENGTH=64,c.SEED_LENGTH=32;function o(D){const N=new Float64Array(16);if(D)for(let C=0;C>16&1),C[ge-1]&=65535;C[15]=u[15]-32767-(C[14]>>16&1);const ee=C[15]>>16&1;C[14]&=65535,K(u,C,1-ee)}for(let E=0;E<16;E++)D[2*E]=u[E]&255,D[2*E+1]=u[E]>>8}function he(D,N){let C=0;for(let u=0;u<32;u++)C|=D[u]^N[u];return(1&C-1>>>8)-1}function le(D,N){const C=new Uint8Array(32),u=new Uint8Array(32);return re(C,D),re(u,N),he(C,u)}function fe(D){const N=new Uint8Array(32);return re(N,D),N[0]&1}function pe(D,N){for(let C=0;C<16;C++)D[C]=N[2*C]+(N[2*C+1]<<8);D[15]&=32767}function de(D,N,C){for(let u=0;u<16;u++)D[u]=N[u]+C[u]}function L(D,N,C){for(let u=0;u<16;u++)D[u]=N[u]-C[u]}function q(D,N,C){let u,E,ee=0,ge=0,be=0,Ne=0,Fe=0,Pe=0,St=0,mt=0,nt=0,$e=0,Xe=0,Ze=0,ot=0,qe=0,Qe=0,De=0,ke=0,ut=0,je=0,Pt=0,Lt=0,Bt=0,Ht=0,jt=0,Wt=0,rr=0,zr=0,Jt=0,Gr=0,ci=0,xi=0,ht=C[0],rt=C[1],lt=C[2],ft=C[3],at=C[4],it=C[5],At=C[6],Ct=C[7],pt=C[8],Ot=C[9],dt=C[10],wt=C[11],gt=C[12],Ye=C[13],Rt=C[14],Tt=C[15];u=N[0],ee+=u*ht,ge+=u*rt,be+=u*lt,Ne+=u*ft,Fe+=u*at,Pe+=u*it,St+=u*At,mt+=u*Ct,nt+=u*pt,$e+=u*Ot,Xe+=u*dt,Ze+=u*wt,ot+=u*gt,qe+=u*Ye,Qe+=u*Rt,De+=u*Tt,u=N[1],ge+=u*ht,be+=u*rt,Ne+=u*lt,Fe+=u*ft,Pe+=u*at,St+=u*it,mt+=u*At,nt+=u*Ct,$e+=u*pt,Xe+=u*Ot,Ze+=u*dt,ot+=u*wt,qe+=u*gt,Qe+=u*Ye,De+=u*Rt,ke+=u*Tt,u=N[2],be+=u*ht,Ne+=u*rt,Fe+=u*lt,Pe+=u*ft,St+=u*at,mt+=u*it,nt+=u*At,$e+=u*Ct,Xe+=u*pt,Ze+=u*Ot,ot+=u*dt,qe+=u*wt,Qe+=u*gt,De+=u*Ye,ke+=u*Rt,ut+=u*Tt,u=N[3],Ne+=u*ht,Fe+=u*rt,Pe+=u*lt,St+=u*ft,mt+=u*at,nt+=u*it,$e+=u*At,Xe+=u*Ct,Ze+=u*pt,ot+=u*Ot,qe+=u*dt,Qe+=u*wt,De+=u*gt,ke+=u*Ye,ut+=u*Rt,je+=u*Tt,u=N[4],Fe+=u*ht,Pe+=u*rt,St+=u*lt,mt+=u*ft,nt+=u*at,$e+=u*it,Xe+=u*At,Ze+=u*Ct,ot+=u*pt,qe+=u*Ot,Qe+=u*dt,De+=u*wt,ke+=u*gt,ut+=u*Ye,je+=u*Rt,Pt+=u*Tt,u=N[5],Pe+=u*ht,St+=u*rt,mt+=u*lt,nt+=u*ft,$e+=u*at,Xe+=u*it,Ze+=u*At,ot+=u*Ct,qe+=u*pt,Qe+=u*Ot,De+=u*dt,ke+=u*wt,ut+=u*gt,je+=u*Ye,Pt+=u*Rt,Lt+=u*Tt,u=N[6],St+=u*ht,mt+=u*rt,nt+=u*lt,$e+=u*ft,Xe+=u*at,Ze+=u*it,ot+=u*At,qe+=u*Ct,Qe+=u*pt,De+=u*Ot,ke+=u*dt,ut+=u*wt,je+=u*gt,Pt+=u*Ye,Lt+=u*Rt,Bt+=u*Tt,u=N[7],mt+=u*ht,nt+=u*rt,$e+=u*lt,Xe+=u*ft,Ze+=u*at,ot+=u*it,qe+=u*At,Qe+=u*Ct,De+=u*pt,ke+=u*Ot,ut+=u*dt,je+=u*wt,Pt+=u*gt,Lt+=u*Ye,Bt+=u*Rt,Ht+=u*Tt,u=N[8],nt+=u*ht,$e+=u*rt,Xe+=u*lt,Ze+=u*ft,ot+=u*at,qe+=u*it,Qe+=u*At,De+=u*Ct,ke+=u*pt,ut+=u*Ot,je+=u*dt,Pt+=u*wt,Lt+=u*gt,Bt+=u*Ye,Ht+=u*Rt,jt+=u*Tt,u=N[9],$e+=u*ht,Xe+=u*rt,Ze+=u*lt,ot+=u*ft,qe+=u*at,Qe+=u*it,De+=u*At,ke+=u*Ct,ut+=u*pt,je+=u*Ot,Pt+=u*dt,Lt+=u*wt,Bt+=u*gt,Ht+=u*Ye,jt+=u*Rt,Wt+=u*Tt,u=N[10],Xe+=u*ht,Ze+=u*rt,ot+=u*lt,qe+=u*ft,Qe+=u*at,De+=u*it,ke+=u*At,ut+=u*Ct,je+=u*pt,Pt+=u*Ot,Lt+=u*dt,Bt+=u*wt,Ht+=u*gt,jt+=u*Ye,Wt+=u*Rt,rr+=u*Tt,u=N[11],Ze+=u*ht,ot+=u*rt,qe+=u*lt,Qe+=u*ft,De+=u*at,ke+=u*it,ut+=u*At,je+=u*Ct,Pt+=u*pt,Lt+=u*Ot,Bt+=u*dt,Ht+=u*wt,jt+=u*gt,Wt+=u*Ye,rr+=u*Rt,zr+=u*Tt,u=N[12],ot+=u*ht,qe+=u*rt,Qe+=u*lt,De+=u*ft,ke+=u*at,ut+=u*it,je+=u*At,Pt+=u*Ct,Lt+=u*pt,Bt+=u*Ot,Ht+=u*dt,jt+=u*wt,Wt+=u*gt,rr+=u*Ye,zr+=u*Rt,Jt+=u*Tt,u=N[13],qe+=u*ht,Qe+=u*rt,De+=u*lt,ke+=u*ft,ut+=u*at,je+=u*it,Pt+=u*At,Lt+=u*Ct,Bt+=u*pt,Ht+=u*Ot,jt+=u*dt,Wt+=u*wt,rr+=u*gt,zr+=u*Ye,Jt+=u*Rt,Gr+=u*Tt,u=N[14],Qe+=u*ht,De+=u*rt,ke+=u*lt,ut+=u*ft,je+=u*at,Pt+=u*it,Lt+=u*At,Bt+=u*Ct,Ht+=u*pt,jt+=u*Ot,Wt+=u*dt,rr+=u*wt,zr+=u*gt,Jt+=u*Ye,Gr+=u*Rt,ci+=u*Tt,u=N[15],De+=u*ht,ke+=u*rt,ut+=u*lt,je+=u*ft,Pt+=u*at,Lt+=u*it,Bt+=u*At,Ht+=u*Ct,jt+=u*pt,Wt+=u*Ot,rr+=u*dt,zr+=u*wt,Jt+=u*gt,Gr+=u*Ye,ci+=u*Rt,xi+=u*Tt,ee+=38*ke,ge+=38*ut,be+=38*je,Ne+=38*Pt,Fe+=38*Lt,Pe+=38*Bt,St+=38*Ht,mt+=38*jt,nt+=38*Wt,$e+=38*rr,Xe+=38*zr,Ze+=38*Jt,ot+=38*Gr,qe+=38*ci,Qe+=38*xi,E=1,u=ee+E+65535,E=Math.floor(u/65536),ee=u-E*65536,u=ge+E+65535,E=Math.floor(u/65536),ge=u-E*65536,u=be+E+65535,E=Math.floor(u/65536),be=u-E*65536,u=Ne+E+65535,E=Math.floor(u/65536),Ne=u-E*65536,u=Fe+E+65535,E=Math.floor(u/65536),Fe=u-E*65536,u=Pe+E+65535,E=Math.floor(u/65536),Pe=u-E*65536,u=St+E+65535,E=Math.floor(u/65536),St=u-E*65536,u=mt+E+65535,E=Math.floor(u/65536),mt=u-E*65536,u=nt+E+65535,E=Math.floor(u/65536),nt=u-E*65536,u=$e+E+65535,E=Math.floor(u/65536),$e=u-E*65536,u=Xe+E+65535,E=Math.floor(u/65536),Xe=u-E*65536,u=Ze+E+65535,E=Math.floor(u/65536),Ze=u-E*65536,u=ot+E+65535,E=Math.floor(u/65536),ot=u-E*65536,u=qe+E+65535,E=Math.floor(u/65536),qe=u-E*65536,u=Qe+E+65535,E=Math.floor(u/65536),Qe=u-E*65536,u=De+E+65535,E=Math.floor(u/65536),De=u-E*65536,ee+=E-1+37*(E-1),E=1,u=ee+E+65535,E=Math.floor(u/65536),ee=u-E*65536,u=ge+E+65535,E=Math.floor(u/65536),ge=u-E*65536,u=be+E+65535,E=Math.floor(u/65536),be=u-E*65536,u=Ne+E+65535,E=Math.floor(u/65536),Ne=u-E*65536,u=Fe+E+65535,E=Math.floor(u/65536),Fe=u-E*65536,u=Pe+E+65535,E=Math.floor(u/65536),Pe=u-E*65536,u=St+E+65535,E=Math.floor(u/65536),St=u-E*65536,u=mt+E+65535,E=Math.floor(u/65536),mt=u-E*65536,u=nt+E+65535,E=Math.floor(u/65536),nt=u-E*65536,u=$e+E+65535,E=Math.floor(u/65536),$e=u-E*65536,u=Xe+E+65535,E=Math.floor(u/65536),Xe=u-E*65536,u=Ze+E+65535,E=Math.floor(u/65536),Ze=u-E*65536,u=ot+E+65535,E=Math.floor(u/65536),ot=u-E*65536,u=qe+E+65535,E=Math.floor(u/65536),qe=u-E*65536,u=Qe+E+65535,E=Math.floor(u/65536),Qe=u-E*65536,u=De+E+65535,E=Math.floor(u/65536),De=u-E*65536,ee+=E-1+37*(E-1),D[0]=ee,D[1]=ge,D[2]=be,D[3]=Ne,D[4]=Fe,D[5]=Pe,D[6]=St,D[7]=mt,D[8]=nt,D[9]=$e,D[10]=Xe,D[11]=Ze,D[12]=ot,D[13]=qe,D[14]=Qe,D[15]=De}function W(D,N){q(D,N,N)}function ve(D,N){const C=o();let u;for(u=0;u<16;u++)C[u]=N[u];for(u=253;u>=0;u--)W(C,C),u!==2&&u!==4&&q(C,C,N);for(u=0;u<16;u++)D[u]=C[u]}function ie(D,N){const C=o();let u;for(u=0;u<16;u++)C[u]=N[u];for(u=250;u>=0;u--)W(C,C),u!==1&&q(C,C,N);for(u=0;u<16;u++)D[u]=C[u]}function ue(D,N){const C=o(),u=o(),E=o(),ee=o(),ge=o(),be=o(),Ne=o(),Fe=o(),Pe=o();L(C,D[1],D[0]),L(Pe,N[1],N[0]),q(C,C,Pe),de(u,D[0],D[1]),de(Pe,N[0],N[1]),q(u,u,Pe),q(E,D[3],N[3]),q(E,E,m),q(ee,D[2],N[2]),de(ee,ee,ee),L(ge,u,C),L(be,ee,E),de(Ne,ee,E),de(Fe,u,C),q(D[0],ge,be),q(D[1],Fe,Ne),q(D[2],Ne,be),q(D[3],ge,Fe)}function Te(D,N,C){for(let u=0;u<4;u++)K(D[u],N[u],C)}function Ue(D,N){const C=o(),u=o(),E=o();ve(E,N[2]),q(C,N[0],E),q(u,N[1],E),re(D,u),D[31]^=fe(C)<<7}function y(D,N,C){z(D[0],d),z(D[1],v),z(D[2],v),z(D[3],d);for(let u=255;u>=0;--u){const E=C[u/8|0]>>(u&7)&1;Te(D,N,E),ue(N,D),ue(D,D),Te(D,N,E)}}function I(D,N){const C=[o(),o(),o(),o()];z(C[0],S),z(C[1],O),z(C[2],v),q(C[3],S,O),y(D,C,N)}function X(D){if(D.length!==c.SEED_LENGTH)throw new Error(`ed25519: seed must be ${c.SEED_LENGTH} bytes`);const N=(0,i.hash)(D);N[0]&=248,N[31]&=127,N[31]|=64;const C=new Uint8Array(32),u=[o(),o(),o(),o()];I(u,N),Ue(C,u);const E=new Uint8Array(64);return E.set(D),E.set(C,32),{publicKey:C,secretKey:E}}c.generateKeyPairFromSeed=X;function ce(D){const N=(0,r.randomBytes)(32,D),C=X(N);return(0,n.wipe)(N),C}c.generateKeyPair=ce;function V(D){if(D.length!==c.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${c.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(D.subarray(32))}c.extractPublicKeyFromSecretKey=V;const B=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function k(D,N){let C,u,E,ee;for(u=63;u>=32;--u){for(C=0,E=u-32,ee=u-12;E>4)*B[E],C=N[E]>>8,N[E]&=255;for(E=0;E<32;E++)N[E]-=C*B[E];for(u=0;u<32;u++)N[u+1]+=N[u]>>8,D[u]=N[u]&255}function G(D){const N=new Float64Array(64);for(let C=0;C<64;C++)N[C]=D[C];for(let C=0;C<64;C++)D[C]=0;k(D,N)}function Je(D,N){const C=new Float64Array(64),u=[o(),o(),o(),o()],E=(0,i.hash)(D.subarray(0,32));E[0]&=248,E[31]&=127,E[31]|=64;const ee=new Uint8Array(64);ee.set(E.subarray(32),32);const ge=new i.SHA512;ge.update(ee.subarray(32)),ge.update(N);const be=ge.digest();ge.clean(),G(be),I(u,be),Ue(ee,u),ge.reset(),ge.update(ee.subarray(0,32)),ge.update(D.subarray(32)),ge.update(N);const Ne=ge.digest();G(Ne);for(let Fe=0;Fe<32;Fe++)C[Fe]=be[Fe];for(let Fe=0;Fe<32;Fe++)for(let Pe=0;Pe<32;Pe++)C[Fe+Pe]+=Ne[Fe]*E[Pe];return k(ee.subarray(32),C),ee}c.sign=Je;function He(D,N){const C=o(),u=o(),E=o(),ee=o(),ge=o(),be=o(),Ne=o();return z(D[2],v),pe(D[1],N),W(E,D[1]),q(ee,E,b),L(E,E,D[2]),de(ee,D[2],ee),W(ge,ee),W(be,ge),q(Ne,be,ge),q(C,Ne,E),q(C,C,ee),ie(C,C),q(C,C,E),q(C,C,ee),q(C,C,ee),q(D[0],C,ee),W(u,D[0]),q(u,u,ee),le(u,E)&&q(D[0],D[0],F),W(u,D[0]),q(u,u,ee),le(u,E)?-1:(fe(D[0])===N[31]>>7&&L(D[0],d,D[0]),q(D[3],D[0],D[1]),0)}function jr(D,N,C){const u=new Uint8Array(32),E=[o(),o(),o(),o()],ee=[o(),o(),o(),o()];if(C.length!==c.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${c.SIGNATURE_LENGTH} bytes`);if(He(ee,D))return!1;const ge=new i.SHA512;ge.update(C.subarray(0,32)),ge.update(D),ge.update(N);const be=ge.digest();return G(be),y(E,ee,be),I(ee,C.subarray(32)),ue(E,ee),Ue(u,E),!he(C,u)}c.verify=jr;function Ie(D){let N=[o(),o(),o(),o()];if(He(N,D))throw new Error("Ed25519: invalid public key");let C=o(),u=o(),E=N[1];de(C,v,E),L(u,v,E),ve(u,u),q(C,C,u);let ee=new Uint8Array(32);return re(ee,C),ee}c.convertPublicKeyToX25519=Ie;function xt(D){const N=(0,i.hash)(D.subarray(0,32));N[0]&=248,N[31]&=127,N[31]|=64;const C=new Uint8Array(N.subarray(0,32));return(0,n.wipe)(N),C}c.convertSecretKeyToX25519=xt})(mc);const U1="EdDSA",q1="JWT",Wl=".",Jl="base64url",B1="utf8",H1="utf8",k1=":",K1="did",V1="key",kh="base58btc",G1="z",W1="K36",J1=32;function uo(c){return fo(yc(Ui(c),B1),Jl)}function Yl(c){const r=yc(W1,kh),i=G1+fo(nm([r,c]),kh);return[K1,V1,i].join(k1)}function Y1(c){return fo(c,Jl)}function X1(c){return yc([uo(c.header),uo(c.payload)].join(Wl),H1)}function Z1(c){return[uo(c.header),uo(c.payload),Y1(c.signature)].join(Wl)}function Kh(c=Fl.randomBytes(J1)){return mc.generateKeyPairFromSeed(c)}async function Q1(c,r,i,n,o=ne.fromMiliseconds(Date.now())){const l={alg:U1,typ:q1},d=Yl(n.publicKey),v=o+i,b={iss:d,sub:c,aud:r,iat:o,exp:v},m=X1({header:l,payload:b}),S=mc.sign(n.secretKey,m);return Z1({header:l,payload:b,signature:S})}const ew="PARSE_ERROR",tw="INVALID_REQUEST",rw="METHOD_NOT_FOUND",iw="INVALID_PARAMS",Xl="INTERNAL_ERROR",wc="SERVER_ERROR",sw=[-32700,-32600,-32601,-32602,-32603],Hs={[ew]:{code:-32700,message:"Parse error"},[tw]:{code:-32600,message:"Invalid Request"},[rw]:{code:-32601,message:"Method not found"},[iw]:{code:-32602,message:"Invalid params"},[Xl]:{code:-32603,message:"Internal error"},[wc]:{code:-32e3,message:"Server error"}},Zl=wc;function nw(c){return sw.includes(c)}function Vh(c){return Object.keys(Hs).includes(c)?Hs[c]:Hs[Zl]}function ow(c){const r=Object.values(Hs).find(i=>i.code===c);return r||Hs[Zl]}function Ql(c,r,i){return c.message.includes("getaddrinfo ENOTFOUND")||c.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${i} RPC url at ${r}`):c}var ef={},ni={},Gh;function aw(){if(Gh)return ni;Gh=1,Object.defineProperty(ni,"__esModule",{value:!0}),ni.isBrowserCryptoAvailable=ni.getSubtleCrypto=ni.getBrowerCrypto=void 0;function c(){return(Mr===null||Mr===void 0?void 0:Mr.crypto)||(Mr===null||Mr===void 0?void 0:Mr.msCrypto)||{}}ni.getBrowerCrypto=c;function r(){const n=c();return n.subtle||n.webkitSubtle}ni.getSubtleCrypto=r;function i(){return!!c()&&!!r()}return ni.isBrowserCryptoAvailable=i,ni}var oi={},Wh;function cw(){if(Wh)return oi;Wh=1,Object.defineProperty(oi,"__esModule",{value:!0}),oi.isBrowser=oi.isNode=oi.isReactNative=void 0;function c(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}oi.isReactNative=c;function r(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}oi.isNode=r;function i(){return!c()&&!r()}return oi.isBrowser=i,oi}(function(c){Object.defineProperty(c,"__esModule",{value:!0});const r=ds;r.__exportStar(aw(),c),r.__exportStar(cw(),c)})(ef);function tf(c=3){const r=Date.now()*Math.pow(10,c),i=Math.floor(Math.random()*Math.pow(10,c));return r+i}function _c(c=6){return BigInt(tf(c))}function po(c,r,i){return{id:i||tf(),jsonrpc:"2.0",method:c,params:r}}function bc(c,r){return{id:c,jsonrpc:"2.0",result:r}}function go(c,r,i){return{id:c,jsonrpc:"2.0",error:uw(r,i)}}function uw(c,r){return typeof c>"u"?Vh(Xl):(typeof c=="string"&&(c=Object.assign(Object.assign({},Vh(wc)),{message:c})),typeof r<"u"&&(c.data=r),nw(c.code)&&(c=ow(c.code)),c)}class hw{}class lw extends hw{constructor(){super()}}class fw extends lw{constructor(r){super()}}const pw="^https?:",dw="^wss?:";function gw(c){const r=c.match(new RegExp(/^\w+:/,"gi"));if(!(!r||!r.length))return r[0]}function rf(c,r){const i=gw(c);return typeof i>"u"?!1:new RegExp(r).test(i)}function Jh(c){return rf(c,pw)}function Yh(c){return rf(c,dw)}function yw(c){return new RegExp("wss?://localhost(:d{2,5})?").test(c)}function sf(c){return typeof c=="object"&&"id"in c&&"jsonrpc"in c&&c.jsonrpc==="2.0"}function Ec(c){return sf(c)&&"method"in c}function yo(c){return sf(c)&&(ai(c)||$r(c))}function ai(c){return"result"in c}function $r(c){return"error"in c}class Ei extends fw{constructor(r){super(r),this.events=new Cr.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(r),this.connection.connected&&this.registerEventListeners()}async connect(r=this.connection){await this.open(r)}async disconnect(){await this.close()}on(r,i){this.events.on(r,i)}once(r,i){this.events.once(r,i)}off(r,i){this.events.off(r,i)}removeListener(r,i){this.events.removeListener(r,i)}async request(r,i){return this.requestStrict(po(r.method,r.params||[],r.id||_c().toString()),i)}async requestStrict(r,i){return new Promise(async(n,o)=>{if(!this.connection.connected)try{await this.open()}catch(l){o(l)}this.events.on(`${r.id}`,l=>{$r(l)?o(l.error):n(l.result)});try{await this.connection.send(r,i)}catch(l){o(l)}})}setConnection(r=this.connection){return r}onPayload(r){this.events.emit("payload",r),yo(r)?this.events.emit(`${r.id}`,r):this.events.emit("message",{type:r.method,data:r.params})}onClose(r){r&&r.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${r.code} ${r.reason?`(${r.reason})`:""}`)),this.events.emit("disconnect")}async open(r=this.connection){this.connection===r&&this.connection.connected||(this.connection.connected&&this.close(),typeof r=="string"&&(await this.connection.open(r),r=this.connection),this.connection=this.setConnection(r),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",r=>this.onPayload(r)),this.connection.on("close",r=>this.onClose(r)),this.connection.on("error",r=>this.events.emit("error",r)),this.connection.on("register_error",r=>this.onClose()),this.hasRegisteredEventListeners=!0)}}const vw=()=>typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:require("ws"),mw=()=>typeof window<"u",Xh=c=>c.split("?")[0],Zh=10,ww=vw();class _w{constructor(r){if(this.url=r,this.events=new Cr.EventEmitter,this.registering=!1,!Yh(r))throw new Error(`Provided URL is not compatible with WebSocket connection: ${r}`);this.url=r}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(r,i){this.events.on(r,i)}once(r,i){this.events.once(r,i)}off(r,i){this.events.off(r,i)}removeListener(r,i){this.events.removeListener(r,i)}async open(r=this.url){await this.register(r)}async close(){return new Promise((r,i)=>{if(typeof this.socket>"u"){i(new Error("Connection already closed"));return}this.socket.onclose=n=>{this.onClose(n),r()},this.socket.close()})}async send(r,i){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(Ui(r))}catch(n){this.onError(r.id,n)}}register(r=this.url){if(!Yh(r))throw new Error(`Provided URL is not compatible with WebSocket connection: ${r}`);if(this.registering){const i=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=i||this.events.listenerCount("open")>=i)&&this.events.setMaxListeners(i+1),new Promise((n,o)=>{this.events.once("register_error",l=>{this.resetMaxListeners(),o(l)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return o(new Error("WebSocket connection is missing or invalid"));n(this.socket)})})}return this.url=r,this.registering=!0,new Promise((i,n)=>{const o=ef.isReactNative()?void 0:{rejectUnauthorized:!yw(r)},l=new ww(r,[],o);mw()?l.onerror=d=>{const v=d;n(this.emitError(v.error))}:l.on("error",d=>{n(this.emitError(d))}),l.onopen=()=>{this.onOpen(l),i(l)}})}onOpen(r){r.onmessage=i=>this.onPayload(i),r.onclose=i=>this.onClose(i),this.socket=r,this.registering=!1,this.events.emit("open")}onClose(r){this.socket=void 0,this.registering=!1,this.events.emit("close",r)}onPayload(r){if(typeof r.data>"u")return;const i=typeof r.data=="string"?Ks(r.data):r.data;this.events.emit("payload",i)}onError(r,i){const n=this.parseError(i),o=n.message||n.toString(),l=go(r,o);this.events.emit("payload",l)}parseError(r,i=this.url){return Ql(r,Xh(i),"WS")}resetMaxListeners(){this.events.getMaxListeners()>Zh&&this.events.setMaxListeners(Zh)}emitError(r){const i=this.parseError(new Error((r==null?void 0:r.message)||`WebSocket connection failed for host: ${Xh(this.url)}`));return this.events.emit("register_error",i),i}}var ho={exports:{}};ho.exports;(function(c,r){var i=200,n="__lodash_hash_undefined__",o=1,l=2,d=9007199254740991,v="[object Arguments]",b="[object Array]",m="[object AsyncFunction]",S="[object Boolean]",O="[object Date]",F="[object Error]",z="[object Function]",R="[object GeneratorFunction]",K="[object Map]",re="[object Number]",he="[object Null]",le="[object Object]",fe="[object Promise]",pe="[object Proxy]",de="[object RegExp]",L="[object Set]",q="[object String]",W="[object Symbol]",ve="[object Undefined]",ie="[object WeakMap]",ue="[object ArrayBuffer]",Te="[object DataView]",Ue="[object Float32Array]",y="[object Float64Array]",I="[object Int8Array]",X="[object Int16Array]",ce="[object Int32Array]",V="[object Uint8Array]",B="[object Uint8ClampedArray]",k="[object Uint16Array]",G="[object Uint32Array]",Je=/[\\^$.*+?()[\]{}|]/g,He=/^\[object .+?Constructor\]$/,jr=/^(?:0|[1-9]\d*)$/,Ie={};Ie[Ue]=Ie[y]=Ie[I]=Ie[X]=Ie[ce]=Ie[V]=Ie[B]=Ie[k]=Ie[G]=!0,Ie[v]=Ie[b]=Ie[ue]=Ie[S]=Ie[Te]=Ie[O]=Ie[F]=Ie[z]=Ie[K]=Ie[re]=Ie[le]=Ie[de]=Ie[L]=Ie[q]=Ie[ie]=!1;var xt=typeof Mr=="object"&&Mr&&Mr.Object===Object&&Mr,D=typeof self=="object"&&self&&self.Object===Object&&self,N=xt||D||Function("return this")(),C=r&&!r.nodeType&&r,u=C&&!0&&c&&!c.nodeType&&c,E=u&&u.exports===C,ee=E&&xt.process,ge=function(){try{return ee&&ee.binding&&ee.binding("util")}catch{}}(),be=ge&&ge.isTypedArray;function Ne(g,x){for(var U=-1,Y=g==null?0:g.length,Ve=0,me=[];++U-1}function Po(g,x){var U=this.__data__,Y=Si(U,g);return Y<0?(++this.size,U.push([g,x])):U[Y][1]=x,this}yr.prototype.clear=Eo,yr.prototype.delete=Io,yr.prototype.get=xo,yr.prototype.has=So,yr.prototype.set=Po;function Wr(g){var x=-1,U=g==null?0:g.length;for(this.clear();++xNt))return!1;var Ge=me.get(g);if(Ge&&me.get(x))return Ge==x;var _t=-1,ir=!0,Dt=U&l?new Vi:void 0;for(me.set(g,x),me.set(x,g);++_t-1&&g%1==0&&g-1&&g%1==0&&g<=d}function ln(g){var x=typeof g;return g!=null&&(x=="object"||x=="function")}function Ci(g){return g!=null&&typeof g=="object"}var fn=be?mt(be):Zs;function zo(g){return Mo(g)?Ys(g):Qs(g)}function Ke(){return[]}function Be(){return!1}c.exports=jo})(ho,ho.exports);var bw=ho.exports;const Ew=Ll(bw);function Iw(c,r){if(c.length>=255)throw new TypeError("Alphabet too long");for(var i=new Uint8Array(256),n=0;n>>0,pe=new Uint8Array(fe);he!==le;){for(var de=R[he],L=0,q=fe-1;(de!==0||L>>0,pe[q]=de%v>>>0,de=de/v>>>0;if(de!==0)throw new Error("Non-zero carry");re=L,he++}for(var W=fe-re;W!==fe&&pe[W]===0;)W++;for(var ve=b.repeat(K);W>>0,fe=new Uint8Array(le);R[K];){var pe=i[R.charCodeAt(K)];if(pe===255)return;for(var de=0,L=le-1;(pe!==0||de>>0,fe[L]=pe%256>>>0,pe=pe/256>>>0;if(pe!==0)throw new Error("Non-zero carry");he=de,K++}if(R[K]!==" "){for(var q=le-he;q!==le&&fe[q]===0;)q++;for(var W=new Uint8Array(re+(le-q)),ve=re;q!==le;)W[ve++]=fe[q++];return W}}}function z(R){var K=F(R);if(K)return K;throw new Error(`Non-${r} character`)}return{encode:O,decodeUnsafe:F,decode:z}}var xw=Iw,Sw=xw;const nf=c=>{if(c instanceof Uint8Array&&c.constructor.name==="Uint8Array")return c;if(c instanceof ArrayBuffer)return new Uint8Array(c);if(ArrayBuffer.isView(c))return new Uint8Array(c.buffer,c.byteOffset,c.byteLength);throw new Error("Unknown type, must be binary type")},Pw=c=>new TextEncoder().encode(c),Aw=c=>new TextDecoder().decode(c);class Cw{constructor(r,i,n){this.name=r,this.prefix=i,this.baseEncode=n}encode(r){if(r instanceof Uint8Array)return`${this.prefix}${this.baseEncode(r)}`;throw Error("Unknown type, must be binary type")}}class Ow{constructor(r,i,n){if(this.name=r,this.prefix=i,i.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=i.codePointAt(0),this.baseDecode=n}decode(r){if(typeof r=="string"){if(r.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(r)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(r.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(r){return of(this,r)}}class Rw{constructor(r){this.decoders=r}or(r){return of(this,r)}decode(r){const i=r[0],n=this.decoders[i];if(n)return n.decode(r);throw RangeError(`Unable to decode multibase string ${JSON.stringify(r)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const of=(c,r)=>new Rw({...c.decoders||{[c.prefix]:c},...r.decoders||{[r.prefix]:r}});class Tw{constructor(r,i,n,o){this.name=r,this.prefix=i,this.baseEncode=n,this.baseDecode=o,this.encoder=new Cw(r,i,n),this.decoder=new Ow(r,i,o)}encode(r){return this.encoder.encode(r)}decode(r){return this.decoder.decode(r)}}const vo=({name:c,prefix:r,encode:i,decode:n})=>new Tw(c,r,i,n),Vs=({prefix:c,name:r,alphabet:i})=>{const{encode:n,decode:o}=Sw(i,r);return vo({prefix:c,name:r,encode:n,decode:l=>nf(o(l))})},Nw=(c,r,i,n)=>{const o={};for(let S=0;S=8&&(v-=8,d[m++]=255&b>>v)}if(v>=i||255&b<<8-v)throw new SyntaxError("Unexpected end of data");return d},Dw=(c,r,i)=>{const n=r[r.length-1]==="=",o=(1<i;)d-=i,l+=r[o&v>>d];if(d&&(l+=r[o&v<vo({prefix:r,name:c,encode(o){return Dw(o,n,i)},decode(o){return Nw(o,n,i,c)}}),Fw=vo({prefix:"\0",name:"identity",encode:c=>Aw(c),decode:c=>Pw(c)});var Lw=Object.freeze({__proto__:null,identity:Fw});const $w=Kt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Mw=Object.freeze({__proto__:null,base2:$w});const jw=Kt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var zw=Object.freeze({__proto__:null,base8:jw});const Uw=Vs({prefix:"9",name:"base10",alphabet:"0123456789"});var qw=Object.freeze({__proto__:null,base10:Uw});const Bw=Kt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Hw=Kt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var kw=Object.freeze({__proto__:null,base16:Bw,base16upper:Hw});const Kw=Kt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Vw=Kt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Gw=Kt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Ww=Kt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Jw=Kt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Yw=Kt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Xw=Kt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Zw=Kt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Qw=Kt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var e_=Object.freeze({__proto__:null,base32:Kw,base32upper:Vw,base32pad:Gw,base32padupper:Ww,base32hex:Jw,base32hexupper:Yw,base32hexpad:Xw,base32hexpadupper:Zw,base32z:Qw});const t_=Vs({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),r_=Vs({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var i_=Object.freeze({__proto__:null,base36:t_,base36upper:r_});const s_=Vs({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),n_=Vs({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var o_=Object.freeze({__proto__:null,base58btc:s_,base58flickr:n_});const a_=Kt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),c_=Kt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),u_=Kt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),h_=Kt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var l_=Object.freeze({__proto__:null,base64:a_,base64pad:c_,base64url:u_,base64urlpad:h_});const af=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),f_=af.reduce((c,r,i)=>(c[i]=r,c),[]),p_=af.reduce((c,r,i)=>(c[r.codePointAt(0)]=i,c),[]);function d_(c){return c.reduce((r,i)=>(r+=f_[i],r),"")}function g_(c){const r=[];for(const i of c){const n=p_[i.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${i}`);r.push(n)}return new Uint8Array(r)}const y_=vo({prefix:"🚀",name:"base256emoji",encode:d_,decode:g_});var v_=Object.freeze({__proto__:null,base256emoji:y_}),m_=cf,Qh=128,w_=127,__=~w_,b_=Math.pow(2,31);function cf(c,r,i){r=r||[],i=i||0;for(var n=i;c>=b_;)r[i++]=c&255|Qh,c/=128;for(;c&__;)r[i++]=c&255|Qh,c>>>=7;return r[i]=c|0,cf.bytes=i-n+1,r}var E_=uc,I_=128,el=127;function uc(c,n){var i=0,n=n||0,o=0,l=n,d,v=c.length;do{if(l>=v)throw uc.bytes=0,new RangeError("Could not decode varint");d=c[l++],i+=o<28?(d&el)<=I_);return uc.bytes=l-n,i}var x_=Math.pow(2,7),S_=Math.pow(2,14),P_=Math.pow(2,21),A_=Math.pow(2,28),C_=Math.pow(2,35),O_=Math.pow(2,42),R_=Math.pow(2,49),T_=Math.pow(2,56),N_=Math.pow(2,63),D_=function(c){return c(uf.encode(c,r,i),r),rl=c=>uf.encodingLength(c),hc=(c,r)=>{const i=r.byteLength,n=rl(c),o=n+rl(i),l=new Uint8Array(o+i);return tl(c,l,0),tl(i,l,n),l.set(r,o),new L_(c,i,r,l)};class L_{constructor(r,i,n,o){this.code=r,this.size=i,this.digest=n,this.bytes=o}}const hf=({name:c,code:r,encode:i})=>new $_(c,r,i);class $_{constructor(r,i,n){this.name=r,this.code=i,this.encode=n}digest(r){if(r instanceof Uint8Array){const i=this.encode(r);return i instanceof Uint8Array?hc(this.code,i):i.then(n=>hc(this.code,n))}else throw Error("Unknown type, must be binary type")}}const lf=c=>async r=>new Uint8Array(await crypto.subtle.digest(c,r)),M_=hf({name:"sha2-256",code:18,encode:lf("SHA-256")}),j_=hf({name:"sha2-512",code:19,encode:lf("SHA-512")});var z_=Object.freeze({__proto__:null,sha256:M_,sha512:j_});const ff=0,U_="identity",pf=nf,q_=c=>hc(ff,pf(c)),B_={code:ff,name:U_,encode:pf,digest:q_};var H_=Object.freeze({__proto__:null,identity:B_});new TextEncoder,new TextDecoder;const il={...Lw,...Mw,...zw,...qw,...kw,...e_,...i_,...o_,...l_,...v_};({...z_,...H_});function df(c){return globalThis.Buffer!=null?new Uint8Array(c.buffer,c.byteOffset,c.byteLength):c}function k_(c=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?df(globalThis.Buffer.allocUnsafe(c)):new Uint8Array(c)}function gf(c,r,i,n){return{name:c,prefix:r,encoder:{name:c,prefix:r,encode:i},decoder:{decode:n}}}const sl=gf("utf8","u",c=>"u"+new TextDecoder("utf8").decode(c),c=>new TextEncoder().encode(c.substring(1))),Xa=gf("ascii","a",c=>{let r="a";for(let i=0;i{c=c.substring(1);const r=k_(c.length);for(let i=0;i{if(!this.initialized){const n=await this.getKeyChain();typeof n<"u"&&(this.keychain=n),this.initialized=!0}},this.has=n=>(this.isInitialized(),this.keychain.has(n)),this.set=async(n,o)=>{this.isInitialized(),this.keychain.set(n,o),await this.persist()},this.get=n=>{this.isInitialized();const o=this.keychain.get(n);if(typeof o>"u"){const{message:l}=Q("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(l)}return o},this.del=async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()},this.core=r,this.logger=Re.generateChildLogger(i,this.name)}get context(){return Re.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setKeyChain(r){await this.core.storage.setItem(this.storageKey,zl(r))}async getKeyChain(){const r=await this.core.storage.getItem(this.storageKey);return typeof r<"u"?Ul(r):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:r}=Q("NOT_INITIALIZED",this.name);throw new Error(r)}}}class Eb{constructor(r,i,n){this.core=r,this.logger=i,this.name=Y_,this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=o=>(this.isInitialized(),this.keychain.has(o)),this.getClientId=async()=>{this.isInitialized();const o=await this.getClientSeed(),l=Kh(o);return Yl(l.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const o=cm();return this.setPrivateKey(o.publicKey,o.privateKey)},this.signJWT=async o=>{this.isInitialized();const l=await this.getClientSeed(),d=Kh(l),v=oc();return await Q1(v,o,X_,d)},this.generateSharedKey=(o,l,d)=>{this.isInitialized();const v=this.getPrivateKey(o),b=um(v,l);return this.setSymKey(b,d)},this.setSymKey=async(o,l)=>{this.isInitialized();const d=l||hm(o);return await this.keychain.set(d,o),d},this.deleteKeyPair=async o=>{this.isInitialized(),await this.keychain.del(o)},this.deleteSymKey=async o=>{this.isInitialized(),await this.keychain.del(o)},this.encode=async(o,l,d)=>{this.isInitialized();const v=lm(d),b=Ui(l);if(Ah(v)){const F=v.senderPublicKey,z=v.receiverPublicKey;o=await this.generateSharedKey(F,z)}const m=this.getSymKey(o),{type:S,senderPublicKey:O}=v;return fm({type:S,symKey:m,message:b,senderPublicKey:O})},this.decode=async(o,l,d)=>{this.isInitialized();const v=pm(l,d);if(Ah(v)){const S=v.receiverPublicKey,O=v.senderPublicKey;o=await this.generateSharedKey(S,O)}const b=this.getSymKey(o),m=dm({symKey:b,encoded:l});return Ks(m)},this.getPayloadType=o=>{const l=Ch(o);return gm(l.type)},this.getPayloadSenderPublicKey=o=>{const l=Ch(o);return l.senderPublicKey?fo(l.senderPublicKey,ym):void 0},this.core=r,this.logger=Re.generateChildLogger(i,this.name),this.keychain=n||new bb(this.core,this.logger)}get context(){return Re.getLoggerContext(this.logger)}async setPrivateKey(r,i){return await this.keychain.set(r,i),r}getPrivateKey(r){return this.keychain.get(r)}async getClientSeed(){let r="";try{r=this.keychain.get(nl)}catch{r=oc(),await this.keychain.set(nl,r)}return V_(r,"base16")}getSymKey(r){return this.keychain.get(r)}isInitialized(){if(!this.initialized){const{message:r}=Q("NOT_INITIALIZED",this.name);throw new Error(r)}}}class Ib extends T1{constructor(r,i){super(r,i),this.logger=r,this.core=i,this.messages=new Map,this.name=eb,this.version=tb,this.initialized=!1,this.storagePrefix=bi,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const n=await this.getRelayerMessages();typeof n<"u"&&(this.messages=n),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(n){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(n)}finally{this.initialized=!0}}},this.set=async(n,o)=>{this.isInitialized();const l=fs(o);let d=this.messages.get(n);return typeof d>"u"&&(d={}),typeof d[l]<"u"||(d[l]=o,this.messages.set(n,d),await this.persist()),l},this.get=n=>{this.isInitialized();let o=this.messages.get(n);return typeof o>"u"&&(o={}),o},this.has=(n,o)=>{this.isInitialized();const l=this.get(n),d=fs(o);return typeof l[d]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=Re.generateChildLogger(r,this.name),this.core=i}get context(){return Re.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}async setRelayerMessages(r){await this.core.storage.setItem(this.storageKey,zl(r))}async getRelayerMessages(){const r=await this.core.storage.getItem(this.storageKey);return typeof r<"u"?Ul(r):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:r}=Q("NOT_INITIALIZED",this.name);throw new Error(r)}}}class xb extends N1{constructor(r,i){super(r,i),this.relayer=r,this.logger=i,this.events=new Cr.EventEmitter,this.name=ib,this.queue=new Map,this.publishTimeout=ne.toMiliseconds(ne.TEN_SECONDS),this.queueTimeout=ne.toMiliseconds(ne.FIVE_SECONDS),this.needsTransportRestart=!1,this.publish=async(n,o,l)=>{this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:o,opts:l}});try{const d=(l==null?void 0:l.ttl)||rb,v=ac(l),b=(l==null?void 0:l.prompt)||!1,m=(l==null?void 0:l.tag)||0,S=(l==null?void 0:l.id)||_c().toString(),O={topic:n,message:o,opts:{ttl:d,relay:v,prompt:b,tag:m,id:S}},F=setTimeout(()=>this.queue.set(S,O),this.queueTimeout);try{await await co(this.rpcPublish(n,o,d,v,b,m,S),this.publishTimeout),clearTimeout(F),this.relayer.events.emit(vt.publish,O)}catch{this.logger.debug("Publishing Payload stalled"),this.needsTransportRestart=!0;return}this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:o,opts:l}})}catch(d){throw this.logger.debug("Failed to Publish Payload"),this.logger.error(d),d}},this.on=(n,o)=>{this.events.on(n,o)},this.once=(n,o)=>{this.events.once(n,o)},this.off=(n,o)=>{this.events.off(n,o)},this.removeListener=(n,o)=>{this.events.removeListener(n,o)},this.relayer=r,this.logger=Re.generateChildLogger(i,this.name),this.registerEventListeners()}get context(){return Re.getLoggerContext(this.logger)}rpcPublish(r,i,n,o,l,d,v){var b,m,S,O;const F={method:io(o.protocol).publish,params:{topic:r,message:i,ttl:n,prompt:l,tag:d},id:v};return _i((b=F.params)==null?void 0:b.prompt)&&((m=F.params)==null||delete m.prompt),_i((S=F.params)==null?void 0:S.tag)&&((O=F.params)==null||delete O.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:F}),this.relayer.request(F)}onPublish(r){this.queue.delete(r)}checkQueue(){this.queue.forEach(async r=>{const{topic:i,message:n,opts:o}=r;await this.publish(i,n,o)})}registerEventListeners(){this.relayer.core.heartbeat.on(gs.HEARTBEAT_EVENTS.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(vt.connection_stalled);return}this.checkQueue()}),this.relayer.on(vt.message_ack,r=>{this.onPublish(r.id.toString())})}}class Sb{constructor(){this.map=new Map,this.set=(r,i)=>{const n=this.get(r);this.exists(r,i)||this.map.set(r,[...n,i])},this.get=r=>this.map.get(r)||[],this.exists=(r,i)=>this.get(r).includes(i),this.delete=(r,i)=>{if(typeof i>"u"){this.map.delete(r);return}if(!this.map.has(r))return;const n=this.get(r);if(!this.exists(r,i))return;const o=n.filter(l=>l!==i);if(!o.length){this.map.delete(r);return}this.map.set(r,o)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var Pb=Object.defineProperty,Ab=Object.defineProperties,Cb=Object.getOwnPropertyDescriptors,cl=Object.getOwnPropertySymbols,Ob=Object.prototype.hasOwnProperty,Rb=Object.prototype.propertyIsEnumerable,ul=(c,r,i)=>r in c?Pb(c,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):c[r]=i,zs=(c,r)=>{for(var i in r||(r={}))Ob.call(r,i)&&ul(c,i,r[i]);if(cl)for(var i of cl(r))Rb.call(r,i)&&ul(c,i,r[i]);return c},Qa=(c,r)=>Ab(c,Cb(r));class Tb extends L1{constructor(r,i){super(r,i),this.relayer=r,this.logger=i,this.subscriptions=new Map,this.topicMap=new Sb,this.events=new Cr.EventEmitter,this.name=fb,this.version=pb,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=bi,this.subscribeTimeout=1e4,this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restart(),this.registerEventListeners(),this.onEnable(),this.clientId=await this.relayer.core.crypto.getClientId())},this.subscribe=async(n,o)=>{await this.restartToComplete(),this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:o}});try{const l=ac(o),d={topic:n,relay:l};this.pending.set(n,d);const v=await this.rpcSubscribe(n,l);return this.onSubscribe(v,d),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:o}}),v}catch(l){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(l),l}},this.unsubscribe=async(n,o)=>{await this.restartToComplete(),this.isInitialized(),typeof(o==null?void 0:o.id)<"u"?await this.unsubscribeById(n,o.id,o):await this.unsubscribeByTopic(n,o)},this.isSubscribed=async n=>this.topics.includes(n)?!0:await new Promise((o,l)=>{const d=new ne.Watch;d.start(this.pendingSubscriptionWatchLabel);const v=setInterval(()=>{!this.pending.has(n)&&this.topics.includes(n)&&(clearInterval(v),d.stop(this.pendingSubscriptionWatchLabel),o(!0)),d.elapsed(this.pendingSubscriptionWatchLabel)>=db&&(clearInterval(v),d.stop(this.pendingSubscriptionWatchLabel),l(new Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1),this.on=(n,o)=>{this.events.on(n,o)},this.once=(n,o)=>{this.events.once(n,o)},this.off=(n,o)=>{this.events.off(n,o)},this.removeListener=(n,o)=>{this.events.removeListener(n,o)},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=r,this.logger=Re.generateChildLogger(i,this.name),this.clientId=""}get context(){return Re.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+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}hasSubscription(r,i){let n=!1;try{n=this.getSubscription(r).topic===i}catch{}return n}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(r,i){const n=this.topicMap.get(r);await Promise.all(n.map(async o=>await this.unsubscribeById(r,o,i)))}async unsubscribeById(r,i,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:r,id:i,opts:n}});try{const o=ac(n);await this.rpcUnsubscribe(r,i,o);const l=tr("USER_DISCONNECTED",`${this.name}, ${r}`);await this.onUnsubscribe(r,i,l),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:r,id:i,opts:n}})}catch(o){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(o),o}}async rpcSubscribe(r,i){const n={method:io(i.protocol).subscribe,params:{topic:r}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{await await co(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(vt.connection_stalled)}return fs(r+this.clientId)}async rpcBatchSubscribe(r){if(!r.length)return;const i=r[0].relay,n={method:io(i.protocol).batchSubscribe,params:{topics:r.map(o=>o.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{return await await co(this.relayer.request(n),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(vt.connection_stalled)}}rpcUnsubscribe(r,i,n){const o={method:io(n.protocol).unsubscribe,params:{topic:r,id:i}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:o}),this.relayer.request(o)}onSubscribe(r,i){this.setSubscription(r,Qa(zs({},i),{id:r})),this.pending.delete(i.topic)}onBatchSubscribe(r){r.length&&r.forEach(i=>{this.setSubscription(i.id,zs({},i)),this.pending.delete(i.topic)})}async onUnsubscribe(r,i,n){this.events.removeAllListeners(i),this.hasSubscription(i,r)&&this.deleteSubscription(i,n),await this.relayer.messages.del(r)}async setRelayerSubscriptions(r){await this.relayer.core.storage.setItem(this.storageKey,r)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(r,i){this.subscriptions.has(r)||(this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:r,subscription:i}),this.addSubscription(r,i))}addSubscription(r,i){this.subscriptions.set(r,zs({},i)),this.topicMap.set(i.topic,r),this.events.emit(Vr.created,i)}getSubscription(r){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:r});const i=this.subscriptions.get(r);if(!i){const{message:n}=Q("NO_MATCHING_KEY",`${this.name}: ${r}`);throw new Error(n)}return i}deleteSubscription(r,i){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:r,reason:i});const n=this.getSubscription(r);this.subscriptions.delete(r),this.topicMap.delete(n.topic,r),this.events.emit(Vr.deleted,Qa(zs({},n),{reason:i}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Vr.sync)}async reset(){if(this.cached.length){const r=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let i=0;i"u"||!r.length)return;if(this.subscriptions.size){const{message:i}=Q("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(i),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(i)}this.cached=r,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(r){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(r)}}async batchSubscribe(r){if(!r.length)return;const i=await this.rpcBatchSubscribe(r);ps(i)&&this.onBatchSubscribe(i.map((n,o)=>Qa(zs({},r[o]),{id:n})))}async onConnect(){this.restartInProgress||(await this.restart(),this.onEnable())}onDisconnect(){this.onDisable()}async checkPending(){if(this.relayer.transportExplicitlyClosed)return;const r=[];this.pending.forEach(i=>{r.push(i)}),await this.batchSubscribe(r)}registerEventListeners(){this.relayer.core.heartbeat.on(gs.HEARTBEAT_EVENTS.pulse,async()=>{await this.checkPending()}),this.relayer.on(vt.connect,async()=>{await this.onConnect()}),this.relayer.on(vt.disconnect,()=>{this.onDisconnect()}),this.events.on(Vr.created,async r=>{const i=Vr.created;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:r}),await this.persist()}),this.events.on(Vr.deleted,async r=>{const i=Vr.deleted;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:r}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:r}=Q("NOT_INITIALIZED",this.name);throw new Error(r)}}async restartToComplete(){this.restartInProgress&&await new Promise(r=>{const i=setInterval(()=>{this.restartInProgress||(clearInterval(i),r())},this.pollingInterval)})}}var Nb=Object.defineProperty,hl=Object.getOwnPropertySymbols,Db=Object.prototype.hasOwnProperty,Fb=Object.prototype.propertyIsEnumerable,ll=(c,r,i)=>r in c?Nb(c,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):c[r]=i,Lb=(c,r)=>{for(var i in r||(r={}))Db.call(r,i)&&ll(c,i,r[i]);if(hl)for(var i of hl(r))Fb.call(r,i)&&ll(c,i,r[i]);return c};class $b extends D1{constructor(r){super(r),this.protocol="wc",this.version=2,this.events=new Cr.EventEmitter,this.name=nb,this.transportExplicitlyClosed=!1,this.initialized=!1,this.reconnecting=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","socket stalled"],this.request=async i=>{this.logger.debug("Publishing Request Payload");try{return await this.toEstablishConnection(),await this.provider.request(i)}catch(n){throw this.logger.debug("Failed to Publish Request"),this.logger.error(n),n}},this.core=r.core,this.logger=typeof r.logger<"u"&&typeof r.logger!="string"?Re.generateChildLogger(r.logger,this.name):Re.pino(Re.getDefaultLoggerOptions({level:r.logger||sb})),this.messages=new Ib(this.logger,r.core),this.subscriber=new Tb(this,this.logger),this.publisher=new xb(this,this.logger),this.relayUrl=(r==null?void 0:r.relayUrl)||mf,this.projectId=r.projectId,this.provider={}}async init(){this.logger.trace("Initialized"),await this.createProvider(),await Promise.all([this.messages.init(),this.subscriber.init()]);try{await this.transportOpen()}catch{this.logger.warn(`Connection via ${this.relayUrl} failed, attempting to connect via failover domain ${ol}...`),await this.restartTransport(ol)}this.registerEventListeners(),this.initialized=!0,setTimeout(async()=>{this.subscriber.topics.length===0&&(this.logger.info("No topics subscribed to after init, closing transport"),await this.transportClose(),this.transportExplicitlyClosed=!1)},ub)}get context(){return Re.getLoggerContext(this.logger)}get connected(){return this.provider.connection.connected}get connecting(){return this.provider.connection.connecting}async publish(r,i,n){this.isInitialized(),await this.publisher.publish(r,i,n),await this.recordMessageEvent({topic:r,message:i,publishedAt:Date.now()})}async subscribe(r,i){var n;this.isInitialized();let o=((n=this.subscriber.topicMap.get(r))==null?void 0:n[0])||"";return o||(await Promise.all([new Promise(l=>{this.subscriber.once(Vr.created,d=>{d.topic===r&&l()})}),new Promise(async l=>{o=await this.subscriber.subscribe(r,i),l()})]),o)}async unsubscribe(r,i){this.isInitialized(),await this.subscriber.unsubscribe(r,i)}on(r,i){this.events.on(r,i)}once(r,i){this.events.once(r,i)}off(r,i){this.events.off(r,i)}removeListener(r,i){this.events.removeListener(r,i)}async transportClose(){this.transportExplicitlyClosed=!0,this.connected&&(await this.provider.disconnect(),this.events.emit(vt.transport_closed))}async transportOpen(r){if(this.transportExplicitlyClosed=!1,!this.reconnecting){this.relayUrl=r||this.relayUrl,this.reconnecting=!0;try{await Promise.all([new Promise(i=>{this.initialized||i(),this.subscriber.once(Vr.resubscribed,()=>{i()})}),await Promise.race([new Promise(async(i,n)=>{await co(this.provider.connect(),5e3,`Socket stalled when trying to connect to ${this.relayUrl}`).catch(o=>n(o)).then(()=>i()).finally(()=>this.removeListener(vt.transport_closed,this.rejectTransportOpen))}),new Promise(i=>this.once(vt.transport_closed,this.rejectTransportOpen))])])}catch(i){this.logger.error(i);const n=i;if(!this.isConnectionStalled(n.message))throw i;this.events.emit(vt.transport_closed)}finally{this.reconnecting=!1}}}async restartTransport(r){this.transportExplicitlyClosed||this.reconnecting||(this.relayUrl=r||this.relayUrl,this.connected&&await Promise.all([new Promise(i=>{this.provider.once(Ms.disconnect,()=>{i()})}),this.transportClose()]),await this.createProvider(),await this.transportOpen())}isConnectionStalled(r){return this.staleConnectionErrors.some(i=>r.includes(i))}rejectTransportOpen(){throw new Error("Attempt to connect to relay via `transportOpen` has stalled. Retrying...")}async createProvider(){const r=await this.core.crypto.signJWT(this.relayUrl);this.provider=new Ei(new _w(vm({sdkVersion:cb,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:r,useOnCloseEvent:!0}))),this.registerProviderListeners()}async recordMessageEvent(r){const{topic:i,message:n}=r;await this.messages.set(i,n)}async shouldIgnoreMessageEvent(r){const{topic:i,message:n}=r;return await this.subscriber.isSubscribed(i)?this.messages.has(i,n):!0}async onProviderPayload(r){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:r}),Ec(r)){if(!r.method.endsWith(ob))return;const i=r.params,{topic:n,message:o,publishedAt:l}=i.data,d={topic:n,message:o,publishedAt:l};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(Lb({type:"event",event:i.id},d)),this.events.emit(i.id,d),await this.acknowledgePayload(r),await this.onMessageEvent(d)}else yo(r)&&this.events.emit(vt.message_ack,r)}async onMessageEvent(r){await this.shouldIgnoreMessageEvent(r)||(this.events.emit(vt.message,r),await this.recordMessageEvent(r))}async acknowledgePayload(r){const i=bc(r.id,!0);await this.provider.connection.send(i)}registerProviderListeners(){this.provider.on(Ms.payload,r=>this.onProviderPayload(r)),this.provider.on(Ms.connect,()=>{this.events.emit(vt.connect)}),this.provider.on(Ms.disconnect,()=>{this.onProviderDisconnect()}),this.provider.on(Ms.error,r=>{this.logger.error(r),this.events.emit(vt.error,r)})}registerEventListeners(){this.events.on(vt.connection_stalled,async()=>{await this.restartTransport()})}onProviderDisconnect(){this.events.emit(vt.disconnect),this.attemptToReconnect()}attemptToReconnect(){this.transportExplicitlyClosed||setTimeout(async()=>{await this.restartTransport()},ne.toMiliseconds(ab))}isInitialized(){if(!this.initialized){const{message:r}=Q("NOT_INITIALIZED",this.name);throw new Error(r)}}async toEstablishConnection(){if(!this.connected){if(this.connecting)return await new Promise(r=>{const i=setInterval(()=>{this.connected&&(clearInterval(i),r())},this.connectionStatusPollingInterval)});await this.restartTransport()}}}var Mb=Object.defineProperty,fl=Object.getOwnPropertySymbols,jb=Object.prototype.hasOwnProperty,zb=Object.prototype.propertyIsEnumerable,pl=(c,r,i)=>r in c?Mb(c,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):c[r]=i,dl=(c,r)=>{for(var i in r||(r={}))jb.call(r,i)&&pl(c,i,r[i]);if(fl)for(var i of fl(r))zb.call(r,i)&&pl(c,i,r[i]);return c};class mo extends F1{constructor(r,i,n,o=bi,l=void 0){super(r,i,n,o),this.core=r,this.logger=i,this.name=n,this.map=new Map,this.version=hb,this.cached=[],this.initialized=!1,this.storagePrefix=bi,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(d=>{this.getKey&&d!==null&&!_i(d)?this.map.set(this.getKey(d),d):om(d)?this.map.set(d.id,d):am(d)&&this.map.set(d.topic,d)}),this.cached=[],this.initialized=!0)},this.set=async(d,v)=>{this.isInitialized(),this.map.has(d)?await this.update(d,v):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:d,value:v}),this.map.set(d,v),await this.persist())},this.get=d=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:d}),this.getData(d)),this.getAll=d=>(this.isInitialized(),d?this.values.filter(v=>Object.keys(d).every(b=>Ew(v[b],d[b]))):this.values),this.update=async(d,v)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:d,update:v});const b=dl(dl({},this.getData(d)),v);this.map.set(d,b),await this.persist()},this.delete=async(d,v)=>{this.isInitialized(),this.map.has(d)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:d,reason:v}),this.map.delete(d),await this.persist())},this.logger=Re.generateChildLogger(i,this.name),this.storagePrefix=o,this.getKey=l}get context(){return Re.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}async setDataStore(r){await this.core.storage.setItem(this.storageKey,r)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(r){const i=this.map.get(r);if(!i){const{message:n}=Q("NO_MATCHING_KEY",`${this.name}: ${r}`);throw this.logger.error(n),new Error(n)}return i}async persist(){await this.setDataStore(this.values)}async restore(){try{const r=await this.getDataStore();if(typeof r>"u"||!r.length)return;if(this.map.size){const{message:i}=Q("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(i),new Error(i)}this.cached=r,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(r){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(r)}}isInitialized(){if(!this.initialized){const{message:r}=Q("NOT_INITIALIZED",this.name);throw new Error(r)}}}class Ub{constructor(r,i){this.core=r,this.logger=i,this.name=gb,this.version=yb,this.events=new vc,this.initialized=!1,this.storagePrefix=bi,this.ignoredPayloadTypes=[$l],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:n})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...n])]},this.create=async()=>{this.isInitialized();const n=oc(),o=await this.core.crypto.setSymKey(n),l=Lr(ne.FIVE_MINUTES),d={protocol:vf},v={topic:o,expiry:l,relay:d,active:!1},b=mm({protocol:this.core.protocol,version:this.core.version,topic:o,symKey:n,relay:d});return await this.pairings.set(o,v),await this.core.relayer.subscribe(o),this.core.expirer.set(o,l),{topic:o,uri:b}},this.pair=async n=>{this.isInitialized(),this.isValidPair(n);const{topic:o,symKey:l,relay:d}=wm(n.uri);if(this.pairings.keys.includes(o))throw new Error(`Pairing already exists: ${o}`);if(this.core.crypto.hasKeys(o))throw new Error(`Keychain already exists: ${o}`);const v=Lr(ne.FIVE_MINUTES),b={topic:o,relay:d,expiry:v,active:!1};return await this.pairings.set(o,b),await this.core.crypto.setSymKey(l,o),await this.core.relayer.subscribe(o,{relay:d}),this.core.expirer.set(o,v),n.activatePairing&&await this.activate({topic:o}),b},this.activate=async({topic:n})=>{this.isInitialized();const o=Lr(ne.THIRTY_DAYS);await this.pairings.update(n,{active:!0,expiry:o}),this.core.expirer.set(n,o)},this.ping=async n=>{this.isInitialized(),await this.isValidPing(n);const{topic:o}=n;if(this.pairings.keys.includes(o)){const l=await this.sendRequest(o,"wc_pairingPing",{}),{done:d,resolve:v,reject:b}=hs();this.events.once(Ft("pairing_ping",l),({error:m})=>{m?b(m):v()}),await d()}},this.updateExpiry=async({topic:n,expiry:o})=>{this.isInitialized(),await this.pairings.update(n,{expiry:o})},this.updateMetadata=async({topic:n,metadata:o})=>{this.isInitialized(),await this.pairings.update(n,{peerMetadata:o})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async n=>{this.isInitialized(),await this.isValidDisconnect(n);const{topic:o}=n;this.pairings.keys.includes(o)&&(await this.sendRequest(o,"wc_pairingDelete",tr("USER_DISCONNECTED")),await this.deletePairing(o))},this.sendRequest=async(n,o,l)=>{const d=po(o,l),v=await this.core.crypto.encode(n,d),b=js[o].req;return this.core.history.set(n,d),this.core.relayer.publish(n,v,b),d.id},this.sendResult=async(n,o,l)=>{const d=bc(n,l),v=await this.core.crypto.encode(o,d),b=await this.core.history.get(o,n),m=js[b.request.method].res;await this.core.relayer.publish(o,v,m),await this.core.history.resolve(d)},this.sendError=async(n,o,l)=>{const d=go(n,l),v=await this.core.crypto.encode(o,d),b=await this.core.history.get(o,n),m=js[b.request.method]?js[b.request.method].res:js.unregistered_method.res;await this.core.relayer.publish(o,v,m),await this.core.history.resolve(d)},this.deletePairing=async(n,o)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,tr("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(n),o?Promise.resolve():this.core.expirer.del(n)])},this.cleanup=async()=>{const n=this.pairings.getAll().filter(o=>wi(o.expiry));await Promise.all(n.map(o=>this.deletePairing(o.topic)))},this.onRelayEventRequest=n=>{const{topic:o,payload:l}=n,d=l.method;if(this.pairings.keys.includes(o))switch(d){case"wc_pairingPing":return this.onPairingPingRequest(o,l);case"wc_pairingDelete":return this.onPairingDeleteRequest(o,l);default:return this.onUnknownRpcMethodRequest(o,l)}},this.onRelayEventResponse=async n=>{const{topic:o,payload:l}=n,d=(await this.core.history.get(o,l.id)).request.method;if(this.pairings.keys.includes(o))switch(d){case"wc_pairingPing":return this.onPairingPingResponse(o,l);default:return this.onUnknownRpcMethodResponse(d)}},this.onPairingPingRequest=async(n,o)=>{const{id:l}=o;try{this.isValidPing({topic:n}),await this.sendResult(l,n,!0),this.events.emit("pairing_ping",{id:l,topic:n})}catch(d){await this.sendError(l,n,d),this.logger.error(d)}},this.onPairingPingResponse=(n,o)=>{const{id:l}=o;setTimeout(()=>{ai(o)?this.events.emit(Ft("pairing_ping",l),{}):$r(o)&&this.events.emit(Ft("pairing_ping",l),{error:o.error})},500)},this.onPairingDeleteRequest=async(n,o)=>{const{id:l}=o;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit("pairing_delete",{id:l,topic:n})}catch(d){await this.sendError(l,n,d),this.logger.error(d)}},this.onUnknownRpcMethodRequest=async(n,o)=>{const{id:l,method:d}=o;try{if(this.registeredMethods.includes(d))return;const v=tr("WC_METHOD_UNSUPPORTED",d);await this.sendError(l,n,v),this.logger.error(v)}catch(v){await this.sendError(l,n,v),this.logger.error(v)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error(tr("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=n=>{if(!ur(n)){const{message:o}=Q("MISSING_OR_INVALID",`pair() params: ${n}`);throw new Error(o)}if(!_m(n.uri)){const{message:o}=Q("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw new Error(o)}},this.isValidPing=async n=>{if(!ur(n)){const{message:l}=Q("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(l)}const{topic:o}=n;await this.isValidPairingTopic(o)},this.isValidDisconnect=async n=>{if(!ur(n)){const{message:l}=Q("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(l)}const{topic:o}=n;await this.isValidPairingTopic(o)},this.isValidPairingTopic=async n=>{if(!ls(n,!1)){const{message:o}=Q("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(o)}if(!this.pairings.keys.includes(n)){const{message:o}=Q("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(o)}if(wi(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:o}=Q("EXPIRED",`pairing topic: ${n}`);throw new Error(o)}},this.core=r,this.logger=Re.generateChildLogger(i,this.name),this.pairings=new mo(this.core,this.logger,this.name,this.storagePrefix)}get context(){return Re.getLoggerContext(this.logger)}isInitialized(){if(!this.initialized){const{message:r}=Q("NOT_INITIALIZED",this.name);throw new Error(r)}}registerRelayerEvents(){this.core.relayer.on(vt.message,async r=>{const{topic:i,message:n}=r;if(this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const o=await this.core.crypto.decode(i,n);Ec(o)?(this.core.history.set(i,o),this.onRelayEventRequest({topic:i,payload:o})):yo(o)&&(await this.core.history.resolve(o),await this.onRelayEventResponse({topic:i,payload:o}),this.core.history.delete(i,o.id))})}registerExpirerEvents(){this.core.expirer.on(Pr.expired,async r=>{const{topic:i}=Ml(r.target);i&&this.pairings.keys.includes(i)&&(await this.deletePairing(i,!0),this.events.emit("pairing_expire",{topic:i}))})}}class qb extends R1{constructor(r,i){super(r,i),this.core=r,this.logger=i,this.records=new Map,this.events=new Cr.EventEmitter,this.name=vb,this.version=mb,this.cached=[],this.initialized=!1,this.storagePrefix=bi,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.records.set(n.id,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(n,o,l)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:o,chainId:l}),this.records.has(o.id))return;const d={id:o.id,topic:n,request:{method:o.method,params:o.params||null},chainId:l,expiry:Lr(ne.THIRTY_DAYS)};this.records.set(d.id,d),this.events.emit(Kr.created,d)},this.resolve=async n=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:n}),!this.records.has(n.id))return;const o=await this.getRecord(n.id);typeof o.response>"u"&&(o.response=$r(n)?{error:n.error}:{result:n.result},this.records.set(o.id,o),this.events.emit(Kr.updated,o))},this.get=async(n,o)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:n,id:o}),await this.getRecord(o)),this.delete=(n,o)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:o}),this.values.forEach(l=>{if(l.topic===n){if(typeof o<"u"&&l.id!==o)return;this.records.delete(l.id),this.events.emit(Kr.deleted,l)}})},this.exists=async(n,o)=>(this.isInitialized(),this.records.has(o)?(await this.getRecord(o)).topic===n:!1),this.on=(n,o)=>{this.events.on(n,o)},this.once=(n,o)=>{this.events.once(n,o)},this.off=(n,o)=>{this.events.off(n,o)},this.removeListener=(n,o)=>{this.events.removeListener(n,o)},this.logger=Re.generateChildLogger(i,this.name)}get context(){return Re.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+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 r=[];return this.values.forEach(i=>{if(typeof i.response<"u")return;const n={topic:i.topic,request:po(i.request.method,i.request.params,i.id),chainId:i.chainId};return r.push(n)}),r}async setJsonRpcRecords(r){await this.core.storage.setItem(this.storageKey,r)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(r){this.isInitialized();const i=this.records.get(r);if(!i){const{message:n}=Q("NO_MATCHING_KEY",`${this.name}: ${r}`);throw new Error(n)}return i}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(Kr.sync)}async restore(){try{const r=await this.getJsonRpcRecords();if(typeof r>"u"||!r.length)return;if(this.records.size){const{message:i}=Q("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(i),new Error(i)}this.cached=r,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(r){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(r)}}registerEventListeners(){this.events.on(Kr.created,r=>{const i=Kr.created;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,record:r}),this.persist()}),this.events.on(Kr.updated,r=>{const i=Kr.updated;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,record:r}),this.persist()}),this.events.on(Kr.deleted,r=>{const i=Kr.deleted;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,record:r}),this.persist()}),this.core.heartbeat.on(gs.HEARTBEAT_EVENTS.pulse,()=>{this.cleanup()})}cleanup(){try{this.records.forEach(r=>{ne.toMiliseconds(r.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${r.id}`),this.delete(r.topic,r.id))})}catch(r){this.logger.warn(r)}}isInitialized(){if(!this.initialized){const{message:r}=Q("NOT_INITIALIZED",this.name);throw new Error(r)}}}class Bb extends $1{constructor(r,i){super(r,i),this.core=r,this.logger=i,this.expirations=new Map,this.events=new Cr.EventEmitter,this.name=wb,this.version=_b,this.cached=[],this.initialized=!1,this.storagePrefix=bi,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.expirations.set(n.target,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=n=>{try{const o=this.formatTarget(n);return typeof this.getExpiration(o)<"u"}catch{return!1}},this.set=(n,o)=>{this.isInitialized();const l=this.formatTarget(n),d={target:l,expiry:o};this.expirations.set(l,d),this.checkExpiry(l,d),this.events.emit(Pr.created,{target:l,expiration:d})},this.get=n=>{this.isInitialized();const o=this.formatTarget(n);return this.getExpiration(o)},this.del=n=>{if(this.isInitialized(),this.has(n)){const o=this.formatTarget(n),l=this.getExpiration(o);this.expirations.delete(o),this.events.emit(Pr.deleted,{target:o,expiration:l})}},this.on=(n,o)=>{this.events.on(n,o)},this.once=(n,o)=>{this.events.once(n,o)},this.off=(n,o)=>{this.events.off(n,o)},this.removeListener=(n,o)=>{this.events.removeListener(n,o)},this.logger=Re.generateChildLogger(i,this.name)}get context(){return Re.getLoggerContext(this.logger)}get storageKey(){return this.storagePrefix+this.version+"//"+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(r){if(typeof r=="string")return bm(r);if(typeof r=="number")return Em(r);const{message:i}=Q("UNKNOWN_TYPE",`Target type: ${typeof r}`);throw new Error(i)}async setExpirations(r){await this.core.storage.setItem(this.storageKey,r)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(Pr.sync)}async restore(){try{const r=await this.getExpirations();if(typeof r>"u"||!r.length)return;if(this.expirations.size){const{message:i}=Q("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(i),new Error(i)}this.cached=r,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(r){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(r)}}getExpiration(r){const i=this.expirations.get(r);if(!i){const{message:n}=Q("NO_MATCHING_KEY",`${this.name}: ${r}`);throw this.logger.error(n),new Error(n)}return i}checkExpiry(r,i){const{expiry:n}=i;ne.toMiliseconds(n)-Date.now()<=0&&this.expire(r,i)}expire(r,i){this.expirations.delete(r),this.events.emit(Pr.expired,{target:r,expiration:i})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((r,i)=>this.checkExpiry(i,r))}registerEventListeners(){this.core.heartbeat.on(gs.HEARTBEAT_EVENTS.pulse,()=>this.checkExpirations()),this.events.on(Pr.created,r=>{const i=Pr.created;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:r}),this.persist()}),this.events.on(Pr.expired,r=>{const i=Pr.expired;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:r}),this.persist()}),this.events.on(Pr.deleted,r=>{const i=Pr.deleted;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:r}),this.persist()})}isInitialized(){if(!this.initialized){const{message:r}=Q("NOT_INITIALIZED",this.name);throw new Error(r)}}}class Hb extends M1{constructor(r,i){super(r,i),this.projectId=r,this.logger=i,this.name=Za,this.initialized=!1,this.init=async n=>{Im()||!jl()||(this.verifyUrl=(n==null?void 0:n.verifyUrl)||al,await this.createIframe())},this.register=async n=>{var o;if(this.initialized||await this.init(),!!this.iframe)try{(o=this.iframe.contentWindow)==null||o.postMessage(n.attestationId,this.verifyUrl),this.logger.info(`postMessage sent: ${n.attestationId} ${this.verifyUrl}`)}catch{}},this.resolve=async n=>{var o;if(this.isDevEnv)return"";this.logger.info(`resolving attestation: ${n.attestationId}`);const l=this.startAbortTimer(ne.FIVE_SECONDS),d=await fetch(`${this.verifyUrl}/attestation/${n.attestationId}`,{signal:this.abortController.signal});return clearTimeout(l),d.status===200?(o=await d.json())==null?void 0:o.origin:""},this.createIframe=async()=>{try{await Promise.race([new Promise((n,o)=>{if(document.getElementById(Za))return n();const l=document.createElement("iframe");l.setAttribute("id",Za),l.setAttribute("src",`${this.verifyUrl}/${this.projectId}`),l.style.display="none",l.addEventListener("load",()=>{this.initialized=!0,n()}),l.addEventListener("error",d=>{o(d)}),document.body.append(l),this.iframe=l}),new Promise(n=>{setTimeout(()=>n("iframe load timeout"),ne.toMiliseconds(ne.ONE_SECOND/2))})])}catch(n){this.logger.error(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.error(n)}},this.logger=Re.generateChildLogger(i,this.name),this.verifyUrl=al,this.abortController=new AbortController,this.isDevEnv=xm()&&{}.IS_VITEST}get context(){return Re.getLoggerContext(this.logger)}startAbortTimer(r){return setTimeout(()=>this.abortController.abort(),ne.toMiliseconds(r))}}var kb=Object.defineProperty,gl=Object.getOwnPropertySymbols,Kb=Object.prototype.hasOwnProperty,Vb=Object.prototype.propertyIsEnumerable,yl=(c,r,i)=>r in c?kb(c,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):c[r]=i,vl=(c,r)=>{for(var i in r||(r={}))Kb.call(r,i)&&yl(c,i,r[i]);if(gl)for(var i of gl(r))Vb.call(r,i)&&yl(c,i,r[i]);return c};class xc extends O1{constructor(r){super(r),this.protocol=yf,this.version=G_,this.name=Ic,this.events=new Cr.EventEmitter,this.initialized=!1,this.on=(n,o)=>this.events.on(n,o),this.once=(n,o)=>this.events.once(n,o),this.off=(n,o)=>this.events.off(n,o),this.removeListener=(n,o)=>this.events.removeListener(n,o),this.projectId=r==null?void 0:r.projectId,this.relayUrl=(r==null?void 0:r.relayUrl)||mf;const i=typeof(r==null?void 0:r.logger)<"u"&&typeof(r==null?void 0:r.logger)!="string"?r.logger:Re.pino(Re.getDefaultLoggerOptions({level:(r==null?void 0:r.logger)||W_.logger}));this.logger=Re.generateChildLogger(i,this.name),this.heartbeat=new gs.HeartBeat,this.crypto=new Eb(this,this.logger,r==null?void 0:r.keychain),this.history=new qb(this,this.logger),this.expirer=new Bb(this,this.logger),this.storage=r!=null&&r.storage?r.storage:new _1(vl(vl({},J_),r==null?void 0:r.storageOptions)),this.relayer=new $b({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new Ub(this,this.logger),this.verify=new Hb(this.projectId||"",this.logger)}static async init(r){const i=new xc(r);await i.initialize();const n=await i.crypto.getClientId();return await i.storage.setItem(lb,n),i}get context(){return Re.getLoggerContext(this.logger)}async start(){this.initialized||await this.initialize()}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.initialized=!0,this.logger.info("Core Initialization Success")}catch(r){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,r),this.logger.error(r.message),r}}}const Gb=xc,wf="wc",_f=2,bf="client",Sc=`${wf}@${_f}:${bf}:`,ec={name:bf,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},Wb="WALLETCONNECT_DEEPLINK_CHOICE",Jb="proposal",Ef="Proposal expired",Yb="session",eo=ne.SEVEN_DAYS,Xb="engine",Us={wc_sessionPropose:{req:{ttl:ne.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:ne.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:ne.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:ne.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:ne.ONE_DAY,prompt:!1,tag:1104},res:{ttl:ne.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:ne.ONE_DAY,prompt:!1,tag:1106},res:{ttl:ne.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:ne.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:ne.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:ne.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:ne.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:ne.ONE_DAY,prompt:!1,tag:1112},res:{ttl:ne.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:ne.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:ne.THIRTY_SECONDS,prompt:!1,tag:1115}}},tc={min:ne.FIVE_MINUTES,max:ne.SEVEN_DAYS},Zb="request",Qb=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"];var eE=Object.defineProperty,tE=Object.defineProperties,rE=Object.getOwnPropertyDescriptors,ml=Object.getOwnPropertySymbols,iE=Object.prototype.hasOwnProperty,sE=Object.prototype.propertyIsEnumerable,wl=(c,r,i)=>r in c?eE(c,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):c[r]=i,Sr=(c,r)=>{for(var i in r||(r={}))iE.call(r,i)&&wl(c,i,r[i]);if(ml)for(var i of ml(r))sE.call(r,i)&&wl(c,i,r[i]);return c},rc=(c,r)=>tE(c,rE(r));class nE extends z1{constructor(r){super(r),this.name=Xb,this.events=new vc,this.initialized=!1,this.ignoredPayloadTypes=[$l],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.client.core.pairing.register({methods:Object.keys(Us)}),this.initialized=!0)},this.connect=async i=>{this.isInitialized();const n=rc(Sr({},i),{requiredNamespaces:i.requiredNamespaces||{},optionalNamespaces:i.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:o,requiredNamespaces:l,optionalNamespaces:d,sessionProperties:v,relays:b}=n;let m=o,S,O=!1;if(m&&(O=this.client.core.pairing.pairings.get(m).active),!m||!O){const{topic:fe,uri:pe}=await this.client.core.pairing.create();m=fe,S=pe}const F=await this.client.core.crypto.generateKeyPair(),z=Sr({requiredNamespaces:l,optionalNamespaces:d,relays:b??[{protocol:vf}],proposer:{publicKey:F,metadata:this.client.metadata}},v&&{sessionProperties:v}),{reject:R,resolve:K,done:re}=hs(ne.FIVE_MINUTES,Ef);if(this.events.once(Ft("session_connect"),async({error:fe,session:pe})=>{if(fe)R(fe);else if(pe){pe.self.publicKey=F;const de=rc(Sr({},pe),{requiredNamespaces:pe.requiredNamespaces,optionalNamespaces:pe.optionalNamespaces});await this.client.session.set(pe.topic,de),await this.setExpiry(pe.topic,pe.expiry),m&&await this.client.core.pairing.updateMetadata({topic:m,metadata:pe.peer.metadata}),K(de)}}),!m){const{message:fe}=Q("NO_MATCHING_KEY",`connect() pairing topic: ${m}`);throw new Error(fe)}const he=await this.sendRequest(m,"wc_sessionPropose",z),le=Lr(ne.FIVE_MINUTES);return await this.setProposal(he,Sr({id:he,expiry:le},z)),{uri:S,approval:re}},this.pair=async i=>(this.isInitialized(),await this.client.core.pairing.pair(i)),this.approve=async i=>{this.isInitialized(),await this.isValidApprove(i);const{id:n,relayProtocol:o,namespaces:l,sessionProperties:d}=i,v=this.client.proposal.get(n);let{pairingTopic:b,proposer:m,requiredNamespaces:S,optionalNamespaces:O}=v;b=b||"",so(S)||(S=Pm(l,"approve()"));const F=await this.client.core.crypto.generateKeyPair(),z=m.publicKey,R=await this.client.core.crypto.generateSharedKey(F,z);b&&n&&(await this.client.core.pairing.updateMetadata({topic:b,metadata:m.metadata}),await this.sendResult(n,b,{relay:{protocol:o??"irn"},responderPublicKey:F}),await this.client.proposal.delete(n,tr("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:b}));const K=Sr({relay:{protocol:o??"irn"},namespaces:l,requiredNamespaces:S,optionalNamespaces:O,pairingTopic:b,controller:{publicKey:F,metadata:this.client.metadata},expiry:Lr(eo)},d&&{sessionProperties:d});await this.client.core.relayer.subscribe(R),await this.sendRequest(R,"wc_sessionSettle",K);const re=rc(Sr({},K),{topic:R,pairingTopic:b,acknowledged:!1,self:K.controller,peer:{publicKey:m.publicKey,metadata:m.metadata},controller:F});return await this.client.session.set(R,re),await this.setExpiry(R,Lr(eo)),{topic:R,acknowledged:()=>new Promise(he=>setTimeout(()=>he(this.client.session.get(R)),500))}},this.reject=async i=>{this.isInitialized(),await this.isValidReject(i);const{id:n,reason:o}=i,{pairingTopic:l}=this.client.proposal.get(n);l&&(await this.sendError(n,l,o),await this.client.proposal.delete(n,tr("USER_DISCONNECTED")))},this.update=async i=>{this.isInitialized(),await this.isValidUpdate(i);const{topic:n,namespaces:o}=i,l=await this.sendRequest(n,"wc_sessionUpdate",{namespaces:o}),{done:d,resolve:v,reject:b}=hs();return this.events.once(Ft("session_update",l),({error:m})=>{m?b(m):v()}),await this.client.session.update(n,{namespaces:o}),{acknowledged:d}},this.extend=async i=>{this.isInitialized(),await this.isValidExtend(i);const{topic:n}=i,o=await this.sendRequest(n,"wc_sessionExtend",{}),{done:l,resolve:d,reject:v}=hs();return this.events.once(Ft("session_extend",o),({error:b})=>{b?v(b):d()}),await this.setExpiry(n,Lr(eo)),{acknowledged:l}},this.request=async i=>{this.isInitialized(),await this.isValidRequest(i);const{chainId:n,request:o,topic:l,expiry:d}=i,v=await this.sendRequest(l,"wc_sessionRequest",{request:o,chainId:n},d),{done:b,resolve:m,reject:S}=hs(d);this.events.once(Ft("session_request",v),({error:F,result:z})=>{F?S(F):m(z)}),this.client.events.emit("session_request_sent",{topic:l,request:o,chainId:n,id:v});const O=await this.client.core.storage.getItem(Wb);return Am({id:v,topic:l,wcDeepLink:O}),await b()},this.respond=async i=>{this.isInitialized(),await this.isValidRespond(i);const{topic:n,response:o}=i,{id:l}=o;ai(o)?await this.sendResult(l,n,o.result):$r(o)&&await this.sendError(l,n,o.error),this.deletePendingSessionRequest(i.response.id,{message:"fulfilled",code:0})},this.ping=async i=>{this.isInitialized(),await this.isValidPing(i);const{topic:n}=i;if(this.client.session.keys.includes(n)){const o=await this.sendRequest(n,"wc_sessionPing",{}),{done:l,resolve:d,reject:v}=hs();this.events.once(Ft("session_ping",o),({error:b})=>{b?v(b):d()}),await l()}else this.client.core.pairing.pairings.keys.includes(n)&&await this.client.core.pairing.ping({topic:n})},this.emit=async i=>{this.isInitialized(),await this.isValidEmit(i);const{topic:n,event:o,chainId:l}=i;await this.sendRequest(n,"wc_sessionEvent",{event:o,chainId:l})},this.disconnect=async i=>{this.isInitialized(),await this.isValidDisconnect(i);const{topic:n}=i;if(this.client.session.keys.includes(n)){const o=_c().toString();let l;const d=v=>{(v==null?void 0:v.id.toString())===o&&(this.client.core.relayer.events.removeListener(vt.message_ack,d),l())};await Promise.all([new Promise(v=>{l=v,this.client.core.relayer.on(vt.message_ack,d)}),this.sendRequest(n,"wc_sessionDelete",tr("USER_DISCONNECTED"),void 0,o)]),await this.deleteSession(n)}else await this.client.core.pairing.disconnect({topic:n})},this.find=i=>(this.isInitialized(),this.client.session.getAll().filter(n=>Cm(n,i))),this.getPendingSessionRequests=()=>(this.isInitialized(),this.client.pendingRequest.getAll()),this.cleanupDuplicatePairings=async i=>{if(i.pairingTopic)try{const n=this.client.core.pairing.pairings.get(i.pairingTopic),o=this.client.core.pairing.pairings.getAll().filter(l=>{var d,v;return((d=l.peerMetadata)==null?void 0:d.url)&&((v=l.peerMetadata)==null?void 0:v.url)===i.peer.metadata.url&&l.topic&&l.topic!==n.topic});if(o.length===0)return;this.client.logger.info(`Cleaning up ${o.length} duplicate pairing(s)`),await Promise.all(o.map(l=>this.client.core.pairing.disconnect({topic:l.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(n){this.client.logger.error(n)}},this.deleteSession=async(i,n)=>{const{self:o}=this.client.session.get(i);await this.client.core.relayer.unsubscribe(i),this.client.session.delete(i,tr("USER_DISCONNECTED")),this.client.core.crypto.keychain.has(o.publicKey)&&await this.client.core.crypto.deleteKeyPair(o.publicKey),this.client.core.crypto.keychain.has(i)&&await this.client.core.crypto.deleteSymKey(i),n||this.client.core.expirer.del(i)},this.deleteProposal=async(i,n)=>{await Promise.all([this.client.proposal.delete(i,tr("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(i)])},this.deletePendingSessionRequest=async(i,n,o=!1)=>{await Promise.all([this.client.pendingRequest.delete(i,n),o?Promise.resolve():this.client.core.expirer.del(i)])},this.setExpiry=async(i,n)=>{this.client.session.keys.includes(i)&&await this.client.session.update(i,{expiry:n}),this.client.core.expirer.set(i,n)},this.setProposal=async(i,n)=>{await this.client.proposal.set(i,n),this.client.core.expirer.set(i,n.expiry)},this.setPendingSessionRequest=async i=>{const n=Us.wc_sessionRequest.req.ttl,{id:o,topic:l,params:d}=i;await this.client.pendingRequest.set(o,{id:o,topic:l,params:d}),n&&this.client.core.expirer.set(o,Lr(n))},this.sendRequest=async(i,n,o,l,d)=>{const v=po(n,o);if(jl()&&Qb.includes(n)){const S=fs(JSON.stringify(v));await this.client.core.verify.register({attestationId:S})}const b=await this.client.core.crypto.encode(i,v),m=Us[n].req;return l&&(m.ttl=l),d&&(m.id=d),this.client.core.history.set(i,v),this.client.core.relayer.publish(i,b,m),v.id},this.sendResult=async(i,n,o)=>{const l=bc(i,o),d=await this.client.core.crypto.encode(n,l),v=await this.client.core.history.get(n,i),b=Us[v.request.method].res;this.client.core.relayer.publish(n,d,b),await this.client.core.history.resolve(l)},this.sendError=async(i,n,o)=>{const l=go(i,o),d=await this.client.core.crypto.encode(n,l),v=await this.client.core.history.get(n,i),b=Us[v.request.method].res;this.client.core.relayer.publish(n,d,b),await this.client.core.history.resolve(l)},this.cleanup=async()=>{const i=[],n=[];this.client.session.getAll().forEach(o=>{wi(o.expiry)&&i.push(o.topic)}),this.client.proposal.getAll().forEach(o=>{wi(o.expiry)&&n.push(o.id)}),await Promise.all([...i.map(o=>this.deleteSession(o)),...n.map(o=>this.deleteProposal(o))])},this.onRelayEventRequest=i=>{const{topic:n,payload:o}=i,l=o.method;switch(l){case"wc_sessionPropose":return this.onSessionProposeRequest(n,o);case"wc_sessionSettle":return this.onSessionSettleRequest(n,o);case"wc_sessionUpdate":return this.onSessionUpdateRequest(n,o);case"wc_sessionExtend":return this.onSessionExtendRequest(n,o);case"wc_sessionPing":return this.onSessionPingRequest(n,o);case"wc_sessionDelete":return this.onSessionDeleteRequest(n,o);case"wc_sessionRequest":return this.onSessionRequest(n,o);case"wc_sessionEvent":return this.onSessionEventRequest(n,o);default:return this.client.logger.info(`Unsupported request method ${l}`)}},this.onRelayEventResponse=async i=>{const{topic:n,payload:o}=i,l=(await this.client.core.history.get(n,o.id)).request.method;switch(l){case"wc_sessionPropose":return this.onSessionProposeResponse(n,o);case"wc_sessionSettle":return this.onSessionSettleResponse(n,o);case"wc_sessionUpdate":return this.onSessionUpdateResponse(n,o);case"wc_sessionExtend":return this.onSessionExtendResponse(n,o);case"wc_sessionPing":return this.onSessionPingResponse(n,o);case"wc_sessionRequest":return this.onSessionRequestResponse(n,o);default:return this.client.logger.info(`Unsupported response method ${l}`)}},this.onRelayEventUnknownPayload=i=>{const{topic:n}=i,{message:o}=Q("MISSING_OR_INVALID",`Decoded payload on topic ${n} is not identifiable as a JSON-RPC request or a response.`);throw new Error(o)},this.onSessionProposeRequest=async(i,n)=>{const{params:o,id:l}=n;try{this.isValidConnect(Sr({},n.params));const d=Lr(ne.FIVE_MINUTES),v=Sr({id:l,pairingTopic:i,expiry:d},o);await this.setProposal(l,v);const b=fs(JSON.stringify(n)),m=await this.getVerifyContext(b,v.proposer.metadata);this.client.events.emit("session_proposal",{id:l,params:v,verifyContext:m})}catch(d){await this.sendError(l,i,d),this.client.logger.error(d)}},this.onSessionProposeResponse=async(i,n)=>{const{id:o}=n;if(ai(n)){const{result:l}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:l});const d=this.client.proposal.get(o);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:d});const v=d.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:v});const b=l.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:b});const m=await this.client.core.crypto.generateSharedKey(v,b);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:m});const S=await this.client.core.relayer.subscribe(m);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:S}),await this.client.core.pairing.activate({topic:i})}else $r(n)&&(await this.client.proposal.delete(o,tr("USER_DISCONNECTED")),this.events.emit(Ft("session_connect"),{error:n.error}))},this.onSessionSettleRequest=async(i,n)=>{const{id:o,params:l}=n;try{this.isValidSessionSettleRequest(l);const{relay:d,controller:v,expiry:b,namespaces:m,requiredNamespaces:S,optionalNamespaces:O,sessionProperties:F,pairingTopic:z}=n.params,R=Sr({topic:i,relay:d,expiry:b,namespaces:m,acknowledged:!0,pairingTopic:z,requiredNamespaces:S,optionalNamespaces:O,controller:v.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:v.publicKey,metadata:v.metadata}},F&&{sessionProperties:F});await this.sendResult(n.id,i,!0),this.events.emit(Ft("session_connect"),{session:R}),this.cleanupDuplicatePairings(R)}catch(d){await this.sendError(o,i,d),this.client.logger.error(d)}},this.onSessionSettleResponse=async(i,n)=>{const{id:o}=n;ai(n)?(await this.client.session.update(i,{acknowledged:!0}),this.events.emit(Ft("session_approve",o),{})):$r(n)&&(await this.client.session.delete(i,tr("USER_DISCONNECTED")),this.events.emit(Ft("session_approve",o),{error:n.error}))},this.onSessionUpdateRequest=async(i,n)=>{const{params:o,id:l}=n;try{this.isValidUpdate(Sr({topic:i},o)),await this.client.session.update(i,{namespaces:o.namespaces}),await this.sendResult(l,i,!0),this.client.events.emit("session_update",{id:l,topic:i,params:o})}catch(d){await this.sendError(l,i,d),this.client.logger.error(d)}},this.onSessionUpdateResponse=(i,n)=>{const{id:o}=n;ai(n)?this.events.emit(Ft("session_update",o),{}):$r(n)&&this.events.emit(Ft("session_update",o),{error:n.error})},this.onSessionExtendRequest=async(i,n)=>{const{id:o}=n;try{this.isValidExtend({topic:i}),await this.setExpiry(i,Lr(eo)),await this.sendResult(o,i,!0),this.client.events.emit("session_extend",{id:o,topic:i})}catch(l){await this.sendError(o,i,l),this.client.logger.error(l)}},this.onSessionExtendResponse=(i,n)=>{const{id:o}=n;ai(n)?this.events.emit(Ft("session_extend",o),{}):$r(n)&&this.events.emit(Ft("session_extend",o),{error:n.error})},this.onSessionPingRequest=async(i,n)=>{const{id:o}=n;try{this.isValidPing({topic:i}),await this.sendResult(o,i,!0),this.client.events.emit("session_ping",{id:o,topic:i})}catch(l){await this.sendError(o,i,l),this.client.logger.error(l)}},this.onSessionPingResponse=(i,n)=>{const{id:o}=n;setTimeout(()=>{ai(n)?this.events.emit(Ft("session_ping",o),{}):$r(n)&&this.events.emit(Ft("session_ping",o),{error:n.error})},500)},this.onSessionDeleteRequest=async(i,n)=>{const{id:o}=n;try{this.isValidDisconnect({topic:i,reason:n.params}),await Promise.all([new Promise(l=>{this.client.core.relayer.once(vt.publish,async()=>{l(await this.deleteSession(i))})}),this.sendResult(o,i,!0)]),this.client.events.emit("session_delete",{id:o,topic:i})}catch(l){this.client.logger.error(l)}},this.onSessionRequest=async(i,n)=>{const{id:o,params:l}=n;try{this.isValidRequest(Sr({topic:i},l)),await this.setPendingSessionRequest({id:o,topic:i,params:l});const d=fs(JSON.stringify(n)),v=this.client.session.get(i),b=await this.getVerifyContext(d,v.peer.metadata);this.client.events.emit("session_request",{id:o,topic:i,params:l,verifyContext:b})}catch(d){await this.sendError(o,i,d),this.client.logger.error(d)}},this.onSessionRequestResponse=(i,n)=>{const{id:o}=n;ai(n)?this.events.emit(Ft("session_request",o),{result:n.result}):$r(n)&&this.events.emit(Ft("session_request",o),{error:n.error})},this.onSessionEventRequest=async(i,n)=>{const{id:o,params:l}=n;try{this.isValidEmit(Sr({topic:i},l)),this.client.events.emit("session_event",{id:o,topic:i,params:l})}catch(d){await this.sendError(o,i,d),this.client.logger.error(d)}},this.isValidConnect=async i=>{if(!ur(i)){const{message:b}=Q("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(i)}`);throw new Error(b)}const{pairingTopic:n,requiredNamespaces:o,optionalNamespaces:l,sessionProperties:d,relays:v}=i;if(_i(n)||await this.isValidPairingTopic(n),!Om(v,!0)){const{message:b}=Q("MISSING_OR_INVALID",`connect() relays: ${v}`);throw new Error(b)}!_i(o)&&so(o)!==0&&this.validateNamespaces(o,"requiredNamespaces"),!_i(l)&&so(l)!==0&&this.validateNamespaces(l,"optionalNamespaces"),_i(d)||this.validateSessionProps(d,"sessionProperties")},this.validateNamespaces=(i,n)=>{const o=Rm(i,"connect()",n);if(o)throw new Error(o.message)},this.isValidApprove=async i=>{if(!ur(i))throw new Error(Q("MISSING_OR_INVALID",`approve() params: ${i}`).message);const{id:n,namespaces:o,relayProtocol:l,sessionProperties:d}=i;await this.isValidProposalId(n);const v=this.client.proposal.get(n),b=Ha(o,"approve()");if(b)throw new Error(b.message);const m=Oh(v.requiredNamespaces,o,"approve()");if(m)throw new Error(m.message);if(!ls(l,!0)){const{message:S}=Q("MISSING_OR_INVALID",`approve() relayProtocol: ${l}`);throw new Error(S)}_i(d)||this.validateSessionProps(d,"sessionProperties")},this.isValidReject=async i=>{if(!ur(i)){const{message:l}=Q("MISSING_OR_INVALID",`reject() params: ${i}`);throw new Error(l)}const{id:n,reason:o}=i;if(await this.isValidProposalId(n),!Tm(o)){const{message:l}=Q("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(o)}`);throw new Error(l)}},this.isValidSessionSettleRequest=i=>{if(!ur(i)){const{message:m}=Q("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${i}`);throw new Error(m)}const{relay:n,controller:o,namespaces:l,expiry:d}=i;if(!Nm(n)){const{message:m}=Q("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(m)}const v=Dm(o,"onSessionSettleRequest()");if(v)throw new Error(v.message);const b=Ha(l,"onSessionSettleRequest()");if(b)throw new Error(b.message);if(wi(d)){const{message:m}=Q("EXPIRED","onSessionSettleRequest()");throw new Error(m)}},this.isValidUpdate=async i=>{if(!ur(i)){const{message:b}=Q("MISSING_OR_INVALID",`update() params: ${i}`);throw new Error(b)}const{topic:n,namespaces:o}=i;await this.isValidSessionTopic(n);const l=this.client.session.get(n),d=Ha(o,"update()");if(d)throw new Error(d.message);const v=Oh(l.requiredNamespaces,o,"update()");if(v)throw new Error(v.message)},this.isValidExtend=async i=>{if(!ur(i)){const{message:o}=Q("MISSING_OR_INVALID",`extend() params: ${i}`);throw new Error(o)}const{topic:n}=i;await this.isValidSessionTopic(n)},this.isValidRequest=async i=>{if(!ur(i)){const{message:b}=Q("MISSING_OR_INVALID",`request() params: ${i}`);throw new Error(b)}const{topic:n,request:o,chainId:l,expiry:d}=i;await this.isValidSessionTopic(n);const{namespaces:v}=this.client.session.get(n);if(!Rh(v,l)){const{message:b}=Q("MISSING_OR_INVALID",`request() chainId: ${l}`);throw new Error(b)}if(!Fm(o)){const{message:b}=Q("MISSING_OR_INVALID",`request() ${JSON.stringify(o)}`);throw new Error(b)}if(!Lm(v,l,o.method)){const{message:b}=Q("MISSING_OR_INVALID",`request() method: ${o.method}`);throw new Error(b)}if(d&&!$m(d,tc)){const{message:b}=Q("MISSING_OR_INVALID",`request() expiry: ${d}. Expiry must be a number (in seconds) between ${tc.min} and ${tc.max}`);throw new Error(b)}},this.isValidRespond=async i=>{if(!ur(i)){const{message:l}=Q("MISSING_OR_INVALID",`respond() params: ${i}`);throw new Error(l)}const{topic:n,response:o}=i;if(await this.isValidSessionTopic(n),!Mm(o)){const{message:l}=Q("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(o)}`);throw new Error(l)}},this.isValidPing=async i=>{if(!ur(i)){const{message:o}=Q("MISSING_OR_INVALID",`ping() params: ${i}`);throw new Error(o)}const{topic:n}=i;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async i=>{if(!ur(i)){const{message:v}=Q("MISSING_OR_INVALID",`emit() params: ${i}`);throw new Error(v)}const{topic:n,event:o,chainId:l}=i;await this.isValidSessionTopic(n);const{namespaces:d}=this.client.session.get(n);if(!Rh(d,l)){const{message:v}=Q("MISSING_OR_INVALID",`emit() chainId: ${l}`);throw new Error(v)}if(!jm(o)){const{message:v}=Q("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(o)}`);throw new Error(v)}if(!zm(d,l,o.name)){const{message:v}=Q("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(o)}`);throw new Error(v)}},this.isValidDisconnect=async i=>{if(!ur(i)){const{message:o}=Q("MISSING_OR_INVALID",`disconnect() params: ${i}`);throw new Error(o)}const{topic:n}=i;await this.isValidSessionOrPairingTopic(n)},this.getVerifyContext=async(i,n)=>{const o={verified:{verifyUrl:n.verifyUrl||"",validation:"UNKNOWN",origin:n.url||""}};try{const l=await this.client.core.verify.resolve({attestationId:i,verifyUrl:n.verifyUrl});l&&(o.verified.origin=l,o.verified.validation=l===n.url?"VALID":"INVALID")}catch(l){this.client.logger.error(l)}return this.client.logger.info(`Verify context: ${JSON.stringify(o)}`),o},this.validateSessionProps=(i,n)=>{Object.values(i).forEach(o=>{if(!ls(o,!1)){const{message:l}=Q("MISSING_OR_INVALID",`${n} must be in Record format. Received: ${JSON.stringify(o)}`);throw new Error(l)}})}}isInitialized(){if(!this.initialized){const{message:r}=Q("NOT_INITIALIZED",this.name);throw new Error(r)}}registerRelayerEvents(){this.client.core.relayer.on(vt.message,async r=>{const{topic:i,message:n}=r;if(this.ignoredPayloadTypes.includes(this.client.core.crypto.getPayloadType(n)))return;const o=await this.client.core.crypto.decode(i,n);Ec(o)?(this.client.core.history.set(i,o),this.onRelayEventRequest({topic:i,payload:o})):yo(o)?(await this.client.core.history.resolve(o),await this.onRelayEventResponse({topic:i,payload:o}),this.client.core.history.delete(i,o.id)):this.onRelayEventUnknownPayload({topic:i,payload:o})})}registerExpirerEvents(){this.client.core.expirer.on(Pr.expired,async r=>{const{topic:i,id:n}=Ml(r.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,Q("EXPIRED"),!0);i?this.client.session.keys.includes(i)&&(await this.deleteSession(i,!0),this.client.events.emit("session_expire",{topic:i})):n&&(await this.deleteProposal(n,!0),this.client.events.emit("proposal_expire",{id:n}))})}isValidPairingTopic(r){if(!ls(r,!1)){const{message:i}=Q("MISSING_OR_INVALID",`pairing topic should be a string: ${r}`);throw new Error(i)}if(!this.client.core.pairing.pairings.keys.includes(r)){const{message:i}=Q("NO_MATCHING_KEY",`pairing topic doesn't exist: ${r}`);throw new Error(i)}if(wi(this.client.core.pairing.pairings.get(r).expiry)){const{message:i}=Q("EXPIRED",`pairing topic: ${r}`);throw new Error(i)}}async isValidSessionTopic(r){if(!ls(r,!1)){const{message:i}=Q("MISSING_OR_INVALID",`session topic should be a string: ${r}`);throw new Error(i)}if(!this.client.session.keys.includes(r)){const{message:i}=Q("NO_MATCHING_KEY",`session topic doesn't exist: ${r}`);throw new Error(i)}if(wi(this.client.session.get(r).expiry)){await this.deleteSession(r);const{message:i}=Q("EXPIRED",`session topic: ${r}`);throw new Error(i)}}async isValidSessionOrPairingTopic(r){if(this.client.session.keys.includes(r))await this.isValidSessionTopic(r);else if(this.client.core.pairing.pairings.keys.includes(r))this.isValidPairingTopic(r);else if(ls(r,!1)){const{message:i}=Q("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${r}`);throw new Error(i)}else{const{message:i}=Q("MISSING_OR_INVALID",`session or pairing topic should be a string: ${r}`);throw new Error(i)}}async isValidProposalId(r){if(!Um(r)){const{message:i}=Q("MISSING_OR_INVALID",`proposal id should be a number: ${r}`);throw new Error(i)}if(!this.client.proposal.keys.includes(r)){const{message:i}=Q("NO_MATCHING_KEY",`proposal id doesn't exist: ${r}`);throw new Error(i)}if(wi(this.client.proposal.get(r).expiry)){await this.deleteProposal(r);const{message:i}=Q("EXPIRED",`proposal id: ${r}`);throw new Error(i)}}}class oE extends mo{constructor(r,i){super(r,i,Jb,Sc),this.core=r,this.logger=i}}class aE extends mo{constructor(r,i){super(r,i,Yb,Sc),this.core=r,this.logger=i}}class cE extends mo{constructor(r,i){super(r,i,Zb,Sc,n=>n.id),this.core=r,this.logger=i}}let uE=class If extends j1{constructor(r){super(r),this.protocol=wf,this.version=_f,this.name=ec.name,this.events=new Cr.EventEmitter,this.on=(n,o)=>this.events.on(n,o),this.once=(n,o)=>this.events.once(n,o),this.off=(n,o)=>this.events.off(n,o),this.removeListener=(n,o)=>this.events.removeListener(n,o),this.removeAllListeners=n=>this.events.removeAllListeners(n),this.connect=async n=>{try{return await this.engine.connect(n)}catch(o){throw this.logger.error(o.message),o}},this.pair=async n=>{try{return await this.engine.pair(n)}catch(o){throw this.logger.error(o.message),o}},this.approve=async n=>{try{return await this.engine.approve(n)}catch(o){throw this.logger.error(o.message),o}},this.reject=async n=>{try{return await this.engine.reject(n)}catch(o){throw this.logger.error(o.message),o}},this.update=async n=>{try{return await this.engine.update(n)}catch(o){throw this.logger.error(o.message),o}},this.extend=async n=>{try{return await this.engine.extend(n)}catch(o){throw this.logger.error(o.message),o}},this.request=async n=>{try{return await this.engine.request(n)}catch(o){throw this.logger.error(o.message),o}},this.respond=async n=>{try{return await this.engine.respond(n)}catch(o){throw this.logger.error(o.message),o}},this.ping=async n=>{try{return await this.engine.ping(n)}catch(o){throw this.logger.error(o.message),o}},this.emit=async n=>{try{return await this.engine.emit(n)}catch(o){throw this.logger.error(o.message),o}},this.disconnect=async n=>{try{return await this.engine.disconnect(n)}catch(o){throw this.logger.error(o.message),o}},this.find=n=>{try{return this.engine.find(n)}catch(o){throw this.logger.error(o.message),o}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(n){throw this.logger.error(n.message),n}},this.name=(r==null?void 0:r.name)||ec.name,this.metadata=(r==null?void 0:r.metadata)||Sm();const i=typeof(r==null?void 0:r.logger)<"u"&&typeof(r==null?void 0:r.logger)!="string"?r.logger:Re.pino(Re.getDefaultLoggerOptions({level:(r==null?void 0:r.logger)||ec.logger}));this.core=(r==null?void 0:r.core)||new Gb(r),this.logger=Re.generateChildLogger(i,this.name),this.session=new aE(this.core,this.logger),this.proposal=new oE(this.core,this.logger),this.pendingRequest=new cE(this.core,this.logger),this.engine=new nE(this)}static async init(r){const i=new If(r);return await i.initialize(),i}get context(){return Re.getLoggerContext(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.engine.init(),this.core.verify.init({verifyUrl:this.metadata.verifyUrl}),this.logger.info("SignClient Initialization Success")}catch(r){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(r.message),r}}};var lc={exports:{}};(function(c,r){var i=typeof self<"u"?self:Mr,n=function(){function l(){this.fetch=!1,this.DOMException=i.DOMException}return l.prototype=i,new l}();(function(l){(function(d){var v={searchParams:"URLSearchParams"in l,iterable:"Symbol"in l&&"iterator"in Symbol,blob:"FileReader"in l&&"Blob"in l&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in l,arrayBuffer:"ArrayBuffer"in l};function b(y){return y&&DataView.prototype.isPrototypeOf(y)}if(v.arrayBuffer)var m=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],S=ArrayBuffer.isView||function(y){return y&&m.indexOf(Object.prototype.toString.call(y))>-1};function O(y){if(typeof y!="string"&&(y=String(y)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(y))throw new TypeError("Invalid character in header field name");return y.toLowerCase()}function F(y){return typeof y!="string"&&(y=String(y)),y}function z(y){var I={next:function(){var X=y.shift();return{done:X===void 0,value:X}}};return v.iterable&&(I[Symbol.iterator]=function(){return I}),I}function R(y){this.map={},y instanceof R?y.forEach(function(I,X){this.append(X,I)},this):Array.isArray(y)?y.forEach(function(I){this.append(I[0],I[1])},this):y&&Object.getOwnPropertyNames(y).forEach(function(I){this.append(I,y[I])},this)}R.prototype.append=function(y,I){y=O(y),I=F(I);var X=this.map[y];this.map[y]=X?X+", "+I:I},R.prototype.delete=function(y){delete this.map[O(y)]},R.prototype.get=function(y){return y=O(y),this.has(y)?this.map[y]:null},R.prototype.has=function(y){return this.map.hasOwnProperty(O(y))},R.prototype.set=function(y,I){this.map[O(y)]=F(I)},R.prototype.forEach=function(y,I){for(var X in this.map)this.map.hasOwnProperty(X)&&y.call(I,this.map[X],X,this)},R.prototype.keys=function(){var y=[];return this.forEach(function(I,X){y.push(X)}),z(y)},R.prototype.values=function(){var y=[];return this.forEach(function(I){y.push(I)}),z(y)},R.prototype.entries=function(){var y=[];return this.forEach(function(I,X){y.push([X,I])}),z(y)},v.iterable&&(R.prototype[Symbol.iterator]=R.prototype.entries);function K(y){if(y.bodyUsed)return Promise.reject(new TypeError("Already read"));y.bodyUsed=!0}function re(y){return new Promise(function(I,X){y.onload=function(){I(y.result)},y.onerror=function(){X(y.error)}})}function he(y){var I=new FileReader,X=re(I);return I.readAsArrayBuffer(y),X}function le(y){var I=new FileReader,X=re(I);return I.readAsText(y),X}function fe(y){for(var I=new Uint8Array(y),X=new Array(I.length),ce=0;ce-1?I:y}function W(y,I){I=I||{};var X=I.body;if(y instanceof W){if(y.bodyUsed)throw new TypeError("Already read");this.url=y.url,this.credentials=y.credentials,I.headers||(this.headers=new R(y.headers)),this.method=y.method,this.mode=y.mode,this.signal=y.signal,!X&&y._bodyInit!=null&&(X=y._bodyInit,y.bodyUsed=!0)}else this.url=String(y);if(this.credentials=I.credentials||this.credentials||"same-origin",(I.headers||!this.headers)&&(this.headers=new R(I.headers)),this.method=q(I.method||this.method||"GET"),this.mode=I.mode||this.mode||null,this.signal=I.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&X)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(X)}W.prototype.clone=function(){return new W(this,{body:this._bodyInit})};function ve(y){var I=new FormData;return y.trim().split("&").forEach(function(X){if(X){var ce=X.split("="),V=ce.shift().replace(/\+/g," "),B=ce.join("=").replace(/\+/g," ");I.append(decodeURIComponent(V),decodeURIComponent(B))}}),I}function ie(y){var I=new R,X=y.replace(/\r?\n[\t ]+/g," ");return X.split(/\r?\n/).forEach(function(ce){var V=ce.split(":"),B=V.shift().trim();if(B){var k=V.join(":").trim();I.append(B,k)}}),I}de.call(W.prototype);function ue(y,I){I||(I={}),this.type="default",this.status=I.status===void 0?200:I.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in I?I.statusText:"OK",this.headers=new R(I.headers),this.url=I.url||"",this._initBody(y)}de.call(ue.prototype),ue.prototype.clone=function(){return new ue(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new R(this.headers),url:this.url})},ue.error=function(){var y=new ue(null,{status:0,statusText:""});return y.type="error",y};var Te=[301,302,303,307,308];ue.redirect=function(y,I){if(Te.indexOf(I)===-1)throw new RangeError("Invalid status code");return new ue(null,{status:I,headers:{location:y}})},d.DOMException=l.DOMException;try{new d.DOMException}catch{d.DOMException=function(I,X){this.message=I,this.name=X;var ce=Error(I);this.stack=ce.stack},d.DOMException.prototype=Object.create(Error.prototype),d.DOMException.prototype.constructor=d.DOMException}function Ue(y,I){return new Promise(function(X,ce){var V=new W(y,I);if(V.signal&&V.signal.aborted)return ce(new d.DOMException("Aborted","AbortError"));var B=new XMLHttpRequest;function k(){B.abort()}B.onload=function(){var G={status:B.status,statusText:B.statusText,headers:ie(B.getAllResponseHeaders()||"")};G.url="responseURL"in B?B.responseURL:G.headers.get("X-Request-URL");var Je="response"in B?B.response:B.responseText;X(new ue(Je,G))},B.onerror=function(){ce(new TypeError("Network request failed"))},B.ontimeout=function(){ce(new TypeError("Network request failed"))},B.onabort=function(){ce(new d.DOMException("Aborted","AbortError"))},B.open(V.method,V.url,!0),V.credentials==="include"?B.withCredentials=!0:V.credentials==="omit"&&(B.withCredentials=!1),"responseType"in B&&v.blob&&(B.responseType="blob"),V.headers.forEach(function(G,Je){B.setRequestHeader(Je,G)}),V.signal&&(V.signal.addEventListener("abort",k),B.onreadystatechange=function(){B.readyState===4&&V.signal.removeEventListener("abort",k)}),B.send(typeof V._bodyInit>"u"?null:V._bodyInit)})}return Ue.polyfill=!0,l.fetch||(l.fetch=Ue,l.Headers=R,l.Request=W,l.Response=ue),d.Headers=R,d.Request=W,d.Response=ue,d.fetch=Ue,Object.defineProperty(d,"__esModule",{value:!0}),d})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var o=n;r=o.fetch,r.default=o.fetch,r.fetch=o.fetch,r.Headers=o.Headers,r.Request=o.Request,r.Response=o.Response,c.exports=r})(lc,lc.exports);var hE=lc.exports;const _l=Ll(hE),lE={Accept:"application/json","Content-Type":"application/json"},fE="POST",bl={headers:lE,method:fE},El=10;class Hi{constructor(r,i=!1){if(this.url=r,this.disableProviderPing=i,this.events=new Cr.EventEmitter,this.isAvailable=!1,this.registering=!1,!Jh(r))throw new Error(`Provided URL is not compatible with HTTP connection: ${r}`);this.url=r,this.disableProviderPing=i}get connected(){return this.isAvailable}get connecting(){return this.registering}on(r,i){this.events.on(r,i)}once(r,i){this.events.once(r,i)}off(r,i){this.events.off(r,i)}removeListener(r,i){this.events.removeListener(r,i)}async open(r=this.url){await this.register(r)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(r,i){this.isAvailable||await this.register();try{const n=Ui(r),l=await(await _l(this.url,Object.assign(Object.assign({},bl),{body:n}))).json();this.onPayload({data:l})}catch(n){this.onError(r.id,n)}}async register(r=this.url){if(!Jh(r))throw new Error(`Provided URL is not compatible with HTTP connection: ${r}`);if(this.registering){const i=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=i||this.events.listenerCount("open")>=i)&&this.events.setMaxListeners(i+1),new Promise((n,o)=>{this.events.once("register_error",l=>{this.resetMaxListeners(),o(l)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return o(new Error("HTTP connection is missing or invalid"));n()})})}this.url=r,this.registering=!0;try{if(!this.disableProviderPing){const i=Ui({id:1,jsonrpc:"2.0",method:"test",params:[]});await _l(r,Object.assign(Object.assign({},bl),{body:i}))}this.onOpen()}catch(i){const n=this.parseError(i);throw this.events.emit("register_error",n),this.onClose(),n}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(r){if(typeof r.data>"u")return;const i=typeof r.data=="string"?Ks(r.data):r.data;this.events.emit("payload",i)}onError(r,i){const n=this.parseError(i),o=n.message||n.toString(),l=go(r,o);this.events.emit("payload",l)}parseError(r,i=this.url){return Ql(r,i,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>El&&this.events.setMaxListeners(El)}}const Il="error",pE="wss://relay.walletconnect.com",dE="wc",gE="universal_provider",xl=`${dE}@2:${gE}:`,yE="https://rpc.walletconnect.com/v1",Ii={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var qs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},fc={exports:{}};/** -* @license -* Lodash -* Copyright OpenJS Foundation and other contributors -* Released under MIT license -* Based on Underscore.js 1.8.3 -* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors -*/(function(c,r){(function(){var i,n="4.17.21",o=200,l="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",d="Expected a function",v="Invalid `variable` option passed into `_.template`",b="__lodash_hash_undefined__",m=500,S="__lodash_placeholder__",O=1,F=2,z=4,R=1,K=2,re=1,he=2,le=4,fe=8,pe=16,de=32,L=64,q=128,W=256,ve=512,ie=30,ue="...",Te=800,Ue=16,y=1,I=2,X=3,ce=1/0,V=9007199254740991,B=17976931348623157e292,k=0/0,G=4294967295,Je=G-1,He=G>>>1,jr=[["ary",q],["bind",re],["bindKey",he],["curry",fe],["curryRight",pe],["flip",ve],["partial",de],["partialRight",L],["rearg",W]],Ie="[object Arguments]",xt="[object Array]",D="[object AsyncFunction]",N="[object Boolean]",C="[object Date]",u="[object DOMException]",E="[object Error]",ee="[object Function]",ge="[object GeneratorFunction]",be="[object Map]",Ne="[object Number]",Fe="[object Null]",Pe="[object Object]",St="[object Promise]",mt="[object Proxy]",nt="[object RegExp]",$e="[object Set]",Xe="[object String]",Ze="[object Symbol]",ot="[object Undefined]",qe="[object WeakMap]",Qe="[object WeakSet]",De="[object ArrayBuffer]",ke="[object DataView]",ut="[object Float32Array]",je="[object Float64Array]",Pt="[object Int8Array]",Lt="[object Int16Array]",Bt="[object Int32Array]",Ht="[object Uint8Array]",jt="[object Uint8ClampedArray]",Wt="[object Uint16Array]",rr="[object Uint32Array]",zr=/\b__p \+= '';/g,Jt=/\b(__p \+=) '' \+/g,Gr=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ci=/&(?:amp|lt|gt|quot|#39);/g,xi=/[&<>"']/g,ht=RegExp(ci.source),rt=RegExp(xi.source),lt=/<%-([\s\S]+?)%>/g,ft=/<%([\s\S]+?)%>/g,at=/<%=([\s\S]+?)%>/g,it=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,At=/^\w*$/,Ct=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,pt=/[\\^$.*+?()[\]{}|]/g,Ot=RegExp(pt.source),dt=/^\s+/,wt=/\s/,gt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ye=/\{\n\/\* \[wrapped with (.+)\] \*/,Rt=/,? & /,Tt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,wo=/[()=,{}\[\]\/\s]/,_o=/\\(\\)?/g,bo=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,yr=/\w*$/,Eo=/^[-+]0x[0-9a-f]+$/i,Io=/^0b[01]+$/i,xo=/^\[object .+?Constructor\]$/,So=/^0o[0-7]+$/i,Po=/^(?:0|[1-9]\d*)$/,Wr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ki=/($^)/,Ao=/['\n\r\u2028\u2029\\]/g,Ki="\\ud800-\\udfff",Co="\\u0300-\\u036f",Oo="\\ufe20-\\ufe2f",Vi="\\u20d0-\\u20ff",Gs=Co+Oo+Vi,Ws="\\u2700-\\u27bf",Or="a-z\\xdf-\\xf6\\xf8-\\xff",Ro="\\xac\\xb1\\xd7\\xf7",To="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",No="\\u2000-\\u206f",Do=" \\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",Js="A-Z\\xc0-\\xd6\\xd8-\\xde",Ys="\\ufe0e\\ufe0f",Si=Ro+To+No+Do,ys="['’]",Pi="["+Ki+"]",vs="["+Si+"]",Ai="["+Gs+"]",Xs="\\d+",Fo="["+Ws+"]",Zs="["+Or+"]",Qs="[^"+Ki+Si+Xs+Ws+Or+Js+"]",Gi="\\ud83c[\\udffb-\\udfff]",Lo="(?:"+Ai+"|"+Gi+")",en="[^"+Ki+"]",Wi="(?:\\ud83c[\\udde6-\\uddff]){2}",ui="[\\ud800-\\udbff][\\udc00-\\udfff]",hr="["+Js+"]",tn="\\u200d",rn="(?:"+Zs+"|"+Qs+")",Ur="(?:"+hr+"|"+Qs+")",sn="(?:"+ys+"(?:d|ll|m|re|s|t|ve))?",nn="(?:"+ys+"(?:D|LL|M|RE|S|T|VE))?",on=Lo+"?",an="["+Ys+"]?",$o="(?:"+tn+"(?:"+[en,Wi,ui].join("|")+")"+an+on+")*",Jr="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",cn="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",un=an+on+$o,Ji="(?:"+[Fo,Wi,ui].join("|")+")"+un,Mo="(?:"+[en+Ai+"?",Ai,Wi,ui,Pi].join("|")+")",ms=RegExp(ys,"g"),jo=RegExp(Ai,"g"),Yi=RegExp(Gi+"(?="+Gi+")|"+Mo+un,"g"),hn=RegExp([hr+"?"+Zs+"+"+sn+"(?="+[vs,hr,"$"].join("|")+")",Ur+"+"+nn+"(?="+[vs,hr+rn,"$"].join("|")+")",hr+"?"+rn+"+"+sn,hr+"+"+nn,cn,Jr,Xs,Ji].join("|"),"g"),ln=RegExp("["+tn+Ki+Gs+Ys+"]"),Ci=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,fn=["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"],zo=-1,Ke={};Ke[ut]=Ke[je]=Ke[Pt]=Ke[Lt]=Ke[Bt]=Ke[Ht]=Ke[jt]=Ke[Wt]=Ke[rr]=!0,Ke[Ie]=Ke[xt]=Ke[De]=Ke[N]=Ke[ke]=Ke[C]=Ke[E]=Ke[ee]=Ke[be]=Ke[Ne]=Ke[Pe]=Ke[nt]=Ke[$e]=Ke[Xe]=Ke[qe]=!1;var Be={};Be[Ie]=Be[xt]=Be[De]=Be[ke]=Be[N]=Be[C]=Be[ut]=Be[je]=Be[Pt]=Be[Lt]=Be[Bt]=Be[be]=Be[Ne]=Be[Pe]=Be[nt]=Be[$e]=Be[Xe]=Be[Ze]=Be[Ht]=Be[jt]=Be[Wt]=Be[rr]=!0,Be[E]=Be[ee]=Be[qe]=!1;var g={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},x={"&":"&","<":"<",">":">",'"':""","'":"'"},U={"&":"&","<":"<",">":">",""":'"',"'":"'"},Y={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ve=parseFloat,me=parseInt,et=typeof qs=="object"&&qs&&qs.Object===Object&&qs,Nt=typeof self=="object"&&self&&self.Object===Object&&self,Ce=et||Nt||Function("return this")(),Ge=r&&!r.nodeType&&r,_t=Ge&&!0&&c&&!c.nodeType&&c,ir=_t&&_t.exports===Ge,Dt=ir&&et.process,tt=function(){try{var P=_t&&_t.require&&_t.require("util").types;return P||Dt&&Dt.binding&&Dt.binding("util")}catch{}}(),Yt=tt&&tt.isArrayBuffer,Rr=tt&&tt.isDate,vr=tt&&tt.isMap,qr=tt&&tt.isRegExp,ws=tt&&tt.isSet,Oi=tt&&tt.isTypedArray;function zt(P,$,T){switch(T.length){case 0:return P.call($);case 1:return P.call($,T[0]);case 2:return P.call($,T[0],T[1]);case 3:return P.call($,T[0],T[1],T[2])}return P.apply($,T)}function Pf(P,$,T,Z){for(var ye=-1,Le=P==null?0:P.length;++ye-1}function Uo(P,$,T){for(var Z=-1,ye=P==null?0:P.length;++Z-1;);return T}function Lc(P,$){for(var T=P.length;T--&&Xi($,P[T],0)>-1;);return T}function Lf(P,$){for(var T=P.length,Z=0;T--;)P[T]===$&&++Z;return Z}var $f=ko(g),Mf=ko(x);function jf(P){return"\\"+Y[P]}function zf(P,$){return P==null?i:P[$]}function Zi(P){return ln.test(P)}function Uf(P){return Ci.test(P)}function qf(P){for(var $,T=[];!($=P.next()).done;)T.push($.value);return T}function Wo(P){var $=-1,T=Array(P.size);return P.forEach(function(Z,ye){T[++$]=[ye,Z]}),T}function $c(P,$){return function(T){return P($(T))}}function fi(P,$){for(var T=-1,Z=P.length,ye=0,Le=[];++T-1}function Cp(e,t){var s=this.__data__,a=Rn(s,e);return a<0?(++this.size,s.push([e,t])):s[a][1]=t,this}Yr.prototype.clear=xp,Yr.prototype.delete=Sp,Yr.prototype.get=Pp,Yr.prototype.has=Ap,Yr.prototype.set=Cp;function Xr(e){var t=-1,s=e==null?0:e.length;for(this.clear();++t=t?e:t)),e}function br(e,t,s,a,h,p){var w,_=t&O,A=t&F,M=t&z;if(s&&(w=h?s(e,a,h,p):s(e)),w!==i)return w;if(!ct(e))return e;var j=we(e);if(j){if(w=Nd(e),!_)return sr(e,w)}else{var H=Gt(e),J=H==ee||H==ge;if(mi(e))return mu(e,_);if(H==Pe||H==Ie||J&&!h){if(w=A||J?{}:Mu(e),!_)return A?bd(e,kp(w,e)):_d(e,Wc(w,e))}else{if(!Be[H])return h?e:{};w=Dd(e,H,_)}}p||(p=new Nr);var te=p.get(e);if(te)return te;p.set(e,w),fh(e)?e.forEach(function(ae){w.add(br(ae,t,s,ae,e,p))}):hh(e)&&e.forEach(function(ae,Se){w.set(Se,br(ae,t,s,Se,e,p))});var oe=M?A?_a:wa:A?or:Ut,Ee=j?i:oe(e);return mr(Ee||e,function(ae,Se){Ee&&(Se=ae,ae=e[Se]),Ps(w,Se,br(ae,t,s,Se,e,p))}),w}function Kp(e){var t=Ut(e);return function(s){return Jc(s,e,t)}}function Jc(e,t,s){var a=s.length;if(e==null)return!a;for(e=We(e);a--;){var h=s[a],p=t[h],w=e[h];if(w===i&&!(h in e)||!p(w))return!1}return!0}function Yc(e,t,s){if(typeof e!="function")throw new wr(d);return Ds(function(){e.apply(i,s)},t)}function As(e,t,s,a){var h=-1,p=pn,w=!0,_=e.length,A=[],M=t.length;if(!_)return A;s&&(t=st(t,lr(s))),a?(p=Uo,w=!1):t.length>=o&&(p=_s,w=!1,t=new Ni(t));e:for(;++h<_;){var j=e[h],H=s==null?j:s(j);if(j=a||j!==0?j:0,w&&H===H){for(var J=M;J--;)if(t[J]===H)continue e;A.push(j)}else p(t,H,a)||A.push(j)}return A}var di=Iu(Br),Xc=Iu(ra,!0);function Vp(e,t){var s=!0;return di(e,function(a,h,p){return s=!!t(a,h,p),s}),s}function Tn(e,t,s){for(var a=-1,h=e.length;++ah?0:h+s),a=a===i||a>h?h:_e(a),a<0&&(a+=h),a=s>a?0:dh(a);s0&&s(_)?t>1?kt(_,t-1,s,a,h):li(h,_):a||(h[h.length]=_)}return h}var ta=xu(),Qc=xu(!0);function Br(e,t){return e&&ta(e,t,Ut)}function ra(e,t){return e&&Qc(e,t,Ut)}function Nn(e,t){return hi(t,function(s){return ri(e[s])})}function Fi(e,t){t=yi(t,e);for(var s=0,a=t.length;e!=null&&st}function Wp(e,t){return e!=null&&ze.call(e,t)}function Jp(e,t){return e!=null&&t in We(e)}function Yp(e,t,s){return e>=Vt(t,s)&&e=120&&j.length>=120)?new Ni(w&&j):i}j=e[0];var H=-1,J=_[0];e:for(;++H-1;)_!==e&&In.call(_,A,1),In.call(e,A,1);return e}function hu(e,t){for(var s=e?t.length:0,a=s-1;s--;){var h=t[s];if(s==a||h!==p){var p=h;ti(h)?In.call(e,h,1):fa(e,h)}}return e}function ua(e,t){return e+Pn(kc()*(t-e+1))}function ud(e,t,s,a){for(var h=-1,p=Mt(Sn((t-e)/(s||1)),0),w=T(p);p--;)w[a?p:++h]=e,e+=s;return w}function ha(e,t){var s="";if(!e||t<1||t>V)return s;do t%2&&(s+=e),t=Pn(t/2),t&&(e+=e);while(t);return s}function xe(e,t){return Aa(Uu(e,t,ar),e+"")}function hd(e){return Gc(us(e))}function ld(e,t){var s=us(e);return Hn(s,Di(t,0,s.length))}function Rs(e,t,s,a){if(!ct(e))return e;t=yi(t,e);for(var h=-1,p=t.length,w=p-1,_=e;_!=null&&++hh?0:h+t),s=s>h?h:s,s<0&&(s+=h),h=t>s?0:s-t>>>0,t>>>=0;for(var p=T(h);++a>>1,w=e[p];w!==null&&!pr(w)&&(s?w<=t:w=o){var M=t?null:Sd(e);if(M)return gn(M);w=!1,h=_s,A=new Ni}else A=t?[]:_;e:for(;++a=a?e:Er(e,t,s)}var vu=rp||function(e){return Ce.clearTimeout(e)};function mu(e,t){if(t)return e.slice();var s=e.length,a=zc?zc(s):new e.constructor(s);return e.copy(a),a}function ya(e){var t=new e.constructor(e.byteLength);return new bn(t).set(new bn(e)),t}function yd(e,t){var s=t?ya(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.byteLength)}function vd(e){var t=new e.constructor(e.source,yr.exec(e));return t.lastIndex=e.lastIndex,t}function md(e){return Ss?We(Ss.call(e)):{}}function wu(e,t){var s=t?ya(e.buffer):e.buffer;return new e.constructor(s,e.byteOffset,e.length)}function _u(e,t){if(e!==t){var s=e!==i,a=e===null,h=e===e,p=pr(e),w=t!==i,_=t===null,A=t===t,M=pr(t);if(!_&&!M&&!p&&e>t||p&&w&&A&&!_&&!M||a&&w&&A||!s&&A||!h)return 1;if(!a&&!p&&!M&&e=_)return A;var M=s[a];return A*(M=="desc"?-1:1)}}return e.index-t.index}function bu(e,t,s,a){for(var h=-1,p=e.length,w=s.length,_=-1,A=t.length,M=Mt(p-w,0),j=T(A+M),H=!a;++_1?s[h-1]:i,w=h>2?s[2]:i;for(p=e.length>3&&typeof p=="function"?(h--,p):i,w&&Zt(s[0],s[1],w)&&(p=h<3?i:p,h=1),t=We(t);++a-1?h[p?t[w]:w]:i}}function Au(e){return ei(function(t){var s=t.length,a=s,h=_r.prototype.thru;for(e&&t.reverse();a--;){var p=t[a];if(typeof p!="function")throw new wr(d);if(h&&!w&&qn(p)=="wrapper")var w=new _r([],!0)}for(a=w?a:s;++a1&&Oe.reverse(),j&&A_))return!1;var M=p.get(e),j=p.get(t);if(M&&j)return M==t&&j==e;var H=-1,J=!0,te=s&K?new Ni:i;for(p.set(e,t),p.set(t,e);++H<_;){var oe=e[H],Ee=t[H];if(a)var ae=w?a(Ee,oe,H,t,e,p):a(oe,Ee,H,e,t,p);if(ae!==i){if(ae)continue;J=!1;break}if(te){if(!Bo(t,function(Se,Oe){if(!_s(te,Oe)&&(oe===Se||h(oe,Se,s,a,p)))return te.push(Oe)})){J=!1;break}}else if(!(oe===Ee||h(oe,Ee,s,a,p))){J=!1;break}}return p.delete(e),p.delete(t),J}function Ad(e,t,s,a,h,p,w){switch(s){case ke:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case De:return!(e.byteLength!=t.byteLength||!p(new bn(e),new bn(t)));case N:case C:case Ne:return Dr(+e,+t);case E:return e.name==t.name&&e.message==t.message;case nt:case Xe:return e==t+"";case be:var _=Wo;case $e:var A=a&R;if(_||(_=gn),e.size!=t.size&&!A)return!1;var M=w.get(e);if(M)return M==t;a|=K,w.set(e,t);var j=Fu(_(e),_(t),a,h,p,w);return w.delete(e),j;case Ze:if(Ss)return Ss.call(e)==Ss.call(t)}return!1}function Cd(e,t,s,a,h,p){var w=s&R,_=wa(e),A=_.length,M=wa(t),j=M.length;if(A!=j&&!w)return!1;for(var H=A;H--;){var J=_[H];if(!(w?J in t:ze.call(t,J)))return!1}var te=p.get(e),oe=p.get(t);if(te&&oe)return te==t&&oe==e;var Ee=!0;p.set(e,t),p.set(t,e);for(var ae=w;++H1?"& ":"")+t[a],t=t.join(s>2?", ":" "),e.replace(gt,`{ -/* [wrapped with `+t+`] */ -`)}function Ld(e){return we(e)||Mi(e)||!!(Bc&&e&&e[Bc])}function ti(e,t){var s=typeof e;return t=t??V,!!t&&(s=="number"||s!="symbol"&&Po.test(e))&&e>-1&&e%1==0&&e0){if(++t>=Te)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Hn(e,t){var s=-1,a=e.length,h=a-1;for(t=t===i?a:t;++s1?e[t-1]:i;return s=typeof s=="function"?(e.pop(),s):i,Zu(e,s)});function Qu(e){var t=f(e);return t.__chain__=!0,t}function Vg(e,t){return t(e),e}function kn(e,t){return t(e)}var Gg=ei(function(e){var t=e.length,s=t?e[0]:0,a=this.__wrapped__,h=function(p){return ea(p,e)};return t>1||this.__actions__.length||!(a instanceof Ae)||!ti(s)?this.thru(h):(a=a.slice(s,+s+(t?1:0)),a.__actions__.push({func:kn,args:[h],thisArg:i}),new _r(a,this.__chain__).thru(function(p){return t&&!p.length&&p.push(i),p}))});function Wg(){return Qu(this)}function Jg(){return new _r(this.value(),this.__chain__)}function Yg(){this.__values__===i&&(this.__values__=ph(this.value()));var e=this.__index__>=this.__values__.length,t=e?i:this.__values__[this.__index__++];return{done:e,value:t}}function Xg(){return this}function Zg(e){for(var t,s=this;s instanceof On;){var a=Vu(s);a.__index__=0,a.__values__=i,t?h.__wrapped__=a:t=a;var h=a;s=s.__wrapped__}return h.__wrapped__=e,t}function Qg(){var e=this.__wrapped__;if(e instanceof Ae){var t=e;return this.__actions__.length&&(t=new Ae(this)),t=t.reverse(),t.__actions__.push({func:kn,args:[Ca],thisArg:i}),new _r(t,this.__chain__)}return this.thru(Ca)}function ey(){return gu(this.__wrapped__,this.__actions__)}var ty=$n(function(e,t,s){ze.call(e,s)?++e[s]:Zr(e,s,1)});function ry(e,t,s){var a=we(e)?Cc:Vp;return s&&Zt(e,t,s)&&(t=i),a(e,se(t,3))}function iy(e,t){var s=we(e)?hi:Zc;return s(e,se(t,3))}var sy=Pu(Gu),ny=Pu(Wu);function oy(e,t){return kt(Kn(e,t),1)}function ay(e,t){return kt(Kn(e,t),ce)}function cy(e,t,s){return s=s===i?1:_e(s),kt(Kn(e,t),s)}function eh(e,t){var s=we(e)?mr:di;return s(e,se(t,3))}function th(e,t){var s=we(e)?Af:Xc;return s(e,se(t,3))}var uy=$n(function(e,t,s){ze.call(e,s)?e[s].push(t):Zr(e,s,[t])});function hy(e,t,s,a){e=nr(e)?e:us(e),s=s&&!a?_e(s):0;var h=e.length;return s<0&&(s=Mt(h+s,0)),Yn(e)?s<=h&&e.indexOf(t,s)>-1:!!h&&Xi(e,t,s)>-1}var ly=xe(function(e,t,s){var a=-1,h=typeof t=="function",p=nr(e)?T(e.length):[];return di(e,function(w){p[++a]=h?zt(t,w,s):Cs(w,t,s)}),p}),fy=$n(function(e,t,s){Zr(e,s,t)});function Kn(e,t){var s=we(e)?st:su;return s(e,se(t,3))}function py(e,t,s,a){return e==null?[]:(we(t)||(t=t==null?[]:[t]),s=a?i:s,we(s)||(s=s==null?[]:[s]),cu(e,t,s))}var dy=$n(function(e,t,s){e[s?0:1].push(t)},function(){return[[],[]]});function gy(e,t,s){var a=we(e)?qo:Nc,h=arguments.length<3;return a(e,se(t,4),s,h,di)}function yy(e,t,s){var a=we(e)?Cf:Nc,h=arguments.length<3;return a(e,se(t,4),s,h,Xc)}function vy(e,t){var s=we(e)?hi:Zc;return s(e,Wn(se(t,3)))}function my(e){var t=we(e)?Gc:hd;return t(e)}function wy(e,t,s){(s?Zt(e,t,s):t===i)?t=1:t=_e(t);var a=we(e)?qp:ld;return a(e,t)}function _y(e){var t=we(e)?Bp:pd;return t(e)}function by(e){if(e==null)return 0;if(nr(e))return Yn(e)?Qi(e):e.length;var t=Gt(e);return t==be||t==$e?e.size:oa(e).length}function Ey(e,t,s){var a=we(e)?Bo:dd;return s&&Zt(e,t,s)&&(t=i),a(e,se(t,3))}var Iy=xe(function(e,t){if(e==null)return[];var s=t.length;return s>1&&Zt(e,t[0],t[1])?t=[]:s>2&&Zt(t[0],t[1],t[2])&&(t=[t[0]]),cu(e,kt(t,1),[])}),Vn=ip||function(){return Ce.Date.now()};function xy(e,t){if(typeof t!="function")throw new wr(d);return e=_e(e),function(){if(--e<1)return t.apply(this,arguments)}}function rh(e,t,s){return t=s?i:t,t=e&&t==null?e.length:t,Qr(e,q,i,i,i,i,t)}function ih(e,t){var s;if(typeof t!="function")throw new wr(d);return e=_e(e),function(){return--e>0&&(s=t.apply(this,arguments)),e<=1&&(t=i),s}}var Ra=xe(function(e,t,s){var a=re;if(s.length){var h=fi(s,as(Ra));a|=de}return Qr(e,a,t,s,h)}),sh=xe(function(e,t,s){var a=re|he;if(s.length){var h=fi(s,as(sh));a|=de}return Qr(t,a,e,s,h)});function nh(e,t,s){t=s?i:t;var a=Qr(e,fe,i,i,i,i,i,t);return a.placeholder=nh.placeholder,a}function oh(e,t,s){t=s?i:t;var a=Qr(e,pe,i,i,i,i,i,t);return a.placeholder=oh.placeholder,a}function ah(e,t,s){var a,h,p,w,_,A,M=0,j=!1,H=!1,J=!0;if(typeof e!="function")throw new wr(d);t=xr(t)||0,ct(s)&&(j=!!s.leading,H="maxWait"in s,p=H?Mt(xr(s.maxWait)||0,t):p,J="trailing"in s?!!s.trailing:J);function te(Et){var Fr=a,si=h;return a=h=i,M=Et,w=e.apply(si,Fr),w}function oe(Et){return M=Et,_=Ds(Se,t),j?te(Et):w}function Ee(Et){var Fr=Et-A,si=Et-M,Ph=t-Fr;return H?Vt(Ph,p-si):Ph}function ae(Et){var Fr=Et-A,si=Et-M;return A===i||Fr>=t||Fr<0||H&&si>=p}function Se(){var Et=Vn();if(ae(Et))return Oe(Et);_=Ds(Se,Ee(Et))}function Oe(Et){return _=i,J&&a?te(Et):(a=h=i,w)}function dr(){_!==i&&vu(_),M=0,a=A=h=_=i}function Qt(){return _===i?w:Oe(Vn())}function gr(){var Et=Vn(),Fr=ae(Et);if(a=arguments,h=this,A=Et,Fr){if(_===i)return oe(A);if(H)return vu(_),_=Ds(Se,t),te(A)}return _===i&&(_=Ds(Se,t)),w}return gr.cancel=dr,gr.flush=Qt,gr}var Sy=xe(function(e,t){return Yc(e,1,t)}),Py=xe(function(e,t,s){return Yc(e,xr(t)||0,s)});function Ay(e){return Qr(e,ve)}function Gn(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new wr(d);var s=function(){var a=arguments,h=t?t.apply(this,a):a[0],p=s.cache;if(p.has(h))return p.get(h);var w=e.apply(this,a);return s.cache=p.set(h,w)||p,w};return s.cache=new(Gn.Cache||Xr),s}Gn.Cache=Xr;function Wn(e){if(typeof e!="function")throw new wr(d);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function Cy(e){return ih(2,e)}var Oy=gd(function(e,t){t=t.length==1&&we(t[0])?st(t[0],lr(se())):st(kt(t,1),lr(se()));var s=t.length;return xe(function(a){for(var h=-1,p=Vt(a.length,s);++h=t}),Mi=tu(function(){return arguments}())?tu:function(e){return yt(e)&&ze.call(e,"callee")&&!qc.call(e,"callee")},we=T.isArray,ky=Yt?lr(Yt):Zp;function nr(e){return e!=null&&Jn(e.length)&&!ri(e)}function bt(e){return yt(e)&&nr(e)}function Ky(e){return e===!0||e===!1||yt(e)&&Xt(e)==N}var mi=np||Ba,Vy=Rr?lr(Rr):Qp;function Gy(e){return yt(e)&&e.nodeType===1&&!Fs(e)}function Wy(e){if(e==null)return!0;if(nr(e)&&(we(e)||typeof e=="string"||typeof e.splice=="function"||mi(e)||cs(e)||Mi(e)))return!e.length;var t=Gt(e);if(t==be||t==$e)return!e.size;if(Ns(e))return!oa(e).length;for(var s in e)if(ze.call(e,s))return!1;return!0}function Jy(e,t){return Os(e,t)}function Yy(e,t,s){s=typeof s=="function"?s:i;var a=s?s(e,t):i;return a===i?Os(e,t,i,s):!!a}function Na(e){if(!yt(e))return!1;var t=Xt(e);return t==E||t==u||typeof e.message=="string"&&typeof e.name=="string"&&!Fs(e)}function Xy(e){return typeof e=="number"&&Hc(e)}function ri(e){if(!ct(e))return!1;var t=Xt(e);return t==ee||t==ge||t==D||t==mt}function uh(e){return typeof e=="number"&&e==_e(e)}function Jn(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=V}function ct(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function yt(e){return e!=null&&typeof e=="object"}var hh=vr?lr(vr):td;function Zy(e,t){return e===t||na(e,t,Ea(t))}function Qy(e,t,s){return s=typeof s=="function"?s:i,na(e,t,Ea(t),s)}function e0(e){return lh(e)&&e!=+e}function t0(e){if(jd(e))throw new ye(l);return ru(e)}function r0(e){return e===null}function i0(e){return e==null}function lh(e){return typeof e=="number"||yt(e)&&Xt(e)==Ne}function Fs(e){if(!yt(e)||Xt(e)!=Pe)return!1;var t=En(e);if(t===null)return!0;var s=ze.call(t,"constructor")&&t.constructor;return typeof s=="function"&&s instanceof s&&mn.call(s)==Qf}var Da=qr?lr(qr):rd;function s0(e){return uh(e)&&e>=-V&&e<=V}var fh=ws?lr(ws):id;function Yn(e){return typeof e=="string"||!we(e)&&yt(e)&&Xt(e)==Xe}function pr(e){return typeof e=="symbol"||yt(e)&&Xt(e)==Ze}var cs=Oi?lr(Oi):sd;function n0(e){return e===i}function o0(e){return yt(e)&&Gt(e)==qe}function a0(e){return yt(e)&&Xt(e)==Qe}var c0=Un(aa),u0=Un(function(e,t){return e<=t});function ph(e){if(!e)return[];if(nr(e))return Yn(e)?Tr(e):sr(e);if(bs&&e[bs])return qf(e[bs]());var t=Gt(e),s=t==be?Wo:t==$e?gn:us;return s(e)}function ii(e){if(!e)return e===0?e:0;if(e=xr(e),e===ce||e===-ce){var t=e<0?-1:1;return t*B}return e===e?e:0}function _e(e){var t=ii(e),s=t%1;return t===t?s?t-s:t:0}function dh(e){return e?Di(_e(e),0,G):0}function xr(e){if(typeof e=="number")return e;if(pr(e))return k;if(ct(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ct(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Dc(e);var s=Io.test(e);return s||So.test(e)?me(e.slice(2),s?2:8):Eo.test(e)?k:+e}function gh(e){return Hr(e,or(e))}function h0(e){return e?Di(_e(e),-V,V):e===0?e:0}function Me(e){return e==null?"":fr(e)}var l0=ns(function(e,t){if(Ns(t)||nr(t)){Hr(t,Ut(t),e);return}for(var s in t)ze.call(t,s)&&Ps(e,s,t[s])}),yh=ns(function(e,t){Hr(t,or(t),e)}),Xn=ns(function(e,t,s,a){Hr(t,or(t),e,a)}),f0=ns(function(e,t,s,a){Hr(t,Ut(t),e,a)}),p0=ei(ea);function d0(e,t){var s=ss(e);return t==null?s:Wc(s,t)}var g0=xe(function(e,t){e=We(e);var s=-1,a=t.length,h=a>2?t[2]:i;for(h&&Zt(t[0],t[1],h)&&(a=1);++s1),p}),Hr(e,_a(e),s),a&&(s=br(s,O|F|z,Pd));for(var h=t.length;h--;)fa(s,t[h]);return s});function D0(e,t){return mh(e,Wn(se(t)))}var F0=ei(function(e,t){return e==null?{}:ad(e,t)});function mh(e,t){if(e==null)return{};var s=st(_a(e),function(a){return[a]});return t=se(t),uu(e,s,function(a,h){return t(a,h[0])})}function L0(e,t,s){t=yi(t,e);var a=-1,h=t.length;for(h||(h=1,e=i);++at){var a=e;e=t,t=a}if(s||e%1||t%1){var h=kc();return Vt(e+h*(t-e+Ve("1e-"+((h+"").length-1))),t)}return ua(e,t)}var V0=os(function(e,t,s){return t=t.toLowerCase(),e+(s?bh(t):t)});function bh(e){return $a(Me(e).toLowerCase())}function Eh(e){return e=Me(e),e&&e.replace(Wr,$f).replace(jo,"")}function G0(e,t,s){e=Me(e),t=fr(t);var a=e.length;s=s===i?a:Di(_e(s),0,a);var h=s;return s-=t.length,s>=0&&e.slice(s,h)==t}function W0(e){return e=Me(e),e&&rt.test(e)?e.replace(xi,Mf):e}function J0(e){return e=Me(e),e&&Ot.test(e)?e.replace(pt,"\\$&"):e}var Y0=os(function(e,t,s){return e+(s?"-":"")+t.toLowerCase()}),X0=os(function(e,t,s){return e+(s?" ":"")+t.toLowerCase()}),Z0=Su("toLowerCase");function Q0(e,t,s){e=Me(e),t=_e(t);var a=t?Qi(e):0;if(!t||a>=t)return e;var h=(t-a)/2;return zn(Pn(h),s)+e+zn(Sn(h),s)}function ev(e,t,s){e=Me(e),t=_e(t);var a=t?Qi(e):0;return t&&a>>0,s?(e=Me(e),e&&(typeof t=="string"||t!=null&&!Da(t))&&(t=fr(t),!t&&Zi(e))?vi(Tr(e),0,s):e.split(t,s)):[]}var av=os(function(e,t,s){return e+(s?" ":"")+$a(t)});function cv(e,t,s){return e=Me(e),s=s==null?0:Di(_e(s),0,e.length),t=fr(t),e.slice(s,s+t.length)==t}function uv(e,t,s){var a=f.templateSettings;s&&Zt(e,t,s)&&(t=i),e=Me(e),t=Xn({},t,a,Nu);var h=Xn({},t.imports,a.imports,Nu),p=Ut(h),w=Go(h,p),_,A,M=0,j=t.interpolate||ki,H="__p += '",J=Jo((t.escape||ki).source+"|"+j.source+"|"+(j===at?bo:ki).source+"|"+(t.evaluate||ki).source+"|$","g"),te="//# sourceURL="+(ze.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++zo+"]")+` -`;e.replace(J,function(ae,Se,Oe,dr,Qt,gr){return Oe||(Oe=dr),H+=e.slice(M,gr).replace(Ao,jf),Se&&(_=!0,H+=`' + -__e(`+Se+`) + -'`),Qt&&(A=!0,H+=`'; -`+Qt+`; -__p += '`),Oe&&(H+=`' + -((__t = (`+Oe+`)) == null ? '' : __t) + -'`),M=gr+ae.length,ae}),H+=`'; -`;var oe=ze.call(t,"variable")&&t.variable;if(!oe)H=`with (obj) { -`+H+` -} -`;else if(wo.test(oe))throw new ye(v);H=(A?H.replace(zr,""):H).replace(Jt,"$1").replace(Gr,"$1;"),H="function("+(oe||"obj")+`) { -`+(oe?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(_?", __e = _.escape":"")+(A?`, __j = Array.prototype.join; -function print() { __p += __j.call(arguments, '') } -`:`; -`)+H+`return __p -}`;var Ee=xh(function(){return Le(p,te+"return "+H).apply(i,w)});if(Ee.source=H,Na(Ee))throw Ee;return Ee}function hv(e){return Me(e).toLowerCase()}function lv(e){return Me(e).toUpperCase()}function fv(e,t,s){if(e=Me(e),e&&(s||t===i))return Dc(e);if(!e||!(t=fr(t)))return e;var a=Tr(e),h=Tr(t),p=Fc(a,h),w=Lc(a,h)+1;return vi(a,p,w).join("")}function pv(e,t,s){if(e=Me(e),e&&(s||t===i))return e.slice(0,Mc(e)+1);if(!e||!(t=fr(t)))return e;var a=Tr(e),h=Lc(a,Tr(t))+1;return vi(a,0,h).join("")}function dv(e,t,s){if(e=Me(e),e&&(s||t===i))return e.replace(dt,"");if(!e||!(t=fr(t)))return e;var a=Tr(e),h=Fc(a,Tr(t));return vi(a,h).join("")}function gv(e,t){var s=ie,a=ue;if(ct(t)){var h="separator"in t?t.separator:h;s="length"in t?_e(t.length):s,a="omission"in t?fr(t.omission):a}e=Me(e);var p=e.length;if(Zi(e)){var w=Tr(e);p=w.length}if(s>=p)return e;var _=s-Qi(a);if(_<1)return a;var A=w?vi(w,0,_).join(""):e.slice(0,_);if(h===i)return A+a;if(w&&(_+=A.length-_),Da(h)){if(e.slice(_).search(h)){var M,j=A;for(h.global||(h=Jo(h.source,Me(yr.exec(h))+"g")),h.lastIndex=0;M=h.exec(j);)var H=M.index;A=A.slice(0,H===i?_:H)}}else if(e.indexOf(fr(h),_)!=_){var J=A.lastIndexOf(h);J>-1&&(A=A.slice(0,J))}return A+a}function yv(e){return e=Me(e),e&&ht.test(e)?e.replace(ci,Kf):e}var vv=os(function(e,t,s){return e+(s?" ":"")+t.toUpperCase()}),$a=Su("toUpperCase");function Ih(e,t,s){return e=Me(e),t=s?i:t,t===i?Uf(e)?Wf(e):Tf(e):e.match(t)||[]}var xh=xe(function(e,t){try{return zt(e,i,t)}catch(s){return Na(s)?s:new ye(s)}}),mv=ei(function(e,t){return mr(t,function(s){s=kr(s),Zr(e,s,Ra(e[s],e))}),e});function wv(e){var t=e==null?0:e.length,s=se();return e=t?st(e,function(a){if(typeof a[1]!="function")throw new wr(d);return[s(a[0]),a[1]]}):[],xe(function(a){for(var h=-1;++hV)return[];var s=G,a=Vt(e,G);t=se(t),e-=G;for(var h=Vo(a,t);++s0||t<0)?new Ae(s):(e<0?s=s.takeRight(-e):e&&(s=s.drop(e)),t!==i&&(t=_e(t),s=t<0?s.dropRight(-t):s.take(t-e)),s)},Ae.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Ae.prototype.toArray=function(){return this.take(G)},Br(Ae.prototype,function(e,t){var s=/^(?:filter|find|map|reject)|While$/.test(t),a=/^(?:head|last)$/.test(t),h=f[a?"take"+(t=="last"?"Right":""):t],p=a||/^find/.test(t);h&&(f.prototype[t]=function(){var w=this.__wrapped__,_=a?[1]:arguments,A=w instanceof Ae,M=_[0],j=A||we(w),H=function(Se){var Oe=h.apply(f,li([Se],_));return a&&J?Oe[0]:Oe};j&&s&&typeof M=="function"&&M.length!=1&&(A=j=!1);var J=this.__chain__,te=!!this.__actions__.length,oe=p&&!J,Ee=A&&!te;if(!p&&j){w=Ee?w:new Ae(this);var ae=e.apply(w,_);return ae.__actions__.push({func:kn,args:[H],thisArg:i}),new _r(ae,J)}return oe&&Ee?e.apply(this,_):(ae=this.thru(H),oe?a?ae.value()[0]:ae.value():ae)})}),mr(["pop","push","shift","sort","splice","unshift"],function(e){var t=yn[e],s=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",a=/^(?:pop|shift)$/.test(e);f.prototype[e]=function(){var h=arguments;if(a&&!this.__chain__){var p=this.value();return t.apply(we(p)?p:[],h)}return this[s](function(w){return t.apply(we(w)?w:[],h)})}}),Br(Ae.prototype,function(e,t){var s=f[t];if(s){var a=s.name+"";ze.call(is,a)||(is[a]=[]),is[a].push({name:t,func:s})}}),is[Mn(i,he).name]=[{name:"wrapper",func:i}],Ae.prototype.clone=yp,Ae.prototype.reverse=vp,Ae.prototype.value=mp,f.prototype.at=Gg,f.prototype.chain=Wg,f.prototype.commit=Jg,f.prototype.next=Yg,f.prototype.plant=Zg,f.prototype.reverse=Qg,f.prototype.toJSON=f.prototype.valueOf=f.prototype.value=ey,f.prototype.first=f.prototype.head,bs&&(f.prototype[bs]=Xg),f},es=Jf();_t?((_t.exports=es)._=es,Ge._=es):Ce._=es}).call(qs)})(fc,fc.exports);var vE=Object.defineProperty,mE=Object.defineProperties,wE=Object.getOwnPropertyDescriptors,Sl=Object.getOwnPropertySymbols,_E=Object.prototype.hasOwnProperty,bE=Object.prototype.propertyIsEnumerable,Pl=(c,r,i)=>r in c?vE(c,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):c[r]=i,to=(c,r)=>{for(var i in r||(r={}))_E.call(r,i)&&Pl(c,i,r[i]);if(Sl)for(var i of Sl(r))bE.call(r,i)&&Pl(c,i,r[i]);return c},EE=(c,r)=>mE(c,wE(r));function Ar(c,r,i){let n;const o=pc(c);return r.rpcMap&&(n=r.rpcMap[o]),n||(n=`${yE}?chainId=eip155:${o}&projectId=${i}`),n}function pc(c){return c.includes("eip155")?Number(c.split(":")[1]):Number(c)}function xf(c){return c.map(r=>`${r.split(":")[0]}:${r.split(":")[1]}`)}function IE(c,r){const i=Object.keys(r.namespaces).filter(o=>o.includes(c));if(!i.length)return[];const n=[];return i.forEach(o=>{const l=r.namespaces[o].accounts;n.push(...l)}),n}function xE(c={},r={}){const i=Al(c),n=Al(r);return fc.exports.merge(i,n)}function Al(c){var r,i,n,o;const l={};if(!so(c))return l;for(const[d,v]of Object.entries(c)){const b=ql(d)?[d]:v.chains,m=v.methods||[],S=v.events||[],O=v.rpcMap||{},F=no(d);l[F]=EE(to(to({},l[F]),v),{chains:ka(b,(r=l[F])==null?void 0:r.chains),methods:ka(m,(i=l[F])==null?void 0:i.methods),events:ka(S,(n=l[F])==null?void 0:n.events),rpcMap:to(to({},O),(o=l[F])==null?void 0:o.rpcMap)})}return l}function SE(c){return c.includes(":")?c.split(":")[2]:c}function PE(c){const r={};for(const[i,n]of Object.entries(c)){const o=n.methods||[],l=n.events||[],d=n.accounts||[],v=ql(i)?[i]:n.chains?n.chains:xf(n.accounts);r[i]={chains:v,methods:o,events:l,accounts:d}}return r}const Sf={},It=c=>Sf[c],ic=(c,r)=>{Sf[c]=r};class AE{constructor(r){this.name="polkadot",this.namespace=r.namespace,this.events=It("events"),this.client=It("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(r){this.namespace=Object.assign(this.namespace,r)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const r=this.namespace.chains[0];if(!r)throw new Error("ChainId not found");return r.split(":")[1]}request(r){return this.namespace.methods.includes(r.request.method)?this.client.request(r):this.getHttpProvider().request(r.request)}setDefaultChain(r,i){if(this.chainId=r,!this.httpProviders[r]){const n=i||Ar(`${this.name}:${r}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${r}`);this.setHttpProvider(r,n)}this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const r=this.namespace.accounts;return r?r.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2])||[]:[]}createHttpProviders(){const r={};return this.namespace.chains.forEach(i=>{var n;r[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[i])}),r}getHttpProvider(){const r=`${this.name}:${this.chainId}`,i=this.httpProviders[r];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${r} not found`);return i}setHttpProvider(r,i){const n=this.createHttpProvider(r,i);n&&(this.httpProviders[r]=n)}createHttpProvider(r,i){const n=i||Ar(r,this.namespace);return typeof n>"u"?void 0:new Ei(new Hi(n,It("disableProviderPing")))}}class CE{constructor(r){this.name="eip155",this.namespace=r.namespace,this.events=It("events"),this.client=It("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(r){switch(r.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(r);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(r.request.method)?await this.client.request(r):this.getHttpProvider().request(r.request)}updateNamespace(r){this.namespace=Object.assign(this.namespace,r)}setDefaultChain(r,i){const n=pc(r);if(!this.httpProviders[n]){const o=i||Ar(`${this.name}:${n}`,this.namespace,this.client.core.projectId);if(!o)throw new Error(`No RPC url provided for chainId: ${n}`);this.setHttpProvider(n,o)}this.chainId=n,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${n}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const r=this.namespace.chains[0];if(!r)throw new Error("ChainId not found");return r.split(":")[1]}createHttpProvider(r,i){const n=i||Ar(`${this.name}:${r}`,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new Ei(new Hi(n,It("disableProviderPing")))}setHttpProvider(r,i){const n=this.createHttpProvider(r,i);n&&(this.httpProviders[r]=n)}createHttpProviders(){const r={};return this.namespace.chains.forEach(i=>{var n;const o=pc(i);r[o]=this.createHttpProvider(o,(n=this.namespace.rpcMap)==null?void 0:n[i])}),r}getAccounts(){const r=this.namespace.accounts;return r?[...new Set(r.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}getHttpProvider(){const r=this.chainId,i=this.httpProviders[r];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${r} not found`);return i}async handleSwitchChain(r){var i,n;let o=r.request.params?(i=r.request.params[0])==null?void 0:i.chainId:"0x0";o=o.startsWith("0x")?o:`0x${o}`;const l=parseInt(o,16);if(this.isChainApproved(l))this.setDefaultChain(`${l}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:r.topic,request:{method:r.request.method,params:[{chainId:o}]},chainId:(n=this.namespace.chains)==null?void 0:n[0]}),this.setDefaultChain(`${l}`);else throw new Error(`Failed to switch to chain 'eip155:${l}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(r){return this.namespace.chains.includes(`${this.name}:${r}`)}}class OE{constructor(r){this.name="solana",this.namespace=r.namespace,this.events=It("events"),this.client=It("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(r){this.namespace=Object.assign(this.namespace,r)}requestAccounts(){return this.getAccounts()}request(r){return this.namespace.methods.includes(r.request.method)?this.client.request(r):this.getHttpProvider().request(r.request)}setDefaultChain(r,i){if(!this.httpProviders[r]){const n=i||Ar(`${this.name}:${r}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${r}`);this.setHttpProvider(r,n)}this.chainId=r,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const r=this.namespace.chains[0];if(!r)throw new Error("ChainId not found");return r.split(":")[1]}getAccounts(){const r=this.namespace.accounts;return r?[...new Set(r.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}createHttpProviders(){const r={};return this.namespace.chains.forEach(i=>{var n;r[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[i])}),r}getHttpProvider(){const r=`${this.name}:${this.chainId}`,i=this.httpProviders[r];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${r} not found`);return i}setHttpProvider(r,i){const n=this.createHttpProvider(r,i);n&&(this.httpProviders[r]=n)}createHttpProvider(r,i){const n=i||Ar(r,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new Ei(new Hi(n,It("disableProviderPing")))}}class RE{constructor(r){this.name="cosmos",this.namespace=r.namespace,this.events=It("events"),this.client=It("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(r){this.namespace=Object.assign(this.namespace,r)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const r=this.namespace.chains[0];if(!r)throw new Error("ChainId not found");return r.split(":")[1]}request(r){return this.namespace.methods.includes(r.request.method)?this.client.request(r):this.getHttpProvider().request(r.request)}setDefaultChain(r,i){if(this.chainId=r,!this.httpProviders[r]){const n=i||Ar(`${this.name}:${r}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${r}`);this.setHttpProvider(r,n)}this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const r=this.namespace.accounts;return r?[...new Set(r.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}createHttpProviders(){const r={};return this.namespace.chains.forEach(i=>{var n;r[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[i])}),r}getHttpProvider(){const r=`${this.name}:${this.chainId}`,i=this.httpProviders[r];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${r} not found`);return i}setHttpProvider(r,i){const n=this.createHttpProvider(r,i);n&&(this.httpProviders[r]=n)}createHttpProvider(r,i){const n=i||Ar(r,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new Ei(new Hi(n,It("disableProviderPing")))}}class TE{constructor(r){this.name="cip34",this.namespace=r.namespace,this.events=It("events"),this.client=It("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(r){this.namespace=Object.assign(this.namespace,r)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const r=this.namespace.chains[0];if(!r)throw new Error("ChainId not found");return r.split(":")[1]}request(r){return this.namespace.methods.includes(r.request.method)?this.client.request(r):this.getHttpProvider().request(r.request)}setDefaultChain(r,i){if(this.chainId=r,!this.httpProviders[r]){const n=i||this.getCardanoRPCUrl(r);if(!n)throw new Error(`No RPC url provided for chainId: ${r}`);this.setHttpProvider(r,n)}this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const r=this.namespace.accounts;return r?[...new Set(r.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}createHttpProviders(){const r={};return this.namespace.chains.forEach(i=>{const n=this.getCardanoRPCUrl(i);r[i]=this.createHttpProvider(i,n)}),r}getHttpProvider(){const r=`${this.name}:${this.chainId}`,i=this.httpProviders[r];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${r} not found`);return i}getCardanoRPCUrl(r){const i=this.namespace.rpcMap;if(i)return i[r]}setHttpProvider(r,i){const n=this.createHttpProvider(r,i);n&&(this.httpProviders[r]=n)}createHttpProvider(r,i){const n=i||this.getCardanoRPCUrl(r);return typeof n>"u"?void 0:new Ei(new Hi(n,It("disableProviderPing")))}}class NE{constructor(r){this.name="elrond",this.namespace=r.namespace,this.events=It("events"),this.client=It("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(r){this.namespace=Object.assign(this.namespace,r)}requestAccounts(){return this.getAccounts()}request(r){return this.namespace.methods.includes(r.request.method)?this.client.request(r):this.getHttpProvider().request(r.request)}setDefaultChain(r,i){if(!this.httpProviders[r]){const n=i||Ar(`${this.name}:${r}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${r}`);this.setHttpProvider(r,n)}this.chainId=r,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const r=this.namespace.chains[0];if(!r)throw new Error("ChainId not found");return r.split(":")[1]}getAccounts(){const r=this.namespace.accounts;return r?[...new Set(r.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}createHttpProviders(){const r={};return this.namespace.chains.forEach(i=>{var n;r[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[i])}),r}getHttpProvider(){const r=`${this.name}:${this.chainId}`,i=this.httpProviders[r];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${r} not found`);return i}setHttpProvider(r,i){const n=this.createHttpProvider(r,i);n&&(this.httpProviders[r]=n)}createHttpProvider(r,i){const n=i||Ar(r,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new Ei(new Hi(n,It("disableProviderPing")))}}class DE{constructor(r){this.name="multiversx",this.namespace=r.namespace,this.events=It("events"),this.client=It("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(r){this.namespace=Object.assign(this.namespace,r)}requestAccounts(){return this.getAccounts()}request(r){return this.namespace.methods.includes(r.request.method)?this.client.request(r):this.getHttpProvider().request(r.request)}setDefaultChain(r,i){if(!this.httpProviders[r]){const n=i||Ar(`${this.name}:${r}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${r}`);this.setHttpProvider(r,n)}this.chainId=r,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const r=this.namespace.chains[0];if(!r)throw new Error("ChainId not found");return r.split(":")[1]}getAccounts(){const r=this.namespace.accounts;return r?[...new Set(r.filter(i=>i.split(":")[1]===this.chainId.toString()).map(i=>i.split(":")[2]))]:[]}createHttpProviders(){const r={};return this.namespace.chains.forEach(i=>{var n;r[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[i])}),r}getHttpProvider(){const r=`${this.name}:${this.chainId}`,i=this.httpProviders[r];if(typeof i>"u")throw new Error(`JSON-RPC provider for ${r} not found`);return i}setHttpProvider(r,i){const n=this.createHttpProvider(r,i);n&&(this.httpProviders[r]=n)}createHttpProvider(r,i){const n=i||Ar(r,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new Ei(new Hi(n,It("disableProviderPing")))}}var FE=Object.defineProperty,LE=Object.defineProperties,$E=Object.getOwnPropertyDescriptors,Cl=Object.getOwnPropertySymbols,ME=Object.prototype.hasOwnProperty,jE=Object.prototype.propertyIsEnumerable,Ol=(c,r,i)=>r in c?FE(c,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):c[r]=i,ro=(c,r)=>{for(var i in r||(r={}))ME.call(r,i)&&Ol(c,i,r[i]);if(Cl)for(var i of Cl(r))jE.call(r,i)&&Ol(c,i,r[i]);return c},sc=(c,r)=>LE(c,$E(r));class Pc{constructor(r){this.events=new vc,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=r,this.logger=typeof(r==null?void 0:r.logger)<"u"&&typeof(r==null?void 0:r.logger)!="string"?r.logger:Re.pino(Re.getDefaultLoggerOptions({level:(r==null?void 0:r.logger)||Il})),this.disableProviderPing=(r==null?void 0:r.disableProviderPing)||!1}static async init(r){const i=new Pc(r);return await i.initialize(),i}async request(r,i){const[n,o]=this.validateChain(i);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(n).request({request:ro({},r),chainId:`${n}:${o}`,topic:this.session.topic})}sendAsync(r,i,n){this.request(r,n).then(o=>i(null,o)).catch(o=>i(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}),await this.requestAccounts()}async disconnect(){var r;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(r=this.session)==null?void 0:r.topic,reason:tr("USER_DISCONNECTED")}),await this.cleanup()}async connect(r){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(r),await this.cleanupPendingPairings(),!r.skipPairing)return await this.pair(r.pairingTopic)}on(r,i){this.events.on(r,i)}once(r,i){this.events.once(r,i)}removeListener(r,i){this.events.removeListener(r,i)}off(r,i){this.events.off(r,i)}get isWalletConnect(){return!0}async pair(r){this.shouldAbortPairingAttempt=!1;let i=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(i>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:n,approval:o}=await this.client.connect({pairingTopic:r,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});n&&(this.uri=n,this.events.emit("display_uri",n)),await o().then(l=>{this.session=l,this.namespaces||(this.namespaces=PE(l.namespaces),this.persist("namespaces",this.namespaces))}).catch(l=>{if(l.message!==Ef)throw l;i++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(r,i){try{if(!this.session)return;const[n,o]=this.validateChain(r);this.getProvider(n).setDefaultChain(o,i)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(r={}){this.logger.info("Cleaning up inactive pairings...");const i=this.client.pairing.getAll();if(ps(i)){for(const n of i)r.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${i.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const r=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[r]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await uE.init({logger:this.providerOpts.logger||Il,relayUrl:this.providerOpts.relayUrl||pE,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,name:this.providerOpts.name}),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 r=[...new Set(Object.keys(this.session.namespaces).map(i=>no(i)))];ic("client",this.client),ic("events",this.events),ic("disableProviderPing",this.disableProviderPing),r.forEach(i=>{if(!this.session)return;const n=IE(i,this.session),o=xf(n),l=xE(this.namespaces,this.optionalNamespaces),d=sc(ro({},l[i]),{accounts:n,chains:o});switch(i){case"eip155":this.rpcProviders[i]=new CE({namespace:d});break;case"solana":this.rpcProviders[i]=new OE({namespace:d});break;case"cosmos":this.rpcProviders[i]=new RE({namespace:d});break;case"polkadot":this.rpcProviders[i]=new AE({namespace:d});break;case"cip34":this.rpcProviders[i]=new TE({namespace:d});break;case"elrond":this.rpcProviders[i]=new NE({namespace:d});break;case"multiversx":this.rpcProviders[i]=new DE({namespace:d});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",r=>{this.events.emit("session_ping",r)}),this.client.on("session_event",r=>{const{params:i}=r,{event:n}=i;if(n.name==="accountsChanged"){const o=n.data;o&&ps(o)&&this.events.emit("accountsChanged",o.map(SE))}else n.name==="chainChanged"?this.onChainChanged(i.chainId):this.events.emit(n.name,n.data);this.events.emit("session_event",r)}),this.client.on("session_update",({topic:r,params:i})=>{var n;const{namespaces:o}=i,l=(n=this.client)==null?void 0:n.session.get(r);this.session=sc(ro({},l),{namespaces:o}),this.onSessionUpdate(),this.events.emit("session_update",{topic:r,params:i})}),this.client.on("session_delete",async r=>{await this.cleanup(),this.events.emit("session_delete",r),this.events.emit("disconnect",sc(ro({},tr("USER_DISCONNECTED")),{data:r.topic}))}),this.on(Ii.DEFAULT_CHAIN_CHANGED,r=>{this.onChainChanged(r,!0)})}getProvider(r){if(!this.rpcProviders[r])throw new Error(`Provider not found: ${r}`);return this.rpcProviders[r]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(r=>{var i;this.getProvider(r).updateNamespace((i=this.session)==null?void 0:i.namespaces[r])})}setNamespaces(r){const{namespaces:i,optionalNamespaces:n,sessionProperties:o}=r;i&&Object.keys(i).length&&(this.namespaces=i),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=o,this.persist("namespaces",i),this.persist("optionalNamespaces",n)}validateChain(r){const[i,n]=(r==null?void 0:r.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[i,n];if(i&&!Object.keys(this.namespaces||{}).map(d=>no(d)).includes(i))throw new Error(`Namespace '${i}' is not configured. Please call connect() first with namespace config.`);if(i&&n)return[i,n];const o=no(Object.keys(this.namespaces)[0]),l=this.rpcProviders[o].getDefaultChain();return[o,l]}async requestAccounts(){const[r]=this.validateChain();return await this.getProvider(r).requestAccounts()}onChainChanged(r,i=!1){var n;if(!this.namespaces)return;const[o,l]=this.validateChain(r);i||this.getProvider(o).setDefaultChain(l),((n=this.namespaces[o])!=null?n:this.namespaces[`${o}:${l}`]).defaultChain=l,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",l)}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(r,i){this.client.core.storage.setItem(`${xl}/${r}`,i)}async getFromStore(r){return await this.client.core.storage.getItem(`${xl}/${r}`)}}const zE=Pc,UE="wc",qE="ethereum_provider",BE=`${UE}@2:${qE}:`,HE="https://rpc.walletconnect.com/v1/",dc=["eth_sendTransaction","personal_sign"],kE=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],gc=["chainChanged","accountsChanged"],KE=["message","disconnect","connect"];var VE=Object.defineProperty,GE=Object.defineProperties,WE=Object.getOwnPropertyDescriptors,Rl=Object.getOwnPropertySymbols,JE=Object.prototype.hasOwnProperty,YE=Object.prototype.propertyIsEnumerable,Tl=(c,r,i)=>r in c?VE(c,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):c[r]=i,Bs=(c,r)=>{for(var i in r||(r={}))JE.call(r,i)&&Tl(c,i,r[i]);if(Rl)for(var i of Rl(r))YE.call(r,i)&&Tl(c,i,r[i]);return c},Nl=(c,r)=>GE(c,WE(r));function lo(c){return Number(c[0].split(":")[1])}function nc(c){return`0x${c.toString(16)}`}function XE(c){const{chains:r,optionalChains:i,methods:n,optionalMethods:o,events:l,optionalEvents:d,rpcMap:v}=c;if(!ps(r))throw new Error("Invalid chains");const b={chains:r,methods:n||dc,events:l||gc,rpcMap:Bs({},r.length?{[lo(r)]:v[lo(r)]}:{})},m=l==null?void 0:l.filter(z=>!gc.includes(z)),S=n==null?void 0:n.filter(z=>!dc.includes(z));if(!i&&!d&&!o&&!(m!=null&&m.length)&&!(S!=null&&S.length))return{required:r.length?b:void 0};const O=(m==null?void 0:m.length)&&(S==null?void 0:S.length)||!i,F={chains:[...new Set(O?b.chains.concat(i||[]):i)],methods:[...new Set(b.methods.concat(o!=null&&o.length?o:kE))],events:[...new Set(b.events.concat(d||KE))],rpcMap:v};return{required:r.length?b:void 0,optional:i.length?F:void 0}}class Ac{constructor(){this.events=new Cr.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=BE,this.on=(r,i)=>(this.events.on(r,i),this),this.once=(r,i)=>(this.events.once(r,i),this),this.removeListener=(r,i)=>(this.events.removeListener(r,i),this),this.off=(r,i)=>(this.events.off(r,i),this),this.parseAccount=r=>this.isCompatibleChainId(r)?this.parseAccountId(r).address:r,this.signer={},this.rpc={}}static async init(r){const i=new Ac;return await i.initialize(r),i}async request(r){return await this.signer.request(r,this.formatChainId(this.chainId))}sendAsync(r,i){this.signer.sendAsync(r,i,this.formatChainId(this.chainId))}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(r){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(r);const{required:i,optional:n}=XE(this.rpc);try{const o=await new Promise(async(d,v)=>{var b;this.rpc.showQrModal&&((b=this.modal)==null||b.subscribeModal(m=>{!m.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),v(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(Nl(Bs({namespaces:Bs({},i&&{[this.namespace]:i})},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:r==null?void 0:r.pairingTopic})).then(m=>{d(m)}).catch(m=>{v(new Error(m.message))})});if(!o)return;this.setChainIds(this.rpc.chains);const l=qm(o.namespaces,[this.namespace]);this.setAccounts(l),this.events.emit("connect",{chainId:nc(this.chainId)})}catch(o){throw this.signer.logger.error(o),o}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",r=>{const{params:i}=r,{event:n}=i;n.name==="accountsChanged"?(this.accounts=this.parseAccounts(n.data),this.events.emit("accountsChanged",this.accounts)):n.name==="chainChanged"?this.setChainId(this.formatChainId(n.data)):this.events.emit(n.name,n.data),this.events.emit("session_event",r)}),this.signer.on("chainChanged",r=>{const i=parseInt(r);this.chainId=i,this.events.emit("chainChanged",nc(this.chainId)),this.persist()}),this.signer.on("session_update",r=>{this.events.emit("session_update",r)}),this.signer.on("session_delete",r=>{this.reset(),this.events.emit("session_delete",r),this.events.emit("disconnect",Nl(Bs({},tr("USER_DISCONNECTED")),{data:r.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",r=>{var i,n;this.rpc.showQrModal&&((i=this.modal)==null||i.closeModal(),(n=this.modal)==null||n.openModal({uri:r})),this.events.emit("display_uri",r)})}switchEthereumChain(r){this.request({method:"wallet_switchEthereumChain",params:[{chainId:r.toString(16)}]})}isCompatibleChainId(r){return typeof r=="string"?r.startsWith(`${this.namespace}:`):!1}formatChainId(r){return`${this.namespace}:${r}`}parseChainId(r){return Number(r.split(":")[1])}setChainIds(r){const i=r.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));i.length&&(this.chainId=i[0],this.events.emit("chainChanged",nc(this.chainId)),this.persist())}setChainId(r){if(this.isCompatibleChainId(r)){const i=this.parseChainId(r);this.chainId=i,this.switchEthereumChain(i)}}parseAccountId(r){const[i,n,o]=r.split(":");return{chainId:`${i}:${n}`,address:o}}setAccounts(r){this.accounts=r.filter(i=>this.parseChainId(this.parseAccountId(i).chainId)===this.chainId).map(i=>this.parseAccountId(i).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(r){var i,n;const o=(i=r==null?void 0:r.chains)!=null?i:[],l=(n=r==null?void 0:r.optionalChains)!=null?n:[],d=o.concat(l);if(!d.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const v=o.length?(r==null?void 0:r.methods)||dc:[],b=o.length?(r==null?void 0:r.events)||gc:[],m=(r==null?void 0:r.optionalMethods)||[],S=(r==null?void 0:r.optionalEvents)||[],O=(r==null?void 0:r.rpcMap)||this.buildRpcMap(d,r.projectId),F=(r==null?void 0:r.qrModalOptions)||void 0;return{chains:o==null?void 0:o.map(z=>this.formatChainId(z)),optionalChains:l.map(z=>this.formatChainId(z)),methods:v,events:b,optionalMethods:m,optionalEvents:S,rpcMap:O,showQrModal:!!(r!=null&&r.showQrModal),qrModalOptions:F,projectId:r.projectId,metadata:r.metadata}}buildRpcMap(r,i){const n={};return r.forEach(o=>{n[o]=this.getRpcUrl(o,i)}),n}async initialize(r){if(this.rpc=this.getRpcConfig(r),this.chainId=this.rpc.chains.length?lo(this.rpc.chains):lo(this.rpc.optionalChains),this.signer=await zE.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:r.disableProviderPing,relayUrl:r.relayUrl,storageOptions:r.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let i;try{const{WalletConnectModal:n}=await Bm(()=>import("./index-e5e7bd9b.js").then(o=>o.a),["./index-e5e7bd9b.js","./index-6a2af3e6.js","./index-f4824932.css","./index-cc134824.js"],import.meta.url);i=n}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(i)try{this.modal=new i(Bs({walletConnectVersion:2,projectId:this.rpc.projectId,standaloneChains:this.rpc.chains},this.rpc.qrModalOptions))}catch(n){throw this.signer.logger.error(n),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(r){if(!r)return;const{chains:i,optionalChains:n,rpcMap:o}=r;i&&ps(i)&&(this.rpc.chains=i.map(l=>this.formatChainId(l)),i.forEach(l=>{this.rpc.rpcMap[l]=(o==null?void 0:o[l])||this.getRpcUrl(l)})),n&&ps(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n==null?void 0:n.map(l=>this.formatChainId(l)),n.forEach(l=>{this.rpc.rpcMap[l]=(o==null?void 0:o[l])||this.getRpcUrl(l)}))}getRpcUrl(r,i){var n;return((n=this.rpc.rpcMap)==null?void 0:n[r])||`${HE}?chainId=eip155:${r}&projectId=${i||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const r=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),i=this.session.namespaces[`${this.namespace}:${r}`]?this.session.namespaces[`${this.namespace}:${r}`]:this.session.namespaces[this.namespace];this.setChainIds(r?[this.formatChainId(r)]:i==null?void 0:i.accounts),this.setAccounts(i==null?void 0:i.accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(r){return typeof r=="string"||r instanceof String?[this.parseAccount(r)]:r.map(i=>this.parseAccount(i))}}const lI=Ac;export{lI as EthereumProvider,KE as OPTIONAL_EVENTS,kE as OPTIONAL_METHODS,gc as REQUIRED_EVENTS,dc as REQUIRED_METHODS,Ac as default}; diff --git a/index.html b/index.html index 9c698bb8..5424170c 100644 --- a/index.html +++ b/index.html @@ -24,7 +24,7 @@ Learn how to configure a non-root public URL by running `npm run build`. --> Sequence Kit Demo - +