diff --git a/assets/___vite-browser-external_commonjs-proxy-D0iV-SFw.js b/assets/___vite-browser-external_commonjs-proxy-D0iV-SFw.js new file mode 100644 index 0000000..2f60c37 --- /dev/null +++ b/assets/___vite-browser-external_commonjs-proxy-D0iV-SFw.js @@ -0,0 +1 @@ +import{j,k as C}from"./index-BCdecgwI.js";var p={exports:{}},a=typeof Reflect=="object"?Reflect:null,h=a&&typeof a.apply=="function"?a.apply:function(e,n,r){return Function.prototype.apply.call(e,n,r)},l;a&&typeof a.ownKeys=="function"?l=a.ownKeys:Object.getOwnPropertySymbols?l=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:l=function(e){return Object.getOwnPropertyNames(e)};function N(t){console&&console.warn&&console.warn(t)}var L=Number.isNaN||function(e){return e!==e};function o(){o.init.call(this)}p.exports=o;p.exports.once=P;o.EventEmitter=o;o.prototype._events=void 0;o.prototype._eventsCount=0;o.prototype._maxListeners=void 0;var m=10;function v(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return m},set:function(t){if(typeof t!="number"||t<0||L(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");m=t}});o.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};o.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||L(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 y(t){return t._maxListeners===void 0?o.defaultMaxListeners:t._maxListeners}o.prototype.getMaxListeners=function(){return y(this)};o.prototype.emit=function(e){for(var n=[],r=1;r0&&(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")h(c,this,n);else for(var d=c.length,O=E(c,d),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,N(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 R(){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=R.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():M(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?A(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;r` ${w(d)}`)],` Sender: ${u}`,` Data: ${n}`,` Callback selector: ${e}`,` Extra data: ${c}`].flat()}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupError"})}}class $ extends p{constructor({result:e,url:t}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${w(t)}`,`Response: ${b(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupResponseMalformedError"})}}class S extends p{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 A(a,e){if(!h(a,{strict:!1}))throw new m({address:a});if(!h(e,{strict:!1}))throw new m({address:e});return a.toLowerCase()===e.toLowerCase()}const P="0x556f1830",q={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 j(a,{blockNumber:e,blockTag:t,data:n,to:c}){const{args:u}=O({data:n,abi:[q]}),[r,i,d,s,o]=u,{ccipRead:f}=a,g=f&&typeof(f==null?void 0:f.request)=="function"?f.request:v;try{if(!A(c,r))throw new S({sender:r,to:c});const l=await g({data:d,sender:r,urls:i}),{data:k}=await L(a,{blockNumber:e,blockTag:t,data:E([s,x([{type:"bytes"},{type:"bytes"}],[l,o])]),to:c});return k}catch(l){throw new R({callbackSelector:s,cause:l,data:n,extraData:o,sender:r,urls:i})}}async function v({data:a,sender:e,urls:t}){var c;let n=new Error("An unknown error occurred.");for(let u=0;u __vite__mapDeps.viteFileDeps[i]) +} +var Nh=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)};var B=(t,e,n)=>(Nh(t,e,"read from private field"),n?n.call(t):e.get(t)),pe=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},se=(t,e,n,r)=>(Nh(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);var Sf=(t,e,n,r)=>({set _(i){se(t,e,i,n)},get _(){return B(t,e,r)}}),Ie=(t,e,n)=>(Nh(t,e,"access private method"),n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var Bg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Jd(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function bD(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var c5={exports:{}},Rp={},u5={exports:{}},Ue={};/** + * @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 Xd=Symbol.for("react.element"),T9=Symbol.for("react.portal"),A9=Symbol.for("react.fragment"),k9=Symbol.for("react.strict_mode"),R9=Symbol.for("react.profiler"),$9=Symbol.for("react.provider"),P9=Symbol.for("react.context"),I9=Symbol.for("react.forward_ref"),O9=Symbol.for("react.suspense"),N9=Symbol.for("react.memo"),M9=Symbol.for("react.lazy"),ey=Symbol.iterator;function L9(t){return t===null||typeof t!="object"?null:(t=ey&&t[ey]||t["@@iterator"],typeof t=="function"?t:null)}var d5={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},f5=Object.assign,p5={};function Ec(t,e,n){this.props=t,this.context=e,this.refs=p5,this.updater=n||d5}Ec.prototype.isReactComponent={};Ec.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")};Ec.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function h5(){}h5.prototype=Ec.prototype;function jg(t,e,n){this.props=t,this.context=e,this.refs=p5,this.updater=n||d5}var Ug=jg.prototype=new h5;Ug.constructor=jg;f5(Ug,Ec.prototype);Ug.isPureReactComponent=!0;var ty=Array.isArray,m5=Object.prototype.hasOwnProperty,Fg={current:null},g5={key:!0,ref:!0,__self:!0,__source:!0};function w5(t,e,n){var r,i={},o=null,s=null;if(e!=null)for(r in e.ref!==void 0&&(s=e.ref),e.key!==void 0&&(o=""+e.key),e)m5.call(e,r)&&!g5.hasOwnProperty(r)&&(i[r]=e[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1>>1,re=R[Y];if(0>>1;Yi(ge,Z))Tei(We,ge)?(R[Y]=We,R[Te]=Z,Y=Te):(R[Y]=ge,R[Se]=Z,Y=Se);else if(Tei(We,Z))R[Y]=We,R[Te]=Z,Y=Te;else break e}}return z}function i(R,z){var Z=R.sortIndex-z.sortIndex;return Z!==0?Z:R.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();t.unstable_now=function(){return s.now()-a}}var l=[],c=[],u=1,d=null,p=3,g=!1,b=!1,S=!1,k=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(R){for(var z=n(c);z!==null;){if(z.callback===null)r(c);else if(z.startTime<=R)r(c),z.sortIndex=z.expirationTime,e(l,z);else break;z=n(c)}}function A(R){if(S=!1,x(R),!b)if(n(l)!==null)b=!0,N(M);else{var z=n(c);z!==null&&j(A,z.startTime-R)}}function M(R,z){b=!1,S&&(S=!1,y(w),w=-1),g=!0;var Z=p;try{for(x(z),d=n(l);d!==null&&(!(d.expirationTime>z)||R&&!O());){var Y=d.callback;if(typeof Y=="function"){d.callback=null,p=d.priorityLevel;var re=Y(d.expirationTime<=z);z=t.unstable_now(),typeof re=="function"?d.callback=re:d===n(l)&&r(l),x(z)}else r(l);d=n(l)}if(d!==null)var be=!0;else{var Se=n(c);Se!==null&&j(A,Se.startTime-z),be=!1}return be}finally{d=null,p=Z,g=!1}}var D=!1,H=null,w=-1,C=5,_=-1;function O(){return!(t.unstable_now()-_R||125Y?(R.sortIndex=Z,e(c,R),n(l)===null&&R===n(c)&&(S?(y(w),w=-1):S=!0,j(A,Z-Y))):(R.sortIndex=re,e(l,R),b||g||(b=!0,N(M))),R},t.unstable_shouldYield=O,t.unstable_wrapCallback=function(R){var z=p;return function(){var Z=p;p=z;try{return R.apply(this,arguments)}finally{p=Z}}}})(x5);b5.exports=x5;var q9=b5.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 C5=je,Un=q9;function te(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),H1=Object.prototype.hasOwnProperty,K9=/^[: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]*$/,ry={},iy={};function Y9(t){return H1.call(iy,t)?!0:H1.call(ry,t)?!1:K9.test(t)?iy[t]=!0:(ry[t]=!0,!1)}function Q9(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function J9(t,e,n,r){if(e===null||typeof e>"u"||Q9(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.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 vn(t,e,n,r,i,o,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=s}var Yt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Yt[t]=new vn(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Yt[e]=new vn(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Yt[t]=new vn(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Yt[t]=new vn(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){Yt[t]=new vn(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Yt[t]=new vn(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Yt[t]=new vn(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Yt[t]=new vn(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Yt[t]=new vn(t,5,!1,t.toLowerCase(),null,!1,!1)});var Wg=/[\-:]([a-z])/g;function Hg(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(Wg,Hg);Yt[e]=new vn(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(Wg,Hg);Yt[e]=new vn(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(Wg,Hg);Yt[e]=new vn(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Yt[t]=new vn(t,1,!1,t.toLowerCase(),null,!1,!1)});Yt.xlinkHref=new vn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Yt[t]=new vn(t,1,!1,t.toLowerCase(),null,!0,!0)});function Vg(t,e,n,r){var i=Yt.hasOwnProperty(e)?Yt[e]:null;(i!==null?i.type!==0:r||!(2a||i[s]!==o[a]){var l=` +`+i[s].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=s&&0<=a);break}}}finally{Dh=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Xc(t):""}function X9(t){switch(t.tag){case 5:return Xc(t.type);case 16:return Xc("Lazy");case 13:return Xc("Suspense");case 19:return Xc("SuspenseList");case 0:case 2:case 15:return t=Bh(t.type,!1),t;case 11:return t=Bh(t.type.render,!1),t;case 1:return t=Bh(t.type,!0),t;default:return""}}function q1(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 Qa:return"Fragment";case Ya:return"Portal";case V1:return"Profiler";case Zg:return"StrictMode";case Z1:return"Suspense";case G1:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case S5:return(t.displayName||"Context")+".Consumer";case E5:return(t._context.displayName||"Context")+".Provider";case Gg:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case qg:return e=t.displayName||null,e!==null?e:q1(t.type)||"Memo";case co:e=t._payload,t=t._init;try{return q1(t(e))}catch{}}return null}function ex(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 q1(e);case 8:return e===Zg?"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 Zo(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function A5(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function tx(t){var e=A5(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function kf(t){t._valueTracker||(t._valueTracker=tx(t))}function k5(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=A5(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function b0(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 K1(t,e){var n=e.checked;return mt({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function sy(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Zo(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function R5(t,e){e=e.checked,e!=null&&Vg(t,"checked",e,!1)}function Y1(t,e){R5(t,e);var n=Zo(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?Q1(t,e.type,n):e.hasOwnProperty("defaultValue")&&Q1(t,e.type,Zo(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function ay(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function Q1(t,e,n){(e!=="number"||b0(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var eu=Array.isArray;function cl(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=Rf.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Eu(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var ou={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},nx=["Webkit","ms","Moz","O"];Object.keys(ou).forEach(function(t){nx.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),ou[e]=ou[t]})});function O5(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||ou.hasOwnProperty(t)&&ou[t]?(""+e).trim():e+"px"}function N5(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=O5(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var rx=mt({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 em(t,e){if(e){if(rx[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(te(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(te(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(te(61))}if(e.style!=null&&typeof e.style!="object")throw Error(te(62))}}function tm(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 nm=null;function Kg(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var rm=null,ul=null,dl=null;function uy(t){if(t=nf(t)){if(typeof rm!="function")throw Error(te(280));var e=t.stateNode;e&&(e=Np(e),rm(t.stateNode,t.type,e))}}function M5(t){ul?dl?dl.push(t):dl=[t]:ul=t}function L5(){if(ul){var t=ul,e=dl;if(dl=ul=null,uy(t),e)for(t=0;t>>=0,t===0?32:31-(hx(t)/mx|0)|0}var $f=64,Pf=4194304;function tu(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 E0(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,o=t.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=tu(a):(o&=s,o!==0&&(r=tu(o)))}else s=n&~i,s!==0?r=tu(s):o!==0&&(r=tu(o));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,o=e&-e,i>=o||i===16&&(o&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function ef(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-kr(e),t[e]=n}function vx(t,e){var n=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 r=t.eventTimes;for(t=t.expirationTimes;0=au),vy=" ",by=!1;function n4(t,e){switch(t){case"keyup":return Gx.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function r4(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ja=!1;function Kx(t,e){switch(t){case"compositionend":return r4(e);case"keypress":return e.which!==32?null:(by=!0,vy);case"textInput":return t=e.data,t===vy&&by?null:t;default:return null}}function Yx(t,e){if(Ja)return t==="compositionend"||!rw&&n4(t,e)?(t=e4(),o0=ew=To=null,Ja=!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:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Ey(n)}}function a4(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?a4(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function l4(){for(var t=window,e=b0();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=b0(t.document)}return e}function iw(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 o7(t){var e=l4(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&a4(n.ownerDocument.documentElement,n)){if(r!==null&&iw(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!t.extend&&o>r&&(i=r,r=o,o=i),i=Sy(n,o);var s=Sy(n,r);i&&s&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>r?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Xa=null,cm=null,cu=null,um=!1;function Ty(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;um||Xa==null||Xa!==b0(r)||(r=Xa,"selectionStart"in r&&iw(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),cu&&$u(cu,r)||(cu=r,r=A0(cm,"onSelect"),0nl||(t.current=gm[nl],gm[nl]=null,nl--)}function tt(t,e){nl++,gm[nl]=t.current,t.current=e}var Go={},nn=is(Go),An=is(!1),zs=Go;function Ml(t,e){var n=t.type.contextTypes;if(!n)return Go;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=e[o];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function kn(t){return t=t.childContextTypes,t!=null}function R0(){rt(An),rt(nn)}function Oy(t,e,n){if(nn.current!==Go)throw Error(te(168));tt(nn,e),tt(An,n)}function w4(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(te(108,ex(t)||"Unknown",i));return mt({},n,r)}function $0(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Go,zs=nn.current,tt(nn,t),tt(An,An.current),!0}function Ny(t,e,n){var r=t.stateNode;if(!r)throw Error(te(169));n?(t=w4(t,e,zs),r.__reactInternalMemoizedMergedChildContext=t,rt(An),rt(nn),tt(nn,t)):rt(An),tt(An,n)}var ki=null,Mp=!1,Jh=!1;function y4(t){ki===null?ki=[t]:ki.push(t)}function w7(t){Mp=!0,y4(t)}function os(){if(!Jh&&ki!==null){Jh=!0;var t=0,e=Ye;try{var n=ki;for(Ye=1;t>=s,i-=s,Pi=1<<32-kr(e)+i|n<w?(C=H,H=null):C=H.sibling;var _=p(y,H,x[w],A);if(_===null){H===null&&(H=C);break}t&&H&&_.alternate===null&&e(y,H),m=o(_,m,w),D===null?M=_:D.sibling=_,D=_,H=C}if(w===x.length)return n(y,H),lt&&vs(y,w),M;if(H===null){for(;ww?(C=H,H=null):C=H.sibling;var O=p(y,H,_.value,A);if(O===null){H===null&&(H=C);break}t&&H&&O.alternate===null&&e(y,H),m=o(O,m,w),D===null?M=O:D.sibling=O,D=O,H=C}if(_.done)return n(y,H),lt&&vs(y,w),M;if(H===null){for(;!_.done;w++,_=x.next())_=d(y,_.value,A),_!==null&&(m=o(_,m,w),D===null?M=_:D.sibling=_,D=_);return lt&&vs(y,w),M}for(H=r(y,H);!_.done;w++,_=x.next())_=g(H,y,w,_.value,A),_!==null&&(t&&_.alternate!==null&&H.delete(_.key===null?w:_.key),m=o(_,m,w),D===null?M=_:D.sibling=_,D=_);return t&&H.forEach(function(L){return e(y,L)}),lt&&vs(y,w),M}function k(y,m,x,A){if(typeof x=="object"&&x!==null&&x.type===Qa&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Af:e:{for(var M=x.key,D=m;D!==null;){if(D.key===M){if(M=x.type,M===Qa){if(D.tag===7){n(y,D.sibling),m=i(D,x.props.children),m.return=y,y=m;break e}}else if(D.elementType===M||typeof M=="object"&&M!==null&&M.$$typeof===co&&Fy(M)===D.type){n(y,D.sibling),m=i(D,x.props),m.ref=zc(y,D,x),m.return=y,y=m;break e}n(y,D);break}else e(y,D);D=D.sibling}x.type===Qa?(m=js(x.props.children,y.mode,A,x.key),m.return=y,y=m):(A=p0(x.type,x.key,x.props,null,y.mode,A),A.ref=zc(y,m,x),A.return=y,y=A)}return s(y);case Ya:e:{for(D=x.key;m!==null;){if(m.key===D)if(m.tag===4&&m.stateNode.containerInfo===x.containerInfo&&m.stateNode.implementation===x.implementation){n(y,m.sibling),m=i(m,x.children||[]),m.return=y,y=m;break e}else{n(y,m);break}else e(y,m);m=m.sibling}m=s1(x,y.mode,A),m.return=y,y=m}return s(y);case co:return D=x._init,k(y,m,D(x._payload),A)}if(eu(x))return b(y,m,x,A);if(Dc(x))return S(y,m,x,A);Bf(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,m!==null&&m.tag===6?(n(y,m.sibling),m=i(m,x),m.return=y,y=m):(n(y,m),m=o1(x,y.mode,A),m.return=y,y=m),s(y)):n(y,m)}return k}var Dl=T4(!0),A4=T4(!1),rf={},ii=is(rf),Nu=is(rf),Mu=is(rf);function Ts(t){if(t===rf)throw Error(te(174));return t}function pw(t,e){switch(tt(Mu,e),tt(Nu,t),tt(ii,rf),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:X1(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=X1(e,t)}rt(ii),tt(ii,e)}function Bl(){rt(ii),rt(Nu),rt(Mu)}function k4(t){Ts(Mu.current);var e=Ts(ii.current),n=X1(e,t.type);e!==n&&(tt(Nu,t),tt(ii,n))}function hw(t){Nu.current===t&&(rt(ii),rt(Nu))}var pt=is(0);function L0(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.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 Xh=[];function mw(){for(var t=0;tn?n:4,t(!0);var r=e1.transition;e1.transition={};try{t(!1),e()}finally{Ye=n,e1.transition=r}}function H4(){return dr().memoizedState}function x7(t,e,n){var r=Do(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},V4(t))Z4(e,n);else if(n=C4(t,e,n,r),n!==null){var i=mn();Rr(n,t,r,i),G4(n,e,r)}}function C7(t,e,n){var r=Do(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(V4(t))Z4(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var s=e.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,Ir(a,s)){var l=e.interleaved;l===null?(i.next=i,dw(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=C4(t,e,i,r),n!==null&&(i=mn(),Rr(n,t,r,i),G4(n,e,r))}}function V4(t){var e=t.alternate;return t===ht||e!==null&&e===ht}function Z4(t,e){uu=D0=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function G4(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Qg(t,n)}}var B0={readContext:ur,useCallback:Qt,useContext:Qt,useEffect:Qt,useImperativeHandle:Qt,useInsertionEffect:Qt,useLayoutEffect:Qt,useMemo:Qt,useReducer:Qt,useRef:Qt,useState:Qt,useDebugValue:Qt,useDeferredValue:Qt,useTransition:Qt,useMutableSource:Qt,useSyncExternalStore:Qt,useId:Qt,unstable_isNewReconciler:!1},_7={readContext:ur,useCallback:function(t,e){return Yr().memoizedState=[t,e===void 0?null:e],t},useContext:ur,useEffect:Wy,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,c0(4194308,4,j4.bind(null,e,t),n)},useLayoutEffect:function(t,e){return c0(4194308,4,t,e)},useInsertionEffect:function(t,e){return c0(4,2,t,e)},useMemo:function(t,e){var n=Yr();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Yr();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=x7.bind(null,ht,t),[r.memoizedState,t]},useRef:function(t){var e=Yr();return t={current:t},e.memoizedState=t},useState:zy,useDebugValue:bw,useDeferredValue:function(t){return Yr().memoizedState=t},useTransition:function(){var t=zy(!1),e=t[0];return t=b7.bind(null,t[1]),Yr().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=ht,i=Yr();if(lt){if(n===void 0)throw Error(te(407));n=n()}else{if(n=e(),Ut===null)throw Error(te(349));Hs&30||P4(r,e,n)}i.memoizedState=n;var o={value:n,getSnapshot:e};return i.queue=o,Wy(O4.bind(null,r,o,t),[t]),r.flags|=2048,Bu(9,I4.bind(null,r,o,n,e),void 0,null),n},useId:function(){var t=Yr(),e=Ut.identifierPrefix;if(lt){var n=Ii,r=Pi;n=(r&~(1<<32-kr(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Lu++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=s.createElement(n,{is:r.is}):(t=s.createElement(n),n==="select"&&(s=t,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):t=s.createElementNS(t,n),t[ti]=e,t[Ou]=r,nb(t,e,!1,!1),e.stateNode=t;e:{switch(s=tm(n,r),n){case"dialog":nt("cancel",t),nt("close",t),i=r;break;case"iframe":case"object":case"embed":nt("load",t),i=r;break;case"video":case"audio":for(i=0;iUl&&(e.flags|=128,r=!0,Wc(o,!1),e.lanes=4194304)}else{if(!r)if(t=L0(s),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),Wc(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!lt)return Jt(e),null}else 2*_t()-o.renderingStartTime>Ul&&n!==1073741824&&(e.flags|=128,r=!0,Wc(o,!1),e.lanes=4194304);o.isBackwards?(s.sibling=e.child,e.child=s):(n=o.last,n!==null?n.sibling=s:e.child=s,o.last=s)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=_t(),e.sibling=null,n=pt.current,tt(pt,r?n&1|2:n&1),e):(Jt(e),null);case 22:case 23:return Tw(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Dn&1073741824&&(Jt(e),e.subtreeFlags&6&&(e.flags|=8192)):Jt(e),null;case 24:return null;case 25:return null}throw Error(te(156,e.tag))}function P7(t,e){switch(sw(e),e.tag){case 1:return kn(e.type)&&R0(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Bl(),rt(An),rt(nn),mw(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return hw(e),null;case 13:if(rt(pt),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(te(340));Ll()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return rt(pt),null;case 4:return Bl(),null;case 10:return uw(e.type._context),null;case 22:case 23:return Tw(),null;case 24:return null;default:return null}}var Uf=!1,tn=!1,I7=typeof WeakSet=="function"?WeakSet:Set,ue=null;function sl(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){vt(t,e,r)}else n.current=null}function km(t,e,n){try{n()}catch(r){vt(t,e,r)}}var Jy=!1;function O7(t,e){if(dm=S0,t=l4(),iw(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,c=0,u=0,d=t,p=null;t:for(;;){for(var g;d!==n||i!==0&&d.nodeType!==3||(a=s+i),d!==o||r!==0&&d.nodeType!==3||(l=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(g=d.firstChild)!==null;)p=d,d=g;for(;;){if(d===t)break t;if(p===n&&++c===i&&(a=s),p===o&&++u===r&&(l=s),(g=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=g}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(fm={focusedElem:t,selectionRange:n},S0=!1,ue=e;ue!==null;)if(e=ue,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,ue=t;else for(;ue!==null;){e=ue;try{var b=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var S=b.memoizedProps,k=b.memoizedState,y=e.stateNode,m=y.getSnapshotBeforeUpdate(e.elementType===e.type?S:Cr(e.type,S),k);y.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var x=e.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(te(163))}}catch(A){vt(e,e.return,A)}if(t=e.sibling,t!==null){t.return=e.return,ue=t;break}ue=e.return}return b=Jy,Jy=!1,b}function du(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,o!==void 0&&km(e,n,o)}i=i.next}while(i!==r)}}function Bp(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function Rm(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function ob(t){var e=t.alternate;e!==null&&(t.alternate=null,ob(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[ti],delete e[Ou],delete e[mm],delete e[m7],delete e[g7])),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 sb(t){return t.tag===5||t.tag===3||t.tag===4}function Xy(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||sb(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 $m(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=k0));else if(r!==4&&(t=t.child,t!==null))for($m(t,e,n),t=t.sibling;t!==null;)$m(t,e,n),t=t.sibling}function Pm(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(Pm(t,e,n),t=t.sibling;t!==null;)Pm(t,e,n),t=t.sibling}var Zt=null,Er=!1;function ro(t,e,n){for(n=n.child;n!==null;)ab(t,e,n),n=n.sibling}function ab(t,e,n){if(ri&&typeof ri.onCommitFiberUnmount=="function")try{ri.onCommitFiberUnmount($p,n)}catch{}switch(n.tag){case 5:tn||sl(n,e);case 6:var r=Zt,i=Er;Zt=null,ro(t,e,n),Zt=r,Er=i,Zt!==null&&(Er?(t=Zt,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Zt.removeChild(n.stateNode));break;case 18:Zt!==null&&(Er?(t=Zt,n=n.stateNode,t.nodeType===8?Qh(t.parentNode,n):t.nodeType===1&&Qh(t,n),ku(t)):Qh(Zt,n.stateNode));break;case 4:r=Zt,i=Er,Zt=n.stateNode.containerInfo,Er=!0,ro(t,e,n),Zt=r,Er=i;break;case 0:case 11:case 14:case 15:if(!tn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&km(n,e,s),i=i.next}while(i!==r)}ro(t,e,n);break;case 1:if(!tn&&(sl(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){vt(n,e,a)}ro(t,e,n);break;case 21:ro(t,e,n);break;case 22:n.mode&1?(tn=(r=tn)||n.memoizedState!==null,ro(t,e,n),tn=r):ro(t,e,n);break;default:ro(t,e,n)}}function e3(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new I7),e.forEach(function(r){var i=z7.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function vr(t,e){var n=e.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~o}if(r=i,r=_t()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*M7(r/1960))-r,10t?16:t,Ao===null)var r=!1;else{if(t=Ao,Ao=null,F0=0,ze&6)throw Error(te(331));var i=ze;for(ze|=4,ue=t.current;ue!==null;){var o=ue,s=o.child;if(ue.flags&16){var a=o.deletions;if(a!==null){for(var l=0;l_t()-Ew?Bs(t,0):_w|=n),Rn(t,e)}function mb(t,e){e===0&&(t.mode&1?(e=Pf,Pf<<=1,!(Pf&130023424)&&(Pf=4194304)):e=1);var n=mn();t=ji(t,e),t!==null&&(ef(t,e,n),Rn(t,n))}function F7(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),mb(t,n)}function z7(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(te(314))}r!==null&&r.delete(e),mb(t,n)}var gb;gb=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||An.current)Tn=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Tn=!1,R7(t,e,n);Tn=!!(t.flags&131072)}else Tn=!1,lt&&e.flags&1048576&&v4(e,I0,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;u0(t,e),t=e.pendingProps;var i=Ml(e,nn.current);pl(e,n),i=ww(null,e,r,t,i,n);var o=yw();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,kn(r)?(o=!0,$0(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,fw(e),i.updater=Lp,e.stateNode=i,i._reactInternals=e,xm(e,r,t,n),e=Em(null,e,r,!0,o,n)):(e.tag=0,lt&&o&&ow(e),fn(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(u0(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=H7(r),t=Cr(r,t),i){case 0:e=_m(null,e,r,t,n);break e;case 1:e=Ky(null,e,r,t,n);break e;case 11:e=Gy(null,e,r,t,n);break e;case 14:e=qy(null,e,r,Cr(r.type,t),n);break e}throw Error(te(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Cr(r,i),_m(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Cr(r,i),Ky(t,e,r,i,n);case 3:e:{if(X4(e),t===null)throw Error(te(387));r=e.pendingProps,o=e.memoizedState,i=o.element,_4(t,e),M0(e,r,null,n);var s=e.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=jl(Error(te(423)),e),e=Yy(t,e,r,n,i);break e}else if(r!==i){i=jl(Error(te(424)),e),e=Yy(t,e,r,n,i);break e}else for(Bn=No(e.stateNode.containerInfo.firstChild),jn=e,lt=!0,Sr=null,n=A4(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ll(),r===i){e=Ui(t,e,n);break e}fn(t,e,r,n)}e=e.child}return e;case 5:return k4(e),t===null&&ym(e),r=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,s=i.children,pm(r,i)?s=null:o!==null&&pm(r,o)&&(e.flags|=32),J4(t,e),fn(t,e,s,n),e.child;case 6:return t===null&&ym(e),null;case 13:return eb(t,e,n);case 4:return pw(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Dl(e,null,r,n):fn(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Cr(r,i),Gy(t,e,r,i,n);case 7:return fn(t,e,e.pendingProps,n),e.child;case 8:return fn(t,e,e.pendingProps.children,n),e.child;case 12:return fn(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,o=e.memoizedProps,s=i.value,tt(O0,r._currentValue),r._currentValue=s,o!==null)if(Ir(o.value,s)){if(o.children===i.children&&!An.current){e=Ui(t,e,n);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=Oi(-1,n&-n),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),vm(o.return,n,e),a.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===e.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(te(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),vm(s,n,e),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===e){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}fn(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,pl(e,n),i=ur(i),r=r(i),e.flags|=1,fn(t,e,r,n),e.child;case 14:return r=e.type,i=Cr(r,e.pendingProps),i=Cr(r.type,i),qy(t,e,r,i,n);case 15:return Y4(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Cr(r,i),u0(t,e),e.tag=1,kn(r)?(t=!0,$0(e)):t=!1,pl(e,n),S4(e,r,i),xm(e,r,i,n),Em(null,e,r,!0,t,n);case 19:return tb(t,e,n);case 22:return Q4(t,e,n)}throw Error(te(156,e.tag))};function wb(t,e){return W5(t,e)}function W7(t,e,n,r){this.tag=t,this.key=n,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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ar(t,e,n,r){return new W7(t,e,n,r)}function kw(t){return t=t.prototype,!(!t||!t.isReactComponent)}function H7(t){if(typeof t=="function")return kw(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Gg)return 11;if(t===qg)return 14}return 2}function Bo(t,e){var n=t.alternate;return n===null?(n=ar(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function p0(t,e,n,r,i,o){var s=2;if(r=t,typeof t=="function")kw(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case Qa:return js(n.children,i,o,e);case Zg:s=8,i|=8;break;case V1:return t=ar(12,n,e,i|2),t.elementType=V1,t.lanes=o,t;case Z1:return t=ar(13,n,e,i),t.elementType=Z1,t.lanes=o,t;case G1:return t=ar(19,n,e,i),t.elementType=G1,t.lanes=o,t;case T5:return Up(n,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case E5:s=10;break e;case S5:s=9;break e;case Gg:s=11;break e;case qg:s=14;break e;case co:s=16,r=null;break e}throw Error(te(130,t==null?t:typeof t,""))}return e=ar(s,n,e,i),e.elementType=t,e.type=r,e.lanes=o,e}function js(t,e,n,r){return t=ar(7,t,r,e),t.lanes=n,t}function Up(t,e,n,r){return t=ar(22,t,r,e),t.elementType=T5,t.lanes=n,t.stateNode={isHidden:!1},t}function o1(t,e,n){return t=ar(6,t,null,e),t.lanes=n,t}function s1(t,e,n){return e=ar(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function V7(t,e,n,r,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=Uh(0),this.expirationTimes=Uh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Uh(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Rw(t,e,n,r,i,o,s,a,l){return t=new V7(t,e,n,a,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=ar(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},fw(o),t}function Z7(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(xb)}catch(t){console.error(t)}}xb(),v5.exports=Gn;var Q7=v5.exports,l3=Q7;W1.createRoot=l3.createRoot,W1.hydrateRoot=l3.hydrateRoot;const J7="_main_ewogh_1",X7="_wrapper_ewogh_14",eC="_animateGlow_ewogh_1",tC="_content_ewogh_38",nC="_footer_ewogh_42",rC="_container_ewogh_73",iC="_button_ewogh_91",oC="_highlight_ewogh_112",sC="_highlightSelected_ewogh_116",aC="_header_ewogh_150",lC="_buttons_ewogh_158",cC="_backdrop_ewogh_164",Gr={main:J7,wrapper:X7,animateGlow:eC,content:tC,footer:nC,container:rC,button:iC,highlight:oC,highlightSelected:sC,header:aC,buttons:lC,backdrop:cC},uC="2.9.15",dC=t=>t,Ow=t=>t,fC=()=>`viem@${uC}`;let ne=class Lm extends Error{constructor(e,n={}){var o;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:fC()});const r=n.cause instanceof Lm?n.cause.details:(o=n.cause)!=null&&o.message?n.cause.message:n.details,i=n.cause instanceof Lm&&n.cause.docsPath||n.docsPath;this.message=[e||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...i?[`Docs: https://viem.sh${i}${n.docsSlug?`#${n.docsSlug}`:""}`]:[],...r?[`Details: ${r}`]:[],`Version: ${this.version}`].join(` +`),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=i,this.metaMessages=n.metaMessages,this.shortMessage=e}walk(e){return Cb(this,e)}};function Cb(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t?Cb(t.cause,e):e?null:t}class pC extends ne{constructor({max:e,min:n,signed:r,size:i,value:o}){super(`Number "${o}" is not in safe ${i?`${i*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${e?`(${n} to ${e})`:`(above ${n})`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntegerOutOfRangeError"})}}class hC extends ne{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 mC extends ne{constructor({givenSize:e,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${e} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeOverflowError"})}}class _b extends ne{constructor({offset:e,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${r}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SliceOffsetOutOfBoundsError"})}}class Eb extends ne{constructor({size:e,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${e}) exceeds padding size (${n}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeExceedsPaddingSizeError"})}}class c3 extends ne{constructor({size:e,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${n} ${r} long, but is ${e} ${r} long.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidBytesLengthError"})}}function Ac(t,{dir:e,size:n=32}={}){return typeof t=="string"?jo(t,{dir:e,size:n}):gC(t,{dir:e,size:n})}function jo(t,{dir:e,size:n=32}={}){if(n===null)return t;const r=t.replace("0x","");if(r.length>n*2)throw new Eb({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[e==="right"?"padEnd":"padStart"](n*2,"0")}`}function gC(t,{dir:e,size:n=32}={}){if(n===null)return t;if(t.length>n)throw new Eb({size:t.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let i=0;i=Ci.zero&&t<=Ci.nine)return t-Ci.zero;if(t>=Ci.A&&t<=Ci.F)return t-(Ci.A-10);if(t>=Ci.a&&t<=Ci.f)return t-(Ci.a-10)}function zi(t,e={}){let n=t;e.size&&(jr(n,{size:e.size}),n=Ac(n,{dir:"right",size:e.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const i=r.length/2,o=new Uint8Array(i);for(let s=0,a=0;se)throw new mC({givenSize:Bt(t),maxSize:e})}function Uu(t,e={}){const{signed:n}=e;e.size&&jr(t,{size:e.size});const r=BigInt(t);if(!n)return r;const i=(t.length-2)/2,o=(1n<e.toString(16).padStart(2,"0"));function ke(t,e={}){return typeof t=="number"||typeof t=="bigint"?Je(t,e):typeof t=="string"?Nw(t,e):typeof t=="boolean"?Sb(t,e):Ft(t,e)}function Sb(t,e={}){const n=`0x${Number(t)}`;return typeof e.size=="number"?(jr(n,{size:e.size}),Ac(n,{size:e.size})):n}function Ft(t,e={}){let n="";for(let i=0;io||i_C(n,{includeName:e})).join(e?", ":","):""}function _C(t,{includeName:e}){return t.type.startsWith("tuple")?`(${Mw(t.components,{includeName:e})})${t.type.slice(5)}`:t.type+(e&&t.name?` ${t.name}`:"")}class EC extends ne{constructor({data:e,params:n,size:r}){super([`Data size of ${r} bytes is too small for given parameters.`].join(` +`),{metaMessages:[`Params: (${Mw(n,{includeName:!0})})`,`Data: ${e} (${r} 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=n,this.size=r}}class Zp extends ne{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingZeroDataError"})}}class SC extends ne{constructor({expectedLength:e,givenLength:n,type:r}){super([`ABI encoding array length mismatch for type ${r}.`,`Expected length: ${e}`,`Given length: ${n}`].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingArrayLengthMismatchError"})}}class TC extends ne{constructor({expectedSize:e,value:n}){super(`Size of bytes "${n}" (bytes${Bt(n)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingBytesSizeMismatchError"})}}class AC extends ne{constructor({expectedLength:e,givenLength:n}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${n}`].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingLengthMismatchError"})}}class Tb extends ne{constructor(e,{docsPath:n}){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:n}),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 H0 extends ne{constructor(e,{docsPath:n}={}){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:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionNotFoundError"})}}class kC extends ne{constructor(e,{docsPath:n}){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:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionOutputsNotFoundError"})}}class RC extends ne{constructor(e,n){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${zl(e.abiItem)}\`, and`,`\`${n.type}\` in \`${zl(n.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItemAmbiguityError"})}}class $C extends ne{constructor(e,{docsPath:n}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(` +`),{docsPath:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiEncodingType"})}}class PC extends ne{constructor(e,{docsPath:n}){super([`Type "${e}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(` +`),{docsPath:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiDecodingType"})}}class IC extends ne{constructor(e){super([`Value "${e}" is not a valid array.`].join(` +`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidArrayError"})}}class OC extends ne{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 Gs(t){return typeof t[0]=="string"?Pa(t):NC(t)}function NC(t){let e=0;for(const i of t)e+=i.length;const n=new Uint8Array(e);let r=0;for(const i of t)n.set(i,r),r+=i.length;return n}function Pa(t){return`0x${t.reduce((e,n)=>e+n.replace("0x",""),"")}`}class fr extends ne{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAddressError"})}}class MC extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}set(e,n){return super.set(e,n),this.maxSize&&this.size>this.maxSize&&this.delete(this.keys().next().value),this}}function d3(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function Ab(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 V0(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 kb(t,e){Ab(t);const n=e.outputLen;if(t.length>f3&Wf)}:{h:Number(t>>f3&Wf)|0,l:Number(t&Wf)|0}}function DC(t,e=!1){let n=new Uint32Array(t.length),r=new Uint32Array(t.length);for(let i=0;it<>>32-n,jC=(t,e,n)=>e<>>32-n,UC=(t,e,n)=>e<>>64-n,FC=(t,e,n)=>t<>>64-n;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const zC=t=>t instanceof Uint8Array,WC=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),a1=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),qr=(t,e)=>t<<32-e|t>>>e,HC=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!HC)throw new Error("Non little-endian hardware is not supported");function VC(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Lw(t){if(typeof t=="string"&&(t=VC(t)),!zC(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}class Rb{clone(){return this._cloneInto()}}function $b(t){const e=r=>t().update(Lw(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}const[Pb,Ib,Ob]=[[],[],[]],ZC=BigInt(0),Vc=BigInt(1),GC=BigInt(2),qC=BigInt(7),KC=BigInt(256),YC=BigInt(113);for(let t=0,e=Vc,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],Pb.push(2*(5*r+n)),Ib.push((t+1)*(t+2)/2%64);let i=ZC;for(let o=0;o<7;o++)e=(e<>qC)*YC)%KC,e&GC&&(i^=Vc<<(Vc<n>32?UC(t,e,n):BC(t,e,n),h3=(t,e,n)=>n>32?FC(t,e,n):jC(t,e,n);function XC(t,e=24){const n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let s=0;s<10;s++)n[s]=t[s]^t[s+10]^t[s+20]^t[s+30]^t[s+40];for(let s=0;s<10;s+=2){const a=(s+8)%10,l=(s+2)%10,c=n[l],u=n[l+1],d=p3(c,u,1)^n[a],p=h3(c,u,1)^n[a+1];for(let g=0;g<50;g+=10)t[s+g]^=d,t[s+g+1]^=p}let i=t[2],o=t[3];for(let s=0;s<24;s++){const a=Ib[s],l=p3(i,o,a),c=h3(i,o,a),u=Pb[s];i=t[u],o=t[u+1],t[u]=l,t[u+1]=c}for(let s=0;s<50;s+=10){for(let a=0;a<10;a++)n[a]=t[s+a];for(let a=0;a<10;a++)t[s+a]^=~n[(a+2)%10]&n[(a+4)%10]}t[0]^=QC[r],t[1]^=JC[r]}n.fill(0)}class Dw extends Rb{constructor(e,n,r,i=!1,o=24){if(super(),this.blockLen=e,this.suffix=n,this.outputLen=r,this.enableXOF=i,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,d3(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=WC(this.state)}keccak(){XC(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){V0(this);const{blockLen:n,state:r}=this;e=Lw(e);const i=e.length;for(let o=0;o=r&&this.keccak();const s=Math.min(r-this.posOut,o-i);e.set(n.subarray(this.posOut,this.posOut+s),i),this.posOut+=s,i+=s}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return d3(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(kb(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:n,suffix:r,outputLen:i,rounds:o,enableXOF:s}=this;return e||(e=new Dw(n,r,i,s,o)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=o,e.suffix=r,e.outputLen=i,e.enableXOF=s,e.destroyed=this.destroyed,e}}const e_=(t,e,n)=>$b(()=>new Dw(e,t,n)),t_=e_(1,136,256/8);function Fu(t,e){const n=e||"hex",r=t_($a(t,{strict:!1})?Vp(t):t);return n==="bytes"?r:ke(r)}function Bw(t,e){const n=e?`${e}${t.toLowerCase()}`:t.substring(2).toLowerCase(),r=Fu(Us(n),"bytes"),i=(e?n.substring(`${e}0x`.length):n).split("");for(let o=0;o<40;o+=2)r[o>>1]>>4>=8&&i[o]&&(i[o]=i[o].toUpperCase()),(r[o>>1]&15)>=8&&i[o+1]&&(i[o+1]=i[o+1].toUpperCase());return`0x${i.join("")}`}function lr(t,e){if(!Kt(t,{strict:!1}))throw new fr({address:t});return Bw(t,e)}const n_=/^0x[a-fA-F0-9]{40}$/,l1=new MC(8192);function Kt(t,e){const{strict:n=!0}=e??{};if(l1.has(t))return l1.get(t);const r=n_.test(t)?t.toLowerCase()===t?!0:n?Bw(t)===t:!0:!1;return l1.set(t,r),r}function zu(t,e,n,{strict:r}={}){return $a(t,{strict:!1})?r_(t,e,n,{strict:r}):Lb(t,e,n,{strict:r})}function Nb(t,e){if(typeof e=="number"&&e>0&&e>Bt(t)-1)throw new _b({offset:e,position:"start",size:Bt(t)})}function Mb(t,e,n){if(typeof e=="number"&&typeof n=="number"&&Bt(t)!==n-e)throw new _b({offset:n,position:"end",size:Bt(t)})}function Lb(t,e,n,{strict:r}={}){Nb(t,e);const i=t.slice(e,n);return r&&Mb(i,e,n),i}function r_(t,e,n,{strict:r}={}){Nb(t,e);const i=`0x${t.replace("0x","").slice((e??0)*2,(n??t.length)*2)}`;return r&&Mb(i,e,n),i}function i_(t,e){if(t.length!==e.length)throw new AC({expectedLength:t.length,givenLength:e.length});const n=o_({params:t,values:e}),r=Uw(n);return r.length===0?"0x":r}function o_({params:t,values:e}){const n=[];for(let r=0;r0?Gs([a,s]):a}}if(i)return{dynamic:!0,encoded:s}}return{dynamic:!1,encoded:Gs(o.map(({encoded:s})=>s))}}function l_(t,{param:e}){const[,n]=e.type.split("bytes"),r=Bt(t);if(!n){let i=t;return r%32!==0&&(i=jo(i,{dir:"right",size:Math.ceil((t.length-2)/2/32)*32})),{dynamic:!0,encoded:Gs([jo(Je(r,{size:32})),i])}}if(r!==parseInt(n))throw new TC({expectedSize:parseInt(n),value:t});return{dynamic:!1,encoded:jo(t,{dir:"right"})}}function c_(t){if(typeof t!="boolean")throw new ne(`Invalid boolean value: "${t}" (type: ${typeof t}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:jo(Sb(t))}}function u_(t,{signed:e}){return{dynamic:!1,encoded:Je(t,{size:32,signed:e})}}function d_(t){const e=Nw(t),n=Math.ceil(Bt(e)/32),r=[];for(let i=0;ii))}}function Fw(t){const e=t.match(/^(.*)\[(\d+)?\]$/);return e?[e[2]?Number(e[2]):null,e[1]]:void 0}function gi(t){return typeof t=="string"?{address:t,type:"json-rpc"}:t}class Db extends ne{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 Dm extends ne{constructor({blockNumber:e,chain:n,contract:r}){super(`Chain "${n.name}" does not support contract "${r.name}".`,{metaMessages:["This could be due to any of the following:",...e&&r.blockCreated&&r.blockCreated>e?[`- The contract "${r.name}" was not deployed until block ${r.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${r.name}" configured.`]]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDoesNotSupportContract"})}}class p_ extends ne{constructor({chain:e,currentChainId:n}){super(`The current chain of the wallet (id: ${n}) does not match the target chain for the transaction (id: ${e.id} – ${e.name}).`,{metaMessages:[`Current Chain ID: ${n}`,`Expected Chain ID: ${e.id} – ${e.name}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainMismatchError"})}}class h_ extends ne{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 Bb extends ne{constructor(){super("No chain was provided to the Client."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ClientChainNotConfiguredError"})}}class of extends ne{constructor({chainId:e}){super(typeof e=="number"?`Chain ID "${e}" is invalid.`:"Chain ID is invalid."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidChainIdError"})}}function m_({chain:t,currentChainId:e}){if(!t)throw new h_;if(e!==t.id)throw new p_({chain:t,currentChainId:e})}const g_={gwei:9,wei:18},w_={ether:-9,wei:9},y_={ether:-18,gwei:-9};function Gp(t,e){let n=t.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(e,"0");let[i,o]=[n.slice(0,n.length-e),n.slice(n.length-e)];return o=o.replace(/(0+)$/,""),`${r?"-":""}${i||"0"}${o?`.${o}`:""}`}function $n(t,e="wei"){return Gp(t,w_[e])}class ll extends ne{constructor({cause:e,message:n}={}){var i;const r=(i=n==null?void 0:n.replace("execution reverted: ",""))==null?void 0:i.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ExecutionRevertedError"})}}Object.defineProperty(ll,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(ll,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class Wi extends ne{constructor({cause:e,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${$n(n)} 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(Wi,"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 Bm extends ne{constructor({cause:e,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${$n(n)}`:""} 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(Bm,"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 jm extends ne{constructor({cause:e,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}is higher than the next one expected.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooHighError"})}}Object.defineProperty(jm,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class Um extends ne{constructor({cause:e,nonce:n}={}){super([`Nonce provided for the transaction ${n?`(${n}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(` +`),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooLowError"})}}Object.defineProperty(Um,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class Fm extends ne{constructor({cause:e,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}exceeds the maximum allowed nonce.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceMaxValueError"})}}Object.defineProperty(Fm,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class zm extends ne{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(zm,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds/});class Wm extends ne{constructor({cause:e,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}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(Wm,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class Hm extends ne{constructor({cause:e,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction is too low.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooLowError"})}}Object.defineProperty(Hm,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class Vm extends ne{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(Vm,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class qs extends ne{constructor({cause:e,maxPriorityFeePerGas:n,maxFeePerGas:r}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${n?` = ${$n(n)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${$n(r)} gwei`:""}).`].join(` +`),{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TipAboveFeeCapError"})}}Object.defineProperty(qs,"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 qp extends ne{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 zw(t,e="wei"){return Gp(t,g_[e])}function sf(t){const e=Object.entries(t).map(([r,i])=>i===void 0||i===!1?null:[r,i]).filter(Boolean),n=e.reduce((r,[i])=>Math.max(r,i.length),0);return e.map(([r,i])=>` ${`${r}:`.padEnd(n+1)} ${i}`).join(` +`)}class v_ extends ne{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 b_ extends ne{constructor({v:e}){super(`Invalid \`v\` value "${e}". Expected 27 or 28.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidLegacyVError"})}}class x_ extends ne{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",sf(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","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- a Legacy Transaction with `gasPrice`"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSerializableTransactionError"})}}class C_ extends ne{constructor({storageKey:e}){super(`Size for storage key "${e}" is invalid. Expected 32 bytes. Got ${Math.floor((e.length-2)/2)} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStorageKeySizeError"})}}class __ extends ne{constructor(e,{account:n,docsPath:r,chain:i,data:o,gas:s,gasPrice:a,maxFeePerGas:l,maxPriorityFeePerGas:c,nonce:u,to:d,value:p}){var b;const g=sf({chain:i&&`${i==null?void 0:i.name} (id: ${i==null?void 0:i.id})`,from:n==null?void 0:n.address,to:d,value:typeof p<"u"&&`${zw(p)} ${((b=i==null?void 0:i.nativeCurrency)==null?void 0:b.symbol)||"ETH"}`,data:o,gas:s,gasPrice:typeof a<"u"&&`${$n(a)} gwei`,maxFeePerGas:typeof l<"u"&&`${$n(l)} gwei`,maxPriorityFeePerGas:typeof c<"u"&&`${$n(c)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:r,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Request 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:"TransactionExecutionError"}),this.cause=e}}const Uo=(t,e,n)=>JSON.stringify(t,(r,i)=>{const o=typeof i=="bigint"?i.toString():i;return typeof e=="function"?e(r,o):o},n);class hu extends ne{constructor({body:e,details:n,headers:r,status:i,url:o}){super("HTTP request failed.",{details:n,metaMessages:[i&&`Status: ${i}`,`URL: ${Ow(o)}`,e&&`Request body: ${Uo(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=r,this.status=i,this.url=o}}class jb extends ne{constructor({body:e,error:n,url:r}){super("RPC Request failed.",{cause:n,details:n.message,metaMessages:[`URL: ${Ow(r)}`,`Request body: ${Uo(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=n.code}}class m3 extends ne{constructor({body:e,url:n}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${Ow(n)}`,`Request body: ${Uo(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TimeoutError"})}}const E_=-1;class Nn extends ne{constructor(e,{code:n,docsPath:r,metaMessages:i,shortMessage:o}){super(o,{cause:e,docsPath:r,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 jb?e.code:n??E_}}class kc extends Nn{constructor(e,n){super(e,n),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=n.data}}class Wu extends Nn{constructor(e){super(e,{code:Wu.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(Wu,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class Hu extends Nn{constructor(e){super(e,{code:Hu.code,shortMessage:"JSON is not a valid request object."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidRequestRpcError"})}}Object.defineProperty(Hu,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class Vu extends Nn{constructor(e){super(e,{code:Vu.code,shortMessage:"The method does not exist / is not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotFoundRpcError"})}}Object.defineProperty(Vu,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class Zu extends Nn{constructor(e){super(e,{code:Zu.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(Zu,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class Ks extends Nn{constructor(e){super(e,{code:Ks.code,shortMessage:"An internal error was received."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InternalRpcError"})}}Object.defineProperty(Ks,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class Gu extends Nn{constructor(e){super(e,{code:Gu.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(Gu,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class qu extends Nn{constructor(e){super(e,{code:qu.code,shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(qu,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class Fo extends Nn{constructor(e){super(e,{code:Fo.code,shortMessage:"Requested resource not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceUnavailableRpcError"})}}Object.defineProperty(Fo,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class Ku extends Nn{constructor(e){super(e,{code:Ku.code,shortMessage:"Transaction creation failed."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionRejectedRpcError"})}}Object.defineProperty(Ku,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class Yu extends Nn{constructor(e){super(e,{code:Yu.code,shortMessage:"Method is not implemented."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotSupportedRpcError"})}}Object.defineProperty(Yu,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class Wl extends Nn{constructor(e){super(e,{code:Wl.code,shortMessage:"Request exceeds defined limit."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"LimitExceededRpcError"})}}Object.defineProperty(Wl,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class Qu extends Nn{constructor(e){super(e,{code:Qu.code,shortMessage:"Version of JSON-RPC protocol is not supported."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"JsonRpcVersionUnsupportedError"})}}Object.defineProperty(Qu,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class Tt extends kc{constructor(e){super(e,{code:Tt.code,shortMessage:"User rejected the request."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UserRejectedRequestError"})}}Object.defineProperty(Tt,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class Ju extends kc{constructor(e){super(e,{code:Ju.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(Ju,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class Xu extends kc{constructor(e){super(e,{code:Xu.code,shortMessage:"The Provider does not support the requested method."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnsupportedProviderMethodError"})}}Object.defineProperty(Xu,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class ed extends kc{constructor(e){super(e,{code:ed.code,shortMessage:"The Provider is disconnected from all chains."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderDisconnectedError"})}}Object.defineProperty(ed,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class td extends kc{constructor(e){super(e,{code:td.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(td,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class Fn extends kc{constructor(e){super(e,{code:Fn.code,shortMessage:"An error occurred when attempting to switch chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainError"})}}Object.defineProperty(Fn,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class S_ extends Nn{constructor(e){super(e,{shortMessage:"An unknown RPC error occurred."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownRpcError"})}}function Ww(t,e){const n=(t.details||"").toLowerCase(),r=t instanceof ne?t.walk(i=>i.code===ll.code):t;return r instanceof ne?new ll({cause:t,message:r.details}):ll.nodeMessage.test(n)?new ll({cause:t,message:t.details}):Wi.nodeMessage.test(n)?new Wi({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):Bm.nodeMessage.test(n)?new Bm({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):jm.nodeMessage.test(n)?new jm({cause:t,nonce:e==null?void 0:e.nonce}):Um.nodeMessage.test(n)?new Um({cause:t,nonce:e==null?void 0:e.nonce}):Fm.nodeMessage.test(n)?new Fm({cause:t,nonce:e==null?void 0:e.nonce}):zm.nodeMessage.test(n)?new zm({cause:t}):Wm.nodeMessage.test(n)?new Wm({cause:t,gas:e==null?void 0:e.gas}):Hm.nodeMessage.test(n)?new Hm({cause:t,gas:e==null?void 0:e.gas}):Vm.nodeMessage.test(n)?new Vm({cause:t}):qs.nodeMessage.test(n)?new qs({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas,maxPriorityFeePerGas:e==null?void 0:e.maxPriorityFeePerGas}):new qp({cause:t})}function T_(t,{docsPath:e,...n}){const r=(()=>{const i=Ww(t,n);return i instanceof qp?t:i})();return new __(r,{docsPath:e,...n})}function Hw(t,{format:e}){if(!e)return{};const n={};function r(o){const s=Object.keys(o);for(const a of s)a in t&&(n[a]=t[a]),o[a]&&typeof o[a]=="object"&&!Array.isArray(o[a])&&r(o[a])}const i=e(t||{});return r(i),n}function Vw(t,e){return({exclude:n,format:r})=>({exclude:n,format:i=>{const o=e(i);if(n)for(const s of n)delete o[s];return{...o,...r(i)}},type:t})}const A_={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3"};function Kp(t){const e={};return typeof t.accessList<"u"&&(e.accessList=t.accessList),typeof t.blobVersionedHashes<"u"&&(e.blobVersionedHashes=t.blobVersionedHashes),typeof t.blobs<"u"&&(typeof t.blobs[0]!="string"?e.blobs=t.blobs.map(n=>Ft(n)):e.blobs=t.blobs),typeof t.data<"u"&&(e.data=t.data),typeof t.from<"u"&&(e.from=t.from),typeof t.gas<"u"&&(e.gas=Je(t.gas)),typeof t.gasPrice<"u"&&(e.gasPrice=Je(t.gasPrice)),typeof t.maxFeePerBlobGas<"u"&&(e.maxFeePerBlobGas=Je(t.maxFeePerBlobGas)),typeof t.maxFeePerGas<"u"&&(e.maxFeePerGas=Je(t.maxFeePerGas)),typeof t.maxPriorityFeePerGas<"u"&&(e.maxPriorityFeePerGas=Je(t.maxPriorityFeePerGas)),typeof t.nonce<"u"&&(e.nonce=Je(t.nonce)),typeof t.to<"u"&&(e.to=t.to),typeof t.type<"u"&&(e.type=A_[t.type]),typeof t.value<"u"&&(e.value=Je(t.value)),e}const k_=Vw("transactionRequest",Kp);function St(t,e,n){return r=>{var i;return((i=t[e.name||n])==null?void 0:i.call(t,r))??e(t,r)}}function Yp(t){const{account:e,gasPrice:n,maxFeePerGas:r,maxPriorityFeePerGas:i,to:o}=t,s=e?gi(e):void 0;if(s&&!Kt(s.address))throw new fr({address:s.address});if(o&&!Kt(o))throw new fr({address:o});if(typeof n<"u"&&(typeof r<"u"||typeof i<"u"))throw new v_;if(r&&r>2n**256n-1n)throw new Wi({maxFeePerGas:r});if(i&&r&&i>r)throw new qs({maxFeePerGas:r,maxPriorityFeePerGas:i})}async function Ub(t){const e=await t.request({method:"eth_chainId"});return Fl(e)}class R_ extends ne{constructor(){super("`baseFeeMultiplier` must be greater than 1."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseFeeScalarError"})}}class Zw extends ne{constructor(){super("Chain does not support EIP-1559 fees."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip1559FeesNotSupportedError"})}}class $_ extends ne{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${$n(e)} gwei).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MaxFeePerGasTooLowError"})}}class P_ extends ne{constructor({blockHash:e,blockNumber:n}){let r="Block";e&&(r=`Block at hash "${e}"`),n&&(r=`Block at number "${n}"`),super(`${r} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlockNotFoundError"})}}const I_={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844"};function Gw(t){const e={...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,chainId:t.chainId?Fl(t.chainId):void 0,gas:t.gas?BigInt(t.gas):void 0,gasPrice:t.gasPrice?BigInt(t.gasPrice):void 0,maxFeePerBlobGas:t.maxFeePerBlobGas?BigInt(t.maxFeePerBlobGas):void 0,maxFeePerGas:t.maxFeePerGas?BigInt(t.maxFeePerGas):void 0,maxPriorityFeePerGas:t.maxPriorityFeePerGas?BigInt(t.maxPriorityFeePerGas):void 0,nonce:t.nonce?Fl(t.nonce):void 0,to:t.to?t.to:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,type:t.type?I_[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.maxFeePerBlobGas,delete e.maxFeePerGas,delete e.maxPriorityFeePerGas,delete e.yParity),e.type==="eip2930"&&(delete e.maxFeePerBlobGas,delete e.maxFeePerGas,delete e.maxPriorityFeePerGas),e.type==="eip1559"&&delete e.maxFeePerBlobGas,e}const O_=Vw("transaction",Gw);function qw(t){var n;const e=(n=t.transactions)==null?void 0:n.map(r=>typeof r=="string"?r:Gw(r));return{...t,baseFeePerGas:t.baseFeePerGas?BigInt(t.baseFeePerGas):null,blobGasUsed:t.blobGasUsed?BigInt(t.blobGasUsed):void 0,difficulty:t.difficulty?BigInt(t.difficulty):void 0,excessBlobGas:t.excessBlobGas?BigInt(t.excessBlobGas):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}}const N_=Vw("block",qw);async function Ys(t,{blockHash:e,blockNumber:n,blockTag:r,includeTransactions:i}={}){var u,d,p;const o=r??"latest",s=i??!1,a=n!==void 0?Je(n):void 0;let l=null;if(e?l=await t.request({method:"eth_getBlockByHash",params:[e,s]}):l=await t.request({method:"eth_getBlockByNumber",params:[a||o,s]}),!l)throw new P_({blockHash:e,blockNumber:n});return(((p=(d=(u=t.chain)==null?void 0:u.formatters)==null?void 0:d.block)==null?void 0:p.format)||qw)(l)}async function Fb(t){const e=await t.request({method:"eth_gasPrice"});return BigInt(e)}async function M_(t,e){var o,s,a;const{block:n,chain:r=t.chain,request:i}=e||{};if(typeof((o=r==null?void 0:r.fees)==null?void 0:o.defaultPriorityFee)=="function"){const l=n||await St(t,Ys,"getBlock")({});return r.fees.defaultPriorityFee({block:l,client:t,request:i})}if(typeof((s=r==null?void 0:r.fees)==null?void 0:s.defaultPriorityFee)<"u")return(a=r==null?void 0:r.fees)==null?void 0:a.defaultPriorityFee;try{const l=await t.request({method:"eth_maxPriorityFeePerGas"});return Uu(l)}catch{const[l,c]=await Promise.all([n?Promise.resolve(n):St(t,Ys,"getBlock")({}),St(t,Fb,"getGasPrice")({})]);if(typeof l.baseFeePerGas!="bigint")throw new Zw;const u=c-l.baseFeePerGas;return u<0n?0n:u}}async function g3(t,e){var p,g;const{block:n,chain:r=t.chain,request:i,type:o="eip1559"}=e||{},s=await(async()=>{var b,S;return typeof((b=r==null?void 0:r.fees)==null?void 0:b.baseFeeMultiplier)=="function"?r.fees.baseFeeMultiplier({block:n,client:t,request:i}):((S=r==null?void 0:r.fees)==null?void 0:S.baseFeeMultiplier)??1.2})();if(s<1)throw new R_;const l=10**(((p=s.toString().split(".")[1])==null?void 0:p.length)??0),c=b=>b*BigInt(Math.ceil(s*l))/BigInt(l),u=n||await St(t,Ys,"getBlock")({});if(typeof((g=r==null?void 0:r.fees)==null?void 0:g.estimateFeesPerGas)=="function"){const b=await r.fees.estimateFeesPerGas({block:n,client:t,multiply:c,request:i,type:o});if(b!==null)return b}if(o==="eip1559"){if(typeof u.baseFeePerGas!="bigint")throw new Zw;const b=typeof(i==null?void 0:i.maxPriorityFeePerGas)=="bigint"?i.maxPriorityFeePerGas:await M_(t,{block:u,chain:r,request:i}),S=c(u.baseFeePerGas);return{maxFeePerGas:(i==null?void 0:i.maxFeePerGas)??S+b,maxPriorityFeePerGas:b}}return{gasPrice:(i==null?void 0:i.gasPrice)??c(await St(t,Fb,"getGasPrice")({}))}}class L_ extends ne{constructor(e,{account:n,docsPath:r,chain:i,data:o,gas:s,gasPrice:a,maxFeePerGas:l,maxPriorityFeePerGas:c,nonce:u,to:d,value:p}){var b;const g=sf({from:n==null?void 0:n.address,to:d,value:typeof p<"u"&&`${zw(p)} ${((b=i==null?void 0:i.nativeCurrency)==null?void 0:b.symbol)||"ETH"}`,data:o,gas:s,gasPrice:typeof a<"u"&&`${$n(a)} gwei`,maxFeePerGas:typeof l<"u"&&`${$n(l)} gwei`,maxPriorityFeePerGas:typeof c<"u"&&`${$n(c)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:r,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas 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:"EstimateGasExecutionError"}),this.cause=e}}function D_(t,{docsPath:e,...n}){const r=(()=>{const i=Ww(t,n);return i instanceof qp?t:i})();return new L_(r,{docsPath:e,...n})}async function B_(t,e){var i,o,s;const n=e.account??t.account,r=n?gi(n):void 0;try{const{accessList:a,blobs:l,blobVersionedHashes:c,blockNumber:u,blockTag:d,data:p,gas:g,gasPrice:b,maxFeePerBlobGas:S,maxFeePerGas:k,maxPriorityFeePerGas:y,nonce:m,to:x,value:A,...M}=await Yb(t,{...e,parameters:(r==null?void 0:r.type)==="local"?void 0:["blobVersionedHashes"]}),H=(u?Je(u):void 0)||d;Yp(e);const w=(s=(o=(i=t.chain)==null?void 0:i.formatters)==null?void 0:o.transactionRequest)==null?void 0:s.format,_=(w||Kp)({...Hw(M,{format:w}),from:r==null?void 0:r.address,accessList:a,blobs:l,blobVersionedHashes:c,data:p,gas:g,gasPrice:b,maxFeePerBlobGas:S,maxFeePerGas:k,maxPriorityFeePerGas:y,nonce:m,to:x,value:A}),O=await t.request({method:"eth_estimateGas",params:H?[_,H]:[_]});return BigInt(O)}catch(a){throw D_(a,{...e,account:r,chain:t.chain})}}async function j_(t,{address:e,blockTag:n="latest",blockNumber:r}){const i=await t.request({method:"eth_getTransactionCount",params:[e,r?Je(r):n]});return Fl(i)}function Kw(t){const{kzg:e}=t,n=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),r=typeof t.blobs[0]=="string"?t.blobs.map(o=>zi(o)):t.blobs,i=[];for(const o of r)i.push(Uint8Array.from(e.blobToKzgCommitment(o)));return n==="bytes"?i:i.map(o=>Ft(o))}function Yw(t){const{kzg:e}=t,n=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),r=typeof t.blobs[0]=="string"?t.blobs.map(s=>zi(s)):t.blobs,i=typeof t.commitments[0]=="string"?t.commitments.map(s=>zi(s)):t.commitments,o=[];for(let s=0;sFt(s))}function U_(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const i=BigInt(32),o=BigInt(4294967295),s=Number(n>>i&o),a=Number(n&o),l=r?4:0,c=r?0:4;t.setUint32(e+l,s,r),t.setUint32(e+c,a,r)}class F_ extends Rb{constructor(e,n,r,i){super(),this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=a1(this.buffer)}update(e){V0(this);const{view:n,buffer:r,blockLen:i}=this;e=Lw(e);const o=e.length;for(let s=0;si-s&&(this.process(r,0),s=0);for(let d=s;du.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;dt&e^~t&n,W_=(t,e,n)=>t&e^t&n^e&n,H_=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]),io=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),oo=new Uint32Array(64);class V_ extends F_{constructor(){super(64,32,8,!1),this.A=io[0]|0,this.B=io[1]|0,this.C=io[2]|0,this.D=io[3]|0,this.E=io[4]|0,this.F=io[5]|0,this.G=io[6]|0,this.H=io[7]|0}get(){const{A:e,B:n,C:r,D:i,E:o,F:s,G:a,H:l}=this;return[e,n,r,i,o,s,a,l]}set(e,n,r,i,o,s,a,l){this.A=e|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=o|0,this.F=s|0,this.G=a|0,this.H=l|0}process(e,n){for(let d=0;d<16;d++,n+=4)oo[d]=e.getUint32(n,!1);for(let d=16;d<64;d++){const p=oo[d-15],g=oo[d-2],b=qr(p,7)^qr(p,18)^p>>>3,S=qr(g,17)^qr(g,19)^g>>>10;oo[d]=S+oo[d-7]+b+oo[d-16]|0}let{A:r,B:i,C:o,D:s,E:a,F:l,G:c,H:u}=this;for(let d=0;d<64;d++){const p=qr(a,6)^qr(a,11)^qr(a,25),g=u+p+z_(a,l,c)+H_[d]+oo[d]|0,S=(qr(r,2)^qr(r,13)^qr(r,22))+W_(r,i,o)|0;u=c,c=l,l=a,a=s+g|0,s=o,o=i,i=r,r=g+S|0}r=r+this.A|0,i=i+this.B|0,o=o+this.C|0,s=s+this.D|0,a=a+this.E|0,l=l+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(r,i,o,s,a,l,c,u)}roundClean(){oo.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Z_=$b(()=>new V_);function G_(t,e){const n=e||"hex",r=Z_($a(t,{strict:!1})?Vp(t):t);return n==="bytes"?r:ke(r)}function q_(t){const{commitment:e,version:n=1}=t,r=t.to??(typeof e=="string"?"hex":"bytes"),i=G_(e,"bytes");return i.set([n],0),r==="bytes"?i:Ft(i)}function zb(t){const{commitments:e,version:n}=t,r=t.to??(typeof e[0]=="string"?"hex":"bytes"),i=[];for(const o of e)i.push(q_({commitment:o,to:r,version:n}));return i}const w3=6,Wb=32,Qw=4096,Hb=Wb*Qw,y3=Hb*w3-1-1*Qw*w3,Vb=1;class K_ extends ne{constructor({maxSize:e,size:n}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${n} bytes`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlobSizeTooLargeError"})}}class Zb extends ne{constructor(){super("Blob data must not be empty."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EmptyBlobError"})}}class Y_ extends ne{constructor({hash:e,size:n}){super(`Versioned hash "${e}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${n}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidVersionedHashSizeError"})}}class Q_ extends ne{constructor({hash:e,version:n}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:[`Expected: ${Vb}`,`Received: ${n}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidVersionedHashVersionError"})}}class v3 extends ne{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NegativeOffsetError"})}}class J_ extends ne{constructor({length:e,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PositionOutOfBoundsError"})}}class X_ extends ne{constructor({count:e,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RecursiveReadLimitExceededError"})}}const eE={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 X_({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(t){if(t<0||t>this.bytes.length-1)throw new J_({length:this.bytes.length,position:t})},decrementPosition(t){if(t<0)throw new v3({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 v3({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 n=e??this.position;return this.assertPosition(n+t-1),this.bytes.subarray(n,n+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 n=this.inspectBytes(t);return this.position+=e??t,n},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},get remaining(){return this.bytes.length-this.position},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 Jw(t,{recursiveReadLimit:e=8192}={}){const n=Object.create(eE);return n.bytes=t,n.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=e,n}function tE(t){const e=t.to??(typeof t.data=="string"?"hex":"bytes"),n=typeof t.data=="string"?zi(t.data):t.data,r=Bt(n);if(!r)throw new Zb;if(r>y3)throw new K_({maxSize:y3,size:r});const i=[];let o=!0,s=0;for(;o;){const a=Jw(new Uint8Array(Hb));let l=0;for(;la.bytes):i.map(a=>Ft(a.bytes))}function Gb(t){const{data:e,kzg:n,to:r}=t,i=t.blobs??tE({data:e,to:r}),o=t.commitments??Kw({blobs:i,kzg:n,to:r}),s=t.proofs??Yw({blobs:i,commitments:o,kzg:n,to:r}),a=[];for(let l=0;l"u"&&d&&(p.nonce=await St(t,j_,"getTransactionCount")({address:d.address,blockTag:"pending"})),(c.includes("fees")||c.includes("type"))&&typeof u>"u")try{p.type=qb(p)}catch{const S=await b();p.type=typeof(S==null?void 0:S.baseFeePerGas)=="bigint"?"eip1559":"legacy"}if(c.includes("fees"))if(p.type==="eip1559"||p.type==="eip4844"){if(typeof p.maxFeePerGas>"u"||typeof p.maxPriorityFeePerGas>"u"){const S=await b(),{maxFeePerGas:k,maxPriorityFeePerGas:y}=await g3(t,{block:S,chain:i,request:p});if(typeof e.maxPriorityFeePerGas>"u"&&e.maxFeePerGas&&e.maxFeePerGas"u"&&(p.gas=await St(t,B_,"estimateGas")({...p,account:d?{address:d.address,type:"json-rpc"}:void 0})),Yp(p),delete p.parameters,p}async function nE(t,{serializedTransaction:e}){return t.request({method:"eth_sendRawTransaction",params:[e]},{retryCount:0})}async function rE(t,e){var y,m,x,A;const{account:n=t.account,chain:r=t.chain,accessList:i,blobs:o,data:s,gas:a,gasPrice:l,maxFeePerBlobGas:c,maxFeePerGas:u,maxPriorityFeePerGas:d,nonce:p,to:g,value:b,...S}=e;if(!n)throw new Db({docsPath:"/docs/actions/wallet/sendTransaction"});const k=gi(n);try{Yp(e);let M;if(r!==null&&(M=await St(t,Ub,"getChainId")({}),m_({currentChainId:M,chain:r})),k.type==="local"){const C=await St(t,Yb,"prepareTransactionRequest")({account:k,accessList:i,blobs:o,chain:r,chainId:M,data:s,gas:a,gasPrice:l,maxFeePerBlobGas:c,maxFeePerGas:u,maxPriorityFeePerGas:d,nonce:p,parameters:[...Kb,"sidecars"],to:g,value:b,...S}),_=(y=r==null?void 0:r.serializers)==null?void 0:y.transaction,O=await k.signTransaction(C,{serializer:_});return await St(t,nE,"sendRawTransaction")({serializedTransaction:O})}const D=(A=(x=(m=t.chain)==null?void 0:m.formatters)==null?void 0:x.transactionRequest)==null?void 0:A.format,w=(D||Kp)({...Hw(S,{format:D}),accessList:i,blobs:o,data:s,from:k.address,gas:a,gasPrice:l,maxFeePerBlobGas:c,maxFeePerGas:u,maxPriorityFeePerGas:d,nonce:p,to:g,value:b});return await t.request({method:"eth_sendTransaction",params:[w]},{retryCount:0})}catch(M){throw T_(M,{...e,account:k,chain:e.chain||void 0})}}const Zm=[{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"}],Qb=[{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"}],iE=[...Qb,{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"}]}],oE=[...Qb,{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"}]}],b3=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}];function sE(t,e={}){typeof e.size<"u"&&jr(t,{size:e.size});const n=Ft(t,e);return Uu(n,e)}function aE(t,e={}){let n=t;if(typeof e.size<"u"&&(jr(n,{size:e.size}),n=Fi(n)),n.length>1||n[0]>1)throw new hC(n);return!!n[0]}function Ni(t,e={}){typeof e.size<"u"&&jr(t,{size:e.size});const n=Ft(t,e);return Fl(n,e)}function lE(t,e={}){let n=t;return typeof e.size<"u"&&(jr(n,{size:e.size}),n=Fi(n,{dir:"right"})),new TextDecoder().decode(n)}function Jb(t,e){const n=typeof e=="string"?zi(e):e,r=Jw(n);if(Bt(n)===0&&t.length>0)throw new Zp;if(Bt(e)&&Bt(e)<32)throw new EC({data:typeof e=="string"?e:Ft(e),params:t,size:Bt(e)});let i=0;const o=[];for(let s=0;s48?sE(i,{signed:n}):Ni(i,{signed:n}),32]}function hE(t,e,{staticPosition:n}){const r=e.components.length===0||e.components.some(({name:s})=>!s),i=r?[]:{};let o=0;if(nd(e)){const s=Ni(t.readBytes(Gm)),a=n+s;for(let l=0;l(\[(\d*)\])*)$/;function qm(t){let e=t.type;if(C3.test(t.type)&&"components"in t){e="(";const n=t.components.length;for(let i=0;iFu(Vp(t));function vE(t){return yE(t)}function bE(t){let e=!0,n="",r=0,i="",o=!1;for(let s=0;s{const e=typeof t=="string"?t:wE(t);return bE(e)};function Xb(t){return vE(xE(t))}const CE=Xb,Xw=t=>zu(Xb(t),0,4);function e2(t){const{abi:e,args:n=[],name:r}=t,i=$a(r,{strict:!1}),o=e.filter(a=>i?a.type==="function"?Xw(a)===r:a.type==="event"?CE(a)===r:!1:"name"in a&&a.name===r);if(o.length===0)return;if(o.length===1)return o[0];let s;for(const a of o){if(!("inputs"in a))continue;if(!n||n.length===0){if(!a.inputs||a.inputs.length===0)return a;continue}if(!a.inputs||a.inputs.length===0||a.inputs.length!==n.length)continue;if(n.every((c,u)=>{const d="inputs"in a&&a.inputs[u];return d?Km(c,d):!1})){if(s&&"inputs"in s&&s.inputs){const c=e6(a.inputs,s.inputs,n);if(c)throw new RC({abiItem:a,type:c[0]},{abiItem:s,type:c[1]})}s=a}}return s||o[0]}function Km(t,e){const n=typeof t,r=e.type;switch(r){case"address":return Kt(t,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in e?Object.values(e.components).every((i,o)=>Km(Object.values(t)[o],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(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||t instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(t)&&t.every(i=>Km(i,{...e,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function e6(t,e,n){for(const r in t){const i=t[r],o=e[r];if(i.type==="tuple"&&o.type==="tuple"&&"components"in i&&"components"in o)return e6(i.components,o.components,n[r]);const s=[i.type,o.type];if(s.includes("address")&&s.includes("bytes20")?!0:s.includes("address")&&s.includes("string")?Kt(n[r],{strict:!1}):s.includes("address")&&s.includes("bytes")?Kt(n[r],{strict:!1}):!1)return s}}const c1="/docs/contract/decodeFunctionResult";function af(t){const{abi:e,args:n,functionName:r,data:i}=t;let o=e[0];if(r){const a=e2({abi:e,args:n,name:r});if(!a)throw new H0(r,{docsPath:c1});o=a}if(o.type!=="function")throw new H0(void 0,{docsPath:c1});if(!o.outputs)throw new kC(o.name,{docsPath:c1});const s=Jb(o.outputs,i);if(s&&s.length>1)return s;if(s&&s.length===1)return s[0]}const _3="/docs/contract/encodeFunctionData";function _E(t){const{abi:e,args:n,functionName:r}=t;let i=e[0];if(r){const o=e2({abi:e,args:n,name:r});if(!o)throw new H0(r,{docsPath:_3});i=o}if(i.type!=="function")throw new H0(void 0,{docsPath:_3});return{abi:[i],functionName:Xw(zl(i))}}function Rc(t){const{args:e}=t,{abi:n,functionName:r}=(()=>{var a;return t.abi.length===1&&((a=t.functionName)!=null&&a.startsWith("0x"))?t:_E(t)})(),i=n[0],o=r,s="inputs"in i&&i.inputs?i_(i.inputs,e??[]):void 0;return Pa([o,s??"0x"])}function Qp({blockNumber:t,chain:e,contract:n}){var i;const r=(i=e==null?void 0:e.contracts)==null?void 0:i[n];if(!r)throw new Dm({chain:e,contract:{name:n}});if(t&&r.blockCreated&&r.blockCreated>t)throw new Dm({blockNumber:t,chain:e,contract:{name:n,blockCreated:r.blockCreated}});return r.address}const t6={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},EE={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},SE={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function TE(t){const{abi:e,data:n}=t,r=zu(n,0,4);if(r==="0x")throw new Zp;const o=[...e||[],EE,SE].find(s=>s.type==="error"&&r===Xw(zl(s)));if(!o)throw new Tb(r,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:o,args:"inputs"in o&&o.inputs&&o.inputs.length>0?Jb(o.inputs,zu(n,4)):void 0,errorName:o.name}}function n6({abiItem:t,args:e,includeFunctionName:n=!0,includeName:r=!1}){if("name"in t&&"inputs"in t&&t.inputs)return`${n?t.name:""}(${t.inputs.map((i,o)=>`${r&&i.name?`${i.name}: `:""}${typeof e[o]=="object"?Uo(e[o]):e[o]}`).join(", ")})`}class AE extends ne{constructor({address:e}){super(`State for account "${e}" is set multiple times.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountStateConflictError"})}}class kE extends ne{constructor(){super("state and stateDiff are set on the same account."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"StateAssignmentConflictError"})}}function E3(t){return t.reduce((e,{slot:n,value:r})=>`${e} ${n}: ${r} +`,"")}function RE(t){return t.reduce((e,{address:n,...r})=>{let i=`${e} ${n}: +`;return r.nonce&&(i+=` nonce: ${r.nonce} +`),r.balance&&(i+=` balance: ${r.balance} +`),r.code&&(i+=` code: ${r.code} +`),r.state&&(i+=` state: +`,i+=E3(r.state)),r.stateDiff&&(i+=` stateDiff: +`,i+=E3(r.stateDiff)),i},` State Override: +`).slice(0,-1)}class $E extends ne{constructor(e,{account:n,docsPath:r,chain:i,data:o,gas:s,gasPrice:a,maxFeePerGas:l,maxPriorityFeePerGas:c,nonce:u,to:d,value:p,stateOverride:g}){var k;const b=n?gi(n):void 0;let S=sf({from:b==null?void 0:b.address,to:d,value:typeof p<"u"&&`${zw(p)} ${((k=i==null?void 0:i.nativeCurrency)==null?void 0:k.symbol)||"ETH"}`,data:o,gas:s,gasPrice:typeof a<"u"&&`${$n(a)} gwei`,maxFeePerGas:typeof l<"u"&&`${$n(l)} gwei`,maxPriorityFeePerGas:typeof c<"u"&&`${$n(c)} gwei`,nonce:u});g&&(S+=` +${RE(g)}`),super(e.shortMessage,{cause:e,docsPath:r,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",S].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 t2 extends ne{constructor(e,{abi:n,args:r,contractAddress:i,docsPath:o,functionName:s,sender:a}){const l=e2({abi:n,args:r,name:s}),c=l?n6({abiItem:l,args:r,includeFunctionName:!1,includeName:!1}):void 0,u=l?zl(l,{includeName:!0}):void 0,d=sf({address:i&&dC(i),function:u,args:c&&c!=="()"&&`${[...Array((s==null?void 0:s.length)??0).keys()].map(()=>" ").join("")}${c}`,sender:a});super(e.shortMessage||`An unknown error occurred while executing the contract function "${s}".`,{cause:e,docsPath:o,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Contract Call:",d].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=n,this.args=r,this.cause=e,this.contractAddress=i,this.functionName=s,this.sender=a}}class Ym extends ne{constructor({abi:e,data:n,functionName:r,message:i}){let o,s,a,l;if(n&&n!=="0x")try{s=TE({abi:e,data:n});const{abiItem:u,errorName:d,args:p}=s;if(d==="Error")l=p[0];else if(d==="Panic"){const[g]=p;l=t6[g]}else{const g=u?zl(u,{includeName:!0}):void 0,b=u&&p?n6({abiItem:u,args:p,includeFunctionName:!1,includeName:!1}):void 0;a=[g?`Error: ${g}`:"",b&&b!=="()"?` ${[...Array((d==null?void 0:d.length)??0).keys()].map(()=>" ").join("")}${b}`:""]}}catch(u){o=u}else i&&(l=i);let c;o instanceof Tb&&(c=o.signature,a=[`Unable to decode signature "${c}" 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=${c}.`]),super(l&&l!=="execution reverted"||c?[`The contract function "${r}" reverted with the following ${c?"signature":"reason"}:`,l||c].join(` +`):`The contract function "${r}" reverted.`,{cause:o,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=s,this.reason=l,this.signature=c}}class PE extends ne{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 n2 extends ne{constructor({data:e,message:n}){super(n||""),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 r6(t,e){var r,i,o,s,a,l;if(!(t instanceof ne))return!1;const n=t.walk(c=>c instanceof Ym);return n instanceof Ym?!!(((r=n.data)==null?void 0:r.errorName)==="ResolverNotFound"||((i=n.data)==null?void 0:i.errorName)==="ResolverWildcardNotSupported"||((o=n.data)==null?void 0:o.errorName)==="ResolverNotContract"||((s=n.data)==null?void 0:s.errorName)==="ResolverError"||((a=n.data)==null?void 0:a.errorName)==="HttpError"||(l=n.reason)!=null&&l.includes("Wildcard on non-extended resolvers is not supported")||e==="reverse"&&n.reason===t6[50]):!1}function i6(t){if(t.length!==66||t.indexOf("[")!==0||t.indexOf("]")!==65)return null;const e=`0x${t.slice(1,65)}`;return $a(e)?e:null}function IE(t){let e=new Uint8Array(32).fill(0);if(!t)return Ft(e);const n=t.split(".");for(let r=n.length-1;r>=0;r-=1){const i=i6(n[r]),o=i?Vp(i):Fu(Us(n[r]),"bytes");e=Fu(Gs([e,o]),"bytes")}return Ft(e)}function OE(t){return`[${t.slice(2)}]`}function NE(t){const e=new Uint8Array(32).fill(0);return t?i6(t)||Fu(Us(t)):Ft(e)}function o6(t){const e=t.replace(/^\.|\.$/gm,"");if(e.length===0)return new Uint8Array(1);const n=new Uint8Array(Us(e).byteLength+2);let r=0;const i=e.split(".");for(let o=0;o255&&(s=Us(OE(NE(i[o])))),n[r]=s.length,n.set(s,r+1),r+=s.length+1}return n.byteLength!==r+1?n.slice(0,r+1):n}const ME=3;function Z0(t,{abi:e,address:n,args:r,docsPath:i,functionName:o,sender:s}){const{code:a,data:l,message:c,shortMessage:u}=t instanceof n2?t:t instanceof ne?t.walk(p=>"data"in p)||t.walk():{},d=t instanceof Zp?new PE({functionName:o}):[ME,Ks.code].includes(a)&&(l||c||u)?new Ym({abi:e,data:typeof l=="object"?l.data:l,functionName:o,message:u??c}):t;return new t2(d,{abi:e,args:r,contractAddress:n,docsPath:i,functionName:o,sender:s})}const LE="modulepreload",DE=function(t){return"/revo-withdrawal-dapp/"+t},S3={},Mi=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){const o=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),a=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));i=Promise.all(n.map(l=>{if(l=DE(l),l in S3)return;S3[l]=!0;const c=l.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(!!r)for(let g=o.length-1;g>=0;g--){const b=o[g];if(b.href===l&&(!c||b.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${u}`))return;const p=document.createElement("link");if(p.rel=c?"stylesheet":LE,c||(p.as="script",p.crossOrigin=""),p.href=l,a&&p.setAttribute("nonce",a),document.head.appendChild(p),c)return new Promise((g,b)=>{p.addEventListener("load",g),p.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${l}`)))})}))}return i.then(()=>e()).catch(o=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=o,window.dispatchEvent(s),!s.defaultPrevented)throw o})},BE="0x82ad56cb";function jE(t,{docsPath:e,...n}){const r=(()=>{const i=Ww(t,n);return i instanceof qp?t:i})();return new $E(r,{docsPath:e,...n})}const u1=new Map;function s6({fn:t,id:e,shouldSplitBatch:n,wait:r=0,sort:i}){const o=async()=>{const u=l();s();const d=u.map(({args:p})=>p);d.length!==0&&t(d).then(p=>{var g;i&&Array.isArray(p)&&p.sort(i);for(let b=0;b{var g;for(let b=0;bu1.delete(e),a=()=>l().map(({args:u})=>u),l=()=>u1.get(e)||[],c=u=>u1.set(e,[...l(),u]);return{flush:s,async schedule(u){const d={},p=new Promise((S,k)=>{d.resolve=S,d.reject=k});return(n==null?void 0:n([...a(),u]))&&o(),l().length>0?(c({args:u,pendingPromise:d}),p):(c({args:u,pendingPromise:d}),setTimeout(o,r),p)}}}async function a6(t,e){var A,M,D,H;const{account:n=t.account,batch:r=!!((A=t.batch)!=null&&A.multicall),blockNumber:i,blockTag:o="latest",accessList:s,blobs:a,data:l,gas:c,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:p,maxPriorityFeePerGas:g,nonce:b,to:S,value:k,stateOverride:y,...m}=e,x=n?gi(n):void 0;try{Yp(e);const C=(i?Je(i):void 0)||o,_=HE(y),O=(H=(D=(M=t.chain)==null?void 0:M.formatters)==null?void 0:D.transactionRequest)==null?void 0:H.format,U=(O||Kp)({...Hw(m,{format:O}),from:x==null?void 0:x.address,accessList:s,blobs:a,data:l,gas:c,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:p,maxPriorityFeePerGas:g,nonce:b,to:S,value:k});if(r&&UE({request:U})&&!_)try{return await FE(t,{...U,blockNumber:i,blockTag:o})}catch(I){if(!(I instanceof Bb)&&!(I instanceof Dm))throw I}const F=await t.request({method:"eth_call",params:_?[U,C,_]:[U,C]});return F==="0x"?{data:void 0}:{data:F}}catch(w){const C=zE(w),{offchainLookup:_,offchainLookupSignature:O}=await Mi(()=>import("./ccip-DGvF_b6K.js"),[]);if(t.ccipRead!==!1&&(C==null?void 0:C.slice(0,10))===O&&S)return{data:await _(t,{data:C,to:S})};throw jE(w,{...e,account:x,chain:t.chain})}}function UE({request:t}){const{data:e,to:n,...r}=t;return!(!e||e.startsWith(BE)||!n||Object.values(r).filter(i=>typeof i<"u").length>0)}async function FE(t,e){var S;const{batchSize:n=1024,wait:r=0}=typeof((S=t.batch)==null?void 0:S.multicall)=="object"?t.batch.multicall:{},{blockNumber:i,blockTag:o="latest",data:s,multicallAddress:a,to:l}=e;let c=a;if(!c){if(!t.chain)throw new Bb;c=Qp({blockNumber:i,chain:t.chain,contract:"multicall3"})}const d=(i?Je(i):void 0)||o,{schedule:p}=s6({id:`${t.uid}.${d}`,wait:r,shouldSplitBatch(k){return k.reduce((m,{data:x})=>m+(x.length-2),0)>n*2},fn:async k=>{const y=k.map(A=>({allowFailure:!0,callData:A.data,target:A.to})),m=Rc({abi:Zm,args:[y],functionName:"aggregate3"}),x=await t.request({method:"eth_call",params:[{data:m,to:c},d]});return af({abi:Zm,args:[y],functionName:"aggregate3",data:x||"0x"})}}),[{returnData:g,success:b}]=await p({data:s,to:l});if(!b)throw new n2({data:g});return g==="0x"?{data:void 0}:{data:g}}function zE(t){var n;if(!(t instanceof ne))return;const e=t.walk();return typeof(e==null?void 0:e.data)=="object"?(n=e.data)==null?void 0:n.data:e.data}function T3(t){if(!(!t||t.length===0))return t.reduce((e,{slot:n,value:r})=>{if(n.length!==66)throw new c3({size:n.length,targetSize:66,type:"hex"});if(r.length!==66)throw new c3({size:r.length,targetSize:66,type:"hex"});return e[n]=r,e},{})}function WE(t){const{balance:e,nonce:n,state:r,stateDiff:i,code:o}=t,s={};if(o!==void 0&&(s.code=o),e!==void 0&&(s.balance=Je(e)),n!==void 0&&(s.nonce=Je(n)),r!==void 0&&(s.state=T3(r)),i!==void 0){if(s.state)throw new kE;s.stateDiff=T3(i)}return s}function HE(t){if(!t)return;const e={};for(const{address:n,...r}of t){if(!Kt(n,{strict:!1}))throw new fr({address:n});if(e[n])throw new AE({address:n});e[n]=WE(r)}return e}async function Hl(t,e){const{abi:n,address:r,args:i,functionName:o,...s}=e,a=Rc({abi:n,args:i,functionName:o});try{const{data:l}=await St(t,a6,"call")({...s,data:a,to:r});return af({abi:n,args:i,functionName:o,data:l||"0x"})}catch(l){throw Z0(l,{abi:n,address:r,args:i,docsPath:"/docs/contract/readContract",functionName:o})}}class VE extends ne{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 Gc extends ne{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidNftUriError"})}}class r2 extends ne{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 ZE extends ne{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 GE=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,qE=/^(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\-.]+))?(?\/.*)?$/,KE=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,YE=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function QE(t){try{const e=await fetch(t,{method:"HEAD"});if(e.status===200){const n=e.headers.get("content-type");return n==null?void 0:n.startsWith("image/")}return!1}catch(e){return typeof e=="object"&&typeof e.response<"u"||!globalThis.hasOwnProperty("Image")?!1:new Promise(n=>{const r=new Image;r.onload=()=>{n(!0)},r.onerror=()=>{n(!1)},r.src=t})}}function A3(t,e){return t?t.endsWith("/")?t.slice(0,-1):t:e}function l6({uri:t,gatewayUrls:e}){const n=KE.test(t);if(n)return{uri:t,isOnChain:!0,isEncoded:n};const r=A3(e==null?void 0:e.ipfs,"https://ipfs.io"),i=A3(e==null?void 0:e.arweave,"https://arweave.net"),o=t.match(GE),{protocol:s,subpath:a,target:l,subtarget:c=""}=(o==null?void 0:o.groups)||{},u=s==="ipns:/"||a==="ipns/",d=s==="ipfs:/"||a==="ipfs/"||qE.test(t);if(t.startsWith("http")&&!u&&!d){let g=t;return e!=null&&e.arweave&&(g=t.replace(/https:\/\/arweave.net/g,e==null?void 0:e.arweave)),{uri:g,isOnChain:!1,isEncoded:!1}}if((u||d)&&l)return{uri:`${r}/${u?"ipns":"ipfs"}/${l}${c}`,isOnChain:!1,isEncoded:!1};if(s==="ar:/"&&l)return{uri:`${i}/${l}${c||""}`,isOnChain:!1,isEncoded:!1};let p=t.replace(YE,"");if(p.startsWith("i.json());return await i2({gatewayUrls:t,uri:c6(n)})}catch{throw new r2({uri:e})}}async function i2({gatewayUrls:t,uri:e}){const{uri:n,isOnChain:r}=l6({uri:e,gatewayUrls:t});if(r||await QE(n))return n;throw new r2({uri:e})}function XE(t){let e=t;e.startsWith("did:nft:")&&(e=e.replace("did:nft:","").replace(/_/g,"/"));const[n,r,i]=e.split("/"),[o,s]=n.split(":"),[a,l]=r.split(":");if(!o||o.toLowerCase()!=="eip155")throw new Gc({reason:"Only EIP-155 supported"});if(!s)throw new Gc({reason:"Chain ID not found"});if(!l)throw new Gc({reason:"Contract address not found"});if(!i)throw new Gc({reason:"Token ID not found"});if(!a)throw new Gc({reason:"ERC namespace not found"});return{chainID:parseInt(s),namespace:a.toLowerCase(),contractAddress:l,tokenID:i}}async function eS(t,{nft:e}){if(e.namespace==="erc721")return Hl(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 Hl(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 ZE({namespace:e.namespace})}async function tS(t,{gatewayUrls:e,record:n}){return/eip155:/i.test(n)?nS(t,{gatewayUrls:e,record:n}):i2({uri:n,gatewayUrls:e})}async function nS(t,{gatewayUrls:e,record:n}){const r=XE(n),i=await eS(t,{nft:r}),{uri:o,isOnChain:s,isEncoded:a}=l6({uri:i,gatewayUrls:e});if(s&&(o.includes("data:application/json;base64,")||o.startsWith("{"))){const c=a?atob(o.replace("data:application/json;base64,","")):o,u=JSON.parse(c);return i2({uri:c6(u),gatewayUrls:e})}let l=r.tokenID;return r.namespace==="erc1155"&&(l=l.replace("0x","").padStart(64,"0")),JE({gatewayUrls:e,uri:o.replace(/(?:0x)?{id}/,l)})}async function rS(t,{blockNumber:e,blockTag:n,name:r,key:i,gatewayUrls:o,strict:s,universalResolverAddress:a}){let l=a;if(!l){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");l=Qp({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const c={address:l,abi:iE,functionName:"resolve",args:[ke(o6(r)),Rc({abi:b3,functionName:"text",args:[IE(r),i]})],blockNumber:e,blockTag:n},u=St(t,Hl,"readContract"),d=o?await u({...c,args:[...c.args,o]}):await u(c);if(d[0]==="0x")return null;const p=af({abi:b3,functionName:"text",data:d[0]});return p===""?null:p}catch(c){if(s)throw c;if(r6(c,"resolve"))return null;throw c}}async function iS(t,{blockNumber:e,blockTag:n,assetGatewayUrls:r,name:i,gatewayUrls:o,strict:s,universalResolverAddress:a}){const l=await St(t,rS,"getEnsText")({blockNumber:e,blockTag:n,key:"avatar",name:i,universalResolverAddress:a,gatewayUrls:o,strict:s});if(!l)return null;try{return await tS(t,{record:l,gatewayUrls:r})}catch{return null}}async function oS(t,{address:e,blockNumber:n,blockTag:r,gatewayUrls:i,strict:o,universalResolverAddress:s}){let a=s;if(!a){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");a=Qp({blockNumber:n,chain:t.chain,contract:"ensUniversalResolver"})}const l=`${e.toLowerCase().substring(2)}.addr.reverse`;try{const c={address:a,abi:oE,functionName:"reverse",args:[ke(o6(l))],blockNumber:n,blockTag:r},u=St(t,Hl,"readContract"),[d,p]=i?await u({...c,args:[...c.args,i]}):await u(c);return e.toLowerCase()!==p.toLowerCase()?null:d}catch(c){if(o)throw c;if(r6(c,"reverse"))return null;throw c}}async function sS(t,{address:e,blockNumber:n,blockTag:r="latest"}){const i=n?Je(n):void 0,o=await t.request({method:"eth_getBalance",params:[e,i||r]});return BigInt(o)}async function aS(t,e){const{abi:n,address:r,args:i,dataSuffix:o,functionName:s,...a}=e,l=a.account?gi(a.account):t.account,c=Rc({abi:n,args:i,functionName:s});try{const{data:u}=await St(t,a6,"call")({batch:!1,data:`${c}${o?o.replace("0x",""):""}`,to:r,...a,account:l}),d=af({abi:n,args:i,functionName:s,data:u||"0x"}),p=n.filter(g=>"name"in g&&g.name===e.functionName);return{result:d,request:{abi:p,address:r,args:i,dataSuffix:o,functionName:s,...a,account:l}}}catch(u){throw Z0(u,{abi:n,address:r,args:i,docsPath:"/docs/contract/simulateContract",functionName:s,sender:l==null?void 0:l.address})}}const d1=new Map,k3=new Map;let lS=0;function cS(t,e,n){const r=++lS,i=()=>d1.get(t)||[],o=()=>{const u=i();d1.set(t,u.filter(d=>d.id!==r))},s=()=>{const u=k3.get(t);i().length===1&&u&&u(),o()},a=i();if(d1.set(t,[...a,{id:r,fns:e}]),a&&a.length>0)return s;const l={};for(const u in e)l[u]=(...d)=>{var g,b;const p=i();if(p.length!==0)for(const S of p)(b=(g=S.fns)[u])==null||b.call(g,...d)};const c=n(l);return typeof c=="function"&&k3.set(t,c),s}async function Qm(t){return new Promise(e=>setTimeout(e,t))}function uS(t,{emitOnBegin:e,initialWaitTime:n,interval:r}){let i=!0;const o=()=>i=!1;return(async()=>{let a;e&&(a=await t({unpoll:o}));const l=await(n==null?void 0:n(a))??r;await Qm(l);const c=async()=>{i&&(await t({unpoll:o}),await Qm(r),c())};c()})(),o}async function dS(t,e){const{abi:n,address:r,args:i,dataSuffix:o,functionName:s,...a}=e,l=Rc({abi:n,args:i,functionName:s});return St(t,rE,"sendTransaction")({data:`${l}${o?o.replace("0x",""):""}`,to:r,...a})}const Jm=256;let Hf=Jm,Vf;function fS(t=11){if(!Vf||Hf+t>Jm*2){Vf="",Hf=0;for(let e=0;e{const m=y(k);for(const A in b)delete m[A];const x={...k,...m};return Object.assign(x,{extend:S(x)})}}return Object.assign(b,{extend:S(b)})}function d6(t,{delay:e=100,retryCount:n=2,shouldRetry:r=()=>!0}={}){return new Promise((i,o)=>{const s=async({count:a=0}={})=>{const l=async({error:c})=>{const u=typeof e=="function"?e({count:a,error:c}):e;u&&await Qm(u),s({count:a+1})};try{const c=await t();i(c)}catch(c){if(a{const{retryDelay:i=150,retryCount:o=3}={...e,...r};return d6(async()=>{try{return await t(n)}catch(s){const a=s;switch(a.code){case Wu.code:throw new Wu(a);case Hu.code:throw new Hu(a);case Vu.code:throw new Vu(a);case Zu.code:throw new Zu(a);case Ks.code:throw new Ks(a);case Gu.code:throw new Gu(a);case qu.code:throw new qu(a);case Fo.code:throw new Fo(a);case Ku.code:throw new Ku(a);case Yu.code:throw new Yu(a);case Wl.code:throw new Wl(a);case Qu.code:throw new Qu(a);case Tt.code:throw new Tt(a);case Ju.code:throw new Ju(a);case Xu.code:throw new Xu(a);case ed.code:throw new ed(a);case td.code:throw new td(a);case Fn.code:throw new Fn(a);case 5e3:throw new Tt(a);default:throw s instanceof ne?s:new S_(a)}}},{delay:({count:s,error:a})=>{var l;if(a&&a instanceof hu){const c=(l=a==null?void 0:a.headers)==null?void 0:l.get("Retry-After");if(c!=null&&c.match(/\d/))return parseInt(c)*1e3}return~~(1<hS(s)})}}function hS(t){return"code"in t&&typeof t.code=="number"?t.code===-1||t.code===Wl.code||t.code===Ks.code:t instanceof hu&&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 f6({key:t,name:e,request:n,retryCount:r=3,retryDelay:i=150,timeout:o,type:s},a){return{config:{key:t,name:e,request:n,retryCount:r,retryDelay:i,timeout:o,type:s},request:pS(n,{retryCount:r,retryDelay:i}),value:a}}function mS(t,e={}){const{key:n="custom",name:r="Custom Provider",retryDelay:i}=e;return({retryCount:o})=>f6({key:n,name:r,request:t.request.bind(t),retryCount:e.retryCount??o,retryDelay:i,type:"custom"})}class gS extends ne{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro"})}}function p6(t,{errorInstance:e=new Error("timed out"),timeout:n,signal:r}){return new Promise((i,o)=>{(async()=>{let s;try{const a=new AbortController;n>0&&(s=setTimeout(()=>{r?a.abort():o(e)},n)),i(await t({signal:(a==null?void 0:a.signal)||null}))}catch(a){a.name==="AbortError"&&o(e),o(a)}finally{clearTimeout(s)}})()})}function wS(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const R3=wS();function yS(t,e={}){return{async request(n){var d;const{body:r,fetchOptions:i={},onRequest:o=e.onRequest,onResponse:s=e.onResponse,timeout:a=e.timeout??1e4}=n,{headers:l,method:c,signal:u}={...e.fetchOptions,...i};try{const p=await p6(async({signal:b})=>{const S=new Request(t,{...i,body:Array.isArray(r)?Uo(r.map(y=>({jsonrpc:"2.0",id:y.id??R3.take(),...y}))):Uo({jsonrpc:"2.0",id:r.id??R3.take(),...r}),headers:{...l,"Content-Type":"application/json"},method:c||"POST",signal:u||(a>0?b:null)});return o&&await o(S),await fetch(S)},{errorInstance:new m3({body:r,url:t}),timeout:a,signal:!0});s&&await s(p);let g;if((d=p.headers.get("Content-Type"))!=null&&d.startsWith("application/json")?g=await p.json():g=await p.text(),!p.ok)throw new hu({body:r,details:Uo(g.error)||p.statusText,headers:p.headers,status:p.status,url:t});return g}catch(p){throw p instanceof hu||p instanceof m3?p:new hu({body:r,details:p.message,url:t})}}}}function $3(t,e={}){const{batch:n,fetchOptions:r,key:i="http",name:o="HTTP JSON-RPC",onFetchRequest:s,onFetchResponse:a,retryDelay:l}=e;return({chain:c,retryCount:u,timeout:d})=>{const{batchSize:p=1e3,wait:g=0}=typeof n=="object"?n:{},b=e.retryCount??u,S=d??e.timeout??1e4,k=t||(c==null?void 0:c.rpcUrls.default.http[0]);if(!k)throw new gS;const y=yS(k,{fetchOptions:r,onRequest:s,onResponse:a,timeout:S});return f6({key:i,name:o,async request({method:m,params:x}){const A={method:m,params:x},{schedule:M}=s6({id:`${t}`,wait:g,shouldSplitBatch(C){return C.length>p},fn:C=>y.request({body:C}),sort:(C,_)=>C.id-_.id}),D=async C=>n?M(C):[await y.request({body:C})],[{error:H,result:w}]=await D(A);if(H)throw new jb({body:A,error:H,url:k});return w},retryCount:b,retryDelay:l,timeout:S,type:"http"},{fetchOptions:r,url:k})}}function h6(t){return{formatters:void 0,fees:void 0,serializers:void 0,...t}}function Qs(t,e="hex"){const n=m6(t),r=Jw(new Uint8Array(n.length));return n.encode(r),e==="hex"?Ft(r.bytes):r.bytes}function m6(t){return Array.isArray(t)?vS(t.map(e=>m6(e))):bS(t)}function vS(t){const e=t.reduce((i,o)=>i+o.length,0),n=g6(e);return{length:e<=55?1+e:1+n+e,encode(i){e<=55?i.pushByte(192+e):(i.pushByte(247+n),n===1?i.pushUint8(e):n===2?i.pushUint16(e):n===3?i.pushUint24(e):i.pushUint32(e));for(const{encode:o}of t)o(i)}}}function bS(t){const e=typeof t=="string"?zi(t):t,n=g6(e.length);return{length:e.length===1&&e[0]<128?1:e.length<=55?1+e.length:1+n+e.length,encode(i){e.length===1&&e[0]<128?i.pushBytes(e):e.length<=55?(i.pushByte(128+e.length),i.pushBytes(e)):(i.pushByte(183+n),n===1?i.pushUint8(e.length):n===2?i.pushUint16(e.length):n===3?i.pushUint24(e.length):i.pushUint32(e.length),i.pushBytes(e))}}}function g6(t){if(t<2**8)return 1;if(t<2**16)return 2;if(t<2**24)return 3;if(t<2**32)return 4;throw new ne("Length is too large.")}function xS(t){const{blobVersionedHashes:e}=t;if(e){if(e.length===0)throw new Zb;for(const n of e){const r=Bt(n),i=Fl(zu(n,0,1));if(r!==32)throw new Y_({hash:n,size:r});if(i!==Vb)throw new Q_({hash:n,version:i})}}w6(t)}function w6(t){const{chainId:e,maxPriorityFeePerGas:n,maxFeePerGas:r,to:i}=t;if(e<=0)throw new of({chainId:e});if(i&&!Kt(i))throw new fr({address:i});if(r&&r>2n**256n-1n)throw new Wi({maxFeePerGas:r});if(n&&r&&n>r)throw new qs({maxFeePerGas:r,maxPriorityFeePerGas:n})}function CS(t){const{chainId:e,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:i,to:o}=t;if(e<=0)throw new of({chainId:e});if(o&&!Kt(o))throw new fr({address:o});if(n||i)throw new ne("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(r&&r>2n**256n-1n)throw new Wi({maxFeePerGas:r})}function _S(t){const{chainId:e,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:i,to:o,accessList:s}=t;if(o&&!Kt(o))throw new fr({address:o});if(typeof e<"u"&&e<=0)throw new of({chainId:e});if(n||i)throw new ne("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(r&&r>2n**256n-1n)throw new Wi({maxFeePerGas:r});if(s)throw new ne("`accessList` is not a valid Legacy Transaction attribute.")}function lf(t){if(!t||t.length===0)return[];const e=[];for(let n=0;n"u"||typeof g>"u")){const x=typeof t.blobs[0]=="string"?t.blobs:t.blobs.map(D=>Ft(D)),A=t.kzg,M=Kw({blobs:x,kzg:A});if(typeof p>"u"&&(p=zb({commitments:M})),typeof g>"u"){const D=Yw({blobs:x,commitments:M,kzg:A});g=Gb({blobs:x,commitments:M,proofs:D})}}const b=lf(u),S=[ke(n),i?ke(i):"0x",c?ke(c):"0x",l?ke(l):"0x",r?ke(r):"0x",o??"0x",s?ke(s):"0x",d??"0x",b,a?ke(a):"0x",p??[],...cf(t,e)],k=[],y=[],m=[];if(g)for(let x=0;x{if(e.v>=35n)return(e.v-35n)/2n>0?e.v:27n+(e.v===35n?0n:1n);if(n>0)return BigInt(n*2)+BigInt(35n+e.v-27n);const d=27n+(e.v===27n?0n:1n);if(e.v!==d)throw new b_({v:e.v});return d})();c=[...c,ke(u),e.r,e.s]}else n>0&&(c=[...c,ke(n),"0x","0x"]);return Qs(c)}function cf(t,e){const{r:n,s:r,v:i,yParity:o}=e??t;return typeof n>"u"?[]:typeof r>"u"?[]:typeof i>"u"&&typeof o>"u"?[]:[typeof o=="number"?o?ke(1):"0x":i===0n?"0x":i===1n?ke(1):i===27n?"0x":ke(1),Fi(n),Fi(r)]}async function RS(t,e){var k;const{allowFailure:n=!0,batchSize:r,blockNumber:i,blockTag:o,multicallAddress:s,stateOverride:a}=e,l=e.contracts,c=r??(typeof((k=t.batch)==null?void 0:k.multicall)=="object"&&t.batch.multicall.batchSize||1024);let u=s;if(!u){if(!t.chain)throw new Error("client chain not configured. multicallAddress is required.");u=Qp({blockNumber:i,chain:t.chain,contract:"multicall3"})}const d=[[]];let p=0,g=0;for(let y=0;y0&&g>c&&d[p].length>0&&(p++,g=(D.length-2)/2,d[p]=[]),d[p]=[...d[p],{allowFailure:!0,callData:D,target:x}]}catch(D){const H=Z0(D,{abi:m,address:x,args:A,docsPath:"/docs/contract/multicall",functionName:M});if(!n)throw H;d[p]=[...d[p],{allowFailure:!0,callData:"0x",target:x}]}}const b=await Promise.allSettled(d.map(y=>St(t,Hl,"readContract")({abi:Zm,address:u,args:[y],blockNumber:i,blockTag:o,functionName:"aggregate3",stateOverride:a}))),S=[];for(let y=0;y{const b=Uo(["watchBlocks",t.uid,e,n,r,u,l]);return cS(b,{onBlock:i,onError:o},S=>uS(async()=>{var k;try{const y=await St(t,Ys,"getBlock")({blockTag:e,includeTransactions:u});if(y.number&&(d!=null&&d.number)){if(y.number===d.number)return;if(y.number-d.number>1&&n)for(let m=(d==null?void 0:d.number)+1n;md.number)&&(S.onBlock(y,d),d=y)}catch(y){(k=S.onError)==null||k.call(S,y)}},{emitOnBegin:r,interval:l}))})():(()=>{let b=!0,S=()=>b=!1;return(async()=>{try{const{unsubscribe:k}=await t.transport.subscribe({params:["newHeads"],onData(y){var A,M,D;if(!b)return;const x=(((D=(M=(A=t.chain)==null?void 0:A.formatters)==null?void 0:M.block)==null?void 0:D.format)||qw)(y.result);i(x,d),d=x},onError(y){o==null||o(y)}});S=k,b||S()}catch(k){o==null||o(k)}})(),()=>S()})()}async function PS(t,{account:e=t.account,message:n}){if(!e)throw new Db({docsPath:"/docs/actions/wallet/signMessage"});const r=gi(e);if(r.type==="local")return r.signMessage({message:n});const i=typeof n=="string"?Nw(n):n.raw instanceof Uint8Array?ke(n.raw):n.raw;return t.request({method:"personal_sign",params:[i,r.address]},{retryCount:0})}function IS(t){const e=n=>t(n.detail);return window.addEventListener("eip6963:announceProvider",e),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",e)}function OS(){const t=new Set;let e=[];const n=()=>IS(i=>{e.some(({info:o})=>o.uuid===i.info.uuid)||(e=[...e,i],t.forEach(o=>o(e,{added:[i]})))});let r=n();return{_listeners(){return t},clear(){t.forEach(i=>i([],{removed:[...e]})),e=[]},destroy(){this.clear(),t.clear(),r()},findProvider({rdns:i}){return e.find(o=>o.info.rdns===i)},getProviders(){return e},reset(){this.clear(),r(),r=n()},subscribe(i,{emitImmediately:o}={}){return t.add(i),o&&i(e,{added:e}),()=>t.delete(i)}}}var NS={VITE_PROJECT_ID:"36e97c0201af2f60e9592935a92b036a",BASE_URL:"/revo-withdrawal-dapp/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const MS=t=>(e,n,r)=>{const i=r.subscribe;return r.subscribe=(s,a,l)=>{let c=s;if(a){const u=(l==null?void 0:l.equalityFn)||Object.is;let d=s(r.getState());c=p=>{const g=s(p);if(!u(d,g)){const b=d;a(d=g,b)}},l!=null&&l.fireImmediately&&a(d,d)}return i(c)},t(e,n,r)},LS=MS;function DS(t,e){let n;try{n=t()}catch{return}return{getItem:i=>{var o;const s=l=>l===null?null:JSON.parse(l,e==null?void 0:e.reviver),a=(o=n.getItem(i))!=null?o:null;return a instanceof Promise?a.then(s):s(a)},setItem:(i,o)=>n.setItem(i,JSON.stringify(o,e==null?void 0:e.replacer)),removeItem:i=>n.removeItem(i)}}const rd=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(r){return rd(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return rd(r)(n)}}}},BS=(t,e)=>(n,r,i)=>{let o={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:k=>k,version:0,merge:(k,y)=>({...y,...k}),...e},s=!1;const a=new Set,l=new Set;let c;try{c=o.getStorage()}catch{}if(!c)return t((...k)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...k)},r,i);const u=rd(o.serialize),d=()=>{const k=o.partialize({...r()});let y;const m=u({state:k,version:o.version}).then(x=>c.setItem(o.name,x)).catch(x=>{y=x});if(y)throw y;return m},p=i.setState;i.setState=(k,y)=>{p(k,y),d()};const g=t((...k)=>{n(...k),d()},r,i);let b;const S=()=>{var k;if(!c)return;s=!1,a.forEach(m=>m(r()));const y=((k=o.onRehydrateStorage)==null?void 0:k.call(o,r()))||void 0;return rd(c.getItem.bind(c))(o.name).then(m=>{if(m)return o.deserialize(m)}).then(m=>{if(m)if(typeof m.version=="number"&&m.version!==o.version){if(o.migrate)return o.migrate(m.state,m.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return m.state}).then(m=>{var x;return b=o.merge(m,(x=r())!=null?x:g),n(b,!0),d()}).then(()=>{y==null||y(b,void 0),s=!0,l.forEach(m=>m(b))}).catch(m=>{y==null||y(void 0,m)})};return i.persist={setOptions:k=>{o={...o,...k},k.getStorage&&(c=k.getStorage())},clearStorage:()=>{c==null||c.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>S(),hasHydrated:()=>s,onHydrate:k=>(a.add(k),()=>{a.delete(k)}),onFinishHydration:k=>(l.add(k),()=>{l.delete(k)})},S(),b||g},jS=(t,e)=>(n,r,i)=>{let o={storage:DS(()=>localStorage),partialize:S=>S,version:0,merge:(S,k)=>({...k,...S}),...e},s=!1;const a=new Set,l=new Set;let c=o.storage;if(!c)return t((...S)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...S)},r,i);const u=()=>{const S=o.partialize({...r()});return c.setItem(o.name,{state:S,version:o.version})},d=i.setState;i.setState=(S,k)=>{d(S,k),u()};const p=t((...S)=>{n(...S),u()},r,i);let g;const b=()=>{var S,k;if(!c)return;s=!1,a.forEach(m=>{var x;return m((x=r())!=null?x:p)});const y=((k=o.onRehydrateStorage)==null?void 0:k.call(o,(S=r())!=null?S:p))||void 0;return rd(c.getItem.bind(c))(o.name).then(m=>{if(m)if(typeof m.version=="number"&&m.version!==o.version){if(o.migrate)return o.migrate(m.state,m.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return m.state}).then(m=>{var x;return g=o.merge(m,(x=r())!=null?x:p),n(g,!0),u()}).then(()=>{y==null||y(g,void 0),g=r(),s=!0,l.forEach(m=>m(g))}).catch(m=>{y==null||y(void 0,m)})};return i.persist={setOptions:S=>{o={...o,...S},S.storage&&(c=S.storage)},clearStorage:()=>{c==null||c.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>b(),hasHydrated:()=>s,onHydrate:S=>(a.add(S),()=>{a.delete(S)}),onFinishHydration:S=>(l.add(S),()=>{l.delete(S)})},o.skipHydration||b(),g||p},US=(t,e)=>"getStorage"in e||"serialize"in e||"deserialize"in e?((NS?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),BS(t,e)):jS(t,e),FS=US;var zS={VITE_PROJECT_ID:"36e97c0201af2f60e9592935a92b036a",BASE_URL:"/revo-withdrawal-dapp/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const P3=t=>{let e;const n=new Set,r=(l,c)=>{const u=typeof l=="function"?l(e):l;if(!Object.is(u,e)){const d=e;e=c??typeof u!="object"?u:Object.assign({},e,u),n.forEach(p=>p(e,d))}},i=()=>e,a={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(zS?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return e=t(r,i,a),a},f1=t=>t?P3(t):P3;var y6={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(l,c,u){this.fn=l,this.context=c,this.once=u||!1}function o(l,c,u,d,p){if(typeof u!="function")throw new TypeError("The listener must be a function");var g=new i(u,d||l,p),b=n?n+c:c;return l._events[b]?l._events[b].fn?l._events[b]=[l._events[b],g]:l._events[b].push(g):(l._events[b]=g,l._eventsCount++),l}function s(l,c){--l._eventsCount===0?l._events=new r:delete l._events[c]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var c=[],u,d;if(this._eventsCount===0)return c;for(d in u=this._events)e.call(u,d)&&c.push(n?d.slice(1):d);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(u)):c},a.prototype.listeners=function(c){var u=n?n+c:c,d=this._events[u];if(!d)return[];if(d.fn)return[d.fn];for(var p=0,g=d.length,b=new Array(g);p{let i=r;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(n,i))??i})}function I3(t,e){return t.slice(0,e).join(".")||"."}function O3(t,e){const{length:n}=t;for(let r=0;r{let s=o;return typeof s=="bigint"&&(s={__type:"bigint",value:o.toString()}),s instanceof Map&&(s={__type:"Map",value:Array.from(o.entries())}),(e==null?void 0:e(i,s))??s},r),n??void 0)}function YS(t){const{deserialize:e=GS,key:n="wagmi",serialize:r=KS,storage:i=v6}=t;function o(s){return s instanceof Promise?s.then(a=>a).catch(()=>null):s}return{...i,key:n,async getItem(s,a){const l=i.getItem(`${n}.${s}`),c=await o(l);return c?e(c)??null:a??null},async setItem(s,a){const l=`${n}.${s}`;a===null?await o(i.removeItem(l)):await o(i.setItem(l,r(a)))},async removeItem(s){await o(i.removeItem(`${n}.${s}`))}}}const v6={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};const h0="2.6.16",QS=()=>`@wagmi/core@${h0}`;var b6=function(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)},G0,x6;let Ia=class Xm extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return QS()}constructor(e,n={}){var o;super(),G0.add(this),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiCoreError"});const r=n.cause instanceof Xm?n.cause.details:(o=n.cause)!=null&&o.message?n.cause.message:n.details,i=n.cause instanceof Xm&&n.cause.docsPath||n.docsPath;this.message=[e||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...i?[`Docs: ${this.docsBaseUrl}${i}.html${n.docsSlug?`#${n.docsSlug}`:""}`]:[],...r?[`Details: ${r}`]:[],`Version: ${this.version}`].join(` +`),n.cause&&(this.cause=n.cause),this.details=r,this.docsPath=i,this.metaMessages=n.metaMessages,this.shortMessage=e}walk(e){return b6(this,G0,"m",x6).call(this,this,e)}};G0=new WeakSet,x6=function t(e,n){return n!=null&&n(e)?e:e.cause?b6(this,G0,"m",t).call(this,e.cause,n):e};class Vl extends Ia{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}class JS extends Ia{constructor(){super("Connector already connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAlreadyConnectedError"})}}class XS extends Ia{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class eT extends Ia{constructor({address:e,connector:n}){super(`Account "${e}" not found for connector "${n.name}".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAccountNotFoundError"})}}class Cs extends Ia{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}class tT extends Ia{constructor({connector:e}){super(`"${e.name}" does not support programmatic chain switching.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainNotSupportedError"})}}const nT={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(t){return t!=null&&t.coinbaseWalletExtension?t.coinbaseWalletExtension:m0(t,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(t){return m0(t,e=>{if(!e.isMetaMask||e.isBraveWallet&&!e._events&&!e._state)return!1;const n=["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPortal","isRabby","isTokenPocket","isTokenary","isZerion"];for(const r of n)if(e[r])return!1;return!0})}},phantom:{id:"phantom",name:"Phantom",provider(t){var e,n;return(e=t==null?void 0:t.phantom)!=null&&e.ethereum?(n=t.phantom)==null?void 0:n.ethereum:m0(t,"isPhantom")}}};Jp.type="injected";function Jp(t={}){const{shimDisconnect:e=!0,unstable_shimAsyncInject:n}=t;function r(){const l=t.target;if(typeof l=="function"){const c=l();if(c)return c}return typeof l=="object"?l:typeof l=="string"?{...nT[l]??{id:l,name:`${l[0].toUpperCase()}${l.slice(1)}`,provider:`is${l[0].toUpperCase()}${l.slice(1)}`}}:{id:"injected",name:"Injected",provider(c){return c==null?void 0:c.ethereum}}}let i,o,s,a;return l=>({get icon(){return r().icon},get id(){return r().id},get name(){return r().name},type:Jp.type,async setup(){const c=await this.getProvider();c&&t.target&&(s||(s=this.onConnect.bind(this),c.on("connect",s)),i||(i=this.onAccountsChanged.bind(this),c.on("accountsChanged",i)))},async connect({chainId:c,isReconnecting:u}={}){var g,b,S,k,y,m;const d=await this.getProvider();if(!d)throw new Cs;let p=[];if(u)p=await this.getAccounts().catch(()=>[]);else if(e)try{p=(k=(S=(b=(g=(await d.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0])==null?void 0:g.caveats)==null?void 0:b[0])==null?void 0:S.value)==null?void 0:k.map(A=>lr(A))}catch(x){const A=x;if(A.code===Tt.code)throw new Tt(A);if(A.code===Fo.code)throw A}try{!(p!=null&&p.length)&&!u&&(p=(await d.request({method:"eth_requestAccounts"})).map(M=>lr(M))),s&&(d.removeListener("connect",s),s=void 0),i||(i=this.onAccountsChanged.bind(this),d.on("accountsChanged",i)),o||(o=this.onChainChanged.bind(this),d.on("chainChanged",o)),a||(a=this.onDisconnect.bind(this),d.on("disconnect",a));let x=await this.getChainId();if(c&&x!==c){const A=await this.switchChain({chainId:c}).catch(M=>{if(M.code===Tt.code)throw M;return{id:x}});x=(A==null?void 0:A.id)??x}return e&&(await((y=l.storage)==null?void 0:y.removeItem(`${this.id}.disconnected`)),t.target||await((m=l.storage)==null?void 0:m.setItem("injected.connected",!0))),{accounts:p,chainId:x}}catch(x){const A=x;throw A.code===Tt.code?new Tt(A):A.code===Fo.code?new Fo(A):A}},async disconnect(){var u,d;const c=await this.getProvider();if(!c)throw new Cs;o&&(c.removeListener("chainChanged",o),o=void 0),a&&(c.removeListener("disconnect",a),a=void 0),s||(s=this.onConnect.bind(this),c.on("connect",s)),e&&(await((u=l.storage)==null?void 0:u.setItem(`${this.id}.disconnected`,!0)),t.target||await((d=l.storage)==null?void 0:d.removeItem("injected.connected")))},async getAccounts(){const c=await this.getProvider();if(!c)throw new Cs;return(await c.request({method:"eth_accounts"})).map(d=>lr(d))},async getChainId(){const c=await this.getProvider();if(!c)throw new Cs;const u=await c.request({method:"eth_chainId"});return Number(u)},async getProvider(){if(typeof window>"u")return;let c;const u=r();return typeof u.provider=="function"?c=u.provider(window):typeof u.provider=="string"?c=m0(window,u.provider):c=u.provider,c&&!c.removeListener&&("off"in c&&typeof c.off=="function"?c.removeListener=c.off:c.removeListener=()=>{}),c},async isAuthorized(){var c,u;try{if(e&&await((c=l.storage)==null?void 0:c.getItem(`${this.id}.disconnected`))||!t.target&&!await((u=l.storage)==null?void 0:u.getItem("injected.connected")))return!1;if(!await this.getProvider()){if(n!==void 0&&n!==!1){const b=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",b),!!await this.getProvider()),S=typeof n=="number"?n:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(y=>window.addEventListener("ethereum#initialized",()=>y(b()),{once:!0}))]:[],new Promise(y=>setTimeout(()=>y(b()),S))]))return!0}throw new Cs}return!!(await d6(()=>p6(()=>this.getAccounts(),{timeout:100}))).length}catch{return!1}},async switchChain({chainId:c}){var p,g,b;const u=await this.getProvider();if(!u)throw new Cs;const d=l.chains.find(S=>S.id===c);if(!d)throw new Fn(new Vl);try{return await Promise.all([u.request({method:"wallet_switchEthereumChain",params:[{chainId:Je(c)}]}),new Promise(S=>{const k=y=>{console.log("[injected] switchChain.listener",{data:y,chainId:c}),Number(y)===c&&(u.removeListener("chainChanged",k),S())};u.on("chainChanged",k)})]),d}catch(S){const k=S;if(k.code===4902||((g=(p=k==null?void 0:k.data)==null?void 0:p.originalError)==null?void 0:g.code)===4902)try{const{default:y,...m}=d.blockExplorers??{};let x;if(y&&(x=[y.url,...Object.values(m).map(M=>M.url)]),await u.request({method:"wallet_addEthereumChain",params:[{chainId:Je(c),chainName:d.name,nativeCurrency:d.nativeCurrency,rpcUrls:[((b=d.rpcUrls.default)==null?void 0:b.http[0])??""],blockExplorerUrls:x}]}),await this.getChainId()!==c)throw new Tt(new Error("User rejected switch after adding network."));return d}catch(y){throw new Tt(y)}throw k.code===Tt.code?new Tt(k):new Fn(k)}},async onAccountsChanged(c){var u;if(console.log("[injected] onAccountsChanged",c),c.length===0)this.onDisconnect();else if(l.emitter.listenerCount("connect")){const d=(await this.getChainId()).toString();this.onConnect({chainId:d}),e&&await((u=l.storage)==null?void 0:u.removeItem(`${this.id}.disconnected`))}else l.emitter.emit("change",{accounts:c.map(d=>lr(d))})},onChainChanged(c){console.log("[injected] onChainChanged",c);const u=Number(c);l.emitter.emit("change",{chainId:u})},async onConnect(c){const u=await this.getAccounts();if(u.length===0)return;const d=Number(c.chainId);l.emitter.emit("connect",{accounts:u,chainId:d});const p=await this.getProvider();p&&(s&&(p.removeListener("connect",s),s=void 0),i||(i=this.onAccountsChanged.bind(this),p.on("accountsChanged",i)),o||(o=this.onChainChanged.bind(this),p.on("chainChanged",o)),a||(a=this.onDisconnect.bind(this),p.on("disconnect",a)))},async onDisconnect(c){const u=await this.getProvider();c&&c.code===1013&&u&&(await this.getAccounts()).length||(l.emitter.emit("disconnect"),u&&(o&&(u.removeListener("chainChanged",o),o=void 0),a&&(u.removeListener("disconnect",a),a=void 0),s||(s=this.onConnect.bind(this),u.on("connect",s))))}})}function m0(t,e){function n(i){return typeof e=="function"?e(i):typeof e=="string"?i[e]:!0}const r=t.ethereum;if(r!=null&&r.providers)return r.providers.find(i=>n(i));if(r&&n(r))return r}const eg=256;let Zf=eg,Gf;function rT(t=11){if(!Gf||Zf+t>eg*2){Gf="",Zf=0;for(let e=0;eo.chains),l=f1(()=>[...o.connectors??[],...i?[]:(s==null?void 0:s.getProviders().map(u))??[]].map(c));function c(A){var H;const M=ZS(rT()),D={...A({emitter:M,chains:a.getState(),storage:n}),emitter:M,uid:M.uid};return M.on("connect",m),(H=D.setup)==null||H.call(D),D}function u(A){const{info:M}=A,D=A.provider;return Jp({target:{...M,id:M.rdns,provider:D}})}const d=new Map;function p(A={}){const M=A.chainId??k.getState().chainId,D=a.getState().find(w=>w.id===M);if(A.chainId&&!D)throw new Vl;{const w=d.get(k.getState().chainId);if(w&&!D)return w;if(!D)throw new Vl}{const w=d.get(M);if(w)return w}let H;if(o.client)H=o.client({chain:D});else{const w=D.id,C=a.getState().map(L=>L.id),_={},O=Object.entries(o);for(const[L,U]of O)if(!(L==="chains"||L==="client"||L==="connectors"||L==="transports"))if(typeof U=="object")if(w in U)_[L]=U[w];else{if(C.some(I=>I in U))continue;_[L]=U}else _[L]=U;H=u6({..._,chain:D,batch:_.batch??{multicall:!0},transport:L=>o.transports[w]({...L,connectors:l})})}return d.set(M,H),H}function g(){return{chainId:a.getState()[0].id,connections:new Map,current:void 0,status:"disconnected"}}let b;const S="0.0.0-canary-";h0.startsWith(S)?b=parseInt(h0.replace(S,"")):b=parseInt(h0.split(".")[0]??"0");const k=f1(LS(n?FS(g,{migrate(A,M){if(M===b)return A;const D=g(),H=A&&typeof A=="object"&&"chainId"in A&&typeof A.chainId=="number"?A.chainId:D.chainId;return{...D,chainId:H}},name:"store",partialize(A){return{connections:{__type:"Map",value:Array.from(A.connections.entries()).map(([M,D])=>{const{id:H,name:w,type:C,uid:_}=D.connector;return[M,{...D,connector:{id:H,name:w,type:C,uid:_}}]})},chainId:A.chainId,current:A.current}},skipHydration:i,storage:n,version:b}):g));r&&k.subscribe(({connections:A,current:M})=>{var D;return M?(D=A.get(M))==null?void 0:D.chainId:void 0},A=>{if(a.getState().some(D=>D.id===A))return k.setState(D=>({...D,chainId:A??D.chainId}))}),s==null||s.subscribe(A=>{const M=new Map;for(const H of l.getState())M.set(H.id,!0);const D=[];for(const H of A){const w=c(u(H));M.has(w.id)||D.push(w)}n&&!k.persist.hasHydrated()||l.setState(H=>[...H,...D],!0)});function y(A){k.setState(M=>{const D=M.connections.get(A.uid);return D?{...M,connections:new Map(M.connections).set(A.uid,{accounts:A.accounts??D.accounts,chainId:A.chainId??D.chainId,connector:D.connector})}:M})}function m(A){k.getState().status==="connecting"||k.getState().status==="reconnecting"||k.setState(M=>{const D=l.getState().find(H=>H.uid===A.uid);return D?(D.emitter.listenerCount("connect")&&D.emitter.off("connect",y),D.emitter.listenerCount("change")||D.emitter.on("change",y),D.emitter.listenerCount("disconnect")||D.emitter.on("disconnect",x),{...M,connections:new Map(M.connections).set(A.uid,{accounts:A.accounts,chainId:A.chainId,connector:D}),current:A.uid,status:"connected"}):M})}function x(A){k.setState(M=>{const D=M.connections.get(A.uid);if(D){const w=D.connector;w.emitter.listenerCount("change")&&D.connector.emitter.off("change",y),w.emitter.listenerCount("disconnect")&&D.connector.emitter.off("disconnect",x),w.emitter.listenerCount("connect")||D.connector.emitter.on("connect",m)}if(M.connections.delete(A.uid),M.connections.size===0)return{...M,connections:new Map,current:void 0,status:"disconnected"};const H=M.connections.values().next().value;return{...M,connections:new Map(M.connections),current:H.connector.uid}})}return{get chains(){return a.getState()},get connectors(){return l.getState()},storage:n,getClient:p,get state(){return k.getState()},setState(A){let M;typeof A=="function"?M=A(k.getState()):M=A;const D=g();typeof M!="object"&&(M=D),Object.keys(D).some(w=>!(w in M))&&(M=D),k.setState(M,!0)},subscribe(A,M,D){return k.subscribe(A,M,D?{...D,fireImmediately:D.emitImmediately}:void 0)},_internal:{mipd:s,store:k,ssr:!!i,syncConnectedChain:r,transports:o.transports,chains:{setState(A){const M=typeof A=="function"?A(a.getState()):A;if(M.length!==0)return a.setState(M,!0)},subscribe(A){return a.subscribe(A)}},connectors:{providerDetailToConnector:u,setup:c,setState(A){return l.setState(typeof A=="function"?A(l.getState()):A,!0)},subscribe(A){return l.subscribe(A)}},events:{change:y,connect:m,disconnect:x}}}}function wi(t,e,n){const r=t[e.name];if(typeof r=="function")return r;const i=t[n];return typeof i=="function"?i:o=>e(t,o)}async function N3(t,e){var r;let n;if(typeof e.connector=="function"?n=t._internal.connectors.setup(e.connector):n=e.connector,n.uid===t.state.current)throw new JS;try{t.setState(s=>({...s,status:"connecting"})),n.emitter.emit("message",{type:"connecting"});const i=await n.connect({chainId:e.chainId}),o=i.accounts;return n.emitter.off("connect",t._internal.events.connect),n.emitter.on("change",t._internal.events.change),n.emitter.on("disconnect",t._internal.events.disconnect),await((r=t.storage)==null?void 0:r.setItem("recentConnectorId",n.id)),t.setState(s=>({...s,connections:new Map(s.connections).set(n.uid,{accounts:o,chainId:i.chainId,connector:n}),current:n.uid,status:"connected"})),{accounts:o,chainId:i.chainId}}catch(i){throw t.setState(o=>({...o,status:o.current?"connected":"disconnected"})),i}}async function oT(t,e={}){var i,o;let n;if(e.connector)n=e.connector;else{const{connections:s,current:a}=t.state,l=s.get(a);n=l==null?void 0:l.connector}const r=t.state.connections;n&&(await n.disconnect(),n.emitter.off("change",t._internal.events.change),n.emitter.off("disconnect",t._internal.events.disconnect),n.emitter.on("connect",t._internal.events.connect),r.delete(n.uid)),t.setState(s=>{if(r.size===0)return{...s,connections:new Map,current:void 0,status:"disconnected"};const a=r.values().next().value;return{...s,connections:new Map(r),current:a.connector.uid}});{const s=t.state.current;if(!s)return;const a=(i=t.state.connections.get(s))==null?void 0:i.connector;if(!a)return;await((o=t.storage)==null?void 0:o.setItem("recentConnectorId",a.id))}}async function o2(t,e={}){let n;if(e.connector){const{connector:l}=e,[c,u]=await Promise.all([l.getAccounts(),l.getChainId()]);n={accounts:c,chainId:u,connector:l}}else n=t.state.connections.get(t.state.current);if(!n)throw new XS;const r=e.chainId??n.chainId,i=n.connector;if(i.getClient)return i.getClient({chainId:r});const o=gi(e.account??n.accounts[0]);o.address=lr(o.address);const s=t.chains.find(l=>l.id===r),a=await n.connector.getProvider({chainId:r});if(e.account&&!n.accounts.includes(o.address))throw new eT({address:o.address,connector:i});return u6({account:o,chain:s,name:"Connector Client",transport:l=>mS(a)({...l,retryCount:0})})}function C6(t){return typeof t=="number"?t:t==="wei"?0:Math.abs(y_[t])}function _6(t){const e=t.state.current,n=t.state.connections.get(e),r=n==null?void 0:n.accounts,i=r==null?void 0:r[0],o=t.chains.find(a=>a.id===(n==null?void 0:n.chainId)),s=t.state.status;switch(s){case"connected":return{address:i,addresses:r,chain:o,chainId:n==null?void 0:n.chainId,connector:n==null?void 0:n.connector,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:s};case"reconnecting":return{address:i,addresses:r,chain:o,chainId:n==null?void 0:n.chainId,connector:n==null?void 0:n.connector,isConnected:!!i,isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:s};case"connecting":return{address:i,addresses:r,chain:o,chainId:n==null?void 0:n.chainId,connector:n==null?void 0:n.connector,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:s};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:s}}}async function sT(t,e){const{allowFailure:n=!0,chainId:r,contracts:i,...o}=e,s=t.getClient({chainId:r});return wi(s,RS,"multicall")({allowFailure:n,contracts:i,...o})}function E6(t,e){const{chainId:n,...r}=e,i=t.getClient({chainId:n});return wi(i,Hl,"readContract")(r)}async function S6(t,e){const{allowFailure:n=!0,blockNumber:r,blockTag:i,...o}=e,s=e.contracts;try{const a=s.reduce((d,p,g)=>{const b=p.chainId??t.state.chainId;return{...d,[b]:[...d[b]||[],{contract:p,index:g}]}},{}),l=()=>Object.entries(a).map(([d,p])=>sT(t,{...o,allowFailure:n,blockNumber:r,blockTag:i,chainId:parseInt(d),contracts:p.map(({contract:g})=>g)})),c=(await Promise.all(l())).flat(),u=Object.values(a).flatMap(d=>d.map(({index:p})=>p));return c.reduce((d,p,g)=>(d&&(d[u[g]]=p),d),[])}catch(a){if(a instanceof t2)throw a;const l=()=>s.map(c=>E6(t,{...c,blockNumber:r,blockTag:i}));return n?(await Promise.allSettled(l())).map(c=>c.status==="fulfilled"?{result:c.value,status:"success"}:{error:c.reason,result:void 0,status:"failure"}):await Promise.all(l())}}async function aT(t,e){const{address:n,blockNumber:r,blockTag:i,chainId:o,token:s,unit:a="ether"}=e;if(s)try{return M3(t,{balanceAddress:n,chainId:o,symbolType:"string",tokenAddress:s})}catch(p){if(p instanceof t2){const g=await M3(t,{balanceAddress:n,chainId:o,symbolType:"bytes32",tokenAddress:s}),b=bC(Fi(g.symbol,{dir:"right"}));return{...g,symbol:b}}throw p}const l=t.getClient({chainId:o}),u=await wi(l,sS,"getBalance")(r?{address:n,blockNumber:r}:{address:n,blockTag:i}),d=t.chains.find(p=>p.id===o)??l.chain;return{decimals:d.nativeCurrency.decimals,formatted:Gp(u,C6(a)),symbol:d.nativeCurrency.symbol,value:u}}async function M3(t,e){const{balanceAddress:n,chainId:r,symbolType:i,tokenAddress:o,unit:s}=e,a={abi:[{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:i}]}],address:o},[l,c,u]=await S6(t,{allowFailure:!1,contracts:[{...a,functionName:"balanceOf",args:[n],chainId:r},{...a,functionName:"decimals",chainId:r},{...a,functionName:"symbol",chainId:r}]}),d=Gp(l??"0",C6(s??c));return{decimals:c,formatted:d,symbol:u,value:l}}async function lT(t,e={}){const{chainId:n,...r}=e,i=t.getClient({chainId:n});return{...await wi(i,Ys,"getBlock")(r),chainId:i.chain.id}}function L3(t){return t.state.chainId}function id(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;let n,r;if(Array.isArray(t)&&Array.isArray(e)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!id(t[r],e[r]))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(n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(o&&!id(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function cT(t,e){const{chainId:n,...r}=e,i=t.getClient({chainId:n});return wi(i,iS,"getEnsAvatar")(r)}function uT(t,e){const{chainId:n,...r}=e,i=t.getClient({chainId:n});return wi(i,oS,"getEnsName")(r)}let p1=!1;async function dT(t,e={}){var c,u;if(p1)return[];p1=!0,t.setState(d=>({...d,status:d.current?"reconnecting":"connecting"}));const n=[];if((c=e.connectors)!=null&&c.length)for(const d of e.connectors){let p;typeof d=="function"?p=t._internal.connectors.setup(d):p=d,n.push(p)}else n.push(...t.connectors);let r;try{r=await((u=t.storage)==null?void 0:u.getItem("recentConnectorId"))}catch{}const i={};for(const[,d]of t.state.connections)i[d.connector.id]=1;r&&(i[r]=0);const o=Object.keys(i).length>0?[...n].sort((d,p)=>(i[d.id]??10)-(i[p.id]??10)):n;let s=!1;const a=[],l=[];for(const d of o){const p=await d.getProvider();if(!p||l.some(S=>S===p)||!await d.isAuthorized())continue;const b=await d.connect({isReconnecting:!0}).catch(()=>null);b&&(d.emitter.off("connect",t._internal.events.connect),d.emitter.on("change",t._internal.events.change),d.emitter.on("disconnect",t._internal.events.disconnect),t.setState(S=>{const k=new Map(s?S.connections:new Map).set(d.uid,{accounts:b.accounts,chainId:b.chainId,connector:d});return{...S,current:s?S.current:d.uid,connections:k}}),a.push({accounts:b.accounts,chainId:b.chainId,connector:d}),l.push(p),s=!0)}return(t.state.status==="reconnecting"||t.state.status==="connecting")&&(s?t.setState(d=>({...d,status:"connected"})):t.setState(d=>({...d,connections:new Map,current:void 0,status:"disconnected"}))),p1=!1,a}async function fT(t,e){const{account:n,connector:r,...i}=e;let o;return typeof n=="object"&&n.type==="local"?o=t.getClient():o=await o2(t,{account:n,connector:r}),wi(o,PS,"signMessage")({...i,...n?{account:n}:{}})}async function pT(t,e){const{abi:n,chainId:r,connector:i,...o}=e;let s;e.account?s=e.account:s=(await o2(t,{chainId:r,connector:i})).account;const a=t.getClient({chainId:r}),l=wi(a,aS,"simulateContract"),{result:c,request:u}=await l({...o,abi:n,account:s});return{chainId:a.chain.id,result:c,request:{__mode:"prepared",...u,chainId:r}}}async function hT(t,e){var o;const{chainId:n}=e,r=t.state.connections.get(((o=e.connector)==null?void 0:o.uid)??t.state.current);if(r){const s=r.connector;if(!s.switchChain)throw new tT({connector:s});return await s.switchChain({chainId:n})}const i=t.chains.find(s=>s.id===n);if(!i)throw new Vl;return t.setState(s=>({...s,chainId:n})),i}function T6(t,e){const{onChange:n}=e;return t.subscribe(()=>_6(t),n,{equalityFn(r,i){const{connector:o,...s}=r,{connector:a,...l}=i;return id(s,l)&&(o==null?void 0:o.id)===(a==null?void 0:a.id)&&(o==null?void 0:o.uid)===(a==null?void 0:a.uid)}})}function mT(t,e){const{syncConnectedChain:n=t._internal.syncConnectedChain,...r}=e;let i;const o=l=>{i&&i();const c=t.getClient({chainId:l});return i=wi(c,$S,"watchBlocks")(r),i},s=o(e.chainId);let a;return n&&!e.chainId&&(a=t.subscribe(({chainId:l})=>l,async l=>o(l))),()=>{s==null||s(),a==null||a()}}function gT(t,e){const{onChange:n}=e;return t.subscribe(r=>r.chainId,n)}function wT(t,e){const{onChange:n}=e;return t._internal.connectors.subscribe((r,i)=>{n(Object.values(r),i)})}async function yT(t,e){const{account:n,chainId:r,connector:i,__mode:o,...s}=e;let a;typeof n=="object"&&n.type==="local"?a=t.getClient({chainId:r}):a=await o2(t,{account:n,chainId:r,connector:i});let l;if(o==="prepared")l=s;else{const{request:d}=await pT(t,{...s,account:n,chainId:r});l=d}return await wi(a,dS,"writeContract")({...l,...n?{account:n}:{},chain:r?{id:r}:null})}function vT(t,e){const{initialState:n,reconnectOnMount:r}=e;return n&&!t._internal.store.persist.hasHydrated()&&t.setState({...n,connections:r?n.connections:new Map,status:r?"reconnecting":"disconnected"}),{async onMount(){var i;if(t._internal.ssr){await t._internal.store.persist.rehydrate();const o=(i=t._internal.mipd)==null?void 0:i.getProviders().map(t._internal.connectors.providerDetailToConnector).map(t._internal.connectors.setup);t._internal.connectors.setState(s=>[...s,...o??[]])}r?dT(t):t.storage&&t.setState(o=>({...o,connections:new Map}))}}}function h1(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}"`)}function bT(t){const{children:e,config:n,initialState:r,reconnectOnMount:i=!0}=t,{onMount:o}=vT(n,{initialState:r,reconnectOnMount:i});n._internal.ssr||o();const s=je.useRef(!0);return je.useEffect(()=>{if(s.current&&n._internal.ssr)return o(),()=>{s.current=!1}},[]),e}const A6=je.createContext(void 0);function xT(t){const{children:e,config:n}=t,r={value:n};return je.createElement(bT,t,je.createElement(A6.Provider,r,e))}const CT="2.5.19",_T=()=>`wagmi@${CT}`;class ET extends Ia{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 _T()}}class ST extends ET{constructor(){super("`useConfig` must be used within `WagmiProvider`.",{docsPath:"/api/WagmiProvider"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiProviderNotFoundError"})}}var $c=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(){}},Zl=typeof window>"u"||"Deno"in globalThis;function ir(){}function TT(t,e){return typeof t=="function"?t(e):t}function tg(t){return typeof t=="number"&&t>=0&&t!==1/0}function k6(t,e){return Math.max(t+(e||0)-Date.now(),0)}function D3(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:a}=t;if(s){if(r){if(e.queryHash!==s2(s,e.options))return!1}else if(!od(e.queryKey,s))return!1}if(n!=="all"){const l=e.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||i&&i!==e.state.fetchStatus||o&&!o(e))}function B3(t,e){const{exact:n,status:r,predicate:i,mutationKey:o}=t;if(o){if(!e.options.mutationKey)return!1;if(n){if(Js(e.options.mutationKey)!==Js(o))return!1}else if(!od(e.options.mutationKey,o))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function s2(t,e){return((e==null?void 0:e.queryKeyHashFn)||Js)(t)}function Js(t){return JSON.stringify(t,(e,n)=>ng(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function od(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(n=>!od(t[n],e[n])):!1}function a2(t,e){if(t===e)return t;const n=j3(t)&&j3(e);if(n||ng(t)&&ng(e)){const r=n?t:Object.keys(t),i=r.length,o=n?e:Object.keys(e),s=o.length,a=n?[]:{};let l=0;for(let c=0;c{setTimeout(e,t)})}function rg(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?a2(t,e):e}function kT(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function RT(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var l2=Symbol(),$s,yo,vl,Qv,$T=(Qv=class extends $c{constructor(){super();pe(this,$s,void 0);pe(this,yo,void 0);pe(this,vl,void 0);se(this,vl,e=>{if(!Zl&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){B(this,yo)||this.setEventListener(B(this,vl))}onUnsubscribe(){var e;this.hasListeners()||((e=B(this,yo))==null||e.call(this),se(this,yo,void 0))}setEventListener(e){var n;se(this,vl,e),(n=B(this,yo))==null||n.call(this),se(this,yo,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){B(this,$s)!==e&&(se(this,$s,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof B(this,$s)=="boolean"?B(this,$s):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},$s=new WeakMap,yo=new WeakMap,vl=new WeakMap,Qv),c2=new $T,bl,vo,xl,Jv,PT=(Jv=class extends $c{constructor(){super();pe(this,bl,!0);pe(this,vo,void 0);pe(this,xl,void 0);se(this,xl,e=>{if(!Zl&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){B(this,vo)||this.setEventListener(B(this,xl))}onUnsubscribe(){var e;this.hasListeners()||((e=B(this,vo))==null||e.call(this),se(this,vo,void 0))}setEventListener(e){var n;se(this,xl,e),(n=B(this,vo))==null||n.call(this),se(this,vo,e(this.setOnline.bind(this)))}setOnline(e){B(this,bl)!==e&&(se(this,bl,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return B(this,bl)}},bl=new WeakMap,vo=new WeakMap,xl=new WeakMap,Jv),K0=new PT;function IT(t){return Math.min(1e3*2**t,3e4)}function u2(t){return(t??"online")==="online"?K0.isOnline():!0}var R6=class{constructor(t){this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function m1(t){return t instanceof R6}function $6(t){let e=!1,n=0,r=!1,i,o,s;const a=new Promise((k,y)=>{o=k,s=y}),l=k=>{var y;r||(g(new R6(k)),(y=t.abort)==null||y.call(t))},c=()=>{e=!0},u=()=>{e=!1},d=()=>!c2.isFocused()||t.networkMode!=="always"&&!K0.isOnline(),p=k=>{var y;r||(r=!0,(y=t.onSuccess)==null||y.call(t,k),i==null||i(),o(k))},g=k=>{var y;r||(r=!0,(y=t.onError)==null||y.call(t,k),i==null||i(),s(k))},b=()=>new Promise(k=>{var y;i=m=>{const x=r||!d();return x&&k(m),x},(y=t.onPause)==null||y.call(t)}).then(()=>{var k;i=void 0,r||(k=t.onContinue)==null||k.call(t)}),S=()=>{if(r)return;let k;try{k=t.fn()}catch(y){k=Promise.reject(y)}Promise.resolve(k).then(p).catch(y=>{var D;if(r)return;const m=t.retry??(Zl?0:3),x=t.retryDelay??IT,A=typeof x=="function"?x(n,y):x,M=m===!0||typeof m=="number"&&n{if(d())return b()}).then(()=>{e?g(y):S()})})};return u2(t.networkMode)?S():b().then(S),{promise:a,cancel:l,continue:()=>(i==null?void 0:i())?a:Promise.resolve(),cancelRetry:c,continueRetry:u}}function OT(){let t=[],e=0,n=p=>{p()},r=p=>{p()},i=p=>setTimeout(p,0);const o=p=>{i=p},s=p=>{let g;e++;try{g=p()}finally{e--,e||c()}return g},a=p=>{e?t.push(p):i(()=>{n(p)})},l=p=>(...g)=>{a(()=>{p(...g)})},c=()=>{const p=t;t=[],p.length&&i(()=>{r(()=>{p.forEach(g=>{n(g)})})})};return{batch:s,batchCalls:l,schedule:a,setNotifyFunction:p=>{n=p},setBatchNotifyFunction:p=>{r=p},setScheduler:o}}var $t=OT(),Ps,Xv,P6=(Xv=class{constructor(){pe(this,Ps,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),tg(this.gcTime)&&se(this,Ps,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Zl?1/0:5*60*1e3))}clearGcTimeout(){B(this,Ps)&&(clearTimeout(B(this,Ps)),se(this,Ps,void 0))}},Ps=new WeakMap,Xv),Cl,_l,nr,un,Nt,jd,Is,_r,Ti,e5,NT=(e5=class extends P6{constructor(e){super();pe(this,_r);pe(this,Cl,void 0);pe(this,_l,void 0);pe(this,nr,void 0);pe(this,un,void 0);pe(this,Nt,void 0);pe(this,jd,void 0);pe(this,Is,void 0);se(this,Is,!1),se(this,jd,e.defaultOptions),this.setOptions(e.options),se(this,Nt,[]),se(this,nr,e.cache),this.queryKey=e.queryKey,this.queryHash=e.queryHash,se(this,Cl,e.state||MT(this.options)),this.state=B(this,Cl),this.scheduleGc()}get meta(){return this.options.meta}setOptions(e){this.options={...B(this,jd),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!B(this,Nt).length&&this.state.fetchStatus==="idle"&&B(this,nr).remove(this)}setData(e,n){const r=rg(this.state.data,e,this.options);return Ie(this,_r,Ti).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){Ie(this,_r,Ti).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,i;const n=(r=B(this,un))==null?void 0:r.promise;return(i=B(this,un))==null||i.cancel(e),n?n.then(ir).catch(ir):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(B(this,Cl))}isActive(){return B(this,Nt).some(e=>e.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?B(this,Nt).some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!k6(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=B(this,Nt).find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=B(this,un))==null||n.continue()}onOnline(){var n;const e=B(this,Nt).find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=B(this,un))==null||n.continue()}addObserver(e){B(this,Nt).includes(e)||(B(this,Nt).push(e),this.clearGcTimeout(),B(this,nr).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){B(this,Nt).includes(e)&&(se(this,Nt,B(this,Nt).filter(n=>n!==e)),B(this,Nt).length||(B(this,un)&&(B(this,Is)?B(this,un).cancel({revert:!0}):B(this,un).cancelRetry()),this.scheduleGc()),B(this,nr).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return B(this,Nt).length}invalidate(){this.state.isInvalidated||Ie(this,_r,Ti).call(this,{type:"invalidate"})}fetch(e,n){var c,u,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(B(this,un))return B(this,un).continueRetry(),B(this,un).promise}if(e&&this.setOptions(e),!this.options.queryFn){const p=B(this,Nt).find(g=>g.options.queryFn);p&&this.setOptions(p.options)}const r=new AbortController,i={queryKey:this.queryKey,meta:this.meta},o=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(se(this,Is,!0),r.signal)})};o(i);const s=()=>!this.options.queryFn||this.options.queryFn===l2?Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)):(se(this,Is,!1),this.options.persister?this.options.persister(this.options.queryFn,i,this):this.options.queryFn(i)),a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};o(a),(c=this.options.behavior)==null||c.onFetch(a,this),se(this,_l,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=a.fetchOptions)==null?void 0:u.meta))&&Ie(this,_r,Ti).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta});const l=p=>{var g,b,S,k;m1(p)&&p.silent||Ie(this,_r,Ti).call(this,{type:"error",error:p}),m1(p)||((b=(g=B(this,nr).config).onError)==null||b.call(g,p,this),(k=(S=B(this,nr).config).onSettled)==null||k.call(S,this.state.data,p,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return se(this,un,$6({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var g,b,S,k;if(p===void 0){l(new Error(`${this.queryHash} data is undefined`));return}this.setData(p),(b=(g=B(this,nr).config).onSuccess)==null||b.call(g,p,this),(k=(S=B(this,nr).config).onSettled)==null||k.call(S,p,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(p,g)=>{Ie(this,_r,Ti).call(this,{type:"failed",failureCount:p,error:g})},onPause:()=>{Ie(this,_r,Ti).call(this,{type:"pause"})},onContinue:()=>{Ie(this,_r,Ti).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),B(this,un).promise}},Cl=new WeakMap,_l=new WeakMap,nr=new WeakMap,un=new WeakMap,Nt=new WeakMap,jd=new WeakMap,Is=new WeakMap,_r=new WeakSet,Ti=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...I6(r.data,this.options),fetchMeta:e.meta??null};case"success":return{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=e.error;return m1(i)&&i.revert&&B(this,_l)?{...B(this,_l),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),$t.batch(()=>{B(this,Nt).forEach(r=>{r.onQueryUpdate()}),B(this,nr).notify({query:this,type:"updated",action:e})})},e5);function I6(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:u2(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function MT(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Qr,t5,LT=(t5=class extends $c{constructor(e={}){super();pe(this,Qr,void 0);this.config=e,se(this,Qr,new Map)}build(e,n,r){const i=n.queryKey,o=n.queryHash??s2(i,n);let s=this.get(o);return s||(s=new NT({cache:this,queryKey:i,queryHash:o,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(s)),s}add(e){B(this,Qr).has(e.queryHash)||(B(this,Qr).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=B(this,Qr).get(e.queryHash);n&&(e.destroy(),n===e&&B(this,Qr).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){$t.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return B(this,Qr).get(e)}getAll(){return[...B(this,Qr).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>D3(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>D3(e,r)):n}notify(e){$t.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){$t.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){$t.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Qr=new WeakMap,t5),Jr,Ud,Ln,El,Xr,lo,n5,DT=(n5=class extends P6{constructor(e){super();pe(this,Xr);pe(this,Jr,void 0);pe(this,Ud,void 0);pe(this,Ln,void 0);pe(this,El,void 0);this.mutationId=e.mutationId,se(this,Ud,e.defaultOptions),se(this,Ln,e.mutationCache),se(this,Jr,[]),this.state=e.state||O6(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options={...B(this,Ud),...e},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){B(this,Jr).includes(e)||(B(this,Jr).push(e),this.clearGcTimeout(),B(this,Ln).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){se(this,Jr,B(this,Jr).filter(n=>n!==e)),this.scheduleGc(),B(this,Ln).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){B(this,Jr).length||(this.state.status==="pending"?this.scheduleGc():B(this,Ln).remove(this))}continue(){var e;return((e=B(this,El))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var i,o,s,a,l,c,u,d,p,g,b,S,k,y,m,x,A,M,D,H;const n=()=>(se(this,El,$6({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(w,C)=>{Ie(this,Xr,lo).call(this,{type:"failed",failureCount:w,error:C})},onPause:()=>{Ie(this,Xr,lo).call(this,{type:"pause"})},onContinue:()=>{Ie(this,Xr,lo).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),B(this,El).promise),r=this.state.status==="pending";try{if(!r){Ie(this,Xr,lo).call(this,{type:"pending",variables:e}),await((o=(i=B(this,Ln).config).onMutate)==null?void 0:o.call(i,e,this));const C=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,e));C!==this.state.context&&Ie(this,Xr,lo).call(this,{type:"pending",context:C,variables:e})}const w=await n();return await((c=(l=B(this,Ln).config).onSuccess)==null?void 0:c.call(l,w,e,this.state.context,this)),await((d=(u=this.options).onSuccess)==null?void 0:d.call(u,w,e,this.state.context)),await((g=(p=B(this,Ln).config).onSettled)==null?void 0:g.call(p,w,null,this.state.variables,this.state.context,this)),await((S=(b=this.options).onSettled)==null?void 0:S.call(b,w,null,e,this.state.context)),Ie(this,Xr,lo).call(this,{type:"success",data:w}),w}catch(w){try{throw await((y=(k=B(this,Ln).config).onError)==null?void 0:y.call(k,w,e,this.state.context,this)),await((x=(m=this.options).onError)==null?void 0:x.call(m,w,e,this.state.context)),await((M=(A=B(this,Ln).config).onSettled)==null?void 0:M.call(A,void 0,w,this.state.variables,this.state.context,this)),await((H=(D=this.options).onSettled)==null?void 0:H.call(D,void 0,w,e,this.state.context)),w}finally{Ie(this,Xr,lo).call(this,{type:"error",error:w})}}}},Jr=new WeakMap,Ud=new WeakMap,Ln=new WeakMap,El=new WeakMap,Xr=new WeakSet,lo=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!u2(this.options.networkMode),status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),$t.batch(()=>{B(this,Jr).forEach(r=>{r.onMutationUpdate(e)}),B(this,Ln).notify({mutation:this,type:"updated",action:e})})},n5);function O6(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var rr,Fd,Os,r5,BT=(r5=class extends $c{constructor(e={}){super();pe(this,rr,void 0);pe(this,Fd,void 0);pe(this,Os,void 0);this.config=e,se(this,rr,[]),se(this,Fd,0)}build(e,n,r){const i=new DT({mutationCache:this,mutationId:++Sf(this,Fd)._,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){B(this,rr).push(e),this.notify({type:"added",mutation:e})}remove(e){se(this,rr,B(this,rr).filter(n=>n!==e)),this.notify({type:"removed",mutation:e})}clear(){$t.batch(()=>{B(this,rr).forEach(e=>{this.remove(e)})})}getAll(){return B(this,rr)}find(e){const n={exact:!0,...e};return B(this,rr).find(r=>B3(n,r))}findAll(e={}){return B(this,rr).filter(n=>B3(e,n))}notify(e){$t.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){return se(this,Os,(B(this,Os)??Promise.resolve()).then(()=>{const e=B(this,rr).filter(n=>n.state.isPaused);return $t.batch(()=>e.reduce((n,r)=>n.then(()=>r.continue().catch(ir)),Promise.resolve()))}).then(()=>{se(this,Os,void 0)})),B(this,Os)}},rr=new WeakMap,Fd=new WeakMap,Os=new WeakMap,r5);function jT(t){return{onFetch:(e,n)=>{const r=async()=>{var b,S,k,y,m;const i=e.options,o=(k=(S=(b=e.fetchOptions)==null?void 0:b.meta)==null?void 0:S.fetchMore)==null?void 0:k.direction,s=((y=e.state.data)==null?void 0:y.pages)||[],a=((m=e.state.data)==null?void 0:m.pageParams)||[],l={pages:[],pageParams:[]};let c=!1;const u=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(e.signal.aborted?c=!0:e.signal.addEventListener("abort",()=>{c=!0}),e.signal)})},d=e.options.queryFn&&e.options.queryFn!==l2?e.options.queryFn:()=>Promise.reject(new Error(`Missing queryFn: '${e.options.queryHash}'`)),p=async(x,A,M)=>{if(c)return Promise.reject();if(A==null&&x.pages.length)return Promise.resolve(x);const D={queryKey:e.queryKey,pageParam:A,direction:M?"backward":"forward",meta:e.options.meta};u(D);const H=await d(D),{maxPages:w}=e.options,C=M?RT:kT;return{pages:C(x.pages,H,w),pageParams:C(x.pageParams,A,w)}};let g;if(o&&s.length){const x=o==="backward",A=x?UT:F3,M={pages:s,pageParams:a},D=A(i,M);g=await p(M,D,x)}else{g=await p(l,a[0]??i.initialPageParam);const x=t??s.length;for(let A=1;A{var i,o;return(o=(i=e.options).persister)==null?void 0:o.call(i,r,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=r}}}function F3(t,{pages:e,pageParams:n}){const r=e.length-1;return t.getNextPageParam(e[r],e,n[r],n)}function UT(t,{pages:e,pageParams:n}){var r;return(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n)}var yt,bo,xo,Sl,Tl,Co,Al,kl,i5,FT=(i5=class{constructor(t={}){pe(this,yt,void 0);pe(this,bo,void 0);pe(this,xo,void 0);pe(this,Sl,void 0);pe(this,Tl,void 0);pe(this,Co,void 0);pe(this,Al,void 0);pe(this,kl,void 0);se(this,yt,t.queryCache||new LT),se(this,bo,t.mutationCache||new BT),se(this,xo,t.defaultOptions||{}),se(this,Sl,new Map),se(this,Tl,new Map),se(this,Co,0)}mount(){Sf(this,Co)._++,B(this,Co)===1&&(se(this,Al,c2.subscribe(async t=>{t&&(await this.resumePausedMutations(),B(this,yt).onFocus())})),se(this,kl,K0.subscribe(async t=>{t&&(await this.resumePausedMutations(),B(this,yt).onOnline())})))}unmount(){var t,e;Sf(this,Co)._--,B(this,Co)===0&&((t=B(this,Al))==null||t.call(this),se(this,Al,void 0),(e=B(this,kl))==null||e.call(this),se(this,kl,void 0))}isFetching(t){return B(this,yt).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return B(this,bo).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=B(this,yt).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.getQueryData(t.queryKey);if(e===void 0)return this.fetchQuery(t);{const n=this.defaultQueryOptions(t),r=B(this,yt).build(this,n);return t.revalidateIfStale&&r.isStaleByTime(n.staleTime)&&this.prefetchQuery(n),Promise.resolve(e)}}getQueriesData(t){return B(this,yt).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),i=B(this,yt).get(r.queryHash),o=i==null?void 0:i.state.data,s=TT(e,o);if(s!==void 0)return B(this,yt).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(t,e,n){return $t.batch(()=>B(this,yt).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=B(this,yt).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=B(this,yt);$t.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=B(this,yt),r={type:"active",...t};return $t.batch(()=>(n.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries(r,e)))}cancelQueries(t={},e={}){const n={revert:!0,...e},r=$t.batch(()=>B(this,yt).findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(ir).catch(ir)}invalidateQueries(t={},e={}){return $t.batch(()=>{if(B(this,yt).findAll(t).forEach(r=>{r.invalidate()}),t.refetchType==="none")return Promise.resolve();const n={...t,type:t.refetchType??t.type??"active"};return this.refetchQueries(n,e)})}refetchQueries(t={},e){const n={...e,cancelRefetch:(e==null?void 0:e.cancelRefetch)??!0},r=$t.batch(()=>B(this,yt).findAll(t).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(ir)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(ir)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=B(this,yt).build(this,e);return n.isStaleByTime(e.staleTime)?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(ir).catch(ir)}fetchInfiniteQuery(t){return t.behavior=jT(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(ir).catch(ir)}resumePausedMutations(){return K0.isOnline()?B(this,bo).resumePausedMutations():Promise.resolve()}getQueryCache(){return B(this,yt)}getMutationCache(){return B(this,bo)}getDefaultOptions(){return B(this,xo)}setDefaultOptions(t){se(this,xo,t)}setQueryDefaults(t,e){B(this,Sl).set(Js(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...B(this,Sl).values()];let n={};return e.forEach(r=>{od(t,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(t,e){B(this,Tl).set(Js(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...B(this,Tl).values()];let n={};return e.forEach(r=>{od(t,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...B(this,xo).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=s2(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.enabled!==!0&&e.queryFn===l2&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...B(this,xo).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){B(this,yt).clear(),B(this,bo).clear()}},yt=new WeakMap,bo=new WeakMap,xo=new WeakMap,Sl=new WeakMap,Tl=new WeakMap,Co=new WeakMap,Al=new WeakMap,kl=new WeakMap,i5),_n,et,zd,dn,Ns,Rl,ei,Wd,$l,Pl,Ms,Ls,_o,Il,Ds,ru,Hd,ig,Vd,og,Zd,sg,Gd,ag,qd,lg,Kd,cg,Yd,ug,kp,N6,o5,zT=(o5=class extends $c{constructor(e,n){super();pe(this,Ds);pe(this,Hd);pe(this,Vd);pe(this,Zd);pe(this,Gd);pe(this,qd);pe(this,Kd);pe(this,Yd);pe(this,kp);pe(this,_n,void 0);pe(this,et,void 0);pe(this,zd,void 0);pe(this,dn,void 0);pe(this,Ns,void 0);pe(this,Rl,void 0);pe(this,ei,void 0);pe(this,Wd,void 0);pe(this,$l,void 0);pe(this,Pl,void 0);pe(this,Ms,void 0);pe(this,Ls,void 0);pe(this,_o,void 0);pe(this,Il,new Set);this.options=n,se(this,_n,e),se(this,ei,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(B(this,et).addObserver(this),z3(B(this,et),this.options)?Ie(this,Ds,ru).call(this):this.updateResult(),Ie(this,Gd,ag).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return dg(B(this,et),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return dg(B(this,et),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ie(this,qd,lg).call(this),Ie(this,Kd,cg).call(this),B(this,et).removeObserver(this)}setOptions(e,n){const r=this.options,i=B(this,et);if(this.options=B(this,_n).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");Ie(this,Yd,ug).call(this),B(this,et).setOptions(this.options),r._defaulted&&!q0(this.options,r)&&B(this,_n).getQueryCache().notify({type:"observerOptionsUpdated",query:B(this,et),observer:this});const o=this.hasListeners();o&&W3(B(this,et),i,this.options,r)&&Ie(this,Ds,ru).call(this),this.updateResult(n),o&&(B(this,et)!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&Ie(this,Hd,ig).call(this);const s=Ie(this,Vd,og).call(this);o&&(B(this,et)!==i||this.options.enabled!==r.enabled||s!==B(this,_o))&&Ie(this,Zd,sg).call(this,s)}getOptimisticResult(e){const n=B(this,_n).getQueryCache().build(B(this,_n),e),r=this.createResult(n,e);return HT(this,r)&&(se(this,dn,r),se(this,Rl,this.options),se(this,Ns,B(this,et).state)),r}getCurrentResult(){return B(this,dn)}trackResult(e,n){const r={};return Object.keys(e).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),n==null||n(i),e[i])})}),r}trackProp(e){B(this,Il).add(e)}getCurrentQuery(){return B(this,et)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=B(this,_n).defaultQueryOptions(e),r=B(this,_n).getQueryCache().build(B(this,_n),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(e){return Ie(this,Ds,ru).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),B(this,dn)))}createResult(e,n){var H;const r=B(this,et),i=this.options,o=B(this,dn),s=B(this,Ns),a=B(this,Rl),c=e!==r?e.state:B(this,zd),{state:u}=e;let d={...u},p=!1,g;if(n._optimisticResults){const w=this.hasListeners(),C=!w&&z3(e,n),_=w&&W3(e,r,n,i);(C||_)&&(d={...d,...I6(u.data,e.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:b,errorUpdatedAt:S,status:k}=d;if(n.select&&d.data!==void 0)if(o&&d.data===(s==null?void 0:s.data)&&n.select===B(this,Wd))g=B(this,$l);else try{se(this,Wd,n.select),g=n.select(d.data),g=rg(o==null?void 0:o.data,g,n),se(this,$l,g),se(this,ei,null)}catch(w){se(this,ei,w)}else g=d.data;if(n.placeholderData!==void 0&&g===void 0&&k==="pending"){let w;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))w=o.data;else if(w=typeof n.placeholderData=="function"?n.placeholderData((H=B(this,Pl))==null?void 0:H.state.data,B(this,Pl)):n.placeholderData,n.select&&w!==void 0)try{w=n.select(w),se(this,ei,null)}catch(C){se(this,ei,C)}w!==void 0&&(k="success",g=rg(o==null?void 0:o.data,w,n),p=!0)}B(this,ei)&&(b=B(this,ei),g=B(this,$l),S=Date.now(),k="error");const y=d.fetchStatus==="fetching",m=k==="pending",x=k==="error",A=m&&y,M=g!==void 0;return{status:k,fetchStatus:d.fetchStatus,isPending:m,isSuccess:k==="success",isError:x,isInitialLoading:A,isLoading:A,data:g,dataUpdatedAt:d.dataUpdatedAt,error:b,errorUpdatedAt:S,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:y,isRefetching:y&&!m,isLoadingError:x&&!M,isPaused:d.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:x&&M,isStale:d2(e,n),refetch:this.refetch}}updateResult(e){const n=B(this,dn),r=this.createResult(B(this,et),this.options);if(se(this,Ns,B(this,et).state),se(this,Rl,this.options),B(this,Ns).data!==void 0&&se(this,Pl,B(this,et)),q0(r,n))return;se(this,dn,r);const i={},o=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!B(this,Il).size)return!0;const l=new Set(a??B(this,Il));return this.options.throwOnError&&l.add("error"),Object.keys(B(this,dn)).some(c=>{const u=c;return B(this,dn)[u]!==n[u]&&l.has(u)})};(e==null?void 0:e.listeners)!==!1&&o()&&(i.listeners=!0),Ie(this,kp,N6).call(this,{...i,...e})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ie(this,Gd,ag).call(this)}},_n=new WeakMap,et=new WeakMap,zd=new WeakMap,dn=new WeakMap,Ns=new WeakMap,Rl=new WeakMap,ei=new WeakMap,Wd=new WeakMap,$l=new WeakMap,Pl=new WeakMap,Ms=new WeakMap,Ls=new WeakMap,_o=new WeakMap,Il=new WeakMap,Ds=new WeakSet,ru=function(e){Ie(this,Yd,ug).call(this);let n=B(this,et).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(ir)),n},Hd=new WeakSet,ig=function(){if(Ie(this,qd,lg).call(this),Zl||B(this,dn).isStale||!tg(this.options.staleTime))return;const n=k6(B(this,dn).dataUpdatedAt,this.options.staleTime)+1;se(this,Ms,setTimeout(()=>{B(this,dn).isStale||this.updateResult()},n))},Vd=new WeakSet,og=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(B(this,et)):this.options.refetchInterval)??!1},Zd=new WeakSet,sg=function(e){Ie(this,Kd,cg).call(this),se(this,_o,e),!(Zl||this.options.enabled===!1||!tg(B(this,_o))||B(this,_o)===0)&&se(this,Ls,setInterval(()=>{(this.options.refetchIntervalInBackground||c2.isFocused())&&Ie(this,Ds,ru).call(this)},B(this,_o)))},Gd=new WeakSet,ag=function(){Ie(this,Hd,ig).call(this),Ie(this,Zd,sg).call(this,Ie(this,Vd,og).call(this))},qd=new WeakSet,lg=function(){B(this,Ms)&&(clearTimeout(B(this,Ms)),se(this,Ms,void 0))},Kd=new WeakSet,cg=function(){B(this,Ls)&&(clearInterval(B(this,Ls)),se(this,Ls,void 0))},Yd=new WeakSet,ug=function(){const e=B(this,_n).getQueryCache().build(B(this,_n),this.options);if(e===B(this,et))return;const n=B(this,et);se(this,et,e),se(this,zd,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},kp=new WeakSet,N6=function(e){$t.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(B(this,dn))}),B(this,_n).getQueryCache().notify({query:B(this,et),type:"observerResultsUpdated"})})},o5);function WT(t,e){return e.enabled!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function z3(t,e){return WT(t,e)||t.state.data!==void 0&&dg(t,e,e.refetchOnMount)}function dg(t,e,n){if(e.enabled!==!1){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&d2(t,e)}return!1}function W3(t,e,n,r){return(t!==e||r.enabled===!1)&&(!n.suspense||t.state.status!=="error")&&d2(t,n)}function d2(t,e){return e.enabled!==!1&&t.isStaleByTime(e.staleTime)}function HT(t,e){return!q0(t.getCurrentResult(),e)}var Eo,So,En,$i,Ol,g0,Qd,fg,s5,VT=(s5=class extends $c{constructor(n,r){super();pe(this,Ol);pe(this,Qd);pe(this,Eo,void 0);pe(this,So,void 0);pe(this,En,void 0);pe(this,$i,void 0);se(this,Eo,n),this.setOptions(r),this.bindMethods(),Ie(this,Ol,g0).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=B(this,Eo).defaultMutationOptions(n),q0(this.options,r)||B(this,Eo).getMutationCache().notify({type:"observerOptionsUpdated",mutation:B(this,En),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Js(r.mutationKey)!==Js(this.options.mutationKey)?this.reset():((i=B(this,En))==null?void 0:i.state.status)==="pending"&&B(this,En).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=B(this,En))==null||n.removeObserver(this)}onMutationUpdate(n){Ie(this,Ol,g0).call(this),Ie(this,Qd,fg).call(this,n)}getCurrentResult(){return B(this,So)}reset(){var n;(n=B(this,En))==null||n.removeObserver(this),se(this,En,void 0),Ie(this,Ol,g0).call(this),Ie(this,Qd,fg).call(this)}mutate(n,r){var i;return se(this,$i,r),(i=B(this,En))==null||i.removeObserver(this),se(this,En,B(this,Eo).getMutationCache().build(B(this,Eo),this.options)),B(this,En).addObserver(this),B(this,En).execute(n)}},Eo=new WeakMap,So=new WeakMap,En=new WeakMap,$i=new WeakMap,Ol=new WeakSet,g0=function(){var r;const n=((r=B(this,En))==null?void 0:r.state)??O6();se(this,So,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Qd=new WeakSet,fg=function(n){$t.batch(()=>{var r,i,o,s,a,l,c,u;if(B(this,$i)&&this.hasListeners()){const d=B(this,So).variables,p=B(this,So).context;(n==null?void 0:n.type)==="success"?((i=(r=B(this,$i)).onSuccess)==null||i.call(r,n.data,d,p),(s=(o=B(this,$i)).onSettled)==null||s.call(o,n.data,null,d,p)):(n==null?void 0:n.type)==="error"&&((l=(a=B(this,$i)).onError)==null||l.call(a,n.error,d,p),(u=(c=B(this,$i)).onSettled)==null||u.call(c,void 0,n.error,d,p))}this.listeners.forEach(d=>{d(B(this,So))})})},s5),M6=je.createContext(void 0),Xp=t=>{const e=je.useContext(M6);if(t)return t;if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},ZT=({client:t,children:e})=>(je.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),Oe.jsx(M6.Provider,{value:t,children:e})),L6=je.createContext(!1),GT=()=>je.useContext(L6);L6.Provider;function qT(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var KT=je.createContext(qT()),YT=()=>je.useContext(KT);function D6(t,e){return typeof t=="function"?t(...e):!!t}function QT(){}var JT=(t,e)=>{(t.suspense||t.throwOnError)&&(e.isReset()||(t.retryOnMount=!1))},XT=t=>{je.useEffect(()=>{t.clearReset()},[t])},eA=({result:t,errorResetBoundary:e,throwOnError:n,query:r})=>t.isError&&!e.isReset()&&!t.isFetching&&r&&D6(n,[t.error,r]),tA=t=>{t.suspense&&typeof t.staleTime!="number"&&(t.staleTime=1e3)},nA=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,rA=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function iA(t,e,n){const r=Xp(n),i=GT(),o=YT(),s=r.defaultQueryOptions(t);s._optimisticResults=i?"isRestoring":"optimistic",tA(s),JT(s,o),XT(o);const[a]=je.useState(()=>new e(r,s)),l=a.getOptimisticResult(s);if(je.useSyncExternalStore(je.useCallback(c=>{const u=i?()=>{}:a.subscribe($t.batchCalls(c));return a.updateResult(),u},[a,i]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),je.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),nA(s,l))throw rA(s,a,o);if(eA({result:l,errorResetBoundary:o,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function oA(t,e){return iA(t,zT,e)}function sA(t,e){const n=Xp(e),[r]=je.useState(()=>new VT(n,t));je.useEffect(()=>{r.setOptions(t)},[r,t]);const i=je.useSyncExternalStore(je.useCallback(s=>r.subscribe($t.batchCalls(s)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=je.useCallback((s,a)=>{r.mutate(s,a).catch(QT)},[r]);if(i.error&&D6(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}function Oa(t={}){const e=t.config??je.useContext(A6);if(!e)throw new ST;return e}var B6={exports:{}},j6={},U6={exports:{}},F6={};/** + * @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 Gl=je;function aA(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var lA=typeof Object.is=="function"?Object.is:aA,cA=Gl.useState,uA=Gl.useEffect,dA=Gl.useLayoutEffect,fA=Gl.useDebugValue;function pA(t,e){var n=e(),r=cA({inst:{value:n,getSnapshot:e}}),i=r[0].inst,o=r[1];return dA(function(){i.value=n,i.getSnapshot=e,g1(i)&&o({inst:i})},[t,n,e]),uA(function(){return g1(i)&&o({inst:i}),t(function(){g1(i)&&o({inst:i})})},[t]),fA(n),n}function g1(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!lA(t,n)}catch{return!0}}function hA(t,e){return e()}var mA=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?hA:pA;F6.useSyncExternalStore=Gl.useSyncExternalStore!==void 0?Gl.useSyncExternalStore:mA;U6.exports=F6;var gA=U6.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 eh=je,wA=gA;function yA(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var vA=typeof Object.is=="function"?Object.is:yA,bA=wA.useSyncExternalStore,xA=eh.useRef,CA=eh.useEffect,_A=eh.useMemo,EA=eh.useDebugValue;j6.useSyncExternalStoreWithSelector=function(t,e,n,r,i){var o=xA(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=_A(function(){function l(g){if(!c){if(c=!0,u=g,g=r(g),i!==void 0&&s.hasValue){var b=s.value;if(i(b,g))return d=b}return d=g}if(b=d,vA(u,g))return b;var S=r(g);return i!==void 0&&i(b,S)?b:(u=g,d=S)}var c=!1,u,d,p=n===void 0?null:n;return[function(){return l(e())},p===null?void 0:function(){return l(p())}]},[e,n,r,i]);var a=bA(t,o[0],o[1]);return CA(function(){s.hasValue=!0,s.value=a},[a]),EA(a),a};B6.exports=j6;var SA=B6.exports;const w1=t=>typeof t=="object"&&!Array.isArray(t);function TA(t,e,n=e,r=id){const i=je.useRef([]),o=SA.useSyncExternalStoreWithSelector(t,e,n,s=>s,(s,a)=>{if(w1(s)&&w1(a)&&i.current.length){for(const l of i.current)if(!r(s[l],a[l]))return!1;return!0}return r(s,a)});if(w1(o)){const s={...o};return Object.defineProperties(s,Object.entries(s).reduce((a,[l,c])=>({...a,[l]:{configurable:!1,enumerable:!0,get:()=>(i.current.includes(l)||i.current.push(l),c)}}),{})),s}return o}function AA(t={}){const e=Oa(t);return TA(n=>T6(e,{onChange:n}),()=>_6(e))}function kA(t){return JSON.stringify(t,(e,n)=>RA(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):typeof n=="bigint"?n.toString():n)}function RA(t){if(!H3(t))return!1;const e=t.constructor;if(typeof e>"u")return!0;const n=e.prototype;return!(!H3(n)||!n.hasOwnProperty("isPrototypeOf"))}function H3(t){return Object.prototype.toString.call(t)==="[object Object]"}function f2(t){const{_defaulted:e,behavior:n,gcTime:r,initialData:i,initialDataUpdatedAt:o,maxPages:s,meta:a,networkMode:l,queryFn:c,queryHash:u,queryKey:d,queryKeyHashFn:p,retry:g,retryDelay:b,structuralSharing:S,getPreviousPageParam:k,getNextPageParam:y,initialPageParam:m,_optimisticResults:x,enabled:A,notifyOnChangeProps:M,placeholderData:D,refetchInterval:H,refetchIntervalInBackground:w,refetchOnMount:C,refetchOnReconnect:_,refetchOnWindowFocus:O,retryOnMount:L,select:U,staleTime:F,suspense:I,throwOnError:N,config:j,connector:R,query:z,...Z}=t;return Z}function $A(t,e={}){return{async queryFn({queryKey:n}){const{scopeKey:r,...i}=n[1];return await lT(t,i)??null},queryKey:PA(e)}}function PA(t={}){return["block",f2(t)]}function IA(t,e={}){return{async queryFn({queryKey:n}){const r=e.abi;if(!r)throw new Error("abi is required");const{address:i,functionName:o,scopeKey:s,...a}=n[1];if(!i)throw new Error("address is required");if(!o)throw new Error("functionName is required");const l=a.args;return E6(t,{abi:r,address:i,functionName:o,args:l,...a})},queryKey:OA(e)}}function OA(t={}){const{abi:e,...n}=t;return["readContract",f2(n)]}function NA(t,e={}){return{async queryFn({queryKey:n}){var a;const r=[],i=n[1].contracts.length;for(let l=0;lgT(e,{onChange:n}),()=>L3(e),()=>L3(e))}function DA(t={}){const{enabled:e=!0,onBlock:n,config:r,...i}=t,o=Oa(t),s=th({config:o}),a=t.chainId??s;je.useEffect(()=>{if(e&&n)return mT(o,{...i,chainId:a,onBlock:n})},[a,o,e,n,i])}function BA(t={}){const{query:e={},watch:n}=t,r=Oa(t),i=Xp(),o=th({config:r}),s=t.chainId??o,a=$A(r,{...t,chainId:s}),l=!!(e.enabled??!0);return DA({config:t.config,chainId:t.chainId,...typeof n=="object"?n:{},enabled:!!(l&&(typeof n=="object"?n.enabled:n)),onBlock(c){i.setQueryData(a.queryKey,c)}}),p2({...e,...a,enabled:l})}function jA(t={}){const{abi:e,address:n,functionName:r,query:i={}}=t,o=Oa(t),s=th({config:o}),a=IA(o,{...t,chainId:t.chainId??s}),l=!!(n&&e&&r&&(i.enabled??!0));return p2({...i,...a,enabled:l,structuralSharing:i.structuralSharing??z6})}function UA(t={}){const{contracts:e=[],query:n={}}=t,r=Oa(t),i=th({config:r}),o=NA(r,{...t,chainId:i}),s=je.useMemo(()=>{let a=!1;for(const l of e){const{abi:c,address:u,functionName:d}=l;if(!c||!u||!d){a=!1;break}a=!0}return!!(a&&(n.enabled??!0))},[e,n.enabled]);return p2({...o,...n,enabled:s,structuralSharing:n.structuralSharing??z6})}function V3(t={}){const{mutation:e}=t,n=Oa(t),r=LA(n),{mutate:i,mutateAsync:o,...s}=sA({...e,...r});return{...s,writeContract:i,writeContractAsync:o}}const FA=[{inputs:[{internalType:"address",name:"_owner",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Paused",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"farmBotAddress",type:"address"},{indexed:!0,internalType:"address",name:"depositorAddress",type:"address"},{indexed:!1,internalType:"uint256",name:"lpGained",type:"uint256"},{indexed:!1,internalType:"uint256",name:"fpGained",type:"uint256"}],name:"RFPBrokerDeposit",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"previousAdminRole",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"newAdminRole",type:"bytes32"}],name:"RoleAdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleGranted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleRevoked",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"account",type:"address"}],name:"Unpaused",type:"event"},{inputs:[],name:"DEFAULT_ADMIN_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleAdmin",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_farmBotAddress",type:"address"},{components:[{internalType:"uint256",name:"amount0Desired",type:"uint256"},{internalType:"uint256",name:"amount1Desired",type:"uint256"},{internalType:"uint256",name:"amount0Min",type:"uint256"},{internalType:"uint256",name:"amount1Min",type:"uint256"}],internalType:"struct LiquidityAmounts",name:"_liquidityAmounts",type:"tuple"},{internalType:"uint256",name:"_deadline",type:"uint256"}],name:"getUniswapLPAndDeposit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"grantRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"hasRole",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"pause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"paused",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"renounceRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"revokeRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"unpause",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_farmBotAddress",type:"address"},{internalType:"uint256",name:"_fpAmount",type:"uint256"},{internalType:"uint256",name:"_amountAMin",type:"uint256"},{internalType:"uint256",name:"_amountBMin",type:"uint256"},{internalType:"uint256",name:"_deadline",type:"uint256"}],name:"withdrawFPForStakingTokens",outputs:[],stateMutability:"nonpayable",type:"function"}],qf="0xCB34fbfC3b9a73bc04D2eb43B62532c7918d9E81",zA="0xF94fEA0C87D2b357DC72b743b45A8cB682b0716E",Z3="0x97d0D4ae7841c9405A80fB8004dbA96123e076De",WA="0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",HA=5e3,VA=60*5,G3=97,q3=[{constant:!0,inputs:[],name:"name",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_spender",type:"address"},{name:"_value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{name:"",type:"uint8"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"",type:"string"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"_owner",type:"address"},{name:"_spender",type:"address"}],name:"allowance",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{payable:!0,stateMutability:"payable",type:"fallback"},{anonymous:!1,inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Transfer",type:"event"}];function ZA(){const{data:t}=BA({query:{refetchInterval:HA}}),e=BigInt(VA);return t!=null&&t.timestamp?t.timestamp+e:BigInt(Math.ceil(Date.now()/1e3))+e}const GA=[{inputs:[{internalType:"address",name:"_owner",type:"address"},{internalType:"address",name:"_reserveAddress",type:"address"},{internalType:"address",name:"_stakingRewards",type:"address"},{internalType:"address",name:"_stakingToken",type:"address"},{internalType:"address",name:"_revoFees",type:"address"},{internalType:"address",name:"_router",type:"address"},{internalType:"address[]",name:"_rewardsTokens",type:"address[]"},{internalType:"string",name:"_symbol",type:"string"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"by",type:"address"},{indexed:!1,internalType:"uint256",name:"lpStaked",type:"uint256"},{indexed:!1,internalType:"uint256",name:"newLPTotalBalance",type:"uint256"},{indexed:!1,internalType:"uint256[]",name:"compounderFeeAmounts",type:"uint256[]"},{indexed:!1,internalType:"uint256[]",name:"reserveFeeAmounts",type:"uint256[]"}],name:"Compound",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"by",type:"address"},{indexed:!1,internalType:"uint256",name:"lpAmount",type:"uint256"}],name:"Deposit",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"by",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"FeesUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"by",type:"address"},{indexed:!0,internalType:"address",name:"newRoleRecipient",type:"address"},{indexed:!1,internalType:"bytes32",name:"role",type:"bytes32"}],name:"GrantRole",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"by",type:"address"},{indexed:!0,internalType:"address",name:"reserveAddress",type:"address"}],name:"ReserveUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"previousAdminRole",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"newAdminRole",type:"bytes32"}],name:"RoleAdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleGranted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleRevoked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"by",type:"address"},{indexed:!1,internalType:"uint256",name:"numerator",type:"uint256"},{indexed:!1,internalType:"uint256",name:"denominator",type:"uint256"}],name:"SlippageUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"by",type:"address"},{indexed:!1,internalType:"uint256",name:"lpAmount",type:"uint256"},{indexed:!1,internalType:"uint256",name:"fee",type:"uint256"}],name:"Withdraw",type:"event"},{inputs:[],name:"COMPOUNDER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"DEFAULT_ADMIN_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[][2][]",name:"_paths",type:"address[][2][]"},{internalType:"uint256[2][]",name:"_minAmountsOut",type:"uint256[2][]"},{internalType:"uint256",name:"_deadline",type:"uint256"}],name:"compound",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_lpAmount",type:"uint256"}],name:"deposit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_lpAmount",type:"uint256"}],name:"getFpAmount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_fpAmount",type:"uint256"}],name:"getLpAmount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleAdmin",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"grantRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"hasRole",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"interestEarnedDenominator",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"interestEarnedNumerator",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"lpTotalBalance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"maxPerformanceFeeDenominator",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"maxPerformanceFeeNumerator",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"maxWithdrawalFeeDenominator",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"maxWithdrawalFeeNumerator",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"previewCompounderRewards",outputs:[{components:[{internalType:"contract IERC20",name:"token",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],internalType:"struct TokenAmount[]",name:"compounderFee",type:"tuple[]"},{components:[{internalType:"contract IERC20",name:"token",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],internalType:"struct TokenAmount[]",name:"compounderBonus",type:"tuple[]"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"renounceRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"reserveAddress",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"revoFees",outputs:[{internalType:"contract IRevoFees",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"revokeRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"rewardsTokens",outputs:[{internalType:"contract IERC20",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"router",outputs:[{internalType:"contract IUniswapV2Router02",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"slippageDenominator",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"slippageNumerator",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"stakingRewards",outputs:[{internalType:"contract IMoolaStakingRewards",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"stakingToken",outputs:[{internalType:"contract IUniswapV2Pair",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"stakingToken0",outputs:[{internalType:"contract IERC20",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"stakingToken1",outputs:[{internalType:"contract IERC20",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_revoFees",type:"address"}],name:"updateFees",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_reserveAddress",type:"address"}],name:"updateReserveAddress",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_slippageNumerator",type:"uint256"},{internalType:"uint256",name:"_slippageDenominator",type:"uint256"}],name:"updateSlippage",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_lpAmount",type:"uint256"}],name:"withdraw",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"withdrawAll",outputs:[],stateMutability:"nonpayable",type:"function"}],qA=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"Burn",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1",type:"uint256"}],name:"Mint",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount0In",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1In",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount0Out",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount1Out",type:"uint256"},{indexed:!0,internalType:"address",name:"to",type:"address"}],name:"Swap",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint112",name:"reserve0",type:"uint112"},{indexed:!1,internalType:"uint112",name:"reserve1",type:"uint112"}],name:"Sync",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{constant:!0,inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"MINIMUM_LIQUIDITY",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"pure",type:"function"},{constant:!0,inputs:[],name:"PERMIT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],payable:!1,stateMutability:"pure",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"burn",outputs:[{internalType:"uint256",name:"amount0",type:"uint256"},{internalType:"uint256",name:"amount1",type:"uint256"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],payable:!1,stateMutability:"pure",type:"function"},{constant:!0,inputs:[],name:"factory",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"getReserves",outputs:[{internalType:"uint112",name:"reserve0",type:"uint112"},{internalType:"uint112",name:"reserve1",type:"uint112"},{internalType:"uint32",name:"blockTimestampLast",type:"uint32"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"initialize",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"kLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"mint",outputs:[{internalType:"uint256",name:"liquidity",type:"uint256"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"pure",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"owner",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"price0CumulativeLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"price1CumulativeLast",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"}],name:"skim",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"uint256",name:"amount0Out",type:"uint256"},{internalType:"uint256",name:"amount1Out",type:"uint256"},{internalType:"address",name:"to",type:"address"},{internalType:"bytes",name:"data",type:"bytes"}],name:"swap",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],payable:!1,stateMutability:"pure",type:"function"},{constant:!1,inputs:[],name:"sync",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"token0",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"token1",outputs:[{internalType:"address",name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}];function KA(t,e,n){const r={address:e,abi:GA},i={abi:qA,address:n},{data:o,status:s,queryKey:a}=UA({contracts:[{...r,functionName:"getLpAmount",args:[t]},{...i,functionName:"getReserves"},{...i,functionName:"totalSupply"}]}),l=Xp(),c=je.useCallback(()=>l.invalidateQueries(a),[l,a]);if(!o)return{stakingToken0Amount:void 0,stakingToken1Amount:void 0,status:s,invalidate:c};const[{result:u},{result:d},{result:p}]=o,g=(BigInt((d==null?void 0:d[0])??0)*BigInt(u??0)/BigInt(p??1)).toString(),b=(BigInt((d==null?void 0:d[1])??0)*BigInt(u??0)/BigInt(p??1)).toString();return{stakingToken0Amount:g,stakingToken1Amount:b,status:s,invalidate:c}}var YA=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,y1=Math.ceil,Xn=Math.floor,Cn="[BigNumber Error] ",K3=Cn+"Number primitive has more than 15 significant digits: ",br=1e14,$e=14,v1=9007199254740991,b1=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],so=1e7,It=1e9;function W6(t){var e,n,r,i=m.prototype={constructor:m,toString:null,valueOf:null},o=new m(1),s=20,a=4,l=-7,c=21,u=-1e7,d=1e7,p=!1,g=1,b=0,S={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},k="0123456789abcdefghijklmnopqrstuvwxyz",y=!0;function m(w,C){var _,O,L,U,F,I,N,j,R=this;if(!(R instanceof m))return new m(w,C);if(C==null){if(w&&w._isBigNumber===!0){R.s=w.s,!w.c||w.e>d?R.c=R.e=null:w.e=10;F/=10,U++);U>d?R.c=R.e=null:(R.e=U,R.c=[w]);return}j=String(w)}else{if(!YA.test(j=String(w)))return r(R,j,I);R.s=j.charCodeAt(0)==45?(j=j.slice(1),-1):1}(U=j.indexOf("."))>-1&&(j=j.replace(".","")),(F=j.search(/e/i))>0?(U<0&&(U=F),U+=+j.slice(F+1),j=j.substring(0,F)):U<0&&(U=j.length)}else{if(ut(C,2,k.length,"Base"),C==10&&y)return R=new m(w),D(R,s+R.e+1,a);if(j=String(w),I=typeof w=="number"){if(w*0!=0)return r(R,j,I,C);if(R.s=1/w<0?(j=j.slice(1),-1):1,m.DEBUG&&j.replace(/^0\.0*|\./,"").length>15)throw Error(K3+w)}else R.s=j.charCodeAt(0)===45?(j=j.slice(1),-1):1;for(_=k.slice(0,C),U=F=0,N=j.length;FU){U=N;continue}}else if(!L&&(j==j.toUpperCase()&&(j=j.toLowerCase())||j==j.toLowerCase()&&(j=j.toUpperCase()))){L=!0,F=-1,U=0;continue}return r(R,String(w),I,C)}I=!1,j=n(j,C,10,R.s),(U=j.indexOf("."))>-1?j=j.replace(".",""):U=j.length}for(F=0;j.charCodeAt(F)===48;F++);for(N=j.length;j.charCodeAt(--N)===48;);if(j=j.slice(F,++N)){if(N-=F,I&&m.DEBUG&&N>15&&(w>v1||w!==Xn(w)))throw Error(K3+R.s*w);if((U=U-F-1)>d)R.c=R.e=null;else if(U=-It&&L<=It&&L===Xn(L)){if(O[0]===0){if(L===0&&O.length===1)return!0;break e}if(C=(L+1)%$e,C<1&&(C+=$e),String(O[0]).length==C){for(C=0;C=br||_!==Xn(_))break e;if(_!==0)return!0}}}else if(O===null&&L===null&&(U===null||U===1||U===-1))return!0;throw Error(Cn+"Invalid BigNumber: "+w)},m.maximum=m.max=function(){return A(arguments,-1)},m.minimum=m.min=function(){return A(arguments,1)},m.random=function(){var w=9007199254740992,C=Math.random()*w&2097151?function(){return Xn(Math.random()*w)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(_){var O,L,U,F,I,N=0,j=[],R=new m(o);if(_==null?_=s:ut(_,0,It),F=y1(_/$e),p)if(crypto.getRandomValues){for(O=crypto.getRandomValues(new Uint32Array(F*=2));N>>11),I>=9e15?(L=crypto.getRandomValues(new Uint32Array(2)),O[N]=L[0],O[N+1]=L[1]):(j.push(I%1e14),N+=2);N=F/2}else if(crypto.randomBytes){for(O=crypto.randomBytes(F*=7);N=9e15?crypto.randomBytes(7).copy(O,N):(j.push(I%1e14),N+=7);N=F/7}else throw p=!1,Error(Cn+"crypto unavailable");if(!p)for(;N=10;I/=10,N++);N<$e&&(U-=$e-N)}return R.e=U,R.c=j,R}}(),m.sum=function(){for(var w=1,C=arguments,_=new m(C[0]);wL-1&&(I[F+1]==null&&(I[F+1]=0),I[F+1]+=I[F]/L|0,I[F]%=L)}return I.reverse()}return function(_,O,L,U,F){var I,N,j,R,z,Z,Y,re,be=_.indexOf("."),Se=s,ge=a;for(be>=0&&(R=b,b=0,_=_.replace(".",""),re=new m(O),Z=re.pow(_.length-be),b=R,re.c=C(_i(Jn(Z.c),Z.e,"0"),10,L,w),re.e=re.c.length),Y=C(_,O,L,F?(I=k,w):(I=w,k)),j=R=Y.length;Y[--R]==0;Y.pop());if(!Y[0])return I.charAt(0);if(be<0?--j:(Z.c=Y,Z.e=j,Z.s=U,Z=e(Z,re,Se,ge,L),Y=Z.c,z=Z.r,j=Z.e),N=j+Se+1,be=Y[N],R=L/2,z=z||N<0||Y[N+1]!=null,z=ge<4?(be!=null||z)&&(ge==0||ge==(Z.s<0?3:2)):be>R||be==R&&(ge==4||z||ge==6&&Y[N-1]&1||ge==(Z.s<0?8:7)),N<1||!Y[0])_=z?_i(I.charAt(1),-Se,I.charAt(0)):I.charAt(0);else{if(Y.length=N,z)for(--L;++Y[--N]>L;)Y[N]=0,N||(++j,Y=[1].concat(Y));for(R=Y.length;!Y[--R];);for(be=0,_="";be<=R;_+=I.charAt(Y[be++]));_=_i(_,j,I.charAt(0))}return _}}(),e=function(){function w(O,L,U){var F,I,N,j,R=0,z=O.length,Z=L%so,Y=L/so|0;for(O=O.slice();z--;)N=O[z]%so,j=O[z]/so|0,F=Y*N+j*Z,I=Z*N+F%so*so+R,R=(I/U|0)+(F/so|0)+Y*j,O[z]=I%U;return R&&(O=[R].concat(O)),O}function C(O,L,U,F){var I,N;if(U!=F)N=U>F?1:-1;else for(I=N=0;IL[I]?1:-1;break}return N}function _(O,L,U,F){for(var I=0;U--;)O[U]-=I,I=O[U]1;O.splice(0,1));}return function(O,L,U,F,I){var N,j,R,z,Z,Y,re,be,Se,ge,Te,We,zt,ln,bt,xt,bn,it=O.s==L.s?1:-1,Ct=O.c,ot=L.c;if(!Ct||!Ct[0]||!ot||!ot[0])return new m(!O.s||!L.s||(Ct?ot&&Ct[0]==ot[0]:!ot)?NaN:Ct&&Ct[0]==0||!ot?it*0:it/0);for(be=new m(it),Se=be.c=[],j=O.e-L.e,it=U+j+1,I||(I=br,j=er(O.e/$e)-er(L.e/$e),it=it/$e|0),R=0;ot[R]==(Ct[R]||0);R++);if(ot[R]>(Ct[R]||0)&&j--,it<0)Se.push(1),z=!0;else{for(ln=Ct.length,xt=ot.length,R=0,it+=2,Z=Xn(I/(ot[0]+1)),Z>1&&(ot=w(ot,Z,I),Ct=w(Ct,Z,I),xt=ot.length,ln=Ct.length),zt=xt,ge=Ct.slice(0,xt),Te=ge.length;Te=I/2&&bt++;do{if(Z=0,N=C(ot,ge,xt,Te),N<0){if(We=ge[0],xt!=Te&&(We=We*I+(ge[1]||0)),Z=Xn(We/bt),Z>1)for(Z>=I&&(Z=I-1),Y=w(ot,Z,I),re=Y.length,Te=ge.length;C(Y,ge,re,Te)==1;)Z--,_(Y,xt=10;it/=10,R++);D(be,U+(be.e=R+j*$e-1)+1,F,z)}else be.e=j,be.r=+z;return be}}();function x(w,C,_,O){var L,U,F,I,N;if(_==null?_=a:ut(_,0,8),!w.c)return w.toString();if(L=w.c[0],F=w.e,C==null)N=Jn(w.c),N=O==1||O==2&&(F<=l||F>=c)?Yf(N,F):_i(N,F,"0");else if(w=D(new m(w),C,_),U=w.e,N=Jn(w.c),I=N.length,O==1||O==2&&(C<=U||U<=l)){for(;II){if(--C>0)for(N+=".";C--;N+="0");}else if(C+=U-I,C>0)for(U+1==I&&(N+=".");C--;N+="0");return w.s<0&&L?"-"+N:N}function A(w,C){for(var _,O,L=1,U=new m(w[0]);L=10;L/=10,O++);return(_=O+_*$e-1)>d?w.c=w.e=null:_=10;I/=10,L++);if(U=C-L,U<0)U+=$e,F=C,N=z[j=0],R=Xn(N/Z[L-F-1]%10);else if(j=y1((U+1)/$e),j>=z.length)if(O){for(;z.length<=j;z.push(0));N=R=0,L=1,U%=$e,F=U-$e+1}else break e;else{for(N=I=z[j],L=1;I>=10;I/=10,L++);U%=$e,F=U-$e+L,R=F<0?0:Xn(N/Z[L-F-1]%10)}if(O=O||C<0||z[j+1]!=null||(F<0?N:N%Z[L-F-1]),O=_<4?(R||O)&&(_==0||_==(w.s<0?3:2)):R>5||R==5&&(_==4||O||_==6&&(U>0?F>0?N/Z[L-F]:0:z[j-1])%10&1||_==(w.s<0?8:7)),C<1||!z[0])return z.length=0,O?(C-=w.e+1,z[0]=Z[($e-C%$e)%$e],w.e=-C||0):z[0]=w.e=0,w;if(U==0?(z.length=j,I=1,j--):(z.length=j+1,I=Z[$e-U],z[j]=F>0?Xn(N/Z[L-F]%Z[F])*I:0),O)for(;;)if(j==0){for(U=1,F=z[0];F>=10;F/=10,U++);for(F=z[0]+=I,I=1;F>=10;F/=10,I++);U!=I&&(w.e++,z[0]==br&&(z[0]=1));break}else{if(z[j]+=I,z[j]!=br)break;z[j--]=0,I=1}for(U=z.length;z[--U]===0;z.pop());}w.e>d?w.c=w.e=null:w.e=c?Yf(C,_):_i(C,_,"0"),w.s<0?"-"+C:C)}return i.absoluteValue=i.abs=function(){var w=new m(this);return w.s<0&&(w.s=1),w},i.comparedTo=function(w,C){return hs(this,new m(w,C))},i.decimalPlaces=i.dp=function(w,C){var _,O,L,U=this;if(w!=null)return ut(w,0,It),C==null?C=a:ut(C,0,8),D(new m(U),w+U.e+1,C);if(!(_=U.c))return null;if(O=((L=_.length-1)-er(this.e/$e))*$e,L=_[L])for(;L%10==0;L/=10,O--);return O<0&&(O=0),O},i.dividedBy=i.div=function(w,C){return e(this,new m(w,C),s,a)},i.dividedToIntegerBy=i.idiv=function(w,C){return e(this,new m(w,C),0,1)},i.exponentiatedBy=i.pow=function(w,C){var _,O,L,U,F,I,N,j,R,z=this;if(w=new m(w),w.c&&!w.isInteger())throw Error(Cn+"Exponent not an integer: "+H(w));if(C!=null&&(C=new m(C)),I=w.e>14,!z.c||!z.c[0]||z.c[0]==1&&!z.e&&z.c.length==1||!w.c||!w.c[0])return R=new m(Math.pow(+H(z),I?w.s*(2-Kf(w)):+H(w))),C?R.mod(C):R;if(N=w.s<0,C){if(C.c?!C.c[0]:!C.s)return new m(NaN);O=!N&&z.isInteger()&&C.isInteger(),O&&(z=z.mod(C))}else{if(w.e>9&&(z.e>0||z.e<-1||(z.e==0?z.c[0]>1||I&&z.c[1]>=24e7:z.c[0]<8e13||I&&z.c[0]<=9999975e7)))return U=z.s<0&&Kf(w)?-0:0,z.e>-1&&(U=1/U),new m(N?1/U:U);b&&(U=y1(b/$e+2))}for(I?(_=new m(.5),N&&(w.s=1),j=Kf(w)):(L=Math.abs(+H(w)),j=L%2),R=new m(o);;){if(j){if(R=R.times(z),!R.c)break;U?R.c.length>U&&(R.c.length=U):O&&(R=R.mod(C))}if(L){if(L=Xn(L/2),L===0)break;j=L%2}else if(w=w.times(_),D(w,w.e+1,1),w.e>14)j=Kf(w);else{if(L=+H(w),L===0)break;j=L%2}z=z.times(z),U?z.c&&z.c.length>U&&(z.c.length=U):O&&(z=z.mod(C))}return O?R:(N&&(R=o.div(R)),C?R.mod(C):U?D(R,b,a,F):R)},i.integerValue=function(w){var C=new m(this);return w==null?w=a:ut(w,0,8),D(C,C.e+1,w)},i.isEqualTo=i.eq=function(w,C){return hs(this,new m(w,C))===0},i.isFinite=function(){return!!this.c},i.isGreaterThan=i.gt=function(w,C){return hs(this,new m(w,C))>0},i.isGreaterThanOrEqualTo=i.gte=function(w,C){return(C=hs(this,new m(w,C)))===1||C===0},i.isInteger=function(){return!!this.c&&er(this.e/$e)>this.c.length-2},i.isLessThan=i.lt=function(w,C){return hs(this,new m(w,C))<0},i.isLessThanOrEqualTo=i.lte=function(w,C){return(C=hs(this,new m(w,C)))===-1||C===0},i.isNaN=function(){return!this.s},i.isNegative=function(){return this.s<0},i.isPositive=function(){return this.s>0},i.isZero=function(){return!!this.c&&this.c[0]==0},i.minus=function(w,C){var _,O,L,U,F=this,I=F.s;if(w=new m(w,C),C=w.s,!I||!C)return new m(NaN);if(I!=C)return w.s=-C,F.plus(w);var N=F.e/$e,j=w.e/$e,R=F.c,z=w.c;if(!N||!j){if(!R||!z)return R?(w.s=-C,w):new m(z?F:NaN);if(!R[0]||!z[0])return z[0]?(w.s=-C,w):new m(R[0]?F:a==3?-0:0)}if(N=er(N),j=er(j),R=R.slice(),I=N-j){for((U=I<0)?(I=-I,L=R):(j=N,L=z),L.reverse(),C=I;C--;L.push(0));L.reverse()}else for(O=(U=(I=R.length)<(C=z.length))?I:C,I=C=0;C0)for(;C--;R[_++]=0);for(C=br-1;O>I;){if(R[--O]=0;){for(_=0,Z=We[L]%Se,Y=We[L]/Se|0,F=N,U=L+F;U>L;)j=Te[--F]%Se,R=Te[F]/Se|0,I=Y*j+R*Z,j=Z*j+I%Se*Se+re[U]+_,_=(j/be|0)+(I/Se|0)+Y*R,re[U--]=j%be;re[U]=_}return _?++O:re.splice(0,1),M(w,re,O)},i.negated=function(){var w=new m(this);return w.s=-w.s||null,w},i.plus=function(w,C){var _,O=this,L=O.s;if(w=new m(w,C),C=w.s,!L||!C)return new m(NaN);if(L!=C)return w.s=-C,O.minus(w);var U=O.e/$e,F=w.e/$e,I=O.c,N=w.c;if(!U||!F){if(!I||!N)return new m(L/0);if(!I[0]||!N[0])return N[0]?w:new m(I[0]?O:L*0)}if(U=er(U),F=er(F),I=I.slice(),L=U-F){for(L>0?(F=U,_=N):(L=-L,_=I),_.reverse();L--;_.push(0));_.reverse()}for(L=I.length,C=N.length,L-C<0&&(_=N,N=I,I=_,C=L),L=0;C;)L=(I[--C]=I[C]+N[C]+L)/br|0,I[C]=br===I[C]?0:I[C]%br;return L&&(I=[L].concat(I),++F),M(w,I,F)},i.precision=i.sd=function(w,C){var _,O,L,U=this;if(w!=null&&w!==!!w)return ut(w,1,It),C==null?C=a:ut(C,0,8),D(new m(U),w,C);if(!(_=U.c))return null;if(L=_.length-1,O=L*$e+1,L=_[L]){for(;L%10==0;L/=10,O--);for(L=_[0];L>=10;L/=10,O++);}return w&&U.e+1>O&&(O=U.e+1),O},i.shiftedBy=function(w){return ut(w,-v1,v1),this.times("1e"+w)},i.squareRoot=i.sqrt=function(){var w,C,_,O,L,U=this,F=U.c,I=U.s,N=U.e,j=s+4,R=new m("0.5");if(I!==1||!F||!F[0])return new m(!I||I<0&&(!F||F[0])?NaN:F?U:1/0);if(I=Math.sqrt(+H(U)),I==0||I==1/0?(C=Jn(F),(C.length+N)%2==0&&(C+="0"),I=Math.sqrt(+C),N=er((N+1)/2)-(N<0||N%2),I==1/0?C="5e"+N:(C=I.toExponential(),C=C.slice(0,C.indexOf("e")+1)+N),_=new m(C)):_=new m(I+""),_.c[0]){for(N=_.e,I=N+j,I<3&&(I=0);;)if(L=_,_=R.times(L.plus(e(U,L,j,1))),Jn(L.c).slice(0,I)===(C=Jn(_.c)).slice(0,I))if(_.e0&&re>0){for(U=re%I||I,R=Y.substr(0,U);U0&&(R+=j+Y.slice(U)),Z&&(R="-"+R)}O=z?R+(_.decimalSeparator||"")+((N=+_.fractionGroupSize)?z.replace(new RegExp("\\d{"+N+"}\\B","g"),"$&"+(_.fractionGroupSeparator||"")):z):R}return(_.prefix||"")+O+(_.suffix||"")},i.toFraction=function(w){var C,_,O,L,U,F,I,N,j,R,z,Z,Y=this,re=Y.c;if(w!=null&&(I=new m(w),!I.isInteger()&&(I.c||I.s!==1)||I.lt(o)))throw Error(Cn+"Argument "+(I.isInteger()?"out of range: ":"not an integer: ")+H(I));if(!re)return new m(Y);for(C=new m(o),j=_=new m(o),O=N=new m(o),Z=Jn(re),U=C.e=Z.length-Y.e-1,C.c[0]=b1[(F=U%$e)<0?$e+F:F],w=!w||I.comparedTo(C)>0?U>0?C:j:I,F=d,d=1/0,I=new m(Z),N.c[0]=0;R=e(I,C,0,1),L=_.plus(R.times(O)),L.comparedTo(w)!=1;)_=O,O=L,j=N.plus(R.times(L=j)),N=L,C=I.minus(R.times(L=C)),I=L;return L=e(w.minus(_),O,0,1),N=N.plus(L.times(j)),_=_.plus(L.times(O)),N.s=j.s=Y.s,U=U*2,z=e(j,O,U,a).minus(Y).abs().comparedTo(e(N,_,U,a).minus(Y).abs())<1?[j,O]:[N,_],d=F,z},i.toNumber=function(){return+H(this)},i.toPrecision=function(w,C){return w!=null&&ut(w,1,It),x(this,w,C,2)},i.toString=function(w){var C,_=this,O=_.s,L=_.e;return L===null?O?(C="Infinity",O<0&&(C="-"+C)):C="NaN":(w==null?C=L<=l||L>=c?Yf(Jn(_.c),L):_i(Jn(_.c),L,"0"):w===10&&y?(_=D(new m(_),s+L+1,a),C=_i(Jn(_.c),_.e,"0")):(ut(w,2,k.length,"Base"),C=n(_i(Jn(_.c),L,"0"),10,w,O,!0)),O<0&&_.c[0]&&(C="-"+C)),C},i.valueOf=i.toJSON=function(){return H(this)},i._isBigNumber=!0,i[Symbol.toStringTag]="BigNumber",i[Symbol.for("nodejs.util.inspect.custom")]=i.valueOf,t!=null&&m.set(t),m}function er(t){var e=t|0;return t>0||t===e?e:e-1}function Jn(t){for(var e,n,r=1,i=t.length,o=t[0]+"";rc^n?1:-1;for(a=(l=i.length)<(c=o.length)?l:c,s=0;so[s]^n?1:-1;return l==c?0:l>c^n?1:-1}function ut(t,e,n,r){if(tn||t!==Xn(t))throw Error(Cn+(r||"Argument")+(typeof t=="number"?tn?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function Kf(t){var e=t.c.length-1;return er(t.e/$e)==e&&t.c[e]%2!=0}function Yf(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function _i(t,e,n){var r,i;if(e<0){for(i=n+".";++e;i+=n);t=i+t}else if(r=t.length,++e>r){for(i=n,e-=r;--e;i+=n);t+=i}else e{t&&r(!1)},[t]);const{data:i,status:o}=jA({abi:q3,address:qf,functionName:"balanceOf",args:[e]}),{stakingToken0Amount:s,stakingToken1Amount:a,status:l,invalidate:c}=KA(BigInt(i??"0"),qf,zA),{writeContract:u,data:d,status:p}=V3(),{writeContract:g,data:b,status:S}=V3();je.useEffect(()=>{S==="success"&&(console.log("withdrawStatus success, invalidating staking token amounts"),c())},[S,c]);function k(){u==null||u({address:qf,abi:q3,functionName:"approve",args:[Z3,i??WA]})}const y=ZA(),m=je.useMemo(()=>(console.log(`recalculating balanceUSD with stakingToken0Amount ${s}`),s===void 0?"-":new As(s).times(2).dividedBy(new As(10).exponentiatedBy(18)).toFixed(2)),[s]);function x(){const M=BigInt(i??"0").toString(),D=(BigInt(s??0)*BigInt(G3)/BigInt(100)).toString(),H=(BigInt(a??0)*BigInt(G3)/BigInt(100)).toString();g==null||g({address:Z3,abi:FA,functionName:"withdrawFPForStakingTokens",args:[qf,M,D,H,y]})}const A=()=>{r(!1)};return Oe.jsxs(Oe.Fragment,{children:[Oe.jsxs("header",{children:[Oe.jsx("div",{className:Gr.backdrop,style:{opacity:n?1:0}}),Oe.jsxs("div",{className:Gr.header,children:[Oe.jsx("div",{children:Oe.jsx("img",{src:"/revo-logo.png",alt:"Revo Logo",height:"87.5",width:"436"})}),Oe.jsx("div",{className:Gr.buttons,children:Oe.jsx("div",{onClick:A,className:`${Gr.highlight} ${n?Gr.highlightSelected:""}`,children:Oe.jsx("w3m-button",{})})})]})]}),Oe.jsx("main",{className:Gr.main,children:Oe.jsxs("div",{className:Gr.wrapper,children:[Oe.jsxs("div",{className:Gr.container,children:[Oe.jsx("h1",{children:"Withdraw Funds"}),Oe.jsxs("div",{className:Gr.content,children:[Oe.jsx(QA,{}),Oe.jsx("br",{}),t?Oe.jsx(XA,{balanceUSD:m}):Oe.jsx(JA,{}),Oe.jsx("br",{}),t&&Oe.jsx(ek,{onClickApprove:k,isConnected:t,approveStatus:p,onClickWithdraw:x,balanceUSD:m})]})]}),Oe.jsxs("div",{className:Gr.footer,children:[Oe.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",height:16,width:16,children:Oe.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"})}),Oe.jsx("a",{href:"https://docs.revo.market",target:"_blank",children:"Check out the full documentation here"})]})]})})]})}function ko(t){return t===0||t===0n||t===void 0||t===null||t==="0"||t===""||typeof t=="string"&&(Fi(t).toLowerCase()==="0x"||Fi(t).toLowerCase()==="0x00")}function pn(t){return!ko(t)}function H6(t){return typeof t.maxFeePerGas<"u"&&typeof t.maxPriorityFeePerGas<"u"}function V6(t){return t.type==="cip42"?!0:H6(t)&&(pn(t.feeCurrency)||pn(t.gatewayFeeRecipient)||pn(t.gatewayFee))}function Z6(t){return t.type==="cip64"?!0:H6(t)&&pn(t.feeCurrency)&&ko(t.gatewayFee)&&ko(t.gatewayFeeRecipient)}const nk={block:N_({exclude:["difficulty","gasLimit","mixHash","nonce","uncles"],format(t){var n;const e=(n=t.transactions)==null?void 0:n.map(r=>typeof r=="string"?r:{...Gw(r),feeCurrency:r.feeCurrency,...r.type!=="0x7b"?{gatewayFee:r.gatewayFee?Uu(r.gatewayFee):null,gatewayFeeRecipient:r.gatewayFeeRecipient||null}:{}});return{randomness:t.randomness,transactions:e}}}),transaction:O_({format(t){const e={feeCurrency:t.feeCurrency};return t.type==="0x7b"?e.type="cip64":(t.type==="0x7c"&&(e.type="cip42"),e.gatewayFee=t.gatewayFee?Uu(t.gatewayFee):null,e.gatewayFeeRecipient=t.gatewayFeeRecipient),e}}),transactionRequest:k_({format(t){const e={feeCurrency:t.feeCurrency};return Z6(t)?e.type="0x7b":(V6(t)&&(e.type="0x7c"),e.gatewayFee=typeof t.gatewayFee<"u"?Je(t.gatewayFee):void 0,e.gatewayFeeRecipient=t.gatewayFeeRecipient),e}})},rk={estimateFeesPerGas:async t=>{var r;if(!((r=t.request)!=null&&r.feeCurrency))return null;const[e,n]=await Promise.all([ik(t.client,t.request.feeCurrency),ok(t.client,t.request.feeCurrency)]);return{maxFeePerGas:e,maxPriorityFeePerGas:n}}};async function ik(t,e){const n=await t.request({method:"eth_gasPrice",params:[e]});return BigInt(n)}async function ok(t,e){const n=await t.request({method:"eth_maxPriorityFeePerGas",params:[e]});return BigInt(n)}function sk(t,e){return Z6(t)?ck(t,e):V6(t)?lk(t,e):ES(t,e)}const ak={transaction:sk};function lk(t,e){uk(t);const{chainId:n,gas:r,nonce:i,to:o,value:s,maxFeePerGas:a,maxPriorityFeePerGas:l,accessList:c,feeCurrency:u,gatewayFeeRecipient:d,gatewayFee:p,data:g}=t,b=[ke(n),i?ke(i):"0x",l?ke(l):"0x",a?ke(a):"0x",r?ke(r):"0x",u??"0x",d??"0x",p?ke(p):"0x",o??"0x",s?ke(s):"0x",g??"0x",lf(c),...cf(t,e)];return Pa(["0x7c",Qs(b)])}function ck(t,e){dk(t);const{chainId:n,gas:r,nonce:i,to:o,value:s,maxFeePerGas:a,maxPriorityFeePerGas:l,accessList:c,feeCurrency:u,data:d}=t,p=[ke(n),i?ke(i):"0x",l?ke(l):"0x",a?ke(a):"0x",r?ke(r):"0x",o??"0x",s?ke(s):"0x",d??"0x",lf(c),u,...cf(t,e)];return Pa(["0x7b",Qs(p)])}const G6=2n**256n-1n;function uk(t){const{chainId:e,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:i,to:o,feeCurrency:s,gatewayFee:a,gatewayFeeRecipient:l}=t;if(e<=0)throw new of({chainId:e});if(o&&!Kt(o))throw new fr({address:o});if(r)throw new ne("`gasPrice` is not a valid CIP-42 Transaction attribute.");if(pn(i)&&i>G6)throw new Wi({maxFeePerGas:i});if(pn(n)&&pn(i)&&n>i)throw new qs({maxFeePerGas:i,maxPriorityFeePerGas:n});if(pn(a)&&ko(l)||pn(l)&&ko(a))throw new ne("`gatewayFee` and `gatewayFeeRecipient` must be provided together.");if(pn(s)&&!Kt(s))throw new ne("`feeCurrency` MUST be a token address for CIP-42 transactions.");if(pn(l)&&!Kt(l))throw new fr(l);if(ko(s)&&ko(l))throw new ne("Either `feeCurrency` or `gatewayFeeRecipient` must be provided for CIP-42 transactions.")}function dk(t){const{chainId:e,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:i,to:o,feeCurrency:s}=t;if(e<=0)throw new of({chainId:e});if(o&&!Kt(o))throw new fr({address:o});if(r)throw new ne("`gasPrice` is not a valid CIP-64 Transaction attribute.");if(pn(i)&&i>G6)throw new Wi({maxFeePerGas:i});if(pn(n)&&pn(i)&&n>i)throw new qs({maxFeePerGas:i,maxPriorityFeePerGas:n});if(pn(s)&&!Kt(s))throw new ne("`feeCurrency` MUST be a token address for CIP-64 transactions.");if(ko(s))throw new ne("`feeCurrency` must be provided for CIP-64 transactions.")}const fk={formatters:nk,serializers:ak,fees:rk},q6=h6({...fk,id:42220,name:"Celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/mainnet",apiUrl:"https://explorer.celo.org/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:13112599}},testnet:!1}),pk=h6({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:"0xce01f8eee7E479C928F8919abD53E553a36CeF67",blockCreated:19258213},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),hk=Symbol(),Q3=Object.getPrototypeOf,pg=new WeakMap,mk=t=>t&&(pg.has(t)?pg.get(t):Q3(t)===Object.prototype||Q3(t)===Array.prototype),gk=t=>mk(t)&&t[hk]||null,J3=(t,e=!0)=>{pg.set(t,e)};var Y0={VITE_PROJECT_ID:"36e97c0201af2f60e9592935a92b036a",BASE_URL:"/revo-withdrawal-dapp/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const x1=t=>typeof t=="object"&&t!==null,fo=new WeakMap,iu=new WeakSet,wk=(t=Object.is,e=(c,u)=>new Proxy(c,u),n=c=>x1(c)&&!iu.has(c)&&(Array.isArray(c)||!(Symbol.iterator in c))&&!(c instanceof WeakMap)&&!(c instanceof WeakSet)&&!(c instanceof Error)&&!(c instanceof Number)&&!(c instanceof Date)&&!(c instanceof String)&&!(c instanceof RegExp)&&!(c instanceof ArrayBuffer),r=c=>{switch(c.status){case"fulfilled":return c.value;case"rejected":throw c.reason;default:throw c}},i=new WeakMap,o=(c,u,d=r)=>{const p=i.get(c);if((p==null?void 0:p[0])===u)return p[1];const g=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c));return J3(g,!0),i.set(c,[u,g]),Reflect.ownKeys(c).forEach(b=>{if(Object.getOwnPropertyDescriptor(g,b))return;const S=Reflect.get(c,b),k={value:S,enumerable:!0,configurable:!0};if(iu.has(S))J3(S,!1);else if(S instanceof Promise)delete k.value,k.get=()=>d(S);else if(fo.has(S)){const[y,m]=fo.get(S);k.value=o(y,m(),d)}Object.defineProperty(g,b,k)}),Object.preventExtensions(g)},s=new WeakMap,a=[1,1],l=c=>{if(!x1(c))throw new Error("object required");const u=s.get(c);if(u)return u;let d=a[0];const p=new Set,g=(C,_=++a[0])=>{d!==_&&(d=_,p.forEach(O=>O(C,_)))};let b=a[1];const S=(C=++a[1])=>(b!==C&&!p.size&&(b=C,y.forEach(([_])=>{const O=_[1](C);O>d&&(d=O)})),d),k=C=>(_,O)=>{const L=[..._];L[1]=[C,...L[1]],g(L,O)},y=new Map,m=(C,_)=>{if((Y0?"production":void 0)!=="production"&&y.has(C))throw new Error("prop listener already exists");if(p.size){const O=_[3](k(C));y.set(C,[_,O])}else y.set(C,[_])},x=C=>{var _;const O=y.get(C);O&&(y.delete(C),(_=O[1])==null||_.call(O))},A=C=>(p.add(C),p.size===1&&y.forEach(([O,L],U)=>{if((Y0?"production":void 0)!=="production"&&L)throw new Error("remove already exists");const F=O[3](k(U));y.set(U,[O,F])}),()=>{p.delete(C),p.size===0&&y.forEach(([O,L],U)=>{L&&(L(),y.set(U,[O]))})}),M=Array.isArray(c)?[]:Object.create(Object.getPrototypeOf(c)),H=e(M,{deleteProperty(C,_){const O=Reflect.get(C,_);x(_);const L=Reflect.deleteProperty(C,_);return L&&g(["delete",[_],O]),L},set(C,_,O,L){const U=Reflect.has(C,_),F=Reflect.get(C,_,L);if(U&&(t(F,O)||s.has(O)&&t(F,s.get(O))))return!0;x(_),x1(O)&&(O=gk(O)||O);let I=O;if(O instanceof Promise)O.then(N=>{O.status="fulfilled",O.value=N,g(["resolve",[_],N])}).catch(N=>{O.status="rejected",O.reason=N,g(["reject",[_],N])});else{!fo.has(O)&&n(O)&&(I=l(O));const N=!iu.has(I)&&fo.get(I);N&&m(_,N)}return Reflect.set(C,_,I,L),g(["set",[_],O,F]),!0}});s.set(c,H);const w=[M,S,o,A];return fo.set(H,w),Reflect.ownKeys(c).forEach(C=>{const _=Object.getOwnPropertyDescriptor(c,C);"value"in _&&(H[C]=c[C],delete _.value,delete _.writable),Object.defineProperty(M,C,_)}),H})=>[l,fo,iu,t,e,n,r,i,o,s,a],[yk]=wk();function an(t={}){return yk(t)}function pr(t,e,n){const r=fo.get(t);(Y0?"production":void 0)!=="production"&&!r&&console.warn("Please use proxy object");let i;const o=[],s=r[3];let a=!1;const c=s(u=>{if(o.push(u),n){e(o.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,a&&e(o.splice(0))}))});return a=!0,()=>{a=!1,c()}}function K6(t,e){const n=fo.get(t);(Y0?"production":void 0)!=="production"&&!n&&console.warn("Please use proxy object");const[r,i,o]=n;return o(r,i(),e)}function ql(t){return iu.add(t),t}function gr(t,e,n,r){let i=t[e];return pr(t,()=>{const o=t[e];Object.is(i,o)||n(i=o)},r)}const C1="https://secure.walletconnect.com",Y6=[{label:"Coinbase",name:"coinbase",feeRange:"1-2%",url:""}],Tr={FOUR_MINUTES_MS:24e4,TEN_SEC_MS:1e4,ONE_SEC_MS:1e3,SECURE_SITE:C1,SECURE_SITE_DASHBOARD:`${C1}/dashboard`,SECURE_SITE_FAVICON:`${C1}/images/favicon.png`,RESTRICTED_TIMEZONES:["ASIA/SHANGHAI","ASIA/URUMQI","ASIA/CHONGQING","ASIA/HARBIN","ASIA/KASHGAR","ASIA/MACAU","ASIA/HONG_KONG","ASIA/MACAO","ASIA/BEIJING","ASIA/HARBIN"],WC_COINBASE_PAY_SDK_CHAINS:["ethereum","arbitrum","polygon","avalanche-c-chain","optimism","celo","base"],WC_COINBASE_PAY_SDK_FALLBACK_CHAIN:"ethereum",WC_COINBASE_PAY_SDK_CHAIN_NAME_MAP:{Ethereum:"ethereum","Arbitrum One":"arbitrum",Polygon:"polygon",Avalanche:"avalanche-c-chain","OP Mainnet":"optimism",Celo:"celo",Base:"base"},WC_COINBASE_ONRAMP_APP_ID:"bf18c88d-495a-463b-b249-0b9d3656cf5e"},le={isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},checkCaipNetwork(t,e=""){return t==null?void 0:t.id.toLocaleLowerCase().includes(e.toLowerCase())},isAndroid(){const t=window.navigator.userAgent.toLowerCase();return le.isMobile()&&t.includes("android")},isIos(){const t=window.navigator.userAgent.toLowerCase();return le.isMobile()&&(t.includes("iphone")||t.includes("ipad"))},isClient(){return typeof window<"u"},isPairingExpired(t){return t?t-Date.now()<=Tr.TEN_SEC_MS:!0},isAllowedRetry(t){return Date.now()-t>=Tr.ONE_SEC_MS},copyToClopboard(t){navigator.clipboard.writeText(t)},getPairingExpiry(){return Date.now()+Tr.FOUR_MINUTES_MS},getPlainAddress(t){return t.split(":")[2]},async wait(t){return new Promise(e=>{setTimeout(e,t)})},debounce(t,e=500){let n;return(...r)=>{function i(){t(...r)}n&&clearTimeout(n),n=setTimeout(i,e)}},isHttpUrl(t){return t.startsWith("http://")||t.startsWith("https://")},formatNativeUrl(t,e){if(le.isHttpUrl(t))return this.formatUniversalUrl(t,e);let n=t;n.includes("://")||(n=t.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`);const r=encodeURIComponent(e);return{redirect:`${n}wc?uri=${r}`,href:n}},formatUniversalUrl(t,e){if(!le.isHttpUrl(t))return this.formatNativeUrl(t,e);let n=t;n.endsWith("/")||(n=`${n}/`);const r=encodeURIComponent(e);return{redirect:`${n}wc?uri=${r}`,href:n}},openHref(t,e,n){window.open(t,e,n||"noreferrer noopener")},async preloadImage(t){const e=new Promise((n,r)=>{const i=new Image;i.onload=n,i.onerror=r,i.crossOrigin="anonymous",i.src=t});return Promise.race([e,le.wait(2e3)])},formatBalance(t,e){var r;let n;if(t==="0")n="0.000";else if(typeof t=="string"){const i=Number(t);i&&(n=(r=i.toString().match(/^-?\d+(?:\.\d{0,3})?/u))==null?void 0:r[0])}return n?`${n} ${e??""}`:`0.000 ${e??""}`},formatBalance2(t,e){var r;let n;if(t==="0")n="0";else if(typeof t=="string"){const i=Number(t);i&&(n=(r=i.toString().match(/^-?\d+(?:\.\d{0,3})?/u))==null?void 0:r[0])}return{value:n??"0",rest:n==="0"?"000":"",symbol:e}},isRestrictedRegion(){try{const{timeZone:t}=new Intl.DateTimeFormat().resolvedOptions(),e=t.toUpperCase();return Tr.RESTRICTED_TIMEZONES.includes(e)}catch{return!1}},getApiUrl(){return le.isRestrictedRegion()?"https://api.web3modal.org":"https://api.web3modal.com"},getBlockchainApiUrl(){return le.isRestrictedRegion()?"https://rpc.walletconnect.org":"https://rpc.walletconnect.com"},getAnalyticsUrl(){return le.isRestrictedRegion()?"https://pulse.walletconnect.org":"https://pulse.walletconnect.com"},getUUID(){return crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})},parseError(t){var e,n;return typeof t=="string"?t:typeof((n=(e=t==null?void 0:t.issues)==null?void 0:e[0])==null?void 0:n.message)=="string"?t.issues[0].message:t instanceof Error?t.message:"Unknown error"},sortRequestedNetworks(t,e=[]){const n={};return e&&t&&(t.forEach((r,i)=>{n[r]=i}),e.sort((r,i)=>{const o=n[r.id],s=n[i.id];return o!==void 0&&s!==void 0?o-s:o!==void 0?-1:s!==void 0?1:0})),e},calculateBalance(t){let e=0;for(const n of t)e+=n.value??0;return e},formatTokenBalance(t){const e=t.toFixed(2),[n,r]=e.split(".");return{dollars:n,pennies:r}},isAddress(t){if(/^(?:0x)?[0-9a-f]{40}$/iu.test(t)){if(/^(?:0x)?[0-9a-f]{40}$/iu.test(t)||/^(?:0x)?[0-9A-F]{40}$/iu.test(t))return!0}else return!1;return!1}};class h2{constructor({baseUrl:e}){this.baseUrl=e}async get({headers:e,signal:n,...r}){const i=this.createUrl(r);return(await fetch(i,{method:"GET",headers:e,signal:n,cache:"no-cache"})).json()}async getBlob({headers:e,signal:n,...r}){const i=this.createUrl(r);return(await fetch(i,{method:"GET",headers:e,signal:n})).blob()}async post({body:e,headers:n,signal:r,...i}){const o=this.createUrl(i);return(await fetch(o,{method:"POST",headers:n,body:e?JSON.stringify(e):void 0,signal:r})).json()}async put({body:e,headers:n,signal:r,...i}){const o=this.createUrl(i);return(await fetch(o,{method:"PUT",headers:n,body:e?JSON.stringify(e):void 0,signal:r})).json()}async delete({body:e,headers:n,signal:r,...i}){const o=this.createUrl(i);return(await fetch(o,{method:"DELETE",headers:n,body:e?JSON.stringify(e):void 0,signal:r})).json()}createUrl({path:e,params:n}){const r=new URL(e,this.baseUrl);return n&&Object.entries(n).forEach(([i,o])=>{o&&r.searchParams.append(i,o)}),r}}const Wt=an({projectId:"",sdkType:"w3m",sdkVersion:"html-wagmi-undefined"}),Ce={state:Wt,subscribeKey(t,e){return gr(Wt,t,e)},setProjectId(t){Wt.projectId=t},setAllWallets(t){Wt.allWallets=t},setIncludeWalletIds(t){Wt.includeWalletIds=t},setExcludeWalletIds(t){Wt.excludeWalletIds=t},setFeaturedWalletIds(t){Wt.featuredWalletIds=t},setTokens(t){Wt.tokens=t},setTermsConditionsUrl(t){Wt.termsConditionsUrl=t},setPrivacyPolicyUrl(t){Wt.privacyPolicyUrl=t},setCustomWallets(t){Wt.customWallets=t},setIsSiweEnabled(t){Wt.isSiweEnabled=t},setEnableAnalytics(t){Wt.enableAnalytics=t},setSdkVersion(t){Wt.sdkVersion=t},setMetadata(t){Wt.metadata=t},setOnrampEnabled(t){Wt.enableOnramp=t},setWalletFeaturesEnabled(t){Wt.enableWalletFeatures=t}},vk={purchaseCurrencies:[{id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"USD Coin",symbol:"USDC",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]},{id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"Ether",symbol:"ETH",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]}],paymentCurrencies:[{id:"USD",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]},{id:"EUR",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]}]},bk=le.getBlockchainApiUrl(),Va=new h2({baseUrl:bk}),Xs={fetchIdentity({caipChainId:t,address:e}){return Va.get({path:`/v1/identity/${e}`,params:{chainId:t,projectId:Ce.state.projectId}})},fetchTransactions({account:t,projectId:e,cursor:n,onramp:r,signal:i}){const o=n?{cursor:n}:{};return Va.get({path:`/v1/account/${t}/history?projectId=${e}${r?`&onramp=${r}`:""}`,params:o,signal:i})},async getBalance(t){return Va.get({path:`/v1/account/${t}/balance`,params:{currency:"usd",projectId:Ce.state.projectId}})},async generateOnRampURL({destinationWallets:t,partnerUserId:e,defaultNetwork:n,purchaseAmount:r,paymentAmount:i}){return(await Va.post({path:`/v1/generators/onrampurl?projectId=${Ce.state.projectId}`,body:{destinationWallets:t,defaultNetwork:n,partnerUserId:e,defaultExperience:"buy",presetCryptoAmount:r,presetFiatAmount:i}})).url},async getOnrampOptions(){try{return await Va.get({path:`/v1/onramp/options?projectId=${Ce.state.projectId}`})}catch{return vk}},async getOnrampQuote({purchaseCurrency:t,paymentCurrency:e,amount:n,network:r}){try{return await Va.post({path:`/v1/onramp/quote?projectId=${Ce.state.projectId}`,body:{purchaseCurrency:t,paymentCurrency:e,amount:n,network:r}})}catch{return{coinbaseFee:{amount:n,currency:e.id},networkFee:{amount:n,currency:e.id},paymentSubtotal:{amount:n,currency:e.id},paymentTotal:{amount:n,currency:e.id},purchaseAmount:{amount:n,currency:e.id},quoteId:"mocked-quote-id"}}}},Ei=an({message:"",variant:"success",open:!1}),Fe={state:Ei,subscribeKey(t,e){return gr(Ei,t,e)},showSuccess(t){Ei.message=t,Ei.variant="success",Ei.open=!0},showError(t){const e=le.parseError(t);Ei.message=e,Ei.variant="error",Ei.open=!0},hide(){Ei.open=!1}},Ge=an({isConnected:!1,currentTab:0,tokenBalance:[],smartAccountDeployed:!1}),de={state:Ge,subscribe(t){return pr(Ge,()=>t(Ge))},subscribeKey(t,e){return gr(Ge,t,e)},setIsConnected(t){Ge.isConnected=t},setCaipAddress(t){Ge.caipAddress=t,Ge.address=t?le.getPlainAddress(t):void 0},setBalance(t,e){Ge.balance=t,Ge.balanceSymbol=e},setProfileName(t){Ge.profileName=t},setProfileImage(t){Ge.profileImage=t},setAddressExplorerUrl(t){Ge.addressExplorerUrl=t},setSmartAccountDeployed(t){Ge.smartAccountDeployed=t},setCurrentTab(t){Ge.currentTab=t},setTokenBalance(t){t&&(Ge.tokenBalance=ql(t))},setConnectedWalletInfo(t){Ge.connectedWalletInfo=t},async fetchTokenBalance(){try{if(Ge.address){const t=await Xs.getBalance(Ge.address);this.setTokenBalance(t.balances)}}catch{Fe.showError("Failed to fetch token balance")}},resetAccount(){Ge.isConnected=!1,Ge.smartAccountDeployed=!1,Ge.currentTab=0,Ge.caipAddress=void 0,Ge.address=void 0,Ge.balance=void 0,Ge.balanceSymbol=void 0,Ge.profileName=void 0,Ge.profileImage=void 0,Ge.addressExplorerUrl=void 0,Ge.tokenBalance=[],Ge.connectedWalletInfo=void 0}},_1="WALLETCONNECT_DEEPLINK_CHOICE",X3="@w3m/recent",ev="@w3m/connected_wallet_image_url",tv="@w3m/connected_connector",jt={setWalletConnectDeepLink({href:t,name:e}){try{localStorage.setItem(_1,JSON.stringify({href:t,name:e}))}catch{console.info("Unable to set WalletConnect deep link")}},getWalletConnectDeepLink(){try{const t=localStorage.getItem(_1);if(t)return JSON.parse(t)}catch{console.info("Unable to get WalletConnect deep link")}},deleteWalletConnectDeepLink(){try{localStorage.removeItem(_1)}catch{console.info("Unable to delete WalletConnect deep link")}},setWeb3ModalRecent(t){try{const e=jt.getRecentWallets();e.find(r=>r.id===t.id)||(e.unshift(t),e.length>2&&e.pop(),localStorage.setItem(X3,JSON.stringify(e)))}catch{console.info("Unable to set Web3Modal recent")}},getRecentWallets(){try{const t=localStorage.getItem(X3);return t?JSON.parse(t):[]}catch{console.info("Unable to get Web3Modal recent")}return[]},setConnectedWalletImageUrl(t){try{localStorage.setItem(ev,t)}catch{console.info("Unable to set Connected Wallet Image Url")}},getConnectedWalletImageUrl(){try{return localStorage.getItem(ev)}catch{console.info("Unable to set Connected Wallet Image Url")}},setConnectedConnector(t){try{localStorage.setItem(tv,t)}catch{console.info("Unable to set Connected Connector")}},getConnectedConnector(){try{return localStorage.getItem(tv)}catch{console.info("Unable to get Connected Connector")}}},xr=an({walletImages:{},networkImages:{},connectorImages:{},tokenImages:{},currencyImages:{}}),Dt={state:xr,subscribeNetworkImages(t){return pr(xr.networkImages,()=>t(xr.networkImages))},subscribeKey(t,e){return gr(xr,t,e)},subscribe(t){return pr(xr,()=>t(xr))},setWalletImage(t,e){xr.walletImages[t]=e},setNetworkImage(t,e){xr.networkImages[t]=e},setConnectorImage(t,e){xr.connectorImages[t]=e},setTokenImage(t,e){xr.tokenImages[t]=e},setCurrencyImage(t,e){xr.currencyImages[t]=e}},ms=an({themeMode:"dark",themeVariables:{}}),kt={state:ms,subscribe(t){return pr(ms,()=>t(ms))},setThemeMode(t){ms.themeMode=t;try{const e=Ke.getEmailConnector();e&&e.provider.syncTheme({themeMode:kt.getSnapshot().themeMode})}catch{console.info("Unable to sync theme to email connector")}},setThemeVariables(t){ms.themeVariables={...ms.themeVariables,...t};try{const e=Ke.getEmailConnector();e&&e.provider.syncTheme({themeVariables:kt.getSnapshot().themeVariables})}catch{console.info("Unable to sync theme to email connector")}},getSnapshot(){return K6(ms)}},ao=an({connectors:[]}),Ke={state:ao,subscribeKey(t,e){return gr(ao,t,e)},setConnectors(t){ao.connectors=t.map(e=>ql(e))},addConnector(t){var e,n;if(ao.connectors.push(ql(t)),t.id==="w3mEmail"){const r=t,i=K6(Ce.state);(n=(e=r==null?void 0:r.provider)==null?void 0:e.syncDappData)==null||n.call(e,{metadata:i.metadata,sdkVersion:i.sdkVersion,projectId:i.projectId}),r.provider.syncTheme({themeMode:kt.getSnapshot().themeMode,themeVariables:kt.getSnapshot().themeVariables})}},getEmailConnector(){return ao.connectors.find(t=>t.type==="EMAIL")},getAnnouncedConnectorRdns(){return ao.connectors.filter(t=>t.type==="ANNOUNCED").map(t=>{var e;return(e=t.info)==null?void 0:e.rdns})},getConnectors(){return ao.connectors},getConnector(t,e){return ao.connectors.find(n=>{var r;return n.explorerId===t||((r=n.info)==null?void 0:r.rdns)===e})}},Kc=an({open:!1,selectedNetworkId:void 0}),Kl={state:Kc,subscribe(t){return pr(Kc,()=>t(Kc))},set(t){Object.assign(Kc,{...Kc,...t})}},xk=le.getAnalyticsUrl(),Ck=new h2({baseUrl:xk}),_k=["MODAL_CREATED"],Za=an({timestamp:Date.now(),data:{type:"track",event:"MODAL_CREATED"}}),ye={state:Za,subscribe(t){return pr(Za,()=>t(Za))},_getApiHeaders(){const{projectId:t,sdkType:e,sdkVersion:n}=Ce.state;return{"x-project-id":t,"x-sdk-type":e,"x-sdk-version":n}},async _sendAnalyticsEvent(t){try{if(_k.includes(t.data.event)||typeof window>"u")return;await Ck.post({path:"/e",headers:ye._getApiHeaders(),body:{eventId:le.getUUID(),url:window.location.href,domain:window.location.hostname,timestamp:t.timestamp,props:t.data}})}catch{}},sendEvent(t){Za.timestamp=Date.now(),Za.data=t,Ce.state.enableAnalytics&&ye._sendAnalyticsEvent(Za)}};var Q6={exports:{}};(function(t,e){(function(n,r){t.exports=r()})(Bg,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",s="second",a="minute",l="hour",c="day",u="week",d="month",p="quarter",g="year",b="date",S="Invalid Date",k=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|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,m={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(F){var I=["th","st","nd","rd"],N=F%100;return"["+F+(I[(N-20)%10]||I[N]||I[0])+"]"}},x=function(F,I,N){var j=String(F);return!j||j.length>=I?F:""+Array(I+1-j.length).join(N)+F},A={s:x,z:function(F){var I=-F.utcOffset(),N=Math.abs(I),j=Math.floor(N/60),R=N%60;return(I<=0?"+":"-")+x(j,2,"0")+":"+x(R,2,"0")},m:function F(I,N){if(I.date()1)return F(Z[0])}else{var Y=I.name;D[Y]=I,R=Y}return!j&&R&&(M=R),R||!j&&M},_=function(F,I){if(w(F))return F.clone();var N=typeof I=="object"?I:{};return N.date=F,N.args=arguments,new L(N)},O=A;O.l=C,O.i=w,O.w=function(F,I){return _(F,{locale:I.$L,utc:I.$u,x:I.$x,$offset:I.$offset})};var L=function(){function F(N){this.$L=C(N.locale,null,!0),this.parse(N),this.$x=this.$x||N.x||{},this[H]=!0}var I=F.prototype;return I.parse=function(N){this.$d=function(j){var R=j.date,z=j.utc;if(R===null)return new Date(NaN);if(O.u(R))return new Date;if(R instanceof Date)return new Date(R);if(typeof R=="string"&&!/Z$/i.test(R)){var Z=R.match(k);if(Z){var Y=Z[2]-1||0,re=(Z[7]||"0").substring(0,3);return z?new Date(Date.UTC(Z[1],Y,Z[3]||1,Z[4]||0,Z[5]||0,Z[6]||0,re)):new Date(Z[1],Y,Z[3]||1,Z[4]||0,Z[5]||0,Z[6]||0,re)}}return new Date(R)}(N),this.init()},I.init=function(){var N=this.$d;this.$y=N.getFullYear(),this.$M=N.getMonth(),this.$D=N.getDate(),this.$W=N.getDay(),this.$H=N.getHours(),this.$m=N.getMinutes(),this.$s=N.getSeconds(),this.$ms=N.getMilliseconds()},I.$utils=function(){return O},I.isValid=function(){return this.$d.toString()!==S},I.isSame=function(N,j){var R=_(N);return this.startOf(j)<=R&&R<=this.endOf(j)},I.isAfter=function(N,j){return _(N)0,D<=M.r||!M.r){D<=1&&A>0&&(M=m[A-1]);var H=y[M.l];g&&(D=g(""+D)),S=typeof H=="string"?H.replace("%d",D):H(D,u,M.l,k);break}}if(u)return S;var w=k?y.future:y.past;return typeof w=="function"?w(S):w.replace("%s",S)},o.to=function(c,u){return a(c,u,this,!0)},o.from=function(c,u){return a(c,u,this)};var l=function(c){return c.$u?i.utc():i()};o.toNow=function(c){return this.to(l(this),c)},o.fromNow=function(c){return this.from(l(this),c)}}})})(X6);var Ak=X6.exports;const kk=Jd(Ak);gl.extend(kk);gl.extend(Tk);gl.updateLocale("en",{relativeTime:{future:"in %s",past:"%s ago",s:"%s sec",m:"1 min",mm:"%d min",h:"1 hr",hh:"%d hrs",d:"1 d",dd:"%d d",M:"1 mo",MM:"%d mo",y:"1 yr",yy:"%d yr"}});const m2={getYear(t=new Date().toISOString()){return gl(t).year()},getRelativeDateFromNow(t){return gl(t).fromNow(!0)},formatDate(t,e="DD MMM"){return gl(t).format(e)}},_s={caipNetworkIdToNumber(t){return t?Number(t.split(":")[1]):void 0}},hg={bigNumber(t){return new As(t)},multiply(t,e){if(t===void 0||e===void 0)return As(0);const n=new As(t),r=new As(e);return n.multipliedBy(r)}},Qe=an({supportsAllNetworks:!0,isDefaultCaipNetwork:!1,smartAccountEnabledNetworks:[]}),me={state:Qe,subscribe(t){return pr(Qe,()=>t(Qe))},subscribeKey(t,e){return gr(Qe,t,e)},_getClient(){if(!Qe._client)throw new Error("NetworkController client not set");return Qe._client},setClient(t){Qe._client=ql(t)},setCaipNetwork(t){Qe.caipNetwork=t,Kl.set({selectedNetworkId:t==null?void 0:t.id}),this.state.allowUnsupportedChain||this.checkIfSupportedNetwork()},setDefaultCaipNetwork(t){Qe.caipNetwork=t,Kl.set({selectedNetworkId:t==null?void 0:t.id}),Qe.isDefaultCaipNetwork=!0},setRequestedCaipNetworks(t){Qe.requestedCaipNetworks=t},setAllowUnsupportedChain(t){Qe.allowUnsupportedChain=t},setSmartAccountEnabledNetworks(t){Qe.smartAccountEnabledNetworks=t},getRequestedCaipNetworks(){const{approvedCaipNetworkIds:t,requestedCaipNetworks:e}=Qe,n=t,r=e;return le.sortRequestedNetworks(n,r)},async getApprovedCaipNetworksData(){const t=await this._getClient().getApprovedCaipNetworksData();Qe.supportsAllNetworks=t.supportsAllNetworks,Qe.approvedCaipNetworkIds=t.approvedCaipNetworkIds},async switchActiveNetwork(t){await this._getClient().switchCaipNetwork(t),Qe.caipNetwork=t,t&&ye.sendEvent({type:"track",event:"SWITCH_NETWORK",properties:{network:t.id}})},checkIfSupportedNetwork(){var t;Qe.isUnsupportedChain=!((t=Qe.requestedCaipNetworks)!=null&&t.some(e=>{var n;return e.id===((n=Qe.caipNetwork)==null?void 0:n.id)})),Qe.isUnsupportedChain&&this.showUnsupportedChainUI()},checkIfSmartAccountEnabled(){var e,n;const t=_s.caipNetworkIdToNumber((e=Qe.caipNetwork)==null?void 0:e.id);return t?!!((n=Qe.smartAccountEnabledNetworks)!=null&&n.includes(t)):!1},resetNetwork(){Qe.isDefaultCaipNetwork||(Qe.caipNetwork=void 0),Qe.approvedCaipNetworkIds=void 0,Qe.supportsAllNetworks=!0,Qe.smartAccountEnabledNetworks=[]},showUnsupportedChainUI(){setTimeout(()=>{De.open({view:"UnsupportedChain"})},300)}},Rk=le.getApiUrl(),cn=new h2({baseUrl:Rk}),$k="40",nv="4",Ht=an({page:1,count:0,featured:[],recommended:[],wallets:[],search:[],isAnalyticsEnabled:!1}),xe={state:Ht,subscribeKey(t,e){return gr(Ht,t,e)},_getApiHeaders(){const{projectId:t,sdkType:e,sdkVersion:n}=Ce.state;return{"x-project-id":t,"x-sdk-type":e,"x-sdk-version":n}},async _fetchWalletImage(t){const e=`${cn.baseUrl}/getWalletImage/${t}`,n=await cn.getBlob({path:e,headers:xe._getApiHeaders()});Dt.setWalletImage(t,URL.createObjectURL(n))},async _fetchNetworkImage(t){const e=`${cn.baseUrl}/public/getAssetImage/${t}`,n=await cn.getBlob({path:e,headers:xe._getApiHeaders()});Dt.setNetworkImage(t,URL.createObjectURL(n))},async _fetchConnectorImage(t){const e=`${cn.baseUrl}/public/getAssetImage/${t}`,n=await cn.getBlob({path:e,headers:xe._getApiHeaders()});Dt.setConnectorImage(t,URL.createObjectURL(n))},async _fetchCurrencyImage(t){const e=`${cn.baseUrl}/public/getCurrencyImage/${t}`,n=await cn.getBlob({path:e,headers:xe._getApiHeaders()});Dt.setCurrencyImage(t,URL.createObjectURL(n))},async _fetchTokenImage(t){const e=`${cn.baseUrl}/public/getTokenImage/${t}`,n=await cn.getBlob({path:e,headers:xe._getApiHeaders()});Dt.setTokenImage(t,URL.createObjectURL(n))},async fetchNetworkImages(){const{requestedCaipNetworks:t}=me.state,e=t==null?void 0:t.map(({imageId:n})=>n).filter(Boolean);e&&await Promise.allSettled(e.map(n=>xe._fetchNetworkImage(n)))},async fetchConnectorImages(){const{connectors:t}=Ke.state,e=t.map(({imageId:n})=>n).filter(Boolean);await Promise.allSettled(e.map(n=>xe._fetchConnectorImage(n)))},async fetchCurrencyImages(t=[]){await Promise.allSettled(t.map(e=>xe._fetchCurrencyImage(e)))},async fetchTokenImages(t=[]){await Promise.allSettled(t.map(e=>xe._fetchTokenImage(e)))},async fetchFeaturedWallets(){const{featuredWalletIds:t}=Ce.state;if(t!=null&&t.length){const{data:e}=await cn.get({path:"/getWallets",headers:xe._getApiHeaders(),params:{page:"1",entries:t!=null&&t.length?String(t.length):nv,include:t==null?void 0:t.join(",")}});e.sort((r,i)=>t.indexOf(r.id)-t.indexOf(i.id));const n=e.map(r=>r.image_id).filter(Boolean);await Promise.allSettled(n.map(r=>xe._fetchWalletImage(r))),Ht.featured=e}},async fetchRecommendedWallets(){var c;const{includeWalletIds:t,excludeWalletIds:e,featuredWalletIds:n}=Ce.state,r=[...e??[],...n??[]].filter(Boolean),{data:i,count:o}=await cn.get({path:"/getWallets",headers:xe._getApiHeaders(),params:{page:"1",chains:(c=me.state.caipNetwork)==null?void 0:c.id,entries:nv,include:t==null?void 0:t.join(","),exclude:r==null?void 0:r.join(",")}}),s=jt.getRecentWallets(),a=i.map(u=>u.image_id).filter(Boolean),l=s.map(u=>u.image_id).filter(Boolean);await Promise.allSettled([...a,...l].map(u=>xe._fetchWalletImage(u))),Ht.recommended=i,Ht.count=o??0},async fetchWallets({page:t}){var l;const{includeWalletIds:e,excludeWalletIds:n,featuredWalletIds:r}=Ce.state,i=[...Ht.recommended.map(({id:c})=>c),...n??[],...r??[]].filter(Boolean),{data:o,count:s}=await cn.get({path:"/getWallets",headers:xe._getApiHeaders(),params:{page:String(t),entries:$k,chains:(l=me.state.caipNetwork)==null?void 0:l.id,include:e==null?void 0:e.join(","),exclude:i.join(",")}}),a=o.map(c=>c.image_id).filter(Boolean);await Promise.allSettled([...a.map(c=>xe._fetchWalletImage(c)),le.wait(300)]),Ht.wallets=[...Ht.wallets,...o],Ht.count=s>Ht.count?s:Ht.count,Ht.page=t},async searchWallet({search:t}){var o;const{includeWalletIds:e,excludeWalletIds:n}=Ce.state;Ht.search=[];const{data:r}=await cn.get({path:"/getWallets",headers:xe._getApiHeaders(),params:{page:"1",entries:"100",search:t,chains:(o=me.state.caipNetwork)==null?void 0:o.id,include:e==null?void 0:e.join(","),exclude:n==null?void 0:n.join(",")}}),i=r.map(s=>s.image_id).filter(Boolean);await Promise.allSettled([...i.map(s=>xe._fetchWalletImage(s)),le.wait(300)]),Ht.search=r},async reFetchWallets(){Ht.page=1,Ht.wallets=[],await xe.fetchFeaturedWallets(),await xe.fetchRecommendedWallets()},prefetch(){const t=[xe.fetchFeaturedWallets(),xe.fetchRecommendedWallets(),xe.fetchNetworkImages(),xe.fetchConnectorImages()];Ce.state.enableAnalytics===void 0&&t.push(xe.fetchAnalyticsConfig()),Ht.prefetchPromise=Promise.race([Promise.allSettled(t),le.wait(3e3)])},async fetchAnalyticsConfig(){const{isAnalyticsEnabled:t}=await cn.get({path:"/getAnalyticsConfig",headers:xe._getApiHeaders()});Ce.setEnableAnalytics(t)}},dt=an({view:"Connect",history:["Connect"]}),X={state:dt,subscribeKey(t,e){return gr(dt,t,e)},push(t,e){t!==dt.view&&(dt.view=t,dt.history.push(t),dt.data=e)},reset(t){dt.view=t,dt.history=[t]},replace(t,e){dt.history.length>1&&dt.history.at(-1)!==t&&(dt.view=t,dt.history[dt.history.length-1]=t,dt.data=e)},goBack(){if(dt.history.length>1){dt.history.pop();const[t]=dt.history.slice(-1);t&&(dt.view=t)}},goBackToIndex(t){if(dt.history.length>1){dt.history=dt.history.slice(0,t+1);const[e]=dt.history.slice(-1);e&&(dt.view=e)}}},gs=an({loading:!1,open:!1}),De={state:gs,subscribe(t){return pr(gs,()=>t(gs))},subscribeKey(t,e){return gr(gs,t,e)},async open(t){await xe.state.prefetchPromise;const e=de.state.isConnected;t!=null&&t.view?X.reset(t.view):e?X.reset("Account"):X.reset("Connect"),gs.open=!0,Kl.set({open:!0}),ye.sendEvent({type:"track",event:"MODAL_OPEN",properties:{connected:e}})},close(){const t=de.state.isConnected;gs.open=!1,Kl.set({open:!1}),ye.sendEvent({type:"track",event:"MODAL_CLOSE",properties:{connected:t}})},setLoading(t){gs.loading=t}},mu={id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"USD Coin",symbol:"USDC",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]},mg={id:"USD",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]},Pk={providers:Y6,selectedProvider:null,error:null,purchaseCurrency:mu,paymentCurrency:mg,purchaseCurrencies:[mu],paymentCurrencies:[],quotesLoading:!1},Ve=an(Pk),Ze={state:Ve,subscribe(t){return pr(Ve,()=>t(Ve))},subscribeKey(t,e){return gr(Ve,t,e)},setSelectedProvider(t){Ve.selectedProvider=t},setPurchaseCurrency(t){Ve.purchaseCurrency=t},setPaymentCurrency(t){Ve.paymentCurrency=t},setPurchaseAmount(t){this.state.purchaseAmount=t},setPaymentAmount(t){this.state.paymentAmount=t},async getAvailableCurrencies(){const t=await Xs.getOnrampOptions();Ve.purchaseCurrencies=t.purchaseCurrencies,Ve.paymentCurrencies=t.paymentCurrencies,Ve.paymentCurrency=t.paymentCurrencies[0]||mg,Ve.purchaseCurrency=t.purchaseCurrencies[0]||mu,await xe.fetchCurrencyImages(t.paymentCurrencies.map(e=>e.id)),await xe.fetchTokenImages(t.purchaseCurrencies.map(e=>e.symbol))},async getQuote(){var t,e;Ve.quotesLoading=!0;try{const n=await Xs.getOnrampQuote({purchaseCurrency:Ve.purchaseCurrency,paymentCurrency:Ve.paymentCurrency,amount:((t=Ve.paymentAmount)==null?void 0:t.toString())||"0",network:(e=Ve.purchaseCurrency)==null?void 0:e.symbol});return Ve.quotesLoading=!1,Ve.purchaseAmount=Number(n.purchaseAmount.amount),n}catch(n){return Ve.error=n.message,Ve.quotesLoading=!1,null}finally{Ve.quotesLoading=!1}},resetState(){Ve.providers=Y6,Ve.selectedProvider=null,Ve.error=null,Ve.purchaseCurrency=mu,Ve.paymentCurrency=mg,Ve.purchaseCurrencies=[mu],Ve.paymentCurrencies=[],Ve.paymentAmount=void 0,Ve.purchaseAmount=void 0,Ve.quotesLoading=!1}},at=an({transactions:[],coinbaseTransactions:{},transactionsByYear:{},loading:!1,empty:!1,next:void 0}),en={state:at,subscribe(t){return pr(at,()=>t(at))},async fetchTransactions(t,e){const{projectId:n}=Ce.state;if(!n||!t)throw new Error("Transactions can't be fetched without a projectId and an accountAddress");at.loading=!0;try{const r=await Xs.fetchTransactions({account:t,projectId:n,cursor:at.next,onramp:e}),i=this.filterSpamTransactions(r.data),o=[...at.transactions,...i];at.loading=!1,e==="coinbase"?at.coinbaseTransactions=this.groupTransactionsByYearAndMonth(at.coinbaseTransactions,r.data):(at.transactions=o,at.transactionsByYear=this.groupTransactionsByYearAndMonth(at.transactionsByYear,i)),at.empty=o.length===0,at.next=r.next?r.next:void 0}catch{ye.sendEvent({type:"track",event:"ERROR_FETCH_TRANSACTIONS",properties:{address:t,projectId:n,cursor:at.next}}),Fe.showError("Failed to fetch transactions"),at.loading=!1,at.empty=!0,at.next=void 0}},groupTransactionsByYearAndMonth(t={},e=[]){const n=t;return e.forEach(r=>{const i=new Date(r.metadata.minedAt).getFullYear(),o=new Date(r.metadata.minedAt).getMonth(),s=n[i]??{},l=(s[o]??[]).filter(c=>c.id!==r.id);n[i]={...s,[o]:[...l,r].sort((c,u)=>new Date(u.metadata.minedAt).getTime()-new Date(c.metadata.minedAt).getTime())}}),n},filterSpamTransactions(t){return t.filter(e=>!e.transfers.every(r=>{var i;return((i=r.nft_info)==null?void 0:i.flags.is_spam)===!0}))},clearCursor(){at.next=void 0},resetTransactions(){at.transactions=[],at.transactionsByYear={},at.loading=!1,at.empty=!1,at.next=void 0}},Ot=an({wcError:!1,buffering:!1}),Be={state:Ot,subscribeKey(t,e){return gr(Ot,t,e)},_getClient(){if(!Ot._client)throw new Error("ConnectionController client not set");return Ot._client},setClient(t){Ot._client=ql(t)},connectWalletConnect(){Ot.wcPromise=this._getClient().connectWalletConnect(t=>{Ot.wcUri=t,Ot.wcPairingExpiry=le.getPairingExpiry()}),jt.setConnectedConnector("WALLET_CONNECT")},async connectExternal(t){var e,n;await((n=(e=this._getClient()).connectExternal)==null?void 0:n.call(e,t)),jt.setConnectedConnector(t.type)},async signMessage(t){return this._getClient().signMessage(t)},checkInstalled(t){var e,n;return(n=(e=this._getClient()).checkInstalled)==null?void 0:n.call(e,t)},resetWcConnection(){Ot.wcUri=void 0,Ot.wcPairingExpiry=void 0,Ot.wcPromise=void 0,Ot.wcLinking=void 0,Ot.recentWallet=void 0,en.resetTransactions(),jt.deleteWalletConnectDeepLink()},setWcLinking(t){Ot.wcLinking=t},setWcError(t){Ot.wcError=t,Ot.buffering=!1},setRecentWallet(t){Ot.recentWallet=t},setBuffering(t){Ot.buffering=t},async disconnect(){await this._getClient().disconnect(),this.resetWcConnection()}},xn=an({}),hn={state:xn,subscribe(t){return pr(xn,()=>t(xn))},subscribeKey(t,e){return gr(xn,t,e)},setToken(t){t&&(xn.token=ql(t))},setTokenAmount(t){xn.sendTokenAmount=t},setReceiverAddress(t){xn.receiverAddress=t},setReceiverProfileImageUrl(t){xn.receiverProfileImageUrl=t},setReceiverProfileName(t){xn.receiverProfileName=t},resetSend(){xn.token=void 0,xn.sendTokenAmount=void 0,xn.receiverAddress=void 0,xn.receiverProfileImageUrl=void 0,xn.receiverProfileName=void 0}},qe={getWalletImage(t){if(t!=null&&t.image_url)return t==null?void 0:t.image_url;if(t!=null&&t.image_id)return Dt.state.walletImages[t.image_id]},getNetworkImage(t){if(t!=null&&t.imageUrl)return t==null?void 0:t.imageUrl;if(t!=null&&t.imageId)return Dt.state.networkImages[t.imageId]},getConnectorImage(t){if(t!=null&&t.imageUrl)return t.imageUrl;if(t!=null&&t.imageId)return Dt.state.connectorImages[t.imageId]}},g2={goBackOrCloseModal(){X.state.history.length>1?X.goBack():De.close()},navigateAfterNetworkSwitch(){const{history:t}=X.state,e=t.findIndex(n=>n==="Networks");e>=1?X.goBackToIndex(e-1):De.close()}};/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const w0=globalThis,w2=w0.ShadowRoot&&(w0.ShadyCSS===void 0||w0.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,e8=Symbol(),rv=new WeakMap;let Ik=class{constructor(e,n,r){if(this._$cssResult$=!0,r!==e8)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=n}get styleSheet(){let e=this.o;const n=this.t;if(w2&&e===void 0){const r=n!==void 0&&n.length===1;r&&(e=rv.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&rv.set(n,e))}return e}toString(){return this.cssText}};const Ok=t=>new Ik(typeof t=="string"?t:t+"",void 0,e8),Nk=(t,e)=>{if(w2)t.adoptedStyleSheets=e.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet);else for(const n of e){const r=document.createElement("style"),i=w0.litNonce;i!==void 0&&r.setAttribute("nonce",i),r.textContent=n.cssText,t.appendChild(r)}},iv=w2?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let n="";for(const r of e.cssRules)n+=r.cssText;return Ok(n)})(t):t;/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const{is:Mk,defineProperty:Lk,getOwnPropertyDescriptor:Dk,getOwnPropertyNames:Bk,getOwnPropertySymbols:jk,getPrototypeOf:Uk}=Object,zo=globalThis,ov=zo.trustedTypes,Fk=ov?ov.emptyScript:"",E1=zo.reactiveElementPolyfillSupport,gu=(t,e)=>t,Q0={toAttribute(t,e){switch(e){case Boolean:t=t?Fk:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=t!==null;break;case Number:n=t===null?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch{n=null}}return n}},y2=(t,e)=>!Mk(t,e),sv={attribute:!0,type:String,converter:Q0,reflect:!1,hasChanged:y2};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),zo.litPropertyMetadata??(zo.litPropertyMetadata=new WeakMap);let Yc=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,n=sv){if(n.state&&(n.attribute=!1),this._$Ei(),this.elementProperties.set(e,n),!n.noAccessor){const r=Symbol(),i=this.getPropertyDescriptor(e,r,n);i!==void 0&&Lk(this.prototype,e,i)}}static getPropertyDescriptor(e,n,r){const{get:i,set:o}=Dk(this.prototype,e)??{get(){return this[n]},set(s){this[n]=s}};return{get(){return i==null?void 0:i.call(this)},set(s){const a=i==null?void 0:i.call(this);o.call(this,s),this.requestUpdate(e,a,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??sv}static _$Ei(){if(this.hasOwnProperty(gu("elementProperties")))return;const e=Uk(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(gu("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(gu("properties"))){const n=this.properties,r=[...Bk(n),...jk(n)];for(const i of r)this.createProperty(i,n[i])}const e=this[Symbol.metadata];if(e!==null){const n=litPropertyMetadata.get(e);if(n!==void 0)for(const[r,i]of n)this.elementProperties.set(r,i)}this._$Eh=new Map;for(const[n,r]of this.elementProperties){const i=this._$Eu(n,r);i!==void 0&&this._$Eh.set(i,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const n=[];if(Array.isArray(e)){const r=new Set(e.flat(1/0).reverse());for(const i of r)n.unshift(iv(i))}else e!==void 0&&n.push(iv(e));return n}static _$Eu(e,n){const r=n.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$Eg=new Promise(n=>this.enableUpdating=n),this._$AL=new Map,this._$ES(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(n=>n(this))}addController(e){var n;(this._$E_??(this._$E_=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((n=e.hostConnected)==null||n.call(e))}removeController(e){var n;(n=this._$E_)==null||n.delete(e)}_$ES(){const e=new Map,n=this.constructor.elementProperties;for(const r of n.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Nk(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$E_)==null||e.forEach(n=>{var r;return(r=n.hostConnected)==null?void 0:r.call(n)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$E_)==null||e.forEach(n=>{var r;return(r=n.hostDisconnected)==null?void 0:r.call(n)})}attributeChangedCallback(e,n,r){this._$AK(e,r)}_$EO(e,n){var o;const r=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,r);if(i!==void 0&&r.reflect===!0){const s=(((o=r.converter)==null?void 0:o.toAttribute)!==void 0?r.converter:Q0).toAttribute(n,r.type);this._$Em=e,s==null?this.removeAttribute(i):this.setAttribute(i,s),this._$Em=null}}_$AK(e,n){var o;const r=this.constructor,i=r._$Eh.get(e);if(i!==void 0&&this._$Em!==i){const s=r.getPropertyOptions(i),a=typeof s.converter=="function"?{fromAttribute:s.converter}:((o=s.converter)==null?void 0:o.fromAttribute)!==void 0?s.converter:Q0;this._$Em=i,this[i]=a.fromAttribute(n,s.type),this._$Em=null}}requestUpdate(e,n,r){if(e!==void 0){if(r??(r=this.constructor.getPropertyOptions(e)),!(r.hasChanged??y2)(this[e],n))return;this.C(e,n,r)}this.isUpdatePending===!1&&(this._$Eg=this._$EP())}C(e,n,r){this._$AL.has(e)||this._$AL.set(e,n),r.reflect===!0&&this._$Em!==e&&(this._$ET??(this._$ET=new Set)).add(e)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(n){Promise.reject(n)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[o,s]of this._$Ep)this[o]=s;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[o,s]of i)s.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.C(o,this[o],s)}let e=!1;const n=this._$AL;try{e=this.shouldUpdate(n),e?(this.willUpdate(n),(r=this._$E_)==null||r.forEach(i=>{var o;return(o=i.hostUpdate)==null?void 0:o.call(i)}),this.update(n)):this._$Ej()}catch(i){throw e=!1,this._$Ej(),i}e&&this._$AE(n)}willUpdate(e){}_$AE(e){var n;(n=this._$E_)==null||n.forEach(r=>{var i;return(i=r.hostUpdated)==null?void 0:i.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ej(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(e){return!0}update(e){this._$ET&&(this._$ET=this._$ET.forEach(n=>this._$EO(n,this[n]))),this._$Ej()}updated(e){}firstUpdated(e){}};Yc.elementStyles=[],Yc.shadowRootOptions={mode:"open"},Yc[gu("elementProperties")]=new Map,Yc[gu("finalized")]=new Map,E1==null||E1({ReactiveElement:Yc}),(zo.reactiveElementVersions??(zo.reactiveElementVersions=[])).push("2.0.3");/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const wu=globalThis,J0=wu.trustedTypes,av=J0?J0.createPolicy("lit-html",{createHTML:t=>t}):void 0,t8="$lit$",mo=`lit$${(Math.random()+"").slice(9)}$`,n8="?"+mo,zk=`<${n8}>`,ea=document,X0=()=>ea.createComment(""),sd=t=>t===null||typeof t!="object"&&typeof t!="function",r8=Array.isArray,Wk=t=>r8(t)||typeof(t==null?void 0:t[Symbol.iterator])=="function",S1=`[ +\f\r]`,Qc=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lv=/-->/g,cv=/>/g,ws=RegExp(`>|${S1}(?:([^\\s"'>=/]+)(${S1}*=${S1}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),uv=/'/g,dv=/"/g,i8=/^(?:script|style|textarea|title)$/i,Yl=Symbol.for("lit-noChange"),Et=Symbol.for("lit-nothing"),fv=new WeakMap,ks=ea.createTreeWalker(ea,129);function o8(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return av!==void 0?av.createHTML(e):e}const Hk=(t,e)=>{const n=t.length-1,r=[];let i,o=e===2?"":"",s=Qc;for(let a=0;a"?(s=i??Qc,d=-1):u[1]===void 0?d=-2:(d=s.lastIndex-u[2].length,c=u[1],s=u[3]===void 0?ws:u[3]==='"'?dv:uv):s===dv||s===uv?s=ws:s===lv||s===cv?s=Qc:(s=ws,i=void 0);const g=s===ws&&t[a+1].startsWith("/>")?" ":"";o+=s===Qc?l+zk:d>=0?(r.push(c),l.slice(0,d)+t8+l.slice(d)+mo+g):l+mo+(d===-2?a:g)}return[o8(t,o+(t[n]||"")+(e===2?"":"")),r]};let gg=class s8{constructor({strings:e,_$litType$:n},r){let i;this.parts=[];let o=0,s=0;const a=e.length-1,l=this.parts,[c,u]=Hk(e,n);if(this.el=s8.createElement(c,r),ks.currentNode=this.el.content,n===2){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(i=ks.nextNode())!==null&&l.length0){i.textContent=J0?J0.emptyScript:"";for(let g=0;g2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=Et}_$AI(e,n=this,r,i){const o=this.strings;let s=!1;if(o===void 0)e=Ql(this,e,n,0),s=!sd(e)||e!==this._$AH&&e!==Yl,s&&(this._$AH=e);else{const a=e;let l,c;for(e=o[0],l=0;lnew c8(typeof t=="string"?t:t+"",void 0,b2),Q=(t,...e)=>{const n=t.length===1?t[0]:e.reduce((r,i,o)=>r+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[o+1],t[0]);return new c8(n,t,b2)},Yk=(t,e)=>{if(v2)t.adoptedStyleSheets=e.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet);else for(const n of e){const r=document.createElement("style"),i=y0.litNonce;i!==void 0&&r.setAttribute("nonce",i),r.textContent=n.cssText,t.appendChild(r)}},hv=v2?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let n="";for(const r of e.cssRules)n+=r.cssText;return Kr(n)})(t):t;/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const{is:Qk,defineProperty:Jk,getOwnPropertyDescriptor:Xk,getOwnPropertyNames:eR,getOwnPropertySymbols:tR,getPrototypeOf:nR}=Object,Wo=globalThis,mv=Wo.trustedTypes,rR=mv?mv.emptyScript:"",A1=Wo.reactiveElementPolyfillSupport,yu=(t,e)=>t,wg={toAttribute(t,e){switch(e){case Boolean:t=t?rR:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let n=t;switch(e){case Boolean:n=t!==null;break;case Number:n=t===null?null:Number(t);break;case Object:case Array:try{n=JSON.parse(t)}catch{n=null}}return n}},u8=(t,e)=>!Qk(t,e),gv={attribute:!0,type:String,converter:wg,reflect:!1,hasChanged:u8};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Wo.litPropertyMetadata??(Wo.litPropertyMetadata=new WeakMap);let qa=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,n=gv){if(n.state&&(n.attribute=!1),this._$Ei(),this.elementProperties.set(e,n),!n.noAccessor){const r=Symbol(),i=this.getPropertyDescriptor(e,r,n);i!==void 0&&Jk(this.prototype,e,i)}}static getPropertyDescriptor(e,n,r){const{get:i,set:o}=Xk(this.prototype,e)??{get(){return this[n]},set(s){this[n]=s}};return{get(){return i==null?void 0:i.call(this)},set(s){const a=i==null?void 0:i.call(this);o.call(this,s),this.requestUpdate(e,a,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??gv}static _$Ei(){if(this.hasOwnProperty(yu("elementProperties")))return;const e=nR(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(yu("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(yu("properties"))){const n=this.properties,r=[...eR(n),...tR(n)];for(const i of r)this.createProperty(i,n[i])}const e=this[Symbol.metadata];if(e!==null){const n=litPropertyMetadata.get(e);if(n!==void 0)for(const[r,i]of n)this.elementProperties.set(r,i)}this._$Eh=new Map;for(const[n,r]of this.elementProperties){const i=this._$Eu(n,r);i!==void 0&&this._$Eh.set(i,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const n=[];if(Array.isArray(e)){const r=new Set(e.flat(1/0).reverse());for(const i of r)n.unshift(hv(i))}else e!==void 0&&n.push(hv(e));return n}static _$Eu(e,n){const r=n.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$Eg=new Promise(n=>this.enableUpdating=n),this._$AL=new Map,this._$ES(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(n=>n(this))}addController(e){var n;(this._$E_??(this._$E_=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((n=e.hostConnected)==null||n.call(e))}removeController(e){var n;(n=this._$E_)==null||n.delete(e)}_$ES(){const e=new Map,n=this.constructor.elementProperties;for(const r of n.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Yk(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$E_)==null||e.forEach(n=>{var r;return(r=n.hostConnected)==null?void 0:r.call(n)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$E_)==null||e.forEach(n=>{var r;return(r=n.hostDisconnected)==null?void 0:r.call(n)})}attributeChangedCallback(e,n,r){this._$AK(e,r)}_$EO(e,n){var o;const r=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,r);if(i!==void 0&&r.reflect===!0){const s=(((o=r.converter)==null?void 0:o.toAttribute)!==void 0?r.converter:wg).toAttribute(n,r.type);this._$Em=e,s==null?this.removeAttribute(i):this.setAttribute(i,s),this._$Em=null}}_$AK(e,n){var o;const r=this.constructor,i=r._$Eh.get(e);if(i!==void 0&&this._$Em!==i){const s=r.getPropertyOptions(i),a=typeof s.converter=="function"?{fromAttribute:s.converter}:((o=s.converter)==null?void 0:o.fromAttribute)!==void 0?s.converter:wg;this._$Em=i,this[i]=a.fromAttribute(n,s.type),this._$Em=null}}requestUpdate(e,n,r){if(e!==void 0){if(r??(r=this.constructor.getPropertyOptions(e)),!(r.hasChanged??u8)(this[e],n))return;this.C(e,n,r)}this.isUpdatePending===!1&&(this._$Eg=this._$EP())}C(e,n,r){this._$AL.has(e)||this._$AL.set(e,n),r.reflect===!0&&this._$Em!==e&&(this._$ET??(this._$ET=new Set)).add(e)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(n){Promise.reject(n)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[o,s]of this._$Ep)this[o]=s;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[o,s]of i)s.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.C(o,this[o],s)}let e=!1;const n=this._$AL;try{e=this.shouldUpdate(n),e?(this.willUpdate(n),(r=this._$E_)==null||r.forEach(i=>{var o;return(o=i.hostUpdate)==null?void 0:o.call(i)}),this.update(n)):this._$Ej()}catch(i){throw e=!1,this._$Ej(),i}e&&this._$AE(n)}willUpdate(e){}_$AE(e){var n;(n=this._$E_)==null||n.forEach(r=>{var i;return(i=r.hostUpdated)==null?void 0:i.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ej(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(e){return!0}update(e){this._$ET&&(this._$ET=this._$ET.forEach(n=>this._$EO(n,this[n]))),this._$Ej()}updated(e){}firstUpdated(e){}};qa.elementStyles=[],qa.shadowRootOptions={mode:"open"},qa[yu("elementProperties")]=new Map,qa[yu("finalized")]=new Map,A1==null||A1({ReactiveElement:qa}),(Wo.reactiveElementVersions??(Wo.reactiveElementVersions=[])).push("2.0.3");/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const vu=globalThis,ep=vu.trustedTypes,wv=ep?ep.createPolicy("lit-html",{createHTML:t=>t}):void 0,d8="$lit$",go=`lit$${(Math.random()+"").slice(9)}$`,f8="?"+go,iR=`<${f8}>`,ta=document,ad=()=>ta.createComment(""),ld=t=>t===null||typeof t!="object"&&typeof t!="function",p8=Array.isArray,oR=t=>p8(t)||typeof(t==null?void 0:t[Symbol.iterator])=="function",k1=`[ +\f\r]`,Jc=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,yv=/-->/g,vv=/>/g,ys=RegExp(`>|${k1}(?:([^\\s"'>=/]+)(${k1}*=${k1}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),bv=/'/g,xv=/"/g,h8=/^(?:script|style|textarea|title)$/i,m8=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),v=m8(1),ee=m8(2),Jl=Symbol.for("lit-noChange"),Lt=Symbol.for("lit-nothing"),Cv=new WeakMap,Rs=ta.createTreeWalker(ta,129);function g8(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return wv!==void 0?wv.createHTML(e):e}const sR=(t,e)=>{const n=t.length-1,r=[];let i,o=e===2?"":"",s=Jc;for(let a=0;a"?(s=i??Jc,d=-1):u[1]===void 0?d=-2:(d=s.lastIndex-u[2].length,c=u[1],s=u[3]===void 0?ys:u[3]==='"'?xv:bv):s===xv||s===bv?s=ys:s===yv||s===vv?s=Jc:(s=ys,i=void 0);const g=s===ys&&t[a+1].startsWith("/>")?" ":"";o+=s===Jc?l+iR:d>=0?(r.push(c),l.slice(0,d)+d8+l.slice(d)+go+g):l+go+(d===-2?a:g)}return[g8(t,o+(t[n]||"")+(e===2?"":"")),r]};class cd{constructor({strings:e,_$litType$:n},r){let i;this.parts=[];let o=0,s=0;const a=e.length-1,l=this.parts,[c,u]=sR(e,n);if(this.el=cd.createElement(c,r),Rs.currentNode=this.el.content,n===2){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(i=Rs.nextNode())!==null&&l.length0){i.textContent=ep?ep.emptyScript:"";for(let g=0;g2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=Lt}_$AI(e,n=this,r,i){const o=this.strings;let s=!1;if(o===void 0)e=Xl(this,e,n,0),s=!ld(e)||e!==this._$AH&&e!==Jl,s&&(this._$AH=e);else{const a=e;let l,c;for(e=o[0],l=0;l{const r=(n==null?void 0:n.renderBefore)??e;let i=r._$litPart$;if(i===void 0){const o=(n==null?void 0:n.renderBefore)??null;r._$litPart$=i=new uf(e.insertBefore(ad(),o),o,void 0,n??{})}return i._$AI(t),i};/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */let q=class extends qa{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var n;const e=super.createRenderRoot();return(n=this.renderOptions).renderBefore??(n.renderBefore=e.firstChild),e}update(e){const n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=fR(n,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return Jl}};var a5;q._$litElement$=!0,q.finalized=!0,(a5=globalThis.litElementHydrateSupport)==null||a5.call(globalThis,{LitElement:q});const $1=globalThis.litElementPolyfillSupport;$1==null||$1({LitElement:q});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.3");const w8=ee` + + + + + +`,y8=ee` + + + + + +`;let bu,Ho,Vo;function v8(t,e){bu=document.createElement("style"),Ho=document.createElement("style"),Vo=document.createElement("style"),bu.textContent=wl(t).core.cssText,Ho.textContent=wl(t).dark.cssText,Vo.textContent=wl(t).light.cssText,document.head.appendChild(bu),document.head.appendChild(Ho),document.head.appendChild(Vo),x2(e)}function x2(t){Ho&&Vo&&(t==="light"?(Ho.removeAttribute("media"),Vo.media="enabled"):(Vo.removeAttribute("media"),Ho.media="enabled"))}function b8(t){bu&&Ho&&Vo&&(bu.textContent=wl(t).core.cssText,Ho.textContent=wl(t).dark.cssText,Vo.textContent=wl(t).light.cssText)}function wl(t){return{core:Q` + @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap'); + :root { + --w3m-color-mix-strength: ${Kr(t!=null&&t["--w3m-color-mix-strength"]?`${t["--w3m-color-mix-strength"]}%`:"0%")}; + --w3m-font-family: ${Kr((t==null?void 0:t["--w3m-font-family"])||"Inter, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;")}; + --w3m-font-size-master: ${Kr((t==null?void 0:t["--w3m-font-size-master"])||"10px")}; + --w3m-border-radius-master: ${Kr((t==null?void 0:t["--w3m-border-radius-master"])||"4px")}; + --w3m-z-index: ${Kr((t==null?void 0:t["--w3m-z-index"])||999)}; + + --wui-font-family: var(--w3m-font-family); + + --wui-font-size-mini: calc(var(--w3m-font-size-master) * 0.8); + --wui-font-size-micro: var(--w3m-font-size-master); + --wui-font-size-tiny: calc(var(--w3m-font-size-master) * 1.2); + --wui-font-size-small: calc(var(--w3m-font-size-master) * 1.4); + --wui-font-size-paragraph: calc(var(--w3m-font-size-master) * 1.6); + --wui-font-size-medium: calc(var(--w3m-font-size-master) * 1.8); + --wui-font-size-large: calc(var(--w3m-font-size-master) * 2); + --wui-font-size-medium-title: calc(var(--w3m-font-size-master) * 2.4); + --wui-font-size-2xl: calc(var(--w3m-font-size-master) * 4); + + --wui-border-radius-5xs: var(--w3m-border-radius-master); + --wui-border-radius-4xs: calc(var(--w3m-border-radius-master) * 1.5); + --wui-border-radius-3xs: calc(var(--w3m-border-radius-master) * 2); + --wui-border-radius-xxs: calc(var(--w3m-border-radius-master) * 3); + --wui-border-radius-xs: calc(var(--w3m-border-radius-master) * 4); + --wui-border-radius-s: calc(var(--w3m-border-radius-master) * 5); + --wui-border-radius-m: calc(var(--w3m-border-radius-master) * 7); + --wui-border-radius-l: calc(var(--w3m-border-radius-master) * 9); + --wui-border-radius-3xl: calc(var(--w3m-border-radius-master) * 20); + + --wui-font-weight-light: 400; + --wui-font-weight-regular: 500; + --wui-font-weight-medium: 600; + --wui-font-weight-bold: 700; + + --wui-letter-spacing-2xl: -1.6px; + --wui-letter-spacing-medium-title: -0.96px; + --wui-letter-spacing-large: -0.8px; + --wui-letter-spacing-medium: -0.72px; + --wui-letter-spacing-paragraph: -0.64px; + --wui-letter-spacing-small: -0.56px; + --wui-letter-spacing-tiny: -0.48px; + --wui-letter-spacing-micro: -0.2px; + --wui-letter-spacing-mini: -0.16px; + + --wui-spacing-0: 0px; + --wui-spacing-4xs: 2px; + --wui-spacing-3xs: 4px; + --wui-spacing-xxs: 6px; + --wui-spacing-2xs: 7px; + --wui-spacing-xs: 8px; + --wui-spacing-1xs: 10px; + --wui-spacing-s: 12px; + --wui-spacing-m: 14px; + --wui-spacing-l: 16px; + --wui-spacing-2l: 18px; + --wui-spacing-xl: 20px; + --wui-spacing-xxl: 24px; + --wui-spacing-2xl: 32px; + --wui-spacing-3xl: 40px; + --wui-spacing-4xl: 90px; + + --wui-icon-box-size-xxs: 14px; + --wui-icon-box-size-xs: 20px; + --wui-icon-box-size-sm: 24px; + --wui-icon-box-size-md: 32px; + --wui-icon-box-size-lg: 40px; + --wui-icon-box-size-xl: 64px; + + --wui-icon-size-inherit: inherit; + --wui-icon-size-xxs: 10px; + --wui-icon-size-xs: 12px; + --wui-icon-size-sm: 14px; + --wui-icon-size-md: 16px; + --wui-icon-size-mdl: 18px; + --wui-icon-size-lg: 20px; + --wui-icon-size-xl: 24px; + + --wui-wallet-image-size-inherit: inherit; + --wui-wallet-image-size-sm: 40px; + --wui-wallet-image-size-md: 56px; + --wui-wallet-image-size-lg: 80px; + + --wui-visual-size-size-inherit: inherit; + --wui-visual-size-sm: 40px; + --wui-visual-size-md: 55px; + --wui-visual-size-lg: 80px; + + --wui-box-size-md: 100px; + --wui-box-size-lg: 120px; + + --wui-ease-out-power-2: cubic-bezier(0, 0, 0.22, 1); + --wui-ease-out-power-1: cubic-bezier(0, 0, 0.55, 1); + + --wui-ease-in-power-3: cubic-bezier(0.66, 0, 1, 1); + --wui-ease-in-power-2: cubic-bezier(0.45, 0, 1, 1); + --wui-ease-in-power-1: cubic-bezier(0.3, 0, 1, 1); + + --wui-ease-inout-power-1: cubic-bezier(0.45, 0, 0.55, 1); + + --wui-duration-lg: 200ms; + --wui-duration-md: 125ms; + --wui-duration-sm: 75ms; + + --wui-path-network-sm: path( + 'M15.4 2.1a5.21 5.21 0 0 1 5.2 0l11.61 6.7a5.21 5.21 0 0 1 2.61 4.52v13.4c0 1.87-1 3.59-2.6 4.52l-11.61 6.7c-1.62.93-3.6.93-5.22 0l-11.6-6.7a5.21 5.21 0 0 1-2.61-4.51v-13.4c0-1.87 1-3.6 2.6-4.52L15.4 2.1Z' + ); + + --wui-path-network-md: path( + 'M43.4605 10.7248L28.0485 1.61089C25.5438 0.129705 22.4562 0.129705 19.9515 1.61088L4.53951 10.7248C2.03626 12.2051 0.5 14.9365 0.5 17.886V36.1139C0.5 39.0635 2.03626 41.7949 4.53951 43.2752L19.9515 52.3891C22.4562 53.8703 25.5438 53.8703 28.0485 52.3891L43.4605 43.2752C45.9637 41.7949 47.5 39.0635 47.5 36.114V17.8861C47.5 14.9365 45.9637 12.2051 43.4605 10.7248Z' + ); + + --wui-path-network-lg: path( + 'M78.3244 18.926L50.1808 2.45078C45.7376 -0.150261 40.2624 -0.150262 35.8192 2.45078L7.6756 18.926C3.23322 21.5266 0.5 26.3301 0.5 31.5248V64.4752C0.5 69.6699 3.23322 74.4734 7.6756 77.074L35.8192 93.5492C40.2624 96.1503 45.7376 96.1503 50.1808 93.5492L78.3244 77.074C82.7668 74.4734 85.5 69.6699 85.5 64.4752V31.5248C85.5 26.3301 82.7668 21.5266 78.3244 18.926Z' + ); + + --wui-width-network-sm: 36px; + --wui-width-network-md: 48px; + --wui-width-network-lg: 86px; + + --wui-height-network-sm: 40px; + --wui-height-network-md: 54px; + --wui-height-network-lg: 96px; + + --wui-icon-size-network-xs: 12px; + --wui-icon-size-network-sm: 16px; + --wui-icon-size-network-md: 24px; + --wui-icon-size-network-lg: 42px; + + --wui-color-inherit: inherit; + + --wui-color-inverse-100: #fff; + --wui-color-inverse-000: #000; + + --wui-cover: rgba(20, 20, 20, 0.8); + + --wui-color-modal-bg: var(--wui-color-modal-bg-base); + + --wui-color-blue-100: var(--wui-color-blue-base-100); + + --wui-color-accent-100: var(--wui-color-accent-base-100); + --wui-color-accent-090: var(--wui-color-accent-base-090); + --wui-color-accent-080: var(--wui-color-accent-base-080); + + --wui-accent-glass-090: var(--wui-accent-glass-base-090); + --wui-accent-glass-080: var(--wui-accent-glass-base-080); + --wui-accent-glass-020: var(--wui-accent-glass-base-020); + --wui-accent-glass-015: var(--wui-accent-glass-base-015); + --wui-accent-glass-010: var(--wui-accent-glass-base-010); + --wui-accent-glass-005: var(--wui-accent-glass-base-005); + --wui-accent-glass-002: var(--wui-accent-glass-base-002); + + --wui-color-fg-100: var(--wui-color-fg-base-100); + --wui-color-fg-125: var(--wui-color-fg-base-125); + --wui-color-fg-150: var(--wui-color-fg-base-150); + --wui-color-fg-175: var(--wui-color-fg-base-175); + --wui-color-fg-200: var(--wui-color-fg-base-200); + --wui-color-fg-225: var(--wui-color-fg-base-225); + --wui-color-fg-250: var(--wui-color-fg-base-250); + --wui-color-fg-275: var(--wui-color-fg-base-275); + --wui-color-fg-300: var(--wui-color-fg-base-300); + + --wui-color-bg-100: var(--wui-color-bg-base-100); + --wui-color-bg-125: var(--wui-color-bg-base-125); + --wui-color-bg-150: var(--wui-color-bg-base-150); + --wui-color-bg-175: var(--wui-color-bg-base-175); + --wui-color-bg-200: var(--wui-color-bg-base-200); + --wui-color-bg-225: var(--wui-color-bg-base-225); + --wui-color-bg-250: var(--wui-color-bg-base-250); + --wui-color-bg-275: var(--wui-color-bg-base-275); + --wui-color-bg-300: var(--wui-color-bg-base-300); + + --wui-color-success-100: var(--wui-color-success-base-100); + --wui-color-error-100: var(--wui-color-error-base-100); + + --wui-icon-box-bg-error-100: var(--wui-icon-box-bg-error-base-100); + --wui-icon-box-bg-blue-100: var(--wui-icon-box-bg-blue-base-100); + --wui-icon-box-bg-success-100: var(--wui-icon-box-bg-success-base-100); + --wui-icon-box-bg-inverse-100: var(--wui-icon-box-bg-inverse-base-100); + + --wui-all-wallets-bg-100: var(--wui-all-wallets-bg-base-100); + + --wui-avatar-border: var(--wui-avatar-border-base); + + --wui-thumbnail-border: var(--wui-thumbnail-border-base); + + --wui-box-shadow-blue: rgba(71, 161, 255, 0.16); + } + + @supports (background: color-mix(in srgb, white 50%, black)) { + :root { + --wui-color-modal-bg: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-modal-bg-base) + ); + + --wui-box-shadow-blue: color-mix(in srgb, var(--wui-color-accent-100) 16%, transparent); + + --wui-color-accent-090: color-mix( + in srgb, + var(--wui-color-accent-base-100) 90%, + var(--w3m-default) + ); + --wui-color-accent-080: color-mix( + in srgb, + var(--wui-color-accent-base-100) 80%, + var(--w3m-default) + ); + + --wui-color-accent-090: color-mix( + in srgb, + var(--wui-color-accent-base-100) 90%, + transparent + ); + --wui-color-accent-080: color-mix( + in srgb, + var(--wui-color-accent-base-100) 80%, + transparent + ); + + --wui-accent-glass-090: color-mix( + in srgb, + var(--wui-color-accent-base-100) 90%, + transparent + ); + --wui-accent-glass-080: color-mix( + in srgb, + var(--wui-color-accent-base-100) 80%, + transparent + ); + --wui-accent-glass-020: color-mix( + in srgb, + var(--wui-color-accent-base-100) 20%, + transparent + ); + --wui-accent-glass-015: color-mix( + in srgb, + var(--wui-color-accent-base-100) 15%, + transparent + ); + --wui-accent-glass-010: color-mix( + in srgb, + var(--wui-color-accent-base-100) 10%, + transparent + ); + --wui-accent-glass-005: color-mix( + in srgb, + var(--wui-color-accent-base-100) 5%, + transparent + ); + --wui-color-accent-002: color-mix( + in srgb, + var(--wui-color-accent-base-100) 2%, + transparent + ); + + --wui-color-fg-100: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-fg-base-100) + ); + --wui-color-fg-125: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-fg-base-125) + ); + --wui-color-fg-150: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-fg-base-150) + ); + --wui-color-fg-175: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-fg-base-175) + ); + --wui-color-fg-200: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-fg-base-200) + ); + --wui-color-fg-225: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-fg-base-225) + ); + --wui-color-fg-250: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-fg-base-250) + ); + --wui-color-fg-275: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-fg-base-275) + ); + --wui-color-fg-300: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-fg-base-300) + ); + + --wui-color-bg-100: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-bg-base-100) + ); + --wui-color-bg-125: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-bg-base-125) + ); + --wui-color-bg-150: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-bg-base-150) + ); + --wui-color-bg-175: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-bg-base-175) + ); + --wui-color-bg-200: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-bg-base-200) + ); + --wui-color-bg-225: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-bg-base-225) + ); + --wui-color-bg-250: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-bg-base-250) + ); + --wui-color-bg-275: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-bg-base-275) + ); + --wui-color-bg-300: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-bg-base-300) + ); + + --wui-color-success-100: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-success-base-100) + ); + --wui-color-error-100: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-color-error-base-100) + ); + + --wui-icon-box-bg-error-100: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-icon-box-bg-error-base-100) + ); + --wui-icon-box-bg-accent-100: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-icon-box-bg-blue-base-100) + ); + --wui-icon-box-bg-success-100: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-icon-box-bg-success-base-100) + ); + --wui-icon-box-bg-inverse-100: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-icon-box-bg-inverse-base-100) + ); + + --wui-all-wallets-bg-100: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-all-wallets-bg-base-100) + ); + + --wui-avatar-border: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-avatar-border-base) + ); + + --wui-thumbnail-border: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--wui-thumbnail-border-base) + ); + } + } + `,light:Q` + :root { + --w3m-color-mix: ${Kr((t==null?void 0:t["--w3m-color-mix"])||"#fff")}; + --w3m-accent: ${Kr((t==null?void 0:t["--w3m-accent"])||"#47a1ff")}; + --w3m-default: #fff; + + --wui-color-modal-bg-base: #191a1a; + + --wui-color-blue-base-100: #47a1ff; + + --wui-color-accent-base-100: var(--w3m-accent); + --wui-color-accent-base-090: #59aaff; + --wui-color-accent-base-080: #6cb4ff; + + --wui-accent-glass-base-090: rgba(71, 161, 255, 0.9); + --wui-accent-glass-base-080: rgba(71, 161, 255, 0.8); + --wui-accent-glass-base-020: rgba(71, 161, 255, 0.2); + --wui-accent-glass-base-015: rgba(71, 161, 255, 0.15); + --wui-accent-glass-base-010: rgba(71, 161, 255, 0.1); + --wui-accent-glass-base-005: rgba(71, 161, 255, 0.05); + --wui-accent-glass-base-002: rgba(71, 161, 255, 0.02); + + --wui-color-fg-base-100: #e4e7e7; + --wui-color-fg-base-125: #d0d5d5; + --wui-color-fg-base-150: #a8b1b1; + --wui-color-fg-base-175: #a8b0b0; + --wui-color-fg-base-200: #949e9e; + --wui-color-fg-base-225: #868f8f; + --wui-color-fg-base-250: #788080; + --wui-color-fg-base-275: #788181; + --wui-color-fg-base-300: #6e7777; + + --wui-color-bg-base-100: #141414; + --wui-color-bg-base-125: #191a1a; + --wui-color-bg-base-150: #1e1f1f; + --wui-color-bg-base-175: #222525; + --wui-color-bg-base-200: #272a2a; + --wui-color-bg-base-225: #2c3030; + --wui-color-bg-base-250: #313535; + --wui-color-bg-base-275: #363b3b; + --wui-color-bg-base-300: #3b4040; + + --wui-color-success-base-100: #26d962; + --wui-color-error-base-100: #f25a67; + + --wui-success-glass-001: rgba(38, 217, 98, 0.01); + --wui-success-glass-002: rgba(38, 217, 98, 0.02); + --wui-success-glass-005: rgba(38, 217, 98, 0.05); + --wui-success-glass-010: rgba(38, 217, 98, 0.1); + --wui-success-glass-015: rgba(38, 217, 98, 0.15); + --wui-success-glass-020: rgba(38, 217, 98, 0.2); + --wui-success-glass-025: rgba(38, 217, 98, 0.25); + --wui-success-glass-030: rgba(38, 217, 98, 0.3); + --wui-success-glass-060: rgba(38, 217, 98, 0.6); + --wui-success-glass-080: rgba(38, 217, 98, 0.8); + + --wui-error-glass-001: rgba(242, 90, 103, 0.01); + --wui-error-glass-002: rgba(242, 90, 103, 0.02); + --wui-error-glass-005: rgba(242, 90, 103, 0.05); + --wui-error-glass-010: rgba(242, 90, 103, 0.1); + --wui-error-glass-015: rgba(242, 90, 103, 0.15); + --wui-error-glass-020: rgba(242, 90, 103, 0.2); + --wui-error-glass-025: rgba(242, 90, 103, 0.25); + --wui-error-glass-030: rgba(242, 90, 103, 0.3); + --wui-error-glass-060: rgba(242, 90, 103, 0.6); + --wui-error-glass-080: rgba(242, 90, 103, 0.8); + + --wui-icon-box-bg-error-base-100: #3c2426; + --wui-icon-box-bg-blue-base-100: #20303f; + --wui-icon-box-bg-success-base-100: #1f3a28; + --wui-icon-box-bg-inverse-base-100: #243240; + + --wui-all-wallets-bg-base-100: #222b35; + + --wui-avatar-border-base: #252525; + + --wui-thumbnail-border-base: #252525; + + --wui-gray-glass-001: rgba(255, 255, 255, 0.01); + --wui-gray-glass-002: rgba(255, 255, 255, 0.02); + --wui-gray-glass-005: rgba(255, 255, 255, 0.05); + --wui-gray-glass-010: rgba(255, 255, 255, 0.1); + --wui-gray-glass-015: rgba(255, 255, 255, 0.15); + --wui-gray-glass-020: rgba(255, 255, 255, 0.2); + --wui-gray-glass-025: rgba(255, 255, 255, 0.25); + --wui-gray-glass-030: rgba(255, 255, 255, 0.3); + --wui-gray-glass-060: rgba(255, 255, 255, 0.6); + --wui-gray-glass-080: rgba(255, 255, 255, 0.8); + --wui-gray-glass-090: rgba(255, 255, 255, 0.9); + } + `,dark:Q` + :root { + --w3m-color-mix: ${Kr((t==null?void 0:t["--w3m-color-mix"])||"#000")}; + --w3m-accent: ${Kr((t==null?void 0:t["--w3m-accent"])||"#3396ff")}; + --w3m-default: #000; + + --wui-color-modal-bg-base: #fff; + + --wui-color-blue-base-100: #3396ff; + + --wui-color-accent-base-100: var(--w3m-accent); + --wui-color-accent-base-090: #2d7dd2; + --wui-color-accent-base-080: #2978cc; + + --wui-accent-glass-base-090: rgba(51, 150, 255, 0.9); + --wui-accent-glass-base-080: rgba(51, 150, 255, 0.8); + --wui-accent-glass-base-020: rgba(51, 150, 255, 0.2); + --wui-accent-glass-base-015: rgba(51, 150, 255, 0.15); + --wui-accent-glass-base-010: rgba(51, 150, 255, 0.1); + --wui-accent-glass-base-005: rgba(51, 150, 255, 0.05); + --wui-accent-glass-base-002: rgba(51, 150, 255, 0.02); + + --wui-color-fg-base-100: #141414; + --wui-color-fg-base-125: #2d3131; + --wui-color-fg-base-150: #474d4d; + --wui-color-fg-base-175: #636d6d; + --wui-color-fg-base-200: #798686; + --wui-color-fg-base-225: #828f8f; + --wui-color-fg-base-250: #8b9797; + --wui-color-fg-base-275: #95a0a0; + --wui-color-fg-base-300: #9ea9a9; + + --wui-color-bg-base-100: #ffffff; + --wui-color-bg-base-125: #f5fafa; + --wui-color-bg-base-150: #f3f8f8; + --wui-color-bg-base-175: #eef4f4; + --wui-color-bg-base-200: #eaf1f1; + --wui-color-bg-base-225: #e5eded; + --wui-color-bg-base-250: #e1e9e9; + --wui-color-bg-base-275: #dce7e7; + --wui-color-bg-base-300: #d8e3e3; + + --wui-color-success-base-100: #26b562; + --wui-color-error-base-100: #f05142; + + --wui-success-glass-001: rgba(38, 181, 98, 0.01); + --wui-success-glass-002: rgba(38, 181, 98, 0.02); + --wui-success-glass-005: rgba(38, 181, 98, 0.05); + --wui-success-glass-010: rgba(38, 181, 98, 0.1); + --wui-success-glass-015: rgba(38, 181, 98, 0.15); + --wui-success-glass-020: rgba(38, 181, 98, 0.2); + --wui-success-glass-025: rgba(38, 181, 98, 0.25); + --wui-success-glass-030: rgba(38, 181, 98, 0.3); + --wui-success-glass-060: rgba(38, 181, 98, 0.6); + --wui-success-glass-080: rgba(38, 181, 98, 0.8); + + --wui-error-glass-001: rgba(240, 81, 66, 0.01); + --wui-error-glass-002: rgba(240, 81, 66, 0.02); + --wui-error-glass-005: rgba(240, 81, 66, 0.05); + --wui-error-glass-010: rgba(240, 81, 66, 0.1); + --wui-error-glass-015: rgba(240, 81, 66, 0.15); + --wui-error-glass-020: rgba(240, 81, 66, 0.2); + --wui-error-glass-025: rgba(240, 81, 66, 0.25); + --wui-error-glass-030: rgba(240, 81, 66, 0.3); + --wui-error-glass-060: rgba(240, 81, 66, 0.6); + --wui-error-glass-080: rgba(240, 81, 66, 0.8); + + --wui-icon-box-bg-error-base-100: #f4dfdd; + --wui-icon-box-bg-blue-base-100: #d9ecfb; + --wui-icon-box-bg-success-base-100: #daf0e4; + --wui-icon-box-bg-inverse-base-100: #dcecfc; + + --wui-all-wallets-bg-base-100: #e8f1fa; + + --wui-avatar-border-base: #f3f4f4; + + --wui-thumbnail-border-base: #eaefef; + + --wui-gray-glass-001: rgba(0, 0, 0, 0.01); + --wui-gray-glass-002: rgba(0, 0, 0, 0.02); + --wui-gray-glass-005: rgba(0, 0, 0, 0.05); + --wui-gray-glass-010: rgba(0, 0, 0, 0.1); + --wui-gray-glass-015: rgba(0, 0, 0, 0.15); + --wui-gray-glass-020: rgba(0, 0, 0, 0.2); + --wui-gray-glass-025: rgba(0, 0, 0, 0.25); + --wui-gray-glass-030: rgba(0, 0, 0, 0.3); + --wui-gray-glass-060: rgba(0, 0, 0, 0.6); + --wui-gray-glass-080: rgba(0, 0, 0, 0.8); + --wui-gray-glass-090: rgba(0, 0, 0, 0.9); + } + `}}const fe=Q` + *, + *::after, + *::before, + :host { + 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; + font-family: var(--wui-font-family); + backface-visibility: hidden; + } +`,Me=Q` + button, + a { + cursor: pointer; + display: flex; + justify-content: center; + align-items: center; + position: relative; + transition: + background-color var(--wui-ease-inout-power-1) var(--wui-duration-md), + color var(--wui-ease-inout-power-1) var(--wui-duration-md), + box-shadow var(--wui-ease-inout-power-1) var(--wui-duration-md); + will-change: background-color, color; + outline: none; + border: 1px solid transparent; + column-gap: var(--wui-spacing-3xs); + background-color: transparent; + text-decoration: none; + } + + @media (hover: hover) and (pointer: fine) { + button:hover:enabled { + background-color: var(--wui-gray-glass-005); + } + + button:active:enabled { + background-color: var(--wui-gray-glass-010); + } + + button[data-variant='fill']:hover:enabled { + background-color: var(--wui-color-accent-090); + } + + button[data-variant='accentBg']:hover:enabled { + background: var(--wui-accent-glass-015); + } + + button[data-variant='accentBg']:active:enabled { + background: var(--wui-accent-glass-020); + } + } + + button:disabled { + cursor: not-allowed; + background-color: var(--wui-gray-glass-005); + } + + button[data-variant='shade']:disabled, + button[data-variant='accent']:disabled, + button[data-variant='accentBg']:disabled { + background-color: var(--wui-gray-glass-010); + color: var(--wui-gray-glass-015); + filter: grayscale(1); + } + + button:disabled > wui-wallet-image, + button:disabled > wui-all-wallets-image, + button:disabled > wui-network-image, + button:disabled > wui-image, + button:disabled > wui-icon-box, + button:disabled > wui-transaction-visual, + button:disabled > wui-logo { + filter: grayscale(1); + } + + button:focus-visible, + a:focus-visible { + border: 1px solid var(--wui-color-accent-100); + background-color: var(--wui-gray-glass-005); + -webkit-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + -moz-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + } + + button[data-variant='fill']:focus-visible { + background-color: var(--wui-color-accent-090); + } + + button[data-variant='fill'] { + color: var(--wui-color-inverse-100); + background-color: var(--wui-color-accent-100); + } + + button[data-variant='fill']:disabled { + color: var(--wui-gray-glass-015); + background-color: var(--wui-gray-glass-015); + } + + button[data-variant='fill']:disabled > wui-icon { + color: var(--wui-gray-glass-015); + } + + button[data-variant='shade'] { + color: var(--wui-color-fg-200); + } + + button[data-variant='accent'], + button[data-variant='accentBg'] { + color: var(--wui-color-accent-100); + } + + button[data-variant='accentBg'] { + background: var(--wui-accent-glass-010); + border: 1px solid var(--wui-accent-glass-010); + } + + button[data-variant='fullWidth'] { + width: 100%; + border-radius: var(--wui-border-radius-xs); + height: 56px; + border: none; + background-color: var(--wui-gray-glass-002); + color: var(--wui-color-fg-200); + gap: var(--wui-spacing-xs); + } + + button:active:enabled { + background-color: var(--wui-gray-glass-010); + } + + button[data-variant='fill']:active:enabled { + background-color: var(--wui-color-accent-080); + border: 1px solid var(--wui-gray-glass-010); + } + + input { + border: none; + outline: none; + appearance: none; + } +`,C2=Q` + .wui-color-inherit { + color: var(--wui-color-inherit); + } + + .wui-color-accent-100 { + color: var(--wui-color-accent-100); + } + + .wui-color-error-100 { + color: var(--wui-color-error-100); + } + + .wui-color-success-100 { + color: var(--wui-color-success-100); + } + + .wui-color-inverse-100 { + color: var(--wui-color-inverse-100); + } + + .wui-color-inverse-000 { + color: var(--wui-color-inverse-000); + } + + .wui-color-fg-100 { + color: var(--wui-color-fg-100); + } + + .wui-color-fg-200 { + color: var(--wui-color-fg-200); + } + + .wui-color-fg-300 { + color: var(--wui-color-fg-300); + } + + .wui-bg-color-inherit { + background-color: var(--wui-color-inherit); + } + + .wui-bg-color-blue-100 { + background-color: var(--wui-color-accent-100); + } + + .wui-bg-color-error-100 { + background-color: var(--wui-color-error-100); + } + + .wui-bg-color-success-100 { + background-color: var(--wui-color-success-100); + } + + .wui-bg-color-inverse-100 { + background-color: var(--wui-color-inverse-100); + } + + .wui-bg-color-inverse-000 { + background-color: var(--wui-color-inverse-000); + } + + .wui-bg-color-fg-100 { + background-color: var(--wui-color-fg-100); + } + + .wui-bg-color-fg-200 { + background-color: var(--wui-color-fg-200); + } + + .wui-bg-color-fg-300 { + background-color: var(--wui-color-fg-300); + } +`;function pR(t,e){const{kind:n,elements:r}=e;return{kind:n,elements:r,finisher(i){customElements.get(t)||customElements.define(t,i)}}}function hR(t,e){return customElements.get(t)||customElements.define(t,e),e}function G(t){return function(n){return typeof n=="function"?hR(t,n):pR(t,n)}}const mR=Q` + :host { + display: block; + border-radius: clamp(0px, var(--wui-border-radius-l), 44px); + box-shadow: 0 0 0 1px var(--wui-gray-glass-005); + background-color: var(--wui-color-modal-bg); + overflow: hidden; + } +`;var gR=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let tp=class extends q{render(){return v``}};tp.styles=[fe,mR];tp=gR([G("wui-card")],tp);/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const wR={attribute:!0,type:String,converter:Q0,reflect:!1,hasChanged:y2},yR=(t=wR,e,n)=>{const{kind:r,metadata:i}=n;let o=globalThis.litPropertyMetadata.get(i);if(o===void 0&&globalThis.litPropertyMetadata.set(i,o=new Map),o.set(n.name,t),r==="accessor"){const{name:s}=n;return{set(a){const l=e.get.call(this);e.set.call(this,a),this.requestUpdate(s,l,t)},init(a){return a!==void 0&&this.C(s,void 0,t),a}}}if(r==="setter"){const{name:s}=n;return function(a){const l=this[s];e.call(this,a),this.requestUpdate(s,l,t)}}throw Error("Unsupported decorator location: "+r)};function T(t){return(e,n)=>typeof n=="object"?yR(t,e,n):((r,i,o)=>{const s=i.hasOwnProperty(o);return i.constructor.createProperty(o,s?{...r,wrapped:!0}:r),s?Object.getOwnPropertyDescriptor(i,o):void 0})(t,e,n)}/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */function K(t){return T({...t,state:!0,attribute:!1})}const vR=Q` + :host { + display: flex; + aspect-ratio: 1 / 1; + color: var(--local-color); + width: var(--local-width); + } + + svg { + width: inherit; + height: inherit; + object-fit: contain; + object-position: center; + } +`,bR=ee` + +`,xR=ee` + `,CR=ee` + + + + + + + + + +`,_R=ee` + + + + + + + + + + + + + +`,ER=ee` + +`,SR=ee` + +`,TR=ee` + +`,AR=ee` + +`,kR=ee` + + +`,RR=ee` + `,$R=ee` + +`,PR=ee` + +`,IR=ee` + +`,OR=ee` + +`,NR=ee` + + + + + + + + + + + + + + + + + + + + + +`,MR=ee` + +`,LR=ee` + +`,DR=ee` + +`,BR=ee` + +`,jR=ee` + `,UR=ee` + `,FR=ee` + +`,zR=ee` + + +`,WR=ee` + +`,HR=ee` + + + + + + + + + + +`,VR=ee` + +`,ZR=ee` + +`,GR=ee` + +`,qR=ee` + + + + + + + + + + + + + + + +`,KR=ee` + +`,YR=ee` + + + + + + + + + + + + + +`,QR=ee` + + + + + + + + + + + + + + + + +`,JR=ee` + + +`,XR=ee` + + +`,e$=ee` + +`,t$=ee` + + +`,n$=ee` + + +`,r$=ee` + +`,i$=ee` + +`,o$=ee` + + + + + + +`,s$=ee` + +`,a$=ee` + +`,l$=ee` + +`,c$=ee` + + `,u$=ee` + +`,d$=ee` + +`,f$=ee` + + + +`,p$=ee` + +`,h$=ee` + +`,m$=ee` + + + + + + + + + + + `,g$=ee` + + + + + + + + + + + + + +`,w$=ee` + + + + + + + + + + +`,y$=ee` + +`,v$=ee` + +`,b$=ee` + +`,x$=ee` + + + + +`,C$=ee` + +`,_$=ee` + + +`,E$=ee` + + +`,S$=ee` + `,T$=ee` + `,A$=ee` + `,k$=ee` + `,R$=ee` + + + + `,$$=ee` + +`;var ih=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};const P$={add:UR,allWallets:bR,arrowBottomCircle:xR,appStore:CR,apple:_R,arrowBottom:ER,arrowLeft:SR,arrowRight:TR,arrowTop:AR,bank:T$,browser:kR,card:A$,checkmark:RR,chevronBottom:$R,checkmarkBold:$$,chevronLeft:PR,chevronRight:IR,chevronTop:OR,chromeStore:NR,clock:MR,close:LR,compass:BR,coinPlaceholder:DR,copy:jR,cursor:FR,cursorTransparent:R$,desktop:zR,disconnect:WR,discord:HR,etherscan:VR,extension:ZR,externalLink:GR,facebook:qR,filters:KR,github:YR,google:QR,helpCircle:JR,infoCircle:XR,mail:e$,mobile:t$,networkPlaceholder:n$,nftPlaceholder:r$,off:i$,playStore:o$,plus:k$,qrCode:s$,recycleHorizontal:S$,refresh:a$,search:l$,send:c$,swapHorizontal:u$,swapHorizontalMedium:f$,swapHorizontalBold:d$,swapVertical:h$,swapHorizontalRoundedBold:p$,telegram:m$,twitch:g$,twitter:w$,twitterIcon:y$,verify:v$,verifyFilled:b$,wallet:C$,walletConnect:_$,walletPlaceholder:x$,warningCircle:E$};let na=class extends q{constructor(){super(...arguments),this.size="md",this.name="copy",this.color="fg-300"}render(){return this.style.cssText=` + --local-color: ${`var(--wui-color-${this.color});`} + --local-width: ${`var(--wui-icon-size-${this.size});`} + `,v`${P$[this.name]}`}};na.styles=[fe,C2,vR];ih([T()],na.prototype,"size",void 0);ih([T()],na.prototype,"name",void 0);ih([T()],na.prototype,"color",void 0);na=ih([G("wui-icon")],na);const I$=Q` + :host { + display: block; + width: var(--local-width); + height: var(--local-height); + } + + img { + display: block; + width: 100%; + height: 100%; + object-fit: cover; + object-position: center center; + border-radius: inherit; + } +`;var oh=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let ra=class extends q{constructor(){super(...arguments),this.src="./path/to/image.jpg",this.alt="Image",this.size=void 0}render(){return this.style.cssText=` + --local-width: ${this.size?`var(--wui-icon-size-${this.size});`:"100%"}; + --local-height: ${this.size?`var(--wui-icon-size-${this.size});`:"100%"}; + `,v`${this.alt}`}};ra.styles=[fe,C2,I$];oh([T()],ra.prototype,"src",void 0);oh([T()],ra.prototype,"alt",void 0);oh([T()],ra.prototype,"size",void 0);ra=oh([G("wui-image")],ra);const O$=Q` + :host { + display: block; + width: var(--wui-box-size-lg); + height: var(--wui-box-size-lg); + } + + svg { + width: var(--wui-box-size-lg); + height: var(--wui-box-size-lg); + fill: none; + stroke: transparent; + stroke-linecap: round; + } + + use { + stroke: var(--wui-color-accent-100); + stroke-width: 2px; + stroke-dasharray: 54, 118; + stroke-dashoffset: 172; + animation: dash 1s linear infinite; + } + + @keyframes dash { + to { + stroke-dashoffset: 0px; + } + } +`;var N$=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let np=class extends q{render(){return v` + + + + + `}};np.styles=[fe,O$];np=N$([G("wui-loading-hexagon")],np);const M$=Q` + :host { + display: flex; + } + + :host([data-size='sm']) > svg { + width: 12px; + height: 12px; + } + + :host([data-size='md']) > svg { + width: 16px; + height: 16px; + } + + :host([data-size='lg']) > svg { + width: 24px; + height: 24px; + } + + :host([data-size='xl']) > svg { + width: 32px; + height: 32px; + } + + svg { + animation: rotate 2s linear infinite; + } + + circle { + fill: none; + stroke: var(--local-color); + stroke-width: 4px; + stroke-dasharray: 1, 124; + stroke-dashoffset: 0; + stroke-linecap: round; + animation: dash 1.5s ease-in-out infinite; + } + + :host([data-size='md']) > svg > circle { + stroke-width: 6px; + } + + :host([data-size='sm']) > svg > circle { + stroke-width: 8px; + } + + @keyframes rotate { + 100% { + transform: rotate(360deg); + } + } + + @keyframes dash { + 0% { + stroke-dasharray: 1, 124; + stroke-dashoffset: 0; + } + + 50% { + stroke-dasharray: 90, 124; + stroke-dashoffset: -35; + } + + 100% { + stroke-dashoffset: -125; + } + } +`;var _2=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let ec=class extends q{constructor(){super(...arguments),this.color="accent-100",this.size="lg"}render(){return this.style.cssText=`--local-color: var(--wui-color-${this.color});`,this.dataset.size=this.size,v` + + `}};ec.styles=[fe,M$];_2([T()],ec.prototype,"color",void 0);_2([T()],ec.prototype,"size",void 0);ec=_2([G("wui-loading-spinner")],ec);const L$=Q` + :host { + display: block; + width: var(--wui-box-size-md); + height: var(--wui-box-size-md); + } + + svg { + width: var(--wui-box-size-md); + height: var(--wui-box-size-md); + } + + rect { + fill: none; + stroke: var(--wui-color-accent-100); + stroke-width: 4px; + stroke-linecap: round; + animation: dash 1s linear infinite; + } + + @keyframes dash { + to { + stroke-dashoffset: 0px; + } + } +`;var x8=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let ud=class extends q{constructor(){super(...arguments),this.radius=36}render(){return this.svgLoaderTemplate()}svgLoaderTemplate(){const e=this.radius>50?50:this.radius,r=36-e,i=116+r,o=245+r,s=360+r*1.75;return v` + + + + `}};ud.styles=[fe,L$];x8([T({type:Number})],ud.prototype,"radius",void 0);ud=x8([G("wui-loading-thumbnail")],ud);const D$=Q` + :host { + display: block; + box-shadow: inset 0 0 0 1px var(--wui-gray-glass-005); + background: linear-gradient( + 120deg, + var(--wui-color-bg-200) 5%, + var(--wui-color-bg-200) 48%, + var(--wui-color-bg-300) 55%, + var(--wui-color-bg-300) 60%, + var(--wui-color-bg-300) calc(60% + 10px), + var(--wui-color-bg-200) calc(60% + 12px), + var(--wui-color-bg-200) 100% + ); + background-size: 250%; + animation: shimmer 3s linear infinite reverse; + } + + @keyframes shimmer { + from { + background-position: -250% 0; + } + to { + background-position: 250% 0; + } + } +`;var sh=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let ia=class extends q{constructor(){super(...arguments),this.width="",this.height="",this.borderRadius="m"}render(){return this.style.cssText=` + width: ${this.width}; + height: ${this.height}; + border-radius: ${`clamp(0px,var(--wui-border-radius-${this.borderRadius}), 40px)`}; + `,v``}};ia.styles=[D$];sh([T()],ia.prototype,"width",void 0);sh([T()],ia.prototype,"height",void 0);sh([T()],ia.prototype,"borderRadius",void 0);ia=sh([G("wui-shimmer")],ia);/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const C8={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},_8=t=>(...e)=>({_$litDirective$:t,values:e});let E8=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,n,r){this._$Ct=e,this._$AM=n,this._$Ci=r}_$AS(e,n){return this.update(e,n)}update(e,n){return this.render(...n)}};/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const B$=_8(class extends E8{constructor(t){var e;if(super(t),t.type!==C8.ATTRIBUTE||t.name!=="class"||((e=t.strings)==null?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){var r,i;if(this.it===void 0){this.it=new Set,t.strings!==void 0&&(this.st=new Set(t.strings.join(" ").split(/\s/).filter(o=>o!=="")));for(const o in e)e[o]&&!((r=this.st)!=null&&r.has(o))&&this.it.add(o);return this.render(e)}const n=t.element.classList;for(const o of this.it)o in e||(n.remove(o),this.it.delete(o));for(const o in e){const s=!!e[o];s===this.it.has(o)||(i=this.st)!=null&&i.has(o)||(s?(n.add(o),this.it.add(o)):(n.remove(o),this.it.delete(o)))}return Yl}}),j$=Q` + :host { + display: inline-flex !important; + } + + slot { + width: 100%; + display: inline-block; + font-style: normal; + font-family: var(--wui-font-family); + font-feature-settings: + 'tnum' on, + 'lnum' on, + 'case' on; + line-height: 130%; + font-weight: var(--wui-font-weight-regular); + overflow: inherit; + text-overflow: inherit; + text-align: var(--local-align); + color: var(--local-color); + } + + .wui-font-medium-400 { + font-size: var(--wui-font-size-medium); + font-weight: var(--wui-font-weight-light); + letter-spacing: var(--wui-letter-spacing-medium); + } + + .wui-font-medium-600 { + font-size: var(--wui-font-size-medium); + letter-spacing: var(--wui-letter-spacing-medium); + } + + .wui-font-medium-title-600 { + font-size: var(--wui-font-size-medium-title); + letter-spacing: var(--wui-letter-spacing-medium-title); + } + + .wui-font-mini-700 { + font-size: var(--wui-font-size-mini); + letter-spacing: var(--wui-letter-spacing-mini); + text-transform: uppercase; + } + + .wui-font-large-500, + .wui-font-large-600, + .wui-font-large-700 { + font-size: var(--wui-font-size-large); + letter-spacing: var(--wui-letter-spacing-large); + } + + .wui-font-2xl-500, + .wui-font-2xl-600, + .wui-font-2xl-700 { + font-size: var(--wui-font-size-2xl); + letter-spacing: var(--wui-letter-spacing-2xl); + } + + .wui-font-paragraph-400, + .wui-font-paragraph-500, + .wui-font-paragraph-600, + .wui-font-paragraph-700 { + font-size: var(--wui-font-size-paragraph); + letter-spacing: var(--wui-letter-spacing-paragraph); + } + + .wui-font-small-400, + .wui-font-small-500, + .wui-font-small-600 { + font-size: var(--wui-font-size-small); + letter-spacing: var(--wui-letter-spacing-small); + } + + .wui-font-tiny-400, + .wui-font-tiny-500, + .wui-font-tiny-600 { + font-size: var(--wui-font-size-tiny); + letter-spacing: var(--wui-letter-spacing-tiny); + } + + .wui-font-micro-700, + .wui-font-micro-600 { + font-size: var(--wui-font-size-micro); + letter-spacing: var(--wui-letter-spacing-micro); + text-transform: uppercase; + } + + .wui-font-tiny-400, + .wui-font-small-400, + .wui-font-paragraph-400 { + font-weight: var(--wui-font-weight-light); + } + + .wui-font-large-700, + .wui-font-paragraph-700, + .wui-font-micro-700, + .wui-font-mini-700 { + font-weight: var(--wui-font-weight-bold); + } + + .wui-font-medium-600, + .wui-font-medium-title-600, + .wui-font-large-600, + .wui-font-paragraph-600, + .wui-font-small-600, + .wui-font-tiny-600, + .wui-font-micro-600 { + font-weight: var(--wui-font-weight-medium); + } +`;var ah=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let oa=class extends q{constructor(){super(...arguments),this.variant="paragraph-500",this.color="fg-300",this.align="left"}render(){const e={[`wui-font-${this.variant}`]:!0,[`wui-color-${this.color}`]:!0};return this.style.cssText=` + --local-align: ${this.align}; + --local-color: var(--wui-color-${this.color}); + `,v``}};oa.styles=[fe,j$];ah([T()],oa.prototype,"variant",void 0);ah([T()],oa.prototype,"color",void 0);ah([T()],oa.prototype,"align",void 0);oa=ah([G("wui-text")],oa);const U$=ee` + + + + + + + + `,F$=ee` + + + + + + + + + + + + + + + + `,z$=ee` + + + + + + + + + + + + +`,W$=ee` + + + + + + + + + + + + + `,H$=ee` + + + + + + + + + + + + + + + `,V$=ee` + + + + + +`,Z$=ee` + + + + + +`,G$=ee` + + + + + + + + + + `,q$=ee` + + + + + + + + + + + + + + + +`,K$=ee` + + + + + + + + + + `,Y$=ee` + + + + + + + + +`,Q$=ee` + + + + + + + + + + + + + + + `,J$=ee` + + + + + + + + + + + + + + `,X$=ee` + + + + + + + + + +`,eP=ee` + + + + + + + + + + +`,tP=ee` + + + + + + + + + + +`,nP=ee` + + + + + + + + + + + + +`,rP=ee` + + + + + + + + + + + + +`,iP=ee` + + + + + + + + + +`,oP=ee` + + + + + + + + + + + + + + + + + + +`,sP=ee` + + + + + + + + + + + + + + + + +`,aP=Q` + :host { + display: block; + width: var(--local-size); + height: var(--local-size); + } + + :host svg { + width: 100%; + height: 100%; + } +`;var E2=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};const lP={browser:U$,dao:F$,defi:z$,defiAlt:W$,eth:H$,layers:V$,lock:Z$,login:G$,network:q$,nft:K$,noun:Y$,profile:Q$,system:J$,coinbase:X$,onrampCard:rP,moonpay:eP,stripe:tP,paypal:nP,google:iP,pencil:oP,lightbulb:sP};let tc=class extends q{constructor(){super(...arguments),this.name="browser",this.size="md"}render(){return this.style.cssText=` + --local-size: var(--wui-visual-size-${this.size}); + `,v`${lP[this.name]}`}};tc.styles=[fe,aP];E2([T()],tc.prototype,"name",void 0);E2([T()],tc.prototype,"size",void 0);tc=E2([G("wui-visual")],tc);/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const he=t=>t??Et,Ae={getSpacingStyles(t,e){if(Array.isArray(t))return t[e]?`var(--wui-spacing-${t[e]})`:void 0;if(typeof t=="string")return`var(--wui-spacing-${t})`},getFormattedDate(t){return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric"}).format(t)},getHostName(t){return new URL(t).hostname},getTruncateString({string:t,charsStart:e,charsEnd:n,truncate:r}){return t.length<=e+n?t:r==="end"?`${t.substring(0,e)}...`:r==="start"?`...${t.substring(t.length-n)}`:`${t.substring(0,Math.floor(e))}...${t.substring(t.length-Math.floor(n))}`},generateAvatarColors(t){const n=t.toLowerCase().replace(/^0x/iu,"").substring(0,6),r=this.hexToRgb(n),i=getComputedStyle(document.documentElement).getPropertyValue("--w3m-border-radius-master"),s=100-3*Number(i==null?void 0:i.replace("px","")),a=`${s}% ${s}% at 65% 40%`,l=[];for(let c=0;c<5;c+=1){const u=this.tintColor(r,.15*c);l.push(`rgb(${u[0]}, ${u[1]}, ${u[2]})`)}return` + --local-color-1: ${l[0]}; + --local-color-2: ${l[1]}; + --local-color-3: ${l[2]}; + --local-color-4: ${l[3]}; + --local-color-5: ${l[4]}; + --local-radial-circle: ${a} + `},hexToRgb(t){const e=parseInt(t,16),n=e>>16&255,r=e>>8&255,i=e&255;return[n,r,i]},tintColor(t,e){const[n,r,i]=t,o=Math.round(n+(255-n)*e),s=Math.round(r+(255-r)*e),a=Math.round(i+(255-i)*e);return[o,s,a]},isNumber(t){return{number:/^[0-9]+$/u}.number.test(t)},getColorTheme(t){return t||(typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":"dark")},splitBalance(t){const e=t.split(".");return e.length===2?[e[0],e[1]]:["0","00"]},roundNumber(t,e,n){return Math.abs(t)>=e?Number(t.toFixed(n)):t},formatNumberToLocalString(t,e=2){return t===void 0?"0.00":typeof t=="number"?t.toLocaleString("en-US",{maximumFractionDigits:e,minimumFractionDigits:e}):parseFloat(t).toLocaleString("en-US",{maximumFractionDigits:e,minimumFractionDigits:e})}},cP=Q` + :host { + display: flex; + width: inherit; + height: inherit; + } +`;var Kn=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let rn=class extends q{render(){return this.style.cssText=` + flex-direction: ${this.flexDirection}; + flex-wrap: ${this.flexWrap}; + flex-basis: ${this.flexBasis}; + flex-grow: ${this.flexGrow}; + flex-shrink: ${this.flexShrink}; + align-items: ${this.alignItems}; + justify-content: ${this.justifyContent}; + column-gap: ${this.columnGap&&`var(--wui-spacing-${this.columnGap})`}; + row-gap: ${this.rowGap&&`var(--wui-spacing-${this.rowGap})`}; + gap: ${this.gap&&`var(--wui-spacing-${this.gap})`}; + padding-top: ${this.padding&&Ae.getSpacingStyles(this.padding,0)}; + padding-right: ${this.padding&&Ae.getSpacingStyles(this.padding,1)}; + padding-bottom: ${this.padding&&Ae.getSpacingStyles(this.padding,2)}; + padding-left: ${this.padding&&Ae.getSpacingStyles(this.padding,3)}; + margin-top: ${this.margin&&Ae.getSpacingStyles(this.margin,0)}; + margin-right: ${this.margin&&Ae.getSpacingStyles(this.margin,1)}; + margin-bottom: ${this.margin&&Ae.getSpacingStyles(this.margin,2)}; + margin-left: ${this.margin&&Ae.getSpacingStyles(this.margin,3)}; + `,v``}};rn.styles=[fe,cP];Kn([T()],rn.prototype,"flexDirection",void 0);Kn([T()],rn.prototype,"flexWrap",void 0);Kn([T()],rn.prototype,"flexBasis",void 0);Kn([T()],rn.prototype,"flexGrow",void 0);Kn([T()],rn.prototype,"flexShrink",void 0);Kn([T()],rn.prototype,"alignItems",void 0);Kn([T()],rn.prototype,"justifyContent",void 0);Kn([T()],rn.prototype,"columnGap",void 0);Kn([T()],rn.prototype,"rowGap",void 0);Kn([T()],rn.prototype,"gap",void 0);Kn([T()],rn.prototype,"padding",void 0);Kn([T()],rn.prototype,"margin",void 0);rn=Kn([G("wui-flex")],rn);const uP=Q` + :host { + display: block; + width: var(--wui-icon-box-size-xl); + height: var(--wui-icon-box-size-xl); + border-radius: var(--wui-border-radius-3xl); + box-shadow: 0 0 0 8px var(--wui-gray-glass-005); + overflow: hidden; + position: relative; + } + + :host([data-variant='generated']) { + --mixed-local-color-1: var(--local-color-1); + --mixed-local-color-2: var(--local-color-2); + --mixed-local-color-3: var(--local-color-3); + --mixed-local-color-4: var(--local-color-4); + --mixed-local-color-5: var(--local-color-5); + } + + @supports (background: color-mix(in srgb, white 50%, black)) { + :host([data-variant='generated']) { + --mixed-local-color-1: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--local-color-1) + ); + --mixed-local-color-2: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--local-color-2) + ); + --mixed-local-color-3: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--local-color-3) + ); + --mixed-local-color-4: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--local-color-4) + ); + --mixed-local-color-5: color-mix( + in srgb, + var(--w3m-color-mix) var(--w3m-color-mix-strength), + var(--local-color-5) + ); + } + } + + :host([data-variant='generated']) { + box-shadow: 0 0 0 8px var(--wui-gray-glass-005); + background: radial-gradient( + var(--local-radial-circle), + #fff 0.52%, + var(--mixed-local-color-5) 31.25%, + var(--mixed-local-color-3) 51.56%, + var(--mixed-local-color-2) 65.63%, + var(--mixed-local-color-1) 82.29%, + var(--mixed-local-color-4) 100% + ); + } + + :host([data-variant='default']) { + box-shadow: 0 0 0 8px var(--wui-gray-glass-005); + background: radial-gradient( + 75.29% 75.29% at 64.96% 24.36%, + #fff 0.52%, + #f5ccfc 31.25%, + #dba4f5 51.56%, + #9a8ee8 65.63%, + #6493da 82.29%, + #6ebdea 100% + ); + } +`;var lh=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let sa=class extends q{constructor(){super(...arguments),this.imageSrc=void 0,this.alt=void 0,this.address=void 0}render(){return v`${this.visualTemplate()}`}visualTemplate(){if(this.imageSrc)return this.dataset.variant="image",v``;if(this.address){this.dataset.variant="generated";const e=Ae.generateAvatarColors(this.address);return this.style.cssText=e,null}return this.dataset.variant="default",null}};sa.styles=[fe,uP];lh([T()],sa.prototype,"imageSrc",void 0);lh([T()],sa.prototype,"alt",void 0);lh([T()],sa.prototype,"address",void 0);sa=lh([G("wui-avatar")],sa);const dP=Q` + :host { + display: inline-flex; + justify-content: center; + align-items: center; + position: relative; + overflow: hidden; + background-color: var(--wui-gray-glass-020); + border-radius: var(--local-border-radius); + border: var(--local-border); + box-sizing: content-box; + width: var(--local-size); + height: var(--local-size); + min-height: var(--local-size); + min-width: var(--local-size); + } + + @supports (background: color-mix(in srgb, white 50%, black)) { + :host { + background-color: color-mix(in srgb, var(--local-bg-value) var(--local-bg-mix), transparent); + } + } +`;var eo=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let hr=class extends q{constructor(){super(...arguments),this.size="md",this.backgroundColor="accent-100",this.iconColor="accent-100",this.background="transparent",this.border=!1,this.borderColor="wui-color-bg-125",this.icon="copy"}render(){const e=this.iconSize||this.size,n=this.size==="lg",r=this.size==="xl",i=n?"12%":"16%",o=n?"xxs":r?"s":"3xl",s=this.background==="gray",a=this.background==="opaque",l=this.backgroundColor==="accent-100"&&a||this.backgroundColor==="success-100"&&a||this.backgroundColor==="error-100"&&a||this.backgroundColor==="inverse-100"&&a;let c=`var(--wui-color-${this.backgroundColor})`;return l?c=`var(--wui-icon-box-bg-${this.backgroundColor})`:s&&(c=`var(--wui-gray-${this.backgroundColor})`),this.style.cssText=` + --local-bg-value: ${c}; + --local-bg-mix: ${l||s?"100%":i}; + --local-border-radius: var(--wui-border-radius-${o}); + --local-size: var(--wui-icon-box-size-${this.size}); + --local-border: ${this.borderColor==="wui-color-bg-125"?"2px":"1px"} solid ${this.border?`var(--${this.borderColor})`:"transparent"} + `,v` `}};hr.styles=[fe,Me,dP];eo([T()],hr.prototype,"size",void 0);eo([T()],hr.prototype,"backgroundColor",void 0);eo([T()],hr.prototype,"iconColor",void 0);eo([T()],hr.prototype,"iconSize",void 0);eo([T()],hr.prototype,"background",void 0);eo([T({type:Boolean})],hr.prototype,"border",void 0);eo([T()],hr.prototype,"borderColor",void 0);eo([T()],hr.prototype,"icon",void 0);hr=eo([G("wui-icon-box")],hr);const fP=Q` + :host { + display: block; + } + + button { + border-radius: var(--wui-border-radius-3xl); + background: var(--wui-gray-glass-002); + display: flex; + gap: var(--wui-spacing-xs); + padding: var(--wui-spacing-3xs) var(--wui-spacing-xs) var(--wui-spacing-3xs) + var(--wui-spacing-xs); + border: 1px solid var(--wui-gray-glass-005); + } + + button:disabled { + background: var(--wui-gray-glass-015); + } + + button:disabled > wui-text { + color: var(--wui-gray-glass-015); + } + + button:disabled > wui-flex > wui-text { + color: var(--wui-gray-glass-015); + } + + button:disabled > wui-image, + button:disabled > wui-icon-box, + button:disabled > wui-flex > wui-avatar { + filter: grayscale(1); + } + + button:has(wui-image) { + padding: var(--wui-spacing-3xs) var(--wui-spacing-3xs) var(--wui-spacing-3xs) + var(--wui-spacing-xs); + } + + wui-text { + color: var(--wui-color-fg-100); + } + + wui-flex > wui-text { + color: var(--wui-color-fg-200); + } + + wui-image, + wui-icon-box { + border-radius: var(--wui-border-radius-3xl); + width: 24px; + height: 24px; + box-shadow: 0 0 0 2px var(--wui-gray-glass-005); + } + + wui-flex { + border-radius: var(--wui-border-radius-3xl); + border: 1px solid var(--wui-gray-glass-005); + background: var(--wui-gray-glass-005); + padding: 4px var(--wui-spacing-m) 4px var(--wui-spacing-xxs); + } + + button.local-no-balance { + border-radius: 0px; + border: none; + background: transparent; + } + + wui-avatar { + width: 20px; + height: 20px; + box-shadow: 0 0 0 2px var(--wui-accent-glass-010); + } + + @media (max-width: 500px) { + button { + gap: 0px; + padding: var(--wui-spacing-3xs) var(--wui-spacing-xs) !important; + height: 32px; + } + wui-image, + wui-icon-box, + button > wui-text { + visibility: hidden; + width: 0px; + height: 0px; + } + button { + border-radius: 0px; + border: none; + background: transparent; + padding: 0px; + } + } + + @media (hover: hover) and (pointer: fine) { + button:hover:enabled > wui-flex > wui-text { + color: var(--wui-color-fg-175); + } + + button:active:enabled > wui-flex > wui-text { + color: var(--wui-color-fg-175); + } + } +`;var Ur=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Pn=class extends q{constructor(){super(...arguments),this.networkSrc=void 0,this.avatarSrc=void 0,this.balance=void 0,this.isUnsupportedChain=void 0,this.disabled=!1,this.isProfileName=!1,this.address="",this.profileName="",this.charsStart=4,this.charsEnd=6}render(){return v` + + `}balanceTemplate(){if(this.isUnsupportedChain)return v` + Switch Network`;if(this.balance){const e=this.networkSrc?v``:v` + + `;return v` + ${e} + ${this.balance} + `}return null}};Pn.styles=[fe,Me,fP];Ur([T()],Pn.prototype,"networkSrc",void 0);Ur([T()],Pn.prototype,"avatarSrc",void 0);Ur([T()],Pn.prototype,"balance",void 0);Ur([T({type:Boolean})],Pn.prototype,"isUnsupportedChain",void 0);Ur([T({type:Boolean})],Pn.prototype,"disabled",void 0);Ur([T({type:Boolean})],Pn.prototype,"isProfileName",void 0);Ur([T()],Pn.prototype,"address",void 0);Ur([T()],Pn.prototype,"profileName",void 0);Ur([T()],Pn.prototype,"charsStart",void 0);Ur([T()],Pn.prototype,"charsEnd",void 0);Pn=Ur([G("wui-account-button")],Pn);const pP=Q` + :host { + position: relative; + background-color: var(--wui-gray-glass-002); + display: flex; + justify-content: center; + align-items: center; + width: var(--local-size); + height: var(--local-size); + border-radius: inherit; + border-radius: var(--local-border-radius); + } + + :host > wui-flex { + overflow: hidden; + border-radius: inherit; + border-radius: var(--local-border-radius); + } + + :host::after { + content: ''; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + border-radius: inherit; + border: 1px solid var(--wui-gray-glass-010); + pointer-events: none; + } + + :host([name='Extension'])::after { + border: 1px solid var(--wui-accent-glass-010); + } + + :host([data-wallet-icon='allWallets']) { + background-color: var(--wui-all-wallets-bg-100); + } + + :host([data-wallet-icon='allWallets'])::after { + border: 1px solid var(--wui-accent-glass-010); + } + + wui-icon[data-parent-size='inherit'] { + width: 75%; + height: 75%; + align-items: center; + } + + wui-icon[data-parent-size='sm'] { + width: 18px; + height: 18px; + } + + wui-icon[data-parent-size='md'] { + width: 24px; + height: 24px; + } + + wui-icon[data-parent-size='lg'] { + width: 42px; + height: 42px; + } + + wui-icon[data-parent-size='full'] { + width: 100%; + height: 100%; + } + + :host > wui-icon-box { + position: absolute; + overflow: hidden; + right: -1px; + bottom: -2px; + z-index: 1; + border: 2px solid var(--wui-color-bg-base-150, #1e1f1f); + padding: 1px; + } +`;var Na=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let oi=class extends q{constructor(){super(...arguments),this.size="md",this.name="",this.installed=!1,this.badgeSize="xs"}render(){let e="xxs";return this.size==="lg"?e="m":this.size==="md"?e="xs":e="xxs",this.style.cssText=` + --local-border-radius: var(--wui-border-radius-${e}); + --local-size: var(--wui-wallet-image-size-${this.size}); + `,this.walletIcon&&(this.dataset.walletIcon=this.walletIcon),v` + ${this.templateVisual()} + `}templateVisual(){return this.imageSrc?v``:this.walletIcon?v``:v``}};oi.styles=[fe,pP];Na([T()],oi.prototype,"size",void 0);Na([T()],oi.prototype,"name",void 0);Na([T()],oi.prototype,"imageSrc",void 0);Na([T()],oi.prototype,"walletIcon",void 0);Na([T({type:Boolean})],oi.prototype,"installed",void 0);Na([T()],oi.prototype,"badgeSize",void 0);oi=Na([G("wui-wallet-image")],oi);const hP=Q` + :host { + position: relative; + border-radius: var(--wui-border-radius-xxs); + width: 40px; + height: 40px; + overflow: hidden; + background: var(--wui-gray-glass-002); + display: flex; + justify-content: center; + align-items: center; + flex-wrap: wrap; + gap: var(--wui-spacing-4xs); + padding: 3.75px !important; + } + + :host::after { + content: ''; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + border-radius: inherit; + border: 1px solid var(--wui-gray-glass-010); + pointer-events: none; + } + + :host > wui-wallet-image { + width: 14px; + height: 14px; + border-radius: var(--wui-border-radius-5xs); + } + + :host > wui-flex { + padding: 2px; + position: fixed; + overflow: hidden; + left: 34px; + bottom: 8px; + background: var(--dark-background-150, #1e1f1f); + border-radius: 50%; + z-index: 2; + display: flex; + } +`;var S8=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};const P1=4;let dd=class extends q{constructor(){super(...arguments),this.walletImages=[]}render(){const e=this.walletImages.lengthv` + + `)} + ${e?[...Array(P1-this.walletImages.length)].map(()=>v` `):null} + + + `}};dd.styles=[fe,hP];S8([T({type:Array})],dd.prototype,"walletImages",void 0);dd=S8([G("wui-all-wallets-image")],dd);const mP=Q` + :host { + width: var(--local-width); + position: relative; + } + + button { + border: 1px solid var(--wui-gray-glass-010); + border-radius: var(--local-border-radius); + width: var(--local-width); + white-space: nowrap; + } + + button:disabled { + border: 1px solid var(--wui-gray-glass-010); + } + + /* xs settings */ + button[data-size='xs'] { + padding: var(--wui-spacing-xs) var(--wui-spacing-1xs); + } + + button[data-size='xs'][data-icon-left='true'][data-icon-right='false'] { + padding-left: var(--wui-spacing-xxs); + } + + button[data-size='xs'][data-icon-right='true'][data-icon-left='false'] { + padding-right: var(--wui-spacing-xxs); + } + + /* sm settings */ + button[data-size='sm'] { + padding: var(--wui-spacing-xxs) var(--wui-spacing-s); + } + + button[data-size='sm'][data-icon-left='true'][data-icon-right='false'] { + padding: var(--wui-spacing-xxs) var(--wui-spacing-s) var(--wui-spacing-xxs) + var(--wui-spacing-xs); + } + + button[data-size='sm'][data-icon-right='true'][data-icon-left='false'] { + padding: var(--wui-spacing-xxs) var(--wui-spacing-xs) var(--wui-spacing-xxs) + var(--wui-spacing-s); + } + + /* md settings */ + button[data-size='md'] { + padding: 8.2px var(--wui-spacing-l) 9px var(--wui-spacing-l); + } + + button[data-size='md'][data-icon-left='true'][data-icon-right='false'] { + padding: 8.2px var(--wui-spacing-l) 9px var(--wui-spacing-s); + } + + button[data-size='md'][data-icon-right='true'][data-icon-left='false'] { + padding: 8.2px var(--wui-spacing-s) 9px var(--wui-spacing-l); + } + + /* lg settings */ + button[data-size='lg'] { + padding: var(--wui-spacing-m) var(--wui-spacing-2l); + } + + button[data-size='lg'][data-icon-left='true'][data-icon-right='false'] { + padding-left: var(--wui-spacing-m); + } + + button[data-size='lg'][data-icon-right='true'][data-icon-left='false'] { + padding-right: var(--wui-spacing-m); + } + + button > wui-text { + transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: opacity; + opacity: var(--local-opacity-100); + } + + ::slotted(*) { + transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: opacity; + opacity: var(--local-opacity-100); + } + + wui-loading-spinner { + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + opacity: var(--local-opacity-000); + } +`;var yi=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};const gP={xs:"small-600",sm:"paragraph-600",md:"small-600",mdl:"small-600",lg:"paragraph-600"};let zn=class extends q{constructor(){super(...arguments),this.size="md",this.disabled=!1,this.fullWidth=!1,this.loading=!1,this.variant="fill",this.hasIconLeft=!1,this.hasIconRight=!1,this.borderRadius="m"}render(){this.style.cssText=` + --local-width: ${this.fullWidth?"100%":"auto"}; + --local-opacity-100: ${this.loading?0:1}; + --local-opacity-000: ${this.loading?1:0}; + --local-border-radius: var(--wui-border-radius-${this.borderRadius}); + `;const e=this.textVariant??gP[this.size];return v` + + `}handleSlotLeftChange(){this.hasIconLeft=!0}handleSlotRightChange(){this.hasIconRight=!0}loadingTemplate(){return this.loading?v``:v``}};zn.styles=[fe,Me,mP];yi([T()],zn.prototype,"size",void 0);yi([T({type:Boolean})],zn.prototype,"disabled",void 0);yi([T({type:Boolean})],zn.prototype,"fullWidth",void 0);yi([T({type:Boolean})],zn.prototype,"loading",void 0);yi([T()],zn.prototype,"variant",void 0);yi([T({type:Boolean})],zn.prototype,"hasIconLeft",void 0);yi([T({type:Boolean})],zn.prototype,"hasIconRight",void 0);yi([T()],zn.prototype,"borderRadius",void 0);yi([T()],zn.prototype,"textVariant",void 0);zn=yi([G("wui-button")],zn);const T8=ee` + +`,wP=Q` + :host { + display: flex; + flex-direction: column; + align-items: center; + width: 76px; + row-gap: var(--wui-spacing-xs); + padding: var(--wui-spacing-xs) 10px; + background-color: var(--wui-gray-glass-002); + border-radius: clamp(0px, var(--wui-border-radius-xs), 20px); + position: relative; + } + + wui-shimmer[data-type='network'] { + border: none; + -webkit-clip-path: var(--wui-path-network); + clip-path: var(--wui-path-network); + } + + svg { + position: absolute; + width: 48px; + height: 54px; + z-index: 1; + } + + svg > path { + stroke: var(--wui-gray-glass-010); + stroke-width: 1px; + } +`;var A8=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let fd=class extends q{constructor(){super(...arguments),this.type="wallet"}render(){return v` + ${this.shimmerTemplate()} + + `}shimmerTemplate(){return this.type==="network"?v` + ${T8}`:v``}};fd.styles=[fe,Me,wP];A8([T()],fd.prototype,"type",void 0);fd=A8([G("wui-card-select-loader")],fd);const yP=ee` + + + +`,vP=ee` + +`,bP=Q` + :host { + position: relative; + border-radius: inherit; + display: flex; + justify-content: center; + align-items: center; + width: var(--local-width); + height: var(--local-height); + } + + svg { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 1; + fill: var(--wui-gray-glass-002); + } + + svg > path { + stroke: var(--local-stroke); + } + + wui-image { + width: 100%; + height: 100%; + -webkit-clip-path: var(--local-path); + clip-path: var(--local-path); + background: var(--wui-gray-glass-002); + } + + wui-icon { + transform: translateY(-5%); + width: var(--local-icon-size); + height: var(--local-icon-size); + } +`;var df=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let qo=class extends q{constructor(){super(...arguments),this.size="md",this.name="uknown",this.selected=!1}render(){const e={sm:yP,md:T8,lg:vP};return this.style.cssText=` + --local-stroke: ${this.selected?"var(--wui-color-accent-100)":"var(--wui-gray-glass-010)"}; + --local-path: var(--wui-path-network-${this.size}); + --local-width: var(--wui-width-network-${this.size}); + --local-height: var(--wui-height-network-${this.size}); + --local-icon-size: var(--wui-icon-size-network-${this.size}); + `,v`${this.templateVisual()} ${e[this.size]}`}templateVisual(){return this.imageSrc?v``:v``}};qo.styles=[fe,bP];df([T()],qo.prototype,"size",void 0);df([T()],qo.prototype,"name",void 0);df([T()],qo.prototype,"imageSrc",void 0);df([T({type:Boolean})],qo.prototype,"selected",void 0);qo=df([G("wui-network-image")],qo);const xP=Q` + button { + flex-direction: column; + width: 76px; + row-gap: var(--wui-spacing-xs); + padding: var(--wui-spacing-xs) var(--wui-spacing-0); + background-color: var(--wui-gray-glass-002); + border-radius: clamp(0px, var(--wui-border-radius-xs), 20px); + } + + button > wui-text { + color: var(--wui-color-fg-100); + max-width: var(--wui-icon-box-size-xl); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + justify-content: center; + } + + button:disabled > wui-text { + color: var(--wui-gray-glass-015); + } + + [data-selected='true'] { + background-color: var(--wui-accent-glass-020); + } + + @media (hover: hover) and (pointer: fine) { + [data-selected='true']:hover:enabled { + background-color: var(--wui-accent-glass-015); + } + } + + [data-selected='true']:active:enabled { + background-color: var(--wui-accent-glass-010); + } +`;var Ma=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let si=class extends q{constructor(){super(...arguments),this.name="Unknown",this.type="wallet",this.imageSrc=void 0,this.disabled=!1,this.selected=!1,this.installed=!1}render(){return v` + + `}imageTemplate(){return this.type==="network"?v` + + + `:v` + + + `}};si.styles=[fe,Me,xP];Ma([T()],si.prototype,"name",void 0);Ma([T()],si.prototype,"type",void 0);Ma([T()],si.prototype,"imageSrc",void 0);Ma([T({type:Boolean})],si.prototype,"disabled",void 0);Ma([T({type:Boolean})],si.prototype,"selected",void 0);Ma([T({type:Boolean})],si.prototype,"installed",void 0);si=Ma([G("wui-card-select")],si);const CP=Q` + a { + border: 1px solid var(--wui-gray-glass-010); + border-radius: var(--wui-border-radius-3xl); + } + + wui-image { + border-radius: var(--wui-border-radius-3xl); + overflow: hidden; + } + + a.disabled > wui-icon, + a.disabled > wui-image { + filter: grayscale(1); + } + + a[data-variant='fill'] { + color: var(--wui-color-inverse-100); + background-color: var(--wui-color-accent-100); + } + + a[data-variant='shade'], + a[data-variant='shadeSmall'] { + background-color: transparent; + background-color: var(--wui-gray-glass-010); + color: var(--wui-color-fg-200); + } + + a[data-variant='success'] { + column-gap: var(--wui-spacing-xxs); + border: 1px solid var(--wui-success-glass-010); + background-color: var(--wui-success-glass-010); + color: var(--wui-color-success-100); + } + + a[data-variant='error'] { + column-gap: var(--wui-spacing-xxs); + border: 1px solid var(--wui-error-glass-010); + background-color: var(--wui-error-glass-010); + color: var(--wui-color-error-100); + } + + a[data-variant='transparent'] { + column-gap: var(--wui-spacing-xxs); + background-color: transparent; + color: var(--wui-color-fg-150); + } + + a[data-variant='transparent'], + a[data-variant='success'], + a[data-variant='shadeSmall'], + a[data-variant='error'] { + padding: 7px var(--wui-spacing-s) 7px 10px; + } + + a[data-variant='transparent']:has(wui-text:first-child), + a[data-variant='success']:has(wui-text:first-child), + a[data-variant='shadeSmall']:has(wui-text:first-child), + a[data-variant='error']:has(wui-text:first-child) { + padding: 7px var(--wui-spacing-s); + } + + a[data-variant='fill'], + a[data-variant='shade'] { + column-gap: var(--wui-spacing-xs); + padding: var(--wui-spacing-xxs) var(--wui-spacing-m) var(--wui-spacing-xxs) + var(--wui-spacing-xs); + } + + a[data-variant='fill']:has(wui-text:first-child), + a[data-variant='shade']:has(wui-text:first-child) { + padding: 9px var(--wui-spacing-m) 9px var(--wui-spacing-m); + } + + a[data-variant='fill'] > wui-image, + a[data-variant='shade'] > wui-image { + width: 24px; + height: 24px; + } + + a[data-variant='fill'] > wui-image { + box-shadow: inset 0 0 0 1px var(--wui-color-accent-090); + } + + a[data-variant='shade'] > wui-image, + a[data-variant='shadeSmall'] > wui-image { + box-shadow: inset 0 0 0 1px var(--wui-gray-glass-010); + } + + a[data-variant='fill'] > wui-icon, + a[data-variant='shade'] > wui-icon { + width: 14px; + height: 14px; + } + + a[data-variant='transparent'] > wui-image, + a[data-variant='success'] > wui-image, + a[data-variant='shadeSmall'] > wui-image, + a[data-variant='error'] > wui-image { + width: 14px; + height: 14px; + } + + a[data-variant='transparent'] > wui-icon, + a[data-variant='success'] > wui-icon, + a[data-variant='shadeSmall'] > wui-icon, + a[data-variant='error'] > wui-icon { + width: 12px; + height: 12px; + } + + a[data-variant='fill']:focus-visible { + background-color: var(--wui-color-accent-090); + } + + a[data-variant='shade']:focus-visible, + a[data-variant='shadeSmall']:focus-visible { + background-color: var(--wui-gray-glass-015); + } + + a[data-variant='transparent']:focus-visible { + background-color: var(--wui-gray-glass-005); + } + + a[data-variant='success']:focus-visible { + background-color: var(--wui-success-glass-015); + } + + a[data-variant='error']:focus-visible { + background-color: var(--wui-error-glass-015); + } + + a.disabled { + color: var(--wui-gray-glass-015); + background-color: var(--wui-gray-glass-015); + pointer-events: none; + } + + @media (hover: hover) and (pointer: fine) { + a[data-variant='fill']:hover { + background-color: var(--wui-color-accent-090); + } + + a[data-variant='shade']:hover, + a[data-variant='shadeSmall']:hover { + background-color: var(--wui-gray-glass-015); + } + + a[data-variant='transparent']:hover { + background-color: var(--wui-gray-glass-005); + } + + a[data-variant='success']:hover { + background-color: var(--wui-success-glass-015); + } + + a[data-variant='error']:hover { + background-color: var(--wui-error-glass-015); + } + } + + a[data-variant='fill']:active { + background-color: var(--wui-color-accent-080); + } + + a[data-variant='shade']:active, + a[data-variant='shadeSmall']:active { + background-color: var(--wui-gray-glass-020); + } + + a[data-variant='transparent']:active { + background-color: var(--wui-gray-glass-010); + } + + a[data-variant='success']:active { + background-color: var(--wui-success-glass-020); + } + + a[data-variant='error']:active { + background-color: var(--wui-error-glass-020); + } +`;var La=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let ai=class extends q{constructor(){super(...arguments),this.variant="fill",this.imageSrc=void 0,this.disabled=!1,this.icon="externalLink",this.href="",this.text=void 0}render(){const n=this.variant==="success"||this.variant==="transparent"||this.variant==="shadeSmall"?"small-600":"paragraph-600";return v` + + ${this.imageTemplate()} + + ${this.title?this.title:Ae.getHostName(this.href)} + + + + `}imageTemplate(){return this.imageSrc?v``:null}};ai.styles=[fe,Me,CP];La([T()],ai.prototype,"variant",void 0);La([T()],ai.prototype,"imageSrc",void 0);La([T({type:Boolean})],ai.prototype,"disabled",void 0);La([T()],ai.prototype,"icon",void 0);La([T()],ai.prototype,"href",void 0);La([T()],ai.prototype,"text",void 0);ai=La([G("wui-chip")],ai);const _P=Q` + :host { + position: relative; + display: block; + } + + button { + background: var(--wui-color-accent-100); + border: 1px solid var(--wui-gray-glass-010); + border-radius: var(--wui-border-radius-m); + gap: var(--wui-spacing-xs); + } + + button.loading { + background: var(--wui-gray-glass-010); + border: 1px solid var(--wui-gray-glass-010); + pointer-events: none; + } + + button:disabled { + background-color: var(--wui-gray-glass-015); + border: 1px solid var(--wui-gray-glass-010); + } + + button:disabled > wui-text { + color: var(--wui-gray-glass-015); + } + + @media (hover: hover) and (pointer: fine) { + button:hover:enabled { + background-color: var(--wui-color-accent-090); + } + + button:active:enabled { + background-color: var(--wui-color-accent-080); + } + } + + button:focus-visible { + border: 1px solid var(--wui-gray-glass-010); + background-color: var(--wui-color-accent-090); + -webkit-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + -moz-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + } + + button[data-size='sm'] { + padding: 6.75px 10px 7.25px; + } + + ::slotted(*) { + transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: opacity; + opacity: var(--local-opacity-100); + } + + button > wui-text { + transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: opacity; + opacity: var(--local-opacity-100); + color: var(--wui-color-inverse-100); + } + + button[data-size='md'] { + padding: 9px var(--wui-spacing-l) 9px var(--wui-spacing-l); + } + + button[data-size='md'] + wui-text { + padding-left: var(--wui-spacing-3xs); + } + + @media (max-width: 500px) { + button[data-size='md'] { + height: 32px; + padding: 5px 12px; + } + + button[data-size='md'] > wui-text > slot { + font-size: 14px !important; + } + } + + wui-loading-spinner { + width: 14px; + height: 14px; + } + + wui-loading-spinner::slotted(svg) { + width: 10px !important; + height: 10px !important; + } + + button[data-size='sm'] > wui-loading-spinner { + width: 12px; + height: 12px; + } +`;var S2=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let nc=class extends q{constructor(){super(...arguments),this.size="md",this.loading=!1}render(){const e=this.size==="md"?"paragraph-600":"small-600";return v` + + `}loadingTemplate(){return this.loading?v``:null}};nc.styles=[fe,Me,_P];S2([T()],nc.prototype,"size",void 0);S2([T({type:Boolean})],nc.prototype,"loading",void 0);nc=S2([G("wui-connect-button")],nc);const EP=Q` + wui-flex { + width: 100%; + background-color: var(--wui-gray-glass-002); + border-radius: var(--wui-border-radius-xs); + } +`;var ch=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let aa=class extends q{constructor(){super(...arguments),this.disabled=!1,this.label="",this.buttonLabel=""}render(){return v` + + ${this.label} + + ${this.buttonLabel} + + + + `}};aa.styles=[fe,Me,EP];ch([T({type:Boolean})],aa.prototype,"disabled",void 0);ch([T()],aa.prototype,"label",void 0);ch([T()],aa.prototype,"buttonLabel",void 0);aa=ch([G("wui-cta-button")],aa);const SP=Q` + :host { + display: block; + padding: var(--wui-spacing-l) var(--wui-spacing-m); + background-color: var(--wui-gray-glass-002); + border-radius: var(--wui-border-radius-xs); + width: 100%; + } +`;var TP=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let rp=class extends q{render(){return v` + + + + `}};rp.styles=[fe,Me,SP];rp=TP([G("wui-details-group")],rp);const AP=Q` + :host { + display: flex; + flex-direction: row; + gap: var(--wui-spacing-l); + width: 100%; + border-radius: var(--wui-border-radius-xs); + } +`;var k8=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let pd=class extends q{constructor(){super(...arguments),this.name=""}render(){return v` + + ${this.name} + + + + + `}};pd.styles=[fe,Me,AP];k8([T()],pd.prototype,"name",void 0);pd=k8([G("wui-details-group-item")],pd);/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const kP=t=>t.strings===void 0;/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const xu=(t,e)=>{var r;const n=t._$AN;if(n===void 0)return!1;for(const i of n)(r=i._$AO)==null||r.call(i,e,!1),xu(i,e);return!0},ip=t=>{let e,n;do{if((e=t._$AM)===void 0)break;n=e._$AN,n.delete(t),t=e}while((n==null?void 0:n.size)===0)},R8=t=>{for(let e;e=t._$AM;t=e){let n=e._$AN;if(n===void 0)e._$AN=n=new Set;else if(n.has(t))break;n.add(t),PP(e)}};function RP(t){this._$AN!==void 0?(ip(this),this._$AM=t,R8(this)):this._$AM=t}function $P(t,e=!1,n=0){const r=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(e)if(Array.isArray(r))for(let o=n;o{t.type==C8.CHILD&&(t._$AP??(t._$AP=$P),t._$AQ??(t._$AQ=RP))};class IP extends E8{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,n,r){super._$AT(e,n,r),R8(this),this.isConnected=e._$AU}_$AO(e,n=!0){var r,i;e!==this.isConnected&&(this.isConnected=e,e?(r=this.reconnected)==null||r.call(this):(i=this.disconnected)==null||i.call(this)),n&&(xu(this,e),ip(this))}setValue(e){if(kP(this._$Ct))this._$Ct._$AI(e,this);else{const n=[...this._$Ct._$AH];n[this._$Ci]=e,this._$Ct._$AI(n,this,0)}}disconnected(){}reconnected(){}}/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const la=()=>new OP;class OP{}const I1=new WeakMap,ca=_8(class extends IP{render(t){return Et}update(t,[e]){var r;const n=e!==this.G;return n&&this.G!==void 0&&this.ot(void 0),(n||this.rt!==this.lt)&&(this.G=e,this.ct=(r=t.options)==null?void 0:r.host,this.ot(this.lt=t.element)),Et}ot(t){if(typeof this.G=="function"){const e=this.ct??globalThis;let n=I1.get(e);n===void 0&&(n=new WeakMap,I1.set(e,n)),n.get(this.G)!==void 0&&this.G.call(this.ct,void 0),n.set(this.G,t),t!==void 0&&this.G.call(this.ct,t)}else this.G.value=t}get rt(){var t,e;return typeof this.G=="function"?(t=I1.get(this.ct??globalThis))==null?void 0:t.get(this.G):(e=this.G)==null?void 0:e.value}disconnected(){this.rt===this.lt&&this.ot(void 0)}reconnected(){this.ot(this.lt)}}),NP=Q` + :host { + position: relative; + width: 100%; + display: inline-block; + color: var(--wui-color-fg-275); + } + + input { + width: 100%; + border-radius: var(--wui-border-radius-xs); + border: 1px solid var(--wui-gray-glass-005); + background: var(--wui-gray-glass-005); + font-size: var(--wui-font-size-paragraph); + font-weight: var(--wui-font-weight-light); + letter-spacing: var(--wui-letter-spacing-paragraph); + color: var(--wui-color-fg-100); + transition: + background-color var(--wui-ease-inout-power-1) var(--wui-duration-md), + border-color var(--wui-ease-inout-power-1) var(--wui-duration-md), + box-shadow var(--wui-ease-inout-power-1) var(--wui-duration-md); + will-change: background-color, border-color, box-shadow; + caret-color: var(--wui-color-accent-100); + } + + input:disabled { + cursor: not-allowed; + border: 1px solid var(--wui-gray-glass-010); + } + + input:disabled::placeholder, + input:disabled + wui-icon { + color: var(--wui-color-fg-300); + } + + input::placeholder { + color: var(--wui-color-fg-275); + } + + input:focus:enabled { + background-color: var(--wui-gray-glass-010); + border: 1px solid var(--wui-color-accent-100); + -webkit-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + -moz-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + } + + input:hover:enabled { + background-color: var(--wui-gray-glass-010); + } + + wui-icon { + position: absolute; + top: 50%; + transform: translateY(-50%); + pointer-events: none; + } + + .wui-size-sm { + padding: 9px var(--wui-spacing-m) 10px var(--wui-spacing-s); + } + + wui-icon + .wui-size-sm { + padding: 9px var(--wui-spacing-m) 10px 36px; + } + + wui-icon[data-input='sm'] { + left: var(--wui-spacing-s); + } + + .wui-size-md { + padding: 15px var(--wui-spacing-m) var(--wui-spacing-l) var(--wui-spacing-m); + } + + wui-icon + .wui-size-md, + wui-loading-spinner + .wui-size-md { + padding: 10.5px var(--wui-spacing-3xl) 10.5px 40px; + } + + wui-icon[data-input='md'] { + left: var(--wui-spacing-l); + } + + .wui-size-lg { + padding: var(--wui-spacing-s) var(--wui-spacing-s) var(--wui-spacing-s) var(--wui-spacing-l); + letter-spacing: var(--wui-letter-spacing-medium-title); + font-size: var(--wui-font-size-medium-title); + font-weight: var(--wui-font-weight-light); + line-height: 130%; + color: var(--wui-color-fg-100); + height: 64px; + } + + wui-icon + .wui-size-lg, + wui-loading-spinner + .wui-size-lg { + padding-left: 50px; + } + + wui-icon[data-input='lg'] { + left: var(--wui-spacing-l); + } + + input:placeholder-shown ~ ::slotted(wui-input-element), + input:placeholder-shown ~ ::slotted(wui-icon) { + opacity: 0; + pointer-events: none; + } + + input::-webkit-outer-spin-button, + input::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; + } + + input[type='number'] { + -moz-appearance: textfield; + } + + ::slotted(wui-input-element), + ::slotted(wui-icon) { + position: absolute; + top: 50%; + transform: translateY(-50%); + } + + ::slotted(wui-input-element) { + right: var(--wui-spacing-m); + } + + ::slotted(wui-icon) { + right: 0px; + } +`;var ss=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Or=class extends q{constructor(){super(...arguments),this.inputElementRef=la(),this.size="md",this.disabled=!1,this.placeholder="",this.type="text",this.value=""}render(){const e=`wui-size-${this.size}`;return v` ${this.templateIcon()} + + `}templateIcon(){return this.icon?v``:null}dispatchInputChangeEvent(){var e;this.dispatchEvent(new CustomEvent("inputChange",{detail:(e=this.inputElementRef.value)==null?void 0:e.value,bubbles:!0,composed:!0}))}};Or.styles=[fe,Me,NP];ss([T()],Or.prototype,"size",void 0);ss([T()],Or.prototype,"icon",void 0);ss([T({type:Boolean})],Or.prototype,"disabled",void 0);ss([T()],Or.prototype,"placeholder",void 0);ss([T()],Or.prototype,"type",void 0);ss([T()],Or.prototype,"keyHint",void 0);ss([T()],Or.prototype,"value",void 0);Or=ss([G("wui-input-text")],Or);const MP=Q` + :host { + position: relative; + display: inline-block; + } + + wui-text { + margin: var(--wui-spacing-xxs) var(--wui-spacing-m) var(--wui-spacing-0) var(--wui-spacing-m); + } +`;var uh=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let ua=class extends q{constructor(){super(...arguments),this.disabled=!1}render(){return v` + + ${this.templateError()} + `}templateError(){return this.errorMessage?v`${this.errorMessage}`:null}};ua.styles=[fe,MP];uh([T()],ua.prototype,"errorMessage",void 0);uh([T({type:Boolean})],ua.prototype,"disabled",void 0);uh([T()],ua.prototype,"value",void 0);ua=uh([G("wui-email-input")],ua);const LP=Q` + button { + border-radius: var(--local-border-radius); + color: var(--wui-color-fg-100); + padding: var(--local-padding); + } + + @media (max-width: 700px) { + button { + padding: var(--wui-spacing-s); + } + } + + button > wui-icon { + pointer-events: none; + } + + button:disabled > wui-icon { + color: var(--wui-color-bg-300) !important; + } + + button:disabled { + background-color: transparent; + } +`;var ff=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Ko=class extends q{constructor(){super(...arguments),this.size="md",this.disabled=!1,this.icon="copy",this.iconColor="inherit"}render(){const e=this.size==="lg"?"--wui-border-radius-xs":"--wui-border-radius-xxs",n=this.size==="lg"?"--wui-spacing-1xs":"--wui-spacing-2xs";return this.style.cssText=` + --local-border-radius: var(${e}); + --local-padding: var(${n}); +`,v` + + `}};Ko.styles=[fe,Me,C2,LP];ff([T()],Ko.prototype,"size",void 0);ff([T({type:Boolean})],Ko.prototype,"disabled",void 0);ff([T()],Ko.prototype,"icon",void 0);ff([T()],Ko.prototype,"iconColor",void 0);Ko=ff([G("wui-icon-link")],Ko);const DP=Q` + button { + background-color: var(--wui-color-fg-300); + border-radius: var(--wui-border-radius-4xs); + width: 16px; + height: 16px; + } + + button:disabled { + background-color: var(--wui-color-bg-300); + } + + wui-icon { + color: var(--wui-color-bg-200) !important; + } + + button:focus-visible { + background-color: var(--wui-color-fg-250); + border: 1px solid var(--wui-color-accent-100); + } + + button:active:enabled { + background-color: var(--wui-color-fg-225); + } + + @media (hover: hover) and (pointer: fine) { + button:hover:enabled { + background-color: var(--wui-color-fg-250); + } + } +`;var $8=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let hd=class extends q{constructor(){super(...arguments),this.icon="copy"}render(){return v` + + `}};hd.styles=[fe,Me,DP];$8([T()],hd.prototype,"icon",void 0);hd=$8([G("wui-input-element")],hd);const BP=Q` + :host { + position: relative; + display: inline-block; + } + + input { + width: 50px; + height: 50px; + background: var(--wui-gray-glass-010); + border-radius: var(--wui-border-radius-xs); + border: 1px solid var(--wui-gray-glass-005); + font-family: var(--wui-font-family); + font-size: var(--wui-font-size-large); + font-weight: var(--wui-font-weight-regular); + letter-spacing: var(--wui-letter-spacing-large); + text-align: center; + color: var(--wui-color-fg-100); + caret-color: var(--wui-color-accent-100); + transition: + background-color var(--wui-ease-inout-power-1) var(--wui-duration-md), + border-color var(--wui-ease-inout-power-1) var(--wui-duration-md), + box-shadow var(--wui-ease-inout-power-1) var(--wui-duration-md); + will-change: background-color, border-color, box-shadow; + box-sizing: border-box; + -webkit-appearance: none; + -moz-appearance: textfield; + padding: 0px; + } + + input::-webkit-outer-spin-button, + input::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; + } + + input[type='number'] { + -moz-appearance: textfield; + } + + input:disabled { + cursor: not-allowed; + border: 1px solid var(--wui-gray-glass-010); + background: var(--wui-gray-glass-005); + } + + input:focus:enabled { + background-color: var(--wui-gray-glass-015); + border: 1px solid var(--wui-color-accent-100); + -webkit-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + -moz-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + } + + @media (hover: hover) and (pointer: fine) { + input:hover:enabled { + background-color: var(--wui-gray-glass-015); + } + } +`;var T2=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let rc=class extends q{constructor(){super(...arguments),this.disabled=!1,this.value=""}render(){return v` `}};rc.styles=[fe,Me,BP];T2([T({type:Boolean})],rc.prototype,"disabled",void 0);T2([T({type:String})],rc.prototype,"value",void 0);rc=T2([G("wui-input-numeric")],rc);const jP=Q` + button { + padding: var(--wui-spacing-4xs) var(--wui-spacing-xxs); + border-radius: var(--wui-border-radius-3xs); + background-color: transparent; + color: var(--wui-color-accent-100); + } + + button:disabled { + background-color: transparent; + color: var(--wui-gray-glass-015); + } +`;var A2=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let ic=class extends q{constructor(){super(...arguments),this.disabled=!1,this.color="inherit"}render(){return v` + + `}};ic.styles=[fe,Me,jP];A2([T({type:Boolean})],ic.prototype,"disabled",void 0);A2([T()],ic.prototype,"color",void 0);ic=A2([G("wui-link")],ic);const UP=Q` + button { + column-gap: var(--wui-spacing-s); + padding: 11px 18px 11px var(--wui-spacing-s); + width: 100%; + background-color: var(--wui-gray-glass-002); + border-radius: var(--wui-border-radius-xs); + color: var(--wui-color-fg-250); + transition: + color var(--wui-ease-out-power-1) var(--wui-duration-md), + background-color var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: color, background-color; + } + + button[data-iconvariant='square'], + button[data-iconvariant='square-blue'] { + padding: 6px 18px 6px 9px; + } + + button > wui-flex { + flex: 1; + } + + button > wui-image { + width: 32px; + height: 32px; + box-shadow: 0 0 0 2px var(--wui-gray-glass-005); + border-radius: var(--wui-border-radius-3xl); + } + + button > wui-icon { + width: 36px; + height: 36px; + transition: opacity var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: opacity; + } + + button > wui-icon-box[data-variant='blue'] { + box-shadow: 0 0 0 2px var(--wui-accent-glass-005); + } + + button > wui-icon-box[data-variant='overlay'] { + box-shadow: 0 0 0 2px var(--wui-gray-glass-005); + } + + button > wui-icon-box[data-variant='square-blue'] { + border-radius: var(--wui-border-radius-3xs); + position: relative; + border: none; + width: 36px; + height: 36px; + } + + button > wui-icon-box[data-variant='square-blue']::after { + content: ''; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + border-radius: inherit; + border: 1px solid var(--wui-accent-glass-010); + pointer-events: none; + } + + button > wui-icon:last-child { + width: 14px; + height: 14px; + } + + button:disabled { + background-color: var(--wui-gray-glass-015); + color: var(--wui-gray-glass-015); + } + + button[data-loading='true'] > wui-icon { + opacity: 0; + } + + wui-loading-spinner { + position: absolute; + right: 18px; + top: 50%; + transform: translateY(-50%); + } +`;var vi=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Wn=class extends q{constructor(){super(...arguments),this.variant="icon",this.disabled=!1,this.imageSrc=void 0,this.alt=void 0,this.chevron=!1,this.loading=!1}render(){return v` + + `}visualTemplate(){if(this.variant==="image"&&this.imageSrc)return v``;if(this.iconVariant==="square"&&this.icon&&this.variant==="icon")return v``;if(this.variant==="icon"&&this.icon&&this.iconVariant){const e=["blue","square-blue"].includes(this.iconVariant)?"accent-100":"fg-200",n=this.iconVariant==="square-blue"?"mdl":"md",r=this.iconSize?this.iconSize:n;return v` + + `}return null}loadingTemplate(){return this.loading?v``:v``}chevronTemplate(){return this.chevron?v``:null}};Wn.styles=[fe,Me,UP];vi([T()],Wn.prototype,"icon",void 0);vi([T()],Wn.prototype,"iconSize",void 0);vi([T()],Wn.prototype,"variant",void 0);vi([T()],Wn.prototype,"iconVariant",void 0);vi([T({type:Boolean})],Wn.prototype,"disabled",void 0);vi([T()],Wn.prototype,"imageSrc",void 0);vi([T()],Wn.prototype,"alt",void 0);vi([T({type:Boolean})],Wn.prototype,"chevron",void 0);vi([T({type:Boolean})],Wn.prototype,"loading",void 0);Wn=vi([G("wui-list-item")],Wn);var yg;(function(t){t.approve="approved",t.bought="bought",t.borrow="borrowed",t.burn="burnt",t.cancel="canceled",t.claim="claimed",t.deploy="deployed",t.deposit="deposited",t.execute="executed",t.mint="minted",t.receive="received",t.repay="repaid",t.send="sent",t.sell="sold",t.stake="staked",t.trade="swapped",t.unstake="unstaked",t.withdraw="withdrawn"})(yg||(yg={}));const FP=Q` + :host > wui-flex { + display: flex; + justify-content: center; + align-items: center; + position: relative; + width: 40px; + height: 40px; + box-shadow: inset 0 0 0 1px var(--wui-gray-glass-005); + background-color: var(--wui-gray-glass-005); + } + + :host > wui-flex wui-image { + display: block; + } + + :host > wui-flex, + :host > wui-flex wui-image, + .swap-images-container, + .swap-images-container.nft, + wui-image.nft { + border-top-left-radius: var(--local-left-border-radius); + border-top-right-radius: var(--local-right-border-radius); + border-bottom-left-radius: var(--local-left-border-radius); + border-bottom-right-radius: var(--local-right-border-radius); + } + + wui-icon { + width: 20px; + height: 20px; + } + + wui-icon-box { + position: absolute; + right: 0; + bottom: 0; + transform: translate(20%, 20%); + } + + .swap-images-container { + position: relative; + width: 40px; + height: 40px; + overflow: hidden; + } + + .swap-images-container wui-image:first-child { + position: absolute; + width: 40px; + height: 40px; + top: 0; + left: 0%; + clip-path: inset(0px calc(50% + 2px) 0px 0%); + } + + .swap-images-container wui-image:last-child { + clip-path: inset(0px 0px 0px calc(50% + 2px)); + } +`;var Da=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let li=class extends q{constructor(){super(...arguments),this.images=[],this.secondImage={type:void 0,url:""}}render(){const[e,n]=this.images,r=(e==null?void 0:e.type)==="NFT",i=n!=null&&n.url?n.type==="NFT":r,o=r?"var(--wui-border-radius-xxs)":"var(--wui-border-radius-s)",s=i?"var(--wui-border-radius-xxs)":"var(--wui-border-radius-s)";return this.style.cssText=` + --local-left-border-radius: ${o}; + --local-right-border-radius: ${s}; + `,v` ${this.templateVisual()} ${this.templateIcon()} `}templateVisual(){const[e,n]=this.images,r=e==null?void 0:e.type;return this.images.length===2&&(e!=null&&e.url||n!=null&&n.url)?v`
+ ${e!=null&&e.url?v``:null} + ${n!=null&&n.url?v``:null} +
`:e!=null&&e.url?v``:r==="NFT"?v``:v``}templateIcon(){let e="accent-100",n;return n=this.getIcon(),this.status&&(e=this.getStatusColor()),n?v` + + `:null}getDirectionIcon(){switch(this.direction){case"in":return"arrowBottom";case"out":return"arrowTop";default:return}}getIcon(){return this.onlyDirectionIcon?this.getDirectionIcon():this.type==="trade"?"swapHorizontalBold":this.type==="approve"?"checkmark":this.type==="cancel"?"close":this.getDirectionIcon()}getStatusColor(){switch(this.status){case"confirmed":return"success-100";case"failed":return"error-100";case"pending":return"inverse-100";default:return"accent-100"}}};li.styles=[FP];Da([T()],li.prototype,"type",void 0);Da([T()],li.prototype,"status",void 0);Da([T()],li.prototype,"direction",void 0);Da([T({type:Boolean})],li.prototype,"onlyDirectionIcon",void 0);Da([T({type:Array})],li.prototype,"images",void 0);Da([T({type:Object})],li.prototype,"secondImage",void 0);li=Da([G("wui-transaction-visual")],li);const zP=Q` + :host > wui-flex:first-child { + align-items: center; + column-gap: var(--wui-spacing-s); + padding: 6.5px var(--wui-spacing-xs) 6.5px var(--wui-spacing-xs); + width: 100%; + } + + :host > wui-flex:first-child wui-text:nth-child(1) { + text-transform: capitalize; + } + + wui-transaction-visual { + width: 40px; + height: 40px; + } + + wui-flex { + flex: 1; + } + + :host wui-flex wui-flex { + overflow: hidden; + } + + :host .description-container wui-text span { + word-break: break-all; + } + + :host .description-container wui-text { + overflow: hidden; + } + + :host .description-separator-icon { + margin: 0px 6px; + } + + :host wui-text > span { + overflow: hidden; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 1; + } +`;var Fr=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let In=class extends q{constructor(){super(...arguments),this.type="approve",this.onlyDirectionIcon=!1,this.images=[],this.price=[],this.amount=[],this.symbol=[]}render(){return v` + + + + + ${yg[this.type]||this.type} + + + ${this.templateDescription()} ${this.templateSecondDescription()} + + + ${this.date} + + `}templateDescription(){var n;const e=(n=this.descriptions)==null?void 0:n[0];return e?v` + + ${e} + + `:null}templateSecondDescription(){var n;const e=(n=this.descriptions)==null?void 0:n[1];return e?v` + + + ${e} + + `:null}};In.styles=[fe,zP];Fr([T()],In.prototype,"type",void 0);Fr([T({type:Array})],In.prototype,"descriptions",void 0);Fr([T()],In.prototype,"date",void 0);Fr([T({type:Boolean})],In.prototype,"onlyDirectionIcon",void 0);Fr([T()],In.prototype,"status",void 0);Fr([T()],In.prototype,"direction",void 0);Fr([T({type:Array})],In.prototype,"images",void 0);Fr([T({type:Array})],In.prototype,"price",void 0);Fr([T({type:Array})],In.prototype,"amount",void 0);Fr([T({type:Array})],In.prototype,"symbol",void 0);In=Fr([G("wui-transaction-list-item")],In);const WP=Q` + :host > wui-flex:first-child { + column-gap: var(--wui-spacing-s); + padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs); + width: 100%; + } + + wui-flex { + display: flex; + flex: 1; + } +`;var HP=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let op=class extends q{render(){return v` + + + + + + + + + `}};op.styles=[fe,WP];op=HP([G("wui-transaction-list-item-loader")],op);const VP=Q` + :host { + display: flex; + justify-content: center; + align-items: center; + height: var(--wui-spacing-m); + padding: 0 var(--wui-spacing-3xs) !important; + border-radius: var(--wui-border-radius-5xs); + } + + :host > wui-text { + transform: translateY(5%); + } + + :host([data-variant='main']) { + background-color: var(--wui-accent-glass-015); + color: var(--wui-color-accent-100); + } + + :host([data-variant='shade']) { + background-color: var(--wui-gray-glass-010); + color: var(--wui-color-fg-200); + } + + :host([data-variant='success']) { + background-color: var(--wui-icon-box-bg-success-100); + color: var(--wui-color-success-100); + } + + :host([data-variant='error']) { + background-color: var(--wui-icon-box-bg-error-100); + color: var(--wui-color-error-100); + } + + :host([data-size='lg']) { + padding: 9px 5px !important; + } + + :host([data-size='lg']) > wui-text { + transform: translateY(2%); + } +`;var k2=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let oc=class extends q{constructor(){super(...arguments),this.variant="main",this.size="lg"}render(){this.dataset.variant=this.variant,this.dataset.size=this.size;const e=this.size==="md"?"mini-700":"micro-700";return v` + + + + `}};oc.styles=[fe,VP];k2([T()],oc.prototype,"variant",void 0);k2([T()],oc.prototype,"size",void 0);oc=k2([G("wui-tag")],oc);const ZP=Q` + button { + column-gap: var(--wui-spacing-s); + padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs); + width: 100%; + background-color: var(--wui-gray-glass-002); + border-radius: var(--wui-border-radius-xs); + color: var(--wui-color-fg-100); + } + + button > wui-text:nth-child(2) { + display: flex; + flex: 1; + } + + wui-icon { + color: var(--wui-color-fg-200) !important; + } + + button:disabled { + background-color: var(--wui-gray-glass-015); + color: var(--wui-gray-glass-015); + } + + button:disabled > wui-tag { + background-color: var(--wui-gray-glass-010); + color: var(--wui-color-fg-300); + } +`;var zr=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let On=class extends q{constructor(){super(...arguments),this.walletImages=[],this.imageSrc="",this.name="",this.installed=!1,this.disabled=!1,this.showAllWallets=!1}render(){return v` + + `}templateAllWallets(){return this.showAllWallets&&this.imageSrc?v` `:this.showAllWallets&&this.walletIcon?v` `:null}templateWalletImage(){return!this.showAllWallets&&this.imageSrc?v``:!this.showAllWallets&&!this.imageSrc?v``:null}templateStatus(){return this.tagLabel&&this.tagVariant?v`${this.tagLabel}`:this.icon?v``:null}};On.styles=[fe,Me,ZP];zr([T({type:Array})],On.prototype,"walletImages",void 0);zr([T()],On.prototype,"imageSrc",void 0);zr([T()],On.prototype,"name",void 0);zr([T()],On.prototype,"tagLabel",void 0);zr([T()],On.prototype,"tagVariant",void 0);zr([T()],On.prototype,"icon",void 0);zr([T()],On.prototype,"walletIcon",void 0);zr([T({type:Boolean})],On.prototype,"installed",void 0);zr([T({type:Boolean})],On.prototype,"disabled",void 0);zr([T({type:Boolean})],On.prototype,"showAllWallets",void 0);On=zr([G("wui-list-wallet")],On);const GP=Q` + :host { + display: block; + width: 40px; + height: 40px; + border-radius: var(--wui-border-radius-3xl); + border: 1px solid var(--wui-gray-glass-010); + overflow: hidden; + } + + wui-icon { + width: 100%; + height: 100%; + } +`;var P8=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let md=class extends q{constructor(){super(...arguments),this.logo="google"}render(){return v` `}};md.styles=[fe,GP];P8([T()],md.prototype,"logo",void 0);md=P8([G("wui-logo")],md);const qP=Q` + :host { + display: block; + } + + button { + width: 50px; + height: 50px; + background: var(--wui-gray-glass-002); + border-radius: var(--wui-border-radius-xs); + } +`;var R2=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let sc=class extends q{constructor(){super(...arguments),this.logo="google",this.disabled=!1}render(){return v` + + `}};sc.styles=[fe,Me,qP];R2([T()],sc.prototype,"logo",void 0);R2([T({type:Boolean})],sc.prototype,"disabled",void 0);sc=R2([G("wui-logo-select")],sc);const KP=Q` + :host { + display: block; + } + + button { + border-radius: var(--wui-border-radius-3xl); + display: flex; + gap: var(--wui-spacing-xs); + padding: var(--wui-spacing-2xs) var(--wui-spacing-s) var(--wui-spacing-2xs) + var(--wui-spacing-xs); + border: 1px solid var(--wui-gray-glass-010); + background-color: var(--wui-gray-glass-005); + color: var(--wui-color-fg-100); + } + + button:disabled { + border: 1px solid var(--wui-gray-glass-005); + background-color: var(--wui-gray-glass-015); + color: var(--wui-gray-glass-015); + } + + @media (hover: hover) and (pointer: fine) { + button:hover:enabled { + background-color: var(--wui-gray-glass-010); + } + + button:active:enabled { + background-color: var(--wui-gray-glass-015); + } + } + + wui-image, + wui-icon-box { + border-radius: var(--wui-border-radius-3xl); + width: 24px; + height: 24px; + box-shadow: 0 0 0 2px var(--wui-gray-glass-005); + } +`;var dh=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let da=class extends q{constructor(){super(...arguments),this.imageSrc=void 0,this.isUnsupportedChain=void 0,this.disabled=!1}render(){return v` + + `}visualTemplate(){return this.isUnsupportedChain?v` + + `:this.imageSrc?v``:v` + + `}};da.styles=[fe,Me,KP];dh([T()],da.prototype,"imageSrc",void 0);dh([T({type:Boolean})],da.prototype,"isUnsupportedChain",void 0);dh([T({type:Boolean})],da.prototype,"disabled",void 0);da=dh([G("wui-network-button")],da);const YP=Q` + :host { + position: relative; + display: block; + } +`;var fh=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let fa=class extends q{constructor(){super(...arguments),this.length=6,this.otp="",this.values=Array.from({length:this.length}).map(()=>""),this.numerics=[],this.shouldInputBeEnabled=e=>this.values.slice(0,e).every(r=>r!==""),this.handleKeyDown=(e,n)=>{const r=e.target,i=this.getInputElement(r),o=["ArrowLeft","ArrowRight","Shift","Delete"];if(!i)return;o.includes(e.key)&&e.preventDefault();const s=i.selectionStart;switch(e.key){case"ArrowLeft":s&&i.setSelectionRange(s+1,s+1),this.focusInputField("prev",n);break;case"ArrowRight":this.focusInputField("next",n);break;case"Shift":this.focusInputField("next",n);break;case"Delete":i.value===""?this.focusInputField("prev",n):this.updateInput(i,n,"");break;case"Backspace":i.value===""?this.focusInputField("prev",n):this.updateInput(i,n,"");break}},this.focusInputField=(e,n)=>{if(e==="next"){const r=n+1;if(!this.shouldInputBeEnabled(r))return;const i=this.numerics[r-1?r:n],o=i?this.getInputElement(i):void 0;o&&o.focus()}}}firstUpdated(){var n,r;this.otp&&(this.values=this.otp.split(""));const e=(n=this.shadowRoot)==null?void 0:n.querySelectorAll("wui-input-numeric");e&&(this.numerics=Array.from(e)),(r=this.numerics[0])==null||r.focus()}render(){return v` + + ${Array.from({length:this.length}).map((e,n)=>v` + this.handleInput(r,n)} + @click=${r=>this.selectInput(r)} + @keydown=${r=>this.handleKeyDown(r,n)} + .disabled=${!this.shouldInputBeEnabled(n)} + .value=${this.values[n]||""} + > + + `)} + + `}updateInput(e,n,r){const i=this.numerics[n],o=e||(i?this.getInputElement(i):void 0);o&&(o.value=r,this.values=this.values.map((s,a)=>a===n?r:s))}selectInput(e){const n=e.target;if(n){const r=this.getInputElement(n);r==null||r.select()}}handleInput(e,n){const r=e.target,i=this.getInputElement(r);if(i){const o=i.value;e.inputType==="insertFromPaste"?this.handlePaste(i,o,n):Ae.isNumber(o)&&e.data?(this.updateInput(i,n,e.data),this.focusInputField("next",n)):this.updateInput(i,n,"")}this.dispatchInputChangeEvent()}handlePaste(e,n,r){const i=n[0];if(i&&Ae.isNumber(i)){this.updateInput(e,r,i);const s=n.substring(1);if(r+140)throw new Error('"version" should be in range from 1 to 40');return e*4+17};Yn.getSymbolTotalCodewords=function(e){return JP[e]};Yn.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e};Yn.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');$2=e};Yn.isKanjiModeEnabled=function(){return typeof $2<"u"};Yn.toSJIS=function(e){return $2(e)};var ph={};(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+n)}}t.isValid=function(r){return r&&typeof r.bit<"u"&&r.bit>=0&&r.bit<4},t.from=function(r,i){if(t.isValid(r))return r;try{return e(r)}catch{return i}}})(ph);function O8(){this.buffer=[],this.length=0}O8.prototype={get:function(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let n=0;n>>e-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const 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 XP=O8;function hf(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}hf.prototype.set=function(t,e,n,r){const i=t*this.size+e;this.data[i]=n,r&&(this.reservedBit[i]=!0)};hf.prototype.get=function(t,e){return this.data[t*this.size+e]};hf.prototype.xor=function(t,e,n){this.data[t*this.size+e]^=n};hf.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var eI=hf,N8={};(function(t){const e=Yn.getSymbolSize;t.getRowColCoords=function(r){if(r===1)return[];const i=Math.floor(r/7)+2,o=e(r),s=o===145?26:Math.ceil((o-13)/(2*i-2))*2,a=[o-7];for(let l=1;l=0&&i<=7},t.from=function(i){return t.isValid(i)?parseInt(i,10):void 0},t.getPenaltyN1=function(i){const o=i.size;let s=0,a=0,l=0,c=null,u=null;for(let d=0;d=5&&(s+=e.N1+(a-5)),c=g,a=1),g=i.get(p,d),g===u?l++:(l>=5&&(s+=e.N1+(l-5)),u=g,l=1)}a>=5&&(s+=e.N1+(a-5)),l>=5&&(s+=e.N1+(l-5))}return s},t.getPenaltyN2=function(i){const o=i.size;let s=0;for(let a=0;a=10&&(a===1488||a===93)&&s++,l=l<<1&2047|i.get(u,c),u>=10&&(l===1488||l===93)&&s++}return s*e.N3},t.getPenaltyN4=function(i){let o=0;const s=i.data.length;for(let l=0;l=0;){const s=o[0];for(let l=0;l0){const o=new Uint8Array(this.degree);return o.set(r,i),o}return r};var nI=P2,j8={},as={},I2={};I2.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var bi={};const U8="[0-9]+",rI="[A-Z $%*+\\-./:]+";let gd="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";gd=gd.replace(/u/g,"\\u");const iI="(?:(?![A-Z0-9 $%*+\\-./:]|"+gd+`)(?:.|[\r +]))+`;bi.KANJI=new RegExp(gd,"g");bi.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");bi.BYTE=new RegExp(iI,"g");bi.NUMERIC=new RegExp(U8,"g");bi.ALPHANUMERIC=new RegExp(rI,"g");const oI=new RegExp("^"+gd+"$"),sI=new RegExp("^"+U8+"$"),aI=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");bi.testKanji=function(e){return oI.test(e)};bi.testNumeric=function(e){return sI.test(e)};bi.testAlphanumeric=function(e){return aI.test(e)};(function(t){const e=I2,n=bi;t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(o,s){if(!o.ccBits)throw new Error("Invalid mode: "+o);if(!e.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?o.ccBits[0]:s<27?o.ccBits[1]:o.ccBits[2]},t.getBestModeForData=function(o){return n.testNumeric(o)?t.NUMERIC:n.testAlphanumeric(o)?t.ALPHANUMERIC:n.testKanji(o)?t.KANJI:t.BYTE},t.toString=function(o){if(o&&o.id)return o.id;throw new Error("Invalid mode")},t.isValid=function(o){return o&&o.bit&&o.ccBits};function r(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+i)}}t.from=function(o,s){if(t.isValid(o))return o;try{return r(o)}catch{return s}}})(as);(function(t){const e=Yn,n=hh,r=ph,i=as,o=I2,s=7973,a=e.getBCHDigit(s);function l(p,g,b){for(let S=1;S<=40;S++)if(g<=t.getCapacity(S,b,p))return S}function c(p,g){return i.getCharCountIndicator(p,g)+4}function u(p,g){let b=0;return p.forEach(function(S){const k=c(S.mode,g);b+=k+S.getBitsLength()}),b}function d(p,g){for(let b=1;b<=40;b++)if(u(p,b)<=t.getCapacity(b,g,i.MIXED))return b}t.from=function(g,b){return o.isValid(g)?parseInt(g,10):b},t.getCapacity=function(g,b,S){if(!o.isValid(g))throw new Error("Invalid QR Code version");typeof S>"u"&&(S=i.BYTE);const k=e.getSymbolTotalCodewords(g),y=n.getTotalCodewordsCount(g,b),m=(k-y)*8;if(S===i.MIXED)return m;const x=m-c(S,g);switch(S){case i.NUMERIC:return Math.floor(x/10*3);case i.ALPHANUMERIC:return Math.floor(x/11*2);case i.KANJI:return Math.floor(x/13);case i.BYTE:default:return Math.floor(x/8)}},t.getBestVersionForData=function(g,b){let S;const k=r.from(b,r.M);if(Array.isArray(g)){if(g.length>1)return d(g,k);if(g.length===0)return 1;S=g[0]}else S=g;return l(S.mode,S.getLength(),k)},t.getEncodedBits=function(g){if(!o.isValid(g)||g<7)throw new Error("Invalid QR Code version");let b=g<<12;for(;e.getBCHDigit(b)-a>=0;)b^=s<=0;)i^=z8<0&&(r=this.data.substr(n),i=parseInt(r,10),e.put(i,o*3+1))};var uI=ac;const dI=as,O1=["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 lc(t){this.mode=dI.ALPHANUMERIC,this.data=t}lc.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};lc.prototype.getLength=function(){return this.data.length};lc.prototype.getBitsLength=function(){return lc.getBitsLength(this.data.length)};lc.prototype.write=function(e){let n;for(n=0;n+2<=this.data.length;n+=2){let r=O1.indexOf(this.data[n])*45;r+=O1.indexOf(this.data[n+1]),e.put(r,11)}this.data.length%2&&e.put(O1.indexOf(this.data[n]),6)};var fI=lc,pI=function(e){for(var n=[],r=e.length,i=0;i=55296&&o<=56319&&r>i+1){var s=e.charCodeAt(i+1);s>=56320&&s<=57343&&(o=(o-55296)*1024+s-56320+65536,i+=1)}if(o<128){n.push(o);continue}if(o<2048){n.push(o>>6|192),n.push(o&63|128);continue}if(o<55296||o>=57344&&o<65536){n.push(o>>12|224),n.push(o>>6&63|128),n.push(o&63|128);continue}if(o>=65536&&o<=1114111){n.push(o>>18|240),n.push(o>>12&63|128),n.push(o>>6&63|128),n.push(o&63|128);continue}n.push(239,191,189)}return new Uint8Array(n).buffer};const hI=pI,mI=as;function cc(t){this.mode=mI.BYTE,typeof t=="string"&&(t=hI(t)),this.data=new Uint8Array(t)}cc.getBitsLength=function(e){return e*8};cc.prototype.getLength=function(){return this.data.length};cc.prototype.getBitsLength=function(){return cc.getBitsLength(this.data.length)};cc.prototype.write=function(t){for(let e=0,n=this.data.length;e=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+` +Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),t.put(n,13)}};var vI=uc,H8={exports:{}};(function(t){var e={single_source_shortest_paths:function(n,r,i){var o={},s={};s[r]=0;var a=e.PriorityQueue.make();a.push(r,0);for(var l,c,u,d,p,g,b,S,k;!a.empty();){l=a.pop(),c=l.value,d=l.cost,p=n[c]||{};for(u in p)p.hasOwnProperty(u)&&(g=p[u],b=d+g,S=s[u],k=typeof s[u]>"u",(k||S>b)&&(s[u]=b,a.push(u,b),o[u]=c))}if(typeof i<"u"&&typeof s[i]>"u"){var y=["Could not find a path from ",r," to ",i,"."].join("");throw new Error(y)}return o},extract_shortest_path_from_predecessor_list:function(n,r){for(var i=[],o=r;o;)i.push(o),n[o],o=n[o];return i.reverse(),i},find_path:function(n,r,i){var o=e.single_source_shortest_paths(n,r,i);return e.extract_shortest_path_from_predecessor_list(o,i)},PriorityQueue:{make:function(n){var r=e.PriorityQueue,i={},o;n=n||{};for(o in r)r.hasOwnProperty(o)&&(i[o]=r[o]);return i.queue=[],i.sorter=n.sorter||r.default_sorter,i},default_sorter:function(n,r){return n.cost-r.cost},push:function(n,r){var i={value:n,cost:r};this.queue.push(i),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e})(H8);var bI=H8.exports;(function(t){const e=as,n=uI,r=fI,i=gI,o=vI,s=bi,a=Yn,l=bI;function c(y){return unescape(encodeURIComponent(y)).length}function u(y,m,x){const A=[];let M;for(;(M=y.exec(x))!==null;)A.push({data:M[0],index:M.index,mode:m,length:M[0].length});return A}function d(y){const m=u(s.NUMERIC,e.NUMERIC,y),x=u(s.ALPHANUMERIC,e.ALPHANUMERIC,y);let A,M;return a.isKanjiModeEnabled()?(A=u(s.BYTE,e.BYTE,y),M=u(s.KANJI,e.KANJI,y)):(A=u(s.BYTE_KANJI,e.BYTE,y),M=[]),m.concat(x,A,M).sort(function(H,w){return H.index-w.index}).map(function(H){return{data:H.data,mode:H.mode,length:H.length}})}function p(y,m){switch(m){case e.NUMERIC:return n.getBitsLength(y);case e.ALPHANUMERIC:return r.getBitsLength(y);case e.KANJI:return o.getBitsLength(y);case e.BYTE:return i.getBitsLength(y)}}function g(y){return y.reduce(function(m,x){const A=m.length-1>=0?m[m.length-1]:null;return A&&A.mode===x.mode?(m[m.length-1].data+=x.data,m):(m.push(x),m)},[])}function b(y){const m=[];for(let x=0;x=0&&a<=6&&(l===0||l===6)||l>=0&&l<=6&&(a===0||a===6)||a>=2&&a<=4&&l>=2&&l<=4?t.set(o+a,s+l,!0,!0):t.set(o+a,s+l,!1,!0))}}function RI(t){const e=t.size;for(let n=8;n>a&1)===1,t.set(i,o,s,!0),t.set(o,i,s,!0)}function L1(t,e,n){const r=t.size,i=TI.getEncodedBits(e,n);let o,s;for(o=0;o<15;o++)s=(i>>o&1)===1,o<6?t.set(o,8,s,!0):o<8?t.set(o+1,8,s,!0):t.set(r-15+o,8,s,!0),o<8?t.set(8,r-o-1,s,!0):o<9?t.set(8,15-o-1+1,s,!0):t.set(8,15-o-1,s,!0);t.set(r-8,8,1,!0)}function II(t,e){const n=t.size;let r=-1,i=n-1,o=7,s=0;for(let a=n-1;a>0;a-=2)for(a===6&&a--;;){for(let l=0;l<2;l++)if(!t.isReserved(i,a-l)){let c=!1;s>>o&1)===1),t.set(i,a-l,c),o--,o===-1&&(s++,o=7)}if(i+=r,i<0||n<=i){i-=r,r=-r;break}}}function OI(t,e,n){const r=new xI;n.forEach(function(l){r.put(l.mode.bit,4),r.put(l.getLength(),AI.getCharCountIndicator(l.mode,t)),l.write(r)});const i=gh.getSymbolTotalCodewords(t),o=xg.getTotalCodewordsCount(t,e),s=(i-o)*8;for(r.getLengthInBits()+4<=s&&r.put(0,4);r.getLengthInBits()%8!==0;)r.putBit(0);const a=(s-r.getLengthInBits())/8;for(let l=0;l=7&&PI(l,e),II(l,s),isNaN(r)&&(r=bg.getBestMask(l,L1.bind(null,l,n))),bg.applyMask(r,l),L1(l,n,r),{modules:l,version:e,errorCorrectionLevel:n,maskPattern:r,segments:i}}I8.create=function(e,n){if(typeof e>"u"||e==="")throw new Error("No input text");let r=N1.M,i,o;return typeof n<"u"&&(r=N1.from(n.errorCorrectionLevel,N1.M),i=ap.from(n.version),o=bg.from(n.maskPattern),n.toSJISFunc&&gh.setToSJISFunction(n.toSJISFunc)),MI(e,i,r,o)};var V8={},O2={};(function(t){function e(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let r=n.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+n);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(o){return[o,o]}))),r.length===6&&r.push("F","F");const i=parseInt(r.join(""),16);return{r:i>>24&255,g:i>>16&255,b:i>>8&255,a:i&255,hex:"#"+r.slice(0,6).join("")}}t.getOptions=function(r){r||(r={}),r.color||(r.color={});const i=typeof r.margin>"u"||r.margin===null||r.margin<0?4:r.margin,o=r.width&&r.width>=21?r.width:void 0,s=r.scale||4;return{width:o,scale:o?4:s,margin:i,color:{dark:e(r.color.dark||"#000000ff"),light:e(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},t.getScale=function(r,i){return i.width&&i.width>=r+i.margin*2?i.width/(r+i.margin*2):i.scale},t.getImageWidth=function(r,i){const o=t.getScale(r,i);return Math.floor((r+i.margin*2)*o)},t.qrToImageData=function(r,i,o){const s=i.modules.size,a=i.modules.data,l=t.getScale(s,o),c=Math.floor((s+o.margin*2)*l),u=o.margin*l,d=[o.color.light,o.color.dark];for(let p=0;p=u&&g>=u&&p"u"&&(!s||!s.getContext)&&(l=s,s=void 0),s||(c=r()),l=e.getOptions(l);const u=e.getImageWidth(o.modules.size,l),d=c.getContext("2d"),p=d.createImageData(u,u);return e.qrToImageData(p.data,o,l),n(d,c,u),d.putImageData(p,0,0),c},t.renderToDataURL=function(o,s,a){let l=a;typeof l>"u"&&(!s||!s.getContext)&&(l=s,s=void 0),l||(l={});const c=t.render(o,s,l),u=l.type||"image/png",d=l.rendererOpts||{};return c.toDataURL(u,d.quality)}})(V8);var Z8={};const LI=O2;function Sv(t,e){const n=t.a/255,r=e+'="'+t.hex+'"';return n<1?r+" "+e+'-opacity="'+n.toFixed(2).slice(1)+'"':r}function D1(t,e,n){let r=t+e;return typeof n<"u"&&(r+=" "+n),r}function DI(t,e,n){let r="",i=0,o=!1,s=0;for(let a=0;a0&&l>0&&t[a-1]||(r+=o?D1("M",l+n,.5+c+n):D1("m",i,0),i=0,o=!1),l+1':"",c="',u='viewBox="0 0 '+a+" "+a+'"',p=''+l+c+` +`;return typeof r=="function"&&r(null,p),p};const BI=QP,Cg=I8,G8=V8,jI=Z8;function N2(t,e,n,r,i){const o=[].slice.call(arguments,1),s=o.length,a=typeof o[s-1]=="function";if(!a&&!BI())throw new Error("Callback required as last argument");if(a){if(s<2)throw new Error("Too few arguments provided");s===2?(i=n,n=e,e=r=void 0):s===3&&(e.getContext&&typeof i>"u"?(i=r,r=void 0):(i=r,r=n,n=e,e=void 0))}else{if(s<1)throw new Error("Too few arguments provided");return s===1?(n=e,e=r=void 0):s===2&&!e.getContext&&(r=n,n=e,e=void 0),new Promise(function(l,c){try{const u=Cg.create(n,r);l(t(u,e,r))}catch(u){c(u)}})}try{const l=Cg.create(n,r);i(null,t(l,e,r))}catch(l){i(l)}}pf.create=Cg.create;pf.toCanvas=N2.bind(null,G8.render);pf.toDataURL=N2.bind(null,G8.renderToDataURL);pf.toString=N2.bind(null,function(t,e,n){return jI.render(t,n)});const UI=.1,Tv=2.5,Si=7;function B1(t,e,n){return t===e?!1:(t-e<0?e-t:t-e)<=n+UI}function FI(t,e){const n=Array.prototype.slice.call(pf.create(t,{errorCorrectionLevel:e}).modules.data,0),r=Math.sqrt(n.length);return n.reduce((i,o,s)=>(s%r===0?i.push([o]):i[i.length-1].push(o))&&i,[])}const zI={generate(t,e,n){const r="#141414",i="transparent",s=[],a=FI(t,"Q"),l=e/a.length,c=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];c.forEach(({x:S,y:k})=>{const y=(a.length-Si)*l*S,m=(a.length-Si)*l*k,x=.45;for(let A=0;A + `)}});const u=Math.floor((n+25)/l),d=a.length/2-u/2,p=a.length/2+u/2-1,g=[];a.forEach((S,k)=>{S.forEach((y,m)=>{if(a[k][m]&&!(ka.length-(Si+1)&&ma.length-(Si+1))&&!(k>d&&kd&&m{var y;b[S]?(y=b[S])==null||y.push(k):b[S]=[k]}),Object.entries(b).map(([S,k])=>{const y=k.filter(m=>k.every(x=>!B1(m,x,l)));return[Number(S),y]}).forEach(([S,k])=>{k.forEach(y=>{s.push(ee``)})}),Object.entries(b).filter(([S,k])=>k.length>1).map(([S,k])=>{const y=k.filter(m=>k.some(x=>B1(m,x,l)));return[Number(S),y]}).map(([S,k])=>{k.sort((m,x)=>mA.some(M=>B1(m,M,l)));x?x.push(m):y.push([m])}return[S,y.map(m=>[m[0],m[m.length-1]])]}).forEach(([S,k])=>{k.forEach(([y,m])=>{s.push(ee` + + `)})}),s}},WI=Q` + :host { + position: relative; + user-select: none; + display: block; + overflow: hidden; + aspect-ratio: 1 / 1; + width: var(--local-size); + } + + :host([data-theme='dark']) { + border-radius: clamp(0px, var(--wui-border-radius-l), 40px); + background-color: var(--wui-color-inverse-100); + padding: var(--wui-spacing-l); + } + + :host([data-theme='light']) { + box-shadow: 0 0 0 1px var(--wui-color-bg-125); + background-color: var(--wui-color-bg-125); + } + + :host([data-clear='true']) > wui-icon { + display: none; + } + + svg:first-child, + wui-image, + wui-icon { + position: absolute; + top: 50%; + left: 50%; + transform: translateY(-50%) translateX(-50%); + } + + wui-image { + width: 25%; + height: 25%; + border-radius: var(--wui-border-radius-xs); + } + + wui-icon { + width: 100%; + height: 100%; + color: #3396ff !important; + transform: translateY(-50%) translateX(-50%) scale(0.25); + } +`;var Ba=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let ci=class extends q{constructor(){super(...arguments),this.uri="",this.size=0,this.theme="dark",this.imageSrc=void 0,this.alt=void 0,this.arenaClear=void 0}render(){return this.dataset.theme=this.theme,this.dataset.clear=String(this.arenaClear),this.style.cssText=`--local-size: ${this.size}px`,v`${this.templateVisual()} ${this.templateSvg()}`}templateSvg(){const e=this.theme==="light"?this.size:this.size-32;return ee` + + ${zI.generate(this.uri,e,this.arenaClear?0:e/4)} + + `}templateVisual(){return this.imageSrc?v``:v``}};ci.styles=[fe,WI];Ba([T()],ci.prototype,"uri",void 0);Ba([T({type:Number})],ci.prototype,"size",void 0);Ba([T()],ci.prototype,"theme",void 0);Ba([T()],ci.prototype,"imageSrc",void 0);Ba([T()],ci.prototype,"alt",void 0);Ba([T({type:Boolean})],ci.prototype,"arenaClear",void 0);ci=Ba([G("wui-qr-code")],ci);const HI=Q` + :host { + position: relative; + display: inline-block; + width: 100%; + } +`;var VI=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let lp=class extends q{constructor(){super(...arguments),this.inputComponentRef=la()}render(){return v` + + + + `}clearValue(){const e=this.inputComponentRef.value,n=e==null?void 0:e.inputElementRef.value;n&&(n.value="",n.focus(),n.dispatchEvent(new Event("input")))}};lp.styles=[fe,HI];lp=VI([G("wui-search-bar")],lp);const ZI=Q` + :host { + display: flex; + column-gap: var(--wui-spacing-xs); + align-items: center; + padding: var(--wui-spacing-xs) var(--wui-spacing-m) var(--wui-spacing-xs) var(--wui-spacing-xs); + border-radius: var(--wui-border-radius-3xl); + border: 1px solid var(--wui-gray-glass-005); + box-sizing: border-box; + max-height: 40px; + background-color: var(--wui-color-bg-175); + box-shadow: + 0px 14px 64px -4px rgba(0, 0, 0, 0.15), + 0px 8px 22px -6px rgba(0, 0, 0, 0.15); + } +`;var mf=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Yo=class extends q{constructor(){super(...arguments),this.backgroundColor="accent-100",this.iconColor="accent-100",this.icon="checkmark",this.message=""}render(){return v` + + ${this.message} + `}};Yo.styles=[fe,ZI];mf([T()],Yo.prototype,"backgroundColor",void 0);mf([T()],Yo.prototype,"iconColor",void 0);mf([T()],Yo.prototype,"icon",void 0);mf([T()],Yo.prototype,"message",void 0);Yo=mf([G("wui-snackbar")],Yo);const GI=Q` + :host { + display: inline-flex; + background-color: var(--wui-gray-glass-002); + border-radius: var(--wui-border-radius-3xl); + padding: var(--wui-spacing-3xs); + position: relative; + height: 36px; + overflow: hidden; + } + + :host::before { + content: ''; + position: absolute; + pointer-events: none; + top: 4px; + left: 4px; + display: block; + width: var(--local-tab-width); + height: 28px; + border-radius: var(--wui-border-radius-3xl); + background-color: var(--wui-gray-glass-002); + box-shadow: inset 0 0 0 1px var(--wui-gray-glass-002); + transform: translateX(calc(var(--local-tab) * var(--local-tab-width))); + transition: transform var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: background-color, opacity; + } + + :host([data-type='flex'])::before { + left: 3px; + transform: translateX(calc((var(--local-tab) * 34px) + (var(--local-tab) * 4px))); + } + + :host([data-type='flex']) { + display: flex; + padding: 0px 0px 0px 12px; + gap: 4px; + } + + :host([data-type='flex']) > button > wui-text { + position: absolute; + left: 18px; + opacity: 0; + } + + button[data-active='true'] > wui-icon, + button[data-active='true'] > wui-text { + color: var(--wui-color-fg-100); + } + + button[data-active='false'] > wui-icon, + button[data-active='false'] > wui-text { + color: var(--wui-color-fg-200); + } + + button[data-active='true']:disabled, + button[data-active='false']:disabled { + background-color: transparent; + opacity: 0.5; + cursor: not-allowed; + } + + button[data-active='true']:disabled > wui-text { + color: var(--wui-color-fg-200); + } + + button[data-active='false']:disabled > wui-text { + color: var(--wui-color-fg-300); + } + + button > wui-icon, + button > wui-text { + pointer-events: none; + transition: color var(--wui-e ase-out-power-1) var(--wui-duration-md); + will-change: color; + } + + button { + width: var(--local-tab-width); + transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: background-color; + } + + :host([data-type='flex']) > button { + width: 34px; + position: relative; + display: flex; + justify-content: flex-start; + } + + button:hover:enabled, + button:active:enabled { + background-color: transparent !important; + } + + button:hover:enabled > wui-icon, + button:active:enabled > wui-icon { + color: var(--wui-color-fg-125); + } + + button:hover:enabled > wui-text, + button:active:enabled > wui-text { + color: var(--wui-color-fg-125); + } + + button { + border-radius: var(--wui-border-radius-3xl); + } +`;var ls=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Nr=class extends q{constructor(){super(...arguments),this.tabs=[],this.onTabChange=()=>null,this.buttons=[],this.disabled=!1,this.localTabWidth="100px",this.activeTab=0,this.isDense=!1}render(){return this.isDense=this.tabs.length>3,this.style.cssText=` + --local-tab: ${this.activeTab}; + --local-tab-width: ${this.localTabWidth}; + `,this.dataset.type=this.isDense?"flex":"block",this.tabs.map((e,n)=>{var i;const r=n===this.activeTab;return v` + + `})}firstUpdated(){this.shadowRoot&&this.isDense&&(this.buttons=[...this.shadowRoot.querySelectorAll("button")],setTimeout(()=>{this.animateTabs(0,!0)},0))}iconTemplate(e){return e.icon?v``:null}onTabClick(e){this.buttons&&this.animateTabs(e,!1),this.activeTab=e,this.onTabChange(e)}animateTabs(e,n){const r=this.buttons[this.activeTab],i=this.buttons[e],o=r==null?void 0:r.querySelector("wui-text"),s=i==null?void 0:i.querySelector("wui-text"),a=i==null?void 0:i.getBoundingClientRect(),l=s==null?void 0:s.getBoundingClientRect();r&&o&&!n&&e!==this.activeTab&&(o.animate([{opacity:0}],{duration:50,easing:"ease",fill:"forwards"}),r.animate([{width:"34px"}],{duration:500,easing:"ease",fill:"forwards"})),i&&a&&l&&s&&(e!==this.activeTab||n)&&(this.localTabWidth=`${Math.round(a.width+l.width)+6}px`,i.animate([{width:`${a.width+l.width}px`}],{duration:n?0:500,fill:"forwards",easing:"ease"}),s.animate([{opacity:1}],{duration:n?0:125,delay:n?0:200,fill:"forwards",easing:"ease"}))}};Nr.styles=[fe,Me,GI];ls([T({type:Array})],Nr.prototype,"tabs",void 0);ls([T()],Nr.prototype,"onTabChange",void 0);ls([T({type:Array})],Nr.prototype,"buttons",void 0);ls([T({type:Boolean})],Nr.prototype,"disabled",void 0);ls([T()],Nr.prototype,"localTabWidth",void 0);ls([K()],Nr.prototype,"activeTab",void 0);ls([K()],Nr.prototype,"isDense",void 0);Nr=ls([G("wui-tabs")],Nr);const qI=Q` + :host { + display: block; + } + + :host > button { + gap: var(--wui-spacing-xxs); + padding: var(--wui-spacing-xs); + padding-right: var(--wui-spacing-1xs); + height: 40px; + border-width: 0px; + background: var(--wui-gray-glass-002); + box-shadow: inset 0 0 0 1px var(--wui-gray-glass-002); + } + + :host > button wui-image { + width: 24px; + height: 24px; + border-radius: var(--wui-border-radius-s); + box-shadow: inset 0 0 0 1px var(--wui-gray-glass-010); + } +`;var M2=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let dc=class extends q{constructor(){super(...arguments),this.text=""}render(){return v` + + `}tokenTemplate(){return this.imageSrc?v``:v` + + `}};dc.styles=[fe,Me,qI];M2([T()],dc.prototype,"imageSrc",void 0);M2([T()],dc.prototype,"text",void 0);dc=M2([G("wui-token-button")],dc);const KI=Q` + :host { + display: block; + padding: 9px var(--wui-spacing-s) 10px var(--wui-spacing-s); + border-radius: var(--wui-border-radius-xxs); + + color: var(--wui-color-bg-100); + position: relative; + } + + :host([data-variant='shade']) { + background-color: var(--wui-color-bg-150); + border: 1px solid var(--wui-gray-glass-005); + } + + :host([data-variant='shade']) > wui-text { + color: var(--wui-color-fg-150); + } + + :host([data-variant='fill']) { + background-color: var(--wui-color-fg-100); + border: none; + } + + wui-icon { + position: absolute; + width: 12px !important; + height: 4px !important; + } + + wui-icon[data-placement='top'] { + bottom: 0px; + left: 50%; + transform: translate(-50%, 95%); + } + + wui-icon[data-placement='bottom'] { + top: 0; + left: 50%; + transform: translate(-50%, -95%) rotate(180deg); + } + + wui-icon[data-placement='right'] { + top: 50%; + left: 0; + transform: translate(-65%, -50%) rotate(90deg); + } + + wui-icon[data-placement='left'] { + top: 50%; + right: 0%; + transform: translate(65%, -50%) rotate(270deg); + } +`;var wh=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let pa=class extends q{constructor(){super(...arguments),this.placement="top",this.variant="fill",this.message=""}render(){return this.dataset.variant=this.variant,v` + ${this.message}`}};pa.styles=[fe,Me,KI];wh([T()],pa.prototype,"placement",void 0);wh([T()],pa.prototype,"variant",void 0);wh([T()],pa.prototype,"message",void 0);pa=wh([G("wui-tooltip")],pa);const YI=Q` + :host > wui-flex { + cursor: pointer; + display: flex; + column-gap: var(--wui-spacing-s); + padding: var(--wui-spacing-xs); + padding-right: var(--wui-spacing-l); + width: 100%; + background-color: transparent; + border-radius: var(--wui-border-radius-xs); + color: var(--wui-color-fg-250); + transition: background-color 0.2s linear; + } + + :host > wui-flex:hover { + background-color: var(--wui-gray-glass-002); + } + + :host([disabled]) > wui-flex { + opacity: 0.6; + } + + :host([disabled]) > wui-flex:hover { + background-color: transparent; + } + + :host > wui-flex > wui-flex { + flex: 1; + } + + :host > wui-flex > wui-image { + width: 40px; + height: 40px; + border-radius: var(--wui-border-radius-3xl); + position: relative; + } + + :host > wui-flex > wui-image::after { + position: absolute; + content: ''; + inset: 0; + box-shadow: inset 0 0 0 1px var(--wui-gray-glass-010); + border-radius: var(--wui-border-radius-l); + } + + button > wui-icon-box[data-variant='square-blue'] { + border-radius: var(--wui-border-radius-3xs); + position: relative; + border: none; + width: 36px; + height: 36px; + } +`;var Pc=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Hi=class extends q{constructor(){super(...arguments),this.imageSrc=void 0,this.name=void 0,this.symbol=void 0,this.price=void 0,this.amount=void 0}render(){var n;const e=(n=hg.multiply(this.price,this.amount))==null?void 0:n.toFixed(3);return v` + + ${this.visualTemplate()} + + + ${this.name} + ${e?v` + + $${Ae.formatNumberToLocalString(e,3)} + + `:null} + + + ${this.symbol} + ${this.amount&&v`${Ae.formatNumberToLocalString(this.amount,4)}`} + + + + `}visualTemplate(){return this.imageSrc?v``:null}};Hi.styles=[fe,Me,YI];Pc([T()],Hi.prototype,"imageSrc",void 0);Pc([T()],Hi.prototype,"name",void 0);Pc([T()],Hi.prototype,"symbol",void 0);Pc([T()],Hi.prototype,"price",void 0);Pc([T()],Hi.prototype,"amount",void 0);Hi=Pc([G("wui-token-list-item")],Hi);const QI=Q` + :host { + display: flex; + justify-content: center; + align-items: center; + width: var(--wui-icon-box-size-xl); + height: var(--wui-icon-box-size-xl); + box-shadow: 0 0 0 8px var(--wui-thumbnail-border); + border-radius: var(--local-border-radius); + overflow: hidden; + } + + wui-icon { + width: 32px; + height: 32px; + } +`;var yh=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let ha=class extends q{render(){return this.style.cssText=`--local-border-radius: ${this.borderRadiusFull?"1000px":"20px"};`,v`${this.templateVisual()}`}templateVisual(){return this.imageSrc?v``:v``}};ha.styles=[fe,QI];yh([T()],ha.prototype,"imageSrc",void 0);yh([T()],ha.prototype,"alt",void 0);yh([T({type:Boolean})],ha.prototype,"borderRadiusFull",void 0);ha=yh([G("wui-visual-thumbnail")],ha);const JI=Q` + :host { + display: block; + } + + button { + width: 100%; + display: block; + padding-top: var(--wui-spacing-l); + padding-bottom: var(--wui-spacing-l); + padding-left: var(--wui-spacing-s); + padding-right: var(--wui-spacing-2l); + border-radius: var(--wui-border-radius-s); + background-color: var(--wui-accent-glass-015); + } + + button:hover { + background-color: var(--wui-accent-glass-010) !important; + } + + button:active { + background-color: var(--wui-accent-glass-020) !important; + } +`;var vh=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let ma=class extends q{constructor(){super(...arguments),this.label="",this.description="",this.icon="wallet"}render(){return v` + + `}};ma.styles=[fe,Me,JI];vh([T()],ma.prototype,"label",void 0);vh([T()],ma.prototype,"description",void 0);vh([T()],ma.prototype,"icon",void 0);ma=vh([G("wui-notice-card")],ma);const XI=Q` + button { + height: auto; + position: relative; + flex-direction: column; + gap: var(--wui-spacing-s); + padding: 17px 18px 17px var(--wui-spacing-m); + width: 100%; + background-color: var(--wui-gray-glass-002); + border-radius: var(--wui-border-radius-xs); + color: var(--wui-color-fg-250); + } + + .overflowedContent { + width: 100%; + overflow: hidden; + } + + .overflowedContent[data-active='false']:after { + content: ''; + position: absolute; + top: 50%; + left: 0; + right: 0; + bottom: 0; + background: linear-gradient(to top, var(--wui-color-bg-200), transparent); + border-bottom-left-radius: var(--wui-border-radius-xs); + border-bottom-right-radius: var(--wui-border-radius-xs); + } + + .heightContent { + max-height: 100px; + } + + pre { + text-align: left; + white-space: pre-wrap; + height: auto; + overflow-x: auto; + overflow-wrap: anywhere; + } +`;var L2=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};const j1=100;let fc=class extends q{constructor(){super(...arguments),this.textTitle="",this.overflowedContent="",this.toggled=!1,this.enableAccordion=!1,this.scrollElement=void 0,this.scrollHeightElement=0}updated(e){super.updated(e),(e.has("textTitle")||e.has("overflowedContent"))&&setTimeout(()=>{this.checkHeight()},1)}checkHeight(){this.updateComplete.then(()=>{var r,i;const e=(r=this.shadowRoot)==null?void 0:r.querySelector(".heightContent"),n=(i=this.shadowRoot)==null?void 0:i.querySelector(".textContent");if(e&&n){this.scrollElement=e;const o=n==null?void 0:n.scrollHeight;o&&o>j1&&(this.enableAccordion=!0,this.scrollHeightElement=o,this.requestUpdate())}})}render(){return v` + + `}onClick(){var n;const e=(n=this.shadowRoot)==null?void 0:n.querySelector("wui-icon");this.enableAccordion&&(this.toggled=!this.toggled,this.requestUpdate(),this.scrollElement&&this.scrollElement.animate([{maxHeight:this.toggled?`${j1}px`:`${this.scrollHeightElement}px`},{maxHeight:this.toggled?`${this.scrollHeightElement}px`:`${j1}px`}],{duration:300,fill:"forwards",easing:"ease"}),e&&e.animate([{transform:this.toggled?"rotate(0deg)":"rotate(180deg)"},{transform:this.toggled?"rotate(180deg)":"rotate(0deg)"}],{duration:300,fill:"forwards",easing:"ease"}))}chevronTemplate(){return this.enableAccordion?v` `:null}};fc.styles=[fe,Me,XI];L2([T()],fc.prototype,"textTitle",void 0);L2([T()],fc.prototype,"overflowedContent",void 0);fc=L2([G("wui-list-accordion")],fc);const eO=Q` + :host { + display: flex; + column-gap: var(--wui-spacing-s); + padding: 17px 18px 17px var(--wui-spacing-m); + width: 100%; + background-color: var(--wui-gray-glass-002); + border-radius: var(--wui-border-radius-xs); + color: var(--wui-color-fg-250); + } + + wui-image { + width: var(--wui-icon-size-lg); + height: var(--wui-icon-size-lg); + border-radius: var(--wui-border-radius-3xl); + } + + wui-icon { + width: var(--wui-icon-size-lg); + height: var(--wui-icon-size-lg); + } +`;var bh=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let ga=class extends q{constructor(){super(...arguments),this.imageSrc=void 0,this.textTitle="",this.textValue=void 0}render(){return v` + + + ${this.textTitle} + + ${this.templateContent()} + + `}templateContent(){return this.imageSrc?v``:this.textValue?v` ${this.textValue} `:v``}};ga.styles=[fe,Me,eO];bh([T()],ga.prototype,"imageSrc",void 0);bh([T()],ga.prototype,"textTitle",void 0);bh([T()],ga.prototype,"textValue",void 0);ga=bh([G("wui-list-content")],ga);const tO=Q` + button { + column-gap: var(--wui-spacing-s); + padding: 7px var(--wui-spacing-l) 7px var(--wui-spacing-xs); + width: 100%; + background-color: var(--wui-gray-glass-002); + border-radius: var(--wui-border-radius-xs); + color: var(--wui-color-fg-100); + } + + button > wui-text:nth-child(2) { + display: flex; + flex: 1; + } + + button[data-transparent='true'] { + pointer-events: none; + background-color: transparent; + } + + wui-icon { + color: var(--wui-color-fg-200) !important; + } + + button:disabled { + background-color: var(--wui-gray-glass-015); + color: var(--wui-gray-glass-015); + } + + button:disabled > wui-tag { + background-color: var(--wui-gray-glass-010); + color: var(--wui-color-fg-300); + } +`;var gf=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Qo=class extends q{constructor(){super(...arguments),this.imageSrc="",this.name="",this.disabled=!1,this.transparent=!1}render(){return v` + + `}templateNetworkImage(){return this.imageSrc?v``:this.imageSrc?null:v``}};Qo.styles=[fe,Me,tO];gf([T()],Qo.prototype,"imageSrc",void 0);gf([T()],Qo.prototype,"name",void 0);gf([T({type:Boolean})],Qo.prototype,"disabled",void 0);gf([T({type:Boolean})],Qo.prototype,"transparent",void 0);Qo=gf([G("wui-list-network")],Qo);const nO=Q` + :host { + display: flex; + flex-direction: column; + gap: var(--wui-spacing-l); + padding: 17px 18px 17px var(--wui-spacing-m); + width: 100%; + background-color: var(--wui-gray-glass-002); + border-radius: var(--wui-border-radius-xs); + color: var(--wui-color-fg-250); + } + + wui-image { + width: var(--wui-icon-size-lg); + height: var(--wui-icon-size-lg); + border-radius: var(--wui-border-radius-3xl); + } + + wui-icon { + width: var(--wui-icon-size-lg); + height: var(--wui-icon-size-lg); + } +`;var Ic=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Vi=class extends q{constructor(){super(...arguments),this.amount="",this.networkCurreny="",this.networkImageUrl="",this.receiverAddress="",this.addressExplorerUrl=""}render(){return v` + + Sending + + + ${this.amount} ${this.networkCurreny} + + ${this.templateNetworkVisual()} + + + + To + + + `}templateNetworkVisual(){return this.networkImageUrl?v``:v``}};Vi.styles=[fe,Me,nO];Ic([T()],Vi.prototype,"amount",void 0);Ic([T()],Vi.prototype,"networkCurreny",void 0);Ic([T()],Vi.prototype,"networkImageUrl",void 0);Ic([T()],Vi.prototype,"receiverAddress",void 0);Ic([T()],Vi.prototype,"addressExplorerUrl",void 0);Vi=Ic([G("wui-list-wallet-transaction")],Vi);const rO=Q` + :host { + width: 100%; + } + + :host > wui-flex { + width: 100%; + padding: var(--wui-spacing-s); + border-radius: var(--wui-border-radius-xs); + width: 100%; + display: flex; + align-items: center; + justify-content: flex-start; + gap: var(--wui-spacing-s); + } + + :host > wui-flex:hover { + background-color: var(--wui-gray-glass-002); + } + + .purchase-image-container { + display: flex; + justify-content: center; + align-items: center; + position: relative; + width: var(--wui-icon-box-size-lg); + height: var(--wui-icon-box-size-lg); + } + + .purchase-image-container wui-image { + width: 100%; + height: 100%; + position: relative; + border-radius: calc(var(--wui-icon-box-size-lg) / 2); + } + + .purchase-image-container wui-image::after { + content: ''; + display: block; + width: 100%; + height: 100%; + position: absolute; + inset: 0; + border-radius: calc(var(--wui-icon-box-size-lg) / 2); + box-shadow: inset 0 0 0 1px var(--wui-gray-glass-005); + } + + .purchase-image-container wui-icon-box { + position: absolute; + right: 0; + bottom: 0; + transform: translate(20%, 20%); + } +`;var Qn=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let on=class extends q{constructor(){super(...arguments),this.disabled=!1,this.color="inherit",this.label="Bought",this.purchaseValue="",this.purchaseCurrency="",this.date="",this.completed=!1,this.inProgress=!1,this.failed=!1,this.onClick=null,this.symbol=""}firstUpdated(){this.icon||this.fetchTokenImage()}render(){return v` + + ${this.imageTemplate()} + + + ${this.statusIconTemplate()} + ${this.label} + + + + ${this.purchaseValue} ${this.purchaseCurrency} + + + ${this.inProgress?v``:v`${this.date}`} + + `}async fetchTokenImage(){await xe._fetchTokenImage(this.purchaseCurrency)}statusIconTemplate(){return this.inProgress?null:this.completed?this.boughtIconTemplate():this.errorIconTemplate()}errorIconTemplate(){return v``}imageTemplate(){const e=this.icon||`https://avatar.vercel.sh/andrew.svg?size=50&text=${this.symbol}`;return v` + + `}boughtIconTemplate(){return v``}};on.styles=[fe,Me,rO];Qn([T({type:Boolean})],on.prototype,"disabled",void 0);Qn([T()],on.prototype,"color",void 0);Qn([T()],on.prototype,"label",void 0);Qn([T()],on.prototype,"purchaseValue",void 0);Qn([T()],on.prototype,"purchaseCurrency",void 0);Qn([T()],on.prototype,"date",void 0);Qn([T({type:Boolean})],on.prototype,"completed",void 0);Qn([T({type:Boolean})],on.prototype,"inProgress",void 0);Qn([T({type:Boolean})],on.prototype,"failed",void 0);Qn([T()],on.prototype,"onClick",void 0);Qn([T()],on.prototype,"symbol",void 0);Qn([T()],on.prototype,"icon",void 0);on=Qn([G("wui-onramp-activity-item")],on);const iO=Q` + button { + padding: var(--wui-spacing-s); + border-radius: var(--wui-border-radius-xs); + background-color: var(--wui-gray-glass-002); + width: 100%; + display: flex; + align-items: center; + justify-content: flex-start; + gap: var(--wui-spacing-s); + transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: background-color; + } + + button:hover { + background-color: var(--wui-gray-glass-005); + } + + .provider-image { + width: var(--wui-spacing-3xl); + min-width: var(--wui-spacing-3xl); + height: var(--wui-spacing-3xl); + border-radius: calc(var(--wui-border-radius-xs) - calc(var(--wui-spacing-s) / 2)); + position: relative; + overflow: hidden; + } + + .provider-image::after { + content: ''; + display: block; + width: 100%; + height: 100%; + position: absolute; + inset: 0; + border-radius: calc(var(--wui-border-radius-xs) - calc(var(--wui-spacing-s) / 2)); + box-shadow: inset 0 0 0 1px var(--wui-gray-glass-005); + } + + .network-icon { + width: var(--wui-spacing-m); + height: var(--wui-spacing-m); + border-radius: calc(var(--wui-spacing-m) / 2); + overflow: hidden; + box-shadow: + 0 0 0 3px var(--wui-gray-glass-002), + 0 0 0 3px var(--wui-color-modal-bg); + transition: box-shadow var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: box-shadow; + } + + button:hover .network-icon { + box-shadow: + 0 0 0 3px var(--wui-gray-glass-005), + 0 0 0 3px var(--wui-color-modal-bg); + } +`;var cs=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Mr=class extends q{constructor(){super(...arguments),this.disabled=!1,this.color="inherit",this.label="",this.feeRange="",this.loading=!1,this.onClick=null}render(){return v` + + `}networksTemplate(){var r;const e=me.getRequestedCaipNetworks(),n=(r=e==null?void 0:e.filter(i=>i==null?void 0:i.imageId))==null?void 0:r.slice(0,5);return v` + + ${n==null?void 0:n.map(i=>v` + + + + `)} + + `}};Mr.styles=[fe,Me,iO];cs([T({type:Boolean})],Mr.prototype,"disabled",void 0);cs([T()],Mr.prototype,"color",void 0);cs([T()],Mr.prototype,"name",void 0);cs([T()],Mr.prototype,"label",void 0);cs([T()],Mr.prototype,"feeRange",void 0);cs([T({type:Boolean})],Mr.prototype,"loading",void 0);cs([T()],Mr.prototype,"onClick",void 0);Mr=cs([G("wui-onramp-provider-item")],Mr);const oO=Q` + button { + display: flex; + gap: var(--wui-spacing-3xs); + align-items: center; + padding: 6.25px var(--wui-spacing-xs) 7.25px var(--wui-spacing-s); + background-color: var(--wui-gray-glass-090); + border-radius: var(--wui-border-radius-3xl); + border: 1px solid var(--wui-gray-glass-060); + transition: background-color var(--wui-duration-md) var(--wui-ease-inout-power-1); + will-change: background-color; + } + + @media (hover: hover) and (pointer: fine) { + button:hover:enabled { + background-color: var(--wui-gray-glass-080); + } + + button:active:enabled { + background-color: var(--wui-gray-glass-060); + } + } +`;var q8=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let wd=class extends q{constructor(){super(...arguments),this.text=""}render(){return v``}};wd.styles=[fe,Me,oO];q8([T()],wd.prototype,"text",void 0);wd=q8([G("wui-promo")],wd);const sO=Q` + :host { + position: relative; + } + + button { + display: flex; + justify-content: center; + align-items: center; + height: 48px; + width: 100%; + background-color: var(--wui-accent-glass-010); + border-radius: var(--wui-border-radius-xs); + border: 1px solid var(--wui-accent-glass-010); + transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: background-color; + } + + wui-tooltip { + padding: 7px var(--wui-spacing-s) 8px var(--wui-spacing-s); + position: absolute; + top: -8px; + left: 50%; + transform: translate(-50%, -100%); + opacity: 0; + } + + @media (hover: hover) and (pointer: fine) { + button:hover:enabled { + background-color: var(--wui-accent-glass-015); + } + + button:active:enabled { + background-color: var(--wui-accent-glass-020); + } + } +`;var D2=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let pc=class extends q{constructor(){super(...arguments),this.text="",this.icon="card"}render(){return v` + `}onMouseEnter(){var n;const e=(n=this.shadowRoot)==null?void 0:n.querySelector("wui-tooltip");e&&(e==null||e.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease",duration:250}))}onMouseLeave(){var n;const e=(n=this.shadowRoot)==null?void 0:n.querySelector("wui-tooltip");e&&(e==null||e.animate([{opacity:1},{opacity:0}],{fill:"forwards",easing:"ease",duration:200}))}};pc.styles=[fe,Me,sO];D2([T()],pc.prototype,"text",void 0);D2([T()],pc.prototype,"icon",void 0);pc=D2([G("wui-tooltip-select")],pc);const aO=Q` + span { + font-weight: 500; + font-size: 40px; + color: var(--wui-color-fg-100); + line-height: 130%; /* 52px */ + letter-spacing: -1.6px; + text-align: center; + } + + .pennies { + color: var(--wui-color-fg-200); + } +`;var B2=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let hc=class extends q{constructor(){super(...arguments),this.dollars="0",this.pennies="00"}render(){return v`$${this.dollars}.${this.pennies}`}};hc.styles=[fe,aO];B2([T()],hc.prototype,"dollars",void 0);B2([T()],hc.prototype,"pennies",void 0);hc=B2([G("wui-balance")],hc);const lO=Q` + button { + background-color: var(--wui-gray-glass-002); + border-radius: var(--wui-border-radius-3xl); + border: 1px solid var(--wui-gray-glass-002); + padding: var(--wui-spacing-xs) var(--wui-spacing-s) var(--wui-spacing-xs) var(--wui-spacing-xs); + position: relative; + } + + wui-avatar { + width: 32px; + height: 32px; + box-shadow: 0 0 0 0; + outline: 3px solid var(--wui-gray-glass-005); + } + + wui-icon-box, + wui-image { + width: 16px; + height: 16px; + border-radius: var(--wui-border-radius-3xl); + position: absolute; + left: 26px; + top: 24px; + } + + wui-image { + outline: 2px solid var(--wui-color-bg-125); + } + + wui-icon-box { + outline: 2px solid var(--wui-color-bg-200); + background-color: var(--wui-color-bg-250); + } +`;var Oc=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Zi=class extends q{constructor(){super(...arguments),this.networkSrc=void 0,this.avatarSrc=void 0,this.isProfileName=!1,this.address="",this.icon="chevronBottom"}render(){return v``}networkImageTemplate(){return this.networkSrc?v``:v` + + `}};Zi.styles=[fe,Me,lO];Oc([T()],Zi.prototype,"networkSrc",void 0);Oc([T()],Zi.prototype,"avatarSrc",void 0);Oc([T({type:Boolean})],Zi.prototype,"isProfileName",void 0);Oc([T()],Zi.prototype,"address",void 0);Oc([T()],Zi.prototype,"icon",void 0);Zi=Oc([G("wui-profile-button")],Zi);const cO=Q` + button { + border: 1px solid var(--wui-gray-glass-010); + border-radius: var(--wui-border-radius-3xl); + } + + wui-image { + border-radius: var(--wui-border-radius-3xl); + overflow: hidden; + } + + button.disabled > wui-icon, + button.disabled > wui-image { + filter: grayscale(1); + } + + button[data-variant='fill'] { + color: var(--wui-color-inverse-100); + background-color: var(--wui-color-accent-100); + } + + button[data-variant='shade'], + button[data-variant='shadeSmall'] { + background-color: transparent; + background-color: var(--wui-gray-glass-010); + color: var(--wui-color-fg-200); + } + + button[data-variant='success'] { + column-gap: var(--wui-spacing-xxs); + border: 1px solid var(--wui-success-glass-010); + background-color: var(--wui-success-glass-010); + color: var(--wui-color-success-100); + } + + button[data-variant='error'] { + column-gap: var(--wui-spacing-xxs); + border: 1px solid var(--wui-error-glass-010); + background-color: var(--wui-error-glass-010); + color: var(--wui-color-error-100); + } + + button[data-variant='transparent'] { + column-gap: var(--wui-spacing-xxs); + background-color: transparent; + color: var(--wui-color-fg-150); + } + + button[data-variant='transparent'], + button[data-variant='success'], + button[data-variant='shadeSmall'], + button[data-variant='error'] { + padding: 7px var(--wui-spacing-s) 7px 8px; + } + + button[data-variant='transparent']:has(wui-text:first-child), + button[data-variant='success']:has(wui-text:first-child), + button[data-variant='shadeSmall']:has(wui-text:first-child), + button[data-variant='error']:has(wui-text:first-child) { + padding: 7px var(--wui-spacing-s); + } + + button[data-variant='fill'], + button[data-variant='shade'] { + column-gap: var(--wui-spacing-xs); + padding: var(--wui-spacing-xxs) var(--wui-spacing-m) var(--wui-spacing-xxs) + var(--wui-spacing-xs); + } + + button[data-variant='fill']:has(wui-text:first-child), + button[data-variant='shade']:has(wui-text:first-child) { + padding: 9px var(--wui-spacing-m) 9px var(--wui-spacing-m); + } + + button[data-variant='fill'] > wui-image, + button[data-variant='shade'] > wui-image { + width: 24px; + height: 24px; + } + + button[data-variant='fill'] > wui-image { + box-shadow: inset 0 0 0 1px var(--wui-color-accent-090); + } + + button[data-variant='shade'] > wui-image, + button[data-variant='shadeSmall'] > wui-image { + box-shadow: inset 0 0 0 1px var(--wui-gray-glass-010); + } + + button[data-variant='fill'] > wui-icon, + button[data-variant='shade'] > wui-icon { + width: 14px; + height: 14px; + } + + button[data-variant='transparent'] > wui-image, + button[data-variant='success'] > wui-image, + button[data-variant='shadeSmall'] > wui-image, + button[data-variant='error'] > wui-image { + width: 14px; + height: 14px; + } + + button[data-variant='transparent'] > wui-icon, + button[data-variant='success'] > wui-icon, + button[data-variant='shadeSmall'] > wui-icon, + button[data-variant='error'] > wui-icon { + width: 12px; + height: 12px; + } + + button[data-variant='fill']:focus-visible { + background-color: var(--wui-color-accent-090); + } + + button[data-variant='shade']:focus-visible, + button[data-variant='shadeSmall']:focus-visible { + background-color: var(--wui-gray-glass-015); + } + + button[data-variant='transparent']:focus-visible { + background-color: var(--wui-gray-glass-005); + } + + button[data-variant='success']:focus-visible { + background-color: var(--wui-success-glass-015); + } + + button[data-variant='error']:focus-visible { + background-color: var(--wui-error-glass-015); + } + + button.disabled { + color: var(--wui-gray-glass-015); + background-color: var(--wui-gray-glass-015); + pointer-events: none; + } + + @media (hover: hover) and (pointer: fine) { + button[data-variant='fill']:hover { + background-color: var(--wui-color-accent-090); + } + + button[data-variant='shade']:hover, + button[data-variant='shadeSmall']:hover { + background-color: var(--wui-gray-glass-015); + } + + button[data-variant='transparent']:hover { + background-color: var(--wui-gray-glass-005); + } + + button[data-variant='success']:hover { + background-color: var(--wui-success-glass-015); + } + + button[data-variant='error']:hover { + background-color: var(--wui-error-glass-015); + } + } + + button[data-variant='fill']:active { + background-color: var(--wui-color-accent-080); + } + + button[data-variant='shade']:active, + button[data-variant='shadeSmall']:active { + background-color: var(--wui-gray-glass-020); + } + + button[data-variant='transparent']:active { + background-color: var(--wui-gray-glass-010); + } + + button[data-variant='success']:active { + background-color: var(--wui-success-glass-020); + } + + button[data-variant='error']:active { + background-color: var(--wui-error-glass-020); + } +`;var Nc=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Gi=class extends q{constructor(){super(...arguments),this.variant="fill",this.imageSrc="",this.disabled=!1,this.icon="externalLink",this.text=""}render(){const n=this.variant==="success"||this.variant==="transparent"||this.variant==="shadeSmall"?"small-600":"paragraph-600";return v` + + `}};Gi.styles=[fe,Me,cO];Nc([T()],Gi.prototype,"variant",void 0);Nc([T()],Gi.prototype,"imageSrc",void 0);Nc([T({type:Boolean})],Gi.prototype,"disabled",void 0);Nc([T()],Gi.prototype,"icon",void 0);Nc([T()],Gi.prototype,"text",void 0);Gi=Nc([G("wui-chip-button")],Gi);const uO=Q` + button { + display: flex; + gap: var(--wui-spacing-xl); + width: 100%; + background-color: var(--wui-gray-glass-002); + border-radius: var(--wui-border-radius-xxs); + padding: var(--wui-spacing-m) var(--wui-spacing-s); + } + + wui-text { + width: 100%; + } + + wui-flex { + width: auto; + } + + .network-icon { + width: var(--wui-spacing-2l); + height: var(--wui-spacing-2l); + border-radius: calc(var(--wui-spacing-2l) / 2); + overflow: hidden; + box-shadow: + 0 0 0 3px var(--wui-gray-glass-002), + 0 0 0 3px var(--wui-color-modal-bg); + } +`;var j2=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let mc=class extends q{constructor(){super(...arguments),this.networkImages=[""],this.text=""}render(){return v` + + `}networksTemplate(){const e=this.networkImages.slice(0,5);return v` + ${e==null?void 0:e.map(n=>v` `)} + `}};mc.styles=[fe,Me,uO];j2([T({type:Array})],mc.prototype,"networkImages",void 0);j2([T()],mc.prototype,"text",void 0);mc=j2([G("wui-compatible-network")],mc);const dO=Q` + wui-flex { + width: 100%; + background-color: var(--wui-gray-glass-005); + border-radius: var(--wui-border-radius-s); + padding: var(--wui-spacing-1xs) var(--wui-spacing-s) var(--wui-spacing-1xs) + var(--wui-spacing-1xs); + } +`;var U2=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let gc=class extends q{constructor(){super(...arguments),this.icon="externalLink",this.text=""}render(){return v` + + + ${this.text} + + `}};gc.styles=[fe,Me,dO];U2([T()],gc.prototype,"icon",void 0);U2([T()],gc.prototype,"text",void 0);gc=U2([G("wui-banner")],gc);const fO=Q` + button { + padding: 6.5px var(--wui-spacing-l) 6.5px var(--wui-spacing-xs); + display: flex; + justify-content: space-between; + width: 100%; + border-radius: var(--wui-border-radius-xs); + background-color: var(--wui-gray-glass-002); + } + + button[data-clickable='false'] { + pointer-events: none; + background-color: transparent; + } + + wui-image { + width: var(--wui-spacing-3xl); + height: var(--wui-spacing-3xl); + border-radius: var(--wui-border-radius-3xl); + } +`;var ja=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let ui=class extends q{constructor(){super(...arguments),this.tokenName="",this.tokenImageUrl="",this.tokenValue=0,this.tokenAmount="0.0",this.tokenCurrency="",this.clickable=!1}render(){return v` + + `}};ui.styles=[fe,Me,fO];ja([T()],ui.prototype,"tokenName",void 0);ja([T()],ui.prototype,"tokenImageUrl",void 0);ja([T({type:Number})],ui.prototype,"tokenValue",void 0);ja([T()],ui.prototype,"tokenAmount",void 0);ja([T()],ui.prototype,"tokenCurrency",void 0);ja([T({type:Boolean})],ui.prototype,"clickable",void 0);ui=ja([G("wui-list-token")],ui);const pO=Q` + button { + width: 100%; + display: flex; + gap: var(--wui-spacing-s); + align-items: center; + justify-content: flex-start; + padding: var(--wui-spacing-s) var(--wui-spacing-m) var(--wui-spacing-s) var(--wui-spacing-s); + background-color: var(--wui-gray-glass-002); + border-radius: var(--wui-border-radius-xs); + } + + wui-icon-box { + width: var(--wui-spacing-2xl); + height: var(--wui-spacing-2xl); + } + + wui-flex { + width: auto; + } +`;var us=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Lr=class extends q{constructor(){super(...arguments),this.icon="card",this.text="",this.description="",this.tag=void 0,this.iconBackgroundColor="accent-100",this.iconColor="accent-100",this.disabled=!1}render(){return v` + + `}titleTemplate(){return this.tag?v` ${this.text}${this.tag} + `:v`${this.text}`}};Lr.styles=[fe,Me,pO];us([T()],Lr.prototype,"icon",void 0);us([T()],Lr.prototype,"text",void 0);us([T()],Lr.prototype,"description",void 0);us([T()],Lr.prototype,"tag",void 0);us([T()],Lr.prototype,"iconBackgroundColor",void 0);us([T()],Lr.prototype,"iconColor",void 0);us([T({type:Boolean})],Lr.prototype,"disabled",void 0);Lr=us([G("wui-list-description")],Lr);const hO=Q` + :host { + position: relative; + display: inline-block; + } + + input { + background: transparent; + width: 100%; + height: auto; + font-family: var(--wui-font-family); + color: var(--wui-color-fg-100); + + font-feature-settings: 'case' on; + font-size: 32px; + font-weight: var(--wui-font-weight-light); + caret-color: var(--wui-color-accent-100); + line-height: 130%; + letter-spacing: -1.28px; + box-sizing: border-box; + -webkit-appearance: none; + -moz-appearance: textfield; + padding: 0px; + } + + input::-webkit-outer-spin-button, + input::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; + } + + input::placeholder { + color: var(--wui-color-fg-275); + } +`,mO=/[.*+?^${}()|[\]\\]/gu,gO=/[0-9,.]/u;var xh=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let wa=class extends q{constructor(){super(...arguments),this.inputElementRef=la(),this.disabled=!1,this.value="",this.placeholder="0"}render(){var e;return(e=this.inputElementRef)!=null&&e.value&&this.value&&(this.inputElementRef.value.value=this.value),v` `}dispatchInputChangeEvent(e){var r,i;const n=e.data;n&&!gO.test(n)&&(r=this.inputElementRef)!=null&&r.value&&(this.inputElementRef.value.value=this.value.replace(new RegExp(n.replace(mO,"\\$&"),"gu"),"")),this.dispatchEvent(new CustomEvent("inputChange",{detail:(i=this.inputElementRef.value)==null?void 0:i.value,bubbles:!0,composed:!0}))}};wa.styles=[fe,Me,hO];xh([T({type:Boolean})],wa.prototype,"disabled",void 0);xh([T({type:String})],wa.prototype,"value",void 0);xh([T({type:String})],wa.prototype,"placeholder",void 0);wa=xh([G("wui-input-amount")],wa);const wO=Q` + :host { + display: flex; + gap: var(--wui-spacing-xs); + border-radius: var(--wui-border-radius-3xl); + border: 1px solid var(--wui-gray-glass-002); + background: var(--wui-gray-glass-002); + padding: var(--wui-spacing-2xs) var(--wui-spacing-xs) var(--wui-spacing-2xs) + var(--wui-spacing-s); + align-items: center; + } + + wui-avatar, + wui-icon, + wui-image { + width: 32px; + height: 32px; + border: 1px solid var(--wui-gray-glass-002); + border-radius: var(--wui-border-radius-3xl); + box-shadow: 0 0 0 2px var(--wui-gray-glass-002); + } +`;var wf=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Jo=class extends q{constructor(){super(...arguments),this.text="",this.address="",this.isAddress=!1}render(){return v`${this.text} + ${this.imageTemplate()}`}imageTemplate(){return this.isAddress?v``:this.imageSrc?v``:v``}};Jo.styles=[fe,Me,wO];wf([T()],Jo.prototype,"text",void 0);wf([T()],Jo.prototype,"address",void 0);wf([T()],Jo.prototype,"imageSrc",void 0);wf([T({type:Boolean})],Jo.prototype,"isAddress",void 0);Jo=wf([G("wui-preview-item")],Jo);const yO=Q` + :host { + display: grid; + width: inherit; + height: inherit; + } +`;var wr=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let gn=class extends q{render(){return this.style.cssText=` + grid-template-rows: ${this.gridTemplateRows}; + grid-template-columns: ${this.gridTemplateColumns}; + justify-items: ${this.justifyItems}; + align-items: ${this.alignItems}; + justify-content: ${this.justifyContent}; + align-content: ${this.alignContent}; + column-gap: ${this.columnGap&&`var(--wui-spacing-${this.columnGap})`}; + row-gap: ${this.rowGap&&`var(--wui-spacing-${this.rowGap})`}; + gap: ${this.gap&&`var(--wui-spacing-${this.gap})`}; + padding-top: ${this.padding&&Ae.getSpacingStyles(this.padding,0)}; + padding-right: ${this.padding&&Ae.getSpacingStyles(this.padding,1)}; + padding-bottom: ${this.padding&&Ae.getSpacingStyles(this.padding,2)}; + padding-left: ${this.padding&&Ae.getSpacingStyles(this.padding,3)}; + margin-top: ${this.margin&&Ae.getSpacingStyles(this.margin,0)}; + margin-right: ${this.margin&&Ae.getSpacingStyles(this.margin,1)}; + margin-bottom: ${this.margin&&Ae.getSpacingStyles(this.margin,2)}; + margin-left: ${this.margin&&Ae.getSpacingStyles(this.margin,3)}; + `,v``}};gn.styles=[fe,yO];wr([T()],gn.prototype,"gridTemplateRows",void 0);wr([T()],gn.prototype,"gridTemplateColumns",void 0);wr([T()],gn.prototype,"justifyItems",void 0);wr([T()],gn.prototype,"alignItems",void 0);wr([T()],gn.prototype,"justifyContent",void 0);wr([T()],gn.prototype,"alignContent",void 0);wr([T()],gn.prototype,"columnGap",void 0);wr([T()],gn.prototype,"rowGap",void 0);wr([T()],gn.prototype,"gap",void 0);wr([T()],gn.prototype,"padding",void 0);wr([T()],gn.prototype,"margin",void 0);gn=wr([G("wui-grid")],gn);const vO=Q` + :host { + position: relative; + display: flex; + width: 100%; + height: 1px; + background-color: var(--wui-gray-glass-005); + justify-content: center; + align-items: center; + } + + :host > wui-text { + position: absolute; + padding: 0px 10px; + background-color: var(--wui-color-modal-bg); + } +`;var K8=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let yd=class extends q{constructor(){super(...arguments),this.text=""}render(){return v`${this.template()}`}template(){return this.text?v`${this.text}`:null}};yd.styles=[fe,vO];K8([T()],yd.prototype,"text",void 0);yd=K8([G("wui-separator")],yd);const bO=3,xO=["receive","deposit","borrow","claim"],CO=["withdraw","repay","burn"],$o={getMonthName(t){const e=new Date;return e.setMonth(t),e.toLocaleString("en-US",{month:"long"})},getTransactionGroupTitle(t,e){const n=m2.getYear(),r=this.getMonthName(e);return t===n?r:`${r} ${t}`},getTransactionImages(t){const[e,n]=t,r=!!e&&(t==null?void 0:t.every(s=>!!s.nft_info)),i=(t==null?void 0:t.length)>1;return(t==null?void 0:t.length)===2&&!r?[this.getTransactionImage(e),this.getTransactionImage(n)]:i?t.map(s=>this.getTransactionImage(s)):[this.getTransactionImage(e)]},getTransactionImage(t){return{type:$o.getTransactionTransferTokenType(t),url:$o.getTransactionImageURL(t)}},getTransactionImageURL(t){var i,o,s,a,l;let e;const n=!!(t!=null&&t.nft_info),r=!!(t!=null&&t.fungible_info);return t&&n?e=(s=(o=(i=t==null?void 0:t.nft_info)==null?void 0:i.content)==null?void 0:o.preview)==null?void 0:s.url:t&&r&&(e=(l=(a=t==null?void 0:t.fungible_info)==null?void 0:a.icon)==null?void 0:l.url),e},getTransactionTransferTokenType(t){if(t!=null&&t.fungible_info)return"FUNGIBLE";if(t!=null&&t.nft_info)return"NFT"},getTransactionDescriptions(t){var d,p,g;const e=(d=t==null?void 0:t.metadata)==null?void 0:d.operationType,n=t==null?void 0:t.transfers,r=((p=t==null?void 0:t.transfers)==null?void 0:p.length)>0,i=((g=t==null?void 0:t.transfers)==null?void 0:g.length)>1,o=r&&(n==null?void 0:n.every(b=>!!(b!=null&&b.fungible_info))),[s,a]=n;let l=this.getTransferDescription(s),c=this.getTransferDescription(a);if(!r)return(e==="send"||e==="receive")&&o?(l=Ae.getTruncateString({string:t==null?void 0:t.metadata.sentFrom,charsStart:4,charsEnd:6,truncate:"middle"}),c=Ae.getTruncateString({string:t==null?void 0:t.metadata.sentTo,charsStart:4,charsEnd:6,truncate:"middle"}),[l,c]):[t.metadata.status];if(i)return n.map(b=>this.getTransferDescription(b));let u="";return xO.includes(e)?u="+":CO.includes(e)&&(u="-"),l=u.concat(l),[l]},getTransferDescription(t){var n;let e="";return t&&(t!=null&&t.nft_info?e=((n=t==null?void 0:t.nft_info)==null?void 0:n.name)||"-":t!=null&&t.fungible_info&&(e=this.getFungibleTransferDescription(t)||"-")),e},getFungibleTransferDescription(t){var r;return t?[this.getQuantityFixedValue(t==null?void 0:t.quantity.numeric),(r=t==null?void 0:t.fungible_info)==null?void 0:r.symbol].join(" ").trim():null},getQuantityFixedValue(t){return t?parseFloat(t).toFixed(bO):null}},_O=Object.freeze(Object.defineProperty({__proto__:null,TransactionUtil:$o,UiHelperUtil:Ae,get WuiAccountButton(){return Pn},get WuiAllWalletsImage(){return dd},get WuiAvatar(){return sa},get WuiBalance(){return hc},get WuiBanner(){return gc},get WuiButton(){return zn},get WuiCard(){return tp},get WuiCardSelect(){return si},get WuiCardSelectLoader(){return fd},get WuiChip(){return ai},get WuiChipButton(){return Gi},get WuiCompatibleNetwork(){return mc},get WuiConnectButton(){return nc},get WuiCtaButton(){return aa},get WuiDetailsGroup(){return rp},get WuiDetailsGroupItem(){return pd},get WuiEmailInput(){return ua},get WuiFlex(){return rn},get WuiGrid(){return gn},get WuiIcon(){return na},get WuiIconBox(){return hr},get WuiIconLink(){return Ko},get WuiImage(){return ra},get WuiInputAmount(){return wa},get WuiInputElement(){return hd},get WuiInputNumeric(){return rc},get WuiInputText(){return Or},get WuiLink(){return ic},get WuiListAccordion(){return fc},get WuiListContent(){return ga},get WuiListDescription(){return Lr},get WuiListItem(){return Wn},get WuiListNetwork(){return Qo},get WuiListToken(){return ui},get WuiListWallet(){return On},get WuiListWalletTransaction(){return Vi},get WuiLoadingHexagon(){return np},get WuiLoadingSpinner(){return ec},get WuiLoadingThumbnail(){return ud},get WuiLogo(){return md},get WuiLogoSelect(){return sc},get WuiNetworkButton(){return da},get WuiNetworkImage(){return qo},get WuiNoticeCard(){return ma},get WuiOnRampActivityItem(){return on},get WuiOnRampProviderItem(){return Mr},get WuiOtp(){return fa},get WuiPreviewItem(){return Jo},get WuiProfileButton(){return Zi},get WuiPromo(){return wd},get WuiQrCode(){return ci},get WuiSearchBar(){return lp},get WuiSeparator(){return yd},get WuiShimmer(){return ia},get WuiSnackbar(){return Yo},get WuiTabs(){return Nr},get WuiTag(){return oc},get WuiText(){return oa},get WuiTokenButton(){return dc},get WuiTokenListItem(){return Hi},get WuiTooltip(){return pa},get WuiTooltipSelect(){return pc},get WuiTransactionListItem(){return In},get WuiTransactionListItemLoader(){return op},get WuiTransactionVisual(){return li},get WuiVisual(){return tc},get WuiVisualThumbnail(){return ha},get WuiWalletImage(){return oi},convertInputMaskBottomSvg:w8,convertInputMaskTopSvg:y8,customElement:G,initializeTheming:v8,setColorTheme:x2,setThemeVariables:b8},Symbol.toStringTag,{value:"Module"}));var yr=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Hn=class extends q{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.balance="show",this.charsStart=4,this.charsEnd=6,this.address=de.state.address,this.balanceVal=de.state.balance,this.balanceSymbol=de.state.balanceSymbol,this.profileName=de.state.profileName,this.profileImage=de.state.profileImage,this.network=me.state.caipNetwork,this.isUnsupportedChain=me.state.isUnsupportedChain,this.unsubscribe.push(de.subscribe(e=>{e.isConnected?(this.address=e.address,this.balanceVal=e.balance,this.profileName=e.profileName,this.profileImage=e.profileImage,this.balanceSymbol=e.balanceSymbol):(this.address="",this.balanceVal="",this.profileName="",this.profileImage="",this.balanceSymbol="")}),me.subscribeKey("caipNetwork",e=>this.network=e),me.subscribeKey("isUnsupportedChain",e=>this.isUnsupportedChain=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=qe.getNetworkImage(this.network),n=this.balance==="show";return v` + + + `}onClick(){this.isUnsupportedChain?De.open({view:"UnsupportedChain"}):De.open()}};yr([T({type:Boolean})],Hn.prototype,"disabled",void 0);yr([T()],Hn.prototype,"balance",void 0);yr([T()],Hn.prototype,"charsStart",void 0);yr([T()],Hn.prototype,"charsEnd",void 0);yr([K()],Hn.prototype,"address",void 0);yr([K()],Hn.prototype,"balanceVal",void 0);yr([K()],Hn.prototype,"balanceSymbol",void 0);yr([K()],Hn.prototype,"profileName",void 0);yr([K()],Hn.prototype,"profileImage",void 0);yr([K()],Hn.prototype,"network",void 0);yr([K()],Hn.prototype,"isUnsupportedChain",void 0);Hn=yr([G("w3m-account-button")],Hn);const EO=Q` + :host { + display: block; + width: max-content; + } +`;var to=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Dr=class extends q{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.balance=void 0,this.size=void 0,this.label=void 0,this.loadingLabel=void 0,this.charsStart=4,this.charsEnd=6,this.isAccount=de.state.isConnected,this.unsubscribe.push(de.subscribeKey("isConnected",e=>{this.isAccount=e}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return this.isAccount?v` + + + `:v` + + `}};Dr.styles=EO;to([T({type:Boolean})],Dr.prototype,"disabled",void 0);to([T()],Dr.prototype,"balance",void 0);to([T()],Dr.prototype,"size",void 0);to([T()],Dr.prototype,"label",void 0);to([T()],Dr.prototype,"loadingLabel",void 0);to([T()],Dr.prototype,"charsStart",void 0);to([T()],Dr.prototype,"charsEnd",void 0);to([K()],Dr.prototype,"isAccount",void 0);Dr=to([G("w3m-button")],Dr);var Mc=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let ya=class extends q{constructor(){super(),this.unsubscribe=[],this.size="md",this.label="Connect Wallet",this.loadingLabel="Connecting...",this.open=De.state.open,this.loading=De.state.loading,this.unsubscribe.push(De.subscribe(e=>{this.open=e.open,this.loading=e.loading}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.loading||this.open;return v` + + ${e?this.loadingLabel:this.label} + + `}onClick(){this.open?De.close():this.loading||De.open()}};Mc([T()],ya.prototype,"size",void 0);Mc([T()],ya.prototype,"label",void 0);Mc([T()],ya.prototype,"loadingLabel",void 0);Mc([K()],ya.prototype,"open",void 0);Mc([K()],ya.prototype,"loading",void 0);ya=Mc([G("w3m-connect-button")],ya);const SO=Q` + :host { + z-index: var(--w3m-z-index); + display: block; + backface-visibility: hidden; + will-change: opacity; + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + pointer-events: none; + opacity: 0; + background-color: var(--wui-cover); + } + + @keyframes zoom-in { + 0% { + transform: scale(0.95) translateY(0); + } + 100% { + transform: scale(1) translateY(0); + } + } + + @keyframes slide-in { + 0% { + transform: scale(1) translateY(50px); + } + 100% { + transform: scale(1) translateY(0); + } + } + + wui-card { + max-width: 360px; + width: 100%; + position: relative; + animation-duration: 0.2s; + animation-name: zoom-in; + animation-fill-mode: backwards; + animation-timing-function: var(--wui-ease-out-power-2); + outline: none; + } + + wui-flex { + overflow-x: hidden; + overflow-y: auto; + display: flex; + align-items: center; + justify-content: center; + width: 100%; + height: 100%; + } + + @media (max-height: 700px) and (min-width: 431px) { + wui-flex { + align-items: flex-start; + } + + wui-card { + margin: var(--wui-spacing-xxl) 0px; + } + } + + @media (max-width: 430px) { + wui-flex { + align-items: flex-end; + } + + wui-card { + max-width: 100%; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + border-bottom: none; + animation-name: slide-in; + } + } +`;var Ch=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};const Av="scroll-lock";let va=class extends q{constructor(){super(),this.unsubscribe=[],this.abortController=void 0,this.open=De.state.open,this.caipAddress=de.state.caipAddress,this.isSiweEnabled=Ce.state.isSiweEnabled,this.initializeTheming(),xe.prefetch(),this.unsubscribe.push(De.subscribeKey("open",e=>e?this.onOpen():this.onClose()),de.subscribe(e=>this.onNewAccountState(e))),ye.sendEvent({type:"track",event:"MODAL_LOADED"})}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),this.onRemoveKeyboardListener()}render(){return this.open?v` + + + + + + + + `:null}async onOverlayClick(e){e.target===e.currentTarget&&await this.handleClose()}async handleClose(){if(this.isSiweEnabled){const{SIWEController:e}=await Mi(()=>import("./index-hW2M65xa.js"),[]);e.state.status!=="success"&&await Be.disconnect()}De.close()}initializeTheming(){const{themeVariables:e,themeMode:n}=kt.state,r=Ae.getColorTheme(n);v8(e,r)}async onClose(){this.onScrollUnlock(),await this.animate([{opacity:1},{opacity:0}],{duration:200,easing:"ease",fill:"forwards"}).finished,Fe.hide(),this.open=!1,this.onRemoveKeyboardListener()}async onOpen(){this.onScrollLock(),this.open=!0,await this.animate([{opacity:0},{opacity:1}],{duration:200,easing:"ease",fill:"forwards"}).finished,this.onAddKeyboardListener()}onScrollLock(){const e=document.createElement("style");e.dataset.w3m=Av,e.textContent=` + html, body { + touch-action: none; + overflow: hidden; + overscroll-behavior: contain; + } + w3m-modal { + pointer-events: auto; + } + `,document.head.appendChild(e)}onScrollUnlock(){const e=document.head.querySelector(`style[data-w3m="${Av}"]`);e&&e.remove()}onAddKeyboardListener(){var n;this.abortController=new AbortController;const e=(n=this.shadowRoot)==null?void 0:n.querySelector("wui-card");e==null||e.focus(),window.addEventListener("keydown",r=>{if(r.key==="Escape")this.handleClose();else if(r.key==="Tab"){const{tagName:i}=r.target;i&&!i.includes("W3M-")&&!i.includes("WUI-")&&(e==null||e.focus())}},this.abortController)}onRemoveKeyboardListener(){var e;(e=this.abortController)==null||e.abort(),this.abortController=void 0}async onNewAccountState(e){const{isConnected:n,caipAddress:r}=e;if(this.isSiweEnabled){const{SIWEController:i}=await Mi(()=>import("./index-hW2M65xa.js"),[]);n&&!this.caipAddress&&(this.caipAddress=r),n&&r&&this.caipAddress!==r&&(await i.signOut(),this.onSiweNavigation(),this.caipAddress=r);try{const o=await i.getSession();o&&!n?await i.signOut():n&&!o&&this.onSiweNavigation()}catch{n&&this.onSiweNavigation()}}}onSiweNavigation(){this.open?X.push("ConnectingSiwe"):De.open({view:"ConnectingSiwe"})}};va.styles=SO;Ch([K()],va.prototype,"open",void 0);Ch([K()],va.prototype,"caipAddress",void 0);Ch([K()],va.prototype,"isSiweEnabled",void 0);va=Ch([G("w3m-modal")],va);const TO=Object.freeze(Object.defineProperty({__proto__:null,get W3mModal(){return va}},Symbol.toStringTag,{value:"Module"})),AO=Q` + :host { + display: block; + width: max-content; + } +`;var Lc=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Xo=class extends q{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.network=me.state.caipNetwork,this.connected=de.state.isConnected,this.loading=De.state.loading,this.isUnsupportedChain=me.state.isUnsupportedChain,this.unsubscribe.push(me.subscribeKey("caipNetwork",e=>this.network=e),de.subscribeKey("isConnected",e=>this.connected=e),De.subscribeKey("loading",e=>this.loading=e),me.subscribeKey("isUnsupportedChain",e=>this.isUnsupportedChain=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var e;return v` + + ${this.isUnsupportedChain?"Switch Network":((e=this.network)==null?void 0:e.name)??(this.connected?"Unknown Network":"Select Network")} + + `}onClick(){this.loading||(ye.sendEvent({type:"track",event:"CLICK_NETWORKS"}),De.open({view:"Networks"}))}};Xo.styles=AO;Lc([T({type:Boolean})],Xo.prototype,"disabled",void 0);Lc([K()],Xo.prototype,"network",void 0);Lc([K()],Xo.prototype,"connected",void 0);Lc([K()],Xo.prototype,"loading",void 0);Lc([K()],Xo.prototype,"isUnsupportedChain",void 0);Xo=Lc([G("w3m-network-button")],Xo);const kO=Q` + :host { + display: block; + will-change: transform, opacity; + } +`;var Y8=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let cp=class extends q{constructor(){super(),this.resizeObserver=void 0,this.prevHeight="0px",this.prevHistoryLength=1,this.unsubscribe=[],this.view=X.state.view,this.unsubscribe.push(X.subscribeKey("view",e=>this.onViewChange(e)))}firstUpdated(){this.resizeObserver=new ResizeObserver(async([e])=>{const n=`${e==null?void 0:e.contentRect.height}px`;this.prevHeight!=="0px"&&(await this.animate([{height:this.prevHeight},{height:n}],{duration:150,easing:"ease",fill:"forwards"}).finished,this.style.height="auto"),this.prevHeight=n}),this.resizeObserver.observe(this.getWrapper())}disconnectedCallback(){var e;(e=this.resizeObserver)==null||e.unobserve(this.getWrapper()),this.unsubscribe.forEach(n=>n())}render(){return v`
${this.viewTemplate()}
`}viewTemplate(){switch(this.view){case"Connect":return v``;case"ConnectingWalletConnect":return v``;case"ConnectingExternal":return v``;case"ConnectingSiwe":return v``;case"AllWallets":return v``;case"Networks":return v``;case"SwitchNetwork":return v``;case"Account":return v``;case"AccountSettings":return v``;case"WhatIsAWallet":return v``;case"WhatIsANetwork":return v``;case"GetWallet":return v``;case"Downloads":return v``;case"EmailVerifyOtp":return v``;case"EmailVerifyDevice":return v``;case"ApproveTransaction":return v``;case"Transactions":return v``;case"UpgradeEmailWallet":return v``;case"UpgradeToSmartAccount":return v``;case"UpdateEmailWallet":return v``;case"UpdateEmailPrimaryOtp":return v``;case"UpdateEmailSecondaryOtp":return v``;case"UnsupportedChain":return v``;case"OnRampProviders":return v``;case"OnRampActivity":return v``;case"OnRampTokenSelect":return v``;case"OnRampFiatSelect":return v``;case"WhatIsABuy":return v``;case"BuyInProgress":return v``;case"WalletReceive":return v``;case"WalletCompatibleNetworks":return v``;case"WalletSend":return v``;case"WalletSendSelectToken":return v``;case"WalletSendPreview":return v``;default:return v``}}async onViewChange(e){const{history:n}=X.state;let r=-10,i=10;n.length wui-flex { + width: 100%; + max-width: 360px; + } + + :host > wui-flex > wui-flex { + border-radius: var(--wui-border-radius-l); + width: 100%; + } + + .amounts-container { + width: 100%; + } +`;var ds=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};const $O={USD:"$",EUR:"€",GBP:"£"},PO=[100,250,500,1e3];let di=class extends q{constructor(){super(),this.unsubscribe=[],this.disabled=!1,this.connected=de.state.isConnected,this.loading=De.state.loading,this.paymentCurrency=Ze.state.paymentCurrency,this.paymentAmount=Ze.state.paymentAmount,this.purchaseAmount=Ze.state.purchaseAmount,this.quoteLoading=Ze.state.quotesLoading,this.unsubscribe.push(de.subscribeKey("isConnected",e=>{this.connected=e}),De.subscribeKey("loading",e=>{this.loading=e}),Ze.subscribe(e=>{this.paymentCurrency=e.paymentCurrency,this.paymentAmount=e.paymentAmount,this.purchaseAmount=e.purchaseAmount,this.quoteLoading=e.quotesLoading}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return v` + + + + + + ${PO.map(e=>{var n;return v`this.selectPresetAmount(e)} + >${`${$O[((n=this.paymentCurrency)==null?void 0:n.id)||"USD"]} ${e}`}`})} + + ${this.templateButton()} + + + `}templateButton(){return this.connected?v` + Get quotes + `:v` + Connect wallet + `}getQuotes(){this.loading||De.open({view:"OnRampProviders"})}openModal(){De.open({view:"Connect"})}async onPaymentAmountChange(e){Ze.setPaymentAmount(Number(e.detail)),await Ze.getQuote()}async selectPresetAmount(e){Ze.setPaymentAmount(e),await Ze.getQuote()}};di.styles=RO;ds([T({type:Boolean})],di.prototype,"disabled",void 0);ds([K()],di.prototype,"connected",void 0);ds([K()],di.prototype,"loading",void 0);ds([K()],di.prototype,"paymentCurrency",void 0);ds([K()],di.prototype,"paymentAmount",void 0);ds([K()],di.prototype,"purchaseAmount",void 0);ds([K()],di.prototype,"quoteLoading",void 0);di=ds([G("w3m-onramp-widget")],di);const IO=Q` + wui-flex { + width: 100%; + } + + wui-icon-link { + margin-right: calc(var(--wui-icon-box-size-md) * -1); + } + + .account-links { + display: flex; + justify-content: space-between; + align-items: center; + } + + .account-links wui-flex { + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + flex: 1; + background: red; + align-items: center; + justify-content: center; + height: 48px; + padding: 10px; + flex: 1 0 0; + + border-radius: var(--XS, 16px); + border: 1px solid var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1)); + background: var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1)); + transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: background-color; + } + + .account-links wui-flex:hover { + background: var(--dark-accent-glass-015, rgba(71, 161, 255, 0.15)); + } + + .account-links wui-flex wui-icon { + width: var(--S, 20px); + height: var(--S, 20px); + } + + .account-links wui-flex wui-icon svg path { + stroke: #47a1ff; + } +`;var Q8={},_h={};_h.byteLength=MO;_h.toByteArray=DO;_h.fromByteArray=UO;var ni=[],tr=[],OO=typeof Uint8Array<"u"?Uint8Array:Array,U1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Ga=0,NO=U1.length;Ga0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");n===-1&&(n=e);var r=n===e?0:4-n%4;return[n,r]}function MO(t){var e=J8(t),n=e[0],r=e[1];return(n+r)*3/4-r}function LO(t,e,n){return(e+n)*3/4-n}function DO(t){var e,n=J8(t),r=n[0],i=n[1],o=new OO(LO(t,r,i)),s=0,a=i>0?r-4:r,l;for(l=0;l>16&255,o[s++]=e>>8&255,o[s++]=e&255;return i===2&&(e=tr[t.charCodeAt(l)]<<2|tr[t.charCodeAt(l+1)]>>4,o[s++]=e&255),i===1&&(e=tr[t.charCodeAt(l)]<<10|tr[t.charCodeAt(l+1)]<<4|tr[t.charCodeAt(l+2)]>>2,o[s++]=e>>8&255,o[s++]=e&255),o}function BO(t){return ni[t>>18&63]+ni[t>>12&63]+ni[t>>6&63]+ni[t&63]}function jO(t,e,n){for(var r,i=[],o=e;oa?a:s+o));return r===1?(e=t[n-1],i.push(ni[e>>2]+ni[e<<4&63]+"==")):r===2&&(e=(t[n-2]<<8)+t[n-1],i.push(ni[e>>10]+ni[e>>4&63]+ni[e<<2&63]+"=")),i.join("")}var F2={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */F2.read=function(t,e,n,r,i){var o,s,a=i*8-r-1,l=(1<>1,u=-7,d=n?i-1:0,p=n?-1:1,g=t[e+d];for(d+=p,o=g&(1<<-u)-1,g>>=-u,u+=a;u>0;o=o*256+t[e+d],d+=p,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=r;u>0;s=s*256+t[e+d],d+=p,u-=8);if(o===0)o=1-c;else{if(o===l)return s?NaN:(g?-1:1)*(1/0);s=s+Math.pow(2,r),o=o-c}return(g?-1:1)*s*Math.pow(2,o-r)};F2.write=function(t,e,n,r,i,o){var s,a,l,c=o*8-i-1,u=(1<>1,p=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=r?0:o-1,b=r?1:-1,S=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+d>=1?e+=p/l:e+=p*Math.pow(2,1-d),e*l>=2&&(s++,l/=2),s+d>=u?(a=0,s=u):s+d>=1?(a=(e*l-1)*Math.pow(2,i),s=s+d):(a=e*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;t[n+g]=a&255,g+=b,a/=256,i-=8);for(s=s<0;t[n+g]=s&255,g+=b,s/=256,c-=8);t[n+g-b]|=S*128};/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */(function(t){const e=_h,n=F2,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=a,t.SlowBuffer=m,t.INSPECT_MAX_BYTES=50;const i=2147483647;t.kMaxLength=i,a.TYPED_ARRAY_SUPPORT=o(),!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 o(){try{const E=new Uint8Array(1),f={foo:function(){return 42}};return Object.setPrototypeOf(f,Uint8Array.prototype),Object.setPrototypeOf(E,f),E.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 s(E){if(E>i)throw new RangeError('The value "'+E+'" is invalid for option "size"');const f=new Uint8Array(E);return Object.setPrototypeOf(f,a.prototype),f}function a(E,f,h){if(typeof E=="number"){if(typeof f=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return d(E)}return l(E,f,h)}a.poolSize=8192;function l(E,f,h){if(typeof E=="string")return p(E,f);if(ArrayBuffer.isView(E))return b(E);if(E==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E);if(Vr(E,ArrayBuffer)||E&&Vr(E.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Vr(E,SharedArrayBuffer)||E&&Vr(E.buffer,SharedArrayBuffer)))return S(E,f,h);if(typeof E=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const P=E.valueOf&&E.valueOf();if(P!=null&&P!==E)return a.from(P,f,h);const W=k(E);if(W)return W;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof E[Symbol.toPrimitive]=="function")return a.from(E[Symbol.toPrimitive]("string"),f,h);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E)}a.from=function(E,f,h){return l(E,f,h)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function c(E){if(typeof E!="number")throw new TypeError('"size" argument must be of type number');if(E<0)throw new RangeError('The value "'+E+'" is invalid for option "size"')}function u(E,f,h){return c(E),E<=0?s(E):f!==void 0?typeof h=="string"?s(E).fill(f,h):s(E).fill(f):s(E)}a.alloc=function(E,f,h){return u(E,f,h)};function d(E){return c(E),s(E<0?0:y(E)|0)}a.allocUnsafe=function(E){return d(E)},a.allocUnsafeSlow=function(E){return d(E)};function p(E,f){if((typeof f!="string"||f==="")&&(f="utf8"),!a.isEncoding(f))throw new TypeError("Unknown encoding: "+f);const h=x(E,f)|0;let P=s(h);const W=P.write(E,f);return W!==h&&(P=P.slice(0,W)),P}function g(E){const f=E.length<0?0:y(E.length)|0,h=s(f);for(let P=0;P=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return E|0}function m(E){return+E!=E&&(E=0),a.alloc(+E)}a.isBuffer=function(f){return f!=null&&f._isBuffer===!0&&f!==a.prototype},a.compare=function(f,h){if(Vr(f,Uint8Array)&&(f=a.from(f,f.offset,f.byteLength)),Vr(h,Uint8Array)&&(h=a.from(h,h.offset,h.byteLength)),!a.isBuffer(f)||!a.isBuffer(h))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(f===h)return 0;let P=f.length,W=h.length;for(let V=0,J=Math.min(P,W);VW.length?(a.isBuffer(J)||(J=a.from(J)),J.copy(W,V)):Uint8Array.prototype.set.call(W,J,V);else if(a.isBuffer(J))J.copy(W,V);else throw new TypeError('"list" argument must be an Array of Buffers');V+=J.length}return W};function x(E,f){if(a.isBuffer(E))return E.length;if(ArrayBuffer.isView(E)||Vr(E,ArrayBuffer))return E.byteLength;if(typeof E!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof E);const h=E.length,P=arguments.length>2&&arguments[2]===!0;if(!P&&h===0)return 0;let W=!1;for(;;)switch(f){case"ascii":case"latin1":case"binary":return h;case"utf8":case"utf-8":return Ih(E).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h*2;case"hex":return h>>>1;case"base64":return X2(E).length;default:if(W)return P?-1:Ih(E).length;f=(""+f).toLowerCase(),W=!0}}a.byteLength=x;function A(E,f,h){let P=!1;if((f===void 0||f<0)&&(f=0),f>this.length||((h===void 0||h>this.length)&&(h=this.length),h<=0)||(h>>>=0,f>>>=0,h<=f))return"";for(E||(E="utf8");;)switch(E){case"hex":return z(this,f,h);case"utf8":case"utf-8":return F(this,f,h);case"ascii":return j(this,f,h);case"latin1":case"binary":return R(this,f,h);case"base64":return U(this,f,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Z(this,f,h);default:if(P)throw new TypeError("Unknown encoding: "+E);E=(E+"").toLowerCase(),P=!0}}a.prototype._isBuffer=!0;function M(E,f,h){const P=E[f];E[f]=E[h],E[h]=P}a.prototype.swap16=function(){const f=this.length;if(f%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let h=0;hh&&(f+=" ... "),""},r&&(a.prototype[r]=a.prototype.inspect),a.prototype.compare=function(f,h,P,W,V){if(Vr(f,Uint8Array)&&(f=a.from(f,f.offset,f.byteLength)),!a.isBuffer(f))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof f);if(h===void 0&&(h=0),P===void 0&&(P=f?f.length:0),W===void 0&&(W=0),V===void 0&&(V=this.length),h<0||P>f.length||W<0||V>this.length)throw new RangeError("out of range index");if(W>=V&&h>=P)return 0;if(W>=V)return-1;if(h>=P)return 1;if(h>>>=0,P>>>=0,W>>>=0,V>>>=0,this===f)return 0;let J=V-W,Le=P-h;const gt=Math.min(J,Le),st=this.slice(W,V),wt=f.slice(h,P);for(let Xe=0;Xe2147483647?h=2147483647:h<-2147483648&&(h=-2147483648),h=+h,Oh(h)&&(h=W?0:E.length-1),h<0&&(h=E.length+h),h>=E.length){if(W)return-1;h=E.length-1}else if(h<0)if(W)h=0;else return-1;if(typeof f=="string"&&(f=a.from(f,P)),a.isBuffer(f))return f.length===0?-1:H(E,f,h,P,W);if(typeof f=="number")return f=f&255,typeof Uint8Array.prototype.indexOf=="function"?W?Uint8Array.prototype.indexOf.call(E,f,h):Uint8Array.prototype.lastIndexOf.call(E,f,h):H(E,[f],h,P,W);throw new TypeError("val must be string, number or Buffer")}function H(E,f,h,P,W){let V=1,J=E.length,Le=f.length;if(P!==void 0&&(P=String(P).toLowerCase(),P==="ucs2"||P==="ucs-2"||P==="utf16le"||P==="utf-16le")){if(E.length<2||f.length<2)return-1;V=2,J/=2,Le/=2,h/=2}function gt(wt,Xe){return V===1?wt[Xe]:wt.readUInt16BE(Xe*V)}let st;if(W){let wt=-1;for(st=h;stJ&&(h=J-Le),st=h;st>=0;st--){let wt=!0;for(let Xe=0;XeW&&(P=W)):P=W;const V=f.length;P>V/2&&(P=V/2);let J;for(J=0;J>>0,isFinite(P)?(P=P>>>0,W===void 0&&(W="utf8")):(W=P,P=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const V=this.length-h;if((P===void 0||P>V)&&(P=V),f.length>0&&(P<0||h<0)||h>this.length)throw new RangeError("Attempt to write outside buffer bounds");W||(W="utf8");let J=!1;for(;;)switch(W){case"hex":return w(this,f,h,P);case"utf8":case"utf-8":return C(this,f,h,P);case"ascii":case"latin1":case"binary":return _(this,f,h,P);case"base64":return O(this,f,h,P);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,f,h,P);default:if(J)throw new TypeError("Unknown encoding: "+W);W=(""+W).toLowerCase(),J=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function U(E,f,h){return f===0&&h===E.length?e.fromByteArray(E):e.fromByteArray(E.slice(f,h))}function F(E,f,h){h=Math.min(E.length,h);const P=[];let W=f;for(;W239?4:V>223?3:V>191?2:1;if(W+Le<=h){let gt,st,wt,Xe;switch(Le){case 1:V<128&&(J=V);break;case 2:gt=E[W+1],(gt&192)===128&&(Xe=(V&31)<<6|gt&63,Xe>127&&(J=Xe));break;case 3:gt=E[W+1],st=E[W+2],(gt&192)===128&&(st&192)===128&&(Xe=(V&15)<<12|(gt&63)<<6|st&63,Xe>2047&&(Xe<55296||Xe>57343)&&(J=Xe));break;case 4:gt=E[W+1],st=E[W+2],wt=E[W+3],(gt&192)===128&&(st&192)===128&&(wt&192)===128&&(Xe=(V&15)<<18|(gt&63)<<12|(st&63)<<6|wt&63,Xe>65535&&Xe<1114112&&(J=Xe))}}J===null?(J=65533,Le=1):J>65535&&(J-=65536,P.push(J>>>10&1023|55296),J=56320|J&1023),P.push(J),W+=Le}return N(P)}const I=4096;function N(E){const f=E.length;if(f<=I)return String.fromCharCode.apply(String,E);let h="",P=0;for(;PP)&&(h=P);let W="";for(let V=f;VP&&(f=P),h<0?(h+=P,h<0&&(h=0)):h>P&&(h=P),hh)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(f,h,P){f=f>>>0,h=h>>>0,P||Y(f,h,this.length);let W=this[f],V=1,J=0;for(;++J>>0,h=h>>>0,P||Y(f,h,this.length);let W=this[f+--h],V=1;for(;h>0&&(V*=256);)W+=this[f+--h]*V;return W},a.prototype.readUint8=a.prototype.readUInt8=function(f,h){return f=f>>>0,h||Y(f,1,this.length),this[f]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(f,h){return f=f>>>0,h||Y(f,2,this.length),this[f]|this[f+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(f,h){return f=f>>>0,h||Y(f,2,this.length),this[f]<<8|this[f+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(f,h){return f=f>>>0,h||Y(f,4,this.length),(this[f]|this[f+1]<<8|this[f+2]<<16)+this[f+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(f,h){return f=f>>>0,h||Y(f,4,this.length),this[f]*16777216+(this[f+1]<<16|this[f+2]<<8|this[f+3])},a.prototype.readBigUInt64LE=no(function(f){f=f>>>0,it(f,"offset");const h=this[f],P=this[f+7];(h===void 0||P===void 0)&&Ct(f,this.length-8);const W=h+this[++f]*2**8+this[++f]*2**16+this[++f]*2**24,V=this[++f]+this[++f]*2**8+this[++f]*2**16+P*2**24;return BigInt(W)+(BigInt(V)<>>0,it(f,"offset");const h=this[f],P=this[f+7];(h===void 0||P===void 0)&&Ct(f,this.length-8);const W=h*2**24+this[++f]*2**16+this[++f]*2**8+this[++f],V=this[++f]*2**24+this[++f]*2**16+this[++f]*2**8+P;return(BigInt(W)<>>0,h=h>>>0,P||Y(f,h,this.length);let W=this[f],V=1,J=0;for(;++J=V&&(W-=Math.pow(2,8*h)),W},a.prototype.readIntBE=function(f,h,P){f=f>>>0,h=h>>>0,P||Y(f,h,this.length);let W=h,V=1,J=this[f+--W];for(;W>0&&(V*=256);)J+=this[f+--W]*V;return V*=128,J>=V&&(J-=Math.pow(2,8*h)),J},a.prototype.readInt8=function(f,h){return f=f>>>0,h||Y(f,1,this.length),this[f]&128?(255-this[f]+1)*-1:this[f]},a.prototype.readInt16LE=function(f,h){f=f>>>0,h||Y(f,2,this.length);const P=this[f]|this[f+1]<<8;return P&32768?P|4294901760:P},a.prototype.readInt16BE=function(f,h){f=f>>>0,h||Y(f,2,this.length);const P=this[f+1]|this[f]<<8;return P&32768?P|4294901760:P},a.prototype.readInt32LE=function(f,h){return f=f>>>0,h||Y(f,4,this.length),this[f]|this[f+1]<<8|this[f+2]<<16|this[f+3]<<24},a.prototype.readInt32BE=function(f,h){return f=f>>>0,h||Y(f,4,this.length),this[f]<<24|this[f+1]<<16|this[f+2]<<8|this[f+3]},a.prototype.readBigInt64LE=no(function(f){f=f>>>0,it(f,"offset");const h=this[f],P=this[f+7];(h===void 0||P===void 0)&&Ct(f,this.length-8);const W=this[f+4]+this[f+5]*2**8+this[f+6]*2**16+(P<<24);return(BigInt(W)<>>0,it(f,"offset");const h=this[f],P=this[f+7];(h===void 0||P===void 0)&&Ct(f,this.length-8);const W=(h<<24)+this[++f]*2**16+this[++f]*2**8+this[++f];return(BigInt(W)<>>0,h||Y(f,4,this.length),n.read(this,f,!0,23,4)},a.prototype.readFloatBE=function(f,h){return f=f>>>0,h||Y(f,4,this.length),n.read(this,f,!1,23,4)},a.prototype.readDoubleLE=function(f,h){return f=f>>>0,h||Y(f,8,this.length),n.read(this,f,!0,52,8)},a.prototype.readDoubleBE=function(f,h){return f=f>>>0,h||Y(f,8,this.length),n.read(this,f,!1,52,8)};function re(E,f,h,P,W,V){if(!a.isBuffer(E))throw new TypeError('"buffer" argument must be a Buffer instance');if(f>W||fE.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(f,h,P,W){if(f=+f,h=h>>>0,P=P>>>0,!W){const Le=Math.pow(2,8*P)-1;re(this,f,h,P,Le,0)}let V=1,J=0;for(this[h]=f&255;++J>>0,P=P>>>0,!W){const Le=Math.pow(2,8*P)-1;re(this,f,h,P,Le,0)}let V=P-1,J=1;for(this[h+V]=f&255;--V>=0&&(J*=256);)this[h+V]=f/J&255;return h+P},a.prototype.writeUint8=a.prototype.writeUInt8=function(f,h,P){return f=+f,h=h>>>0,P||re(this,f,h,1,255,0),this[h]=f&255,h+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(f,h,P){return f=+f,h=h>>>0,P||re(this,f,h,2,65535,0),this[h]=f&255,this[h+1]=f>>>8,h+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(f,h,P){return f=+f,h=h>>>0,P||re(this,f,h,2,65535,0),this[h]=f>>>8,this[h+1]=f&255,h+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(f,h,P){return f=+f,h=h>>>0,P||re(this,f,h,4,4294967295,0),this[h+3]=f>>>24,this[h+2]=f>>>16,this[h+1]=f>>>8,this[h]=f&255,h+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(f,h,P){return f=+f,h=h>>>0,P||re(this,f,h,4,4294967295,0),this[h]=f>>>24,this[h+1]=f>>>16,this[h+2]=f>>>8,this[h+3]=f&255,h+4};function be(E,f,h,P,W){bn(f,P,W,E,h,7);let V=Number(f&BigInt(4294967295));E[h++]=V,V=V>>8,E[h++]=V,V=V>>8,E[h++]=V,V=V>>8,E[h++]=V;let J=Number(f>>BigInt(32)&BigInt(4294967295));return E[h++]=J,J=J>>8,E[h++]=J,J=J>>8,E[h++]=J,J=J>>8,E[h++]=J,h}function Se(E,f,h,P,W){bn(f,P,W,E,h,7);let V=Number(f&BigInt(4294967295));E[h+7]=V,V=V>>8,E[h+6]=V,V=V>>8,E[h+5]=V,V=V>>8,E[h+4]=V;let J=Number(f>>BigInt(32)&BigInt(4294967295));return E[h+3]=J,J=J>>8,E[h+2]=J,J=J>>8,E[h+1]=J,J=J>>8,E[h]=J,h+8}a.prototype.writeBigUInt64LE=no(function(f,h=0){return be(this,f,h,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=no(function(f,h=0){return Se(this,f,h,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(f,h,P,W){if(f=+f,h=h>>>0,!W){const gt=Math.pow(2,8*P-1);re(this,f,h,P,gt-1,-gt)}let V=0,J=1,Le=0;for(this[h]=f&255;++V>0)-Le&255;return h+P},a.prototype.writeIntBE=function(f,h,P,W){if(f=+f,h=h>>>0,!W){const gt=Math.pow(2,8*P-1);re(this,f,h,P,gt-1,-gt)}let V=P-1,J=1,Le=0;for(this[h+V]=f&255;--V>=0&&(J*=256);)f<0&&Le===0&&this[h+V+1]!==0&&(Le=1),this[h+V]=(f/J>>0)-Le&255;return h+P},a.prototype.writeInt8=function(f,h,P){return f=+f,h=h>>>0,P||re(this,f,h,1,127,-128),f<0&&(f=255+f+1),this[h]=f&255,h+1},a.prototype.writeInt16LE=function(f,h,P){return f=+f,h=h>>>0,P||re(this,f,h,2,32767,-32768),this[h]=f&255,this[h+1]=f>>>8,h+2},a.prototype.writeInt16BE=function(f,h,P){return f=+f,h=h>>>0,P||re(this,f,h,2,32767,-32768),this[h]=f>>>8,this[h+1]=f&255,h+2},a.prototype.writeInt32LE=function(f,h,P){return f=+f,h=h>>>0,P||re(this,f,h,4,2147483647,-2147483648),this[h]=f&255,this[h+1]=f>>>8,this[h+2]=f>>>16,this[h+3]=f>>>24,h+4},a.prototype.writeInt32BE=function(f,h,P){return f=+f,h=h>>>0,P||re(this,f,h,4,2147483647,-2147483648),f<0&&(f=4294967295+f+1),this[h]=f>>>24,this[h+1]=f>>>16,this[h+2]=f>>>8,this[h+3]=f&255,h+4},a.prototype.writeBigInt64LE=no(function(f,h=0){return be(this,f,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=no(function(f,h=0){return Se(this,f,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ge(E,f,h,P,W,V){if(h+P>E.length)throw new RangeError("Index out of range");if(h<0)throw new RangeError("Index out of range")}function Te(E,f,h,P,W){return f=+f,h=h>>>0,W||ge(E,f,h,4),n.write(E,f,h,P,23,4),h+4}a.prototype.writeFloatLE=function(f,h,P){return Te(this,f,h,!0,P)},a.prototype.writeFloatBE=function(f,h,P){return Te(this,f,h,!1,P)};function We(E,f,h,P,W){return f=+f,h=h>>>0,W||ge(E,f,h,8),n.write(E,f,h,P,52,8),h+8}a.prototype.writeDoubleLE=function(f,h,P){return We(this,f,h,!0,P)},a.prototype.writeDoubleBE=function(f,h,P){return We(this,f,h,!1,P)},a.prototype.copy=function(f,h,P,W){if(!a.isBuffer(f))throw new TypeError("argument should be a Buffer");if(P||(P=0),!W&&W!==0&&(W=this.length),h>=f.length&&(h=f.length),h||(h=0),W>0&&W=this.length)throw new RangeError("Index out of range");if(W<0)throw new RangeError("sourceEnd out of bounds");W>this.length&&(W=this.length),f.length-h>>0,P=P===void 0?this.length:P>>>0,f||(f=0);let V;if(typeof f=="number")for(V=h;V2**32?W=bt(String(h)):typeof h=="bigint"&&(W=String(h),(h>BigInt(2)**BigInt(32)||h<-(BigInt(2)**BigInt(32)))&&(W=bt(W)),W+="n"),P+=` It must be ${f}. Received ${W}`,P},RangeError);function bt(E){let f="",h=E.length;const P=E[0]==="-"?1:0;for(;h>=P+4;h-=3)f=`_${E.slice(h-3,h)}${f}`;return`${E.slice(0,h)}${f}`}function xt(E,f,h){it(f,"offset"),(E[f]===void 0||E[f+h]===void 0)&&Ct(f,E.length-(h+1))}function bn(E,f,h,P,W,V){if(E>h||E3?f===0||f===BigInt(0)?Le=`>= 0${J} and < 2${J} ** ${(V+1)*8}${J}`:Le=`>= -(2${J} ** ${(V+1)*8-1}${J}) and < 2 ** ${(V+1)*8-1}${J}`:Le=`>= ${f}${J} and <= ${h}${J}`,new zt.ERR_OUT_OF_RANGE("value",Le,E)}xt(P,W,V)}function it(E,f){if(typeof E!="number")throw new zt.ERR_INVALID_ARG_TYPE(f,"number",E)}function Ct(E,f,h){throw Math.floor(E)!==E?(it(E,h),new zt.ERR_OUT_OF_RANGE(h||"offset","an integer",E)):f<0?new zt.ERR_BUFFER_OUT_OF_BOUNDS:new zt.ERR_OUT_OF_RANGE(h||"offset",`>= ${h?1:0} and <= ${f}`,E)}const ot=/[^+/0-9A-Za-z-_]/g;function x9(E){if(E=E.split("=")[0],E=E.trim().replace(ot,""),E.length<2)return"";for(;E.length%4!==0;)E=E+"=";return E}function Ih(E,f){f=f||1/0;let h;const P=E.length;let W=null;const V=[];for(let J=0;J55295&&h<57344){if(!W){if(h>56319){(f-=3)>-1&&V.push(239,191,189);continue}else if(J+1===P){(f-=3)>-1&&V.push(239,191,189);continue}W=h;continue}if(h<56320){(f-=3)>-1&&V.push(239,191,189),W=h;continue}h=(W-55296<<10|h-56320)+65536}else W&&(f-=3)>-1&&V.push(239,191,189);if(W=null,h<128){if((f-=1)<0)break;V.push(h)}else if(h<2048){if((f-=2)<0)break;V.push(h>>6|192,h&63|128)}else if(h<65536){if((f-=3)<0)break;V.push(h>>12|224,h>>6&63|128,h&63|128)}else if(h<1114112){if((f-=4)<0)break;V.push(h>>18|240,h>>12&63|128,h>>6&63|128,h&63|128)}else throw new Error("Invalid code point")}return V}function C9(E){const f=[];for(let h=0;h>8,W=h%256,V.push(W),V.push(P);return V}function X2(E){return e.toByteArray(x9(E))}function Ef(E,f,h,P){let W;for(W=0;W=f.length||W>=E.length);++W)f[W+h]=E[W];return W}function Vr(E,f){return E instanceof f||E!=null&&E.constructor!=null&&E.constructor.name!=null&&E.constructor.name===f.name}function Oh(E){return E!==E}const E9=function(){const E="0123456789abcdef",f=new Array(256);for(let h=0;h<16;++h){const P=h*16;for(let W=0;W<16;++W)f[P+W]=E[h]+E[W]}return f}();function no(E){return typeof BigInt>"u"?S9:E}function S9(){throw new Error("BigInt not supported")}})(Q8);var l5;typeof window<"u"&&(window.Buffer||(window.Buffer=Q8.Buffer),window.global||(window.global=window),window.process||(window.process={}),(l5=window.process)!=null&&l5.env||(window.process={env:{}}));var FO={};const oe={SECURE_SITE_SDK:FO.NEXT_PUBLIC_SECURE_SITE_SDK_URL||"https://secure.walletconnect.com/sdk",APP_EVENT_KEY:"@w3m-app/",FRAME_EVENT_KEY:"@w3m-frame/",RPC_METHOD_KEY:"RPC_",STORAGE_KEY:"@w3m-storage/",SESSION_TOKEN_KEY:"SESSION_TOKEN_KEY",EMAIL_LOGIN_USED_KEY:"EMAIL_LOGIN_USED_KEY",LAST_USED_CHAIN_KEY:"LAST_USED_CHAIN_KEY",LAST_EMAIL_LOGIN_TIME:"LAST_EMAIL_LOGIN_TIME",EMAIL:"EMAIL",PREFERRED_ACCOUNT_TYPE:"PREFERRED_ACCOUNT_TYPE",SMART_ACCOUNT_ENABLED:"SMART_ACCOUNT_ENABLED",SMART_ACCOUNT_ENABLED_NETWORKS:"SMART_ACCOUNT_ENABLED_NETWORKS",APP_SWITCH_NETWORK:"@w3m-app/SWITCH_NETWORK",APP_CONNECT_EMAIL:"@w3m-app/CONNECT_EMAIL",APP_CONNECT_DEVICE:"@w3m-app/CONNECT_DEVICE",APP_CONNECT_OTP:"@w3m-app/CONNECT_OTP",APP_GET_USER:"@w3m-app/GET_USER",APP_SIGN_OUT:"@w3m-app/SIGN_OUT",APP_IS_CONNECTED:"@w3m-app/IS_CONNECTED",APP_GET_CHAIN_ID:"@w3m-app/GET_CHAIN_ID",APP_RPC_REQUEST:"@w3m-app/RPC_REQUEST",APP_UPDATE_EMAIL:"@w3m-app/UPDATE_EMAIL",APP_UPDATE_EMAIL_PRIMARY_OTP:"@w3m-app/UPDATE_EMAIL_PRIMARY_OTP",APP_UPDATE_EMAIL_SECONDARY_OTP:"@w3m-app/UPDATE_EMAIL_SECONDARY_OTP",APP_AWAIT_UPDATE_EMAIL:"@w3m-app/AWAIT_UPDATE_EMAIL",APP_SYNC_THEME:"@w3m-app/SYNC_THEME",APP_SYNC_DAPP_DATA:"@w3m-app/SYNC_DAPP_DATA",APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS:"@w3m-app/GET_SMART_ACCOUNT_ENABLED_NETWORKS",APP_INIT_SMART_ACCOUNT:"@w3m-app/INIT_SMART_ACCOUNT",APP_SET_PREFERRED_ACCOUNT:"@w3m-app/SET_PREFERRED_ACCOUNT",FRAME_SWITCH_NETWORK_ERROR:"@w3m-frame/SWITCH_NETWORK_ERROR",FRAME_SWITCH_NETWORK_SUCCESS:"@w3m-frame/SWITCH_NETWORK_SUCCESS",FRAME_CONNECT_EMAIL_ERROR:"@w3m-frame/CONNECT_EMAIL_ERROR",FRAME_CONNECT_EMAIL_SUCCESS:"@w3m-frame/CONNECT_EMAIL_SUCCESS",FRAME_CONNECT_DEVICE_ERROR:"@w3m-frame/CONNECT_DEVICE_ERROR",FRAME_CONNECT_DEVICE_SUCCESS:"@w3m-frame/CONNECT_DEVICE_SUCCESS",FRAME_CONNECT_OTP_SUCCESS:"@w3m-frame/CONNECT_OTP_SUCCESS",FRAME_CONNECT_OTP_ERROR:"@w3m-frame/CONNECT_OTP_ERROR",FRAME_GET_USER_SUCCESS:"@w3m-frame/GET_USER_SUCCESS",FRAME_GET_USER_ERROR:"@w3m-frame/GET_USER_ERROR",FRAME_SIGN_OUT_SUCCESS:"@w3m-frame/SIGN_OUT_SUCCESS",FRAME_SIGN_OUT_ERROR:"@w3m-frame/SIGN_OUT_ERROR",FRAME_IS_CONNECTED_SUCCESS:"@w3m-frame/IS_CONNECTED_SUCCESS",FRAME_IS_CONNECTED_ERROR:"@w3m-frame/IS_CONNECTED_ERROR",FRAME_GET_CHAIN_ID_SUCCESS:"@w3m-frame/GET_CHAIN_ID_SUCCESS",FRAME_GET_CHAIN_ID_ERROR:"@w3m-frame/GET_CHAIN_ID_ERROR",FRAME_RPC_REQUEST_SUCCESS:"@w3m-frame/RPC_REQUEST_SUCCESS",FRAME_RPC_REQUEST_ERROR:"@w3m-frame/RPC_REQUEST_ERROR",FRAME_SESSION_UPDATE:"@w3m-frame/SESSION_UPDATE",FRAME_UPDATE_EMAIL_SUCCESS:"@w3m-frame/UPDATE_EMAIL_SUCCESS",FRAME_UPDATE_EMAIL_ERROR:"@w3m-frame/UPDATE_EMAIL_ERROR",FRAME_UPDATE_EMAIL_PRIMARY_OTP_SUCCESS:"@w3m-frame/UPDATE_EMAIL_PRIMARY_OTP_SUCCESS",FRAME_UPDATE_EMAIL_PRIMARY_OTP_ERROR:"@w3m-frame/UPDATE_EMAIL_PRIMARY_OTP_ERROR",FRAME_UPDATE_EMAIL_SECONDARY_OTP_SUCCESS:"@w3m-frame/UPDATE_EMAIL_SECONDARY_OTP_SUCCESS",FRAME_UPDATE_EMAIL_SECONDARY_OTP_ERROR:"@w3m-frame/UPDATE_EMAIL_SECONDARY_OTP_ERROR",FRAME_SYNC_THEME_SUCCESS:"@w3m-frame/SYNC_THEME_SUCCESS",FRAME_SYNC_THEME_ERROR:"@w3m-frame/SYNC_THEME_ERROR",FRAME_SYNC_DAPP_DATA_SUCCESS:"@w3m-frame/SYNC_DAPP_DATA_SUCCESS",FRAME_SYNC_DAPP_DATA_ERROR:"@w3m-frame/SYNC_DAPP_DATA_ERROR",FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS:"@w3m-frame/GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS",FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR:"@w3m-frame/GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR",FRAME_INIT_SMART_ACCOUNT_SUCCESS:"@w3m-frame/INIT_SMART_ACCOUNT_SUCCESS",FRAME_INIT_SMART_ACCOUNT_ERROR:"@w3m-frame/INIT_SMART_ACCOUNT_ERROR",FRAME_SET_PREFERRED_ACCOUNT_SUCCESS:"@w3m-frame/SET_PREFERRED_ACCOUNT_SUCCESS",FRAME_SET_PREFERRED_ACCOUNT_ERROR:"@w3m-frame/SET_PREFERRED_ACCOUNT_ERROR"},Gt={SAFE_RPC_METHODS:["eth_accounts","eth_blockNumber","eth_call","eth_chainId","eth_estimateGas","eth_feeHistory","eth_gasPrice","eth_getAccount","eth_getBalance","eth_getBlockByHash","eth_getBlockByNumber","eth_getBlockReceipts","eth_getBlockTransactionCountByHash","eth_getBlockTransactionCountByNumber","eth_getCode","eth_getFilterChanges","eth_getFilterLogs","eth_getLogs","eth_getProof","eth_getStorageAt","eth_getTransactionByBlockHashAndIndex","eth_getTransactionByBlockNumberAndIndex","eth_getTransactionByHash","eth_getTransactionCount","eth_getTransactionReceipt","eth_getUncleCountByBlockHash","eth_getUncleCountByBlockNumber","eth_maxPriorityFeePerGas","eth_newBlockFilter","eth_newFilter","eth_newPendingTransactionFilter","eth_sendRawTransaction","eth_syncing","eth_uninstallFilter"],NOT_SAFE_RPC_METHODS:["personal_sign","eth_signTypedData_v4","eth_sendTransaction"],GET_CHAIN_ID:"eth_chainId",RPC_METHOD_NOT_ALLOWED_MESSAGE:"Requested RPC call is not allowed",RPC_METHOD_NOT_ALLOWED_UI_MESSAGE:"Action not allowed",ACCOUNT_TYPES:{EOA:"eoa",SMART_ACCOUNT:"smartAccount"}};var He;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const o={};for(const s of i)o[s]=s;return o},t.getValidEnumValues=i=>{const o=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(const a of o)s[a]=i[a];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(o){return i[o]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},t.find=(i,o)=>{for(const s of i)if(o(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(He||(He={}));var _g;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(_g||(_g={}));const ae=He.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),wo=t=>{switch(typeof t){case"undefined":return ae.undefined;case"string":return ae.string;case"number":return isNaN(t)?ae.nan:ae.number;case"boolean":return ae.boolean;case"function":return ae.function;case"bigint":return ae.bigint;case"symbol":return ae.symbol;case"object":return Array.isArray(t)?ae.array:t===null?ae.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ae.promise:typeof Map<"u"&&t instanceof Map?ae.map:typeof Set<"u"&&t instanceof Set?ae.set:typeof Date<"u"&&t instanceof Date?ae.date:ae.object;default:return ae.unknown}},ie=He.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),zO=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class $r extends Error{constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(o){return o.message},r={_errors:[]},i=o=>{for(const s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let a=r,l=0;for(;ln.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(e(i))):r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}$r.create=t=>new $r(t);const vd=(t,e)=>{let n;switch(t.code){case ie.invalid_type:t.received===ae.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case ie.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,He.jsonStringifyReplacer)}`;break;case ie.unrecognized_keys:n=`Unrecognized key(s) in object: ${He.joinValues(t.keys,", ")}`;break;case ie.invalid_union:n="Invalid input";break;case ie.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${He.joinValues(t.options)}`;break;case ie.invalid_enum_value:n=`Invalid enum value. Expected ${He.joinValues(t.options)}, received '${t.received}'`;break;case ie.invalid_arguments:n="Invalid function arguments";break;case ie.invalid_return_type:n="Invalid function return type";break;case ie.invalid_date:n="Invalid date";break;case ie.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:He.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case ie.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case ie.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case ie.custom:n="Invalid input";break;case ie.invalid_intersection_types:n="Intersection results could not be merged";break;case ie.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case ie.not_finite:n="Number must be finite";break;default:n=e.defaultError,He.assertNever(t)}return{message:n}};let X8=vd;function WO(t){X8=t}function up(){return X8}const dp=t=>{const{data:e,path:n,errorMaps:r,issueData:i}=t,o=[...n,...i.path||[]],s={...i,path:o};let a="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)a=c(s,{data:e,defaultError:a}).message;return{...i,path:o,message:i.message||a}},HO=[];function ce(t,e){const n=dp({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,up(),vd].filter(r=>!!r)});t.common.issues.push(n)}class sn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const i of n){if(i.status==="aborted")return Re;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const i of n)r.push({key:await i.key,value:await i.value});return sn.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const i of n){const{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return Re;o.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(r[o.value]=s.value)}return{status:e.value,value:r}}}const Re=Object.freeze({status:"aborted"}),e9=t=>({status:"dirty",value:t}),wn=t=>({status:"valid",value:t}),Eg=t=>t.status==="aborted",Sg=t=>t.status==="dirty",bd=t=>t.status==="valid",fp=t=>typeof Promise<"u"&&t instanceof Promise;var we;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(we||(we={}));class fi{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const kv=(t,e)=>{if(bd(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new $r(t.common.issues);return this._error=n,this._error}}};function Pe(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,a)=>s.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:r??a.defaultError}:{message:n??a.defaultError},description:i}}class Ne{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return wo(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:wo(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new sn,ctx:{common:e.parent.common,data:e.data,parsedType:wo(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(fp(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:wo(e)},o=this._parseSync({data:e,path:i.path,parent:i});return kv(i,o)}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:wo(e)},i=this._parse({data:e,path:r.path,parent:r}),o=await(fp(i)?i:Promise.resolve(i));return kv(r,o)}refine(e,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const s=e(i),a=()=>o.addIssue({code:ie.custom,...r(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new Br({schema:this,typeName:_e.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Li.create(this,this._def)}nullable(){return Ca.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Pr.create(this,this._def)}promise(){return yc.create(this,this._def)}or(e){return Ed.create([this,e],this._def)}and(e){return Sd.create(this,e,this._def)}transform(e){return new Br({...Pe(this._def),schema:this,typeName:_e.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new $d({...Pe(this._def),innerType:this,defaultValue:n,typeName:_e.ZodDefault})}brand(){return new n9({typeName:_e.ZodBranded,type:this,...Pe(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new gp({...Pe(this._def),innerType:this,catchValue:n,typeName:_e.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return yf.create(this,e)}readonly(){return yp.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const VO=/^c[^\s-]{8,}$/i,ZO=/^[a-z][a-z0-9]*$/,GO=/^[0-9A-HJKMNP-TV-Z]{26}$/,qO=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,KO=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,YO="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let F1;const QO=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,JO=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,XO=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function eN(t,e){return!!((e==="v4"||!e)&&QO.test(t)||(e==="v6"||!e)&&JO.test(t))}class Ar extends Ne{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ae.string){const o=this._getOrReturnCtx(e);return ce(o,{code:ie.invalid_type,expected:ae.string,received:o.parsedType}),Re}const r=new sn;let i;for(const o of this._def.checks)if(o.kind==="min")e.data.lengtho.value&&(i=this._getOrReturnCtx(e,i),ce(i,{code:ie.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const s=e.data.length>o.value,a=e.data.lengthe.test(i),{validation:n,code:ie.invalid_string,...we.errToObj(r)})}_addCheck(e){return new Ar({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...we.errToObj(e)})}url(e){return this._addCheck({kind:"url",...we.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...we.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...we.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...we.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...we.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...we.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...we.errToObj(e)})}datetime(e){var n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,...we.errToObj(e==null?void 0:e.message)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...we.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...we.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...we.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...we.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...we.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...we.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...we.errToObj(n)})}nonempty(e){return this.min(1,we.errToObj(e))}trim(){return new Ar({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ar({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ar({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value{var e;return new Ar({checks:[],typeName:_e.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Pe(t)})};function tN(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,o=parseInt(t.toFixed(i).replace(".","")),s=parseInt(e.toFixed(i).replace(".",""));return o%s/Math.pow(10,i)}class es extends Ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ae.number){const o=this._getOrReturnCtx(e);return ce(o,{code:ie.invalid_type,expected:ae.number,received:o.parsedType}),Re}let r;const i=new sn;for(const o of this._def.checks)o.kind==="int"?He.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),ce(r,{code:ie.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?e.datao.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),ce(r,{code:ie.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?tN(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),ce(r,{code:ie.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),ce(r,{code:ie.not_finite,message:o.message}),i.dirty()):He.assertNever(o);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,we.toString(n))}gt(e,n){return this.setLimit("min",e,!1,we.toString(n))}lte(e,n){return this.setLimit("max",e,!0,we.toString(n))}lt(e,n){return this.setLimit("max",e,!1,we.toString(n))}setLimit(e,n,r,i){return new es({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:we.toString(i)}]})}_addCheck(e){return new es({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:we.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:we.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:we.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:we.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:we.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:we.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:we.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:we.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:we.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.valuee.kind==="int"||e.kind==="multipleOf"&&He.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.valuenew es({checks:[],typeName:_e.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Pe(t)});class ts extends Ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==ae.bigint){const o=this._getOrReturnCtx(e);return ce(o,{code:ie.invalid_type,expected:ae.bigint,received:o.parsedType}),Re}let r;const i=new sn;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?e.datao.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),ce(r,{code:ie.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),ce(r,{code:ie.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):He.assertNever(o);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,we.toString(n))}gt(e,n){return this.setLimit("min",e,!1,we.toString(n))}lte(e,n){return this.setLimit("max",e,!0,we.toString(n))}lt(e,n){return this.setLimit("max",e,!1,we.toString(n))}setLimit(e,n,r,i){return new ts({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:we.toString(i)}]})}_addCheck(e){return new ts({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:we.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:we.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:we.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:we.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:we.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value{var e;return new ts({checks:[],typeName:_e.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Pe(t)})};class xd extends Ne{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ae.boolean){const r=this._getOrReturnCtx(e);return ce(r,{code:ie.invalid_type,expected:ae.boolean,received:r.parsedType}),Re}return wn(e.data)}}xd.create=t=>new xd({typeName:_e.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Pe(t)});class ba extends Ne{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ae.date){const o=this._getOrReturnCtx(e);return ce(o,{code:ie.invalid_type,expected:ae.date,received:o.parsedType}),Re}if(isNaN(e.data.getTime())){const o=this._getOrReturnCtx(e);return ce(o,{code:ie.invalid_date}),Re}const r=new sn;let i;for(const o of this._def.checks)o.kind==="min"?e.data.getTime()o.value&&(i=this._getOrReturnCtx(e,i),ce(i,{code:ie.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):He.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ba({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:we.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:we.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.valuenew ba({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:_e.ZodDate,...Pe(t)});class pp extends Ne{_parse(e){if(this._getType(e)!==ae.symbol){const r=this._getOrReturnCtx(e);return ce(r,{code:ie.invalid_type,expected:ae.symbol,received:r.parsedType}),Re}return wn(e.data)}}pp.create=t=>new pp({typeName:_e.ZodSymbol,...Pe(t)});class Cd extends Ne{_parse(e){if(this._getType(e)!==ae.undefined){const r=this._getOrReturnCtx(e);return ce(r,{code:ie.invalid_type,expected:ae.undefined,received:r.parsedType}),Re}return wn(e.data)}}Cd.create=t=>new Cd({typeName:_e.ZodUndefined,...Pe(t)});class _d extends Ne{_parse(e){if(this._getType(e)!==ae.null){const r=this._getOrReturnCtx(e);return ce(r,{code:ie.invalid_type,expected:ae.null,received:r.parsedType}),Re}return wn(e.data)}}_d.create=t=>new _d({typeName:_e.ZodNull,...Pe(t)});class wc extends Ne{constructor(){super(...arguments),this._any=!0}_parse(e){return wn(e.data)}}wc.create=t=>new wc({typeName:_e.ZodAny,...Pe(t)});class Fs extends Ne{constructor(){super(...arguments),this._unknown=!0}_parse(e){return wn(e.data)}}Fs.create=t=>new Fs({typeName:_e.ZodUnknown,...Pe(t)});class qi extends Ne{_parse(e){const n=this._getOrReturnCtx(e);return ce(n,{code:ie.invalid_type,expected:ae.never,received:n.parsedType}),Re}}qi.create=t=>new qi({typeName:_e.ZodNever,...Pe(t)});class hp extends Ne{_parse(e){if(this._getType(e)!==ae.undefined){const r=this._getOrReturnCtx(e);return ce(r,{code:ie.invalid_type,expected:ae.void,received:r.parsedType}),Re}return wn(e.data)}}hp.create=t=>new hp({typeName:_e.ZodVoid,...Pe(t)});class Pr extends Ne{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==ae.array)return ce(n,{code:ie.invalid_type,expected:ae.array,received:n.parsedType}),Re;if(i.exactLength!==null){const s=n.data.length>i.exactLength.value,a=n.data.lengthi.maxLength.value&&(ce(n,{code:ie.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>i.type._parseAsync(new fi(n,s,n.path,a)))).then(s=>sn.mergeArray(r,s));const o=[...n.data].map((s,a)=>i.type._parseSync(new fi(n,s,n.path,a)));return sn.mergeArray(r,o)}get element(){return this._def.type}min(e,n){return new Pr({...this._def,minLength:{value:e,message:we.toString(n)}})}max(e,n){return new Pr({...this._def,maxLength:{value:e,message:we.toString(n)}})}length(e,n){return new Pr({...this._def,exactLength:{value:e,message:we.toString(n)}})}nonempty(e){return this.min(1,e)}}Pr.create=(t,e)=>new Pr({type:t,minLength:null,maxLength:null,exactLength:null,typeName:_e.ZodArray,...Pe(e)});function Ka(t){if(t instanceof ft){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=Li.create(Ka(r))}return new ft({...t._def,shape:()=>e})}else return t instanceof Pr?new Pr({...t._def,type:Ka(t.element)}):t instanceof Li?Li.create(Ka(t.unwrap())):t instanceof Ca?Ca.create(Ka(t.unwrap())):t instanceof pi?pi.create(t.items.map(e=>Ka(e))):t}class ft extends Ne{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=He.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==ae.object){const c=this._getOrReturnCtx(e);return ce(c,{code:ie.invalid_type,expected:ae.object,received:c.parsedType}),Re}const{status:r,ctx:i}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof qi&&this._def.unknownKeys==="strip"))for(const c in i.data)s.includes(c)||a.push(c);const l=[];for(const c of s){const u=o[c],d=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new fi(i,d,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof qi){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of a)l.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(c==="strict")a.length>0&&(ce(i,{code:ie.unrecognized_keys,keys:a}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of a){const d=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new fi(i,d,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const d=await u.key;c.push({key:d,value:await u.value,alwaysSet:u.alwaysSet})}return c}).then(c=>sn.mergeObjectSync(r,c)):sn.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return we.errToObj,new ft({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var i,o,s,a;const l=(s=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,n,r).message)!==null&&s!==void 0?s:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=we.errToObj(e).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new ft({...this._def,unknownKeys:"strip"})}passthrough(){return new ft({...this._def,unknownKeys:"passthrough"})}extend(e){return new ft({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ft({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_e.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new ft({...this._def,catchall:e})}pick(e){const n={};return He.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new ft({...this._def,shape:()=>n})}omit(e){const n={};return He.objectKeys(this.shape).forEach(r=>{e[r]||(n[r]=this.shape[r])}),new ft({...this._def,shape:()=>n})}deepPartial(){return Ka(this)}partial(e){const n={};return He.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}),new ft({...this._def,shape:()=>n})}required(e){const n={};return He.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Li;)o=o._def.innerType;n[r]=o}}),new ft({...this._def,shape:()=>n})}keyof(){return t9(He.objectKeys(this.shape))}}ft.create=(t,e)=>new ft({shape:()=>t,unknownKeys:"strip",catchall:qi.create(),typeName:_e.ZodObject,...Pe(e)});ft.strictCreate=(t,e)=>new ft({shape:()=>t,unknownKeys:"strict",catchall:qi.create(),typeName:_e.ZodObject,...Pe(e)});ft.lazycreate=(t,e)=>new ft({shape:t,unknownKeys:"strip",catchall:qi.create(),typeName:_e.ZodObject,...Pe(e)});class Ed extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function i(o){for(const a of o)if(a.result.status==="valid")return a.result;for(const a of o)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const s=o.map(a=>new $r(a.ctx.common.issues));return ce(n,{code:ie.invalid_union,unionErrors:s}),Re}if(n.common.async)return Promise.all(r.map(async o=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let o;const s=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const a=s.map(l=>new $r(l));return ce(n,{code:ie.invalid_union,unionErrors:a}),Re}}get options(){return this._def.options}}Ed.create=(t,e)=>new Ed({options:t,typeName:_e.ZodUnion,...Pe(e)});const v0=t=>t instanceof Ad?v0(t.schema):t instanceof Br?v0(t.innerType()):t instanceof kd?[t.value]:t instanceof ns?t.options:t instanceof Rd?Object.keys(t.enum):t instanceof $d?v0(t._def.innerType):t instanceof Cd?[void 0]:t instanceof _d?[null]:null;class Eh extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.object)return ce(n,{code:ie.invalid_type,expected:ae.object,received:n.parsedType}),Re;const r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(ce(n,{code:ie.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Re)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const i=new Map;for(const o of n){const s=v0(o.shape[e]);if(!s)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of s){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,o)}}return new Eh({typeName:_e.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...Pe(r)})}}function Tg(t,e){const n=wo(t),r=wo(e);if(t===e)return{valid:!0,data:t};if(n===ae.object&&r===ae.object){const i=He.objectKeys(e),o=He.objectKeys(t).filter(a=>i.indexOf(a)!==-1),s={...t,...e};for(const a of o){const l=Tg(t[a],e[a]);if(!l.valid)return{valid:!1};s[a]=l.data}return{valid:!0,data:s}}else if(n===ae.array&&r===ae.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let o=0;o{if(Eg(o)||Eg(s))return Re;const a=Tg(o.value,s.value);return a.valid?((Sg(o)||Sg(s))&&n.dirty(),{status:n.value,value:a.data}):(ce(r,{code:ie.invalid_intersection_types}),Re)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,s])=>i(o,s)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Sd.create=(t,e,n)=>new Sd({left:t,right:e,typeName:_e.ZodIntersection,...Pe(n)});class pi extends Ne{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ae.array)return ce(r,{code:ie.invalid_type,expected:ae.array,received:r.parsedType}),Re;if(r.data.lengththis._def.items.length&&(ce(r,{code:ie.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((s,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new fi(r,s,r.path,a)):null}).filter(s=>!!s);return r.common.async?Promise.all(o).then(s=>sn.mergeArray(n,s)):sn.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new pi({...this._def,rest:e})}}pi.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new pi({items:t,typeName:_e.ZodTuple,rest:null,...Pe(e)})};class Td extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ae.object)return ce(r,{code:ie.invalid_type,expected:ae.object,received:r.parsedType}),Re;const i=[],o=this._def.keyType,s=this._def.valueType;for(const a in r.data)i.push({key:o._parse(new fi(r,a,r.path,a)),value:s._parse(new fi(r,r.data[a],r.path,a))});return r.common.async?sn.mergeObjectAsync(n,i):sn.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof Ne?new Td({keyType:e,valueType:n,typeName:_e.ZodRecord,...Pe(r)}):new Td({keyType:Ar.create(),valueType:e,typeName:_e.ZodRecord,...Pe(n)})}}class mp extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ae.map)return ce(r,{code:ie.invalid_type,expected:ae.map,received:r.parsedType}),Re;const i=this._def.keyType,o=this._def.valueType,s=[...r.data.entries()].map(([a,l],c)=>({key:i._parse(new fi(r,a,r.path,[c,"key"])),value:o._parse(new fi(r,l,r.path,[c,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of s){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return Re;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of s){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return Re;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}}}}mp.create=(t,e,n)=>new mp({valueType:e,keyType:t,typeName:_e.ZodMap,...Pe(n)});class xa extends Ne{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ae.set)return ce(r,{code:ie.invalid_type,expected:ae.set,received:r.parsedType}),Re;const i=this._def;i.minSize!==null&&r.data.sizei.maxSize.value&&(ce(r,{code:ie.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function s(l){const c=new Set;for(const u of l){if(u.status==="aborted")return Re;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const a=[...r.data.values()].map((l,c)=>o._parse(new fi(r,l,r.path,c)));return r.common.async?Promise.all(a).then(l=>s(l)):s(a)}min(e,n){return new xa({...this._def,minSize:{value:e,message:we.toString(n)}})}max(e,n){return new xa({...this._def,maxSize:{value:e,message:we.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}xa.create=(t,e)=>new xa({valueType:t,minSize:null,maxSize:null,typeName:_e.ZodSet,...Pe(e)});class yl extends Ne{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.function)return ce(n,{code:ie.invalid_type,expected:ae.function,received:n.parsedType}),Re;function r(a,l){return dp({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,up(),vd].filter(c=>!!c),issueData:{code:ie.invalid_arguments,argumentsError:l}})}function i(a,l){return dp({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,up(),vd].filter(c=>!!c),issueData:{code:ie.invalid_return_type,returnTypeError:l}})}const o={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof yc){const a=this;return wn(async function(...l){const c=new $r([]),u=await a._def.args.parseAsync(l,o).catch(g=>{throw c.addIssue(r(l,g)),c}),d=await Reflect.apply(s,this,u);return await a._def.returns._def.type.parseAsync(d,o).catch(g=>{throw c.addIssue(i(d,g)),c})})}else{const a=this;return wn(function(...l){const c=a._def.args.safeParse(l,o);if(!c.success)throw new $r([r(l,c.error)]);const u=Reflect.apply(s,this,c.data),d=a._def.returns.safeParse(u,o);if(!d.success)throw new $r([i(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new yl({...this._def,args:pi.create(e).rest(Fs.create())})}returns(e){return new yl({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new yl({args:e||pi.create([]).rest(Fs.create()),returns:n||Fs.create(),typeName:_e.ZodFunction,...Pe(r)})}}class Ad extends Ne{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Ad.create=(t,e)=>new Ad({getter:t,typeName:_e.ZodLazy,...Pe(e)});class kd extends Ne{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ce(n,{received:n.data,code:ie.invalid_literal,expected:this._def.value}),Re}return{status:"valid",value:e.data}}get value(){return this._def.value}}kd.create=(t,e)=>new kd({value:t,typeName:_e.ZodLiteral,...Pe(e)});function t9(t,e){return new ns({values:t,typeName:_e.ZodEnum,...Pe(e)})}class ns extends Ne{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return ce(n,{expected:He.joinValues(r),received:n.parsedType,code:ie.invalid_type}),Re}if(this._def.values.indexOf(e.data)===-1){const n=this._getOrReturnCtx(e),r=this._def.values;return ce(n,{received:n.data,code:ie.invalid_enum_value,options:r}),Re}return wn(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e){return ns.create(e)}exclude(e){return ns.create(this.options.filter(n=>!e.includes(n)))}}ns.create=t9;class Rd extends Ne{_parse(e){const n=He.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==ae.string&&r.parsedType!==ae.number){const i=He.objectValues(n);return ce(r,{expected:He.joinValues(i),received:r.parsedType,code:ie.invalid_type}),Re}if(n.indexOf(e.data)===-1){const i=He.objectValues(n);return ce(r,{received:r.data,code:ie.invalid_enum_value,options:i}),Re}return wn(e.data)}get enum(){return this._def.values}}Rd.create=(t,e)=>new Rd({values:t,typeName:_e.ZodNativeEnum,...Pe(e)});class yc extends Ne{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.promise&&n.common.async===!1)return ce(n,{code:ie.invalid_type,expected:ae.promise,received:n.parsedType}),Re;const r=n.parsedType===ae.promise?n.data:Promise.resolve(n.data);return wn(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}yc.create=(t,e)=>new yc({type:t,typeName:_e.ZodPromise,...Pe(e)});class Br extends Ne{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_e.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,o={addIssue:s=>{ce(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){const s=i.transform(r.data,o);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(s).then(a=>this._def.schema._parseAsync({data:a,path:r.path,parent:r})):this._def.schema._parseSync({data:s,path:r.path,parent:r})}if(i.type==="refinement"){const s=a=>{const l=i.refinement(a,o);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Re:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?Re:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!bd(s))return s;const a=i.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>bd(s)?Promise.resolve(i.transform(s.value,o)).then(a=>({status:n.value,value:a})):s);He.assertNever(i)}}Br.create=(t,e,n)=>new Br({schema:t,typeName:_e.ZodEffects,effect:e,...Pe(n)});Br.createWithPreprocess=(t,e,n)=>new Br({schema:e,effect:{type:"preprocess",transform:t},typeName:_e.ZodEffects,...Pe(n)});class Li extends Ne{_parse(e){return this._getType(e)===ae.undefined?wn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Li.create=(t,e)=>new Li({innerType:t,typeName:_e.ZodOptional,...Pe(e)});class Ca extends Ne{_parse(e){return this._getType(e)===ae.null?wn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ca.create=(t,e)=>new Ca({innerType:t,typeName:_e.ZodNullable,...Pe(e)});class $d extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===ae.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}$d.create=(t,e)=>new $d({innerType:t,typeName:_e.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Pe(e)});class gp extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return fp(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new $r(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new $r(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}gp.create=(t,e)=>new gp({innerType:t,typeName:_e.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Pe(e)});class wp extends Ne{_parse(e){if(this._getType(e)!==ae.nan){const r=this._getOrReturnCtx(e);return ce(r,{code:ie.invalid_type,expected:ae.nan,received:r.parsedType}),Re}return{status:"valid",value:e.data}}}wp.create=t=>new wp({typeName:_e.ZodNaN,...Pe(t)});const nN=Symbol("zod_brand");class n9 extends Ne{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class yf extends Ne{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Re:o.status==="dirty"?(n.dirty(),e9(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Re:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new yf({in:e,out:n,typeName:_e.ZodPipeline})}}class yp extends Ne{_parse(e){const n=this._def.innerType._parse(e);return bd(n)&&(n.value=Object.freeze(n.value)),n}}yp.create=(t,e)=>new yp({innerType:t,typeName:_e.ZodReadonly,...Pe(e)});const r9=(t,e={},n)=>t?wc.create().superRefine((r,i)=>{var o,s;if(!t(r)){const a=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,l=(s=(o=a.fatal)!==null&&o!==void 0?o:n)!==null&&s!==void 0?s:!0,c=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...c,fatal:l})}}):wc.create(),rN={object:ft.lazycreate};var _e;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(_e||(_e={}));const iN=(t,e={message:`Input not instance of ${t.name}`})=>r9(n=>n instanceof t,e),i9=Ar.create,o9=es.create,oN=wp.create,sN=ts.create,s9=xd.create,aN=ba.create,lN=pp.create,cN=Cd.create,uN=_d.create,dN=wc.create,fN=Fs.create,pN=qi.create,hN=hp.create,mN=Pr.create,gN=ft.create,wN=ft.strictCreate,yN=Ed.create,vN=Eh.create,bN=Sd.create,xN=pi.create,CN=Td.create,_N=mp.create,EN=xa.create,SN=yl.create,TN=Ad.create,AN=kd.create,kN=ns.create,RN=Rd.create,$N=yc.create,Rv=Br.create,PN=Li.create,IN=Ca.create,ON=Br.createWithPreprocess,NN=yf.create,MN=()=>i9().optional(),LN=()=>o9().optional(),DN=()=>s9().optional(),BN={string:t=>Ar.create({...t,coerce:!0}),number:t=>es.create({...t,coerce:!0}),boolean:t=>xd.create({...t,coerce:!0}),bigint:t=>ts.create({...t,coerce:!0}),date:t=>ba.create({...t,coerce:!0})},jN=Re;var $=Object.freeze({__proto__:null,defaultErrorMap:vd,setErrorMap:WO,getErrorMap:up,makeIssue:dp,EMPTY_PATH:HO,addIssueToContext:ce,ParseStatus:sn,INVALID:Re,DIRTY:e9,OK:wn,isAborted:Eg,isDirty:Sg,isValid:bd,isAsync:fp,get util(){return He},get objectUtil(){return _g},ZodParsedType:ae,getParsedType:wo,ZodType:Ne,ZodString:Ar,ZodNumber:es,ZodBigInt:ts,ZodBoolean:xd,ZodDate:ba,ZodSymbol:pp,ZodUndefined:Cd,ZodNull:_d,ZodAny:wc,ZodUnknown:Fs,ZodNever:qi,ZodVoid:hp,ZodArray:Pr,ZodObject:ft,ZodUnion:Ed,ZodDiscriminatedUnion:Eh,ZodIntersection:Sd,ZodTuple:pi,ZodRecord:Td,ZodMap:mp,ZodSet:xa,ZodFunction:yl,ZodLazy:Ad,ZodLiteral:kd,ZodEnum:ns,ZodNativeEnum:Rd,ZodPromise:yc,ZodEffects:Br,ZodTransformer:Br,ZodOptional:Li,ZodNullable:Ca,ZodDefault:$d,ZodCatch:gp,ZodNaN:wp,BRAND:nN,ZodBranded:n9,ZodPipeline:yf,ZodReadonly:yp,custom:r9,Schema:Ne,ZodSchema:Ne,late:rN,get ZodFirstPartyTypeKind(){return _e},coerce:BN,any:dN,array:mN,bigint:sN,boolean:s9,date:aN,discriminatedUnion:vN,effect:Rv,enum:kN,function:SN,instanceof:iN,intersection:bN,lazy:TN,literal:AN,map:_N,nan:oN,nativeEnum:RN,never:pN,null:uN,nullable:IN,number:o9,object:gN,oboolean:DN,onumber:LN,optional:PN,ostring:MN,pipeline:NN,preprocess:ON,promise:$N,record:CN,set:EN,strictObject:wN,string:i9,symbol:lN,transformer:Rv,tuple:xN,undefined:cN,union:yN,unknown:fN,void:hN,NEVER:jN,ZodIssueCode:ie,quotelessJson:zO,ZodError:$r});const Vt=$.object({message:$.string()});function ve(t){return $.literal(oe[t])}$.object({accessList:$.array($.string()),blockHash:$.string().nullable(),blockNumber:$.string().nullable(),chainId:$.string(),from:$.string(),gas:$.string(),hash:$.string(),input:$.string().nullable(),maxFeePerGas:$.string(),maxPriorityFeePerGas:$.string(),nonce:$.string(),r:$.string(),s:$.string(),to:$.string(),transactionIndex:$.string().nullable(),type:$.string(),v:$.string(),value:$.string()});const UN=$.object({chainId:$.number()}),FN=$.object({email:$.string().email()}),zN=$.object({otp:$.string()}),WN=$.object({chainId:$.optional($.number()),preferredAccountType:$.optional($.string())}),HN=$.object({email:$.string().email()}),VN=$.object({otp:$.string()}),ZN=$.object({otp:$.string()}),GN=$.object({themeMode:$.optional($.enum(["light","dark"])),themeVariables:$.optional($.record($.string(),$.string().or($.number())))}),qN=$.object({metadata:$.object({name:$.string(),description:$.string(),url:$.string(),icons:$.array($.string())}).optional(),sdkVersion:$.string(),projectId:$.string()}),KN=$.object({type:$.string()}),YN=$.object({action:$.enum(["VERIFY_DEVICE","VERIFY_OTP"])}),QN=$.object({email:$.string().email(),address:$.string(),chainId:$.number(),smartAccountDeployed:$.optional($.boolean())}),JN=$.object({isConnected:$.boolean()}),XN=$.object({chainId:$.number()}),eM=$.object({chainId:$.number()}),tM=$.object({newEmail:$.string().email()}),nM=$.object({smartAccountEnabledNetworks:$.array($.number())});$.object({address:$.string(),isDeployed:$.boolean()});const rM=$.object({type:$.string(),address:$.string()}),iM=$.any(),oM=$.object({method:$.literal("eth_accounts")}),sM=$.object({method:$.literal("eth_blockNumber")}),aM=$.object({method:$.literal("eth_call"),params:$.array($.any())}),lM=$.object({method:$.literal("eth_chainId")}),cM=$.object({method:$.literal("eth_estimateGas"),params:$.array($.any())}),uM=$.object({method:$.literal("eth_feeHistory"),params:$.array($.any())}),dM=$.object({method:$.literal("eth_gasPrice")}),fM=$.object({method:$.literal("eth_getAccount"),params:$.array($.any())}),pM=$.object({method:$.literal("eth_getBalance"),params:$.array($.any())}),hM=$.object({method:$.literal("eth_getBlockByHash"),params:$.array($.any())}),mM=$.object({method:$.literal("eth_getBlockByNumber"),params:$.array($.any())}),gM=$.object({method:$.literal("eth_getBlockReceipts"),params:$.array($.any())}),wM=$.object({method:$.literal("eth_getBlockTransactionCountByHash"),params:$.array($.any())}),yM=$.object({method:$.literal("eth_getBlockTransactionCountByNumber"),params:$.array($.any())}),vM=$.object({method:$.literal("eth_getCode"),params:$.array($.any())}),bM=$.object({method:$.literal("eth_getFilterChanges"),params:$.array($.any())}),xM=$.object({method:$.literal("eth_getFilterLogs"),params:$.array($.any())}),CM=$.object({method:$.literal("eth_getLogs"),params:$.array($.any())}),_M=$.object({method:$.literal("eth_getProof"),params:$.array($.any())}),EM=$.object({method:$.literal("eth_getStorageAt"),params:$.array($.any())}),SM=$.object({method:$.literal("eth_getTransactionByBlockHashAndIndex"),params:$.array($.any())}),TM=$.object({method:$.literal("eth_getTransactionByBlockNumberAndIndex"),params:$.array($.any())}),AM=$.object({method:$.literal("eth_getTransactionByHash"),params:$.array($.any())}),kM=$.object({method:$.literal("eth_getTransactionCount"),params:$.array($.any())}),RM=$.object({method:$.literal("eth_getTransactionReceipt"),params:$.array($.any())}),$M=$.object({method:$.literal("eth_getUncleCountByBlockHash"),params:$.array($.any())}),PM=$.object({method:$.literal("eth_getUncleCountByBlockNumber"),params:$.array($.any())}),IM=$.object({method:$.literal("eth_maxPriorityFeePerGas")}),OM=$.object({method:$.literal("eth_newBlockFilter")}),NM=$.object({method:$.literal("eth_newFilter"),params:$.array($.any())}),MM=$.object({method:$.literal("eth_newPendingTransactionFilter")}),LM=$.object({method:$.literal("eth_sendRawTransaction"),params:$.array($.any())}),DM=$.object({method:$.literal("eth_syncing"),params:$.array($.any())}),BM=$.object({method:$.literal("eth_uninstallFilter"),params:$.array($.any())}),$v=$.object({method:$.literal("personal_sign"),params:$.array($.any())}),jM=$.object({method:$.literal("eth_signTypedData_v4"),params:$.array($.any())}),Pv=$.object({method:$.literal("eth_sendTransaction"),params:$.array($.any())}),Iv=$.object({token:$.string()}),Xf={appEvent:$.object({type:ve("APP_SWITCH_NETWORK"),payload:UN}).or($.object({type:ve("APP_CONNECT_EMAIL"),payload:FN})).or($.object({type:ve("APP_CONNECT_DEVICE")})).or($.object({type:ve("APP_CONNECT_OTP"),payload:zN})).or($.object({type:ve("APP_GET_USER"),payload:$.optional(WN)})).or($.object({type:ve("APP_SIGN_OUT")})).or($.object({type:ve("APP_IS_CONNECTED"),payload:$.optional(Iv)})).or($.object({type:ve("APP_GET_CHAIN_ID")})).or($.object({type:ve("APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS")})).or($.object({type:ve("APP_INIT_SMART_ACCOUNT")})).or($.object({type:ve("APP_SET_PREFERRED_ACCOUNT"),payload:KN})).or($.object({type:ve("APP_RPC_REQUEST"),payload:$v.or(Pv).or(oM).or(sM).or(aM).or(lM).or(cM).or(uM).or(dM).or(fM).or(pM).or(hM).or(mM).or(gM).or(wM).or(yM).or(vM).or(bM).or(xM).or(CM).or(_M).or(EM).or(SM).or(TM).or(AM).or(kM).or(RM).or($M).or(PM).or(IM).or(OM).or(NM).or(MM).or(LM).or(DM).or(BM).or($v).or(jM).or(Pv)})).or($.object({type:ve("APP_UPDATE_EMAIL"),payload:HN})).or($.object({type:ve("APP_UPDATE_EMAIL_PRIMARY_OTP"),payload:VN})).or($.object({type:ve("APP_UPDATE_EMAIL_SECONDARY_OTP"),payload:ZN})).or($.object({type:ve("APP_SYNC_THEME"),payload:GN})).or($.object({type:ve("APP_SYNC_DAPP_DATA"),payload:qN})),frameEvent:$.object({type:ve("FRAME_SWITCH_NETWORK_ERROR"),payload:Vt}).or($.object({type:ve("FRAME_SWITCH_NETWORK_SUCCESS"),payload:eM})).or($.object({type:ve("FRAME_CONNECT_EMAIL_ERROR"),payload:Vt})).or($.object({type:ve("FRAME_CONNECT_EMAIL_SUCCESS"),payload:YN})).or($.object({type:ve("FRAME_CONNECT_OTP_ERROR"),payload:Vt})).or($.object({type:ve("FRAME_CONNECT_OTP_SUCCESS")})).or($.object({type:ve("FRAME_CONNECT_DEVICE_ERROR"),payload:Vt})).or($.object({type:ve("FRAME_CONNECT_DEVICE_SUCCESS")})).or($.object({type:ve("FRAME_GET_USER_ERROR"),payload:Vt})).or($.object({type:ve("FRAME_GET_USER_SUCCESS"),payload:QN})).or($.object({type:ve("FRAME_SIGN_OUT_ERROR"),payload:Vt})).or($.object({type:ve("FRAME_SIGN_OUT_SUCCESS")})).or($.object({type:ve("FRAME_IS_CONNECTED_ERROR"),payload:Vt})).or($.object({type:ve("FRAME_IS_CONNECTED_SUCCESS"),payload:JN})).or($.object({type:ve("FRAME_GET_CHAIN_ID_ERROR"),payload:Vt})).or($.object({type:ve("FRAME_GET_CHAIN_ID_SUCCESS"),payload:XN})).or($.object({type:ve("FRAME_RPC_REQUEST_ERROR"),payload:Vt})).or($.object({type:ve("FRAME_RPC_REQUEST_SUCCESS"),payload:iM})).or($.object({type:ve("FRAME_SESSION_UPDATE"),payload:Iv})).or($.object({type:ve("FRAME_UPDATE_EMAIL_ERROR"),payload:Vt})).or($.object({type:ve("FRAME_UPDATE_EMAIL_SUCCESS")})).or($.object({type:ve("FRAME_UPDATE_EMAIL_PRIMARY_OTP_ERROR"),payload:Vt})).or($.object({type:ve("FRAME_UPDATE_EMAIL_PRIMARY_OTP_SUCCESS")})).or($.object({type:ve("FRAME_UPDATE_EMAIL_SECONDARY_OTP_ERROR"),payload:Vt})).or($.object({type:ve("FRAME_UPDATE_EMAIL_SECONDARY_OTP_SUCCESS"),payload:tM})).or($.object({type:ve("FRAME_SYNC_THEME_ERROR"),payload:Vt})).or($.object({type:ve("FRAME_SYNC_THEME_SUCCESS")})).or($.object({type:ve("FRAME_SYNC_DAPP_DATA_ERROR"),payload:Vt})).or($.object({type:ve("FRAME_SYNC_DAPP_DATA_SUCCESS")})).or($.object({type:ve("FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS"),payload:nM})).or($.object({type:ve("FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR"),payload:Vt})).or($.object({type:ve("FRAME_INIT_SMART_ACCOUNT_ERROR"),payload:Vt})).or($.object({type:ve("FRAME_SET_PREFERRED_ACCOUNT_SUCCESS"),payload:rM})).or($.object({type:ve("FRAME_SET_PREFERRED_ACCOUNT_ERROR"),payload:Vt}))},Xt={set(t,e){ct.isClient&&localStorage.setItem(`${oe.STORAGE_KEY}${t}`,e)},get(t){return ct.isClient?localStorage.getItem(`${oe.STORAGE_KEY}${t}`):null},delete(t){ct.isClient&&localStorage.removeItem(`${oe.STORAGE_KEY}${t}`)}},UM=["ASIA/SHANGHAI","ASIA/URUMQI","ASIA/CHONGQING","ASIA/HARBIN","ASIA/KASHGAR","ASIA/MACAU","ASIA/HONG_KONG","ASIA/MACAO","ASIA/BEIJING","ASIA/HARBIN"],e0=30*1e3,ct={getBlockchainApiUrl(){try{const{timeZone:t}=new Intl.DateTimeFormat().resolvedOptions(),e=t.toUpperCase();return UM.includes(e)?"https://rpc.walletconnect.org":"https://rpc.walletconnect.com"}catch{return!1}},checkIfAllowedToTriggerEmail(){const t=Xt.get(oe.LAST_EMAIL_LOGIN_TIME);if(t){const e=Date.now()-Number(t);if(e{ct.isClient&&window.addEventListener("message",({data:i})=>{var s;if(!((s=i.type)!=null&&s.includes(oe.FRAME_EVENT_KEY)))return;const o=Xf.frameEvent.parse(i);r(o)})},onAppEvent:r=>{ct.isClient&&window.addEventListener("message",({data:i})=>{var s;if(!((s=i.type)!=null&&s.includes(oe.APP_EVENT_KEY)))return;const o=Xf.appEvent.parse(i);r(o)})},postAppEvent:r=>{var i;if(ct.isClient){if(!((i=this.iframe)!=null&&i.contentWindow))throw new Error("W3mFrame: iframe is not set");Xf.appEvent.parse(r),window.postMessage(r),this.iframe.contentWindow.postMessage(r,"*")}},postFrameEvent:r=>{if(ct.isClient){if(!parent)throw new Error("W3mFrame: parent is not set");Xf.frameEvent.parse(r),parent.postMessage(r,"*")}}},this.projectId=e,this.frameLoadPromise=new Promise((r,i)=>{this.frameLoadPromiseResolver={resolve:r,reject:i}}),n&&(this.frameLoadPromise=new Promise((r,i)=>{this.frameLoadPromiseResolver={resolve:r,reject:i}}),ct.isClient)){const r=document.createElement("iframe");r.id="w3m-iframe",r.src=`${oe.SECURE_SITE_SDK}?projectId=${e}`,r.style.position="fixed",r.style.zIndex="999999",r.style.display="none",r.style.opacity="0",r.style.borderBottomLeftRadius="clamp(0px, var(--wui-border-radius-l), 44px)",r.style.borderBottomRightRadius="clamp(0px, var(--wui-border-radius-l), 44px)",document.body.appendChild(r),this.iframe=r,this.iframe.onload=()=>{var i;(i=this.frameLoadPromiseResolver)==null||i.resolve(void 0)},this.iframe.onerror=()=>{var i;(i=this.frameLoadPromiseResolver)==null||i.reject("Unable to load email login dependency")}}}get networks(){const e=[1,5,11155111,10,420,42161,421613,137,80001,42220,1313161554,1313161555,56,97,43114,43113,324,280,100,8453,84531,7777777,999].map(n=>({[n]:{rpcUrl:`${this.rpcUrl}/v1/?chainId=eip155:${n}&projectId=${this.projectId}`,chainId:n}}));return Object.assign({},...e)}}class zM{constructor(e){this.connectEmailResolver=void 0,this.connectDeviceResolver=void 0,this.connectOtpResolver=void 0,this.connectResolver=void 0,this.disconnectResolver=void 0,this.isConnectedResolver=void 0,this.getChainIdResolver=void 0,this.switchChainResolver=void 0,this.rpcRequestResolver=void 0,this.updateEmailResolver=void 0,this.updateEmailPrimaryOtpResolver=void 0,this.updateEmailSecondaryOtpResolver=void 0,this.syncThemeResolver=void 0,this.syncDappDataResolver=void 0,this.smartAccountEnabledNetworksResolver=void 0,this.setPreferredAccountResolver=void 0,this.w3mFrame=new FM(e,!0),this.w3mFrame.events.onFrameEvent(n=>{switch(console.log("💻 received",n),n.type){case oe.FRAME_CONNECT_EMAIL_SUCCESS:return this.onConnectEmailSuccess(n);case oe.FRAME_CONNECT_EMAIL_ERROR:return this.onConnectEmailError(n);case oe.FRAME_CONNECT_DEVICE_SUCCESS:return this.onConnectDeviceSuccess();case oe.FRAME_CONNECT_DEVICE_ERROR:return this.onConnectDeviceError(n);case oe.FRAME_CONNECT_OTP_SUCCESS:return this.onConnectOtpSuccess();case oe.FRAME_CONNECT_OTP_ERROR:return this.onConnectOtpError(n);case oe.FRAME_GET_USER_SUCCESS:return this.onConnectSuccess(n);case oe.FRAME_GET_USER_ERROR:return this.onConnectError(n);case oe.FRAME_IS_CONNECTED_SUCCESS:return this.onIsConnectedSuccess(n);case oe.FRAME_IS_CONNECTED_ERROR:return this.onIsConnectedError(n);case oe.FRAME_GET_CHAIN_ID_SUCCESS:return this.onGetChainIdSuccess(n);case oe.FRAME_GET_CHAIN_ID_ERROR:return this.onGetChainIdError(n);case oe.FRAME_SIGN_OUT_SUCCESS:return this.onSignOutSuccess();case oe.FRAME_SIGN_OUT_ERROR:return this.onSignOutError(n);case oe.FRAME_SWITCH_NETWORK_SUCCESS:return this.onSwitchChainSuccess(n);case oe.FRAME_SWITCH_NETWORK_ERROR:return this.onSwitchChainError(n);case oe.FRAME_RPC_REQUEST_SUCCESS:return this.onRpcRequestSuccess(n);case oe.FRAME_RPC_REQUEST_ERROR:return this.onRpcRequestError(n);case oe.FRAME_SESSION_UPDATE:return this.onSessionUpdate(n);case oe.FRAME_UPDATE_EMAIL_SUCCESS:return this.onUpdateEmailSuccess();case oe.FRAME_UPDATE_EMAIL_ERROR:return this.onUpdateEmailError(n);case oe.FRAME_UPDATE_EMAIL_PRIMARY_OTP_SUCCESS:return this.onUpdateEmailPrimaryOtpSuccess();case oe.FRAME_UPDATE_EMAIL_PRIMARY_OTP_ERROR:return this.onUpdateEmailPrimaryOtpError(n);case oe.FRAME_UPDATE_EMAIL_SECONDARY_OTP_SUCCESS:return this.onUpdateEmailSecondaryOtpSuccess(n);case oe.FRAME_UPDATE_EMAIL_SECONDARY_OTP_ERROR:return this.onUpdateEmailSecondaryOtpError(n);case oe.FRAME_SYNC_THEME_SUCCESS:return this.onSyncThemeSuccess();case oe.FRAME_SYNC_THEME_ERROR:return this.onSyncThemeError(n);case oe.FRAME_SYNC_DAPP_DATA_SUCCESS:return this.onSyncDappDataSuccess();case oe.FRAME_SYNC_DAPP_DATA_ERROR:return this.onSyncDappDataError(n);case oe.FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS:return this.onSmartAccountEnabledNetworksSuccess(n);case oe.FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR:return this.onSmartAccountEnabledNetworksError(n);case oe.FRAME_SET_PREFERRED_ACCOUNT_SUCCESS:return this.onPreferSmartAccountSuccess(n);case oe.FRAME_SET_PREFERRED_ACCOUNT_ERROR:return this.onPreferSmartAccountError();default:return null}})}getLoginEmailUsed(){return!!Xt.get(oe.EMAIL_LOGIN_USED_KEY)}getEmail(){return Xt.get(oe.EMAIL)}rejectRpcRequest(){var e;(e=this.rpcRequestResolver)==null||e.reject()}async connectEmail(e){return await this.w3mFrame.frameLoadPromise,ct.checkIfAllowedToTriggerEmail(),this.w3mFrame.events.postAppEvent({type:oe.APP_CONNECT_EMAIL,payload:e}),new Promise((n,r)=>{this.connectEmailResolver={resolve:n,reject:r}})}async connectDevice(){return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:oe.APP_CONNECT_DEVICE}),new Promise((e,n)=>{this.connectDeviceResolver={resolve:e,reject:n}})}async connectOtp(e){return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:oe.APP_CONNECT_OTP,payload:e}),new Promise((n,r)=>{this.connectOtpResolver={resolve:n,reject:r}})}async isConnected(){return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:oe.APP_IS_CONNECTED,payload:void 0}),new Promise((e,n)=>{this.isConnectedResolver={resolve:e,reject:n}})}async getChainId(){return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:oe.APP_GET_CHAIN_ID}),new Promise((e,n)=>{this.getChainIdResolver={resolve:e,reject:n}})}async updateEmail(e){return await this.w3mFrame.frameLoadPromise,ct.checkIfAllowedToTriggerEmail(),this.w3mFrame.events.postAppEvent({type:oe.APP_UPDATE_EMAIL,payload:e}),new Promise((n,r)=>{this.updateEmailResolver={resolve:n,reject:r}})}async updateEmailPrimaryOtp(e){return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:oe.APP_UPDATE_EMAIL_PRIMARY_OTP,payload:e}),new Promise((n,r)=>{this.updateEmailPrimaryOtpResolver={resolve:n,reject:r}})}async updateEmailSecondaryOtp(e){return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:oe.APP_UPDATE_EMAIL_SECONDARY_OTP,payload:e}),new Promise((n,r)=>{this.updateEmailSecondaryOtpResolver={resolve:n,reject:r}})}async syncTheme(e){return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:oe.APP_SYNC_THEME,payload:e}),new Promise((n,r)=>{this.syncThemeResolver={resolve:n,reject:r}})}async syncDappData(e){return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:oe.APP_SYNC_DAPP_DATA,payload:e}),new Promise((n,r)=>{this.syncDappDataResolver={resolve:n,reject:r}})}async getSmartAccountEnabledNetworks(){return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:oe.APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS}),new Promise((e,n)=>{this.smartAccountEnabledNetworksResolver={resolve:e,reject:n}})}async setPreferredAccount(e){return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:oe.APP_SET_PREFERRED_ACCOUNT,payload:{type:e}}),new Promise((n,r)=>{this.setPreferredAccountResolver={resolve:n,reject:r}})}async connect(e){const n=(e==null?void 0:e.chainId)??this.getLastUsedChainId()??1;return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:oe.APP_GET_USER,payload:{chainId:n,preferredAccountType:e==null?void 0:e.preferredAccountType}}),new Promise((r,i)=>{this.connectResolver={resolve:r,reject:i}})}async switchNetwork(e){return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:oe.APP_SWITCH_NETWORK,payload:{chainId:e}}),new Promise((n,r)=>{this.switchChainResolver={resolve:n,reject:r}})}async disconnect(){return await this.w3mFrame.frameLoadPromise,this.w3mFrame.events.postAppEvent({type:oe.APP_SIGN_OUT}),new Promise((e,n)=>{this.disconnectResolver={resolve:e,reject:n}})}async request(e){return await this.w3mFrame.frameLoadPromise,Gt.GET_CHAIN_ID===e.method?this.getLastUsedChainId():(this.w3mFrame.events.postAppEvent({type:oe.APP_RPC_REQUEST,payload:e}),new Promise((n,r)=>{this.rpcRequestResolver={resolve:n,reject:r}}))}onRpcRequest(e){this.w3mFrame.events.onAppEvent(n=>{n.type.includes(oe.RPC_METHOD_KEY)&&e(n)})}onRpcResponse(e){this.w3mFrame.events.onFrameEvent(n=>{n.type.includes(oe.RPC_METHOD_KEY)&&e(n)})}onIsConnected(e){this.w3mFrame.events.onFrameEvent(n=>{n.type===oe.FRAME_GET_USER_SUCCESS&&e(n.payload)})}onNotConnected(e){this.w3mFrame.events.onFrameEvent(n=>{n.type===oe.FRAME_IS_CONNECTED_ERROR&&e(),n.type===oe.FRAME_IS_CONNECTED_SUCCESS&&!n.payload.isConnected&&e()})}onSetPreferredAccount(e){this.w3mFrame.events.onFrameEvent(n=>{n.type===oe.FRAME_SET_PREFERRED_ACCOUNT_SUCCESS?e(n.payload):n.type===oe.FRAME_SET_PREFERRED_ACCOUNT_ERROR&&e({type:Gt.ACCOUNT_TYPES.EOA})})}onGetSmartAccountEnabledNetworks(e){this.w3mFrame.events.onFrameEvent(n=>{n.type===oe.FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS?e(n.payload.smartAccountEnabledNetworks):n.type===oe.FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR&&e([])})}onConnectEmailSuccess(e){var n;(n=this.connectEmailResolver)==null||n.resolve(e.payload),this.setNewLastEmailLoginTime()}onConnectEmailError(e){var n;(n=this.connectEmailResolver)==null||n.reject(e.payload.message)}onConnectDeviceSuccess(){var e;(e=this.connectDeviceResolver)==null||e.resolve(void 0)}onConnectDeviceError(e){var n;(n=this.connectDeviceResolver)==null||n.reject(e.payload.message)}onConnectOtpSuccess(){var e;(e=this.connectOtpResolver)==null||e.resolve(void 0)}onConnectOtpError(e){var n;(n=this.connectOtpResolver)==null||n.reject(e.payload.message)}onConnectSuccess(e){var n;this.setEmailLoginSuccess(e.payload.email),this.setLastUsedChainId(e.payload.chainId),(n=this.connectResolver)==null||n.resolve(e.payload)}onConnectError(e){var n;(n=this.connectResolver)==null||n.reject(e.payload.message)}onIsConnectedSuccess(e){var n;e.payload.isConnected||this.deleteEmailLoginCache(),(n=this.isConnectedResolver)==null||n.resolve(e.payload)}onIsConnectedError(e){var n;(n=this.isConnectedResolver)==null||n.reject(e.payload.message)}onGetChainIdSuccess(e){var n;this.setLastUsedChainId(e.payload.chainId),(n=this.getChainIdResolver)==null||n.resolve(e.payload)}onGetChainIdError(e){var n;(n=this.getChainIdResolver)==null||n.reject(e.payload.message)}onSignOutSuccess(){var e;(e=this.disconnectResolver)==null||e.resolve(void 0),this.deleteEmailLoginCache()}onSignOutError(e){var n;(n=this.disconnectResolver)==null||n.reject(e.payload.message)}onSwitchChainSuccess(e){var n;this.setLastUsedChainId(e.payload.chainId),(n=this.switchChainResolver)==null||n.resolve(e.payload)}onSwitchChainError(e){var n;(n=this.switchChainResolver)==null||n.reject(e.payload.message)}onRpcRequestSuccess(e){var n;(n=this.rpcRequestResolver)==null||n.resolve(e.payload)}onRpcRequestError(e){var n;(n=this.rpcRequestResolver)==null||n.reject(e.payload.message)}onSessionUpdate(e){}onUpdateEmailSuccess(){var e;(e=this.updateEmailResolver)==null||e.resolve(void 0),this.setNewLastEmailLoginTime()}onUpdateEmailError(e){var n;(n=this.updateEmailResolver)==null||n.reject(e.payload.message)}onUpdateEmailPrimaryOtpSuccess(){var e;(e=this.updateEmailPrimaryOtpResolver)==null||e.resolve(void 0)}onUpdateEmailPrimaryOtpError(e){var n;(n=this.updateEmailPrimaryOtpResolver)==null||n.reject(e.payload.message)}onUpdateEmailSecondaryOtpSuccess(e){var r;const{newEmail:n}=e.payload;this.setEmailLoginSuccess(n),(r=this.updateEmailSecondaryOtpResolver)==null||r.resolve({newEmail:n})}onUpdateEmailSecondaryOtpError(e){var n;(n=this.updateEmailSecondaryOtpResolver)==null||n.reject(e.payload.message)}onSyncThemeSuccess(){var e;(e=this.syncThemeResolver)==null||e.resolve(void 0)}onSyncThemeError(e){var n;(n=this.syncThemeResolver)==null||n.reject(e.payload.message)}onSyncDappDataSuccess(){var e;(e=this.syncDappDataResolver)==null||e.resolve(void 0)}onSyncDappDataError(e){var n;(n=this.syncDappDataResolver)==null||n.reject(e.payload.message)}onSmartAccountEnabledNetworksSuccess(e){var n;this.persistSmartAccountEnabledNetworks(e.payload.smartAccountEnabledNetworks),(n=this.smartAccountEnabledNetworksResolver)==null||n.resolve(e.payload)}onSmartAccountEnabledNetworksError(e){var n;this.persistSmartAccountEnabledNetworks([]),(n=this.smartAccountEnabledNetworksResolver)==null||n.reject(e.payload.message)}onPreferSmartAccountSuccess(e){var n;this.persistPreferredAccount(e.payload.type),(n=this.setPreferredAccountResolver)==null||n.resolve(void 0)}onPreferSmartAccountError(){var e;(e=this.setPreferredAccountResolver)==null||e.reject()}setNewLastEmailLoginTime(){Xt.set(oe.LAST_EMAIL_LOGIN_TIME,Date.now().toString())}setEmailLoginSuccess(e){Xt.set(oe.EMAIL,e),Xt.set(oe.EMAIL_LOGIN_USED_KEY,"true"),Xt.delete(oe.LAST_EMAIL_LOGIN_TIME)}deleteEmailLoginCache(){Xt.delete(oe.EMAIL_LOGIN_USED_KEY),Xt.delete(oe.EMAIL),Xt.delete(oe.LAST_USED_CHAIN_KEY)}setLastUsedChainId(e){Xt.set(oe.LAST_USED_CHAIN_KEY,String(e))}getLastUsedChainId(){return Number(Xt.get(oe.LAST_USED_CHAIN_KEY))}persistPreferredAccount(e){Xt.set(oe.PREFERRED_ACCOUNT_TYPE,e)}persistSmartAccountEnabledNetworks(e){Xt.set(oe.SMART_ACCOUNT_ENABLED_NETWORKS,e.join(","))}}var Ua=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Ki=class extends q{constructor(){super(),this.usubscribe=[],this.networkImages=Dt.state.networkImages,this.address=de.state.address,this.profileImage=de.state.profileImage,this.profileName=de.state.profileName,this.network=me.state.caipNetwork,this.disconnecting=!1,this.loading=!1,this.usubscribe.push(de.subscribe(e=>{e.address?(this.address=e.address,this.profileImage=e.profileImage,this.profileName=e.profileName):De.close()}),me.subscribeKey("caipNetwork",e=>{e!=null&&e.id&&(this.network=e)}))}disconnectedCallback(){this.usubscribe.forEach(e=>e())}render(){var n,r;if(!this.address)throw new Error("w3m-account-settings-view: No account provided");const e=this.networkImages[((n=this.network)==null?void 0:n.imageId)??""];return v` + + + + + + ${this.profileName?Ae.getTruncateString({string:this.profileName,charsStart:20,charsEnd:0,truncate:"end"}):Ae.getTruncateString({string:this.address,charsStart:4,charsEnd:6,truncate:"middle"})} + + + + + + + + + ${this.emailBtnTemplate()} + + + ${((r=this.network)==null?void 0:r.name)??"Unknown"} + + + ${this.togglePreferredAccountBtnTemplate()} + + Disconnect + + + + `}isAllowedNetworkSwitch(){const{requestedCaipNetworks:e}=me.state,n=e?e.length>1:!1,r=e==null?void 0:e.find(({id:i})=>{var o;return i===((o=this.network)==null?void 0:o.id)});return n||!r}onCopyAddress(){try{this.address&&(le.copyToClopboard(this.address),Fe.showSuccess("Address copied"))}catch{Fe.showError("Failed to copy")}}emailBtnTemplate(){const e=jt.getConnectedConnector(),n=Ke.getEmailConnector();if(!n||e!=="EMAIL")return null;const r=n.provider.getEmail()??"";return v` + this.onGoToUpdateEmail(r)} + > + ${r} + + `}togglePreferredAccountBtnTemplate(){const e=me.checkIfSmartAccountEnabled(),n=jt.getConnectedConnector();if(!Ke.getEmailConnector()||n!=="EMAIL"||!e)return null;const o=ct.getPreferredAccountType()===Gt.ACCOUNT_TYPES.SMART_ACCOUNT?"Switch to your EOA":"Switch to your smart account";return v` + + ${o} + + `}async changePreferredAccountType(){const e=me.checkIfSmartAccountEnabled(),r=ct.getPreferredAccountType()===Gt.ACCOUNT_TYPES.SMART_ACCOUNT||!e?Gt.ACCOUNT_TYPES.EOA:Gt.ACCOUNT_TYPES.SMART_ACCOUNT,i=Ke.getEmailConnector();i&&(this.loading=!0,await(i==null?void 0:i.provider.setPreferredAccount(r)),this.loading=!1,this.requestUpdate())}onGoToUpdateEmail(e){X.push("UpdateEmailWallet",{email:e})}onNetworks(){this.isAllowedNetworkSwitch()&&X.push("Networks")}async onDisconnect(){try{this.disconnecting=!0,await Be.disconnect(),ye.sendEvent({type:"track",event:"DISCONNECT_SUCCESS"}),De.close()}catch{ye.sendEvent({type:"track",event:"DISCONNECT_ERROR"}),Fe.showError("Failed to disconnect")}finally{this.disconnecting=!1}}};Ki.styles=IO;Ua([K()],Ki.prototype,"address",void 0);Ua([K()],Ki.prototype,"profileImage",void 0);Ua([K()],Ki.prototype,"profileName",void 0);Ua([K()],Ki.prototype,"network",void 0);Ua([K()],Ki.prototype,"disconnecting",void 0);Ua([K()],Ki.prototype,"loading",void 0);Ki=Ua([G("w3m-account-settings-view")],Ki);var WM=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Ov=class extends q{render(){const e=jt.getConnectedConnector();return v` + ${Ce.state.enableWalletFeatures&&e==="EMAIL"?this.walletFeaturesTemplate():this.defaultTemplate()} + `}walletFeaturesTemplate(){return v``}defaultTemplate(){return v``}};Ov=WM([G("w3m-account-view")],Ov);var a9=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Ag=class extends q{constructor(){super(...arguments),this.search="",this.onDebouncedSearch=le.debounce(e=>{this.search=e})}render(){const e=this.search.length>=2;return v` + + + ${this.qrButtonTemplate()} + + ${e?v``:v``} + `}onInputChange(e){this.onDebouncedSearch(e.detail)}qrButtonTemplate(){return le.isMobile()?v` + + `:null}onWalletConnectQr(){X.push("ConnectingWalletConnect")}};a9([K()],Ag.prototype,"search",void 0);Ag=a9([G("w3m-all-wallets-view")],Ag);const HM=Q` + @keyframes shake { + 0% { + transform: translateX(0); + } + 25% { + transform: translateX(3px); + } + 50% { + transform: translateX(-3px); + } + 75% { + transform: translateX(3px); + } + 100% { + transform: translateX(0); + } + } + + wui-flex:first-child:not(:only-child) { + position: relative; + } + + wui-loading-thumbnail { + position: absolute; + } + + wui-visual { + width: var(--wui-wallet-image-size-lg); + height: var(--wui-wallet-image-size-lg); + border-radius: calc(var(--wui-border-radius-5xs) * 9 - var(--wui-border-radius-xxs)); + position: relative; + overflow: hidden; + } + + wui-visual::after { + content: ''; + display: block; + width: 100%; + height: 100%; + position: absolute; + inset: 0; + border-radius: calc(var(--wui-border-radius-5xs) * 9 - var(--wui-border-radius-xxs)); + box-shadow: inset 0 0 0 1px var(--wui-gray-glass-005); + } + + wui-icon-box { + position: absolute; + right: calc(var(--wui-spacing-3xs) * -1); + bottom: calc(var(--wui-spacing-3xs) * -1); + opacity: 0; + transform: scale(0.5); + transition: + opacity var(--wui-ease-out-power-2) var(--wui-duration-lg), + transform var(--wui-ease-out-power-2) var(--wui-duration-lg); + will-change: opacity, transform; + } + + wui-text[align='center'] { + width: 100%; + padding: 0px var(--wui-spacing-l); + } + + [data-error='true'] wui-icon-box { + opacity: 1; + transform: scale(1); + } + + [data-error='true'] > wui-flex:first-child { + animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both; + } + + [data-retry='false'] wui-link { + display: none; + } + + [data-retry='true'] wui-link { + display: block; + opacity: 1; + } + + wui-link { + padding: var(--wui-spacing-4xs) var(--wui-spacing-xxs); + } +`;var Wr=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Vn=class extends q{constructor(){super(),this.unsubscribe=[],this.selectedOnRampProvider=Ze.state.selectedProvider,this.uri=Be.state.wcUri,this.ready=!1,this.showRetry=!1,this.buffering=!1,this.error=!1,this.startTime=null,this.isMobile=!1,this.onRetry=void 0,this.unsubscribe.push(Ze.subscribeKey("selectedProvider",e=>{this.selectedOnRampProvider=e})),this.watchTransactions()}disconnectedCallback(){this.intervalId&&clearInterval(this.intervalId)}render(){var r,i;let e="Continue in external window";this.error?e="Buy failed":this.selectedOnRampProvider&&(e=`Buy in ${(r=this.selectedOnRampProvider)==null?void 0:r.label}`);const n=this.error?"Buy can be declined from your side or due to and error on the provider app":"We’ll notify you once your Buy is processed";return v` + + + + + + ${this.error?null:this.loaderTemplate()} + + + + + + + ${e} + + ${n} + + + ${this.error?this.tryAgainTemplate():null} + + + + + + Copy link + + + `}watchTransactions(){if(this.selectedOnRampProvider)switch(this.selectedOnRampProvider.name){case"coinbase":this.startTime=Date.now(),this.initializeCoinbaseTransactions();break}}async initializeCoinbaseTransactions(){await this.watchCoinbaseTransactions(),this.intervalId=setInterval(()=>this.watchCoinbaseTransactions(),4e3)}async watchCoinbaseTransactions(){try{const e=de.state.address,n=Ce.state.projectId;if(!e)throw new Error("No address found");(await Xs.fetchTransactions({account:e,onramp:"coinbase",projectId:n})).data.filter(o=>new Date(o.metadata.minedAt)>new Date(this.startTime)||o.metadata.status==="ONRAMP_TRANSACTION_STATUS_IN_PROGRESS").length?(clearInterval(this.intervalId),X.replace("OnRampActivity")):this.startTime&&Date.now()-this.startTime>=18e4&&(clearInterval(this.intervalId),this.error=!0)}catch(e){Fe.showError(e)}}onTryAgain(){this.selectedOnRampProvider&&(this.error=!1,le.openHref(this.selectedOnRampProvider.url,"popupWindow","width=600,height=800,scrollbars=yes"))}tryAgainTemplate(){var e;return(e=this.selectedOnRampProvider)!=null&&e.url?v` + + Try again + `:null}loaderTemplate(){const e=kt.state.themeVariables["--w3m-border-radius-master"],n=e?parseInt(e.replace("px",""),10):4;return v``}onCopyUri(){var e;if(!((e=this.selectedOnRampProvider)!=null&&e.url)){Fe.showError("No link found"),X.goBack();return}try{le.copyToClopboard(this.selectedOnRampProvider.url),Fe.showSuccess("Link copied")}catch{Fe.showError("Failed to copy")}}};Vn.styles=HM;Wr([K()],Vn.prototype,"selectedOnRampProvider",void 0);Wr([K()],Vn.prototype,"uri",void 0);Wr([K()],Vn.prototype,"ready",void 0);Wr([K()],Vn.prototype,"showRetry",void 0);Wr([K()],Vn.prototype,"buffering",void 0);Wr([K()],Vn.prototype,"error",void 0);Wr([K()],Vn.prototype,"intervalId",void 0);Wr([K()],Vn.prototype,"startTime",void 0);Wr([T({type:Boolean})],Vn.prototype,"isMobile",void 0);Wr([T()],Vn.prototype,"onRetry",void 0);Vn=Wr([G("w3m-buy-in-progress-view")],Vn);const VM=Q` + wui-flex { + max-height: clamp(360px, 540px, 80vh); + overflow: scroll; + scrollbar-width: none; + } + + wui-flex::-webkit-scrollbar { + display: none; + } +`,Ee={WALLET_CONNECT_CONNECTOR_ID:"walletConnect",INJECTED_CONNECTOR_ID:"injected",COINBASE_CONNECTOR_ID:"coinbaseWallet",COINBASE_SDK_CONNECTOR_ID:"coinbaseWalletSDK",SAFE_CONNECTOR_ID:"safe",LEDGER_CONNECTOR_ID:"ledger",EIP6963_CONNECTOR_ID:"eip6963",EMAIL_CONNECTOR_ID:"w3mEmail",EIP155:"eip155",ADD_CHAIN_METHOD:"wallet_addEthereumChain",EIP6963_ANNOUNCE_EVENT:"eip6963:announceProvider",EIP6963_REQUEST_EVENT:"eip6963:requestProvider",CONNECTOR_RDNS_MAP:{coinbaseWallet:"com.coinbase.wallet"},VERSION:"4.1.6"},Ri={ConnectorExplorerIds:{[Ee.COINBASE_CONNECTOR_ID]:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",[Ee.SAFE_CONNECTOR_ID]:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",[Ee.LEDGER_CONNECTOR_ID]:"19177a98252e07ddfc9af2083ba8e07ef627cb6103467ffebb3f8f4205fd7927"},EIP155NetworkImageIds:{1:"692ed6ba-e569-459a-556a-776476829e00",42161:"3bff954d-5cb0-47a0-9a23-d20192e74600",43114:"30c46e53-e989-45fb-4549-be3bd4eb3b00",56:"93564157-2e8e-4ce7-81df-b264dbee9b00",250:"06b26297-fe0c-4733-5d6b-ffa5498aac00",10:"ab9c186a-c52f-464b-2906-ca59d760a400",137:"41d04d42-da3b-4453-8506-668cc0727900",100:"02b53f6a-e3d4-479e-1cb4-21178987d100",9001:"f926ff41-260d-4028-635e-91913fc28e00",324:"b310f07f-4ef7-49f3-7073-2a0a39685800",314:"5a73b3dd-af74-424e-cae0-0de859ee9400",4689:"34e68754-e536-40da-c153-6ef2e7188a00",1088:"3897a66d-40b9-4833-162f-a2c90531c900",1284:"161038da-44ae-4ec7-1208-0ea569454b00",1285:"f1d73bb6-5450-4e18-38f7-fb6484264a00",7777777:"845c60df-d429-4991-e687-91ae45791600",42220:"ab781bbc-ccc6-418d-d32d-789b15da1f00",8453:"7289c336-3981-4081-c5f4-efc26ac64a00",1313161554:"3ff73439-a619-4894-9262-4470c773a100",2020:"b8101fc0-9c19-4b6f-ec65-f6dfff106e00",2021:"b8101fc0-9c19-4b6f-ec65-f6dfff106e00","5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp":"a1b58899-f671-4276-6a5e-56ca5bd59700","4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z":"a1b58899-f671-4276-6a5e-56ca5bd59700",EtWTRABZaYq6iMfeYKouRu166VU2xqa1:"a1b58899-f671-4276-6a5e-56ca5bd59700"},ConnectorImageIds:{[Ee.COINBASE_CONNECTOR_ID]:"0c2840c3-5b04-4c44-9661-fbd4b49e1800",[Ee.COINBASE_SDK_CONNECTOR_ID]:"0c2840c3-5b04-4c44-9661-fbd4b49e1800",[Ee.SAFE_CONNECTOR_ID]:"461db637-8616-43ce-035a-d89b8a1d5800",[Ee.LEDGER_CONNECTOR_ID]:"54a1aa77-d202-4f8d-0fb2-5d2bb6db0300",[Ee.WALLET_CONNECT_CONNECTOR_ID]:"ef1a1fcf-7fe8-4d69-bd6d-fda1345b4400",[Ee.INJECTED_CONNECTOR_ID]:"07ba87ed-43aa-4adf-4540-9e6a2b9cae00"},ConnectorNamesMap:{[Ee.INJECTED_CONNECTOR_ID]:"Browser Wallet",[Ee.WALLET_CONNECT_CONNECTOR_ID]:"WalletConnect",[Ee.COINBASE_CONNECTOR_ID]:"Coinbase",[Ee.COINBASE_SDK_CONNECTOR_ID]:"Coinbase",[Ee.LEDGER_CONNECTOR_ID]:"Ledger",[Ee.SAFE_CONNECTOR_ID]:"Safe"},ConnectorTypesMap:{[Ee.INJECTED_CONNECTOR_ID]:"INJECTED",[Ee.WALLET_CONNECT_CONNECTOR_ID]:"WALLET_CONNECT",[Ee.EIP6963_CONNECTOR_ID]:"ANNOUNCED",[Ee.EMAIL_CONNECTOR_ID]:"EMAIL"},WalletConnectRpcChainIds:[1,5,11155111,10,420,42161,421613,137,80001,42220,1313161554,1313161555,56,97,43114,43113,100,8453,84531,7777777,999,324,280]},ZM={getCaipTokens(t){if(!t)return;const e={};return Object.entries(t).forEach(([n,r])=>{e[`${Ee.EIP155}:${n}`]=r}),e}};var z2=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Pd=class extends q{constructor(){super(),this.unsubscribe=[],this.connectors=Ke.state.connectors,this.count=xe.state.count,this.unsubscribe.push(Ke.subscribeKey("connectors",e=>this.connectors=e),xe.subscribeKey("count",e=>this.count=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return v` + + + + ${this.walletConnectConnectorTemplate()} ${this.recentTemplate()} + ${this.announcedTemplate()} ${this.injectedTemplate()} ${this.featuredTemplate()} + ${this.customTemplate()} ${this.recommendedTemplate()} ${this.externalTemplate()} + ${this.allWalletsTemplate()} + + + `}walletConnectConnectorTemplate(){if(le.isMobile())return null;const e=this.connectors.find(n=>n.type==="WALLET_CONNECT");return e?v` + this.onConnector(e)} + tagLabel="qr code" + tagVariant="main" + data-testid="wallet-selector-walletconnect" + > + + `:null}customTemplate(){const{customWallets:e}=Ce.state;return e!=null&&e.length?this.filterOutDuplicateWallets(e).map(r=>v` + this.onConnectWallet(r)} + data-testid=${`wallet-selector-${r.id}`} + > + + `):null}featuredTemplate(){if(!this.connectors.find(i=>i.type==="WALLET_CONNECT"))return null;const{featured:n}=xe.state;return n.length?this.filterOutDuplicateWallets(n).map(i=>v` + this.onConnectWallet(i)} + > + + `):null}recentTemplate(){return jt.getRecentWallets().map(n=>v` + this.onConnectWallet(n)} + tagLabel="recent" + tagVariant="shade" + > + + `)}announcedTemplate(){return this.connectors.map(e=>e.type!=="ANNOUNCED"?null:v` + this.onConnector(e)} + tagVariant="success" + .installed=${!0} + > + + `)}injectedTemplate(){return this.connectors.map(e=>e.type!=="INJECTED"||!Be.checkInstalled()?null:v` + this.onConnector(e)} + > + + `)}externalTemplate(){const e=Ke.getAnnouncedConnectorRdns();return this.connectors.map(n=>["WALLET_CONNECT","INJECTED","ANNOUNCED","EMAIL"].includes(n.type)||e.includes(Ee.CONNECTOR_RDNS_MAP[n.id])?null:v` + this.onConnector(n)} + > + + `)}allWalletsTemplate(){const e=this.connectors.find(a=>a.type==="WALLET_CONNECT"),{allWallets:n}=Ce.state;if(!e||n==="HIDE"||n==="ONLY_MOBILE"&&!le.isMobile())return null;const r=xe.state.featured.length,i=this.count+r,o=i<10?i:Math.floor(i/10)*10,s=o + `}recommendedTemplate(){if(!this.connectors.find(p=>p.type==="WALLET_CONNECT"))return null;const{recommended:n}=xe.state,{customWallets:r,featuredWalletIds:i}=Ce.state,{connectors:o}=Ke.state,s=jt.getRecentWallets(),l=o.filter(p=>p.type==="INJECTED").filter(p=>p.name!=="Browser Wallet");if(i||r||!n.length)return null;const c=l.length+s.length,u=Math.max(0,2-c);return this.filterOutDuplicateWallets(n).slice(0,u).map(p=>v` + this.onConnectWallet(p)} + > + + `)}onConnector(e){e.type==="WALLET_CONNECT"?le.isMobile()?X.push("AllWallets"):X.push("ConnectingWalletConnect"):X.push("ConnectingExternal",{connector:e})}filterOutDuplicateWallets(e){const n=jt.getRecentWallets(),r=this.connectors.map(a=>{var l;return(l=a.info)==null?void 0:l.rdns}).filter(Boolean),i=n.map(a=>a.rdns).filter(Boolean),o=r.concat(i);return e.filter(a=>!o.includes(String(a==null?void 0:a.rdns)))}onAllWallets(){ye.sendEvent({type:"track",event:"CLICK_ALL_WALLETS"}),X.push("AllWallets")}onConnectWallet(e){X.push("ConnectingWalletConnect",{wallet:e})}};Pd.styles=VM;z2([K()],Pd.prototype,"connectors",void 0);z2([K()],Pd.prototype,"count",void 0);Pd=z2([G("w3m-connect-view")],Pd);const GM=Q` + @keyframes shake { + 0% { + transform: translateX(0); + } + 25% { + transform: translateX(3px); + } + 50% { + transform: translateX(-3px); + } + 75% { + transform: translateX(3px); + } + 100% { + transform: translateX(0); + } + } + + wui-flex:first-child:not(:only-child) { + position: relative; + } + + wui-loading-thumbnail { + position: absolute; + } + + wui-icon-box { + position: absolute; + right: calc(var(--wui-spacing-3xs) * -1); + bottom: calc(var(--wui-spacing-3xs) * -1); + opacity: 0; + transform: scale(0.5); + transition-property: opacity, transform; + transition-duration: var(--wui-duration-lg); + transition-timing-function: var(--wui-ease-out-power-2); + will-change: opacity, transform; + } + + wui-text[align='center'] { + width: 100%; + padding: 0px var(--wui-spacing-l); + } + + [data-error='true'] wui-icon-box { + opacity: 1; + transform: scale(1); + } + + [data-error='true'] > wui-flex:first-child { + animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both; + } + + [data-retry='false'] wui-link { + display: none; + } + + [data-retry='true'] wui-link { + display: block; + opacity: 1; + } +`;var Fa=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};class Mn extends q{constructor(){var e,n,r,i;super(),this.wallet=(e=X.state.data)==null?void 0:e.wallet,this.connector=(n=X.state.data)==null?void 0:n.connector,this.timeout=void 0,this.secondaryBtnLabel="Try again",this.secondaryBtnIcon="refresh",this.secondaryLabel="Accept connection request in the wallet",this.onConnect=void 0,this.onRender=void 0,this.onAutoConnect=void 0,this.isWalletConnect=!0,this.unsubscribe=[],this.imageSrc=qe.getWalletImage(this.wallet)??qe.getConnectorImage(this.connector),this.name=((r=this.wallet)==null?void 0:r.name)??((i=this.connector)==null?void 0:i.name)??"Wallet",this.isRetrying=!1,this.uri=Be.state.wcUri,this.error=Be.state.wcError,this.ready=!1,this.showRetry=!1,this.buffering=!1,this.isMobile=!1,this.onRetry=void 0,this.unsubscribe.push(Be.subscribeKey("wcUri",o=>{var s;this.uri=o,this.isRetrying&&this.onRetry&&(this.isRetrying=!1,(s=this.onConnect)==null||s.call(this))}),Be.subscribeKey("wcError",o=>this.error=o),Be.subscribeKey("buffering",o=>this.buffering=o))}firstUpdated(){var e;(e=this.onAutoConnect)==null||e.call(this),this.showRetry=!this.onAutoConnect}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),clearTimeout(this.timeout)}render(){var r;(r=this.onRender)==null||r.call(this),this.onShowRetry();const e=this.error?"Connection can be declined if a previous request is still active":this.secondaryLabel;let n=`Continue in ${this.name}`;return this.buffering&&(n="Connecting..."),this.error&&(n="Connection declined"),v` + + + + + ${this.error?null:this.loaderTemplate()} + + + + + + + ${n} + + ${e} + + + + + ${this.secondaryBtnLabel} + + + + ${this.isWalletConnect?v` + + + + Copy link + + + `:null} + + + `}onShowRetry(){var e;if(this.error&&!this.showRetry){this.showRetry=!0;const n=(e=this.shadowRoot)==null?void 0:e.querySelector("wui-button");n==null||n.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}onTryAgain(){var e,n;this.buffering||(Be.setWcError(!1),this.onRetry?(this.isRetrying=!0,(e=this.onRetry)==null||e.call(this)):(n=this.onConnect)==null||n.call(this))}loaderTemplate(){const e=kt.state.themeVariables["--w3m-border-radius-master"],n=e?parseInt(e.replace("px",""),10):4;return v``}onCopyUri(){try{this.uri&&(le.copyToClopboard(this.uri),Fe.showSuccess("Link copied"))}catch{Fe.showError("Failed to copy")}}}Mn.styles=GM;Fa([K()],Mn.prototype,"uri",void 0);Fa([K()],Mn.prototype,"error",void 0);Fa([K()],Mn.prototype,"ready",void 0);Fa([K()],Mn.prototype,"showRetry",void 0);Fa([K()],Mn.prototype,"buffering",void 0);Fa([T({type:Boolean})],Mn.prototype,"isMobile",void 0);Fa([T()],Mn.prototype,"onRetry",void 0);var qM=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Nv=class extends Mn{constructor(){if(super(),!this.connector)throw new Error("w3m-connecting-view: No connector provided");ye.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.connector.name??"Unknown",platform:"browser"}}),this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),this.isWalletConnect=!1}async onConnectProxy(){try{this.error=!1,this.connector&&(this.connector.imageUrl&&jt.setConnectedWalletImageUrl(this.connector.imageUrl),await Be.connectExternal(this.connector),Ce.state.isSiweEnabled?X.push("ConnectingSiwe"):De.close(),ye.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"browser",name:this.connector.name||"Unknown"}}))}catch(e){ye.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(e==null?void 0:e.message)??"Unknown"}}),this.error=!0}}};Nv=qM([G("w3m-connecting-external-view")],Nv);var W2=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let vp=class extends q{constructor(){var e;super(),this.interval=void 0,this.lastRetry=Date.now(),this.wallet=(e=X.state.data)==null?void 0:e.wallet,this.platform=void 0,this.platforms=[],this.initializeConnection(),this.interval=setInterval(this.initializeConnection.bind(this),Tr.TEN_SEC_MS)}disconnectedCallback(){clearTimeout(this.interval)}render(){return this.wallet?(this.determinePlatforms(),v` + ${this.headerTemplate()} +
${this.platformTemplate()}
+ `):v``}async initializeConnection(e=!1){try{const{wcPairingExpiry:n}=Be.state;if(e||le.isPairingExpired(n)){if(Be.connectWalletConnect(),this.wallet){const r=qe.getWalletImage(this.wallet);r&&jt.setConnectedWalletImageUrl(r)}else{const i=Ke.state.connectors.find(s=>s.type==="WALLET_CONNECT"),o=qe.getConnectorImage(i);o&&jt.setConnectedWalletImageUrl(o)}await Be.state.wcPromise,this.finalizeConnection(),Ce.state.isSiweEnabled?X.push("ConnectingSiwe"):De.close()}}catch(n){ye.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(n==null?void 0:n.message)??"Unknown"}}),Be.setWcError(!0),le.isAllowedRetry(this.lastRetry)&&(Fe.showError("Declined"),this.lastRetry=Date.now(),this.initializeConnection(!0))}}finalizeConnection(){var r;const{wcLinking:e,recentWallet:n}=Be.state;e&&jt.setWalletConnectDeepLink(e),n&&jt.setWeb3ModalRecent(n),ye.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:e?"mobile":"qrcode",name:((r=this.wallet)==null?void 0:r.name)||"Unknown"}})}determinePlatforms(){if(!this.wallet)throw new Error("w3m-connecting-wc-view:determinePlatforms No wallet");if(this.platform)return;const{mobile_link:e,desktop_link:n,webapp_link:r,injected:i,rdns:o}=this.wallet,s=i==null?void 0:i.map(({injected_id:b})=>b).filter(Boolean),a=o?[o]:s??[],l=a.length,c=e,u=r,d=Be.checkInstalled(a),p=l&&d,g=n&&!le.isMobile();p&&this.platforms.push("browser"),c&&this.platforms.push(le.isMobile()?"mobile":"qrcode"),u&&this.platforms.push("web"),g&&this.platforms.push("desktop"),!p&&l&&this.platforms.push("unsupported"),this.platform=this.platforms[0]}platformTemplate(){switch(this.platform){case"browser":return v``;case"desktop":return v` + this.initializeConnection(!0)}> + + `;case"web":return v` + this.initializeConnection(!0)}> + + `;case"mobile":return v` + this.initializeConnection(!0)}> + + `;case"qrcode":return v``;default:return v``}}headerTemplate(){return this.platforms.length>1?v` + + + `:null}async onSelectPlatform(e){var r;const n=(r=this.shadowRoot)==null?void 0:r.querySelector("div");n&&(await n.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.platform=e,n.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}};W2([K()],vp.prototype,"platform",void 0);W2([K()],vp.prototype,"platforms",void 0);vp=W2([G("w3m-connecting-wc-view")],vp);var KM=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Mv=class extends q{constructor(){var e;super(...arguments),this.wallet=(e=X.state.data)==null?void 0:e.wallet}render(){if(!this.wallet)throw new Error("w3m-downloads-view");return v` + + ${this.chromeTemplate()} ${this.iosTemplate()} ${this.androidTemplate()} + ${this.homepageTemplate()} + + `}chromeTemplate(){var e;return(e=this.wallet)!=null&&e.chrome_store?v` + Chrome Extension + `:null}iosTemplate(){var e;return(e=this.wallet)!=null&&e.app_store?v` + iOS App + `:null}androidTemplate(){var e;return(e=this.wallet)!=null&&e.play_store?v` + Android App + `:null}homepageTemplate(){var e;return(e=this.wallet)!=null&&e.homepage?v` + + Website + + `:null}onChromeStore(){var e;(e=this.wallet)!=null&&e.chrome_store&&le.openHref(this.wallet.chrome_store,"_blank")}onAppStore(){var e;(e=this.wallet)!=null&&e.app_store&&le.openHref(this.wallet.app_store,"_blank")}onPlayStore(){var e;(e=this.wallet)!=null&&e.play_store&&le.openHref(this.wallet.play_store,"_blank")}onHomePage(){var e;(e=this.wallet)!=null&&e.homepage&&le.openHref(this.wallet.homepage,"_blank")}};Mv=KM([G("w3m-downloads-view")],Mv);var YM=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};const QM="https://walletconnect.com/explorer";let Lv=class extends q{render(){return v` + + ${this.recommendedWalletsTemplate()} + {le.openHref("https://walletconnect.com/explorer?type=wallet","_blank")}} + > + + `}recommendedWalletsTemplate(){const{recommended:e,featured:n}=xe.state,{customWallets:r}=Ce.state;return[...n,...r??[],...e].slice(0,4).map(o=>v` + {le.openHref(o.homepage??QM,"_blank")}} + > + `)}};Lv=YM([G("w3m-get-wallet-view")],Lv);const JM=Q` + @keyframes shake { + 0% { + transform: translateX(0); + } + 25% { + transform: translateX(3px); + } + 50% { + transform: translateX(-3px); + } + 75% { + transform: translateX(3px); + } + 100% { + transform: translateX(0); + } + } + + wui-flex:first-child:not(:only-child) { + position: relative; + } + + wui-loading-hexagon { + position: absolute; + } + + wui-icon-box { + position: absolute; + right: 4px; + bottom: 0; + opacity: 0; + transform: scale(0.5); + z-index: 1; + } + + wui-button { + display: none; + } + + [data-error='true'] wui-icon-box { + opacity: 1; + transform: scale(1); + } + + [data-error='true'] > wui-flex:first-child { + animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both; + } + + wui-button[data-retry='true'] { + display: block; + opacity: 1; + } +`;var H2=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Id=class extends q{constructor(){var e;super(),this.network=(e=X.state.data)==null?void 0:e.network,this.unsubscribe=[],this.showRetry=!1,this.error=!1}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}firstUpdated(){this.onSwitchNetwork()}render(){if(!this.network)throw new Error("w3m-network-switch-view: No network provided");this.onShowRetry();const e=this.error?"Switch declined":"Approve in wallet",n=this.error?"Switch can be declined if chain is not supported by a wallet or previous request is still active":"Accept connection request in your wallet";return v` + + + + + ${this.error?null:v``} + + + + + + ${e} + ${n} + + + + + Try again + + + `}onShowRetry(){var e;if(this.error&&!this.showRetry){this.showRetry=!0;const n=(e=this.shadowRoot)==null?void 0:e.querySelector("wui-button");n==null||n.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"})}}async onSwitchNetwork(){try{this.error=!1,this.network&&(await me.switchActiveNetwork(this.network),Ce.state.isSiweEnabled||g2.navigateAfterNetworkSwitch())}catch{this.error=!0}}};Id.styles=JM;H2([K()],Id.prototype,"showRetry",void 0);H2([K()],Id.prototype,"error",void 0);Id=H2([G("w3m-network-switch-view")],Id);const XM=Q` + :host > wui-grid { + max-height: 360px; + overflow: auto; + } + + wui-grid::-webkit-scrollbar { + display: none; + } +`;var l9=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let bp=class extends q{constructor(){super(),this.unsubscribe=[],this.caipNetwork=me.state.caipNetwork,this.unsubscribe.push(me.subscribeKey("caipNetwork",e=>this.caipNetwork=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return v` + + ${this.networksTemplate()} + + + + + + + Your connected wallet may not support some of the networks available for this dApp + + + + What is a network + + + `}onNetworkHelp(){ye.sendEvent({type:"track",event:"CLICK_NETWORK_HELP"}),X.push("WhatIsANetwork")}networksTemplate(){const{approvedCaipNetworkIds:e,requestedCaipNetworks:n,supportsAllNetworks:r}=me.state,i=le.sortRequestedNetworks(e,n);return i==null?void 0:i.map(o=>{var s;return v` + this.onSwitchNetwork(o)} + .disabled=${!r&&!(e!=null&&e.includes(o.id))} + data-testid=${`w3m-network-switch-${o.name??o.id}`} + > + `})}async onSwitchNetwork(e){const{isConnected:n}=de.state,{approvedCaipNetworkIds:r,supportsAllNetworks:i,caipNetwork:o}=me.state,{data:s}=X.state;n&&(o==null?void 0:o.id)!==e.id?r!=null&&r.includes(e.id)?(await me.switchActiveNetwork(e),g2.navigateAfterNetworkSwitch()):i&&X.push("SwitchNetwork",{...s,network:e}):n||(me.setCaipNetwork(e),X.push("Connect"))}};bp.styles=XM;l9([K()],bp.prototype,"caipNetwork",void 0);bp=l9([G("w3m-networks-view")],bp);const eL=Q` + :host > wui-flex { + height: 500px; + overflow-y: auto; + overflow-x: hidden; + scrollbar-width: none; + padding: var(--wui-spacing-m); + box-sizing: border-box; + display: flex; + align-items: center; + justify-content: flex-start; + } + + :host > wui-flex > wui-flex { + width: 100%; + } + + wui-transaction-list-item-loader { + width: 100%; + } +`;var vf=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};const tL=7;let _a=class extends q{constructor(){super(),this.unsubscribe=[],this.refetchTimeout=void 0,this.selectedOnRampProvider=Ze.state.selectedProvider,this.loading=!1,this.coinbaseTransactions=en.state.coinbaseTransactions,this.tokenImages=Dt.state.tokenImages,this.unsubscribe.push(Ze.subscribeKey("selectedProvider",e=>{this.selectedOnRampProvider=e}),Dt.subscribeKey("tokenImages",e=>this.tokenImages=e),()=>{clearTimeout(this.refetchTimeout)},en.subscribe(e=>{this.coinbaseTransactions={...e.coinbaseTransactions}})),en.clearCursor(),this.fetchTransactions()}render(){return v` + + ${this.loading?this.templateLoading():this.templateTransactionsByYear()} + + `}templateTransactions(e){return e==null?void 0:e.map(n=>{var a,l,c;const r=m2.formatDate((a=n==null?void 0:n.metadata)==null?void 0:a.minedAt),i=n.transfers[0],o=i==null?void 0:i.fungible_info;if(!o)return null;const s=((l=o==null?void 0:o.icon)==null?void 0:l.url)||((c=this.tokenImages)==null?void 0:c[o.symbol||""]);return v` + + `})}templateTransactionsByYear(){return Object.keys(this.coinbaseTransactions).sort().reverse().map(n=>{const r=parseInt(n,10);return new Array(12).fill(null).map((o,s)=>s).reverse().map(o=>{var l;const s=$o.getTransactionGroupTitle(r,o),a=(l=this.coinbaseTransactions[r])==null?void 0:l[o];return a?v` + + + ${s} + + + ${this.templateTransactions(a)} + + + `:null})})}async fetchTransactions(){await this.fetchCoinbaseTransactions()}async fetchCoinbaseTransactions(){const e=de.state.address,n=Ce.state.projectId;if(!e)throw new Error("No address found");if(!n)throw new Error("No projectId found");this.loading=!0,await en.fetchTransactions(e,"coinbase"),this.loading=!1,this.refetchLoadingTransactions()}refetchLoadingTransactions(){var i;const e=new Date;if((((i=this.coinbaseTransactions[e.getFullYear()])==null?void 0:i[e.getMonth()])||[]).filter(o=>o.metadata.status==="ONRAMP_TRANSACTION_STATUS_IN_PROGRESS").length===0){clearTimeout(this.refetchTimeout);return}this.refetchTimeout=setTimeout(async()=>{const o=de.state.address;await en.fetchTransactions(o,"coinbase"),this.refetchLoadingTransactions()},3e3)}templateLoading(){return Array(tL).fill(v` `).map(e=>e)}};_a.styles=eL;vf([K()],_a.prototype,"selectedOnRampProvider",void 0);vf([K()],_a.prototype,"loading",void 0);vf([K()],_a.prototype,"coinbaseTransactions",void 0);vf([K()],_a.prototype,"tokenImages",void 0);_a=vf([G("w3m-onramp-activity-view")],_a);const nL=Q` + :host > wui-grid { + max-height: 360px; + overflow: auto; + } + + wui-grid::-webkit-scrollbar { + display: none; + } +`;var Sh=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let vc=class extends q{constructor(){super(),this.unsubscribe=[],this.selectedCurrency=Ze.state.paymentCurrency,this.currencies=Ze.state.paymentCurrencies,this.currencyImages=Dt.state.currencyImages,this.unsubscribe.push(Ze.subscribe(e=>{this.selectedCurrency=e.paymentCurrency,this.currencies=e.paymentCurrencies}),Dt.subscribeKey("currencyImages",e=>this.currencyImages=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return v` + + ${this.currenciesTemplate()} + + + `}currenciesTemplate(){return this.currencies.map(e=>{var n;return v` + this.selectCurrency(e)} + variant="image" + > + ${e.id} + + `})}selectCurrency(e){e&&(Ze.setPaymentCurrency(e),De.close())}};vc.styles=nL;Sh([K()],vc.prototype,"selectedCurrency",void 0);Sh([K()],vc.prototype,"currencies",void 0);Sh([K()],vc.prototype,"currencyImages",void 0);vc=Sh([G("w3m-onramp-fiat-select-view")],vc);var c9=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let kg=class extends q{constructor(){super(),this.unsubscribe=[],this.providers=Ze.state.providers,this.unsubscribe.push(Ze.subscribeKey("providers",e=>{this.providers=e}))}firstUpdated(){const e=this.providers.map(async n=>n.name==="coinbase"?await this.getCoinbaseOnRampURL():Promise.resolve(n==null?void 0:n.url));Promise.all(e).then(n=>{this.providers=this.providers.map((r,i)=>({...r,url:n[i]||""}))})}render(){return v` + + ${this.onRampProvidersTemplate()} + + + `}onRampProvidersTemplate(){return this.providers.map(e=>v` + {this.onClickProvider(e)}} + ?disabled=${!e.url} + > + `)}onClickProvider(e){Ze.setSelectedProvider(e),X.push("BuyInProgress"),le.openHref(e.url,"popupWindow","width=600,height=800,scrollbars=yes")}async getCoinbaseOnRampURL(){const e=de.state.address,n=me.state.caipNetwork;if(!e)throw new Error("No address found");if(!(n!=null&&n.name))throw new Error("No network found");const r=Tr.WC_COINBASE_PAY_SDK_CHAIN_NAME_MAP[n.name]??Tr.WC_COINBASE_PAY_SDK_FALLBACK_CHAIN,i=Ze.state.purchaseCurrency,o=i?[i.symbol]:Ze.state.purchaseCurrencies.map(s=>s.symbol);return await Xs.generateOnRampURL({defaultNetwork:r,destinationWallets:[{address:e,blockchains:Tr.WC_COINBASE_PAY_SDK_CHAINS,assets:o}],partnerUserId:e,purchaseAmount:Ze.state.purchaseAmount})}};c9([K()],kg.prototype,"providers",void 0);kg=c9([G("w3m-onramp-providers-view")],kg);const rL=Q` + :host > wui-grid { + max-height: 360px; + overflow: auto; + } + + wui-grid::-webkit-scrollbar { + display: none; + } +`;var Th=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let bc=class extends q{constructor(){super(),this.unsubscribe=[],this.selectedCurrency=Ze.state.purchaseCurrencies,this.tokens=Ze.state.purchaseCurrencies,this.tokenImages=Dt.state.tokenImages,this.unsubscribe.push(Ze.subscribe(e=>{this.selectedCurrency=e.purchaseCurrencies,this.tokens=e.purchaseCurrencies}),Dt.subscribeKey("tokenImages",e=>this.tokenImages=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return v` + + ${this.currenciesTemplate()} + + + `}currenciesTemplate(){return this.tokens.map(e=>{var n;return v` + this.selectToken(e)} + variant="image" + > + + ${e.name} + ${e.symbol} + + + `})}selectToken(e){e&&(Ze.setPurchaseCurrency(e),De.close())}};bc.styles=rL;Th([K()],bc.prototype,"selectedCurrency",void 0);Th([K()],bc.prototype,"tokens",void 0);Th([K()],bc.prototype,"tokenImages",void 0);bc=Th([G("w3m-onramp-token-select-view")],bc);const iL=Q` + :host > wui-flex:first-child { + height: 500px; + overflow-y: auto; + overflow-x: hidden; + scrollbar-width: none; + padding: var(--wui-spacing-m); + } + + :host > wui-flex:first-child::-webkit-scrollbar { + display: none; + } +`;var oL=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Rg=class extends q{render(){return v` + + + + `}};Rg.styles=iL;Rg=oL([G("w3m-transactions-view")],Rg);var sL=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};const aL=[{images:["network","layers","system"],title:"The system’s nuts and bolts",text:"A network is what brings the blockchain to life, as this technical infrastructure allows apps to access the ledger and smart contract services."},{images:["noun","defiAlt","dao"],title:"Designed for different uses",text:"Each network is designed differently, and may therefore suit certain apps and experiences."}];let Dv=class extends q{render(){return v` + + + {le.openHref("https://ethereum.org/en/developers/docs/networks/","_blank")}} + > + Learn more + + + + `}};Dv=sL([G("w3m-what-is-a-network-view")],Dv);var lL=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};const cL=[{images:["login","profile","lock"],title:"One login for all of web3",text:"Log in to any app by connecting your wallet. Say goodbye to countless passwords!"},{images:["defi","nft","eth"],title:"A home for your digital assets",text:"A wallet lets you store, send and receive digital assets like cryptocurrencies and NFTs."},{images:["browser","noun","dao"],title:"Your gateway to a new web",text:"With your wallet, you can explore and interact with DeFi, NFTs, DAOs, and much more."}];let Bv=class extends q{render(){return v` + + + + + Get a wallet + + + `}onGetWallet(){ye.sendEvent({type:"track",event:"CLICK_GET_WALLET"}),X.push("GetWallet")}};Bv=lL([G("w3m-what-is-a-wallet-view")],Bv);var uL=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let jv=class extends q{render(){return v` + + + + + Quickly and easily buy digital assets! + + + Simply select your preferred onramp provider and add digital assets to your account + using your credit card or bank transfer + + + + + Buy + + + `}};jv=uL([G("w3m-what-is-a-buy-view")],jv);const dL=Q` + wui-loading-spinner { + margin: 9px auto; + } +`;var Ah=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};const fL=6;let Yi=class extends q{firstUpdated(){this.startOTPTimeout()}disconnectedCallback(){clearTimeout(this.OTPTimeout)}constructor(){var e;super(),this.loading=!1,this.timeoutTimeLeft=ct.getTimeToNextEmailLogin(),this.error="",this.otp="",this.email=(e=X.state.data)==null?void 0:e.email,this.emailConnector=Ke.getEmailConnector()}render(){if(!this.email)throw new Error("w3m-email-otp-widget: No email provided");const e=!!this.timeoutTimeLeft,n=this.getFooterLabels(e);return v` + + + Enter the code we sent to + ${this.email} + + + The code expires in 20 minutes + + ${this.loading?v``:v` + + ${this.error?v` + + ${this.error}. Try Again + + `:null} + `} + + + ${n.title} + + ${n.action} + + + + `}startOTPTimeout(){this.timeoutTimeLeft=ct.getTimeToNextEmailLogin(),this.OTPTimeout=setInterval(()=>{this.timeoutTimeLeft>0?this.timeoutTimeLeft=ct.getTimeToNextEmailLogin():clearInterval(this.OTPTimeout)},1e3)}async onOtpInputChange(e){var n;try{this.loading||(this.otp=e.detail,this.emailConnector&&this.otp.length===fL&&(this.loading=!0,await((n=this.onOtpSubmit)==null?void 0:n.call(this,this.otp))))}catch(r){this.error=le.parseError(r),this.loading=!1}}async onResendCode(){try{if(this.onOtpResend){if(!this.loading&&!this.timeoutTimeLeft){if(this.error="",this.otp="",!Ke.getEmailConnector()||!this.email)throw new Error("w3m-email-otp-widget: Unable to resend email");this.loading=!0,await this.onOtpResend(this.email),this.startOTPTimeout(),Fe.showSuccess("Code email resent")}}else this.onStartOver&&this.onStartOver()}catch(e){Fe.showError(e)}finally{this.loading=!1}}getFooterLabels(e){return this.onStartOver?{title:"Something wrong?",action:`Try again ${e?`in ${this.timeoutTimeLeft}s`:""}`}:{title:"Didn't receive it?",action:`Resend ${e?`in ${this.timeoutTimeLeft}s`:"Code"}`}}};Yi.styles=dL;Ah([K()],Yi.prototype,"loading",void 0);Ah([K()],Yi.prototype,"timeoutTimeLeft",void 0);Ah([K()],Yi.prototype,"error",void 0);Yi=Ah([G("w3m-email-otp-widget")],Yi);var u9=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let $g=class extends Yi{constructor(){super(),this.unsubscribe=[],this.smartAccountDeployed=de.state.smartAccountDeployed,this.onOtpSubmit=async e=>{try{if(this.emailConnector){const n=me.checkIfSmartAccountEnabled();await this.emailConnector.provider.connectOtp({otp:e}),ye.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_PASS"}),await Be.connectExternal(this.emailConnector),ye.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"email",name:this.emailConnector.name||"Unknown"}}),n&&!this.smartAccountDeployed?X.push("UpgradeToSmartAccount"):De.close()}}catch(n){throw ye.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_FAIL"}),n}},this.onOtpResend=async e=>{this.emailConnector&&(await this.emailConnector.provider.connectEmail({email:e}),ye.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_SENT"}))},this.unsubscribe.push(de.subscribeKey("smartAccountDeployed",e=>{this.smartAccountDeployed=e}))}};u9([K()],$g.prototype,"smartAccountDeployed",void 0);$g=u9([G("w3m-email-verify-otp-view")],$g);const pL=Q` + wui-icon-box { + height: var(--wui-icon-box-size-xl); + width: var(--wui-icon-box-size-xl); + } +`;var d9=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let xp=class extends q{constructor(){var e;super(),this.email=(e=X.state.data)==null?void 0:e.email,this.emailConnector=Ke.getEmailConnector(),this.loading=!1,this.listenForDeviceApproval()}render(){if(!this.email)throw new Error("w3m-email-verify-device-view: No email provided");if(!this.emailConnector)throw new Error("w3m-email-verify-device-view: No email connector provided");return v` + + + + + + + Approve the login link we sent to + + ${this.email} + + + + The code expires in 20 minutes + + + + + Didn't receive it? + + + Resend email + + + + + `}async listenForDeviceApproval(){if(this.emailConnector)try{await this.emailConnector.provider.connectDevice(),ye.sendEvent({type:"track",event:"DEVICE_REGISTERED_FOR_EMAIL"}),ye.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_SENT"}),X.replace("EmailVerifyOtp",{email:this.email})}catch{X.goBack()}}async onResendCode(){try{if(!this.loading){if(!this.emailConnector||!this.email)throw new Error("w3m-email-login-widget: Unable to resend email");this.loading=!0,await this.emailConnector.provider.connectEmail({email:this.email}),this.listenForDeviceApproval(),Fe.showSuccess("Code email resent")}}catch(e){Fe.showError(e)}finally{this.loading=!1}}};xp.styles=pL;d9([K()],xp.prototype,"loading",void 0);xp=d9([G("w3m-email-verify-device-view")],xp);const hL=Q` + div { + width: 100%; + height: 400px; + } + + [data-ready='false'] { + transform: scale(1.05); + } + + @media (max-width: 430px) { + [data-ready='false'] { + transform: translateY(-50px); + } + } +`;var f9=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Cp=class extends q{constructor(){super(),this.bodyObserver=void 0,this.unsubscribe=[],this.iframe=document.getElementById("w3m-iframe"),this.ready=!1,this.unsubscribe.push(De.subscribeKey("open",e=>{e||this.onHideIframe()}))}disconnectedCallback(){var e;this.unsubscribe.forEach(n=>n()),(e=this.bodyObserver)==null||e.unobserve(window.document.body)}async firstUpdated(){await this.syncTheme(),this.iframe.style.display="block";const n=this.renderRoot.querySelector("div");this.bodyObserver=new ResizeObserver(()=>{const i=(n==null?void 0:n.getBoundingClientRect())??{left:0,top:0,width:0,height:0};this.iframe.style.width="360px",this.iframe.style.height=`${i.height-10}px`,this.iframe.style.left="calc(50% - 180px)",this.iframe.style.top=`${i.top+10/2}px`,this.ready=!0}),this.bodyObserver.observe(window.document.body)}render(){return this.ready&&this.onShowIframe(),v`
`}onShowIframe(){const e=window.innerWidth<=430;this.iframe.animate([{opacity:0,transform:e?"translateY(50px)":"scale(.95)"},{opacity:1,transform:e?"translateY(0)":"scale(1)"}],{duration:200,easing:"ease",fill:"forwards"})}async onHideIframe(){await this.iframe.animate([{opacity:1},{opacity:0}],{duration:200,easing:"ease",fill:"forwards"}).finished,this.iframe.style.display="none"}async syncTheme(){const e=Ke.getEmailConnector();e&&await e.provider.syncTheme({themeVariables:kt.getSnapshot().themeVariables})}};Cp.styles=hL;f9([K()],Cp.prototype,"ready",void 0);Cp=f9([G("w3m-approve-transaction-view")],Cp);var mL=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Uv=class extends q{render(){return v` + + Follow the instructions on + + + + You will have to reconnect for security reasons + + + `}};Uv=mL([G("w3m-upgrade-wallet-view")],Uv);var V2=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let _p=class extends q{constructor(){super(...arguments),this.emailConnector=Ke.getEmailConnector(),this.loading=!1,this.setPreferSmartAccount=async()=>{if(this.emailConnector)try{this.loading=!0,await this.emailConnector.provider.setPreferredAccount(Gt.ACCOUNT_TYPES.SMART_ACCOUNT),await this.emailConnector.provider.connect({preferredAccountType:Gt.ACCOUNT_TYPES.SMART_ACCOUNT}),this.loading=!1,X.push("Account")}catch{Fe.showError("Error upgrading to smart account")}}}render(){return v` + + ${this.onboardingTemplate()} ${this.buttonsTemplate()} + + Learn more + + + + `}onboardingTemplate(){return v` + + + + + + + + Discover Smart Accounts + + + Access advanced features such as username, social login, improved security and a smoother + user experience! + + + `}buttonsTemplate(){return v` + + Do it later + + Continue + + `}redirectToAccount(){X.push("Account")}};V2([K()],_p.prototype,"emailConnector",void 0);V2([K()],_p.prototype,"loading",void 0);_p=V2([G("w3m-upgrade-to-smart-account-view")],_p);const gL=Q` + wui-email-input { + width: 100%; + } + + form { + width: 100%; + display: block; + position: relative; + } +`;var Z2=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Od=class extends q{constructor(){var e;super(...arguments),this.formRef=la(),this.initialEmail=((e=X.state.data)==null?void 0:e.email)??"",this.email="",this.loading=!1}firstUpdated(){var e;(e=this.formRef.value)==null||e.addEventListener("keydown",n=>{n.key==="Enter"&&this.onSubmitEmail(n)})}render(){const e=!this.loading&&this.email.length>3&&this.email!==this.initialEmail;return v` + +
+ + + +
+ + + + Cancel + + + + Save + + +
+ `}onEmailInputChange(e){this.email=e.detail}async onSubmitEmail(e){try{if(this.loading)return;this.loading=!0,e.preventDefault();const n=Ke.getEmailConnector();if(!n)throw new Error("w3m-update-email-wallet: Email connector not found");await n.provider.updateEmail({email:this.email}),ye.sendEvent({type:"track",event:"EMAIL_EDIT"}),X.replace("UpdateEmailPrimaryOtp",{email:this.initialEmail,newEmail:this.email})}catch(n){Fe.showError(n),this.loading=!1}}};Od.styles=gL;Z2([K()],Od.prototype,"email",void 0);Z2([K()],Od.prototype,"loading",void 0);Od=Z2([G("w3m-update-email-wallet-view")],Od);var wL=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Fv=class extends Yi{constructor(){var e;super(),this.email=(e=X.state.data)==null?void 0:e.email,this.onOtpSubmit=async n=>{try{this.emailConnector&&(await this.emailConnector.provider.updateEmailPrimaryOtp({otp:n}),ye.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_PASS"}),X.replace("UpdateEmailSecondaryOtp",X.state.data))}catch(r){throw ye.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_FAIL"}),r}},this.onStartOver=()=>{X.replace("UpdateEmailWallet",X.state.data)}}};Fv=wL([G("w3m-update-email-primary-otp-view")],Fv);var yL=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let zv=class extends Yi{constructor(){var e;super(),this.email=(e=X.state.data)==null?void 0:e.newEmail,this.onOtpSubmit=async n=>{try{this.emailConnector&&(await this.emailConnector.provider.updateEmailSecondaryOtp({otp:n}),ye.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_PASS"}),X.reset("Account"))}catch(r){throw ye.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_FAIL"}),r}},this.onStartOver=()=>{X.replace("UpdateEmailWallet",X.state.data)}}};zv=yL([G("w3m-update-email-secondary-otp-view")],zv);const vL=Q` + :host > wui-flex { + max-height: clamp(360px, 540px, 80vh); + overflow: scroll; + scrollbar-width: none; + } + + :host > wui-flex::-webkit-scrollbar { + display: none; + } +`;var p9=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Ep=class extends q{constructor(){super(...arguments),this.disconecting=!1}render(){return v` + + + + This app doesn’t support your current network. Switch to an available option following + to continue. + + + + + ${this.networksTemplate()} + + + + + + Disconnect + + + + `}networksTemplate(){const{approvedCaipNetworkIds:e,requestedCaipNetworks:n}=me.state;return le.sortRequestedNetworks(e,n).map(i=>v` + this.onSwitchNetwork(i)} + > + + `)}async onDisconnect(){try{this.disconecting=!0,await Be.disconnect(),ye.sendEvent({type:"track",event:"DISCONNECT_SUCCESS"}),De.close()}catch{ye.sendEvent({type:"track",event:"DISCONNECT_ERROR"}),Fe.showError("Failed to disconnect")}finally{this.disconecting=!1}}async onSwitchNetwork(e){const{isConnected:n}=de.state,{approvedCaipNetworkIds:r,supportsAllNetworks:i,caipNetwork:o}=me.state,{data:s}=X.state;n&&(o==null?void 0:o.id)!==e.id?r!=null&&r.includes(e.id)?(await me.switchActiveNetwork(e),g2.navigateAfterNetworkSwitch()):i&&X.push("SwitchNetwork",{...s,network:e}):n||(me.setCaipNetwork(e),X.push("Connect"))}};Ep.styles=vL;p9([K()],Ep.prototype,"disconecting",void 0);Ep=p9([G("w3m-unsupported-chain-view")],Ep);const bL=Q` + wui-compatible-network { + margin-top: var(--wui-spacing-l); + } +`;var kh=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let xc=class extends q{constructor(){super(),this.unsubscribe=[],this.address=de.state.address,this.profileName=de.state.profileName,this.network=me.state.caipNetwork,this.unsubscribe.push(de.subscribe(e=>{e.address?(this.address=e.address,this.profileName=e.profileName):Fe.showError("Account not found")}),me.subscribeKey("caipNetwork",e=>{e!=null&&e.id&&(this.network=e)}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(!this.address)throw new Error("w3m-wallet-receive-view: No account provided");const e=qe.getNetworkImage(this.network);return v` + + + + + Copy your address or scan this QR code + + + ${this.networkTemplate()} + `}networkTemplate(){var a;const e=me.getRequestedCaipNetworks(),n=me.checkIfSmartAccountEnabled(),r=me.state.caipNetwork;if(ct.getPreferredAccountType()===Gt.ACCOUNT_TYPES.SMART_ACCOUNT&&n)return r?v``:null;const s=((a=e==null?void 0:e.filter(l=>l==null?void 0:l.imageId))==null?void 0:a.slice(0,5)).map(qe.getNetworkImage).filter(Boolean);return v``}onReceiveClick(){X.push("WalletCompatibleNetworks")}onCopyClick(){try{this.address&&(le.copyToClopboard(this.address),Fe.showSuccess("Address copied"))}catch{Fe.showError("Failed to copy")}}};xc.styles=bL;kh([K()],xc.prototype,"address",void 0);kh([K()],xc.prototype,"profileName",void 0);kh([K()],xc.prototype,"network",void 0);xc=kh([G("w3m-wallet-receive-view")],xc);const xL=Q` + :host > wui-flex { + max-height: clamp(360px, 540px, 80vh); + overflow: scroll; + scrollbar-width: none; + } + + :host > wui-flex::-webkit-scrollbar { + display: none; + } +`;var CL=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Pg=class extends q{render(){return v` + + ${this.networkTemplate()} + `}networkTemplate(){const{approvedCaipNetworkIds:e,requestedCaipNetworks:n,caipNetwork:r}=me.state,i=me.checkIfSmartAccountEnabled(),o=ct.getPreferredAccountType();let s=le.sortRequestedNetworks(e,n);if(i&&o===Gt.ACCOUNT_TYPES.SMART_ACCOUNT){if(!r)return null;s=[r]}return s.map(a=>v` + + + `)}};Pg.styles=xL;Pg=CL([G("w3m-wallet-compatible-networks-view")],Pg);const _L=Q` + :host { + display: block; + } + + wui-flex { + position: relative; + } + + wui-icon-box { + width: 40px; + height: 40px; + border-radius: var(--wui-border-radius-xs) !important; + border: 5px solid var(--wui-color-bg-125); + background: var(--wui-color-bg-175); + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + z-index: 1; + } + + wui-button { + --local-border-radius: var(--wui-border-radius-xs) !important; + } + + .inputContainer { + height: fit-content; + } +`;var bf=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Ea=class extends q{constructor(){super(),this.unsubscribe=[],this.token=hn.state.token,this.sendTokenAmount=hn.state.sendTokenAmount,this.receiverAddress=hn.state.receiverAddress,this.message="Preview Send",this.unsubscribe.push(hn.subscribe(e=>{this.token=e.token,this.sendTokenAmount=e.sendTokenAmount,this.receiverAddress=e.receiverAddress}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return this.getMessage(),v` + + + + + + + + ${this.message} + + + `}onButtonClick(){X.push("WalletSendPreview")}getMessage(){this.message="Preview Send",this.receiverAddress&&!le.isAddress(this.receiverAddress)&&(this.message="Invalid Address"),this.receiverAddress||(this.message="Add Address"),this.sendTokenAmount&&this.token&&this.sendTokenAmount>Number(this.token.quantity.numeric)&&(this.message="Insufficient Funds"),this.sendTokenAmount||(this.message="Add Amount"),this.token||(this.message="Select Token")}};Ea.styles=_L;bf([K()],Ea.prototype,"token",void 0);bf([K()],Ea.prototype,"sendTokenAmount",void 0);bf([K()],Ea.prototype,"receiverAddress",void 0);bf([K()],Ea.prototype,"message",void 0);Ea=bf([G("w3m-wallet-send-view")],Ea);const EL=Q` + .contentContainer { + height: 440px; + overflow: scroll; + scrollbar-width: none; + } + + wui-icon-box { + width: 40px; + height: 40px; + border-radius: var(--wui-border-radius-xxs); + } +`;var Rh=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Cc=class extends q{constructor(){super(),this.unsubscribe=[],this.tokenBalance=de.state.tokenBalance,this.search="",this.onDebouncedSearch=le.debounce(e=>{this.search=e}),this.unsubscribe.push(de.subscribe(e=>{this.tokenBalance=e.tokenBalance}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return v` + + ${this.templateSearchInput()} ${this.templateTokens()} + + `}templateSearchInput(){return v` + + + + `}templateTokens(){var e;return this.search?this.tokens=(e=this.tokenBalance)==null?void 0:e.filter(n=>n.name.toLowerCase().includes(this.search.toLowerCase())):this.tokens=this.tokenBalance,v` + + + Your tokens + + + ${this.tokens&&this.tokens.length>0?this.tokens.map(n=>v``):v` + + + No tokens found + Your tokens will appear here + + Buy + `} + + + `}onBuyClick(){X.push("OnRampProviders")}onInputChange(e){this.onDebouncedSearch(e.detail)}handleTokenClick(e){hn.setToken(e),hn.setTokenAmount(void 0),X.goBack()}};Cc.styles=EL;Rh([K()],Cc.prototype,"tokenBalance",void 0);Rh([K()],Cc.prototype,"tokens",void 0);Rh([K()],Cc.prototype,"search",void 0);Cc=Rh([G("w3m-wallet-send-select-token-view")],Cc);const SL=Q` + wui-avatar, + wui-image { + display: ruby; + width: 32px; + height: 32px; + border-radius: var(--wui-border-radius-3xl); + } + + .sendButton { + width: 70%; + --local-width: 100% !important; + --local-border-radius: var(--wui-border-radius-xs) !important; + } + + .cancelButton { + width: 30%; + --local-width: 100% !important; + --local-border-radius: var(--wui-border-radius-xs) !important; + } +`;var xf=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Sa=class extends q{constructor(){super(),this.unsubscribe=[],this.token=hn.state.token,this.sendTokenAmount=hn.state.sendTokenAmount,this.receiverAddress=hn.state.receiverAddress,this.caipNetwork=me.state.caipNetwork,this.unsubscribe.push(hn.subscribe(e=>{this.token=e.token,this.sendTokenAmount=e.sendTokenAmount,this.receiverAddress=e.receiverAddress}),me.subscribeKey("caipNetwork",e=>this.caipNetwork=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var e,n,r;return v` + + + + Send + ${this.sendValueTemplate()} + + + + + + + + To + + + + + + + + Review transaction carefully + + + + Cancel + + + Send + + + `}sendValueTemplate(){if(this.token&&this.sendTokenAmount){const n=this.token.price*this.sendTokenAmount;return v`$${n.toFixed(2)}`}return null}onSendClick(){X.reset("Account"),setTimeout(()=>{hn.resetSend()},200)}onCancelClick(){X.goBack()}};Sa.styles=SL;xf([K()],Sa.prototype,"token",void 0);xf([K()],Sa.prototype,"sendTokenAmount",void 0);xf([K()],Sa.prototype,"receiverAddress",void 0);xf([K()],Sa.prototype,"caipNetwork",void 0);Sa=xf([G("w3m-wallet-send-preview-view")],Sa);const TL=Q` + wui-grid { + max-height: clamp(360px, 400px, 80vh); + overflow: scroll; + scrollbar-width: none; + grid-auto-rows: min-content; + grid-template-columns: repeat(auto-fill, 76px); + } + + @media (max-width: 435px) { + wui-grid { + grid-template-columns: repeat(auto-fill, 77px); + } + } + + wui-grid[data-scroll='false'] { + overflow: hidden; + } + + wui-grid::-webkit-scrollbar { + display: none; + } + + wui-loading-spinner { + padding-top: var(--wui-spacing-l); + padding-bottom: var(--wui-spacing-l); + justify-content: center; + grid-column: 1 / span 4; + } +`;function h9(t){const{connectors:e}=Ke.state,n=e.filter(o=>o.type==="ANNOUNCED").reduce((o,s)=>{var a;return(a=s.info)!=null&&a.rdns&&(o[s.info.rdns]=!0),o},{});return t.map(o=>({...o,installed:!!o.rdns&&!!n[o.rdns??""]})).sort((o,s)=>Number(s.installed)-Number(o.installed))}var Cf=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};const Wv="local-paginator";let Ta=class extends q{constructor(){super(),this.unsubscribe=[],this.paginationObserver=void 0,this.initial=!xe.state.wallets.length,this.wallets=xe.state.wallets,this.recommended=xe.state.recommended,this.featured=xe.state.featured,this.unsubscribe.push(xe.subscribeKey("wallets",e=>this.wallets=e),xe.subscribeKey("recommended",e=>this.recommended=e),xe.subscribeKey("featured",e=>this.featured=e))}firstUpdated(){this.initialFetch(),this.createPaginationObserver()}disconnectedCallback(){var e;this.unsubscribe.forEach(n=>n()),(e=this.paginationObserver)==null||e.disconnect()}render(){return v` + + ${this.initial?this.shimmerTemplate(16):this.walletsTemplate()} + ${this.paginationLoaderTemplate()} + + `}async initialFetch(){var n;const e=(n=this.shadowRoot)==null?void 0:n.querySelector("wui-grid");this.initial&&e&&(await xe.fetchWallets({page:1}),await e.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.initial=!1,e.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}shimmerTemplate(e,n){return[...Array(e)].map(()=>v` + + `)}walletsTemplate(){const e=[...this.featured,...this.recommended,...this.wallets];return h9(e).map(r=>v` + this.onConnectWallet(r)} + .installed=${r.installed} + > + `)}paginationLoaderTemplate(){const{wallets:e,recommended:n,featured:r,count:i}=xe.state,o=window.innerWidth<352?3:4,s=e.length+n.length;let l=Math.ceil(s/o)*o-s+o;return l-=e.length?r.length%o:0,i===0&&r.length>0?null:i===0||[...r,...e,...n].length{if(r!=null&&r.isIntersecting&&!this.initial){const{page:i,count:o,wallets:s}=xe.state;s.length=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Nd=class extends q{constructor(){super(...arguments),this.prevQuery="",this.loading=!0,this.query=""}render(){return this.onSearch(),this.loading?v``:this.walletsTemplate()}async onSearch(){this.query!==this.prevQuery&&(this.prevQuery=this.query,this.loading=!0,await xe.searchWallet({search:this.query}),this.loading=!1)}walletsTemplate(){const{search:e}=xe.state,n=h9(e);return e.length?v` + + ${n.map(r=>v` + this.onConnectWallet(r)} + .installed=${r.installed} + > + `)} + + `:v` + + + No Wallet found + + `}onConnectWallet(e){const n=Ke.getConnector(e.id,e.rdns);n?X.push("ConnectingExternal",{connector:n}):X.push("ConnectingWalletConnect",{wallet:e})}};Nd.styles=AL;G2([K()],Nd.prototype,"loading",void 0);G2([T()],Nd.prototype,"query",void 0);Nd=G2([G("w3m-all-wallets-search")],Nd);var $h=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Md=class extends q{constructor(){super(),this.platformTabs=[],this.unsubscribe=[],this.platforms=[],this.onSelectPlatfrom=void 0,this.buffering=!1,this.unsubscribe.push(Be.subscribeKey("buffering",e=>this.buffering=e))}disconnectCallback(){this.unsubscribe.forEach(e=>e())}render(){const e=this.generateTabs();return v` + + + + `}generateTabs(){const e=this.platforms.map(n=>n==="browser"?{label:"Browser",icon:"extension",platform:"browser"}:n==="mobile"?{label:"Mobile",icon:"mobile",platform:"mobile"}:n==="qrcode"?{label:"Mobile",icon:"mobile",platform:"qrcode"}:n==="web"?{label:"Webapp",icon:"browser",platform:"web"}:n==="desktop"?{label:"Desktop",icon:"desktop",platform:"desktop"}:{label:"Browser",icon:"extension",platform:"unsupported"});return this.platformTabs=e.map(({platform:n})=>n),e}onTabChange(e){var r;const n=this.platformTabs[e];n&&((r=this.onSelectPlatfrom)==null||r.call(this,n))}};$h([T({type:Array})],Md.prototype,"platforms",void 0);$h([T()],Md.prototype,"onSelectPlatfrom",void 0);$h([K()],Md.prototype,"buffering",void 0);Md=$h([G("w3m-connecting-header")],Md);var kL=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Hv=class extends Mn{constructor(){if(super(),!this.wallet)throw new Error("w3m-connecting-wc-browser: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),ye.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser"}})}async onConnectProxy(){var e;try{this.error=!1;const{connectors:n}=Ke.state,r=n.find(o=>{var s,a;return o.type==="ANNOUNCED"&&((s=o.info)==null?void 0:s.rdns)===((a=this.wallet)==null?void 0:a.rdns)}),i=n.find(o=>o.type==="INJECTED");r?await Be.connectExternal(r):i&&await Be.connectExternal(i),De.close(),ye.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:"browser",name:((e=this.wallet)==null?void 0:e.name)||"Unknown"}})}catch(n){ye.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:(n==null?void 0:n.message)??"Unknown"}}),this.error=!0}}};Hv=kL([G("w3m-connecting-wc-browser")],Hv);var RL=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Vv=class extends Mn{constructor(){if(super(),!this.wallet)throw new Error("w3m-connecting-wc-desktop: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onRender=this.onRenderProxy.bind(this),ye.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"desktop"}})}onRenderProxy(){!this.ready&&this.uri&&(this.ready=!0,this.timeout=setTimeout(()=>{var e;(e=this.onConnect)==null||e.call(this)},200))}onConnectProxy(){var e;if((e=this.wallet)!=null&&e.desktop_link&&this.uri)try{this.error=!1;const{desktop_link:n,name:r}=this.wallet,{redirect:i,href:o}=le.formatNativeUrl(n,this.uri);Be.setWcLinking({name:r,href:o}),Be.setRecentWallet(this.wallet),le.openHref(i,"_blank")}catch{this.error=!0}}};Vv=RL([G("w3m-connecting-wc-desktop")],Vv);var $L=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Zv=class extends Mn{constructor(){if(super(),!this.wallet)throw new Error("w3m-connecting-wc-mobile: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onRender=this.onRenderProxy.bind(this),document.addEventListener("visibilitychange",this.onBuffering.bind(this)),ye.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"mobile"}})}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("visibilitychange",this.onBuffering.bind(this))}onRenderProxy(){var e;!this.ready&&this.uri&&(this.ready=!0,(e=this.onConnect)==null||e.call(this))}onConnectProxy(){var e;if((e=this.wallet)!=null&&e.mobile_link&&this.uri)try{this.error=!1;const{mobile_link:n,name:r}=this.wallet,{redirect:i,href:o}=le.formatNativeUrl(n,this.uri);Be.setWcLinking({name:r,href:o}),Be.setRecentWallet(this.wallet),le.openHref(i,"_self")}catch{this.error=!0}}onBuffering(){const e=le.isIos();(document==null?void 0:document.visibilityState)==="visible"&&!this.error&&e&&(Be.setBuffering(!0),setTimeout(()=>{Be.setBuffering(!1)},5e3))}};Zv=$L([G("w3m-connecting-wc-mobile")],Zv);const PL=Q` + @keyframes fadein { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + + wui-shimmer { + width: 100%; + aspect-ratio: 1 / 1; + border-radius: clamp(0px, var(--wui-border-radius-l), 40px) !important; + } + + wui-qr-code { + opacity: 0; + animation-duration: 200ms; + animation-timing-function: ease; + animation-name: fadein; + animation-fill-mode: forwards; + } +`;var IL=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Ig=class extends Mn{constructor(){var e;super(),this.forceUpdate=()=>{this.requestUpdate()},window.addEventListener("resize",this.forceUpdate),ye.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:((e=this.wallet)==null?void 0:e.name)??"WalletConnect",platform:"qrcode"}})}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("resize",this.forceUpdate)}render(){return this.onRenderProxy(),v` + + ${this.qrCodeTemplate()} + + + Scan this QR Code with your phone + + ${this.copyTemplate()} + + + + `}onRenderProxy(){!this.ready&&this.uri&&(this.timeout=setTimeout(()=>{this.ready=!0},200))}qrCodeTemplate(){if(!this.uri||!this.ready)return null;const e=this.getBoundingClientRect().width-40,n=this.wallet?this.wallet.name:void 0;return Be.setWcLinking(void 0),Be.setRecentWallet(this.wallet),v` `}copyTemplate(){const e=!this.uri||!this.ready;return v` + + Copy link + `}};Ig.styles=PL;Ig=IL([G("w3m-connecting-wc-qrcode")],Ig);var OL=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Gv=class extends q{constructor(){var e;if(super(),this.wallet=(e=X.state.data)==null?void 0:e.wallet,!this.wallet)throw new Error("w3m-connecting-wc-unsupported: No wallet provided");ye.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser"}})}render(){return v` + + + + Not Detected + + + + `}};Gv=OL([G("w3m-connecting-wc-unsupported")],Gv);var NL=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let qv=class extends Mn{constructor(){if(super(),!this.wallet)throw new Error("w3m-connecting-wc-web: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.secondaryBtnLabel="Open",this.secondaryLabel="Open and continue in a new browser tab",this.secondaryBtnIcon="externalLink",ye.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"web"}})}onConnectProxy(){var e;if((e=this.wallet)!=null&&e.webapp_link&&this.uri)try{this.error=!1;const{webapp_link:n,name:r}=this.wallet,{redirect:i,href:o}=le.formatUniversalUrl(n,this.uri);Be.setWcLinking({name:r,href:o}),Be.setRecentWallet(this.wallet),le.openHref(i,"_blank")}catch{this.error=!0}}};qv=NL([G("w3m-connecting-wc-web")],qv);const ML=Q` + :host { + width: 100%; + } + + .details-container > wui-flex { + background: var(--wui-gray-glass-002); + border-radius: var(--wui-border-radius-xxs); + width: 100%; + } + + .details-container > wui-flex > button { + border: none; + background: none; + padding: var(--wui-spacing-s); + border-radius: var(--wui-border-radius-xxs); + cursor: pointer; + } + + .details-content-container { + padding: var(--wui-spacing-1xs); + padding-top: 0px; + display: flex; + align-items: center; + justify-content: center; + } + + .details-content-container > wui-flex { + width: 100%; + } + + .details-row { + width: 100%; + padding: var(--wui-spacing-s); + padding-left: var(--wui-spacing-s); + padding-right: var(--wui-spacing-1xs); + border-radius: calc(var(--wui-border-radius-5xs) + var(--wui-border-radius-4xs)); + background: var(--wui-gray-glass-002); + } + + .details-row.provider-free-row { + padding-right: var(--wui-spacing-xs); + } + + .free-badge { + background: rgba(38, 217, 98, 0.15); + border-radius: var(--wui-border-radius-4xs); + padding: 4.5px 6px; + } +`;var xi=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let mr=class extends q{constructor(){super(...arguments),this.detailsOpen=!1,this.slippageRate=.5}render(){return v` + + + + ${this.detailsOpen?v` + + + + Network cost + + $${Ae.formatNumberToLocalString(this.gasPriceInUSD,3)} + + + + ${this.priceImpact?v` + + Price impact + + + ${Ae.formatNumberToLocalString(this.priceImpact,3)}% + + + + `:null} + ${this.maxSlippage&&this.sourceTokenSymbol?v` + + Max. slippage + + + ${Ae.formatNumberToLocalString(this.maxSlippage,6)} + ${this.sourceTokenSymbol} ${this.slippageRate}% + + + + `:null} + + + Provider fee + + Free + + + + + `:null} + + + `}toggleDetails(){this.detailsOpen=!this.detailsOpen}};mr.styles=[ML];xi([T()],mr.prototype,"detailsOpen",void 0);xi([T()],mr.prototype,"sourceTokenSymbol",void 0);xi([T()],mr.prototype,"sourceTokenPrice",void 0);xi([T()],mr.prototype,"toTokenSymbol",void 0);xi([T()],mr.prototype,"toTokenConvertedAmount",void 0);xi([T()],mr.prototype,"gasPriceInUSD",void 0);xi([T()],mr.prototype,"priceImpact",void 0);xi([T()],mr.prototype,"slippageRate",void 0);xi([T()],mr.prototype,"maxSlippage",void 0);mr=xi([G("w3m-convert-details")],mr);const LL=Q` + :host > wui-flex { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; + border-radius: var(--wui-border-radius-s); + padding: var(--wui-spacing-xl); + padding-right: var(--wui-spacing-s); + width: 100%; + height: 100px; + box-sizing: border-box; + position: relative; + } + + :host > wui-flex > svg.input_mask { + position: absolute; + inset: 0; + z-index: 5; + } + + :host wui-flex .input_mask__border, + :host wui-flex .input_mask__background { + transition: fill var(--wui-duration-md) var(--wui-ease-out-power-1); + will-change: fill; + } + + :host wui-flex .input_mask__border { + fill: var(--wui-gray-glass-005); + } + + :host wui-flex .input_mask__background { + fill: var(--wui-gray-glass-002); + } + + :host wui-flex.focus .input_mask__border { + fill: var(--wui-gray-glass-020); + } + + :host > wui-flex .swap-input, + :host > wui-flex .swap-token-button { + z-index: 10; + } + + :host > wui-flex .swap-input { + -webkit-mask-image: linear-gradient( + 270deg, + transparent 0px, + transparent 8px, + black 24px, + black 25px, + black 32px, + black 100% + ); + mask-image: linear-gradient( + 270deg, + transparent 0px, + transparent 8px, + black 24px, + black 25px, + black 32px, + black 100% + ); + } + + :host > wui-flex .swap-input input { + background: none; + border: none; + height: 42px; + width: 100%; + font-size: 32px; + font-style: normal; + font-weight: 400; + line-height: 130%; + letter-spacing: -1.28px; + outline: none; + caret-color: var(--wui-color-accent-100); + color: var(--wui-color-fg-200); + } + + :host > wui-flex .swap-input input:focus-visible { + outline: none; + } + + :host > wui-flex .swap-input input::-webkit-outer-spin-button, + :host > wui-flex .swap-input input::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; + } + + .token-select-button { + display: flex; + align-items: center; + justify-content: center; + gap: var(--wui-spacing-xxs); + padding: var(--wui-spacing-xs); + padding-right: var(--wui-spacing-1xs); + height: 40px; + border: none; + border-radius: 80px; + background: var(--wui-gray-glass-002); + box-shadow: inset 0 0 0 1px var(--wui-gray-glass-002); + cursor: pointer; + transition: background 0.2s linear; + } + + .token-select-button:hover { + background: var(--wui-gray-glass-005); + } + + .token-select-button wui-image { + width: 24px; + height: 24px; + border-radius: var(--wui-border-radius-s); + box-shadow: inset 0 0 0 1px var(--wui-gray-glass-010); + } + + .max-value-button { + background-color: transparent; + border: none; + cursor: pointer; + color: var(--wui-gray-glass-020); + } + + .market-value { + min-height: 18px; + } +`;var Hr=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};const DL=5e-5;let Zn=class extends q{constructor(){super(...arguments),this.focused=!1,this.price=0,this.marketValue="$1.0345,00",this.target="sourceToken",this.onSetAmount=null,this.onSetMaxValue=null}render(){const e=this.marketValue||"0",n=hg.bigNumber(e).isGreaterThan(0);return v` + + ${this.target==="sourceToken"?y8:w8} + + this.onFocusChange(!0)} + @focusout=${()=>this.onFocusChange(!1)} + ?disabled=${this.disabled} + .value=${this.value} + @input=${this.dispatchInputChangeEvent} + @keydown=${this.handleKeydown} + placeholder="0" + /> + + ${n?`$${this.marketValue}`:null} + + + ${this.templateTokenSelectButton()} + + `}handleKeydown(e){const n=["Backspace","Meta","Ctrl","a","c","v","ArrowLeft","ArrowRight","Tab"],r=e.key===",",i=e.key===".",o=e.key>="0"&&e.key<="9",s=this.value;!o&&!n.includes(e.key)&&!i&&!r&&e.preventDefault(),(r||i)&&(s!=null&&s.includes(".")||s!=null&&s.includes(","))&&e.preventDefault()}dispatchInputChangeEvent(e){if(!this.onSetAmount)return;const n=e.target.value;n===","||n==="."?this.onSetAmount(this.target,"0."):n.endsWith(",")?this.onSetAmount(this.target,n.replace(",",".")):this.onSetAmount(this.target,n)}setMaxValueToInput(){var e;(e=this.onSetMaxValue)==null||e.call(this,this.target,this.balance)}templateTokenSelectButton(){if(!this.token)return v` + Select token + `;const e=this.token.logoURI?v``:v` + + `;return v` + + + ${this.tokenBalanceTemplate()} + + `}tokenBalanceTemplate(){const e=hg.multiply(this.balance,this.price),n=e?e==null?void 0:e.isGreaterThan(DL):!1;return v` + ${n?v` + ${Ae.formatNumberToLocalString(this.balance,3)} + `:null} + ${this.target==="sourceToken"?this.tokenActionButtonTemplate(n):null} + `}tokenActionButtonTemplate(e){return e?v` `:v` `}onFocusChange(e){this.focused=e}onSelectToken(){ye.sendEvent({type:"track",event:"CLICK_SELECT_TOKEN_TO_SWAP"})}onBuyToken(){X.push("OnRampProviders")}};Zn.styles=[LL];Hr([T()],Zn.prototype,"focused",void 0);Hr([T()],Zn.prototype,"balance",void 0);Hr([T()],Zn.prototype,"value",void 0);Hr([T()],Zn.prototype,"price",void 0);Hr([T()],Zn.prototype,"marketValue",void 0);Hr([T()],Zn.prototype,"disabled",void 0);Hr([T()],Zn.prototype,"target",void 0);Hr([T()],Zn.prototype,"token",void 0);Hr([T()],Zn.prototype,"onSetAmount",void 0);Hr([T()],Zn.prototype,"onSetMaxValue",void 0);Zn=Hr([G("w3m-convert-input")],Zn);const BL=Q` + wui-icon-link[data-hidden='true'] { + opacity: 0 !important; + pointer-events: none; + } +`;var Ph=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};function Kv(){var s,a,l,c,u,d,p;const t=(a=(s=X.state.data)==null?void 0:s.connector)==null?void 0:a.name,e=(c=(l=X.state.data)==null?void 0:l.wallet)==null?void 0:c.name,n=(d=(u=X.state.data)==null?void 0:u.network)==null?void 0:d.name,r=e??t,i=Ke.getConnectors();return{Connect:`Connect ${i.length===1&&((p=i[0])==null?void 0:p.id)==="w3m-email"?"Email":""} Wallet`,Account:void 0,AccountSettings:void 0,ConnectingExternal:r??"Connect Wallet",ConnectingWalletConnect:r??"WalletConnect",ConnectingSiwe:"Sign In",Networks:"Choose Network",SwitchNetwork:n??"Switch Network",AllWallets:"All Wallets",WhatIsANetwork:"What is a network?",WhatIsAWallet:"What is a wallet?",GetWallet:"Get a wallet",Downloads:r?`Get ${r}`:"Downloads",EmailVerifyOtp:"Confirm Email",EmailVerifyDevice:"Register Device",ApproveTransaction:"Approve Transaction",Transactions:"Activity",UpgradeEmailWallet:"Upgrade your Wallet",UpgradeToSmartAccount:void 0,UpdateEmailWallet:"Edit Email",UpdateEmailPrimaryOtp:"Confirm Current Email",UpdateEmailSecondaryOtp:"Confirm New Email",UnsupportedChain:"Switch Network",OnRampProviders:"Choose Provider",OnRampActivity:"Activity",WhatIsABuy:"What is Buy?",BuyInProgress:"Buy",OnRampTokenSelect:"Select Token",OnRampFiatSelect:"Select Currency",WalletReceive:"Receive",WalletCompatibleNetworks:"Compatible Networks",WalletSend:"Send",WalletSendPreview:"Review send",WalletSendSelectToken:"Select Token"}}let _c=class extends q{constructor(){super(),this.unsubscribe=[],this.heading=Kv()[X.state.view],this.buffering=!1,this.showBack=!1,this.unsubscribe.push(X.subscribeKey("view",e=>{this.onViewChange(e),this.onHistoryChange()}),Be.subscribeKey("buffering",e=>this.buffering=e))}disconnectCallback(){this.unsubscribe.forEach(e=>e())}render(){return v` + + ${this.dynamicButtonTemplate()} ${this.titleTemplate()} + + + ${this.separatorTemplate()} + `}onWalletHelp(){ye.sendEvent({type:"track",event:"CLICK_WALLET_HELP"}),X.push("WhatIsAWallet")}async onClose(){if(Ce.state.isSiweEnabled){const{SIWEController:e}=await Mi(()=>import("./index-hW2M65xa.js"),[]);e.state.status!=="success"&&await Be.disconnect()}De.close()}titleTemplate(){return v`${this.heading}`}dynamicButtonTemplate(){const{view:e}=X.state,n=e==="Connect",o=e==="ApproveTransaction"||e==="UpgradeToSmartAccount";return this.showBack&&!o?v``:v``}separatorTemplate(){return this.heading?v``:null}getPadding(){return this.heading?["l","2l","l","2l"]:["l","2l","0","2l"]}async onViewChange(e){var r;const n=(r=this.shadowRoot)==null?void 0:r.querySelector("wui-text");if(n){const i=Kv()[e];await n.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.heading=i,n.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"})}}async onHistoryChange(){var r;const{history:e}=X.state,n=(r=this.shadowRoot)==null?void 0:r.querySelector("#dynamic");e.length>1&&!this.showBack&&n?(await n.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.showBack=!0,n.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"})):e.length<=1&&this.showBack&&n&&(await n.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.showBack=!1,n.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}onGoBack(){X.state.view==="ConnectingSiwe"?X.push("Connect"):X.goBack()}};_c.styles=[BL];Ph([K()],_c.prototype,"heading",void 0);Ph([K()],_c.prototype,"buffering",void 0);Ph([K()],_c.prototype,"showBack",void 0);_c=Ph([G("w3m-header")],_c);var m9=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Og=class extends q{constructor(){super(...arguments),this.data=[]}render(){return v` + + ${this.data.map(e=>v` + + + ${e.images.map(n=>v``)} + + + + + ${e.title} + + ${e.text} + + `)} + + `}};m9([T({type:Array})],Og.prototype,"data",void 0);Og=m9([G("w3m-help-widget")],Og);const jL=Q` + :host { + width: 100%; + } + + wui-loading-spinner { + position: absolute; + top: 50%; + right: 20px; + transform: translateY(-50%); + } + + .currency-container { + position: absolute; + top: 50%; + transform: translateY(-50%); + right: var(--wui-spacing-1xs); + height: 40px; + padding: var(--wui-spacing-xs) var(--wui-spacing-1xs) var(--wui-spacing-xs) + var(--wui-spacing-xs); + min-width: 95px; + border-radius: var(--FULL, 1000px); + border: 1px solid var(--wui-gray-glass-002); + background: var(--wui-gray-glass-002); + cursor: pointer; + } + + .currency-container > wui-image { + height: 24px; + width: 24px; + border-radius: 50%; + } +`;var za=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Qi=class extends q{constructor(){var e;super(),this.unsubscribe=[],this.type="Token",this.value=0,this.currencies=[],this.selectedCurrency=(e=this.currencies)==null?void 0:e[0],this.currencyImages=Dt.state.currencyImages,this.tokenImages=Dt.state.tokenImages,this.unsubscribe.push(Ze.subscribeKey("purchaseCurrency",n=>{!n||this.type==="Fiat"||(this.selectedCurrency=this.formatPurchaseCurrency(n))}),Ze.subscribeKey("paymentCurrency",n=>{!n||this.type==="Token"||(this.selectedCurrency=this.formatPaymentCurrency(n))}),Ze.subscribe(n=>{this.type==="Fiat"?this.currencies=n.purchaseCurrencies.map(this.formatPurchaseCurrency):this.currencies=n.paymentCurrencies.map(this.formatPaymentCurrency)}),Dt.subscribe(n=>{this.currencyImages={...n.currencyImages},this.tokenImages={...n.tokenImages}}))}firstUpdated(){Ze.getAvailableCurrencies()}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var r;const e=((r=this.selectedCurrency)==null?void 0:r.symbol)||"",n=this.currencyImages[e]||this.tokenImages[e];return v` + ${this.selectedCurrency?v` De.open({view:`OnRamp${this.type}Select`})} + > + + ${this.selectedCurrency.symbol} + `:v``} + `}formatPaymentCurrency(e){return{name:e.id,symbol:e.id}}formatPurchaseCurrency(e){return{name:e.name,symbol:e.symbol}}};Qi.styles=jL;za([T({type:String})],Qi.prototype,"type",void 0);za([T({type:Number})],Qi.prototype,"value",void 0);za([K()],Qi.prototype,"currencies",void 0);za([K()],Qi.prototype,"selectedCurrency",void 0);za([K()],Qi.prototype,"currencyImages",void 0);za([K()],Qi.prototype,"tokenImages",void 0);Qi=za([G("w3m-swap-input")],Qi);const UL=Q` + wui-flex { + background-color: var(--wui-gray-glass-005); + } + + a { + text-decoration: none; + color: var(--wui-color-fg-175); + font-weight: 500; + } +`;var FL=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Ng=class extends q{render(){const{termsConditionsUrl:e,privacyPolicyUrl:n}=Ce.state;return!e&&!n?null:v` + + + By connecting your wallet, you agree to our
+ ${this.termsTemplate()} ${this.andTemplate()} ${this.privacyTemplate()} +
+
+ `}andTemplate(){const{termsConditionsUrl:e,privacyPolicyUrl:n}=Ce.state;return e&&n?"and":""}termsTemplate(){const{termsConditionsUrl:e}=Ce.state;return e?v`Terms of Service`:null}privacyTemplate(){const{privacyPolicyUrl:e}=Ce.state;return e?v`Privacy Policy`:null}};Ng.styles=[UL];Ng=FL([G("w3m-legal-footer")],Ng);const zL=Q` + :host { + display: block; + padding: 0 var(--wui-spacing-xl) var(--wui-spacing-xl); + } +`;var g9=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Sp=class extends q{constructor(){super(...arguments),this.wallet=void 0}render(){if(!this.wallet)return this.style.display="none",null;const{name:e,app_store:n,play_store:r,chrome_store:i,homepage:o}=this.wallet,s=le.isMobile(),a=le.isIos(),l=le.isAndroid(),c=[n,r,o,i].filter(Boolean).length>1,u=Ae.getTruncateString({string:e,charsStart:12,charsEnd:0,truncate:"end"});return c&&!s?v` + X.push("Downloads",{wallet:this.wallet})} + > + `:!c&&o?v` + + `:n&&a?v` + + `:r&&l?v` + + `:(this.style.display="none",null)}onAppStore(){var e;(e=this.wallet)!=null&&e.app_store&&le.openHref(this.wallet.app_store,"_blank")}onPlayStore(){var e;(e=this.wallet)!=null&&e.play_store&&le.openHref(this.wallet.play_store,"_blank")}onHomePage(){var e;(e=this.wallet)!=null&&e.homepage&&le.openHref(this.wallet.homepage,"_blank")}};Sp.styles=[zL];g9([T({type:Object})],Sp.prototype,"wallet",void 0);Sp=g9([G("w3m-mobile-download-links")],Sp);const WL=Q` + wui-flex { + border-top: 1px solid var(--wui-gray-glass-005); + } + + a { + text-decoration: none; + color: var(--wui-color-fg-175); + font-weight: 500; + display: flex; + align-items: center; + justify-content: center; + gap: var(--wui-spacing-3xs); + } +`;var HL=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Mg=class extends q{render(){const{termsConditionsUrl:e,privacyPolicyUrl:n}=Ce.state;return!e&&!n?null:v` + + + We work with the best providers to give you the lowest fees and best support. More options + coming soon! + + + ${this.howDoesItWorkTemplate()} + + `}howDoesItWorkTemplate(){return v` + + How does it work? + `}onWhatIsBuy(){X.push("WhatIsABuy")}};Mg.styles=[WL];Mg=HL([G("w3m-onramp-providers-footer")],Mg);const VL=Q` + :host { + display: block; + position: absolute; + opacity: 0; + pointer-events: none; + top: 11px; + left: 50%; + width: max-content; + } +`;var w9=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};const ZL={success:{backgroundColor:"success-100",iconColor:"success-100",icon:"checkmark"},error:{backgroundColor:"error-100",iconColor:"error-100",icon:"close"}};let Tp=class extends q{constructor(){super(),this.unsubscribe=[],this.timeout=void 0,this.open=Fe.state.open,this.unsubscribe.push(Fe.subscribeKey("open",e=>{this.open=e,this.onOpen()}))}disconnectedCallback(){clearTimeout(this.timeout),this.unsubscribe.forEach(e=>e())}render(){const{message:e,variant:n}=Fe.state,r=ZL[n];return v` + + `}onOpen(){clearTimeout(this.timeout),this.open?(this.animate([{opacity:0,transform:"translateX(-50%) scale(0.85)"},{opacity:1,transform:"translateX(-50%) scale(1)"}],{duration:150,fill:"forwards",easing:"ease"}),this.timeout=setTimeout(()=>Fe.hide(),2500)):this.animate([{opacity:1,transform:"translateX(-50%) scale(1)"},{opacity:0,transform:"translateX(-50%) scale(0.85)"}],{duration:150,fill:"forwards",easing:"ease"})}};Tp.styles=VL;w9([K()],Tp.prototype,"open",void 0);Tp=w9([G("w3m-snackbar")],Tp);const GL=Q` + wui-separator { + margin: var(--wui-spacing-s) calc(var(--wui-spacing-s) * -1); + width: calc(100% + var(--wui-spacing-s) * 2); + } + + wui-email-input { + width: 100%; + } + + form { + width: 100%; + display: block; + position: relative; + } + + wui-icon-link, + wui-loading-spinner { + position: absolute; + top: 21px; + transform: translateY(-50%); + } + + wui-icon-link { + right: var(--wui-spacing-xs); + } + + wui-loading-spinner { + right: var(--wui-spacing-m); + } +`;var _f=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Aa=class extends q{constructor(){super(),this.unsubscribe=[],this.formRef=la(),this.connectors=Ke.state.connectors,this.email="",this.loading=!1,this.error="",this.unsubscribe.push(Ke.subscribeKey("connectors",e=>this.connectors=e))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}firstUpdated(){var e;(e=this.formRef.value)==null||e.addEventListener("keydown",n=>{n.key==="Enter"&&this.onSubmitEmail(n)})}render(){const e=this.connectors.length>1;return this.connectors.find(r=>r.type==="EMAIL")?v` +
+ + + + ${this.submitButtonTemplate()}${this.loadingTemplate()} + +
+ + ${e?v``:null} + `:null}submitButtonTemplate(){return!this.loading&&this.email.length>3?v` + + + `:null}loadingTemplate(){return this.loading?v``:null}onEmailInputChange(e){this.email=e.detail,this.error=""}async onSubmitEmail(e){try{if(this.loading)return;this.loading=!0,e.preventDefault();const n=Ke.getEmailConnector();if(!n)throw new Error("w3m-email-login-widget: Email connector not found");const{action:r}=await n.provider.connectEmail({email:this.email});ye.sendEvent({type:"track",event:"EMAIL_SUBMITTED"}),r==="VERIFY_OTP"?(ye.sendEvent({type:"track",event:"EMAIL_VERIFICATION_CODE_SENT"}),X.push("EmailVerifyOtp",{email:this.email})):r==="VERIFY_DEVICE"&&X.push("EmailVerifyDevice",{email:this.email})}catch(n){const r=le.parseError(n);r!=null&&r.includes("Invalid email")?this.error="Invalid email. Try again.":Fe.showError(n)}finally{this.loading=!1}}onFocusEvent(){ye.sendEvent({type:"track",event:"EMAIL_LOGIN_SELECTED"})}};Aa.styles=GL;_f([K()],Aa.prototype,"connectors",void 0);_f([K()],Aa.prototype,"email",void 0);_f([K()],Aa.prototype,"loading",void 0);_f([K()],Aa.prototype,"error",void 0);Aa=_f([G("w3m-email-login-widget")],Aa);const qL=Q` + wui-flex { + width: 100%; + } + + :host > wui-flex:first-child { + transform: translateY(calc(var(--wui-spacing-xxs) * -1)); + } + + wui-icon-link { + margin-right: calc(var(--wui-icon-box-size-md) * -1); + } + + wui-notice-card { + margin-bottom: var(--wui-spacing-3xs); + } + + w3m-transactions-view { + max-height: 200px; + } + + .tab-content-container { + height: 300px; + overflow-y: auto; + overflow-x: hidden; + scrollbar-width: none; + } + + .account-button { + width: auto; + border: none; + display: flex; + align-items: center; + justify-content: center; + gap: var(--wui-spacing-s); + height: 48px; + padding: var(--wui-spacing-xs); + padding-right: var(--wui-spacing-s); + box-shadow: inset 0 0 0 1px var(--wui-gray-glass-002); + background-color: var(--wui-gray-glass-002); + border-radius: 24px; + transaction: background-color 0.2s linear; + } + + .account-button:hover { + background-color: var(--wui-gray-glass-005); + } + + .avatar-container { + position: relative; + } + + wui-avatar.avatar { + width: 32px; + height: 32px; + box-shadow: 0 0 0 2px var(--wui-gray-glass-005); + } + + wui-avatar.network-avatar { + width: 16px; + height: 16px; + position: absolute; + left: 100%; + top: 100%; + transform: translate(-75%, -75%); + box-shadow: 0 0 0 2px var(--wui-gray-glass-005); + } + + .account-links { + display: flex; + justify-content: space-between; + align-items: center; + } + + .account-links wui-flex { + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + flex: 1; + background: red; + align-items: center; + justify-content: center; + height: 48px; + padding: 10px; + flex: 1 0 0; + border-radius: var(--XS, 16px); + border: 1px solid var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1)); + background: var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1)); + transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-md); + will-change: background-color; + } + + .account-links wui-flex:hover { + background: var(--dark-accent-glass-015, rgba(71, 161, 255, 0.15)); + } + + .account-links wui-flex wui-icon { + width: var(--S, 20px); + height: var(--S, 20px); + } + + .account-links wui-flex wui-icon svg path { + stroke: #47a1ff; + } +`;var fs=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let hi=class extends q{constructor(){super(),this.unsubscribe=[],this.address=de.state.address,this.profileImage=de.state.profileImage,this.profileName=de.state.profileName,this.network=me.state.caipNetwork,this.disconnecting=!1,this.balance=de.state.balance,this.balanceSymbol=de.state.balanceSymbol,this.unsubscribe.push(de.subscribe(e=>{e.address?(this.address=e.address,this.profileImage=e.profileImage,this.profileName=e.profileName,this.balance=e.balance,this.balanceSymbol=e.balanceSymbol):this.disconnecting||Fe.showError("Account not found")}),me.subscribeKey("caipNetwork",e=>{e!=null&&e.id&&(this.network=e)}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){var n;if(!this.address)throw new Error("w3m-account-view: No account provided");const e=qe.getNetworkImage(this.network);return v` + + + + + ${this.profileName?Ae.getTruncateString({string:this.profileName,charsStart:20,charsEnd:0,truncate:"end"}):Ae.getTruncateString({string:this.address?this.address:"",charsStart:4,charsEnd:4,truncate:"middle"})} + + + + ${le.formatBalance(this.balance,this.balanceSymbol)} + + ${this.explorerBtnTemplate()} + + + + ${this.emailCardTemplate()} ${this.emailBtnTemplate()} + + + + ${((n=this.network)==null?void 0:n.name)??"Unknown"} + + + ${this.onrampTemplate()} + + Activity + + + Disconnect + + `}onrampTemplate(){const{enableOnramp:e}=Ce.state;return e?v` + + Buy crypto + + `:null}emailCardTemplate(){const e=jt.getConnectedConnector(),n=Ke.getEmailConnector(),{origin:r}=location;return!n||e!=="EMAIL"||r.includes(Tr.SECURE_SITE)?null:v` + + `}handleClickPay(){X.push("OnRampProviders")}explorerBtnTemplate(){const{addressExplorerUrl:e}=de.state;return e?v` + + + Block Explorer + + + `:null}emailBtnTemplate(){const e=jt.getConnectedConnector(),n=Ke.getEmailConnector();if(!n||e!=="EMAIL")return null;const r=n.provider.getEmail()??"";return v` + this.onGoToUpdateEmail(r)} + > + ${r} + + `}isAllowedNetworkSwitch(){const{requestedCaipNetworks:e}=me.state,n=e?e.length>1:!1,r=e==null?void 0:e.find(({id:i})=>{var o;return i===((o=this.network)==null?void 0:o.id)});return n||!r}onCopyAddress(){try{this.address&&(le.copyToClopboard(this.address),Fe.showSuccess("Address copied"))}catch{Fe.showError("Failed to copy")}}onNetworks(){this.isAllowedNetworkSwitch()&&(ye.sendEvent({type:"track",event:"CLICK_NETWORKS"}),X.push("Networks"))}onTransactions(){ye.sendEvent({type:"track",event:"CLICK_TRANSACTIONS"}),X.push("Transactions")}async onDisconnect(){try{this.disconnecting=!0,await Be.disconnect(),ye.sendEvent({type:"track",event:"DISCONNECT_SUCCESS"}),De.close()}catch{ye.sendEvent({type:"track",event:"DISCONNECT_ERROR"}),Fe.showError("Failed to disconnect")}finally{this.disconnecting=!1}}onExplorer(){const{addressExplorerUrl:e}=de.state;e&&le.openHref(e,"_blank")}onGoToUpgradeView(){ye.sendEvent({type:"track",event:"EMAIL_UPGRADE_FROM_MODAL"}),X.push("UpgradeEmailWallet")}onGoToUpdateEmail(e){X.push("UpdateEmailWallet",{email:e})}};hi.styles=qL;fs([K()],hi.prototype,"address",void 0);fs([K()],hi.prototype,"profileImage",void 0);fs([K()],hi.prototype,"profileName",void 0);fs([K()],hi.prototype,"network",void 0);fs([K()],hi.prototype,"disconnecting",void 0);fs([K()],hi.prototype,"balance",void 0);fs([K()],hi.prototype,"balanceSymbol",void 0);hi=fs([G("w3m-account-default-widget")],hi);const KL=Q` + wui-flex { + width: 100%; + } + + wui-promo { + position: absolute; + top: -32px; + } + + wui-profile-button { + margin-top: calc(-1 * var(--wui-spacing-2l)); + } + + wui-promo + wui-profile-button { + margin-top: var(--wui-spacing-2l); + } + + wui-tooltip-select { + width: 100%; + } + + wui-tabs { + width: 100%; + } + + .contentContainer { + height: 280px; + } + + .contentContainer > wui-icon-box { + width: 40px; + height: 40px; + border-radius: var(--wui-border-radius-xxs); + } + + .contentContainer > .textContent { + width: 65%; + } +`,YL={ACCOUNT_TABS:[{label:"Tokens"},{label:"NFTs"},{label:"Activity"}]};var ps=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let mi=class extends q{constructor(){super(),this.unsubscribe=[],this.address=de.state.address,this.profileImage=de.state.profileImage,this.profileName=de.state.profileName,this.smartAccountDeployed=de.state.smartAccountDeployed,this.network=me.state.caipNetwork,this.currentTab=de.state.currentTab,this.tokenBalance=de.state.tokenBalance,this.unsubscribe.push(de.subscribe(e=>{e.address?(this.address=e.address,this.profileImage=e.profileImage,this.profileName=e.profileName,this.currentTab=e.currentTab,this.tokenBalance=e.tokenBalance,this.smartAccountDeployed=e.smartAccountDeployed):De.close()}),me.subscribe(e=>{this.network=e.caipNetwork}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){if(!this.address)throw new Error("w3m-account-view: No account provided");const e=qe.getNetworkImage(this.network);return v` + ${this.activateAccountTemplate()} + + ${this.tokenBalanceTemplate()} + + + + + + + + + ${this.listContentTemplate()} + `}listContentTemplate(){return this.currentTab===0?v``:this.currentTab===1?v``:this.currentTab===2?v``:v``}tokenBalanceTemplate(){var e;if(this.tokenBalance&&((e=this.tokenBalance)==null?void 0:e.length)>=0){const n=le.calculateBalance(this.tokenBalance),{dollars:r="0",pennies:i="00"}=le.formatTokenBalance(n);return v``}return v``}activateAccountTemplate(){const e=me.checkIfSmartAccountEnabled(),n=ct.getPreferredAccountType();return!e||n===Gt.ACCOUNT_TYPES.SMART_ACCOUNT||this.smartAccountDeployed?null:v` `}onTabChange(e){de.setCurrentTab(e)}onProfileButtonClick(){X.push("AccountSettings")}onBuyClick(){X.push("OnRampProviders")}onReceiveClick(){X.push("WalletReceive")}onSendClick(){X.push("WalletSend")}onUpdateToSmartAccount(){X.push("UpgradeToSmartAccount")}};mi.styles=KL;ps([K()],mi.prototype,"address",void 0);ps([K()],mi.prototype,"profileImage",void 0);ps([K()],mi.prototype,"profileName",void 0);ps([K()],mi.prototype,"smartAccountDeployed",void 0);ps([K()],mi.prototype,"network",void 0);ps([K()],mi.prototype,"currentTab",void 0);ps([K()],mi.prototype,"tokenBalance",void 0);mi=ps([G("w3m-account-wallet-features-widget")],mi);const QL=Q` + :host { + width: 100%; + max-height: 280px; + overflow: scroll; + scrollbar-width: none; + } +`;var JL=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Lg=class extends q{render(){return v``}};Lg.styles=QL;Lg=JL([G("w3m-account-activity-widget")],Lg);const XL=Q` + .contentContainer { + height: 280px; + } + + .contentContainer > wui-icon-box { + width: 40px; + height: 40px; + border-radius: var(--wui-border-radius-xxs); + } + + .contentContainer > .textContent { + width: 65%; + } +`;var eD=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Dg=class extends q{render(){return v`${this.nftTemplate()}`}nftTemplate(){return v` + + + No NFTs yet + Transfer from another wallets to get started + + Receive NFTs + `}onReceiveClick(){X.push("WalletReceive")}};Dg.styles=XL;Dg=eD([G("w3m-account-nfts-widget")],Dg);const tD=Q` + :host { + width: 100%; + } + + wui-flex { + width: 100%; + } + + .contentContainer { + max-height: 280px; + overflow: scroll; + scrollbar-width: none; + } +`;var y9=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Ap=class extends q{constructor(){super(),this.unsubscribe=[],this.tokenBalance=de.state.tokenBalance,this.unsubscribe.push(de.subscribe(e=>{this.tokenBalance=e.tokenBalance}))}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}firstUpdated(){de.fetchTokenBalance()}render(){return v`${this.tokenTemplate()}`}tokenTemplate(){var e;return this.tokenBalance&&((e=this.tokenBalance)==null?void 0:e.length)>0?v` + ${this.tokenItemTemplate()} + `:v` `}tokenItemTemplate(){var e;return(e=this.tokenBalance)==null?void 0:e.map(n=>v``)}onReceiveClick(){X.push("WalletReceive")}onBuyClick(){X.push("OnRampProviders")}};Ap.styles=tD;y9([K()],Ap.prototype,"tokenBalance",void 0);Ap=y9([G("w3m-account-tokens-widget")],Ap);const nD=Q` + :host { + height: 100%; + } + + .contentContainer { + height: 280px; + } + + .contentContainer > wui-icon-box { + width: 40px; + height: 40px; + border-radius: var(--wui-border-radius-xxs); + } + + .contentContainer > .textContent { + width: 65%; + } +`;var Wa=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};const t0="last-transaction",rD=7;let Ji=class extends q{constructor(){super(),this.unsubscribe=[],this.paginationObserver=void 0,this.page="activity",this.address=de.state.address,this.transactionsByYear=en.state.transactionsByYear,this.loading=en.state.loading,this.empty=en.state.empty,this.next=en.state.next,en.clearCursor(),this.unsubscribe.push(de.subscribe(e=>{e.isConnected&&this.address!==e.address&&(this.address=e.address,en.resetTransactions(),en.fetchTransactions(e.address))}),en.subscribe(e=>{this.transactionsByYear=e.transactionsByYear,this.loading=e.loading,this.empty=e.empty,this.next=e.next}))}firstUpdated(){en.fetchTransactions(this.address),this.createPaginationObserver()}updated(){this.setPaginationObserver()}disconnectedCallback(){this.unsubscribe.forEach(e=>e())}render(){return v` ${this.empty?null:this.templateTransactionsByYear()} + ${this.loading?this.templateLoading():null} + ${!this.loading&&this.empty?this.templateEmpty():null}`}templateTransactionsByYear(){const e=Object.keys(this.transactionsByYear).sort().reverse();return e.map((n,r)=>{const i=r===e.length-1,o=parseInt(n,10);return new Array(12).fill(null).map((a,l)=>l).reverse().map(a=>{var u;const l=$o.getTransactionGroupTitle(o,a),c=(u=this.transactionsByYear[o])==null?void 0:u[a];return c?v` + + + ${l} + + + ${this.templateTransactions(c,i)} + + + `:null})})}templateRenderTransaction(e,n){const{date:r,descriptions:i,direction:o,isAllNFT:s,images:a,status:l,transfers:c,type:u}=this.getTransactionListItemProps(e),d=(c==null?void 0:c.length)>1;return(c==null?void 0:c.length)===2&&!s?v` + + `:d?c.map((g,b)=>{const S=$o.getTransferDescription(g),k=n&&b===c.length-1;return v` `}):v` + + `}templateTransactions(e,n){return e.map((r,i)=>{const o=n&&i===e.length-1;return v`${this.templateRenderTransaction(r,o)}`})}emptyStateActivity(){return v` + + + No Transactions yet + Start trading on dApps
+ to grow your wallet!
+
+
`}emptyStateAccount(){return v` + + + No activity yet + Your next transactions will appear here + + Trade + `}templateEmpty(){return this.page==="account"?v`${this.emptyStateAccount()}`:v`${this.emptyStateActivity()}`}templateLoading(){return this.page==="activity"?Array(rD).fill(v` `).map(e=>e):null}onReceiveClick(){X.push("WalletReceive")}createPaginationObserver(){const{projectId:e}=Ce.state;this.paginationObserver=new IntersectionObserver(([n])=>{n!=null&&n.isIntersecting&&!this.loading&&(en.fetchTransactions(this.address),ye.sendEvent({type:"track",event:"LOAD_MORE_TRANSACTIONS",properties:{address:this.address,projectId:e,cursor:this.next}}))},{}),this.setPaginationObserver()}setPaginationObserver(){var n,r,i;(n=this.paginationObserver)==null||n.disconnect();const e=(r=this.shadowRoot)==null?void 0:r.querySelector(`#${t0}`);e&&((i=this.paginationObserver)==null||i.observe(e))}getTransactionListItemProps(e){var l,c,u,d,p;const n=m2.formatDate((l=e==null?void 0:e.metadata)==null?void 0:l.minedAt),r=$o.getTransactionDescriptions(e),i=e==null?void 0:e.transfers,o=(c=e==null?void 0:e.transfers)==null?void 0:c[0],s=!!o&&((u=e==null?void 0:e.transfers)==null?void 0:u.every(g=>!!g.nft_info)),a=$o.getTransactionImages(i);return{date:n,direction:o==null?void 0:o.direction,descriptions:r,isAllNFT:s,images:a,status:(d=e.metadata)==null?void 0:d.status,transfers:i,type:(p=e.metadata)==null?void 0:p.operationType}}};Ji.styles=nD;Wa([T()],Ji.prototype,"page",void 0);Wa([K()],Ji.prototype,"address",void 0);Wa([K()],Ji.prototype,"transactionsByYear",void 0);Wa([K()],Ji.prototype,"loading",void 0);Wa([K()],Ji.prototype,"empty",void 0);Wa([K()],Ji.prototype,"next",void 0);Ji=Wa([G("w3m-activity-list")],Ji);const iD=Q` + :host { + width: 100%; + height: 100px; + border-radius: var(--wui-border-radius-s); + border: 1px solid var(--wui-gray-glass-002); + background-color: var(--wui-gray-glass-002); + transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-lg); + will-change: background-color; + } + + :host(:hover) { + background-color: var(--wui-gray-glass-005); + } + + wui-flex { + width: 100%; + height: fit-content; + } + + wui-button { + width: 100%; + display: flex; + justify-content: flex-end; + } +`;var q2=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Ld=class extends q{render(){return v` + + + ${this.buttonTemplate()} + + + ${this.sendValueTemplate()} + + ${this.maxAmountTemplate()} ${this.actionTemplate()} + + + `}buttonTemplate(){return this.token?v`Select token`:v`Select token`}handleSelectButtonClick(){X.push("WalletSendSelectToken")}sendValueTemplate(){if(this.token&&this.sendTokenAmount){const n=this.token.price*this.sendTokenAmount;return v`$${n.toFixed(2)}`}return null}maxAmountTemplate(){return this.token?this.sendTokenAmount&&this.sendTokenAmount>Number(this.token.quantity.numeric)?v` + ${Ae.roundNumber(Number(this.token.quantity.numeric),6,5)} + `:v` + ${Ae.roundNumber(Number(this.token.quantity.numeric),6,5)} + `:null}actionTemplate(){return this.token?this.sendTokenAmount&&this.sendTokenAmount>Number(this.token.quantity.numeric)?v`Buy`:v`Max`:null}onInputChange(e){hn.setTokenAmount(e.detail)}onMaxClick(){var e;this.token&&hn.setTokenAmount(Number((e=this.token)==null?void 0:e.quantity.numeric))}onBuyClick(){X.push("OnRampProviders")}};Ld.styles=iD;q2([T({type:Object})],Ld.prototype,"token",void 0);q2([T({type:Number})],Ld.prototype,"sendTokenAmount",void 0);Ld=q2([G("w3m-input-token")],Ld);const oD=Q` + :host { + width: 100%; + height: 100px; + border-radius: var(--wui-border-radius-s); + border: 1px solid var(--wui-gray-glass-002); + background-color: var(--wui-gray-glass-002); + transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-lg); + will-change: background-color; + position: relative; + } + + :host(:hover) { + background-color: var(--wui-gray-glass-005); + } + + wui-flex { + width: 100%; + height: fit-content; + } + + wui-button { + display: ruby; + color: var(--wui-color-fg-100); + margin: 0 var(--wui-spacing-xs); + } + + .instruction { + position: absolute; + top: 50%; + transform: translateY(-50%); + } + + textarea { + background: transparent; + width: 100%; + font-family: var(--w3m-font-family); + font-size: var(--wui-font-size-medium); + font-style: normal; + font-weight: var(--wui-font-weight-light); + line-height: 130%; + letter-spacing: var(--wui-letter-spacing-medium); + color: var(--wui-color-fg-100); + caret-color: var(--wui-color-accent-100); + box-sizing: border-box; + -webkit-appearance: none; + -moz-appearance: textfield; + padding: 0px; + border: none; + outline: none; + appearance: none; + resize: none; + overflow: hidden; + } +`;var K2=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Dd=class extends q{constructor(){super(...arguments),this.inputElementRef=la(),this.instructionElementRef=la(),this.instructionHidden=!!this.receiverAddress}firstUpdated(){this.receiverAddress&&(this.instructionHidden=!0),this.checkHidden()}render(){return v` + + Type or + + + Paste + + address + + + `}async focusInput(){var e;this.instructionElementRef.value&&(this.instructionHidden=!0,await this.toggleInstructionFocus(!1),this.instructionElementRef.value.style.pointerEvents="none",(e=this.inputElementRef.value)==null||e.focus(),this.inputElementRef.value&&(this.inputElementRef.value.selectionStart=this.inputElementRef.value.selectionEnd=this.inputElementRef.value.value.length))}async focusInstruction(){var e;this.instructionElementRef.value&&(this.instructionHidden=!1,await this.toggleInstructionFocus(!0),this.instructionElementRef.value.style.pointerEvents="auto",(e=this.inputElementRef.value)==null||e.blur())}async toggleInstructionFocus(e){this.instructionElementRef.value&&await this.instructionElementRef.value.animate([{opacity:e?0:1},{opacity:e?1:0}],{duration:100,easing:"ease",fill:"forwards"}).finished}onBoxClick(){!this.receiverAddress&&!this.instructionHidden&&this.focusInput()}onBlur(){!this.receiverAddress&&this.instructionHidden&&this.focusInstruction()}checkHidden(){this.instructionHidden&&this.focusInput()}async onPasteClick(){const e=await navigator.clipboard.readText();hn.setReceiverAddress(e)}onInputChange(e){const n=e.target;n.value&&!this.instructionHidden&&this.focusInput(),hn.setReceiverAddress(n.value)}};Dd.styles=oD;K2([T()],Dd.prototype,"receiverAddress",void 0);K2([K()],Dd.prototype,"instructionHidden",void 0);Dd=K2([G("w3m-input-address")],Dd);const sD=Q` + :host { + display: flex; + width: 100%; + flex-direction: column; + gap: var(--wui-border-radius-1xs); + border-radius: var(--wui-border-radius-s); + background: var(--wui-gray-glass-002); + padding: var(--wui-spacing-s) var(--wui-spacing-1xs) var(--wui-spacing-1xs) + var(--wui-spacing-1xs); + } + + wui-text { + padding: 0 var(--wui-spacing-1xs); + } + + wui-flex { + margin-top: var(--wui-spacing-1xs); + } + + .network { + cursor: pointer; + transition: background-color var(--wui-ease-out-power-1) var(--wui-duration-lg); + will-change: background-color; + } + + .network:focus-visible { + border: 1px solid var(--wui-color-accent-100); + background-color: var(--wui-gray-glass-005); + -webkit-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + -moz-box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + box-shadow: 0px 0px 0px 4px var(--wui-box-shadow-blue); + } + + .network:hover { + background-color: var(--wui-gray-glass-005); + } + + .network:active { + background-color: var(--wui-gray-glass-010); + } +`;var Y2=function(t,e,n,r){var i=arguments.length,o=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,n,o):s(e,n))||o);return i>3&&o&&Object.defineProperty(e,n,o),o};let Bd=class extends q{render(){return v` Details + + + + + ${this.networkTemplate()} + `}networkTemplate(){var e;return(e=this.caipNetwork)!=null&&e.name?v` this.onNetworkClick(this.caipNetwork)} + class="network" + textTitle="Network" + imageSrc=${he(qe.getNetworkImage(this.caipNetwork))} + >`:null}onNetworkClick(e){e&&X.push("Networks",{network:e})}};Bd.styles=sD;Y2([T()],Bd.prototype,"receiverAddress",void 0);Y2([T({type:Object})],Bd.prototype,"caipNetwork",void 0);Bd=Y2([G("w3m-wallet-send-details")],Bd);let Yv=!1;class aD{constructor(e){this.initPromise=void 0,this.setIsConnected=n=>{de.setIsConnected(n)},this.setCaipAddress=n=>{de.setCaipAddress(n)},this.setBalance=(n,r)=>{de.setBalance(n,r)},this.fetchTokenBalance=()=>{de.fetchTokenBalance()},this.setProfileName=n=>{de.setProfileName(n)},this.setProfileImage=n=>{de.setProfileImage(n)},this.resetAccount=()=>{de.resetAccount()},this.setCaipNetwork=n=>{me.setCaipNetwork(n)},this.getCaipNetwork=()=>me.state.caipNetwork,this.setRequestedCaipNetworks=n=>{me.setRequestedCaipNetworks(n)},this.getApprovedCaipNetworksData=()=>me.getApprovedCaipNetworksData(),this.resetNetwork=()=>{me.resetNetwork()},this.setConnectors=n=>{Ke.setConnectors(n)},this.addConnector=n=>{Ke.addConnector(n)},this.getConnectors=()=>Ke.getConnectors(),this.resetWcConnection=()=>{Be.resetWcConnection()},this.fetchIdentity=n=>Xs.fetchIdentity(n),this.setAddressExplorerUrl=n=>{de.setAddressExplorerUrl(n)},this.setSmartAccountDeployed=n=>{de.setSmartAccountDeployed(n)},this.setConnectedWalletInfo=n=>{de.setConnectedWalletInfo(n)},this.setSmartAccountEnabledNetworks=n=>{me.setSmartAccountEnabledNetworks(n)},this.initControllers(e),this.initOrContinue()}async open(e){await this.initOrContinue(),De.open(e)}async close(){await this.initOrContinue(),De.close()}setLoading(e){De.setLoading(e)}getThemeMode(){return kt.state.themeMode}getThemeVariables(){return kt.state.themeVariables}setThemeMode(e){kt.setThemeMode(e),x2(kt.state.themeMode)}setThemeVariables(e){kt.setThemeVariables(e),b8(kt.state.themeVariables)}subscribeTheme(e){return kt.subscribe(e)}getWalletInfo(){return de.state.connectedWalletInfo}subscribeWalletInfo(e){return de.subscribeKey("connectedWalletInfo",e)}getState(){return{...Kl.state}}subscribeState(e){return Kl.subscribe(e)}showErrorMessage(e){Fe.showError(e)}showSuccessMessage(e){Fe.showSuccess(e)}getEvent(){return{...ye.state}}subscribeEvents(e){return ye.subscribe(e)}async initControllers(e){if(me.setClient(e.networkControllerClient),me.setDefaultCaipNetwork(e.defaultChain),Ce.setProjectId(e.projectId),Ce.setAllWallets(e.allWallets),Ce.setIncludeWalletIds(e.includeWalletIds),Ce.setExcludeWalletIds(e.excludeWalletIds),Ce.setFeaturedWalletIds(e.featuredWalletIds),Ce.setTokens(e.tokens),Ce.setTermsConditionsUrl(e.termsConditionsUrl),Ce.setPrivacyPolicyUrl(e.privacyPolicyUrl),Ce.setCustomWallets(e.customWallets),Ce.setEnableAnalytics(e.enableAnalytics),Ce.setSdkVersion(e._sdkVersion),Be.setClient(e.connectionControllerClient),e.siweControllerClient){const{SIWEController:n}=await Mi(()=>import("./index-hW2M65xa.js"),[]);n.setSIWEClient(e.siweControllerClient)}e.metadata&&Ce.setMetadata(e.metadata),e.themeMode&&kt.setThemeMode(e.themeMode),e.themeVariables&&kt.setThemeVariables(e.themeVariables),e.enableOnramp&&Ce.setOnrampEnabled(!!e.enableOnramp),e.enableWalletFeatures&&Ce.setWalletFeaturesEnabled(!!e.enableWalletFeatures),e.allowUnsupportedChain&&me.setAllowUnsupportedChain(e.allowUnsupportedChain)}async initOrContinue(){return!this.initPromise&&!Yv&&le.isClient()&&(Yv=!0,this.initPromise=new Promise(async e=>{await Promise.all([Mi(()=>Promise.resolve().then(()=>_O),void 0),Mi(()=>Promise.resolve().then(()=>TO),void 0)]);const n=document.createElement("w3m-modal");document.body.insertAdjacentElement("beforeend",n),e()})),this.initPromise}}function lD(t){if(t)return{id:`${Ee.EIP155}:${t.id}`,name:t.name,imageId:Ri.EIP155NetworkImageIds[t.id]}}async function cD(t){var o,s,a,l;if(!t)throw new Error("networkControllerClient:getApprovedCaipNetworks - connector is undefined");const e=await(t==null?void 0:t.getProvider()),n=(s=(o=e==null?void 0:e.signer)==null?void 0:o.session)==null?void 0:s.namespaces,r=(a=n==null?void 0:n[Ee.EIP155])==null?void 0:a.methods,i=(l=n==null?void 0:n[Ee.EIP155])==null?void 0:l.chains;return{supportsAllNetworks:!!(r!=null&&r.includes(Ee.ADD_CHAIN_METHOD)),approvedCaipNetworkIds:i}}function uD(){return{supportsAllNetworks:!1,approvedCaipNetworkIds:Ri.WalletConnectRpcChainIds.map(t=>`${Ee.EIP155}:${t}`)}}function dD({chainId:t,projectId:e}){const n=le.getBlockchainApiUrl();return Ri.WalletConnectRpcChainIds.includes(t)?$3(`${n}/v1/?chainId=${Ee.EIP155}:${t}&projectId=${e}`):$3()}class fD extends aD{constructor(e){const{wagmiConfig:n,siweConfig:r,defaultChain:i,tokens:o,_sdkVersion:s,...a}=e;if(!n)throw new Error("web3modal:constructor - wagmiConfig is undefined");if(!a.projectId)throw new Error("web3modal:constructor - projectId is undefined");const l={switchCaipNetwork:async u=>{const d=_s.caipNetworkIdToNumber(u==null?void 0:u.id);d&&await hT(this.wagmiConfig,{chainId:d})},getApprovedCaipNetworksData:async()=>new Promise(u=>{var g,b;const p=new Map(n.state.connections).get(n.state.current||"");if(((g=p==null?void 0:p.connector)==null?void 0:g.id)===Ee.EMAIL_CONNECTOR_ID)u(uD());else if(((b=p==null?void 0:p.connector)==null?void 0:b.id)===Ee.WALLET_CONNECT_CONNECTOR_ID){const S=n.connectors.find(k=>k.id===Ee.WALLET_CONNECT_CONNECTOR_ID);u(cD(S))}u({approvedCaipNetworkIds:void 0,supportsAllNetworks:!0})})},c={connectWalletConnect:async u=>{var b;const d=n.connectors.find(S=>S.id===Ee.WALLET_CONNECT_CONNECTOR_ID);if(!d)throw new Error("connectionControllerClient:getWalletConnectUri - connector is undefined");(await d.getProvider()).on("display_uri",S=>{u(S)});const g=_s.caipNetworkIdToNumber((b=this.getCaipNetwork())==null?void 0:b.id);await N3(this.wagmiConfig,{connector:d,chainId:g})},connectExternal:async({id:u,provider:d,info:p})=>{var S,k;const g=n.connectors.find(y=>y.id===u);if(!g)throw new Error("connectionControllerClient:connectExternal - connector is undefined");d&&p&&g.id===Ee.EIP6963_CONNECTOR_ID&&((S=g.setEip6963Wallet)==null||S.call(g,{provider:d,info:p}));const b=_s.caipNetworkIdToNumber((k=this.getCaipNetwork())==null?void 0:k.id);await N3(this.wagmiConfig,{connector:g,chainId:b})},checkInstalled:u=>{const d=this.getConnectors().find(p=>p.type==="INJECTED");return u?d&&window!=null&&window.ethereum?u.some(p=>{var g;return!!((g=window.ethereum)!=null&&g[String(p)])}):!1:!!window.ethereum},disconnect:async()=>{var u;await oT(this.wagmiConfig),(u=r==null?void 0:r.options)!=null&&u.signOutOnDisconnect&&await r.signOut()},signMessage:async u=>fT(this.wagmiConfig,{message:u})};super({networkControllerClient:l,connectionControllerClient:c,siweControllerClient:r,defaultChain:lD(i),tokens:ZM.getCaipTokens(o),_sdkVersion:s??`html-wagmi-${Ee.VERSION}`,...a}),this.hasSyncedConnectedAccount=!1,this.options=void 0,this.options=e,this.wagmiConfig=n,this.syncRequestedNetworks([...n.chains]),this.syncConnectors([...n.connectors]),this.initEmailConnectorListeners([...n.connectors]),wT(this.wagmiConfig,{onChange:u=>this.syncConnectors(u)}),T6(this.wagmiConfig,{onChange:u=>this.syncAccount({...u})})}getState(){const e=super.getState();return{...e,selectedNetworkId:_s.caipNetworkIdToNumber(e.selectedNetworkId)}}subscribeState(e){return super.subscribeState(n=>e({...n,selectedNetworkId:_s.caipNetworkIdToNumber(n.selectedNetworkId)}))}syncRequestedNetworks(e){const n=e==null?void 0:e.map(r=>{var i,o;return{id:`${Ee.EIP155}:${r.id}`,name:r.name,imageId:Ri.EIP155NetworkImageIds[r.id],imageUrl:(o=(i=this.options)==null?void 0:i.chainImages)==null?void 0:o[r.id]}});this.setRequestedCaipNetworks(n??[])}async syncAccount({address:e,isConnected:n,chainId:r,connector:i}){if(this.resetAccount(),this.syncNetwork(e,r,n),n&&e&&r){const o=`${Ee.EIP155}:${r}:${e}`;this.setIsConnected(n),this.setCaipAddress(o),await Promise.all([this.syncProfile(e,r),this.syncBalance(e,r),this.syncConnectedWalletInfo(i),this.fetchTokenBalance(),this.getApprovedCaipNetworksData()]),this.hasSyncedConnectedAccount=!0}else!n&&this.hasSyncedConnectedAccount&&(this.resetWcConnection(),this.resetNetwork())}async syncNetwork(e,n,r){var o,s,a,l;const i=this.wagmiConfig.chains.find(c=>c.id===n);if(i||n){const c=(i==null?void 0:i.name)??(n==null?void 0:n.toString()),u=Number((i==null?void 0:i.id)??n),d=`${Ee.EIP155}:${u}`;if(this.setCaipNetwork({id:d,name:c,imageId:Ri.EIP155NetworkImageIds[u],imageUrl:(s=(o=this.options)==null?void 0:o.chainImages)==null?void 0:s[u]}),r&&e&&n){const p=`${Ee.EIP155}:${u}:${e}`;if(this.setCaipAddress(p),(l=(a=i==null?void 0:i.blockExplorers)==null?void 0:a.default)!=null&&l.url){const g=`${i.blockExplorers.default.url}/address/${e}`;this.setAddressExplorerUrl(g)}else this.setAddressExplorerUrl(void 0);this.hasSyncedConnectedAccount&&(await this.syncProfile(e,n),await this.syncBalance(e,n))}}}async syncProfile(e,n){if(n!==pk.id){this.setProfileName(null),this.setProfileImage(null);return}try{const{name:r,avatar:i}=await this.fetchIdentity({caipChainId:`${Ee.EIP155}:${n}`,address:e});this.setProfileName(r),this.setProfileImage(i)}catch{const r=await uT(this.wagmiConfig,{address:e,chainId:n});if(r){this.setProfileName(r);const i=await cT(this.wagmiConfig,{name:r,chainId:n});i&&this.setProfileImage(i)}}}async syncBalance(e,n){var i,o,s;const r=this.wagmiConfig.chains.find(a=>a.id===n);if(r){const a=await aT(this.wagmiConfig,{address:e,chainId:r.id,token:(s=(o=(i=this.options)==null?void 0:i.tokens)==null?void 0:o[r.id])==null?void 0:s.address});this.setBalance(a.formatted,a.symbol);return}this.setBalance(void 0,void 0)}async syncConnectedWalletInfo(e){var n;if(!e)throw Error("syncConnectedWalletInfo - connector is undefined");if(e.id===Ee.WALLET_CONNECT_CONNECTOR_ID&&e.getProvider){const r=await e.getProvider();r.session&&this.setConnectedWalletInfo({...r.session.peer.metadata,name:r.session.peer.metadata.name,icon:(n=r.session.peer.metadata.icons)==null?void 0:n[0]})}else this.setConnectedWalletInfo({name:e.name,icon:e.icon})}syncConnectors(e){const n=new Set,r=e.filter(a=>!n.has(a.id)&&n.add(a.id)),i=[],o=Ee.COINBASE_SDK_CONNECTOR_ID,s=r.find(a=>a.id===Ee.CONNECTOR_RDNS_MAP[Ee.COINBASE_CONNECTOR_ID]);r.forEach(({id:a,name:l,type:c,icon:u})=>{var g,b;s&&a===o||Ee.EMAIL_CONNECTOR_ID===a||i.push({id:a,explorerId:Ri.ConnectorExplorerIds[a],imageUrl:((b=(g=this.options)==null?void 0:g.connectorImages)==null?void 0:b[a])??u,name:Ri.ConnectorNamesMap[a]??l,imageId:Ri.ConnectorImageIds[a],type:Ri.ConnectorTypesMap[c]??"EXTERNAL",info:{rdns:a}})}),this.setConnectors(i),this.syncEmailConnector(r)}async syncEmailConnector(e){const n=e.find(({id:r})=>r===Ee.EMAIL_CONNECTOR_ID);if(n){const r=await n.getProvider();this.addConnector({id:Ee.EMAIL_CONNECTOR_ID,type:"EMAIL",name:"Email",provider:r})}}async initEmailConnectorListeners(e){const n=e.find(({id:r})=>r===Ee.EMAIL_CONNECTOR_ID);n&&(await this.listenEmailConnector(n),await this.listenModal(n))}async listenEmailConnector(e){if(typeof window<"u"&&e){super.setLoading(!0);const n=await e.getProvider(),r=n.getLoginEmailUsed();super.setLoading(r),r&&this.setIsConnected(!1),n.onRpcRequest(i=>{if(ct.checkIfRequestExists(i))ct.checkIfRequestIsAllowed(i)||super.open({view:"ApproveTransaction"});else{super.open();const o=ct.getRequestMethod(i);console.error(Gt.RPC_METHOD_NOT_ALLOWED_MESSAGE,{method:o}),setTimeout(()=>{this.showErrorMessage(Gt.RPC_METHOD_NOT_ALLOWED_UI_MESSAGE)},300),n.rejectRpcRequest()}}),n.onRpcResponse(()=>{super.close()}),n.onNotConnected(()=>{this.setIsConnected(!1),super.setLoading(!1)}),n.onIsConnected(i=>{this.setIsConnected(!0),this.setSmartAccountDeployed(!!i.smartAccountDeployed),super.setLoading(!1)}),n.onGetSmartAccountEnabledNetworks(i=>{this.setSmartAccountEnabledNetworks(i)}),n.onSetPreferredAccount(({address:i})=>{var s;if(!i)return;const o=_s.caipNetworkIdToNumber((s=this.getCaipNetwork())==null?void 0:s.id);this.syncAccount({address:i,chainId:o,isConnected:!0,connector:e})})}}async listenModal(e){const n=await e.getProvider();this.subscribeState(r=>{r.open||n.rejectRpcRequest()})}}let z1;function pD(t){return z1||(z1=new fD({...t,_sdkVersion:`react-wagmi-${Ee.VERSION}`})),z1}Q2.type="coinbaseWallet";function Q2(t){let n,r,i,o,s;return a=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",type:Q2.type,async connect({chainId:l}={}){try{const c=await this.getProvider(),u=(await c.request({method:"eth_requestAccounts"})).map(p=>lr(p));i||(i=this.onAccountsChanged.bind(this),c.on("accountsChanged",i)),o||(o=this.onChainChanged.bind(this),c.on("chainChanged",o)),s||(s=this.onDisconnect.bind(this),c.on("disconnect",s));let d=await this.getChainId();if(l&&d!==l){const p=await this.switchChain({chainId:l}).catch(g=>{if(g.code===Tt.code)throw g;return{id:d}});d=(p==null?void 0:p.id)??d}return{accounts:u,chainId:d}}catch(c){throw/(user closed modal|accounts received is empty|user denied account)/i.test(c.message)?new Tt(c):c}},async disconnect(){const l=await this.getProvider();i&&(l.removeListener("accountsChanged",i),i=void 0),o&&(l.removeListener("chainChanged",o),o=void 0),s&&(l.removeListener("disconnect",s),s=void 0),l.disconnect(),l.close()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(c=>lr(c))},async getChainId(){const c=await(await this.getProvider()).request({method:"eth_chainId"});return Number(c)},async getProvider(){var l;if(!r){const{default:c}=await Mi(()=>import("./index-Bw6nSNtr.js").then(S=>S.i),__vite__mapDeps([0,1]));let u;typeof c!="function"&&typeof c.default=="function"?u=c.default:u=c,n=new u({reloadOnDisconnect:!1,...t});const d=(l=n.walletExtension)==null?void 0:l.getChainId(),p=a.chains.find(S=>t.chainId?S.id===t.chainId:S.id===d)||a.chains[0],g=t.chainId||(p==null?void 0:p.id),b=t.jsonRpcUrl||(p==null?void 0:p.rpcUrls.default.http[0]);r=n.makeWeb3Provider(b,g)}return r},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({chainId:l}){var p,g;const c=a.chains.find(b=>b.id===l);if(!c)throw new Fn(new Vl);const u=await this.getProvider(),d=Je(c.id);try{return await u.request({method:"wallet_switchEthereumChain",params:[{chainId:d}]}),c}catch(b){if(b.code===4902)try{return await u.request({method:"wallet_addEthereumChain",params:[{chainId:d,chainName:c.name,nativeCurrency:c.nativeCurrency,rpcUrls:[((p=c.rpcUrls.default)==null?void 0:p.http[0])??""],blockExplorerUrls:[(g=c.blockExplorers)==null?void 0:g.default.url]}]}),c}catch(S){throw new Tt(S)}throw new Fn(b)}},onAccountsChanged(l){l.length===0?this.onDisconnect():a.emitter.emit("change",{accounts:l.map(c=>lr(c))})},onChainChanged(l){const c=Number(l);a.emitter.emit("change",{chainId:c})},async onDisconnect(l){a.emitter.emit("disconnect");const c=await this.getProvider();i&&(c.removeListener("accountsChanged",i),i=void 0),o&&(c.removeListener("chainChanged",o),o=void 0),s&&(c.removeListener("disconnect",s),s=void 0)}})}J2.type="walletConnect";function J2(t){const e=t.isNewChainsStale??!0;let n,r;const i="eip155";return o=>({id:"walletConnect",name:"WalletConnect",type:J2.type,async setup(){const s=await this.getProvider().catch(()=>null);s&&(s.on("connect",this.onConnect.bind(this)),s.on("session_delete",this.onSessionDelete.bind(this)))},async connect({chainId:s,...a}={}){var l,c;try{const u=await this.getProvider();if(!u)throw new Cs;u.on("display_uri",this.onDisplayUri);let d=s;if(!d){const S=await((l=o.storage)==null?void 0:l.getItem("state"))??{};o.chains.some(y=>y.id===S.chainId)?d=S.chainId:d=(c=o.chains[0])==null?void 0:c.id}if(!d)throw new Error("No chains found on connector.");const p=await this.isChainsStale();if(u.session&&p&&await u.disconnect(),!u.session||p){const S=o.chains.filter(k=>k.id!==d).map(k=>k.id);await u.connect({optionalChains:[d,...S],..."pairingTopic"in a?{pairingTopic:a.pairingTopic}:{}}),this.setRequestedChainsIds(o.chains.map(k=>k.id))}const g=(await u.enable()).map(S=>lr(S)),b=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:g,chainId:b}}catch(u){throw/(user rejected|connection request reset)/i.test(u==null?void 0:u.message)?new Tt(u):u}},async disconnect(){const s=await this.getProvider();try{await(s==null?void 0:s.disconnect())}catch(a){if(!/No matching key/i.test(a.message))throw a}finally{s==null||s.removeListener("accountsChanged",this.onAccountsChanged.bind(this)),s==null||s.removeListener("chainChanged",this.onChainChanged),s==null||s.removeListener("disconnect",this.onDisconnect.bind(this)),s==null||s.removeListener("session_delete",this.onSessionDelete.bind(this)),s==null||s.on("connect",this.onConnect.bind(this)),this.setRequestedChainsIds([])}},async getAccounts(){return(await this.getProvider()).accounts.map(a=>lr(a))},async getProvider({chainId:s}={}){var l;async function a(){const c=o.chains.map(d=>d.id);if(!c.length)return;const{EthereumProvider:u}=await Mi(()=>import("./index.es-_1whrglJ.js"),__vite__mapDeps([2,1]));return await u.init({...t,disableProviderPing:!0,optionalChains:c,projectId:t.projectId,rpcMap:Object.fromEntries(o.chains.map(d=>[d.id,d.rpcUrls.default.http[0]])),showQrModal:t.showQrModal??!0})}return n||(r||(r=a()),n=await r,n==null||n.events.setMaxListeners(1/0)),s&&await((l=this.switchChain)==null?void 0:l.call(this,{chainId:s})),n},async getChainId(){return(await this.getProvider()).chainId},async isAuthorized(){try{const[s,a]=await Promise.all([this.getAccounts(),this.getProvider()]);return s.length?await this.isChainsStale()&&a.session?(await a.disconnect().catch(()=>{}),!1):!0:!1}catch{return!1}},async switchChain({chainId:s}){var l;const a=o.chains.find(c=>c.id===s);if(!a)throw new Fn(new Vl);try{const c=await this.getProvider(),u=this.getNamespaceChainsIds(),d=this.getNamespaceMethods();if(!u.includes(s)&&d.includes("wallet_addEthereumChain")){await c.request({method:"wallet_addEthereumChain",params:[{chainId:Je(a.id),blockExplorerUrls:[(l=a.blockExplorers)==null?void 0:l.default.url],chainName:a.name,nativeCurrency:a.nativeCurrency,rpcUrls:[...a.rpcUrls.default.http]}]});const g=await this.getRequestedChainsIds();this.setRequestedChainsIds([...g,s])}return await c.request({method:"wallet_switchEthereumChain",params:[{chainId:Je(s)}]}),a}catch(c){const u=typeof c=="string"?c:c==null?void 0:c.message;throw/user rejected request/i.test(u)?new Tt(c):new Fn(c)}},onAccountsChanged(s){s.length===0?this.onDisconnect():o.emitter.emit("change",{accounts:s.map(a=>lr(a))})},onChainChanged(s){const a=Number(s);o.emitter.emit("change",{chainId:a})},async onConnect(s){const a=Number(s.chainId),l=await this.getAccounts();o.emitter.emit("connect",{accounts:l,chainId:a})},async onDisconnect(s){this.setRequestedChainsIds([]),o.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(s){o.emitter.emit("message",{type:"display_uri",data:s})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){var a,l,c;return n?((c=(l=(a=n.session)==null?void 0:a.namespaces[i])==null?void 0:l.chains)==null?void 0:c.map(u=>parseInt(u.split(":")[1]||"")))??[]:[]},getNamespaceMethods(){var a,l;return n?((l=(a=n.session)==null?void 0:a.namespaces[i])==null?void 0:l.methods)??[]:[]},async getRequestedChainsIds(){var s;return await((s=o.storage)==null?void 0:s.getItem(this.requestedChainsStorageKey))??[]},async isChainsStale(){if(this.getNamespaceMethods().includes("wallet_addEthereumChain")||!e)return!1;const a=o.chains.map(u=>u.id),l=this.getNamespaceChainsIds();if(l.length&&!l.some(u=>a.includes(u)))return!1;const c=await this.getRequestedChainsIds();return!a.every(u=>c.includes(u))},async setRequestedChainsIds(s){var a;await((a=o.storage)==null?void 0:a.setItem(this.requestedChainsStorageKey,s))},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}})}function hD(t){return e=>({id:Ee.EMAIL_CONNECTOR_ID,name:"Web3Modal Email",type:"w3mEmail",async connect(n={}){const r=await this.getProvider(),i=ct.getPreferredAccountType(),[{address:o,chainId:s}]=await Promise.all([r.connect({chainId:n.chainId,preferredAccountType:i}),r.getSmartAccountEnabledNetworks()]);return{accounts:[o],account:o,chainId:s,chain:{id:s,unsuported:!1}}},async disconnect(){await(await this.getProvider()).disconnect()},async getAccounts(){const n=await this.getProvider(),r=ct.getPreferredAccountType(),{address:i}=await n.connect({preferredAccountType:r});return e.emitter.emit("change",{accounts:[i]}),[i]},async getProvider(){return this.provider||(this.provider=new zM(t.options.projectId)),Promise.resolve(this.provider)},async getChainId(){const n=await this.getProvider(),{chainId:r}=await n.getChainId();return r},async isAuthorized(){const n=await this.getProvider(),{isConnected:r}=await n.isConnected();return r},async switchChain({chainId:n}){try{const r=e.chains.find(o=>o.id===n);if(!r)throw new Fn(new Error("chain not found on connector."));return await(await this.getProvider()).switchNetwork(n),e.emitter.emit("change",{chainId:h1(n)}),r}catch(r){throw r instanceof Error?new Fn(r):r}},onAccountsChanged(n){n.length===0?this.onDisconnect():e.emitter.emit("change",{accounts:n.map(lr)})},onChainChanged(n){const r=h1(n);e.emitter.emit("change",{chainId:r})},async onConnect(n){const r=h1(n.chainId),i=await this.getAccounts();e.emitter.emit("connect",{accounts:i,chainId:r})},async onDisconnect(n){await(await this.getProvider()).disconnect()}})}function mD({projectId:t,chains:e,metadata:n,enableInjected:r,enableCoinbase:i,enableEmail:o,enableWalletConnect:s,enableEIP6963:a,...l}){const c=[],u=e.map(p=>[p.id,dD({chainId:p.id,projectId:t})]),d=Object.fromEntries(u);return s!==!1&&c.push(J2({projectId:t,metadata:n,showQrModal:!1})),r!==!1&&c.push(Jp({shimDisconnect:!0})),i!==!1&&c.push(Q2({appName:(n==null?void 0:n.name)??"Unknown",appLogoUrl:(n==null?void 0:n.icons[0])??"Unknown",enableMobileWalletLink:!0})),o===!0&&c.push(hD({chains:[...e],options:{projectId:t}})),iT({chains:e,multiInjectedProviderDiscovery:a!==!1,transports:d,...l,connectors:c})}const gD=[q6],v9="36e97c0201af2f60e9592935a92b036a",wD={name:"Revo Withdrawal Dapp",description:"A dapp for withdrawing Revo assets",url:"https://revo.market",icons:["/revo-logo.png"]},b9=mD({chains:gD,projectId:v9,metadata:wD}),yD=new FT;pD({wagmiConfig:b9,projectId:v9,defaultChain:q6});W1.createRoot(document.getElementById("root")).render(Oe.jsx(F9.StrictMode,{children:Oe.jsx(xT,{config:b9,children:Oe.jsx(ZT,{client:yD,children:Oe.jsx(tk,{})})})}));export{de as A,ne as B,Be as C,Q8 as D,ye as E,hu as H,fr as I,De as M,_s as N,Ce as O,g2 as R,jt as S,Mi as _,K6 as a,Uo as b,a6 as c,TE as d,Gs as e,i_ as f,Ow as g,$a as h,Kt as i,Jd as j,bD as k,me as l,gr as m,Q as n,q as o,an as p,G as q,ql as r,pr as s,Fe as t,X as u,K as v,pf as w,v as x,Bg as y,HS as z}; diff --git a/assets/index-BW-H86H5.css b/assets/index-BW-H86H5.css new file mode 100644 index 0000000..17f4f8a --- /dev/null +++ b/assets/index-BW-H86H5.css @@ -0,0 +1 @@ +@import"https://fonts.googleapis.com/css2?family=Avenir+Next:wght@400;500;600;700&family=Fira+Code:wght@400;700&family=Fira+Mono:wght@400;700&family=Manrope:wght@400;700&family=Roboto+Mono:wght@400;700&display=swap";._main_ewogh_1{display:grid;place-items:center;height:100%;background:linear-gradient(to bottom,var(--color-bg),transparent,var(--color-bg)),radial-gradient(circle,transparent 0%,var(--color-bg) 70%)}._wrapper_ewogh_14{position:relative;border:1px solid var(--color-primary);border-radius:var(--rounded-md);background:hsl(var(--h),1%,10%);max-width:clamp(20rem,90%,40rem);box-shadow:var(--shadow-lg)}._wrapper_ewogh_14:after{position:absolute;content:"";top:0;left:0;right:0;z-index:-1;height:100%;width:100%;filter:blur(100px);background:linear-gradient(95deg,#7baff3,#3f8ef6,#0b2c56,#4e70d0);background-size:200% 200%;animation:_animateGlow_ewogh_1 5s linear infinite}._content_ewogh_38{margin-top:1.5rem}._footer_ewogh_42{display:flex;justify-content:center;align-items:center;padding:.5rem;background-color:hsla(var(--h),var(--s),22%,.5);border-top:1px solid hsl(var(--h),var(--s),20%);border-radius:0 0 var(--rounded-md) var(--rounded-md);font-size:.875rem;white-space:pre;color:var(--color-grey-700)}._footer_ewogh_42 svg{margin-right:.25rem}._footer_ewogh_42 a{color:inherit;text-decoration:none;text-underline-offset:.125rem}._footer_ewogh_42 a:hover{color:var(--color-grey-500)}._footer_ewogh_42 svg:has(+a:hover){color:var(--color-grey-500)!important}._container_ewogh_73{padding:2rem 2.25rem}._wrapper_ewogh_14 li{color:var(--color-grey-400);line-height:1.75}._wrapper_ewogh_14 li:not(:first-child){margin-top:1rem}._main_ewogh_1 h1{font-size:1.75rem;font-weight:600}span._button_ewogh_91{position:relative;display:inline-flex;vertical-align:bottom;align-items:center;justify-content:center;gap:.375rem;padding:.375rem .675rem;margin:0 .25rem;font-size:.875rem;border-radius:var(--rounded-sm);background-color:hsl(var(--h),var(--s),20%);border:1px solid hsl(var(--h),var(--s),22%);color:inherit;line-height:1;box-shadow:var(--shadow-md);cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none;transition:all .1s}._highlight_ewogh_112{position:relative}._highlightSelected_ewogh_116{z-index:5}._highlightSelected_ewogh_116:after{opacity:.5!important}._highlight_ewogh_112:after{opacity:0;transition:opacity .2s;position:absolute;content:"";top:0;left:0;right:0;z-index:-1;height:100%;width:100%;filter:blur(15px);background:linear-gradient(95deg,#7baff3,#3f8ef6,#0b2c56,#4e70d0);background-size:200% 200%;animation:_animateGlow_ewogh_1 5s linear infinite}span._button_ewogh_91:hover{background-color:hsl(var(--h),var(--s),30%);border:1px solid hsl(var(--h),var(--s),32%);color:var(--color-grey-100)}._header_ewogh_150{display:flex;justify-content:space-between;align-items:center;padding:1rem 1rem 1.75rem}._header_ewogh_150 ._buttons_ewogh_158{display:flex;align-items:center;gap:.5rem}._backdrop_ewogh_164{position:absolute;top:0;left:0;right:0;bottom:0;z-index:4;pointer-events:none;background:#0a0a0abf;transition:opacity .2s}@keyframes _animateGlow_ewogh_1{0%{background-position:0% 50%}to{background-position:200% 50%}}:root{--font-base: "Avenir Next", "Manrope", sans-serif;--font-mono: "Fira Code", "Fira Mono", "Roboto Mono", monospace;--h: 180;--s: 2%;--l: 20%;--color-bg: hsl(0, 0%, 4%);--color-grey-100: #fff;--color-grey-300: #e4e7e7;--color-grey-400: #c9cfcf;--color-grey-500: #9ea9a9;--color-grey-700: #7a8484;--color-grey-900: #3b4040;--color-grey-950: #272a2a;--color-primary: hsl(var(--h), var(--s), var(--l));--shadow-md: rgba(0, 0, 0, .1) 0px 20px 25px -5px, rgba(0, 0, 0, .04) 0px 10px 10px -5px;--shadow-lg: rgba(0, 0, 0, .25) 0px 25px 50px -12px;--rounded-sm: .5rem;--rounded-md: 1.5rem}*{margin:0;padding:0;box-sizing:border-box}html{height:100%}html,body,#root{min-height:100%!important;height:100%}body{min-height:100%;font-family:var(--font-base);background-color:var(--color-bg);color:var(--color-grey-100)}pre,code{font-family:var(--font-mono)}code{background-color:var(--color-grey-950);padding:.25rem .5rem;margin:0 .25rem;border-radius:.4rem;font-size:.875rem}code:before,code:after{content:"`"}ul,li{list-style-position:inside}header{position:fixed;width:100%}*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.flex{display:flex}.flex-row{flex-direction:row}.flex-nowrap{flex-wrap:nowrap}.justify-center{justify-content:center}.gap-4{gap:1rem}.btn{display:flex;width:8rem;align-items:center;justify-content:center;border-radius:.75rem;--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity));padding:.5rem 1rem;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.btn:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity))}.btn:last-child{margin-right:0}.btn-disabled{display:flex;width:8rem;align-items:center;justify-content:center;border-radius:.75rem;--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity));padding:.5rem 1rem;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.btn-disabled:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity))}.btn-disabled:last-child{margin-right:0}.btn-disabled,.btn-disabled:hover{--tw-bg-opacity: 1;background-color:rgb(96 165 250 / var(--tw-bg-opacity))} diff --git a/assets/index-Bw6nSNtr.js b/assets/index-Bw6nSNtr.js new file mode 100644 index 0000000..1a2c828 --- /dev/null +++ b/assets/index-Bw6nSNtr.js @@ -0,0 +1,7 @@ +import{z as La,y as J,k as gn,D as Fn,j as dd}from"./index-BCdecgwI.js";import{r as jo,e as Di}from"./___vite-browser-external_commonjs-proxy-D0iV-SFw.js";function fd(e,t){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const pd=Object.freeze(Object.defineProperty({__proto__:null,EventEmitter:La,default:La},Symbol.toStringTag,{value:"Module"}));var Ho={},On={},Fi={};Object.defineProperty(Fi,"__esModule",{value:!0});Fi.walletLogo=void 0;const gd=(e,t)=>{let r;switch(e){case"standard":return r=t,`data:image/svg+xml,%3Csvg width='${t}' 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=t,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' 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*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' 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*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' 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*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' 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*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' 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=t,`data:image/svg+xml,%3Csvg width='${t}' 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 `}};Fi.walletLogo=gd;var ji={};Object.defineProperty(ji,"__esModule",{value:!0});ji.LINK_API_URL=void 0;ji.LINK_API_URL="https://www.walletlink.org";var z={},Uo={exports:{}};Uo.exports;(function(e){(function(t,r){function n(v,a){if(!v)throw new Error(a||"Assertion failed")}function i(v,a){v.super_=a;var d=function(){};d.prototype=a.prototype,v.prototype=new d,v.prototype.constructor=v}function s(v,a,d){if(s.isBN(v))return v;this.negative=0,this.words=null,this.length=0,this.red=null,v!==null&&((a==="le"||a==="be")&&(d=a,a=10),this._init(v||0,a||10,d||"be"))}typeof t=="object"?t.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=jo.Buffer}catch{}s.isBN=function(a){return a instanceof s?!0:a!==null&&typeof a=="object"&&a.constructor.wordSize===s.wordSize&&Array.isArray(a.words)},s.max=function(a,d){return a.cmp(d)>0?a:d},s.min=function(a,d){return a.cmp(d)<0?a:d},s.prototype._init=function(a,d,g){if(typeof a=="number")return this._initNumber(a,d,g);if(typeof a=="object")return this._initArray(a,d,g);d==="hex"&&(d=16),n(d===(d|0)&&d>=2&&d<=36),a=a.toString().replace(/\s+/g,"");var m=0;a[0]==="-"&&(m++,this.negative=1),m=0;m-=3)C=a[m]|a[m-1]<<8|a[m-2]<<16,this.words[y]|=C<>>26-A&67108863,A+=24,A>=26&&(A-=26,y++);else if(g==="le")for(m=0,y=0;m>>26-A&67108863,A+=24,A>=26&&(A-=26,y++);return this._strip()};function c(v,a){var d=v.charCodeAt(a);if(d>=48&&d<=57)return d-48;if(d>=65&&d<=70)return d-55;if(d>=97&&d<=102)return d-87;n(!1,"Invalid character in "+v)}function l(v,a,d){var g=c(v,d);return d-1>=a&&(g|=c(v,d-1)<<4),g}s.prototype._parseHex=function(a,d,g){this.length=Math.ceil((a.length-d)/6),this.words=new Array(this.length);for(var m=0;m=d;m-=2)A=l(a,d,m)<=18?(y-=18,C+=1,this.words[C]|=A>>>26):y+=8;else{var b=a.length-d;for(m=b%2===0?d+1:d;m=18?(y-=18,C+=1,this.words[C]|=A>>>26):y+=8}this._strip()};function u(v,a,d,g){for(var m=0,y=0,C=Math.min(v.length,d),A=a;A=49?y=b-49+10:b>=17?y=b-17+10:y=b,n(b>=0&&y1&&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 _=["","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"],R=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],x=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(a,d){a=a||10,d=d|0||1;var g;if(a===16||a==="hex"){g="";for(var m=0,y=0,C=0;C>>24-m&16777215,m+=2,m>=26&&(m-=26,C--),y!==0||C!==this.length-1?g=_[6-b.length]+b+g:g=b+g}for(y!==0&&(g=y.toString(16)+g);g.length%d!==0;)g="0"+g;return this.negative!==0&&(g="-"+g),g}if(a===(a|0)&&a>=2&&a<=36){var h=R[a],S=x[a];g="";var W=this.clone();for(W.negative=0;!W.isZero();){var q=W.modrn(S).toString(a);W=W.idivn(S),W.isZero()?g=q+g:g=_[h-q.length]+q+g}for(this.isZero()&&(g="0"+g);g.length%d!==0;)g="0"+g;return this.negative!==0&&(g="-"+g),g}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var a=this.words[0];return this.length===2?a+=this.words[1]*67108864:this.length===3&&this.words[2]===1?a+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-a:a},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(a,d){return this.toArrayLike(o,a,d)}),s.prototype.toArray=function(a,d){return this.toArrayLike(Array,a,d)};var P=function(a,d){return a.allocUnsafe?a.allocUnsafe(d):new a(d)};s.prototype.toArrayLike=function(a,d,g){this._strip();var m=this.byteLength(),y=g||Math.max(1,m);n(m<=y,"byte array longer than desired length"),n(y>0,"Requested array length <= 0");var C=P(a,y),A=d==="le"?"LE":"BE";return this["_toArrayLike"+A](C,m),C},s.prototype._toArrayLikeLE=function(a,d){for(var g=0,m=0,y=0,C=0;y>8&255),g>16&255),C===6?(g>24&255),m=0,C=0):(m=A>>>24,C+=2)}if(g=0&&(a[g--]=A>>8&255),g>=0&&(a[g--]=A>>16&255),C===6?(g>=0&&(a[g--]=A>>24&255),m=0,C=0):(m=A>>>24,C+=2)}if(g>=0)for(a[g--]=m;g>=0;)a[g--]=0},Math.clz32?s.prototype._countBits=function(a){return 32-Math.clz32(a)}:s.prototype._countBits=function(a){var d=a,g=0;return d>=4096&&(g+=13,d>>>=13),d>=64&&(g+=7,d>>>=7),d>=8&&(g+=4,d>>>=4),d>=2&&(g+=2,d>>>=2),g+d},s.prototype._zeroBits=function(a){if(a===0)return 26;var d=a,g=0;return d&8191||(g+=13,d>>>=13),d&127||(g+=7,d>>>=7),d&15||(g+=4,d>>>=4),d&3||(g+=2,d>>>=2),d&1||g++,g},s.prototype.bitLength=function(){var a=this.words[this.length-1],d=this._countBits(a);return(this.length-1)*26+d};function L(v){for(var a=new Array(v.bitLength()),d=0;d>>m&1}return a}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var a=0,d=0;da.length?this.clone().ior(a):a.clone().ior(this)},s.prototype.uor=function(a){return this.length>a.length?this.clone().iuor(a):a.clone().iuor(this)},s.prototype.iuand=function(a){var d;this.length>a.length?d=a:d=this;for(var g=0;ga.length?this.clone().iand(a):a.clone().iand(this)},s.prototype.uand=function(a){return this.length>a.length?this.clone().iuand(a):a.clone().iuand(this)},s.prototype.iuxor=function(a){var d,g;this.length>a.length?(d=this,g=a):(d=a,g=this);for(var m=0;ma.length?this.clone().ixor(a):a.clone().ixor(this)},s.prototype.uxor=function(a){return this.length>a.length?this.clone().iuxor(a):a.clone().iuxor(this)},s.prototype.inotn=function(a){n(typeof a=="number"&&a>=0);var d=Math.ceil(a/26)|0,g=a%26;this._expand(d),g>0&&d--;for(var m=0;m0&&(this.words[m]=~this.words[m]&67108863>>26-g),this._strip()},s.prototype.notn=function(a){return this.clone().inotn(a)},s.prototype.setn=function(a,d){n(typeof a=="number"&&a>=0);var g=a/26|0,m=a%26;return this._expand(g+1),d?this.words[g]=this.words[g]|1<a.length?(g=this,m=a):(g=a,m=this);for(var y=0,C=0;C>>26;for(;y!==0&&C>>26;if(this.length=g.length,y!==0)this.words[this.length]=y,this.length++;else if(g!==this)for(;Ca.length?this.clone().iadd(a):a.clone().iadd(this)},s.prototype.isub=function(a){if(a.negative!==0){a.negative=0;var d=this.iadd(a);return a.negative=1,d._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(a),this.negative=1,this._normSign();var g=this.cmp(a);if(g===0)return this.negative=0,this.length=1,this.words[0]=0,this;var m,y;g>0?(m=this,y=a):(m=a,y=this);for(var C=0,A=0;A>26,this.words[A]=d&67108863;for(;C!==0&&A>26,this.words[A]=d&67108863;if(C===0&&A>>26,W=b&67108863,q=Math.min(h,a.length-1),I=Math.max(0,h-v.length+1);I<=q;I++){var T=h-I|0;m=v.words[T]|0,y=a.words[I]|0,C=m*y+W,S+=C/67108864|0,W=C&67108863}d.words[h]=W|0,b=S|0}return b!==0?d.words[h]=b|0:d.length--,d._strip()}var k=function(a,d,g){var m=a.words,y=d.words,C=g.words,A=0,b,h,S,W=m[0]|0,q=W&8191,I=W>>>13,T=m[1]|0,B=T&8191,U=T>>>13,te=m[2]|0,w=te&8191,E=te>>>13,F=m[3]|0,j=F&8191,K=F>>>13,ee=m[4]|0,Z=ee&8191,le=ee>>>13,Mt=m[5]|0,ge=Mt&8191,_e=Mt>>>13,Vt=m[6]|0,de=Vt&8191,fe=Vt>>>13,Pt=m[7]|0,he=Pt&8191,ue=Pt>>>13,ct=m[8]|0,me=ct&8191,ve=ct>>>13,Or=m[9]|0,be=Or&8191,ye=Or>>>13,Pr=y[0]|0,we=Pr&8191,Ee=Pr>>>13,$r=y[1]|0,Se=$r&8191,Re=$r>>>13,Br=y[2]|0,Me=Br&8191,Ce=Br>>>13,Dr=y[3]|0,ke=Dr&8191,Ie=Dr>>>13,Fr=y[4]|0,xe=Fr&8191,Ae=Fr>>>13,jr=y[5]|0,Te=jr&8191,Ne=jr>>>13,Hr=y[6]|0,Le=Hr&8191,Oe=Hr>>>13,Ur=y[7]|0,Pe=Ur&8191,$e=Ur>>>13,Wr=y[8]|0,Be=Wr&8191,De=Wr>>>13,Vr=y[9]|0,Fe=Vr&8191,je=Vr>>>13;g.negative=a.negative^d.negative,g.length=19,b=Math.imul(q,we),h=Math.imul(q,Ee),h=h+Math.imul(I,we)|0,S=Math.imul(I,Ee);var Qt=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,b=Math.imul(B,we),h=Math.imul(B,Ee),h=h+Math.imul(U,we)|0,S=Math.imul(U,Ee),b=b+Math.imul(q,Se)|0,h=h+Math.imul(q,Re)|0,h=h+Math.imul(I,Se)|0,S=S+Math.imul(I,Re)|0;var Yt=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,b=Math.imul(w,we),h=Math.imul(w,Ee),h=h+Math.imul(E,we)|0,S=Math.imul(E,Ee),b=b+Math.imul(B,Se)|0,h=h+Math.imul(B,Re)|0,h=h+Math.imul(U,Se)|0,S=S+Math.imul(U,Re)|0,b=b+Math.imul(q,Me)|0,h=h+Math.imul(q,Ce)|0,h=h+Math.imul(I,Me)|0,S=S+Math.imul(I,Ce)|0;var Xt=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,b=Math.imul(j,we),h=Math.imul(j,Ee),h=h+Math.imul(K,we)|0,S=Math.imul(K,Ee),b=b+Math.imul(w,Se)|0,h=h+Math.imul(w,Re)|0,h=h+Math.imul(E,Se)|0,S=S+Math.imul(E,Re)|0,b=b+Math.imul(B,Me)|0,h=h+Math.imul(B,Ce)|0,h=h+Math.imul(U,Me)|0,S=S+Math.imul(U,Ce)|0,b=b+Math.imul(q,ke)|0,h=h+Math.imul(q,Ie)|0,h=h+Math.imul(I,ke)|0,S=S+Math.imul(I,Ie)|0;var er=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(er>>>26)|0,er&=67108863,b=Math.imul(Z,we),h=Math.imul(Z,Ee),h=h+Math.imul(le,we)|0,S=Math.imul(le,Ee),b=b+Math.imul(j,Se)|0,h=h+Math.imul(j,Re)|0,h=h+Math.imul(K,Se)|0,S=S+Math.imul(K,Re)|0,b=b+Math.imul(w,Me)|0,h=h+Math.imul(w,Ce)|0,h=h+Math.imul(E,Me)|0,S=S+Math.imul(E,Ce)|0,b=b+Math.imul(B,ke)|0,h=h+Math.imul(B,Ie)|0,h=h+Math.imul(U,ke)|0,S=S+Math.imul(U,Ie)|0,b=b+Math.imul(q,xe)|0,h=h+Math.imul(q,Ae)|0,h=h+Math.imul(I,xe)|0,S=S+Math.imul(I,Ae)|0;var tr=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(tr>>>26)|0,tr&=67108863,b=Math.imul(ge,we),h=Math.imul(ge,Ee),h=h+Math.imul(_e,we)|0,S=Math.imul(_e,Ee),b=b+Math.imul(Z,Se)|0,h=h+Math.imul(Z,Re)|0,h=h+Math.imul(le,Se)|0,S=S+Math.imul(le,Re)|0,b=b+Math.imul(j,Me)|0,h=h+Math.imul(j,Ce)|0,h=h+Math.imul(K,Me)|0,S=S+Math.imul(K,Ce)|0,b=b+Math.imul(w,ke)|0,h=h+Math.imul(w,Ie)|0,h=h+Math.imul(E,ke)|0,S=S+Math.imul(E,Ie)|0,b=b+Math.imul(B,xe)|0,h=h+Math.imul(B,Ae)|0,h=h+Math.imul(U,xe)|0,S=S+Math.imul(U,Ae)|0,b=b+Math.imul(q,Te)|0,h=h+Math.imul(q,Ne)|0,h=h+Math.imul(I,Te)|0,S=S+Math.imul(I,Ne)|0;var rr=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(rr>>>26)|0,rr&=67108863,b=Math.imul(de,we),h=Math.imul(de,Ee),h=h+Math.imul(fe,we)|0,S=Math.imul(fe,Ee),b=b+Math.imul(ge,Se)|0,h=h+Math.imul(ge,Re)|0,h=h+Math.imul(_e,Se)|0,S=S+Math.imul(_e,Re)|0,b=b+Math.imul(Z,Me)|0,h=h+Math.imul(Z,Ce)|0,h=h+Math.imul(le,Me)|0,S=S+Math.imul(le,Ce)|0,b=b+Math.imul(j,ke)|0,h=h+Math.imul(j,Ie)|0,h=h+Math.imul(K,ke)|0,S=S+Math.imul(K,Ie)|0,b=b+Math.imul(w,xe)|0,h=h+Math.imul(w,Ae)|0,h=h+Math.imul(E,xe)|0,S=S+Math.imul(E,Ae)|0,b=b+Math.imul(B,Te)|0,h=h+Math.imul(B,Ne)|0,h=h+Math.imul(U,Te)|0,S=S+Math.imul(U,Ne)|0,b=b+Math.imul(q,Le)|0,h=h+Math.imul(q,Oe)|0,h=h+Math.imul(I,Le)|0,S=S+Math.imul(I,Oe)|0;var nr=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(nr>>>26)|0,nr&=67108863,b=Math.imul(he,we),h=Math.imul(he,Ee),h=h+Math.imul(ue,we)|0,S=Math.imul(ue,Ee),b=b+Math.imul(de,Se)|0,h=h+Math.imul(de,Re)|0,h=h+Math.imul(fe,Se)|0,S=S+Math.imul(fe,Re)|0,b=b+Math.imul(ge,Me)|0,h=h+Math.imul(ge,Ce)|0,h=h+Math.imul(_e,Me)|0,S=S+Math.imul(_e,Ce)|0,b=b+Math.imul(Z,ke)|0,h=h+Math.imul(Z,Ie)|0,h=h+Math.imul(le,ke)|0,S=S+Math.imul(le,Ie)|0,b=b+Math.imul(j,xe)|0,h=h+Math.imul(j,Ae)|0,h=h+Math.imul(K,xe)|0,S=S+Math.imul(K,Ae)|0,b=b+Math.imul(w,Te)|0,h=h+Math.imul(w,Ne)|0,h=h+Math.imul(E,Te)|0,S=S+Math.imul(E,Ne)|0,b=b+Math.imul(B,Le)|0,h=h+Math.imul(B,Oe)|0,h=h+Math.imul(U,Le)|0,S=S+Math.imul(U,Oe)|0,b=b+Math.imul(q,Pe)|0,h=h+Math.imul(q,$e)|0,h=h+Math.imul(I,Pe)|0,S=S+Math.imul(I,$e)|0;var ir=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(ir>>>26)|0,ir&=67108863,b=Math.imul(me,we),h=Math.imul(me,Ee),h=h+Math.imul(ve,we)|0,S=Math.imul(ve,Ee),b=b+Math.imul(he,Se)|0,h=h+Math.imul(he,Re)|0,h=h+Math.imul(ue,Se)|0,S=S+Math.imul(ue,Re)|0,b=b+Math.imul(de,Me)|0,h=h+Math.imul(de,Ce)|0,h=h+Math.imul(fe,Me)|0,S=S+Math.imul(fe,Ce)|0,b=b+Math.imul(ge,ke)|0,h=h+Math.imul(ge,Ie)|0,h=h+Math.imul(_e,ke)|0,S=S+Math.imul(_e,Ie)|0,b=b+Math.imul(Z,xe)|0,h=h+Math.imul(Z,Ae)|0,h=h+Math.imul(le,xe)|0,S=S+Math.imul(le,Ae)|0,b=b+Math.imul(j,Te)|0,h=h+Math.imul(j,Ne)|0,h=h+Math.imul(K,Te)|0,S=S+Math.imul(K,Ne)|0,b=b+Math.imul(w,Le)|0,h=h+Math.imul(w,Oe)|0,h=h+Math.imul(E,Le)|0,S=S+Math.imul(E,Oe)|0,b=b+Math.imul(B,Pe)|0,h=h+Math.imul(B,$e)|0,h=h+Math.imul(U,Pe)|0,S=S+Math.imul(U,$e)|0,b=b+Math.imul(q,Be)|0,h=h+Math.imul(q,De)|0,h=h+Math.imul(I,Be)|0,S=S+Math.imul(I,De)|0;var sr=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(sr>>>26)|0,sr&=67108863,b=Math.imul(be,we),h=Math.imul(be,Ee),h=h+Math.imul(ye,we)|0,S=Math.imul(ye,Ee),b=b+Math.imul(me,Se)|0,h=h+Math.imul(me,Re)|0,h=h+Math.imul(ve,Se)|0,S=S+Math.imul(ve,Re)|0,b=b+Math.imul(he,Me)|0,h=h+Math.imul(he,Ce)|0,h=h+Math.imul(ue,Me)|0,S=S+Math.imul(ue,Ce)|0,b=b+Math.imul(de,ke)|0,h=h+Math.imul(de,Ie)|0,h=h+Math.imul(fe,ke)|0,S=S+Math.imul(fe,Ie)|0,b=b+Math.imul(ge,xe)|0,h=h+Math.imul(ge,Ae)|0,h=h+Math.imul(_e,xe)|0,S=S+Math.imul(_e,Ae)|0,b=b+Math.imul(Z,Te)|0,h=h+Math.imul(Z,Ne)|0,h=h+Math.imul(le,Te)|0,S=S+Math.imul(le,Ne)|0,b=b+Math.imul(j,Le)|0,h=h+Math.imul(j,Oe)|0,h=h+Math.imul(K,Le)|0,S=S+Math.imul(K,Oe)|0,b=b+Math.imul(w,Pe)|0,h=h+Math.imul(w,$e)|0,h=h+Math.imul(E,Pe)|0,S=S+Math.imul(E,$e)|0,b=b+Math.imul(B,Be)|0,h=h+Math.imul(B,De)|0,h=h+Math.imul(U,Be)|0,S=S+Math.imul(U,De)|0,b=b+Math.imul(q,Fe)|0,h=h+Math.imul(q,je)|0,h=h+Math.imul(I,Fe)|0,S=S+Math.imul(I,je)|0;var or=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(or>>>26)|0,or&=67108863,b=Math.imul(be,Se),h=Math.imul(be,Re),h=h+Math.imul(ye,Se)|0,S=Math.imul(ye,Re),b=b+Math.imul(me,Me)|0,h=h+Math.imul(me,Ce)|0,h=h+Math.imul(ve,Me)|0,S=S+Math.imul(ve,Ce)|0,b=b+Math.imul(he,ke)|0,h=h+Math.imul(he,Ie)|0,h=h+Math.imul(ue,ke)|0,S=S+Math.imul(ue,Ie)|0,b=b+Math.imul(de,xe)|0,h=h+Math.imul(de,Ae)|0,h=h+Math.imul(fe,xe)|0,S=S+Math.imul(fe,Ae)|0,b=b+Math.imul(ge,Te)|0,h=h+Math.imul(ge,Ne)|0,h=h+Math.imul(_e,Te)|0,S=S+Math.imul(_e,Ne)|0,b=b+Math.imul(Z,Le)|0,h=h+Math.imul(Z,Oe)|0,h=h+Math.imul(le,Le)|0,S=S+Math.imul(le,Oe)|0,b=b+Math.imul(j,Pe)|0,h=h+Math.imul(j,$e)|0,h=h+Math.imul(K,Pe)|0,S=S+Math.imul(K,$e)|0,b=b+Math.imul(w,Be)|0,h=h+Math.imul(w,De)|0,h=h+Math.imul(E,Be)|0,S=S+Math.imul(E,De)|0,b=b+Math.imul(B,Fe)|0,h=h+Math.imul(B,je)|0,h=h+Math.imul(U,Fe)|0,S=S+Math.imul(U,je)|0;var ar=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(ar>>>26)|0,ar&=67108863,b=Math.imul(be,Me),h=Math.imul(be,Ce),h=h+Math.imul(ye,Me)|0,S=Math.imul(ye,Ce),b=b+Math.imul(me,ke)|0,h=h+Math.imul(me,Ie)|0,h=h+Math.imul(ve,ke)|0,S=S+Math.imul(ve,Ie)|0,b=b+Math.imul(he,xe)|0,h=h+Math.imul(he,Ae)|0,h=h+Math.imul(ue,xe)|0,S=S+Math.imul(ue,Ae)|0,b=b+Math.imul(de,Te)|0,h=h+Math.imul(de,Ne)|0,h=h+Math.imul(fe,Te)|0,S=S+Math.imul(fe,Ne)|0,b=b+Math.imul(ge,Le)|0,h=h+Math.imul(ge,Oe)|0,h=h+Math.imul(_e,Le)|0,S=S+Math.imul(_e,Oe)|0,b=b+Math.imul(Z,Pe)|0,h=h+Math.imul(Z,$e)|0,h=h+Math.imul(le,Pe)|0,S=S+Math.imul(le,$e)|0,b=b+Math.imul(j,Be)|0,h=h+Math.imul(j,De)|0,h=h+Math.imul(K,Be)|0,S=S+Math.imul(K,De)|0,b=b+Math.imul(w,Fe)|0,h=h+Math.imul(w,je)|0,h=h+Math.imul(E,Fe)|0,S=S+Math.imul(E,je)|0;var cr=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(cr>>>26)|0,cr&=67108863,b=Math.imul(be,ke),h=Math.imul(be,Ie),h=h+Math.imul(ye,ke)|0,S=Math.imul(ye,Ie),b=b+Math.imul(me,xe)|0,h=h+Math.imul(me,Ae)|0,h=h+Math.imul(ve,xe)|0,S=S+Math.imul(ve,Ae)|0,b=b+Math.imul(he,Te)|0,h=h+Math.imul(he,Ne)|0,h=h+Math.imul(ue,Te)|0,S=S+Math.imul(ue,Ne)|0,b=b+Math.imul(de,Le)|0,h=h+Math.imul(de,Oe)|0,h=h+Math.imul(fe,Le)|0,S=S+Math.imul(fe,Oe)|0,b=b+Math.imul(ge,Pe)|0,h=h+Math.imul(ge,$e)|0,h=h+Math.imul(_e,Pe)|0,S=S+Math.imul(_e,$e)|0,b=b+Math.imul(Z,Be)|0,h=h+Math.imul(Z,De)|0,h=h+Math.imul(le,Be)|0,S=S+Math.imul(le,De)|0,b=b+Math.imul(j,Fe)|0,h=h+Math.imul(j,je)|0,h=h+Math.imul(K,Fe)|0,S=S+Math.imul(K,je)|0;var lr=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(lr>>>26)|0,lr&=67108863,b=Math.imul(be,xe),h=Math.imul(be,Ae),h=h+Math.imul(ye,xe)|0,S=Math.imul(ye,Ae),b=b+Math.imul(me,Te)|0,h=h+Math.imul(me,Ne)|0,h=h+Math.imul(ve,Te)|0,S=S+Math.imul(ve,Ne)|0,b=b+Math.imul(he,Le)|0,h=h+Math.imul(he,Oe)|0,h=h+Math.imul(ue,Le)|0,S=S+Math.imul(ue,Oe)|0,b=b+Math.imul(de,Pe)|0,h=h+Math.imul(de,$e)|0,h=h+Math.imul(fe,Pe)|0,S=S+Math.imul(fe,$e)|0,b=b+Math.imul(ge,Be)|0,h=h+Math.imul(ge,De)|0,h=h+Math.imul(_e,Be)|0,S=S+Math.imul(_e,De)|0,b=b+Math.imul(Z,Fe)|0,h=h+Math.imul(Z,je)|0,h=h+Math.imul(le,Fe)|0,S=S+Math.imul(le,je)|0;var ur=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(ur>>>26)|0,ur&=67108863,b=Math.imul(be,Te),h=Math.imul(be,Ne),h=h+Math.imul(ye,Te)|0,S=Math.imul(ye,Ne),b=b+Math.imul(me,Le)|0,h=h+Math.imul(me,Oe)|0,h=h+Math.imul(ve,Le)|0,S=S+Math.imul(ve,Oe)|0,b=b+Math.imul(he,Pe)|0,h=h+Math.imul(he,$e)|0,h=h+Math.imul(ue,Pe)|0,S=S+Math.imul(ue,$e)|0,b=b+Math.imul(de,Be)|0,h=h+Math.imul(de,De)|0,h=h+Math.imul(fe,Be)|0,S=S+Math.imul(fe,De)|0,b=b+Math.imul(ge,Fe)|0,h=h+Math.imul(ge,je)|0,h=h+Math.imul(_e,Fe)|0,S=S+Math.imul(_e,je)|0;var Bs=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(Bs>>>26)|0,Bs&=67108863,b=Math.imul(be,Le),h=Math.imul(be,Oe),h=h+Math.imul(ye,Le)|0,S=Math.imul(ye,Oe),b=b+Math.imul(me,Pe)|0,h=h+Math.imul(me,$e)|0,h=h+Math.imul(ve,Pe)|0,S=S+Math.imul(ve,$e)|0,b=b+Math.imul(he,Be)|0,h=h+Math.imul(he,De)|0,h=h+Math.imul(ue,Be)|0,S=S+Math.imul(ue,De)|0,b=b+Math.imul(de,Fe)|0,h=h+Math.imul(de,je)|0,h=h+Math.imul(fe,Fe)|0,S=S+Math.imul(fe,je)|0;var Ds=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(Ds>>>26)|0,Ds&=67108863,b=Math.imul(be,Pe),h=Math.imul(be,$e),h=h+Math.imul(ye,Pe)|0,S=Math.imul(ye,$e),b=b+Math.imul(me,Be)|0,h=h+Math.imul(me,De)|0,h=h+Math.imul(ve,Be)|0,S=S+Math.imul(ve,De)|0,b=b+Math.imul(he,Fe)|0,h=h+Math.imul(he,je)|0,h=h+Math.imul(ue,Fe)|0,S=S+Math.imul(ue,je)|0;var Fs=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(Fs>>>26)|0,Fs&=67108863,b=Math.imul(be,Be),h=Math.imul(be,De),h=h+Math.imul(ye,Be)|0,S=Math.imul(ye,De),b=b+Math.imul(me,Fe)|0,h=h+Math.imul(me,je)|0,h=h+Math.imul(ve,Fe)|0,S=S+Math.imul(ve,je)|0;var js=(A+b|0)+((h&8191)<<13)|0;A=(S+(h>>>13)|0)+(js>>>26)|0,js&=67108863,b=Math.imul(be,Fe),h=Math.imul(be,je),h=h+Math.imul(ye,Fe)|0,S=Math.imul(ye,je);var Hs=(A+b|0)+((h&8191)<<13)|0;return A=(S+(h>>>13)|0)+(Hs>>>26)|0,Hs&=67108863,C[0]=Qt,C[1]=Yt,C[2]=Xt,C[3]=er,C[4]=tr,C[5]=rr,C[6]=nr,C[7]=ir,C[8]=sr,C[9]=or,C[10]=ar,C[11]=cr,C[12]=lr,C[13]=ur,C[14]=Bs,C[15]=Ds,C[16]=Fs,C[17]=js,C[18]=Hs,A!==0&&(C[19]=A,g.length++),g};Math.imul||(k=M);function N(v,a,d){d.negative=a.negative^v.negative,d.length=v.length+a.length;for(var g=0,m=0,y=0;y>>26)|0,m+=C>>>26,C&=67108863}d.words[y]=A,g=C,C=m}return g!==0?d.words[y]=g:d.length--,d._strip()}function $(v,a,d){return N(v,a,d)}s.prototype.mulTo=function(a,d){var g,m=this.length+a.length;return this.length===10&&a.length===10?g=k(this,a,d):m<63?g=M(this,a,d):m<1024?g=N(this,a,d):g=$(this,a,d),g},s.prototype.mul=function(a){var d=new s(null);return d.words=new Array(this.length+a.length),this.mulTo(a,d)},s.prototype.mulf=function(a){var d=new s(null);return d.words=new Array(this.length+a.length),$(this,a,d)},s.prototype.imul=function(a){return this.clone().mulTo(a,this)},s.prototype.imuln=function(a){var d=a<0;d&&(a=-a),n(typeof a=="number"),n(a<67108864);for(var g=0,m=0;m>=26,g+=y/67108864|0,g+=C>>>26,this.words[m]=C&67108863}return g!==0&&(this.words[m]=g,this.length++),d?this.ineg():this},s.prototype.muln=function(a){return this.clone().imuln(a)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(a){var d=L(a);if(d.length===0)return new s(1);for(var g=this,m=0;m=0);var d=a%26,g=(a-d)/26,m=67108863>>>26-d<<26-d,y;if(d!==0){var C=0;for(y=0;y>>26-d}C&&(this.words[y]=C,this.length++)}if(g!==0){for(y=this.length-1;y>=0;y--)this.words[y+g]=this.words[y];for(y=0;y=0);var m;d?m=(d-d%26)/26:m=0;var y=a%26,C=Math.min((a-y)/26,this.length),A=67108863^67108863>>>y<C)for(this.length-=C,h=0;h=0&&(S!==0||h>=m);h--){var W=this.words[h]|0;this.words[h]=S<<26-y|W>>>y,S=W&A}return b&&S!==0&&(b.words[b.length++]=S),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(a,d,g){return n(this.negative===0),this.iushrn(a,d,g)},s.prototype.shln=function(a){return this.clone().ishln(a)},s.prototype.ushln=function(a){return this.clone().iushln(a)},s.prototype.shrn=function(a){return this.clone().ishrn(a)},s.prototype.ushrn=function(a){return this.clone().iushrn(a)},s.prototype.testn=function(a){n(typeof a=="number"&&a>=0);var d=a%26,g=(a-d)/26,m=1<=0);var d=a%26,g=(a-d)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=g)return this;if(d!==0&&g++,this.length=Math.min(g,this.length),d!==0){var m=67108863^67108863>>>d<=67108864;d++)this.words[d]-=67108864,d===this.length-1?this.words[d+1]=1:this.words[d+1]++;return this.length=Math.max(this.length,d+1),this},s.prototype.isubn=function(a){if(n(typeof a=="number"),n(a<67108864),a<0)return this.iaddn(-a);if(this.negative!==0)return this.negative=0,this.iaddn(a),this.negative=1,this;if(this.words[0]-=a,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var d=0;d>26)-(b/67108864|0),this.words[y+g]=C&67108863}for(;y>26,this.words[y+g]=C&67108863;if(A===0)return this._strip();for(n(A===-1),A=0,y=0;y>26,this.words[y]=C&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(a,d){var g=this.length-a.length,m=this.clone(),y=a,C=y.words[y.length-1]|0,A=this._countBits(C);g=26-A,g!==0&&(y=y.ushln(g),m.iushln(g),C=y.words[y.length-1]|0);var b=m.length-y.length,h;if(d!=="mod"){h=new s(null),h.length=b+1,h.words=new Array(h.length);for(var S=0;S=0;q--){var I=(m.words[y.length+q]|0)*67108864+(m.words[y.length+q-1]|0);for(I=Math.min(I/C|0,67108863),m._ishlnsubmul(y,I,q);m.negative!==0;)I--,m.negative=0,m._ishlnsubmul(y,1,q),m.isZero()||(m.negative^=1);h&&(h.words[q]=I)}return h&&h._strip(),m._strip(),d!=="div"&&g!==0&&m.iushrn(g),{div:h||null,mod:m}},s.prototype.divmod=function(a,d,g){if(n(!a.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var m,y,C;return this.negative!==0&&a.negative===0?(C=this.neg().divmod(a,d),d!=="mod"&&(m=C.div.neg()),d!=="div"&&(y=C.mod.neg(),g&&y.negative!==0&&y.iadd(a)),{div:m,mod:y}):this.negative===0&&a.negative!==0?(C=this.divmod(a.neg(),d),d!=="mod"&&(m=C.div.neg()),{div:m,mod:C.mod}):this.negative&a.negative?(C=this.neg().divmod(a.neg(),d),d!=="div"&&(y=C.mod.neg(),g&&y.negative!==0&&y.isub(a)),{div:C.div,mod:y}):a.length>this.length||this.cmp(a)<0?{div:new s(0),mod:this}:a.length===1?d==="div"?{div:this.divn(a.words[0]),mod:null}:d==="mod"?{div:null,mod:new s(this.modrn(a.words[0]))}:{div:this.divn(a.words[0]),mod:new s(this.modrn(a.words[0]))}:this._wordDiv(a,d)},s.prototype.div=function(a){return this.divmod(a,"div",!1).div},s.prototype.mod=function(a){return this.divmod(a,"mod",!1).mod},s.prototype.umod=function(a){return this.divmod(a,"mod",!0).mod},s.prototype.divRound=function(a){var d=this.divmod(a);if(d.mod.isZero())return d.div;var g=d.div.negative!==0?d.mod.isub(a):d.mod,m=a.ushrn(1),y=a.andln(1),C=g.cmp(m);return C<0||y===1&&C===0?d.div:d.div.negative!==0?d.div.isubn(1):d.div.iaddn(1)},s.prototype.modrn=function(a){var d=a<0;d&&(a=-a),n(a<=67108863);for(var g=(1<<26)%a,m=0,y=this.length-1;y>=0;y--)m=(g*m+(this.words[y]|0))%a;return d?-m:m},s.prototype.modn=function(a){return this.modrn(a)},s.prototype.idivn=function(a){var d=a<0;d&&(a=-a),n(a<=67108863);for(var g=0,m=this.length-1;m>=0;m--){var y=(this.words[m]|0)+g*67108864;this.words[m]=y/a|0,g=y%a}return this._strip(),d?this.ineg():this},s.prototype.divn=function(a){return this.clone().idivn(a)},s.prototype.egcd=function(a){n(a.negative===0),n(!a.isZero());var d=this,g=a.clone();d.negative!==0?d=d.umod(a):d=d.clone();for(var m=new s(1),y=new s(0),C=new s(0),A=new s(1),b=0;d.isEven()&&g.isEven();)d.iushrn(1),g.iushrn(1),++b;for(var h=g.clone(),S=d.clone();!d.isZero();){for(var W=0,q=1;!(d.words[0]&q)&&W<26;++W,q<<=1);if(W>0)for(d.iushrn(W);W-- >0;)(m.isOdd()||y.isOdd())&&(m.iadd(h),y.isub(S)),m.iushrn(1),y.iushrn(1);for(var I=0,T=1;!(g.words[0]&T)&&I<26;++I,T<<=1);if(I>0)for(g.iushrn(I);I-- >0;)(C.isOdd()||A.isOdd())&&(C.iadd(h),A.isub(S)),C.iushrn(1),A.iushrn(1);d.cmp(g)>=0?(d.isub(g),m.isub(C),y.isub(A)):(g.isub(d),C.isub(m),A.isub(y))}return{a:C,b:A,gcd:g.iushln(b)}},s.prototype._invmp=function(a){n(a.negative===0),n(!a.isZero());var d=this,g=a.clone();d.negative!==0?d=d.umod(a):d=d.clone();for(var m=new s(1),y=new s(0),C=g.clone();d.cmpn(1)>0&&g.cmpn(1)>0;){for(var A=0,b=1;!(d.words[0]&b)&&A<26;++A,b<<=1);if(A>0)for(d.iushrn(A);A-- >0;)m.isOdd()&&m.iadd(C),m.iushrn(1);for(var h=0,S=1;!(g.words[0]&S)&&h<26;++h,S<<=1);if(h>0)for(g.iushrn(h);h-- >0;)y.isOdd()&&y.iadd(C),y.iushrn(1);d.cmp(g)>=0?(d.isub(g),m.isub(y)):(g.isub(d),y.isub(m))}var W;return d.cmpn(1)===0?W=m:W=y,W.cmpn(0)<0&&W.iadd(a),W},s.prototype.gcd=function(a){if(this.isZero())return a.abs();if(a.isZero())return this.abs();var d=this.clone(),g=a.clone();d.negative=0,g.negative=0;for(var m=0;d.isEven()&&g.isEven();m++)d.iushrn(1),g.iushrn(1);do{for(;d.isEven();)d.iushrn(1);for(;g.isEven();)g.iushrn(1);var y=d.cmp(g);if(y<0){var C=d;d=g,g=C}else if(y===0||g.cmpn(1)===0)break;d.isub(g)}while(!0);return g.iushln(m)},s.prototype.invm=function(a){return this.egcd(a).a.umod(a)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(a){return this.words[0]&a},s.prototype.bincn=function(a){n(typeof a=="number");var d=a%26,g=(a-d)/26,m=1<>>26,A&=67108863,this.words[C]=A}return y!==0&&(this.words[C]=y,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(a){var d=a<0;if(this.negative!==0&&!d)return-1;if(this.negative===0&&d)return 1;this._strip();var g;if(this.length>1)g=1;else{d&&(a=-a),n(a<=67108863,"Number is too big");var m=this.words[0]|0;g=m===a?0:ma.length)return 1;if(this.length=0;g--){var m=this.words[g]|0,y=a.words[g]|0;if(m!==y){my&&(d=1);break}}return d},s.prototype.gtn=function(a){return this.cmpn(a)===1},s.prototype.gt=function(a){return this.cmp(a)===1},s.prototype.gten=function(a){return this.cmpn(a)>=0},s.prototype.gte=function(a){return this.cmp(a)>=0},s.prototype.ltn=function(a){return this.cmpn(a)===-1},s.prototype.lt=function(a){return this.cmp(a)===-1},s.prototype.lten=function(a){return this.cmpn(a)<=0},s.prototype.lte=function(a){return this.cmp(a)<=0},s.prototype.eqn=function(a){return this.cmpn(a)===0},s.prototype.eq=function(a){return this.cmp(a)===0},s.red=function(a){return new Q(a)},s.prototype.toRed=function(a){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),a.convertTo(this)._forceRed(a)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(a){return this.red=a,this},s.prototype.forceRed=function(a){return n(!this.red,"Already a number in reduction context"),this._forceRed(a)},s.prototype.redAdd=function(a){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,a)},s.prototype.redIAdd=function(a){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,a)},s.prototype.redSub=function(a){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,a)},s.prototype.redISub=function(a){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,a)},s.prototype.redShl=function(a){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,a)},s.prototype.redMul=function(a){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.mul(this,a)},s.prototype.redIMul=function(a){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.imul(this,a)},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(a){return n(this.red&&!a.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,a)};var O={k256:null,p224:null,p192:null,p25519:null};function D(v,a){this.name=v,this.p=new s(a,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}D.prototype._tmp=function(){var a=new s(null);return a.words=new Array(Math.ceil(this.n/13)),a},D.prototype.ireduce=function(a){var d=a,g;do this.split(d,this.tmp),d=this.imulK(d),d=d.iadd(this.tmp),g=d.bitLength();while(g>this.n);var m=g0?d.isub(this.p):d.strip!==void 0?d.strip():d._strip(),d},D.prototype.split=function(a,d){a.iushrn(this.n,0,d)},D.prototype.imulK=function(a){return a.imul(this.k)};function G(){D.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(G,D),G.prototype.split=function(a,d){for(var g=4194303,m=Math.min(a.length,9),y=0;y>>22,C=A}C>>>=22,a.words[y-10]=C,C===0&&a.length>10?a.length-=10:a.length-=9},G.prototype.imulK=function(a){a.words[a.length]=0,a.words[a.length+1]=0,a.length+=2;for(var d=0,g=0;g>>=26,a.words[g]=y,d=m}return d!==0&&(a.words[a.length++]=d),a},s._prime=function(a){if(O[a])return O[a];var d;if(a==="k256")d=new G;else if(a==="p224")d=new V;else if(a==="p192")d=new H;else if(a==="p25519")d=new X;else throw new Error("Unknown prime "+a);return O[a]=d,d};function Q(v){if(typeof v=="string"){var a=s._prime(v);this.m=a.p,this.prime=a}else n(v.gtn(1),"modulus must be greater than 1"),this.m=v,this.prime=null}Q.prototype._verify1=function(a){n(a.negative===0,"red works only with positives"),n(a.red,"red works only with red numbers")},Q.prototype._verify2=function(a,d){n((a.negative|d.negative)===0,"red works only with positives"),n(a.red&&a.red===d.red,"red works only with red numbers")},Q.prototype.imod=function(a){return this.prime?this.prime.ireduce(a)._forceRed(this):(p(a,a.umod(this.m)._forceRed(this)),a)},Q.prototype.neg=function(a){return a.isZero()?a.clone():this.m.sub(a)._forceRed(this)},Q.prototype.add=function(a,d){this._verify2(a,d);var g=a.add(d);return g.cmp(this.m)>=0&&g.isub(this.m),g._forceRed(this)},Q.prototype.iadd=function(a,d){this._verify2(a,d);var g=a.iadd(d);return g.cmp(this.m)>=0&&g.isub(this.m),g},Q.prototype.sub=function(a,d){this._verify2(a,d);var g=a.sub(d);return g.cmpn(0)<0&&g.iadd(this.m),g._forceRed(this)},Q.prototype.isub=function(a,d){this._verify2(a,d);var g=a.isub(d);return g.cmpn(0)<0&&g.iadd(this.m),g},Q.prototype.shl=function(a,d){return this._verify1(a),this.imod(a.ushln(d))},Q.prototype.imul=function(a,d){return this._verify2(a,d),this.imod(a.imul(d))},Q.prototype.mul=function(a,d){return this._verify2(a,d),this.imod(a.mul(d))},Q.prototype.isqr=function(a){return this.imul(a,a.clone())},Q.prototype.sqr=function(a){return this.mul(a,a)},Q.prototype.sqrt=function(a){if(a.isZero())return a.clone();var d=this.m.andln(3);if(n(d%2===1),d===3){var g=this.m.add(new s(1)).iushrn(2);return this.pow(a,g)}for(var m=this.m.subn(1),y=0;!m.isZero()&&m.andln(1)===0;)y++,m.iushrn(1);n(!m.isZero());var C=new s(1).toRed(this),A=C.redNeg(),b=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new s(2*h*h).toRed(this);this.pow(h,b).cmp(A)!==0;)h.redIAdd(A);for(var S=this.pow(h,m),W=this.pow(a,m.addn(1).iushrn(1)),q=this.pow(a,m),I=y;q.cmp(C)!==0;){for(var T=q,B=0;T.cmp(C)!==0;B++)T=T.redSqr();n(B=0;y--){for(var S=d.words[y],W=h-1;W>=0;W--){var q=S>>W&1;if(C!==m[0]&&(C=this.sqr(C)),q===0&&A===0){b=0;continue}A<<=1,A|=q,b++,!(b!==g&&(y!==0||W!==0))&&(C=this.mul(C,m[A]),b=0,A=0)}h=26}return C},Q.prototype.convertTo=function(a){var d=a.umod(this.m);return d===a?d.clone():d},Q.prototype.convertFrom=function(a){var d=a.clone();return d.red=null,d},s.mont=function(a){return new ie(a)};function ie(v){Q.call(this,v),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(ie,Q),ie.prototype.convertTo=function(a){return this.imod(a.ushln(this.shift))},ie.prototype.convertFrom=function(a){var d=this.imod(a.mul(this.rinv));return d.red=null,d},ie.prototype.imul=function(a,d){if(a.isZero()||d.isZero())return a.words[0]=0,a.length=1,a;var g=a.imul(d),m=g.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=g.isub(m).iushrn(this.shift),C=y;return y.cmp(this.m)>=0?C=y.isub(this.m):y.cmpn(0)<0&&(C=y.iadd(this.m)),C._forceRed(this)},ie.prototype.mul=function(a,d){if(a.isZero()||d.isZero())return new s(0)._forceRed(this);var g=a.mul(d),m=g.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),y=g.isub(m).iushrn(this.shift),C=y;return y.cmp(this.m)>=0?C=y.isub(this.m):y.cmpn(0)<0&&(C=y.iadd(this.m)),C._forceRed(this)},ie.prototype.invm=function(a){var d=this.imod(a._invmp(this.m).mul(this.r2));return d._forceRed(this)}})(e,J)})(Uo);var Hi=Uo.exports,jn={},Ht={};Object.defineProperty(Ht,"__esModule",{value:!0});Ht.errorValues=Ht.standardErrorCodes=void 0;Ht.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}};Ht.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 Ui={},Wi={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=e.getErrorCode=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=Ht,r="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(_,R=r){if(_&&Number.isInteger(_)){const x=_.toString();if(p(t.errorValues,x))return t.errorValues[x].message;if(l(_))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return R}e.getMessageFromCode=n;function i(_){if(!Number.isInteger(_))return!1;const R=_.toString();return!!(t.errorValues[R]||l(_))}e.isValidCode=i;function s(_){var R;if(typeof _=="number")return _;if(o(_))return(R=_.code)!==null&&R!==void 0?R:_.errorCode}e.getErrorCode=s;function o(_){return typeof _=="object"&&_!==null&&(typeof _.code=="number"||typeof _.errorCode=="number")}function c(_,{shouldIncludeStack:R=!1}={}){const x={};if(_&&typeof _=="object"&&!Array.isArray(_)&&p(_,"code")&&i(_.code)){const P=_;x.code=P.code,P.message&&typeof P.message=="string"?(x.message=P.message,p(P,"data")&&(x.data=P.data)):(x.message=n(x.code),x.data={originalError:u(_)})}else x.code=t.standardErrorCodes.rpc.internal,x.message=f(_,"message")?_.message:r,x.data={originalError:u(_)};return R&&(x.stack=f(_,"stack")?_.stack:void 0),x}e.serialize=c;function l(_){return _>=-32099&&_<=-32e3}function u(_){return _&&typeof _=="object"&&!Array.isArray(_)?Object.assign({},_):_}function p(_,R){return Object.prototype.hasOwnProperty.call(_,R)}function f(_,R){return typeof _=="object"&&_!==null&&R in _&&typeof _[R]=="string"}})(Wi);Object.defineProperty(Ui,"__esModule",{value:!0});Ui.standardErrors=void 0;const Xe=Ht,Il=Wi;Ui.standardErrors={rpc:{parse:e=>dt(Xe.standardErrorCodes.rpc.parse,e),invalidRequest:e=>dt(Xe.standardErrorCodes.rpc.invalidRequest,e),invalidParams:e=>dt(Xe.standardErrorCodes.rpc.invalidParams,e),methodNotFound:e=>dt(Xe.standardErrorCodes.rpc.methodNotFound,e),internal:e=>dt(Xe.standardErrorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return dt(t,e)},invalidInput:e=>dt(Xe.standardErrorCodes.rpc.invalidInput,e),resourceNotFound:e=>dt(Xe.standardErrorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>dt(Xe.standardErrorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>dt(Xe.standardErrorCodes.rpc.transactionRejected,e),methodNotSupported:e=>dt(Xe.standardErrorCodes.rpc.methodNotSupported,e),limitExceeded:e=>dt(Xe.standardErrorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>qr(Xe.standardErrorCodes.provider.userRejectedRequest,e),unauthorized:e=>qr(Xe.standardErrorCodes.provider.unauthorized,e),unsupportedMethod:e=>qr(Xe.standardErrorCodes.provider.unsupportedMethod,e),disconnected:e=>qr(Xe.standardErrorCodes.provider.disconnected,e),chainDisconnected:e=>qr(Xe.standardErrorCodes.provider.chainDisconnected,e),unsupportedChain:e=>qr(Xe.standardErrorCodes.provider.unsupportedChain,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new Tl(t,r,n)}}};function dt(e,t){const[r,n]=xl(t);return new Al(e,r||(0,Il.getMessageFromCode)(e),n)}function qr(e,t){const[r,n]=xl(t);return new Tl(e,r||(0,Il.getMessageFromCode)(e),n)}function xl(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}let Al=class extends Error{constructor(t,r,n){if(!Number.isInteger(t))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=t,n!==void 0&&(this.data=n)}},Tl=class extends Al{constructor(t,r,n){if(!_d(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};function _d(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}var Vi={},_n={};Object.defineProperty(_n,"__esModule",{value:!0});_n.isErrorResponse=void 0;function md(e){return e.errorMessage!==void 0}_n.isErrorResponse=md;var mn={};Object.defineProperty(mn,"__esModule",{value:!0});mn.LIB_VERSION=void 0;mn.LIB_VERSION="3.9.1";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.serializeError=void 0;const vd=_n,bd=mn,yd=Ht,wd=Wi;function Ed(e,t){const r=(0,wd.serialize)(Sd(e),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",bd.LIB_VERSION),n.searchParams.set("code",r.code.toString());const i=Rd(r.data,t);return i&&n.searchParams.set("method",i),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}Vi.serializeError=Ed;function Sd(e){return typeof e=="string"?{message:e,code:yd.standardErrorCodes.rpc.internal}:(0,vd.isErrorResponse)(e)?Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method}}):e}function Rd(e,t){const r=e==null?void 0:e.method;if(r)return r;if(t!==void 0){if(typeof t=="string")return t;if(Array.isArray(t)){if(t.length>0)return t[0].method}else return t.method}}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.standardErrors=e.standardErrorCodes=e.serializeError=e.getMessageFromCode=e.getErrorCode=void 0;const t=Ht;Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return t.standardErrorCodes}});const r=Ui;Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=Vi;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const i=Wi;Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return i.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return i.getMessageFromCode}})})(jn);var Je={};Object.defineProperty(Je,"__esModule",{value:!0});Je.ProviderType=Je.RegExpString=Je.IntNumber=Je.BigIntString=Je.AddressString=Je.HexString=Je.OpaqueType=void 0;function Hn(){return e=>e}Je.OpaqueType=Hn;Je.HexString=Hn();Je.AddressString=Hn();Je.BigIntString=Hn();function Md(e){return Math.floor(e)}Je.IntNumber=Md;Je.RegExpString=Hn();var Oa;(function(e){e.CoinbaseWallet="CoinbaseWallet",e.MetaMask="MetaMask",e.Unselected=""})(Oa||(Je.ProviderType=Oa={}));var Cd=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(z,"__esModule",{value:!0});z.isMobileWeb=z.getLocation=z.isInIFrame=z.createQrUrl=z.getFavicon=z.range=z.isBigNumber=z.ensureParsedJSONObject=z.ensureBN=z.ensureRegExpString=z.ensureIntNumber=z.ensureBuffer=z.ensureAddressString=z.ensureEvenLengthHexString=z.ensureHexString=z.isHexString=z.prepend0x=z.strip0x=z.has0xPrefix=z.hexStringFromIntNumber=z.intNumberFromHexString=z.bigIntStringFromBN=z.hexStringFromBuffer=z.hexStringToUint8Array=z.uint8ArrayToHex=z.randomBytesHex=void 0;const Gt=Cd(Hi),kr=jn,_t=Je,Nl=/^[0-9]*$/,Ll=/^[a-f0-9]*$/;function kd(e){return Ol(crypto.getRandomValues(new Uint8Array(e)))}z.randomBytesHex=kd;function Ol(e){return[...e].map(t=>t.toString(16).padStart(2,"0")).join("")}z.uint8ArrayToHex=Ol;function Id(e){return new Uint8Array(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}z.hexStringToUint8Array=Id;function xd(e,t=!1){const r=e.toString("hex");return(0,_t.HexString)(t?`0x${r}`:r)}z.hexStringFromBuffer=xd;function Ad(e){return(0,_t.BigIntString)(e.toString(10))}z.bigIntStringFromBN=Ad;function Td(e){return(0,_t.IntNumber)(new Gt.default(Wn(e,!1),16).toNumber())}z.intNumberFromHexString=Td;function Nd(e){return(0,_t.HexString)(`0x${new Gt.default(e).toString(16)}`)}z.hexStringFromIntNumber=Nd;function Wo(e){return e.startsWith("0x")||e.startsWith("0X")}z.has0xPrefix=Wo;function qi(e){return Wo(e)?e.slice(2):e}z.strip0x=qi;function Pl(e){return Wo(e)?`0x${e.slice(2)}`:`0x${e}`}z.prepend0x=Pl;function Un(e){if(typeof e!="string")return!1;const t=qi(e).toLowerCase();return Ll.test(t)}z.isHexString=Un;function $l(e,t=!1){if(typeof e=="string"){const r=qi(e).toLowerCase();if(Ll.test(r))return(0,_t.HexString)(t?`0x${r}`:r)}throw kr.standardErrors.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}z.ensureHexString=$l;function Wn(e,t=!1){let r=$l(e,!1);return r.length%2===1&&(r=(0,_t.HexString)(`0${r}`)),t?(0,_t.HexString)(`0x${r}`):r}z.ensureEvenLengthHexString=Wn;function Ld(e){if(typeof e=="string"){const t=qi(e).toLowerCase();if(Un(t)&&t.length===40)return(0,_t.AddressString)(Pl(t))}throw kr.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)}z.ensureAddressString=Ld;function Od(e){if(Buffer.isBuffer(e))return e;if(typeof e=="string"){if(Un(e)){const t=Wn(e,!1);return Buffer.from(t,"hex")}return Buffer.from(e,"utf8")}throw kr.standardErrors.rpc.invalidParams(`Not binary data: ${String(e)}`)}z.ensureBuffer=Od;function Bl(e){if(typeof e=="number"&&Number.isInteger(e))return(0,_t.IntNumber)(e);if(typeof e=="string"){if(Nl.test(e))return(0,_t.IntNumber)(Number(e));if(Un(e))return(0,_t.IntNumber)(new Gt.default(Wn(e,!1),16).toNumber())}throw kr.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}z.ensureIntNumber=Bl;function Pd(e){if(e instanceof RegExp)return(0,_t.RegExpString)(e.toString());throw kr.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(e)}`)}z.ensureRegExpString=Pd;function $d(e){if(e!==null&&(Gt.default.isBN(e)||Dl(e)))return new Gt.default(e.toString(10),10);if(typeof e=="number")return new Gt.default(Bl(e));if(typeof e=="string"){if(Nl.test(e))return new Gt.default(e,10);if(Un(e))return new Gt.default(Wn(e,!1),16)}throw kr.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}z.ensureBN=$d;function Bd(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw kr.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(e)}`)}z.ensureParsedJSONObject=Bd;function Dl(e){if(e==null||typeof e.constructor!="function")return!1;const{constructor:t}=e;return typeof t.config=="function"&&typeof t.EUCLID=="number"}z.isBigNumber=Dl;function Dd(e,t){return Array.from({length:t-e},(r,n)=>e+n)}z.range=Dd;function Fd(){const e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:t,host:r}=document.location,n=e?e.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?t+n:`${t}//${r}${n}`}z.getFavicon=Fd;function jd(e,t,r,n,i,s){const o=n?"parent-id":"id",c=new URLSearchParams({[o]:e,secret:t,server:r,v:i,chainId:s.toString()}).toString();return`${r}/#/link?${c}`}z.createQrUrl=jd;function Fl(){try{return window.frameElement!==null}catch{return!1}}z.isInIFrame=Fl;function Hd(){try{return Fl()&&window.top?window.top.location:window.location}catch{return window.location}}z.getLocation=Hd;function Ud(){var e;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((e=window==null?void 0:window.navigator)===null||e===void 0?void 0:e.userAgent)}z.isMobileWeb=Ud;var zi={};Object.defineProperty(zi,"__esModule",{value:!0});zi.ScopedLocalStorage=void 0;class Wd{constructor(t){this.scope=t}setItem(t,r){localStorage.setItem(this.scopedKey(t),r)}getItem(t){return localStorage.getItem(this.scopedKey(t))}removeItem(t){localStorage.removeItem(this.scopedKey(t))}clear(){const t=this.scopedKey(""),r=[];for(let n=0;nlocalStorage.removeItem(n))}scopedKey(t){return`${this.scope}:${t}`}}zi.ScopedLocalStorage=Wd;var on={};const Vd=gn(pd);var Vn={},qn={},vn={};Object.defineProperty(vn,"__esModule",{value:!0});vn.EVENTS=void 0;vn.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 gt={};Object.defineProperty(gt,"__esModule",{value:!0});gt.RelayAbstract=gt.APP_VERSION_KEY=gt.LOCAL_STORAGE_ADDRESSES_KEY=gt.WALLET_USER_NAME_KEY=void 0;const Pa=jn;gt.WALLET_USER_NAME_KEY="walletUsername";gt.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";gt.APP_VERSION_KEY="AppVersion";class qd{async makeEthereumJSONRPCRequest(t,r){if(!r)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(r,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{if(!n)throw Pa.standardErrors.rpc.parse({});const i=n,{error:s}=i;if(s)throw(0,Pa.serializeError)(s,t.method);return i})}}gt.RelayAbstract=qd;var bn={},jl={exports:{}},Eo={exports:{}};typeof Object.create=="function"?Eo.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Eo.exports=function(t,r){if(r){t.super_=r;var n=function(){};n.prototype=r.prototype,t.prototype=new n,t.prototype.constructor=t}};var Et=Eo.exports,So={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh */(function(e,t){var r=Fn,n=r.Buffer;function i(o,c){for(var l in o)c[l]=o[l]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=s);function s(o,c,l){return n(o,c,l)}s.prototype=Object.create(n.prototype),i(n,s),s.from=function(o,c,l){if(typeof o=="number")throw new TypeError("Argument must not be a number");return n(o,c,l)},s.alloc=function(o,c,l){if(typeof o!="number")throw new TypeError("Argument must be a number");var u=n(o);return c!==void 0?typeof l=="string"?u.fill(c,l):u.fill(c):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)}})(So,So.exports);var Ir=So.exports,Hl=Ir.Buffer;function Gi(e,t){this._block=Hl.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}Gi.prototype.update=function(e,t){typeof e=="string"&&(t=t||"utf8",e=Hl.from(e,t));for(var r=this._block,n=this._blockSize,i=e.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 e?s.toString(e):s};Gi.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var yn=Gi,zd=Et,Ul=yn,Gd=Ir.Buffer,Jd=[1518500249,1859775393,-1894007588,-899497514],Zd=new Array(80);function zn(){this.init(),this._w=Zd,Ul.call(this,64,56)}zd(zn,Ul);zn.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Kd(e){return e<<5|e>>>27}function Qd(e){return e<<30|e>>>2}function Yd(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}zn.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,c=0;c<16;++c)t[c]=e.readInt32BE(c*4);for(;c<80;++c)t[c]=t[c-3]^t[c-8]^t[c-14]^t[c-16];for(var l=0;l<80;++l){var u=~~(l/20),p=Kd(r)+Yd(u,n,i,s)+o+t[l]+Jd[u]|0;o=s,s=i,i=Qd(n),n=r,r=p}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};zn.prototype._hash=function(){var e=Gd.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var Xd=zn,ef=Et,Wl=yn,tf=Ir.Buffer,rf=[1518500249,1859775393,-1894007588,-899497514],nf=new Array(80);function Gn(){this.init(),this._w=nf,Wl.call(this,64,56)}ef(Gn,Wl);Gn.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function sf(e){return e<<1|e>>>31}function of(e){return e<<5|e>>>27}function af(e){return e<<30|e>>>2}function cf(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}Gn.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,c=0;c<16;++c)t[c]=e.readInt32BE(c*4);for(;c<80;++c)t[c]=sf(t[c-3]^t[c-8]^t[c-14]^t[c-16]);for(var l=0;l<80;++l){var u=~~(l/20),p=of(r)+cf(u,n,i,s)+o+t[l]+rf[u]|0;o=s,s=i,i=af(n),n=r,r=p}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};Gn.prototype._hash=function(){var e=tf.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var lf=Gn,uf=Et,Vl=yn,hf=Ir.Buffer,df=[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],ff=new Array(64);function Jn(){this.init(),this._w=ff,Vl.call(this,64,56)}uf(Jn,Vl);Jn.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 pf(e,t,r){return r^e&(t^r)}function gf(e,t,r){return e&t|r&(e|t)}function _f(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function mf(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function vf(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function bf(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}Jn.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,c=this._f|0,l=this._g|0,u=this._h|0,p=0;p<16;++p)t[p]=e.readInt32BE(p*4);for(;p<64;++p)t[p]=bf(t[p-2])+t[p-7]+vf(t[p-15])+t[p-16]|0;for(var f=0;f<64;++f){var _=u+mf(o)+pf(o,c,l)+df[f]+t[f]|0,R=_f(r)+gf(r,n,i)|0;u=l,l=c,c=o,o=s+_|0,s=i,i=n,n=r,r=_+R|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=c+this._f|0,this._g=l+this._g|0,this._h=u+this._h|0};Jn.prototype._hash=function(){var e=hf.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var ql=Jn,yf=Et,wf=ql,Ef=yn,Sf=Ir.Buffer,Rf=new Array(64);function Ji(){this.init(),this._w=Rf,Ef.call(this,64,56)}yf(Ji,wf);Ji.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};Ji.prototype._hash=function(){var e=Sf.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var Mf=Ji,Cf=Et,zl=yn,kf=Ir.Buffer,$a=[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],If=new Array(160);function Zn(){this.init(),this._w=If,zl.call(this,128,112)}Cf(Zn,zl);Zn.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 Ba(e,t,r){return r^e&(t^r)}function Da(e,t,r){return e&t|r&(e|t)}function Fa(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function ja(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function xf(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function Af(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function Tf(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function Nf(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function Ke(e,t){return e>>>0>>0?1:0}Zn.prototype._update=function(e){for(var t=this._w,r=this._ah|0,n=this._bh|0,i=this._ch|0,s=this._dh|0,o=this._eh|0,c=this._fh|0,l=this._gh|0,u=this._hh|0,p=this._al|0,f=this._bl|0,_=this._cl|0,R=this._dl|0,x=this._el|0,P=this._fl|0,L=this._gl|0,M=this._hl|0,k=0;k<32;k+=2)t[k]=e.readInt32BE(k*4),t[k+1]=e.readInt32BE(k*4+4);for(;k<160;k+=2){var N=t[k-30],$=t[k-15*2+1],O=xf(N,$),D=Af($,N);N=t[k-2*2],$=t[k-2*2+1];var G=Tf(N,$),V=Nf($,N),H=t[k-7*2],X=t[k-7*2+1],Q=t[k-16*2],ie=t[k-16*2+1],v=D+X|0,a=O+H+Ke(v,D)|0;v=v+V|0,a=a+G+Ke(v,V)|0,v=v+ie|0,a=a+Q+Ke(v,ie)|0,t[k]=a,t[k+1]=v}for(var d=0;d<160;d+=2){a=t[d],v=t[d+1];var g=Da(r,n,i),m=Da(p,f,_),y=Fa(r,p),C=Fa(p,r),A=ja(o,x),b=ja(x,o),h=$a[d],S=$a[d+1],W=Ba(o,c,l),q=Ba(x,P,L),I=M+b|0,T=u+A+Ke(I,M)|0;I=I+q|0,T=T+W+Ke(I,q)|0,I=I+S|0,T=T+h+Ke(I,S)|0,I=I+v|0,T=T+a+Ke(I,v)|0;var B=C+m|0,U=y+g+Ke(B,C)|0;u=l,M=L,l=c,L=P,c=o,P=x,x=R+I|0,o=s+T+Ke(x,R)|0,s=i,R=_,i=n,_=f,n=r,f=p,p=I+B|0,r=T+U+Ke(p,I)|0}this._al=this._al+p|0,this._bl=this._bl+f|0,this._cl=this._cl+_|0,this._dl=this._dl+R|0,this._el=this._el+x|0,this._fl=this._fl+P|0,this._gl=this._gl+L|0,this._hl=this._hl+M|0,this._ah=this._ah+r+Ke(this._al,p)|0,this._bh=this._bh+n+Ke(this._bl,f)|0,this._ch=this._ch+i+Ke(this._cl,_)|0,this._dh=this._dh+s+Ke(this._dl,R)|0,this._eh=this._eh+o+Ke(this._el,x)|0,this._fh=this._fh+c+Ke(this._fl,P)|0,this._gh=this._gh+l+Ke(this._gl,L)|0,this._hh=this._hh+u+Ke(this._hl,M)|0};Zn.prototype._hash=function(){var e=kf.allocUnsafe(64);function t(r,n,i){e.writeInt32BE(r,i),e.writeInt32BE(n,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var Gl=Zn,Lf=Et,Of=Gl,Pf=yn,$f=Ir.Buffer,Bf=new Array(160);function Zi(){this.init(),this._w=Bf,Pf.call(this,128,112)}Lf(Zi,Of);Zi.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};Zi.prototype._hash=function(){var e=$f.allocUnsafe(48);function t(r,n,i){e.writeInt32BE(r,i),e.writeInt32BE(n,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var Df=Zi,xr=jl.exports=function(t){t=t.toLowerCase();var r=xr[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r};xr.sha=Xd;xr.sha1=lf;xr.sha224=Mf;xr.sha256=ql;xr.sha384=Df;xr.sha512=Gl;var Ff=jl.exports;Object.defineProperty(bn,"__esModule",{value:!0});bn.Session=void 0;const Ha=Ff,Ua=z,Wa="session:id",Va="session:secret",qa="session:linked";class Vo{constructor(t,r,n,i){this._storage=t,this._id=r||(0,Ua.randomBytesHex)(16),this._secret=n||(0,Ua.randomBytesHex)(32),this._key=new Ha.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(t){const r=t.getItem(Wa),n=t.getItem(qa),i=t.getItem(Va);return r&&i?new Vo(t,r,i,n==="1"):null}static hash(t){return new Ha.sha256().update(t).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(t){this._linked=t,this.persistLinked()}save(){return this._storage.setItem(Wa,this._id),this._storage.setItem(Va,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(qa,this._linked?"1":"0")}}bn.Session=Vo;var Ki={},Qi={};Object.defineProperty(Qi,"__esModule",{value:!0});Qi.Cipher=void 0;const di=z;class jf{constructor(t){this.secret=t}async encrypt(t){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,di.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(t)),c=16,l=o.slice(o.byteLength-c),u=o.slice(0,o.byteLength-c),p=new Uint8Array(l),f=new Uint8Array(u),_=new Uint8Array([...n,...p,...f]);return(0,di.uint8ArrayToHex)(_)}async decrypt(t){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,di.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),o=(0,di.hexStringToUint8Array)(t),c=o.slice(0,12),l=o.slice(12,28),u=o.slice(28),p=new Uint8Array([...u,...l]),f={name:"AES-GCM",iv:new Uint8Array(c)};try{const _=await window.crypto.subtle.decrypt(f,s,p),R=new TextDecoder;n(R.decode(_))}catch(_){i(_)}})()})}}Qi.Cipher=jf;var Yi={};Object.defineProperty(Yi,"__esModule",{value:!0});Yi.WalletLinkHTTP=void 0;class Hf{constructor(t,r,n){this.linkAPIUrl=t,this.sessionId=r;const i=`${r}:${n}`;this.auth=`Basic ${btoa(i)}`}async markUnseenEventsAsSeen(t){return Promise.all(t.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 t;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=(t=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&&t!==void 0?t:[];return this.markUnseenEventsAsSeen(s),s}throw new Error(`Check unseen events failed: ${r.status}`)}}Yi.WalletLinkHTTP=Hf;var an={};Object.defineProperty(an,"__esModule",{value:!0});an.WalletLinkWebSocket=an.ConnectionState=void 0;var Xr;(function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"})(Xr||(an.ConnectionState=Xr={}));class Uf{setConnectionStateListener(t){this.connectionStateListener=t}setIncomingDataListener(t){this.incomingDataListener=t}constructor(t,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.pendingData=[],this.url=t.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((t,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,Xr.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,Xr.DISCONNECTED)},i.onopen=s=>{var o;t(),(o=this.connectionStateListener)===null||o===void 0||o.call(this,Xr.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(l=>this.sendData(l)),this.pendingData=[])},i.onmessage=s=>{var o,c;if(s.data==="h")(o=this.incomingDataListener)===null||o===void 0||o.call(this,{type:"Heartbeat"});else try{const l=JSON.parse(s.data);(c=this.incomingDataListener)===null||c===void 0||c.call(this,l)}catch{}}})}disconnect(){var t;const{webSocket:r}=this;if(r){this.clearWebSocket(),(t=this.connectionStateListener)===null||t===void 0||t.call(this,Xr.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{r.close()}catch{}}}sendData(t){const{webSocket:r}=this;if(!r){this.pendingData.push(t),this.connect();return}r.send(t)}clearWebSocket(){const{webSocket:t}=this;t&&(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}}an.WalletLinkWebSocket=Uf;Object.defineProperty(Ki,"__esModule",{value:!0});Ki.WalletLinkConnection=void 0;const zr=Je,Wf=Qi,Ct=vn,za=gt,Gr=bn,Vf=Yi,fi=an,Ga=1e4,qf=6e4;class zf{constructor({session:t,linkAPIUrl:r,listener:n,diagnostic:i,WebSocketClass:s=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,zr.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=c=>{if(!c)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",u=>c.JsonRpcUrl&&this.handleChainUpdated(u,c.JsonRpcUrl)]]).forEach((u,p)=>{const f=c[p];f!==void 0&&u(f)})},this.handleDestroyed=c=>{var l,u;c==="1"&&((l=this.listener)===null||l===void 0||l.resetAndReload(),(u=this.diagnostic)===null||u===void 0||u.log(Ct.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:Gr.Session.hash(this.session.id)}))},this.handleAccountUpdated=async c=>{var l,u;try{const p=await this.cipher.decrypt(c);(l=this.listener)===null||l===void 0||l.accountUpdated(p)}catch{(u=this.diagnostic)===null||u===void 0||u.log(Ct.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(c,l)=>{var u,p;try{const f=await this.cipher.decrypt(l);(u=this.listener)===null||u===void 0||u.metadataUpdated(c,f)}catch{(p=this.diagnostic)===null||p===void 0||p.log(Ct.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:c})}},this.handleWalletUsernameUpdated=async c=>{this.handleMetadataUpdated(za.WALLET_USER_NAME_KEY,c)},this.handleAppVersionUpdated=async c=>{this.handleMetadataUpdated(za.APP_VERSION_KEY,c)},this.handleChainUpdated=async(c,l)=>{var u,p;try{const f=await this.cipher.decrypt(c),_=await this.cipher.decrypt(l);(u=this.listener)===null||u===void 0||u.chainUpdated(f,_)}catch{(p=this.diagnostic)===null||p===void 0||p.log(Ct.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=t,this.cipher=new Wf.Cipher(t.secret),this.diagnostic=i,this.listener=n;const o=new fi.WalletLinkWebSocket(`${r}/rpc`,s);o.setConnectionStateListener(async c=>{var l;(l=this.diagnostic)===null||l===void 0||l.log(Ct.EVENTS.CONNECTED_STATE_CHANGE,{state:c,sessionIdHash:Gr.Session.hash(t.id)});let u=!1;switch(c){case fi.ConnectionState.DISCONNECTED:if(!this.destroyed){const p=async()=>{await new Promise(f=>setTimeout(f,5e3)),this.destroyed||o.connect().catch(()=>{p()})};p()}break;case fi.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),u=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},Ga),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case fi.ConnectionState.CONNECTING:break}this.connected!==u&&(this.connected=u)}),o.setIncomingDataListener(c=>{var l,u,p;switch(c.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const f=c.type==="IsLinkedOK"?c.linked:void 0;(l=this.diagnostic)===null||l===void 0||l.log(Ct.EVENTS.LINKED,{sessionIdHash:Gr.Session.hash(t.id),linked:f,type:c.type,onlineGuests:c.onlineGuests}),this.linked=f||c.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(u=this.diagnostic)===null||u===void 0||u.log(Ct.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:Gr.Session.hash(t.id),metadata_keys:c&&c.metadata?Object.keys(c.metadata):void 0}),this.handleSessionMetadataUpdated(c.metadata);break}case"Event":{this.handleIncomingEvent(c);break}}c.id!==void 0&&((p=this.requestResolutions.get(c.id))===null||p===void 0||p(c))}),this.ws=o,this.http=new Vf.WalletLinkHTTP(r,t.id,t.key)}connect(){var t;if(this.destroyed)throw new Error("instance is destroyed");(t=this.diagnostic)===null||t===void 0||t.log(Ct.EVENTS.STARTED_CONNECTING,{sessionIdHash:Gr.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var t;this.destroyed=!0,this.ws.disconnect(),(t=this.diagnostic)===null||t===void 0||t.log(Ct.EVENTS.DISCONNECTED,{sessionIdHash:Gr.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(t){var r,n;this._connected=t,t&&((r=this.onceConnected)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.connectedUpdated(t)}setOnceConnected(t){return new Promise(r=>{this.connected?t().then(r):this.onceConnected=()=>{t().then(r),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(t){var r,n;this._linked=t,t&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(t)}setOnceLinked(t){return new Promise(r=>{this.linked?t().then(r):this.onceLinked=()=>{t().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(t){var r,n;if(!(t.type!=="Event"||t.event!=="Web3Response"))try{const i=await this.cipher.decrypt(t.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(Ct.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(t=>setTimeout(t,250));try{await this.fetchUnseenEventsAPI()}catch(t){console.error("Unable to check for unseen events",t)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(r=>this.handleIncomingEvent(r))}async setSessionMetadata(t,r){const n={type:"SetSessionConfig",id:(0,zr.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[t]: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(t,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,zr.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:t,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(t){this.ws.sendData(JSON.stringify(t))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>Ga*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(t,r=qf){const n=t.id;this.sendData(t);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 t={type:"HostSession",id:(0,zr.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(t);if(r.type==="Fail")throw new Error(r.error||"failed to authentcate")}sendIsLinked(){const t={type:"IsLinked",id:(0,zr.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}sendGetSessionConfig(){const t={type:"GetSessionConfig",id:(0,zr.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}}Ki.WalletLinkConnection=zf;var Kn={},Qn={},qo={};Object.defineProperty(qo,"__esModule",{value:!0});qo.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 Gf=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qn,"__esModule",{value:!0});Qn.injectCssReset=void 0;const Jf=Gf(qo);function Zf(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(Jf.default)),document.documentElement.appendChild(e)}Qn.injectCssReset=Zf;var Xi={},Yn,He,Jl,Zl,gr,Ja,Kl,Ro,zo,Mo,Co,Ql,Pn={},Yl=[],Kf=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,es=Array.isArray;function jt(e,t){for(var r in t)e[r]=t[r];return e}function Xl(e){var t=e.parentNode;t&&t.removeChild(e)}function ko(e,t,r){var n,i,s,o={};for(s in t)s=="key"?n=t[s]:s=="ref"?i=t[s]:o[s]=t[s];if(arguments.length>2&&(o.children=arguments.length>3?Yn.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(s in e.defaultProps)o[s]===void 0&&(o[s]=e.defaultProps[s]);return An(e,o,n,i,null)}function An(e,t,r,n,i){var s={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++Jl,__i:-1,__u:0};return i==null&&He.vnode!=null&&He.vnode(s),s}function Qf(){return{current:null}}function Xn(e){return e.children}function Tn(e,t){this.props=e,this.context=t}function Sr(e,t){if(t==null)return e.__?Sr(e.__,e.__i+1):null;for(var r;tt&&gr.sort(Ro));Ti.__r=0}function tu(e,t,r,n,i,s,o,c,l,u,p){var f,_,R,x,P,L=n&&n.__k||Yl,M=t.length;for(r.__d=l,Yf(r,t,L),l=r.__d,f=0;f0?An(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=e,i.__b=e.__b+1,c=Xf(i,r,o,p),i.__i=c,s=null,c!==-1&&(p--,(s=r[c])&&(s.__u|=131072)),s==null||s.__v===null?(c==-1&&f--,typeof i.type!="function"&&(i.__u|=65536)):c!==o&&(c===o+1?f++:c>o?p>l-o?f+=c-o:f--:c(l!=null&&!(131072&l.__u)?1:0))for(;o>=0||c=0){if((l=t[o])&&!(131072&l.__u)&&i==l.key&&s===l.type)return o;o--}if(c2&&(c.children=arguments.length>3?Yn.call(arguments,2):r),An(e.type,c,n||e.key,i||e.ref,null)}function n0(e,t){var r={__c:t="__cC"+Ql++,__:e,Consumer:function(n,i){return n.children(i)},Provider:function(n){var i,s;return this.getChildContext||(i=[],(s={})[t]=this,this.getChildContext=function(){return s},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&i.some(function(c){c.__e=!0,Io(c)})},this.sub=function(o){i.push(o);var c=o.componentWillUnmount;o.componentWillUnmount=function(){i.splice(i.indexOf(o),1),c&&c.call(o)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}Yn=Yl.slice,He={__e:function(e,t,r,n){for(var i,s,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,n||{}),o=i.__d),o)return i.__E=i}catch(c){e=c}throw e}},Jl=0,Zl=function(e){return e!=null&&e.constructor==null},Tn.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=jt({},this.state),typeof e=="function"&&(e=e(jt({},r),this.props)),e&&jt(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),Io(this))},Tn.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Io(this))},Tn.prototype.render=Xn,gr=[],Kl=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ro=function(e,t){return e.__v.__b-t.__v.__b},Ti.__r=0,zo=0,Mo=Ka(!1),Co=Ka(!0),Ql=0;const i0=Object.freeze(Object.defineProperty({__proto__:null,Component:Tn,Fragment:Xn,cloneElement:r0,createContext:n0,createElement:ko,createRef:Qf,h:ko,hydrate:ou,get isValidElement(){return Zl},get options(){return He},render:su,toChildArray:nu},Symbol.toStringTag,{value:"Module"})),ot=gn(i0);var ts={};function au(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t=r.__.length&&r.__.push({__V:ki}),r.__[e]}function lu(e){return cn=1,uu(du,e)}function uu(e,t,r){var n=Ar(Ut++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):du(void 0,t),function(c){var l=n.__N?n.__N[0]:n.__[0],u=n.t(l,c);l!==u&&(n.__N=[u,n.__[1]],n.__c.setState({}))}],n.__c=pe,!pe.u)){var i=function(c,l,u){if(!n.__c.__H)return!0;var p=n.__c.__H.__.filter(function(_){return!!_.__c});if(p.every(function(_){return!_.__N}))return!s||s.call(this,c,l,u);var f=!1;return p.forEach(function(_){if(_.__N){var R=_.__[0];_.__=_.__N,_.__N=void 0,R!==_.__[0]&&(f=!0)}}),!(!f&&n.__c.props===c)&&(!s||s.call(this,c,l,u))};pe.u=!0;var s=pe.shouldComponentUpdate,o=pe.componentWillUpdate;pe.componentWillUpdate=function(c,l,u){if(this.__e){var p=s;s=void 0,i(c,l,u),s=p}o&&o.call(this,c,l,u)},pe.shouldComponentUpdate=i}return n.__N||n.__}function o0(e,t){var r=Ar(Ut++,3);!Ve.__s&&Ko(r.__H,t)&&(r.__=e,r.i=t,pe.__H.__h.push(r))}function hu(e,t){var r=Ar(Ut++,4);!Ve.__s&&Ko(r.__H,t)&&(r.__=e,r.i=t,pe.__h.push(r))}function a0(e){return cn=5,Zo(function(){return{current:e}},[])}function c0(e,t,r){cn=6,hu(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},r==null?r:r.concat(e))}function Zo(e,t){var r=Ar(Ut++,7);return Ko(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function l0(e,t){return cn=8,Zo(function(){return e},t)}function u0(e){var t=pe.context[e.__c],r=Ar(Ut++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(pe)),t.props.value):e.__}function h0(e,t){Ve.useDebugValue&&Ve.useDebugValue(t?t(e):e)}function d0(e){var t=Ar(Ut++,10),r=lu();return t.__=e,pe.componentDidCatch||(pe.componentDidCatch=function(n,i){t.__&&t.__(n,i),r[1](n)}),[r[0],function(){r[1](void 0)}]}function f0(){var e=Ar(Ut++,11);if(!e.__){for(var t=pe.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function p0(){for(var e;e=cu.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Ii),e.__H.__h.forEach(Ao),e.__H.__h=[]}catch(t){e.__H.__h=[],Ve.__e(t,e.__v)}}Ve.__b=function(e){pe=null,Xa&&Xa(e)},Ve.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ic&&ic(e,t)},Ve.__r=function(e){ec&&ec(e),Ut=0;var t=(pe=e.__c).__H;t&&(Us===pe?(t.__h=[],pe.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=ki,r.__N=r.i=void 0})):(t.__h.forEach(Ii),t.__h.forEach(Ao),t.__h=[],Ut=0)),Us=pe},Ve.diffed=function(e){tc&&tc(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(cu.push(t)!==1&&Ya===Ve.requestAnimationFrame||((Ya=Ve.requestAnimationFrame)||g0)(p0)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==ki&&(r.__=r.__V),r.i=void 0,r.__V=ki})),Us=pe=null},Ve.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Ii),r.__h=r.__h.filter(function(n){return!n.__||Ao(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],Ve.__e(n,r.__v)}}),rc&&rc(e,t)},Ve.unmount=function(e){nc&&nc(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Ii(n)}catch(i){t=i}}),r.__H=void 0,t&&Ve.__e(t,r.__v))};var sc=typeof requestAnimationFrame=="function";function g0(e){var t,r=function(){clearTimeout(n),sc&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);sc&&(t=requestAnimationFrame(r))}function Ii(e){var t=pe,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),pe=t}function Ao(e){var t=pe;e.__c=e.__(),pe=t}function Ko(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function du(e,t){return typeof t=="function"?t(e):t}const _0=Object.freeze(Object.defineProperty({__proto__:null,useCallback:l0,useContext:u0,useDebugValue:h0,useEffect:o0,useErrorBoundary:d0,useId:f0,useImperativeHandle:c0,useLayoutEffect:hu,useMemo:Zo,useReducer:uu,useRef:a0,useState:lu},Symbol.toStringTag,{value:"Module"})),rs=gn(_0);var ln={},ns={};Object.defineProperty(ns,"__esModule",{value:!0});ns.CloseIcon=void 0;const oc=ot;function m0(e){return(0,oc.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,oc.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"}))}ns.CloseIcon=m0;var is={};Object.defineProperty(is,"__esModule",{value:!0});is.CoinbaseWalletRound=void 0;const gi=ot;function v0(e){return(0,gi.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,gi.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,gi.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,gi.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"}))}is.CoinbaseWalletRound=v0;var ss={};Object.defineProperty(ss,"__esModule",{value:!0});ss.QRCodeIcon=void 0;const Mn=ot;function b0(e){return(0,Mn.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),(0,Mn.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,Mn.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,Mn.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,Mn.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}ss.QRCodeIcon=b0;var os={};function fu(e){this.mode=ut.MODE_8BIT_BYTE,this.data=e,this.parsedData=[];for(var t=0,r=this.data.length;t65536?(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))}fu.prototype={getLength:function(e){return this.parsedData.length},write:function(e){for(var t=0,r=this.parsedData.length;t=7&&this.setupTypeNumber(e),this.dataCache==null&&(this.dataCache=Nt.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var r=-1;r<=7;r++)if(!(e+r<=-1||this.moduleCount<=e+r))for(var n=-1;n<=7;n++)t+n<=-1||this.moduleCount<=t+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[e+r][t+n]=!0:this.modules[e+r][t+n]=!1)},getBestMaskPattern:function(){for(var e=0,t=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=We.getLostPoint(this);(r==0||e>n)&&(e=n,t=r)}return t},createMovieClip:function(e,t,r){var n=e.createEmptyMovieClip(t,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=!e&&(t>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(e,t){for(var r=this.errorCorrectLevel<<3|t,n=We.getBCHTypeInfo(r),i=0;i<15;i++){var s=!e&&(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=!e&&(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]=!e},mapData:function(e,t){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 c=0;c<2;c++)if(this.modules[n][o-c]==null){var l=!1;s>>i&1)==1);var u=We.getMask(t,n,o-c);u&&(l=!l),this.modules[n][o-c]=l,i--,i==-1&&(s++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};Nt.PAD0=236;Nt.PAD1=17;Nt.createData=function(e,t,r){for(var n=Tt.getRSBlocks(e,t),i=new pu,s=0;sc*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+c*8+")");for(i.getLengthInBits()+4<=c*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=c*8||(i.put(Nt.PAD0,8),i.getLengthInBits()>=c*8));)i.put(Nt.PAD1,8);return Nt.createBytes(i,n)};Nt.createBytes=function(e,t){for(var r=0,n=0,i=0,s=new Array(t.length),o=new Array(t.length),c=0;c=0?R.get(x):0}}for(var P=0,p=0;p=0;)t^=We.G15<=0;)t^=We.G18<>>=1;return t},getPatternPosition:function(e){return We.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,r){switch(e){case qt.PATTERN000:return(t+r)%2==0;case qt.PATTERN001:return t%2==0;case qt.PATTERN010:return r%3==0;case qt.PATTERN011:return(t+r)%3==0;case qt.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case qt.PATTERN101:return t*r%2+t*r%3==0;case qt.PATTERN110:return(t*r%2+t*r%3)%2==0;case qt.PATTERN111:return(t*r%3+(t+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new en([1],0),r=0;r5&&(r+=3+s-5)}for(var n=0;n=256;)e-=255;return Ye.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var et=0;et<8;et++)Ye.EXP_TABLE[et]=1<>>7-e%8&1)==1},put:function(e,t){for(var r=0;r>>t-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){var 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 Ws=[[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 gu(e){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof e=="string"&&(e={content:e}),e)for(var t in e)this.options[t]=e[t];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(l){switch(l){case"L":return Jt.L;case"M":return Jt.M;case"Q":return Jt.Q;case"H":return Jt.H;default:throw new Error("Unknwon error correction level: "+l)}}function n(l,u){for(var p=i(l),f=1,_=0,R=0,x=Ws.length;R<=x;R++){var P=Ws[R];if(!P)throw new Error("Content too long: expected "+_+" but got "+p);switch(u){case"L":_=P[0];break;case"M":_=P[1];break;case"Q":_=P[2];break;case"H":_=P[3];break;default:throw new Error("Unknwon error correction level: "+u)}if(p<=_)break;f++}if(f>Ws.length)throw new Error("Content too long");return f}function i(l){var u=encodeURI(l).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return u.length+(u.length!=l?3:0)}var s=this.options.content,o=n(s,this.options.ecl),c=r(this.options.ecl);this.qrcode=new Nt(o,c),this.qrcode.addData(s),this.qrcode.make()}gu.prototype.svg=function(e){var t=this.options||{},r=this.qrcode.modules;typeof e>"u"&&(e={container:t.container||"svg"});for(var n=typeof t.pretty<"u"?!!t.pretty:!0,i=n?" ":"",s=n?`\r +`:"",o=t.width,c=t.height,l=r.length,u=o/(l+2*t.padding),p=c/(l+2*t.padding),f=typeof t.join<"u"?!!t.join:!1,_=typeof t.swap<"u"?!!t.swap:!1,R=typeof t.xmlDeclaration<"u"?!!t.xmlDeclaration:!0,x=typeof t.predefined<"u"?!!t.predefined:!1,P=x?i+''+s:"",L=i+''+s,M="",k="",N=0;N'+s:M+=i+''+s}}f&&(M=i+'');let Q="";if(this.options.image!==void 0&&this.options.image.svg){const v=o*this.options.image.width/100,a=c*this.options.image.height/100,d=o/2-v/2,g=c/2-a/2;Q+=``,Q+=this.options.image.svg+s,Q+=""}var ie="";switch(e.container){case"svg":R&&(ie+=''+s),ie+=''+s,ie+=P+L+M,ie+=Q,ie+="";break;case"svg-viewbox":R&&(ie+=''+s),ie+=''+s,ie+=P+L+M,ie+=Q,ie+="";break;case"g":ie+=''+s,ie+=P+L+M,ie+=Q,ie+="";break;default:ie+=(P+L+M+Q).replace(/^\s+/,"");break}return ie};var y0=gu,w0=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(os,"__esModule",{value:!0});os.QRCode=void 0;const E0=ot,ac=rs,S0=w0(y0),R0=e=>{const[t,r]=(0,ac.useState)("");return(0,ac.useEffect)(()=>{var n,i;const s=new S0.default({content:e.content,background:e.bgColor||"#ffffff",color:e.fgColor||"#000000",container:"svg",ecl:"M",width:(n=e.width)!==null&&n!==void 0?n:256,height:(i=e.height)!==null&&i!==void 0?i:256,padding:0,image:e.image}),o=Buffer.from(s.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${o}`)},[e.bgColor,e.content,e.fgColor,e.height,e.image,e.width]),t?(0,E0.h)("img",{src:t,alt:"QR Code"}):null};os.QRCode=R0;var as={},Qo={};Object.defineProperty(Qo,"__esModule",{value:!0});Qo.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 M0=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(as,"__esModule",{value:!0});as.Spinner=void 0;const _i=ot,C0=M0(Qo),k0=e=>{var t;const r=(t=e.size)!==null&&t!==void 0?t:64,n=e.color||"#000";return(0,_i.h)("div",{class:"-cbwsdk-spinner"},(0,_i.h)("style",null,C0.default),(0,_i.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,_i.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};as.Spinner=k0;var Yo={};Object.defineProperty(Yo,"__esModule",{value:!0});Yo.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 _u=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ln,"__esModule",{value:!0});ln.CoinbaseWalletSteps=ln.ConnectContent=void 0;const Er=_u(ei),oe=ot,I0=z,x0=mn,A0=ns,T0=is,N0=ss,L0=os,O0=as,P0=_u(Yo),Vs={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:mu},$0=e=>e==="light"?"#FFFFFF":"#0A0B0D";function B0(e){const{theme:t}=e,r=(0,I0.createQrUrl)(e.sessionId,e.sessionSecret,e.linkAPIUrl,e.isParentConnection,e.version,e.chainId),n=Vs.steps;return(0,oe.h)("div",{"data-testid":"connect-content",className:(0,Er.default)("-cbwsdk-connect-content",t)},(0,oe.h)("style",null,P0.default),(0,oe.h)("div",{className:"-cbwsdk-connect-content-header"},(0,oe.h)("h2",{className:(0,Er.default)("-cbwsdk-connect-content-heading",t)},"Scan to connect with our mobile app"),e.onCancel&&(0,oe.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:e.onCancel},(0,oe.h)(A0.CloseIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,oe.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,oe.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,oe.h)(D0,{title:Vs.title,description:Vs.description,theme:t})),(0,oe.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,oe.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,oe.h)(L0.QRCode,{content:r,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,oe.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:x0.LIB_VERSION}),(0,oe.h)("input",{type:"hidden",value:r})),(0,oe.h)(n,{theme:t}),!e.isConnected&&(0,oe.h)("div",{"data-testid":"connecting-spinner",className:(0,Er.default)("-cbwsdk-connect-content-qr-connecting",t)},(0,oe.h)(O0.Spinner,{size:36,color:t==="dark"?"#FFF":"#000"}),(0,oe.h)("p",null,"Connecting...")))))}ln.ConnectContent=B0;function D0({title:e,description:t,theme:r}){return(0,oe.h)("div",{className:(0,Er.default)("-cbwsdk-connect-item",r)},(0,oe.h)("div",null,(0,oe.h)(T0.CoinbaseWalletRound,null)),(0,oe.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,oe.h)("h3",{className:"-cbwsdk-connect-item-title"},e),(0,oe.h)("p",{className:"-cbwsdk-connect-item-description"},t)))}function mu({theme:e}){return(0,oe.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,oe.h)("li",{className:(0,Er.default)("-cbwsdk-wallet-steps-item",e)},(0,oe.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,oe.h)("li",{className:(0,Er.default)("-cbwsdk-wallet-steps-item",e)},(0,oe.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,oe.h)("span",null,"Tap ",(0,oe.h)("strong",null,"Scan")," "),(0,oe.h)("span",{className:(0,Er.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,oe.h)(N0.QRCodeIcon,{fill:$0(e)})))))}ln.CoinbaseWalletSteps=mu;var cs={},ls={};Object.defineProperty(ls,"__esModule",{value:!0});ls.ArrowLeftIcon=void 0;const cc=ot;function F0(e){return(0,cc.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},e),(0,cc.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"}))}ls.ArrowLeftIcon=F0;var us={};Object.defineProperty(us,"__esModule",{value:!0});us.LaptopIcon=void 0;const qs=ot;function j0(e){return(0,qs.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,qs.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,qs.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"}))}us.LaptopIcon=j0;var hs={};Object.defineProperty(hs,"__esModule",{value:!0});hs.SafeIcon=void 0;const lc=ot;function H0(e){return(0,lc.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,lc.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"}))}hs.SafeIcon=H0;var Xo={};Object.defineProperty(Xo,"__esModule",{value:!0});Xo.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 vu=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(cs,"__esModule",{value:!0});cs.TryExtensionContent=void 0;const hr=vu(ei),Ge=ot,zs=rs,U0=ls,W0=us,V0=hs,q0=vu(Xo);function z0({theme:e}){const[t,r]=(0,zs.useState)(!1),n=(0,zs.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,zs.useCallback)(()=>{t?window.location.reload():(n(),r(!0))},[n,t]);return(0,Ge.h)("div",{class:(0,hr.default)("-cbwsdk-try-extension",e)},(0,Ge.h)("style",null,q0.default),(0,Ge.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Ge.h)("h3",{class:(0,hr.default)("-cbwsdk-try-extension-heading",e)},"Or try the Coinbase Wallet browser extension"),(0,Ge.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,Ge.h)("button",{class:(0,hr.default)("-cbwsdk-try-extension-cta",e),onClick:i},t?"Refresh":"Install"),(0,Ge.h)("div",null,!t&&(0,Ge.h)(U0.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:e==="light"?"#0052FF":"#588AF5"})))),(0,Ge.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Ge.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,Ge.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Ge.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Ge.h)("span",{class:(0,hr.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,Ge.h)(W0.LaptopIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Ge.h)("div",{class:(0,hr.default)("-cbwsdk-try-extension-list-item-copy",e)},"Connect with dapps with just one click on your desktop browser")),(0,Ge.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Ge.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Ge.h)("span",{class:(0,hr.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,Ge.h)(V0.SafeIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Ge.h)("div",{class:(0,hr.default)("-cbwsdk-try-extension-list-item-copy",e)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}cs.TryExtensionContent=z0;var ea={};Object.defineProperty(ea,"__esModule",{value:!0});ea.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 bu=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ts,"__esModule",{value:!0});ts.ConnectDialog=void 0;const Gs=bu(ei),dr=ot,Js=rs,G0=ln,J0=cs,Z0=bu(ea),K0=e=>{const{isOpen:t,darkMode:r}=e,[n,i]=(0,Js.useState)(!t),[s,o]=(0,Js.useState)(!t);(0,Js.useEffect)(()=>{const l=[window.setTimeout(()=>{o(!t)},10)];return t?i(!1):l.push(window.setTimeout(()=>{i(!0)},360)),()=>{l.forEach(window.clearTimeout)}},[t]);const c=r?"dark":"light";return(0,dr.h)("div",{class:(0,Gs.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,dr.h)("style",null,Z0.default),(0,dr.h)("div",{class:(0,Gs.default)("-cbwsdk-connect-dialog-backdrop",c,s&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,dr.h)("div",{class:"-cbwsdk-connect-dialog"},(0,dr.h)("div",{class:(0,Gs.default)("-cbwsdk-connect-dialog-box",s&&"-cbwsdk-connect-dialog-box-hidden")},e.connectDisabled?null:(0,dr.h)(G0.ConnectContent,{theme:c,version:e.version,sessionId:e.sessionId,sessionSecret:e.sessionSecret,linkAPIUrl:e.linkAPIUrl,isConnected:e.isConnected,isParentConnection:e.isParentConnection,chainId:e.chainId,onCancel:e.onCancel}),(0,dr.h)(J0.TryExtensionContent,{theme:c}))))};ts.ConnectDialog=K0;Object.defineProperty(Xi,"__esModule",{value:!0});Xi.LinkFlow=void 0;const Zs=ot,Q0=ts;class Y0{constructor(t){this.connected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=t.darkMode,this.version=t.version,this.sessionId=t.sessionId,this.sessionSecret=t.sessionSecret,this.linkAPIUrl=t.linkAPIUrl,this.isParentConnection=t.isParentConnection}attach(t){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",t.appendChild(this.root),this.render()}setConnected(t){this.connected!==t&&(this.connected=t,this.render())}setChainId(t){this.chainId!==t&&(this.chainId=t,this.render())}detach(){var t;this.root&&((0,Zs.render)(null,this.root),(t=this.root.parentElement)===null||t===void 0||t.removeChild(this.root))}setConnectDisabled(t){this.connectDisabled=t}open(t){this.isOpen=!0,this.onCancel=t.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){this.root&&(0,Zs.render)((0,Zs.h)(Q0.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)}}Xi.LinkFlow=Y0;var ta={},ra={};Object.defineProperty(ra,"__esModule",{value:!0});ra.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(e){var t=J&&J.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.SnackbarInstance=e.SnackbarContainer=e.Snackbar=void 0;const r=t(ei),n=ot,i=rs,s=t(ra),o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",c="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class l{constructor(_){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=_.darkMode}attach(_){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",_.appendChild(this.root),this.render()}presentItem(_){const R=this.nextItemKey++;return this.items.set(R,_),this.render(),()=>{this.items.delete(R),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(e.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([_,R])=>(0,n.h)(e.SnackbarInstance,Object.assign({},R,{key:_}))))),this.root)}}e.Snackbar=l;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));e.SnackbarContainer=u;const p=({autoExpand:f,message:_,menuItems:R})=>{const[x,P]=(0,i.useState)(!0),[L,M]=(0,i.useState)(f??!1);(0,i.useEffect)(()=>{const N=[window.setTimeout(()=>{P(!1)},1),window.setTimeout(()=>{M(!0)},1e4)];return()=>{N.forEach(window.clearTimeout)}});const k=()=>{M(!L)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",x&&"-cbwsdk-snackbar-instance-hidden",L&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:k},(0,n.h)("img",{src:o,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},_),(0,n.h)("div",{class:"-gear-container"},!L&&(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:c,class:"-gear-icon",title:"Expand"}))),R&&R.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},R.map((N,$)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",N.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:N.onClick,key:$},(0,n.h)("svg",{width:N.svgWidth,height:N.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":N.defaultFillRule,"clip-rule":N.defaultClipRule,d:N.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",N.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},N.info)))))};e.SnackbarInstance=p})(ta);Object.defineProperty(Kn,"__esModule",{value:!0});Kn.WalletLinkRelayUI=void 0;const X0=Qn,ep=Xi,tp=ta;class rp{constructor(t){this.standalone=null,this.attached=!1,this.snackbar=new tp.Snackbar({darkMode:t.darkMode}),this.linkFlow=new ep.LinkFlow({darkMode:t.darkMode,version:t.version,sessionId:t.session.id,sessionSecret:t.session.secret,linkAPIUrl:t.linkAPIUrl,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const t=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",t.appendChild(r),this.linkFlow.attach(r),this.snackbar.attach(r),this.attached=!0,(0,X0.injectCssReset)()}setConnected(t){this.linkFlow.setConnected(t)}setChainId(t){this.linkFlow.setChainId(t)}setConnectDisabled(t){this.linkFlow.setConnectDisabled(t)}addEthereumChain(){}watchAsset(){}switchEthereumChain(){}requestEthereumAccounts(t){this.linkFlow.open({onCancel:t.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}showConnecting(t){let r;return t.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:t.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:t.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:t.onResetConnection}]},this.snackbar.presentItem(r)}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(t){this.standalone=t}isStandalone(){var t;return(t=this.standalone)!==null&&t!==void 0?t:!1}}Kn.WalletLinkRelayUI=rp;Object.defineProperty(qn,"__esModule",{value:!0});qn.WalletLinkRelay=void 0;const Jr=jn,np=Je,Ue=z,fr=vn,uc=gt,zt=bn,ip=Ki,pr=_n,sp=Kn;class Dt extends uc.RelayAbstract{constructor(t){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 c;this.isLinked=o;const l=this.storage.getItem(uc.LOCAL_STORAGE_ADDRESSES_KEY);if(o&&(this.session.linked=o),this.isUnlinkedErrorState=!1,l){const u=l.split(" "),p=this.storage.getItem("IsStandaloneSigning")==="true";if(u[0]!==""&&!o&&this.session.linked&&!p){this.isUnlinkedErrorState=!0;const f=this.getSessionIdHash();(c=this.diagnostic)===null||c===void 0||c.log(fr.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:f})}}},this.metadataUpdated=(o,c)=>{this.storage.setItem(o,c)},this.chainUpdated=(o,c)=>{this.chainCallbackParams.chainId===o&&this.chainCallbackParams.jsonRpcUrl===c||(this.chainCallbackParams={chainId:o,jsonRpcUrl:c},this.chainCallback&&this.chainCallback(o,c))},this.accountUpdated=o=>{this.accountsCallback&&this.accountsCallback([o]),Dt.accountRequestCallbackIds.size>0&&(Array.from(Dt.accountRequestCallbackIds.values()).forEach(c=>{const l={type:"WEB3_RESPONSE",id:c,response:{method:"requestEthereumAccounts",result:[o]}};this.invokeCallback(Object.assign(Object.assign({},l),{id:c}))}),Dt.accountRequestCallbackIds.clear())},this.connectedUpdated=o=>{this.ui.setConnected(o)},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=t.linkAPIUrl,this.storage=t.storage,this.options=t;const{session:n,ui:i,connection:s}=this.subscribe();this._session=n,this.connection=s,this.relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this._reloadOnDisconnect=(r=t.reloadOnDisconnect)!==null&&r!==void 0?r:!0,this.ui=i}subscribe(){const t=zt.Session.load(this.storage)||new zt.Session(this.storage).save(),{linkAPIUrl:r,diagnostic:n}=this,i=new ip.WalletLinkConnection({session:t,linkAPIUrl:r,diagnostic:n,listener:this}),{version:s,darkMode:o}=this.options,c=this.options.uiConstructor({linkAPIUrl:r,version:s,darkMode:o,session:t});return i.connect(),{session:t,ui:c,connection:i}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(t=>setTimeout(()=>t(null),1e3))]).then(()=>{var t,r;const n=this.ui.isStandalone();(t=this.diagnostic)===null||t===void 0||t.log(fr.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const i=zt.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(fr.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:zt.Session.hash(i.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);const{session:s,ui:o,connection:c}=this.subscribe();this._session=s,this.connection=c,this.ui=o,n&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.attachUI()}).catch(t=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(fr.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${t}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(t,r){this.appName=t,this.appLogoUrl=r}getStorageItem(t){return this.storage.getItem(t)}get session(){return this._session}setStorageItem(t,r){this.storage.setItem(t,r)}signEthereumMessage(t,r,n,i){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,Ue.hexStringFromBuffer)(t,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(t,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,Ue.hexStringFromBuffer)(t,!0),signature:(0,Ue.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,Ue.bigIntStringFromBN)(t.weiValue),data:(0,Ue.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,Ue.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.gasPriceInWei?(0,Ue.bigIntStringFromBN)(t.gasPriceInWei):null,maxPriorityFeePerGas:t.gasPriceInWei?(0,Ue.bigIntStringFromBN)(t.gasPriceInWei):null,gasLimit:t.gasLimit?(0,Ue.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,Ue.bigIntStringFromBN)(t.weiValue),data:(0,Ue.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,Ue.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.maxFeePerGas?(0,Ue.bigIntStringFromBN)(t.maxFeePerGas):null,maxPriorityFeePerGas:t.maxPriorityFeePerGas?(0,Ue.bigIntStringFromBN)(t.maxPriorityFeePerGas):null,gasLimit:t.gasLimit?(0,Ue.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!0}})}submitEthereumTransaction(t,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,Ue.hexStringFromBuffer)(t,!0),chainId:r}})}scanQRCode(t){return this.sendRequest({method:"scanQRCode",params:{regExp:t}})}getQRCodeUrl(){return(0,Ue.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(t,r){return this.sendRequest({method:"generic",params:{action:r,data:t}})}sendGenericMessage(t){return this.sendRequest(t)}sendRequest(t){let r=null;const n=(0,Ue.randomBytesHex)(8),i=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,t.method,o),r==null||r()};return{promise:new Promise((o,c)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,l=>{if(r==null||r(),(0,pr.isErrorResponse)(l))return c(new Error(l.errorMessage));o(l)}),this.ui.isStandalone()?this.sendRequestStandalone(n,t):this.publishWeb3RequestEvent(n,t)}),cancel:i}}setConnectDisabled(t){this.ui.setConnectDisabled(t)}setAccountsCallback(t){this.accountsCallback=t}setChainCallback(t){this.chainCallback=t}setDappDefaultChainCallback(t){this.dappDefaultChain=t,this.ui instanceof sp.WalletLinkRelayUI&&this.ui.setChainId(t)}publishWeb3RequestEvent(t,r){var n;const i={type:"WEB3_REQUEST",id:t,request:r},s=zt.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(fr.EVENTS.WEB3_REQUEST,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?zt.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()}),this.publishEvent("Web3Request",i,!0).then(o=>{var c;(c=this.diagnostic)===null||c===void 0||c.log(fr.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?zt.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(t){const r={type:"WEB3_REQUEST_CANCELED",id:t};this.publishEvent("Web3RequestCanceled",r,!1).then()}publishEvent(t,r,n){return this.connection.publishEvent(t,r,n)}handleWeb3ResponseMessage(t){var r;const{response:n}=t;if((r=this.diagnostic)===null||r===void 0||r.log(fr.EVENTS.WEB3_RESPONSE,{eventId:t.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),n.method==="requestEthereumAccounts"){Dt.accountRequestCallbackIds.forEach(i=>this.invokeCallback(Object.assign(Object.assign({},t),{id:i}))),Dt.accountRequestCallbackIds.clear();return}this.invokeCallback(t)}handleErrorResponse(t,r,n,i){var s;const o=(s=n==null?void 0:n.message)!==null&&s!==void 0?s:(0,Jr.getMessageFromCode)(i);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:{method:r,errorMessage:o,errorCode:i}})}invokeCallback(t){const r=this.relayEventManager.callbacks.get(t.id);r&&(r(t.response),this.relayEventManager.callbacks.delete(t.id))}requestEthereumAccounts(){const t={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=(0,Ue.randomBytesHex)(8),n=s=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,t.method,s)};return{promise:new Promise((s,o)=>{if(this.relayEventManager.callbacks.set(r,c=>{if(this.ui.hideRequestEthereumAccounts(),(0,pr.isErrorResponse)(c))return o(new Error(c.errorMessage));s(c)}),this.ui.inlineAccountsResponse()){const c=l=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:r,response:{method:"requestEthereumAccounts",result:l}})};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:c})}else{const c=Jr.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(c)})}Dt.accountRequestCallbackIds.add(r),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(r,t)}),cancel:n}}selectProvider(t){const r={method:"selectProvider",params:{providerOptions:t}},n=(0,Ue.randomBytesHex)(8),i=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,o)},s=new Promise((o,c)=>{this.relayEventManager.callbacks.set(n,p=>{if((0,pr.isErrorResponse)(p))return c(new Error(p.errorMessage));o(p)});const l=p=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:np.ProviderType.Unselected}})},u=p=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:p}})};this.ui.selectProvider&&this.ui.selectProvider({onApprove:u,onCancel:l,providerOptions:t})});return{cancel:i,promise:s}}watchAsset(t,r,n,i,s,o){const c={method:"watchAsset",params:{type:t,options:{address:r,symbol:n,decimals:i,image:s},chainId:o}};let l=null;const u=(0,Ue.randomBytesHex)(8),p=_=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,c.method,_),l==null||l()};this.ui.inlineWatchAsset()||(l=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:p,onResetConnection:this.resetAndReload}));const f=new Promise((_,R)=>{this.relayEventManager.callbacks.set(u,L=>{if(l==null||l(),(0,pr.isErrorResponse)(L))return R(new Error(L.errorMessage));_(L)});const x=L=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:u,response:{method:"watchAsset",result:!1}})},P=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:u,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:P,onCancel:x,type:t,address:r,symbol:n,decimals:i,image:s,chainId:o}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(u,c)});return{cancel:p,promise:f}}addEthereumChain(t,r,n,i,s,o){const c={method:"addEthereumChain",params:{chainId:t,rpcUrls:r,blockExplorerUrls:i,chainName:s,iconUrls:n,nativeCurrency:o}};let l=null;const u=(0,Ue.randomBytesHex)(8),p=_=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,c.method,_),l==null||l()};return this.ui.inlineAddEthereumChain(t)||(l=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:p,onResetConnection:this.resetAndReload})),{promise:new Promise((_,R)=>{this.relayEventManager.callbacks.set(u,L=>{if(l==null||l(),(0,pr.isErrorResponse)(L))return R(new Error(L.errorMessage));_(L)});const x=L=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:u,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},P=L=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:u,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:L}}})};this.ui.inlineAddEthereumChain(t)&&this.ui.addEthereumChain({onCancel:x,onApprove:P,chainId:c.params.chainId,rpcUrls:c.params.rpcUrls,blockExplorerUrls:c.params.blockExplorerUrls,chainName:c.params.chainName,iconUrls:c.params.iconUrls,nativeCurrency:c.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(t)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(u,c)}),cancel:p}}switchEthereumChain(t,r){const n={method:"switchEthereumChain",params:Object.assign({chainId:t},{address:r})},i=(0,Ue.randomBytesHex)(8),s=c=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,n.method,c)};return{promise:new Promise((c,l)=>{this.relayEventManager.callbacks.set(i,f=>{if((0,pr.isErrorResponse)(f)&&f.errorCode)return l(Jr.standardErrors.provider.custom({code:f.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,pr.isErrorResponse)(f))return l(new Error(f.errorMessage));c(f)});const u=f=>{var _;if(f){const R=(_=(0,Jr.getErrorCode)(f))!==null&&_!==void 0?_:Jr.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(i,"switchEthereumChain",f instanceof Error?f:Jr.standardErrors.provider.unsupportedChain(t),R)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},p=f=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:f}}})};this.ui.switchEthereumChain({onCancel:u,onApprove:p,chainId:n.params.chainId,address:n.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(i,n)}),cancel:s}}inlineAddEthereumChain(t){return this.ui.inlineAddEthereumChain(t)}getSessionIdHash(){return zt.Session.hash(this._session.id)}sendRequestStandalone(t,r){const n=s=>{this.handleErrorResponse(t,r.method,s)},i=s=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,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}}}qn.WalletLinkRelay=Dt;Dt.accountRequestCallbackIds=new Set;var ti={},ds={},yu={};(function(e){var t=J&&J.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s);var c=Object.getOwnPropertyDescriptor(i,s);(!c||("get"in c?!i.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,o,c)}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=J&&J.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(ta,e)})(yu);var na={};Object.defineProperty(na,"__esModule",{value:!0});na.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 wu=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ds,"__esModule",{value:!0});ds.RedirectDialog=void 0;const op=wu(ei),At=ot,ap=Qn,cp=yu,lp=wu(na);class up{constructor(){this.root=null}attach(){const t=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",t.appendChild(this.root),(0,ap.injectCssReset)()}present(t){this.render(t)}clear(){this.render(null)}render(t){this.root&&((0,At.render)(null,this.root),t&&(0,At.render)((0,At.h)(hp,Object.assign({},t,{onDismiss:()=>{this.clear()}})),this.root))}}ds.RedirectDialog=up;const hp=({title:e,buttonText:t,darkMode:r,onButtonClick:n,onDismiss:i})=>{const s=r?"dark":"light";return(0,At.h)(cp.SnackbarContainer,{darkMode:r},(0,At.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,At.h)("style",null,lp.default),(0,At.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:i}),(0,At.h)("div",{class:(0,op.default)("-cbwsdk-redirect-dialog-box",s)},(0,At.h)("p",null,e),(0,At.h)("button",{onClick:n},t))))};Object.defineProperty(ti,"__esModule",{value:!0});ti.MobileRelayUI=void 0;const dp=ds;class fp{constructor(t){this.attached=!1,this.darkMode=!1,this.openedWindow=null,this.redirectDialog=new dp.RedirectDialog,this.darkMode=t.darkMode}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}setConnected(t){}closeOpenedWindow(){var t;(t=this.openedWindow)===null||t===void 0||t.close(),this.openedWindow=null}redirectToCoinbaseWallet(t){const r=new URL("https://go.cb-w.com/walletlink");r.searchParams.append("redirect_url",window.location.href),t&&r.searchParams.append("wl_url",t),this.openedWindow=window.open(r.href,"cbw-opener"),this.openedWindow&&setTimeout(()=>this.closeOpenedWindow(),5e3)}openCoinbaseWalletDeeplink(t){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",darkMode:this.darkMode,onButtonClick:()=>{this.redirectToCoinbaseWallet(t)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(t)},99)}showConnecting(t){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}}ti.MobileRelayUI=fp;Object.defineProperty(Vn,"__esModule",{value:!0});Vn.MobileRelay=void 0;const pp=z,gp=qn,hc=ti;class _p extends gp.WalletLinkRelay{constructor(t){var r;super(t),this._enableMobileWalletLink=(r=t.enableMobileWalletLink)!==null&&r!==void 0?r:!1}requestEthereumAccounts(){return this._enableMobileWalletLink?super.requestEthereumAccounts():{promise:new Promise(()=>{const t=(0,pp.getLocation)();t.href=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(t.href)}`}),cancel:()=>{}}}publishWeb3RequestEvent(t,r){if(super.publishWeb3RequestEvent(t,r),!(this._enableMobileWalletLink&&this.ui instanceof hc.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(t){super.handleWeb3ResponseMessage(t),this._enableMobileWalletLink&&this.ui instanceof hc.MobileRelayUI&&this.ui.closeOpenedWindow()}connectAndSignIn(t){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:t.nonce,iat:new Date().toISOString(),chainId:`eip155:${this.dappDefaultChain}`,statement:t.statement,resources:t.resources}})}}Vn.MobileRelay=_p;var To={exports:{}},Eu=Di.EventEmitter,Ks,dc;function mp(){if(dc)return Ks;dc=1;function e(x,P){var L=Object.keys(x);if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(x);P&&(M=M.filter(function(k){return Object.getOwnPropertyDescriptor(x,k).enumerable})),L.push.apply(L,M)}return L}function t(x){for(var P=1;P0?this.tail.next=M:this.head=M,this.tail=M,++this.length}},{key:"unshift",value:function(L){var M={data:L,next:this.head};this.length===0&&(this.tail=M),this.head=M,++this.length}},{key:"shift",value:function(){if(this.length!==0){var L=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,L}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(L){if(this.length===0)return"";for(var M=this.head,k=""+M.data;M=M.next;)k+=L+M.data;return k}},{key:"concat",value:function(L){if(this.length===0)return u.alloc(0);for(var M=u.allocUnsafe(L>>>0),k=this.head,N=0;k;)R(k.data,M,N),N+=k.data.length,k=k.next;return M}},{key:"consume",value:function(L,M){var k;return L$.length?$.length:L;if(O===$.length?N+=$:N+=$.slice(0,L),L-=O,L===0){O===$.length?(++k,M.next?this.head=M.next:this.head=this.tail=null):(this.head=M,M.data=$.slice(O));break}++k}return this.length-=k,N}},{key:"_getBuffer",value:function(L){var M=u.allocUnsafe(L),k=this.head,N=1;for(k.data.copy(M),L-=k.data.length;k=k.next;){var $=k.data,O=L>$.length?$.length:L;if($.copy(M,M.length-L,0,O),L-=O,L===0){O===$.length?(++N,k.next?this.head=k.next:this.head=this.tail=null):(this.head=k,k.data=$.slice(O));break}++N}return this.length-=N,M}},{key:_,value:function(L,M){return f(this,t(t({},M),{},{depth:0,customInspect:!1}))}}]),x}(),Ks}function vp(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(No,this,e)):process.nextTick(No,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(s){!t&&s?r._writableState?r._writableState.errorEmitted?process.nextTick(xi,r):(r._writableState.errorEmitted=!0,process.nextTick(fc,r,s)):process.nextTick(fc,r,s):t?(process.nextTick(xi,r),t(s)):process.nextTick(xi,r)}),this)}function fc(e,t){No(e,t),xi(e)}function xi(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function bp(){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 No(e,t){e.emit("error",t)}function yp(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}var Su={destroy:vp,undestroy:bp,errorOrDestroy:yp},Tr={};function wp(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var Ru={};function vt(e,t,r){r||(r=Error);function n(s,o,c){return typeof t=="string"?t:t(s,o,c)}var i=function(s){wp(o,s);function o(c,l,u){return s.call(this,n(c,l,u))||this}return o}(r);i.prototype.name=r.name,i.prototype.code=e,Ru[e]=i}function pc(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(n){return String(n)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:r===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function Ep(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function Sp(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function Rp(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}vt("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);vt("ERR_INVALID_ARG_TYPE",function(e,t,r){var n;typeof t=="string"&&Ep(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";var i;if(Sp(e," argument"))i="The ".concat(e," ").concat(n," ").concat(pc(t,"type"));else{var s=Rp(e,".")?"property":"argument";i='The "'.concat(e,'" ').concat(s," ").concat(n," ").concat(pc(t,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);vt("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");vt("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});vt("ERR_STREAM_PREMATURE_CLOSE","Premature close");vt("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});vt("ERR_MULTIPLE_CALLBACK","Callback called multiple times");vt("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");vt("ERR_STREAM_WRITE_AFTER_END","write after end");vt("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);vt("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);vt("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Tr.codes=Ru;var Mp=Tr.codes.ERR_INVALID_OPT_VALUE;function Cp(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function kp(e,t,r,n){var i=Cp(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var s=n?r:"highWaterMark";throw new Mp(s,i)}return Math.floor(i)}return e.objectMode?16:16*1024}var Mu={getHighWaterMark:kp},Ip=xp;function xp(e,t){if(Qs("noDeprecation"))return e;var r=!1;function n(){if(!r){if(Qs("throwDeprecation"))throw new Error(t);Qs("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}return n}function Qs(e){try{if(!J.localStorage)return!1}catch{return!1}var t=J.localStorage[e];return t==null?!1:String(t).toLowerCase()==="true"}var Ys,gc;function Cu(){if(gc)return Ys;gc=1,Ys=V;function e(I){var T=this;this.next=null,this.entry=null,this.finish=function(){q(T,I)}}var t;V.WritableState=D;var r={deprecate:Ip},n=Eu,i=Fn.Buffer,s=(typeof J<"u"?J:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function o(I){return i.from(I)}function c(I){return i.isBuffer(I)||I instanceof s}var l=Su,u=Mu,p=u.getHighWaterMark,f=Tr.codes,_=f.ERR_INVALID_ARG_TYPE,R=f.ERR_METHOD_NOT_IMPLEMENTED,x=f.ERR_MULTIPLE_CALLBACK,P=f.ERR_STREAM_CANNOT_PIPE,L=f.ERR_STREAM_DESTROYED,M=f.ERR_STREAM_NULL_VALUES,k=f.ERR_STREAM_WRITE_AFTER_END,N=f.ERR_UNKNOWN_ENCODING,$=l.errorOrDestroy;Et(V,n);function O(){}function D(I,T,B){t=t||un(),I=I||{},typeof B!="boolean"&&(B=T instanceof t),this.objectMode=!!I.objectMode,B&&(this.objectMode=this.objectMode||!!I.writableObjectMode),this.highWaterMark=p(this,I,"writableHighWaterMark",B),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var U=I.decodeStrings===!1;this.decodeStrings=!U,this.defaultEncoding=I.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(te){g(T,te)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=I.emitClose!==!1,this.autoDestroy=!!I.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}D.prototype.getBuffer=function(){for(var T=this.bufferedRequest,B=[];T;)B.push(T),T=T.next;return B},function(){try{Object.defineProperty(D.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var G;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(G=Function.prototype[Symbol.hasInstance],Object.defineProperty(V,Symbol.hasInstance,{value:function(T){return G.call(this,T)?!0:this!==V?!1:T&&T._writableState instanceof D}})):G=function(T){return T instanceof this};function V(I){t=t||un();var T=this instanceof t;if(!T&&!G.call(V,this))return new V(I);this._writableState=new D(I,this,T),this.writable=!0,I&&(typeof I.write=="function"&&(this._write=I.write),typeof I.writev=="function"&&(this._writev=I.writev),typeof I.destroy=="function"&&(this._destroy=I.destroy),typeof I.final=="function"&&(this._final=I.final)),n.call(this)}V.prototype.pipe=function(){$(this,new P)};function H(I,T){var B=new k;$(I,B),process.nextTick(T,B)}function X(I,T,B,U){var te;return B===null?te=new M:typeof B!="string"&&!T.objectMode&&(te=new _("chunk",["string","Buffer"],B)),te?($(I,te),process.nextTick(U,te),!1):!0}V.prototype.write=function(I,T,B){var U=this._writableState,te=!1,w=!U.objectMode&&c(I);return w&&!i.isBuffer(I)&&(I=o(I)),typeof T=="function"&&(B=T,T=null),w?T="buffer":T||(T=U.defaultEncoding),typeof B!="function"&&(B=O),U.ending?H(this,B):(w||X(this,U,I,B))&&(U.pendingcb++,te=ie(this,U,w,I,T,B)),te},V.prototype.cork=function(){this._writableState.corked++},V.prototype.uncork=function(){var I=this._writableState;I.corked&&(I.corked--,!I.writing&&!I.corked&&!I.bufferProcessing&&I.bufferedRequest&&C(this,I))},V.prototype.setDefaultEncoding=function(T){if(typeof T=="string"&&(T=T.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((T+"").toLowerCase())>-1))throw new N(T);return this._writableState.defaultEncoding=T,this},Object.defineProperty(V.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Q(I,T,B){return!I.objectMode&&I.decodeStrings!==!1&&typeof T=="string"&&(T=i.from(T,B)),T}Object.defineProperty(V.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function ie(I,T,B,U,te,w){if(!B){var E=Q(T,U,te);U!==E&&(B=!0,te="buffer",U=E)}var F=T.objectMode?1:U.length;T.length+=F;var j=T.length */var mc;function Ap(){return mc||(mc=1,function(e,t){var r=Fn,n=r.Buffer;function i(o,c){for(var l in o)c[l]=o[l]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=s);function s(o,c,l){return n(o,c,l)}s.prototype=Object.create(n.prototype),i(n,s),s.from=function(o,c,l){if(typeof o=="number")throw new TypeError("Argument must not be a number");return n(o,c,l)},s.alloc=function(o,c,l){if(typeof o!="number")throw new TypeError("Argument must be a number");var u=n(o);return c!==void 0?typeof l=="string"?u.fill(c,l):u.fill(c):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)}}(mi,mi.exports)),mi.exports}var vc;function bc(){if(vc)return eo;vc=1;var e=Ap().Buffer,t=e.isEncoding||function(M){switch(M=""+M,M&&M.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(M){if(!M)return"utf8";for(var k;;)switch(M){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return M;default:if(k)return;M=(""+M).toLowerCase(),k=!0}}function n(M){var k=r(M);if(typeof k!="string"&&(e.isEncoding===t||!t(M)))throw new Error("Unknown encoding: "+M);return k||M}eo.StringDecoder=i;function i(M){this.encoding=n(M);var k;switch(this.encoding){case"utf16le":this.text=f,this.end=_,k=4;break;case"utf8":this.fillLast=l,k=4;break;case"base64":this.text=R,this.end=x,k=3;break;default:this.write=P,this.end=L;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(k)}i.prototype.write=function(M){if(M.length===0)return"";var k,N;if(this.lastNeed){if(k=this.fillLast(M),k===void 0)return"";N=this.lastNeed,this.lastNeed=0}else N=0;return N>5===6?2:M>>4===14?3:M>>3===30?4:M>>6===2?-1:-2}function o(M,k,N){var $=k.length-1;if($=0?(O>0&&(M.lastNeed=O-1),O):--$=0?(O>0&&(M.lastNeed=O-2),O):--$=0?(O>0&&(O===2?O=0:M.lastNeed=O-3),O):0))}function c(M,k,N){if((k[0]&192)!==128)return M.lastNeed=0,"�";if(M.lastNeed>1&&k.length>1){if((k[1]&192)!==128)return M.lastNeed=1,"�";if(M.lastNeed>2&&k.length>2&&(k[2]&192)!==128)return M.lastNeed=2,"�"}}function l(M){var k=this.lastTotal-this.lastNeed,N=c(this,M);if(N!==void 0)return N;if(this.lastNeed<=M.length)return M.copy(this.lastChar,k,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);M.copy(this.lastChar,k,0,M.length),this.lastNeed-=M.length}function u(M,k){var N=o(this,M,k);if(!this.lastNeed)return M.toString("utf8",k);this.lastTotal=N;var $=M.length-(N-this.lastNeed);return M.copy(this.lastChar,0,$),M.toString("utf8",k,$)}function p(M){var k=M&&M.length?this.write(M):"";return this.lastNeed?k+"�":k}function f(M,k){if((M.length-k)%2===0){var N=M.toString("utf16le",k);if(N){var $=N.charCodeAt(N.length-1);if($>=55296&&$<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=M[M.length-2],this.lastChar[1]=M[M.length-1],N.slice(0,-1)}return N}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=M[M.length-1],M.toString("utf16le",k,M.length-1)}function _(M){var k=M&&M.length?this.write(M):"";if(this.lastNeed){var N=this.lastTotal-this.lastNeed;return k+this.lastChar.toString("utf16le",0,N)}return k}function R(M,k){var N=(M.length-k)%3;return N===0?M.toString("base64",k):(this.lastNeed=3-N,this.lastTotal=3,N===1?this.lastChar[0]=M[M.length-1]:(this.lastChar[0]=M[M.length-2],this.lastChar[1]=M[M.length-1]),M.toString("base64",k,M.length-N))}function x(M){var k=M&&M.length?this.write(M):"";return this.lastNeed?k+this.lastChar.toString("base64",0,3-this.lastNeed):k}function P(M){return M.toString(this.encoding)}function L(M){return M&&M.length?this.write(M):""}return eo}var yc=Tr.codes.ERR_STREAM_PREMATURE_CLOSE;function Tp(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i0)if(typeof E!="string"&&!ee.objectMode&&Object.getPrototypeOf(E)!==n.prototype&&(E=s(E)),j)ee.endEmitted?O(w,new M):Q(w,ee,E,!0);else if(ee.ended)O(w,new P);else{if(ee.destroyed)return!1;ee.reading=!1,ee.decoder&&!F?(E=ee.decoder.write(E),ee.objectMode||E.length!==0?Q(w,ee,E,!1):C(w,ee)):Q(w,ee,E,!1)}else j||(ee.reading=!1,C(w,ee))}return!ee.ended&&(ee.length=v?w=v:(w--,w|=w>>>1,w|=w>>>2,w|=w>>>4,w|=w>>>8,w|=w>>>16,w++),w}function d(w,E){return w<=0||E.length===0&&E.ended?0:E.objectMode?1:w!==w?E.flowing&&E.length?E.buffer.head.data.length:E.length:(w>E.highWaterMark&&(E.highWaterMark=a(w)),w<=E.length?w:E.ended?E.length:(E.needReadable=!0,0))}H.prototype.read=function(w){l("read",w),w=parseInt(w,10);var E=this._readableState,F=w;if(w!==0&&(E.emittedReadable=!1),w===0&&E.needReadable&&((E.highWaterMark!==0?E.length>=E.highWaterMark:E.length>0)||E.ended))return l("read: emitReadable",E.length,E.ended),E.length===0&&E.ended?B(this):m(this),null;if(w=d(w,E),w===0&&E.ended)return E.length===0&&B(this),null;var j=E.needReadable;l("need readable",j),(E.length===0||E.length-w0?K=T(w,E):K=null,K===null?(E.needReadable=E.length<=E.highWaterMark,w=0):(E.length-=w,E.awaitDrain=0),E.length===0&&(E.ended||(E.needReadable=!0),F!==w&&E.ended&&B(this)),K!==null&&this.emit("data",K),K};function g(w,E){if(l("onEofChunk"),!E.ended){if(E.decoder){var F=E.decoder.end();F&&F.length&&(E.buffer.push(F),E.length+=E.objectMode?1:F.length)}E.ended=!0,E.sync?m(w):(E.needReadable=!1,E.emittedReadable||(E.emittedReadable=!0,y(w)))}}function m(w){var E=w._readableState;l("emitReadable",E.needReadable,E.emittedReadable),E.needReadable=!1,E.emittedReadable||(l("emitReadable",E.flowing),E.emittedReadable=!0,process.nextTick(y,w))}function y(w){var E=w._readableState;l("emitReadable_",E.destroyed,E.length,E.ended),!E.destroyed&&(E.length||E.ended)&&(w.emit("readable"),E.emittedReadable=!1),E.needReadable=!E.flowing&&!E.ended&&E.length<=E.highWaterMark,I(w)}function C(w,E){E.readingMore||(E.readingMore=!0,process.nextTick(A,w,E))}function A(w,E){for(;!E.reading&&!E.ended&&(E.length1&&te(j.pipes,w)!==-1)&&!ge&&(l("false write response, pause",j.awaitDrain),j.awaitDrain++),F.pause())}function de(ue){l("onerror",ue),he(),w.removeListener("error",de),t(w,"error")===0&&O(w,ue)}G(w,"error",de);function fe(){w.removeListener("finish",Pt),he()}w.once("close",fe);function Pt(){l("onfinish"),w.removeListener("close",fe),he()}w.once("finish",Pt);function he(){l("unpipe"),F.unpipe(w)}return w.emit("pipe",F),j.flowing||(l("pipe resume"),F.resume()),w};function b(w){return function(){var F=w._readableState;l("pipeOnDrain",F.awaitDrain),F.awaitDrain&&F.awaitDrain--,F.awaitDrain===0&&t(w,"data")&&(F.flowing=!0,I(w))}}H.prototype.unpipe=function(w){var E=this._readableState,F={hasUnpiped:!1};if(E.pipesCount===0)return this;if(E.pipesCount===1)return w&&w!==E.pipes?this:(w||(w=E.pipes),E.pipes=null,E.pipesCount=0,E.flowing=!1,w&&w.emit("unpipe",this,F),this);if(!w){var j=E.pipes,K=E.pipesCount;E.pipes=null,E.pipesCount=0,E.flowing=!1;for(var ee=0;ee0,j.flowing!==!1&&this.resume()):w==="readable"&&!j.endEmitted&&!j.readableListening&&(j.readableListening=j.needReadable=!0,j.flowing=!1,j.emittedReadable=!1,l("on readable",j.length,j.reading),j.length?m(this):j.reading||process.nextTick(S,this)),F},H.prototype.addListener=H.prototype.on,H.prototype.removeListener=function(w,E){var F=r.prototype.removeListener.call(this,w,E);return w==="readable"&&process.nextTick(h,this),F},H.prototype.removeAllListeners=function(w){var E=r.prototype.removeAllListeners.apply(this,arguments);return(w==="readable"||w===void 0)&&process.nextTick(h,this),E};function h(w){var E=w._readableState;E.readableListening=w.listenerCount("readable")>0,E.resumeScheduled&&!E.paused?E.flowing=!0:w.listenerCount("data")>0&&w.resume()}function S(w){l("readable nexttick read 0"),w.read(0)}H.prototype.resume=function(){var w=this._readableState;return w.flowing||(l("resume"),w.flowing=!w.readableListening,W(this,w)),w.paused=!1,this};function W(w,E){E.resumeScheduled||(E.resumeScheduled=!0,process.nextTick(q,w,E))}function q(w,E){l("resume",E.reading),E.reading||w.read(0),E.resumeScheduled=!1,w.emit("resume"),I(w),E.flowing&&!E.reading&&w.read(0)}H.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function I(w){var E=w._readableState;for(l("flow",E.flowing);E.flowing&&w.read()!==null;);}H.prototype.wrap=function(w){var E=this,F=this._readableState,j=!1;w.on("end",function(){if(l("wrapped end"),F.decoder&&!F.ended){var Z=F.decoder.end();Z&&Z.length&&E.push(Z)}E.push(null)}),w.on("data",function(Z){if(l("wrapped data"),F.decoder&&(Z=F.decoder.write(Z)),!(F.objectMode&&Z==null)&&!(!F.objectMode&&(!Z||!Z.length))){var le=E.push(Z);le||(j=!0,w.pause())}});for(var K in w)this[K]===void 0&&typeof w[K]=="function"&&(this[K]=function(le){return function(){return w[le].apply(w,arguments)}}(K));for(var ee=0;ee=E.length?(E.decoder?F=E.buffer.join(""):E.buffer.length===1?F=E.buffer.first():F=E.buffer.concat(E.length),E.buffer.clear()):F=E.buffer.consume(w,E.decoder),F}function B(w){var E=w._readableState;l("endReadable",E.endEmitted),E.endEmitted||(E.ended=!0,process.nextTick(U,E,w))}function U(w,E){if(l("endReadableNT",w.endEmitted,w.length),!w.endEmitted&&w.length===0&&(w.endEmitted=!0,E.readable=!1,E.emit("end"),w.autoDestroy)){var F=E._writableState;(!F||F.autoDestroy&&F.finished)&&E.destroy()}}typeof Symbol=="function"&&(H.from=function(w,E){return $===void 0&&($=Pp()),$(H,w,E)});function te(w,E){for(var F=0,j=w.length;F0;return Gp(o,l,u,function(p){i||(i=p),p&&s.forEach(Cc),!l&&(s.forEach(Cc),n(i))})});return t.reduce(Jp)}var Qp=Kp;(function(e,t){t=e.exports=Iu(),t.Stream=t,t.Readable=t,t.Writable=Cu(),t.Duplex=un(),t.Transform=xu,t.PassThrough=Up,t.finished=ia,t.pipeline=Qp})(To,To.exports);var Nu=To.exports;const{Transform:Yp}=Nu;var Xp=e=>class Lu extends Yp{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 e,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 Lu(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:e1}=Nu;var t1=e=>class Ou extends e1{constructor(r,n,i,s){super(s),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._options=s,this._state=new e,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 Ou(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const r1=Xp,n1=t1;var i1=function(e){const t=r1(e),r=n1(e);return function(n,i){switch(typeof n=="string"?n.toLowerCase():n){case"keccak224":return new t(1152,448,null,224,i);case"keccak256":return new t(1088,512,null,256,i);case"keccak384":return new t(832,768,null,384,i);case"keccak512":return new t(576,1024,null,512,i);case"sha3-224":return new t(1152,448,6,224,i);case"sha3-256":return new t(1088,512,6,256,i);case"sha3-384":return new t(832,768,6,384,i);case"sha3-512":return new t(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)}}},Pu={};const kc=[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];Pu.p1600=function(e){for(let t=0;t<24;++t){const r=e[0]^e[10]^e[20]^e[30]^e[40],n=e[1]^e[11]^e[21]^e[31]^e[41],i=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],o=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],l=e[6]^e[16]^e[26]^e[36]^e[46],u=e[7]^e[17]^e[27]^e[37]^e[47],p=e[8]^e[18]^e[28]^e[38]^e[48],f=e[9]^e[19]^e[29]^e[39]^e[49];let _=p^(i<<1|s>>>31),R=f^(s<<1|i>>>31);const x=e[0]^_,P=e[1]^R,L=e[10]^_,M=e[11]^R,k=e[20]^_,N=e[21]^R,$=e[30]^_,O=e[31]^R,D=e[40]^_,G=e[41]^R;_=r^(o<<1|c>>>31),R=n^(c<<1|o>>>31);const V=e[2]^_,H=e[3]^R,X=e[12]^_,Q=e[13]^R,ie=e[22]^_,v=e[23]^R,a=e[32]^_,d=e[33]^R,g=e[42]^_,m=e[43]^R;_=i^(l<<1|u>>>31),R=s^(u<<1|l>>>31);const y=e[4]^_,C=e[5]^R,A=e[14]^_,b=e[15]^R,h=e[24]^_,S=e[25]^R,W=e[34]^_,q=e[35]^R,I=e[44]^_,T=e[45]^R;_=o^(p<<1|f>>>31),R=c^(f<<1|p>>>31);const B=e[6]^_,U=e[7]^R,te=e[16]^_,w=e[17]^R,E=e[26]^_,F=e[27]^R,j=e[36]^_,K=e[37]^R,ee=e[46]^_,Z=e[47]^R;_=l^(r<<1|n>>>31),R=u^(n<<1|r>>>31);const le=e[8]^_,Mt=e[9]^R,ge=e[18]^_,_e=e[19]^R,Vt=e[28]^_,de=e[29]^R,fe=e[38]^_,Pt=e[39]^R,he=e[48]^_,ue=e[49]^R,ct=x,me=P,ve=M<<4|L>>>28,Or=L<<4|M>>>28,be=k<<3|N>>>29,ye=N<<3|k>>>29,Pr=O<<9|$>>>23,we=$<<9|O>>>23,Ee=D<<18|G>>>14,$r=G<<18|D>>>14,Se=V<<1|H>>>31,Re=H<<1|V>>>31,Br=Q<<12|X>>>20,Me=X<<12|Q>>>20,Ce=ie<<10|v>>>22,Dr=v<<10|ie>>>22,ke=d<<13|a>>>19,Ie=a<<13|d>>>19,Fr=g<<2|m>>>30,xe=m<<2|g>>>30,Ae=C<<30|y>>>2,jr=y<<30|C>>>2,Te=A<<6|b>>>26,Ne=b<<6|A>>>26,Hr=S<<11|h>>>21,Le=h<<11|S>>>21,Oe=W<<15|q>>>17,Ur=q<<15|W>>>17,Pe=T<<29|I>>>3,$e=I<<29|T>>>3,Wr=B<<28|U>>>4,Be=U<<28|B>>>4,De=w<<23|te>>>9,Vr=te<<23|w>>>9,Fe=E<<25|F>>>7,je=F<<25|E>>>7,Qt=j<<21|K>>>11,Yt=K<<21|j>>>11,Xt=Z<<24|ee>>>8,er=ee<<24|Z>>>8,tr=le<<27|Mt>>>5,rr=Mt<<27|le>>>5,nr=ge<<20|_e>>>12,ir=_e<<20|ge>>>12,sr=de<<7|Vt>>>25,or=Vt<<7|de>>>25,ar=fe<<8|Pt>>>24,cr=Pt<<8|fe>>>24,lr=he<<14|ue>>>18,ur=ue<<14|he>>>18;e[0]=ct^~Br&Hr,e[1]=me^~Me&Le,e[10]=Wr^~nr&be,e[11]=Be^~ir&ye,e[20]=Se^~Te&Fe,e[21]=Re^~Ne&je,e[30]=tr^~ve&Ce,e[31]=rr^~Or&Dr,e[40]=Ae^~De&sr,e[41]=jr^~Vr&or,e[2]=Br^~Hr&Qt,e[3]=Me^~Le&Yt,e[12]=nr^~be&ke,e[13]=ir^~ye&Ie,e[22]=Te^~Fe&ar,e[23]=Ne^~je&cr,e[32]=ve^~Ce&Oe,e[33]=Or^~Dr&Ur,e[42]=De^~sr&Pr,e[43]=Vr^~or&we,e[4]=Hr^~Qt&lr,e[5]=Le^~Yt&ur,e[14]=be^~ke&Pe,e[15]=ye^~Ie&$e,e[24]=Fe^~ar&Ee,e[25]=je^~cr&$r,e[34]=Ce^~Oe&Xt,e[35]=Dr^~Ur&er,e[44]=sr^~Pr&Fr,e[45]=or^~we&xe,e[6]=Qt^~lr&ct,e[7]=Yt^~ur&me,e[16]=ke^~Pe&Wr,e[17]=Ie^~$e&Be,e[26]=ar^~Ee&Se,e[27]=cr^~$r&Re,e[36]=Oe^~Xt&tr,e[37]=Ur^~er&rr,e[46]=Pr^~Fr&Ae,e[47]=we^~xe&jr,e[8]=lr^~ct&Br,e[9]=ur^~me&Me,e[18]=Pe^~Wr&nr,e[19]=$e^~Be&ir,e[28]=Ee^~Se&Te,e[29]=$r^~Re&Ne,e[38]=Xt^~tr&ve,e[39]=er^~rr&Or,e[48]=Fr^~Ae&De,e[49]=xe^~jr&Vr,e[0]^=kc[t*2],e[1]^=kc[t*2+1]}};const Ni=Pu;function wn(){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}wn.prototype.initialize=function(e,t){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1};wn.prototype.absorb=function(e){for(let t=0;t>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(Ni.p1600(this.state),this.count=0);return t};wn.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing};var s1=wn,o1=i1(s1);const a1=o1,c1=Hi;function $u(e){return Buffer.allocUnsafe(e).fill(0)}function Bu(e,t,r){const n=$u(t);return e=gs(e),r?e.length"u")throw new Error("Not an array?");if(r=Uu(e),r!=="dynamic"&&r!==0&&t.length>r)throw new Error("Elements exceed array size: "+r);i=[],e=e.slice(0,e.lastIndexOf("[")),typeof t=="string"&&(t=JSON.parse(t));for(s in t)i.push(xt(e,t[s]));if(r==="dynamic"){var o=xt("uint256",t.length);i.unshift(o)}return Buffer.concat(i)}else{if(e==="bytes")return t=new Buffer(t),i=Buffer.concat([xt("uint256",t.length),t]),t.length%32!==0&&(i=Buffer.concat([i,Rr.zeros(32-t.length%32)])),i;if(e.startsWith("bytes")){if(r=tn(e),r<1||r>32)throw new Error("Invalid bytes width: "+r);return Rr.setLengthRight(t,32)}else if(e.startsWith("uint")){if(r=tn(e),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);if(n=_r(t),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(e.startsWith("int")){if(r=tn(e),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);if(n=_r(t),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(Buffer,"be",32)}else if(e.startsWith("ufixed")){if(r=Ic(e),n=_r(t),n<0)throw new Error("Supplied ufixed is negative");return xt("uint256",n.mul(new br(2).pow(new br(r[1]))))}else if(e.startsWith("fixed"))return r=Ic(e),xt("int256",_r(t).mul(new br(2).pow(new br(r[1]))))}throw new Error("Unsupported or invalid type: "+e)}function f1(e){return e==="string"||e==="bytes"||Uu(e)==="dynamic"}function p1(e){return e.lastIndexOf("]")===e.length-1}function g1(e,t){var r=[],n=[],i=32*e.length;for(var s in e){var o=Hu(e[s]),c=t[s],l=xt(o,c);f1(o)?(r.push(xt("uint256",i)),n.push(l),i+=l.length):r.push(l)}return Buffer.concat(r.concat(n))}function Wu(e,t){if(e.length!==t.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(Rr.setLengthRight(c,r))}else if(o.startsWith("uint")){if(r=tn(o),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);if(n=_r(c),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=tn(o),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);if(n=_r(c),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 _1(e,t){return Rr.keccak(Wu(e,t))}var m1={rawEncode:g1,solidityPack:Wu,soliditySHA3:_1};const yt=ju,Nn=m1,Vu={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"]},so={encodeData(e,t,r,n=!0){const i=["bytes32"],s=[this.hashType(e,r)];if(n){const o=(c,l,u)=>{if(r[l]!==void 0)return["bytes32",u==null?"0x0000000000000000000000000000000000000000000000000000000000000000":yt.keccak(this.encodeData(l,u,r,n))];if(u===void 0)throw new Error(`missing value for field ${c} of type ${l}`);if(l==="bytes")return["bytes32",yt.keccak(u)];if(l==="string")return typeof u=="string"&&(u=Buffer.from(u,"utf8")),["bytes32",yt.keccak(u)];if(l.lastIndexOf("]")===l.length-1){const p=l.slice(0,l.lastIndexOf("[")),f=u.map(_=>o(c,p,_));return["bytes32",yt.keccak(Nn.rawEncode(f.map(([_])=>_),f.map(([,_])=>_)))]}return[l,u]};for(const c of r[e]){const[l,u]=o(c.name,c.type,t[c.name]);i.push(l),s.push(u)}}else for(const o of r[e]){let c=t[o.name];if(c!==void 0)if(o.type==="bytes")i.push("bytes32"),c=yt.keccak(c),s.push(c);else if(o.type==="string")i.push("bytes32"),typeof c=="string"&&(c=Buffer.from(c,"utf8")),c=yt.keccak(c),s.push(c);else if(r[o.type]!==void 0)i.push("bytes32"),c=yt.keccak(this.encodeData(o.type,c,r,n)),s.push(c);else{if(o.type.lastIndexOf("]")===o.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(o.type),s.push(c)}}return Nn.rawEncode(i,s)},encodeType(e,t){let r="",n=this.findTypeDependencies(e,t).filter(i=>i!==e);n=[e].concat(n.sort());for(const i of n){if(!t[i])throw new Error("No type definition specified: "+i);r+=i+"("+t[i].map(({name:o,type:c})=>c+" "+o).join(",")+")"}return r},findTypeDependencies(e,t,r=[]){if(e=e.match(/^\w*/)[0],r.includes(e)||t[e]===void 0)return r;r.push(e);for(const n of t[e])for(const i of this.findTypeDependencies(n.type,t,r))!r.includes(i)&&r.push(i);return r},hashStruct(e,t,r,n=!0){return yt.keccak(this.encodeData(e,t,r,n))},hashType(e,t){return yt.keccak(this.encodeType(e,t))},sanitizeData(e){const t={};for(const r in Vu.properties)e[r]&&(t[r]=e[r]);return t.types&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},hash(e,t=!0){const r=this.sanitizeData(e),n=[Buffer.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,t)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,t)),yt.keccak(Buffer.concat(n))}};var v1={TYPED_MESSAGE_SCHEMA:Vu,TypedDataUtils:so,hashForSignTypedDataLegacy:function(e){return b1(e.data)},hashForSignTypedData_v3:function(e){return so.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return so.hash(e.data)}};function b1(e){const t=new Error("Expect argument to be non-empty array");if(typeof e!="object"||!e.length)throw t;const r=e.map(function(s){return s.type==="bytes"?yt.toBuffer(s.value):s.value}),n=e.map(function(s){return s.type}),i=e.map(function(s){if(!s.name)throw t;return s.type+" "+s.name});return Nn.soliditySHA3(["bytes32","bytes32"],[Nn.soliditySHA3(new Array(e.length).fill("string"),i),Nn.soliditySHA3(n,r)])}var hn={};Object.defineProperty(hn,"__esModule",{value:!0});hn.filterFromParam=hn.FilterPolyfill=void 0;const Yr=Je,nt=z,y1=5*60*1e3,mr={jsonrpc:"2.0",id:0};class w1{constructor(t){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,Yr.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=t}async newFilter(t){const r=qu(t),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,nt.hexStringFromIntNumber)(n)}async newBlockFilter(){const t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.info(`Installing new block filter (${t}) with initial cursor position:`,r),this.blockFilters.add(t),this.setFilterTimeout(t),(0,nt.hexStringFromIntNumber)(t)}async newPendingTransactionFilter(){const t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.info(`Installing new block filter (${t}) with initial cursor position:`,r),this.pendingTransactionFilters.add(t),this.setFilterTimeout(t),(0,nt.hexStringFromIntNumber)(t)}uninstallFilter(t){const r=(0,nt.intNumberFromHexString)(t);return console.info(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(t){const r=(0,nt.intNumberFromHexString)(t);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(vi())}async getFilterLogs(t){const r=(0,nt.intNumberFromHexString)(t),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},mr),{method:"eth_getLogs",params:[xc(n)]})):vi()}makeFilterId(){return(0,Yr.IntNumber)(++this.nextFilterId)}sendAsyncPromise(t){return new Promise((r,n)=>{this.provider.sendAsync(t,(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(t){console.info(`Deleting filter (${t})`),this.logFilters.delete(t),this.blockFilters.delete(t),this.pendingTransactionFilters.delete(t),this.cursors.delete(t),this.timeouts.delete(t)}async getLogFilterChanges(t){const r=this.logFilters.get(t),n=this.cursors.get(t);if(!n||!r)return vi();const i=await this.getCurrentBlockHeight(),s=r.toBlock==="latest"?i:r.toBlock;if(n>i||n>Number(r.toBlock))return bi();console.info(`Fetching logs from ${n} to ${s} for filter ${t}`);const o=await this.sendAsyncPromise(Object.assign(Object.assign({},mr),{method:"eth_getLogs",params:[xc(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:s}))]}));if(Array.isArray(o.result)){const c=o.result.map(u=>(0,nt.intNumberFromHexString)(u.blockNumber||"0x0")),l=Math.max(...c);if(l&&l>n){const u=(0,Yr.IntNumber)(l+1);console.info(`Moving cursor position for filter (${t}) from ${n} to ${u}`),this.cursors.set(t,u)}}return o}async getBlockFilterChanges(t){const r=this.cursors.get(t);if(!r)return vi();const n=await this.getCurrentBlockHeight();if(r>n)return bi();console.info(`Fetching blocks from ${r} to ${n} for filter (${t})`);const i=(await Promise.all((0,nt.range)(r,n+1).map(o=>this.getBlockHashByNumber((0,Yr.IntNumber)(o))))).filter(o=>!!o),s=(0,Yr.IntNumber)(r+i.length);return console.info(`Moving cursor position for filter (${t}) from ${r} to ${s}`),this.cursors.set(t,s),Object.assign(Object.assign({},mr),{result:i})}async getPendingTransactionFilterChanges(t){return Promise.resolve(bi())}async setInitialCursorPosition(t,r){const n=await this.getCurrentBlockHeight(),i=typeof r=="number"&&r>n?r:n;return this.cursors.set(t,i),i}setFilterTimeout(t){const r=this.timeouts.get(t);r&&window.clearTimeout(r);const n=window.setTimeout(()=>{console.info(`Filter (${t}) timed out`),this.deleteFilter(t)},y1);this.timeouts.set(t,n)}async getCurrentBlockHeight(){const t=new Date;if(t.getTime()-this.lastFetchTimestamp.getTime()>this.REQUEST_THROTTLE_INTERVAL){this.lastFetchTimestamp=t;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:t}=await this.sendAsyncPromise(Object.assign(Object.assign({},mr),{method:"eth_blockNumber",params:[]}));return(0,nt.intNumberFromHexString)((0,nt.ensureHexString)(t))}async getBlockHashByNumber(t){const r=await this.sendAsyncPromise(Object.assign(Object.assign({},mr),{method:"eth_getBlockByNumber",params:[(0,nt.hexStringFromIntNumber)(t),!1]}));return r.result&&typeof r.result.hash=="string"?(0,nt.ensureHexString)(r.result.hash):null}}hn.FilterPolyfill=w1;function qu(e){return{fromBlock:Ac(e.fromBlock),toBlock:Ac(e.toBlock),addresses:e.address===void 0?null:Array.isArray(e.address)?e.address:[e.address],topics:e.topics||[]}}hn.filterFromParam=qu;function xc(e){const t={fromBlock:Tc(e.fromBlock),toBlock:Tc(e.toBlock),topics:e.topics};return e.addresses!==null&&(t.address=e.addresses),t}function Ac(e){if(e===void 0||e==="latest"||e==="pending")return"latest";if(e==="earliest")return(0,Yr.IntNumber)(0);if((0,nt.isHexString)(e))return(0,nt.intNumberFromHexString)(e);throw new Error(`Invalid block option: ${String(e)}`)}function Tc(e){return e==="latest"?e:(0,nt.hexStringFromIntNumber)(e)}function vi(){return Object.assign(Object.assign({},mr),{error:{code:-32e3,message:"filter not found"}})}function bi(){return Object.assign(Object.assign({},mr),{result:[]})}var _s={},zu={},ms={},sa=E1;function E1(e){e=e||{};var t=e.max||Number.MAX_SAFE_INTEGER,r=typeof e.start<"u"?e.start:Math.floor(Math.random()*t);return function(){return r=r%t,r++}}const Nc=(e,t)=>function(){const r=t.promiseModule,n=new Array(arguments.length);for(let i=0;i{t.errorFirst?n.push(function(o,c){if(t.multiArgs){const l=new Array(arguments.length-1);for(let u=1;u{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const r=i=>{const s=o=>typeof o=="string"?i===o:o.test(i);return t.include?t.include.some(s):!t.exclude.some(s)};let n;typeof e=="function"?n=function(){return t.excludeMain?e.apply(this,arguments):Nc(e,t).apply(this,arguments)}:n=Object.create(Object.getPrototypeOf(e));for(const i in e){const s=e[i];n[i]=typeof s=="function"&&r(i)?Nc(s,t):s}return n},ri={},ni={};Object.defineProperty(ni,"__esModule",{value:!0});const R1=Di;function Lc(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function M1(e){const t=e.length,r=new Array(t);for(let n=0;n0&&([o]=r),o instanceof Error)throw o;const c=new Error(`Unhandled error.${o?` (${o.message})`:""}`);throw c.context=o,c}const s=i[t];if(s===void 0)return!1;if(typeof s=="function")Lc(s,this,r);else{const o=s.length,c=M1(s);for(let l=0;le+t,Oc=["sync","latest"];class T1 extends I1.default{constructor(t){super(),this._blockResetDuration=t.blockResetDuration||20*x1,this._usePastBlocks=t.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(t){return t?super.removeAllListeners(t):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(t){Oc.includes(t)&&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 Oc.map(t=>this.listenerCount(t)).reduce(A1)}_shouldUseNewBlock(t){const r=this._currentBlock;if(!r)return!0;const n=Pc(t),i=Pc(r);return this._usePastBlocks&&ni}_newPotentialLatest(t){this._shouldUseNewBlock(t)&&this._setCurrentBlock(t)}_setCurrentBlock(t){const r=this._currentBlock;this._currentBlock=t,this.emit("latest",t),this.emit("sync",{oldBlock:r,newBlock:t})}_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}}ri.BaseBlockTracker=T1;function Pc(e){return Number.parseInt(e,16)}var Gu={},Ju={},tt={};class Zu extends TypeError{constructor(t,r){let n;const{message:i,explanation:s,...o}=t,{path:c}=t,l=c.length===0?i:`At path: ${c.join(".")} -- ${i}`;super(s??l),s!=null&&(this.cause=l),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...r()])}}function N1(e){return mt(e)&&typeof e[Symbol.iterator]=="function"}function mt(e){return typeof e=="object"&&e!=null}function $c(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Ze(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function L1(e){const{done:t,value:r}=e.next();return t?void 0:r}function O1(e,t,r,n){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:i,branch:s}=t,{type:o}=r,{refinement:c,message:l=`Expected a value of type \`${o}\`${c?` with refinement \`${c}\``:""}, but received: \`${Ze(n)}\``}=e;return{value:n,type:o,refinement:c,key:i[i.length-1],path:i,branch:s,...e,message:l}}function*Lo(e,t,r,n){N1(e)||(e=[e]);for(const i of e){const s=O1(i,t,r,n);s&&(yield s)}}function*oa(e,t,r={}){const{path:n=[],branch:i=[e],coerce:s=!1,mask:o=!1}=r,c={path:n,branch:i};if(s&&(e=t.coercer(e,c),o&&t.type!=="type"&&mt(t.schema)&&mt(e)&&!Array.isArray(e)))for(const u in e)t.schema[u]===void 0&&delete e[u];let l="valid";for(const u of t.validator(e,c))u.explanation=r.message,l="not_valid",yield[u,void 0];for(let[u,p,f]of t.entries(e,c)){const _=oa(p,f,{path:u===void 0?n:[...n,u],branch:u===void 0?i:[...i,p],coerce:s,mask:o,message:r.message});for(const R of _)R[0]?(l=R[0].refinement!=null?"not_refined":"not_valid",yield[R[0],void 0]):s&&(p=R[1],u===void 0?e=p:e instanceof Map?e.set(u,p):e instanceof Set?e.add(p):mt(e)&&(p!==void 0||u in e)&&(e[u]=p))}if(l!=="not_valid")for(const u of t.refiner(e,c))u.explanation=r.message,l="not_refined",yield[u,void 0];l==="valid"&&(yield[void 0,e])}class ze{constructor(t){const{type:r,schema:n,validator:i,refiner:s,coercer:o=l=>l,entries:c=function*(){}}=t;this.type=r,this.schema=n,this.entries=c,this.coercer=o,i?this.validator=(l,u)=>{const p=i(l,u);return Lo(p,u,this,l)}:this.validator=()=>[],s?this.refiner=(l,u)=>{const p=s(l,u);return Lo(p,u,this,l)}:this.refiner=()=>[]}assert(t,r){return Ku(t,this,r)}create(t,r){return Qu(t,this,r)}is(t){return aa(t,this)}mask(t,r){return Yu(t,this,r)}validate(t,r={}){return En(t,this,r)}}function Ku(e,t,r){const n=En(e,t,{message:r});if(n[0])throw n[0]}function Qu(e,t,r){const n=En(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function Yu(e,t,r){const n=En(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function aa(e,t){return!En(e,t)[0]}function En(e,t,r={}){const n=oa(e,t,r),i=L1(n);return i[0]?[new Zu(i[0],function*(){for(const o of n)o[0]&&(yield o[0])}),void 0]:[void 0,i[1]]}function P1(...e){const t=e[0].type==="type",r=e.map(i=>i.schema),n=Object.assign({},...r);return t?la(n):ii(n)}function at(e,t){return new ze({type:e,schema:null,validator:t})}function $1(e,t){return new ze({...e,refiner:(r,n)=>r===void 0||e.refiner(r,n),validator(r,n){return r===void 0?!0:(t(r,n),e.validator(r,n))}})}function B1(e){return new ze({type:"dynamic",schema:null,*entries(t,r){yield*e(t,r).entries(t,r)},validator(t,r){return e(t,r).validator(t,r)},coercer(t,r){return e(t,r).coercer(t,r)},refiner(t,r){return e(t,r).refiner(t,r)}})}function D1(e){let t;return new ze({type:"lazy",schema:null,*entries(r,n){t??(t=e()),yield*t.entries(r,n)},validator(r,n){return t??(t=e()),t.validator(r,n)},coercer(r,n){return t??(t=e()),t.coercer(r,n)},refiner(r,n){return t??(t=e()),t.refiner(r,n)}})}function F1(e,t){const{schema:r}=e,n={...r};for(const i of t)delete n[i];switch(e.type){case"type":return la(n);default:return ii(n)}}function j1(e){const t=e instanceof ze?{...e.schema}:{...e};for(const r in t)t[r]=Xu(t[r]);return ii(t)}function H1(e,t){const{schema:r}=e,n={};for(const i of t)n[i]=r[i];return ii(n)}function U1(e,t){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),at(e,t)}function W1(){return at("any",()=>!0)}function V1(e){return new ze({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${Ze(t)}`}})}function q1(){return at("bigint",e=>typeof e=="bigint")}function z1(){return at("boolean",e=>typeof e=="boolean")}function G1(){return at("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${Ze(e)}`)}function J1(e){const t={},r=e.map(n=>Ze(n)).join();for(const n of e)t[n]=n;return new ze({type:"enums",schema:t,validator(n){return e.includes(n)||`Expected one of \`${r}\`, but received: ${Ze(n)}`}})}function Z1(){return at("func",e=>typeof e=="function"||`Expected a function, but received: ${Ze(e)}`)}function K1(e){return at("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${Ze(t)}`)}function Q1(){return at("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${Ze(e)}`)}function Y1(e){return new ze({type:"intersection",schema:null,*entries(t,r){for(const n of e)yield*n.entries(t,r)},*validator(t,r){for(const n of e)yield*n.validator(t,r)},*refiner(t,r){for(const n of e)yield*n.refiner(t,r)}})}function X1(e){const t=Ze(e),r=typeof e;return new ze({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(n){return n===e||`Expected the literal \`${t}\`, but received: ${Ze(n)}`}})}function eg(e,t){return new ze({type:"map",schema:null,*entries(r){if(e&&t&&r instanceof Map)for(const[n,i]of r.entries())yield[n,n,e],yield[n,i,t]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${Ze(r)}`}})}function ca(){return at("never",()=>!1)}function tg(e){return new ze({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function rg(){return at("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${Ze(e)}`)}function ii(e){const t=e?Object.keys(e):[],r=ca();return new ze({type:"object",schema:e||null,*entries(n){if(e&&mt(n)){const i=new Set(Object.keys(n));for(const s of t)i.delete(s),yield[s,n[s],e[s]];for(const s of i)yield[s,n[s],r]}},validator(n){return mt(n)||`Expected an object, but received: ${Ze(n)}`},coercer(n){return mt(n)?{...n}:n}})}function Xu(e){return new ze({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function ng(e,t){return new ze({type:"record",schema:null,*entries(r){if(mt(r))for(const n in r){const i=r[n];yield[n,n,e],yield[n,i,t]}},validator(r){return mt(r)||`Expected an object, but received: ${Ze(r)}`}})}function ig(){return at("regexp",e=>e instanceof RegExp)}function sg(e){return new ze({type:"set",schema:null,*entries(t){if(e&&t instanceof Set)for(const r of t)yield[r,r,e]},coercer(t){return t instanceof Set?new Set(t):t},validator(t){return t instanceof Set||`Expected a \`Set\` object, but received: ${Ze(t)}`}})}function eh(){return at("string",e=>typeof e=="string"||`Expected a string, but received: ${Ze(e)}`)}function og(e){const t=ca();return new ze({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let i=0;ir.type).join(" | ");return new ze({type:"union",schema:null,coercer(r){for(const n of e){const[i,s]=n.validate(r,{coerce:!0});if(!i)return s}return r},validator(r,n){const i=[];for(const s of e){const[...o]=oa(r,s,n),[c]=o;if(c[0])for(const[l]of o)l&&i.push(l);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${Ze(r)}`,...i]}})}function th(){return at("unknown",()=>!0)}function ua(e,t,r){return new ze({...e,coercer:(n,i)=>aa(n,t)?e.coercer(r(n,i),i):e.coercer(n,i)})}function cg(e,t,r={}){return ua(e,th(),n=>{const i=typeof t=="function"?t():t;if(n===void 0)return i;if(!r.strict&&$c(n)&&$c(i)){const s={...n};let o=!1;for(const c in i)s[c]===void 0&&(s[c]=i[c],o=!0);if(o)return s}return n})}function lg(e){return ua(e,eh(),t=>t.trim())}function ug(e){return Nr(e,"empty",t=>{const r=rh(t);return r===0||`Expected an empty ${e.type} but received one with a size of \`${r}\``})}function rh(e){return e instanceof Map||e instanceof Set?e.size:e.length}function hg(e,t,r={}){const{exclusive:n}=r;return Nr(e,"max",i=>n?in?i>t:i>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${i}\``)}function fg(e){return Nr(e,"nonempty",t=>rh(t)>0||`Expected a nonempty ${e.type} but received an empty one`)}function pg(e,t){return Nr(e,"pattern",r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`)}function gg(e,t,r=t){const n=`Expected a ${e.type}`,i=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return Nr(e,"size",s=>{if(typeof s=="number"||s instanceof Date)return t<=s&&s<=r||`${n} ${i} but received \`${s}\``;if(s instanceof Map||s instanceof Set){const{size:o}=s;return t<=o&&o<=r||`${n} with a size ${i} but received one with a size of \`${o}\``}else{const{length:o}=s;return t<=o&&o<=r||`${n} with a length ${i} but received one with a length of \`${o}\``}})}function Nr(e,t,r){return new ze({...e,*refiner(n,i){yield*e.refiner(n,i);const s=r(n,i),o=Lo(s,i,e,n);for(const c of o)yield{...c,refinement:t}}})}const _g=Object.freeze(Object.defineProperty({__proto__:null,Struct:ze,StructError:Zu,any:W1,array:V1,assert:Ku,assign:P1,bigint:q1,boolean:z1,coerce:ua,create:Qu,date:G1,defaulted:cg,define:at,deprecated:$1,dynamic:B1,empty:ug,enums:J1,func:Z1,instance:K1,integer:Q1,intersection:Y1,is:aa,lazy:D1,literal:X1,map:eg,mask:Yu,max:hg,min:dg,never:ca,nonempty:fg,nullable:tg,number:rg,object:ii,omit:F1,optional:Xu,partial:j1,pattern:pg,pick:H1,record:ng,refine:Nr,regexp:ig,set:sg,size:gg,string:eh,struct:U1,trimmed:lg,tuple:og,type:la,union:ag,unknown:th,validate:En},Symbol.toStringTag,{value:"Module"})),Lr=gn(_g);Object.defineProperty(tt,"__esModule",{value:!0});tt.assertExhaustive=tt.assertStruct=tt.assert=tt.AssertionError=void 0;const mg=Lr;function vg(e){return typeof e=="object"&&e!==null&&"message"in e}function bg(e){var t,r;return typeof((r=(t=e==null?void 0:e.prototype)===null||t===void 0?void 0:t.constructor)===null||r===void 0?void 0:r.name)=="string"}function yg(e){const t=vg(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}function nh(e,t){return bg(e)?new e({message:t}):e({message:t})}class ha extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}tt.AssertionError=ha;function wg(e,t="Assertion failed.",r=ha){if(!e)throw t instanceof Error?t:nh(r,t)}tt.assert=wg;function Eg(e,t,r="Assertion failed",n=ha){try{(0,mg.assert)(e,t)}catch(i){throw nh(n,`${r}: ${yg(i)}.`)}}tt.assertStruct=Eg;function Sg(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}tt.assertExhaustive=Sg;var si={};Object.defineProperty(si,"__esModule",{value:!0});si.base64=void 0;const Rg=Lr,Mg=tt,Cg=(e,t={})=>{var r,n;const i=(r=t.paddingRequired)!==null&&r!==void 0?r:!1,s=(n=t.characterSet)!==null&&n!==void 0?n:"base64";let o;s==="base64"?o=String.raw`[A-Za-z0-9+\/]`:((0,Mg.assert)(s==="base64url"),o=String.raw`[-_A-Za-z0-9]`);let c;return i?c=new RegExp(`^(?:${o}{4})*(?:${o}{3}=|${o}{2}==)?$`,"u"):c=new RegExp(`^(?:${o}{4})*(?:${o}{2,3}|${o}{3}=|${o}{2}==)?$`,"u"),(0,Rg.pattern)(e,c)};si.base64=Cg;var ae={},oi={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.remove0x=e.add0x=e.assertIsStrictHexString=e.assertIsHexString=e.isStrictHexString=e.isHexString=e.StrictHexStruct=e.HexStruct=void 0;const t=Lr,r=tt;e.HexStruct=(0,t.pattern)((0,t.string)(),/^(?:0x)?[0-9a-f]+$/iu),e.StrictHexStruct=(0,t.pattern)((0,t.string)(),/^0x[0-9a-f]+$/iu);function n(u){return(0,t.is)(u,e.HexStruct)}e.isHexString=n;function i(u){return(0,t.is)(u,e.StrictHexStruct)}e.isStrictHexString=i;function s(u){(0,r.assert)(n(u),"Value must be a hexadecimal string.")}e.assertIsHexString=s;function o(u){(0,r.assert)(i(u),'Value must be a hexadecimal string, starting with "0x".')}e.assertIsStrictHexString=o;function c(u){return u.startsWith("0x")?u:u.startsWith("0X")?`0x${u.substring(2)}`:`0x${u}`}e.add0x=c;function l(u){return u.startsWith("0x")||u.startsWith("0X")?u.substring(2):u}e.remove0x=l})(oi);Object.defineProperty(ae,"__esModule",{value:!0});ae.createDataView=ae.concatBytes=ae.valueToBytes=ae.stringToBytes=ae.numberToBytes=ae.signedBigIntToBytes=ae.bigIntToBytes=ae.hexToBytes=ae.bytesToString=ae.bytesToNumber=ae.bytesToSignedBigInt=ae.bytesToBigInt=ae.bytesToHex=ae.assertIsBytes=ae.isBytes=void 0;const ht=tt,Oo=oi,Bc=48,Dc=58,Fc=87;function kg(){const e=[];return()=>{if(e.length===0)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}const Ig=kg();function da(e){return e instanceof Uint8Array}ae.isBytes=da;function Sn(e){(0,ht.assert)(da(e),"Value must be a Uint8Array.")}ae.assertIsBytes=Sn;function ih(e){if(Sn(e),e.length===0)return"0x";const t=Ig(),r=new Array(e.length);for(let n=0;n=BigInt(0),"Value must be a non-negative bigint.");const t=e.toString(16);return vs(t)}ae.bigIntToBytes=oh;function Ng(e,t){(0,ht.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(t*8+-1))}function Lg(e,t){(0,ht.assert)(typeof e=="bigint","Value must be a bigint."),(0,ht.assert)(typeof t=="number","Byte length must be a number."),(0,ht.assert)(t>0,"Byte length must be greater than 0."),(0,ht.assert)(Ng(e,t),"Byte length is too small to represent the given value.");let r=e;const n=new Uint8Array(t);for(let i=0;i>=BigInt(8);return n.reverse()}ae.signedBigIntToBytes=Lg;function ah(e){(0,ht.assert)(typeof e=="number","Value must be a number."),(0,ht.assert)(e>=0,"Value must be a non-negative number."),(0,ht.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");const t=e.toString(16);return vs(t)}ae.numberToBytes=ah;function ch(e){return(0,ht.assert)(typeof e=="string","Value must be a string."),new TextEncoder().encode(e)}ae.stringToBytes=ch;function lh(e){if(typeof e=="bigint")return oh(e);if(typeof e=="number")return ah(e);if(typeof e=="string")return e.startsWith("0x")?vs(e):ch(e);if(da(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}ae.valueToBytes=lh;function Og(e){const t=new Array(e.length);let r=0;for(let i=0;it.call(r,n,i,this))}get(t){return it(this,bt,"f").get(t)}has(t){return it(this,bt,"f").has(t)}keys(){return it(this,bt,"f").keys()}values(){return it(this,bt,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([t,r])=>`${String(t)} => ${String(r)}`).join(", ")} `:""}}`}}dn.FrozenMap=fa;class pa{constructor(t){kt.set(this,void 0),dh(this,kt,new Set(t),"f"),Object.freeze(this)}get size(){return it(this,kt,"f").size}[(kt=new WeakMap,Symbol.iterator)](){return it(this,kt,"f")[Symbol.iterator]()}entries(){return it(this,kt,"f").entries()}forEach(t,r){return it(this,kt,"f").forEach((n,i,s)=>t.call(r,n,i,this))}has(t){return it(this,kt,"f").has(t)}keys(){return it(this,kt,"f").keys()}values(){return it(this,kt,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(t=>String(t)).join(", ")} `:""}}`}}dn.FrozenSet=pa;Object.freeze(fa);Object.freeze(fa.prototype);Object.freeze(pa);Object.freeze(pa.prototype);var fh={};Object.defineProperty(fh,"__esModule",{value:!0});var ph={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsonRpcIdValidator=e.assertIsJsonRpcError=e.isJsonRpcError=e.assertIsJsonRpcFailure=e.isJsonRpcFailure=e.assertIsJsonRpcSuccess=e.isJsonRpcSuccess=e.assertIsJsonRpcResponse=e.isJsonRpcResponse=e.assertIsPendingJsonRpcResponse=e.isPendingJsonRpcResponse=e.JsonRpcResponseStruct=e.JsonRpcFailureStruct=e.JsonRpcSuccessStruct=e.PendingJsonRpcResponseStruct=e.assertIsJsonRpcRequest=e.isJsonRpcRequest=e.assertIsJsonRpcNotification=e.isJsonRpcNotification=e.JsonRpcNotificationStruct=e.JsonRpcRequestStruct=e.JsonRpcParamsStruct=e.JsonRpcErrorStruct=e.JsonRpcIdStruct=e.JsonRpcVersionStruct=e.jsonrpc2=e.getJsonSize=e.isValidJson=e.JsonStruct=e.UnsafeJsonStruct=void 0;const t=Lr,r=tt,n=()=>(0,t.define)("finite number",O=>(0,t.is)(O,(0,t.number)())&&Number.isFinite(O));e.UnsafeJsonStruct=(0,t.union)([(0,t.literal)(null),(0,t.boolean)(),n(),(0,t.string)(),(0,t.array)((0,t.lazy)(()=>e.UnsafeJsonStruct)),(0,t.record)((0,t.string)(),(0,t.lazy)(()=>e.UnsafeJsonStruct))]),e.JsonStruct=(0,t.define)("Json",(O,D)=>{function G(V,H){const Q=[...H.validator(V,D)];return Q.length>0?Q:!0}try{const V=G(O,e.UnsafeJsonStruct);return V!==!0?V:G(JSON.parse(JSON.stringify(O)),e.UnsafeJsonStruct)}catch(V){return V instanceof RangeError?"Circular reference detected":!1}});function i(O){return(0,t.is)(O,e.JsonStruct)}e.isValidJson=i;function s(O){(0,r.assertStruct)(O,e.JsonStruct,"Invalid JSON value");const D=JSON.stringify(O);return new TextEncoder().encode(D).byteLength}e.getJsonSize=s,e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,t.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,t.nullable)((0,t.union)([(0,t.number)(),(0,t.string)()])),e.JsonRpcErrorStruct=(0,t.object)({code:(0,t.integer)(),message:(0,t.string)(),data:(0,t.optional)(e.JsonStruct),stack:(0,t.optional)((0,t.string)())}),e.JsonRpcParamsStruct=(0,t.optional)((0,t.union)([(0,t.record)((0,t.string)(),e.JsonStruct),(0,t.array)(e.JsonStruct)])),e.JsonRpcRequestStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,t.string)(),params:e.JsonRpcParamsStruct}),e.JsonRpcNotificationStruct=(0,t.omit)(e.JsonRpcRequestStruct,["id"]);function o(O){return(0,t.is)(O,e.JsonRpcNotificationStruct)}e.isJsonRpcNotification=o;function c(O,D){(0,r.assertStruct)(O,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",D)}e.assertIsJsonRpcNotification=c;function l(O){return(0,t.is)(O,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=l;function u(O,D){(0,r.assertStruct)(O,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",D)}e.assertIsJsonRpcRequest=u,e.PendingJsonRpcResponseStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:(0,t.optional)((0,t.unknown)()),error:(0,t.optional)(e.JsonRpcErrorStruct)}),e.JsonRpcSuccessStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:e.JsonStruct}),e.JsonRpcFailureStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,error:e.JsonRpcErrorStruct}),e.JsonRpcResponseStruct=(0,t.union)([e.JsonRpcSuccessStruct,e.JsonRpcFailureStruct]);function p(O){return(0,t.is)(O,e.PendingJsonRpcResponseStruct)}e.isPendingJsonRpcResponse=p;function f(O,D){(0,r.assertStruct)(O,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",D)}e.assertIsPendingJsonRpcResponse=f;function _(O){return(0,t.is)(O,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=_;function R(O,D){(0,r.assertStruct)(O,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",D)}e.assertIsJsonRpcResponse=R;function x(O){return(0,t.is)(O,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=x;function P(O,D){(0,r.assertStruct)(O,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",D)}e.assertIsJsonRpcSuccess=P;function L(O){return(0,t.is)(O,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=L;function M(O,D){(0,r.assertStruct)(O,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",D)}e.assertIsJsonRpcFailure=M;function k(O){return(0,t.is)(O,e.JsonRpcErrorStruct)}e.isJsonRpcError=k;function N(O,D){(0,r.assertStruct)(O,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",D)}e.assertIsJsonRpcError=N;function $(O){const{permitEmptyString:D,permitFractions:G,permitNull:V}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},O);return X=>!!(typeof X=="number"&&(G||Number.isInteger(X))||typeof X=="string"&&(D||X.length>0)||V&&X===null)}e.getJsonRpcIdValidator=$})(ph);var gh={};Object.defineProperty(gh,"__esModule",{value:!0});var fn={},Po={exports:{}},oo,Hc;function zg(){if(Hc)return oo;Hc=1;var e=1e3,t=e*60,r=t*60,n=r*24,i=n*7,s=n*365.25;oo=function(p,f){f=f||{};var _=typeof p;if(_==="string"&&p.length>0)return o(p);if(_==="number"&&isFinite(p))return f.long?l(p):c(p);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(p))};function o(p){if(p=String(p),!(p.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(p);if(f){var _=parseFloat(f[1]),R=(f[2]||"ms").toLowerCase();switch(R){case"years":case"year":case"yrs":case"yr":case"y":return _*s;case"weeks":case"week":case"w":return _*i;case"days":case"day":case"d":return _*n;case"hours":case"hour":case"hrs":case"hr":case"h":return _*r;case"minutes":case"minute":case"mins":case"min":case"m":return _*t;case"seconds":case"second":case"secs":case"sec":case"s":return _*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return _;default:return}}}}function c(p){var f=Math.abs(p);return f>=n?Math.round(p/n)+"d":f>=r?Math.round(p/r)+"h":f>=t?Math.round(p/t)+"m":f>=e?Math.round(p/e)+"s":p+"ms"}function l(p){var f=Math.abs(p);return f>=n?u(p,f,n,"day"):f>=r?u(p,f,r,"hour"):f>=t?u(p,f,t,"minute"):f>=e?u(p,f,e,"second"):p+" ms"}function u(p,f,_,R){var x=f>=_*1.5;return Math.round(p/_)+" "+R+(x?"s":"")}return oo}function Gg(e){r.debug=r,r.default=r,r.coerce=l,r.disable=s,r.enable=i,r.enabled=o,r.humanize=zg(),r.destroy=u,Object.keys(e).forEach(p=>{r[p]=e[p]}),r.names=[],r.skips=[],r.formatters={};function t(p){let f=0;for(let _=0;_{if(D==="%%")return"%";$++;const V=r.formatters[G];if(typeof V=="function"){const H=L[$];D=V.call(M,H),L.splice($,1),$--}return D}),r.formatArgs.call(M,L),(M.log||r.log).apply(M,L)}return P.namespace=p,P.useColors=r.useColors(),P.color=r.selectColor(p),P.extend=n,P.destroy=r.destroy,Object.defineProperty(P,"enabled",{enumerable:!0,configurable:!1,get:()=>_!==null?_:(R!==r.namespaces&&(R=r.namespaces,x=r.enabled(p)),x),set:L=>{_=L}}),typeof r.init=="function"&&r.init(P),P}function n(p,f){const _=r(this.namespace+(typeof f>"u"?":":f)+p);return _.log=this.log,_}function i(p){r.save(p),r.namespaces=p,r.names=[],r.skips=[];let f;const _=(typeof p=="string"?p:"").split(/[\s,]+/),R=_.length;for(f=0;f"-"+f)].join(",");return r.enable(""),p}function o(p){if(p[p.length-1]==="*")return!0;let f,_;for(f=0,_=r.skips.length;f<_;f++)if(r.skips[f].test(p))return!1;for(f=0,_=r.names.length;f<_;f++)if(r.names[f].test(p))return!0;return!1}function c(p){return p.toString().substring(2,p.toString().length-2).replace(/\.\*\?$/,"*")}function l(p){return p instanceof Error?p.stack||p.message:p}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}var Jg=Gg;(function(e,t){var r={};t.formatArgs=i,t.save=s,t.load=o,t.useColors=n,t.storage=c(),t.destroy=(()=>{let u=!1;return()=>{u||(u=!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`."))}})(),t.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 n(){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 i(u){if(u[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+u[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const p="color: "+this.color;u.splice(1,0,p,"color: inherit");let f=0,_=0;u[0].replace(/%[a-zA-Z%]/g,R=>{R!=="%%"&&(f++,R==="%c"&&(_=f))}),u.splice(_,0,p)}t.log=console.debug||console.log||(()=>{});function s(u){try{u?t.storage.setItem("debug",u):t.storage.removeItem("debug")}catch{}}function o(){let u;try{u=t.storage.getItem("debug")}catch{}return!u&&typeof process<"u"&&"env"in process&&(u=r.DEBUG),u}function c(){try{return localStorage}catch{}}e.exports=Jg(t);const{formatters:l}=e.exports;l.j=function(u){try{return JSON.stringify(u)}catch(p){return"[UnexpectedJSONParseError]: "+p.message}}})(Po,Po.exports);var Zg=Po.exports,Kg=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(fn,"__esModule",{value:!0});fn.createModuleLogger=fn.createProjectLogger=void 0;const Qg=Kg(Zg),Yg=(0,Qg.default)("metamask");function Xg(e){return Yg.extend(e)}fn.createProjectLogger=Xg;function e_(e,t){return e.extend(t)}fn.createModuleLogger=e_;var _h={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.calculateNumberSize=e.calculateStringSize=e.isASCII=e.isPlainObject=e.ESCAPE_CHARACTERS_REGEXP=e.JsonSize=e.hasProperty=e.isObject=e.isNullOrUndefined=e.isNonEmptyArray=void 0;function t(u){return Array.isArray(u)&&u.length>0}e.isNonEmptyArray=t;function r(u){return u==null}e.isNullOrUndefined=r;function n(u){return!!u&&typeof u=="object"&&!Array.isArray(u)}e.isObject=n;const i=(u,p)=>Object.hasOwnProperty.call(u,p);e.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"}(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function s(u){if(typeof u!="object"||u===null)return!1;try{let p=u;for(;Object.getPrototypeOf(p)!==null;)p=Object.getPrototypeOf(p);return Object.getPrototypeOf(u)===p}catch{return!1}}e.isPlainObject=s;function o(u){return u.charCodeAt(0)<=127}e.isASCII=o;function c(u){var p;return u.split("").reduce((_,R)=>o(R)?_+1:_+2,0)+((p=u.match(e.ESCAPE_CHARACTERS_REGEXP))!==null&&p!==void 0?p:[]).length}e.calculateStringSize=c;function l(u){return u.toString().length}e.calculateNumberSize=l})(_h);var Ot={};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.hexToBigInt=Ot.hexToNumber=Ot.bigIntToHex=Ot.numberToHex=void 0;const rn=tt,Bn=oi,t_=e=>((0,rn.assert)(typeof e=="number","Value must be a number."),(0,rn.assert)(e>=0,"Value must be a non-negative number."),(0,rn.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Bn.add0x)(e.toString(16)));Ot.numberToHex=t_;const r_=e=>((0,rn.assert)(typeof e=="bigint","Value must be a bigint."),(0,rn.assert)(e>=0,"Value must be a non-negative bigint."),(0,Bn.add0x)(e.toString(16)));Ot.bigIntToHex=r_;const n_=e=>{(0,Bn.assertIsHexString)(e);const t=parseInt(e,16);return(0,rn.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};Ot.hexToNumber=n_;const i_=e=>((0,Bn.assertIsHexString)(e),BigInt((0,Bn.add0x)(e)));Ot.hexToBigInt=i_;var mh={};Object.defineProperty(mh,"__esModule",{value:!0});var vh={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.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"}(e.Duration||(e.Duration={}));const t=s=>Number.isInteger(s)&&s>=0,r=(s,o)=>{if(!t(s))throw new Error(`"${o}" must be a non-negative integer. Received: "${s}".`)};function n(s,o){return r(s,"count"),s*o}e.inMilliseconds=n;function i(s){return r(s,"timestamp"),Date.now()-s}e.timeSince=i})(vh);var bh={};Object.defineProperty(bh,"__esModule",{value:!0});var yh={},$o={exports:{}};const s_="2.0.0",wh=256,o_=Number.MAX_SAFE_INTEGER||9007199254740991,a_=16,c_=wh-6,l_=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var ws={MAX_LENGTH:wh,MAX_SAFE_COMPONENT_LENGTH:a_,MAX_SAFE_BUILD_LENGTH:c_,MAX_SAFE_INTEGER:o_,RELEASE_TYPES:l_,SEMVER_SPEC_VERSION:s_,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},ao={};const u_=typeof process=="object"&&ao&&ao.NODE_DEBUG&&/\bsemver\b/i.test(ao.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var Es=u_;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=ws,s=Es;t=e.exports={};const o=t.re=[],c=t.safeRe=[],l=t.src=[],u=t.t={};let p=0;const f="[a-zA-Z0-9-]",_=[["\\s",1],["\\d",i],[f,n]],R=P=>{for(const[L,M]of _)P=P.split(`${L}*`).join(`${L}{0,${M}}`).split(`${L}+`).join(`${L}{1,${M}}`);return P},x=(P,L,M)=>{const k=R(L),N=p++;s(P,N,L),u[P]=N,l[N]=L,o[N]=new RegExp(L,M?"g":void 0),c[N]=new RegExp(k,M?"g":void 0)};x("NUMERICIDENTIFIER","0|[1-9]\\d*"),x("NUMERICIDENTIFIERLOOSE","\\d+"),x("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),x("MAINVERSION",`(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})`),x("MAINVERSIONLOOSE",`(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})`),x("PRERELEASEIDENTIFIER",`(?:${l[u.NUMERICIDENTIFIER]}|${l[u.NONNUMERICIDENTIFIER]})`),x("PRERELEASEIDENTIFIERLOOSE",`(?:${l[u.NUMERICIDENTIFIERLOOSE]}|${l[u.NONNUMERICIDENTIFIER]})`),x("PRERELEASE",`(?:-(${l[u.PRERELEASEIDENTIFIER]}(?:\\.${l[u.PRERELEASEIDENTIFIER]})*))`),x("PRERELEASELOOSE",`(?:-?(${l[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[u.PRERELEASEIDENTIFIERLOOSE]})*))`),x("BUILDIDENTIFIER",`${f}+`),x("BUILD",`(?:\\+(${l[u.BUILDIDENTIFIER]}(?:\\.${l[u.BUILDIDENTIFIER]})*))`),x("FULLPLAIN",`v?${l[u.MAINVERSION]}${l[u.PRERELEASE]}?${l[u.BUILD]}?`),x("FULL",`^${l[u.FULLPLAIN]}$`),x("LOOSEPLAIN",`[v=\\s]*${l[u.MAINVERSIONLOOSE]}${l[u.PRERELEASELOOSE]}?${l[u.BUILD]}?`),x("LOOSE",`^${l[u.LOOSEPLAIN]}$`),x("GTLT","((?:<|>)?=?)"),x("XRANGEIDENTIFIERLOOSE",`${l[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),x("XRANGEIDENTIFIER",`${l[u.NUMERICIDENTIFIER]}|x|X|\\*`),x("XRANGEPLAIN",`[v=\\s]*(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:${l[u.PRERELEASE]})?${l[u.BUILD]}?)?)?`),x("XRANGEPLAINLOOSE",`[v=\\s]*(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:${l[u.PRERELEASELOOSE]})?${l[u.BUILD]}?)?)?`),x("XRANGE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAIN]}$`),x("XRANGELOOSE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAINLOOSE]}$`),x("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),x("COERCERTL",l[u.COERCE],!0),x("LONETILDE","(?:~>?)"),x("TILDETRIM",`(\\s*)${l[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",x("TILDE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAIN]}$`),x("TILDELOOSE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAINLOOSE]}$`),x("LONECARET","(?:\\^)"),x("CARETTRIM",`(\\s*)${l[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",x("CARET",`^${l[u.LONECARET]}${l[u.XRANGEPLAIN]}$`),x("CARETLOOSE",`^${l[u.LONECARET]}${l[u.XRANGEPLAINLOOSE]}$`),x("COMPARATORLOOSE",`^${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]})$|^$`),x("COMPARATOR",`^${l[u.GTLT]}\\s*(${l[u.FULLPLAIN]})$|^$`),x("COMPARATORTRIM",`(\\s*)${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]}|${l[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",x("HYPHENRANGE",`^\\s*(${l[u.XRANGEPLAIN]})\\s+-\\s+(${l[u.XRANGEPLAIN]})\\s*$`),x("HYPHENRANGELOOSE",`^\\s*(${l[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[u.XRANGEPLAINLOOSE]})\\s*$`),x("STAR","(<|>)?=?\\s*\\*"),x("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),x("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})($o,$o.exports);var ai=$o.exports;const h_=Object.freeze({loose:!0}),d_=Object.freeze({}),f_=e=>e?typeof e!="object"?h_:e:d_;var ga=f_;const Uc=/^[0-9]+$/,Eh=(e,t)=>{const r=Uc.test(e),n=Uc.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:eEh(t,e);var Sh={compareIdentifiers:Eh,rcompareIdentifiers:p_};const yi=Es,{MAX_LENGTH:Wc,MAX_SAFE_INTEGER:wi}=ws,{safeRe:Vc,t:qc}=ai,g_=ga,{compareIdentifiers:Zr}=Sh;let __=class It{constructor(t,r){if(r=g_(r),t instanceof It){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>Wc)throw new TypeError(`version is longer than ${Wc} characters`);yi("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=t.trim().match(r.loose?Vc[qc.LOOSE]:Vc[qc.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>wi||this.major<0)throw new TypeError("Invalid major version");if(this.minor>wi||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>wi||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]),Zr(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var st=__;const zc=st,m_=(e,t,r=!1)=>{if(e instanceof zc)return e;try{return new zc(e,t)}catch(n){if(!r)return null;throw n}};var Rn=m_;const v_=Rn,b_=(e,t)=>{const r=v_(e,t);return r?r.version:null};var y_=b_;const w_=Rn,E_=(e,t)=>{const r=w_(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};var S_=E_;const Gc=st,R_=(e,t,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new Gc(e instanceof Gc?e.version:e,r).inc(t,n,i).version}catch{return null}};var M_=R_;const Jc=Rn,C_=(e,t)=>{const r=Jc(e,null,!0),n=Jc(t,null,!0),i=r.compare(n);if(i===0)return null;const s=i>0,o=s?r:n,c=s?n:r,l=!!o.prerelease.length;if(!!c.prerelease.length&&!l)return!c.patch&&!c.minor?"major":o.patch?"patch":o.minor?"minor":"major";const p=l?"pre":"";return r.major!==n.major?p+"major":r.minor!==n.minor?p+"minor":r.patch!==n.patch?p+"patch":"prerelease"};var k_=C_;const I_=st,x_=(e,t)=>new I_(e,t).major;var A_=x_;const T_=st,N_=(e,t)=>new T_(e,t).minor;var L_=N_;const O_=st,P_=(e,t)=>new O_(e,t).patch;var $_=P_;const B_=Rn,D_=(e,t)=>{const r=B_(e,t);return r&&r.prerelease.length?r.prerelease:null};var F_=D_;const Zc=st,j_=(e,t,r)=>new Zc(e,r).compare(new Zc(t,r));var St=j_;const H_=St,U_=(e,t,r)=>H_(t,e,r);var W_=U_;const V_=St,q_=(e,t)=>V_(e,t,!0);var z_=q_;const Kc=st,G_=(e,t,r)=>{const n=new Kc(e,r),i=new Kc(t,r);return n.compare(i)||n.compareBuild(i)};var _a=G_;const J_=_a,Z_=(e,t)=>e.sort((r,n)=>J_(r,n,t));var K_=Z_;const Q_=_a,Y_=(e,t)=>e.sort((r,n)=>Q_(n,r,t));var X_=Y_;const em=St,tm=(e,t,r)=>em(e,t,r)>0;var Ss=tm;const rm=St,nm=(e,t,r)=>rm(e,t,r)<0;var ma=nm;const im=St,sm=(e,t,r)=>im(e,t,r)===0;var Rh=sm;const om=St,am=(e,t,r)=>om(e,t,r)!==0;var Mh=am;const cm=St,lm=(e,t,r)=>cm(e,t,r)>=0;var va=lm;const um=St,hm=(e,t,r)=>um(e,t,r)<=0;var ba=hm;const dm=Rh,fm=Mh,pm=Ss,gm=va,_m=ma,mm=ba,vm=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return dm(e,r,n);case"!=":return fm(e,r,n);case">":return pm(e,r,n);case">=":return gm(e,r,n);case"<":return _m(e,r,n);case"<=":return mm(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};var Ch=vm;const bm=st,ym=Rn,{safeRe:Ei,t:Si}=ai,wm=(e,t)=>{if(e instanceof bm)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(Ei[Si.COERCE]);else{let n;for(;(n=Ei[Si.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||n.index+n[0].length!==r.index+r[0].length)&&(r=n),Ei[Si.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;Ei[Si.COERCERTL].lastIndex=-1}return r===null?null:ym(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)};var Em=wm,co,Qc;function Sm(){return Qc||(Qc=1,co=function(e){e.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}),co}var Rm=ce;ce.Node=Mr;ce.create=ce;function ce(e){var t=this;if(t instanceof ce||(t=new ce),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach=="function")e.forEach(function(i){t.push(i)});else if(arguments.length>0)for(var r=0,n=arguments.length;r1)r=t;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=e(r,n.value,i),n=n.next;return r};ce.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;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=e(r,n.value,i),n=n.prev;return r};ce.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;r!==null;t++)e[t]=r.value,r=r.next;return e};ce.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;r!==null;t++)e[t]=r.value,r=r.prev;return e};ce.prototype.slice=function(e,t){t=t||this.length,t<0&&(t+=this.length),e=e||0,e<0&&(e+=this.length);var r=new ce;if(tthis.length&&(t=this.length);for(var n=0,i=this.head;i!==null&&nthis.length&&(t=this.length);for(var n=this.length,i=this.tail;i!==null&&n>t;n--)i=i.prev;for(;i!==null&&n>e;n--,i=i.prev)r.push(i.value);return r};ce.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,i=this.head;i!==null&&n1;class xm{constructor(t){if(typeof t=="number"&&(t={max:t}),t||(t={}),t.max&&(typeof t.max!="number"||t.max<0))throw new TypeError("max must be a non-negative number");this[vr]=t.max||1/0;const r=t.length||lo;if(this[Kr]=typeof r!="function"?lo:r,this[Ln]=t.stale||!1,t.maxAge&&typeof t.maxAge!="number")throw new TypeError("maxAge must be a number");this[yr]=t.maxAge||0,this[$t]=t.dispose,this[Yc]=t.noDisposeOnSet||!1,this[kh]=t.updateAgeOnGet||!1,this.reset()}set max(t){if(typeof t!="number"||t<0)throw new TypeError("max must be a non-negative number");this[vr]=t||1/0,Cn(this)}get max(){return this[vr]}set allowStale(t){this[Ln]=!!t}get allowStale(){return this[Ln]}set maxAge(t){if(typeof t!="number")throw new TypeError("maxAge must be a non-negative number");this[yr]=t,Cn(this)}get maxAge(){return this[yr]}set lengthCalculator(t){typeof t!="function"&&(t=lo),t!==this[Kr]&&(this[Kr]=t,this[Ft]=0,this[Qe].forEach(r=>{r.length=this[Kr](r.value,r.key),this[Ft]+=r.length})),Cn(this)}get lengthCalculator(){return this[Kr]}get length(){return this[Ft]}get itemCount(){return this[Qe].length}rforEach(t,r){r=r||this;for(let n=this[Qe].tail;n!==null;){const i=n.prev;Xc(this,t,n,r),n=i}}forEach(t,r){r=r||this;for(let n=this[Qe].head;n!==null;){const i=n.next;Xc(this,t,n,r),n=i}}keys(){return this[Qe].toArray().map(t=>t.key)}values(){return this[Qe].toArray().map(t=>t.value)}reset(){this[$t]&&this[Qe]&&this[Qe].length&&this[Qe].forEach(t=>this[$t](t.key,t.value)),this[wt]=new Map,this[Qe]=new Im,this[Ft]=0}dump(){return this[Qe].map(t=>Li(this,t)?!1:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}).toArray().filter(t=>t)}dumpLru(){return this[Qe]}set(t,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[Kr](r,t);if(this[wt].has(t)){if(s>this[vr])return nn(this,this[wt].get(t)),!1;const l=this[wt].get(t).value;return this[$t]&&(this[Yc]||this[$t](t,l.value)),l.now=i,l.maxAge=n,l.value=r,this[Ft]+=s-l.length,l.length=s,this.get(t),Cn(this),!0}const o=new Am(t,r,s,i,n);return o.length>this[vr]?(this[$t]&&this[$t](t,r),!1):(this[Ft]+=o.length,this[Qe].unshift(o),this[wt].set(t,this[Qe].head),Cn(this),!0)}has(t){if(!this[wt].has(t))return!1;const r=this[wt].get(t).value;return!Li(this,r)}get(t){return uo(this,t,!0)}peek(t){return uo(this,t,!1)}pop(){const t=this[Qe].tail;return t?(nn(this,t),t.value):null}del(t){nn(this,this[wt].get(t))}load(t){this.reset();const r=Date.now();for(let n=t.length-1;n>=0;n--){const i=t[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[wt].forEach((t,r)=>uo(this,r,!1))}}const uo=(e,t,r)=>{const n=e[wt].get(t);if(n){const i=n.value;if(Li(e,i)){if(nn(e,n),!e[Ln])return}else r&&(e[kh]&&(n.value.now=Date.now()),e[Qe].unshiftNode(n));return i.value}},Li=(e,t)=>{if(!t||!t.maxAge&&!e[yr])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[yr]&&r>e[yr]},Cn=e=>{if(e[Ft]>e[vr])for(let t=e[Qe].tail;e[Ft]>e[vr]&&t!==null;){const r=t.prev;nn(e,t),t=r}},nn=(e,t)=>{if(t){const r=t.value;e[$t]&&e[$t](r.key,r.value),e[Ft]-=r.length,e[wt].delete(r.key),e[Qe].removeNode(t)}};class Am{constructor(t,r,n,i,s){this.key=t,this.value=r,this.length=n,this.now=i,this.maxAge=s||0}}const Xc=(e,t,r,n)=>{let i=r.value;Li(e,i)&&(nn(e,r),e[Ln]||(i=void 0)),i&&t.call(n,i.value,i.key,e)};var Tm=xm,ho,el;function Rt(){if(el)return ho;el=1;class e{constructor(a,d){if(d=n(d),a instanceof e)return a.loose===!!d.loose&&a.includePrerelease===!!d.includePrerelease?a:new e(a.raw,d);if(a instanceof i)return this.raw=a.value,this.set=[[a]],this.format(),this;if(this.options=d,this.loose=!!d.loose,this.includePrerelease=!!d.includePrerelease,this.raw=a.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(g=>this.parseRange(g.trim())).filter(g=>g.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const g=this.set[0];if(this.set=this.set.filter(m=>!x(m[0])),this.set.length===0)this.set=[g];else if(this.set.length>1){for(const m of this.set)if(m.length===1&&P(m[0])){this.set=[m];break}}}this.format()}format(){return this.range=this.set.map(a=>a.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(a){const g=((this.options.includePrerelease&&_)|(this.options.loose&&R))+":"+a,m=r.get(g);if(m)return m;const y=this.options.loose,C=y?c[l.HYPHENRANGELOOSE]:c[l.HYPHENRANGE];a=a.replace(C,Q(this.options.includePrerelease)),s("hyphen replace",a),a=a.replace(c[l.COMPARATORTRIM],u),s("comparator trim",a),a=a.replace(c[l.TILDETRIM],p),s("tilde trim",a),a=a.replace(c[l.CARETTRIM],f),s("caret trim",a);let A=a.split(" ").map(W=>M(W,this.options)).join(" ").split(/\s+/).map(W=>X(W,this.options));y&&(A=A.filter(W=>(s("loose invalid filter",W,this.options),!!W.match(c[l.COMPARATORLOOSE])))),s("range list",A);const b=new Map,h=A.map(W=>new i(W,this.options));for(const W of h){if(x(W))return[W];b.set(W.value,W)}b.size>1&&b.has("")&&b.delete("");const S=[...b.values()];return r.set(g,S),S}intersects(a,d){if(!(a instanceof e))throw new TypeError("a Range is required");return this.set.some(g=>L(g,d)&&a.set.some(m=>L(m,d)&&g.every(y=>m.every(C=>y.intersects(C,d)))))}test(a){if(!a)return!1;if(typeof a=="string")try{a=new o(a,this.options)}catch{return!1}for(let d=0;dv.value==="<0.0.0-0",P=v=>v.value==="",L=(v,a)=>{let d=!0;const g=v.slice();let m=g.pop();for(;d&&g.length;)d=g.every(y=>m.intersects(y,a)),m=g.pop();return d},M=(v,a)=>(s("comp",v,a),v=O(v,a),s("caret",v),v=N(v,a),s("tildes",v),v=G(v,a),s("xrange",v),v=H(v,a),s("stars",v),v),k=v=>!v||v.toLowerCase()==="x"||v==="*",N=(v,a)=>v.trim().split(/\s+/).map(d=>$(d,a)).join(" "),$=(v,a)=>{const d=a.loose?c[l.TILDELOOSE]:c[l.TILDE];return v.replace(d,(g,m,y,C,A)=>{s("tilde",v,g,m,y,C,A);let b;return k(m)?b="":k(y)?b=`>=${m}.0.0 <${+m+1}.0.0-0`:k(C)?b=`>=${m}.${y}.0 <${m}.${+y+1}.0-0`:A?(s("replaceTilde pr",A),b=`>=${m}.${y}.${C}-${A} <${m}.${+y+1}.0-0`):b=`>=${m}.${y}.${C} <${m}.${+y+1}.0-0`,s("tilde return",b),b})},O=(v,a)=>v.trim().split(/\s+/).map(d=>D(d,a)).join(" "),D=(v,a)=>{s("caret",v,a);const d=a.loose?c[l.CARETLOOSE]:c[l.CARET],g=a.includePrerelease?"-0":"";return v.replace(d,(m,y,C,A,b)=>{s("caret",v,m,y,C,A,b);let h;return k(y)?h="":k(C)?h=`>=${y}.0.0${g} <${+y+1}.0.0-0`:k(A)?y==="0"?h=`>=${y}.${C}.0${g} <${y}.${+C+1}.0-0`:h=`>=${y}.${C}.0${g} <${+y+1}.0.0-0`:b?(s("replaceCaret pr",b),y==="0"?C==="0"?h=`>=${y}.${C}.${A}-${b} <${y}.${C}.${+A+1}-0`:h=`>=${y}.${C}.${A}-${b} <${y}.${+C+1}.0-0`:h=`>=${y}.${C}.${A}-${b} <${+y+1}.0.0-0`):(s("no pr"),y==="0"?C==="0"?h=`>=${y}.${C}.${A}${g} <${y}.${C}.${+A+1}-0`:h=`>=${y}.${C}.${A}${g} <${y}.${+C+1}.0-0`:h=`>=${y}.${C}.${A} <${+y+1}.0.0-0`),s("caret return",h),h})},G=(v,a)=>(s("replaceXRanges",v,a),v.split(/\s+/).map(d=>V(d,a)).join(" ")),V=(v,a)=>{v=v.trim();const d=a.loose?c[l.XRANGELOOSE]:c[l.XRANGE];return v.replace(d,(g,m,y,C,A,b)=>{s("xRange",v,g,m,y,C,A,b);const h=k(y),S=h||k(C),W=S||k(A),q=W;return m==="="&&q&&(m=""),b=a.includePrerelease?"-0":"",h?m===">"||m==="<"?g="<0.0.0-0":g="*":m&&q?(S&&(C=0),A=0,m===">"?(m=">=",S?(y=+y+1,C=0,A=0):(C=+C+1,A=0)):m==="<="&&(m="<",S?y=+y+1:C=+C+1),m==="<"&&(b="-0"),g=`${m+y}.${C}.${A}${b}`):S?g=`>=${y}.0.0${b} <${+y+1}.0.0-0`:W&&(g=`>=${y}.${C}.0${b} <${y}.${+C+1}.0-0`),s("xRange return",g),g})},H=(v,a)=>(s("replaceStars",v,a),v.trim().replace(c[l.STAR],"")),X=(v,a)=>(s("replaceGTE0",v,a),v.trim().replace(c[a.includePrerelease?l.GTE0PRE:l.GTE0],"")),Q=v=>(a,d,g,m,y,C,A,b,h,S,W,q,I)=>(k(g)?d="":k(m)?d=`>=${g}.0.0${v?"-0":""}`:k(y)?d=`>=${g}.${m}.0${v?"-0":""}`:C?d=`>=${d}`:d=`>=${d}${v?"-0":""}`,k(h)?b="":k(S)?b=`<${+h+1}.0.0-0`:k(W)?b=`<${h}.${+S+1}.0-0`:q?b=`<=${h}.${S}.${W}-${q}`:v?b=`<${h}.${S}.${+W+1}-0`:b=`<=${b}`,`${d} ${b}`.trim()),ie=(v,a,d)=>{for(let g=0;g0){const m=v[g].semver;if(m.major===a.major&&m.minor===a.minor&&m.patch===a.patch)return!0}return!1}return!0};return ho}var fo,tl;function Rs(){if(tl)return fo;tl=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(p,f){if(f=r(f),p instanceof t){if(p.loose===!!f.loose)return p;p=p.value}p=p.trim().split(/\s+/).join(" "),o("comparator",p,f),this.options=f,this.loose=!!f.loose,this.parse(p),this.semver===e?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(p){const f=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],_=p.match(f);if(!_)throw new TypeError(`Invalid comparator: ${p}`);this.operator=_[1]!==void 0?_[1]:"",this.operator==="="&&(this.operator=""),_[2]?this.semver=new c(_[2],this.options.loose):this.semver=e}toString(){return this.value}test(p){if(o("Comparator.test",p,this.options.loose),this.semver===e||p===e)return!0;if(typeof p=="string")try{p=new c(p,this.options)}catch{return!1}return s(p,this.operator,this.semver,this.options)}intersects(p,f){if(!(p instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new l(p.value,f).test(this.value):p.operator===""?p.value===""?!0:new l(this.value,f).test(p.semver):(f=r(f),f.includePrerelease&&(this.value==="<0.0.0-0"||p.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||p.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&p.operator.startsWith(">")||this.operator.startsWith("<")&&p.operator.startsWith("<")||this.semver.version===p.semver.version&&this.operator.includes("=")&&p.operator.includes("=")||s(this.semver,"<",p.semver,f)&&this.operator.startsWith(">")&&p.operator.startsWith("<")||s(this.semver,">",p.semver,f)&&this.operator.startsWith("<")&&p.operator.startsWith(">")))}}fo=t;const r=ga,{safeRe:n,t:i}=ai,s=Ch,o=Es,c=st,l=Rt();return fo}const Nm=Rt(),Lm=(e,t,r)=>{try{t=new Nm(t,r)}catch{return!1}return t.test(e)};var Ms=Lm;const Om=Rt(),Pm=(e,t)=>new Om(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var $m=Pm;const Bm=st,Dm=Rt(),Fm=(e,t,r)=>{let n=null,i=null,s=null;try{s=new Dm(t,r)}catch{return null}return e.forEach(o=>{s.test(o)&&(!n||i.compare(o)===-1)&&(n=o,i=new Bm(n,r))}),n};var jm=Fm;const Hm=st,Um=Rt(),Wm=(e,t,r)=>{let n=null,i=null,s=null;try{s=new Um(t,r)}catch{return null}return e.forEach(o=>{s.test(o)&&(!n||i.compare(o)===1)&&(n=o,i=new Hm(n,r))}),n};var Vm=Wm;const po=st,qm=Rt(),rl=Ss,zm=(e,t)=>{e=new qm(e,t);let r=new po("0.0.0");if(e.test(r)||(r=new po("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n{const c=new po(o.semver.version);switch(o.operator){case">":c.prerelease.length===0?c.patch++:c.prerelease.push(0),c.raw=c.format();case"":case">=":(!s||rl(c,s))&&(s=c);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!r||rl(r,s))&&(r=s)}return r&&e.test(r)?r:null};var Gm=zm;const Jm=Rt(),Zm=(e,t)=>{try{return new Jm(e,t).range||"*"}catch{return null}};var Km=Zm;const Qm=st,Ih=Rs(),{ANY:Ym}=Ih,Xm=Rt(),ev=Ms,nl=Ss,il=ma,tv=ba,rv=va,nv=(e,t,r,n)=>{e=new Qm(e,n),t=new Xm(t,n);let i,s,o,c,l;switch(r){case">":i=nl,s=tv,o=il,c=">",l=">=";break;case"<":i=il,s=rv,o=nl,c="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(ev(e,t,n))return!1;for(let u=0;u{R.semver===Ym&&(R=new Ih(">=0.0.0")),f=f||R,_=_||R,i(R.semver,f.semver,n)?f=R:o(R.semver,_.semver,n)&&(_=R)}),f.operator===c||f.operator===l||(!_.operator||_.operator===c)&&s(e,_.semver))return!1;if(_.operator===l&&o(e,_.semver))return!1}return!0};var ya=nv;const iv=ya,sv=(e,t,r)=>iv(e,t,">",r);var ov=sv;const av=ya,cv=(e,t,r)=>av(e,t,"<",r);var lv=cv;const sl=Rt(),uv=(e,t,r)=>(e=new sl(e,r),t=new sl(t,r),e.intersects(t,r));var hv=uv;const dv=Ms,fv=St;var pv=(e,t,r)=>{const n=[];let i=null,s=null;const o=e.sort((p,f)=>fv(p,f,r));for(const p of o)dv(p,t,r)?(s=p,i||(i=p)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);const c=[];for(const[p,f]of n)p===f?c.push(p):!f&&p===o[0]?c.push("*"):f?p===o[0]?c.push(`<=${f}`):c.push(`${p} - ${f}`):c.push(`>=${p}`);const l=c.join(" || "),u=typeof t.raw=="string"?t.raw:String(t);return l.length{if(e===t)return!0;e=new ol(e,r),t=new ol(t,r);let n=!1;e:for(const i of e.set){for(const s of t.set){const o=mv(i,s,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},_v=[new wa(">=0.0.0-0")],al=[new wa(">=0.0.0")],mv=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===go){if(t.length===1&&t[0].semver===go)return!0;r.includePrerelease?e=_v:e=al}if(t.length===1&&t[0].semver===go){if(r.includePrerelease)return!0;t=al}const n=new Set;let i,s;for(const R of e)R.operator===">"||R.operator===">="?i=cl(i,R,r):R.operator==="<"||R.operator==="<="?s=ll(s,R,r):n.add(R.semver);if(n.size>1)return null;let o;if(i&&s){if(o=Ea(i.semver,s.semver,r),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(const R of n){if(i&&!kn(R,String(i),r)||s&&!kn(R,String(s),r))return null;for(const x of t)if(!kn(R,String(x),r))return!1;return!0}let c,l,u,p,f=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,_=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 R of t){if(p=p||R.operator===">"||R.operator===">=",u=u||R.operator==="<"||R.operator==="<=",i){if(_&&R.semver.prerelease&&R.semver.prerelease.length&&R.semver.major===_.major&&R.semver.minor===_.minor&&R.semver.patch===_.patch&&(_=!1),R.operator===">"||R.operator===">="){if(c=cl(i,R,r),c===R&&c!==i)return!1}else if(i.operator===">="&&!kn(i.semver,String(R),r))return!1}if(s){if(f&&R.semver.prerelease&&R.semver.prerelease.length&&R.semver.major===f.major&&R.semver.minor===f.minor&&R.semver.patch===f.patch&&(f=!1),R.operator==="<"||R.operator==="<="){if(l=ll(s,R,r),l===R&&l!==s)return!1}else if(s.operator==="<="&&!kn(s.semver,String(R),r))return!1}if(!R.operator&&(s||i)&&o!==0)return!1}return!(i&&u&&!s&&o!==0||s&&p&&!i&&o!==0||_||f)},cl=(e,t,r)=>{if(!e)return t;const n=Ea(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},ll=(e,t,r)=>{if(!e)return t;const n=Ea(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};var vv=gv;const _o=ai,ul=ws,bv=st,hl=Sh,yv=Rn,wv=y_,Ev=S_,Sv=M_,Rv=k_,Mv=A_,Cv=L_,kv=$_,Iv=F_,xv=St,Av=W_,Tv=z_,Nv=_a,Lv=K_,Ov=X_,Pv=Ss,$v=ma,Bv=Rh,Dv=Mh,Fv=va,jv=ba,Hv=Ch,Uv=Em,Wv=Rs(),Vv=Rt(),qv=Ms,zv=$m,Gv=jm,Jv=Vm,Zv=Gm,Kv=Km,Qv=ya,Yv=ov,Xv=lv,eb=hv,tb=pv,rb=vv;var nb={parse:yv,valid:wv,clean:Ev,inc:Sv,diff:Rv,major:Mv,minor:Cv,patch:kv,prerelease:Iv,compare:xv,rcompare:Av,compareLoose:Tv,compareBuild:Nv,sort:Lv,rsort:Ov,gt:Pv,lt:$v,eq:Bv,neq:Dv,gte:Fv,lte:jv,cmp:Hv,coerce:Uv,Comparator:Wv,Range:Vv,satisfies:qv,toComparators:zv,maxSatisfying:Gv,minSatisfying:Jv,minVersion:Zv,validRange:Kv,outside:Qv,gtr:Yv,ltr:Xv,intersects:eb,simplifyRange:tb,subset:rb,SemVer:bv,re:_o.re,src:_o.src,tokens:_o.t,SEMVER_SPEC_VERSION:ul.SEMVER_SPEC_VERSION,RELEASE_TYPES:ul.RELEASE_TYPES,compareIdentifiers:hl.compareIdentifiers,rcompareIdentifiers:hl.rcompareIdentifiers};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.satisfiesVersionRange=e.gtRange=e.gtVersion=e.assertIsSemVerRange=e.assertIsSemVerVersion=e.isValidSemVerRange=e.isValidSemVerVersion=e.VersionRangeStruct=e.VersionStruct=void 0;const t=nb,r=Lr,n=tt;e.VersionStruct=(0,r.refine)((0,r.string)(),"Version",f=>(0,t.valid)(f)===null?`Expected SemVer version, got "${f}"`:!0),e.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",f=>(0,t.validRange)(f)===null?`Expected SemVer range, got "${f}"`:!0);function i(f){return(0,r.is)(f,e.VersionStruct)}e.isValidSemVerVersion=i;function s(f){return(0,r.is)(f,e.VersionRangeStruct)}e.isValidSemVerRange=s;function o(f){(0,n.assertStruct)(f,e.VersionStruct)}e.assertIsSemVerVersion=o;function c(f){(0,n.assertStruct)(f,e.VersionRangeStruct)}e.assertIsSemVerRange=c;function l(f,_){return(0,t.gt)(f,_)}e.gtVersion=l;function u(f,_){return(0,t.gtr)(f,_)}e.gtRange=u;function p(f,_){return(0,t.satisfies)(f,_,{includePrerelease:!0})}e.satisfiesVersionRange=p})(yh);(function(e){var t=J&&J.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s);var c=Object.getOwnPropertyDescriptor(i,s);(!c||("get"in c?!i.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,o,c)}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=J&&J.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(tt,e),r(si,e),r(ae,e),r(bs,e),r(Lt,e),r(dn,e),r(fh,e),r(oi,e),r(ph,e),r(gh,e),r(fn,e),r(_h,e),r(Ot,e),r(mh,e),r(vh,e),r(bh,e),r(yh,e)})(Ju);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createModuleLogger=e.projectLogger=void 0;const t=Ju;Object.defineProperty(e,"createModuleLogger",{enumerable:!0,get:function(){return t.createModuleLogger}}),e.projectLogger=(0,t.createProjectLogger)("eth-block-tracker")})(Gu);var xh=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ms,"__esModule",{value:!0});ms.PollingBlockTracker=void 0;const ib=xh(sa),sb=xh(S1),ob=ri,dl=Gu,fl=(0,dl.createModuleLogger)(dl.projectLogger,"polling-block-tracker"),ab=(0,ib.default)(),cb=1e3;class lb extends ob.BaseBlockTracker{constructor(t={}){var r;if(!t.provider)throw new Error("PollingBlockTracker - no provider specified.");super(Object.assign(Object.assign({},t),{blockResetDuration:(r=t.blockResetDuration)!==null&&r!==void 0?r:t.pollingInterval})),this._provider=t.provider,this._pollingInterval=t.pollingInterval||20*cb,this._retryTimeout=t.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=t.keepEventLoopActive===void 0?!0:t.keepEventLoopActive,this._setSkipCacheFlag=t.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var t;this._isRunning;)try{await this._updateLatestBlock();const r=pl(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: +${(t=r.stack)!==null&&t!==void 0?t:r}`);try{this.emit("error",n)}catch{console.error(n)}const i=pl(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await i}}async _updateLatestBlock(){const t=await this._fetchLatestBlock();this._newPotentialLatest(t)}async _fetchLatestBlock(){const t={jsonrpc:"2.0",id:ab(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(t.skipCache=!0),fl("Making request",t);const r=await(0,sb.default)(n=>this._provider.sendAsync(t,n))();if(fl("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block: +${r.error.message}`);return r.result}}ms.PollingBlockTracker=lb;function pl(e,t){return new Promise(r=>{const n=setTimeout(r,e);n.unref&&t&&n.unref()})}var Cs={},ub=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Cs,"__esModule",{value:!0});Cs.SubscribeBlockTracker=void 0;const hb=ub(sa),db=ri,fb=(0,hb.default)();class pb extends db.BaseBlockTracker{constructor(t={}){if(!t.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(t),this._provider=t.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const t=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(t)}catch(t){this.emit("error",t)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(t){this.emit("error",t)}}_call(t,...r){return new Promise((n,i)=>{this._provider.sendAsync({id:fb(),method:t,params:r,jsonrpc:"2.0"},(s,o)=>{s?i(s):n(o.result)})})}_handleSubData(t,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)}}Cs.SubscribeBlockTracker=pb;(function(e){var t=J&&J.__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=J&&J.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(ms,e),r(Cs,e)})(zu);var Sa={},ks={},ci={};Object.defineProperty(ci,"__esModule",{value:!0});ci.getUniqueId=void 0;const Ah=4294967295;let mo=Math.floor(Math.random()*Ah);function gb(){return mo=(mo+1)%Ah,mo}ci.getUniqueId=gb;Object.defineProperty(ks,"__esModule",{value:!0});ks.createIdRemapMiddleware=void 0;const _b=ci;function mb(){return(e,t,r,n)=>{const i=e.id,s=_b.getUniqueId();e.id=s,t.id=s,r(o=>{e.id=i,t.id=i,o()})}}ks.createIdRemapMiddleware=mb;var Is={};Object.defineProperty(Is,"__esModule",{value:!0});Is.createAsyncMiddleware=void 0;function vb(e){return async(t,r,n,i)=>{let s;const o=new Promise(p=>{s=p});let c=null,l=!1;const u=async()=>{l=!0,n(p=>{c=p,s()}),await o};try{await e(t,r,u),l?(await o,c(null)):i(null)}catch(p){c?c(p):i(p)}}}Is.createAsyncMiddleware=vb;var xs={};Object.defineProperty(xs,"__esModule",{value:!0});xs.createScaffoldMiddleware=void 0;function bb(e){return(t,r,n,i)=>{const s=e[t.method];return s===void 0?n():typeof s=="function"?s(t,r,n,i):(r.result=s,i())}}xs.createScaffoldMiddleware=bb;var li={},Ra={};Object.defineProperty(Ra,"__esModule",{value:!0});const yb=Di;function gl(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function wb(e){const t=e.length,r=new Array(t);for(let n=0;n0&&([o]=r),o instanceof Error)throw o;const c=new Error(`Unhandled error.${o?` (${o.message})`:""}`);throw c.context=o,c}const s=i[t];if(s===void 0)return!1;if(typeof s=="function")gl(s,this,r);else{const o=s.length,c=wb(s);for(let l=0;l"u"&&(n=Lh()),Bo(e,"",0,[],void 0,0,n);var i;try{wr.length===0?i=JSON.stringify(e,t,r):i=JSON.stringify(e,Ph(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Cr.length!==0;){var s=Cr.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function sn(e,t,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:e}),Cr.push([n,r,t,i])):wr.push([t,r,e]):(n[r]=e,Cr.push([n,r,t]))}function Bo(e,t,r,n,i,s,o){s+=1;var c;if(typeof e=="object"&&e!==null){for(c=0;co.depthLimit){sn(Oi,e,t,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){sn(Oi,e,t,i);return}if(n.push(e),Array.isArray(e))for(c=0;ct?1:0}function Oh(e,t,r,n){typeof n>"u"&&(n=Lh());var i=Do(e,"",0,[],void 0,0,n)||e,s;try{wr.length===0?s=JSON.stringify(i,t,r):s=JSON.stringify(i,Ph(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Cr.length!==0;){var o=Cr.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return s}function Do(e,t,r,n,i,s,o){s+=1;var c;if(typeof e=="object"&&e!==null){for(c=0;co.depthLimit){sn(Oi,e,t,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){sn(Oi,e,t,i);return}if(n.push(e),Array.isArray(e))for(c=0;c0)for(var n=0;n=1e3&&e<=4999}function Ib(e,t){if(t!=="[Circular]")return t}var Ma={},Kt={};Object.defineProperty(Kt,"__esModule",{value:!0});Kt.errorValues=Kt.errorCodes=void 0;Kt.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}};Kt.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(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=Kt,r=Zt,n=t.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:n,message:o(n)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function o(_,R=i){if(Number.isInteger(_)){const x=_.toString();if(f(t.errorValues,x))return t.errorValues[x].message;if(u(_))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return R}e.getMessageFromCode=o;function c(_){if(!Number.isInteger(_))return!1;const R=_.toString();return!!(t.errorValues[R]||u(_))}e.isValidCode=c;function l(_,{fallbackError:R=s,shouldIncludeStack:x=!1}={}){var P,L;if(!R||!Number.isInteger(R.code)||typeof R.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(_ instanceof r.EthereumRpcError)return _.serialize();const M={};if(_&&typeof _=="object"&&!Array.isArray(_)&&f(_,"code")&&c(_.code)){const N=_;M.code=N.code,N.message&&typeof N.message=="string"?(M.message=N.message,f(N,"data")&&(M.data=N.data)):(M.message=o(M.code),M.data={originalError:p(_)})}else{M.code=R.code;const N=(P=_)===null||P===void 0?void 0:P.message;M.message=N&&typeof N=="string"?N:R.message,M.data={originalError:p(_)}}const k=(L=_)===null||L===void 0?void 0:L.stack;return x&&_&&k&&typeof k=="string"&&(M.stack=k),M}e.serializeError=l;function u(_){return _>=-32099&&_<=-32e3}function p(_){return _&&typeof _=="object"&&!Array.isArray(_)?Object.assign({},_):_}function f(_,R){return Object.prototype.hasOwnProperty.call(_,R)}})(Ma);var As={};Object.defineProperty(As,"__esModule",{value:!0});As.ethErrors=void 0;const Ca=Zt,Bh=Ma,rt=Kt;As.ethErrors={rpc:{parse:e=>ft(rt.errorCodes.rpc.parse,e),invalidRequest:e=>ft(rt.errorCodes.rpc.invalidRequest,e),invalidParams:e=>ft(rt.errorCodes.rpc.invalidParams,e),methodNotFound:e=>ft(rt.errorCodes.rpc.methodNotFound,e),internal:e=>ft(rt.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return ft(t,e)},invalidInput:e=>ft(rt.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>ft(rt.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>ft(rt.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>ft(rt.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>ft(rt.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>ft(rt.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>In(rt.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>In(rt.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>In(rt.errorCodes.provider.unsupportedMethod,e),disconnected:e=>In(rt.errorCodes.provider.disconnected,e),chainDisconnected:e=>In(rt.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new Ca.EthereumProviderError(t,r,n)}}};function ft(e,t){const[r,n]=Dh(t);return new Ca.EthereumRpcError(e,r||Bh.getMessageFromCode(e),n)}function In(e,t){const[r,n]=Dh(t);return new Ca.EthereumProviderError(e,r||Bh.getMessageFromCode(e),n)}function Dh(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const t=Zt;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const r=Ma;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=As;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=Kt;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(Th);var xb=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(li,"__esModule",{value:!0});li.JsonRpcEngine=void 0;const Ab=xb(Ra),pt=Th;class Bt extends Ab.default{constructor(){super(),this._middleware=[]}push(t){this._middleware.push(t)}handle(t,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(t)?r?this._handleBatch(t,r):this._handleBatch(t):r?this._handle(t,r):this._promiseHandle(t)}asMiddleware(){return async(t,r,n,i)=>{try{const[s,o,c]=await Bt._runAllMiddleware(t,r,this._middleware);return o?(await Bt._runReturnHandlers(c),i(s)):n(async l=>{try{await Bt._runReturnHandlers(c)}catch(u){return l(u)}return l()})}catch(s){return i(s)}}}async _handleBatch(t,r){try{const n=await Promise.all(t.map(this._promiseHandle.bind(this)));return r?r(null,n):n}catch(n){if(r)return r(n);throw n}}_promiseHandle(t){return new Promise(r=>{this._handle(t,(n,i)=>{r(i)})})}async _handle(t,r){if(!t||Array.isArray(t)||typeof t!="object"){const o=new pt.EthereumRpcError(pt.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof t}`,{request:t});return r(o,{id:void 0,jsonrpc:"2.0",error:o})}if(typeof t.method!="string"){const o=new pt.EthereumRpcError(pt.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof t.method}`,{request:t});return r(o,{id:t.id,jsonrpc:"2.0",error:o})}const n=Object.assign({},t),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=pt.serializeError(s))),r(s,i)}async _processRequest(t,r){const[n,i,s]=await Bt._runAllMiddleware(t,r,this._middleware);if(Bt._checkForCompletion(t,r,i),await Bt._runReturnHandlers(s),n)throw n}static async _runAllMiddleware(t,r,n){const i=[];let s=null,o=!1;for(const c of n)if([s,o]=await Bt._runMiddleware(t,r,c,i),o)break;return[s,o,i.reverse()]}static _runMiddleware(t,r,n,i){return new Promise(s=>{const o=l=>{const u=l||r.error;u&&(r.error=pt.serializeError(u)),s([u,!0])},c=l=>{r.error?o(r.error):(l&&(typeof l!="function"&&o(new pt.EthereumRpcError(pt.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof l}" for request: +${vo(t)}`,{request:t})),i.push(l)),s([null,!1]))};try{n(t,r,c,o)}catch(l){o(l)}})}static async _runReturnHandlers(t){for(const r of t)await new Promise((n,i)=>{r(s=>s?i(s):n())})}static _checkForCompletion(t,r,n){if(!("result"in r)&&!("error"in r))throw new pt.EthereumRpcError(pt.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request: +${vo(t)}`,{request:t});if(!n)throw new pt.EthereumRpcError(pt.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request: +${vo(t)}`,{request:t})}}li.JsonRpcEngine=Bt;function vo(e){return JSON.stringify(e,null,2)}var Ts={};Object.defineProperty(Ts,"__esModule",{value:!0});Ts.mergeMiddleware=void 0;const Tb=li;function Nb(e){const t=new Tb.JsonRpcEngine;return e.forEach(r=>t.push(r)),t.asMiddleware()}Ts.mergeMiddleware=Nb;(function(e){var t=J&&J.__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=J&&J.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(ks,e),r(Is,e),r(xs,e),r(ci,e),r(li,e),r(Ts,e)})(Sa);var Fh={},ka={},Fo=function(e,t){return Fo=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])},Fo(e,t)};function jh(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Fo(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Pi=function(){return Pi=Object.assign||function(t){for(var r,n=1,i=arguments.length;n=0;c--)(o=e[c])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s}function Wh(e,t){return function(r,n){t(r,n,e)}}function Lb(e,t,r,n,i,s){function o(M){if(M!==void 0&&typeof M!="function")throw new TypeError("Function expected");return M}for(var c=n.kind,l=c==="getter"?"get":c==="setter"?"set":"value",u=!t&&e?n.static?e:e.prototype:null,p=t||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),f,_=!1,R=r.length-1;R>=0;R--){var x={};for(var P in n)x[P]=P==="access"?{}:n[P];for(var P in n.access)x.access[P]=n.access[P];x.addInitializer=function(M){if(_)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(M||null))};var L=(0,r[R])(c==="accessor"?{get:p.get,set:p.set}:p[l],x);if(c==="accessor"){if(L===void 0)continue;if(L===null||typeof L!="object")throw new TypeError("Object expected");(f=o(L.get))&&(p.get=f),(f=o(L.set))&&(p.set=f),(f=o(L.init))&&i.unshift(f)}else(f=o(L))&&(c==="field"?i.unshift(f):p[l]=f)}u&&Object.defineProperty(u,n.name,p),_=!0}function Ob(e,t,r){for(var n=arguments.length>2,i=0;i0&&s[s.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ia(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function Jh(){for(var e=[],t=0;t1||c(_,R)})})}function c(_,R){try{l(n[_](R))}catch(x){f(s[0][3],x)}}function l(_){_.value instanceof pn?Promise.resolve(_.value.v).then(u,p):f(s[0][2],_)}function u(_){c("next",_)}function p(_){c("throw",_)}function f(_,R){_(R),s.shift(),s.length&&c(s[0][0],s[0][1])}}function Yh(e){var t,r;return t={},n("next"),n("throw",function(i){throw i}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(i,s){t[i]=e[i]?function(o){return(r=!r)?{value:pn(e[i](o)),done:!1}:s?s(o):o}:s}}function Xh(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof $i=="function"?$i(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=e[s]&&function(o){return new Promise(function(c,l){o=e[s](o),i(c,l,o.done,o.value)})}}function i(s,o,c,l){Promise.resolve(l).then(function(u){s({value:u,done:c})},o)}}function ed(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var Bb=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function td(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Ns(t,e,r);return Bb(t,e),t}function rd(e){return e&&e.__esModule?e:{default:e}}function nd(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}function id(e,t,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 t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r}function sd(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function od(e,t,r){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose]}if(typeof n!="function")throw new TypeError("Object not disposable.");e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}var Db=typeof SuppressedError=="function"?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function ad(e){function t(n){e.error=e.hasError?new Db(n,e.error,"An error was suppressed during disposal."):n,e.hasError=!0}function r(){for(;e.stack.length;){var n=e.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(r,function(s){return t(s),r()})}catch(s){t(s)}}if(e.hasError)throw e.error}return r()}const Fb={__extends:jh,__assign:Pi,__rest:Hh,__decorate:Uh,__param:Wh,__metadata:Vh,__awaiter:qh,__generator:zh,__createBinding:Ns,__exportStar:Gh,__values:$i,__read:Ia,__spread:Jh,__spreadArrays:Zh,__spreadArray:Kh,__await:pn,__asyncGenerator:Qh,__asyncDelegator:Yh,__asyncValues:Xh,__makeTemplateObject:ed,__importStar:td,__importDefault:rd,__classPrivateFieldGet:nd,__classPrivateFieldSet:id,__classPrivateFieldIn:sd,__addDisposableResource:od,__disposeResources:ad},jb=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:od,get __assign(){return Pi},__asyncDelegator:Yh,__asyncGenerator:Qh,__asyncValues:Xh,__await:pn,__awaiter:qh,__classPrivateFieldGet:nd,__classPrivateFieldIn:sd,__classPrivateFieldSet:id,__createBinding:Ns,__decorate:Uh,__disposeResources:ad,__esDecorate:Lb,__exportStar:Gh,__extends:jh,__generator:zh,__importDefault:rd,__importStar:td,__makeTemplateObject:ed,__metadata:Vh,__param:Wh,__propKey:Pb,__read:Ia,__rest:Hh,__runInitializers:Ob,__setFunctionName:$b,__spread:Jh,__spreadArray:Kh,__spreadArrays:Zh,__values:$i,default:Fb},Symbol.toStringTag,{value:"Module"})),xa=gn(jb);var Ls={};Object.defineProperty(Ls,"__esModule",{value:!0});var _l=xa,Hb=function(){function e(t){if(this._maxConcurrency=t,this._queue=[],t<=0)throw new Error("semaphore must be initialized to a positive value");this._value=t}return e.prototype.acquire=function(){var t=this,r=this.isLocked(),n=new Promise(function(i){return t._queue.push(i)});return r||this._dispatch(),n},e.prototype.runExclusive=function(t){return _l.__awaiter(this,void 0,void 0,function(){var r,n,i;return _l.__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,t(n)];case 3:return[2,s.sent()];case 4:return i(),[7];case 5:return[2]}})})},e.prototype.isLocked=function(){return this._value<=0},e.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 t=this._currentReleaser;this._currentReleaser=void 0,t()}},e.prototype._dispatch=function(){var t=this,r=this._queue.shift();if(r){var n=!1;this._currentReleaser=function(){n||(n=!0,t._value++,t._dispatch())},r([this._value--,this._currentReleaser])}},e}();Ls.default=Hb;Object.defineProperty(ka,"__esModule",{value:!0});var ml=xa,Ub=Ls,Wb=function(){function e(){this._semaphore=new Ub.default(1)}return e.prototype.acquire=function(){return ml.__awaiter(this,void 0,void 0,function(){var t,r;return ml.__generator(this,function(n){switch(n.label){case 0:return[4,this._semaphore.acquire()];case 1:return t=n.sent(),r=t[1],[2,r]}})})},e.prototype.runExclusive=function(t){return this._semaphore.runExclusive(function(){return t()})},e.prototype.isLocked=function(){return this._semaphore.isLocked()},e.prototype.release=function(){this._semaphore.release()},e}();ka.default=Wb;var Os={};Object.defineProperty(Os,"__esModule",{value:!0});Os.withTimeout=void 0;var Ri=xa;function Vb(e,t,r){var n=this;return r===void 0&&(r=new Error("timeout")),{acquire:function(){return new Promise(function(i,s){return Ri.__awaiter(n,void 0,void 0,function(){var o,c,l;return Ri.__generator(this,function(u){switch(u.label){case 0:return o=!1,setTimeout(function(){o=!0,s(r)},t),[4,e.acquire()];case 1:return c=u.sent(),o?(l=Array.isArray(c)?c[1]:c,l()):i(c),[2]}})})})},runExclusive:function(i){return Ri.__awaiter(this,void 0,void 0,function(){var s,o;return Ri.__generator(this,function(c){switch(c.label){case 0:s=function(){},c.label=1;case 1:return c.trys.push([1,,7,8]),[4,this.acquire()];case 2:return o=c.sent(),Array.isArray(o)?(s=o[1],[4,i(o[0])]):[3,4];case 3:return[2,c.sent()];case 4:return s=o,[4,i()];case 5:return[2,c.sent()];case 6:return[3,8];case 7:return s(),[7];case 8:return[2]}})})},release:function(){e.release()},isLocked:function(){return e.isLocked()}}}Os.withTimeout=Vb;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.withTimeout=e.Semaphore=e.Mutex=void 0;var t=ka;Object.defineProperty(e,"Mutex",{enumerable:!0,get:function(){return t.default}});var r=Ls;Object.defineProperty(e,"Semaphore",{enumerable:!0,get:function(){return r.default}});var n=Os;Object.defineProperty(e,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}})})(Fh);var qb=Gb,zb=Object.prototype.hasOwnProperty;function Gb(){for(var e={},t=0;tfunction(...i){const s=t.promiseModule;return new s((o,c)=>{t.multiArgs?i.push((...u)=>{t.errorFirst?u[0]?c(u):(u.shift(),o(u)):o(u)}):t.errorFirst?i.push((u,p)=>{u?c(u):o(p)}):i.push(o),Reflect.apply(e,this===r?n:this,i)})},bl=new WeakMap;var Yb=(e,t)=>{t={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...t};const r=typeof e;if(!(e!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${e===null?"null":r}\``);const n=(o,c)=>{let l=bl.get(o);if(l||(l={},bl.set(o,l)),c in l)return l[c];const u=x=>typeof x=="string"||typeof c=="symbol"?c===x:x.test(c),p=Reflect.getOwnPropertyDescriptor(o,c),f=p===void 0||p.writable||p.configurable,R=(t.include?t.include.some(u):!t.exclude.some(u))&&f;return l[c]=R,R},i=new WeakMap,s=new Proxy(e,{apply(o,c,l){const u=i.get(o);if(u)return Reflect.apply(u,c,l);const p=t.excludeMain?o:vl(o,t,s,o);return i.set(o,p),Reflect.apply(p,c,l)},get(o,c){const l=o[c];if(!n(o,c)||l===Function.prototype[c])return l;const u=i.get(l);if(u)return u;if(typeof l=="function"){const p=vl(l,t,s,o);return i.set(l,p),p}return l}});return s};const Xb=ni.default;let ey=class extends Xb{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(t){this.updates=this.updates.concat(t),t.forEach(r=>this.emit("update",r))}addInitialResults(t){}getChangesAndClear(){const t=this.updates;return this.updates=[],t}};var Aa=ey;const ty=Aa;let ry=class extends ty{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(t){this.allResults=this.allResults.concat(t),super.addResults(t)}addInitialResults(t){this.allResults=this.allResults.concat(t),super.addInitialResults(t)}getAllResults(){return this.allResults}};var ny=ry,hi={minBlockRef:iy,maxBlockRef:sy,sortBlockRefs:Ta,bnToHex:oy,blockRefIsNumber:ay,hexToInt:Bi,incrementHexInt:cy,intToHex:cd,unsafeRandomBytes:ly};function iy(...e){return Ta(e)[0]}function sy(...e){const t=Ta(e);return t[t.length-1]}function Ta(e){return e.sort((t,r)=>t==="latest"||r==="earliest"?1:r==="latest"||t==="earliest"?-1:Bi(t)-Bi(r))}function oy(e){return"0x"+e.toString(16)}function ay(e){return e&&!["earliest","latest","pending"].includes(e)}function Bi(e){return e==null?e:Number.parseInt(e,16)}function cy(e){if(e==null)return e;const t=Bi(e);return cd(t+1)}function cd(e){if(e==null)return e;let t=e.toString(16);return t.length%2&&(t="0"+t),"0x"+t}function ly(e){let t="0x";for(let r=0;rn.toLowerCase()))}async initialize({currentBlock:t}){let r=this.params.fromBlock;["latest","pending"].includes(r)&&(r=t),r==="earliest"&&(r="0x0"),this.params.fromBlock=r;const n=py(this.params.toBlock,t),i=Object.assign({},this.params,{toBlock:n}),s=await this._fetchLogs(i);this.addInitialResults(s)}async update({oldBlock:t,newBlock:r}){const n=r;let i;t?i=fy(t):i=r;const s=Object.assign({},this.params,{fromBlock:i,toBlock:n}),c=(await this._fetchLogs(s)).filter(l=>this.matchLog(l));this.addResults(c)}async _fetchLogs(t){return await hy(n=>this.ethQuery.getLogs(t,n))()}matchLog(t){if(Mi(this.params.fromBlock)>=Mi(t.blockNumber)||gy(this.params.toBlock)&&Mi(this.params.toBlock)<=Mi(t.blockNumber))return!1;const r=t.address&&t.address.toLowerCase();return this.params.address&&r&&!this.params.address.includes(r)?!1:this.params.topics.every((i,s)=>{let o=t.topics[s];if(!o)return!1;o=o.toLowerCase();let c=Array.isArray(i)?i:[i];return c.includes(null)?!0:(c=c.map(p=>p.toLowerCase()),c.includes(o))})}};var my=_y,Na=vy;async function vy({provider:e,fromBlock:t,toBlock:r}){t||(t=r);const n=wl(t),s=wl(r)-n+1,o=Array(s).fill().map((l,u)=>n+u).map(by);let c=await Promise.all(o.map(l=>wy(e,"eth_getBlockByNumber",[l,!1])));return c=c.filter(l=>l!==null),c}function wl(e){return e==null?e:Number.parseInt(e,16)}function by(e){return e==null?e:"0x"+e.toString(16)}function yy(e,t){return new Promise((r,n)=>{e.sendAsync(t,(i,s)=>{i?n(i):s.error?n(s.error):s.result?r(s.result):n(new Error("Result was empty"))})})}async function wy(e,t,r){for(let n=0;n<3;n++)try{return await yy(e,{id:1,jsonrpc:"2.0",method:t,params:r})}catch(i){console.error(`provider.sendAsync failed: ${i.stack||i.message||i}`)}return null}const Ey=Aa,Sy=Na,{incrementHexInt:Ry}=hi;let My=class extends Ey{constructor({provider:t,params:r}){super(),this.type="block",this.provider=t}async update({oldBlock:t,newBlock:r}){const n=r,i=Ry(t),o=(await Sy({provider:this.provider,fromBlock:i,toBlock:n})).map(c=>c.hash);this.addResults(o)}};var Cy=My;const ky=Aa,Iy=Na,{incrementHexInt:xy}=hi;let Ay=class extends ky{constructor({provider:t}){super(),this.type="tx",this.provider=t}async update({oldBlock:t}){const r=t,n=xy(t),i=await Iy({provider:this.provider,fromBlock:n,toBlock:r}),s=[];for(const o of i)s.push(...o.transactions);this.addResults(s)}};var Ty=Ay;const Ny=Fh.Mutex,{createAsyncMiddleware:Ly,createScaffoldMiddleware:Oy}=Sa,Py=my,$y=Cy,By=Ty,{intToHex:ld,hexToInt:bo}=hi;var Dy=Fy;function Fy({blockTracker:e,provider:t}){let r=0,n={};const i=new Ny,s=jy({mutex:i}),o=Oy({eth_newFilter:s(yo(l)),eth_newBlockFilter:s(yo(u)),eth_newPendingTransactionFilter:s(yo(p)),eth_uninstallFilter:s(Ai(R)),eth_getFilterChanges:s(Ai(f)),eth_getFilterLogs:s(Ai(_))}),c=async({oldBlock:k,newBlock:N})=>{if(n.length===0)return;const $=await i.acquire();try{await Promise.all(Qr(n).map(async O=>{try{await O.update({oldBlock:k,newBlock:N})}catch(D){console.error(D)}}))}catch(O){console.error(O)}$()};return o.newLogFilter=l,o.newBlockFilter=u,o.newPendingTransactionFilter=p,o.uninstallFilter=R,o.getFilterChanges=f,o.getFilterLogs=_,o.destroy=()=>{L()},o;async function l(k){const N=new Py({provider:t,params:k});return await x(N),N}async function u(){const k=new $y({provider:t});return await x(k),k}async function p(){const k=new By({provider:t});return await x(k),k}async function f(k){const N=bo(k),$=n[N];if(!$)throw new Error(`No filter for index "${N}"`);return $.getChangesAndClear()}async function _(k){const N=bo(k),$=n[N];if(!$)throw new Error(`No filter for index "${N}"`);let O=[];return $.type==="log"&&(O=$.getAllResults()),O}async function R(k){const N=bo(k),O=!!n[N];return O&&await P(N),O}async function x(k){const N=Qr(n).length,$=await e.getLatestBlock();await k.initialize({currentBlock:$}),r++,n[r]=k,k.id=r,k.idHex=ld(r);const O=Qr(n).length;return M({prevFilterCount:N,newFilterCount:O}),r}async function P(k){const N=Qr(n).length;delete n[k];const $=Qr(n).length;M({prevFilterCount:N,newFilterCount:$})}async function L(){const k=Qr(n).length;n={},M({prevFilterCount:k,newFilterCount:0})}function M({prevFilterCount:k,newFilterCount:N}){if(k===0&&N>0){e.on("sync",c);return}if(k>0&&N===0){e.removeListener("sync",c);return}}}function yo(e){return Ai(async(...t)=>{const r=await e(...t);return ld(r.id)})}function Ai(e){return Ly(async(t,r)=>{const n=await e.apply(null,t.params);r.result=n})}function jy({mutex:e}){return t=>async(r,n,i,s)=>{(await e.acquire())(),t(r,n,i,s)}}function Qr(e,t){const r=[];for(let n in e)r.push(e[n]);return r}const Hy=ni.default,{createAsyncMiddleware:El,createScaffoldMiddleware:Uy}=Sa,Wy=Dy,{unsafeRandomBytes:Vy,incrementHexInt:qy}=hi,zy=Na;var Gy=Jy;function Jy({blockTracker:e,provider:t}){const r={},n=Wy({blockTracker:e,provider:t});let i=!1;const s=new Hy,o=Uy({eth_subscribe:El(c),eth_unsubscribe:El(l)});return o.destroy=p,{events:s,middleware:o};async function c(f,_){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const R=f.params[0],x=Vy(16);let P;switch(R){case"newHeads":P=L({subId:x});break;case"logs":const k=f.params[1],N=await n.newLogFilter(k);P=M({subId:x,filter:N});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${R}"`)}r[x]=P,_.result=x;return;function L({subId:k}){const N={type:R,destroy:async()=>{e.removeListener("sync",N.update)},update:async({oldBlock:$,newBlock:O})=>{const D=O,G=qy($);(await zy({provider:t,fromBlock:G,toBlock:D})).map(Zy).filter(X=>X!==null).forEach(X=>{u(k,X)})}};return e.on("sync",N.update),N}function M({subId:k,filter:N}){return N.on("update",O=>u(k,O)),{type:R,destroy:async()=>await n.uninstallFilter(N.idHex)}}}async function l(f,_){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const R=f.params[0],x=r[R];if(!x){_.result=!1;return}delete r[R],await x.destroy(),_.result=!0}function u(f,_){s.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:f,result:_}})}function p(){s.removeAllListeners();for(const f in r)r[f].destroy(),delete r[f];i=!0}}function Zy(e){return e==null?null:{hash:e.hash,parentHash:e.parentHash,sha3Uncles:e.sha3Uncles,miner:e.miner,stateRoot:e.stateRoot,transactionsRoot:e.transactionsRoot,receiptsRoot:e.receiptsRoot,logsBloom:e.logsBloom,difficulty:e.difficulty,number:e.number,gasLimit:e.gasLimit,gasUsed:e.gasUsed,nonce:e.nonce,mixHash:e.mixHash,timestamp:e.timestamp,extraData:e.extraData}}Object.defineProperty(_s,"__esModule",{value:!0});_s.SubscriptionManager=void 0;const Ky=zu,Qy=Gy,Sl=()=>{};class Yy{constructor(t){const r=new Ky.PollingBlockTracker({provider:t,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:n,middleware:i}=Qy({blockTracker:r,provider:t});this.events=n,this.subscriptionMiddleware=i}async handleRequest(t){const r={};return await this.subscriptionMiddleware(t,r,Sl,Sl),r}destroy(){this.subscriptionMiddleware.destroy()}}_s.SubscriptionManager=Yy;var ud=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(on,"__esModule",{value:!0});on.CoinbaseWalletProvider=void 0;const Xy=ud(Hi),ew=Vd,se=jn,re=z,tw=Vn,Rl=gt,Ci=bn,lt=_n,wo=ud(v1),xn=vn,rw=hn,nw=_s,Ml="DefaultChainId",Cl="DefaultJsonRpcUrl";class iw extends ew.EventEmitter{constructor(t){var r,n;super(),this._filterPolyfill=new rw.FilterPolyfill(this),this._subscriptionManager=new nw.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=t.chainId,this._jsonRpcUrlFromOpts=t.jsonRpcUrl,this._overrideIsMetaMask=t.overrideIsMetaMask,this._relayProvider=t.relayProvider,this._storage=t.storage,this._relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=(r=t.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this.isCoinbaseBrowser=(n=t.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this.qrUrl=t.qrUrl;const i=this.getChainId(),s=(0,re.prepend0x)(i.toString(16));this.emit("connect",{chainIdStr:s});const o=this._storage.getItem(Rl.LOCAL_STORAGE_ADDRESSES_KEY);if(o){const c=o.split(" ");c[0]!==""&&(this._addresses=c.map(l=>(0,re.ensureAddressString)(l)),this.emit("accountsChanged",c))}this._subscriptionManager.events.on("notification",c=>{this.emit("message",{type:c.method,data:c.params})}),this._isAuthorized()&&this.initializeRelay(),window.addEventListener("message",c=>{var l;if(!(c.origin!==location.origin||c.source!==window)&&c.data.type==="walletLinkMessage"&&c.data.data.action==="dappChainSwitched"){const u=c.data.data.chainId,p=(l=c.data.data.jsonRpcUrl)!==null&&l!==void 0?l:this.jsonRpcUrl;this.updateProviderInfo(p,Number(u))}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,re.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 t;return(t=this._storage.getItem(Cl))!==null&&t!==void 0?t:this._jsonRpcUrlFromOpts}set jsonRpcUrl(t){this._storage.setItem(Cl,t)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(t,r){this.isCoinbaseBrowser||(this._chainIdFromOpts=r,this._jsonRpcUrlFromOpts=t),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(t,r){this.jsonRpcUrl=t;const n=this.getChainId();this._storage.setItem(Ml,r.toString(10)),((0,re.ensureIntNumber)(r)!==n||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(t,r,n,i,s,o){const l=await(await this.initializeRelay()).watchAsset(t,r,n,i,s,o==null?void 0:o.toString()).promise;return(0,lt.isErrorResponse)(l)?!1:!!l.result}async addEthereumChain(t,r,n,i,s,o){var c,l;if((0,re.ensureIntNumber)(t)===this.getChainId())return!1;const u=await this.initializeRelay(),p=u.inlineAddEthereumChain(t.toString());!this._isAuthorized()&&!p&&await u.requestEthereumAccounts().promise;const f=await u.addEthereumChain(t.toString(),r,s,n,i,o).promise;return(0,lt.isErrorResponse)(f)?!1:(((c=f.result)===null||c===void 0?void 0:c.isApproved)===!0&&this.updateProviderInfo(r[0],t),((l=f.result)===null||l===void 0?void 0:l.isApproved)===!0)}async switchEthereumChain(t){const n=await(await this.initializeRelay()).switchEthereumChain(t.toString(10),this.selectedAddress||void 0).promise;if((0,lt.isErrorResponse)(n)){if(!n.errorCode)return;throw n.errorCode===se.standardErrorCodes.provider.unsupportedChain?se.standardErrors.provider.unsupportedChain():se.standardErrors.provider.custom({message:n.errorMessage,code:n.errorCode})}const i=n.result;i.isApproved&&i.rpcUrl.length>0&&this.updateProviderInfo(i.rpcUrl,t)}setAppInfo(t,r){this.initializeRelay().then(n=>n.setAppInfo(t,r))}async enable(){var t;return(t=this.diagnostic)===null||t===void 0||t.log(xn.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?Ci.Session.hash(this._relay.session.id):void 0}),this._isAuthorized()?[...this._addresses]:await this.send("eth_requestAccounts")}async close(){(await this.initializeRelay()).resetAndReload()}send(t,r){try{const n=this._send(t,r);if(n instanceof Promise)return n.catch(i=>{throw(0,se.serializeError)(i,t)})}catch(n){throw(0,se.serializeError)(n,t)}}_send(t,r){if(typeof t=="string"){const i=t,s=Array.isArray(r)?r:r!==void 0?[r]:[],o={jsonrpc:"2.0",id:0,method:i,params:s};return this._sendRequestAsync(o).then(c=>c.result)}if(typeof r=="function"){const i=t,s=r;return this._sendAsync(i,s)}if(Array.isArray(t))return t.map(s=>this._sendRequest(s));const n=t;return this._sendRequest(n)}async sendAsync(t,r){try{return this._sendAsync(t,r).catch(n=>{throw(0,se.serializeError)(n,t)})}catch(n){return Promise.reject((0,se.serializeError)(n,t))}}async _sendAsync(t,r){if(typeof r!="function")throw new Error("callback is required");if(Array.isArray(t)){const i=r;this._sendMultipleRequestsAsync(t).then(s=>i(null,s)).catch(s=>i(s,null));return}const n=r;return this._sendRequestAsync(t).then(i=>n(null,i)).catch(i=>n(i,null))}async request(t){try{return this._request(t).catch(r=>{throw(0,se.serializeError)(r,t.method)})}catch(r){return Promise.reject((0,se.serializeError)(r,t.method))}}async _request(t){if(!t||typeof t!="object"||Array.isArray(t))throw se.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:t});const{method:r,params:n}=t;if(typeof r!="string"||r.length===0)throw se.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:t});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw se.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:t});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(t){const n=await(await this.initializeRelay()).scanQRCode((0,re.ensureRegExpString)(t)).promise;if((0,lt.isErrorResponse)(n))throw(0,se.serializeError)(n.errorMessage,"scanQRCode");if(typeof n.result!="string")throw(0,se.serializeError)("result was not a string","scanQRCode");return n.result}async genericRequest(t,r){const i=await(await this.initializeRelay()).genericRequest(t,r).promise;if((0,lt.isErrorResponse)(i))throw(0,se.serializeError)(i.errorMessage,"generic");if(typeof i.result!="string")throw(0,se.serializeError)("result was not a string","generic");return i.result}async connectAndSignIn(t){var r;(r=this.diagnostic)===null||r===void 0||r.log(xn.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::connectAndSignIn",sessionIdHash:this._relay?Ci.Session.hash(this._relay.session.id):void 0});let n;try{const s=await this.initializeRelay();if(!(s instanceof tw.MobileRelay))throw new Error("connectAndSignIn is only supported on mobile");if(n=await s.connectAndSignIn(t).promise,(0,lt.isErrorResponse)(n))throw new Error(n.errorMessage)}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?se.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(t){const n=await(await this.initializeRelay()).selectProvider(t).promise;if((0,lt.isErrorResponse)(n))throw(0,se.serializeError)(n.errorMessage,"selectProvider");if(typeof n.result!="string")throw(0,se.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(t){const r={jsonrpc:"2.0",id:t.id},{method:n}=t;if(r.result=this._handleSynchronousMethods(t),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(t,r){if(!Array.isArray(t))throw new Error("addresses is not an array");const n=t.map(i=>(0,re.ensureAddressString)(i));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(Rl.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" ")))}_sendRequestAsync(t){return new Promise((r,n)=>{try{const i=this._handleSynchronousMethods(t);if(i!==void 0)return r({jsonrpc:"2.0",id:t.id,result:i});const s=this._handleAsynchronousFilterMethods(t);if(s!==void 0){s.then(c=>r(Object.assign(Object.assign({},c),{id:t.id}))).catch(c=>n(c));return}const o=this._handleSubscriptionMethods(t);if(o!==void 0){o.then(c=>r({jsonrpc:"2.0",id:t.id,result:c.result})).catch(c=>n(c));return}}catch(i){return n(i)}this._handleAsynchronousMethods(t).then(i=>i&&r(Object.assign(Object.assign({},i),{id:t.id}))).catch(i=>n(i))})}_sendMultipleRequestsAsync(t){return Promise.all(t.map(r=>this._sendRequestAsync(r)))}_handleSynchronousMethods(t){const{method:r}=t,n=t.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(t){const{method:r}=t,n=t.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(t,this.jsonRpcUrl).catch(s=>{var o;throw(s.code===se.standardErrorCodes.rpc.methodNotFound||s.code===se.standardErrorCodes.rpc.methodNotSupported)&&((o=this.diagnostic)===null||o===void 0||o.log(xn.EVENTS.METHOD_NOT_IMPLEMENTED,{method:t.method,sessionIdHash:this._relay?Ci.Session.hash(this._relay.session.id):void 0})),s})}_handleAsynchronousFilterMethods(t){const{method:r}=t,n=t.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(t){switch(t.method){case"eth_subscribe":case"eth_unsubscribe":return this._subscriptionManager.handleRequest(t)}}_isKnownAddress(t){try{const r=(0,re.ensureAddressString)(t);return this._addresses.map(i=>(0,re.ensureAddressString)(i)).includes(r)}catch{}return!1}_ensureKnownAddress(t){var r;if(!this._isKnownAddress(t))throw(r=this.diagnostic)===null||r===void 0||r.log(xn.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(t){const r=t.from?(0,re.ensureAddressString)(t.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);const n=t.to?(0,re.ensureAddressString)(t.to):null,i=t.value!=null?(0,re.ensureBN)(t.value):new Xy.default(0),s=t.data?(0,re.ensureBuffer)(t.data):Buffer.alloc(0),o=t.nonce!=null?(0,re.ensureIntNumber)(t.nonce):null,c=t.gasPrice!=null?(0,re.ensureBN)(t.gasPrice):null,l=t.maxFeePerGas!=null?(0,re.ensureBN)(t.maxFeePerGas):null,u=t.maxPriorityFeePerGas!=null?(0,re.ensureBN)(t.maxPriorityFeePerGas):null,p=t.gas!=null?(0,re.ensureBN)(t.gas):null,f=t.chainId?(0,re.ensureIntNumber)(t.chainId):this.getChainId();return{fromAddress:r,toAddress:n,weiValue:i,data:s,nonce:o,gasPriceInWei:c,maxFeePerGas:l,maxPriorityFeePerGas:u,gasLimit:p,chainId:f}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw se.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw se.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(t,r,n,i){this._ensureKnownAddress(r);try{const o=await(await this.initializeRelay()).signEthereumMessage(t,r,n,i).promise;if((0,lt.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)?se.standardErrors.provider.userRejectedRequest("User denied message signature"):s}}async _ethereumAddressFromSignedMessage(t,r,n){const s=await(await this.initializeRelay()).ethereumAddressFromSignedMessage(t,r,n).promise;if((0,lt.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,re.hexStringFromIntNumber)(this.getChainId())}getChainId(){const t=this._storage.getItem(Ml);if(!t)return(0,re.ensureIntNumber)(this._chainIdFromOpts);const r=parseInt(t,10);return(0,re.ensureIntNumber)(r)}async _eth_requestAccounts(){var t;if((t=this.diagnostic)===null||t===void 0||t.log(xn.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?Ci.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,lt.isErrorResponse)(r))throw new Error(r.errorMessage)}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?se.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(t){this._requireAuthorization();const r=(0,re.ensureAddressString)(t[0]),n=(0,re.ensureBuffer)(t[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(t){const r=(0,re.ensureBuffer)(t[0]),n=(0,re.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(t){this._requireAuthorization();const r=(0,re.ensureBuffer)(t[0]),n=(0,re.ensureAddressString)(t[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(t){const r=(0,re.ensureBuffer)(t[0]),n=(0,re.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!0)}async _eth_signTransaction(t){this._requireAuthorization();const r=this._prepareTransactionParams(t[0]||{});try{const i=await(await this.initializeRelay()).signEthereumTransaction(r).promise;if((0,lt.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)?se.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(t){const r=(0,re.ensureBuffer)(t[0]),i=await(await this.initializeRelay()).submitEthereumTransaction(r,this.getChainId()).promise;if((0,lt.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}async _eth_sendTransaction(t){this._requireAuthorization();const r=this._prepareTransactionParams(t[0]||{});try{const i=await(await this.initializeRelay()).signAndSubmitEthereumTransaction(r).promise;if((0,lt.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)?se.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(t){this._requireAuthorization();const r=(0,re.ensureParsedJSONObject)(t[0]),n=(0,re.ensureAddressString)(t[1]);this._ensureKnownAddress(n);const i=wo.default.hashForSignTypedDataLegacy({data:r}),s=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,s)}async _eth_signTypedData_v3(t){this._requireAuthorization();const r=(0,re.ensureAddressString)(t[0]),n=(0,re.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const i=wo.default.hashForSignTypedData_v3({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _eth_signTypedData_v4(t){this._requireAuthorization();const r=(0,re.ensureAddressString)(t[0]),n=(0,re.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const i=wo.default.hashForSignTypedData_v4({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _cbwallet_arbitrary(t){const r=t[0],n=t[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(t){var r,n,i,s;const o=t[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 se.standardErrors.rpc.invalidParams("chainName is a required field");if(!o.nativeCurrency)throw se.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const c=parseInt(o.chainId,16);return await this.addEthereumChain(c,(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(t){const r=t[0];return await this.switchEthereumChain(parseInt(r.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(t){const r=Array.isArray(t)?t[0]:t;if(!r.type)throw se.standardErrors.rpc.invalidParams("Type is required");if((r==null?void 0:r.type)!=="ERC20")throw se.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!(r!=null&&r.options))throw se.standardErrors.rpc.invalidParams("Options are required");if(!(r!=null&&r.options.address))throw se.standardErrors.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:i,symbol:s,image:o,decimals:c}=r.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(r.type,i,s,c,o,n)}}_eth_uninstallFilter(t){const r=(0,re.ensureHexString)(t[0]);return this._filterPolyfill.uninstallFilter(r)}async _eth_newFilter(t){const r=t[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(t){const r=(0,re.ensureHexString)(t[0]);return this._filterPolyfill.getFilterChanges(r)}_eth_getFilterLogs(t){const r=(0,re.ensureHexString)(t[0]);return this._filterPolyfill.getFilterLogs(r)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(t=>(t.setAccountsCallback((r,n)=>this._setAddresses(r,n)),t.setChainCallback((r,n)=>{this.updateProviderInfo(n,parseInt(r,10))}),t.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=t,t))}}on.CoinbaseWalletProvider=iw;var Ps={};Object.defineProperty(Ps,"__esModule",{value:!0});Ps.RelayEventManager=void 0;const sw=z;class ow{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const t=this._nextRequestId,r=(0,sw.prepend0x)(t.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),t}}Ps.RelayEventManager=ow;Object.defineProperty(On,"__esModule",{value:!0});On.CoinbaseWalletSDK=void 0;const aw=Fi,cw=ji,kl=z,lw=zi,uw=on,hw=Vn,dw=ti,fw=Ps,pw=Kn,gw=qn,hd=mn;class $s{constructor(t){var r,n,i;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const s=t.linkAPIUrl||cw.LINK_API_URL;typeof t.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=t.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(r=t.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this._overrideIsCoinbaseBrowser=(n=t.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this._diagnosticLogger=t.diagnosticLogger,this._reloadOnDisconnect=(i=t.reloadOnDisconnect)!==null&&i!==void 0?i:!0;const o=new URL(s),c=`${o.protocol}//${o.host}`;if(this._storage=new lw.ScopedLocalStorage(`-walletlink:${c}`),this._storage.setItem("version",$s.VERSION),this.walletExtension||this.coinbaseBrowser)return;this._relayEventManager=new fw.RelayEventManager;const l=(0,kl.isMobileWeb)(),u=t.uiConstructor||(f=>l?new dw.MobileRelayUI(f):new pw.WalletLinkRelayUI(f)),p={linkAPIUrl:s,version:hd.LIB_VERSION,darkMode:!!t.darkMode,uiConstructor:u,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect,enableMobileWalletLink:t.enableMobileWalletLink};this._relay=l?new hw.MobileRelay(p):new gw.WalletLinkRelay(p),this.setAppInfo(t.appName,t.appLogoUrl),!t.headlessMode&&this._relay.attachUI()}makeWeb3Provider(t="",r=1){const n=this.walletExtension;if(n)return this.isCipherProvider(n)||n.setProviderInfo(t,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 t||s.setConnectDisabled(!0),new uw.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(s),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:t,chainId:r,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(t,r){var n;this._appName=t||"DApp",this._appLogoUrl=r||(0,kl.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 t;const r=this===null||this===void 0?void 0:this.walletExtension;r?r.close():(t=this._relay)===null||t===void 0||t.resetAndReload()}getQrUrl(){var t,r;return(r=(t=this._relay)===null||t===void 0?void 0:t.getQRCodeUrl())!==null&&r!==void 0?r:null}getCoinbaseWalletLogo(t,r=240){return(0,aw.walletLogo)(t,r)}get walletExtension(){var t;return(t=window.coinbaseWalletExtension)!==null&&t!==void 0?t:window.walletLinkExtension}get coinbaseBrowser(){var t,r;try{const n=(t=window.ethereum)!==null&&t!==void 0?t:(r=window.top)===null||r===void 0?void 0:r.ethereum;return n&&"isCoinbaseBrowser"in n&&n.isCoinbaseBrowser?n:void 0}catch{return}}isCipherProvider(t){return typeof t.isCipher=="boolean"&&t.isCipher}}On.CoinbaseWalletSDK=$s;$s.VERSION=hd.LIB_VERSION;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CoinbaseWalletProvider=e.CoinbaseWalletSDK=void 0;const t=On,r=on;var n=On;Object.defineProperty(e,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return n.CoinbaseWalletSDK}});var i=on;Object.defineProperty(e,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return i.CoinbaseWalletProvider}}),e.default=t.CoinbaseWalletSDK,typeof window<"u"&&(window.CoinbaseWalletSDK=t.CoinbaseWalletSDK,window.CoinbaseWalletProvider=r.CoinbaseWalletProvider,window.WalletLink=t.CoinbaseWalletSDK,window.WalletLinkProvider=r.CoinbaseWalletProvider)})(Ho);const _w=dd(Ho),xw=fd({__proto__:null,default:_w},[Ho]);export{xw as i}; diff --git a/assets/index-CZVo1pMO.js b/assets/index-CZVo1pMO.js new file mode 100644 index 0000000..1f2d214 --- /dev/null +++ b/assets/index-CZVo1pMO.js @@ -0,0 +1,7 @@ +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/index-D0THPP6r.js","assets/index-BCdecgwI.js","assets/index-BW-H86H5.css"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} +import{p as u,s as h,a as R,_ as V}from"./index-BCdecgwI.js";const n=u({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),x={state:n,subscribe(e){return h(n,()=>e(n))},push(e,t){e!==n.view&&(n.view=e,t&&(n.data=t),n.history.push(e))},reset(e){n.view=e,n.history=[e]},replace(e){n.history.length>1&&(n.history[n.history.length-1]=e,n.view=e)},goBack(){if(n.history.length>1){n.history.pop();const[e]=n.history.slice(-1);n.view=e}},setData(e){n.data=e}},r={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 r.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return r.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(r.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let o=e;o.includes("://")||(o=e.replaceAll("/","").replaceAll(":",""),o=`${o}://`),o.endsWith("/")||(o=`${o}/`),this.setWalletConnectDeepLink(o,s);const i=encodeURIComponent(t);return`${o}wc?uri=${i}`},formatUniversalUrl(e,t,s){if(!r.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let o=e;o.endsWith("/")||(o=`${o}/`),this.setWalletConnectDeepLink(o,s);const i=encodeURIComponent(t);return`${o}wc?uri=${i}`},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(r.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(r.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(r.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(r.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=x.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},H=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),a=u({enabled:H,userSessionId:"",events:[],connectedWalletId:void 0}),B={state:a,subscribe(e){return h(a.events,()=>e(R(a.events[a.events.length-1])))},initialize(){a.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(a.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){a.connectedWalletId=e},click(e){if(a.enabled){const t={type:"CLICK",name:e.name,userSessionId:a.userSessionId,timestamp:Date.now(),data:e};a.events.push(t)}},track(e){if(a.enabled){const t={type:"TRACK",name:e.name,userSessionId:a.userSessionId,timestamp:Date.now(),data:e};a.events.push(t)}},view(e){if(a.enabled){const t={type:"VIEW",name:e.name,userSessionId:a.userSessionId,timestamp:Date.now(),data:e};a.events.push(t)}}},d=u({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),c={state:d,subscribe(e){return h(d,()=>e(d))},setChains(e){d.chains=e},setWalletConnectUri(e){d.walletConnectUri=e},setIsCustomDesktop(e){d.isCustomDesktop=e},setIsCustomMobile(e){d.isCustomMobile=e},setIsDataLoaded(e){d.isDataLoaded=e},setIsUiLoaded(e){d.isUiLoaded=e},setIsAuth(e){d.isAuth=e}},w=u({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}),v={state:w,subscribe(e){return h(w,()=>e(w))},setConfig(e){var t,s;B.initialize(),c.setChains(e.chains),c.setIsAuth(!!e.enableAuthMode),c.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),c.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),r.setModalVersionInStorage(),Object.assign(w,e)}};var K=Object.defineProperty,j=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,J=Object.prototype.propertyIsEnumerable,D=(e,t,s)=>t in e?K(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,q=(e,t)=>{for(var s in t||(t={}))z.call(t,s)&&D(e,s,t[s]);if(j)for(var s of j(t))J.call(t,s)&&D(e,s,t[s]);return e};const E="https://explorer-api.walletconnect.com",O="wcm",A="js-2.6.2";async function W(e,t){const s=q({sdkType:O,sdkVersion:A},t),o=new URL(e,E);return o.searchParams.append("projectId",v.state.projectId),Object.entries(s).forEach(([i,l])=>{l&&o.searchParams.append(i,String(l))}),(await fetch(o)).json()}const m={async getDesktopListings(e){return W("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return W("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return W("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return W("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${E}/w3m/v1/getWalletImage/${e}?projectId=${v.state.projectId}&sdkType=${O}&sdkVersion=${A}`},getAssetImageUrl(e){return`${E}/w3m/v1/getAssetImage/${e}?projectId=${v.state.projectId}&sdkType=${O}&sdkVersion=${A}`}};var F=Object.defineProperty,k=Object.getOwnPropertySymbols,G=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable,_=(e,t,s)=>t in e?F(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,X=(e,t)=>{for(var s in t||(t={}))G.call(t,s)&&_(e,s,t[s]);if(k)for(var s of k(t))Q.call(t,s)&&_(e,s,t[s]);return e};const S=r.isMobile(),p=u({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),ae={state:p,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=v.state;if(e==="NONE"||t==="ALL"&&!e)return p.recomendedWallets;if(r.isArray(e)){const s={recommendedIds:e.join(",")},{listings:o}=await m.getAllListings(s),i=Object.values(o);i.sort((l,b)=>{const y=e.indexOf(l.id),C=e.indexOf(b.id);return y-C}),p.recomendedWallets=i}else{const{chains:s,isAuth:o}=c.state,i=s==null?void 0:s.join(","),l=r.isArray(t),b={page:1,sdks:o?"auth_v1":void 0,entries:r.RECOMMENDED_WALLET_AMOUNT,chains:i,version:2,excludedIds:l?t.join(","):void 0},{listings:y}=S?await m.getMobileListings(b):await m.getDesktopListings(b);p.recomendedWallets=Object.values(y)}return p.recomendedWallets},async getWallets(e){const t=X({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:o}=v.state,{recomendedWallets:i}=p;if(o==="ALL")return p.wallets;i.length?t.excludedIds=i.map($=>$.id).join(","):r.isArray(s)&&(t.excludedIds=s.join(",")),r.isArray(o)&&(t.excludedIds=[t.excludedIds,o].filter(Boolean).join(",")),c.state.isAuth&&(t.sdks="auth_v1");const{page:l,search:b}=e,{listings:y,total:C}=S?await m.getMobileListings(t):await m.getDesktopListings(t),U=Object.values(y),M=b?"search":"wallets";return p[M]={listings:[...p[M].listings,...U],total:C,page:l??1},{listings:U,total:C}},getWalletImageUrl(e){return m.getWalletImageUrl(e)},getAssetImageUrl(e){return m.getAssetImageUrl(e)},resetSearch(){p.search={listings:[],total:0,page:1}}},I=u({open:!1}),L={state:I,subscribe(e){return h(I,()=>e(I))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:o}=c.state;if(r.removeWalletConnectDeepLink(),c.setWalletConnectUri(e==null?void 0:e.uri),c.setChains(e==null?void 0:e.chains),x.reset("ConnectWallet"),s&&o)I.open=!0,t();else{const i=setInterval(()=>{const l=c.state;l.isUiLoaded&&l.isDataLoaded&&(clearInterval(i),I.open=!0,t())},200)}})},close(){I.open=!1}};var Y=Object.defineProperty,N=Object.getOwnPropertySymbols,Z=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable,T=(e,t,s)=>t in e?Y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,te=(e,t)=>{for(var s in t||(t={}))Z.call(t,s)&&T(e,s,t[s]);if(N)for(var s of N(t))ee.call(t,s)&&T(e,s,t[s]);return e};function se(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const f=u({themeMode:se()?"dark":"light"}),P={state:f,subscribe(e){return h(f,()=>e(f))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(f.themeMode=t),s&&(f.themeVariables=te({},s))}},g=u({open:!1,message:"",variant:"success"}),re={state:g,subscribe(e){return h(g,()=>e(g))},openToast(e,t){g.open=!0,g.message=e,g.variant=t},closeToast(){g.open=!1}};class oe{constructor(t){this.openModal=L.open,this.closeModal=L.close,this.subscribeModal=L.subscribe,this.setTheme=P.setThemeConfig,P.setThemeConfig(t),v.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await V(()=>import("./index-D0THPP6r.js"),__vite__mapDeps([0,1,2]));const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),c.setIsUiLoaded(!0)}}}const ie=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:oe},Symbol.toStringTag,{value:"Module"}));export{B as R,x as T,r as a,ie as i,P as n,re as o,c as p,L as s,ae as t,v as y}; diff --git a/assets/index-D0THPP6r.js b/assets/index-D0THPP6r.js new file mode 100644 index 0000000..92a3add --- /dev/null +++ b/assets/index-D0THPP6r.js @@ -0,0 +1,47 @@ +import{n as ve,s as qe,T as k,t as W,a as u,o as Q,R as jr,p as U,y as ne}from"./index-CZVo1pMO.js";import{w as Nr}from"./index-BCdecgwI.js";/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Ke=window,Nt=Ke.ShadowRoot&&(Ke.ShadyCSS===void 0||Ke.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ut=Symbol(),zt=new WeakMap;let br=class{constructor(e,r,i){if(this._$cssResult$=!0,i!==Ut)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o;const r=this.t;if(Nt&&e===void 0){const i=r!==void 0&&r.length===1;i&&(e=zt.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&zt.set(r,e))}return e}toString(){return this.cssText}};const Ur=t=>new br(typeof t=="string"?t:t+"",void 0,Ut),x=(t,...e)=>{const r=t.length===1?t[0]:e.reduce((i,o,n)=>i+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+t[n+1],t[0]);return new br(r,t,Ut)},Hr=(t,e)=>{Nt?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{const i=document.createElement("style"),o=Ke.litNonce;o!==void 0&&i.setAttribute("nonce",o),i.textContent=r.cssText,t.appendChild(i)})},Vt=Nt?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(const i of e.cssRules)r+=i.cssText;return Ur(r)})(t):t;/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */var tt;const Qe=window,Ft=Qe.trustedTypes,Br=Ft?Ft.emptyScript:"",qt=Qe.reactiveElementPolyfillSupport,St={toAttribute(t,e){switch(e){case Boolean:t=t?Br:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},yr=(t,e)=>e!==t&&(e==e||t==t),rt={attribute:!0,type:String,converter:St,reflect:!1,hasChanged:yr},Rt="finalized";let pe=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var r;this.finalize(),((r=this.h)!==null&&r!==void 0?r:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach((r,i)=>{const o=this._$Ep(i,r);o!==void 0&&(this._$Ev.set(o,i),e.push(o))}),e}static createProperty(e,r=rt){if(r.state&&(r.attribute=!1),this.finalize(),this.elementProperties.set(e,r),!r.noAccessor&&!this.prototype.hasOwnProperty(e)){const i=typeof e=="symbol"?Symbol():"__"+e,o=this.getPropertyDescriptor(e,i,r);o!==void 0&&Object.defineProperty(this.prototype,e,o)}}static getPropertyDescriptor(e,r,i){return{get(){return this[r]},set(o){const n=this[e];this[r]=o,this.requestUpdate(e,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||rt}static finalize(){if(this.hasOwnProperty(Rt))return!1;this[Rt]=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const r=this.properties,i=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(const o of i)this.createProperty(o,r[o])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const r=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const o of i)r.unshift(Vt(o))}else e!==void 0&&r.push(Vt(e));return r}static _$Ep(e,r){const i=r.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(r=>r(this))}addController(e){var r,i;((r=this._$ES)!==null&&r!==void 0?r:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((i=e.hostConnected)===null||i===void 0||i.call(e))}removeController(e){var r;(r=this._$ES)===null||r===void 0||r.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,r)=>{this.hasOwnProperty(r)&&(this._$Ei.set(r,this[r]),delete this[r])})}createRenderRoot(){var e;const r=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return Hr(r,this.constructor.elementStyles),r}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(r=>{var i;return(i=r.hostConnected)===null||i===void 0?void 0:i.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(r=>{var i;return(i=r.hostDisconnected)===null||i===void 0?void 0:i.call(r)})}attributeChangedCallback(e,r,i){this._$AK(e,i)}_$EO(e,r,i=rt){var o;const n=this.constructor._$Ep(e,i);if(n!==void 0&&i.reflect===!0){const a=(((o=i.converter)===null||o===void 0?void 0:o.toAttribute)!==void 0?i.converter:St).toAttribute(r,i.type);this._$El=e,a==null?this.removeAttribute(n):this.setAttribute(n,a),this._$El=null}}_$AK(e,r){var i;const o=this.constructor,n=o._$Ev.get(e);if(n!==void 0&&this._$El!==n){const a=o.getPropertyOptions(n),s=typeof a.converter=="function"?{fromAttribute:a.converter}:((i=a.converter)===null||i===void 0?void 0:i.fromAttribute)!==void 0?a.converter:St;this._$El=n,this[n]=s.fromAttribute(r,a.type),this._$El=null}}requestUpdate(e,r,i){let o=!0;e!==void 0&&(((i=i||this.constructor.getPropertyOptions(e)).hasChanged||yr)(this[e],r)?(this._$AL.has(e)||this._$AL.set(e,r),i.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,i))):o=!1),!this.isUpdatePending&&o&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(r){Promise.reject(r)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((o,n)=>this[n]=o),this._$Ei=void 0);let r=!1;const i=this._$AL;try{r=this.shouldUpdate(i),r?(this.willUpdate(i),(e=this._$ES)===null||e===void 0||e.forEach(o=>{var n;return(n=o.hostUpdate)===null||n===void 0?void 0:n.call(o)}),this.update(i)):this._$Ek()}catch(o){throw r=!1,this._$Ek(),o}r&&this._$AE(i)}willUpdate(e){}_$AE(e){var r;(r=this._$ES)===null||r===void 0||r.forEach(i=>{var o;return(o=i.hostUpdated)===null||o===void 0?void 0:o.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((r,i)=>this._$EO(i,this[i],r)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};pe[Rt]=!0,pe.elementProperties=new Map,pe.elementStyles=[],pe.shadowRootOptions={mode:"open"},qt==null||qt({ReactiveElement:pe}),((tt=Qe.reactiveElementVersions)!==null&&tt!==void 0?tt:Qe.reactiveElementVersions=[]).push("1.6.3");/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */var ot;const Ye=window,fe=Ye.trustedTypes,Kt=fe?fe.createPolicy("lit-html",{createHTML:t=>t}):void 0,Lt="$lit$",K=`lit$${(Math.random()+"").slice(9)}$`,xr="?"+K,Zr=`<${xr}>`,ae=document,Me=()=>ae.createComment(""),Se=t=>t===null||typeof t!="object"&&typeof t!="function",$r=Array.isArray,zr=t=>$r(t)||typeof(t==null?void 0:t[Symbol.iterator])=="function",it=`[ +\f\r]`,$e=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Qt=/-->/g,Yt=/>/g,J=RegExp(`>|${it}(?:([^\\s"'>=/]+)(${it}*=${it}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),Gt=/'/g,Xt=/"/g,Cr=/^(?:script|style|textarea|title)$/i,Ar=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),l=Ar(1),O=Ar(2),se=Symbol.for("lit-noChange"),M=Symbol.for("lit-nothing"),Jt=new WeakMap,oe=ae.createTreeWalker(ae,129,null,!1);function _r(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Kt!==void 0?Kt.createHTML(e):e}const Vr=(t,e)=>{const r=t.length-1,i=[];let o,n=e===2?"":"",a=$e;for(let s=0;s"?(a=o??$e,v=-1):y[1]===void 0?v=-2:(v=a.lastIndex-y[2].length,d=y[1],a=y[3]===void 0?J:y[3]==='"'?Xt:Gt):a===Xt||a===Gt?a=J:a===Qt||a===Yt?a=$e:(a=J,o=void 0);const A=a===J&&t[s+1].startsWith("/>")?" ":"";n+=a===$e?c+Zr:v>=0?(i.push(d),c.slice(0,v)+Lt+c.slice(v)+K+A):c+K+(v===-2?(i.push(void 0),s):A)}return[_r(t,n+(t[r]||"")+(e===2?"":"")),i]};class Re{constructor({strings:e,_$litType$:r},i){let o;this.parts=[];let n=0,a=0;const s=e.length-1,c=this.parts,[d,y]=Vr(e,r);if(this.el=Re.createElement(d,i),oe.currentNode=this.el.content,r===2){const v=this.el.content,p=v.firstChild;p.remove(),v.append(...p.childNodes)}for(;(o=oe.nextNode())!==null&&c.length0){o.textContent=fe?fe.emptyScript:"";for(let A=0;A2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=M}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,r=this,i,o){const n=this.strings;let a=!1;if(n===void 0)e=be(this,e,r,0),a=!Se(e)||e!==this._$AH&&e!==se,a&&(this._$AH=e);else{const s=e;let c,d;for(e=n[0],c=0;c{var i,o;const n=(i=r==null?void 0:r.renderBefore)!==null&&i!==void 0?i:e;let a=n._$litPart$;if(a===void 0){const s=(o=r==null?void 0:r.renderBefore)!==null&&o!==void 0?o:null;n._$litPart$=a=new We(e.insertBefore(Me(),s),s,void 0,r??{})}return a._$AI(t),a};/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */var nt,at;class w extends pe{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,r;const i=super.createRenderRoot();return(e=(r=this.renderOptions).renderBefore)!==null&&e!==void 0||(r.renderBefore=i.firstChild),i}update(e){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Xr(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return se}}w.finalized=!0,w._$litElement$=!0,(nt=globalThis.litElementHydrateSupport)===null||nt===void 0||nt.call(globalThis,{LitElement:w});const tr=globalThis.litElementPolyfillSupport;tr==null||tr({LitElement:w});((at=globalThis.litElementVersions)!==null&&at!==void 0?at:globalThis.litElementVersions=[]).push("3.3.3");/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const b=t=>e=>typeof e=="function"?((r,i)=>(customElements.define(r,i),i))(t,e):((r,i)=>{const{kind:o,elements:n}=i;return{kind:o,elements:n,finisher(a){customElements.define(r,a)}}})(t,e);/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Jr=(t,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(r){r.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(r){r.createProperty(e.key,t)}},eo=(t,e,r)=>{e.constructor.createProperty(r,t)};function m(t){return(e,r)=>r!==void 0?eo(t,e,r):Jr(t,e)}/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */function D(t){return m({...t,state:!0})}/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */var st;((st=window.HTMLSlotElement)===null||st===void 0?void 0:st.prototype.assignedElements)!=null;/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const to={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},ro=t=>(...e)=>({_$litDirective$:t,values:e});class oo{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,i){this._$Ct=e,this._$AM=r,this._$Ci=i}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}}/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const B=ro(class extends oo{constructor(t){var e;if(super(t),t.type!==to.ATTRIBUTE||t.name!=="class"||((e=t.strings)===null||e===void 0?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){var r,i;if(this.it===void 0){this.it=new Set,t.strings!==void 0&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(n=>n!=="")));for(const n in e)e[n]&&!(!((r=this.nt)===null||r===void 0)&&r.has(n))&&this.it.add(n);return this.render(e)}const o=t.element.classList;this.it.forEach(n=>{n in e||(o.remove(n),this.it.delete(n))});for(const n in e){const a=!!e[n];a===this.it.has(n)||!((i=this.nt)===null||i===void 0)&&i.has(n)||(a?(o.add(n),this.it.add(n)):(o.remove(n),this.it.delete(n)))}return se}});function io(t,e){t.indexOf(e)===-1&&t.push(e)}const Er=(t,e,r)=>Math.min(Math.max(r,t),e),j={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},Ge=t=>typeof t=="number",ge=t=>Array.isArray(t)&&!Ge(t[0]),no=(t,e,r)=>{const i=e-t;return((r-t)%i+i)%i+t};function ao(t,e){return ge(t)?t[no(0,t.length,e)]:t}const Or=(t,e,r)=>-r*t+r*e+t,kr=()=>{},Y=t=>t,Ht=(t,e,r)=>e-t===0?1:(r-t)/(e-t);function Ir(t,e){const r=t[t.length-1];for(let i=1;i<=e;i++){const o=Ht(0,e,i);t.push(Or(r,1,o))}}function so(t){const e=[0];return Ir(e,t-1),e}function lo(t,e=so(t.length),r=Y){const i=t.length,o=i-e.length;return o>0&&Ir(e,o),n=>{let a=0;for(;aArray.isArray(t)&&Ge(t[0]),Wt=t=>typeof t=="object"&&!!t.createAnimation,ye=t=>typeof t=="function",co=t=>typeof t=="string",Pe={ms:t=>t*1e3,s:t=>t/1e3},Pr=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,ho=1e-7,mo=12;function po(t,e,r,i,o){let n,a,s=0;do a=e+(r-e)/2,n=Pr(a,i,o)-t,n>0?r=a:e=a;while(Math.abs(n)>ho&&++spo(n,0,1,t,r);return n=>n===0||n===1?n:Pr(o(n),e,i)}const uo=(t,e="end")=>r=>{r=e==="end"?Math.min(r,.999):Math.max(r,.001);const i=r*t,o=e==="end"?Math.floor(i):Math.ceil(i);return Er(0,1,o/t)},rr={ease:Te(.25,.1,.25,1),"ease-in":Te(.42,0,1,1),"ease-in-out":Te(.42,0,.58,1),"ease-out":Te(0,0,.58,1)},go=/\((.*?)\)/;function or(t){if(ye(t))return t;if(Tr(t))return Te(...t);if(rr[t])return rr[t];if(t.startsWith("steps")){const e=go.exec(t);if(e){const r=e[1].split(",");return uo(parseFloat(r[0]),r[1].trim())}}return Y}class Mr{constructor(e,r=[0,1],{easing:i,duration:o=j.duration,delay:n=j.delay,endDelay:a=j.endDelay,repeat:s=j.repeat,offset:c,direction:d="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=Y,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((v,p)=>{this.resolve=v,this.reject=p}),i=i||j.easing,Wt(i)){const v=i.createAnimation(r);i=v.easing,r=v.keyframes||r,o=v.duration||o}this.repeat=s,this.easing=ge(i)?Y:or(i),this.updateDuration(o);const y=lo(r,c,ge(i)?i.map(or):Y);this.tick=v=>{var p;n=n;let A=0;this.pauseTime!==void 0?A=this.pauseTime:A=(v-this.startTime)*this.rate,this.t=A,A/=1e3,A=Math.max(A-n,0),this.playState==="finished"&&this.pauseTime===void 0&&(A=this.totalDuration);const _=A/this.duration;let g=Math.floor(_),E=_%1;!E&&_>=1&&(E=1),E===1&&g--;const $=g%2;(d==="reverse"||d==="alternate"&&$||d==="alternate-reverse"&&!$)&&(E=1-E);const T=A>=this.totalDuration?1:Math.min(E,1),R=y(this.easing(T));e(R),this.pauseTime===void 0&&(this.playState==="finished"||A>=this.totalDuration+a)?(this.playState="finished",(p=this.resolve)===null||p===void 0||p.call(this,R)):this.playState!=="idle"&&(this.frameRequestId=requestAnimationFrame(this.tick))},this.play()}play(){const e=performance.now();this.playState="running",this.pauseTime!==void 0?this.startTime=e-this.pauseTime:this.startTime||(this.startTime=e),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 e;this.playState="idle",this.frameRequestId!==void 0&&cancelAnimationFrame(this.frameRequestId),(e=this.reject)===null||e===void 0||e.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(e){this.duration=e,this.totalDuration=e*(this.repeat+1)}get currentTime(){return this.t}set currentTime(e){this.pauseTime!==void 0||this.rate===0?this.pauseTime=e:this.startTime=performance.now()-e/this.rate}get playbackRate(){return this.rate}set playbackRate(e){this.rate=e}}class wo{setAnimation(e){this.animation=e,e==null||e.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const lt=new WeakMap;function Sr(t){return lt.has(t)||lt.set(t,{transforms:[],values:new Map}),lt.get(t)}function vo(t,e){return t.has(e)||t.set(e,new wo),t.get(e)}const fo=["","X","Y","Z"],bo=["translate","scale","rotate","skew"],Xe={x:"translateX",y:"translateY",z:"translateZ"},ir={syntax:"",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},yo={translate:{syntax:"",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:ir,scale:{syntax:"",initialValue:1,toDefaultUnit:Y},skew:ir},Le=new Map,Bt=t=>`--motion-${t}`,Je=["x","y","z"];bo.forEach(t=>{fo.forEach(e=>{Je.push(t+e),Le.set(Bt(t+e),yo[t])})});const xo=(t,e)=>Je.indexOf(t)-Je.indexOf(e),$o=new Set(Je),Rr=t=>$o.has(t),Co=(t,e)=>{Xe[e]&&(e=Xe[e]);const{transforms:r}=Sr(t);io(r,e),t.style.transform=Ao(r)},Ao=t=>t.sort(xo).reduce(_o,"").trim(),_o=(t,e)=>`${t} ${e}(var(${Bt(e)}))`,Dt=t=>t.startsWith("--"),nr=new Set;function Eo(t){if(!nr.has(t)){nr.add(t);try{const{syntax:e,initialValue:r}=Le.has(t)?Le.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:r})}catch{}}}const ct=(t,e)=>document.createElement("div").animate(t,e),ar={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{ct({opacity:[1]})}catch{return!1}return!0},finished:()=>!!ct({opacity:[0,1]},{duration:.001}).finished,linearEasing:()=>{try{ct({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},dt={},ue={};for(const t in ar)ue[t]=()=>(dt[t]===void 0&&(dt[t]=ar[t]()),dt[t]);const Oo=.015,ko=(t,e)=>{let r="";const i=Math.round(e/Oo);for(let o=0;oye(t)?ue.linearEasing()?`linear(${ko(t,e)})`:j.easing:Tr(t)?Io(t):t,Io=([t,e,r,i])=>`cubic-bezier(${t}, ${e}, ${r}, ${i})`;function To(t,e){for(let r=0;rArray.isArray(t)?t:[t];function jt(t){return Xe[t]&&(t=Xe[t]),Rr(t)?Bt(t):t}const Ne={get:(t,e)=>{e=jt(e);let r=Dt(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!r&&r!==0){const i=Le.get(e);i&&(r=i.initialValue)}return r},set:(t,e,r)=>{e=jt(e),Dt(e)?t.style.setProperty(e,r):t.style[e]=r}};function Lr(t,e=!0){if(!(!t||t.playState==="finished"))try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch{}}function Mo(t,e){var r;let i=(e==null?void 0:e.toDefaultUnit)||Y;const o=t[t.length-1];if(co(o)){const n=((r=o.match(/(-?[\d.]+)([a-z%]*)/))===null||r===void 0?void 0:r[2])||"";n&&(i=a=>a+n)}return i}function So(){return window.__MOTION_DEV_TOOLS_RECORD}function Ro(t,e,r,i={},o){const n=So(),a=i.record!==!1&&n;let s,{duration:c=j.duration,delay:d=j.delay,endDelay:y=j.endDelay,repeat:v=j.repeat,easing:p=j.easing,persist:A=!1,direction:_,offset:g,allowWebkitAcceleration:E=!1}=i;const $=Sr(t),T=Rr(e);let R=ue.waapi();T&&Co(t,e);const S=jt(e),De=vo($.values,S),Z=Le.get(S);return Lr(De.animation,!(Wt(p)&&De.generator)&&i.record!==!1),()=>{const je=()=>{var I,xe;return(xe=(I=Ne.get(t,S))!==null&&I!==void 0?I:Z==null?void 0:Z.initialValue)!==null&&xe!==void 0?xe:0};let P=To(Po(r),je);const Zt=Mo(P,Z);if(Wt(p)){const I=p.createAnimation(P,e!=="opacity",je,S,De);p=I.easing,P=I.keyframes||P,c=I.duration||c}if(Dt(S)&&(ue.cssRegisterProperty()?Eo(S):R=!1),T&&!ue.linearEasing()&&(ye(p)||ge(p)&&p.some(ye))&&(R=!1),R){Z&&(P=P.map(X=>Ge(X)?Z.toDefaultUnit(X):X)),P.length===1&&(!ue.partialKeyframes()||a)&&P.unshift(je());const I={delay:Pe.ms(d),duration:Pe.ms(c),endDelay:Pe.ms(y),easing:ge(p)?void 0:sr(p,c),direction:_,iterations:v+1,fill:"both"};s=t.animate({[S]:P,offset:g,easing:ge(p)?p.map(X=>sr(X,c)):void 0},I),s.finished||(s.finished=new Promise((X,Dr)=>{s.onfinish=X,s.oncancel=Dr}));const xe=P[P.length-1];s.finished.then(()=>{A||(Ne.set(t,S,xe),s.cancel())}).catch(kr),E||(s.playbackRate=1.000001)}else if(o&&T)P=P.map(I=>typeof I=="string"?parseFloat(I):I),P.length===1&&P.unshift(parseFloat(je())),s=new o(I=>{Ne.set(t,S,Zt?Zt(I):I)},P,Object.assign(Object.assign({},i),{duration:c,easing:p}));else{const I=P[P.length-1];Ne.set(t,S,Z&&Ge(I)?Z.toDefaultUnit(I):I)}return a&&n(t,e,P,{duration:c,delay:d,easing:p,repeat:v,offset:g},"motion-one"),De.setAnimation(s),s}}const Lo=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function Wo(t,e){var r;return typeof t=="string"?e?((r=e[t])!==null&&r!==void 0||(e[t]=document.querySelectorAll(t)),t=e[t]):t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t||[])}const Do=t=>t(),Wr=(t,e,r=j.duration)=>new Proxy({animations:t.map(Do).filter(Boolean),duration:r,options:e},No),jo=t=>t.animations[0],No={get:(t,e)=>{const r=jo(t);switch(e){case"duration":return t.duration;case"currentTime":return Pe.s((r==null?void 0:r[e])||0);case"playbackRate":case"playState":return r==null?void 0:r[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(Uo)).catch(kr)),t.finished;case"stop":return()=>{t.animations.forEach(i=>Lr(i))};case"forEachNative":return i=>{t.animations.forEach(o=>i(o,t))};default:return typeof(r==null?void 0:r[e])>"u"?void 0:()=>t.animations.forEach(i=>i[e]())}},set:(t,e,r)=>{switch(e){case"currentTime":r=Pe.ms(r);case"playbackRate":for(let i=0;it.finished;function Ho(t,e,r){return ye(t)?t(e,r):t}function Bo(t){return function(r,i,o={}){r=Wo(r);const n=r.length,a=[];for(let s=0;s{const r=new Mr(t,[0,1],e);return r.finished.catch(()=>{}),r}],e,e.duration)}function ie(t,e,r){return(ye(t)?zo:Zo)(t,e,r)}/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const L=t=>t??M;var Vo=Object.defineProperty,lr=Object.getOwnPropertySymbols,Fo=Object.prototype.hasOwnProperty,qo=Object.prototype.propertyIsEnumerable,cr=(t,e,r)=>e in t?Vo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ht=(t,e)=>{for(var r in e||(e={}))Fo.call(e,r)&&cr(t,r,e[r]);if(lr)for(var r of lr(e))qo.call(e,r)&&cr(t,r,e[r]);return t};function Ko(){var t;const e=(t=ve.state.themeMode)!=null?t:"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)"}}[e];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 dr(){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 f={getPreset(t){return dr()[t]},setTheme(){const t=document.querySelector(":root"),{themeVariables:e}=ve.state;if(t){const r=ht(ht(ht({},Ko()),dr()),e);Object.entries(r).forEach(([i,o])=>t.style.setProperty(i,o))}},globalCss:x`*,::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)}`},Qo=x`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 Yo=Object.defineProperty,Go=Object.getOwnPropertyDescriptor,le=(t,e,r,i)=>{for(var o=i>1?void 0:i?Go(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&Yo(e,r,o),o};let z=class extends w{constructor(){super(...arguments),this.disabled=!1,this.iconLeft=void 0,this.iconRight=void 0,this.onClick=()=>null,this.variant="default"}render(){const t={"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 e="inverse";return this.variant==="ghost"&&(e="secondary"),this.variant==="outline"&&(e="accent"),l``}};z.styles=[f.globalCss,Qo],le([m({type:Boolean})],z.prototype,"disabled",2),le([m()],z.prototype,"iconLeft",2),le([m()],z.prototype,"iconRight",2),le([m()],z.prototype,"onClick",2),le([m()],z.prototype,"variant",2),z=le([b("wcm-button")],z);const Xo=x`: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 Jo=Object.defineProperty,ei=Object.getOwnPropertyDescriptor,mt=(t,e,r,i)=>{for(var o=i>1?void 0:i?ei(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&Jo(e,r,o),o};let Ce=class extends w{constructor(){super(...arguments),this.disabled=!1,this.variant="primary"}render(){const t={"wcm-secondary":this.variant==="secondary"};return l``}};Ce.styles=[f.globalCss,Xo],mt([m({type:Boolean})],Ce.prototype,"disabled",2),mt([m()],Ce.prototype,"variant",2),Ce=mt([b("wcm-button-big")],Ce);const ti=x`: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 ri=Object.defineProperty,oi=Object.getOwnPropertyDescriptor,ii=(t,e,r,i)=>{for(var o=i>1?void 0:i?oi(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&ri(e,r,o),o};let pt=class extends w{render(){return l`
`}};pt.styles=[f.globalCss,ti],pt=ii([b("wcm-info-footer")],pt);const C={CROSS_ICON:O``,WALLET_CONNECT_LOGO:O``,WALLET_CONNECT_ICON:O``,WALLET_CONNECT_ICON_COLORED:O``,BACK_ICON:O``,COPY_ICON:O``,RETRY_ICON:O``,DESKTOP_ICON:O``,MOBILE_ICON:O``,ARROW_DOWN_ICON:O``,ARROW_UP_RIGHT_ICON:O``,ARROW_RIGHT_ICON:O``,QRCODE_ICON:O``,SCAN_ICON:O``,CHECKMARK_ICON:O``,SEARCH_ICON:O``,WALLET_PLACEHOLDER:O``,GLOBE_ICON:O``},ni=x`.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 ai=Object.defineProperty,si=Object.getOwnPropertyDescriptor,li=(t,e,r,i)=>{for(var o=i>1?void 0:i?si(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&ai(e,r,o),o};let ut=class extends w{render(){return l`
${C.WALLET_CONNECT_LOGO}
`}};ut.styles=[f.globalCss,ni],ut=li([b("wcm-modal-backcard")],ut);const ci=x`main{padding:20px;padding-top:0;width:100%}`;var di=Object.defineProperty,hi=Object.getOwnPropertyDescriptor,mi=(t,e,r,i)=>{for(var o=i>1?void 0:i?hi(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&di(e,r,o),o};let gt=class extends w{render(){return l`
`}};gt.styles=[f.globalCss,ci],gt=mi([b("wcm-modal-content")],gt);const pi=x`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--wcm-color-bg-2)}`;var ui=Object.defineProperty,gi=Object.getOwnPropertyDescriptor,wi=(t,e,r,i)=>{for(var o=i>1?void 0:i?gi(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&ui(e,r,o),o};let wt=class extends w{render(){return l`
`}};wt.styles=[f.globalCss,pi],wt=wi([b("wcm-modal-footer")],wt);const vi=x`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 fi=Object.defineProperty,bi=Object.getOwnPropertyDescriptor,Ae=(t,e,r,i)=>{for(var o=i>1?void 0:i?bi(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&fi(e,r,o),o};let ee=class extends w{constructor(){super(...arguments),this.title="",this.onAction=void 0,this.actionIcon=void 0,this.border=!1}backBtnTemplate(){return l``}actionBtnTemplate(){return l``}render(){const t={"wcm-border":this.border},e=k.state.history.length>1,r=this.title?l`${this.title}`:l``;return l`
${e?this.backBtnTemplate():null} ${r} ${this.onAction?this.actionBtnTemplate():null}
`}};ee.styles=[f.globalCss,vi],Ae([m()],ee.prototype,"title",2),Ae([m()],ee.prototype,"onAction",2),Ae([m()],ee.prototype,"actionIcon",2),Ae([m({type:Boolean})],ee.prototype,"border",2),ee=Ae([b("wcm-modal-header")],ee);const h={MOBILE_BREAKPOINT:600,WCM_RECENT_WALLET_DATA:"WCM_RECENT_WALLET_DATA",EXPLORER_WALLET_URL:"https://explorer.walletconnect.com/?type=wallet",getShadowRootElement(t,e){const r=t.renderRoot.querySelector(e);if(!r)throw new Error(`${e} not found`);return r},getWalletIcon({id:t,image_id:e}){const{walletImages:r}=ne.state;return r!=null&&r[t]?r[t]:e?W.getWalletImageUrl(e):""},getWalletName(t,e=!1){return e&&t.length>8?`${t.substring(0,8)}..`:t},isMobileAnimation(){return window.innerWidth<=h.MOBILE_BREAKPOINT},async preloadImage(t){const e=new Promise((r,i)=>{const o=new Image;o.onload=r,o.onerror=i,o.crossOrigin="anonymous",o.src=t});return Promise.race([e,u.wait(3e3)])},getErrorMessage(t){return t instanceof Error?t.message:"Unknown Error"},debounce(t,e=500){let r;return(...i)=>{function o(){t(...i)}r&&clearTimeout(r),r=setTimeout(o,e)}},handleMobileLinking(t){const{walletConnectUri:e}=U.state,{mobile:r,name:i}=t,o=r==null?void 0:r.native,n=r==null?void 0:r.universal;h.setRecentWallet(t);function a(s){let c="";o?c=u.formatUniversalUrl(o,s,i):n&&(c=u.formatNativeUrl(n,s,i)),u.openHref(c,"_self")}e&&a(e)},handleAndroidLinking(){const{walletConnectUri:t}=U.state;t&&(u.setWalletConnectAndroidDeepLink(t),u.openHref(t,"_self"))},async handleUriCopy(){const{walletConnectUri:t}=U.state;if(t)try{await navigator.clipboard.writeText(t),Q.openToast("Link copied","success")}catch{Q.openToast("Failed to copy","error")}},getCustomImageUrls(){const{walletImages:t}=ne.state,e=Object.values(t??{});return Object.values(e)},truncate(t,e=8){return t.length<=e?t:`${t.substring(0,4)}...${t.substring(t.length-4)}`},setRecentWallet(t){try{localStorage.setItem(h.WCM_RECENT_WALLET_DATA,JSON.stringify(t))}catch{console.info("Unable to set recent wallet")}},getRecentWallet(){try{const t=localStorage.getItem(h.WCM_RECENT_WALLET_DATA);return t?JSON.parse(t):void 0}catch{console.info("Unable to get recent wallet")}},caseSafeIncludes(t,e){return t.toUpperCase().includes(e.toUpperCase())},openWalletExplorerUrl(){u.openHref(h.EXPLORER_WALLET_URL,"_blank")},getCachedRouterWalletPlatforms(){const{desktop:t,mobile:e}=u.getWalletRouterData(),r=!!(t!=null&&t.native),i=!!(t!=null&&t.universal),o=!!(e!=null&&e.native)||!!(e!=null&&e.universal);return{isDesktop:r,isMobile:o,isWeb:i}},goToConnectingView(t){k.setData({Wallet:t});const e=u.isMobile(),{isDesktop:r,isWeb:i,isMobile:o}=h.getCachedRouterWalletPlatforms();e?o?k.push("MobileConnecting"):i?k.push("WebConnecting"):k.push("InstallWallet"):r?k.push("DesktopConnecting"):i?k.push("WebConnecting"):o?k.push("MobileQrcodeConnecting"):k.push("InstallWallet")}},yi=x`.wcm-router{overflow:hidden;will-change:transform}.wcm-content{display:flex;flex-direction:column}`;var xi=Object.defineProperty,$i=Object.getOwnPropertyDescriptor,vt=(t,e,r,i)=>{for(var o=i>1?void 0:i?$i(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&xi(e,r,o),o};let _e=class extends w{constructor(){super(),this.view=k.state.view,this.prevView=k.state.view,this.unsubscribe=void 0,this.oldHeight="0px",this.resizeObserver=void 0,this.unsubscribe=k.subscribe(t=>{this.view!==t.view&&this.onChangeRoute()})}firstUpdated(){this.resizeObserver=new ResizeObserver(([t])=>{const e=`${t.contentRect.height}px`;this.oldHeight!=="0px"&&ie(this.routerEl,{height:[this.oldHeight,e]},{duration:.2}),this.oldHeight=e}),this.resizeObserver.observe(this.contentEl)}disconnectedCallback(){var t,e;(t=this.unsubscribe)==null||t.call(this),(e=this.resizeObserver)==null||e.disconnect()}get routerEl(){return h.getShadowRootElement(this,".wcm-router")}get contentEl(){return h.getShadowRootElement(this,".wcm-content")}viewTemplate(){switch(this.view){case"ConnectWallet":return l``;case"DesktopConnecting":return l``;case"MobileConnecting":return l``;case"WebConnecting":return l``;case"MobileQrcodeConnecting":return l``;case"WalletExplorer":return l``;case"Qrcode":return l``;case"InstallWallet":return l``;default:return l`
Not Found
`}}async onChangeRoute(){await ie(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15,delay:.1}).finished,this.view=k.state.view,ie(this.routerEl,{opacity:[0,1],scale:[.99,1]},{duration:.37,delay:.05})}render(){return l`
${this.viewTemplate()}
`}};_e.styles=[f.globalCss,yi],vt([D()],_e.prototype,"view",2),vt([D()],_e.prototype,"prevView",2),_e=vt([b("wcm-modal-router")],_e);const Ci=x`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 Ai=Object.defineProperty,_i=Object.getOwnPropertyDescriptor,hr=(t,e,r,i)=>{for(var o=i>1?void 0:i?_i(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&Ai(e,r,o),o};let Ue=class extends w{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=Q.subscribe(t=>{t.open?(this.open=!0,this.timeout=setTimeout(()=>Q.closeToast(),2200)):(this.open=!1,clearTimeout(this.timeout))})}disconnectedCallback(){var t;(t=this.unsubscribe)==null||t.call(this),clearTimeout(this.timeout),Q.closeToast()}render(){const{message:t,variant:e}=Q.state,r={"wcm-success":e==="success","wcm-error":e==="error"};return this.open?l`
${e==="success"?C.CHECKMARK_ICON:null} ${e==="error"?C.CROSS_ICON:null}${t}
`:null}};Ue.styles=[f.globalCss,Ci],hr([D()],Ue.prototype,"open",2),Ue=hr([b("wcm-modal-toast")],Ue);const Ei=.1,mr=2.5,H=7;function ft(t,e,r){return t===e?!1:(t-e<0?e-t:t-e)<=r+Ei}function Oi(t,e){const r=Array.prototype.slice.call(Nr.create(t,{errorCorrectionLevel:e}).modules.data,0),i=Math.sqrt(r.length);return r.reduce((o,n,a)=>(a%i===0?o.push([n]):o[o.length-1].push(n))&&o,[])}const ki={generate(t,e,r){const i="#141414",o="#ffffff",n=[],a=Oi(t,"Q"),s=e/a.length,c=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];c.forEach(({x:_,y:g})=>{const E=(a.length-H)*s*_,$=(a.length-H)*s*g,T=.45;for(let R=0;R`)}});const d=Math.floor((r+25)/s),y=a.length/2-d/2,v=a.length/2+d/2-1,p=[];a.forEach((_,g)=>{_.forEach((E,$)=>{if(a[g][$]&&!(ga.length-(H+1)&&$a.length-(H+1))&&!(g>y&&gy&&${A[_]?A[_].push(g):A[_]=[g]}),Object.entries(A).map(([_,g])=>{const E=g.filter($=>g.every(T=>!ft($,T,s)));return[Number(_),E]}).forEach(([_,g])=>{g.forEach(E=>{n.push(O``)})}),Object.entries(A).filter(([_,g])=>g.length>1).map(([_,g])=>{const E=g.filter($=>g.some(T=>ft($,T,s)));return[Number(_),E]}).map(([_,g])=>{g.sort(($,T)=>$R.some(S=>ft($,S,s)));T?T.push($):E.push([$])}return[_,E.map($=>[$[0],$[$.length-1]])]}).forEach(([_,g])=>{g.forEach(([E,$])=>{n.push(O``)})}),n}},Ii=x`@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 Ti=Object.defineProperty,Pi=Object.getOwnPropertyDescriptor,ce=(t,e,r,i)=>{for(var o=i>1?void 0:i?Pi(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&Ti(e,r,o),o};let V=class extends w{constructor(){super(...arguments),this.uri="",this.size=0,this.imageId=void 0,this.walletId=void 0,this.imageUrl=void 0}svgTemplate(){const t=ve.state.themeMode==="light"?this.size:this.size-36;return O`${ki.generate(this.uri,t,t/4)}`}render(){const t={"wcm-dark":ve.state.themeMode==="dark"};return l`
${this.walletId||this.imageUrl?l``:C.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}
`}};V.styles=[f.globalCss,Ii],ce([m()],V.prototype,"uri",2),ce([m({type:Number})],V.prototype,"size",2),ce([m()],V.prototype,"imageId",2),ce([m()],V.prototype,"walletId",2),ce([m()],V.prototype,"imageUrl",2),V=ce([b("wcm-qrcode")],V);const Mi=x`: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 Si=Object.defineProperty,Ri=Object.getOwnPropertyDescriptor,pr=(t,e,r,i)=>{for(var o=i>1?void 0:i?Ri(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&Si(e,r,o),o};let He=class extends w{constructor(){super(...arguments),this.onChange=()=>null}render(){return l` ${C.SEARCH_ICON}`}};He.styles=[f.globalCss,Mi],pr([m()],He.prototype,"onChange",2),He=pr([b("wcm-search-input")],He);const Li=x`@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 Wi=Object.defineProperty,Di=Object.getOwnPropertyDescriptor,ji=(t,e,r,i)=>{for(var o=i>1?void 0:i?Di(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&Wi(e,r,o),o};let bt=class extends w{render(){return l``}};bt.styles=[f.globalCss,Li],bt=ji([b("wcm-spinner")],bt);const Ni=x`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 Ui=Object.defineProperty,Hi=Object.getOwnPropertyDescriptor,yt=(t,e,r,i)=>{for(var o=i>1?void 0:i?Hi(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&Ui(e,r,o),o};let Ee=class extends w{constructor(){super(...arguments),this.variant="medium-regular",this.color="primary"}render(){const t={"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 l``}};Ee.styles=[f.globalCss,Ni],yt([m()],Ee.prototype,"variant",2),yt([m()],Ee.prototype,"color",2),Ee=yt([b("wcm-text")],Ee);const Bi=x`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 Zi=Object.defineProperty,zi=Object.getOwnPropertyDescriptor,F=(t,e,r,i)=>{for(var o=i>1?void 0:i?zi(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&Zi(e,r,o),o};let N=class extends w{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?l`RECENT`:this.installed?l`INSTALLED`:null}handleClick(){jr.click({name:"WALLET_BUTTON",walletId:this.walletId}),this.onClick()}render(){var t;return l``}};N.styles=[f.globalCss,Bi],F([m()],N.prototype,"onClick",2),F([m()],N.prototype,"name",2),F([m()],N.prototype,"walletId",2),F([m()],N.prototype,"label",2),F([m()],N.prototype,"imageId",2),F([m({type:Boolean})],N.prototype,"installed",2),F([m({type:Boolean})],N.prototype,"recent",2),N=F([b("wcm-wallet-button")],N);const Vi=x`: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 Fi=Object.defineProperty,qi=Object.getOwnPropertyDescriptor,Be=(t,e,r,i)=>{for(var o=i>1?void 0:i?qi(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&Fi(e,r,o),o};let de=class extends w{constructor(){super(...arguments),this.walletId="",this.imageId=void 0,this.imageUrl=void 0}render(){var t;const e=(t=this.imageUrl)!=null&&t.length?this.imageUrl:h.getWalletIcon({id:this.walletId,image_id:this.imageId});return l`${e.length?l`
${this.id}
`:C.WALLET_PLACEHOLDER}`}};de.styles=[f.globalCss,Vi],Be([m()],de.prototype,"walletId",2),Be([m()],de.prototype,"imageId",2),Be([m()],de.prototype,"imageUrl",2),de=Be([b("wcm-wallet-image")],de);var Ki=Object.defineProperty,Qi=Object.getOwnPropertyDescriptor,ur=(t,e,r,i)=>{for(var o=i>1?void 0:i?Qi(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&Ki(e,r,o),o};let xt=class extends w{constructor(){super(),this.preload=!0,this.preloadData()}async loadImages(t){try{t!=null&&t.length&&await Promise.all(t.map(async e=>h.preloadImage(e)))}catch{console.info("Unsuccessful attempt at preloading some images",t)}}async preloadListings(){if(ne.state.enableExplorer){await W.getRecomendedWallets(),U.setIsDataLoaded(!0);const{recomendedWallets:t}=W.state,e=t.map(r=>h.getWalletIcon(r));await this.loadImages(e)}else U.setIsDataLoaded(!0)}async preloadCustomImages(){const t=h.getCustomImageUrls();await this.loadImages(t)}async preloadData(){try{this.preload&&(this.preload=!1,await Promise.all([this.preloadListings(),this.preloadCustomImages()]))}catch(t){console.error(t),Q.openToast("Failed preloading","error")}}};ur([D()],xt.prototype,"preload",2),xt=ur([b("wcm-explorer-context")],xt);var Yi=Object.defineProperty,Gi=Object.getOwnPropertyDescriptor,Xi=(t,e,r,i)=>{for(var o=i>1?void 0:i?Gi(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&Yi(e,r,o),o};let gr=class extends w{constructor(){super(),this.unsubscribeTheme=void 0,f.setTheme(),this.unsubscribeTheme=ve.subscribe(f.setTheme)}disconnectedCallback(){var t;(t=this.unsubscribeTheme)==null||t.call(this)}};gr=Xi([b("wcm-theme-context")],gr);const Ji=x`@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 en=Object.defineProperty,tn=Object.getOwnPropertyDescriptor,rn=(t,e,r,i)=>{for(var o=i>1?void 0:i?tn(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&en(e,r,o),o};let $t=class extends w{onGoToQrcode(){k.push("Qrcode")}render(){const{recomendedWallets:t}=W.state,e=[...t,...t],r=u.RECOMMENDED_WALLET_AMOUNT*2;return l`
${C.MOBILE_ICON}WalletConnect
${[...Array(r)].map((i,o)=>{const n=e[o%e.length];return n?l``:C.WALLET_PLACEHOLDER})}
Select Wallet
Choose WalletConnect to see supported apps on your device`}};$t.styles=[f.globalCss,Ji],$t=rn([b("wcm-android-wallet-selection")],$t);const on=x`@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 nn=Object.defineProperty,an=Object.getOwnPropertyDescriptor,he=(t,e,r,i)=>{for(var o=i>1?void 0:i?an(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&nn(e,r,o),o};let q=class extends w{constructor(){super(...arguments),this.walletId=void 0,this.imageId=void 0,this.isError=!1,this.isStale=!1,this.label=""}svgLoaderTemplate(){var t,e;const r=(e=(t=ve.state.themeVariables)==null?void 0:t["--wcm-wallet-icon-large-border-radius"])!=null?e:f.getPreset("--wcm-wallet-icon-large-border-radius");let i=0;r.includes("%")?i=88/100*parseInt(r,10):i=parseInt(r,10),i*=1.17;const o=317-i*1.57,n=425-i*1.8;return l``}render(){const t={"wcm-error":this.isError,"wcm-stale":this.isStale};return l`
${this.svgLoaderTemplate()}
${this.isError?"Connection declined":this.label}`}};q.styles=[f.globalCss,on],he([m()],q.prototype,"walletId",2),he([m()],q.prototype,"imageId",2),he([m({type:Boolean})],q.prototype,"isError",2),he([m({type:Boolean})],q.prototype,"isStale",2),he([m()],q.prototype,"label",2),q=he([b("wcm-connector-waiting")],q);const we={manualWallets(){var t,e;const{mobileWallets:r,desktopWallets:i}=ne.state,o=(t=we.recentWallet())==null?void 0:t.id,n=u.isMobile()?r:i,a=n==null?void 0:n.filter(s=>o!==s.id);return(e=u.isMobile()?a==null?void 0:a.map(({id:s,name:c,links:d})=>({id:s,name:c,mobile:d,links:d})):a==null?void 0:a.map(({id:s,name:c,links:d})=>({id:s,name:c,desktop:d,links:d})))!=null?e:[]},recentWallet(){return h.getRecentWallet()},recomendedWallets(t=!1){var e;const r=t||(e=we.recentWallet())==null?void 0:e.id,{recomendedWallets:i}=W.state;return i.filter(o=>r!==o.id)}},G={onConnecting(t){h.goToConnectingView(t)},manualWalletsTemplate(){return we.manualWallets().map(t=>l``)},recomendedWalletsTemplate(t=!1){return we.recomendedWallets(t).map(e=>l``)},recentWalletTemplate(){const t=we.recentWallet();if(t)return l``}},sn=x`.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 ln=Object.defineProperty,cn=Object.getOwnPropertyDescriptor,dn=(t,e,r,i)=>{for(var o=i>1?void 0:i?cn(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&ln(e,r,o),o};let Ct=class extends w{render(){const{explorerExcludedWalletIds:t,enableExplorer:e}=ne.state,r=t!=="ALL"&&e,i=G.manualWalletsTemplate(),o=G.recomendedWalletsTemplate();let n=[G.recentWalletTemplate(),...i,...o];n=n.filter(Boolean);const a=n.length>4||r;let s=[];a?s=n.slice(0,3):s=n;const c=!!s.length;return l`
${C.MOBILE_ICON}Mobile
${C.SCAN_ICON}Scan with your wallet
${c?l`
${C.DESKTOP_ICON}Desktop
${s} ${a?l``:null}
`:null}`}};Ct.styles=[f.globalCss,sn],Ct=dn([b("wcm-desktop-wallet-selection")],Ct);const hn=x`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 mn=Object.defineProperty,pn=Object.getOwnPropertyDescriptor,un=(t,e,r,i)=>{for(var o=i>1?void 0:i?pn(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&mn(e,r,o),o};let At=class extends w{render(){const{termsOfServiceUrl:t,privacyPolicyUrl:e}=ne.state;return t??e?l`
By connecting your wallet to this app, you agree to the app's ${t?l`Terms of Service`:null} ${t&&e?"and":null} ${e?l`Privacy Policy`:null}
`:null}};At.styles=[f.globalCss,hn],At=un([b("wcm-legal-notice")],At);const gn=x`div{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;var wn=Object.defineProperty,vn=Object.getOwnPropertyDescriptor,fn=(t,e,r,i)=>{for(var o=i>1?void 0:i?vn(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&wn(e,r,o),o};let _t=class extends w{onQrcode(){k.push("Qrcode")}render(){const{explorerExcludedWalletIds:t,enableExplorer:e}=ne.state,r=t!=="ALL"&&e,i=G.manualWalletsTemplate(),o=G.recomendedWalletsTemplate();let n=[G.recentWalletTemplate(),...i,...o];n=n.filter(Boolean);const a=n.length>8||r;let s=[];a?s=n.slice(0,7):s=n;const c=!!s.length;return l`${c?l`
${s} ${a?l``:null}
`:null}`}};_t.styles=[f.globalCss,gn],_t=fn([b("wcm-mobile-wallet-selection")],_t);const bn=x`: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 yn=Object.defineProperty,xn=Object.getOwnPropertyDescriptor,Et=(t,e,r,i)=>{for(var o=i>1?void 0:i?xn(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&yn(e,r,o),o};let Oe=class extends w{constructor(){super(),this.open=!1,this.active=!1,this.unsubscribeModal=void 0,this.abortController=void 0,this.unsubscribeModal=qe.subscribe(t=>{t.open?this.onOpenModalEvent():this.onCloseModalEvent()})}disconnectedCallback(){var t;(t=this.unsubscribeModal)==null||t.call(this)}get overlayEl(){return h.getShadowRootElement(this,".wcm-overlay")}get containerEl(){return h.getShadowRootElement(this,".wcm-container")}toggleBodyScroll(t){if(document.querySelector("body"))if(t){const e=document.getElementById("wcm-styles");e==null||e.remove()}else document.head.insertAdjacentHTML("beforeend",'')}onCloseModal(t){t.target===t.currentTarget&&qe.close()}onOpenModalEvent(){this.toggleBodyScroll(!1),this.addKeyboardEvents(),this.open=!0,setTimeout(async()=>{const t=h.isMobileAnimation()?{y:["50vh","0vh"]}:{scale:[.98,1]},e=.1,r=.2;await Promise.all([ie(this.overlayEl,{opacity:[0,1]},{delay:e,duration:r}).finished,ie(this.containerEl,t,{delay:e,duration:r}).finished]),this.active=!0},0)}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents();const t=h.isMobileAnimation()?{y:["0vh","50vh"]}:{scale:[1,.98]},e=.2;await Promise.all([ie(this.overlayEl,{opacity:[1,0]},{duration:e}).finished,ie(this.containerEl,t,{duration:e}).finished]),this.containerEl.removeAttribute("style"),this.active=!1,this.open=!1}addKeyboardEvents(){this.abortController=new AbortController,window.addEventListener("keydown",t=>{var e;t.key==="Escape"?qe.close():t.key==="Tab"&&((e=t.target)!=null&&e.tagName.includes("wcm-")||this.containerEl.focus())},this.abortController),this.containerEl.focus()}removeKeyboardEvents(){var t;(t=this.abortController)==null||t.abort(),this.abortController=void 0}render(){const t={"wcm-overlay":!0,"wcm-active":this.active};return l`
${this.open?l`
`:null}
`}};Oe.styles=[f.globalCss,bn],Et([D()],Oe.prototype,"open",2),Et([D()],Oe.prototype,"active",2),Oe=Et([b("wcm-modal")],Oe);const $n=x`div{display:flex;margin-top:15px}slot{display:inline-block;margin:0 5px}wcm-button{margin:0 5px}`;var Cn=Object.defineProperty,An=Object.getOwnPropertyDescriptor,ke=(t,e,r,i)=>{for(var o=i>1?void 0:i?An(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&Cn(e,r,o),o};let te=class extends w{constructor(){super(...arguments),this.isMobile=!1,this.isDesktop=!1,this.isWeb=!1,this.isRetry=!1}onMobile(){u.isMobile()?k.replace("MobileConnecting"):k.replace("MobileQrcodeConnecting")}onDesktop(){k.replace("DesktopConnecting")}onWeb(){k.replace("WebConnecting")}render(){return l`
${this.isRetry?l``:null} ${this.isMobile?l`Mobile`:null} ${this.isDesktop?l`Desktop`:null} ${this.isWeb?l`Web`:null}
`}};te.styles=[f.globalCss,$n],ke([m({type:Boolean})],te.prototype,"isMobile",2),ke([m({type:Boolean})],te.prototype,"isDesktop",2),ke([m({type:Boolean})],te.prototype,"isWeb",2),ke([m({type:Boolean})],te.prototype,"isRetry",2),te=ke([b("wcm-platform-selection")],te);const _n=x`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 En=Object.defineProperty,On=Object.getOwnPropertyDescriptor,kn=(t,e,r,i)=>{for(var o=i>1?void 0:i?On(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&En(e,r,o),o};let Ot=class extends w{onClick(){k.push("WalletExplorer")}render(){const{recomendedWallets:t}=W.state,e=we.manualWallets(),r=[...t,...e].reverse().slice(0,4);return l``}};Ot.styles=[f.globalCss,_n],Ot=kn([b("wcm-view-all-wallets-button")],Ot);const In=x`.wcm-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var Tn=Object.defineProperty,Pn=Object.getOwnPropertyDescriptor,Ze=(t,e,r,i)=>{for(var o=i>1?void 0:i?Pn(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&Tn(e,r,o),o};let me=class extends w{constructor(){super(),this.walletId="",this.imageId="",this.uri="",setTimeout(()=>{const{walletConnectUri:t}=U.state;this.uri=t},0)}get overlayEl(){return h.getShadowRootElement(this,".wcm-qr-container")}render(){return l`
${this.uri?l``:l``}
`}};me.styles=[f.globalCss,In],Ze([m()],me.prototype,"walletId",2),Ze([m()],me.prototype,"imageId",2),Ze([D()],me.prototype,"uri",2),me=Ze([b("wcm-walletconnect-qr")],me);var Mn=Object.defineProperty,Sn=Object.getOwnPropertyDescriptor,Rn=(t,e,r,i)=>{for(var o=i>1?void 0:i?Sn(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&Mn(e,r,o),o};let kt=class extends w{viewTemplate(){return u.isAndroid()?l``:u.isMobile()?l``:l``}render(){return l`${this.viewTemplate()}`}};kt.styles=[f.globalCss],kt=Rn([b("wcm-connect-wallet-view")],kt);const Ln=x`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var Wn=Object.defineProperty,Dn=Object.getOwnPropertyDescriptor,wr=(t,e,r,i)=>{for(var o=i>1?void 0:i?Dn(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&Wn(e,r,o),o};let ze=class extends w{constructor(){super(),this.isError=!1,this.openDesktopApp()}onFormatAndRedirect(t){const{desktop:e,name:r}=u.getWalletRouterData(),i=e==null?void 0:e.native;if(i){const o=u.formatNativeUrl(i,t,r);u.openHref(o,"_self")}}openDesktopApp(){const{walletConnectUri:t}=U.state,e=u.getWalletRouterData();h.setRecentWallet(e),t&&this.onFormatAndRedirect(t)}render(){const{name:t,id:e,image_id:r}=u.getWalletRouterData(),{isMobile:i,isWeb:o}=h.getCachedRouterWalletPlatforms();return l`${`Connection can continue loading if ${t} is not installed on your device`}Retry`}};ze.styles=[f.globalCss,Ln],wr([D()],ze.prototype,"isError",2),ze=wr([b("wcm-desktop-connecting-view")],ze);const jn=x`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 Nn=Object.defineProperty,Un=Object.getOwnPropertyDescriptor,Hn=(t,e,r,i)=>{for(var o=i>1?void 0:i?Un(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&Nn(e,r,o),o};let It=class extends w{onInstall(t){t&&u.openHref(t,"_blank")}render(){const{name:t,id:e,image_id:r,homepage:i}=u.getWalletRouterData();return l`${`Download ${t} to continue. If multiple browser extensions are installed, disable non ${t} ones and try again`}Download`}};It.styles=[f.globalCss,jn],It=Hn([b("wcm-install-wallet-view")],It);const Bn=x`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 Zn=Object.defineProperty,zn=Object.getOwnPropertyDescriptor,vr=(t,e,r,i)=>{for(var o=i>1?void 0:i?zn(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&Zn(e,r,o),o};let Ve=class extends w{constructor(){super(),this.isError=!1,this.openMobileApp()}onFormatAndRedirect(t,e=!1){const{mobile:r,name:i}=u.getWalletRouterData(),o=r==null?void 0:r.native,n=r==null?void 0:r.universal;if(o&&!e){const a=u.formatNativeUrl(o,t,i);u.openHref(a,"_self")}else if(n){const a=u.formatUniversalUrl(n,t,i);u.openHref(a,"_self")}}openMobileApp(t=!1){const{walletConnectUri:e}=U.state,r=u.getWalletRouterData();h.setRecentWallet(r),e&&this.onFormatAndRedirect(e,t)}onGoToAppStore(t){t&&u.openHref(t,"_blank")}render(){const{name:t,id:e,image_id:r,app:i,mobile:o}=u.getWalletRouterData(),{isWeb:n}=h.getCachedRouterWalletPlatforms(),a=i==null?void 0:i.ios,s=o==null?void 0:o.universal;return l`Retry${s?l`Still doesn't work? Try this alternate link`:null}
${`Get ${t}`}
App Store
`}};Ve.styles=[f.globalCss,Bn],vr([D()],Ve.prototype,"isError",2),Ve=vr([b("wcm-mobile-connecting-view")],Ve);const Vn=x`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var Fn=Object.defineProperty,qn=Object.getOwnPropertyDescriptor,Kn=(t,e,r,i)=>{for(var o=i>1?void 0:i?qn(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&Fn(e,r,o),o};let Tt=class extends w{render(){const{name:t,id:e,image_id:r}=u.getWalletRouterData(),{isDesktop:i,isWeb:o}=h.getCachedRouterWalletPlatforms();return l`${`Scan this QR Code with your phone's camera or inside ${t} app`}`}};Tt.styles=[f.globalCss,Vn],Tt=Kn([b("wcm-mobile-qr-connecting-view")],Tt);var Qn=Object.defineProperty,Yn=Object.getOwnPropertyDescriptor,Gn=(t,e,r,i)=>{for(var o=i>1?void 0:i?Yn(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&Qn(e,r,o),o};let Pt=class extends w{render(){return l``}};Pt.styles=[f.globalCss],Pt=Gn([b("wcm-qrcode-view")],Pt);const Xn=x`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 Jn=Object.defineProperty,ea=Object.getOwnPropertyDescriptor,Ie=(t,e,r,i)=>{for(var o=i>1?void 0:i?ea(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&Jn(e,r,o),o};const Mt=40;let re=class extends w{constructor(){super(...arguments),this.loading=!W.state.wallets.listings.length,this.firstFetch=!W.state.wallets.listings.length,this.search="",this.endReached=!1,this.intersectionObserver=void 0,this.searchDebounce=h.debounce(t=>{t.length>=1?(this.firstFetch=!0,this.endReached=!1,this.search=t,W.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),W.resetSearch())})}firstUpdated(){this.createPaginationObserver()}disconnectedCallback(){var t;(t=this.intersectionObserver)==null||t.disconnect()}get placeholderEl(){return h.getShadowRootElement(this,".wcm-placeholder-block")}createPaginationObserver(){this.intersectionObserver=new IntersectionObserver(([t])=>{t.isIntersecting&&!(this.search&&this.firstFetch)&&this.fetchWallets()}),this.intersectionObserver.observe(this.placeholderEl)}isLastPage(){const{wallets:t,search:e}=W.state,{listings:r,total:i}=this.search?e:t;return i<=Mt||r.length>=i}async fetchWallets(){var t;const{wallets:e,search:r}=W.state,{listings:i,total:o,page:n}=this.search?r:e;if(!this.endReached&&(this.firstFetch||o>Mt&&i.lengthh.getWalletIcon(d));await Promise.all([...c.map(async d=>h.preloadImage(d)),u.wait(300)]),this.endReached=this.isLastPage()}catch(a){console.error(a),Q.openToast(h.getErrorMessage(a),"error")}finally{this.loading=!1,this.firstFetch=!1}}onConnect(t){u.isAndroid()?h.handleMobileLinking(t):h.goToConnectingView(t)}onSearchChange(t){const{value:e}=t.target;this.searchDebounce(e)}render(){const{wallets:t,search:e}=W.state,{listings:r}=this.search?e:t,i=this.loading&&!r.length,o=this.search.length>=3;let n=G.manualWalletsTemplate(),a=G.recomendedWalletsTemplate(!0);o&&(n=n.filter(({values:d})=>h.caseSafeIncludes(d[0],this.search)),a=a.filter(({values:d})=>h.caseSafeIncludes(d[0],this.search)));const s=!this.loading&&!r.length&&!a.length,c={"wcm-loading":i,"wcm-end-reached":this.endReached||!this.loading,"wcm-empty":s};return l`
${i?null:n} ${i?null:a} ${i?null:r.map(d=>l`${d?l``:null}`)}
${s?l`No results found`:null} ${!s&&this.loading?l``:null}
`}};re.styles=[f.globalCss,Xn],Ie([D()],re.prototype,"loading",2),Ie([D()],re.prototype,"firstFetch",2),Ie([D()],re.prototype,"search",2),Ie([D()],re.prototype,"endReached",2),re=Ie([b("wcm-wallet-explorer-view")],re);const ta=x`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var ra=Object.defineProperty,oa=Object.getOwnPropertyDescriptor,fr=(t,e,r,i)=>{for(var o=i>1?void 0:i?oa(e,r):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(o=(i?a(e,r,o):a(o))||o);return i&&o&&ra(e,r,o),o};let Fe=class extends w{constructor(){super(),this.isError=!1,this.openWebWallet()}onFormatAndRedirect(t){const{desktop:e,name:r}=u.getWalletRouterData(),i=e==null?void 0:e.universal;if(i){const o=u.formatUniversalUrl(i,t,r);u.openHref(o,"_blank")}}openWebWallet(){const{walletConnectUri:t}=U.state,e=u.getWalletRouterData();h.setRecentWallet(e),t&&this.onFormatAndRedirect(t)}render(){const{name:t,id:e,image_id:r}=u.getWalletRouterData(),{isMobile:i,isDesktop:o}=h.getCachedRouterWalletPlatforms(),n=u.isMobile();return l`${`${t} web app has opened in a new tab. Go there, accept the connection, and come back`}Retry`}};Fe.styles=[f.globalCss,ta],fr([D()],Fe.prototype,"isError",2),Fe=fr([b("wcm-web-connecting-view")],Fe);export{Oe as WcmModal,V as WcmQrCode}; diff --git a/assets/index-hW2M65xa.js b/assets/index-hW2M65xa.js new file mode 100644 index 0000000..f2cf47e --- /dev/null +++ b/assets/index-hW2M65xa.js @@ -0,0 +1,61 @@ +import{A as S,N as E,l as _,C as m,R as b,p as v,m as x,s as M,r as N,O as h,n as O,o as p,S as W,x as C,q as I,E as u,t as R,M as U,u as $,v as A}from"./index-BCdecgwI.js";const f={FIVE_MINUTES_IN_MS:3e5};class j{constructor(e){const{enabled:n=!0,nonceRefetchIntervalMs:i=f.FIVE_MINUTES_IN_MS,sessionRefetchIntervalMs:a=f.FIVE_MINUTES_IN_MS,signOutOnAccountChange:s=!0,signOutOnDisconnect:r=!0,signOutOnNetworkChange:o=!0,...l}=e;this.options={enabled:n,nonceRefetchIntervalMs:i,sessionRefetchIntervalMs:a,signOutOnDisconnect:r,signOutOnAccountChange:s,signOutOnNetworkChange:o},this.methods=l}async getNonce(e){const n=await this.methods.getNonce(e);if(!n)throw new Error("siweControllerClient:getNonce - nonce is undefined");return n}createMessage(e){const n=this.methods.createMessage(e);if(!n)throw new Error("siweControllerClient:createMessage - message is undefined");return n}async verifyMessage(e){return await this.methods.verifyMessage(e)}async getSession(){const e=await this.methods.getSession();if(!e)throw new Error("siweControllerClient:getSession - session is undefined");return e}async signIn(){var l;const{address:e}=S.state,n=await this.methods.getNonce(e);if(!e)throw new Error("An address is required to create a SIWE message.");const i=E.caipNetworkIdToNumber((l=_.state.caipNetwork)==null?void 0:l.id);if(!i)throw new Error("A chainId is required to create a SIWE message.");const a=this.methods.createMessage({address:e,nonce:n,chainId:i}),s=await m.signMessage(a);if(!await this.methods.verifyMessage({message:a,signature:s}))throw new Error("Error verifying SIWE signature");const o=await this.methods.getSession();if(!o)throw new Error("Error verifying SIWE signature");return this.methods.onSignIn&&this.methods.onSignIn(o),b.navigateAfterNetworkSwitch(),o}async signOut(){return this.methods.signOut()}}const c=v({status:"uninitialized"}),g={state:c,subscribeKey(t,e){return x(c,t,e)},subscribe(t){return M(c,()=>t(c))},_getClient(){if(!c._client)throw new Error("SIWEController client not set");return c._client},async getNonce(t){const n=await this._getClient().getNonce(t);return this.setNonce(n),n},async getSession(){const e=await this._getClient().getSession();return e&&(this.setSession(e),this.setStatus("success")),e},createMessage(t){const n=this._getClient().createMessage(t);return this.setMessage(n),n},async verifyMessage(t){return await this._getClient().verifyMessage(t)},async signIn(){return await this._getClient().signIn()},async signOut(){var e;const t=this._getClient();await t.signOut(),this.setStatus("ready"),(e=t.onSignOut)==null||e.call(t)},onSignIn(t){var n;const e=this._getClient();(n=e.onSignIn)==null||n.call(e,t)},onSignOut(){var e;const t=this._getClient();(e=t.onSignOut)==null||e.call(t)},setSIWEClient(t){c._client=N(t),c.status="ready",h.setIsSiweEnabled(t.options.enabled)},setNonce(t){c.nonce=t},setStatus(t){c.status=t},setMessage(t){c.message=t},setSession(t){c.session=t}},V=O` + :host { + display: flex; + justify-content: center; + gap: var(--wui-spacing-2xl); + } + + wui-visual-thumbnail:nth-child(1) { + z-index: 1; + } +`;var T=function(t,e,n,i){var a=arguments.length,s=a<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(s=(a<3?r(s):a>3?r(e,n,s):r(e,n))||s);return a>3&&s&&Object.defineProperty(e,n,s),s};let d=class extends p{constructor(){var e;super(...arguments),this.dappImageUrl=(e=h.state.metadata)==null?void 0:e.icons,this.walletImageUrl=W.getConnectedWalletImageUrl()}firstUpdated(){var n;const e=(n=this.shadowRoot)==null?void 0:n.querySelectorAll("wui-visual-thumbnail");e!=null&&e[0]&&this.createAnimation(e[0],"translate(18px)"),e!=null&&e[1]&&this.createAnimation(e[1],"translate(-18px)")}render(){var e;return C` + + + `}createAnimation(e,n){e.animate([{transform:"translateX(0px)"},{transform:n}],{duration:1600,easing:"cubic-bezier(0.56, 0, 0.48, 1)",direction:"alternate",iterations:1/0})}};d.styles=V;d=T([I("w3m-connecting-siwe")],d);var y=function(t,e,n,i){var a=arguments.length,s=a<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(s=(a<3?r(s):a>3?r(e,n,s):r(e,n))||s);return a>3&&s&&Object.defineProperty(e,n,s),s};let w=class extends p{constructor(){var e;super(...arguments),this.dappName=(e=h.state.metadata)==null?void 0:e.name,this.isSigning=!1}render(){return C` + + + + + ${this.dappName??"Dapp"} needs to connect to your wallet + + + Sign this message to prove you own this wallet and proceed. Canceling will disconnect + you. + + + + Cancel + + + ${this.isSigning?"Signing...":"Sign"} + + + `}async onSign(){this.isSigning=!0,u.sendEvent({event:"CLICK_SIGN_SIWE_MESSAGE",type:"track"});try{g.setStatus("loading");const e=await g.signIn();return g.setStatus("success"),u.sendEvent({event:"SIWE_AUTH_SUCCESS",type:"track"}),e}catch{return R.showError("Signature declined"),g.setStatus("error"),u.sendEvent({event:"SIWE_AUTH_ERROR",type:"track"})}finally{this.isSigning=!1}}async onCancel(){const{isConnected:e}=S.state;e?(await m.disconnect(),U.close()):$.push("Connect"),u.sendEvent({event:"CLICK_CANCEL_SIWE",type:"track"})}};y([A()],w.prototype,"isSigning",void 0);w=y([I("w3m-connecting-siwe-view")],w);function D(t){return new j(t)}export{g as SIWEController,d as W3mConnectingSiwe,w as W3mConnectingSiweView,D as createSIWEConfig}; diff --git a/assets/index.es-_1whrglJ.js b/assets/index.es-_1whrglJ.js new file mode 100644 index 0000000..eda8063 --- /dev/null +++ b/assets/index.es-_1whrglJ.js @@ -0,0 +1,52 @@ +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/index-CZVo1pMO.js","assets/index-BCdecgwI.js","assets/index-BW-H86H5.css"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} +import{k as xu,y as Yr,j as Ou,_ as I_}from"./index-BCdecgwI.js";import{r as x_,e as Fr,U as Pu}from"./___vite-browser-external_commonjs-proxy-D0iV-SFw.js";var Cu={},ea={},$e={},Ud={};(function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(f,y){var g=f>>>16&65535,m=f&65535,D=y>>>16&65535,I=y&65535;return m*I+(g*I+m*D<<16>>>0)|0}i.mul=Math.imul||e;function t(f,y){return f+y|0}i.add=t;function s(f,y){return f-y|0}i.sub=s;function o(f,y){return f<>>32-y}i.rotl=o;function c(f,y){return f<<32-y|f>>>y}i.rotr=c;function d(f){return typeof f=="number"&&isFinite(f)&&Math.floor(f)===f}i.isInteger=Number.isInteger||d,i.MAX_SAFE_INTEGER=9007199254740991,i.isSafeInteger=function(f){return i.isInteger(f)&&f>=-i.MAX_SAFE_INTEGER&&f<=i.MAX_SAFE_INTEGER}})(Ud);Object.defineProperty($e,"__esModule",{value:!0});var Ld=Ud;function O_(i,e){return e===void 0&&(e=0),(i[e+0]<<8|i[e+1])<<16>>16}$e.readInt16BE=O_;function P_(i,e){return e===void 0&&(e=0),(i[e+0]<<8|i[e+1])>>>0}$e.readUint16BE=P_;function C_(i,e){return e===void 0&&(e=0),(i[e+1]<<8|i[e])<<16>>16}$e.readInt16LE=C_;function A_(i,e){return e===void 0&&(e=0),(i[e+1]<<8|i[e])>>>0}$e.readUint16LE=A_;function $d(i,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=i>>>8,e[t+1]=i>>>0,e}$e.writeUint16BE=$d;$e.writeInt16BE=$d;function Md(i,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=i>>>0,e[t+1]=i>>>8,e}$e.writeUint16LE=Md;$e.writeInt16LE=Md;function nu(i,e){return e===void 0&&(e=0),i[e]<<24|i[e+1]<<16|i[e+2]<<8|i[e+3]}$e.readInt32BE=nu;function su(i,e){return e===void 0&&(e=0),(i[e]<<24|i[e+1]<<16|i[e+2]<<8|i[e+3])>>>0}$e.readUint32BE=su;function ou(i,e){return e===void 0&&(e=0),i[e+3]<<24|i[e+2]<<16|i[e+1]<<8|i[e]}$e.readInt32LE=ou;function au(i,e){return e===void 0&&(e=0),(i[e+3]<<24|i[e+2]<<16|i[e+1]<<8|i[e])>>>0}$e.readUint32LE=au;function Go(i,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=i>>>24,e[t+1]=i>>>16,e[t+2]=i>>>8,e[t+3]=i>>>0,e}$e.writeUint32BE=Go;$e.writeInt32BE=Go;function Wo(i,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=i>>>0,e[t+1]=i>>>8,e[t+2]=i>>>16,e[t+3]=i>>>24,e}$e.writeUint32LE=Wo;$e.writeInt32LE=Wo;function T_(i,e){e===void 0&&(e=0);var t=nu(i,e),s=nu(i,e+4);return t*4294967296+s-(s>>31)*4294967296}$e.readInt64BE=T_;function R_(i,e){e===void 0&&(e=0);var t=su(i,e),s=su(i,e+4);return t*4294967296+s}$e.readUint64BE=R_;function N_(i,e){e===void 0&&(e=0);var t=ou(i,e),s=ou(i,e+4);return s*4294967296+t-(t>>31)*4294967296}$e.readInt64LE=N_;function U_(i,e){e===void 0&&(e=0);var t=au(i,e),s=au(i,e+4);return s*4294967296+t}$e.readUint64LE=U_;function jd(i,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),Go(i/4294967296>>>0,e,t),Go(i>>>0,e,t+4),e}$e.writeUint64BE=jd;$e.writeInt64BE=jd;function qd(i,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),Wo(i>>>0,e,t),Wo(i/4294967296>>>0,e,t+4),e}$e.writeUint64LE=qd;$e.writeInt64LE=qd;function L_(i,e,t){if(t===void 0&&(t=0),i%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(i/8>e.length-t)throw new Error("readUintBE: array is too short for the given bitLength");for(var s=0,o=1,c=i/8+t-1;c>=t;c--)s+=e[c]*o,o*=256;return s}$e.readUintBE=L_;function $_(i,e,t){if(t===void 0&&(t=0),i%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(i/8>e.length-t)throw new Error("readUintLE: array is too short for the given bitLength");for(var s=0,o=1,c=t;c=s;c--)t[c]=e/o&255,o*=256;return t}$e.writeUintBE=M_;function j_(i,e,t,s){if(t===void 0&&(t=new Uint8Array(i/8)),s===void 0&&(s=0),i%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!Ld.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var o=1,c=s;c>>16|C<<16,se=se+C|0,u^=se,u=u>>>20|u<<12,O=O+_|0,ee^=O,ee=ee>>>16|ee<<16,ue=ue+ee|0,_^=ue,_=_>>>20|_<<12,A=A+G|0,Q^=A,Q=Q>>>16|Q<<16,de=de+Q|0,G^=de,G=G>>>20|G<<12,E=E+W|0,k^=E,k=k>>>16|k<<16,b=b+k|0,W^=b,W=W>>>20|W<<12,A=A+G|0,Q^=A,Q=Q>>>24|Q<<8,de=de+Q|0,G^=de,G=G>>>25|G<<7,E=E+W|0,k^=E,k=k>>>24|k<<8,b=b+k|0,W^=b,W=W>>>25|W<<7,O=O+_|0,ee^=O,ee=ee>>>24|ee<<8,ue=ue+ee|0,_^=ue,_=_>>>25|_<<7,j=j+u|0,C^=j,C=C>>>24|C<<8,se=se+C|0,u^=se,u=u>>>25|u<<7,j=j+_|0,k^=j,k=k>>>16|k<<16,de=de+k|0,_^=de,_=_>>>20|_<<12,O=O+G|0,C^=O,C=C>>>16|C<<16,b=b+C|0,G^=b,G=G>>>20|G<<12,A=A+W|0,ee^=A,ee=ee>>>16|ee<<16,se=se+ee|0,W^=se,W=W>>>20|W<<12,E=E+u|0,Q^=E,Q=Q>>>16|Q<<16,ue=ue+Q|0,u^=ue,u=u>>>20|u<<12,A=A+W|0,ee^=A,ee=ee>>>24|ee<<8,se=se+ee|0,W^=se,W=W>>>25|W<<7,E=E+u|0,Q^=E,Q=Q>>>24|Q<<8,ue=ue+Q|0,u^=ue,u=u>>>25|u<<7,O=O+G|0,C^=O,C=C>>>24|C<<8,b=b+C|0,G^=b,G=G>>>25|G<<7,j=j+_|0,k^=j,k=k>>>24|k<<8,de=de+k|0,_^=de,_=_>>>25|_<<7;Zt.writeUint32LE(j+s|0,i,0),Zt.writeUint32LE(O+o|0,i,4),Zt.writeUint32LE(A+c|0,i,8),Zt.writeUint32LE(E+d|0,i,12),Zt.writeUint32LE(u+f|0,i,16),Zt.writeUint32LE(_+y|0,i,20),Zt.writeUint32LE(G+g|0,i,24),Zt.writeUint32LE(W+m|0,i,28),Zt.writeUint32LE(se+D|0,i,32),Zt.writeUint32LE(ue+I|0,i,36),Zt.writeUint32LE(de+T|0,i,40),Zt.writeUint32LE(b+P|0,i,44),Zt.writeUint32LE(C+z|0,i,48),Zt.writeUint32LE(ee+H|0,i,52),Zt.writeUint32LE(Q+ie|0,i,56),Zt.writeUint32LE(k+U|0,i,60)}function Fd(i,e,t,s,o){if(o===void 0&&(o=0),i.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(s.length>>=8,e++;if(s>0)throw new Error("ChaCha: counter overflow")}var zd={},Fi={};Object.defineProperty(Fi,"__esModule",{value:!0});function X_(i,e,t){return~(i-1)&e|i-1&t}Fi.select=X_;function Z_(i,e){return(i|0)-(e|0)-1>>>31&1}Fi.lessOrEqual=Z_;function Bd(i,e){if(i.length!==e.length)return 0;for(var t=0,s=0;s>>8}Fi.compare=Bd;function e1(i,e){return i.length===0||e.length===0?!1:Bd(i,e)!==0}Fi.equal=e1;(function(i){Object.defineProperty(i,"__esModule",{value:!0});var e=Fi,t=Cr;i.DIGEST_LENGTH=16;var s=function(){function d(f){this.digestLength=i.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 y=f[0]|f[1]<<8;this._r[0]=y&8191;var g=f[2]|f[3]<<8;this._r[1]=(y>>>13|g<<3)&8191;var m=f[4]|f[5]<<8;this._r[2]=(g>>>10|m<<6)&7939;var D=f[6]|f[7]<<8;this._r[3]=(m>>>7|D<<9)&8191;var I=f[8]|f[9]<<8;this._r[4]=(D>>>4|I<<12)&255,this._r[5]=I>>>1&8190;var T=f[10]|f[11]<<8;this._r[6]=(I>>>14|T<<2)&8191;var P=f[12]|f[13]<<8;this._r[7]=(T>>>11|P<<5)&8065;var z=f[14]|f[15]<<8;this._r[8]=(P>>>8|z<<8)&8191,this._r[9]=z>>>5&127,this._pad[0]=f[16]|f[17]<<8,this._pad[1]=f[18]|f[19]<<8,this._pad[2]=f[20]|f[21]<<8,this._pad[3]=f[22]|f[23]<<8,this._pad[4]=f[24]|f[25]<<8,this._pad[5]=f[26]|f[27]<<8,this._pad[6]=f[28]|f[29]<<8,this._pad[7]=f[30]|f[31]<<8}return d.prototype._blocks=function(f,y,g){for(var m=this._fin?0:2048,D=this._h[0],I=this._h[1],T=this._h[2],P=this._h[3],z=this._h[4],H=this._h[5],ie=this._h[6],U=this._h[7],j=this._h[8],O=this._h[9],A=this._r[0],E=this._r[1],u=this._r[2],_=this._r[3],G=this._r[4],W=this._r[5],se=this._r[6],ue=this._r[7],de=this._r[8],b=this._r[9];g>=16;){var C=f[y+0]|f[y+1]<<8;D+=C&8191;var ee=f[y+2]|f[y+3]<<8;I+=(C>>>13|ee<<3)&8191;var Q=f[y+4]|f[y+5]<<8;T+=(ee>>>10|Q<<6)&8191;var k=f[y+6]|f[y+7]<<8;P+=(Q>>>7|k<<9)&8191;var V=f[y+8]|f[y+9]<<8;z+=(k>>>4|V<<12)&8191,H+=V>>>1&8191;var J=f[y+10]|f[y+11]<<8;ie+=(V>>>14|J<<2)&8191;var re=f[y+12]|f[y+13]<<8;U+=(J>>>11|re<<5)&8191;var _e=f[y+14]|f[y+15]<<8;j+=(re>>>8|_e<<8)&8191,O+=_e>>>5|m;var oe=0,be=oe;be+=D*A,be+=I*(5*b),be+=T*(5*de),be+=P*(5*ue),be+=z*(5*se),oe=be>>>13,be&=8191,be+=H*(5*W),be+=ie*(5*G),be+=U*(5*_),be+=j*(5*u),be+=O*(5*E),oe+=be>>>13,be&=8191;var le=oe;le+=D*E,le+=I*A,le+=T*(5*b),le+=P*(5*de),le+=z*(5*ue),oe=le>>>13,le&=8191,le+=H*(5*se),le+=ie*(5*W),le+=U*(5*G),le+=j*(5*_),le+=O*(5*u),oe+=le>>>13,le&=8191;var me=oe;me+=D*u,me+=I*E,me+=T*A,me+=P*(5*b),me+=z*(5*de),oe=me>>>13,me&=8191,me+=H*(5*ue),me+=ie*(5*se),me+=U*(5*W),me+=j*(5*G),me+=O*(5*_),oe+=me>>>13,me&=8191;var B=oe;B+=D*_,B+=I*u,B+=T*E,B+=P*A,B+=z*(5*b),oe=B>>>13,B&=8191,B+=H*(5*de),B+=ie*(5*ue),B+=U*(5*se),B+=j*(5*W),B+=O*(5*G),oe+=B>>>13,B&=8191;var F=oe;F+=D*G,F+=I*_,F+=T*u,F+=P*E,F+=z*A,oe=F>>>13,F&=8191,F+=H*(5*b),F+=ie*(5*de),F+=U*(5*ue),F+=j*(5*se),F+=O*(5*W),oe+=F>>>13,F&=8191;var L=oe;L+=D*W,L+=I*G,L+=T*_,L+=P*u,L+=z*E,oe=L>>>13,L&=8191,L+=H*A,L+=ie*(5*b),L+=U*(5*de),L+=j*(5*ue),L+=O*(5*se),oe+=L>>>13,L&=8191;var l=oe;l+=D*se,l+=I*W,l+=T*G,l+=P*_,l+=z*u,oe=l>>>13,l&=8191,l+=H*E,l+=ie*A,l+=U*(5*b),l+=j*(5*de),l+=O*(5*ue),oe+=l>>>13,l&=8191;var R=oe;R+=D*ue,R+=I*se,R+=T*W,R+=P*G,R+=z*_,oe=R>>>13,R&=8191,R+=H*u,R+=ie*E,R+=U*A,R+=j*(5*b),R+=O*(5*de),oe+=R>>>13,R&=8191;var ae=oe;ae+=D*de,ae+=I*ue,ae+=T*se,ae+=P*W,ae+=z*G,oe=ae>>>13,ae&=8191,ae+=H*_,ae+=ie*u,ae+=U*E,ae+=j*A,ae+=O*(5*b),oe+=ae>>>13,ae&=8191;var fe=oe;fe+=D*b,fe+=I*de,fe+=T*ue,fe+=P*se,fe+=z*W,oe=fe>>>13,fe&=8191,fe+=H*G,fe+=ie*_,fe+=U*u,fe+=j*E,fe+=O*A,oe+=fe>>>13,fe&=8191,oe=(oe<<2)+oe|0,oe=oe+be|0,be=oe&8191,oe=oe>>>13,le+=oe,D=be,I=le,T=me,P=B,z=F,H=L,ie=l,U=R,j=ae,O=fe,y+=16,g-=16}this._h[0]=D,this._h[1]=I,this._h[2]=T,this._h[3]=P,this._h[4]=z,this._h[5]=H,this._h[6]=ie,this._h[7]=U,this._h[8]=j,this._h[9]=O},d.prototype.finish=function(f,y){y===void 0&&(y=0);var g=new Uint16Array(10),m,D,I,T;if(this._leftover){for(T=this._leftover,this._buffer[T++]=1;T<16;T++)this._buffer[T]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(m=this._h[1]>>>13,this._h[1]&=8191,T=2;T<10;T++)this._h[T]+=m,m=this._h[T]>>>13,this._h[T]&=8191;for(this._h[0]+=m*5,m=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=m,m=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=m,g[0]=this._h[0]+5,m=g[0]>>>13,g[0]&=8191,T=1;T<10;T++)g[T]=this._h[T]+m,m=g[T]>>>13,g[T]&=8191;for(g[9]-=8192,D=(m^1)-1,T=0;T<10;T++)g[T]&=D;for(D=~D,T=0;T<10;T++)this._h[T]=this._h[T]&D|g[T];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,I=this._h[0]+this._pad[0],this._h[0]=I&65535,T=1;T<8;T++)I=(this._h[T]+this._pad[T]|0)+(I>>>16)|0,this._h[T]=I&65535;return f[y+0]=this._h[0]>>>0,f[y+1]=this._h[0]>>>8,f[y+2]=this._h[1]>>>0,f[y+3]=this._h[1]>>>8,f[y+4]=this._h[2]>>>0,f[y+5]=this._h[2]>>>8,f[y+6]=this._h[3]>>>0,f[y+7]=this._h[3]>>>8,f[y+8]=this._h[4]>>>0,f[y+9]=this._h[4]>>>8,f[y+10]=this._h[5]>>>0,f[y+11]=this._h[5]>>>8,f[y+12]=this._h[6]>>>0,f[y+13]=this._h[6]>>>8,f[y+14]=this._h[7]>>>0,f[y+15]=this._h[7]>>>8,this._finished=!0,this},d.prototype.update=function(f){var y=0,g=f.length,m;if(this._leftover){m=16-this._leftover,m>g&&(m=g);for(var D=0;D=16&&(m=g-g%16,this._blocks(f,y,m),y+=m,g-=m),g){for(var D=0;D16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var T=new Uint8Array(16);T.set(g,T.length-g.length);var P=new Uint8Array(32);e.stream(this._key,T,P,4);var z=m.length+this.tagLength,H;if(I){if(I.length!==z)throw new Error("ChaCha20Poly1305: incorrect destination length");H=I}else H=new Uint8Array(z);return e.streamXOR(this._key,T,m,H,4),this._authenticate(H.subarray(H.length-this.tagLength,H.length),P,H.subarray(0,H.length-this.tagLength),D),s.wipe(T),H},y.prototype.open=function(g,m,D,I){if(g.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(m.length0&&T.update(d.subarray(I.length%16))),T.update(D),D.length%16>0&&T.update(d.subarray(D.length%16));var P=new Uint8Array(8);I&&o.writeUint64LE(I.length,P),T.update(P),o.writeUint64LE(D.length,P),T.update(P);for(var z=T.digest(),H=0;Hthis.blockSize?this._inner.update(t).finish(s).clean():s.set(t);for(var o=0;o1&&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},i.prototype.expand=function(e){for(var t=new Uint8Array(e),s=0;s256)throw new Error("randomString charset is too long");let I="";const T=m.length,P=256-256%T;for(;g>0;){const z=o(Math.ceil(g*256/P),D);for(let H=0;H0;H++){const ie=z[H];ie0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=y[m++],g--;this._bufferLength===this.blockSize&&(c(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(g>=this.blockSize&&(m=c(this._temp,this._state,y,m,g),g%=this.blockSize);g>0;)this._buffer[this._bufferLength++]=y[m++],g--;return this},f.prototype.finish=function(y){if(!this._finished){var g=this._bytesHashed,m=this._bufferLength,D=g/536870912|0,I=g<<3,T=g%64<56?64:128;this._buffer[m]=128;for(var P=m+1;P0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},f.prototype.restoreState=function(y){return this._state.set(y.state),this._bufferLength=y.bufferLength,y.buffer&&this._buffer.set(y.buffer),this._bytesHashed=y.bytesHashed,this._finished=!1,this},f.prototype.cleanSavedState=function(y){t.wipe(y.state),y.buffer&&t.wipe(y.buffer),y.bufferLength=0,y.bytesHashed=0},f}();i.SHA256=s;var o=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 c(f,y,g,m,D){for(;D>=64;){for(var I=y[0],T=y[1],P=y[2],z=y[3],H=y[4],ie=y[5],U=y[6],j=y[7],O=0;O<16;O++){var A=m+O*4;f[O]=e.readUint32BE(g,A)}for(var O=16;O<64;O++){var E=f[O-2],u=(E>>>17|E<<15)^(E>>>19|E<<13)^E>>>10;E=f[O-15];var _=(E>>>7|E<<25)^(E>>>18|E<<14)^E>>>3;f[O]=(u+f[O-7]|0)+(_+f[O-16]|0)}for(var O=0;O<64;O++){var u=(((H>>>6|H<<26)^(H>>>11|H<<21)^(H>>>25|H<<7))+(H&ie^~H&U)|0)+(j+(o[O]+f[O]|0)|0)|0,_=((I>>>2|I<<30)^(I>>>13|I<<19)^(I>>>22|I<<10))+(I&T^I&P^T&P)|0;j=U,U=ie,ie=H,H=z+u|0,z=P,P=T,T=I,I=u+_|0}y[0]+=I,y[1]+=T,y[2]+=P,y[3]+=z,y[4]+=H,y[5]+=ie,y[6]+=U,y[7]+=j,m+=64,D-=64}return m}function d(f){var y=new s;y.update(f);var g=y.digest();return y.clean(),g}i.hash=d})(na);var Tu={};(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.sharedKey=i.generateKeyPair=i.generateKeyPairFromSeed=i.scalarMultBase=i.scalarMult=i.SHARED_KEY_LENGTH=i.SECRET_KEY_LENGTH=i.PUBLIC_KEY_LENGTH=void 0;const e=Fn,t=Cr;i.PUBLIC_KEY_LENGTH=32,i.SECRET_KEY_LENGTH=32,i.SHARED_KEY_LENGTH=32;function s(O){const A=new Float64Array(16);if(O)for(let E=0;E>16&1),E[W-1]&=65535;E[15]=u[15]-32767-(E[14]>>16&1);const G=E[15]>>16&1;E[14]&=65535,f(u,E,1-G)}for(let _=0;_<16;_++)O[2*_]=u[_]&255,O[2*_+1]=u[_]>>8}function g(O,A){for(let E=0;E<16;E++)O[E]=A[2*E]+(A[2*E+1]<<8);O[15]&=32767}function m(O,A,E){for(let u=0;u<16;u++)O[u]=A[u]+E[u]}function D(O,A,E){for(let u=0;u<16;u++)O[u]=A[u]-E[u]}function I(O,A,E){let u,_,G=0,W=0,se=0,ue=0,de=0,b=0,C=0,ee=0,Q=0,k=0,V=0,J=0,re=0,_e=0,oe=0,be=0,le=0,me=0,B=0,F=0,L=0,l=0,R=0,ae=0,fe=0,Ie=0,Be=0,ke=0,Me=0,pt=0,gt=0,qe=E[0],xe=E[1],Ne=E[2],Ue=E[3],Fe=E[4],Pe=E[5],Le=E[6],Se=E[7],Ce=E[8],He=E[9],Oe=E[10],Ve=E[11],We=E[12],et=E[13],tt=E[14],Qe=E[15];u=A[0],G+=u*qe,W+=u*xe,se+=u*Ne,ue+=u*Ue,de+=u*Fe,b+=u*Pe,C+=u*Le,ee+=u*Se,Q+=u*Ce,k+=u*He,V+=u*Oe,J+=u*Ve,re+=u*We,_e+=u*et,oe+=u*tt,be+=u*Qe,u=A[1],W+=u*qe,se+=u*xe,ue+=u*Ne,de+=u*Ue,b+=u*Fe,C+=u*Pe,ee+=u*Le,Q+=u*Se,k+=u*Ce,V+=u*He,J+=u*Oe,re+=u*Ve,_e+=u*We,oe+=u*et,be+=u*tt,le+=u*Qe,u=A[2],se+=u*qe,ue+=u*xe,de+=u*Ne,b+=u*Ue,C+=u*Fe,ee+=u*Pe,Q+=u*Le,k+=u*Se,V+=u*Ce,J+=u*He,re+=u*Oe,_e+=u*Ve,oe+=u*We,be+=u*et,le+=u*tt,me+=u*Qe,u=A[3],ue+=u*qe,de+=u*xe,b+=u*Ne,C+=u*Ue,ee+=u*Fe,Q+=u*Pe,k+=u*Le,V+=u*Se,J+=u*Ce,re+=u*He,_e+=u*Oe,oe+=u*Ve,be+=u*We,le+=u*et,me+=u*tt,B+=u*Qe,u=A[4],de+=u*qe,b+=u*xe,C+=u*Ne,ee+=u*Ue,Q+=u*Fe,k+=u*Pe,V+=u*Le,J+=u*Se,re+=u*Ce,_e+=u*He,oe+=u*Oe,be+=u*Ve,le+=u*We,me+=u*et,B+=u*tt,F+=u*Qe,u=A[5],b+=u*qe,C+=u*xe,ee+=u*Ne,Q+=u*Ue,k+=u*Fe,V+=u*Pe,J+=u*Le,re+=u*Se,_e+=u*Ce,oe+=u*He,be+=u*Oe,le+=u*Ve,me+=u*We,B+=u*et,F+=u*tt,L+=u*Qe,u=A[6],C+=u*qe,ee+=u*xe,Q+=u*Ne,k+=u*Ue,V+=u*Fe,J+=u*Pe,re+=u*Le,_e+=u*Se,oe+=u*Ce,be+=u*He,le+=u*Oe,me+=u*Ve,B+=u*We,F+=u*et,L+=u*tt,l+=u*Qe,u=A[7],ee+=u*qe,Q+=u*xe,k+=u*Ne,V+=u*Ue,J+=u*Fe,re+=u*Pe,_e+=u*Le,oe+=u*Se,be+=u*Ce,le+=u*He,me+=u*Oe,B+=u*Ve,F+=u*We,L+=u*et,l+=u*tt,R+=u*Qe,u=A[8],Q+=u*qe,k+=u*xe,V+=u*Ne,J+=u*Ue,re+=u*Fe,_e+=u*Pe,oe+=u*Le,be+=u*Se,le+=u*Ce,me+=u*He,B+=u*Oe,F+=u*Ve,L+=u*We,l+=u*et,R+=u*tt,ae+=u*Qe,u=A[9],k+=u*qe,V+=u*xe,J+=u*Ne,re+=u*Ue,_e+=u*Fe,oe+=u*Pe,be+=u*Le,le+=u*Se,me+=u*Ce,B+=u*He,F+=u*Oe,L+=u*Ve,l+=u*We,R+=u*et,ae+=u*tt,fe+=u*Qe,u=A[10],V+=u*qe,J+=u*xe,re+=u*Ne,_e+=u*Ue,oe+=u*Fe,be+=u*Pe,le+=u*Le,me+=u*Se,B+=u*Ce,F+=u*He,L+=u*Oe,l+=u*Ve,R+=u*We,ae+=u*et,fe+=u*tt,Ie+=u*Qe,u=A[11],J+=u*qe,re+=u*xe,_e+=u*Ne,oe+=u*Ue,be+=u*Fe,le+=u*Pe,me+=u*Le,B+=u*Se,F+=u*Ce,L+=u*He,l+=u*Oe,R+=u*Ve,ae+=u*We,fe+=u*et,Ie+=u*tt,Be+=u*Qe,u=A[12],re+=u*qe,_e+=u*xe,oe+=u*Ne,be+=u*Ue,le+=u*Fe,me+=u*Pe,B+=u*Le,F+=u*Se,L+=u*Ce,l+=u*He,R+=u*Oe,ae+=u*Ve,fe+=u*We,Ie+=u*et,Be+=u*tt,ke+=u*Qe,u=A[13],_e+=u*qe,oe+=u*xe,be+=u*Ne,le+=u*Ue,me+=u*Fe,B+=u*Pe,F+=u*Le,L+=u*Se,l+=u*Ce,R+=u*He,ae+=u*Oe,fe+=u*Ve,Ie+=u*We,Be+=u*et,ke+=u*tt,Me+=u*Qe,u=A[14],oe+=u*qe,be+=u*xe,le+=u*Ne,me+=u*Ue,B+=u*Fe,F+=u*Pe,L+=u*Le,l+=u*Se,R+=u*Ce,ae+=u*He,fe+=u*Oe,Ie+=u*Ve,Be+=u*We,ke+=u*et,Me+=u*tt,pt+=u*Qe,u=A[15],be+=u*qe,le+=u*xe,me+=u*Ne,B+=u*Ue,F+=u*Fe,L+=u*Pe,l+=u*Le,R+=u*Se,ae+=u*Ce,fe+=u*He,Ie+=u*Oe,Be+=u*Ve,ke+=u*We,Me+=u*et,pt+=u*tt,gt+=u*Qe,G+=38*le,W+=38*me,se+=38*B,ue+=38*F,de+=38*L,b+=38*l,C+=38*R,ee+=38*ae,Q+=38*fe,k+=38*Ie,V+=38*Be,J+=38*ke,re+=38*Me,_e+=38*pt,oe+=38*gt,_=1,u=G+_+65535,_=Math.floor(u/65536),G=u-_*65536,u=W+_+65535,_=Math.floor(u/65536),W=u-_*65536,u=se+_+65535,_=Math.floor(u/65536),se=u-_*65536,u=ue+_+65535,_=Math.floor(u/65536),ue=u-_*65536,u=de+_+65535,_=Math.floor(u/65536),de=u-_*65536,u=b+_+65535,_=Math.floor(u/65536),b=u-_*65536,u=C+_+65535,_=Math.floor(u/65536),C=u-_*65536,u=ee+_+65535,_=Math.floor(u/65536),ee=u-_*65536,u=Q+_+65535,_=Math.floor(u/65536),Q=u-_*65536,u=k+_+65535,_=Math.floor(u/65536),k=u-_*65536,u=V+_+65535,_=Math.floor(u/65536),V=u-_*65536,u=J+_+65535,_=Math.floor(u/65536),J=u-_*65536,u=re+_+65535,_=Math.floor(u/65536),re=u-_*65536,u=_e+_+65535,_=Math.floor(u/65536),_e=u-_*65536,u=oe+_+65535,_=Math.floor(u/65536),oe=u-_*65536,u=be+_+65535,_=Math.floor(u/65536),be=u-_*65536,G+=_-1+37*(_-1),_=1,u=G+_+65535,_=Math.floor(u/65536),G=u-_*65536,u=W+_+65535,_=Math.floor(u/65536),W=u-_*65536,u=se+_+65535,_=Math.floor(u/65536),se=u-_*65536,u=ue+_+65535,_=Math.floor(u/65536),ue=u-_*65536,u=de+_+65535,_=Math.floor(u/65536),de=u-_*65536,u=b+_+65535,_=Math.floor(u/65536),b=u-_*65536,u=C+_+65535,_=Math.floor(u/65536),C=u-_*65536,u=ee+_+65535,_=Math.floor(u/65536),ee=u-_*65536,u=Q+_+65535,_=Math.floor(u/65536),Q=u-_*65536,u=k+_+65535,_=Math.floor(u/65536),k=u-_*65536,u=V+_+65535,_=Math.floor(u/65536),V=u-_*65536,u=J+_+65535,_=Math.floor(u/65536),J=u-_*65536,u=re+_+65535,_=Math.floor(u/65536),re=u-_*65536,u=_e+_+65535,_=Math.floor(u/65536),_e=u-_*65536,u=oe+_+65535,_=Math.floor(u/65536),oe=u-_*65536,u=be+_+65535,_=Math.floor(u/65536),be=u-_*65536,G+=_-1+37*(_-1),O[0]=G,O[1]=W,O[2]=se,O[3]=ue,O[4]=de,O[5]=b,O[6]=C,O[7]=ee,O[8]=Q,O[9]=k,O[10]=V,O[11]=J,O[12]=re,O[13]=_e,O[14]=oe,O[15]=be}function T(O,A){I(O,A,A)}function P(O,A){const E=s();for(let u=0;u<16;u++)E[u]=A[u];for(let u=253;u>=0;u--)T(E,E),u!==2&&u!==4&&I(E,E,A);for(let u=0;u<16;u++)O[u]=E[u]}function z(O,A){const E=new Uint8Array(32),u=new Float64Array(80),_=s(),G=s(),W=s(),se=s(),ue=s(),de=s();for(let Q=0;Q<31;Q++)E[Q]=O[Q];E[31]=O[31]&127|64,E[0]&=248,g(u,A);for(let Q=0;Q<16;Q++)G[Q]=u[Q];_[0]=se[0]=1;for(let Q=254;Q>=0;--Q){const k=E[Q>>>3]>>>(Q&7)&1;f(_,G,k),f(W,se,k),m(ue,_,W),D(_,_,W),m(W,G,se),D(G,G,se),T(se,ue),T(de,_),I(_,W,_),I(W,G,ue),m(ue,_,W),D(_,_,W),T(G,_),D(W,se,de),I(_,W,c),m(_,_,se),I(W,W,_),I(_,se,de),I(se,G,u),T(G,ue),f(_,G,k),f(W,se,k)}for(let Q=0;Q<16;Q++)u[Q+16]=_[Q],u[Q+32]=W[Q],u[Q+48]=G[Q],u[Q+64]=se[Q];const b=u.subarray(32),C=u.subarray(16);P(b,b),I(C,C,b);const ee=new Uint8Array(32);return y(ee,C),ee}i.scalarMult=z;function H(O){return z(O,o)}i.scalarMultBase=H;function ie(O){if(O.length!==i.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${i.SECRET_KEY_LENGTH} bytes`);const A=new Uint8Array(O);return{publicKey:H(A),secretKey:A}}i.generateKeyPairFromSeed=ie;function U(O){const A=(0,e.randomBytes)(32,O),E=ie(A);return(0,t.wipe)(A),E}i.generateKeyPair=U;function j(O,A,E=!1){if(O.length!==i.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(A.length!==i.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const u=z(O,A);if(E){let _=0;for(let G=0;Go+c.length,0));const t=kd(e);let s=0;for(const o of i)t.set(o,s),s+=o.length;return Ru(t)}function p1(i,e){if(i.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),s=0;s>>0,O=new Uint8Array(j);ie!==U;){for(var A=P[ie],E=0,u=j-1;(A!==0||E>>0,O[u]=A%f>>>0,A=A/f>>>0;if(A!==0)throw new Error("Non-zero carry");H=E,ie++}for(var _=j-H;_!==j&&O[_]===0;)_++;for(var G=y.repeat(z);_>>0,j=new Uint8Array(U);P[z];){var O=t[P.charCodeAt(z)];if(O===255)return;for(var A=0,E=U-1;(O!==0||A>>0,j[E]=O%256>>>0,O=O/256>>>0;if(O!==0)throw new Error("Non-zero carry");ie=A,z++}if(P[z]!==" "){for(var u=U-ie;u!==U&&j[u]===0;)u++;for(var _=new Uint8Array(H+(U-u)),G=H;u!==U;)_[G++]=j[u++];return _}}}function T(P){var z=I(P);if(z)return z;throw new Error(`Non-${e} character`)}return{encode:D,decodeUnsafe:I,decode:T}}var g1=p1,y1=g1;const v1=i=>{if(i instanceof Uint8Array&&i.constructor.name==="Uint8Array")return i;if(i instanceof ArrayBuffer)return new Uint8Array(i);if(ArrayBuffer.isView(i))return new Uint8Array(i.buffer,i.byteOffset,i.byteLength);throw new Error("Unknown type, must be binary type")},m1=i=>new TextEncoder().encode(i),w1=i=>new TextDecoder().decode(i);class _1{constructor(e,t,s){this.name=e,this.prefix=t,this.baseEncode=s}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class b1{constructor(e,t,s){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=s}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 Vd(this,e)}}class E1{constructor(e){this.decoders=e}or(e){return Vd(this,e)}decode(e){const t=e[0],s=this.decoders[t];if(s)return s.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Vd=(i,e)=>new E1({...i.decoders||{[i.prefix]:i},...e.decoders||{[e.prefix]:e}});class D1{constructor(e,t,s,o){this.name=e,this.prefix=t,this.baseEncode=s,this.baseDecode=o,this.encoder=new _1(e,t,s),this.decoder=new b1(e,t,o)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const sa=({name:i,prefix:e,encode:t,decode:s})=>new D1(i,e,t,s),Os=({prefix:i,name:e,alphabet:t})=>{const{encode:s,decode:o}=y1(t,e);return sa({prefix:i,name:e,encode:s,decode:c=>v1(o(c))})},S1=(i,e,t,s)=>{const o={};for(let m=0;m=8&&(f-=8,d[g++]=255&y>>f)}if(f>=t||255&y<<8-f)throw new SyntaxError("Unexpected end of data");return d},I1=(i,e,t)=>{const s=e[e.length-1]==="=",o=(1<t;)d-=t,c+=e[o&f>>d];if(d&&(c+=e[o&f<sa({prefix:e,name:i,encode(o){return I1(o,s,t)},decode(o){return S1(o,s,t,i)}}),x1=sa({prefix:"\0",name:"identity",encode:i=>w1(i),decode:i=>m1(i)}),O1=Object.freeze(Object.defineProperty({__proto__:null,identity:x1},Symbol.toStringTag,{value:"Module"})),P1=Yt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),C1=Object.freeze(Object.defineProperty({__proto__:null,base2:P1},Symbol.toStringTag,{value:"Module"})),A1=Yt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),T1=Object.freeze(Object.defineProperty({__proto__:null,base8:A1},Symbol.toStringTag,{value:"Module"})),R1=Os({prefix:"9",name:"base10",alphabet:"0123456789"}),N1=Object.freeze(Object.defineProperty({__proto__:null,base10:R1},Symbol.toStringTag,{value:"Module"})),U1=Yt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),L1=Yt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),$1=Object.freeze(Object.defineProperty({__proto__:null,base16:U1,base16upper:L1},Symbol.toStringTag,{value:"Module"})),M1=Yt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),j1=Yt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),q1=Yt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),F1=Yt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),z1=Yt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),B1=Yt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),H1=Yt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),K1=Yt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),k1=Yt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),V1=Object.freeze(Object.defineProperty({__proto__:null,base32:M1,base32hex:z1,base32hexpad:H1,base32hexpadupper:K1,base32hexupper:B1,base32pad:q1,base32padupper:F1,base32upper:j1,base32z:k1},Symbol.toStringTag,{value:"Module"})),G1=Os({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),W1=Os({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),Y1=Object.freeze(Object.defineProperty({__proto__:null,base36:G1,base36upper:W1},Symbol.toStringTag,{value:"Module"})),J1=Os({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Q1=Os({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),X1=Object.freeze(Object.defineProperty({__proto__:null,base58btc:J1,base58flickr:Q1},Symbol.toStringTag,{value:"Module"})),Z1=Yt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),eb=Yt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),tb=Yt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),rb=Yt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),ib=Object.freeze(Object.defineProperty({__proto__:null,base64:Z1,base64pad:eb,base64url:tb,base64urlpad:rb},Symbol.toStringTag,{value:"Module"})),Gd=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),nb=Gd.reduce((i,e,t)=>(i[t]=e,i),[]),sb=Gd.reduce((i,e,t)=>(i[e.codePointAt(0)]=t,i),[]);function ob(i){return i.reduce((e,t)=>(e+=nb[t],e),"")}function ab(i){const e=[];for(const t of i){const s=sb[t.codePointAt(0)];if(s===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(s)}return new Uint8Array(e)}const cb=sa({prefix:"🚀",name:"base256emoji",encode:ob,decode:ab}),ub=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:cb},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const Xl={...O1,...C1,...T1,...N1,...$1,...V1,...Y1,...X1,...ib,...ub};function Wd(i,e,t,s){return{name:i,prefix:e,encoder:{name:i,prefix:e,encode:t},decoder:{decode:s}}}const Zl=Wd("utf8","u",i=>"u"+new TextDecoder("utf8").decode(i),i=>new TextEncoder().encode(i.substring(1))),Lc=Wd("ascii","a",i=>{let e="a";for(let t=0;t{i=i.substring(1);const e=kd(i.length);for(let t=0;t"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new pb:typeof navigator<"u"?nf(navigator.userAgent):bb()}function wb(i){return i!==""&&vb.reduce(function(e,t){var s=t[0],o=t[1];if(e)return e;var c=o.exec(i);return!!c&&[s,c]},!1)}function nf(i){var e=wb(i);if(!e)return null;var t=e[0],s=e[1];if(t==="searchbot")return new db;var o=s[1]&&s[1].split(".").join("_").split("_").slice(0,3);o?o.length=0;f--)(d=i[f])&&(c=(o<3?d(c):o>3?d(e,t,c):d(e,t))||c);return o>3&&c&&Object.defineProperty(e,t,c),c}function xb(i,e){return function(t,s){e(t,s,i)}}function Ob(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)}function Pb(i,e,t,s){function o(c){return c instanceof t?c:new t(function(d){d(c)})}return new(t||(t=Promise))(function(c,d){function f(m){try{g(s.next(m))}catch(D){d(D)}}function y(m){try{g(s.throw(m))}catch(D){d(D)}}function g(m){m.done?c(m.value):o(m.value).then(f,y)}g((s=s.apply(i,e||[])).next())})}function Cb(i,e){var t={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},s,o,c,d;return d={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function f(g){return function(m){return y([g,m])}}function y(g){if(s)throw new TypeError("Generator is already executing.");for(;t;)try{if(s=1,o&&(c=g[0]&2?o.return:g[0]?o.throw||((c=o.return)&&c.call(o),0):o.next)&&!(c=c.call(o,g[1])).done)return c;switch(o=0,c&&(g=[g[0]&2,c.value]),g[0]){case 0:case 1:c=g;break;case 4:return t.label++,{value:g[1],done:!1};case 5:t.label++,o=g[1],g=[0];continue;case 7:g=t.ops.pop(),t.trys.pop();continue;default:if(c=t.trys,!(c=c.length>0&&c[c.length-1])&&(g[0]===6||g[0]===2)){t=0;continue}if(g[0]===3&&(!c||g[1]>c[0]&&g[1]=i.length&&(i=void 0),{value:i&&i[s++],done:!i}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Jd(i,e){var t=typeof Symbol=="function"&&i[Symbol.iterator];if(!t)return i;var s=t.call(i),o,c=[],d;try{for(;(e===void 0||e-- >0)&&!(o=s.next()).done;)c.push(o.value)}catch(f){d={error:f}}finally{try{o&&!o.done&&(t=s.return)&&t.call(s)}finally{if(d)throw d.error}}return c}function Rb(){for(var i=[],e=0;e1||f(I,T)})})}function f(I,T){try{y(s[I](T))}catch(P){D(c[0][3],P)}}function y(I){I.value instanceof Es?Promise.resolve(I.value.v).then(g,m):D(c[0][2],I)}function g(I){f("next",I)}function m(I){f("throw",I)}function D(I,T){I(T),c.shift(),c.length&&f(c[0][0],c[0][1])}}function Lb(i){var e,t;return e={},s("next"),s("throw",function(o){throw o}),s("return"),e[Symbol.iterator]=function(){return this},e;function s(o,c){e[o]=i[o]?function(d){return(t=!t)?{value:Es(i[o](d)),done:o==="return"}:c?c(d):d}:c}}function $b(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=i[Symbol.asyncIterator],t;return e?e.call(i):(i=typeof fu=="function"?fu(i):i[Symbol.iterator](),t={},s("next"),s("throw"),s("return"),t[Symbol.asyncIterator]=function(){return this},t);function s(c){t[c]=i[c]&&function(d){return new Promise(function(f,y){d=i[c](d),o(f,y,d.done,d.value)})}}function o(c,d,f,y){Promise.resolve(y).then(function(g){c({value:g,done:f})},d)}}function Mb(i,e){return Object.defineProperty?Object.defineProperty(i,"raw",{value:e}):i.raw=e,i}function jb(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)Object.hasOwnProperty.call(i,t)&&(e[t]=i[t]);return e.default=i,e}function qb(i){return i&&i.__esModule?i:{default:i}}function Fb(i,e){if(!e.has(i))throw new TypeError("attempted to get private field on non-instance");return e.get(i)}function zb(i,e,t){if(!e.has(i))throw new TypeError("attempted to set private field on non-instance");return e.set(i,t),t}const Bb=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return lu},__asyncDelegator:Lb,__asyncGenerator:Ub,__asyncValues:$b,__await:Es,__awaiter:Pb,__classPrivateFieldGet:Fb,__classPrivateFieldSet:zb,__createBinding:Ab,__decorate:Ib,__exportStar:Tb,__extends:Db,__generator:Cb,__importDefault:qb,__importStar:jb,__makeTemplateObject:Mb,__metadata:Ob,__param:xb,__read:Jd,__rest:Sb,__spread:Rb,__spreadArrays:Nb,__values:fu},Symbol.toStringTag,{value:"Module"})),si=xu(Bb);var $c={},ls={},sf;function Hb(){if(sf)return ls;sf=1,Object.defineProperty(ls,"__esModule",{value:!0}),ls.delay=void 0;function i(e){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}return ls.delay=i,ls}var rn={},Mc={},nn={},of;function Kb(){return of||(of=1,Object.defineProperty(nn,"__esModule",{value:!0}),nn.ONE_THOUSAND=nn.ONE_HUNDRED=void 0,nn.ONE_HUNDRED=100,nn.ONE_THOUSAND=1e3),nn}var jc={},af;function kb(){return af||(af=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.ONE_YEAR=i.FOUR_WEEKS=i.THREE_WEEKS=i.TWO_WEEKS=i.ONE_WEEK=i.THIRTY_DAYS=i.SEVEN_DAYS=i.FIVE_DAYS=i.THREE_DAYS=i.ONE_DAY=i.TWENTY_FOUR_HOURS=i.TWELVE_HOURS=i.SIX_HOURS=i.THREE_HOURS=i.ONE_HOUR=i.SIXTY_MINUTES=i.THIRTY_MINUTES=i.TEN_MINUTES=i.FIVE_MINUTES=i.ONE_MINUTE=i.SIXTY_SECONDS=i.THIRTY_SECONDS=i.TEN_SECONDS=i.FIVE_SECONDS=i.ONE_SECOND=void 0,i.ONE_SECOND=1,i.FIVE_SECONDS=5,i.TEN_SECONDS=10,i.THIRTY_SECONDS=30,i.SIXTY_SECONDS=60,i.ONE_MINUTE=i.SIXTY_SECONDS,i.FIVE_MINUTES=i.ONE_MINUTE*5,i.TEN_MINUTES=i.ONE_MINUTE*10,i.THIRTY_MINUTES=i.ONE_MINUTE*30,i.SIXTY_MINUTES=i.ONE_MINUTE*60,i.ONE_HOUR=i.SIXTY_MINUTES,i.THREE_HOURS=i.ONE_HOUR*3,i.SIX_HOURS=i.ONE_HOUR*6,i.TWELVE_HOURS=i.ONE_HOUR*12,i.TWENTY_FOUR_HOURS=i.ONE_HOUR*24,i.ONE_DAY=i.TWENTY_FOUR_HOURS,i.THREE_DAYS=i.ONE_DAY*3,i.FIVE_DAYS=i.ONE_DAY*5,i.SEVEN_DAYS=i.ONE_DAY*7,i.THIRTY_DAYS=i.ONE_DAY*30,i.ONE_WEEK=i.SEVEN_DAYS,i.TWO_WEEKS=i.ONE_WEEK*2,i.THREE_WEEKS=i.ONE_WEEK*3,i.FOUR_WEEKS=i.ONE_WEEK*4,i.ONE_YEAR=i.ONE_DAY*365}(jc)),jc}var cf;function Qd(){return cf||(cf=1,function(i){Object.defineProperty(i,"__esModule",{value:!0});const e=si;e.__exportStar(Kb(),i),e.__exportStar(kb(),i)}(Mc)),Mc}var uf;function Vb(){if(uf)return rn;uf=1,Object.defineProperty(rn,"__esModule",{value:!0}),rn.fromMiliseconds=rn.toMiliseconds=void 0;const i=Qd();function e(s){return s*i.ONE_THOUSAND}rn.toMiliseconds=e;function t(s){return Math.floor(s/i.ONE_THOUSAND)}return rn.fromMiliseconds=t,rn}var hf;function Gb(){return hf||(hf=1,function(i){Object.defineProperty(i,"__esModule",{value:!0});const e=si;e.__exportStar(Hb(),i),e.__exportStar(Vb(),i)}($c)),$c}var Un={},lf;function Wb(){if(lf)return Un;lf=1,Object.defineProperty(Un,"__esModule",{value:!0}),Un.Watch=void 0;class i{constructor(){this.timestamps=new Map}start(t){if(this.timestamps.has(t))throw new Error(`Watch already started for label: ${t}`);this.timestamps.set(t,{started:Date.now()})}stop(t){const s=this.get(t);if(typeof s.elapsed<"u")throw new Error(`Watch already stopped for label: ${t}`);const o=Date.now()-s.started;this.timestamps.set(t,{started:s.started,elapsed:o})}get(t){const s=this.timestamps.get(t);if(typeof s>"u")throw new Error(`No timestamp found for label: ${t}`);return s}elapsed(t){const s=this.get(t);return s.elapsed||Date.now()-s.started}}return Un.Watch=i,Un.default=i,Un}var qc={},fs={},ff;function Yb(){if(ff)return fs;ff=1,Object.defineProperty(fs,"__esModule",{value:!0}),fs.IWatch=void 0;class i{}return fs.IWatch=i,fs}var df;function Jb(){return df||(df=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),si.__exportStar(Yb(),i)}(qc)),qc}(function(i){Object.defineProperty(i,"__esModule",{value:!0});const e=si;e.__exportStar(Gb(),i),e.__exportStar(Wb(),i),e.__exportStar(Jb(),i),e.__exportStar(Qd(),i)})(ve);var lt={};Object.defineProperty(lt,"__esModule",{value:!0});lt.getLocalStorage=lt.getLocalStorageOrThrow=lt.getCrypto=lt.getCryptoOrThrow=Xd=lt.getLocation=lt.getLocationOrThrow=Uu=lt.getNavigator=lt.getNavigatorOrThrow=Nu=lt.getDocument=lt.getDocumentOrThrow=lt.getFromWindowOrThrow=lt.getFromWindow=void 0;function un(i){let e;return typeof window<"u"&&typeof window[i]<"u"&&(e=window[i]),e}lt.getFromWindow=un;function zn(i){const e=un(i);if(!e)throw new Error(`${i} is not defined in Window`);return e}lt.getFromWindowOrThrow=zn;function Qb(){return zn("document")}lt.getDocumentOrThrow=Qb;function Xb(){return un("document")}var Nu=lt.getDocument=Xb;function Zb(){return zn("navigator")}lt.getNavigatorOrThrow=Zb;function eE(){return un("navigator")}var Uu=lt.getNavigator=eE;function tE(){return zn("location")}lt.getLocationOrThrow=tE;function rE(){return un("location")}var Xd=lt.getLocation=rE;function iE(){return zn("crypto")}lt.getCryptoOrThrow=iE;function nE(){return un("crypto")}lt.getCrypto=nE;function sE(){return zn("localStorage")}lt.getLocalStorageOrThrow=sE;function oE(){return un("localStorage")}lt.getLocalStorage=oE;var Lu={};Object.defineProperty(Lu,"__esModule",{value:!0});var Zd=Lu.getWindowMetadata=void 0;const pf=lt;function aE(){let i,e;try{i=pf.getDocumentOrThrow(),e=pf.getLocationOrThrow()}catch{return null}function t(){const D=i.getElementsByTagName("link"),I=[];for(let T=0;T-1){const H=P.getAttribute("href");if(H)if(H.toLowerCase().indexOf("https:")===-1&&H.toLowerCase().indexOf("http:")===-1&&H.indexOf("//")!==0){let ie=e.protocol+"//"+e.host;if(H.indexOf("/")===0)ie+=H;else{const U=e.pathname.split("/");U.pop();const j=U.join("/");ie+=j+"/"+H}I.push(ie)}else if(H.indexOf("//")===0){const ie=e.protocol+H;I.push(ie)}else I.push(H)}}return I}function s(...D){const I=i.getElementsByTagName("meta");for(let T=0;TP.getAttribute(H)).filter(H=>H?D.includes(H):!1);if(z.length&&z){const H=P.getAttribute("content");if(H)return H}}return""}function o(){let D=s("name","og:site_name","og:title","twitter:title");return D||(D=i.title),D}function c(){return s("description","og:description","twitter:description","keywords")}const d=o(),f=c(),y=e.origin,g=t();return{description:f,url:y,icons:g,name:d}}Zd=Lu.getWindowMetadata=aE;var Ds={},cE=i=>encodeURIComponent(i).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),ep="%[a-f0-9]{2}",gf=new RegExp("("+ep+")|([^%]+?)","gi"),yf=new RegExp("("+ep+")+","gi");function du(i,e){try{return[decodeURIComponent(i.join(""))]}catch{}if(i.length===1)return i;e=e||1;var t=i.slice(0,e),s=i.slice(e);return Array.prototype.concat.call([],du(t),du(s))}function uE(i){try{return decodeURIComponent(i)}catch{for(var e=i.match(gf)||[],t=1;t{if(!(typeof i=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[i];const t=i.indexOf(e);return t===-1?[i]:[i.slice(0,t),i.slice(t+e.length)]},dE=function(i,e){for(var t={},s=Object.keys(i),o=Array.isArray(e),c=0;cU==null,d=Symbol("encodeFragmentIdentifier");function f(U){switch(U.arrayFormat){case"index":return j=>(O,A)=>{const E=O.length;return A===void 0||U.skipNull&&A===null||U.skipEmptyString&&A===""?O:A===null?[...O,[m(j,U),"[",E,"]"].join("")]:[...O,[m(j,U),"[",m(E,U),"]=",m(A,U)].join("")]};case"bracket":return j=>(O,A)=>A===void 0||U.skipNull&&A===null||U.skipEmptyString&&A===""?O:A===null?[...O,[m(j,U),"[]"].join("")]:[...O,[m(j,U),"[]=",m(A,U)].join("")];case"colon-list-separator":return j=>(O,A)=>A===void 0||U.skipNull&&A===null||U.skipEmptyString&&A===""?O:A===null?[...O,[m(j,U),":list="].join("")]:[...O,[m(j,U),":list=",m(A,U)].join("")];case"comma":case"separator":case"bracket-separator":{const j=U.arrayFormat==="bracket-separator"?"[]=":"=";return O=>(A,E)=>E===void 0||U.skipNull&&E===null||U.skipEmptyString&&E===""?A:(E=E===null?"":E,A.length===0?[[m(O,U),j,m(E,U)].join("")]:[[A,m(E,U)].join(U.arrayFormatSeparator)])}default:return j=>(O,A)=>A===void 0||U.skipNull&&A===null||U.skipEmptyString&&A===""?O:A===null?[...O,m(j,U)]:[...O,[m(j,U),"=",m(A,U)].join("")]}}function y(U){let j;switch(U.arrayFormat){case"index":return(O,A,E)=>{if(j=/\[(\d*)\]$/.exec(O),O=O.replace(/\[\d*\]$/,""),!j){E[O]=A;return}E[O]===void 0&&(E[O]={}),E[O][j[1]]=A};case"bracket":return(O,A,E)=>{if(j=/(\[\])$/.exec(O),O=O.replace(/\[\]$/,""),!j){E[O]=A;return}if(E[O]===void 0){E[O]=[A];return}E[O]=[].concat(E[O],A)};case"colon-list-separator":return(O,A,E)=>{if(j=/(:list)$/.exec(O),O=O.replace(/:list$/,""),!j){E[O]=A;return}if(E[O]===void 0){E[O]=[A];return}E[O]=[].concat(E[O],A)};case"comma":case"separator":return(O,A,E)=>{const u=typeof A=="string"&&A.includes(U.arrayFormatSeparator),_=typeof A=="string"&&!u&&D(A,U).includes(U.arrayFormatSeparator);A=_?D(A,U):A;const G=u||_?A.split(U.arrayFormatSeparator).map(W=>D(W,U)):A===null?A:D(A,U);E[O]=G};case"bracket-separator":return(O,A,E)=>{const u=/(\[\])$/.test(O);if(O=O.replace(/\[\]$/,""),!u){E[O]=A&&D(A,U);return}const _=A===null?[]:A.split(U.arrayFormatSeparator).map(G=>D(G,U));if(E[O]===void 0){E[O]=_;return}E[O]=[].concat(E[O],_)};default:return(O,A,E)=>{if(E[O]===void 0){E[O]=A;return}E[O]=[].concat(E[O],A)}}}function g(U){if(typeof U!="string"||U.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function m(U,j){return j.encode?j.strict?e(U):encodeURIComponent(U):U}function D(U,j){return j.decode?t(U):U}function I(U){return Array.isArray(U)?U.sort():typeof U=="object"?I(Object.keys(U)).sort((j,O)=>Number(j)-Number(O)).map(j=>U[j]):U}function T(U){const j=U.indexOf("#");return j!==-1&&(U=U.slice(0,j)),U}function P(U){let j="";const O=U.indexOf("#");return O!==-1&&(j=U.slice(O)),j}function z(U){U=T(U);const j=U.indexOf("?");return j===-1?"":U.slice(j+1)}function H(U,j){return j.parseNumbers&&!Number.isNaN(Number(U))&&typeof U=="string"&&U.trim()!==""?U=Number(U):j.parseBooleans&&U!==null&&(U.toLowerCase()==="true"||U.toLowerCase()==="false")&&(U=U.toLowerCase()==="true"),U}function ie(U,j){j=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},j),g(j.arrayFormatSeparator);const O=y(j),A=Object.create(null);if(typeof U!="string"||(U=U.trim().replace(/^[?#&]/,""),!U))return A;for(const E of U.split("&")){if(E==="")continue;let[u,_]=s(j.decode?E.replace(/\+/g," "):E,"=");_=_===void 0?null:["comma","separator","bracket-separator"].includes(j.arrayFormat)?_:D(_,j),O(D(u,j),_,A)}for(const E of Object.keys(A)){const u=A[E];if(typeof u=="object"&&u!==null)for(const _ of Object.keys(u))u[_]=H(u[_],j);else A[E]=H(u,j)}return j.sort===!1?A:(j.sort===!0?Object.keys(A).sort():Object.keys(A).sort(j.sort)).reduce((E,u)=>{const _=A[u];return _&&typeof _=="object"&&!Array.isArray(_)?E[u]=I(_):E[u]=_,E},Object.create(null))}i.extract=z,i.parse=ie,i.stringify=(U,j)=>{if(!U)return"";j=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},j),g(j.arrayFormatSeparator);const O=_=>j.skipNull&&c(U[_])||j.skipEmptyString&&U[_]==="",A=f(j),E={};for(const _ of Object.keys(U))O(_)||(E[_]=U[_]);const u=Object.keys(E);return j.sort!==!1&&u.sort(j.sort),u.map(_=>{const G=U[_];return G===void 0?"":G===null?m(_,j):Array.isArray(G)?G.length===0&&j.arrayFormat==="bracket-separator"?m(_,j)+"[]":G.reduce(A(_),[]).join("&"):m(_,j)+"="+m(G,j)}).filter(_=>_.length>0).join("&")},i.parseUrl=(U,j)=>{j=Object.assign({decode:!0},j);const[O,A]=s(U,"#");return Object.assign({url:O.split("?")[0]||"",query:ie(z(U),j)},j&&j.parseFragmentIdentifier&&A?{fragmentIdentifier:D(A,j)}:{})},i.stringifyUrl=(U,j)=>{j=Object.assign({encode:!0,strict:!0,[d]:!0},j);const O=T(U.url).split("?")[0]||"",A=i.extract(U.url),E=i.parse(A,{sort:!1}),u=Object.assign(E,U.query);let _=i.stringify(u,j);_&&(_=`?${_}`);let G=P(U.url);return U.fragmentIdentifier&&(G=`#${j[d]?m(U.fragmentIdentifier,j):U.fragmentIdentifier}`),`${O}${_}${G}`},i.pick=(U,j,O)=>{O=Object.assign({parseFragmentIdentifier:!0,[d]:!1},O);const{url:A,query:E,fragmentIdentifier:u}=i.parseUrl(U,O);return i.stringifyUrl({url:A,query:o(E,j),fragmentIdentifier:u},O)},i.exclude=(U,j,O)=>{const A=Array.isArray(j)?E=>!j.includes(E):(E,u)=>!j(E,u);return i.pick(U,A,O)}})(Ds);const pE={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"}},gE=":";function yE(i){const[e,t]=i.split(gE);return{namespace:e,reference:t}}function vE(i,e=[]){const t=[];return Object.keys(i).forEach(s=>{if(e.length&&!e.includes(s))return;const o=i[s];t.push(...o.accounts)}),t}function tp(i,e){return i.includes(":")?[i]:e.chains||[]}const rp="base10",hr="base16",pu="base64pad",$u="utf8",ip=0,hn=1,mE=0,vf=1,gu=12,Mu=32;function wE(){const i=Tu.generateKeyPair();return{privateKey:lr(i.secretKey,hr),publicKey:lr(i.publicKey,hr)}}function yu(){const i=Fn.randomBytes(Mu);return lr(i,hr)}function _E(i,e){const t=Tu.sharedKey(_r(i,hr),_r(e,hr),!0),s=new o1(na.SHA256,t).expand(Mu);return lr(s,hr)}function bE(i){const e=na.hash(_r(i,hr));return lr(e,hr)}function jn(i){const e=na.hash(_r(i,$u));return lr(e,hr)}function EE(i){return _r(`${i}`,rp)}function Ps(i){return Number(lr(i,rp))}function DE(i){const e=EE(typeof i.type<"u"?i.type:ip);if(Ps(e)===hn&&typeof i.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const t=typeof i.senderPublicKey<"u"?_r(i.senderPublicKey,hr):void 0,s=typeof i.iv<"u"?_r(i.iv,hr):Fn.randomBytes(gu),o=new Cu.ChaCha20Poly1305(_r(i.symKey,hr)).seal(s,_r(i.message,$u));return IE({type:e,sealed:o,iv:s,senderPublicKey:t})}function SE(i){const e=new Cu.ChaCha20Poly1305(_r(i.symKey,hr)),{sealed:t,iv:s}=Yo(i.encoded),o=e.open(s,t);if(o===null)throw new Error("Failed to decrypt");return lr(o,$u)}function IE(i){if(Ps(i.type)===hn){if(typeof i.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return lr(uu([i.type,i.senderPublicKey,i.iv,i.sealed]),pu)}return lr(uu([i.type,i.iv,i.sealed]),pu)}function Yo(i){const e=_r(i,pu),t=e.slice(mE,vf),s=vf;if(Ps(t)===hn){const f=s+Mu,y=f+gu,g=e.slice(s,f),m=e.slice(f,y),D=e.slice(y);return{type:t,sealed:D,iv:m,senderPublicKey:g}}const o=s+gu,c=e.slice(s,o),d=e.slice(o);return{type:t,sealed:d,iv:c}}function xE(i,e){const t=Yo(i);return np({type:Ps(t.type),senderPublicKey:typeof t.senderPublicKey<"u"?lr(t.senderPublicKey,hr):void 0,receiverPublicKey:e==null?void 0:e.receiverPublicKey})}function np(i){const e=(i==null?void 0:i.type)||ip;if(e===hn){if(typeof(i==null?void 0:i.senderPublicKey)>"u")throw new Error("missing sender public key");if(typeof(i==null?void 0:i.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:i==null?void 0:i.senderPublicKey,receiverPublicKey:i==null?void 0:i.receiverPublicKey}}function mf(i){return i.type===hn&&typeof i.senderPublicKey=="string"&&typeof i.receiverPublicKey=="string"}var OE=Object.defineProperty,wf=Object.getOwnPropertySymbols,PE=Object.prototype.hasOwnProperty,CE=Object.prototype.propertyIsEnumerable,_f=(i,e,t)=>e in i?OE(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,bf=(i,e)=>{for(var t in e||(e={}))PE.call(e,t)&&_f(i,t,e[t]);if(wf)for(var t of wf(e))CE.call(e,t)&&_f(i,t,e[t]);return i};const AE="ReactNative",Pr={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},TE="js";function ju(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function Bn(){return!Nu()&&!!Uu()&&navigator.product===AE}function Hn(){return!ju()&&!!Uu()&&!!Nu()}function Cs(){return Bn()?Pr.reactNative:ju()?Pr.node:Hn()?Pr.browser:Pr.unknown}function RE(){var i;try{return Bn()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(i=global.Application)==null?void 0:i.applicationId:void 0}catch{return}}function NE(i,e){let t=Ds.parse(i);return t=bf(bf({},t),e),i=Ds.stringify(t),i}function UE(){return Zd()||{name:"",description:"",url:"",icons:[""]}}function LE(){if(Cs()===Pr.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:t,Version:s}=global.Platform;return[t,s].join("-")}const i=mb();if(i===null)return"unknown";const e=i.os?i.os.replace(" ","").toLowerCase():"unknown";return i.type==="browser"?[e,i.name,i.version].join("-"):[e,i.version].join("-")}function $E(){var i;const e=Cs();return e===Pr.browser?[e,((i=Xd())==null?void 0:i.host)||"unknown"].join(":"):e}function ME(i,e,t){const s=LE(),o=$E();return[[i,e].join("-"),[TE,t].join("-"),s,o].join("/")}function jE({protocol:i,version:e,relayUrl:t,sdkVersion:s,auth:o,projectId:c,useOnCloseEvent:d,bundleId:f}){const y=t.split("?"),g=ME(i,e,s),m={auth:o,ua:g,projectId:c,useOnCloseEvent:d||void 0,origin:f||void 0},D=NE(y[1]||"",m);return y[0]+"?"+D}function an(i,e){return i.filter(t=>e.includes(t)).length===i.length}function sp(i){return Object.fromEntries(i.entries())}function op(i){return new Map(Object.entries(i))}function $n(i=ve.FIVE_MINUTES,e){const t=ve.toMiliseconds(i||ve.FIVE_MINUTES);let s,o,c;return{resolve:d=>{c&&s&&(clearTimeout(c),s(d))},reject:d=>{c&&o&&(clearTimeout(c),o(d))},done:()=>new Promise((d,f)=>{c=setTimeout(()=>{f(new Error(e))},t),s=d,o=f})}}function Ss(i,e,t){return new Promise(async(s,o)=>{const c=setTimeout(()=>o(new Error(t)),e);try{const d=await i;s(d)}catch(d){o(d)}clearTimeout(c)})}function ap(i,e){if(typeof e=="string"&&e.startsWith(`${i}:`))return e;if(i.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(i.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: ${i}`)}function qE(i){return ap("topic",i)}function FE(i){return ap("id",i)}function cp(i){const[e,t]=i.split(":"),s={id:void 0,topic:void 0};if(e==="topic"&&typeof t=="string")s.topic=t;else if(e==="id"&&Number.isInteger(Number(t)))s.id=Number(t);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${t}`);return s}function Or(i,e){return ve.fromMiliseconds((e||Date.now())+ve.toMiliseconds(i))}function Mi(i){return Date.now()>=ve.toMiliseconds(i)}function Ut(i,e){return`${i}${e?`:${e}`:""}`}function Fc(i=[],e=[]){return[...new Set([...i,...e])]}async function zE({id:i,topic:e,wcDeepLink:t}){try{if(!t)return;const s=typeof t=="string"?JSON.parse(t):t;let o=s==null?void 0:s.href;if(typeof o!="string")return;o.endsWith("/")&&(o=o.slice(0,-1));const c=`${o}/wc?requestId=${i}&sessionTopic=${e}`,d=Cs();d===Pr.browser?c.startsWith("https://")?window.open(c,"_blank","noreferrer noopener"):window.open(c,"_self","noreferrer noopener"):d===Pr.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(c)}catch(s){console.error(s)}}async function BE(i,e){try{return await i.getItem(e)||(Hn()?localStorage.getItem(e):void 0)}catch(t){console.error(t)}}const HE="irn";function vu(i){return(i==null?void 0:i.relay)||{protocol:HE}}function Ko(i){const e=pE[i];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${i}`);return e}var KE=Object.defineProperty,kE=Object.defineProperties,VE=Object.getOwnPropertyDescriptors,Ef=Object.getOwnPropertySymbols,GE=Object.prototype.hasOwnProperty,WE=Object.prototype.propertyIsEnumerable,Df=(i,e,t)=>e in i?KE(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,YE=(i,e)=>{for(var t in e||(e={}))GE.call(e,t)&&Df(i,t,e[t]);if(Ef)for(var t of Ef(e))WE.call(e,t)&&Df(i,t,e[t]);return i},JE=(i,e)=>kE(i,VE(e));function QE(i,e="-"){const t={},s="relay"+e;return Object.keys(i).forEach(o=>{if(o.startsWith(s)){const c=o.replace(s,""),d=i[o];t[c]=d}}),t}function Sf(i){i=i.includes("wc://")?i.replace("wc://",""):i,i=i.includes("wc:")?i.replace("wc:",""):i;const e=i.indexOf(":"),t=i.indexOf("?")!==-1?i.indexOf("?"):void 0,s=i.substring(0,e),o=i.substring(e+1,t).split("@"),c=typeof t<"u"?i.substring(t):"",d=Ds.parse(c);return{protocol:s,topic:XE(o[0]),version:parseInt(o[1],10),symKey:d.symKey,relay:QE(d),expiryTimestamp:d.expiryTimestamp?parseInt(d.expiryTimestamp,10):void 0}}function XE(i){return i.startsWith("//")?i.substring(2):i}function ZE(i,e="-"){const t="relay",s={};return Object.keys(i).forEach(o=>{const c=t+e+o;i[o]&&(s[c]=i[o])}),s}function eD(i){return`${i.protocol}:${i.topic}@${i.version}?`+Ds.stringify(JE(YE({symKey:i.symKey},ZE(i.relay)),{expiryTimestamp:i.expiryTimestamp}))}function Kn(i){const e=[];return i.forEach(t=>{const[s,o]=t.split(":");e.push(`${s}:${o}`)}),e}function tD(i){const e=[];return Object.values(i).forEach(t=>{e.push(...Kn(t.accounts))}),e}function rD(i,e){const t=[];return Object.values(i).forEach(s=>{Kn(s.accounts).includes(e)&&t.push(...s.methods)}),t}function iD(i,e){const t=[];return Object.values(i).forEach(s=>{Kn(s.accounts).includes(e)&&t.push(...s.events)}),t}function qu(i){return i.includes(":")}function ms(i){return qu(i)?i.split(":")[0]:i}const nD={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}},sD={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 ce(i,e){const{message:t,code:s}=sD[i];return{message:e?`${t} ${e}`:t,code:s}}function wt(i,e){const{message:t,code:s}=nD[i];return{message:e?`${t} ${e}`:t,code:s}}function ni(i,e){return Array.isArray(i)?typeof e<"u"&&i.length?i.every(e):!0:!1}function Is(i){return Object.getPrototypeOf(i)===Object.prototype&&Object.keys(i).length}function ur(i){return typeof i>"u"}function Gt(i,e){return e&&ur(i)?!0:typeof i=="string"&&!!i.trim().length}function Fu(i,e){return e&&ur(i)?!0:typeof i=="number"&&!isNaN(i)}function oD(i,e){const{requiredNamespaces:t}=e,s=Object.keys(i.namespaces),o=Object.keys(t);let c=!0;return an(o,s)?(s.forEach(d=>{const{accounts:f,methods:y,events:g}=i.namespaces[d],m=Kn(f),D=t[d];(!an(tp(d,D),m)||!an(D.methods,y)||!an(D.events,g))&&(c=!1)}),c):!1}function Jo(i){return Gt(i,!1)&&i.includes(":")?i.split(":").length===2:!1}function aD(i){if(Gt(i,!1)&&i.includes(":")){const e=i.split(":");if(e.length===3){const t=e[0]+":"+e[1];return!!e[2]&&Jo(t)}}return!1}function cD(i){if(Gt(i,!1))try{return typeof new URL(i)<"u"}catch{return!1}return!1}function uD(i){var e;return(e=i==null?void 0:i.proposer)==null?void 0:e.publicKey}function hD(i){return i==null?void 0:i.topic}function lD(i,e){let t=null;return Gt(i==null?void 0:i.publicKey,!1)||(t=ce("MISSING_OR_INVALID",`${e} controller public key should be a string`)),t}function If(i){let e=!0;return ni(i)?i.length&&(e=i.every(t=>Gt(t,!1))):e=!1,e}function fD(i,e,t){let s=null;return ni(e)&&e.length?e.forEach(o=>{s||Jo(o)||(s=wt("UNSUPPORTED_CHAINS",`${t}, chain ${o} should be a string and conform to "namespace:chainId" format`))}):Jo(i)||(s=wt("UNSUPPORTED_CHAINS",`${t}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),s}function dD(i,e,t){let s=null;return Object.entries(i).forEach(([o,c])=>{if(s)return;const d=fD(o,tp(o,c),`${e} ${t}`);d&&(s=d)}),s}function pD(i,e){let t=null;return ni(i)?i.forEach(s=>{t||aD(s)||(t=wt("UNSUPPORTED_ACCOUNTS",`${e}, account ${s} should be a string and conform to "namespace:chainId:address" format`))}):t=wt("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),t}function gD(i,e){let t=null;return Object.values(i).forEach(s=>{if(t)return;const o=pD(s==null?void 0:s.accounts,`${e} namespace`);o&&(t=o)}),t}function yD(i,e){let t=null;return If(i==null?void 0:i.methods)?If(i==null?void 0:i.events)||(t=wt("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):t=wt("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),t}function up(i,e){let t=null;return Object.values(i).forEach(s=>{if(t)return;const o=yD(s,`${e}, namespace`);o&&(t=o)}),t}function vD(i,e,t){let s=null;if(i&&Is(i)){const o=up(i,e);o&&(s=o);const c=dD(i,e,t);c&&(s=c)}else s=ce("MISSING_OR_INVALID",`${e}, ${t} should be an object with data`);return s}function zc(i,e){let t=null;if(i&&Is(i)){const s=up(i,e);s&&(t=s);const o=gD(i,e);o&&(t=o)}else t=ce("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return t}function hp(i){return Gt(i.protocol,!0)}function mD(i,e){let t=!1;return e&&!i?t=!0:i&&ni(i)&&i.length&&i.forEach(s=>{t=hp(s)}),t}function wD(i){return typeof i=="number"}function wr(i){return typeof i<"u"&&typeof i!==null}function _D(i){return!(!i||typeof i!="object"||!i.code||!Fu(i.code,!1)||!i.message||!Gt(i.message,!1))}function bD(i){return!(ur(i)||!Gt(i.method,!1))}function ED(i){return!(ur(i)||ur(i.result)&&ur(i.error)||!Fu(i.id,!1)||!Gt(i.jsonrpc,!1))}function DD(i){return!(ur(i)||!Gt(i.name,!1))}function xf(i,e){return!(!Jo(e)||!tD(i).includes(e))}function SD(i,e,t){return Gt(t,!1)?rD(i,e).includes(t):!1}function ID(i,e,t){return Gt(t,!1)?iD(i,e).includes(t):!1}function Of(i,e,t){let s=null;const o=xD(i),c=OD(e),d=Object.keys(o),f=Object.keys(c),y=Pf(Object.keys(i)),g=Pf(Object.keys(e)),m=y.filter(D=>!g.includes(D));return m.length&&(s=ce("NON_CONFORMING_NAMESPACES",`${t} namespaces keys don't satisfy requiredNamespaces. + Required: ${m.toString()} + Received: ${Object.keys(e).toString()}`)),an(d,f)||(s=ce("NON_CONFORMING_NAMESPACES",`${t} namespaces chains don't satisfy required namespaces. + Required: ${d.toString()} + Approved: ${f.toString()}`)),Object.keys(e).forEach(D=>{if(!D.includes(":")||s)return;const I=Kn(e[D].accounts);I.includes(D)||(s=ce("NON_CONFORMING_NAMESPACES",`${t} namespaces accounts don't satisfy namespace accounts for ${D} + Required: ${D} + Approved: ${I.toString()}`))}),d.forEach(D=>{s||(an(o[D].methods,c[D].methods)?an(o[D].events,c[D].events)||(s=ce("NON_CONFORMING_NAMESPACES",`${t} namespaces events don't satisfy namespace events for ${D}`)):s=ce("NON_CONFORMING_NAMESPACES",`${t} namespaces methods don't satisfy namespace methods for ${D}`))}),s}function xD(i){const e={};return Object.keys(i).forEach(t=>{var s;t.includes(":")?e[t]=i[t]:(s=i[t].chains)==null||s.forEach(o=>{e[o]={methods:i[t].methods,events:i[t].events}})}),e}function Pf(i){return[...new Set(i.map(e=>e.includes(":")?e.split(":")[0]:e))]}function OD(i){const e={};return Object.keys(i).forEach(t=>{if(t.includes(":"))e[t]=i[t];else{const s=Kn(i[t].accounts);s==null||s.forEach(o=>{e[o]={accounts:i[t].accounts.filter(c=>c.includes(`${o}:`)),methods:i[t].methods,events:i[t].events}})}}),e}function PD(i,e){return Fu(i,!1)&&i<=e.max&&i>=e.min}function Cf(){const i=Cs();return new Promise(e=>{switch(i){case Pr.browser:e(CD());break;case Pr.reactNative:e(AD());break;case Pr.node:e(TD());break;default:e(!0)}})}function CD(){return Hn()&&(navigator==null?void 0:navigator.onLine)}async function AD(){if(Bn()&&typeof global<"u"&&global!=null&&global.NetInfo){const i=await(global==null?void 0:global.NetInfo.fetch());return i==null?void 0:i.isConnected}return!0}function TD(){return!0}function RD(i){switch(Cs()){case Pr.browser:ND(i);break;case Pr.reactNative:UD(i);break}}function ND(i){!Bn()&&Hn()&&(window.addEventListener("online",()=>i(!0)),window.addEventListener("offline",()=>i(!1)))}function UD(i){Bn()&&typeof global<"u"&&global!=null&&global.NetInfo&&(global==null||global.NetInfo.addEventListener(e=>i(e==null?void 0:e.isConnected)))}const Bc={};let jo=class{static get(e){return Bc[e]}static set(e,t){Bc[e]=t}static delete(e){delete Bc[e]}};const LD=/"(?:_|\\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*:/,$D=/"(?: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*:/,MD=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function jD(i,e){if(i==="__proto__"||i==="constructor"&&e&&typeof e=="object"&&"prototype"in e){qD(i);return}return e}function qD(i){console.warn(`[destr] Dropping "${i}" key to prevent prototype pollution.`)}function qo(i,e={}){if(typeof i!="string")return i;const t=i.trim();if(i[0]==='"'&&i.at(-1)==='"'&&!i.includes("\\"))return t.slice(1,-1);if(t.length<=9){const s=t.toLowerCase();if(s==="true")return!0;if(s==="false")return!1;if(s==="undefined")return;if(s==="null")return null;if(s==="nan")return Number.NaN;if(s==="infinity")return Number.POSITIVE_INFINITY;if(s==="-infinity")return Number.NEGATIVE_INFINITY}if(!MD.test(i)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return i}try{if(LD.test(i)||$D.test(i)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(i,jD)}return JSON.parse(i)}catch(s){if(e.strict)throw s;return i}}function FD(i){return!i||typeof i.then!="function"?Promise.resolve(i):i}function Vt(i,...e){try{return FD(i(...e))}catch(t){return Promise.reject(t)}}function zD(i){const e=typeof i;return i===null||e!=="object"&&e!=="function"}function BD(i){const e=Object.getPrototypeOf(i);return!e||e.isPrototypeOf(Object)}function ko(i){if(zD(i))return String(i);if(BD(i)||Array.isArray(i))return JSON.stringify(i);if(typeof i.toJSON=="function")return ko(i.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function lp(){if(typeof Buffer===void 0)throw new TypeError("[unstorage] Buffer is not supported!")}const mu="base64:";function HD(i){if(typeof i=="string")return i;lp();const e=Buffer.from(i).toString("base64");return mu+e}function KD(i){return typeof i!="string"||!i.startsWith(mu)?i:(lp(),Buffer.from(i.slice(mu.length),"base64"))}function mr(i){return i?i.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function kD(...i){return mr(i.join(":"))}function Fo(i){return i=mr(i),i?i+":":""}const VD="memory",GD=()=>{const i=new Map;return{name:VD,options:{},hasItem(e){return i.has(e)},getItem(e){return i.get(e)??null},getItemRaw(e){return i.get(e)??null},setItem(e,t){i.set(e,t)},setItemRaw(e,t){i.set(e,t)},removeItem(e){i.delete(e)},getKeys(){return Array.from(i.keys())},clear(){i.clear()},dispose(){i.clear()}}};function WD(i={}){const e={mounts:{"":i.driver||GD()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},t=g=>{for(const m of e.mountpoints)if(g.startsWith(m))return{base:m,relativeKey:g.slice(m.length),driver:e.mounts[m]};return{base:"",relativeKey:g,driver:e.mounts[""]}},s=(g,m)=>e.mountpoints.filter(D=>D.startsWith(g)||m&&g.startsWith(D)).map(D=>({relativeBase:g.length>D.length?g.slice(D.length):void 0,mountpoint:D,driver:e.mounts[D]})),o=(g,m)=>{if(e.watching){m=mr(m);for(const D of e.watchListeners)D(g,m)}},c=async()=>{if(!e.watching){e.watching=!0;for(const g in e.mounts)e.unwatch[g]=await Af(e.mounts[g],o,g)}},d=async()=>{if(e.watching){for(const g in e.unwatch)await e.unwatch[g]();e.unwatch={},e.watching=!1}},f=(g,m,D)=>{const I=new Map,T=P=>{let z=I.get(P.base);return z||(z={driver:P.driver,base:P.base,items:[]},I.set(P.base,z)),z};for(const P of g){const z=typeof P=="string",H=mr(z?P:P.key),ie=z?void 0:P.value,U=z||!P.options?m:{...m,...P.options},j=t(H);T(j).items.push({key:H,value:ie,relativeKey:j.relativeKey,options:U})}return Promise.all([...I.values()].map(P=>D(P))).then(P=>P.flat())},y={hasItem(g,m={}){g=mr(g);const{relativeKey:D,driver:I}=t(g);return Vt(I.hasItem,D,m)},getItem(g,m={}){g=mr(g);const{relativeKey:D,driver:I}=t(g);return Vt(I.getItem,D,m).then(T=>qo(T))},getItems(g,m){return f(g,m,D=>D.driver.getItems?Vt(D.driver.getItems,D.items.map(I=>({key:I.relativeKey,options:I.options})),m).then(I=>I.map(T=>({key:kD(D.base,T.key),value:qo(T.value)}))):Promise.all(D.items.map(I=>Vt(D.driver.getItem,I.relativeKey,I.options).then(T=>({key:I.key,value:qo(T)})))))},getItemRaw(g,m={}){g=mr(g);const{relativeKey:D,driver:I}=t(g);return I.getItemRaw?Vt(I.getItemRaw,D,m):Vt(I.getItem,D,m).then(T=>KD(T))},async setItem(g,m,D={}){if(m===void 0)return y.removeItem(g);g=mr(g);const{relativeKey:I,driver:T}=t(g);T.setItem&&(await Vt(T.setItem,I,ko(m),D),T.watch||o("update",g))},async setItems(g,m){await f(g,m,async D=>{D.driver.setItems&&await Vt(D.driver.setItems,D.items.map(I=>({key:I.relativeKey,value:ko(I.value),options:I.options})),m),D.driver.setItem&&await Promise.all(D.items.map(I=>Vt(D.driver.setItem,I.relativeKey,ko(I.value),I.options)))})},async setItemRaw(g,m,D={}){if(m===void 0)return y.removeItem(g,D);g=mr(g);const{relativeKey:I,driver:T}=t(g);if(T.setItemRaw)await Vt(T.setItemRaw,I,m,D);else if(T.setItem)await Vt(T.setItem,I,HD(m),D);else return;T.watch||o("update",g)},async removeItem(g,m={}){typeof m=="boolean"&&(m={removeMeta:m}),g=mr(g);const{relativeKey:D,driver:I}=t(g);I.removeItem&&(await Vt(I.removeItem,D,m),(m.removeMeta||m.removeMata)&&await Vt(I.removeItem,D+"$",m),I.watch||o("remove",g))},async getMeta(g,m={}){typeof m=="boolean"&&(m={nativeOnly:m}),g=mr(g);const{relativeKey:D,driver:I}=t(g),T=Object.create(null);if(I.getMeta&&Object.assign(T,await Vt(I.getMeta,D,m)),!m.nativeOnly){const P=await Vt(I.getItem,D+"$",m).then(z=>qo(z));P&&typeof P=="object"&&(typeof P.atime=="string"&&(P.atime=new Date(P.atime)),typeof P.mtime=="string"&&(P.mtime=new Date(P.mtime)),Object.assign(T,P))}return T},setMeta(g,m,D={}){return this.setItem(g+"$",m,D)},removeMeta(g,m={}){return this.removeItem(g+"$",m)},async getKeys(g,m={}){g=Fo(g);const D=s(g,!0);let I=[];const T=[];for(const P of D){const H=(await Vt(P.driver.getKeys,P.relativeBase,m)).map(ie=>P.mountpoint+mr(ie)).filter(ie=>!I.some(U=>ie.startsWith(U)));T.push(...H),I=[P.mountpoint,...I.filter(ie=>!ie.startsWith(P.mountpoint))]}return g?T.filter(P=>P.startsWith(g)&&!P.endsWith("$")):T.filter(P=>!P.endsWith("$"))},async clear(g,m={}){g=Fo(g),await Promise.all(s(g,!1).map(async D=>{if(D.driver.clear)return Vt(D.driver.clear,D.relativeBase,m);if(D.driver.removeItem){const I=await D.driver.getKeys(D.relativeBase||"",m);return Promise.all(I.map(T=>D.driver.removeItem(T,m)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(g=>Tf(g)))},async watch(g){return await c(),e.watchListeners.push(g),async()=>{e.watchListeners=e.watchListeners.filter(m=>m!==g),e.watchListeners.length===0&&await d()}},async unwatch(){e.watchListeners=[],await d()},mount(g,m){if(g=Fo(g),g&&e.mounts[g])throw new Error(`already mounted at ${g}`);return g&&(e.mountpoints.push(g),e.mountpoints.sort((D,I)=>I.length-D.length)),e.mounts[g]=m,e.watching&&Promise.resolve(Af(m,o,g)).then(D=>{e.unwatch[g]=D}).catch(console.error),y},async unmount(g,m=!0){g=Fo(g),!(!g||!e.mounts[g])&&(e.watching&&g in e.unwatch&&(e.unwatch[g](),delete e.unwatch[g]),m&&await Tf(e.mounts[g]),e.mountpoints=e.mountpoints.filter(D=>D!==g),delete e.mounts[g])},getMount(g=""){g=mr(g)+":";const m=t(g);return{driver:m.driver,base:m.base}},getMounts(g="",m={}){return g=mr(g),s(g,m.parents).map(I=>({driver:I.driver,base:I.mountpoint}))}};return y}function Af(i,e,t){return i.watch?i.watch((s,o)=>e(s,t+o)):()=>{}}async function Tf(i){typeof i.dispose=="function"&&await Vt(i.dispose)}function ln(i){return new Promise((e,t)=>{i.oncomplete=i.onsuccess=()=>e(i.result),i.onabort=i.onerror=()=>t(i.error)})}function fp(i,e){const t=indexedDB.open(i);t.onupgradeneeded=()=>t.result.createObjectStore(e);const s=ln(t);return(o,c)=>s.then(d=>c(d.transaction(e,o).objectStore(e)))}let Hc;function As(){return Hc||(Hc=fp("keyval-store","keyval")),Hc}function Rf(i,e=As()){return e("readonly",t=>ln(t.get(i)))}function YD(i,e,t=As()){return t("readwrite",s=>(s.put(e,i),ln(s.transaction)))}function JD(i,e=As()){return e("readwrite",t=>(t.delete(i),ln(t.transaction)))}function QD(i=As()){return i("readwrite",e=>(e.clear(),ln(e.transaction)))}function XD(i,e){return i.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},ln(i.transaction)}function ZD(i=As()){return i("readonly",e=>{if(e.getAllKeys)return ln(e.getAllKeys());const t=[];return XD(e,s=>t.push(s.key)).then(()=>t)})}const e3=i=>JSON.stringify(i,(e,t)=>typeof t=="bigint"?t.toString()+"n":t),t3=i=>{const e=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,t=i.replace(e,'$1"$2n"$3');return JSON.parse(t,(s,o)=>typeof o=="string"&&o.match(/^\d+n$/)?BigInt(o.substring(0,o.length-1)):o)};function Ts(i){if(typeof i!="string")throw new Error(`Cannot safe json parse value of type ${typeof i}`);try{return t3(i)}catch{return i}}function cn(i){return typeof i=="string"?i:e3(i)||""}const r3="idb-keyval";var i3=(i={})=>{const e=i.base&&i.base.length>0?`${i.base}:`:"",t=o=>e+o;let s;return i.dbName&&i.storeName&&(s=fp(i.dbName,i.storeName)),{name:r3,options:i,async hasItem(o){return!(typeof await Rf(t(o),s)>"u")},async getItem(o){return await Rf(t(o),s)??null},setItem(o,c){return YD(t(o),c,s)},removeItem(o){return JD(t(o),s)},getKeys(){return ZD(s)},clear(){return QD(s)}}};const n3="WALLET_CONNECT_V2_INDEXED_DB",s3="keyvaluestorage";let o3=class{constructor(){this.indexedDb=WD({driver:i3({dbName:n3,storeName:s3})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){const t=await this.indexedDb.getItem(e);if(t!==null)return t}async setItem(e,t){await this.indexedDb.setItem(e,cn(t))}async removeItem(e){await this.indexedDb.removeItem(e)}};var Kc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Vo={exports:{}};(function(){let i;function e(){}i=e,i.prototype.getItem=function(t){return this.hasOwnProperty(t)?String(this[t]):null},i.prototype.setItem=function(t,s){this[t]=String(s)},i.prototype.removeItem=function(t){delete this[t]},i.prototype.clear=function(){const t=this;Object.keys(t).forEach(function(s){t[s]=void 0,delete t[s]})},i.prototype.key=function(t){return t=t||0,Object.keys(this)[t]},i.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof Kc<"u"&&Kc.localStorage?Vo.exports=Kc.localStorage:typeof window<"u"&&window.localStorage?Vo.exports=window.localStorage:Vo.exports=new e})();function a3(i){var e;return[i[0],Ts((e=i[1])!=null?e:"")]}class c3{constructor(){this.localStorage=Vo.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(a3)}async getItem(e){const t=this.localStorage.getItem(e);if(t!==null)return Ts(t)}async setItem(e,t){this.localStorage.setItem(e,cn(t))}async removeItem(e){this.localStorage.removeItem(e)}}const u3="wc_storage_version",Nf=1,h3=async(i,e,t)=>{const s=u3,o=await e.getItem(s);if(o&&o>=Nf){t(e);return}const c=await i.getKeys();if(!c.length){t(e);return}const d=[];for(;c.length;){const f=c.shift();if(!f)continue;const y=f.toLowerCase();if(y.includes("wc@")||y.includes("walletconnect")||y.includes("wc_")||y.includes("wallet_connect")){const g=await i.getItem(f);await e.setItem(f,g),d.push(f)}}await e.setItem(s,Nf),t(e),l3(i,d)},l3=async(i,e)=>{e.length&&e.forEach(async t=>{await i.removeItem(t)})};let f3=class{constructor(){this.initialized=!1,this.setInitialized=t=>{this.storage=t,this.initialized=!0};const e=new c3;this.storage=e;try{const t=new o3;h3(e,t,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,t){return await this.initialize(),this.storage.setItem(e,t)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{const t=setInterval(()=>{this.initialized&&(clearInterval(t),e())},20)})}};var kn={},ds={},kc={},ps={};let fn=class{};const d3=Object.freeze(Object.defineProperty({__proto__:null,IEvents:fn},Symbol.toStringTag,{value:"Module"})),p3=xu(d3);var Uf;function g3(){if(Uf)return ps;Uf=1,Object.defineProperty(ps,"__esModule",{value:!0}),ps.IHeartBeat=void 0;const i=p3;class e extends i.IEvents{constructor(s){super()}}return ps.IHeartBeat=e,ps}var Lf;function dp(){return Lf||(Lf=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),si.__exportStar(g3(),i)}(kc)),kc}var Vc={},sn={},$f;function y3(){if($f)return sn;$f=1,Object.defineProperty(sn,"__esModule",{value:!0}),sn.HEARTBEAT_EVENTS=sn.HEARTBEAT_INTERVAL=void 0;const i=ve;return sn.HEARTBEAT_INTERVAL=i.FIVE_SECONDS,sn.HEARTBEAT_EVENTS={pulse:"heartbeat_pulse"},sn}var Mf;function pp(){return Mf||(Mf=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),si.__exportStar(y3(),i)}(Vc)),Vc}var jf;function v3(){if(jf)return ds;jf=1,Object.defineProperty(ds,"__esModule",{value:!0}),ds.HeartBeat=void 0;const i=si,e=Fr,t=ve,s=dp(),o=pp();class c extends s.IHeartBeat{constructor(f){super(f),this.events=new e.EventEmitter,this.interval=o.HEARTBEAT_INTERVAL,this.interval=(f==null?void 0:f.interval)||o.HEARTBEAT_INTERVAL}static init(f){return i.__awaiter(this,void 0,void 0,function*(){const y=new c(f);return yield y.init(),y})}init(){return i.__awaiter(this,void 0,void 0,function*(){yield this.initialize()})}stop(){clearInterval(this.intervalRef)}on(f,y){this.events.on(f,y)}once(f,y){this.events.once(f,y)}off(f,y){this.events.off(f,y)}removeListener(f,y){this.events.removeListener(f,y)}initialize(){return i.__awaiter(this,void 0,void 0,function*(){this.intervalRef=setInterval(()=>this.pulse(),t.toMiliseconds(this.interval))})}pulse(){this.events.emit(o.HEARTBEAT_EVENTS.pulse)}}return ds.HeartBeat=c,ds}(function(i){Object.defineProperty(i,"__esModule",{value:!0});const e=si;e.__exportStar(v3(),i),e.__exportStar(dp(),i),e.__exportStar(pp(),i)})(kn);var Je={},Gc,qf;function m3(){if(qf)return Gc;qf=1;function i(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}Gc=e;function e(t,s,o){var c=o&&o.stringify||i,d=1;if(typeof t=="object"&&t!==null){var f=s.length+d;if(f===1)return t;var y=new Array(f);y[0]=c(t);for(var g=1;g-1?T:0,t.charCodeAt(z+1)){case 100:case 102:if(I>=m||s[I]==null)break;T=m||s[I]==null)break;T=m||s[I]===void 0)break;T",T=z+2,z++;break}D+=c(s[I]),T=z+2,z++;break;case 115:if(I>=m)break;T-1&&(se=!1);const ue=["error","fatal","warn","info","debug","trace"];typeof _=="function"&&(_.error=_.fatal=_.warn=_.info=_.debug=_.trace=_),E.enabled===!1&&(E.level="silent");const de=E.level||"info",b=Object.create(_);b.log||(b.log=H),Object.defineProperty(b,"levelVal",{get:ee}),Object.defineProperty(b,"level",{get:Q,set:k});const C={transmit:u,serialize:W,asObject:E.browser.asObject,levels:ue,timestamp:T(E)};b.levels=o.levels,b.level=de,b.setMaxListeners=b.getMaxListeners=b.emit=b.addListener=b.on=b.prependListener=b.once=b.prependOnceListener=b.removeListener=b.removeAllListeners=b.listeners=b.listenerCount=b.eventNames=b.write=b.flush=H,b.serializers=G,b._serialize=W,b._stdErrSerialize=se,b.child=V,u&&(b._logEvent=D());function ee(){return this.level==="silent"?1/0:this.levels.values[this.level]}function Q(){return this._level}function k(J){if(J!=="silent"&&!this.levels.values[J])throw Error("unknown level "+J);this._level=J,c(C,b,"error","log"),c(C,b,"fatal","error"),c(C,b,"warn","error"),c(C,b,"info","log"),c(C,b,"debug","log"),c(C,b,"trace","log")}function V(J,re){if(!J)throw new Error("missing bindings for child Pino");re=re||{},W&&J.serializers&&(re.serializers=J.serializers);const _e=re.serializers;if(W&&_e){var oe=Object.assign({},G,_e),be=E.browser.serialize===!0?Object.keys(oe):W;delete J.serializers,y([J],be,oe,this._stdErrSerialize)}function le(me){this._childLevel=(me._childLevel|0)+1,this.error=g(me,J,"error"),this.fatal=g(me,J,"fatal"),this.warn=g(me,J,"warn"),this.info=g(me,J,"info"),this.debug=g(me,J,"debug"),this.trace=g(me,J,"trace"),oe&&(this.serializers=oe,this._serialize=be),u&&(this._logEvent=D([].concat(me._logEvent.bindings,J)))}return le.prototype=this,new le(this)}return b}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=t,o.stdTimeFunctions=Object.assign({},{nullTime:ie,epochTime:U,unixTime:j,isoTime:O});function c(E,u,_,G){const W=Object.getPrototypeOf(u);u[_]=u.levelVal>u.levels.values[_]?H:W[_]?W[_]:e[_]||e[G]||H,d(E,u,_)}function d(E,u,_){!E.transmit&&u[_]===H||(u[_]=function(G){return function(){const se=E.timestamp(),ue=new Array(arguments.length),de=Object.getPrototypeOf&&Object.getPrototypeOf(this)===e?e:this;for(var b=0;b-1&&se in _&&(E[W][se]=_[se](E[W][se]))}function g(E,u,_){return function(){const G=new Array(1+arguments.length);G[0]=u;for(var W=1;W"u"?g=t(f,y):g=f.bindings().context||"",g}ar.getLoggerContext=o;function c(f,y,g=i.PINO_CUSTOM_CONTEXT_KEY){const m=o(f,g);return m.trim()?`${m}/${y}`:y}ar.formatChildLoggerContext=c;function d(f,y,g=i.PINO_CUSTOM_CONTEXT_KEY){const m=c(f,y,g),D=f.child({context:m});return s(D,m,g)}return ar.generateChildLogger=d,ar}(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.pino=void 0;const e=si,t=e.__importDefault(w3());Object.defineProperty(i,"pino",{enumerable:!0,get:function(){return t.default}}),e.__exportStar(gp(),i),e.__exportStar(_3(),i)})(Je);class b3 extends fn{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}let E3=class extends fn{constructor(e,t){super(),this.core=e,this.logger=t,this.records=new Map}},D3=class{constructor(e,t){this.logger=e,this.core=t}},S3=class extends fn{constructor(e,t){super(),this.relayer=e,this.logger=t}},I3=class extends fn{constructor(e){super()}},x3=class{constructor(e,t,s,o){this.core=e,this.logger=t,this.name=s}};class O3 extends fn{constructor(e,t){super(),this.relayer=e,this.logger=t}}let P3=class extends fn{constructor(e,t){super(),this.core=e,this.logger=t}},C3=class{constructor(e,t){this.projectId=e,this.logger=t}},A3=class{constructor(e,t){this.projectId=e,this.logger=t}},T3=class{constructor(e){this.opts=e,this.protocol="wc",this.version=2}},R3=class{constructor(e){this.client=e}};var zu={},yp={};(function(i){Object.defineProperty(i,"__esModule",{value:!0});var e=$e,t=Cr;i.DIGEST_LENGTH=64,i.BLOCK_SIZE=128;var s=function(){function f(){this.digestLength=i.DIGEST_LENGTH,this.blockSize=i.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 f.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},f.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},f.prototype.clean=function(){t.wipe(this._buffer),t.wipe(this._tempHi),t.wipe(this._tempLo),this.reset()},f.prototype.update=function(y,g){if(g===void 0&&(g=y.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var m=0;if(this._bytesHashed+=g,this._bufferLength>0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=y[m++],g--;this._bufferLength===this.blockSize&&(c(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(g>=this.blockSize&&(m=c(this._tempHi,this._tempLo,this._stateHi,this._stateLo,y,m,g),g%=this.blockSize);g>0;)this._buffer[this._bufferLength++]=y[m++],g--;return this},f.prototype.finish=function(y){if(!this._finished){var g=this._bytesHashed,m=this._bufferLength,D=g/536870912|0,I=g<<3,T=g%128<112?128:256;this._buffer[m]=128;for(var P=m+1;P0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},f.prototype.restoreState=function(y){return this._stateHi.set(y.stateHi),this._stateLo.set(y.stateLo),this._bufferLength=y.bufferLength,y.buffer&&this._buffer.set(y.buffer),this._bytesHashed=y.bytesHashed,this._finished=!1,this},f.prototype.cleanSavedState=function(y){t.wipe(y.stateHi),t.wipe(y.stateLo),y.buffer&&t.wipe(y.buffer),y.bufferLength=0,y.bytesHashed=0},f}();i.SHA512=s;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 c(f,y,g,m,D,I,T){for(var P=g[0],z=g[1],H=g[2],ie=g[3],U=g[4],j=g[5],O=g[6],A=g[7],E=m[0],u=m[1],_=m[2],G=m[3],W=m[4],se=m[5],ue=m[6],de=m[7],b,C,ee,Q,k,V,J,re;T>=128;){for(var _e=0;_e<16;_e++){var oe=8*_e+I;f[_e]=e.readUint32BE(D,oe),y[_e]=e.readUint32BE(D,oe+4)}for(var _e=0;_e<80;_e++){var be=P,le=z,me=H,B=ie,F=U,L=j,l=O,R=A,ae=E,fe=u,Ie=_,Be=G,ke=W,Me=se,pt=ue,gt=de;if(b=A,C=de,k=C&65535,V=C>>>16,J=b&65535,re=b>>>16,b=(U>>>14|W<<18)^(U>>>18|W<<14)^(W>>>9|U<<23),C=(W>>>14|U<<18)^(W>>>18|U<<14)^(U>>>9|W<<23),k+=C&65535,V+=C>>>16,J+=b&65535,re+=b>>>16,b=U&j^~U&O,C=W&se^~W&ue,k+=C&65535,V+=C>>>16,J+=b&65535,re+=b>>>16,b=o[_e*2],C=o[_e*2+1],k+=C&65535,V+=C>>>16,J+=b&65535,re+=b>>>16,b=f[_e%16],C=y[_e%16],k+=C&65535,V+=C>>>16,J+=b&65535,re+=b>>>16,V+=k>>>16,J+=V>>>16,re+=J>>>16,ee=J&65535|re<<16,Q=k&65535|V<<16,b=ee,C=Q,k=C&65535,V=C>>>16,J=b&65535,re=b>>>16,b=(P>>>28|E<<4)^(E>>>2|P<<30)^(E>>>7|P<<25),C=(E>>>28|P<<4)^(P>>>2|E<<30)^(P>>>7|E<<25),k+=C&65535,V+=C>>>16,J+=b&65535,re+=b>>>16,b=P&z^P&H^z&H,C=E&u^E&_^u&_,k+=C&65535,V+=C>>>16,J+=b&65535,re+=b>>>16,V+=k>>>16,J+=V>>>16,re+=J>>>16,R=J&65535|re<<16,gt=k&65535|V<<16,b=B,C=Be,k=C&65535,V=C>>>16,J=b&65535,re=b>>>16,b=ee,C=Q,k+=C&65535,V+=C>>>16,J+=b&65535,re+=b>>>16,V+=k>>>16,J+=V>>>16,re+=J>>>16,B=J&65535|re<<16,Be=k&65535|V<<16,z=be,H=le,ie=me,U=B,j=F,O=L,A=l,P=R,u=ae,_=fe,G=Ie,W=Be,se=ke,ue=Me,de=pt,E=gt,_e%16===15)for(var oe=0;oe<16;oe++)b=f[oe],C=y[oe],k=C&65535,V=C>>>16,J=b&65535,re=b>>>16,b=f[(oe+9)%16],C=y[(oe+9)%16],k+=C&65535,V+=C>>>16,J+=b&65535,re+=b>>>16,ee=f[(oe+1)%16],Q=y[(oe+1)%16],b=(ee>>>1|Q<<31)^(ee>>>8|Q<<24)^ee>>>7,C=(Q>>>1|ee<<31)^(Q>>>8|ee<<24)^(Q>>>7|ee<<25),k+=C&65535,V+=C>>>16,J+=b&65535,re+=b>>>16,ee=f[(oe+14)%16],Q=y[(oe+14)%16],b=(ee>>>19|Q<<13)^(Q>>>29|ee<<3)^ee>>>6,C=(Q>>>19|ee<<13)^(ee>>>29|Q<<3)^(Q>>>6|ee<<26),k+=C&65535,V+=C>>>16,J+=b&65535,re+=b>>>16,V+=k>>>16,J+=V>>>16,re+=J>>>16,f[oe]=J&65535|re<<16,y[oe]=k&65535|V<<16}b=P,C=E,k=C&65535,V=C>>>16,J=b&65535,re=b>>>16,b=g[0],C=m[0],k+=C&65535,V+=C>>>16,J+=b&65535,re+=b>>>16,V+=k>>>16,J+=V>>>16,re+=J>>>16,g[0]=P=J&65535|re<<16,m[0]=E=k&65535|V<<16,b=z,C=u,k=C&65535,V=C>>>16,J=b&65535,re=b>>>16,b=g[1],C=m[1],k+=C&65535,V+=C>>>16,J+=b&65535,re+=b>>>16,V+=k>>>16,J+=V>>>16,re+=J>>>16,g[1]=z=J&65535|re<<16,m[1]=u=k&65535|V<<16,b=H,C=_,k=C&65535,V=C>>>16,J=b&65535,re=b>>>16,b=g[2],C=m[2],k+=C&65535,V+=C>>>16,J+=b&65535,re+=b>>>16,V+=k>>>16,J+=V>>>16,re+=J>>>16,g[2]=H=J&65535|re<<16,m[2]=_=k&65535|V<<16,b=ie,C=G,k=C&65535,V=C>>>16,J=b&65535,re=b>>>16,b=g[3],C=m[3],k+=C&65535,V+=C>>>16,J+=b&65535,re+=b>>>16,V+=k>>>16,J+=V>>>16,re+=J>>>16,g[3]=ie=J&65535|re<<16,m[3]=G=k&65535|V<<16,b=U,C=W,k=C&65535,V=C>>>16,J=b&65535,re=b>>>16,b=g[4],C=m[4],k+=C&65535,V+=C>>>16,J+=b&65535,re+=b>>>16,V+=k>>>16,J+=V>>>16,re+=J>>>16,g[4]=U=J&65535|re<<16,m[4]=W=k&65535|V<<16,b=j,C=se,k=C&65535,V=C>>>16,J=b&65535,re=b>>>16,b=g[5],C=m[5],k+=C&65535,V+=C>>>16,J+=b&65535,re+=b>>>16,V+=k>>>16,J+=V>>>16,re+=J>>>16,g[5]=j=J&65535|re<<16,m[5]=se=k&65535|V<<16,b=O,C=ue,k=C&65535,V=C>>>16,J=b&65535,re=b>>>16,b=g[6],C=m[6],k+=C&65535,V+=C>>>16,J+=b&65535,re+=b>>>16,V+=k>>>16,J+=V>>>16,re+=J>>>16,g[6]=O=J&65535|re<<16,m[6]=ue=k&65535|V<<16,b=A,C=de,k=C&65535,V=C>>>16,J=b&65535,re=b>>>16,b=g[7],C=m[7],k+=C&65535,V+=C>>>16,J+=b&65535,re+=b>>>16,V+=k>>>16,J+=V>>>16,re+=J>>>16,g[7]=A=J&65535|re<<16,m[7]=de=k&65535|V<<16,I+=128,T-=128}return I}function d(f){var y=new s;y.update(f);var g=y.digest();return y.clean(),g}i.hash=d})(yp);(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.convertSecretKeyToX25519=i.convertPublicKeyToX25519=i.verify=i.sign=i.extractPublicKeyFromSecretKey=i.generateKeyPair=i.generateKeyPairFromSeed=i.SEED_LENGTH=i.SECRET_KEY_LENGTH=i.PUBLIC_KEY_LENGTH=i.SIGNATURE_LENGTH=void 0;const e=Fn,t=yp,s=Cr;i.SIGNATURE_LENGTH=64,i.PUBLIC_KEY_LENGTH=32,i.SECRET_KEY_LENGTH=64,i.SEED_LENGTH=32;function o(B){const F=new Float64Array(16);if(B)for(let L=0;L>16&1),L[fe-1]&=65535;L[15]=l[15]-32767-(L[14]>>16&1);const ae=L[15]>>16&1;L[14]&=65535,z(l,L,1-ae)}for(let R=0;R<16;R++)B[2*R]=l[R]&255,B[2*R+1]=l[R]>>8}function ie(B,F){let L=0;for(let l=0;l<32;l++)L|=B[l]^F[l];return(1&L-1>>>8)-1}function U(B,F){const L=new Uint8Array(32),l=new Uint8Array(32);return H(L,B),H(l,F),ie(L,l)}function j(B){const F=new Uint8Array(32);return H(F,B),F[0]&1}function O(B,F){for(let L=0;L<16;L++)B[L]=F[2*L]+(F[2*L+1]<<8);B[15]&=32767}function A(B,F,L){for(let l=0;l<16;l++)B[l]=F[l]+L[l]}function E(B,F,L){for(let l=0;l<16;l++)B[l]=F[l]-L[l]}function u(B,F,L){let l,R,ae=0,fe=0,Ie=0,Be=0,ke=0,Me=0,pt=0,gt=0,qe=0,xe=0,Ne=0,Ue=0,Fe=0,Pe=0,Le=0,Se=0,Ce=0,He=0,Oe=0,Ve=0,We=0,et=0,tt=0,Qe=0,tr=0,fr=0,Jr=0,rr=0,oi=0,xi=0,Bi=0,Dt=L[0],yt=L[1],St=L[2],It=L[3],bt=L[4],vt=L[5],Lt=L[6],$t=L[7],xt=L[8],Mt=L[9],Ot=L[10],At=L[11],Pt=L[12],ht=L[13],jt=L[14],qt=L[15];l=F[0],ae+=l*Dt,fe+=l*yt,Ie+=l*St,Be+=l*It,ke+=l*bt,Me+=l*vt,pt+=l*Lt,gt+=l*$t,qe+=l*xt,xe+=l*Mt,Ne+=l*Ot,Ue+=l*At,Fe+=l*Pt,Pe+=l*ht,Le+=l*jt,Se+=l*qt,l=F[1],fe+=l*Dt,Ie+=l*yt,Be+=l*St,ke+=l*It,Me+=l*bt,pt+=l*vt,gt+=l*Lt,qe+=l*$t,xe+=l*xt,Ne+=l*Mt,Ue+=l*Ot,Fe+=l*At,Pe+=l*Pt,Le+=l*ht,Se+=l*jt,Ce+=l*qt,l=F[2],Ie+=l*Dt,Be+=l*yt,ke+=l*St,Me+=l*It,pt+=l*bt,gt+=l*vt,qe+=l*Lt,xe+=l*$t,Ne+=l*xt,Ue+=l*Mt,Fe+=l*Ot,Pe+=l*At,Le+=l*Pt,Se+=l*ht,Ce+=l*jt,He+=l*qt,l=F[3],Be+=l*Dt,ke+=l*yt,Me+=l*St,pt+=l*It,gt+=l*bt,qe+=l*vt,xe+=l*Lt,Ne+=l*$t,Ue+=l*xt,Fe+=l*Mt,Pe+=l*Ot,Le+=l*At,Se+=l*Pt,Ce+=l*ht,He+=l*jt,Oe+=l*qt,l=F[4],ke+=l*Dt,Me+=l*yt,pt+=l*St,gt+=l*It,qe+=l*bt,xe+=l*vt,Ne+=l*Lt,Ue+=l*$t,Fe+=l*xt,Pe+=l*Mt,Le+=l*Ot,Se+=l*At,Ce+=l*Pt,He+=l*ht,Oe+=l*jt,Ve+=l*qt,l=F[5],Me+=l*Dt,pt+=l*yt,gt+=l*St,qe+=l*It,xe+=l*bt,Ne+=l*vt,Ue+=l*Lt,Fe+=l*$t,Pe+=l*xt,Le+=l*Mt,Se+=l*Ot,Ce+=l*At,He+=l*Pt,Oe+=l*ht,Ve+=l*jt,We+=l*qt,l=F[6],pt+=l*Dt,gt+=l*yt,qe+=l*St,xe+=l*It,Ne+=l*bt,Ue+=l*vt,Fe+=l*Lt,Pe+=l*$t,Le+=l*xt,Se+=l*Mt,Ce+=l*Ot,He+=l*At,Oe+=l*Pt,Ve+=l*ht,We+=l*jt,et+=l*qt,l=F[7],gt+=l*Dt,qe+=l*yt,xe+=l*St,Ne+=l*It,Ue+=l*bt,Fe+=l*vt,Pe+=l*Lt,Le+=l*$t,Se+=l*xt,Ce+=l*Mt,He+=l*Ot,Oe+=l*At,Ve+=l*Pt,We+=l*ht,et+=l*jt,tt+=l*qt,l=F[8],qe+=l*Dt,xe+=l*yt,Ne+=l*St,Ue+=l*It,Fe+=l*bt,Pe+=l*vt,Le+=l*Lt,Se+=l*$t,Ce+=l*xt,He+=l*Mt,Oe+=l*Ot,Ve+=l*At,We+=l*Pt,et+=l*ht,tt+=l*jt,Qe+=l*qt,l=F[9],xe+=l*Dt,Ne+=l*yt,Ue+=l*St,Fe+=l*It,Pe+=l*bt,Le+=l*vt,Se+=l*Lt,Ce+=l*$t,He+=l*xt,Oe+=l*Mt,Ve+=l*Ot,We+=l*At,et+=l*Pt,tt+=l*ht,Qe+=l*jt,tr+=l*qt,l=F[10],Ne+=l*Dt,Ue+=l*yt,Fe+=l*St,Pe+=l*It,Le+=l*bt,Se+=l*vt,Ce+=l*Lt,He+=l*$t,Oe+=l*xt,Ve+=l*Mt,We+=l*Ot,et+=l*At,tt+=l*Pt,Qe+=l*ht,tr+=l*jt,fr+=l*qt,l=F[11],Ue+=l*Dt,Fe+=l*yt,Pe+=l*St,Le+=l*It,Se+=l*bt,Ce+=l*vt,He+=l*Lt,Oe+=l*$t,Ve+=l*xt,We+=l*Mt,et+=l*Ot,tt+=l*At,Qe+=l*Pt,tr+=l*ht,fr+=l*jt,Jr+=l*qt,l=F[12],Fe+=l*Dt,Pe+=l*yt,Le+=l*St,Se+=l*It,Ce+=l*bt,He+=l*vt,Oe+=l*Lt,Ve+=l*$t,We+=l*xt,et+=l*Mt,tt+=l*Ot,Qe+=l*At,tr+=l*Pt,fr+=l*ht,Jr+=l*jt,rr+=l*qt,l=F[13],Pe+=l*Dt,Le+=l*yt,Se+=l*St,Ce+=l*It,He+=l*bt,Oe+=l*vt,Ve+=l*Lt,We+=l*$t,et+=l*xt,tt+=l*Mt,Qe+=l*Ot,tr+=l*At,fr+=l*Pt,Jr+=l*ht,rr+=l*jt,oi+=l*qt,l=F[14],Le+=l*Dt,Se+=l*yt,Ce+=l*St,He+=l*It,Oe+=l*bt,Ve+=l*vt,We+=l*Lt,et+=l*$t,tt+=l*xt,Qe+=l*Mt,tr+=l*Ot,fr+=l*At,Jr+=l*Pt,rr+=l*ht,oi+=l*jt,xi+=l*qt,l=F[15],Se+=l*Dt,Ce+=l*yt,He+=l*St,Oe+=l*It,Ve+=l*bt,We+=l*vt,et+=l*Lt,tt+=l*$t,Qe+=l*xt,tr+=l*Mt,fr+=l*Ot,Jr+=l*At,rr+=l*Pt,oi+=l*ht,xi+=l*jt,Bi+=l*qt,ae+=38*Ce,fe+=38*He,Ie+=38*Oe,Be+=38*Ve,ke+=38*We,Me+=38*et,pt+=38*tt,gt+=38*Qe,qe+=38*tr,xe+=38*fr,Ne+=38*Jr,Ue+=38*rr,Fe+=38*oi,Pe+=38*xi,Le+=38*Bi,R=1,l=ae+R+65535,R=Math.floor(l/65536),ae=l-R*65536,l=fe+R+65535,R=Math.floor(l/65536),fe=l-R*65536,l=Ie+R+65535,R=Math.floor(l/65536),Ie=l-R*65536,l=Be+R+65535,R=Math.floor(l/65536),Be=l-R*65536,l=ke+R+65535,R=Math.floor(l/65536),ke=l-R*65536,l=Me+R+65535,R=Math.floor(l/65536),Me=l-R*65536,l=pt+R+65535,R=Math.floor(l/65536),pt=l-R*65536,l=gt+R+65535,R=Math.floor(l/65536),gt=l-R*65536,l=qe+R+65535,R=Math.floor(l/65536),qe=l-R*65536,l=xe+R+65535,R=Math.floor(l/65536),xe=l-R*65536,l=Ne+R+65535,R=Math.floor(l/65536),Ne=l-R*65536,l=Ue+R+65535,R=Math.floor(l/65536),Ue=l-R*65536,l=Fe+R+65535,R=Math.floor(l/65536),Fe=l-R*65536,l=Pe+R+65535,R=Math.floor(l/65536),Pe=l-R*65536,l=Le+R+65535,R=Math.floor(l/65536),Le=l-R*65536,l=Se+R+65535,R=Math.floor(l/65536),Se=l-R*65536,ae+=R-1+37*(R-1),R=1,l=ae+R+65535,R=Math.floor(l/65536),ae=l-R*65536,l=fe+R+65535,R=Math.floor(l/65536),fe=l-R*65536,l=Ie+R+65535,R=Math.floor(l/65536),Ie=l-R*65536,l=Be+R+65535,R=Math.floor(l/65536),Be=l-R*65536,l=ke+R+65535,R=Math.floor(l/65536),ke=l-R*65536,l=Me+R+65535,R=Math.floor(l/65536),Me=l-R*65536,l=pt+R+65535,R=Math.floor(l/65536),pt=l-R*65536,l=gt+R+65535,R=Math.floor(l/65536),gt=l-R*65536,l=qe+R+65535,R=Math.floor(l/65536),qe=l-R*65536,l=xe+R+65535,R=Math.floor(l/65536),xe=l-R*65536,l=Ne+R+65535,R=Math.floor(l/65536),Ne=l-R*65536,l=Ue+R+65535,R=Math.floor(l/65536),Ue=l-R*65536,l=Fe+R+65535,R=Math.floor(l/65536),Fe=l-R*65536,l=Pe+R+65535,R=Math.floor(l/65536),Pe=l-R*65536,l=Le+R+65535,R=Math.floor(l/65536),Le=l-R*65536,l=Se+R+65535,R=Math.floor(l/65536),Se=l-R*65536,ae+=R-1+37*(R-1),B[0]=ae,B[1]=fe,B[2]=Ie,B[3]=Be,B[4]=ke,B[5]=Me,B[6]=pt,B[7]=gt,B[8]=qe,B[9]=xe,B[10]=Ne,B[11]=Ue,B[12]=Fe,B[13]=Pe,B[14]=Le,B[15]=Se}function _(B,F){u(B,F,F)}function G(B,F){const L=o();let l;for(l=0;l<16;l++)L[l]=F[l];for(l=253;l>=0;l--)_(L,L),l!==2&&l!==4&&u(L,L,F);for(l=0;l<16;l++)B[l]=L[l]}function W(B,F){const L=o();let l;for(l=0;l<16;l++)L[l]=F[l];for(l=250;l>=0;l--)_(L,L),l!==1&&u(L,L,F);for(l=0;l<16;l++)B[l]=L[l]}function se(B,F){const L=o(),l=o(),R=o(),ae=o(),fe=o(),Ie=o(),Be=o(),ke=o(),Me=o();E(L,B[1],B[0]),E(Me,F[1],F[0]),u(L,L,Me),A(l,B[0],B[1]),A(Me,F[0],F[1]),u(l,l,Me),u(R,B[3],F[3]),u(R,R,g),u(ae,B[2],F[2]),A(ae,ae,ae),E(fe,l,L),E(Ie,ae,R),A(Be,ae,R),A(ke,l,L),u(B[0],fe,Ie),u(B[1],ke,Be),u(B[2],Be,Ie),u(B[3],fe,ke)}function ue(B,F,L){for(let l=0;l<4;l++)z(B[l],F[l],L)}function de(B,F){const L=o(),l=o(),R=o();G(R,F[2]),u(L,F[0],R),u(l,F[1],R),H(B,l),B[31]^=j(L)<<7}function b(B,F,L){T(B[0],d),T(B[1],f),T(B[2],f),T(B[3],d);for(let l=255;l>=0;--l){const R=L[l/8|0]>>(l&7)&1;ue(B,F,R),se(F,B),se(B,B),ue(B,F,R)}}function C(B,F){const L=[o(),o(),o(),o()];T(L[0],m),T(L[1],D),T(L[2],f),u(L[3],m,D),b(B,L,F)}function ee(B){if(B.length!==i.SEED_LENGTH)throw new Error(`ed25519: seed must be ${i.SEED_LENGTH} bytes`);const F=(0,t.hash)(B);F[0]&=248,F[31]&=127,F[31]|=64;const L=new Uint8Array(32),l=[o(),o(),o(),o()];C(l,F),de(L,l);const R=new Uint8Array(64);return R.set(B),R.set(L,32),{publicKey:L,secretKey:R}}i.generateKeyPairFromSeed=ee;function Q(B){const F=(0,e.randomBytes)(32,B),L=ee(F);return(0,s.wipe)(F),L}i.generateKeyPair=Q;function k(B){if(B.length!==i.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${i.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(B.subarray(32))}i.extractPublicKeyFromSecretKey=k;const V=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 J(B,F){let L,l,R,ae;for(l=63;l>=32;--l){for(L=0,R=l-32,ae=l-12;R>4)*V[R],L=F[R]>>8,F[R]&=255;for(R=0;R<32;R++)F[R]-=L*V[R];for(l=0;l<32;l++)F[l+1]+=F[l]>>8,B[l]=F[l]&255}function re(B){const F=new Float64Array(64);for(let L=0;L<64;L++)F[L]=B[L];for(let L=0;L<64;L++)B[L]=0;J(B,F)}function _e(B,F){const L=new Float64Array(64),l=[o(),o(),o(),o()],R=(0,t.hash)(B.subarray(0,32));R[0]&=248,R[31]&=127,R[31]|=64;const ae=new Uint8Array(64);ae.set(R.subarray(32),32);const fe=new t.SHA512;fe.update(ae.subarray(32)),fe.update(F);const Ie=fe.digest();fe.clean(),re(Ie),C(l,Ie),de(ae,l),fe.reset(),fe.update(ae.subarray(0,32)),fe.update(B.subarray(32)),fe.update(F);const Be=fe.digest();re(Be);for(let ke=0;ke<32;ke++)L[ke]=Ie[ke];for(let ke=0;ke<32;ke++)for(let Me=0;Me<32;Me++)L[ke+Me]+=Be[ke]*R[Me];return J(ae.subarray(32),L),ae}i.sign=_e;function oe(B,F){const L=o(),l=o(),R=o(),ae=o(),fe=o(),Ie=o(),Be=o();return T(B[2],f),O(B[1],F),_(R,B[1]),u(ae,R,y),E(R,R,B[2]),A(ae,B[2],ae),_(fe,ae),_(Ie,fe),u(Be,Ie,fe),u(L,Be,R),u(L,L,ae),W(L,L),u(L,L,R),u(L,L,ae),u(L,L,ae),u(B[0],L,ae),_(l,B[0]),u(l,l,ae),U(l,R)&&u(B[0],B[0],I),_(l,B[0]),u(l,l,ae),U(l,R)?-1:(j(B[0])===F[31]>>7&&E(B[0],d,B[0]),u(B[3],B[0],B[1]),0)}function be(B,F,L){const l=new Uint8Array(32),R=[o(),o(),o(),o()],ae=[o(),o(),o(),o()];if(L.length!==i.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${i.SIGNATURE_LENGTH} bytes`);if(oe(ae,B))return!1;const fe=new t.SHA512;fe.update(L.subarray(0,32)),fe.update(B),fe.update(F);const Ie=fe.digest();return re(Ie),b(R,ae,Ie),C(ae,L.subarray(32)),se(R,ae),de(l,R),!ie(L,l)}i.verify=be;function le(B){let F=[o(),o(),o(),o()];if(oe(F,B))throw new Error("Ed25519: invalid public key");let L=o(),l=o(),R=F[1];A(L,f,R),E(l,f,R),G(l,l),u(L,L,l);let ae=new Uint8Array(32);return H(ae,L),ae}i.convertPublicKeyToX25519=le;function me(B){const F=(0,t.hash)(B.subarray(0,32));F[0]&=248,F[31]&=127,F[31]|=64;const L=new Uint8Array(F.subarray(0,32));return(0,s.wipe)(F),L}i.convertSecretKeyToX25519=me})(zu);const N3="EdDSA",U3="JWT",vp=".",mp="base64url",L3="utf8",$3="utf8",M3=":",j3="did",q3="key",Hf="base58btc",F3="z",z3="K36",B3=32;function Qo(i){return lr(_r(cn(i),L3),mp)}function wp(i){const e=_r(z3,Hf),t=F3+lr(uu([e,i]),Hf);return[j3,q3,t].join(M3)}function H3(i){return lr(i,mp)}function K3(i){return _r([Qo(i.header),Qo(i.payload)].join(vp),$3)}function k3(i){return[Qo(i.header),Qo(i.payload),H3(i.signature)].join(vp)}function Kf(i=Fn.randomBytes(B3)){return zu.generateKeyPairFromSeed(i)}async function V3(i,e,t,s,o=ve.fromMiliseconds(Date.now())){const c={alg:N3,typ:U3},d=wp(s.publicKey),f=o+t,y={iss:d,sub:i,aud:e,iat:o,exp:f},g=K3({header:c,payload:y}),m=zu.sign(s.secretKey,g);return k3({header:c,payload:y,signature:m})}const G3="PARSE_ERROR",W3="INVALID_REQUEST",Y3="METHOD_NOT_FOUND",J3="INVALID_PARAMS",_p="INTERNAL_ERROR",Bu="SERVER_ERROR",Q3=[-32700,-32600,-32601,-32602,-32603],bs={[G3]:{code:-32700,message:"Parse error"},[W3]:{code:-32600,message:"Invalid Request"},[Y3]:{code:-32601,message:"Method not found"},[J3]:{code:-32602,message:"Invalid params"},[_p]:{code:-32603,message:"Internal error"},[Bu]:{code:-32e3,message:"Server error"}},bp=Bu;function X3(i){return Q3.includes(i)}function kf(i){return Object.keys(bs).includes(i)?bs[i]:bs[bp]}function Z3(i){const e=Object.values(bs).find(t=>t.code===i);return e||bs[bp]}function Ep(i,e,t){return i.message.includes("getaddrinfo ENOTFOUND")||i.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${t} RPC url at ${e}`):i}var Dp={},mi={},Vf;function e6(){if(Vf)return mi;Vf=1,Object.defineProperty(mi,"__esModule",{value:!0}),mi.isBrowserCryptoAvailable=mi.getSubtleCrypto=mi.getBrowerCrypto=void 0;function i(){return(Yr===null||Yr===void 0?void 0:Yr.crypto)||(Yr===null||Yr===void 0?void 0:Yr.msCrypto)||{}}mi.getBrowerCrypto=i;function e(){const s=i();return s.subtle||s.webkitSubtle}mi.getSubtleCrypto=e;function t(){return!!i()&&!!e()}return mi.isBrowserCryptoAvailable=t,mi}var wi={},Gf;function t6(){if(Gf)return wi;Gf=1,Object.defineProperty(wi,"__esModule",{value:!0}),wi.isBrowser=wi.isNode=wi.isReactNative=void 0;function i(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}wi.isReactNative=i;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}wi.isNode=e;function t(){return!i()&&!e()}return wi.isBrowser=t,wi}(function(i){Object.defineProperty(i,"__esModule",{value:!0});const e=si;e.__exportStar(e6(),i),e.__exportStar(t6(),i)})(Dp);function Hu(i=3){const e=Date.now()*Math.pow(10,i),t=Math.floor(Math.random()*Math.pow(10,i));return e+t}function Sp(i=6){return BigInt(Hu(i))}function qn(i,e,t){return{id:t||Hu(),jsonrpc:"2.0",method:i,params:e}}function oa(i,e){return{id:i,jsonrpc:"2.0",result:e}}function aa(i,e,t){return{id:i,jsonrpc:"2.0",error:r6(e,t)}}function r6(i,e){return typeof i>"u"?kf(_p):(typeof i=="string"&&(i=Object.assign(Object.assign({},kf(Bu)),{message:i})),typeof e<"u"&&(i.data=e),X3(i.code)&&(i=Z3(i.code)),i)}class i6{}class n6 extends i6{constructor(){super()}}class s6 extends n6{constructor(e){super()}}const o6="^https?:",a6="^wss?:";function c6(i){const e=i.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function Ip(i,e){const t=c6(i);return typeof t>"u"?!1:new RegExp(e).test(t)}function Wf(i){return Ip(i,o6)}function Yf(i){return Ip(i,a6)}function u6(i){return new RegExp("wss?://localhost(:d{2,5})?").test(i)}function xp(i){return typeof i=="object"&&"id"in i&&"jsonrpc"in i&&i.jsonrpc==="2.0"}function Ku(i){return xp(i)&&"method"in i}function ca(i){return xp(i)&&(Di(i)||Wr(i))}function Di(i){return"result"in i}function Wr(i){return"error"in i}class Si extends s6{constructor(e){super(e),this.events=new Fr.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict(qn(e.method,e.params||[],e.id||Sp().toString()),t)}async requestStrict(e,t){return new Promise(async(s,o)=>{if(!this.connection.connected)try{await this.open()}catch(c){o(c)}this.events.on(`${e.id}`,c=>{Wr(c)?o(c.error):s(c.result)});try{await this.connection.send(e,t)}catch(c){o(c)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),ca(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 h6=()=>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"),l6=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",Jf=i=>i.split("?")[0],Qf=10,f6=h6();let d6=class{constructor(e){if(this.url=e,this.events=new Fr.EventEmitter,this.registering=!1,!Yf(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,t)=>{if(typeof this.socket>"u"){t(new Error("Connection already closed"));return}this.socket.onclose=s=>{this.onClose(s),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(cn(e))}catch(t){this.onError(e.id,t)}}register(e=this.url){if(!Yf(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const t=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=t||this.events.listenerCount("open")>=t)&&this.events.setMaxListeners(t+1),new Promise((s,o)=>{this.events.once("register_error",c=>{this.resetMaxListeners(),o(c)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return o(new Error("WebSocket connection is missing or invalid"));s(this.socket)})})}return this.url=e,this.registering=!0,new Promise((t,s)=>{const o=new URLSearchParams(e).get("origin"),c=Dp.isReactNative()?{headers:{origin:o}}:{rejectUnauthorized:!u6(e)},d=new f6(e,[],c);l6()?d.onerror=f=>{const y=f;s(this.emitError(y.error))}:d.on("error",f=>{s(this.emitError(f))}),d.onopen=()=>{this.onOpen(d),t(d)}})}onOpen(e){e.onmessage=t=>this.onPayload(t),e.onclose=t=>this.onClose(t),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;const t=typeof e.data=="string"?Ts(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const s=this.parseError(t),o=s.message||s.toString(),c=aa(e,o);this.events.emit("payload",c)}parseError(e,t=this.url){return Ep(e,Jf(t),"WS")}resetMaxListeners(){this.events.getMaxListeners()>Qf&&this.events.setMaxListeners(Qf)}emitError(e){const t=this.parseError(new Error((e==null?void 0:e.message)||`WebSocket connection failed for host: ${Jf(this.url)}`));return this.events.emit("register_error",t),t}};var Xo={exports:{}};Xo.exports;(function(i,e){var t=200,s="__lodash_hash_undefined__",o=1,c=2,d=9007199254740991,f="[object Arguments]",y="[object Array]",g="[object AsyncFunction]",m="[object Boolean]",D="[object Date]",I="[object Error]",T="[object Function]",P="[object GeneratorFunction]",z="[object Map]",H="[object Number]",ie="[object Null]",U="[object Object]",j="[object Promise]",O="[object Proxy]",A="[object RegExp]",E="[object Set]",u="[object String]",_="[object Symbol]",G="[object Undefined]",W="[object WeakMap]",se="[object ArrayBuffer]",ue="[object DataView]",de="[object Float32Array]",b="[object Float64Array]",C="[object Int8Array]",ee="[object Int16Array]",Q="[object Int32Array]",k="[object Uint8Array]",V="[object Uint8ClampedArray]",J="[object Uint16Array]",re="[object Uint32Array]",_e=/[\\^$.*+?()[\]{}|]/g,oe=/^\[object .+?Constructor\]$/,be=/^(?:0|[1-9]\d*)$/,le={};le[de]=le[b]=le[C]=le[ee]=le[Q]=le[k]=le[V]=le[J]=le[re]=!0,le[f]=le[y]=le[se]=le[m]=le[ue]=le[D]=le[I]=le[T]=le[z]=le[H]=le[U]=le[A]=le[E]=le[u]=le[W]=!1;var me=typeof Yr=="object"&&Yr&&Yr.Object===Object&&Yr,B=typeof self=="object"&&self&&self.Object===Object&&self,F=me||B||Function("return this")(),L=e&&!e.nodeType&&e,l=L&&!0&&i&&!i.nodeType&&i,R=l&&l.exports===L,ae=R&&me.process,fe=function(){try{return ae&&ae.binding&&ae.binding("util")}catch{}}(),Ie=fe&&fe.isTypedArray;function Be(S,$){for(var te=-1,pe=S==null?0:S.length,at=0,Te=[];++te-1}function ma(S,$){var te=this.__data__,pe=Hi(te,S);return pe<0?(++this.size,te.push([S,$])):te[pe][1]=$,this}Ar.prototype.clear=pa,Ar.prototype.delete=ga,Ar.prototype.get=ya,Ar.prototype.has=va,Ar.prototype.set=ma;function ai(S){var $=-1,te=S==null?0:S.length;for(this.clear();++$Ft))return!1;var ct=Te.get(S);if(ct&&Te.get($))return ct==$;var Tt=-1,dr=!0,zt=te&c?new yn:void 0;for(Te.set(S,$),Te.set($,S);++Tt-1&&S%1==0&&S<$}function Ks(S){var $=typeof S;return $=="string"||$=="number"||$=="symbol"||$=="boolean"?S!=="__proto__":S===null}function ks(S){return!!Ve&&Ve in S}function Vs(S){var $=S&&S.constructor,te=typeof $=="function"&&$.prototype||Se;return S===te}function Pa(S){return We.call(S)}function ci(S){if(S!=null){try{return He.call(S)}catch{}try{return S+""}catch{}}return""}function Gs(S,$){return S===$||S!==S&&$!==$}var Ws=Gn(function(){return arguments}())?Gn:function(S){return Vi(S)&&Oe.call(S,"callee")&&!fr.call(S,"callee")},wn=Array.isArray;function Ca(S){return S!=null&&Ys(S.length)&&!_n(S)}var Wn=xi||st;function Aa(S,$){return ki(S,$)}function _n(S){if(!Js(S))return!1;var $=Ki(S);return $==T||$==P||$==g||$==O}function Ys(S){return typeof S=="number"&&S>-1&&S%1==0&&S<=d}function Js(S){var $=typeof S;return S!=null&&($=="object"||$=="function")}function Vi(S){return S!=null&&typeof S=="object"}var Qs=Ie?gt(Ie):js;function Ta(S){return Ca(S)?$s(S):qs(S)}function ot(){return[]}function st(){return!1}i.exports=Aa})(Xo,Xo.exports);var p6=Xo.exports;const g6=Ou(p6);function y6(i,e){return e=e||{},new Promise(function(t,s){var o=new XMLHttpRequest,c=[],d=[],f={},y=function(){return{ok:(o.status/100|0)==2,statusText:o.statusText,status:o.status,url:o.responseURL,text:function(){return Promise.resolve(o.responseText)},json:function(){return Promise.resolve(o.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([o.response]))},clone:y,headers:{keys:function(){return c},entries:function(){return d},get:function(m){return f[m.toLowerCase()]},has:function(m){return m.toLowerCase()in f}}}};for(var g in o.open(e.method||"get",i,!0),o.onload=function(){o.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(m,D,I){c.push(D=D.toLowerCase()),d.push([D,I]),f[D]=f[D]?f[D]+","+I:I}),t(y())},o.onerror=s,o.withCredentials=e.credentials=="include",e.headers)o.setRequestHeader(g,e.headers[g]);o.send(e.body||null)})}const v6=Object.freeze(Object.defineProperty({__proto__:null,default:y6},Symbol.toStringTag,{value:"Module"})),Xf=xu(v6);var m6=self.fetch||(self.fetch=Xf.default||Xf);const w6=Ou(m6);var _6={};function b6(i,e){if(i.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),s=0;s>>0,O=new Uint8Array(j);ie!==U;){for(var A=P[ie],E=0,u=j-1;(A!==0||E>>0,O[u]=A%f>>>0,A=A/f>>>0;if(A!==0)throw new Error("Non-zero carry");H=E,ie++}for(var _=j-H;_!==j&&O[_]===0;)_++;for(var G=y.repeat(z);_>>0,j=new Uint8Array(U);P[z];){var O=t[P.charCodeAt(z)];if(O===255)return;for(var A=0,E=U-1;(O!==0||A>>0,j[E]=O%256>>>0,O=O/256>>>0;if(O!==0)throw new Error("Non-zero carry");ie=A,z++}if(P[z]!==" "){for(var u=U-ie;u!==U&&j[u]===0;)u++;for(var _=new Uint8Array(H+(U-u)),G=H;u!==U;)_[G++]=j[u++];return _}}}function T(P){var z=I(P);if(z)return z;throw new Error(`Non-${e} character`)}return{encode:D,decodeUnsafe:I,decode:T}}var E6=b6,D6=E6;const Op=i=>{if(i instanceof Uint8Array&&i.constructor.name==="Uint8Array")return i;if(i instanceof ArrayBuffer)return new Uint8Array(i);if(ArrayBuffer.isView(i))return new Uint8Array(i.buffer,i.byteOffset,i.byteLength);throw new Error("Unknown type, must be binary type")},S6=i=>new TextEncoder().encode(i),I6=i=>new TextDecoder().decode(i);class x6{constructor(e,t,s){this.name=e,this.prefix=t,this.baseEncode=s}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class O6{constructor(e,t,s){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=s}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 Pp(this,e)}}class P6{constructor(e){this.decoders=e}or(e){return Pp(this,e)}decode(e){const t=e[0],s=this.decoders[t];if(s)return s.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Pp=(i,e)=>new P6({...i.decoders||{[i.prefix]:i},...e.decoders||{[e.prefix]:e}});class C6{constructor(e,t,s,o){this.name=e,this.prefix=t,this.baseEncode=s,this.baseDecode=o,this.encoder=new x6(e,t,s),this.decoder=new O6(e,t,o)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const ua=({name:i,prefix:e,encode:t,decode:s})=>new C6(i,e,t,s),Rs=({prefix:i,name:e,alphabet:t})=>{const{encode:s,decode:o}=D6(t,e);return ua({prefix:i,name:e,encode:s,decode:c=>Op(o(c))})},A6=(i,e,t,s)=>{const o={};for(let m=0;m=8&&(f-=8,d[g++]=255&y>>f)}if(f>=t||255&y<<8-f)throw new SyntaxError("Unexpected end of data");return d},T6=(i,e,t)=>{const s=e[e.length-1]==="=",o=(1<t;)d-=t,c+=e[o&f>>d];if(d&&(c+=e[o&f<ua({prefix:e,name:i,encode(o){return T6(o,s,t)},decode(o){return A6(o,s,t,i)}}),R6=ua({prefix:"\0",name:"identity",encode:i=>I6(i),decode:i=>S6(i)});var N6=Object.freeze({__proto__:null,identity:R6});const U6=Jt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var L6=Object.freeze({__proto__:null,base2:U6});const $6=Jt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var M6=Object.freeze({__proto__:null,base8:$6});const j6=Rs({prefix:"9",name:"base10",alphabet:"0123456789"});var q6=Object.freeze({__proto__:null,base10:j6});const F6=Jt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),z6=Jt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var B6=Object.freeze({__proto__:null,base16:F6,base16upper:z6});const H6=Jt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),K6=Jt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),k6=Jt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),V6=Jt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),G6=Jt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),W6=Jt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Y6=Jt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),J6=Jt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Q6=Jt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var X6=Object.freeze({__proto__:null,base32:H6,base32upper:K6,base32pad:k6,base32padupper:V6,base32hex:G6,base32hexupper:W6,base32hexpad:Y6,base32hexpadupper:J6,base32z:Q6});const Z6=Rs({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),eS=Rs({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var tS=Object.freeze({__proto__:null,base36:Z6,base36upper:eS});const rS=Rs({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),iS=Rs({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var nS=Object.freeze({__proto__:null,base58btc:rS,base58flickr:iS});const sS=Jt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),oS=Jt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),aS=Jt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),cS=Jt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var uS=Object.freeze({__proto__:null,base64:sS,base64pad:oS,base64url:aS,base64urlpad:cS});const Cp=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),hS=Cp.reduce((i,e,t)=>(i[t]=e,i),[]),lS=Cp.reduce((i,e,t)=>(i[e.codePointAt(0)]=t,i),[]);function fS(i){return i.reduce((e,t)=>(e+=hS[t],e),"")}function dS(i){const e=[];for(const t of i){const s=lS[t.codePointAt(0)];if(s===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(s)}return new Uint8Array(e)}const pS=ua({prefix:"🚀",name:"base256emoji",encode:fS,decode:dS});var gS=Object.freeze({__proto__:null,base256emoji:pS}),yS=Ap,Zf=128,vS=127,mS=~vS,wS=Math.pow(2,31);function Ap(i,e,t){e=e||[],t=t||0;for(var s=t;i>=wS;)e[t++]=i&255|Zf,i/=128;for(;i&mS;)e[t++]=i&255|Zf,i>>>=7;return e[t]=i|0,Ap.bytes=t-s+1,e}var _S=wu,bS=128,ed=127;function wu(i,s){var t=0,s=s||0,o=0,c=s,d,f=i.length;do{if(c>=f)throw wu.bytes=0,new RangeError("Could not decode varint");d=i[c++],t+=o<28?(d&ed)<=bS);return wu.bytes=c-s,t}var ES=Math.pow(2,7),DS=Math.pow(2,14),SS=Math.pow(2,21),IS=Math.pow(2,28),xS=Math.pow(2,35),OS=Math.pow(2,42),PS=Math.pow(2,49),CS=Math.pow(2,56),AS=Math.pow(2,63),TS=function(i){return i(Tp.encode(i,e,t),e),rd=i=>Tp.encodingLength(i),_u=(i,e)=>{const t=e.byteLength,s=rd(i),o=s+rd(t),c=new Uint8Array(o+t);return td(i,c,0),td(t,c,s),c.set(e,o),new NS(i,t,e,c)};class NS{constructor(e,t,s,o){this.code=e,this.size=t,this.digest=s,this.bytes=o}}const Rp=({name:i,code:e,encode:t})=>new US(i,e,t);class US{constructor(e,t,s){this.name=e,this.code=t,this.encode=s}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?_u(this.code,t):t.then(s=>_u(this.code,s))}else throw Error("Unknown type, must be binary type")}}const Np=i=>async e=>new Uint8Array(await crypto.subtle.digest(i,e)),LS=Rp({name:"sha2-256",code:18,encode:Np("SHA-256")}),$S=Rp({name:"sha2-512",code:19,encode:Np("SHA-512")});var MS=Object.freeze({__proto__:null,sha256:LS,sha512:$S});const Up=0,jS="identity",Lp=Op,qS=i=>_u(Up,Lp(i)),FS={code:Up,name:jS,encode:Lp,digest:qS};var zS=Object.freeze({__proto__:null,identity:FS});new TextEncoder,new TextDecoder;const id={...N6,...L6,...M6,...q6,...B6,...X6,...tS,...nS,...uS,...gS};({...MS,...zS});function $p(i){return globalThis.Buffer!=null?new Uint8Array(i.buffer,i.byteOffset,i.byteLength):i}function BS(i=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?$p(globalThis.Buffer.allocUnsafe(i)):new Uint8Array(i)}function Mp(i,e,t,s){return{name:i,prefix:e,encoder:{name:i,prefix:e,encode:t},decoder:{decode:s}}}const nd=Mp("utf8","u",i=>"u"+new TextDecoder("utf8").decode(i),i=>new TextEncoder().encode(i.substring(1))),Yc=Mp("ascii","a",i=>{let e="a";for(let t=0;t{i=i.substring(1);const e=BS(i.length);for(let t=0;t{if(!this.initialized){const s=await this.getKeyChain();typeof s<"u"&&(this.keychain=s),this.initialized=!0}},this.has=s=>(this.isInitialized(),this.keychain.has(s)),this.set=async(s,o)=>{this.isInitialized(),this.keychain.set(s,o),await this.persist()},this.get=s=>{this.isInitialized();const o=this.keychain.get(s);if(typeof o>"u"){const{message:c}=ce("NO_MATCHING_KEY",`${this.name}: ${s}`);throw new Error(c)}return o},this.del=async s=>{this.isInitialized(),this.keychain.delete(s),await this.persist()},this.core=e,this.logger=Je.generateChildLogger(t,this.name)}get context(){return Je.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,sp(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?op(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=ce("NOT_INITIALIZED",this.name);throw new Error(e)}}}class D2{constructor(e,t,s){this.core=e,this.logger=t,this.name=WS,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(),c=Kf(o);return wp(c.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const o=wE();return this.setPrivateKey(o.publicKey,o.privateKey)},this.signJWT=async o=>{this.isInitialized();const c=await this.getClientSeed(),d=Kf(c),f=yu();return await V3(f,o,YS,d)},this.generateSharedKey=(o,c,d)=>{this.isInitialized();const f=this.getPrivateKey(o),y=_E(f,c);return this.setSymKey(y,d)},this.setSymKey=async(o,c)=>{this.isInitialized();const d=c||bE(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,c,d)=>{this.isInitialized();const f=np(d),y=cn(c);if(mf(f)){const I=f.senderPublicKey,T=f.receiverPublicKey;o=await this.generateSharedKey(I,T)}const g=this.getSymKey(o),{type:m,senderPublicKey:D}=f;return DE({type:m,symKey:g,message:y,senderPublicKey:D})},this.decode=async(o,c,d)=>{this.isInitialized();const f=xE(c,d);if(mf(f)){const y=f.receiverPublicKey,g=f.senderPublicKey;o=await this.generateSharedKey(y,g)}try{const y=this.getSymKey(o),g=SE({symKey:y,encoded:c});return Ts(g)}catch(y){this.logger.error(`Failed to decode message from topic: '${o}', clientId: '${await this.getClientId()}'`),this.logger.error(y)}},this.getPayloadType=o=>{const c=Yo(o);return Ps(c.type)},this.getPayloadSenderPublicKey=o=>{const c=Yo(o);return c.senderPublicKey?lr(c.senderPublicKey,hr):void 0},this.core=e,this.logger=Je.generateChildLogger(t,this.name),this.keychain=s||new E2(this.core,this.logger)}get context(){return Je.getLoggerContext(this.logger)}async setPrivateKey(e,t){return await this.keychain.set(e,t),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(sd)}catch{e=yu(),await this.keychain.set(sd,e)}return KS(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=ce("NOT_INITIALIZED",this.name);throw new Error(e)}}}class S2 extends D3{constructor(e,t){super(e,t),this.logger=e,this.core=t,this.messages=new Map,this.name=XS,this.version=ZS,this.initialized=!1,this.storagePrefix=ji,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const s=await this.getRelayerMessages();typeof s<"u"&&(this.messages=s),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(s){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(s)}finally{this.initialized=!0}}},this.set=async(s,o)=>{this.isInitialized();const c=jn(o);let d=this.messages.get(s);return typeof d>"u"&&(d={}),typeof d[c]<"u"||(d[c]=o,this.messages.set(s,d),await this.persist()),c},this.get=s=>{this.isInitialized();let o=this.messages.get(s);return typeof o>"u"&&(o={}),o},this.has=(s,o)=>{this.isInitialized();const c=this.get(s),d=jn(o);return typeof c[d]<"u"},this.del=async s=>{this.isInitialized(),this.messages.delete(s),await this.persist()},this.logger=Je.generateChildLogger(e,this.name),this.core=t}get context(){return Je.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,sp(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?op(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=ce("NOT_INITIALIZED",this.name);throw new Error(e)}}}class I2 extends S3{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.events=new Fr.EventEmitter,this.name=t2,this.queue=new Map,this.publishTimeout=ve.toMiliseconds(ve.TEN_SECONDS*2),this.needsTransportRestart=!1,this.publish=async(s,o,c)=>{var d;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:s,message:o,opts:c}});try{const f=(c==null?void 0:c.ttl)||e2,y=vu(c),g=(c==null?void 0:c.prompt)||!1,m=(c==null?void 0:c.tag)||0,D=(c==null?void 0:c.id)||Sp().toString(),I={topic:s,message:o,opts:{ttl:f,relay:y,prompt:g,tag:m,id:D}},T=setTimeout(()=>this.queue.set(D,I),this.publishTimeout);try{await await Ss(this.rpcPublish(s,o,f,y,g,m,D),this.publishTimeout,`Failed to publish payload, please try again. id:${D} tag:${m}`),this.removeRequestFromQueue(D),this.relayer.events.emit(er.publish,I)}catch(P){if(this.logger.debug("Publishing Payload stalled"),this.needsTransportRestart=!0,(d=c==null?void 0:c.internal)!=null&&d.throwOnFailedPublish)throw this.removeRequestFromQueue(D),P;return}finally{clearTimeout(T)}this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:s,message:o,opts:c}})}catch(f){throw this.logger.debug("Failed to Publish Payload"),this.logger.error(f),f}},this.on=(s,o)=>{this.events.on(s,o)},this.once=(s,o)=>{this.events.once(s,o)},this.off=(s,o)=>{this.events.off(s,o)},this.removeListener=(s,o)=>{this.events.removeListener(s,o)},this.relayer=e,this.logger=Je.generateChildLogger(t,this.name),this.registerEventListeners()}get context(){return Je.getLoggerContext(this.logger)}rpcPublish(e,t,s,o,c,d,f){var y,g,m,D;const I={method:Ko(o.protocol).publish,params:{topic:e,message:t,ttl:s,prompt:c,tag:d},id:f};return ur((y=I.params)==null?void 0:y.prompt)&&((g=I.params)==null||delete g.prompt),ur((m=I.params)==null?void 0:m.tag)&&((D=I.params)==null||delete D.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:I}),this.relayer.request(I)}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{const{topic:t,message:s,opts:o}=e;await this.publish(t,s,o)})}registerEventListeners(){this.relayer.core.heartbeat.on(kn.HEARTBEAT_EVENTS.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(er.connection_stalled);return}this.checkQueue()}),this.relayer.on(er.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class x2{constructor(){this.map=new Map,this.set=(e,t)=>{const s=this.get(e);this.exists(e,t)||this.map.set(e,[...s,t])},this.get=e=>this.map.get(e)||[],this.exists=(e,t)=>this.get(e).includes(t),this.delete=(e,t)=>{if(typeof t>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const s=this.get(e);if(!this.exists(e,t))return;const o=s.filter(c=>c!==t);if(!o.length){this.map.delete(e);return}this.map.set(e,o)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var O2=Object.defineProperty,P2=Object.defineProperties,C2=Object.getOwnPropertyDescriptors,ad=Object.getOwnPropertySymbols,A2=Object.prototype.hasOwnProperty,T2=Object.prototype.propertyIsEnumerable,cd=(i,e,t)=>e in i?O2(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,ys=(i,e)=>{for(var t in e||(e={}))A2.call(e,t)&&cd(i,t,e[t]);if(ad)for(var t of ad(e))T2.call(e,t)&&cd(i,t,e[t]);return i},Qc=(i,e)=>P2(i,C2(e));class R2 extends O3{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.subscriptions=new Map,this.topicMap=new x2,this.events=new Fr.EventEmitter,this.name=h2,this.version=l2,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=ji,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(s,o)=>{await this.restartToComplete(),this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:s,opts:o}});try{const c=vu(o),d={topic:s,relay:c};this.pending.set(s,d);const f=await this.rpcSubscribe(s,c);return this.onSubscribe(f,d),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:s,opts:o}}),f}catch(c){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(c),c}},this.unsubscribe=async(s,o)=>{await this.restartToComplete(),this.isInitialized(),typeof(o==null?void 0:o.id)<"u"?await this.unsubscribeById(s,o.id,o):await this.unsubscribeByTopic(s,o)},this.isSubscribed=async s=>{if(this.topics.includes(s))return!0;const o=`${this.pendingSubscriptionWatchLabel}_${s}`;return await new Promise((c,d)=>{const f=new ve.Watch;f.start(o);const y=setInterval(()=>{!this.pending.has(s)&&this.topics.includes(s)&&(clearInterval(y),f.stop(o),c(!0)),f.elapsed(o)>=f2&&(clearInterval(y),f.stop(o),d(new Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1)},this.on=(s,o)=>{this.events.on(s,o)},this.once=(s,o)=>{this.events.once(s,o)},this.off=(s,o)=>{this.events.off(s,o)},this.removeListener=(s,o)=>{this.events.removeListener(s,o)},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=Je.generateChildLogger(t,this.name),this.clientId=""}get context(){return Je.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,t){let s=!1;try{s=this.getSubscription(e).topic===t}catch{}return s}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,t){const s=this.topicMap.get(e);await Promise.all(s.map(async o=>await this.unsubscribeById(e,o,t)))}async unsubscribeById(e,t,s){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:s}});try{const o=vu(s);await this.rpcUnsubscribe(e,t,o);const c=wt("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,t,c),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:s}})}catch(o){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(o),o}}async rpcSubscribe(e,t){const s={method:Ko(t.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:s});try{await await Ss(this.relayer.request(s),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(er.connection_stalled)}return jn(e+this.clientId)}async rpcBatchSubscribe(e){if(!e.length)return;const t=e[0].relay,s={method:Ko(t.protocol).batchSubscribe,params:{topics:e.map(o=>o.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:s});try{return await await Ss(this.relayer.request(s),this.subscribeTimeout)}catch{this.logger.debug("Outgoing Relay Payload stalled"),this.relayer.events.emit(er.connection_stalled)}}rpcUnsubscribe(e,t,s){const o={method:Ko(s.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:o}),this.relayer.request(o)}onSubscribe(e,t){this.setSubscription(e,Qc(ys({},t),{id:e})),this.pending.delete(t.topic)}onBatchSubscribe(e){e.length&&e.forEach(t=>{this.setSubscription(t.id,ys({},t)),this.pending.delete(t.topic)})}async onUnsubscribe(e,t,s){this.events.removeAllListeners(t),this.hasSubscription(t,e)&&this.deleteSubscription(t,s),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,t){this.subscriptions.has(e)||(this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:t}),this.addSubscription(e,t))}addSubscription(e,t){this.subscriptions.set(e,ys({},t)),this.topicMap.set(t.topic,e),this.events.emit(Gr.created,t)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const t=this.subscriptions.get(e);if(!t){const{message:s}=ce("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(s)}return t}deleteSubscription(e,t){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:t});const s=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(s.topic,e),this.events.emit(Gr.deleted,Qc(ys({},s),{reason:t}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Gr.sync)}async reset(){if(this.cached.length){const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let t=0;t"u"||!e.length)return;if(this.subscriptions.size){const{message:t}=ce("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(!e.length)return;const t=await this.rpcBatchSubscribe(e);ni(t)&&this.onBatchSubscribe(t.map((s,o)=>Qc(ys({},e[o]),{id:s})))}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(t=>{e.push(t)}),await this.batchSubscribe(e)}registerEventListeners(){this.relayer.core.heartbeat.on(kn.HEARTBEAT_EVENTS.pulse,async()=>{await this.checkPending()}),this.relayer.on(er.connect,async()=>{await this.onConnect()}),this.relayer.on(er.disconnect,()=>{this.onDisconnect()}),this.events.on(Gr.created,async e=>{const t=Gr.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()}),this.events.on(Gr.deleted,async e=>{const t=Gr.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=ce("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){this.restartInProgress&&await new Promise(e=>{const t=setInterval(()=>{this.restartInProgress||(clearInterval(t),e())},this.pollingInterval)})}}var N2=Object.defineProperty,ud=Object.getOwnPropertySymbols,U2=Object.prototype.hasOwnProperty,L2=Object.prototype.propertyIsEnumerable,hd=(i,e,t)=>e in i?N2(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,$2=(i,e)=>{for(var t in e||(e={}))U2.call(e,t)&&hd(i,t,e[t]);if(ud)for(var t of ud(e))L2.call(e,t)&&hd(i,t,e[t]);return i};class M2 extends I3{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new Fr.EventEmitter,this.name=i2,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","socket stalled"],this.hasExperiencedNetworkDisruption=!1,this.requestsInFlight=new Map,this.request=async t=>{this.logger.debug("Publishing Request Payload");const s=t.id;try{await this.toEstablishConnection();const o=this.provider.request(t);return this.requestsInFlight.set(s,{promise:o,request:t}),await o}catch(o){throw this.logger.debug("Failed to Publish Request"),this.logger.error(o),o}finally{this.requestsInFlight.delete(s)}},this.onPayloadHandler=t=>{this.onProviderPayload(t)},this.onConnectHandler=()=>{this.events.emit(er.connect)},this.onDisconnectHandler=()=>{this.onProviderDisconnect()},this.onProviderErrorHandler=t=>{this.logger.error(t),this.events.emit(er.error,t),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(_i.payload,this.onPayloadHandler),this.provider.on(_i.connect,this.onConnectHandler),this.provider.on(_i.disconnect,this.onDisconnectHandler),this.provider.on(_i.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?Je.generateChildLogger(e.logger,this.name):Je.pino(Je.getDefaultLoggerOptions({level:e.logger||r2})),this.messages=new S2(this.logger,e.core),this.subscriber=new R2(this,this.logger),this.publisher=new I2(this,this.logger),this.relayUrl=(e==null?void 0:e.relayUrl)||Fp,this.projectId=e.projectId,this.bundleId=RE(),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 ${od}...`),await this.restartTransport(od)}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)},a2)}get context(){return Je.getLoggerContext(this.logger)}get connected(){return this.provider.connection.connected}get connecting(){return this.provider.connection.connecting}async publish(e,t,s){this.isInitialized(),await this.publisher.publish(e,t,s),await this.recordMessageEvent({topic:e,message:t,publishedAt:Date.now()})}async subscribe(e,t){var s;this.isInitialized();let o=((s=this.subscriber.topicMap.get(e))==null?void 0:s[0])||"";if(o)return o;let c;const d=f=>{f.topic===e&&(this.subscriber.off(Gr.created,d),c())};return await Promise.all([new Promise(f=>{c=f,this.subscriber.on(Gr.created,d)}),new Promise(async f=>{o=await this.subscriber.subscribe(e,t),f()})]),o}async unsubscribe(e,t){this.isInitialized(),await this.subscriber.unsubscribe(e,t)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async transportClose(){this.requestsInFlight.size>0&&(this.logger.debug("Waiting for all in-flight requests to finish before closing transport..."),this.requestsInFlight.forEach(async e=>{await e.promise})),this.transportExplicitlyClosed=!0,this.hasExperiencedNetworkDisruption&&this.connected?await Ss(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(t=>{if(!this.initialized)return t();this.subscriber.once(Gr.resubscribed,()=>{t()})}),new Promise(async(t,s)=>{try{await Ss(this.provider.connect(),1e4,`Socket stalled when trying to connect to ${this.relayUrl}`)}catch(o){s(o);return}t()})])}catch(t){this.logger.error(t);const s=t;if(!this.isConnectionStalled(s.message))throw t;this.provider.events.emit(_i.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 Cf())throw new Error("No internet connection detected. Please restart your network and try again.")}isConnectionStalled(e){return this.staleConnectionErrors.some(t=>e.includes(t))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new Si(new d6(jE({sdkVersion:o2,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:t,message:s}=e;await this.messages.set(t,s)}async shouldIgnoreMessageEvent(e){const{topic:t,message:s}=e;if(!s||s.length===0)return this.logger.debug(`Ignoring invalid/empty message: ${s}`),!0;if(!await this.subscriber.isSubscribed(t))return this.logger.debug(`Ignoring message for non-subscribed topic ${t}`),!0;const o=this.messages.has(t,s);return o&&this.logger.debug(`Ignoring duplicate message: ${s}`),o}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),Ku(e)){if(!e.method.endsWith(n2))return;const t=e.params,{topic:s,message:o,publishedAt:c}=t.data,d={topic:s,message:o,publishedAt:c};this.logger.debug("Emitting Relayer Payload"),this.logger.trace($2({type:"event",event:t.id},d)),this.events.emit(t.id,d),await this.acknowledgePayload(e),await this.onMessageEvent(d)}else ca(e)&&this.events.emit(er.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(er.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const t=oa(e.id,!0);await this.provider.connection.send(t)}unregisterProviderListeners(){this.provider.off(_i.payload,this.onPayloadHandler),this.provider.off(_i.connect,this.onConnectHandler),this.provider.off(_i.disconnect,this.onDisconnectHandler),this.provider.off(_i.error,this.onProviderErrorHandler)}async registerEventListeners(){this.events.on(er.connection_stalled,()=>{this.restartTransport().catch(t=>this.logger.error(t))});let e=await Cf();RD(async t=>{this.initialized&&e!==t&&(e=t,t?await this.restartTransport().catch(s=>this.logger.error(s)):(this.hasExperiencedNetworkDisruption=!0,await this.transportClose().catch(s=>this.logger.error(s))))})}onProviderDisconnect(){this.events.emit(er.disconnect),this.attemptToReconnect()}attemptToReconnect(){this.transportExplicitlyClosed||(this.logger.info("attemptToReconnect called. Connecting..."),setTimeout(async()=>{await this.restartTransport().catch(e=>this.logger.error(e))},ve.toMiliseconds(s2)))}isInitialized(){if(!this.initialized){const{message:e}=ce("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 t=setInterval(()=>{this.connected&&(clearInterval(t),e())},this.connectionStatusPollingInterval)});await this.restartTransport()}}}var j2=Object.defineProperty,ld=Object.getOwnPropertySymbols,q2=Object.prototype.hasOwnProperty,F2=Object.prototype.propertyIsEnumerable,fd=(i,e,t)=>e in i?j2(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,dd=(i,e)=>{for(var t in e||(e={}))q2.call(e,t)&&fd(i,t,e[t]);if(ld)for(var t of ld(e))F2.call(e,t)&&fd(i,t,e[t]);return i};class ha extends x3{constructor(e,t,s,o=ji,c=void 0){super(e,t,s,o),this.core=e,this.logger=t,this.name=s,this.map=new Map,this.version=c2,this.cached=[],this.initialized=!1,this.storagePrefix=ji,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(d=>{this.getKey&&d!==null&&!ur(d)?this.map.set(this.getKey(d),d):uD(d)?this.map.set(d.id,d):hD(d)&&this.map.set(d.topic,d)}),this.cached=[],this.initialized=!0)},this.set=async(d,f)=>{this.isInitialized(),this.map.has(d)?await this.update(d,f):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:d,value:f}),this.map.set(d,f),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(f=>Object.keys(d).every(y=>g6(f[y],d[y]))):this.values),this.update=async(d,f)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:d,update:f});const y=dd(dd({},this.getData(d)),f);this.map.set(d,y),await this.persist()},this.delete=async(d,f)=>{this.isInitialized(),this.map.has(d)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:d,reason:f}),this.map.delete(d),await this.persist())},this.logger=Je.generateChildLogger(t,this.name),this.storagePrefix=o,this.getKey=c}get context(){return Je.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 t=this.map.get(e);if(!t){const{message:s}=ce("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(s),new Error(s)}return t}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:t}=ce("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=ce("NOT_INITIALIZED",this.name);throw new Error(e)}}}class z2{constructor(e,t){this.core=e,this.logger=t,this.name=d2,this.version=p2,this.events=new Pu,this.initialized=!1,this.storagePrefix=ji,this.ignoredPayloadTypes=[hn],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:s})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...s])]},this.create=async()=>{this.isInitialized();const s=yu(),o=await this.core.crypto.setSymKey(s),c=Or(ve.FIVE_MINUTES),d={protocol:qp},f={topic:o,expiry:c,relay:d,active:!1},y=eD({protocol:this.core.protocol,version:this.core.version,topic:o,symKey:s,relay:d,expiryTimestamp:c});return await this.pairings.set(o,f),await this.core.relayer.subscribe(o),this.core.expirer.set(o,c),{topic:o,uri:y}},this.pair=async s=>{this.isInitialized(),this.isValidPair(s);const{topic:o,symKey:c,relay:d,expiryTimestamp:f}=Sf(s.uri);let y;if(this.pairings.keys.includes(o)&&(y=this.pairings.get(o),y.active))throw new Error(`Pairing already exists: ${o}. Please try again with a new connection URI.`);const g=f||Or(ve.FIVE_MINUTES),m={topic:o,relay:d,expiry:g,active:!1};return await this.pairings.set(o,m),this.core.expirer.set(o,g),s.activatePairing&&await this.activate({topic:o}),this.events.emit(ws.create,m),this.core.crypto.keychain.has(o)||(await this.core.crypto.setSymKey(c,o),await this.core.relayer.subscribe(o,{relay:d})),m},this.activate=async({topic:s})=>{this.isInitialized();const o=Or(ve.THIRTY_DAYS);await this.pairings.update(s,{active:!0,expiry:o}),this.core.expirer.set(s,o)},this.ping=async s=>{this.isInitialized(),await this.isValidPing(s);const{topic:o}=s;if(this.pairings.keys.includes(o)){const c=await this.sendRequest(o,"wc_pairingPing",{}),{done:d,resolve:f,reject:y}=$n();this.events.once(Ut("pairing_ping",c),({error:g})=>{g?y(g):f()}),await d()}},this.updateExpiry=async({topic:s,expiry:o})=>{this.isInitialized(),await this.pairings.update(s,{expiry:o})},this.updateMetadata=async({topic:s,metadata:o})=>{this.isInitialized(),await this.pairings.update(s,{peerMetadata:o})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async s=>{this.isInitialized(),await this.isValidDisconnect(s);const{topic:o}=s;this.pairings.keys.includes(o)&&(await this.sendRequest(o,"wc_pairingDelete",wt("USER_DISCONNECTED")),await this.deletePairing(o))},this.sendRequest=async(s,o,c)=>{const d=qn(o,c),f=await this.core.crypto.encode(s,d),y=gs[o].req;return this.core.history.set(s,d),this.core.relayer.publish(s,f,y),d.id},this.sendResult=async(s,o,c)=>{const d=oa(s,c),f=await this.core.crypto.encode(o,d),y=await this.core.history.get(o,s),g=gs[y.request.method].res;await this.core.relayer.publish(o,f,g),await this.core.history.resolve(d)},this.sendError=async(s,o,c)=>{const d=aa(s,c),f=await this.core.crypto.encode(o,d),y=await this.core.history.get(o,s),g=gs[y.request.method]?gs[y.request.method].res:gs.unregistered_method.res;await this.core.relayer.publish(o,f,g),await this.core.history.resolve(d)},this.deletePairing=async(s,o)=>{await this.core.relayer.unsubscribe(s),await Promise.all([this.pairings.delete(s,wt("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(s),o?Promise.resolve():this.core.expirer.del(s)])},this.cleanup=async()=>{const s=this.pairings.getAll().filter(o=>Mi(o.expiry));await Promise.all(s.map(o=>this.deletePairing(o.topic)))},this.onRelayEventRequest=s=>{const{topic:o,payload:c}=s;switch(c.method){case"wc_pairingPing":return this.onPairingPingRequest(o,c);case"wc_pairingDelete":return this.onPairingDeleteRequest(o,c);default:return this.onUnknownRpcMethodRequest(o,c)}},this.onRelayEventResponse=async s=>{const{topic:o,payload:c}=s,d=(await this.core.history.get(o,c.id)).request.method;switch(d){case"wc_pairingPing":return this.onPairingPingResponse(o,c);default:return this.onUnknownRpcMethodResponse(d)}},this.onPairingPingRequest=async(s,o)=>{const{id:c}=o;try{this.isValidPing({topic:s}),await this.sendResult(c,s,!0),this.events.emit(ws.ping,{id:c,topic:s})}catch(d){await this.sendError(c,s,d),this.logger.error(d)}},this.onPairingPingResponse=(s,o)=>{const{id:c}=o;setTimeout(()=>{Di(o)?this.events.emit(Ut("pairing_ping",c),{}):Wr(o)&&this.events.emit(Ut("pairing_ping",c),{error:o.error})},500)},this.onPairingDeleteRequest=async(s,o)=>{const{id:c}=o;try{this.isValidDisconnect({topic:s}),await this.deletePairing(s),this.events.emit(ws.delete,{id:c,topic:s})}catch(d){await this.sendError(c,s,d),this.logger.error(d)}},this.onUnknownRpcMethodRequest=async(s,o)=>{const{id:c,method:d}=o;try{if(this.registeredMethods.includes(d))return;const f=wt("WC_METHOD_UNSUPPORTED",d);await this.sendError(c,s,f),this.logger.error(f)}catch(f){await this.sendError(c,s,f),this.logger.error(f)}},this.onUnknownRpcMethodResponse=s=>{this.registeredMethods.includes(s)||this.logger.error(wt("WC_METHOD_UNSUPPORTED",s))},this.isValidPair=s=>{var o;if(!wr(s)){const{message:d}=ce("MISSING_OR_INVALID",`pair() params: ${s}`);throw new Error(d)}if(!cD(s.uri)){const{message:d}=ce("MISSING_OR_INVALID",`pair() uri: ${s.uri}`);throw new Error(d)}const c=Sf(s.uri);if(!((o=c==null?void 0:c.relay)!=null&&o.protocol)){const{message:d}=ce("MISSING_OR_INVALID","pair() uri#relay-protocol");throw new Error(d)}if(!(c!=null&&c.symKey)){const{message:d}=ce("MISSING_OR_INVALID","pair() uri#symKey");throw new Error(d)}if(c!=null&&c.expiryTimestamp&&ve.toMiliseconds(c==null?void 0:c.expiryTimestamp){if(!wr(s)){const{message:c}=ce("MISSING_OR_INVALID",`ping() params: ${s}`);throw new Error(c)}const{topic:o}=s;await this.isValidPairingTopic(o)},this.isValidDisconnect=async s=>{if(!wr(s)){const{message:c}=ce("MISSING_OR_INVALID",`disconnect() params: ${s}`);throw new Error(c)}const{topic:o}=s;await this.isValidPairingTopic(o)},this.isValidPairingTopic=async s=>{if(!Gt(s,!1)){const{message:o}=ce("MISSING_OR_INVALID",`pairing topic should be a string: ${s}`);throw new Error(o)}if(!this.pairings.keys.includes(s)){const{message:o}=ce("NO_MATCHING_KEY",`pairing topic doesn't exist: ${s}`);throw new Error(o)}if(Mi(this.pairings.get(s).expiry)){await this.deletePairing(s);const{message:o}=ce("EXPIRED",`pairing topic: ${s}`);throw new Error(o)}},this.core=e,this.logger=Je.generateChildLogger(t,this.name),this.pairings=new ha(this.core,this.logger,this.name,this.storagePrefix)}get context(){return Je.getLoggerContext(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=ce("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(er.message,async e=>{const{topic:t,message:s}=e;if(!this.pairings.keys.includes(t)||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(s)))return;const o=await this.core.crypto.decode(t,s);try{Ku(o)?(this.core.history.set(t,o),this.onRelayEventRequest({topic:t,payload:o})):ca(o)&&(await this.core.history.resolve(o),await this.onRelayEventResponse({topic:t,payload:o}),this.core.history.delete(t,o.id))}catch(c){this.logger.error(c)}})}registerExpirerEvents(){this.core.expirer.on(qr.expired,async e=>{const{topic:t}=cp(e.target);t&&this.pairings.keys.includes(t)&&(await this.deletePairing(t,!0),this.events.emit(ws.expire,{topic:t}))})}}class B2 extends E3{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.records=new Map,this.events=new Fr.EventEmitter,this.name=g2,this.version=y2,this.cached=[],this.initialized=!1,this.storagePrefix=ji,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(s=>this.records.set(s.id,s)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(s,o,c)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:s,request:o,chainId:c}),this.records.has(o.id))return;const d={id:o.id,topic:s,request:{method:o.method,params:o.params||null},chainId:c,expiry:Or(ve.THIRTY_DAYS)};this.records.set(d.id,d),this.events.emit(ii.created,d)},this.resolve=async s=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:s}),!this.records.has(s.id))return;const o=await this.getRecord(s.id);typeof o.response>"u"&&(o.response=Wr(s)?{error:s.error}:{result:s.result},this.records.set(o.id,o),this.events.emit(ii.updated,o))},this.get=async(s,o)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:s,id:o}),await this.getRecord(o)),this.delete=(s,o)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:o}),this.values.forEach(c=>{if(c.topic===s){if(typeof o<"u"&&c.id!==o)return;this.records.delete(c.id),this.events.emit(ii.deleted,c)}})},this.exists=async(s,o)=>(this.isInitialized(),this.records.has(o)?(await this.getRecord(o)).topic===s:!1),this.on=(s,o)=>{this.events.on(s,o)},this.once=(s,o)=>{this.events.once(s,o)},this.off=(s,o)=>{this.events.off(s,o)},this.removeListener=(s,o)=>{this.events.removeListener(s,o)},this.logger=Je.generateChildLogger(t,this.name)}get context(){return Je.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(t=>{if(typeof t.response<"u")return;const s={topic:t.topic,request:qn(t.request.method,t.request.params,t.id),chainId:t.chainId};return e.push(s)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const t=this.records.get(e);if(!t){const{message:s}=ce("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(s)}return t}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(ii.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:t}=ce("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(ii.created,e=>{const t=ii.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e}),this.persist()}),this.events.on(ii.updated,e=>{const t=ii.updated;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e}),this.persist()}),this.events.on(ii.deleted,e=>{const t=ii.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e}),this.persist()}),this.core.heartbeat.on(kn.HEARTBEAT_EVENTS.pulse,()=>{this.cleanup()})}cleanup(){try{this.records.forEach(e=>{ve.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}=ce("NOT_INITIALIZED",this.name);throw new Error(e)}}}class H2 extends P3{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.expirations=new Map,this.events=new Fr.EventEmitter,this.name=v2,this.version=m2,this.cached=[],this.initialized=!1,this.storagePrefix=ji,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(s=>this.expirations.set(s.target,s)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=s=>{try{const o=this.formatTarget(s);return typeof this.getExpiration(o)<"u"}catch{return!1}},this.set=(s,o)=>{this.isInitialized();const c=this.formatTarget(s),d={target:c,expiry:o};this.expirations.set(c,d),this.checkExpiry(c,d),this.events.emit(qr.created,{target:c,expiration:d})},this.get=s=>{this.isInitialized();const o=this.formatTarget(s);return this.getExpiration(o)},this.del=s=>{if(this.isInitialized(),this.has(s)){const o=this.formatTarget(s),c=this.getExpiration(o);this.expirations.delete(o),this.events.emit(qr.deleted,{target:o,expiration:c})}},this.on=(s,o)=>{this.events.on(s,o)},this.once=(s,o)=>{this.events.once(s,o)},this.off=(s,o)=>{this.events.off(s,o)},this.removeListener=(s,o)=>{this.events.removeListener(s,o)},this.logger=Je.generateChildLogger(t,this.name)}get context(){return Je.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 qE(e);if(typeof e=="number")return FE(e);const{message:t}=ce("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(t)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(qr.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:t}=ce("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const t=this.expirations.get(e);if(!t){const{message:s}=ce("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(s),new Error(s)}return t}checkExpiry(e,t){const{expiry:s}=t;ve.toMiliseconds(s)-Date.now()<=0&&this.expire(e,t)}expire(e,t){this.expirations.delete(e),this.events.emit(qr.expired,{target:e,expiration:t})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,t)=>this.checkExpiry(t,e))}registerEventListeners(){this.core.heartbeat.on(kn.HEARTBEAT_EVENTS.pulse,()=>this.checkExpirations()),this.events.on(qr.created,e=>{const t=qr.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(qr.expired,e=>{const t=qr.expired;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(qr.deleted,e=>{const t=qr.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=ce("NOT_INITIALIZED",this.name);throw new Error(e)}}}class K2 extends C3{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,this.name=Jc,this.initialized=!1,this.queue=[],this.verifyDisabled=!1,this.init=async s=>{if(this.verifyDisabled||Bn()||!Hn())return;const o=this.getVerifyUrl(s==null?void 0:s.verifyUrl);this.verifyUrl!==o&&this.removeIframe(),this.verifyUrl=o;try{await this.createIframe()}catch(c){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(c)}if(!this.initialized){this.removeIframe(),this.verifyUrl=bu;try{await this.createIframe()}catch(c){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(c),this.verifyDisabled=!0}}},this.register=async s=>{this.initialized?this.sendPost(s.attestationId):(this.addToQueue(s.attestationId),await this.init())},this.resolve=async s=>{if(this.isDevEnv)return"";const o=this.getVerifyUrl(s==null?void 0:s.verifyUrl);let c;try{c=await this.fetchAttestation(s.attestationId,o)}catch(d){this.logger.info(`failed to resolve attestation: ${s.attestationId} from url: ${o}`),this.logger.info(d),c=await this.fetchAttestation(s.attestationId,bu)}return c},this.fetchAttestation=async(s,o)=>{this.logger.info(`resolving attestation: ${s} from url: ${o}`);const c=this.startAbortTimer(ve.ONE_SECOND*2),d=await fetch(`${o}/attestation/${s}`,{signal:this.abortController.signal});return clearTimeout(c),d.status===200?await d.json():void 0},this.addToQueue=s=>{this.queue.push(s)},this.processQueue=()=>{this.queue.length!==0&&(this.queue.forEach(s=>this.sendPost(s)),this.queue=[])},this.sendPost=s=>{var o;try{if(!this.iframe)return;(o=this.iframe.contentWindow)==null||o.postMessage(s,"*"),this.logger.info(`postMessage sent: ${s} ${this.verifyUrl}`)}catch{}},this.createIframe=async()=>{let s;const o=c=>{c.data==="verify_ready"&&(this.initialized=!0,this.processQueue(),window.removeEventListener("message",o),s())};await Promise.race([new Promise(c=>{if(document.getElementById(Jc))return c();window.addEventListener("message",o);const d=document.createElement("iframe");d.id=Jc,d.src=`${this.verifyUrl}/${this.projectId}`,d.style.display="none",document.body.append(d),this.iframe=d,s=c}),new Promise((c,d)=>setTimeout(()=>{window.removeEventListener("message",o),d("verify iframe load timeout")},ve.toMiliseconds(ve.FIVE_SECONDS)))])},this.removeIframe=()=>{this.iframe&&(this.iframe.remove(),this.iframe=void 0,this.initialized=!1)},this.getVerifyUrl=s=>{let o=s||Mn;return w2.includes(o)||(this.logger.info(`verify url: ${o}, not included in trusted list, assigning default: ${Mn}`),o=Mn),o},this.logger=Je.generateChildLogger(t,this.name),this.verifyUrl=Mn,this.abortController=new AbortController,this.isDevEnv=ju()&&_6.IS_VITEST}get context(){return Je.getLoggerContext(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),ve.toMiliseconds(e))}}class k2 extends A3{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,this.context=_2,this.registerDeviceToken=async s=>{const{clientId:o,token:c,notificationType:d,enableEncrypted:f=!1}=s,y=`${b2}/${this.projectId}/clients`;await w6(y,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:o,type:d,token:c,always_raw:f})})},this.logger=Je.generateChildLogger(t,this.context)}}var V2=Object.defineProperty,pd=Object.getOwnPropertySymbols,G2=Object.prototype.hasOwnProperty,W2=Object.prototype.propertyIsEnumerable,gd=(i,e,t)=>e in i?V2(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,yd=(i,e)=>{for(var t in e||(e={}))G2.call(e,t)&&gd(i,t,e[t]);if(pd)for(var t of pd(e))W2.call(e,t)&&gd(i,t,e[t]);return i};class Vu extends b3{constructor(e){super(e),this.protocol=jp,this.version=kS,this.name=ku,this.events=new Fr.EventEmitter,this.initialized=!1,this.on=(s,o)=>this.events.on(s,o),this.once=(s,o)=>this.events.once(s,o),this.off=(s,o)=>this.events.off(s,o),this.removeListener=(s,o)=>this.events.removeListener(s,o),this.projectId=e==null?void 0:e.projectId,this.relayUrl=(e==null?void 0:e.relayUrl)||Fp,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const t=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:Je.pino(Je.getDefaultLoggerOptions({level:(e==null?void 0:e.logger)||VS.logger}));this.logger=Je.generateChildLogger(t,this.name),this.heartbeat=new kn.HeartBeat,this.crypto=new D2(this,this.logger,e==null?void 0:e.keychain),this.history=new B2(this,this.logger),this.expirer=new H2(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new f3(yd(yd({},GS),e==null?void 0:e.storageOptions)),this.relayer=new M2({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new z2(this,this.logger),this.verify=new K2(this.projectId||"",this.logger),this.echoClient=new k2(this.projectId||"",this.logger)}static async init(e){const t=new Vu(e);await t.initialize();const s=await t.crypto.getClientId();return await t.storage.setItem(u2,s),t}get context(){return Je.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 Y2=Vu,zp="wc",Bp=2,Hp="client",Gu=`${zp}@${Bp}:${Hp}:`,Xc={name:Hp,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},vd="WALLETCONNECT_DEEPLINK_CHOICE",J2="proposal",Kp="Proposal expired",Q2="session",zo=ve.SEVEN_DAYS,X2="engine",bi={wc_sessionPropose:{req:{ttl:ve.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:ve.FIVE_MINUTES,prompt:!1,tag:1101}},wc_sessionSettle:{req:{ttl:ve.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:ve.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:ve.ONE_DAY,prompt:!1,tag:1104},res:{ttl:ve.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:ve.ONE_DAY,prompt:!1,tag:1106},res:{ttl:ve.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:ve.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:ve.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:ve.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:ve.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:ve.ONE_DAY,prompt:!1,tag:1112},res:{ttl:ve.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:ve.THIRTY_SECONDS,prompt:!1,tag:1114},res:{ttl:ve.THIRTY_SECONDS,prompt:!1,tag:1115}}},Zc={min:ve.FIVE_MINUTES,max:ve.SEVEN_DAYS},Ei={idle:"IDLE",active:"ACTIVE"},Z2="request",eI=["wc_sessionPropose","wc_sessionRequest","wc_authRequest"];var tI=Object.defineProperty,rI=Object.defineProperties,iI=Object.getOwnPropertyDescriptors,md=Object.getOwnPropertySymbols,nI=Object.prototype.hasOwnProperty,sI=Object.prototype.propertyIsEnumerable,wd=(i,e,t)=>e in i?tI(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,cr=(i,e)=>{for(var t in e||(e={}))nI.call(e,t)&&wd(i,t,e[t]);if(md)for(var t of md(e))sI.call(e,t)&&wd(i,t,e[t]);return i},Ln=(i,e)=>rI(i,iI(e));class oI extends R3{constructor(e){super(e),this.name=X2,this.events=new Pu,this.initialized=!1,this.ignoredPayloadTypes=[hn],this.requestQueue={state:Ei.idle,queue:[]},this.sessionRequestQueue={state:Ei.idle,queue:[]},this.requestQueueDelay=ve.ONE_SECOND,this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),this.client.core.pairing.register({methods:Object.keys(bi)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},ve.toMiliseconds(this.requestQueueDelay)))},this.connect=async t=>{await this.isInitialized();const s=Ln(cr({},t),{requiredNamespaces:t.requiredNamespaces||{},optionalNamespaces:t.optionalNamespaces||{}});await this.isValidConnect(s);const{pairingTopic:o,requiredNamespaces:c,optionalNamespaces:d,sessionProperties:f,relays:y}=s;let g=o,m,D=!1;if(g&&(D=this.client.core.pairing.pairings.get(g).active),!g||!D){const{topic:O,uri:A}=await this.client.core.pairing.create();g=O,m=A}const I=await this.client.core.crypto.generateKeyPair(),T=bi.wc_sessionPropose.req.ttl||ve.FIVE_MINUTES,P=Or(T),z=cr({requiredNamespaces:c,optionalNamespaces:d,relays:y??[{protocol:qp}],proposer:{publicKey:I,metadata:this.client.metadata},expiryTimestamp:P},f&&{sessionProperties:f}),{reject:H,resolve:ie,done:U}=$n(T,Kp);if(this.events.once(Ut("session_connect"),async({error:O,session:A})=>{if(O)H(O);else if(A){A.self.publicKey=I;const E=Ln(cr({},A),{requiredNamespaces:z.requiredNamespaces,optionalNamespaces:z.optionalNamespaces});await this.client.session.set(A.topic,E),await this.setExpiry(A.topic,A.expiry),g&&await this.client.core.pairing.updateMetadata({topic:g,metadata:A.peer.metadata}),ie(E)}}),!g){const{message:O}=ce("NO_MATCHING_KEY",`connect() pairing topic: ${g}`);throw new Error(O)}const j=await this.sendRequest({topic:g,method:"wc_sessionPropose",params:z,throwOnFailedPublish:!0});return await this.setProposal(j,cr({id:j},z)),{uri:m,approval:U}},this.pair=async t=>(await this.isInitialized(),await this.client.core.pairing.pair(t)),this.approve=async t=>{await this.isInitialized(),await this.isValidApprove(t);const{id:s,relayProtocol:o,namespaces:c,sessionProperties:d}=t,f=this.client.proposal.get(s);let{pairingTopic:y,proposer:g,requiredNamespaces:m,optionalNamespaces:D}=f;y=y||"";const I=await this.client.core.crypto.generateKeyPair(),T=g.publicKey,P=await this.client.core.crypto.generateSharedKey(I,T);y&&s&&(await this.client.core.pairing.updateMetadata({topic:y,metadata:g.metadata}),await this.sendResult({id:s,topic:y,result:{relay:{protocol:o??"irn"},responderPublicKey:I}}),await this.client.proposal.delete(s,wt("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:y}));const z=cr({relay:{protocol:o??"irn"},namespaces:c,pairingTopic:y,controller:{publicKey:I,metadata:this.client.metadata},expiry:Or(zo)},d&&{sessionProperties:d});await this.client.core.relayer.subscribe(P);const H=Ln(cr({},z),{topic:P,requiredNamespaces:m,optionalNamespaces:D,pairingTopic:y,acknowledged:!1,self:z.controller,peer:{publicKey:g.publicKey,metadata:g.metadata},controller:I});await this.client.session.set(P,H);try{await this.sendRequest({topic:P,method:"wc_sessionSettle",params:z,throwOnFailedPublish:!0})}catch(ie){throw this.client.logger.error(ie),this.client.session.delete(P,wt("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(P),ie}return await this.setExpiry(P,Or(zo)),{topic:P,acknowledged:()=>new Promise(ie=>setTimeout(()=>ie(this.client.session.get(P)),500))}},this.reject=async t=>{await this.isInitialized(),await this.isValidReject(t);const{id:s,reason:o}=t,{pairingTopic:c}=this.client.proposal.get(s);c&&(await this.sendError(s,c,o),await this.client.proposal.delete(s,wt("USER_DISCONNECTED")))},this.update=async t=>{await this.isInitialized(),await this.isValidUpdate(t);const{topic:s,namespaces:o}=t,c=await this.sendRequest({topic:s,method:"wc_sessionUpdate",params:{namespaces:o}}),{done:d,resolve:f,reject:y}=$n();return this.events.once(Ut("session_update",c),({error:g})=>{g?y(g):f()}),await this.client.session.update(s,{namespaces:o}),{acknowledged:d}},this.extend=async t=>{await this.isInitialized(),await this.isValidExtend(t);const{topic:s}=t,o=await this.sendRequest({topic:s,method:"wc_sessionExtend",params:{}}),{done:c,resolve:d,reject:f}=$n();return this.events.once(Ut("session_extend",o),({error:y})=>{y?f(y):d()}),await this.setExpiry(s,Or(zo)),{acknowledged:c}},this.request=async t=>{await this.isInitialized(),await this.isValidRequest(t);const{chainId:s,request:o,topic:c,expiry:d=bi.wc_sessionRequest.req.ttl}=t,f=Hu(),{done:y,resolve:g,reject:m}=$n(d,"Request expired. Please try again.");return this.events.once(Ut("session_request",f),({error:D,result:I})=>{D?m(D):g(I)}),await Promise.all([new Promise(async D=>{await this.sendRequest({clientRpcId:f,topic:c,method:"wc_sessionRequest",params:{request:Ln(cr({},o),{expiryTimestamp:Or(d)}),chainId:s},expiry:d,throwOnFailedPublish:!0}).catch(I=>m(I)),this.client.events.emit("session_request_sent",{topic:c,request:o,chainId:s,id:f}),D()}),new Promise(async D=>{const I=await BE(this.client.core.storage,vd);zE({id:f,topic:c,wcDeepLink:I}),D()}),y()]).then(D=>D[2])},this.respond=async t=>{await this.isInitialized(),await this.isValidRespond(t);const{topic:s,response:o}=t,{id:c}=o;Di(o)?await this.sendResult({id:c,topic:s,result:o.result,throwOnFailedPublish:!0}):Wr(o)&&await this.sendError(c,s,o.error),this.cleanupAfterResponse(t)},this.ping=async t=>{await this.isInitialized(),await this.isValidPing(t);const{topic:s}=t;if(this.client.session.keys.includes(s)){const o=await this.sendRequest({topic:s,method:"wc_sessionPing",params:{}}),{done:c,resolve:d,reject:f}=$n();this.events.once(Ut("session_ping",o),({error:y})=>{y?f(y):d()}),await c()}else this.client.core.pairing.pairings.keys.includes(s)&&await this.client.core.pairing.ping({topic:s})},this.emit=async t=>{await this.isInitialized(),await this.isValidEmit(t);const{topic:s,event:o,chainId:c}=t;await this.sendRequest({topic:s,method:"wc_sessionEvent",params:{event:o,chainId:c}})},this.disconnect=async t=>{await this.isInitialized(),await this.isValidDisconnect(t);const{topic:s}=t;if(this.client.session.keys.includes(s))await this.sendRequest({topic:s,method:"wc_sessionDelete",params:wt("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:s,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(s))await this.client.core.pairing.disconnect({topic:s});else{const{message:o}=ce("MISMATCHED_TOPIC",`Session or pairing topic not found: ${s}`);throw new Error(o)}},this.find=t=>(this.isInitialized(),this.client.session.getAll().filter(s=>oD(s,t))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.cleanupDuplicatePairings=async t=>{if(t.pairingTopic)try{const s=this.client.core.pairing.pairings.get(t.pairingTopic),o=this.client.core.pairing.pairings.getAll().filter(c=>{var d,f;return((d=c.peerMetadata)==null?void 0:d.url)&&((f=c.peerMetadata)==null?void 0:f.url)===t.peer.metadata.url&&c.topic&&c.topic!==s.topic});if(o.length===0)return;this.client.logger.info(`Cleaning up ${o.length} duplicate pairing(s)`),await Promise.all(o.map(c=>this.client.core.pairing.disconnect({topic:c.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(s){this.client.logger.error(s)}},this.deleteSession=async t=>{const{topic:s,expirerHasDeleted:o=!1,emitEvent:c=!0,id:d=0}=t,{self:f}=this.client.session.get(s);await this.client.core.relayer.unsubscribe(s),await this.client.session.delete(s,wt("USER_DISCONNECTED")),this.client.core.crypto.keychain.has(f.publicKey)&&await this.client.core.crypto.deleteKeyPair(f.publicKey),this.client.core.crypto.keychain.has(s)&&await this.client.core.crypto.deleteSymKey(s),o||this.client.core.expirer.del(s),this.client.core.storage.removeItem(vd).catch(y=>this.client.logger.warn(y)),this.getPendingSessionRequests().forEach(y=>{y.topic===s&&this.deletePendingSessionRequest(y.id,wt("USER_DISCONNECTED"))}),c&&this.client.events.emit("session_delete",{id:d,topic:s})},this.deleteProposal=async(t,s)=>{await Promise.all([this.client.proposal.delete(t,wt("USER_DISCONNECTED")),s?Promise.resolve():this.client.core.expirer.del(t)])},this.deletePendingSessionRequest=async(t,s,o=!1)=>{await Promise.all([this.client.pendingRequest.delete(t,s),o?Promise.resolve():this.client.core.expirer.del(t)]),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(c=>c.id!==t),o&&(this.sessionRequestQueue.state=Ei.idle,this.client.events.emit("session_request_expire",{id:t}))},this.setExpiry=async(t,s)=>{this.client.session.keys.includes(t)&&await this.client.session.update(t,{expiry:s}),this.client.core.expirer.set(t,s)},this.setProposal=async(t,s)=>{await this.client.proposal.set(t,s),this.client.core.expirer.set(t,Or(bi.wc_sessionPropose.req.ttl))},this.setPendingSessionRequest=async t=>{const{id:s,topic:o,params:c,verifyContext:d}=t,f=c.request.expiryTimestamp||Or(bi.wc_sessionRequest.req.ttl);await this.client.pendingRequest.set(s,{id:s,topic:o,params:c,verifyContext:d}),f&&this.client.core.expirer.set(s,f)},this.sendRequest=async t=>{const{topic:s,method:o,params:c,expiry:d,relayRpcId:f,clientRpcId:y,throwOnFailedPublish:g}=t,m=qn(o,c,y);if(Hn()&&eI.includes(o)){const T=jn(JSON.stringify(m));this.client.core.verify.register({attestationId:T})}const D=await this.client.core.crypto.encode(s,m),I=bi[o].req;return d&&(I.ttl=d),f&&(I.id=f),this.client.core.history.set(s,m),g?(I.internal=Ln(cr({},I.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(s,D,I)):this.client.core.relayer.publish(s,D,I).catch(T=>this.client.logger.error(T)),m.id},this.sendResult=async t=>{const{id:s,topic:o,result:c,throwOnFailedPublish:d}=t,f=oa(s,c),y=await this.client.core.crypto.encode(o,f),g=await this.client.core.history.get(o,s),m=bi[g.request.method].res;d?(m.internal=Ln(cr({},m.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(o,y,m)):this.client.core.relayer.publish(o,y,m).catch(D=>this.client.logger.error(D)),await this.client.core.history.resolve(f)},this.sendError=async(t,s,o)=>{const c=aa(t,o),d=await this.client.core.crypto.encode(s,c),f=await this.client.core.history.get(s,t),y=bi[f.request.method].res;this.client.core.relayer.publish(s,d,y),await this.client.core.history.resolve(c)},this.cleanup=async()=>{const t=[],s=[];this.client.session.getAll().forEach(o=>{let c=!1;Mi(o.expiry)&&(c=!0),this.client.core.crypto.keychain.has(o.topic)||(c=!0),c&&t.push(o.topic)}),this.client.proposal.getAll().forEach(o=>{Mi(o.expiryTimestamp)&&s.push(o.id)}),await Promise.all([...t.map(o=>this.deleteSession({topic:o})),...s.map(o=>this.deleteProposal(o))])},this.onRelayEventRequest=async t=>{this.requestQueue.queue.push(t),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===Ei.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=Ei.active;const t=this.requestQueue.queue.shift();if(t)try{this.processRequest(t),await new Promise(s=>setTimeout(s,300))}catch(s){this.client.logger.warn(s)}}this.requestQueue.state=Ei.idle},this.processRequest=t=>{const{topic:s,payload:o}=t,c=o.method;switch(c){case"wc_sessionPropose":return this.onSessionProposeRequest(s,o);case"wc_sessionSettle":return this.onSessionSettleRequest(s,o);case"wc_sessionUpdate":return this.onSessionUpdateRequest(s,o);case"wc_sessionExtend":return this.onSessionExtendRequest(s,o);case"wc_sessionPing":return this.onSessionPingRequest(s,o);case"wc_sessionDelete":return this.onSessionDeleteRequest(s,o);case"wc_sessionRequest":return this.onSessionRequest(s,o);case"wc_sessionEvent":return this.onSessionEventRequest(s,o);default:return this.client.logger.info(`Unsupported request method ${c}`)}},this.onRelayEventResponse=async t=>{const{topic:s,payload:o}=t,c=(await this.client.core.history.get(s,o.id)).request.method;switch(c){case"wc_sessionPropose":return this.onSessionProposeResponse(s,o);case"wc_sessionSettle":return this.onSessionSettleResponse(s,o);case"wc_sessionUpdate":return this.onSessionUpdateResponse(s,o);case"wc_sessionExtend":return this.onSessionExtendResponse(s,o);case"wc_sessionPing":return this.onSessionPingResponse(s,o);case"wc_sessionRequest":return this.onSessionRequestResponse(s,o);default:return this.client.logger.info(`Unsupported response method ${c}`)}},this.onRelayEventUnknownPayload=t=>{const{topic:s}=t,{message:o}=ce("MISSING_OR_INVALID",`Decoded payload on topic ${s} is not identifiable as a JSON-RPC request or a response.`);throw new Error(o)},this.onSessionProposeRequest=async(t,s)=>{const{params:o,id:c}=s;try{this.isValidConnect(cr({},s.params));const d=o.expiryTimestamp||Or(bi.wc_sessionPropose.req.ttl),f=cr({id:c,pairingTopic:t,expiryTimestamp:d},o);await this.setProposal(c,f);const y=jn(JSON.stringify(s)),g=await this.getVerifyContext(y,f.proposer.metadata);this.client.events.emit("session_proposal",{id:c,params:f,verifyContext:g})}catch(d){await this.sendError(c,t,d),this.client.logger.error(d)}},this.onSessionProposeResponse=async(t,s)=>{const{id:o}=s;if(Di(s)){const{result:c}=s;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:c});const d=this.client.proposal.get(o);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:d});const f=d.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:f});const y=c.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:y});const g=await this.client.core.crypto.generateSharedKey(f,y);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:g});const m=await this.client.core.relayer.subscribe(g);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:m}),await this.client.core.pairing.activate({topic:t})}else Wr(s)&&(await this.client.proposal.delete(o,wt("USER_DISCONNECTED")),this.events.emit(Ut("session_connect"),{error:s.error}))},this.onSessionSettleRequest=async(t,s)=>{const{id:o,params:c}=s;try{this.isValidSessionSettleRequest(c);const{relay:d,controller:f,expiry:y,namespaces:g,sessionProperties:m,pairingTopic:D}=s.params,I=cr({topic:t,relay:d,expiry:y,namespaces:g,acknowledged:!0,pairingTopic:D,requiredNamespaces:{},optionalNamespaces:{},controller:f.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:f.publicKey,metadata:f.metadata}},m&&{sessionProperties:m});await this.sendResult({id:s.id,topic:t,result:!0}),this.events.emit(Ut("session_connect"),{session:I}),this.cleanupDuplicatePairings(I)}catch(d){await this.sendError(o,t,d),this.client.logger.error(d)}},this.onSessionSettleResponse=async(t,s)=>{const{id:o}=s;Di(s)?(await this.client.session.update(t,{acknowledged:!0}),this.events.emit(Ut("session_approve",o),{})):Wr(s)&&(await this.client.session.delete(t,wt("USER_DISCONNECTED")),this.events.emit(Ut("session_approve",o),{error:s.error}))},this.onSessionUpdateRequest=async(t,s)=>{const{params:o,id:c}=s;try{const d=`${t}_session_update`,f=jo.get(d);if(f&&this.isRequestOutOfSync(f,c)){this.client.logger.info(`Discarding out of sync request - ${c}`);return}this.isValidUpdate(cr({topic:t},o)),await this.client.session.update(t,{namespaces:o.namespaces}),await this.sendResult({id:c,topic:t,result:!0}),this.client.events.emit("session_update",{id:c,topic:t,params:o}),jo.set(d,c)}catch(d){await this.sendError(c,t,d),this.client.logger.error(d)}},this.isRequestOutOfSync=(t,s)=>parseInt(s.toString().slice(0,-3))<=parseInt(t.toString().slice(0,-3)),this.onSessionUpdateResponse=(t,s)=>{const{id:o}=s;Di(s)?this.events.emit(Ut("session_update",o),{}):Wr(s)&&this.events.emit(Ut("session_update",o),{error:s.error})},this.onSessionExtendRequest=async(t,s)=>{const{id:o}=s;try{this.isValidExtend({topic:t}),await this.setExpiry(t,Or(zo)),await this.sendResult({id:o,topic:t,result:!0}),this.client.events.emit("session_extend",{id:o,topic:t})}catch(c){await this.sendError(o,t,c),this.client.logger.error(c)}},this.onSessionExtendResponse=(t,s)=>{const{id:o}=s;Di(s)?this.events.emit(Ut("session_extend",o),{}):Wr(s)&&this.events.emit(Ut("session_extend",o),{error:s.error})},this.onSessionPingRequest=async(t,s)=>{const{id:o}=s;try{this.isValidPing({topic:t}),await this.sendResult({id:o,topic:t,result:!0}),this.client.events.emit("session_ping",{id:o,topic:t})}catch(c){await this.sendError(o,t,c),this.client.logger.error(c)}},this.onSessionPingResponse=(t,s)=>{const{id:o}=s;setTimeout(()=>{Di(s)?this.events.emit(Ut("session_ping",o),{}):Wr(s)&&this.events.emit(Ut("session_ping",o),{error:s.error})},500)},this.onSessionDeleteRequest=async(t,s)=>{const{id:o}=s;try{this.isValidDisconnect({topic:t,reason:s.params}),await Promise.all([new Promise(c=>{this.client.core.relayer.once(er.publish,async()=>{c(await this.deleteSession({topic:t,id:o}))})}),this.sendResult({id:o,topic:t,result:!0}),this.cleanupPendingSentRequestsForTopic({topic:t,error:wt("USER_DISCONNECTED")})])}catch(c){this.client.logger.error(c)}},this.onSessionRequest=async(t,s)=>{const{id:o,params:c}=s;try{this.isValidRequest(cr({topic:t},c));const d=jn(JSON.stringify(qn("wc_sessionRequest",c,o))),f=this.client.session.get(t),y=await this.getVerifyContext(d,f.peer.metadata),g={id:o,topic:t,params:c,verifyContext:y};await this.setPendingSessionRequest(g),this.addSessionRequestToSessionRequestQueue(g),this.processSessionRequestQueue()}catch(d){await this.sendError(o,t,d),this.client.logger.error(d)}},this.onSessionRequestResponse=(t,s)=>{const{id:o}=s;Di(s)?this.events.emit(Ut("session_request",o),{result:s.result}):Wr(s)&&this.events.emit(Ut("session_request",o),{error:s.error})},this.onSessionEventRequest=async(t,s)=>{const{id:o,params:c}=s;try{const d=`${t}_session_event_${c.event.name}`,f=jo.get(d);if(f&&this.isRequestOutOfSync(f,o)){this.client.logger.info(`Discarding out of sync request - ${o}`);return}this.isValidEmit(cr({topic:t},c)),this.client.events.emit("session_event",{id:o,topic:t,params:c}),jo.set(d,o)}catch(d){await this.sendError(o,t,d),this.client.logger.error(d)}},this.addSessionRequestToSessionRequestQueue=t=>{this.sessionRequestQueue.queue.push(t)},this.cleanupAfterResponse=t=>{this.deletePendingSessionRequest(t.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=Ei.idle,this.processSessionRequestQueue()},ve.toMiliseconds(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:t,error:s})=>{const o=this.client.core.history.pending;o.length>0&&o.filter(c=>c.topic===t&&c.request.method==="wc_sessionRequest").forEach(c=>{this.events.emit(Ut("session_request",c.request.id),{error:s})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===Ei.active){this.client.logger.info("session request queue is already active.");return}const t=this.sessionRequestQueue.queue[0];if(!t){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=Ei.active,this.client.events.emit("session_request",t)}catch(s){this.client.logger.error(s)}},this.onPairingCreated=t=>{if(t.active)return;const s=this.client.proposal.getAll().find(o=>o.pairingTopic===t.topic);s&&this.onSessionProposeRequest(t.topic,qn("wc_sessionPropose",{requiredNamespaces:s.requiredNamespaces,optionalNamespaces:s.optionalNamespaces,relays:s.relays,proposer:s.proposer,sessionProperties:s.sessionProperties},s.id))},this.isValidConnect=async t=>{if(!wr(t)){const{message:y}=ce("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(t)}`);throw new Error(y)}const{pairingTopic:s,requiredNamespaces:o,optionalNamespaces:c,sessionProperties:d,relays:f}=t;if(ur(s)||await this.isValidPairingTopic(s),!mD(f,!0)){const{message:y}=ce("MISSING_OR_INVALID",`connect() relays: ${f}`);throw new Error(y)}!ur(o)&&Is(o)!==0&&this.validateNamespaces(o,"requiredNamespaces"),!ur(c)&&Is(c)!==0&&this.validateNamespaces(c,"optionalNamespaces"),ur(d)||this.validateSessionProps(d,"sessionProperties")},this.validateNamespaces=(t,s)=>{const o=vD(t,"connect()",s);if(o)throw new Error(o.message)},this.isValidApprove=async t=>{if(!wr(t))throw new Error(ce("MISSING_OR_INVALID",`approve() params: ${t}`).message);const{id:s,namespaces:o,relayProtocol:c,sessionProperties:d}=t;await this.isValidProposalId(s);const f=this.client.proposal.get(s),y=zc(o,"approve()");if(y)throw new Error(y.message);const g=Of(f.requiredNamespaces,o,"approve()");if(g)throw new Error(g.message);if(!Gt(c,!0)){const{message:m}=ce("MISSING_OR_INVALID",`approve() relayProtocol: ${c}`);throw new Error(m)}ur(d)||this.validateSessionProps(d,"sessionProperties")},this.isValidReject=async t=>{if(!wr(t)){const{message:c}=ce("MISSING_OR_INVALID",`reject() params: ${t}`);throw new Error(c)}const{id:s,reason:o}=t;if(await this.isValidProposalId(s),!_D(o)){const{message:c}=ce("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(o)}`);throw new Error(c)}},this.isValidSessionSettleRequest=t=>{if(!wr(t)){const{message:g}=ce("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${t}`);throw new Error(g)}const{relay:s,controller:o,namespaces:c,expiry:d}=t;if(!hp(s)){const{message:g}=ce("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(g)}const f=lD(o,"onSessionSettleRequest()");if(f)throw new Error(f.message);const y=zc(c,"onSessionSettleRequest()");if(y)throw new Error(y.message);if(Mi(d)){const{message:g}=ce("EXPIRED","onSessionSettleRequest()");throw new Error(g)}},this.isValidUpdate=async t=>{if(!wr(t)){const{message:y}=ce("MISSING_OR_INVALID",`update() params: ${t}`);throw new Error(y)}const{topic:s,namespaces:o}=t;await this.isValidSessionTopic(s);const c=this.client.session.get(s),d=zc(o,"update()");if(d)throw new Error(d.message);const f=Of(c.requiredNamespaces,o,"update()");if(f)throw new Error(f.message)},this.isValidExtend=async t=>{if(!wr(t)){const{message:o}=ce("MISSING_OR_INVALID",`extend() params: ${t}`);throw new Error(o)}const{topic:s}=t;await this.isValidSessionTopic(s)},this.isValidRequest=async t=>{if(!wr(t)){const{message:y}=ce("MISSING_OR_INVALID",`request() params: ${t}`);throw new Error(y)}const{topic:s,request:o,chainId:c,expiry:d}=t;await this.isValidSessionTopic(s);const{namespaces:f}=this.client.session.get(s);if(!xf(f,c)){const{message:y}=ce("MISSING_OR_INVALID",`request() chainId: ${c}`);throw new Error(y)}if(!bD(o)){const{message:y}=ce("MISSING_OR_INVALID",`request() ${JSON.stringify(o)}`);throw new Error(y)}if(!SD(f,c,o.method)){const{message:y}=ce("MISSING_OR_INVALID",`request() method: ${o.method}`);throw new Error(y)}if(d&&!PD(d,Zc)){const{message:y}=ce("MISSING_OR_INVALID",`request() expiry: ${d}. Expiry must be a number (in seconds) between ${Zc.min} and ${Zc.max}`);throw new Error(y)}},this.isValidRespond=async t=>{var s;if(!wr(t)){const{message:d}=ce("MISSING_OR_INVALID",`respond() params: ${t}`);throw new Error(d)}const{topic:o,response:c}=t;try{await this.isValidSessionTopic(o)}catch(d){throw(s=t==null?void 0:t.response)!=null&&s.id&&this.cleanupAfterResponse(t),d}if(!ED(c)){const{message:d}=ce("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(c)}`);throw new Error(d)}},this.isValidPing=async t=>{if(!wr(t)){const{message:o}=ce("MISSING_OR_INVALID",`ping() params: ${t}`);throw new Error(o)}const{topic:s}=t;await this.isValidSessionOrPairingTopic(s)},this.isValidEmit=async t=>{if(!wr(t)){const{message:f}=ce("MISSING_OR_INVALID",`emit() params: ${t}`);throw new Error(f)}const{topic:s,event:o,chainId:c}=t;await this.isValidSessionTopic(s);const{namespaces:d}=this.client.session.get(s);if(!xf(d,c)){const{message:f}=ce("MISSING_OR_INVALID",`emit() chainId: ${c}`);throw new Error(f)}if(!DD(o)){const{message:f}=ce("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(o)}`);throw new Error(f)}if(!ID(d,c,o.name)){const{message:f}=ce("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(o)}`);throw new Error(f)}},this.isValidDisconnect=async t=>{if(!wr(t)){const{message:o}=ce("MISSING_OR_INVALID",`disconnect() params: ${t}`);throw new Error(o)}const{topic:s}=t;await this.isValidSessionOrPairingTopic(s)},this.getVerifyContext=async(t,s)=>{const o={verified:{verifyUrl:s.verifyUrl||Mn,validation:"UNKNOWN",origin:s.url||""}};try{const c=await this.client.core.verify.resolve({attestationId:t,verifyUrl:s.verifyUrl});c&&(o.verified.origin=c.origin,o.verified.isScam=c.isScam,o.verified.validation=c.origin===new URL(s.url).origin?"VALID":"INVALID")}catch(c){this.client.logger.info(c)}return this.client.logger.info(`Verify context: ${JSON.stringify(o)}`),o},this.validateSessionProps=(t,s)=>{Object.values(t).forEach(o=>{if(!Gt(o,!1)){const{message:c}=ce("MISSING_OR_INVALID",`${s} must be in Record format. Received: ${JSON.stringify(o)}`);throw new Error(c)}})}}async isInitialized(){if(!this.initialized){const{message:e}=ce("NOT_INITIALIZED",this.name);throw new Error(e)}await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(er.message,async e=>{const{topic:t,message:s}=e;if(this.ignoredPayloadTypes.includes(this.client.core.crypto.getPayloadType(s)))return;const o=await this.client.core.crypto.decode(t,s);try{Ku(o)?(this.client.core.history.set(t,o),this.onRelayEventRequest({topic:t,payload:o})):ca(o)?(await this.client.core.history.resolve(o),await this.onRelayEventResponse({topic:t,payload:o}),this.client.core.history.delete(t,o.id)):this.onRelayEventUnknownPayload({topic:t,payload:o})}catch(c){this.client.logger.error(c)}})}registerExpirerEvents(){this.client.core.expirer.on(qr.expired,async e=>{const{topic:t,id:s}=cp(e.target);if(s&&this.client.pendingRequest.keys.includes(s))return await this.deletePendingSessionRequest(s,ce("EXPIRED"),!0);t?this.client.session.keys.includes(t)&&(await this.deleteSession({topic:t,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:t})):s&&(await this.deleteProposal(s,!0),this.client.events.emit("proposal_expire",{id:s}))})}registerPairingEvents(){this.client.core.pairing.events.on(ws.create,e=>this.onPairingCreated(e))}isValidPairingTopic(e){if(!Gt(e,!1)){const{message:t}=ce("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(t)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:t}=ce("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(t)}if(Mi(this.client.core.pairing.pairings.get(e).expiry)){const{message:t}=ce("EXPIRED",`pairing topic: ${e}`);throw new Error(t)}}async isValidSessionTopic(e){if(!Gt(e,!1)){const{message:t}=ce("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(t)}if(!this.client.session.keys.includes(e)){const{message:t}=ce("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(t)}if(Mi(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});const{message:t}=ce("EXPIRED",`session topic: ${e}`);throw new Error(t)}if(!this.client.core.crypto.keychain.has(e)){const{message:t}=ce("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),new Error(t)}}async isValidSessionOrPairingTopic(e){if(this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(Gt(e,!1)){const{message:t}=ce("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(t)}else{const{message:t}=ce("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(t)}}async isValidProposalId(e){if(!wD(e)){const{message:t}=ce("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(t)}if(!this.client.proposal.keys.includes(e)){const{message:t}=ce("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(t)}if(Mi(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:t}=ce("EXPIRED",`proposal id: ${e}`);throw new Error(t)}}}class aI extends ha{constructor(e,t){super(e,t,J2,Gu),this.core=e,this.logger=t}}let cI=class extends ha{constructor(e,t){super(e,t,Q2,Gu),this.core=e,this.logger=t}};class uI extends ha{constructor(e,t){super(e,t,Z2,Gu,s=>s.id),this.core=e,this.logger=t}}let hI=class kp extends T3{constructor(e){super(e),this.protocol=zp,this.version=Bp,this.name=Xc.name,this.events=new Fr.EventEmitter,this.on=(s,o)=>this.events.on(s,o),this.once=(s,o)=>this.events.once(s,o),this.off=(s,o)=>this.events.off(s,o),this.removeListener=(s,o)=>this.events.removeListener(s,o),this.removeAllListeners=s=>this.events.removeAllListeners(s),this.connect=async s=>{try{return await this.engine.connect(s)}catch(o){throw this.logger.error(o.message),o}},this.pair=async s=>{try{return await this.engine.pair(s)}catch(o){throw this.logger.error(o.message),o}},this.approve=async s=>{try{return await this.engine.approve(s)}catch(o){throw this.logger.error(o.message),o}},this.reject=async s=>{try{return await this.engine.reject(s)}catch(o){throw this.logger.error(o.message),o}},this.update=async s=>{try{return await this.engine.update(s)}catch(o){throw this.logger.error(o.message),o}},this.extend=async s=>{try{return await this.engine.extend(s)}catch(o){throw this.logger.error(o.message),o}},this.request=async s=>{try{return await this.engine.request(s)}catch(o){throw this.logger.error(o.message),o}},this.respond=async s=>{try{return await this.engine.respond(s)}catch(o){throw this.logger.error(o.message),o}},this.ping=async s=>{try{return await this.engine.ping(s)}catch(o){throw this.logger.error(o.message),o}},this.emit=async s=>{try{return await this.engine.emit(s)}catch(o){throw this.logger.error(o.message),o}},this.disconnect=async s=>{try{return await this.engine.disconnect(s)}catch(o){throw this.logger.error(o.message),o}},this.find=s=>{try{return this.engine.find(s)}catch(o){throw this.logger.error(o.message),o}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(s){throw this.logger.error(s.message),s}},this.name=(e==null?void 0:e.name)||Xc.name,this.metadata=(e==null?void 0:e.metadata)||UE();const t=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:Je.pino(Je.getDefaultLoggerOptions({level:(e==null?void 0:e.logger)||Xc.logger}));this.core=(e==null?void 0:e.core)||new Y2(e),this.logger=Je.generateChildLogger(t,this.name),this.session=new cI(this.core,this.logger),this.proposal=new aI(this.core,this.logger),this.pendingRequest=new uI(this.core,this.logger),this.engine=new oI(this)}static async init(e){const t=new kp(e);return await t.initialize(),t}get context(){return Je.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 Eu={exports:{}};(function(i,e){var t=typeof self<"u"?self:Yr,s=function(){function c(){this.fetch=!1,this.DOMException=t.DOMException}return c.prototype=t,new c}();(function(c){(function(d){var f={searchParams:"URLSearchParams"in c,iterable:"Symbol"in c&&"iterator"in Symbol,blob:"FileReader"in c&&"Blob"in c&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in c,arrayBuffer:"ArrayBuffer"in c};function y(b){return b&&DataView.prototype.isPrototypeOf(b)}if(f.arrayBuffer)var g=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],m=ArrayBuffer.isView||function(b){return b&&g.indexOf(Object.prototype.toString.call(b))>-1};function D(b){if(typeof b!="string"&&(b=String(b)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(b))throw new TypeError("Invalid character in header field name");return b.toLowerCase()}function I(b){return typeof b!="string"&&(b=String(b)),b}function T(b){var C={next:function(){var ee=b.shift();return{done:ee===void 0,value:ee}}};return f.iterable&&(C[Symbol.iterator]=function(){return C}),C}function P(b){this.map={},b instanceof P?b.forEach(function(C,ee){this.append(ee,C)},this):Array.isArray(b)?b.forEach(function(C){this.append(C[0],C[1])},this):b&&Object.getOwnPropertyNames(b).forEach(function(C){this.append(C,b[C])},this)}P.prototype.append=function(b,C){b=D(b),C=I(C);var ee=this.map[b];this.map[b]=ee?ee+", "+C:C},P.prototype.delete=function(b){delete this.map[D(b)]},P.prototype.get=function(b){return b=D(b),this.has(b)?this.map[b]:null},P.prototype.has=function(b){return this.map.hasOwnProperty(D(b))},P.prototype.set=function(b,C){this.map[D(b)]=I(C)},P.prototype.forEach=function(b,C){for(var ee in this.map)this.map.hasOwnProperty(ee)&&b.call(C,this.map[ee],ee,this)},P.prototype.keys=function(){var b=[];return this.forEach(function(C,ee){b.push(ee)}),T(b)},P.prototype.values=function(){var b=[];return this.forEach(function(C){b.push(C)}),T(b)},P.prototype.entries=function(){var b=[];return this.forEach(function(C,ee){b.push([ee,C])}),T(b)},f.iterable&&(P.prototype[Symbol.iterator]=P.prototype.entries);function z(b){if(b.bodyUsed)return Promise.reject(new TypeError("Already read"));b.bodyUsed=!0}function H(b){return new Promise(function(C,ee){b.onload=function(){C(b.result)},b.onerror=function(){ee(b.error)}})}function ie(b){var C=new FileReader,ee=H(C);return C.readAsArrayBuffer(b),ee}function U(b){var C=new FileReader,ee=H(C);return C.readAsText(b),ee}function j(b){for(var C=new Uint8Array(b),ee=new Array(C.length),Q=0;Q-1?C:b}function _(b,C){C=C||{};var ee=C.body;if(b instanceof _){if(b.bodyUsed)throw new TypeError("Already read");this.url=b.url,this.credentials=b.credentials,C.headers||(this.headers=new P(b.headers)),this.method=b.method,this.mode=b.mode,this.signal=b.signal,!ee&&b._bodyInit!=null&&(ee=b._bodyInit,b.bodyUsed=!0)}else this.url=String(b);if(this.credentials=C.credentials||this.credentials||"same-origin",(C.headers||!this.headers)&&(this.headers=new P(C.headers)),this.method=u(C.method||this.method||"GET"),this.mode=C.mode||this.mode||null,this.signal=C.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&ee)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(ee)}_.prototype.clone=function(){return new _(this,{body:this._bodyInit})};function G(b){var C=new FormData;return b.trim().split("&").forEach(function(ee){if(ee){var Q=ee.split("="),k=Q.shift().replace(/\+/g," "),V=Q.join("=").replace(/\+/g," ");C.append(decodeURIComponent(k),decodeURIComponent(V))}}),C}function W(b){var C=new P,ee=b.replace(/\r?\n[\t ]+/g," ");return ee.split(/\r?\n/).forEach(function(Q){var k=Q.split(":"),V=k.shift().trim();if(V){var J=k.join(":").trim();C.append(V,J)}}),C}A.call(_.prototype);function se(b,C){C||(C={}),this.type="default",this.status=C.status===void 0?200:C.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in C?C.statusText:"OK",this.headers=new P(C.headers),this.url=C.url||"",this._initBody(b)}A.call(se.prototype),se.prototype.clone=function(){return new se(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new P(this.headers),url:this.url})},se.error=function(){var b=new se(null,{status:0,statusText:""});return b.type="error",b};var ue=[301,302,303,307,308];se.redirect=function(b,C){if(ue.indexOf(C)===-1)throw new RangeError("Invalid status code");return new se(null,{status:C,headers:{location:b}})},d.DOMException=c.DOMException;try{new d.DOMException}catch{d.DOMException=function(C,ee){this.message=C,this.name=ee;var Q=Error(C);this.stack=Q.stack},d.DOMException.prototype=Object.create(Error.prototype),d.DOMException.prototype.constructor=d.DOMException}function de(b,C){return new Promise(function(ee,Q){var k=new _(b,C);if(k.signal&&k.signal.aborted)return Q(new d.DOMException("Aborted","AbortError"));var V=new XMLHttpRequest;function J(){V.abort()}V.onload=function(){var re={status:V.status,statusText:V.statusText,headers:W(V.getAllResponseHeaders()||"")};re.url="responseURL"in V?V.responseURL:re.headers.get("X-Request-URL");var _e="response"in V?V.response:V.responseText;ee(new se(_e,re))},V.onerror=function(){Q(new TypeError("Network request failed"))},V.ontimeout=function(){Q(new TypeError("Network request failed"))},V.onabort=function(){Q(new d.DOMException("Aborted","AbortError"))},V.open(k.method,k.url,!0),k.credentials==="include"?V.withCredentials=!0:k.credentials==="omit"&&(V.withCredentials=!1),"responseType"in V&&f.blob&&(V.responseType="blob"),k.headers.forEach(function(re,_e){V.setRequestHeader(_e,re)}),k.signal&&(k.signal.addEventListener("abort",J),V.onreadystatechange=function(){V.readyState===4&&k.signal.removeEventListener("abort",J)}),V.send(typeof k._bodyInit>"u"?null:k._bodyInit)})}return de.polyfill=!0,c.fetch||(c.fetch=de,c.Headers=P,c.Request=_,c.Response=se),d.Headers=P,d.Request=_,d.Response=se,d.fetch=de,Object.defineProperty(d,"__esModule",{value:!0}),d})({})})(s),s.fetch.ponyfill=!0,delete s.fetch.polyfill;var o=s;e=o.fetch,e.default=o.fetch,e.fetch=o.fetch,e.Headers=o.Headers,e.Request=o.Request,e.Response=o.Response,i.exports=e})(Eu,Eu.exports);var lI=Eu.exports;const _d=Ou(lI),fI={Accept:"application/json","Content-Type":"application/json"},dI="POST",bd={headers:fI,method:dI},Ed=10;class zi{constructor(e,t=!1){if(this.url=e,this.disableProviderPing=t,this.events=new Fr.EventEmitter,this.isAvailable=!1,this.registering=!1,!Wf(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=t}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e,t){this.isAvailable||await this.register();try{const s=cn(e),c=await(await _d(this.url,Object.assign(Object.assign({},bd),{body:s}))).json();this.onPayload({data:c})}catch(s){this.onError(e.id,s)}}async register(e=this.url){if(!Wf(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const t=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=t||this.events.listenerCount("open")>=t)&&this.events.setMaxListeners(t+1),new Promise((s,o)=>{this.events.once("register_error",c=>{this.resetMaxListeners(),o(c)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return o(new Error("HTTP connection is missing or invalid"));s()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const t=cn({id:1,jsonrpc:"2.0",method:"test",params:[]});await _d(e,Object.assign(Object.assign({},bd),{body:t}))}this.onOpen()}catch(t){const s=this.parseError(t);throw this.events.emit("register_error",s),this.onClose(),s}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const t=typeof e.data=="string"?Ts(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const s=this.parseError(t),o=s.message||s.toString(),c=aa(e,o);this.events.emit("payload",c)}parseError(e,t=this.url){return Ep(e,t,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>Ed&&this.events.setMaxListeners(Ed)}}const Dd="error",pI="wss://relay.walletconnect.com",gI="wc",yI="universal_provider",Sd=`${gI}@2:${yI}:`,vI="https://rpc.walletconnect.com/v1/",Ii={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var vs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Du={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(i,e){(function(){var t,s="4.17.21",o=200,c="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",d="Expected a function",f="Invalid `variable` option passed into `_.template`",y="__lodash_hash_undefined__",g=500,m="__lodash_placeholder__",D=1,I=2,T=4,P=1,z=2,H=1,ie=2,U=4,j=8,O=16,A=32,E=64,u=128,_=256,G=512,W=30,se="...",ue=800,de=16,b=1,C=2,ee=3,Q=1/0,k=9007199254740991,V=17976931348623157e292,J=NaN,re=4294967295,_e=re-1,oe=re>>>1,be=[["ary",u],["bind",H],["bindKey",ie],["curry",j],["curryRight",O],["flip",G],["partial",A],["partialRight",E],["rearg",_]],le="[object Arguments]",me="[object Array]",B="[object AsyncFunction]",F="[object Boolean]",L="[object Date]",l="[object DOMException]",R="[object Error]",ae="[object Function]",fe="[object GeneratorFunction]",Ie="[object Map]",Be="[object Number]",ke="[object Null]",Me="[object Object]",pt="[object Promise]",gt="[object Proxy]",qe="[object RegExp]",xe="[object Set]",Ne="[object String]",Ue="[object Symbol]",Fe="[object Undefined]",Pe="[object WeakMap]",Le="[object WeakSet]",Se="[object ArrayBuffer]",Ce="[object DataView]",He="[object Float32Array]",Oe="[object Float64Array]",Ve="[object Int8Array]",We="[object Int16Array]",et="[object Int32Array]",tt="[object Uint8Array]",Qe="[object Uint8ClampedArray]",tr="[object Uint16Array]",fr="[object Uint32Array]",Jr=/\b__p \+= '';/g,rr=/\b(__p \+=) '' \+/g,oi=/(__e\(.*?\)|\b__t\)) \+\n'';/g,xi=/&(?:amp|lt|gt|quot|#39);/g,Bi=/[&<>"']/g,Dt=RegExp(xi.source),yt=RegExp(Bi.source),St=/<%-([\s\S]+?)%>/g,It=/<%([\s\S]+?)%>/g,bt=/<%=([\s\S]+?)%>/g,vt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Lt=/^\w*$/,$t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,xt=/[\\^$.*+?()[\]{}|]/g,Mt=RegExp(xt.source),Ot=/^\s+/,At=/\s/,Pt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ht=/\{\n\/\* \[wrapped with (.+)\] \*/,jt=/,? & /,qt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,la=/[()=,{}\[\]\/\s]/,fa=/\\(\\)?/g,da=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ar=/\w*$/,pa=/^[-+]0x[0-9a-f]+$/i,ga=/^0b[01]+$/i,ya=/^\[object .+?Constructor\]$/,va=/^0o[0-7]+$/i,ma=/^(?:0|[1-9]\d*)$/,ai=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,pn=/($^)/,wa=/['\n\r\u2028\u2029\\]/g,gn="\\ud800-\\udfff",_a="\\u0300-\\u036f",ba="\\ufe20-\\ufe2f",yn="\\u20d0-\\u20ff",Ns=_a+ba+yn,Us="\\u2700-\\u27bf",zr="a-z\\xdf-\\xf6\\xf8-\\xff",Ea="\\xac\\xb1\\xd7\\xf7",Da="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Sa="\\u2000-\\u206f",Ia=" \\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",Ls="A-Z\\xc0-\\xd6\\xd8-\\xde",$s="\\ufe0e\\ufe0f",Hi=Ea+Da+Sa+Ia,Vn="['’]",Ki="["+gn+"]",Gn="["+Hi+"]",ki="["+Ns+"]",Ms="\\d+",xa="["+Us+"]",js="["+zr+"]",qs="[^"+gn+Hi+Ms+Us+zr+Ls+"]",vn="\\ud83c[\\udffb-\\udfff]",Oa="(?:"+ki+"|"+vn+")",Fs="[^"+gn+"]",mn="(?:\\ud83c[\\udde6-\\uddff]){2}",Oi="[\\ud800-\\udbff][\\udc00-\\udfff]",br="["+Ls+"]",zs="\\u200d",Bs="(?:"+js+"|"+qs+")",Qr="(?:"+br+"|"+qs+")",Hs="(?:"+Vn+"(?:d|ll|m|re|s|t|ve))?",Ks="(?:"+Vn+"(?:D|LL|M|RE|S|T|VE))?",ks=Oa+"?",Vs="["+$s+"]?",Pa="(?:"+zs+"(?:"+[Fs,mn,Oi].join("|")+")"+Vs+ks+")*",ci="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Gs="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ws=Vs+ks+Pa,wn="(?:"+[xa,mn,Oi].join("|")+")"+Ws,Ca="(?:"+[Fs+ki+"?",ki,mn,Oi,Ki].join("|")+")",Wn=RegExp(Vn,"g"),Aa=RegExp(ki,"g"),_n=RegExp(vn+"(?="+vn+")|"+Ca+Ws,"g"),Ys=RegExp([br+"?"+js+"+"+Hs+"(?="+[Gn,br,"$"].join("|")+")",Qr+"+"+Ks+"(?="+[Gn,br+Bs,"$"].join("|")+")",br+"?"+Bs+"+"+Hs,br+"+"+Ks,Gs,ci,Ms,wn].join("|"),"g"),Js=RegExp("["+zs+gn+Ns+$s+"]"),Vi=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Qs=["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"],Ta=-1,ot={};ot[He]=ot[Oe]=ot[Ve]=ot[We]=ot[et]=ot[tt]=ot[Qe]=ot[tr]=ot[fr]=!0,ot[le]=ot[me]=ot[Se]=ot[F]=ot[Ce]=ot[L]=ot[R]=ot[ae]=ot[Ie]=ot[Be]=ot[Me]=ot[qe]=ot[xe]=ot[Ne]=ot[Pe]=!1;var st={};st[le]=st[me]=st[Se]=st[Ce]=st[F]=st[L]=st[He]=st[Oe]=st[Ve]=st[We]=st[et]=st[Ie]=st[Be]=st[Me]=st[qe]=st[xe]=st[Ne]=st[Ue]=st[tt]=st[Qe]=st[tr]=st[fr]=!0,st[R]=st[ae]=st[Pe]=!1;var S={À:"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"},$={"&":"&","<":"<",">":">",'"':""","'":"'"},te={"&":"&","<":"<",">":">",""":'"',"'":"'"},pe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},at=parseFloat,Te=parseInt,ft=typeof vs=="object"&&vs&&vs.Object===Object&&vs,Ft=typeof self=="object"&&self&&self.Object===Object&&self,Xe=ft||Ft||Function("return this")(),ct=e&&!e.nodeType&&e,Tt=ct&&!0&&i&&!i.nodeType&&i,dr=Tt&&Tt.exports===ct,zt=dr&&ft.process,dt=function(){try{var M=Tt&&Tt.require&&Tt.require("util").types;return M||zt&&zt.binding&&zt.binding("util")}catch{}}(),ir=dt&&dt.isArrayBuffer,Br=dt&&dt.isDate,Tr=dt&&dt.isMap,Xr=dt&&dt.isRegExp,Yn=dt&&dt.isSet,Gi=dt&&dt.isTypedArray;function Kt(M,Y,K){switch(K.length){case 0:return M.call(Y);case 1:return M.call(Y,K[0]);case 2:return M.call(Y,K[0],K[1]);case 3:return M.call(Y,K[0],K[1],K[2])}return M.apply(Y,K)}function Wp(M,Y,K,ge){for(var Ae=-1,rt=M==null?0:M.length;++Ae-1}function Ra(M,Y,K){for(var ge=-1,Ae=M==null?0:M.length;++ge-1;);return K}function ih(M,Y){for(var K=M.length;K--&&bn(Y,M[K],0)>-1;);return K}function ig(M,Y){for(var K=M.length,ge=0;K--;)M[K]===Y&&++ge;return ge}var ng=$a(S),sg=$a($);function og(M){return"\\"+pe[M]}function ag(M,Y){return M==null?t:M[Y]}function En(M){return Js.test(M)}function cg(M){return Vi.test(M)}function ug(M){for(var Y,K=[];!(Y=M.next()).done;)K.push(Y.value);return K}function Fa(M){var Y=-1,K=Array(M.size);return M.forEach(function(ge,Ae){K[++Y]=[Ae,ge]}),K}function nh(M,Y){return function(K){return M(Y(K))}}function Ai(M,Y){for(var K=-1,ge=M.length,Ae=0,rt=[];++K-1}function Jg(r,n){var a=this.__data__,h=yo(a,r);return h<0?(++this.size,a.push([r,n])):a[h][1]=n,this}ui.prototype.clear=Vg,ui.prototype.delete=Gg,ui.prototype.get=Wg,ui.prototype.has=Yg,ui.prototype.set=Jg;function hi(r){var n=-1,a=r==null?0:r.length;for(this.clear();++n=n?r:n)),r}function Lr(r,n,a,h,p,w){var x,N=n&D,q=n&I,X=n&T;if(a&&(x=p?a(r,h,p,w):a(r)),x!==t)return x;if(!Et(r))return r;var Z=Re(r);if(Z){if(x=ey(r),!N)return pr(r,x)}else{var ne=Xt(r),he=ne==ae||ne==fe;if($i(r))return Fh(r,N);if(ne==Me||ne==le||he&&!p){if(x=q||he?{}:sl(r),!N)return q?H0(r,f0(x,r)):B0(r,yh(x,r))}else{if(!st[ne])return p?r:{};x=ty(r,ne,N)}}w||(w=new Kr);var ye=w.get(r);if(ye)return ye;w.set(r,x),Ul(r)?r.forEach(function(De){x.add(Lr(De,n,a,De,r,w))}):Rl(r)&&r.forEach(function(De,Ge){x.set(Ge,Lr(De,n,a,Ge,r,w))});var Ee=X?q?fc:lc:q?yr:kt,ze=Z?t:Ee(r);return Rr(ze||r,function(De,Ge){ze&&(Ge=De,De=r[Ge]),rs(x,Ge,Lr(De,n,a,Ge,r,w))}),x}function d0(r){var n=kt(r);return function(a){return vh(a,r,n)}}function vh(r,n,a){var h=a.length;if(r==null)return!h;for(r=ut(r);h--;){var p=a[h],w=n[p],x=r[p];if(x===t&&!(p in r)||!w(x))return!1}return!0}function mh(r,n,a){if(typeof r!="function")throw new Nr(d);return us(function(){r.apply(t,a)},n)}function is(r,n,a,h){var p=-1,w=Xs,x=!0,N=r.length,q=[],X=n.length;if(!N)return q;a&&(n=mt(n,Er(a))),h?(w=Ra,x=!1):n.length>=o&&(w=Jn,x=!1,n=new Ji(n));e:for(;++pp?0:p+a),h=h===t||h>p?p:je(h),h<0&&(h+=p),h=a>h?0:$l(h);a0&&a(N)?n>1?Wt(N,n-1,a,h,p):Ci(p,N):h||(p[p.length]=N)}return p}var Ga=Vh(),bh=Vh(!0);function Zr(r,n){return r&&Ga(r,n,kt)}function Wa(r,n){return r&&bh(r,n,kt)}function mo(r,n){return Pi(n,function(a){return gi(r[a])})}function Xi(r,n){n=Ui(n,r);for(var a=0,h=n.length;r!=null&&an}function y0(r,n){return r!=null&&nt.call(r,n)}function v0(r,n){return r!=null&&n in ut(r)}function m0(r,n,a){return r>=Qt(n,a)&&r=120&&Z.length>=120)?new Ji(x&&Z):t}Z=r[0];var ne=-1,he=N[0];e:for(;++ne-1;)N!==r&&co.call(N,q,1),co.call(r,q,1);return r}function Rh(r,n){for(var a=r?n.length:0,h=a-1;a--;){var p=n[a];if(a==h||p!==w){var w=p;pi(p)?co.call(r,p,1):nc(r,p)}}return r}function tc(r,n){return r+lo(fh()*(n-r+1))}function T0(r,n,a,h){for(var p=-1,w=Ht(ho((n-r)/(a||1)),0),x=K(w);w--;)x[h?w:++p]=r,r+=a;return x}function rc(r,n){var a="";if(!r||n<1||n>k)return a;do n%2&&(a+=r),n=lo(n/2),n&&(r+=r);while(n);return a}function Ke(r,n){return wc(cl(r,n,vr),r+"")}function R0(r){return gh(Nn(r))}function N0(r,n){var a=Nn(r);return Co(a,Qi(n,0,a.length))}function os(r,n,a,h){if(!Et(r))return r;n=Ui(n,r);for(var p=-1,w=n.length,x=w-1,N=r;N!=null&&++pp?0:p+n),a=a>p?p:a,a<0&&(a+=p),p=n>a?0:a-n>>>0,n>>>=0;for(var w=K(p);++h>>1,x=r[w];x!==null&&!Sr(x)&&(a?x<=n:x=o){var X=n?null:G0(r);if(X)return eo(X);x=!1,p=Jn,q=new Ji}else q=n?[]:N;e:for(;++h=h?r:$r(r,n,a)}var qh=Sg||function(r){return Xe.clearTimeout(r)};function Fh(r,n){if(n)return r.slice();var a=r.length,h=ah?ah(a):new r.constructor(a);return r.copy(h),h}function cc(r){var n=new r.constructor(r.byteLength);return new oo(n).set(new oo(r)),n}function j0(r,n){var a=n?cc(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.byteLength)}function q0(r){var n=new r.constructor(r.source,Ar.exec(r));return n.lastIndex=r.lastIndex,n}function F0(r){return ts?ut(ts.call(r)):{}}function zh(r,n){var a=n?cc(r.buffer):r.buffer;return new r.constructor(a,r.byteOffset,r.length)}function Bh(r,n){if(r!==n){var a=r!==t,h=r===null,p=r===r,w=Sr(r),x=n!==t,N=n===null,q=n===n,X=Sr(n);if(!N&&!X&&!w&&r>n||w&&x&&q&&!N&&!X||h&&x&&q||!a&&q||!p)return 1;if(!h&&!w&&!X&&r=N)return q;var X=a[h];return q*(X=="desc"?-1:1)}}return r.index-n.index}function Hh(r,n,a,h){for(var p=-1,w=r.length,x=a.length,N=-1,q=n.length,X=Ht(w-x,0),Z=K(q+X),ne=!h;++N1?a[p-1]:t,x=p>2?a[2]:t;for(w=r.length>3&&typeof w=="function"?(p--,w):t,x&&sr(a[0],a[1],x)&&(w=p<3?t:w,p=1),n=ut(n);++h-1?p[w?n[x]:x]:t}}function Yh(r){return di(function(n){var a=n.length,h=a,p=Ur.prototype.thru;for(r&&n.reverse();h--;){var w=n[h];if(typeof w!="function")throw new Nr(d);if(p&&!x&&Oo(w)=="wrapper")var x=new Ur([],!0)}for(h=x?h:a;++h1&&Ze.reverse(),Z&&qN))return!1;var X=w.get(r),Z=w.get(n);if(X&&Z)return X==n&&Z==r;var ne=-1,he=!0,ye=a&z?new Ji:t;for(w.set(r,n),w.set(n,r);++ne1?"& ":"")+n[h],n=n.join(a>2?", ":" "),r.replace(Pt,`{ +/* [wrapped with `+n+`] */ +`)}function iy(r){return Re(r)||tn(r)||!!(hh&&r&&r[hh])}function pi(r,n){var a=typeof r;return n=n??k,!!n&&(a=="number"||a!="symbol"&&ma.test(r))&&r>-1&&r%1==0&&r0){if(++n>=ue)return arguments[0]}else n=0;return r.apply(t,arguments)}}function Co(r,n){var a=-1,h=r.length,p=h-1;for(n=n===t?h:n;++a1?r[n-1]:t;return a=typeof a=="function"?(r.pop(),a):t,_l(r,a)});function bl(r){var n=v(r);return n.__chain__=!0,n}function pv(r,n){return n(r),r}function Ao(r,n){return n(r)}var gv=di(function(r){var n=r.length,a=n?r[0]:0,h=this.__wrapped__,p=function(w){return Va(w,r)};return n>1||this.__actions__.length||!(h instanceof Ye)||!pi(a)?this.thru(p):(h=h.slice(a,+a+(n?1:0)),h.__actions__.push({func:Ao,args:[p],thisArg:t}),new Ur(h,this.__chain__).thru(function(w){return n&&!w.length&&w.push(t),w}))});function yv(){return bl(this)}function vv(){return new Ur(this.value(),this.__chain__)}function mv(){this.__values__===t&&(this.__values__=Ll(this.value()));var r=this.__index__>=this.__values__.length,n=r?t:this.__values__[this.__index__++];return{done:r,value:n}}function wv(){return this}function _v(r){for(var n,a=this;a instanceof go;){var h=pl(a);h.__index__=0,h.__values__=t,n?p.__wrapped__=h:n=h;var p=h;a=a.__wrapped__}return p.__wrapped__=r,n}function bv(){var r=this.__wrapped__;if(r instanceof Ye){var n=r;return this.__actions__.length&&(n=new Ye(this)),n=n.reverse(),n.__actions__.push({func:Ao,args:[_c],thisArg:t}),new Ur(n,this.__chain__)}return this.thru(_c)}function Ev(){return Mh(this.__wrapped__,this.__actions__)}var Dv=Eo(function(r,n,a){nt.call(r,a)?++r[a]:li(r,a,1)});function Sv(r,n,a){var h=Re(r)?Ju:p0;return a&&sr(r,n,a)&&(n=t),h(r,we(n,3))}function Iv(r,n){var a=Re(r)?Pi:_h;return a(r,we(n,3))}var xv=Wh(gl),Ov=Wh(yl);function Pv(r,n){return Wt(To(r,n),1)}function Cv(r,n){return Wt(To(r,n),Q)}function Av(r,n,a){return a=a===t?1:je(a),Wt(To(r,n),a)}function El(r,n){var a=Re(r)?Rr:Ri;return a(r,we(n,3))}function Dl(r,n){var a=Re(r)?Yp:wh;return a(r,we(n,3))}var Tv=Eo(function(r,n,a){nt.call(r,a)?r[a].push(n):li(r,a,[n])});function Rv(r,n,a,h){r=gr(r)?r:Nn(r),a=a&&!h?je(a):0;var p=r.length;return a<0&&(a=Ht(p+a,0)),$o(r)?a<=p&&r.indexOf(n,a)>-1:!!p&&bn(r,n,a)>-1}var Nv=Ke(function(r,n,a){var h=-1,p=typeof n=="function",w=gr(r)?K(r.length):[];return Ri(r,function(x){w[++h]=p?Kt(n,x,a):ns(x,n,a)}),w}),Uv=Eo(function(r,n,a){li(r,a,n)});function To(r,n){var a=Re(r)?mt:xh;return a(r,we(n,3))}function Lv(r,n,a,h){return r==null?[]:(Re(n)||(n=n==null?[]:[n]),a=h?t:a,Re(a)||(a=a==null?[]:[a]),Ah(r,n,a))}var $v=Eo(function(r,n,a){r[a?0:1].push(n)},function(){return[[],[]]});function Mv(r,n,a){var h=Re(r)?Na:eh,p=arguments.length<3;return h(r,we(n,4),a,p,Ri)}function jv(r,n,a){var h=Re(r)?Jp:eh,p=arguments.length<3;return h(r,we(n,4),a,p,wh)}function qv(r,n){var a=Re(r)?Pi:_h;return a(r,Uo(we(n,3)))}function Fv(r){var n=Re(r)?gh:R0;return n(r)}function zv(r,n,a){(a?sr(r,n,a):n===t)?n=1:n=je(n);var h=Re(r)?u0:N0;return h(r,n)}function Bv(r){var n=Re(r)?h0:L0;return n(r)}function Hv(r){if(r==null)return 0;if(gr(r))return $o(r)?Dn(r):r.length;var n=Xt(r);return n==Ie||n==xe?r.size:Xa(r).length}function Kv(r,n,a){var h=Re(r)?Ua:$0;return a&&sr(r,n,a)&&(n=t),h(r,we(n,3))}var kv=Ke(function(r,n){if(r==null)return[];var a=n.length;return a>1&&sr(r,n[0],n[1])?n=[]:a>2&&sr(n[0],n[1],n[2])&&(n=[n[0]]),Ah(r,Wt(n,1),[])}),Ro=Ig||function(){return Xe.Date.now()};function Vv(r,n){if(typeof n!="function")throw new Nr(d);return r=je(r),function(){if(--r<1)return n.apply(this,arguments)}}function Sl(r,n,a){return n=a?t:n,n=r&&n==null?r.length:n,fi(r,u,t,t,t,t,n)}function Il(r,n){var a;if(typeof n!="function")throw new Nr(d);return r=je(r),function(){return--r>0&&(a=n.apply(this,arguments)),r<=1&&(n=t),a}}var Ec=Ke(function(r,n,a){var h=H;if(a.length){var p=Ai(a,Tn(Ec));h|=A}return fi(r,h,n,a,p)}),xl=Ke(function(r,n,a){var h=H|ie;if(a.length){var p=Ai(a,Tn(xl));h|=A}return fi(n,h,r,a,p)});function Ol(r,n,a){n=a?t:n;var h=fi(r,j,t,t,t,t,t,n);return h.placeholder=Ol.placeholder,h}function Pl(r,n,a){n=a?t:n;var h=fi(r,O,t,t,t,t,t,n);return h.placeholder=Pl.placeholder,h}function Cl(r,n,a){var h,p,w,x,N,q,X=0,Z=!1,ne=!1,he=!0;if(typeof r!="function")throw new Nr(d);n=jr(n)||0,Et(a)&&(Z=!!a.leading,ne="maxWait"in a,w=ne?Ht(jr(a.maxWait)||0,n):w,he="trailing"in a?!!a.trailing:he);function ye(Nt){var Vr=h,vi=p;return h=p=t,X=Nt,x=r.apply(vi,Vr),x}function Ee(Nt){return X=Nt,N=us(Ge,n),Z?ye(Nt):x}function ze(Nt){var Vr=Nt-q,vi=Nt-X,Wl=n-Vr;return ne?Qt(Wl,w-vi):Wl}function De(Nt){var Vr=Nt-q,vi=Nt-X;return q===t||Vr>=n||Vr<0||ne&&vi>=w}function Ge(){var Nt=Ro();if(De(Nt))return Ze(Nt);N=us(Ge,ze(Nt))}function Ze(Nt){return N=t,he&&h?ye(Nt):(h=p=t,x)}function Ir(){N!==t&&qh(N),X=0,h=q=p=N=t}function or(){return N===t?x:Ze(Ro())}function xr(){var Nt=Ro(),Vr=De(Nt);if(h=arguments,p=this,q=Nt,Vr){if(N===t)return Ee(q);if(ne)return qh(N),N=us(Ge,n),ye(q)}return N===t&&(N=us(Ge,n)),x}return xr.cancel=Ir,xr.flush=or,xr}var Gv=Ke(function(r,n){return mh(r,1,n)}),Wv=Ke(function(r,n,a){return mh(r,jr(n)||0,a)});function Yv(r){return fi(r,G)}function No(r,n){if(typeof r!="function"||n!=null&&typeof n!="function")throw new Nr(d);var a=function(){var h=arguments,p=n?n.apply(this,h):h[0],w=a.cache;if(w.has(p))return w.get(p);var x=r.apply(this,h);return a.cache=w.set(p,x)||w,x};return a.cache=new(No.Cache||hi),a}No.Cache=hi;function Uo(r){if(typeof r!="function")throw new Nr(d);return function(){var n=arguments;switch(n.length){case 0:return!r.call(this);case 1:return!r.call(this,n[0]);case 2:return!r.call(this,n[0],n[1]);case 3:return!r.call(this,n[0],n[1],n[2])}return!r.apply(this,n)}}function Jv(r){return Il(2,r)}var Qv=M0(function(r,n){n=n.length==1&&Re(n[0])?mt(n[0],Er(we())):mt(Wt(n,1),Er(we()));var a=n.length;return Ke(function(h){for(var p=-1,w=Qt(h.length,a);++p=n}),tn=Dh(function(){return arguments}())?Dh:function(r){return Ct(r)&&nt.call(r,"callee")&&!uh.call(r,"callee")},Re=K.isArray,fm=ir?Er(ir):_0;function gr(r){return r!=null&&Lo(r.length)&&!gi(r)}function Rt(r){return Ct(r)&&gr(r)}function dm(r){return r===!0||r===!1||Ct(r)&&nr(r)==F}var $i=Og||Uc,pm=Br?Er(Br):b0;function gm(r){return Ct(r)&&r.nodeType===1&&!hs(r)}function ym(r){if(r==null)return!0;if(gr(r)&&(Re(r)||typeof r=="string"||typeof r.splice=="function"||$i(r)||Rn(r)||tn(r)))return!r.length;var n=Xt(r);if(n==Ie||n==xe)return!r.size;if(cs(r))return!Xa(r).length;for(var a in r)if(nt.call(r,a))return!1;return!0}function vm(r,n){return ss(r,n)}function mm(r,n,a){a=typeof a=="function"?a:t;var h=a?a(r,n):t;return h===t?ss(r,n,t,a):!!h}function Sc(r){if(!Ct(r))return!1;var n=nr(r);return n==R||n==l||typeof r.message=="string"&&typeof r.name=="string"&&!hs(r)}function wm(r){return typeof r=="number"&&lh(r)}function gi(r){if(!Et(r))return!1;var n=nr(r);return n==ae||n==fe||n==B||n==gt}function Tl(r){return typeof r=="number"&&r==je(r)}function Lo(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=k}function Et(r){var n=typeof r;return r!=null&&(n=="object"||n=="function")}function Ct(r){return r!=null&&typeof r=="object"}var Rl=Tr?Er(Tr):D0;function _m(r,n){return r===n||Qa(r,n,pc(n))}function bm(r,n,a){return a=typeof a=="function"?a:t,Qa(r,n,pc(n),a)}function Em(r){return Nl(r)&&r!=+r}function Dm(r){if(oy(r))throw new Ae(c);return Sh(r)}function Sm(r){return r===null}function Im(r){return r==null}function Nl(r){return typeof r=="number"||Ct(r)&&nr(r)==Be}function hs(r){if(!Ct(r)||nr(r)!=Me)return!1;var n=ao(r);if(n===null)return!0;var a=nt.call(n,"constructor")&&n.constructor;return typeof a=="function"&&a instanceof a&&io.call(a)==bg}var Ic=Xr?Er(Xr):S0;function xm(r){return Tl(r)&&r>=-k&&r<=k}var Ul=Yn?Er(Yn):I0;function $o(r){return typeof r=="string"||!Re(r)&&Ct(r)&&nr(r)==Ne}function Sr(r){return typeof r=="symbol"||Ct(r)&&nr(r)==Ue}var Rn=Gi?Er(Gi):x0;function Om(r){return r===t}function Pm(r){return Ct(r)&&Xt(r)==Pe}function Cm(r){return Ct(r)&&nr(r)==Le}var Am=xo(Za),Tm=xo(function(r,n){return r<=n});function Ll(r){if(!r)return[];if(gr(r))return $o(r)?Hr(r):pr(r);if(Qn&&r[Qn])return ug(r[Qn]());var n=Xt(r),a=n==Ie?Fa:n==xe?eo:Nn;return a(r)}function yi(r){if(!r)return r===0?r:0;if(r=jr(r),r===Q||r===-Q){var n=r<0?-1:1;return n*V}return r===r?r:0}function je(r){var n=yi(r),a=n%1;return n===n?a?n-a:n:0}function $l(r){return r?Qi(je(r),0,re):0}function jr(r){if(typeof r=="number")return r;if(Sr(r))return J;if(Et(r)){var n=typeof r.valueOf=="function"?r.valueOf():r;r=Et(n)?n+"":n}if(typeof r!="string")return r===0?r:+r;r=th(r);var a=ga.test(r);return a||va.test(r)?Te(r.slice(2),a?2:8):pa.test(r)?J:+r}function Ml(r){return ei(r,yr(r))}function Rm(r){return r?Qi(je(r),-k,k):r===0?r:0}function it(r){return r==null?"":Dr(r)}var Nm=Cn(function(r,n){if(cs(n)||gr(n)){ei(n,kt(n),r);return}for(var a in n)nt.call(n,a)&&rs(r,a,n[a])}),jl=Cn(function(r,n){ei(n,yr(n),r)}),Mo=Cn(function(r,n,a,h){ei(n,yr(n),r,h)}),Um=Cn(function(r,n,a,h){ei(n,kt(n),r,h)}),Lm=di(Va);function $m(r,n){var a=Pn(r);return n==null?a:yh(a,n)}var Mm=Ke(function(r,n){r=ut(r);var a=-1,h=n.length,p=h>2?n[2]:t;for(p&&sr(n[0],n[1],p)&&(h=1);++a1),w}),ei(r,fc(r),a),h&&(a=Lr(a,D|I|T,W0));for(var p=n.length;p--;)nc(a,n[p]);return a});function tw(r,n){return Fl(r,Uo(we(n)))}var rw=di(function(r,n){return r==null?{}:C0(r,n)});function Fl(r,n){if(r==null)return{};var a=mt(fc(r),function(h){return[h]});return n=we(n),Th(r,a,function(h,p){return n(h,p[0])})}function iw(r,n,a){n=Ui(n,r);var h=-1,p=n.length;for(p||(p=1,r=t);++hn){var h=r;r=n,n=h}if(a||r%1||n%1){var p=fh();return Qt(r+p*(n-r+at("1e-"+((p+"").length-1))),n)}return tc(r,n)}var pw=An(function(r,n,a){return n=n.toLowerCase(),r+(a?Hl(n):n)});function Hl(r){return Pc(it(r).toLowerCase())}function Kl(r){return r=it(r),r&&r.replace(ai,ng).replace(Aa,"")}function gw(r,n,a){r=it(r),n=Dr(n);var h=r.length;a=a===t?h:Qi(je(a),0,h);var p=a;return a-=n.length,a>=0&&r.slice(a,p)==n}function yw(r){return r=it(r),r&&yt.test(r)?r.replace(Bi,sg):r}function vw(r){return r=it(r),r&&Mt.test(r)?r.replace(xt,"\\$&"):r}var mw=An(function(r,n,a){return r+(a?"-":"")+n.toLowerCase()}),ww=An(function(r,n,a){return r+(a?" ":"")+n.toLowerCase()}),_w=Gh("toLowerCase");function bw(r,n,a){r=it(r),n=je(n);var h=n?Dn(r):0;if(!n||h>=n)return r;var p=(n-h)/2;return Io(lo(p),a)+r+Io(ho(p),a)}function Ew(r,n,a){r=it(r),n=je(n);var h=n?Dn(r):0;return n&&h>>0,a?(r=it(r),r&&(typeof n=="string"||n!=null&&!Ic(n))&&(n=Dr(n),!n&&En(r))?Li(Hr(r),0,a):r.split(n,a)):[]}var Cw=An(function(r,n,a){return r+(a?" ":"")+Pc(n)});function Aw(r,n,a){return r=it(r),a=a==null?0:Qi(je(a),0,r.length),n=Dr(n),r.slice(a,a+n.length)==n}function Tw(r,n,a){var h=v.templateSettings;a&&sr(r,n,a)&&(n=t),r=it(r),n=Mo({},n,h,el);var p=Mo({},n.imports,h.imports,el),w=kt(p),x=qa(p,w),N,q,X=0,Z=n.interpolate||pn,ne="__p += '",he=za((n.escape||pn).source+"|"+Z.source+"|"+(Z===bt?da:pn).source+"|"+(n.evaluate||pn).source+"|$","g"),ye="//# sourceURL="+(nt.call(n,"sourceURL")?(n.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ta+"]")+` +`;r.replace(he,function(De,Ge,Ze,Ir,or,xr){return Ze||(Ze=Ir),ne+=r.slice(X,xr).replace(wa,og),Ge&&(N=!0,ne+=`' + +__e(`+Ge+`) + +'`),or&&(q=!0,ne+=`'; +`+or+`; +__p += '`),Ze&&(ne+=`' + +((__t = (`+Ze+`)) == null ? '' : __t) + +'`),X=xr+De.length,De}),ne+=`'; +`;var Ee=nt.call(n,"variable")&&n.variable;if(!Ee)ne=`with (obj) { +`+ne+` +} +`;else if(la.test(Ee))throw new Ae(f);ne=(q?ne.replace(Jr,""):ne).replace(rr,"$1").replace(oi,"$1;"),ne="function("+(Ee||"obj")+`) { +`+(Ee?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(N?", __e = _.escape":"")+(q?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+ne+`return __p +}`;var ze=Vl(function(){return rt(w,ye+"return "+ne).apply(t,x)});if(ze.source=ne,Sc(ze))throw ze;return ze}function Rw(r){return it(r).toLowerCase()}function Nw(r){return it(r).toUpperCase()}function Uw(r,n,a){if(r=it(r),r&&(a||n===t))return th(r);if(!r||!(n=Dr(n)))return r;var h=Hr(r),p=Hr(n),w=rh(h,p),x=ih(h,p)+1;return Li(h,w,x).join("")}function Lw(r,n,a){if(r=it(r),r&&(a||n===t))return r.slice(0,sh(r)+1);if(!r||!(n=Dr(n)))return r;var h=Hr(r),p=ih(h,Hr(n))+1;return Li(h,0,p).join("")}function $w(r,n,a){if(r=it(r),r&&(a||n===t))return r.replace(Ot,"");if(!r||!(n=Dr(n)))return r;var h=Hr(r),p=rh(h,Hr(n));return Li(h,p).join("")}function Mw(r,n){var a=W,h=se;if(Et(n)){var p="separator"in n?n.separator:p;a="length"in n?je(n.length):a,h="omission"in n?Dr(n.omission):h}r=it(r);var w=r.length;if(En(r)){var x=Hr(r);w=x.length}if(a>=w)return r;var N=a-Dn(h);if(N<1)return h;var q=x?Li(x,0,N).join(""):r.slice(0,N);if(p===t)return q+h;if(x&&(N+=q.length-N),Ic(p)){if(r.slice(N).search(p)){var X,Z=q;for(p.global||(p=za(p.source,it(Ar.exec(p))+"g")),p.lastIndex=0;X=p.exec(Z);)var ne=X.index;q=q.slice(0,ne===t?N:ne)}}else if(r.indexOf(Dr(p),N)!=N){var he=q.lastIndexOf(p);he>-1&&(q=q.slice(0,he))}return q+h}function jw(r){return r=it(r),r&&Dt.test(r)?r.replace(xi,dg):r}var qw=An(function(r,n,a){return r+(a?" ":"")+n.toUpperCase()}),Pc=Gh("toUpperCase");function kl(r,n,a){return r=it(r),n=a?t:n,n===t?cg(r)?yg(r):Zp(r):r.match(n)||[]}var Vl=Ke(function(r,n){try{return Kt(r,t,n)}catch(a){return Sc(a)?a:new Ae(a)}}),Fw=di(function(r,n){return Rr(n,function(a){a=ti(a),li(r,a,Ec(r[a],r))}),r});function zw(r){var n=r==null?0:r.length,a=we();return r=n?mt(r,function(h){if(typeof h[1]!="function")throw new Nr(d);return[a(h[0]),h[1]]}):[],Ke(function(h){for(var p=-1;++pk)return[];var a=re,h=Qt(r,re);n=we(n),r-=re;for(var p=ja(h,n);++a0||n<0)?new Ye(a):(r<0?a=a.takeRight(-r):r&&(a=a.drop(r)),n!==t&&(n=je(n),a=n<0?a.dropRight(-n):a.take(n-r)),a)},Ye.prototype.takeRightWhile=function(r){return this.reverse().takeWhile(r).reverse()},Ye.prototype.toArray=function(){return this.take(re)},Zr(Ye.prototype,function(r,n){var a=/^(?:filter|find|map|reject)|While$/.test(n),h=/^(?:head|last)$/.test(n),p=v[h?"take"+(n=="last"?"Right":""):n],w=h||/^find/.test(n);p&&(v.prototype[n]=function(){var x=this.__wrapped__,N=h?[1]:arguments,q=x instanceof Ye,X=N[0],Z=q||Re(x),ne=function(Ge){var Ze=p.apply(v,Ci([Ge],N));return h&&he?Ze[0]:Ze};Z&&a&&typeof X=="function"&&X.length!=1&&(q=Z=!1);var he=this.__chain__,ye=!!this.__actions__.length,Ee=w&&!he,ze=q&&!ye;if(!w&&Z){x=ze?x:new Ye(this);var De=r.apply(x,N);return De.__actions__.push({func:Ao,args:[ne],thisArg:t}),new Ur(De,he)}return Ee&&ze?r.apply(this,N):(De=this.thru(ne),Ee?h?De.value()[0]:De.value():De)})}),Rr(["pop","push","shift","sort","splice","unshift"],function(r){var n=to[r],a=/^(?:push|sort|unshift)$/.test(r)?"tap":"thru",h=/^(?:pop|shift)$/.test(r);v.prototype[r]=function(){var p=arguments;if(h&&!this.__chain__){var w=this.value();return n.apply(Re(w)?w:[],p)}return this[a](function(x){return n.apply(Re(x)?x:[],p)})}}),Zr(Ye.prototype,function(r,n){var a=v[n];if(a){var h=a.name+"";nt.call(On,h)||(On[h]=[]),On[h].push({name:n,func:a})}}),On[Do(t,ie).name]=[{name:"wrapper",func:t}],Ye.prototype.clone=jg,Ye.prototype.reverse=qg,Ye.prototype.value=Fg,v.prototype.at=gv,v.prototype.chain=yv,v.prototype.commit=vv,v.prototype.next=mv,v.prototype.plant=_v,v.prototype.reverse=bv,v.prototype.toJSON=v.prototype.valueOf=v.prototype.value=Ev,v.prototype.first=v.prototype.head,Qn&&(v.prototype[Qn]=wv),v},Sn=vg();Tt?((Tt.exports=Sn)._=Sn,ct._=Sn):Xe._=Sn}).call(vs)})(Du,Du.exports);var mI=Object.defineProperty,wI=Object.defineProperties,_I=Object.getOwnPropertyDescriptors,Id=Object.getOwnPropertySymbols,bI=Object.prototype.hasOwnProperty,EI=Object.prototype.propertyIsEnumerable,xd=(i,e,t)=>e in i?mI(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Bo=(i,e)=>{for(var t in e||(e={}))bI.call(e,t)&&xd(i,t,e[t]);if(Id)for(var t of Id(e))EI.call(e,t)&&xd(i,t,e[t]);return i},DI=(i,e)=>wI(i,_I(e));function qi(i,e,t){var s;const o=yE(i);return((s=e.rpcMap)==null?void 0:s[o.reference])||`${vI}?chainId=${o.namespace}:${o.reference}&projectId=${t}`}function dn(i){return i.includes(":")?i.split(":")[1]:i}function Vp(i){return i.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function SI(i,e){const t=Object.keys(e.namespaces).filter(o=>o.includes(i));if(!t.length)return[];const s=[];return t.forEach(o=>{const c=e.namespaces[o].accounts;s.push(...c)}),s}function Od(i={},e={}){const t=Pd(i),s=Pd(e);return Du.exports.merge(t,s)}function Pd(i){var e,t,s,o;const c={};if(!Is(i))return c;for(const[d,f]of Object.entries(i)){const y=qu(d)?[d]:f.chains,g=f.methods||[],m=f.events||[],D=f.rpcMap||{},I=ms(d);c[I]=DI(Bo(Bo({},c[I]),f),{chains:Fc(y,(e=c[I])==null?void 0:e.chains),methods:Fc(g,(t=c[I])==null?void 0:t.methods),events:Fc(m,(s=c[I])==null?void 0:s.events),rpcMap:Bo(Bo({},D),(o=c[I])==null?void 0:o.rpcMap)})}return c}function II(i){return i.includes(":")?i.split(":")[2]:i}function xI(i){const e={};for(const[t,s]of Object.entries(i)){const o=s.methods||[],c=s.events||[],d=s.accounts||[],f=qu(t)?[t]:s.chains?s.chains:Vp(s.accounts);e[t]={chains:f,methods:o,events:c,accounts:d}}return e}function eu(i){return typeof i=="number"?i:i.includes("0x")?parseInt(i,16):(i=i.includes(":")?i.split(":")[1]:i,isNaN(Number(i))?i:Number(i))}const Gp={},_t=i=>Gp[i],tu=(i,e)=>{Gp[i]=e};class OI{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var s;const o=dn(t);e[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const s=this.createHttpProvider(e,t);s&&(this.httpProviders[e]=s)}createHttpProvider(e,t){const s=t||qi(e,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);return new Si(new zi(s,_t("disableProviderPing")))}}class PI{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("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,t){this.httpProviders[e]||this.setHttpProvider(parseInt(e),t),this.chainId=parseInt(e),this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,t){const s=t||qi(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);return new Si(new zi(s,_t("disableProviderPing")))}setHttpProvider(e,t){const s=this.createHttpProvider(e,t);s&&(this.httpProviders[e]=s)}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var s;const o=parseInt(dn(t));e[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[t])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}async handleSwitchChain(e){var t,s;let o=e.request.params?(t=e.request.params[0])==null?void 0:t.chainId:"0x0";o=o.startsWith("0x")?o:`0x${o}`;const c=parseInt(o,16);if(this.isChainApproved(c))this.setDefaultChain(`${c}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:o}]},chainId:(s=this.namespace.chains)==null?void 0:s[0]}),this.setDefaultChain(`${c}`);else throw new Error(`Failed to switch to chain 'eip155:${c}'. 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 CI{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var s;const o=dn(t);e[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const s=this.createHttpProvider(e,t);s&&(this.httpProviders[e]=s)}createHttpProvider(e,t){const s=t||qi(e,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);return new Si(new zi(s,_t("disableProviderPing")))}}class AI{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var s;const o=dn(t);e[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const s=this.createHttpProvider(e,t);s&&(this.httpProviders[e]=s)}createHttpProvider(e,t){const s=t||qi(e,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);return new Si(new zi(s,_t("disableProviderPing")))}}class TI{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{const s=this.getCardanoRPCUrl(t),o=dn(t);e[o]=this.createHttpProvider(o,s)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}getCardanoRPCUrl(e){const t=this.namespace.rpcMap;if(t)return t[e]}setHttpProvider(e,t){const s=this.createHttpProvider(e,t);s&&(this.httpProviders[e]=s)}createHttpProvider(e,t){const s=t||this.getCardanoRPCUrl(e);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);return new Si(new zi(s,_t("disableProviderPing")))}}class RI{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var s;const o=dn(t);e[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const s=this.createHttpProvider(e,t);s&&(this.httpProviders[e]=s)}createHttpProvider(e,t){const s=t||qi(e,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);return new Si(new zi(s,_t("disableProviderPing")))}}class NI{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var s;const o=dn(t);e[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const s=this.createHttpProvider(e,t);s&&(this.httpProviders[e]=s)}createHttpProvider(e,t){const s=t||qi(e,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);return new Si(new zi(s,_t("disableProviderPing")))}}class UI{constructor(e){this.name="near",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(this.chainId=e,!this.httpProviders[e]){const s=t||qi(`${this.name}:${e}`,this.namespace);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,s)}this.events.emit(Ii.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var s;e[t]=this.createHttpProvider(t,(s=this.namespace.rpcMap)==null?void 0:s[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const s=this.createHttpProvider(e,t);s&&(this.httpProviders[e]=s)}createHttpProvider(e,t){const s=t||qi(e,this.namespace);return typeof s>"u"?void 0:new Si(new zi(s,_t("disableProviderPing")))}}var LI=Object.defineProperty,$I=Object.defineProperties,MI=Object.getOwnPropertyDescriptors,Cd=Object.getOwnPropertySymbols,jI=Object.prototype.hasOwnProperty,qI=Object.prototype.propertyIsEnumerable,Ad=(i,e,t)=>e in i?LI(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Ho=(i,e)=>{for(var t in e||(e={}))jI.call(e,t)&&Ad(i,t,e[t]);if(Cd)for(var t of Cd(e))qI.call(e,t)&&Ad(i,t,e[t]);return i},ru=(i,e)=>$I(i,MI(e));class Wu{constructor(e){this.events=new Pu,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:Je.pino(Je.getDefaultLoggerOptions({level:(e==null?void 0:e.logger)||Dd})),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const t=new Wu(e);return await t.initialize(),t}async request(e,t,s){const[o,c]=this.validateChain(t);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(o).request({request:Ho({},e),chainId:`${o}:${c}`,topic:this.session.topic,expiry:s})}sendAsync(e,t,s,o){const c=new Date().getTime();this.request(e,s,o).then(d=>t(null,oa(c,d))).catch(d=>t(d,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:wt("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,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}removeListener(e,t){this.events.removeListener(e,t)}off(e,t){this.events.off(e,t)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let t=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(t>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:s,approval:o}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});s&&(this.uri=s,this.events.emit("display_uri",s)),await o().then(c=>{this.session=c;const d=xI(c.namespaces);this.namespaces=Od(this.namespaces,d),this.persist("namespaces",this.namespaces)}).catch(c=>{if(c.message!==Kp)throw c;t++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,t){try{if(!this.session)return;const[s,o]=this.validateChain(e);this.getProvider(s).setDefaultChain(o,t)}catch(s){if(!/Please call connect/.test(s.message))throw s}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const t=this.client.pairing.getAll();if(ni(t)){for(const s of t)e.deletePairings?this.client.core.expirer.set(s.topic,0):await this.client.core.relayer.subscriber.unsubscribe(s.topic);this.logger.info(`Inactive pairings cleared: ${t.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 hI.init({logger:this.providerOpts.logger||Dd,relayUrl:this.providerOpts.relayUrl||pI,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(t=>ms(t)))];tu("client",this.client),tu("events",this.events),tu("disableProviderPing",this.disableProviderPing),e.forEach(t=>{if(!this.session)return;const s=SI(t,this.session),o=Vp(s),c=Od(this.namespaces,this.optionalNamespaces),d=ru(Ho({},c[t]),{accounts:s,chains:o});switch(t){case"eip155":this.rpcProviders[t]=new PI({namespace:d});break;case"solana":this.rpcProviders[t]=new CI({namespace:d});break;case"cosmos":this.rpcProviders[t]=new AI({namespace:d});break;case"polkadot":this.rpcProviders[t]=new OI({namespace:d});break;case"cip34":this.rpcProviders[t]=new TI({namespace:d});break;case"elrond":this.rpcProviders[t]=new RI({namespace:d});break;case"multiversx":this.rpcProviders[t]=new NI({namespace:d});break;case"near":this.rpcProviders[t]=new UI({namespace:d});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:t}=e,{event:s}=t;if(s.name==="accountsChanged"){const o=s.data;o&&ni(o)&&this.events.emit("accountsChanged",o.map(II))}else if(s.name==="chainChanged"){const o=t.chainId,c=t.event.data,d=ms(o),f=eu(o)!==eu(c)?`${d}:${eu(c)}`:o;this.onChainChanged(f)}else this.events.emit(s.name,s.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:t})=>{var s;const{namespaces:o}=t,c=(s=this.client)==null?void 0:s.session.get(e);this.session=ru(Ho({},c),{namespaces:o}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:t})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",ru(Ho({},wt("USER_DISCONNECTED")),{data:e.topic}))}),this.on(Ii.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 t;this.getProvider(e).updateNamespace((t=this.session)==null?void 0:t.namespaces[e])})}setNamespaces(e){const{namespaces:t,optionalNamespaces:s,sessionProperties:o}=e;t&&Object.keys(t).length&&(this.namespaces=t),s&&Object.keys(s).length&&(this.optionalNamespaces=s),this.sessionProperties=o,this.persist("namespaces",t),this.persist("optionalNamespaces",s)}validateChain(e){const[t,s]=(e==null?void 0:e.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[t,s];if(t&&!Object.keys(this.namespaces||{}).map(d=>ms(d)).includes(t))throw new Error(`Namespace '${t}' is not configured. Please call connect() first with namespace config.`);if(t&&s)return[t,s];const o=ms(Object.keys(this.namespaces)[0]),c=this.rpcProviders[o].getDefaultChain();return[o,c]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,t=!1){if(!this.namespaces)return;const[s,o]=this.validateChain(e);o&&(t||this.getProvider(s).setDefaultChain(o),this.namespaces[s]?this.namespaces[s].defaultChain=o:this.namespaces[`${s}:${o}`]?this.namespaces[`${s}:${o}`].defaultChain=o:this.namespaces[`${s}:${o}`]={defaultChain:o},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",o))}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,t){this.client.core.storage.setItem(`${Sd}/${e}`,t)}async getFromStore(e){return await this.client.core.storage.getItem(`${Sd}/${e}`)}}const FI=Wu,zI="wc",BI="ethereum_provider",HI=`${zI}@2:${BI}:`,KI="https://rpc.walletconnect.com/v1/",Su=["eth_sendTransaction","personal_sign"],kI=["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"],Iu=["chainChanged","accountsChanged"],VI=["chainChanged","accountsChanged","message","disconnect","connect"];var GI=Object.defineProperty,WI=Object.defineProperties,YI=Object.getOwnPropertyDescriptors,Td=Object.getOwnPropertySymbols,JI=Object.prototype.hasOwnProperty,QI=Object.prototype.propertyIsEnumerable,Rd=(i,e,t)=>e in i?GI(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,_s=(i,e)=>{for(var t in e||(e={}))JI.call(e,t)&&Rd(i,t,e[t]);if(Td)for(var t of Td(e))QI.call(e,t)&&Rd(i,t,e[t]);return i},Nd=(i,e)=>WI(i,YI(e));function Zo(i){return Number(i[0].split(":")[1])}function iu(i){return`0x${i.toString(16)}`}function XI(i){const{chains:e,optionalChains:t,methods:s,optionalMethods:o,events:c,optionalEvents:d,rpcMap:f}=i;if(!ni(e))throw new Error("Invalid chains");const y={chains:e,methods:s||Su,events:c||Iu,rpcMap:_s({},e.length?{[Zo(e)]:f[Zo(e)]}:{})},g=c==null?void 0:c.filter(T=>!Iu.includes(T)),m=s==null?void 0:s.filter(T=>!Su.includes(T));if(!t&&!d&&!o&&!(g!=null&&g.length)&&!(m!=null&&m.length))return{required:e.length?y:void 0};const D=(g==null?void 0:g.length)&&(m==null?void 0:m.length)||!t,I={chains:[...new Set(D?y.chains.concat(t||[]):t)],methods:[...new Set(y.methods.concat(o!=null&&o.length?o:kI))],events:[...new Set(y.events.concat(d!=null&&d.length?d:VI))],rpcMap:f};return{required:e.length?y:void 0,optional:t.length?I:void 0}}class Yu{constructor(){this.events=new Fr.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=HI,this.on=(e,t)=>(this.events.on(e,t),this),this.once=(e,t)=>(this.events.once(e,t),this),this.removeListener=(e,t)=>(this.events.removeListener(e,t),this),this.off=(e,t)=>(this.events.off(e,t),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const t=new Yu;return await t.initialize(e),t}async request(e,t){return await this.signer.request(e,this.formatChainId(this.chainId),t)}sendAsync(e,t,s){this.signer.sendAsync(e,t,this.formatChainId(this.chainId),s)}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:t,optional:s}=XI(this.rpc);try{const o=await new Promise(async(d,f)=>{var y;this.rpc.showQrModal&&((y=this.modal)==null||y.subscribeModal(g=>{!g.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),f(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(Nd(_s({namespaces:_s({},t&&{[this.namespace]:t})},s&&{optionalNamespaces:{[this.namespace]:s}}),{pairingTopic:e==null?void 0:e.pairingTopic})).then(g=>{d(g)}).catch(g=>{f(new Error(g.message))})});if(!o)return;const c=vE(o.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:c),this.setAccounts(c),this.events.emit("connect",{chainId:iu(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",e=>{const{params:t}=e,{event:s}=t;s.name==="accountsChanged"?(this.accounts=this.parseAccounts(s.data),this.events.emit("accountsChanged",this.accounts)):s.name==="chainChanged"?this.setChainId(this.formatChainId(s.data)):this.events.emit(s.name,s.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{const t=parseInt(e);this.chainId=t,this.events.emit("chainChanged",iu(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",Nd(_s({},wt("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var t,s;this.rpc.showQrModal&&((t=this.modal)==null||t.closeModal(),(s=this.modal)==null||s.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 t=e.filter(s=>this.isCompatibleChainId(s)).map(s=>this.parseChainId(s));t.length&&(this.chainId=t[0],this.events.emit("chainChanged",iu(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const t=this.parseChainId(e);this.chainId=t,this.switchEthereumChain(t)}}parseAccountId(e){const[t,s,o]=e.split(":");return{chainId:`${t}:${s}`,address:o}}setAccounts(e){this.accounts=e.filter(t=>this.parseChainId(this.parseAccountId(t).chainId)===this.chainId).map(t=>this.parseAccountId(t).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var t,s;const o=(t=e==null?void 0:e.chains)!=null?t:[],c=(s=e==null?void 0:e.optionalChains)!=null?s:[],d=o.concat(c);if(!d.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const f=o.length?(e==null?void 0:e.methods)||Su:[],y=o.length?(e==null?void 0:e.events)||Iu:[],g=(e==null?void 0:e.optionalMethods)||[],m=(e==null?void 0:e.optionalEvents)||[],D=(e==null?void 0:e.rpcMap)||this.buildRpcMap(d,e.projectId),I=(e==null?void 0:e.qrModalOptions)||void 0;return{chains:o==null?void 0:o.map(T=>this.formatChainId(T)),optionalChains:c.map(T=>this.formatChainId(T)),methods:f,events:y,optionalMethods:g,optionalEvents:m,rpcMap:D,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:I,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,t){const s={};return e.forEach(o=>{s[o]=this.getRpcUrl(o,t)}),s}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?Zo(this.rpc.chains):Zo(this.rpc.optionalChains),this.signer=await FI.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 t;try{const{WalletConnectModal:s}=await I_(()=>import("./index-CZVo1pMO.js").then(o=>o.i),__vite__mapDeps([0,1,2]));t=s}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(t)try{this.modal=new t(_s({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(s){throw this.signer.logger.error(s),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:t,optionalChains:s,rpcMap:o}=e;t&&ni(t)&&(this.rpc.chains=t.map(c=>this.formatChainId(c)),t.forEach(c=>{this.rpc.rpcMap[c]=(o==null?void 0:o[c])||this.getRpcUrl(c)})),s&&ni(s)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=s==null?void 0:s.map(c=>this.formatChainId(c)),s.forEach(c=>{this.rpc.rpcMap[c]=(o==null?void 0:o[c])||this.getRpcUrl(c)}))}getRpcUrl(e,t){var s;return((s=this.rpc.rpcMap)==null?void 0:s[e])||`${KI}?chainId=eip155:${e}&projectId=${t||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),t=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:t==null?void 0:t.accounts),this.setAccounts(t==null?void 0:t.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(t=>this.parseAccount(t))}}const v5=Yu;export{v5 as EthereumProvider,VI as OPTIONAL_EVENTS,kI as OPTIONAL_METHODS,Iu as REQUIRED_EVENTS,Su as REQUIRED_METHODS,Yu as default}; diff --git a/favicon.png b/favicon.png new file mode 100644 index 0000000..e26123f Binary files /dev/null and b/favicon.png differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..9d6ef5e --- /dev/null +++ b/index.html @@ -0,0 +1,15 @@ + + + + + + + + WalletConnect | React Starter Template + + + + +
+ + diff --git a/logo.svg b/logo.svg new file mode 100644 index 0000000..c1037e1 --- /dev/null +++ b/logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/revo-logo.png b/revo-logo.png new file mode 100644 index 0000000..3565aa0 Binary files /dev/null and b/revo-logo.png differ