@dcl/landing-site 0.0.1-23617412190.commit-e3cca1e → 0.0.1-23618345269.commit-1e2a634
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{AnimatedBackground-gNtI-YhV.js → AnimatedBackground-DaItTQFq.js} +2 -2
- package/assets/FooterLanding-DssbnrQv.js +1 -0
- package/assets/{add-CHM98Fes.js → add-DPPiowNV.js} +1 -1
- package/assets/all-wallets-Bz44-vkK.js +6 -0
- package/assets/{app-store-CRgqc_8W.js → app-store-BIDMwYtJ.js} +2 -2
- package/assets/{apple-DA-gL0ew.js → apple-N0qVBHJ_.js} +2 -2
- package/assets/arrow-bottom-DEr0DxNQ.js +8 -0
- package/assets/{arrow-bottom-circle-W7EphmHv.js → arrow-bottom-circle-CyIUslGZ.js} +2 -2
- package/assets/arrow-left-CL8RzR1U.js +8 -0
- package/assets/arrow-right-9ngyyIUg.js +8 -0
- package/assets/arrow-top-Ds4_-RxX.js +8 -0
- package/assets/auto-track-CCVKJMew.js +1 -0
- package/assets/{bank-BJ_zMNdO.js → bank-BXxzgEEm.js} +1 -1
- package/assets/{basic-Cbs3wtVd.js → basic-BeVmC8wl.js} +1 -1
- package/assets/{browser-BZI6LlMK.js → browser-BFjIZRUr.js} +2 -2
- package/assets/{card-a0PEwixX.js → card-QrT_SqqP.js} +2 -2
- package/assets/ccip-Cnf8kps5.js +1 -0
- package/assets/{checkmark-DxhM6kxf.js → checkmark-BMbPxxD7.js} +2 -2
- package/assets/{checkmark-bold-nUmAb0Jv.js → checkmark-bold-CJr27ZWW.js} +2 -2
- package/assets/chevron-bottom-D-0_NZL7.js +8 -0
- package/assets/chevron-left-CkfqwG7X.js +8 -0
- package/assets/chevron-right-VRrVnjRX.js +8 -0
- package/assets/chevron-top-DmsHTjIi.js +8 -0
- package/assets/{chrome-store-C0l7_S46.js → chrome-store-Cxd7qy2P.js} +2 -2
- package/assets/{clock-CGFlkuTk.js → clock-BnERhsls.js} +2 -2
- package/assets/close-CegnAZI6.js +8 -0
- package/assets/{coinPlaceholder-BcTAu_IN.js → coinPlaceholder-ChJPLsLs.js} +2 -2
- package/assets/{compass-AzcmZa1s.js → compass-DhggJQin.js} +2 -2
- package/assets/{copy-DU6nZmjR.js → copy-CPyS9JID.js} +2 -2
- package/assets/{core-kZLq_ADy.js → core-BsX5IiWg.js} +33 -32
- package/assets/cursor-DuDLrsyW.js +3 -0
- package/assets/{cursor-transparent-CBn-iCcY.js → cursor-transparent-nm7_wJtu.js} +1 -1
- package/assets/{desktop-Cgv-18ZV.js → desktop-lh-TFiWV.js} +2 -2
- package/assets/{disconnect-BccJ3jIT.js → disconnect-BVdZSUk4.js} +2 -2
- package/assets/{discord-5RUDhSal.js → discord-DXIOms3e.js} +2 -2
- package/assets/{etherscan-C3fPztHb.js → etherscan-C7MLFrad.js} +2 -2
- package/assets/{exclamation-triangle-D_ozpW4c.js → exclamation-triangle-BQlSv988.js} +2 -2
- package/assets/{extension-BBOn_gDX.js → extension-BpS3-8TK.js} +1 -1
- package/assets/{external-link-BWUOLdmG.js → external-link-Bhl3PYp_.js} +1 -1
- package/assets/{facebook-CPf0OEse.js → facebook-BhDHaw9e.js} +2 -2
- package/assets/{farcaster-CR6V0phI.js → farcaster-4D2R9BLw.js} +2 -2
- package/assets/filters-Cx1L6OOr.js +8 -0
- package/assets/{github-Df-6J-fJ.js → github-ZEREWWLi.js} +2 -2
- package/assets/{google-ZDEMGNHZ.js → google-G5T2o3XW.js} +1 -1
- package/assets/{help-circle-BL4M8ISL.js → help-circle-rjs8mUc4.js} +1 -1
- package/assets/hooks.module-Dz_XB4AG.js +1 -0
- package/assets/{id-B8ywMzga.js → id-CdFeC_id.js} +2 -2
- package/assets/{image-CwqhHOgq.js → image-25IylLgD.js} +2 -2
- package/assets/index-0pT38_PF.js +2 -0
- package/assets/index-1kXtXmtZ.js +1 -0
- package/assets/index-B06iF3RB.js +1 -0
- package/assets/index-B37VckPJ.js +1 -0
- package/assets/index-Ba0skkGV.js +51 -0
- package/assets/index-BgDqerLq.js +2 -0
- package/assets/index-BvDvxY19.js +811 -0
- package/assets/index-Cdwkr0dW.js +1 -0
- package/assets/{index-BfZPjAvn.js → index-CnGR-jpk.js} +3 -3
- package/assets/index-DBXLKIqk.js +1 -0
- package/assets/index-DmYudDJU.js +1 -0
- package/assets/index-UGAdGA2y.js +5 -0
- package/assets/index-WuZ7mIic.js +7 -0
- package/assets/index-i_Rpb8UV.js +1 -0
- package/assets/index-ikT2QzgB.js +1 -0
- package/assets/index-nibyPLVP.js +1 -0
- package/assets/index-rj6I7Dp8.js +44 -0
- package/assets/index-z5AtYTFU.js +1 -0
- package/assets/{index.es-D0tGeUGR.js → index.es-A2H6_-n5.js} +12 -11
- package/assets/index.umd-DLkXoDDP.js +1 -0
- package/assets/{info-COI3OebQ.js → info-BCYaCSNh.js} +2 -2
- package/assets/{info-circle-D_RgtoG_.js → info-circle-gsgfsSpe.js} +2 -2
- package/assets/{lightbulb-D29oA1kW.js → lightbulb-BDHFTG5h.js} +2 -2
- package/assets/{mail-CJ9rvNEO.js → mail-DiTw9Nrl.js} +1 -1
- package/assets/{mobile-BSTR0oWP.js → mobile-CXqu2RHA.js} +2 -2
- package/assets/{more-BcYAHybc.js → more-C2sMArXI.js} +2 -2
- package/assets/{network-placeholder-Cnunuezr.js → network-placeholder-CPz8HGx-.js} +2 -2
- package/assets/{nftPlaceholder-rT8UJE4K.js → nftPlaceholder-DfXkrt19.js} +2 -2
- package/assets/node-Dh3n99U-.js +4 -0
- package/assets/off-DkrCs4Mj.js +8 -0
- package/assets/{play-store-DvfWnN4y.js → play-store-bfQWoaGY.js} +2 -2
- package/assets/{plus-gHBDgGjM.js → plus-QWHXQdAC.js} +2 -2
- package/assets/{qr-code-DDHcNUue.js → qr-code-BkDfZ-Qo.js} +1 -1
- package/assets/{recycle-horizontal-BRiwD6Mt.js → recycle-horizontal-QwbqvQmV.js} +1 -1
- package/assets/{refresh-B9gXvGXV.js → refresh-mrgGy3xW.js} +2 -2
- package/assets/{reown-logo-WhOyJ0P-.js → reown-logo-BPaNSMQx.js} +2 -2
- package/assets/search-BC-KS3un.js +8 -0
- package/assets/secp256k1-Bm0d2i6U.js +1 -0
- package/assets/secp256k1-MIfy00vZ.js +1 -0
- package/assets/{send-Bwl7uhNH.js → send-TXNvdG3J.js} +2 -2
- package/assets/{swapHorizontal-DZpWZtIz.js → swapHorizontal-DB0tAXym.js} +2 -2
- package/assets/{swapHorizontalBold-BsXTfOUB.js → swapHorizontalBold-bt9pkPYB.js} +2 -2
- package/assets/{swapHorizontalMedium-C_6kbXTl.js → swapHorizontalMedium-sWdoPCsB.js} +2 -2
- package/assets/{swapHorizontalRoundedBold-C0Zn63rG.js → swapHorizontalRoundedBold-DHHovHd5.js} +2 -2
- package/assets/{swapVertical-3Bh1HEox.js → swapVertical-DTfIwviz.js} +2 -2
- package/assets/swiper-react-Bl4aS6YN.js +1 -0
- package/assets/{telegram-DNIzTF3I.js → telegram-5bTwLHz7.js} +2 -2
- package/assets/{three-dots-COxARji7.js → three-dots-C33y8Xmm.js} +2 -2
- package/assets/{twitch-CZ-7Kiwd.js → twitch-CHjNW3bL.js} +2 -2
- package/assets/{twitterIcon-Dcm6rS6L.js → twitterIcon-Bsvg5_qQ.js} +2 -2
- package/assets/{verify-CDFvKR62.js → verify-Cadwtk5M.js} +2 -2
- package/assets/{verify-filled-xoYiPqK4.js → verify-filled-tSZv_9lr.js} +2 -2
- package/assets/{w3m-modal-DelFzwRg.js → w3m-modal-9Q6B4hli.js} +1 -1
- package/assets/{wallet-BFpTXEJT.js → wallet-DhjaFVTL.js} +2 -2
- package/assets/{wallet-placeholder-AXXSMd3R.js → wallet-placeholder-B-dNSlaX.js} +2 -2
- package/assets/{walletconnect-Cz3JVcWt.js → walletconnect-BcwzL0ZV.js} +4 -4
- package/assets/{warning-circle-8Kak1pmh.js → warning-circle-D3W3qLdq.js} +1 -1
- package/assets/{x-C-F8mfxV.js → x-BZWPQTuH.js} +2 -2
- package/index.html +2 -5
- package/package.json +3 -3
- package/assets/FooterLanding-iYuz415B.js +0 -1
- package/assets/all-wallets-Qb9stbRm.js +0 -6
- package/assets/arrow-bottom-rhor6qOA.js +0 -8
- package/assets/arrow-left-Bq3H-u24.js +0 -8
- package/assets/arrow-right-CkiCqXKz.js +0 -8
- package/assets/arrow-top-BbayD3ny.js +0 -8
- package/assets/auto-track-CpyrW7jj.js +0 -1
- package/assets/chevron-bottom-C2GrTkGW.js +0 -8
- package/assets/chevron-left-TOHygVkY.js +0 -8
- package/assets/chevron-right-kK9l_fNM.js +0 -8
- package/assets/chevron-top-GkMD6fM_.js +0 -8
- package/assets/close-D_Rm3jAw.js +0 -8
- package/assets/cursor-BkgcU3pB.js +0 -3
- package/assets/filters-DJ44i8Mo.js +0 -8
- package/assets/index-BA7pz-wf.js +0 -1
- package/assets/index-BFntqBXC.js +0 -1
- package/assets/index-B_dMHlXr.js +0 -1
- package/assets/index-BgXJ6Z6L.js +0 -1
- package/assets/index-CJxXHUcP.js +0 -1
- package/assets/index-CXz9iuA3.js +0 -1
- package/assets/index-Cg_5qxO-.js +0 -2
- package/assets/index-CntXRSz5.js +0 -2
- package/assets/index-DIS5DQM_.js +0 -1
- package/assets/index-Dbv53o1b.js +0 -1
- package/assets/index-DoaqdCF9.js +0 -601
- package/assets/index-Dsk1niAz.js +0 -7
- package/assets/index-HuL12PNJ.js +0 -5
- package/assets/index-mgaHX57j.js +0 -1
- package/assets/index-vWYtvmN_.js +0 -1
- package/assets/index.umd-CIiTi8qb.js +0 -1
- package/assets/off-B_Wn42xj.js +0 -8
- package/assets/search-DpE00x6Q.js +0 -8
- package/assets/swiper-react-BALcxKpm.js +0 -1
- package/assets/vendor-mui-40jyI-Tp.js +0 -197
- package/assets/vendor-react-DJXYd7Dm.js +0 -40
- package/assets/vendor-web3-Dw3dBix7.js +0 -74
package/assets/index-Dsk1niAz.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{c as z,a as vr,g as Mh}from"./vendor-mui-40jyI-Tp.js";import{x as kh,B as re,y as Ih,z as Ch,A as Ah,g as fe,C as xh,D as Th}from"./vendor-web3-Dw3dBix7.js";import{i as _t}from"./inherits_browser-BlmhoU4v.js";import{r as Jr,t as Nh}from"./index-DoaqdCF9.js";var gi=Object.defineProperty||!1;if(gi)try{gi({},"a",{value:1})}catch{gi=!1}var Ci=gi,hl=SyntaxError,En=TypeError,Ph=Object.getOwnPropertyDescriptor,mi=Ph;if(mi)try{mi([],"length")}catch{mi=null}var Sn=mi,ma=Ci,Lh=hl,Pr=En,va=Sn,$h=function(t,r,n){if(!t||typeof t!="object"&&typeof t!="function")throw new Pr("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new Pr("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Pr("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Pr("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Pr("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Pr("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,l=arguments.length>6?arguments[6]:!1,h=!!va&&va(t,r);if(ma)ma(t,r,{configurable:a===null&&h?h.configurable:!a,enumerable:i===null&&h?h.enumerable:!i,value:n,writable:s===null&&h?h.writable:!s});else if(l||!i&&!s&&!a)t[r]=n;else throw new Lh("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},mo=Ci,dl=function(){return!!mo};dl.hasArrayLengthDefineBug=function(){if(!mo)return null;try{return mo([],"length",{value:1}).length!==1}catch{return!0}};var Oh=dl,fl={exports:{}},pl=Object,Bh=Error,Dh=EvalError,Fh=RangeError,jh=ReferenceError,Uh=URIError,Hh=Math.abs,Wh=Math.floor,Vh=Math.max,qh=Math.min,zh=Math.pow,Gh=Math.round,Jh=Number.isNaN||function(t){return t!==t},Zh=Jh,Kh=function(t){return Zh(t)||t===0?t:t<0?-1:1},gl=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var s in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var a=Object.getOwnPropertySymbols(t);if(a.length!==1||a[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(t,r);if(l.value!==i||l.enumerable!==!0)return!1}return!0},ya=typeof Symbol<"u"&&Symbol,Qh=gl,Yh=function(){return typeof ya!="function"||typeof Symbol!="function"||typeof ya("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Qh()},ml=typeof Reflect<"u"&&Reflect.getPrototypeOf||null,Xh=pl,vl=Xh.getPrototypeOf||null,xs,ba;function ed(){if(ba)return xs;ba=1;var e="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,r=Math.max,n="[object Function]",i=function(h,d){for(var f=[],R=0;R<h.length;R+=1)f[R]=h[R];for(var _=0;_<d.length;_+=1)f[_+h.length]=d[_];return f},s=function(h,d){for(var f=[],R=d,_=0;R<h.length;R+=1,_+=1)f[_]=h[R];return f},a=function(l,h){for(var d="",f=0;f<l.length;f+=1)d+=l[f],f+1<l.length&&(d+=h);return d};return xs=function(h){var d=this;if(typeof d!="function"||t.apply(d)!==n)throw new TypeError(e+d);for(var f=s(arguments,1),R,_=function(){if(this instanceof R){var M=d.apply(this,i(f,arguments));return Object(M)===M?M:this}return d.apply(h,i(f,arguments))},C=r(0,d.length-f.length),L=[],N=0;N<C;N++)L[N]="$"+N;if(R=Function("binder","return function ("+a(L,",")+"){ return binder.apply(this,arguments); }")(_),d.prototype){var $=function(){};$.prototype=d.prototype,R.prototype=new $,$.prototype=null}return R},xs}var Ts,wa;function Rn(){if(wa)return Ts;wa=1;var e=ed();return Ts=Function.prototype.bind||e,Ts}var Ns,_a;function Io(){return _a||(_a=1,Ns=Function.prototype.call),Ns}var Ps,Ea;function Co(){return Ea||(Ea=1,Ps=Function.prototype.apply),Ps}var td=typeof Reflect<"u"&&Reflect&&Reflect.apply,rd=Rn(),nd=Co(),id=Io(),sd=td,yl=sd||rd.call(id,nd),od=Rn(),ad=En,cd=Io(),ld=yl,Ao=function(t){if(t.length<1||typeof t[0]!="function")throw new ad("a function is required");return ld(od,cd,t)},ud=Ao,Sa=Sn,bl;try{bl=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var Ls=!!bl&&Sa&&Sa(Object.prototype,"__proto__"),wl=Object,Ra=wl.getPrototypeOf,hd=Ls&&typeof Ls.get=="function"?ud([Ls.get]):typeof Ra=="function"?function(t){return Ra(t==null?t:wl(t))}:!1,Ma=ml,ka=vl,Ia=hd,_l=Ma?function(t){return Ma(t)}:ka?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return ka(t)}:Ia?function(t){return Ia(t)}:null,dd=Function.prototype.call,fd=Object.prototype.hasOwnProperty,pd=Rn(),gd=pd.call(dd,fd),se,md=pl,vd=Bh,yd=Dh,bd=Fh,wd=jh,Zr=hl,Vr=En,_d=Uh,Ed=Hh,Sd=Wh,Rd=Vh,Md=qh,kd=zh,Id=Gh,Cd=Kh,El=Function,$s=function(e){try{return El('"use strict"; return ('+e+").constructor;")()}catch{}},yn=Sn,Ad=Ci,Os=function(){throw new Vr},xd=yn?function(){try{return arguments.callee,Os}catch{try{return yn(arguments,"callee").get}catch{return Os}}}():Os,Lr=Yh(),Ke=_l,Td=vl,Nd=ml,Sl=Co(),Mn=Io(),jr={},Pd=typeof Uint8Array>"u"||!Ke?se:Ke(Uint8Array),pr={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?se:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?se:ArrayBuffer,"%ArrayIteratorPrototype%":Lr&&Ke?Ke([][Symbol.iterator]()):se,"%AsyncFromSyncIteratorPrototype%":se,"%AsyncFunction%":jr,"%AsyncGenerator%":jr,"%AsyncGeneratorFunction%":jr,"%AsyncIteratorPrototype%":jr,"%Atomics%":typeof Atomics>"u"?se:Atomics,"%BigInt%":typeof BigInt>"u"?se:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?se:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?se:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?se:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":vd,"%eval%":eval,"%EvalError%":yd,"%Float16Array%":typeof Float16Array>"u"?se:Float16Array,"%Float32Array%":typeof Float32Array>"u"?se:Float32Array,"%Float64Array%":typeof Float64Array>"u"?se:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?se:FinalizationRegistry,"%Function%":El,"%GeneratorFunction%":jr,"%Int8Array%":typeof Int8Array>"u"?se:Int8Array,"%Int16Array%":typeof Int16Array>"u"?se:Int16Array,"%Int32Array%":typeof Int32Array>"u"?se:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Lr&&Ke?Ke(Ke([][Symbol.iterator]())):se,"%JSON%":typeof JSON=="object"?JSON:se,"%Map%":typeof Map>"u"?se:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Lr||!Ke?se:Ke(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":md,"%Object.getOwnPropertyDescriptor%":yn,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?se:Promise,"%Proxy%":typeof Proxy>"u"?se:Proxy,"%RangeError%":bd,"%ReferenceError%":wd,"%Reflect%":typeof Reflect>"u"?se:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?se:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Lr||!Ke?se:Ke(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?se:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Lr&&Ke?Ke(""[Symbol.iterator]()):se,"%Symbol%":Lr?Symbol:se,"%SyntaxError%":Zr,"%ThrowTypeError%":xd,"%TypedArray%":Pd,"%TypeError%":Vr,"%Uint8Array%":typeof Uint8Array>"u"?se:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?se:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?se:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?se:Uint32Array,"%URIError%":_d,"%WeakMap%":typeof WeakMap>"u"?se:WeakMap,"%WeakRef%":typeof WeakRef>"u"?se:WeakRef,"%WeakSet%":typeof WeakSet>"u"?se:WeakSet,"%Function.prototype.call%":Mn,"%Function.prototype.apply%":Sl,"%Object.defineProperty%":Ad,"%Object.getPrototypeOf%":Td,"%Math.abs%":Ed,"%Math.floor%":Sd,"%Math.max%":Rd,"%Math.min%":Md,"%Math.pow%":kd,"%Math.round%":Id,"%Math.sign%":Cd,"%Reflect.getPrototypeOf%":Nd};if(Ke)try{null.error}catch(e){var Ld=Ke(Ke(e));pr["%Error.prototype%"]=Ld}var $d=function e(t){var r;if(t==="%AsyncFunction%")r=$s("async function () {}");else if(t==="%GeneratorFunction%")r=$s("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=$s("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&Ke&&(r=Ke(i.prototype))}return pr[t]=r,r},Ca={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},kn=Rn(),Ei=gd,Od=kn.call(Mn,Array.prototype.concat),Bd=kn.call(Sl,Array.prototype.splice),Aa=kn.call(Mn,String.prototype.replace),Si=kn.call(Mn,String.prototype.slice),Dd=kn.call(Mn,RegExp.prototype.exec),Fd=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,jd=/\\(\\)?/g,Ud=function(t){var r=Si(t,0,1),n=Si(t,-1);if(r==="%"&&n!=="%")throw new Zr("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Zr("invalid intrinsic syntax, expected opening `%`");var i=[];return Aa(t,Fd,function(s,a,l,h){i[i.length]=l?Aa(h,jd,"$1"):a||s}),i},Hd=function(t,r){var n=t,i;if(Ei(Ca,n)&&(i=Ca[n],n="%"+i[0]+"%"),Ei(pr,n)){var s=pr[n];if(s===jr&&(s=$d(n)),typeof s>"u"&&!r)throw new Vr("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new Zr("intrinsic "+t+" does not exist!")},Rl=function(t,r){if(typeof t!="string"||t.length===0)throw new Vr("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Vr('"allowMissing" argument must be a boolean');if(Dd(/^%?[^%]*%?$/,t)===null)throw new Zr("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Ud(t),i=n.length>0?n[0]:"",s=Hd("%"+i+"%",r),a=s.name,l=s.value,h=!1,d=s.alias;d&&(i=d[0],Bd(n,Od([0,1],d)));for(var f=1,R=!0;f<n.length;f+=1){var _=n[f],C=Si(_,0,1),L=Si(_,-1);if((C==='"'||C==="'"||C==="`"||L==='"'||L==="'"||L==="`")&&C!==L)throw new Zr("property names with quotes must have matching quotes");if((_==="constructor"||!R)&&(h=!0),i+="."+_,a="%"+i+"%",Ei(pr,a))l=pr[a];else if(l!=null){if(!(_ in l)){if(!r)throw new Vr("base intrinsic for "+t+" exists, but the property is not available.");return}if(yn&&f+1>=n.length){var N=yn(l,_);R=!!N,R&&"get"in N&&!("originalValue"in N.get)?l=N.get:l=l[_]}else R=Ei(l,_),l=l[_];R&&!h&&(pr[a]=l)}}return l},Wd=Rl,xa=$h,Vd=Oh(),Ta=Sn,Na=En,qd=Wd("%Math.floor%"),zd=function(t,r){if(typeof t!="function")throw new Na("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||qd(r)!==r)throw new Na("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],i=!0,s=!0;if("length"in t&&Ta){var a=Ta(t,"length");a&&!a.configurable&&(i=!1),a&&!a.writable&&(s=!1)}return(i||s||!n)&&(Vd?xa(t,"length",r,!0,!0):xa(t,"length",r)),t},Gd=Rn(),Jd=Co(),Zd=yl,Kd=function(){return Zd(Gd,Jd,arguments)};(function(e){var t=zd,r=Ci,n=Ao,i=Kd;e.exports=function(a){var l=n(arguments),h=a.length-(arguments.length-1);return t(l,1+(h>0?h:0),!0)},r?r(e.exports,"apply",{value:i}):e.exports.apply=i})(fl);var Qd=fl.exports,Ml=Rl,kl=Ao,Yd=kl([Ml("%String.prototype.indexOf%")]),Il=function(t,r){var n=Ml(t,!!r);return typeof n=="function"&&Yd(t,".prototype.")>-1?kl([n]):n},Xd=gl,ef=function(){return Xd()&&!!Symbol.toStringTag},tf={}.toString,rf=Array.isArray||function(e){return tf.call(e)=="[object Array]"},Cl=Function.prototype.toString,Hr=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,vo,vi;if(typeof Hr=="function"&&typeof Object.defineProperty=="function")try{vo=Object.defineProperty({},"length",{get:function(){throw vi}}),vi={},Hr(function(){throw 42},null,vo)}catch(e){e!==vi&&(Hr=null)}else Hr=null;var nf=/^\s*class\b/,yo=function(t){try{var r=Cl.call(t);return nf.test(r)}catch{return!1}},Bs=function(t){try{return yo(t)?!1:(Cl.call(t),!0)}catch{return!1}},yi=Object.prototype.toString,sf="[object Object]",of="[object Function]",af="[object GeneratorFunction]",cf="[object HTMLAllCollection]",lf="[object HTML document.all class]",uf="[object HTMLCollection]",hf=typeof Symbol=="function"&&!!Symbol.toStringTag,df=!(0 in[,]),bo=function(){return!1};if(typeof document=="object"){var ff=document.all;yi.call(ff)===yi.call(document.all)&&(bo=function(t){if((df||!t)&&(typeof t>"u"||typeof t=="object"))try{var r=yi.call(t);return(r===cf||r===lf||r===uf||r===sf)&&t("")==null}catch{}return!1})}var pf=Hr?function(t){if(bo(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{Hr(t,null,vo)}catch(r){if(r!==vi)return!1}return!yo(t)&&Bs(t)}:function(t){if(bo(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(hf)return Bs(t);if(yo(t))return!1;var r=yi.call(t);return r!==of&&r!==af&&!/^\[object HTML/.test(r)?!1:Bs(t)},gf=pf,mf=Object.prototype.toString,Al=Object.prototype.hasOwnProperty,vf=function(t,r,n){for(var i=0,s=t.length;i<s;i++)Al.call(t,i)&&(n==null?r(t[i],i,t):r.call(n,t[i],i,t))},yf=function(t,r,n){for(var i=0,s=t.length;i<s;i++)n==null?r(t.charAt(i),i,t):r.call(n,t.charAt(i),i,t)},bf=function(t,r,n){for(var i in t)Al.call(t,i)&&(n==null?r(t[i],i,t):r.call(n,t[i],i,t))};function wf(e){return mf.call(e)==="[object Array]"}var _f=function(t,r,n){if(!gf(r))throw new TypeError("iterator must be a function");var i;arguments.length>=3&&(i=n),wf(t)?vf(t,r,i):typeof t=="string"?yf(t,r,i):bf(t,r,i)},Ef=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"],Ds=Ef,Sf=typeof globalThis>"u"?z:globalThis,Rf=function(){for(var t=[],r=0;r<Ds.length;r++)typeof Sf[Ds[r]]=="function"&&(t[t.length]=Ds[r]);return t},Ri=_f,Mf=Rf,Pa=Qd,xo=Il,bi=Sn,Xn=_l,kf=xo("Object.prototype.toString"),xl=ef(),La=typeof globalThis>"u"?z:globalThis,wo=Mf(),To=xo("String.prototype.slice"),If=xo("Array.prototype.indexOf",!0)||function(t,r){for(var n=0;n<t.length;n+=1)if(t[n]===r)return n;return-1},Mi={__proto__:null};xl&&bi&&Xn?Ri(wo,function(e){var t=new La[e];if(Symbol.toStringTag in t&&Xn){var r=Xn(t),n=bi(r,Symbol.toStringTag);if(!n&&r){var i=Xn(r);n=bi(i,Symbol.toStringTag)}Mi["$"+e]=Pa(n.get)}}):Ri(wo,function(e){var t=new La[e],r=t.slice||t.set;r&&(Mi["$"+e]=Pa(r))});var Cf=function(t){var r=!1;return Ri(Mi,function(n,i){if(!r)try{"$"+n(t)===i&&(r=To(i,1))}catch{}}),r},Af=function(t){var r=!1;return Ri(Mi,function(n,i){if(!r)try{n(t),r=To(i,1)}catch{}}),r},xf=function(t){if(!t||typeof t!="object")return!1;if(!xl){var r=To(kf(t),8,-1);return If(wo,r)>-1?r:r!=="Object"?!1:Af(t)}return bi?Cf(t):null},Tl={},bn={},Ai={};Object.defineProperty(Ai,"__esModule",{value:!0});Ai.walletLogo=void 0;const Tf=(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 `}};Ai.walletLogo=Tf;var xi={};Object.defineProperty(xi,"__esModule",{value:!0});xi.LINK_API_URL=void 0;xi.LINK_API_URL="https://www.walletlink.org";var q={},No={exports:{}};const In=vr(kh);No.exports;(function(e){(function(t,r){function n(S,o){if(!S)throw new Error(o||"Assertion failed")}function i(S,o){S.super_=o;var u=function(){};u.prototype=o.prototype,S.prototype=new u,S.prototype.constructor=S}function s(S,o,u){if(s.isBN(S))return S;this.negative=0,this.words=null,this.length=0,this.red=null,S!==null&&((o==="le"||o==="be")&&(u=o,o=10),this._init(S||0,o||10,u||"be"))}typeof t=="object"?t.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var a;try{typeof window<"u"&&typeof window.Buffer<"u"?a=window.Buffer:a=In.Buffer}catch{}s.isBN=function(o){return o instanceof s?!0:o!==null&&typeof o=="object"&&o.constructor.wordSize===s.wordSize&&Array.isArray(o.words)},s.max=function(o,u){return o.cmp(u)>0?o:u},s.min=function(o,u){return o.cmp(u)<0?o:u},s.prototype._init=function(o,u,p){if(typeof o=="number")return this._initNumber(o,u,p);if(typeof o=="object")return this._initArray(o,u,p);u==="hex"&&(u=16),n(u===(u|0)&&u>=2&&u<=36),o=o.toString().replace(/\s+/g,"");var g=0;o[0]==="-"&&(g++,this.negative=1),g<o.length&&(u===16?this._parseHex(o,g,p):(this._parseBase(o,u,g),p==="le"&&this._initArray(this.toArray(),u,p)))},s.prototype._initNumber=function(o,u,p){o<0&&(this.negative=1,o=-o),o<67108864?(this.words=[o&67108863],this.length=1):o<4503599627370496?(this.words=[o&67108863,o/67108864&67108863],this.length=2):(n(o<9007199254740992),this.words=[o&67108863,o/67108864&67108863,1],this.length=3),p==="le"&&this._initArray(this.toArray(),u,p)},s.prototype._initArray=function(o,u,p){if(n(typeof o.length=="number"),o.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(o.length/3),this.words=new Array(this.length);for(var g=0;g<this.length;g++)this.words[g]=0;var v,E,I=0;if(p==="be")for(g=o.length-1,v=0;g>=0;g-=3)E=o[g]|o[g-1]<<8|o[g-2]<<16,this.words[v]|=E<<I&67108863,this.words[v+1]=E>>>26-I&67108863,I+=24,I>=26&&(I-=26,v++);else if(p==="le")for(g=0,v=0;g<o.length;g+=3)E=o[g]|o[g+1]<<8|o[g+2]<<16,this.words[v]|=E<<I&67108863,this.words[v+1]=E>>>26-I&67108863,I+=24,I>=26&&(I-=26,v++);return this._strip()};function l(S,o){var u=S.charCodeAt(o);if(u>=48&&u<=57)return u-48;if(u>=65&&u<=70)return u-55;if(u>=97&&u<=102)return u-87;n(!1,"Invalid character in "+S)}function h(S,o,u){var p=l(S,u);return u-1>=o&&(p|=l(S,u-1)<<4),p}s.prototype._parseHex=function(o,u,p){this.length=Math.ceil((o.length-u)/6),this.words=new Array(this.length);for(var g=0;g<this.length;g++)this.words[g]=0;var v=0,E=0,I;if(p==="be")for(g=o.length-1;g>=u;g-=2)I=h(o,u,g)<<v,this.words[E]|=I&67108863,v>=18?(v-=18,E+=1,this.words[E]|=I>>>26):v+=8;else{var m=o.length-u;for(g=m%2===0?u+1:u;g<o.length;g+=2)I=h(o,u,g)<<v,this.words[E]|=I&67108863,v>=18?(v-=18,E+=1,this.words[E]|=I>>>26):v+=8}this._strip()};function d(S,o,u,p){for(var g=0,v=0,E=Math.min(S.length,u),I=o;I<E;I++){var m=S.charCodeAt(I)-48;g*=p,m>=49?v=m-49+10:m>=17?v=m-17+10:v=m,n(m>=0&&v<p,"Invalid character"),g+=v}return g}s.prototype._parseBase=function(o,u,p){this.words=[0],this.length=1;for(var g=0,v=1;v<=67108863;v*=u)g++;g--,v=v/u|0;for(var E=o.length-p,I=E%g,m=Math.min(E,E-I)+p,c=0,y=p;y<m;y+=g)c=d(o,y,y+g,u),this.imuln(v),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(I!==0){var W=1;for(c=d(o,y,o.length,u),y=0;y<I;y++)W*=u;this.imuln(W),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this._strip()},s.prototype.copy=function(o){o.words=new Array(this.length);for(var u=0;u<this.length;u++)o.words[u]=this.words[u];o.length=this.length,o.negative=this.negative,o.red=this.red};function f(S,o){S.words=o.words,S.length=o.length,S.negative=o.negative,S.red=o.red}if(s.prototype._move=function(o){f(o,this)},s.prototype.clone=function(){var o=new s(null);return this.copy(o),o},s.prototype._expand=function(o){for(;this.length<o;)this.words[this.length++]=0;return this},s.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=R}catch{s.prototype.inspect=R}else s.prototype.inspect=R;function R(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}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"],C=[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],L=[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(o,u){o=o||10,u=u|0||1;var p;if(o===16||o==="hex"){p="";for(var g=0,v=0,E=0;E<this.length;E++){var I=this.words[E],m=((I<<g|v)&16777215).toString(16);v=I>>>24-g&16777215,g+=2,g>=26&&(g-=26,E--),v!==0||E!==this.length-1?p=_[6-m.length]+m+p:p=m+p}for(v!==0&&(p=v.toString(16)+p);p.length%u!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}if(o===(o|0)&&o>=2&&o<=36){var c=C[o],y=L[o];p="";var W=this.clone();for(W.negative=0;!W.isZero();){var U=W.modrn(y).toString(o);W=W.idivn(y),W.isZero()?p=U+p:p=_[c-U.length]+U+p}for(this.isZero()&&(p="0"+p);p.length%u!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var o=this.words[0];return this.length===2?o+=this.words[1]*67108864:this.length===3&&this.words[2]===1?o+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-o:o},s.prototype.toJSON=function(){return this.toString(16,2)},a&&(s.prototype.toBuffer=function(o,u){return this.toArrayLike(a,o,u)}),s.prototype.toArray=function(o,u){return this.toArrayLike(Array,o,u)};var N=function(o,u){return o.allocUnsafe?o.allocUnsafe(u):new o(u)};s.prototype.toArrayLike=function(o,u,p){this._strip();var g=this.byteLength(),v=p||Math.max(1,g);n(g<=v,"byte array longer than desired length"),n(v>0,"Requested array length <= 0");var E=N(o,v),I=u==="le"?"LE":"BE";return this["_toArrayLike"+I](E,g),E},s.prototype._toArrayLikeLE=function(o,u){for(var p=0,g=0,v=0,E=0;v<this.length;v++){var I=this.words[v]<<E|g;o[p++]=I&255,p<o.length&&(o[p++]=I>>8&255),p<o.length&&(o[p++]=I>>16&255),E===6?(p<o.length&&(o[p++]=I>>24&255),g=0,E=0):(g=I>>>24,E+=2)}if(p<o.length)for(o[p++]=g;p<o.length;)o[p++]=0},s.prototype._toArrayLikeBE=function(o,u){for(var p=o.length-1,g=0,v=0,E=0;v<this.length;v++){var I=this.words[v]<<E|g;o[p--]=I&255,p>=0&&(o[p--]=I>>8&255),p>=0&&(o[p--]=I>>16&255),E===6?(p>=0&&(o[p--]=I>>24&255),g=0,E=0):(g=I>>>24,E+=2)}if(p>=0)for(o[p--]=g;p>=0;)o[p--]=0},Math.clz32?s.prototype._countBits=function(o){return 32-Math.clz32(o)}:s.prototype._countBits=function(o){var u=o,p=0;return u>=4096&&(p+=13,u>>>=13),u>=64&&(p+=7,u>>>=7),u>=8&&(p+=4,u>>>=4),u>=2&&(p+=2,u>>>=2),p+u},s.prototype._zeroBits=function(o){if(o===0)return 26;var u=o,p=0;return u&8191||(p+=13,u>>>=13),u&127||(p+=7,u>>>=7),u&15||(p+=4,u>>>=4),u&3||(p+=2,u>>>=2),u&1||p++,p},s.prototype.bitLength=function(){var o=this.words[this.length-1],u=this._countBits(o);return(this.length-1)*26+u};function $(S){for(var o=new Array(S.bitLength()),u=0;u<o.length;u++){var p=u/26|0,g=u%26;o[u]=S.words[p]>>>g&1}return o}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var o=0,u=0;u<this.length;u++){var p=this._zeroBits(this.words[u]);if(o+=p,p!==26)break}return o},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(o){return this.negative!==0?this.abs().inotn(o).iaddn(1):this.clone()},s.prototype.fromTwos=function(o){return this.testn(o-1)?this.notn(o).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(o){for(;this.length<o.length;)this.words[this.length++]=0;for(var u=0;u<o.length;u++)this.words[u]=this.words[u]|o.words[u];return this._strip()},s.prototype.ior=function(o){return n((this.negative|o.negative)===0),this.iuor(o)},s.prototype.or=function(o){return this.length>o.length?this.clone().ior(o):o.clone().ior(this)},s.prototype.uor=function(o){return this.length>o.length?this.clone().iuor(o):o.clone().iuor(this)},s.prototype.iuand=function(o){var u;this.length>o.length?u=o:u=this;for(var p=0;p<u.length;p++)this.words[p]=this.words[p]&o.words[p];return this.length=u.length,this._strip()},s.prototype.iand=function(o){return n((this.negative|o.negative)===0),this.iuand(o)},s.prototype.and=function(o){return this.length>o.length?this.clone().iand(o):o.clone().iand(this)},s.prototype.uand=function(o){return this.length>o.length?this.clone().iuand(o):o.clone().iuand(this)},s.prototype.iuxor=function(o){var u,p;this.length>o.length?(u=this,p=o):(u=o,p=this);for(var g=0;g<p.length;g++)this.words[g]=u.words[g]^p.words[g];if(this!==u)for(;g<u.length;g++)this.words[g]=u.words[g];return this.length=u.length,this._strip()},s.prototype.ixor=function(o){return n((this.negative|o.negative)===0),this.iuxor(o)},s.prototype.xor=function(o){return this.length>o.length?this.clone().ixor(o):o.clone().ixor(this)},s.prototype.uxor=function(o){return this.length>o.length?this.clone().iuxor(o):o.clone().iuxor(this)},s.prototype.inotn=function(o){n(typeof o=="number"&&o>=0);var u=Math.ceil(o/26)|0,p=o%26;this._expand(u),p>0&&u--;for(var g=0;g<u;g++)this.words[g]=~this.words[g]&67108863;return p>0&&(this.words[g]=~this.words[g]&67108863>>26-p),this._strip()},s.prototype.notn=function(o){return this.clone().inotn(o)},s.prototype.setn=function(o,u){n(typeof o=="number"&&o>=0);var p=o/26|0,g=o%26;return this._expand(p+1),u?this.words[p]=this.words[p]|1<<g:this.words[p]=this.words[p]&~(1<<g),this._strip()},s.prototype.iadd=function(o){var u;if(this.negative!==0&&o.negative===0)return this.negative=0,u=this.isub(o),this.negative^=1,this._normSign();if(this.negative===0&&o.negative!==0)return o.negative=0,u=this.isub(o),o.negative=1,u._normSign();var p,g;this.length>o.length?(p=this,g=o):(p=o,g=this);for(var v=0,E=0;E<g.length;E++)u=(p.words[E]|0)+(g.words[E]|0)+v,this.words[E]=u&67108863,v=u>>>26;for(;v!==0&&E<p.length;E++)u=(p.words[E]|0)+v,this.words[E]=u&67108863,v=u>>>26;if(this.length=p.length,v!==0)this.words[this.length]=v,this.length++;else if(p!==this)for(;E<p.length;E++)this.words[E]=p.words[E];return this},s.prototype.add=function(o){var u;return o.negative!==0&&this.negative===0?(o.negative=0,u=this.sub(o),o.negative^=1,u):o.negative===0&&this.negative!==0?(this.negative=0,u=o.sub(this),this.negative=1,u):this.length>o.length?this.clone().iadd(o):o.clone().iadd(this)},s.prototype.isub=function(o){if(o.negative!==0){o.negative=0;var u=this.iadd(o);return o.negative=1,u._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(o),this.negative=1,this._normSign();var p=this.cmp(o);if(p===0)return this.negative=0,this.length=1,this.words[0]=0,this;var g,v;p>0?(g=this,v=o):(g=o,v=this);for(var E=0,I=0;I<v.length;I++)u=(g.words[I]|0)-(v.words[I]|0)+E,E=u>>26,this.words[I]=u&67108863;for(;E!==0&&I<g.length;I++)u=(g.words[I]|0)+E,E=u>>26,this.words[I]=u&67108863;if(E===0&&I<g.length&&g!==this)for(;I<g.length;I++)this.words[I]=g.words[I];return this.length=Math.max(this.length,I),g!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(o){return this.clone().isub(o)};function M(S,o,u){u.negative=o.negative^S.negative;var p=S.length+o.length|0;u.length=p,p=p-1|0;var g=S.words[0]|0,v=o.words[0]|0,E=g*v,I=E&67108863,m=E/67108864|0;u.words[0]=I;for(var c=1;c<p;c++){for(var y=m>>>26,W=m&67108863,U=Math.min(c,o.length-1),k=Math.max(0,c-S.length+1);k<=U;k++){var A=c-k|0;g=S.words[A]|0,v=o.words[k]|0,E=g*v+W,y+=E/67108864|0,W=E&67108863}u.words[c]=W|0,m=y|0}return m!==0?u.words[c]=m|0:u.length--,u._strip()}var x=function(o,u,p){var g=o.words,v=u.words,E=p.words,I=0,m,c,y,W=g[0]|0,U=W&8191,k=W>>>13,A=g[1]|0,O=A&8191,H=A>>>13,ee=g[2]|0,b=ee&8191,w=ee>>>13,D=g[3]|0,j=D&8191,K=D>>>13,X=g[4]|0,Z=X&8191,ue=X>>>13,Rt=g[5]|0,me=Rt&8191,ve=Rt>>>13,jt=g[6]|0,pe=jt&8191,ge=jt>>>13,Lt=g[7]|0,de=Lt&8191,he=Lt>>>13,at=g[8]|0,ye=at&8191,be=at>>>13,Er=g[9]|0,we=Er&8191,_e=Er>>>13,Sr=v[0]|0,Ee=Sr&8191,Se=Sr>>>13,Rr=v[1]|0,Re=Rr&8191,Me=Rr>>>13,Mr=v[2]|0,ke=Mr&8191,Ie=Mr>>>13,kr=v[3]|0,Ce=kr&8191,Ae=kr>>>13,Ir=v[4]|0,xe=Ir&8191,Te=Ir>>>13,Cr=v[5]|0,Ne=Cr&8191,Pe=Cr>>>13,Ar=v[6]|0,Le=Ar&8191,$e=Ar>>>13,xr=v[7]|0,Oe=xr&8191,Be=xr>>>13,Tr=v[8]|0,De=Tr&8191,Fe=Tr>>>13,Nr=v[9]|0,je=Nr&8191,Ue=Nr>>>13;p.negative=o.negative^u.negative,p.length=19,m=Math.imul(U,Ee),c=Math.imul(U,Se),c=c+Math.imul(k,Ee)|0,y=Math.imul(k,Se);var Gt=(I+m|0)+((c&8191)<<13)|0;I=(y+(c>>>13)|0)+(Gt>>>26)|0,Gt&=67108863,m=Math.imul(O,Ee),c=Math.imul(O,Se),c=c+Math.imul(H,Ee)|0,y=Math.imul(H,Se),m=m+Math.imul(U,Re)|0,c=c+Math.imul(U,Me)|0,c=c+Math.imul(k,Re)|0,y=y+Math.imul(k,Me)|0;var Jt=(I+m|0)+((c&8191)<<13)|0;I=(y+(c>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,m=Math.imul(b,Ee),c=Math.imul(b,Se),c=c+Math.imul(w,Ee)|0,y=Math.imul(w,Se),m=m+Math.imul(O,Re)|0,c=c+Math.imul(O,Me)|0,c=c+Math.imul(H,Re)|0,y=y+Math.imul(H,Me)|0,m=m+Math.imul(U,ke)|0,c=c+Math.imul(U,Ie)|0,c=c+Math.imul(k,ke)|0,y=y+Math.imul(k,Ie)|0;var Zt=(I+m|0)+((c&8191)<<13)|0;I=(y+(c>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,m=Math.imul(j,Ee),c=Math.imul(j,Se),c=c+Math.imul(K,Ee)|0,y=Math.imul(K,Se),m=m+Math.imul(b,Re)|0,c=c+Math.imul(b,Me)|0,c=c+Math.imul(w,Re)|0,y=y+Math.imul(w,Me)|0,m=m+Math.imul(O,ke)|0,c=c+Math.imul(O,Ie)|0,c=c+Math.imul(H,ke)|0,y=y+Math.imul(H,Ie)|0,m=m+Math.imul(U,Ce)|0,c=c+Math.imul(U,Ae)|0,c=c+Math.imul(k,Ce)|0,y=y+Math.imul(k,Ae)|0;var Kt=(I+m|0)+((c&8191)<<13)|0;I=(y+(c>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,m=Math.imul(Z,Ee),c=Math.imul(Z,Se),c=c+Math.imul(ue,Ee)|0,y=Math.imul(ue,Se),m=m+Math.imul(j,Re)|0,c=c+Math.imul(j,Me)|0,c=c+Math.imul(K,Re)|0,y=y+Math.imul(K,Me)|0,m=m+Math.imul(b,ke)|0,c=c+Math.imul(b,Ie)|0,c=c+Math.imul(w,ke)|0,y=y+Math.imul(w,Ie)|0,m=m+Math.imul(O,Ce)|0,c=c+Math.imul(O,Ae)|0,c=c+Math.imul(H,Ce)|0,y=y+Math.imul(H,Ae)|0,m=m+Math.imul(U,xe)|0,c=c+Math.imul(U,Te)|0,c=c+Math.imul(k,xe)|0,y=y+Math.imul(k,Te)|0;var Qt=(I+m|0)+((c&8191)<<13)|0;I=(y+(c>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,m=Math.imul(me,Ee),c=Math.imul(me,Se),c=c+Math.imul(ve,Ee)|0,y=Math.imul(ve,Se),m=m+Math.imul(Z,Re)|0,c=c+Math.imul(Z,Me)|0,c=c+Math.imul(ue,Re)|0,y=y+Math.imul(ue,Me)|0,m=m+Math.imul(j,ke)|0,c=c+Math.imul(j,Ie)|0,c=c+Math.imul(K,ke)|0,y=y+Math.imul(K,Ie)|0,m=m+Math.imul(b,Ce)|0,c=c+Math.imul(b,Ae)|0,c=c+Math.imul(w,Ce)|0,y=y+Math.imul(w,Ae)|0,m=m+Math.imul(O,xe)|0,c=c+Math.imul(O,Te)|0,c=c+Math.imul(H,xe)|0,y=y+Math.imul(H,Te)|0,m=m+Math.imul(U,Ne)|0,c=c+Math.imul(U,Pe)|0,c=c+Math.imul(k,Ne)|0,y=y+Math.imul(k,Pe)|0;var Yt=(I+m|0)+((c&8191)<<13)|0;I=(y+(c>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,m=Math.imul(pe,Ee),c=Math.imul(pe,Se),c=c+Math.imul(ge,Ee)|0,y=Math.imul(ge,Se),m=m+Math.imul(me,Re)|0,c=c+Math.imul(me,Me)|0,c=c+Math.imul(ve,Re)|0,y=y+Math.imul(ve,Me)|0,m=m+Math.imul(Z,ke)|0,c=c+Math.imul(Z,Ie)|0,c=c+Math.imul(ue,ke)|0,y=y+Math.imul(ue,Ie)|0,m=m+Math.imul(j,Ce)|0,c=c+Math.imul(j,Ae)|0,c=c+Math.imul(K,Ce)|0,y=y+Math.imul(K,Ae)|0,m=m+Math.imul(b,xe)|0,c=c+Math.imul(b,Te)|0,c=c+Math.imul(w,xe)|0,y=y+Math.imul(w,Te)|0,m=m+Math.imul(O,Ne)|0,c=c+Math.imul(O,Pe)|0,c=c+Math.imul(H,Ne)|0,y=y+Math.imul(H,Pe)|0,m=m+Math.imul(U,Le)|0,c=c+Math.imul(U,$e)|0,c=c+Math.imul(k,Le)|0,y=y+Math.imul(k,$e)|0;var Xt=(I+m|0)+((c&8191)<<13)|0;I=(y+(c>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,m=Math.imul(de,Ee),c=Math.imul(de,Se),c=c+Math.imul(he,Ee)|0,y=Math.imul(he,Se),m=m+Math.imul(pe,Re)|0,c=c+Math.imul(pe,Me)|0,c=c+Math.imul(ge,Re)|0,y=y+Math.imul(ge,Me)|0,m=m+Math.imul(me,ke)|0,c=c+Math.imul(me,Ie)|0,c=c+Math.imul(ve,ke)|0,y=y+Math.imul(ve,Ie)|0,m=m+Math.imul(Z,Ce)|0,c=c+Math.imul(Z,Ae)|0,c=c+Math.imul(ue,Ce)|0,y=y+Math.imul(ue,Ae)|0,m=m+Math.imul(j,xe)|0,c=c+Math.imul(j,Te)|0,c=c+Math.imul(K,xe)|0,y=y+Math.imul(K,Te)|0,m=m+Math.imul(b,Ne)|0,c=c+Math.imul(b,Pe)|0,c=c+Math.imul(w,Ne)|0,y=y+Math.imul(w,Pe)|0,m=m+Math.imul(O,Le)|0,c=c+Math.imul(O,$e)|0,c=c+Math.imul(H,Le)|0,y=y+Math.imul(H,$e)|0,m=m+Math.imul(U,Oe)|0,c=c+Math.imul(U,Be)|0,c=c+Math.imul(k,Oe)|0,y=y+Math.imul(k,Be)|0;var er=(I+m|0)+((c&8191)<<13)|0;I=(y+(c>>>13)|0)+(er>>>26)|0,er&=67108863,m=Math.imul(ye,Ee),c=Math.imul(ye,Se),c=c+Math.imul(be,Ee)|0,y=Math.imul(be,Se),m=m+Math.imul(de,Re)|0,c=c+Math.imul(de,Me)|0,c=c+Math.imul(he,Re)|0,y=y+Math.imul(he,Me)|0,m=m+Math.imul(pe,ke)|0,c=c+Math.imul(pe,Ie)|0,c=c+Math.imul(ge,ke)|0,y=y+Math.imul(ge,Ie)|0,m=m+Math.imul(me,Ce)|0,c=c+Math.imul(me,Ae)|0,c=c+Math.imul(ve,Ce)|0,y=y+Math.imul(ve,Ae)|0,m=m+Math.imul(Z,xe)|0,c=c+Math.imul(Z,Te)|0,c=c+Math.imul(ue,xe)|0,y=y+Math.imul(ue,Te)|0,m=m+Math.imul(j,Ne)|0,c=c+Math.imul(j,Pe)|0,c=c+Math.imul(K,Ne)|0,y=y+Math.imul(K,Pe)|0,m=m+Math.imul(b,Le)|0,c=c+Math.imul(b,$e)|0,c=c+Math.imul(w,Le)|0,y=y+Math.imul(w,$e)|0,m=m+Math.imul(O,Oe)|0,c=c+Math.imul(O,Be)|0,c=c+Math.imul(H,Oe)|0,y=y+Math.imul(H,Be)|0,m=m+Math.imul(U,De)|0,c=c+Math.imul(U,Fe)|0,c=c+Math.imul(k,De)|0,y=y+Math.imul(k,Fe)|0;var tr=(I+m|0)+((c&8191)<<13)|0;I=(y+(c>>>13)|0)+(tr>>>26)|0,tr&=67108863,m=Math.imul(we,Ee),c=Math.imul(we,Se),c=c+Math.imul(_e,Ee)|0,y=Math.imul(_e,Se),m=m+Math.imul(ye,Re)|0,c=c+Math.imul(ye,Me)|0,c=c+Math.imul(be,Re)|0,y=y+Math.imul(be,Me)|0,m=m+Math.imul(de,ke)|0,c=c+Math.imul(de,Ie)|0,c=c+Math.imul(he,ke)|0,y=y+Math.imul(he,Ie)|0,m=m+Math.imul(pe,Ce)|0,c=c+Math.imul(pe,Ae)|0,c=c+Math.imul(ge,Ce)|0,y=y+Math.imul(ge,Ae)|0,m=m+Math.imul(me,xe)|0,c=c+Math.imul(me,Te)|0,c=c+Math.imul(ve,xe)|0,y=y+Math.imul(ve,Te)|0,m=m+Math.imul(Z,Ne)|0,c=c+Math.imul(Z,Pe)|0,c=c+Math.imul(ue,Ne)|0,y=y+Math.imul(ue,Pe)|0,m=m+Math.imul(j,Le)|0,c=c+Math.imul(j,$e)|0,c=c+Math.imul(K,Le)|0,y=y+Math.imul(K,$e)|0,m=m+Math.imul(b,Oe)|0,c=c+Math.imul(b,Be)|0,c=c+Math.imul(w,Oe)|0,y=y+Math.imul(w,Be)|0,m=m+Math.imul(O,De)|0,c=c+Math.imul(O,Fe)|0,c=c+Math.imul(H,De)|0,y=y+Math.imul(H,Fe)|0,m=m+Math.imul(U,je)|0,c=c+Math.imul(U,Ue)|0,c=c+Math.imul(k,je)|0,y=y+Math.imul(k,Ue)|0;var rr=(I+m|0)+((c&8191)<<13)|0;I=(y+(c>>>13)|0)+(rr>>>26)|0,rr&=67108863,m=Math.imul(we,Re),c=Math.imul(we,Me),c=c+Math.imul(_e,Re)|0,y=Math.imul(_e,Me),m=m+Math.imul(ye,ke)|0,c=c+Math.imul(ye,Ie)|0,c=c+Math.imul(be,ke)|0,y=y+Math.imul(be,Ie)|0,m=m+Math.imul(de,Ce)|0,c=c+Math.imul(de,Ae)|0,c=c+Math.imul(he,Ce)|0,y=y+Math.imul(he,Ae)|0,m=m+Math.imul(pe,xe)|0,c=c+Math.imul(pe,Te)|0,c=c+Math.imul(ge,xe)|0,y=y+Math.imul(ge,Te)|0,m=m+Math.imul(me,Ne)|0,c=c+Math.imul(me,Pe)|0,c=c+Math.imul(ve,Ne)|0,y=y+Math.imul(ve,Pe)|0,m=m+Math.imul(Z,Le)|0,c=c+Math.imul(Z,$e)|0,c=c+Math.imul(ue,Le)|0,y=y+Math.imul(ue,$e)|0,m=m+Math.imul(j,Oe)|0,c=c+Math.imul(j,Be)|0,c=c+Math.imul(K,Oe)|0,y=y+Math.imul(K,Be)|0,m=m+Math.imul(b,De)|0,c=c+Math.imul(b,Fe)|0,c=c+Math.imul(w,De)|0,y=y+Math.imul(w,Fe)|0,m=m+Math.imul(O,je)|0,c=c+Math.imul(O,Ue)|0,c=c+Math.imul(H,je)|0,y=y+Math.imul(H,Ue)|0;var nr=(I+m|0)+((c&8191)<<13)|0;I=(y+(c>>>13)|0)+(nr>>>26)|0,nr&=67108863,m=Math.imul(we,ke),c=Math.imul(we,Ie),c=c+Math.imul(_e,ke)|0,y=Math.imul(_e,Ie),m=m+Math.imul(ye,Ce)|0,c=c+Math.imul(ye,Ae)|0,c=c+Math.imul(be,Ce)|0,y=y+Math.imul(be,Ae)|0,m=m+Math.imul(de,xe)|0,c=c+Math.imul(de,Te)|0,c=c+Math.imul(he,xe)|0,y=y+Math.imul(he,Te)|0,m=m+Math.imul(pe,Ne)|0,c=c+Math.imul(pe,Pe)|0,c=c+Math.imul(ge,Ne)|0,y=y+Math.imul(ge,Pe)|0,m=m+Math.imul(me,Le)|0,c=c+Math.imul(me,$e)|0,c=c+Math.imul(ve,Le)|0,y=y+Math.imul(ve,$e)|0,m=m+Math.imul(Z,Oe)|0,c=c+Math.imul(Z,Be)|0,c=c+Math.imul(ue,Oe)|0,y=y+Math.imul(ue,Be)|0,m=m+Math.imul(j,De)|0,c=c+Math.imul(j,Fe)|0,c=c+Math.imul(K,De)|0,y=y+Math.imul(K,Fe)|0,m=m+Math.imul(b,je)|0,c=c+Math.imul(b,Ue)|0,c=c+Math.imul(w,je)|0,y=y+Math.imul(w,Ue)|0;var ir=(I+m|0)+((c&8191)<<13)|0;I=(y+(c>>>13)|0)+(ir>>>26)|0,ir&=67108863,m=Math.imul(we,Ce),c=Math.imul(we,Ae),c=c+Math.imul(_e,Ce)|0,y=Math.imul(_e,Ae),m=m+Math.imul(ye,xe)|0,c=c+Math.imul(ye,Te)|0,c=c+Math.imul(be,xe)|0,y=y+Math.imul(be,Te)|0,m=m+Math.imul(de,Ne)|0,c=c+Math.imul(de,Pe)|0,c=c+Math.imul(he,Ne)|0,y=y+Math.imul(he,Pe)|0,m=m+Math.imul(pe,Le)|0,c=c+Math.imul(pe,$e)|0,c=c+Math.imul(ge,Le)|0,y=y+Math.imul(ge,$e)|0,m=m+Math.imul(me,Oe)|0,c=c+Math.imul(me,Be)|0,c=c+Math.imul(ve,Oe)|0,y=y+Math.imul(ve,Be)|0,m=m+Math.imul(Z,De)|0,c=c+Math.imul(Z,Fe)|0,c=c+Math.imul(ue,De)|0,y=y+Math.imul(ue,Fe)|0,m=m+Math.imul(j,je)|0,c=c+Math.imul(j,Ue)|0,c=c+Math.imul(K,je)|0,y=y+Math.imul(K,Ue)|0;var sr=(I+m|0)+((c&8191)<<13)|0;I=(y+(c>>>13)|0)+(sr>>>26)|0,sr&=67108863,m=Math.imul(we,xe),c=Math.imul(we,Te),c=c+Math.imul(_e,xe)|0,y=Math.imul(_e,Te),m=m+Math.imul(ye,Ne)|0,c=c+Math.imul(ye,Pe)|0,c=c+Math.imul(be,Ne)|0,y=y+Math.imul(be,Pe)|0,m=m+Math.imul(de,Le)|0,c=c+Math.imul(de,$e)|0,c=c+Math.imul(he,Le)|0,y=y+Math.imul(he,$e)|0,m=m+Math.imul(pe,Oe)|0,c=c+Math.imul(pe,Be)|0,c=c+Math.imul(ge,Oe)|0,y=y+Math.imul(ge,Be)|0,m=m+Math.imul(me,De)|0,c=c+Math.imul(me,Fe)|0,c=c+Math.imul(ve,De)|0,y=y+Math.imul(ve,Fe)|0,m=m+Math.imul(Z,je)|0,c=c+Math.imul(Z,Ue)|0,c=c+Math.imul(ue,je)|0,y=y+Math.imul(ue,Ue)|0;var or=(I+m|0)+((c&8191)<<13)|0;I=(y+(c>>>13)|0)+(or>>>26)|0,or&=67108863,m=Math.imul(we,Ne),c=Math.imul(we,Pe),c=c+Math.imul(_e,Ne)|0,y=Math.imul(_e,Pe),m=m+Math.imul(ye,Le)|0,c=c+Math.imul(ye,$e)|0,c=c+Math.imul(be,Le)|0,y=y+Math.imul(be,$e)|0,m=m+Math.imul(de,Oe)|0,c=c+Math.imul(de,Be)|0,c=c+Math.imul(he,Oe)|0,y=y+Math.imul(he,Be)|0,m=m+Math.imul(pe,De)|0,c=c+Math.imul(pe,Fe)|0,c=c+Math.imul(ge,De)|0,y=y+Math.imul(ge,Fe)|0,m=m+Math.imul(me,je)|0,c=c+Math.imul(me,Ue)|0,c=c+Math.imul(ve,je)|0,y=y+Math.imul(ve,Ue)|0;var Ms=(I+m|0)+((c&8191)<<13)|0;I=(y+(c>>>13)|0)+(Ms>>>26)|0,Ms&=67108863,m=Math.imul(we,Le),c=Math.imul(we,$e),c=c+Math.imul(_e,Le)|0,y=Math.imul(_e,$e),m=m+Math.imul(ye,Oe)|0,c=c+Math.imul(ye,Be)|0,c=c+Math.imul(be,Oe)|0,y=y+Math.imul(be,Be)|0,m=m+Math.imul(de,De)|0,c=c+Math.imul(de,Fe)|0,c=c+Math.imul(he,De)|0,y=y+Math.imul(he,Fe)|0,m=m+Math.imul(pe,je)|0,c=c+Math.imul(pe,Ue)|0,c=c+Math.imul(ge,je)|0,y=y+Math.imul(ge,Ue)|0;var ks=(I+m|0)+((c&8191)<<13)|0;I=(y+(c>>>13)|0)+(ks>>>26)|0,ks&=67108863,m=Math.imul(we,Oe),c=Math.imul(we,Be),c=c+Math.imul(_e,Oe)|0,y=Math.imul(_e,Be),m=m+Math.imul(ye,De)|0,c=c+Math.imul(ye,Fe)|0,c=c+Math.imul(be,De)|0,y=y+Math.imul(be,Fe)|0,m=m+Math.imul(de,je)|0,c=c+Math.imul(de,Ue)|0,c=c+Math.imul(he,je)|0,y=y+Math.imul(he,Ue)|0;var Is=(I+m|0)+((c&8191)<<13)|0;I=(y+(c>>>13)|0)+(Is>>>26)|0,Is&=67108863,m=Math.imul(we,De),c=Math.imul(we,Fe),c=c+Math.imul(_e,De)|0,y=Math.imul(_e,Fe),m=m+Math.imul(ye,je)|0,c=c+Math.imul(ye,Ue)|0,c=c+Math.imul(be,je)|0,y=y+Math.imul(be,Ue)|0;var Cs=(I+m|0)+((c&8191)<<13)|0;I=(y+(c>>>13)|0)+(Cs>>>26)|0,Cs&=67108863,m=Math.imul(we,je),c=Math.imul(we,Ue),c=c+Math.imul(_e,je)|0,y=Math.imul(_e,Ue);var As=(I+m|0)+((c&8191)<<13)|0;return I=(y+(c>>>13)|0)+(As>>>26)|0,As&=67108863,E[0]=Gt,E[1]=Jt,E[2]=Zt,E[3]=Kt,E[4]=Qt,E[5]=Yt,E[6]=Xt,E[7]=er,E[8]=tr,E[9]=rr,E[10]=nr,E[11]=ir,E[12]=sr,E[13]=or,E[14]=Ms,E[15]=ks,E[16]=Is,E[17]=Cs,E[18]=As,I!==0&&(E[19]=I,p.length++),p};Math.imul||(x=M);function T(S,o,u){u.negative=o.negative^S.negative,u.length=S.length+o.length;for(var p=0,g=0,v=0;v<u.length-1;v++){var E=g;g=0;for(var I=p&67108863,m=Math.min(v,o.length-1),c=Math.max(0,v-S.length+1);c<=m;c++){var y=v-c,W=S.words[y]|0,U=o.words[c]|0,k=W*U,A=k&67108863;E=E+(k/67108864|0)|0,A=A+I|0,I=A&67108863,E=E+(A>>>26)|0,g+=E>>>26,E&=67108863}u.words[v]=I,p=E,E=g}return p!==0?u.words[v]=p:u.length--,u._strip()}function B(S,o,u){return T(S,o,u)}s.prototype.mulTo=function(o,u){var p,g=this.length+o.length;return this.length===10&&o.length===10?p=x(this,o,u):g<63?p=M(this,o,u):g<1024?p=T(this,o,u):p=B(this,o,u),p},s.prototype.mul=function(o){var u=new s(null);return u.words=new Array(this.length+o.length),this.mulTo(o,u)},s.prototype.mulf=function(o){var u=new s(null);return u.words=new Array(this.length+o.length),B(this,o,u)},s.prototype.imul=function(o){return this.clone().mulTo(o,this)},s.prototype.imuln=function(o){var u=o<0;u&&(o=-o),n(typeof o=="number"),n(o<67108864);for(var p=0,g=0;g<this.length;g++){var v=(this.words[g]|0)*o,E=(v&67108863)+(p&67108863);p>>=26,p+=v/67108864|0,p+=E>>>26,this.words[g]=E&67108863}return p!==0&&(this.words[g]=p,this.length++),this.length=o===0?1:this.length,u?this.ineg():this},s.prototype.muln=function(o){return this.clone().imuln(o)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(o){var u=$(o);if(u.length===0)return new s(1);for(var p=this,g=0;g<u.length&&u[g]===0;g++,p=p.sqr());if(++g<u.length)for(var v=p.sqr();g<u.length;g++,v=v.sqr())u[g]!==0&&(p=p.mul(v));return p},s.prototype.iushln=function(o){n(typeof o=="number"&&o>=0);var u=o%26,p=(o-u)/26,g=67108863>>>26-u<<26-u,v;if(u!==0){var E=0;for(v=0;v<this.length;v++){var I=this.words[v]&g,m=(this.words[v]|0)-I<<u;this.words[v]=m|E,E=I>>>26-u}E&&(this.words[v]=E,this.length++)}if(p!==0){for(v=this.length-1;v>=0;v--)this.words[v+p]=this.words[v];for(v=0;v<p;v++)this.words[v]=0;this.length+=p}return this._strip()},s.prototype.ishln=function(o){return n(this.negative===0),this.iushln(o)},s.prototype.iushrn=function(o,u,p){n(typeof o=="number"&&o>=0);var g;u?g=(u-u%26)/26:g=0;var v=o%26,E=Math.min((o-v)/26,this.length),I=67108863^67108863>>>v<<v,m=p;if(g-=E,g=Math.max(0,g),m){for(var c=0;c<E;c++)m.words[c]=this.words[c];m.length=E}if(E!==0)if(this.length>E)for(this.length-=E,c=0;c<this.length;c++)this.words[c]=this.words[c+E];else this.words[0]=0,this.length=1;var y=0;for(c=this.length-1;c>=0&&(y!==0||c>=g);c--){var W=this.words[c]|0;this.words[c]=y<<26-v|W>>>v,y=W&I}return m&&y!==0&&(m.words[m.length++]=y),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(o,u,p){return n(this.negative===0),this.iushrn(o,u,p)},s.prototype.shln=function(o){return this.clone().ishln(o)},s.prototype.ushln=function(o){return this.clone().iushln(o)},s.prototype.shrn=function(o){return this.clone().ishrn(o)},s.prototype.ushrn=function(o){return this.clone().iushrn(o)},s.prototype.testn=function(o){n(typeof o=="number"&&o>=0);var u=o%26,p=(o-u)/26,g=1<<u;if(this.length<=p)return!1;var v=this.words[p];return!!(v&g)},s.prototype.imaskn=function(o){n(typeof o=="number"&&o>=0);var u=o%26,p=(o-u)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=p)return this;if(u!==0&&p++,this.length=Math.min(p,this.length),u!==0){var g=67108863^67108863>>>u<<u;this.words[this.length-1]&=g}return this._strip()},s.prototype.maskn=function(o){return this.clone().imaskn(o)},s.prototype.iaddn=function(o){return n(typeof o=="number"),n(o<67108864),o<0?this.isubn(-o):this.negative!==0?this.length===1&&(this.words[0]|0)<=o?(this.words[0]=o-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(o),this.negative=1,this):this._iaddn(o)},s.prototype._iaddn=function(o){this.words[0]+=o;for(var u=0;u<this.length&&this.words[u]>=67108864;u++)this.words[u]-=67108864,u===this.length-1?this.words[u+1]=1:this.words[u+1]++;return this.length=Math.max(this.length,u+1),this},s.prototype.isubn=function(o){if(n(typeof o=="number"),n(o<67108864),o<0)return this.iaddn(-o);if(this.negative!==0)return this.negative=0,this.iaddn(o),this.negative=1,this;if(this.words[0]-=o,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var u=0;u<this.length&&this.words[u]<0;u++)this.words[u]+=67108864,this.words[u+1]-=1;return this._strip()},s.prototype.addn=function(o){return this.clone().iaddn(o)},s.prototype.subn=function(o){return this.clone().isubn(o)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(o,u,p){var g=o.length+p,v;this._expand(g);var E,I=0;for(v=0;v<o.length;v++){E=(this.words[v+p]|0)+I;var m=(o.words[v]|0)*u;E-=m&67108863,I=(E>>26)-(m/67108864|0),this.words[v+p]=E&67108863}for(;v<this.length-p;v++)E=(this.words[v+p]|0)+I,I=E>>26,this.words[v+p]=E&67108863;if(I===0)return this._strip();for(n(I===-1),I=0,v=0;v<this.length;v++)E=-(this.words[v]|0)+I,I=E>>26,this.words[v]=E&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(o,u){var p=this.length-o.length,g=this.clone(),v=o,E=v.words[v.length-1]|0,I=this._countBits(E);p=26-I,p!==0&&(v=v.ushln(p),g.iushln(p),E=v.words[v.length-1]|0);var m=g.length-v.length,c;if(u!=="mod"){c=new s(null),c.length=m+1,c.words=new Array(c.length);for(var y=0;y<c.length;y++)c.words[y]=0}var W=g.clone()._ishlnsubmul(v,1,m);W.negative===0&&(g=W,c&&(c.words[m]=1));for(var U=m-1;U>=0;U--){var k=(g.words[v.length+U]|0)*67108864+(g.words[v.length+U-1]|0);for(k=Math.min(k/E|0,67108863),g._ishlnsubmul(v,k,U);g.negative!==0;)k--,g.negative=0,g._ishlnsubmul(v,1,U),g.isZero()||(g.negative^=1);c&&(c.words[U]=k)}return c&&c._strip(),g._strip(),u!=="div"&&p!==0&&g.iushrn(p),{div:c||null,mod:g}},s.prototype.divmod=function(o,u,p){if(n(!o.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var g,v,E;return this.negative!==0&&o.negative===0?(E=this.neg().divmod(o,u),u!=="mod"&&(g=E.div.neg()),u!=="div"&&(v=E.mod.neg(),p&&v.negative!==0&&v.iadd(o)),{div:g,mod:v}):this.negative===0&&o.negative!==0?(E=this.divmod(o.neg(),u),u!=="mod"&&(g=E.div.neg()),{div:g,mod:E.mod}):this.negative&o.negative?(E=this.neg().divmod(o.neg(),u),u!=="div"&&(v=E.mod.neg(),p&&v.negative!==0&&v.isub(o)),{div:E.div,mod:v}):o.length>this.length||this.cmp(o)<0?{div:new s(0),mod:this}:o.length===1?u==="div"?{div:this.divn(o.words[0]),mod:null}:u==="mod"?{div:null,mod:new s(this.modrn(o.words[0]))}:{div:this.divn(o.words[0]),mod:new s(this.modrn(o.words[0]))}:this._wordDiv(o,u)},s.prototype.div=function(o){return this.divmod(o,"div",!1).div},s.prototype.mod=function(o){return this.divmod(o,"mod",!1).mod},s.prototype.umod=function(o){return this.divmod(o,"mod",!0).mod},s.prototype.divRound=function(o){var u=this.divmod(o);if(u.mod.isZero())return u.div;var p=u.div.negative!==0?u.mod.isub(o):u.mod,g=o.ushrn(1),v=o.andln(1),E=p.cmp(g);return E<0||v===1&&E===0?u.div:u.div.negative!==0?u.div.isubn(1):u.div.iaddn(1)},s.prototype.modrn=function(o){var u=o<0;u&&(o=-o),n(o<=67108863);for(var p=(1<<26)%o,g=0,v=this.length-1;v>=0;v--)g=(p*g+(this.words[v]|0))%o;return u?-g:g},s.prototype.modn=function(o){return this.modrn(o)},s.prototype.idivn=function(o){var u=o<0;u&&(o=-o),n(o<=67108863);for(var p=0,g=this.length-1;g>=0;g--){var v=(this.words[g]|0)+p*67108864;this.words[g]=v/o|0,p=v%o}return this._strip(),u?this.ineg():this},s.prototype.divn=function(o){return this.clone().idivn(o)},s.prototype.egcd=function(o){n(o.negative===0),n(!o.isZero());var u=this,p=o.clone();u.negative!==0?u=u.umod(o):u=u.clone();for(var g=new s(1),v=new s(0),E=new s(0),I=new s(1),m=0;u.isEven()&&p.isEven();)u.iushrn(1),p.iushrn(1),++m;for(var c=p.clone(),y=u.clone();!u.isZero();){for(var W=0,U=1;!(u.words[0]&U)&&W<26;++W,U<<=1);if(W>0)for(u.iushrn(W);W-- >0;)(g.isOdd()||v.isOdd())&&(g.iadd(c),v.isub(y)),g.iushrn(1),v.iushrn(1);for(var k=0,A=1;!(p.words[0]&A)&&k<26;++k,A<<=1);if(k>0)for(p.iushrn(k);k-- >0;)(E.isOdd()||I.isOdd())&&(E.iadd(c),I.isub(y)),E.iushrn(1),I.iushrn(1);u.cmp(p)>=0?(u.isub(p),g.isub(E),v.isub(I)):(p.isub(u),E.isub(g),I.isub(v))}return{a:E,b:I,gcd:p.iushln(m)}},s.prototype._invmp=function(o){n(o.negative===0),n(!o.isZero());var u=this,p=o.clone();u.negative!==0?u=u.umod(o):u=u.clone();for(var g=new s(1),v=new s(0),E=p.clone();u.cmpn(1)>0&&p.cmpn(1)>0;){for(var I=0,m=1;!(u.words[0]&m)&&I<26;++I,m<<=1);if(I>0)for(u.iushrn(I);I-- >0;)g.isOdd()&&g.iadd(E),g.iushrn(1);for(var c=0,y=1;!(p.words[0]&y)&&c<26;++c,y<<=1);if(c>0)for(p.iushrn(c);c-- >0;)v.isOdd()&&v.iadd(E),v.iushrn(1);u.cmp(p)>=0?(u.isub(p),g.isub(v)):(p.isub(u),v.isub(g))}var W;return u.cmpn(1)===0?W=g:W=v,W.cmpn(0)<0&&W.iadd(o),W},s.prototype.gcd=function(o){if(this.isZero())return o.abs();if(o.isZero())return this.abs();var u=this.clone(),p=o.clone();u.negative=0,p.negative=0;for(var g=0;u.isEven()&&p.isEven();g++)u.iushrn(1),p.iushrn(1);do{for(;u.isEven();)u.iushrn(1);for(;p.isEven();)p.iushrn(1);var v=u.cmp(p);if(v<0){var E=u;u=p,p=E}else if(v===0||p.cmpn(1)===0)break;u.isub(p)}while(!0);return p.iushln(g)},s.prototype.invm=function(o){return this.egcd(o).a.umod(o)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(o){return this.words[0]&o},s.prototype.bincn=function(o){n(typeof o=="number");var u=o%26,p=(o-u)/26,g=1<<u;if(this.length<=p)return this._expand(p+1),this.words[p]|=g,this;for(var v=g,E=p;v!==0&&E<this.length;E++){var I=this.words[E]|0;I+=v,v=I>>>26,I&=67108863,this.words[E]=I}return v!==0&&(this.words[E]=v,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(o){var u=o<0;if(this.negative!==0&&!u)return-1;if(this.negative===0&&u)return 1;this._strip();var p;if(this.length>1)p=1;else{u&&(o=-o),n(o<=67108863,"Number is too big");var g=this.words[0]|0;p=g===o?0:g<o?-1:1}return this.negative!==0?-p|0:p},s.prototype.cmp=function(o){if(this.negative!==0&&o.negative===0)return-1;if(this.negative===0&&o.negative!==0)return 1;var u=this.ucmp(o);return this.negative!==0?-u|0:u},s.prototype.ucmp=function(o){if(this.length>o.length)return 1;if(this.length<o.length)return-1;for(var u=0,p=this.length-1;p>=0;p--){var g=this.words[p]|0,v=o.words[p]|0;if(g!==v){g<v?u=-1:g>v&&(u=1);break}}return u},s.prototype.gtn=function(o){return this.cmpn(o)===1},s.prototype.gt=function(o){return this.cmp(o)===1},s.prototype.gten=function(o){return this.cmpn(o)>=0},s.prototype.gte=function(o){return this.cmp(o)>=0},s.prototype.ltn=function(o){return this.cmpn(o)===-1},s.prototype.lt=function(o){return this.cmp(o)===-1},s.prototype.lten=function(o){return this.cmpn(o)<=0},s.prototype.lte=function(o){return this.cmp(o)<=0},s.prototype.eqn=function(o){return this.cmpn(o)===0},s.prototype.eq=function(o){return this.cmp(o)===0},s.red=function(o){return new Q(o)},s.prototype.toRed=function(o){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),o.convertTo(this)._forceRed(o)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(o){return this.red=o,this},s.prototype.forceRed=function(o){return n(!this.red,"Already a number in reduction context"),this._forceRed(o)},s.prototype.redAdd=function(o){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,o)},s.prototype.redIAdd=function(o){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,o)},s.prototype.redSub=function(o){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,o)},s.prototype.redISub=function(o){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,o)},s.prototype.redShl=function(o){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,o)},s.prototype.redMul=function(o){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.mul(this,o)},s.prototype.redIMul=function(o){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.imul(this,o)},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(o){return n(this.red&&!o.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,o)};var P={k256:null,p224:null,p192:null,p25519:null};function F(S,o){this.name=S,this.p=new s(o,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}F.prototype._tmp=function(){var o=new s(null);return o.words=new Array(Math.ceil(this.n/13)),o},F.prototype.ireduce=function(o){var u=o,p;do this.split(u,this.tmp),u=this.imulK(u),u=u.iadd(this.tmp),p=u.bitLength();while(p>this.n);var g=p<this.n?-1:u.ucmp(this.p);return g===0?(u.words[0]=0,u.length=1):g>0?u.isub(this.p):u.strip!==void 0?u.strip():u._strip(),u},F.prototype.split=function(o,u){o.iushrn(this.n,0,u)},F.prototype.imulK=function(o){return o.imul(this.k)};function J(){F.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(J,F),J.prototype.split=function(o,u){for(var p=4194303,g=Math.min(o.length,9),v=0;v<g;v++)u.words[v]=o.words[v];if(u.length=g,o.length<=9){o.words[0]=0,o.length=1;return}var E=o.words[9];for(u.words[u.length++]=E&p,v=10;v<o.length;v++){var I=o.words[v]|0;o.words[v-10]=(I&p)<<4|E>>>22,E=I}E>>>=22,o.words[v-10]=E,E===0&&o.length>10?o.length-=10:o.length-=9},J.prototype.imulK=function(o){o.words[o.length]=0,o.words[o.length+1]=0,o.length+=2;for(var u=0,p=0;p<o.length;p++){var g=o.words[p]|0;u+=g*977,o.words[p]=u&67108863,u=g*64+(u/67108864|0)}return o.words[o.length-1]===0&&(o.length--,o.words[o.length-1]===0&&o.length--),o};function G(){F.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(G,F);function V(){F.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(V,F);function ie(){F.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(ie,F),ie.prototype.imulK=function(o){for(var u=0,p=0;p<o.length;p++){var g=(o.words[p]|0)*19+u,v=g&67108863;g>>>=26,o.words[p]=v,u=g}return u!==0&&(o.words[o.length++]=u),o},s._prime=function(o){if(P[o])return P[o];var u;if(o==="k256")u=new J;else if(o==="p224")u=new G;else if(o==="p192")u=new V;else if(o==="p25519")u=new ie;else throw new Error("Unknown prime "+o);return P[o]=u,u};function Q(S){if(typeof S=="string"){var o=s._prime(S);this.m=o.p,this.prime=o}else n(S.gtn(1),"modulus must be greater than 1"),this.m=S,this.prime=null}Q.prototype._verify1=function(o){n(o.negative===0,"red works only with positives"),n(o.red,"red works only with red numbers")},Q.prototype._verify2=function(o,u){n((o.negative|u.negative)===0,"red works only with positives"),n(o.red&&o.red===u.red,"red works only with red numbers")},Q.prototype.imod=function(o){return this.prime?this.prime.ireduce(o)._forceRed(this):(f(o,o.umod(this.m)._forceRed(this)),o)},Q.prototype.neg=function(o){return o.isZero()?o.clone():this.m.sub(o)._forceRed(this)},Q.prototype.add=function(o,u){this._verify2(o,u);var p=o.add(u);return p.cmp(this.m)>=0&&p.isub(this.m),p._forceRed(this)},Q.prototype.iadd=function(o,u){this._verify2(o,u);var p=o.iadd(u);return p.cmp(this.m)>=0&&p.isub(this.m),p},Q.prototype.sub=function(o,u){this._verify2(o,u);var p=o.sub(u);return p.cmpn(0)<0&&p.iadd(this.m),p._forceRed(this)},Q.prototype.isub=function(o,u){this._verify2(o,u);var p=o.isub(u);return p.cmpn(0)<0&&p.iadd(this.m),p},Q.prototype.shl=function(o,u){return this._verify1(o),this.imod(o.ushln(u))},Q.prototype.imul=function(o,u){return this._verify2(o,u),this.imod(o.imul(u))},Q.prototype.mul=function(o,u){return this._verify2(o,u),this.imod(o.mul(u))},Q.prototype.isqr=function(o){return this.imul(o,o.clone())},Q.prototype.sqr=function(o){return this.mul(o,o)},Q.prototype.sqrt=function(o){if(o.isZero())return o.clone();var u=this.m.andln(3);if(n(u%2===1),u===3){var p=this.m.add(new s(1)).iushrn(2);return this.pow(o,p)}for(var g=this.m.subn(1),v=0;!g.isZero()&&g.andln(1)===0;)v++,g.iushrn(1);n(!g.isZero());var E=new s(1).toRed(this),I=E.redNeg(),m=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new s(2*c*c).toRed(this);this.pow(c,m).cmp(I)!==0;)c.redIAdd(I);for(var y=this.pow(c,g),W=this.pow(o,g.addn(1).iushrn(1)),U=this.pow(o,g),k=v;U.cmp(E)!==0;){for(var A=U,O=0;A.cmp(E)!==0;O++)A=A.redSqr();n(O<k);var H=this.pow(y,new s(1).iushln(k-O-1));W=W.redMul(H),y=H.redSqr(),U=U.redMul(y),k=O}return W},Q.prototype.invm=function(o){var u=o._invmp(this.m);return u.negative!==0?(u.negative=0,this.imod(u).redNeg()):this.imod(u)},Q.prototype.pow=function(o,u){if(u.isZero())return new s(1).toRed(this);if(u.cmpn(1)===0)return o.clone();var p=4,g=new Array(1<<p);g[0]=new s(1).toRed(this),g[1]=o;for(var v=2;v<g.length;v++)g[v]=this.mul(g[v-1],o);var E=g[0],I=0,m=0,c=u.bitLength()%26;for(c===0&&(c=26),v=u.length-1;v>=0;v--){for(var y=u.words[v],W=c-1;W>=0;W--){var U=y>>W&1;if(E!==g[0]&&(E=this.sqr(E)),U===0&&I===0){m=0;continue}I<<=1,I|=U,m++,!(m!==p&&(v!==0||W!==0))&&(E=this.mul(E,g[I]),m=0,I=0)}c=26}return E},Q.prototype.convertTo=function(o){var u=o.umod(this.m);return u===o?u.clone():u},Q.prototype.convertFrom=function(o){var u=o.clone();return u.red=null,u},s.mont=function(o){return new oe(o)};function oe(S){Q.call(this,S),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(oe,Q),oe.prototype.convertTo=function(o){return this.imod(o.ushln(this.shift))},oe.prototype.convertFrom=function(o){var u=this.imod(o.mul(this.rinv));return u.red=null,u},oe.prototype.imul=function(o,u){if(o.isZero()||u.isZero())return o.words[0]=0,o.length=1,o;var p=o.imul(u),g=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=p.isub(g).iushrn(this.shift),E=v;return v.cmp(this.m)>=0?E=v.isub(this.m):v.cmpn(0)<0&&(E=v.iadd(this.m)),E._forceRed(this)},oe.prototype.mul=function(o,u){if(o.isZero()||u.isZero())return new s(0)._forceRed(this);var p=o.mul(u),g=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=p.isub(g).iushrn(this.shift),E=v;return v.cmp(this.m)>=0?E=v.isub(this.m):v.cmpn(0)<0&&(E=v.iadd(this.m)),E._forceRed(this)},oe.prototype.invm=function(o){var u=this.imod(o._invmp(this.m).mul(this.r2));return u._forceRed(this)}})(e,z)})(No);var Ti=No.exports,Cn={},Bt={};Object.defineProperty(Bt,"__esModule",{value:!0});Bt.errorValues=Bt.standardErrorCodes=void 0;Bt.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}};Bt.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 Ni={},Pi={};(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=Bt,r="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(_,C=r){if(_&&Number.isInteger(_)){const L=_.toString();if(f(t.errorValues,L))return t.errorValues[L].message;if(h(_))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return C}e.getMessageFromCode=n;function i(_){if(!Number.isInteger(_))return!1;const C=_.toString();return!!(t.errorValues[C]||h(_))}e.isValidCode=i;function s(_){var C;if(typeof _=="number")return _;if(a(_))return(C=_.code)!==null&&C!==void 0?C:_.errorCode}e.getErrorCode=s;function a(_){return typeof _=="object"&&_!==null&&(typeof _.code=="number"||typeof _.errorCode=="number")}function l(_,{shouldIncludeStack:C=!1}={}){const L={};if(_&&typeof _=="object"&&!Array.isArray(_)&&f(_,"code")&&i(_.code)){const N=_;L.code=N.code,N.message&&typeof N.message=="string"?(L.message=N.message,f(N,"data")&&(L.data=N.data)):(L.message=n(L.code),L.data={originalError:d(_)})}else L.code=t.standardErrorCodes.rpc.internal,L.message=R(_,"message")?_.message:r,L.data={originalError:d(_)};return C&&(L.stack=R(_,"stack")?_.stack:void 0),L}e.serialize=l;function h(_){return _>=-32099&&_<=-32e3}function d(_){return _&&typeof _=="object"&&!Array.isArray(_)?Object.assign({},_):_}function f(_,C){return Object.prototype.hasOwnProperty.call(_,C)}function R(_,C){return typeof _=="object"&&_!==null&&C in _&&typeof _[C]=="string"}})(Pi);Object.defineProperty(Ni,"__esModule",{value:!0});Ni.standardErrors=void 0;const Ye=Bt,Nl=Pi;Ni.standardErrors={rpc:{parse:e=>ht(Ye.standardErrorCodes.rpc.parse,e),invalidRequest:e=>ht(Ye.standardErrorCodes.rpc.invalidRequest,e),invalidParams:e=>ht(Ye.standardErrorCodes.rpc.invalidParams,e),methodNotFound:e=>ht(Ye.standardErrorCodes.rpc.methodNotFound,e),internal:e=>ht(Ye.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 ht(t,e)},invalidInput:e=>ht(Ye.standardErrorCodes.rpc.invalidInput,e),resourceNotFound:e=>ht(Ye.standardErrorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>ht(Ye.standardErrorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>ht(Ye.standardErrorCodes.rpc.transactionRejected,e),methodNotSupported:e=>ht(Ye.standardErrorCodes.rpc.methodNotSupported,e),limitExceeded:e=>ht(Ye.standardErrorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>$r(Ye.standardErrorCodes.provider.userRejectedRequest,e),unauthorized:e=>$r(Ye.standardErrorCodes.provider.unauthorized,e),unsupportedMethod:e=>$r(Ye.standardErrorCodes.provider.unsupportedMethod,e),disconnected:e=>$r(Ye.standardErrorCodes.provider.disconnected,e),chainDisconnected:e=>$r(Ye.standardErrorCodes.provider.chainDisconnected,e),unsupportedChain:e=>$r(Ye.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 $l(t,r,n)}}};function ht(e,t){const[r,n]=Pl(t);return new Ll(e,r||(0,Nl.getMessageFromCode)(e),n)}function $r(e,t){const[r,n]=Pl(t);return new $l(e,r||(0,Nl.getMessageFromCode)(e),n)}function Pl(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 Ll=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)}},$l=class extends Ll{constructor(t,r,n){if(!Nf(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};function Nf(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}var Li={},nn={};Object.defineProperty(nn,"__esModule",{value:!0});nn.isErrorResponse=void 0;function Pf(e){return e.errorMessage!==void 0}nn.isErrorResponse=Pf;var sn={};Object.defineProperty(sn,"__esModule",{value:!0});sn.LIB_VERSION=void 0;sn.LIB_VERSION="3.9.3";Object.defineProperty(Li,"__esModule",{value:!0});Li.serializeError=void 0;const Lf=nn,$f=sn,Of=Bt,Bf=Pi;function Df(e,t){const r=(0,Bf.serialize)(Ff(e),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",$f.LIB_VERSION),n.searchParams.set("code",r.code.toString());const i=jf(r.data,t);return i&&n.searchParams.set("method",i),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}Li.serializeError=Df;function Ff(e){return typeof e=="string"?{message:e,code:Of.standardErrorCodes.rpc.internal}:(0,Lf.isErrorResponse)(e)?Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method}}):e}function jf(e,t){const r=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=Bt;Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return t.standardErrorCodes}});const r=Ni;Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=Li;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const i=Pi;Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return i.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return i.getMessageFromCode}})})(Cn);var Ge={};Object.defineProperty(Ge,"__esModule",{value:!0});Ge.ProviderType=Ge.RegExpString=Ge.IntNumber=Ge.BigIntString=Ge.AddressString=Ge.HexString=Ge.OpaqueType=void 0;function An(){return e=>e}Ge.OpaqueType=An;Ge.HexString=An();Ge.AddressString=An();Ge.BigIntString=An();function Uf(e){return Math.floor(e)}Ge.IntNumber=Uf;Ge.RegExpString=An();var $a;(function(e){e.CoinbaseWallet="CoinbaseWallet",e.MetaMask="MetaMask",e.Unselected=""})($a||(Ge.ProviderType=$a={}));var Hf=z&&z.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(q,"__esModule",{value:!0});q.isMobileWeb=q.getLocation=q.isInIFrame=q.createQrUrl=q.getFavicon=q.range=q.isBigNumber=q.ensureParsedJSONObject=q.ensureBN=q.ensureRegExpString=q.ensureIntNumber=q.ensureBuffer=q.ensureAddressString=q.ensureEvenLengthHexString=q.ensureHexString=q.isHexString=q.prepend0x=q.strip0x=q.has0xPrefix=q.hexStringFromIntNumber=q.intNumberFromHexString=q.bigIntStringFromBN=q.hexStringFromBuffer=q.hexStringToUint8Array=q.uint8ArrayToHex=q.randomBytesHex=void 0;const Wt=Hf(Ti),yr=Cn,gt=Ge,Ol=/^[0-9]*$/,Bl=/^[a-f0-9]*$/;function Wf(e){return Dl(crypto.getRandomValues(new Uint8Array(e)))}q.randomBytesHex=Wf;function Dl(e){return[...e].map(t=>t.toString(16).padStart(2,"0")).join("")}q.uint8ArrayToHex=Dl;function Vf(e){return new Uint8Array(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}q.hexStringToUint8Array=Vf;function qf(e,t=!1){const r=e.toString("hex");return(0,gt.HexString)(t?`0x${r}`:r)}q.hexStringFromBuffer=qf;function zf(e){return(0,gt.BigIntString)(e.toString(10))}q.bigIntStringFromBN=zf;function Gf(e){return(0,gt.IntNumber)(new Wt.default(Tn(e,!1),16).toNumber())}q.intNumberFromHexString=Gf;function Jf(e){return(0,gt.HexString)(`0x${new Wt.default(e).toString(16)}`)}q.hexStringFromIntNumber=Jf;function Po(e){return e.startsWith("0x")||e.startsWith("0X")}q.has0xPrefix=Po;function $i(e){return Po(e)?e.slice(2):e}q.strip0x=$i;function Fl(e){return Po(e)?`0x${e.slice(2)}`:`0x${e}`}q.prepend0x=Fl;function xn(e){if(typeof e!="string")return!1;const t=$i(e).toLowerCase();return Bl.test(t)}q.isHexString=xn;function jl(e,t=!1){if(typeof e=="string"){const r=$i(e).toLowerCase();if(Bl.test(r))return(0,gt.HexString)(t?`0x${r}`:r)}throw yr.standardErrors.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}q.ensureHexString=jl;function Tn(e,t=!1){let r=jl(e,!1);return r.length%2===1&&(r=(0,gt.HexString)(`0${r}`)),t?(0,gt.HexString)(`0x${r}`):r}q.ensureEvenLengthHexString=Tn;function Zf(e){if(typeof e=="string"){const t=$i(e).toLowerCase();if(xn(t)&&t.length===40)return(0,gt.AddressString)(Fl(t))}throw yr.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)}q.ensureAddressString=Zf;function Kf(e){if(re.isBuffer(e))return e;if(typeof e=="string"){if(xn(e)){const t=Tn(e,!1);return re.from(t,"hex")}return re.from(e,"utf8")}throw yr.standardErrors.rpc.invalidParams(`Not binary data: ${String(e)}`)}q.ensureBuffer=Kf;function Ul(e){if(typeof e=="number"&&Number.isInteger(e))return(0,gt.IntNumber)(e);if(typeof e=="string"){if(Ol.test(e))return(0,gt.IntNumber)(Number(e));if(xn(e))return(0,gt.IntNumber)(new Wt.default(Tn(e,!1),16).toNumber())}throw yr.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}q.ensureIntNumber=Ul;function Qf(e){if(e instanceof RegExp)return(0,gt.RegExpString)(e.toString());throw yr.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(e)}`)}q.ensureRegExpString=Qf;function Yf(e){if(e!==null&&(Wt.default.isBN(e)||Hl(e)))return new Wt.default(e.toString(10),10);if(typeof e=="number")return new Wt.default(Ul(e));if(typeof e=="string"){if(Ol.test(e))return new Wt.default(e,10);if(xn(e))return new Wt.default(Tn(e,!1),16)}throw yr.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}q.ensureBN=Yf;function Xf(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw yr.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(e)}`)}q.ensureParsedJSONObject=Xf;function Hl(e){if(e==null||typeof e.constructor!="function")return!1;const{constructor:t}=e;return typeof t.config=="function"&&typeof t.EUCLID=="number"}q.isBigNumber=Hl;function e0(e,t){return Array.from({length:t-e},(r,n)=>e+n)}q.range=e0;function t0(){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}`}q.getFavicon=t0;function r0(e,t,r,n,i,s){const a=n?"parent-id":"id",l=new URLSearchParams({[a]:e,secret:t,server:r,v:i,chainId:s.toString()}).toString();return`${r}/#/link?${l}`}q.createQrUrl=r0;function Wl(){try{return window.frameElement!==null}catch{return!1}}q.isInIFrame=Wl;function n0(){try{return Wl()&&window.top?window.top.location:window.location}catch{return window.location}}q.getLocation=n0;function i0(){var e;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((e=window?.navigator)===null||e===void 0?void 0:e.userAgent)}q.isMobileWeb=i0;var Oi={};Object.defineProperty(Oi,"__esModule",{value:!0});Oi.ScopedLocalStorage=void 0;class s0{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;n<localStorage.length;n++){const i=localStorage.key(n);typeof i=="string"&&i.startsWith(t)&&r.push(i)}r.forEach(n=>localStorage.removeItem(n))}scopedKey(t){return`${this.scope}:${t}`}}Oi.ScopedLocalStorage=s0;var Kr={};const o0=vr(Ih);var Nn={},Pn={},on={};Object.defineProperty(on,"__esModule",{value:!0});on.EVENTS=void 0;on.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 pt={};Object.defineProperty(pt,"__esModule",{value:!0});pt.RelayAbstract=pt.APP_VERSION_KEY=pt.LOCAL_STORAGE_ADDRESSES_KEY=pt.WALLET_USER_NAME_KEY=void 0;const Oa=Cn;pt.WALLET_USER_NAME_KEY="walletUsername";pt.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";pt.APP_VERSION_KEY="AppVersion";class a0{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 Oa.standardErrors.rpc.parse({});const i=n,{error:s}=i;if(s)throw(0,Oa.serializeError)(s,t.method);return i})}}pt.RelayAbstract=a0;var an={},Vl={exports:{}},_o={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(e,t){var r=In,n=r.Buffer;function i(a,l){for(var h in a)l[h]=a[h]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=s);function s(a,l,h){return n(a,l,h)}s.prototype=Object.create(n.prototype),i(n,s),s.from=function(a,l,h){if(typeof a=="number")throw new TypeError("Argument must not be a number");return n(a,l,h)},s.alloc=function(a,l,h){if(typeof a!="number")throw new TypeError("Argument must be a number");var d=n(a);return l!==void 0?typeof h=="string"?d.fill(l,h):d.fill(l):d.fill(0),d},s.allocUnsafe=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return n(a)},s.allocUnsafeSlow=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(a)}})(_o,_o.exports);var Ft=_o.exports,Fs,Ba;function c0(){if(Ba)return Fs;Ba=1;var e=xf;return Fs=function(r){return!!e(r)},Fs}var l0=En,u0=Il,h0=u0("TypedArray.prototype.buffer",!0),d0=c0(),f0=h0||function(t){if(!d0(t))throw new l0("Not a Typed Array");return t.buffer},wt=Ft.Buffer,p0=rf,g0=f0,m0=ArrayBuffer.isView||function(t){try{return g0(t),!0}catch{return!1}},v0=typeof Uint8Array<"u",ql=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",y0=ql&&(wt.prototype instanceof Uint8Array||wt.TYPED_ARRAY_SUPPORT),b0=function(t,r){if(wt.isBuffer(t))return t.constructor&&!("isBuffer"in t)?wt.from(t):t;if(typeof t=="string")return wt.from(t,r);if(ql&&m0(t)){if(t.byteLength===0)return wt.alloc(0);if(y0){var n=wt.from(t.buffer,t.byteOffset,t.byteLength);if(n.byteLength===t.byteLength)return n}var i=t instanceof Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),s=wt.from(i);if(s.length===t.byteLength)return s}if(v0&&t instanceof Uint8Array)return wt.from(t);var a=p0(t);if(a)for(var l=0;l<t.length;l+=1){var h=t[l];if(typeof h!="number"||h<0||h>255||~~h!==h)throw new RangeError("Array items must be numbers in the range 0-255.")}if(a||wt.isBuffer(t)&&t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t))return wt.from(t);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')},w0=Ft.Buffer,_0=b0;function Bi(e,t){this._block=w0.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}Bi.prototype.update=function(e,t){e=_0(e,t||"utf8");for(var r=this._block,n=this._blockSize,i=e.length,s=this._len,a=0;a<i;){for(var l=s%n,h=Math.min(i-a,n-l),d=0;d<h;d++)r[l+d]=e[a+d];s+=h,a+=h,s%n===0&&this._update(r)}return this._len+=i,this};Bi.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=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};Bi.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var cn=Bi,E0=_t,zl=cn,S0=Ft.Buffer,R0=[1518500249,1859775393,-1894007588,-899497514],M0=new Array(80);function Ln(){this.init(),this._w=M0,zl.call(this,64,56)}E0(Ln,zl);Ln.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function k0(e){return e<<5|e>>>27}function I0(e){return e<<30|e>>>2}function C0(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}Ln.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,a=this._e|0,l=0;l<16;++l)t[l]=e.readInt32BE(l*4);for(;l<80;++l)t[l]=t[l-3]^t[l-8]^t[l-14]^t[l-16];for(var h=0;h<80;++h){var d=~~(h/20),f=k0(r)+C0(d,n,i,s)+a+t[h]+R0[d]|0;a=s,s=i,i=I0(n),n=r,r=f}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=a+this._e|0};Ln.prototype._hash=function(){var e=S0.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 A0=Ln,x0=_t,Gl=cn,T0=Ft.Buffer,N0=[1518500249,1859775393,-1894007588,-899497514],P0=new Array(80);function $n(){this.init(),this._w=P0,Gl.call(this,64,56)}x0($n,Gl);$n.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function L0(e){return e<<1|e>>>31}function $0(e){return e<<5|e>>>27}function O0(e){return e<<30|e>>>2}function B0(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}$n.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,a=this._e|0,l=0;l<16;++l)t[l]=e.readInt32BE(l*4);for(;l<80;++l)t[l]=L0(t[l-3]^t[l-8]^t[l-14]^t[l-16]);for(var h=0;h<80;++h){var d=~~(h/20),f=$0(r)+B0(d,n,i,s)+a+t[h]+N0[d]|0;a=s,s=i,i=O0(n),n=r,r=f}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=a+this._e|0};$n.prototype._hash=function(){var e=T0.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 D0=$n,F0=_t,Jl=cn,j0=Ft.Buffer,U0=[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],H0=new Array(64);function On(){this.init(),this._w=H0,Jl.call(this,64,56)}F0(On,Jl);On.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 W0(e,t,r){return r^e&(t^r)}function V0(e,t,r){return e&t|r&(e|t)}function q0(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function z0(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function G0(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function J0(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}On.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,a=this._e|0,l=this._f|0,h=this._g|0,d=this._h|0,f=0;f<16;++f)t[f]=e.readInt32BE(f*4);for(;f<64;++f)t[f]=J0(t[f-2])+t[f-7]+G0(t[f-15])+t[f-16]|0;for(var R=0;R<64;++R){var _=d+z0(a)+W0(a,l,h)+U0[R]+t[R]|0,C=q0(r)+V0(r,n,i)|0;d=h,h=l,l=a,a=s+_|0,s=i,i=n,n=r,r=_+C|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=a+this._e|0,this._f=l+this._f|0,this._g=h+this._g|0,this._h=d+this._h|0};On.prototype._hash=function(){var e=j0.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 Zl=On,Z0=_t,K0=Zl,Q0=cn,Y0=Ft.Buffer,X0=new Array(64);function Di(){this.init(),this._w=X0,Q0.call(this,64,56)}Z0(Di,K0);Di.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};Di.prototype._hash=function(){var e=Y0.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 ep=Di,tp=_t,Kl=cn,rp=Ft.Buffer,Da=[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],np=new Array(160);function Bn(){this.init(),this._w=np,Kl.call(this,128,112)}tp(Bn,Kl);Bn.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 Fa(e,t,r){return r^e&(t^r)}function ja(e,t,r){return e&t|r&(e|t)}function Ua(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function Ha(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function ip(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function sp(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function op(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function ap(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function Ze(e,t){return e>>>0<t>>>0?1:0}Bn.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,a=this._eh|0,l=this._fh|0,h=this._gh|0,d=this._hh|0,f=this._al|0,R=this._bl|0,_=this._cl|0,C=this._dl|0,L=this._el|0,N=this._fl|0,$=this._gl|0,M=this._hl|0,x=0;x<32;x+=2)t[x]=e.readInt32BE(x*4),t[x+1]=e.readInt32BE(x*4+4);for(;x<160;x+=2){var T=t[x-30],B=t[x-15*2+1],P=ip(T,B),F=sp(B,T);T=t[x-2*2],B=t[x-2*2+1];var J=op(T,B),G=ap(B,T),V=t[x-7*2],ie=t[x-7*2+1],Q=t[x-16*2],oe=t[x-16*2+1],S=F+ie|0,o=P+V+Ze(S,F)|0;S=S+G|0,o=o+J+Ze(S,G)|0,S=S+oe|0,o=o+Q+Ze(S,oe)|0,t[x]=o,t[x+1]=S}for(var u=0;u<160;u+=2){o=t[u],S=t[u+1];var p=ja(r,n,i),g=ja(f,R,_),v=Ua(r,f),E=Ua(f,r),I=Ha(a,L),m=Ha(L,a),c=Da[u],y=Da[u+1],W=Fa(a,l,h),U=Fa(L,N,$),k=M+m|0,A=d+I+Ze(k,M)|0;k=k+U|0,A=A+W+Ze(k,U)|0,k=k+y|0,A=A+c+Ze(k,y)|0,k=k+S|0,A=A+o+Ze(k,S)|0;var O=E+g|0,H=v+p+Ze(O,E)|0;d=h,M=$,h=l,$=N,l=a,N=L,L=C+k|0,a=s+A+Ze(L,C)|0,s=i,C=_,i=n,_=R,n=r,R=f,f=k+O|0,r=A+H+Ze(f,k)|0}this._al=this._al+f|0,this._bl=this._bl+R|0,this._cl=this._cl+_|0,this._dl=this._dl+C|0,this._el=this._el+L|0,this._fl=this._fl+N|0,this._gl=this._gl+$|0,this._hl=this._hl+M|0,this._ah=this._ah+r+Ze(this._al,f)|0,this._bh=this._bh+n+Ze(this._bl,R)|0,this._ch=this._ch+i+Ze(this._cl,_)|0,this._dh=this._dh+s+Ze(this._dl,C)|0,this._eh=this._eh+a+Ze(this._el,L)|0,this._fh=this._fh+l+Ze(this._fl,N)|0,this._gh=this._gh+h+Ze(this._gl,$)|0,this._hh=this._hh+d+Ze(this._hl,M)|0};Bn.prototype._hash=function(){var e=rp.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 Ql=Bn,cp=_t,lp=Ql,up=cn,hp=Ft.Buffer,dp=new Array(160);function Fi(){this.init(),this._w=dp,up.call(this,128,112)}cp(Fi,lp);Fi.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};Fi.prototype._hash=function(){var e=hp.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 fp=Fi;(function(e){e.exports=function(r){var n=r.toLowerCase(),i=e.exports[n];if(!i)throw new Error(n+" is not supported (we accept pull requests)");return new i},e.exports.sha=A0,e.exports.sha1=D0,e.exports.sha224=ep,e.exports.sha256=Zl,e.exports.sha384=fp,e.exports.sha512=Ql})(Vl);var pp=Vl.exports;Object.defineProperty(an,"__esModule",{value:!0});an.Session=void 0;const Wa=pp,Va=q,qa="session:id",za="session:secret",Ga="session:linked";class Lo{constructor(t,r,n,i){this._storage=t,this._id=r||(0,Va.randomBytesHex)(16),this._secret=n||(0,Va.randomBytesHex)(32),this._key=new Wa.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(t){const r=t.getItem(qa),n=t.getItem(Ga),i=t.getItem(za);return r&&i?new Lo(t,r,i,n==="1"):null}static hash(t){return new Wa.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(qa,this._id),this._storage.setItem(za,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(Ga,this._linked?"1":"0")}}an.Session=Lo;var ji={},Ui={};Object.defineProperty(Ui,"__esModule",{value:!0});Ui.Cipher=void 0;const ei=q;class gp{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,ei.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=new TextEncoder,a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},i,s.encode(t)),l=16,h=a.slice(a.byteLength-l),d=a.slice(0,a.byteLength-l),f=new Uint8Array(h),R=new Uint8Array(d),_=new Uint8Array([...n,...f,...R]);return(0,ei.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,ei.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),a=(0,ei.hexStringToUint8Array)(t),l=a.slice(0,12),h=a.slice(12,28),d=a.slice(28),f=new Uint8Array([...d,...h]),R={name:"AES-GCM",iv:new Uint8Array(l)};try{const _=await window.crypto.subtle.decrypt(R,s,f),C=new TextDecoder;n(C.decode(_))}catch(_){i(_)}})()})}}Ui.Cipher=gp;var Hi={};Object.defineProperty(Hi,"__esModule",{value:!0});Hi.WalletLinkHTTP=void 0;class mp{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?.filter(a=>a.event==="Web3Response").map(a=>({type:"Event",sessionId:this.sessionId,eventId:a.id,event:a.event,data:a.data})))!==null&&t!==void 0?t:[];return this.markUnseenEventsAsSeen(s),s}throw new Error(`Check unseen events failed: ${r.status}`)}}Hi.WalletLinkHTTP=mp;var Qr={};Object.defineProperty(Qr,"__esModule",{value:!0});Qr.WalletLinkWebSocket=Qr.ConnectionState=void 0;var Wr;(function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"})(Wr||(Qr.ConnectionState=Wr={}));class vp{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,Wr.CONNECTING),i.onclose=s=>{var a;this.clearWebSocket(),r(new Error(`websocket error ${s.code}: ${s.reason}`)),(a=this.connectionStateListener)===null||a===void 0||a.call(this,Wr.DISCONNECTED)},i.onopen=s=>{var a;t(),(a=this.connectionStateListener)===null||a===void 0||a.call(this,Wr.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(h=>this.sendData(h)),this.pendingData=[])},i.onmessage=s=>{var a,l;if(s.data==="h")(a=this.incomingDataListener)===null||a===void 0||a.call(this,{type:"Heartbeat"});else try{const h=JSON.parse(s.data);(l=this.incomingDataListener)===null||l===void 0||l.call(this,h)}catch{}}})}disconnect(){var t;const{webSocket:r}=this;if(r){this.clearWebSocket(),(t=this.connectionStateListener)===null||t===void 0||t.call(this,Wr.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)}}Qr.WalletLinkWebSocket=vp;Object.defineProperty(ji,"__esModule",{value:!0});ji.WalletLinkConnection=void 0;const Or=Ge,yp=Ui,Mt=on,Ja=pt,Br=an,bp=Hi,ti=Qr,Za=1e4,wp=6e4;class _p{constructor({session:t,linkAPIUrl:r,listener:n,diagnostic:i,WebSocketClass:s=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,Or.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=l=>{if(!l)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",d=>l.JsonRpcUrl&&this.handleChainUpdated(d,l.JsonRpcUrl)]]).forEach((d,f)=>{const R=l[f];R!==void 0&&d(R)})},this.handleDestroyed=l=>{var h,d;l==="1"&&((h=this.listener)===null||h===void 0||h.resetAndReload(),(d=this.diagnostic)===null||d===void 0||d.log(Mt.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:Br.Session.hash(this.session.id)}))},this.handleAccountUpdated=async l=>{var h,d;try{const f=await this.cipher.decrypt(l);(h=this.listener)===null||h===void 0||h.accountUpdated(f)}catch{(d=this.diagnostic)===null||d===void 0||d.log(Mt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(l,h)=>{var d,f;try{const R=await this.cipher.decrypt(h);(d=this.listener)===null||d===void 0||d.metadataUpdated(l,R)}catch{(f=this.diagnostic)===null||f===void 0||f.log(Mt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:l})}},this.handleWalletUsernameUpdated=async l=>{this.handleMetadataUpdated(Ja.WALLET_USER_NAME_KEY,l)},this.handleAppVersionUpdated=async l=>{this.handleMetadataUpdated(Ja.APP_VERSION_KEY,l)},this.handleChainUpdated=async(l,h)=>{var d,f;try{const R=await this.cipher.decrypt(l),_=await this.cipher.decrypt(h);(d=this.listener)===null||d===void 0||d.chainUpdated(R,_)}catch{(f=this.diagnostic)===null||f===void 0||f.log(Mt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=t,this.cipher=new yp.Cipher(t.secret),this.diagnostic=i,this.listener=n;const a=new ti.WalletLinkWebSocket(`${r}/rpc`,s);a.setConnectionStateListener(async l=>{var h;(h=this.diagnostic)===null||h===void 0||h.log(Mt.EVENTS.CONNECTED_STATE_CHANGE,{state:l,sessionIdHash:Br.Session.hash(t.id)});let d=!1;switch(l){case ti.ConnectionState.DISCONNECTED:if(!this.destroyed){const f=async()=>{await new Promise(R=>setTimeout(R,5e3)),this.destroyed||a.connect().catch(()=>{f()})};f()}break;case ti.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),d=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},Za),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case ti.ConnectionState.CONNECTING:break}this.connected!==d&&(this.connected=d)}),a.setIncomingDataListener(l=>{var h,d,f;switch(l.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const R=l.type==="IsLinkedOK"?l.linked:void 0;(h=this.diagnostic)===null||h===void 0||h.log(Mt.EVENTS.LINKED,{sessionIdHash:Br.Session.hash(t.id),linked:R,type:l.type,onlineGuests:l.onlineGuests}),this.linked=R||l.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(d=this.diagnostic)===null||d===void 0||d.log(Mt.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:Br.Session.hash(t.id),metadata_keys:l&&l.metadata?Object.keys(l.metadata):void 0}),this.handleSessionMetadataUpdated(l.metadata);break}case"Event":{this.handleIncomingEvent(l);break}}l.id!==void 0&&((f=this.requestResolutions.get(l.id))===null||f===void 0||f(l))}),this.ws=a,this.http=new bp.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(Mt.EVENTS.STARTED_CONNECTING,{sessionIdHash:Br.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(Mt.EVENTS.DISCONNECTED,{sessionIdHash:Br.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(Mt.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,Or.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,Or.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:t,data:i,callWebhook:n};return this.setOnceLinked(async()=>{const a=await this.makeRequest(s);if(a.type==="Fail")throw new Error(a.error||"failed to publish event");return a.eventId})}sendData(t){this.ws.sendData(JSON.stringify(t))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>Za*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(t,r=wp){const n=t.id;this.sendData(t);let i;return Promise.race([new Promise((s,a)=>{i=window.setTimeout(()=>{a(new Error(`request ${n} timed out`))},r)}),new Promise(s=>{this.requestResolutions.set(n,a=>{clearTimeout(i),s(a),this.requestResolutions.delete(n)})})])}async authenticate(){const t={type:"HostSession",id:(0,Or.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,Or.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}sendGetSessionConfig(){const t={type:"GetSessionConfig",id:(0,Or.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}}ji.WalletLinkConnection=_p;var Dn={},Fn={},$o={};Object.defineProperty($o,"__esModule",{value:!0});$o.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 Ep=z&&z.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Fn,"__esModule",{value:!0});Fn.injectCssReset=void 0;const Sp=Ep($o);function Rp(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(Sp.default)),document.documentElement.appendChild(e)}Fn.injectCssReset=Rp;var Wi={};const st=vr(Ch);var Vi={};function Yl(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<e.length;t++)e[t]&&(r=Yl(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function Ka(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=Yl(e))&&(n&&(n+=" "),n+=t);return n}const Mp=Object.freeze(Object.defineProperty({__proto__:null,clsx:Ka,default:Ka},Symbol.toStringTag,{value:"Module"})),jn=vr(Mp),qi=vr(Ah);var Yr={},zi={};Object.defineProperty(zi,"__esModule",{value:!0});zi.CloseIcon=void 0;const Qa=st;function kp(e){return(0,Qa.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,Qa.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"}))}zi.CloseIcon=kp;var Gi={};Object.defineProperty(Gi,"__esModule",{value:!0});Gi.CoinbaseWalletRound=void 0;const ri=st;function Ip(e){return(0,ri.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,ri.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,ri.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,ri.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"}))}Gi.CoinbaseWalletRound=Ip;var Ji={};Object.defineProperty(Ji,"__esModule",{value:!0});Ji.QRCodeIcon=void 0;const fn=st;function Cp(e){return(0,fn.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),(0,fn.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,fn.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,fn.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,fn.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}Ji.QRCodeIcon=Cp;var Zi={};function Xl(e){this.mode=lt.MODE_8BIT_BYTE,this.data=e,this.parsedData=[];for(var t=0,r=this.data.length;t<r;t++){var n=[],i=this.data.charCodeAt(t);i>65536?(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))}Xl.prototype={getLength:function(e){return this.parsedData.length},write:function(e){for(var t=0,r=this.parsedData.length;t<r;t++)e.put(this.parsedData[t],8)}};function Tt(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}Tt.prototype={addData:function(e){var t=new Xl(e);this.dataList.push(t),this.dataCache=null},isDark:function(e,t){if(e<0||this.moduleCount<=e||t<0||this.moduleCount<=t)throw new Error(e+","+t);return this.modules[e][t]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(e,t){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++)this.modules[r][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(e,t),this.typeNumber>=7&&this.setupTypeNumber(e),this.dataCache==null&&(this.dataCache=Tt.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<this.modules.length;s++)for(var a=s*i,l=0;l<this.modules[s].length;l++){var h=l*i,d=this.modules[s][l];d&&(n.beginFill(0,100),n.moveTo(h,a),n.lineTo(h+i,a),n.lineTo(h+i,a+i),n.lineTo(h,a+i),n.endFill())}return n},setupTimingPattern:function(){for(var e=8;e<this.moduleCount-8;e++)this.modules[e][6]==null&&(this.modules[e][6]=e%2==0);for(var t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)},setupPositionAdjustPattern:function(){for(var e=We.getPatternPosition(this.typeNumber),t=0;t<e.length;t++)for(var r=0;r<e.length;r++){var n=e[t],i=e[r];if(this.modules[n][i]==null)for(var s=-2;s<=2;s++)for(var a=-2;a<=2;a++)s==-2||s==2||a==-2||a==2||s==0&&a==0?this.modules[n+s][i+a]=!0:this.modules[n+s][i+a]=!1}},setupTypeNumber:function(e){for(var t=We.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var n=!e&&(t>>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,a=this.moduleCount-1;a>0;a-=2)for(a==6&&a--;;){for(var l=0;l<2;l++)if(this.modules[n][a-l]==null){var h=!1;s<e.length&&(h=(e[s]>>>i&1)==1);var d=We.getMask(t,n,a-l);d&&(h=!h),this.modules[n][a-l]=h,i--,i==-1&&(s++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};Tt.PAD0=236;Tt.PAD1=17;Tt.createData=function(e,t,r){for(var n=xt.getRSBlocks(e,t),i=new eu,s=0;s<r.length;s++){var a=r[s];i.put(a.mode,4),i.put(a.getLength(),We.getLengthInBits(a.mode,e)),a.write(i)}for(var l=0,s=0;s<n.length;s++)l+=n[s].dataCount;if(i.getLengthInBits()>l*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+l*8+")");for(i.getLengthInBits()+4<=l*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=l*8||(i.put(Tt.PAD0,8),i.getLengthInBits()>=l*8));)i.put(Tt.PAD1,8);return Tt.createBytes(i,n)};Tt.createBytes=function(e,t){for(var r=0,n=0,i=0,s=new Array(t.length),a=new Array(t.length),l=0;l<t.length;l++){var h=t[l].dataCount,d=t[l].totalCount-h;n=Math.max(n,h),i=Math.max(i,d),s[l]=new Array(h);for(var f=0;f<s[l].length;f++)s[l][f]=255&e.buffer[f+r];r+=h;var R=We.getErrorCorrectPolynomial(d),_=new qr(s[l],R.getLength()-1),C=_.mod(R);a[l]=new Array(R.getLength()-1);for(var f=0;f<a[l].length;f++){var L=f+C.getLength()-a[l].length;a[l][f]=L>=0?C.get(L):0}}for(var N=0,f=0;f<t.length;f++)N+=t[f].totalCount;for(var $=new Array(N),M=0,f=0;f<n;f++)for(var l=0;l<t.length;l++)f<s[l].length&&($[M++]=s[l][f]);for(var f=0;f<i;f++)for(var l=0;l<t.length;l++)f<a[l].length&&($[M++]=a[l][f]);return $};var lt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Vt={L:1,M:0,Q:3,H:2},Ut={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},We={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(e){for(var t=e<<10;We.getBCHDigit(t)-We.getBCHDigit(We.G15)>=0;)t^=We.G15<<We.getBCHDigit(t)-We.getBCHDigit(We.G15);return(e<<10|t)^We.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;We.getBCHDigit(t)-We.getBCHDigit(We.G18)>=0;)t^=We.G18<<We.getBCHDigit(t)-We.getBCHDigit(We.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;e!=0;)t++,e>>>=1;return t},getPatternPosition:function(e){return We.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,r){switch(e){case Ut.PATTERN000:return(t+r)%2==0;case Ut.PATTERN001:return t%2==0;case Ut.PATTERN010:return r%3==0;case Ut.PATTERN011:return(t+r)%3==0;case Ut.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case Ut.PATTERN101:return t*r%2+t*r%3==0;case Ut.PATTERN110:return(t*r%2+t*r%3)%2==0;case Ut.PATTERN111:return(t*r%3+(t+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new qr([1],0),r=0;r<e;r++)t=t.multiply(new qr([1,Qe.gexp(r)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){case lt.MODE_NUMBER:return 10;case lt.MODE_ALPHA_NUM:return 9;case lt.MODE_8BIT_BYTE:return 8;case lt.MODE_KANJI:return 8;default:throw new Error("mode:"+e)}else if(t<27)switch(e){case lt.MODE_NUMBER:return 12;case lt.MODE_ALPHA_NUM:return 11;case lt.MODE_8BIT_BYTE:return 16;case lt.MODE_KANJI:return 10;default:throw new Error("mode:"+e)}else if(t<41)switch(e){case lt.MODE_NUMBER:return 14;case lt.MODE_ALPHA_NUM:return 13;case lt.MODE_8BIT_BYTE:return 16;case lt.MODE_KANJI:return 12;default:throw new Error("mode:"+e)}else throw new Error("type:"+t)},getLostPoint:function(e){for(var t=e.getModuleCount(),r=0,n=0;n<t;n++)for(var i=0;i<t;i++){for(var s=0,a=e.isDark(n,i),l=-1;l<=1;l++)if(!(n+l<0||t<=n+l))for(var h=-1;h<=1;h++)i+h<0||t<=i+h||l==0&&h==0||a==e.isDark(n+l,i+h)&&s++;s>5&&(r+=3+s-5)}for(var n=0;n<t-1;n++)for(var i=0;i<t-1;i++){var d=0;e.isDark(n,i)&&d++,e.isDark(n+1,i)&&d++,e.isDark(n,i+1)&&d++,e.isDark(n+1,i+1)&&d++,(d==0||d==4)&&(r+=3)}for(var n=0;n<t;n++)for(var i=0;i<t-6;i++)e.isDark(n,i)&&!e.isDark(n,i+1)&&e.isDark(n,i+2)&&e.isDark(n,i+3)&&e.isDark(n,i+4)&&!e.isDark(n,i+5)&&e.isDark(n,i+6)&&(r+=40);for(var i=0;i<t;i++)for(var n=0;n<t-6;n++)e.isDark(n,i)&&!e.isDark(n+1,i)&&e.isDark(n+2,i)&&e.isDark(n+3,i)&&e.isDark(n+4,i)&&!e.isDark(n+5,i)&&e.isDark(n+6,i)&&(r+=40);for(var f=0,i=0;i<t;i++)for(var n=0;n<t;n++)e.isDark(n,i)&&f++;var R=Math.abs(100*f/t/t-50)/5;return r+=R*10,r}},Qe={glog:function(e){if(e<1)throw new Error("glog("+e+")");return Qe.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return Qe.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var Xe=0;Xe<8;Xe++)Qe.EXP_TABLE[Xe]=1<<Xe;for(var Xe=8;Xe<256;Xe++)Qe.EXP_TABLE[Xe]=Qe.EXP_TABLE[Xe-4]^Qe.EXP_TABLE[Xe-5]^Qe.EXP_TABLE[Xe-6]^Qe.EXP_TABLE[Xe-8];for(var Xe=0;Xe<255;Xe++)Qe.LOG_TABLE[Qe.EXP_TABLE[Xe]]=Xe;function qr(e,t){if(e.length==null)throw new Error(e.length+"/"+t);for(var r=0;r<e.length&&e[r]==0;)r++;this.num=new Array(e.length-r+t);for(var n=0;n<e.length-r;n++)this.num[n]=e[n+r]}qr.prototype={get:function(e){return this.num[e]},getLength:function(){return this.num.length},multiply:function(e){for(var t=new Array(this.getLength()+e.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<e.getLength();n++)t[r+n]^=Qe.gexp(Qe.glog(this.get(r))+Qe.glog(e.get(n)));return new qr(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=Qe.glog(this.get(0))-Qe.glog(e.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(var n=0;n<e.getLength();n++)r[n]^=Qe.gexp(Qe.glog(e.get(n))+t);return new qr(r,0).mod(e)}};function xt(e,t){this.totalCount=e,this.dataCount=t}xt.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];xt.getRSBlocks=function(e,t){var r=xt.getRsBlockTable(e,t);if(r==null)throw new Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);for(var n=r.length/3,i=[],s=0;s<n;s++)for(var a=r[s*3+0],l=r[s*3+1],h=r[s*3+2],d=0;d<a;d++)i.push(new xt(l,h));return i};xt.getRsBlockTable=function(e,t){switch(t){case Vt.L:return xt.RS_BLOCK_TABLE[(e-1)*4+0];case Vt.M:return xt.RS_BLOCK_TABLE[(e-1)*4+1];case Vt.Q:return xt.RS_BLOCK_TABLE[(e-1)*4+2];case Vt.H:return xt.RS_BLOCK_TABLE[(e-1)*4+3];default:return}};function eu(){this.buffer=[],this.length=0}eu.prototype={get:function(e){var t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(var r=0;r<t;r++)this.putBit((e>>>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 js=[[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 tu(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(h){switch(h){case"L":return Vt.L;case"M":return Vt.M;case"Q":return Vt.Q;case"H":return Vt.H;default:throw new Error("Unknwon error correction level: "+h)}}function n(h,d){for(var f=i(h),R=1,_=0,C=0,L=js.length;C<=L;C++){var N=js[C];if(!N)throw new Error("Content too long: expected "+_+" but got "+f);switch(d){case"L":_=N[0];break;case"M":_=N[1];break;case"Q":_=N[2];break;case"H":_=N[3];break;default:throw new Error("Unknwon error correction level: "+d)}if(f<=_)break;R++}if(R>js.length)throw new Error("Content too long");return R}function i(h){var d=encodeURI(h).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return d.length+(d.length!=h?3:0)}var s=this.options.content,a=n(s,this.options.ecl),l=r(this.options.ecl);this.qrcode=new Tt(a,l),this.qrcode.addData(s),this.qrcode.make()}tu.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
|
|
2
|
-
`:"",a=t.width,l=t.height,h=r.length,d=a/(h+2*t.padding),f=l/(h+2*t.padding),R=typeof t.join<"u"?!!t.join:!1,_=typeof t.swap<"u"?!!t.swap:!1,C=typeof t.xmlDeclaration<"u"?!!t.xmlDeclaration:!0,L=typeof t.predefined<"u"?!!t.predefined:!1,N=L?i+'<defs><path id="qrmodule" d="M0 0 h'+f+" v"+d+' H0 z" style="fill:'+t.color+';shape-rendering:crispEdges;" /></defs>'+s:"",$=i+'<rect x="0" y="0" width="'+a+'" height="'+l+'" style="fill:'+t.background+';shape-rendering:crispEdges;"/>'+s,M="",x="",T=0;T<h;T++)for(var B=0;B<h;B++){var P=r[B][T];if(P){var F=B*d+t.padding*d,J=T*f+t.padding*f;if(_){var G=F;F=J,J=G}if(R){var V=d+F,ie=f+J;F=Number.isInteger(F)?Number(F):F.toFixed(2),J=Number.isInteger(J)?Number(J):J.toFixed(2),V=Number.isInteger(V)?Number(V):V.toFixed(2),ie=Number.isInteger(ie)?Number(ie):ie.toFixed(2),x+="M"+F+","+J+" V"+ie+" H"+V+" V"+J+" H"+F+" Z "}else L?M+=i+'<use x="'+F.toString()+'" y="'+J.toString()+'" href="#qrmodule" />'+s:M+=i+'<rect x="'+F.toString()+'" y="'+J.toString()+'" width="'+d+'" height="'+f+'" style="fill:'+t.color+';shape-rendering:crispEdges;"/>'+s}}R&&(M=i+'<path x="0" y="0" style="fill:'+t.color+';shape-rendering:crispEdges;" d="'+x+'" />');let Q="";if(this.options.image!==void 0&&this.options.image.svg){const S=a*this.options.image.width/100,o=l*this.options.image.height/100,u=a/2-S/2,p=l/2-o/2;Q+=`<svg x="${u}" y="${p}" width="${S}" height="${o}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,Q+=this.options.image.svg+s,Q+="</svg>"}var oe="";switch(e.container){case"svg":C&&(oe+='<?xml version="1.0" standalone="yes"?>'+s),oe+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+a+'" height="'+l+'">'+s,oe+=N+$+M,oe+=Q,oe+="</svg>";break;case"svg-viewbox":C&&(oe+='<?xml version="1.0" standalone="yes"?>'+s),oe+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+a+" "+l+'">'+s,oe+=N+$+M,oe+=Q,oe+="</svg>";break;case"g":oe+='<g width="'+a+'" height="'+l+'">'+s,oe+=N+$+M,oe+=Q,oe+="</g>";break;default:oe+=(N+$+M+Q).replace(/^\s+/,"");break}return oe};var Ap=tu,xp=z&&z.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Zi,"__esModule",{value:!0});Zi.QRCode=void 0;const Tp=st,Ya=qi,Np=xp(Ap),Pp=e=>{const[t,r]=(0,Ya.useState)("");return(0,Ya.useEffect)(()=>{var n,i;const s=new Np.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}),a=re.from(s.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${a}`)},[e.bgColor,e.content,e.fgColor,e.height,e.image,e.width]),t?(0,Tp.h)("img",{src:t,alt:"QR Code"}):null};Zi.QRCode=Pp;var Ki={},Oo={};Object.defineProperty(Oo,"__esModule",{value:!0});Oo.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 Lp=z&&z.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ki,"__esModule",{value:!0});Ki.Spinner=void 0;const ni=st,$p=Lp(Oo),Op=e=>{var t;const r=(t=e.size)!==null&&t!==void 0?t:64,n=e.color||"#000";return(0,ni.h)("div",{class:"-cbwsdk-spinner"},(0,ni.h)("style",null,$p.default),(0,ni.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,ni.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};Ki.Spinner=Op;var Bo={};Object.defineProperty(Bo,"__esModule",{value:!0});Bo.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 ru=z&&z.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Yr,"__esModule",{value:!0});Yr.CoinbaseWalletSteps=Yr.ConnectContent=void 0;const gr=ru(jn),ce=st,Bp=q,Dp=sn,Fp=zi,jp=Gi,Up=Ji,Hp=Zi,Wp=Ki,Vp=ru(Bo),Us={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:nu},qp=e=>e==="light"?"#FFFFFF":"#0A0B0D";function zp(e){const{theme:t}=e,r=(0,Bp.createQrUrl)(e.sessionId,e.sessionSecret,e.linkAPIUrl,e.isParentConnection,e.version,e.chainId),n=Us.steps;return(0,ce.h)("div",{"data-testid":"connect-content",className:(0,gr.default)("-cbwsdk-connect-content",t)},(0,ce.h)("style",null,Vp.default),(0,ce.h)("div",{className:"-cbwsdk-connect-content-header"},(0,ce.h)("h2",{className:(0,gr.default)("-cbwsdk-connect-content-heading",t)},"Scan to connect with our mobile app"),e.onCancel&&(0,ce.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:e.onCancel},(0,ce.h)(Fp.CloseIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,ce.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,ce.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,ce.h)(Gp,{title:Us.title,description:Us.description,theme:t})),(0,ce.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,ce.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,ce.h)(Hp.QRCode,{content:r,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,ce.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:Dp.LIB_VERSION}),(0,ce.h)("input",{type:"hidden",value:r})),(0,ce.h)(n,{theme:t}),!e.isConnected&&(0,ce.h)("div",{"data-testid":"connecting-spinner",className:(0,gr.default)("-cbwsdk-connect-content-qr-connecting",t)},(0,ce.h)(Wp.Spinner,{size:36,color:t==="dark"?"#FFF":"#000"}),(0,ce.h)("p",null,"Connecting...")))))}Yr.ConnectContent=zp;function Gp({title:e,description:t,theme:r}){return(0,ce.h)("div",{className:(0,gr.default)("-cbwsdk-connect-item",r)},(0,ce.h)("div",null,(0,ce.h)(jp.CoinbaseWalletRound,null)),(0,ce.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,ce.h)("h3",{className:"-cbwsdk-connect-item-title"},e),(0,ce.h)("p",{className:"-cbwsdk-connect-item-description"},t)))}function nu({theme:e}){return(0,ce.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,ce.h)("li",{className:(0,gr.default)("-cbwsdk-wallet-steps-item",e)},(0,ce.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,ce.h)("li",{className:(0,gr.default)("-cbwsdk-wallet-steps-item",e)},(0,ce.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,ce.h)("span",null,"Tap ",(0,ce.h)("strong",null,"Scan")," "),(0,ce.h)("span",{className:(0,gr.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,ce.h)(Up.QRCodeIcon,{fill:qp(e)})))))}Yr.CoinbaseWalletSteps=nu;var Qi={},Yi={};Object.defineProperty(Yi,"__esModule",{value:!0});Yi.ArrowLeftIcon=void 0;const Xa=st;function Jp(e){return(0,Xa.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},e),(0,Xa.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"}))}Yi.ArrowLeftIcon=Jp;var Xi={};Object.defineProperty(Xi,"__esModule",{value:!0});Xi.LaptopIcon=void 0;const Hs=st;function Zp(e){return(0,Hs.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,Hs.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,Hs.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"}))}Xi.LaptopIcon=Zp;var es={};Object.defineProperty(es,"__esModule",{value:!0});es.SafeIcon=void 0;const ec=st;function Kp(e){return(0,ec.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,ec.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"}))}es.SafeIcon=Kp;var Do={};Object.defineProperty(Do,"__esModule",{value:!0});Do.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 iu=z&&z.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qi,"__esModule",{value:!0});Qi.TryExtensionContent=void 0;const ar=iu(jn),ze=st,Ws=qi,Qp=Yi,Yp=Xi,Xp=es,e1=iu(Do);function t1({theme:e}){const[t,r]=(0,Ws.useState)(!1),n=(0,Ws.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,Ws.useCallback)(()=>{t?window.location.reload():(n(),r(!0))},[n,t]);return(0,ze.h)("div",{class:(0,ar.default)("-cbwsdk-try-extension",e)},(0,ze.h)("style",null,e1.default),(0,ze.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,ze.h)("h3",{class:(0,ar.default)("-cbwsdk-try-extension-heading",e)},"Or try the Coinbase Wallet browser extension"),(0,ze.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,ze.h)("button",{class:(0,ar.default)("-cbwsdk-try-extension-cta",e),onClick:i},t?"Refresh":"Install"),(0,ze.h)("div",null,!t&&(0,ze.h)(Qp.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:e==="light"?"#0052FF":"#588AF5"})))),(0,ze.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,ze.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,ze.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,ze.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,ze.h)("span",{class:(0,ar.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,ze.h)(Yp.LaptopIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,ze.h)("div",{class:(0,ar.default)("-cbwsdk-try-extension-list-item-copy",e)},"Connect with dapps with just one click on your desktop browser")),(0,ze.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,ze.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,ze.h)("span",{class:(0,ar.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,ze.h)(Xp.SafeIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,ze.h)("div",{class:(0,ar.default)("-cbwsdk-try-extension-list-item-copy",e)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}Qi.TryExtensionContent=t1;var Fo={};Object.defineProperty(Fo,"__esModule",{value:!0});Fo.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 su=z&&z.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Vi,"__esModule",{value:!0});Vi.ConnectDialog=void 0;const Vs=su(jn),cr=st,qs=qi,r1=Yr,n1=Qi,i1=su(Fo),s1=e=>{const{isOpen:t,darkMode:r}=e,[n,i]=(0,qs.useState)(!t),[s,a]=(0,qs.useState)(!t);(0,qs.useEffect)(()=>{const h=[window.setTimeout(()=>{a(!t)},10)];return t?i(!1):h.push(window.setTimeout(()=>{i(!0)},360)),()=>{h.forEach(window.clearTimeout)}},[t]);const l=r?"dark":"light";return(0,cr.h)("div",{class:(0,Vs.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,cr.h)("style",null,i1.default),(0,cr.h)("div",{class:(0,Vs.default)("-cbwsdk-connect-dialog-backdrop",l,s&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,cr.h)("div",{class:"-cbwsdk-connect-dialog"},(0,cr.h)("div",{class:(0,Vs.default)("-cbwsdk-connect-dialog-box",s&&"-cbwsdk-connect-dialog-box-hidden")},e.connectDisabled?null:(0,cr.h)(r1.ConnectContent,{theme:l,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,cr.h)(n1.TryExtensionContent,{theme:l}))))};Vi.ConnectDialog=s1;Object.defineProperty(Wi,"__esModule",{value:!0});Wi.LinkFlow=void 0;const zs=st,o1=Vi;class a1{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)(o1.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)}}Wi.LinkFlow=a1;var jo={},Uo={};Object.defineProperty(Uo,"__esModule",{value:!0});Uo.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=z&&z.__importDefault||function(R){return R&&R.__esModule?R:{default:R}};Object.defineProperty(e,"__esModule",{value:!0}),e.SnackbarInstance=e.SnackbarContainer=e.Snackbar=void 0;const r=t(jn),n=st,i=qi,s=t(Uo),a="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",l="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class h{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 C=this.nextItemKey++;return this.items.set(C,_),this.render(),()=>{this.items.delete(C),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(([_,C])=>(0,n.h)(e.SnackbarInstance,Object.assign({},C,{key:_}))))),this.root)}}e.Snackbar=h;const d=R=>(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"},R.children));e.SnackbarContainer=d;const f=({autoExpand:R,message:_,menuItems:C})=>{const[L,N]=(0,i.useState)(!0),[$,M]=(0,i.useState)(R??!1);(0,i.useEffect)(()=>{const T=[window.setTimeout(()=>{N(!1)},1),window.setTimeout(()=>{M(!0)},1e4)];return()=>{T.forEach(window.clearTimeout)}});const x=()=>{M(!$)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",L&&"-cbwsdk-snackbar-instance-hidden",$&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:x},(0,n.h)("img",{src:a,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},_),(0,n.h)("div",{class:"-gear-container"},!$&&(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:l,class:"-gear-icon",title:"Expand"}))),C&&C.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},C.map((T,B)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",T.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:T.onClick,key:B},(0,n.h)("svg",{width:T.svgWidth,height:T.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":T.defaultFillRule,"clip-rule":T.defaultClipRule,d:T.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",T.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},T.info)))))};e.SnackbarInstance=f})(jo);Object.defineProperty(Dn,"__esModule",{value:!0});Dn.WalletLinkRelayUI=void 0;const c1=Fn,l1=Wi,u1=jo;class h1{constructor(t){this.standalone=null,this.attached=!1,this.snackbar=new u1.Snackbar({darkMode:t.darkMode}),this.linkFlow=new l1.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,c1.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}}Dn.WalletLinkRelayUI=h1;Object.defineProperty(Pn,"__esModule",{value:!0});Pn.WalletLinkRelay=void 0;const Dr=Cn,d1=Ge,He=q,lr=on,tc=pt,Ht=an,f1=ji,ur=nn,p1=Dn;class Ot extends tc.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=a=>{var l;this.isLinked=a;const h=this.storage.getItem(tc.LOCAL_STORAGE_ADDRESSES_KEY);if(a&&(this.session.linked=a),this.isUnlinkedErrorState=!1,h){const d=h.split(" "),f=this.storage.getItem("IsStandaloneSigning")==="true";if(d[0]!==""&&!a&&this.session.linked&&!f){this.isUnlinkedErrorState=!0;const R=this.getSessionIdHash();(l=this.diagnostic)===null||l===void 0||l.log(lr.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:R})}}},this.metadataUpdated=(a,l)=>{this.storage.setItem(a,l)},this.chainUpdated=(a,l)=>{this.chainCallbackParams.chainId===a&&this.chainCallbackParams.jsonRpcUrl===l||(this.chainCallbackParams={chainId:a,jsonRpcUrl:l},this.chainCallback&&this.chainCallback(a,l))},this.accountUpdated=a=>{this.accountsCallback&&this.accountsCallback([a]),Ot.accountRequestCallbackIds.size>0&&(Array.from(Ot.accountRequestCallbackIds.values()).forEach(l=>{const h={type:"WEB3_RESPONSE",id:l,response:{method:"requestEthereumAccounts",result:[a]}};this.invokeCallback(Object.assign(Object.assign({},h),{id:l}))}),Ot.accountRequestCallbackIds.clear())},this.connectedUpdated=a=>{this.ui.setConnected(a)},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=Ht.Session.load(this.storage)||new Ht.Session(this.storage).save(),{linkAPIUrl:r,diagnostic:n}=this,i=new f1.WalletLinkConnection({session:t,linkAPIUrl:r,diagnostic:n,listener:this}),{version:s,darkMode:a}=this.options,l=this.options.uiConstructor({linkAPIUrl:r,version:s,darkMode:a,session:t});return i.connect(),{session:t,ui:l,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(lr.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const i=Ht.Session.load(this.storage);if(i?.id===this._session.id?this.storage.clear():i&&((r=this.diagnostic)===null||r===void 0||r.log(lr.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:Ht.Session.hash(i.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);const{session:s,ui:a,connection:l}=this.subscribe();this._session=s,this.connection=l,this.ui=a,n&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.options.headlessMode||this.attachUI()}).catch(t=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(lr.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,He.hexStringFromBuffer)(t,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(t,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,He.hexStringFromBuffer)(t,!0),signature:(0,He.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,He.bigIntStringFromBN)(t.weiValue),data:(0,He.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,He.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.gasPriceInWei?(0,He.bigIntStringFromBN)(t.gasPriceInWei):null,maxPriorityFeePerGas:t.gasPriceInWei?(0,He.bigIntStringFromBN)(t.gasPriceInWei):null,gasLimit:t.gasLimit?(0,He.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,He.bigIntStringFromBN)(t.weiValue),data:(0,He.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,He.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.maxFeePerGas?(0,He.bigIntStringFromBN)(t.maxFeePerGas):null,maxPriorityFeePerGas:t.maxPriorityFeePerGas?(0,He.bigIntStringFromBN)(t.maxPriorityFeePerGas):null,gasLimit:t.gasLimit?(0,He.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!0}})}submitEthereumTransaction(t,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,He.hexStringFromBuffer)(t,!0),chainId:r}})}scanQRCode(t){return this.sendRequest({method:"scanQRCode",params:{regExp:t}})}getQRCodeUrl(){return(0,He.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,He.randomBytesHex)(8),i=a=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,t.method,a),r?.()};return{promise:new Promise((a,l)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,h=>{if(r?.(),(0,ur.isErrorResponse)(h))return l(new Error(h.errorMessage));a(h)}),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 p1.WalletLinkRelayUI&&this.ui.setChainId(t)}publishWeb3RequestEvent(t,r){var n;const i={type:"WEB3_REQUEST",id:t,request:r},s=Ht.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(lr.EVENTS.WEB3_REQUEST,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Ht.Session.hash(s.id):"",isSessionMismatched:(s?.id!==this._session.id).toString()}),this.publishEvent("Web3Request",i,!0).then(a=>{var l;(l=this.diagnostic)===null||l===void 0||l.log(lr.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Ht.Session.hash(s.id):"",isSessionMismatched:(s?.id!==this._session.id).toString()})}).catch(a=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i.id,response:{method:r.method,errorMessage:a.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(lr.EVENTS.WEB3_RESPONSE,{eventId:t.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),n.method==="requestEthereumAccounts"){Ot.accountRequestCallbackIds.forEach(i=>this.invokeCallback(Object.assign(Object.assign({},t),{id:i}))),Ot.accountRequestCallbackIds.clear();return}this.invokeCallback(t)}handleErrorResponse(t,r,n,i){var s;const a=(s=n?.message)!==null&&s!==void 0?s:(0,Dr.getMessageFromCode)(i);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:{method:r,errorMessage:a,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,He.randomBytesHex)(8),n=s=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,t.method,s)};return{promise:new Promise((s,a)=>{if(this.relayEventManager.callbacks.set(r,l=>{if(this.ui.hideRequestEthereumAccounts(),(0,ur.isErrorResponse)(l))return a(new Error(l.errorMessage));s(l)}),this.ui.inlineAccountsResponse()){const l=h=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:r,response:{method:"requestEthereumAccounts",result:h}})};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:l})}else{const l=Dr.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(l)})}Ot.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,He.randomBytesHex)(8),i=a=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,a)},s=new Promise((a,l)=>{this.relayEventManager.callbacks.set(n,f=>{if((0,ur.isErrorResponse)(f))return l(new Error(f.errorMessage));a(f)});const h=f=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:d1.ProviderType.Unselected}})},d=f=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:f}})};this.ui.selectProvider&&this.ui.selectProvider({onApprove:d,onCancel:h,providerOptions:t})});return{cancel:i,promise:s}}watchAsset(t,r,n,i,s,a){const l={method:"watchAsset",params:{type:t,options:{address:r,symbol:n,decimals:i,image:s},chainId:a}};let h=null;const d=(0,He.randomBytesHex)(8),f=_=>{this.publishWeb3RequestCanceledEvent(d),this.handleErrorResponse(d,l.method,_),h?.()};this.ui.inlineWatchAsset()||(h=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:f,onResetConnection:this.resetAndReload}));const R=new Promise((_,C)=>{this.relayEventManager.callbacks.set(d,$=>{if(h?.(),(0,ur.isErrorResponse)($))return C(new Error($.errorMessage));_($)});const L=$=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:d,response:{method:"watchAsset",result:!1}})},N=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:d,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:N,onCancel:L,type:t,address:r,symbol:n,decimals:i,image:s,chainId:a}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(d,l)});return{cancel:f,promise:R}}addEthereumChain(t,r,n,i,s,a){const l={method:"addEthereumChain",params:{chainId:t,rpcUrls:r,blockExplorerUrls:i,chainName:s,iconUrls:n,nativeCurrency:a}};let h=null;const d=(0,He.randomBytesHex)(8),f=_=>{this.publishWeb3RequestCanceledEvent(d),this.handleErrorResponse(d,l.method,_),h?.()};return this.ui.inlineAddEthereumChain(t)||(h=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:f,onResetConnection:this.resetAndReload})),{promise:new Promise((_,C)=>{this.relayEventManager.callbacks.set(d,$=>{if(h?.(),(0,ur.isErrorResponse)($))return C(new Error($.errorMessage));_($)});const L=$=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:d,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},N=$=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:d,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:$}}})};this.ui.inlineAddEthereumChain(t)&&this.ui.addEthereumChain({onCancel:L,onApprove:N,chainId:l.params.chainId,rpcUrls:l.params.rpcUrls,blockExplorerUrls:l.params.blockExplorerUrls,chainName:l.params.chainName,iconUrls:l.params.iconUrls,nativeCurrency:l.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(t)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(d,l)}),cancel:f}}switchEthereumChain(t,r){const n={method:"switchEthereumChain",params:Object.assign({chainId:t},{address:r})},i=(0,He.randomBytesHex)(8),s=l=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,n.method,l)};return{promise:new Promise((l,h)=>{this.relayEventManager.callbacks.set(i,R=>{if((0,ur.isErrorResponse)(R)&&R.errorCode)return h(Dr.standardErrors.provider.custom({code:R.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,ur.isErrorResponse)(R))return h(new Error(R.errorMessage));l(R)});const d=R=>{var _;if(R){const C=(_=(0,Dr.getErrorCode)(R))!==null&&_!==void 0?_:Dr.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(i,"switchEthereumChain",R instanceof Error?R:Dr.standardErrors.provider.unsupportedChain(t),C)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},f=R=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:R}}})};this.ui.switchEthereumChain({onCancel:d,onApprove:f,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 Ht.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}}}Pn.WalletLinkRelay=Ot;Ot.accountRequestCallbackIds=new Set;var Un={},ts={},ou={};(function(e){var t=z&&z.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var l=Object.getOwnPropertyDescriptor(i,s);(!l||("get"in l?!i.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,l)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=z&&z.__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(jo,e)})(ou);var Ho={};Object.defineProperty(Ho,"__esModule",{value:!0});Ho.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 au=z&&z.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ts,"__esModule",{value:!0});ts.RedirectDialog=void 0;const g1=au(jn),At=st,m1=Fn,v1=ou,y1=au(Ho);class b1{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,m1.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)(w1,Object.assign({},t,{onDismiss:()=>{this.clear()}})),this.root))}}ts.RedirectDialog=b1;const w1=({title:e,buttonText:t,darkMode:r,onButtonClick:n,onDismiss:i})=>{const s=r?"dark":"light";return(0,At.h)(v1.SnackbarContainer,{darkMode:r},(0,At.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,At.h)("style",null,y1.default),(0,At.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:i}),(0,At.h)("div",{class:(0,g1.default)("-cbwsdk-redirect-dialog-box",s)},(0,At.h)("p",null,e),(0,At.h)("button",{onClick:n},t))))};Object.defineProperty(Un,"__esModule",{value:!0});Un.MobileRelayUI=void 0;const _1=ts;class E1{constructor(t){this.attached=!1,this.darkMode=!1,this.redirectDialog=new _1.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){}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);const n=document.createElement("a");n.target="cbw-opener",n.href=r.href,n.rel="noreferrer noopener",n.click()}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.redirectDialog.clear()}}hideRequestEthereumAccounts(){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}}Un.MobileRelayUI=E1;Object.defineProperty(Nn,"__esModule",{value:!0});Nn.MobileRelay=void 0;const S1=q,R1=Pn,M1=Un;class k1 extends R1.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,S1.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 M1.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)}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}})}}Nn.MobileRelay=k1;var Eo={exports:{}},cu=Jr.EventEmitter,Gs,rc;function I1(){if(rc)return Gs;rc=1;function e(L,N){var $=Object.keys(L);if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(L);N&&(M=M.filter(function(x){return Object.getOwnPropertyDescriptor(L,x).enumerable})),$.push.apply($,M)}return $}function t(L){for(var N=1;N<arguments.length;N++){var $=arguments[N]!=null?arguments[N]:{};N%2?e(Object($),!0).forEach(function(M){r(L,M,$[M])}):Object.getOwnPropertyDescriptors?Object.defineProperties(L,Object.getOwnPropertyDescriptors($)):e(Object($)).forEach(function(M){Object.defineProperty(L,M,Object.getOwnPropertyDescriptor($,M))})}return L}function r(L,N,$){return N=a(N),N in L?Object.defineProperty(L,N,{value:$,enumerable:!0,configurable:!0,writable:!0}):L[N]=$,L}function n(L,N){if(!(L instanceof N))throw new TypeError("Cannot call a class as a function")}function i(L,N){for(var $=0;$<N.length;$++){var M=N[$];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(L,a(M.key),M)}}function s(L,N,$){return N&&i(L.prototype,N),Object.defineProperty(L,"prototype",{writable:!1}),L}function a(L){var N=l(L,"string");return typeof N=="symbol"?N:String(N)}function l(L,N){if(typeof L!="object"||L===null)return L;var $=L[Symbol.toPrimitive];if($!==void 0){var M=$.call(L,N||"default");if(typeof M!="object")return M;throw new TypeError("@@toPrimitive must return a primitive value.")}return(N==="string"?String:Number)(L)}var h=In,d=h.Buffer,f=Jr,R=f.inspect,_=R&&R.custom||"inspect";function C(L,N,$){d.prototype.copy.call(L,N,$)}return Gs=function(){function L(){n(this,L),this.head=null,this.tail=null,this.length=0}return s(L,[{key:"push",value:function($){var M={data:$,next:null};this.length>0?this.tail.next=M:this.head=M,this.tail=M,++this.length}},{key:"unshift",value:function($){var M={data:$,next:this.head};this.length===0&&(this.tail=M),this.head=M,++this.length}},{key:"shift",value:function(){if(this.length!==0){var $=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,$}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function($){if(this.length===0)return"";for(var M=this.head,x=""+M.data;M=M.next;)x+=$+M.data;return x}},{key:"concat",value:function($){if(this.length===0)return d.alloc(0);for(var M=d.allocUnsafe($>>>0),x=this.head,T=0;x;)C(x.data,M,T),T+=x.data.length,x=x.next;return M}},{key:"consume",value:function($,M){var x;return $<this.head.data.length?(x=this.head.data.slice(0,$),this.head.data=this.head.data.slice($)):$===this.head.data.length?x=this.shift():x=M?this._getString($):this._getBuffer($),x}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function($){var M=this.head,x=1,T=M.data;for($-=T.length;M=M.next;){var B=M.data,P=$>B.length?B.length:$;if(P===B.length?T+=B:T+=B.slice(0,$),$-=P,$===0){P===B.length?(++x,M.next?this.head=M.next:this.head=this.tail=null):(this.head=M,M.data=B.slice(P));break}++x}return this.length-=x,T}},{key:"_getBuffer",value:function($){var M=d.allocUnsafe($),x=this.head,T=1;for(x.data.copy(M),$-=x.data.length;x=x.next;){var B=x.data,P=$>B.length?B.length:$;if(B.copy(M,M.length-$,0,P),$-=P,$===0){P===B.length?(++T,x.next?this.head=x.next:this.head=this.tail=null):(this.head=x,x.data=B.slice(P));break}++T}return this.length-=T,M}},{key:_,value:function($,M){return R(this,t(t({},M),{},{depth:0,customInspect:!1}))}}]),L}(),Gs}function C1(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,fe.nextTick(So,this,e)):fe.nextTick(So,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?fe.nextTick(wi,r):(r._writableState.errorEmitted=!0,fe.nextTick(nc,r,s)):fe.nextTick(nc,r,s):t?(fe.nextTick(wi,r),t(s)):fe.nextTick(wi,r)}),this)}function nc(e,t){So(e,t),wi(e)}function wi(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function A1(){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 So(e,t){e.emit("error",t)}function x1(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}var lu={destroy:C1,undestroy:A1,errorOrDestroy:x1},br={};function T1(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var uu={};function vt(e,t,r){r||(r=Error);function n(s,a,l){return typeof t=="string"?t:t(s,a,l)}var i=function(s){T1(a,s);function a(l,h,d){return s.call(this,n(l,h,d))||this}return a}(r);i.prototype.name=r.name,i.prototype.code=e,uu[e]=i}function ic(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 N1(e,t,r){return e.substr(0,t.length)===t}function P1(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function L1(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"&&N1(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";var i;if(P1(e," argument"))i="The ".concat(e," ").concat(n," ").concat(ic(t,"type"));else{var s=L1(e,".")?"property":"argument";i='The "'.concat(e,'" ').concat(s," ").concat(n," ").concat(ic(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");br.codes=uu;var $1=br.codes.ERR_INVALID_OPT_VALUE;function O1(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function B1(e,t,r,n){var i=O1(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var s=n?r:"highWaterMark";throw new $1(s,i)}return Math.floor(i)}return e.objectMode?16:16*1024}var hu={getHighWaterMark:B1},D1=F1;function F1(e,t){if(Js("noDeprecation"))return e;var r=!1;function n(){if(!r){if(Js("throwDeprecation"))throw new Error(t);Js("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}return n}function Js(e){try{if(!z.localStorage)return!1}catch{return!1}var t=z.localStorage[e];return t==null?!1:String(t).toLowerCase()==="true"}var Zs,sc;function du(){if(sc)return Zs;sc=1,Zs=G;function e(k){var A=this;this.next=null,this.entry=null,this.finish=function(){U(A,k)}}var t;G.WritableState=F;var r={deprecate:D1},n=cu,i=In.Buffer,s=(typeof z<"u"?z:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function a(k){return i.from(k)}function l(k){return i.isBuffer(k)||k instanceof s}var h=lu,d=hu,f=d.getHighWaterMark,R=br.codes,_=R.ERR_INVALID_ARG_TYPE,C=R.ERR_METHOD_NOT_IMPLEMENTED,L=R.ERR_MULTIPLE_CALLBACK,N=R.ERR_STREAM_CANNOT_PIPE,$=R.ERR_STREAM_DESTROYED,M=R.ERR_STREAM_NULL_VALUES,x=R.ERR_STREAM_WRITE_AFTER_END,T=R.ERR_UNKNOWN_ENCODING,B=h.errorOrDestroy;_t(G,n);function P(){}function F(k,A,O){t=t||Xr(),k=k||{},typeof O!="boolean"&&(O=A instanceof t),this.objectMode=!!k.objectMode,O&&(this.objectMode=this.objectMode||!!k.writableObjectMode),this.highWaterMark=f(this,k,"writableHighWaterMark",O),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var H=k.decodeStrings===!1;this.decodeStrings=!H,this.defaultEncoding=k.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ee){p(A,ee)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=k.emitClose!==!1,this.autoDestroy=!!k.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}F.prototype.getBuffer=function(){for(var A=this.bufferedRequest,O=[];A;)O.push(A),A=A.next;return O},function(){try{Object.defineProperty(F.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var J;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(J=Function.prototype[Symbol.hasInstance],Object.defineProperty(G,Symbol.hasInstance,{value:function(A){return J.call(this,A)?!0:this!==G?!1:A&&A._writableState instanceof F}})):J=function(A){return A instanceof this};function G(k){t=t||Xr();var A=this instanceof t;if(!A&&!J.call(G,this))return new G(k);this._writableState=new F(k,this,A),this.writable=!0,k&&(typeof k.write=="function"&&(this._write=k.write),typeof k.writev=="function"&&(this._writev=k.writev),typeof k.destroy=="function"&&(this._destroy=k.destroy),typeof k.final=="function"&&(this._final=k.final)),n.call(this)}G.prototype.pipe=function(){B(this,new N)};function V(k,A){var O=new x;B(k,O),fe.nextTick(A,O)}function ie(k,A,O,H){var ee;return O===null?ee=new M:typeof O!="string"&&!A.objectMode&&(ee=new _("chunk",["string","Buffer"],O)),ee?(B(k,ee),fe.nextTick(H,ee),!1):!0}G.prototype.write=function(k,A,O){var H=this._writableState,ee=!1,b=!H.objectMode&&l(k);return b&&!i.isBuffer(k)&&(k=a(k)),typeof A=="function"&&(O=A,A=null),b?A="buffer":A||(A=H.defaultEncoding),typeof O!="function"&&(O=P),H.ending?V(this,O):(b||ie(this,H,k,O))&&(H.pendingcb++,ee=oe(this,H,b,k,A,O)),ee},G.prototype.cork=function(){this._writableState.corked++},G.prototype.uncork=function(){var k=this._writableState;k.corked&&(k.corked--,!k.writing&&!k.corked&&!k.bufferProcessing&&k.bufferedRequest&&E(this,k))},G.prototype.setDefaultEncoding=function(A){if(typeof A=="string"&&(A=A.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((A+"").toLowerCase())>-1))throw new T(A);return this._writableState.defaultEncoding=A,this},Object.defineProperty(G.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Q(k,A,O){return!k.objectMode&&k.decodeStrings!==!1&&typeof A=="string"&&(A=i.from(A,O)),A}Object.defineProperty(G.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function oe(k,A,O,H,ee,b){if(!O){var w=Q(A,H,ee);H!==w&&(O=!0,ee="buffer",H=w)}var D=A.objectMode?1:H.length;A.length+=D;var j=A.length<A.highWaterMark;if(j||(A.needDrain=!0),A.writing||A.corked){var K=A.lastBufferedRequest;A.lastBufferedRequest={chunk:H,encoding:ee,isBuf:O,callback:b,next:null},K?K.next=A.lastBufferedRequest:A.bufferedRequest=A.lastBufferedRequest,A.bufferedRequestCount+=1}else S(k,A,!1,D,H,ee,b);return j}function S(k,A,O,H,ee,b,w){A.writelen=H,A.writecb=w,A.writing=!0,A.sync=!0,A.destroyed?A.onwrite(new $("write")):O?k._writev(ee,A.onwrite):k._write(ee,b,A.onwrite),A.sync=!1}function o(k,A,O,H,ee){--A.pendingcb,O?(fe.nextTick(ee,H),fe.nextTick(y,k,A),k._writableState.errorEmitted=!0,B(k,H)):(ee(H),k._writableState.errorEmitted=!0,B(k,H),y(k,A))}function u(k){k.writing=!1,k.writecb=null,k.length-=k.writelen,k.writelen=0}function p(k,A){var O=k._writableState,H=O.sync,ee=O.writecb;if(typeof ee!="function")throw new L;if(u(O),A)o(k,O,H,A,ee);else{var b=I(O)||k.destroyed;!b&&!O.corked&&!O.bufferProcessing&&O.bufferedRequest&&E(k,O),H?fe.nextTick(g,k,O,b,ee):g(k,O,b,ee)}}function g(k,A,O,H){O||v(k,A),A.pendingcb--,H(),y(k,A)}function v(k,A){A.length===0&&A.needDrain&&(A.needDrain=!1,k.emit("drain"))}function E(k,A){A.bufferProcessing=!0;var O=A.bufferedRequest;if(k._writev&&O&&O.next){var H=A.bufferedRequestCount,ee=new Array(H),b=A.corkedRequestsFree;b.entry=O;for(var w=0,D=!0;O;)ee[w]=O,O.isBuf||(D=!1),O=O.next,w+=1;ee.allBuffers=D,S(k,A,!0,A.length,ee,"",b.finish),A.pendingcb++,A.lastBufferedRequest=null,b.next?(A.corkedRequestsFree=b.next,b.next=null):A.corkedRequestsFree=new e(A),A.bufferedRequestCount=0}else{for(;O;){var j=O.chunk,K=O.encoding,X=O.callback,Z=A.objectMode?1:j.length;if(S(k,A,!1,Z,j,K,X),O=O.next,A.bufferedRequestCount--,A.writing)break}O===null&&(A.lastBufferedRequest=null)}A.bufferedRequest=O,A.bufferProcessing=!1}G.prototype._write=function(k,A,O){O(new C("_write()"))},G.prototype._writev=null,G.prototype.end=function(k,A,O){var H=this._writableState;return typeof k=="function"?(O=k,k=null,A=null):typeof A=="function"&&(O=A,A=null),k!=null&&this.write(k,A),H.corked&&(H.corked=1,this.uncork()),H.ending||W(this,H,O),this},Object.defineProperty(G.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function I(k){return k.ending&&k.length===0&&k.bufferedRequest===null&&!k.finished&&!k.writing}function m(k,A){k._final(function(O){A.pendingcb--,O&&B(k,O),A.prefinished=!0,k.emit("prefinish"),y(k,A)})}function c(k,A){!A.prefinished&&!A.finalCalled&&(typeof k._final=="function"&&!A.destroyed?(A.pendingcb++,A.finalCalled=!0,fe.nextTick(m,k,A)):(A.prefinished=!0,k.emit("prefinish")))}function y(k,A){var O=I(A);if(O&&(c(k,A),A.pendingcb===0&&(A.finished=!0,k.emit("finish"),A.autoDestroy))){var H=k._readableState;(!H||H.autoDestroy&&H.endEmitted)&&k.destroy()}return O}function W(k,A,O){A.ending=!0,y(k,A),O&&(A.finished?fe.nextTick(O):k.once("finish",O)),A.ended=!0,k.writable=!1}function U(k,A,O){var H=k.entry;for(k.entry=null;H;){var ee=H.callback;A.pendingcb--,ee(O),H=H.next}A.corkedRequestsFree.next=k}return Object.defineProperty(G.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(A){this._writableState&&(this._writableState.destroyed=A)}}),G.prototype.destroy=h.destroy,G.prototype._undestroy=h.undestroy,G.prototype._destroy=function(k,A){A(k)},Zs}var Ks,oc;function Xr(){if(oc)return Ks;oc=1;var e=Object.keys||function(d){var f=[];for(var R in d)f.push(R);return f};Ks=a;var t=pu(),r=du();_t(a,t);for(var n=e(r.prototype),i=0;i<n.length;i++){var s=n[i];a.prototype[s]||(a.prototype[s]=r.prototype[s])}function a(d){if(!(this instanceof a))return new a(d);t.call(this,d),r.call(this,d),this.allowHalfOpen=!0,d&&(d.readable===!1&&(this.readable=!1),d.writable===!1&&(this.writable=!1),d.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",l)))}Object.defineProperty(a.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(a.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(a.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function l(){this._writableState.ended||fe.nextTick(h,this)}function h(d){d.end()}return Object.defineProperty(a.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(f){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=f,this._writableState.destroyed=f)}}),Ks}var Qs={},ac;function cc(){if(ac)return Qs;ac=1;var e=Ft.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 x;;)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(x)return;M=(""+M).toLowerCase(),x=!0}}function n(M){var x=r(M);if(typeof x!="string"&&(e.isEncoding===t||!t(M)))throw new Error("Unknown encoding: "+M);return x||M}Qs.StringDecoder=i;function i(M){this.encoding=n(M);var x;switch(this.encoding){case"utf16le":this.text=R,this.end=_,x=4;break;case"utf8":this.fillLast=h,x=4;break;case"base64":this.text=C,this.end=L,x=3;break;default:this.write=N,this.end=$;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(x)}i.prototype.write=function(M){if(M.length===0)return"";var x,T;if(this.lastNeed){if(x=this.fillLast(M),x===void 0)return"";T=this.lastNeed,this.lastNeed=0}else T=0;return T<M.length?x?x+this.text(M,T):this.text(M,T):x||""},i.prototype.end=f,i.prototype.text=d,i.prototype.fillLast=function(M){if(this.lastNeed<=M.length)return M.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);M.copy(this.lastChar,this.lastTotal-this.lastNeed,0,M.length),this.lastNeed-=M.length};function s(M){return M<=127?0:M>>5===6?2:M>>4===14?3:M>>3===30?4:M>>6===2?-1:-2}function a(M,x,T){var B=x.length-1;if(B<T)return 0;var P=s(x[B]);return P>=0?(P>0&&(M.lastNeed=P-1),P):--B<T||P===-2?0:(P=s(x[B]),P>=0?(P>0&&(M.lastNeed=P-2),P):--B<T||P===-2?0:(P=s(x[B]),P>=0?(P>0&&(P===2?P=0:M.lastNeed=P-3),P):0))}function l(M,x,T){if((x[0]&192)!==128)return M.lastNeed=0,"�";if(M.lastNeed>1&&x.length>1){if((x[1]&192)!==128)return M.lastNeed=1,"�";if(M.lastNeed>2&&x.length>2&&(x[2]&192)!==128)return M.lastNeed=2,"�"}}function h(M){var x=this.lastTotal-this.lastNeed,T=l(this,M);if(T!==void 0)return T;if(this.lastNeed<=M.length)return M.copy(this.lastChar,x,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);M.copy(this.lastChar,x,0,M.length),this.lastNeed-=M.length}function d(M,x){var T=a(this,M,x);if(!this.lastNeed)return M.toString("utf8",x);this.lastTotal=T;var B=M.length-(T-this.lastNeed);return M.copy(this.lastChar,0,B),M.toString("utf8",x,B)}function f(M){var x=M&&M.length?this.write(M):"";return this.lastNeed?x+"�":x}function R(M,x){if((M.length-x)%2===0){var T=M.toString("utf16le",x);if(T){var B=T.charCodeAt(T.length-1);if(B>=55296&&B<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=M[M.length-2],this.lastChar[1]=M[M.length-1],T.slice(0,-1)}return T}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=M[M.length-1],M.toString("utf16le",x,M.length-1)}function _(M){var x=M&&M.length?this.write(M):"";if(this.lastNeed){var T=this.lastTotal-this.lastNeed;return x+this.lastChar.toString("utf16le",0,T)}return x}function C(M,x){var T=(M.length-x)%3;return T===0?M.toString("base64",x):(this.lastNeed=3-T,this.lastTotal=3,T===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",x,M.length-T))}function L(M){var x=M&&M.length?this.write(M):"";return this.lastNeed?x+this.lastChar.toString("base64",0,3-this.lastNeed):x}function N(M){return M.toString(this.encoding)}function $(M){return M&&M.length?this.write(M):""}return Qs}var lc=br.codes.ERR_STREAM_PREMATURE_CLOSE;function j1(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}function U1(){}function H1(e){return e.setHeader&&typeof e.abort=="function"}function fu(e,t,r){if(typeof t=="function")return fu(e,null,t);t||(t={}),r=j1(r||U1);var n=t.readable||t.readable!==!1&&e.readable,i=t.writable||t.writable!==!1&&e.writable,s=function(){e.writable||l()},a=e._writableState&&e._writableState.finished,l=function(){i=!1,a=!0,n||r.call(e)},h=e._readableState&&e._readableState.endEmitted,d=function(){n=!1,h=!0,i||r.call(e)},f=function(L){r.call(e,L)},R=function(){var L;if(n&&!h)return(!e._readableState||!e._readableState.ended)&&(L=new lc),r.call(e,L);if(i&&!a)return(!e._writableState||!e._writableState.ended)&&(L=new lc),r.call(e,L)},_=function(){e.req.on("finish",l)};return H1(e)?(e.on("complete",l),e.on("abort",R),e.req?_():e.on("request",_)):i&&!e._writableState&&(e.on("end",s),e.on("close",s)),e.on("end",d),e.on("finish",l),t.error!==!1&&e.on("error",f),e.on("close",R),function(){e.removeListener("complete",l),e.removeListener("abort",R),e.removeListener("request",_),e.req&&e.req.removeListener("finish",l),e.removeListener("end",s),e.removeListener("close",s),e.removeListener("finish",l),e.removeListener("end",d),e.removeListener("error",f),e.removeListener("close",R)}}var Wo=fu,Ys,uc;function W1(){if(uc)return Ys;uc=1;var e;function t(T,B,P){return B=r(B),B in T?Object.defineProperty(T,B,{value:P,enumerable:!0,configurable:!0,writable:!0}):T[B]=P,T}function r(T){var B=n(T,"string");return typeof B=="symbol"?B:String(B)}function n(T,B){if(typeof T!="object"||T===null)return T;var P=T[Symbol.toPrimitive];if(P!==void 0){var F=P.call(T,B||"default");if(typeof F!="object")return F;throw new TypeError("@@toPrimitive must return a primitive value.")}return(B==="string"?String:Number)(T)}var i=Wo,s=Symbol("lastResolve"),a=Symbol("lastReject"),l=Symbol("error"),h=Symbol("ended"),d=Symbol("lastPromise"),f=Symbol("handlePromise"),R=Symbol("stream");function _(T,B){return{value:T,done:B}}function C(T){var B=T[s];if(B!==null){var P=T[R].read();P!==null&&(T[d]=null,T[s]=null,T[a]=null,B(_(P,!1)))}}function L(T){fe.nextTick(C,T)}function N(T,B){return function(P,F){T.then(function(){if(B[h]){P(_(void 0,!0));return}B[f](P,F)},F)}}var $=Object.getPrototypeOf(function(){}),M=Object.setPrototypeOf((e={get stream(){return this[R]},next:function(){var B=this,P=this[l];if(P!==null)return Promise.reject(P);if(this[h])return Promise.resolve(_(void 0,!0));if(this[R].destroyed)return new Promise(function(V,ie){fe.nextTick(function(){B[l]?ie(B[l]):V(_(void 0,!0))})});var F=this[d],J;if(F)J=new Promise(N(F,this));else{var G=this[R].read();if(G!==null)return Promise.resolve(_(G,!1));J=new Promise(this[f])}return this[d]=J,J}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var B=this;return new Promise(function(P,F){B[R].destroy(null,function(J){if(J){F(J);return}P(_(void 0,!0))})})}),e),$),x=function(B){var P,F=Object.create(M,(P={},t(P,R,{value:B,writable:!0}),t(P,s,{value:null,writable:!0}),t(P,a,{value:null,writable:!0}),t(P,l,{value:null,writable:!0}),t(P,h,{value:B._readableState.endEmitted,writable:!0}),t(P,f,{value:function(G,V){var ie=F[R].read();ie?(F[d]=null,F[s]=null,F[a]=null,G(_(ie,!1))):(F[s]=G,F[a]=V)},writable:!0}),P));return F[d]=null,i(B,function(J){if(J&&J.code!=="ERR_STREAM_PREMATURE_CLOSE"){var G=F[a];G!==null&&(F[d]=null,F[s]=null,F[a]=null,G(J)),F[l]=J;return}var V=F[s];V!==null&&(F[d]=null,F[s]=null,F[a]=null,V(_(void 0,!0))),F[h]=!0}),B.on("readable",L.bind(null,F)),F};return Ys=x,Ys}var Xs,hc;function V1(){return hc||(hc=1,Xs=function(){throw new Error("Readable.from is not available in the browser")}),Xs}var eo,dc;function pu(){if(dc)return eo;dc=1,eo=V;var e;V.ReadableState=G,Jr.EventEmitter;var t=function(w,D){return w.listeners(D).length},r=cu,n=In.Buffer,i=(typeof z<"u"?z:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(b){return n.from(b)}function a(b){return n.isBuffer(b)||b instanceof i}var l=Jr,h;l&&l.debuglog?h=l.debuglog("stream"):h=function(){};var d=I1(),f=lu,R=hu,_=R.getHighWaterMark,C=br.codes,L=C.ERR_INVALID_ARG_TYPE,N=C.ERR_STREAM_PUSH_AFTER_EOF,$=C.ERR_METHOD_NOT_IMPLEMENTED,M=C.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,x,T,B;_t(V,r);var P=f.errorOrDestroy,F=["error","close","destroy","pause","resume"];function J(b,w,D){if(typeof b.prependListener=="function")return b.prependListener(w,D);!b._events||!b._events[w]?b.on(w,D):Array.isArray(b._events[w])?b._events[w].unshift(D):b._events[w]=[D,b._events[w]]}function G(b,w,D){e=e||Xr(),b=b||{},typeof D!="boolean"&&(D=w instanceof e),this.objectMode=!!b.objectMode,D&&(this.objectMode=this.objectMode||!!b.readableObjectMode),this.highWaterMark=_(this,b,"readableHighWaterMark",D),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=b.emitClose!==!1,this.autoDestroy=!!b.autoDestroy,this.destroyed=!1,this.defaultEncoding=b.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,b.encoding&&(x||(x=cc().StringDecoder),this.decoder=new x(b.encoding),this.encoding=b.encoding)}function V(b){if(e=e||Xr(),!(this instanceof V))return new V(b);var w=this instanceof e;this._readableState=new G(b,this,w),this.readable=!0,b&&(typeof b.read=="function"&&(this._read=b.read),typeof b.destroy=="function"&&(this._destroy=b.destroy)),r.call(this)}Object.defineProperty(V.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(w){this._readableState&&(this._readableState.destroyed=w)}}),V.prototype.destroy=f.destroy,V.prototype._undestroy=f.undestroy,V.prototype._destroy=function(b,w){w(b)},V.prototype.push=function(b,w){var D=this._readableState,j;return D.objectMode?j=!0:typeof b=="string"&&(w=w||D.defaultEncoding,w!==D.encoding&&(b=n.from(b,w),w=""),j=!0),ie(this,b,w,!1,j)},V.prototype.unshift=function(b){return ie(this,b,null,!0,!1)};function ie(b,w,D,j,K){h("readableAddChunk",w);var X=b._readableState;if(w===null)X.reading=!1,p(b,X);else{var Z;if(K||(Z=oe(X,w)),Z)P(b,Z);else if(X.objectMode||w&&w.length>0)if(typeof w!="string"&&!X.objectMode&&Object.getPrototypeOf(w)!==n.prototype&&(w=s(w)),j)X.endEmitted?P(b,new M):Q(b,X,w,!0);else if(X.ended)P(b,new N);else{if(X.destroyed)return!1;X.reading=!1,X.decoder&&!D?(w=X.decoder.write(w),X.objectMode||w.length!==0?Q(b,X,w,!1):E(b,X)):Q(b,X,w,!1)}else j||(X.reading=!1,E(b,X))}return!X.ended&&(X.length<X.highWaterMark||X.length===0)}function Q(b,w,D,j){w.flowing&&w.length===0&&!w.sync?(w.awaitDrain=0,b.emit("data",D)):(w.length+=w.objectMode?1:D.length,j?w.buffer.unshift(D):w.buffer.push(D),w.needReadable&&g(b)),E(b,w)}function oe(b,w){var D;return!a(w)&&typeof w!="string"&&w!==void 0&&!b.objectMode&&(D=new L("chunk",["string","Buffer","Uint8Array"],w)),D}V.prototype.isPaused=function(){return this._readableState.flowing===!1},V.prototype.setEncoding=function(b){x||(x=cc().StringDecoder);var w=new x(b);this._readableState.decoder=w,this._readableState.encoding=this._readableState.decoder.encoding;for(var D=this._readableState.buffer.head,j="";D!==null;)j+=w.write(D.data),D=D.next;return this._readableState.buffer.clear(),j!==""&&this._readableState.buffer.push(j),this._readableState.length=j.length,this};var S=1073741824;function o(b){return b>=S?b=S:(b--,b|=b>>>1,b|=b>>>2,b|=b>>>4,b|=b>>>8,b|=b>>>16,b++),b}function u(b,w){return b<=0||w.length===0&&w.ended?0:w.objectMode?1:b!==b?w.flowing&&w.length?w.buffer.head.data.length:w.length:(b>w.highWaterMark&&(w.highWaterMark=o(b)),b<=w.length?b:w.ended?w.length:(w.needReadable=!0,0))}V.prototype.read=function(b){h("read",b),b=parseInt(b,10);var w=this._readableState,D=b;if(b!==0&&(w.emittedReadable=!1),b===0&&w.needReadable&&((w.highWaterMark!==0?w.length>=w.highWaterMark:w.length>0)||w.ended))return h("read: emitReadable",w.length,w.ended),w.length===0&&w.ended?O(this):g(this),null;if(b=u(b,w),b===0&&w.ended)return w.length===0&&O(this),null;var j=w.needReadable;h("need readable",j),(w.length===0||w.length-b<w.highWaterMark)&&(j=!0,h("length less than watermark",j)),w.ended||w.reading?(j=!1,h("reading or ended",j)):j&&(h("do read"),w.reading=!0,w.sync=!0,w.length===0&&(w.needReadable=!0),this._read(w.highWaterMark),w.sync=!1,w.reading||(b=u(D,w)));var K;return b>0?K=A(b,w):K=null,K===null?(w.needReadable=w.length<=w.highWaterMark,b=0):(w.length-=b,w.awaitDrain=0),w.length===0&&(w.ended||(w.needReadable=!0),D!==b&&w.ended&&O(this)),K!==null&&this.emit("data",K),K};function p(b,w){if(h("onEofChunk"),!w.ended){if(w.decoder){var D=w.decoder.end();D&&D.length&&(w.buffer.push(D),w.length+=w.objectMode?1:D.length)}w.ended=!0,w.sync?g(b):(w.needReadable=!1,w.emittedReadable||(w.emittedReadable=!0,v(b)))}}function g(b){var w=b._readableState;h("emitReadable",w.needReadable,w.emittedReadable),w.needReadable=!1,w.emittedReadable||(h("emitReadable",w.flowing),w.emittedReadable=!0,fe.nextTick(v,b))}function v(b){var w=b._readableState;h("emitReadable_",w.destroyed,w.length,w.ended),!w.destroyed&&(w.length||w.ended)&&(b.emit("readable"),w.emittedReadable=!1),w.needReadable=!w.flowing&&!w.ended&&w.length<=w.highWaterMark,k(b)}function E(b,w){w.readingMore||(w.readingMore=!0,fe.nextTick(I,b,w))}function I(b,w){for(;!w.reading&&!w.ended&&(w.length<w.highWaterMark||w.flowing&&w.length===0);){var D=w.length;if(h("maybeReadMore read 0"),b.read(0),D===w.length)break}w.readingMore=!1}V.prototype._read=function(b){P(this,new $("_read()"))},V.prototype.pipe=function(b,w){var D=this,j=this._readableState;switch(j.pipesCount){case 0:j.pipes=b;break;case 1:j.pipes=[j.pipes,b];break;default:j.pipes.push(b);break}j.pipesCount+=1,h("pipe count=%d opts=%j",j.pipesCount,w);var K=(!w||w.end!==!1)&&b!==fe.stdout&&b!==fe.stderr,X=K?ue:de;j.endEmitted?fe.nextTick(X):D.once("end",X),b.on("unpipe",Z);function Z(he,at){h("onunpipe"),he===D&&at&&at.hasUnpiped===!1&&(at.hasUnpiped=!0,ve())}function ue(){h("onend"),b.end()}var Rt=m(D);b.on("drain",Rt);var me=!1;function ve(){h("cleanup"),b.removeListener("close",ge),b.removeListener("finish",Lt),b.removeListener("drain",Rt),b.removeListener("error",pe),b.removeListener("unpipe",Z),D.removeListener("end",ue),D.removeListener("end",de),D.removeListener("data",jt),me=!0,j.awaitDrain&&(!b._writableState||b._writableState.needDrain)&&Rt()}D.on("data",jt);function jt(he){h("ondata");var at=b.write(he);h("dest.write",at),at===!1&&((j.pipesCount===1&&j.pipes===b||j.pipesCount>1&&ee(j.pipes,b)!==-1)&&!me&&(h("false write response, pause",j.awaitDrain),j.awaitDrain++),D.pause())}function pe(he){h("onerror",he),de(),b.removeListener("error",pe),t(b,"error")===0&&P(b,he)}J(b,"error",pe);function ge(){b.removeListener("finish",Lt),de()}b.once("close",ge);function Lt(){h("onfinish"),b.removeListener("close",ge),de()}b.once("finish",Lt);function de(){h("unpipe"),D.unpipe(b)}return b.emit("pipe",D),j.flowing||(h("pipe resume"),D.resume()),b};function m(b){return function(){var D=b._readableState;h("pipeOnDrain",D.awaitDrain),D.awaitDrain&&D.awaitDrain--,D.awaitDrain===0&&t(b,"data")&&(D.flowing=!0,k(b))}}V.prototype.unpipe=function(b){var w=this._readableState,D={hasUnpiped:!1};if(w.pipesCount===0)return this;if(w.pipesCount===1)return b&&b!==w.pipes?this:(b||(b=w.pipes),w.pipes=null,w.pipesCount=0,w.flowing=!1,b&&b.emit("unpipe",this,D),this);if(!b){var j=w.pipes,K=w.pipesCount;w.pipes=null,w.pipesCount=0,w.flowing=!1;for(var X=0;X<K;X++)j[X].emit("unpipe",this,{hasUnpiped:!1});return this}var Z=ee(w.pipes,b);return Z===-1?this:(w.pipes.splice(Z,1),w.pipesCount-=1,w.pipesCount===1&&(w.pipes=w.pipes[0]),b.emit("unpipe",this,D),this)},V.prototype.on=function(b,w){var D=r.prototype.on.call(this,b,w),j=this._readableState;return b==="data"?(j.readableListening=this.listenerCount("readable")>0,j.flowing!==!1&&this.resume()):b==="readable"&&!j.endEmitted&&!j.readableListening&&(j.readableListening=j.needReadable=!0,j.flowing=!1,j.emittedReadable=!1,h("on readable",j.length,j.reading),j.length?g(this):j.reading||fe.nextTick(y,this)),D},V.prototype.addListener=V.prototype.on,V.prototype.removeListener=function(b,w){var D=r.prototype.removeListener.call(this,b,w);return b==="readable"&&fe.nextTick(c,this),D},V.prototype.removeAllListeners=function(b){var w=r.prototype.removeAllListeners.apply(this,arguments);return(b==="readable"||b===void 0)&&fe.nextTick(c,this),w};function c(b){var w=b._readableState;w.readableListening=b.listenerCount("readable")>0,w.resumeScheduled&&!w.paused?w.flowing=!0:b.listenerCount("data")>0&&b.resume()}function y(b){h("readable nexttick read 0"),b.read(0)}V.prototype.resume=function(){var b=this._readableState;return b.flowing||(h("resume"),b.flowing=!b.readableListening,W(this,b)),b.paused=!1,this};function W(b,w){w.resumeScheduled||(w.resumeScheduled=!0,fe.nextTick(U,b,w))}function U(b,w){h("resume",w.reading),w.reading||b.read(0),w.resumeScheduled=!1,b.emit("resume"),k(b),w.flowing&&!w.reading&&b.read(0)}V.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function k(b){var w=b._readableState;for(h("flow",w.flowing);w.flowing&&b.read()!==null;);}V.prototype.wrap=function(b){var w=this,D=this._readableState,j=!1;b.on("end",function(){if(h("wrapped end"),D.decoder&&!D.ended){var Z=D.decoder.end();Z&&Z.length&&w.push(Z)}w.push(null)}),b.on("data",function(Z){if(h("wrapped data"),D.decoder&&(Z=D.decoder.write(Z)),!(D.objectMode&&Z==null)&&!(!D.objectMode&&(!Z||!Z.length))){var ue=w.push(Z);ue||(j=!0,b.pause())}});for(var K in b)this[K]===void 0&&typeof b[K]=="function"&&(this[K]=function(ue){return function(){return b[ue].apply(b,arguments)}}(K));for(var X=0;X<F.length;X++)b.on(F[X],this.emit.bind(this,F[X]));return this._read=function(Z){h("wrapped _read",Z),j&&(j=!1,b.resume())},this},typeof Symbol=="function"&&(V.prototype[Symbol.asyncIterator]=function(){return T===void 0&&(T=W1()),T(this)}),Object.defineProperty(V.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(V.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(V.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(w){this._readableState&&(this._readableState.flowing=w)}}),V._fromList=A,Object.defineProperty(V.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function A(b,w){if(w.length===0)return null;var D;return w.objectMode?D=w.buffer.shift():!b||b>=w.length?(w.decoder?D=w.buffer.join(""):w.buffer.length===1?D=w.buffer.first():D=w.buffer.concat(w.length),w.buffer.clear()):D=w.buffer.consume(b,w.decoder),D}function O(b){var w=b._readableState;h("endReadable",w.endEmitted),w.endEmitted||(w.ended=!0,fe.nextTick(H,w,b))}function H(b,w){if(h("endReadableNT",b.endEmitted,b.length),!b.endEmitted&&b.length===0&&(b.endEmitted=!0,w.readable=!1,w.emit("end"),b.autoDestroy)){var D=w._writableState;(!D||D.autoDestroy&&D.finished)&&w.destroy()}}typeof Symbol=="function"&&(V.from=function(b,w){return B===void 0&&(B=V1()),B(V,b,w)});function ee(b,w){for(var D=0,j=b.length;D<j;D++)if(b[D]===w)return D;return-1}return eo}var gu=Dt,rs=br.codes,q1=rs.ERR_METHOD_NOT_IMPLEMENTED,z1=rs.ERR_MULTIPLE_CALLBACK,G1=rs.ERR_TRANSFORM_ALREADY_TRANSFORMING,J1=rs.ERR_TRANSFORM_WITH_LENGTH_0,ns=Xr();_t(Dt,ns);function Z1(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new z1);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Dt(e){if(!(this instanceof Dt))return new Dt(e);ns.call(this,e),this._transformState={afterTransform:Z1.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",K1)}function K1(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){fc(e,t,r)}):fc(this,null,null)}Dt.prototype.push=function(e,t){return this._transformState.needTransform=!1,ns.prototype.push.call(this,e,t)};Dt.prototype._transform=function(e,t,r){r(new q1("_transform()"))};Dt.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Dt.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};Dt.prototype._destroy=function(e,t){ns.prototype._destroy.call(this,e,function(r){t(r)})};function fc(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new J1;if(e._transformState.transforming)throw new G1;return e.push(null)}var Q1=wn,mu=gu;_t(wn,mu);function wn(e){if(!(this instanceof wn))return new wn(e);mu.call(this,e)}wn.prototype._transform=function(e,t,r){r(null,e)};var to;function Y1(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var vu=br.codes,X1=vu.ERR_MISSING_ARGS,eg=vu.ERR_STREAM_DESTROYED;function pc(e){if(e)throw e}function tg(e){return e.setHeader&&typeof e.abort=="function"}function rg(e,t,r,n){n=Y1(n);var i=!1;e.on("close",function(){i=!0}),to===void 0&&(to=Wo),to(e,{readable:t,writable:r},function(a){if(a)return n(a);i=!0,n()});var s=!1;return function(a){if(!i&&!s){if(s=!0,tg(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(a||new eg("pipe"))}}}function gc(e){e()}function ng(e,t){return e.pipe(t)}function ig(e){return!e.length||typeof e[e.length-1]!="function"?pc:e.pop()}function sg(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=ig(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new X1("streams");var i,s=t.map(function(a,l){var h=l<t.length-1,d=l>0;return rg(a,h,d,function(f){i||(i=f),f&&s.forEach(gc),!h&&(s.forEach(gc),n(i))})});return t.reduce(ng)}var og=sg;(function(e,t){t=e.exports=pu(),t.Stream=t,t.Readable=t,t.Writable=du(),t.Duplex=Xr(),t.Transform=gu,t.PassThrough=Q1,t.finished=Wo,t.pipeline=og})(Eo,Eo.exports);var yu=Eo.exports;const{Transform:ag}=yu;var cg=e=>class bu extends ag{constructor(r,n,i,s,a){super(a),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._hashBitLength=s,this._options=a,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(a){s=a}i(s)}_flush(r){let n=null;try{this.push(this.digest())}catch(i){n=i}r(n)}update(r,n){if(!re.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 re.isBuffer(r)||(r=re.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 bu(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:lg}=yu;var ug=e=>class wu extends lg{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(a){s=a}i(s)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,n){if(!re.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 re.isBuffer(r)||(r=re.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 wu(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const hg=cg,dg=ug;var fg=function(e){const t=hg(e),r=dg(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)}}},_u={};const mc=[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];_u.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],a=e[4]^e[14]^e[24]^e[34]^e[44],l=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],d=e[7]^e[17]^e[27]^e[37]^e[47],f=e[8]^e[18]^e[28]^e[38]^e[48],R=e[9]^e[19]^e[29]^e[39]^e[49];let _=f^(i<<1|s>>>31),C=R^(s<<1|i>>>31);const L=e[0]^_,N=e[1]^C,$=e[10]^_,M=e[11]^C,x=e[20]^_,T=e[21]^C,B=e[30]^_,P=e[31]^C,F=e[40]^_,J=e[41]^C;_=r^(a<<1|l>>>31),C=n^(l<<1|a>>>31);const G=e[2]^_,V=e[3]^C,ie=e[12]^_,Q=e[13]^C,oe=e[22]^_,S=e[23]^C,o=e[32]^_,u=e[33]^C,p=e[42]^_,g=e[43]^C;_=i^(h<<1|d>>>31),C=s^(d<<1|h>>>31);const v=e[4]^_,E=e[5]^C,I=e[14]^_,m=e[15]^C,c=e[24]^_,y=e[25]^C,W=e[34]^_,U=e[35]^C,k=e[44]^_,A=e[45]^C;_=a^(f<<1|R>>>31),C=l^(R<<1|f>>>31);const O=e[6]^_,H=e[7]^C,ee=e[16]^_,b=e[17]^C,w=e[26]^_,D=e[27]^C,j=e[36]^_,K=e[37]^C,X=e[46]^_,Z=e[47]^C;_=h^(r<<1|n>>>31),C=d^(n<<1|r>>>31);const ue=e[8]^_,Rt=e[9]^C,me=e[18]^_,ve=e[19]^C,jt=e[28]^_,pe=e[29]^C,ge=e[38]^_,Lt=e[39]^C,de=e[48]^_,he=e[49]^C,at=L,ye=N,be=M<<4|$>>>28,Er=$<<4|M>>>28,we=x<<3|T>>>29,_e=T<<3|x>>>29,Sr=P<<9|B>>>23,Ee=B<<9|P>>>23,Se=F<<18|J>>>14,Rr=J<<18|F>>>14,Re=G<<1|V>>>31,Me=V<<1|G>>>31,Mr=Q<<12|ie>>>20,ke=ie<<12|Q>>>20,Ie=oe<<10|S>>>22,kr=S<<10|oe>>>22,Ce=u<<13|o>>>19,Ae=o<<13|u>>>19,Ir=p<<2|g>>>30,xe=g<<2|p>>>30,Te=E<<30|v>>>2,Cr=v<<30|E>>>2,Ne=I<<6|m>>>26,Pe=m<<6|I>>>26,Ar=y<<11|c>>>21,Le=c<<11|y>>>21,$e=W<<15|U>>>17,xr=U<<15|W>>>17,Oe=A<<29|k>>>3,Be=k<<29|A>>>3,Tr=O<<28|H>>>4,De=H<<28|O>>>4,Fe=b<<23|ee>>>9,Nr=ee<<23|b>>>9,je=w<<25|D>>>7,Ue=D<<25|w>>>7,Gt=j<<21|K>>>11,Jt=K<<21|j>>>11,Zt=Z<<24|X>>>8,Kt=X<<24|Z>>>8,Qt=ue<<27|Rt>>>5,Yt=Rt<<27|ue>>>5,Xt=me<<20|ve>>>12,er=ve<<20|me>>>12,tr=pe<<7|jt>>>25,rr=jt<<7|pe>>>25,nr=ge<<8|Lt>>>24,ir=Lt<<8|ge>>>24,sr=de<<14|he>>>18,or=he<<14|de>>>18;e[0]=at^~Mr&Ar,e[1]=ye^~ke&Le,e[10]=Tr^~Xt&we,e[11]=De^~er&_e,e[20]=Re^~Ne&je,e[21]=Me^~Pe&Ue,e[30]=Qt^~be&Ie,e[31]=Yt^~Er&kr,e[40]=Te^~Fe&tr,e[41]=Cr^~Nr&rr,e[2]=Mr^~Ar&Gt,e[3]=ke^~Le&Jt,e[12]=Xt^~we&Ce,e[13]=er^~_e&Ae,e[22]=Ne^~je&nr,e[23]=Pe^~Ue&ir,e[32]=be^~Ie&$e,e[33]=Er^~kr&xr,e[42]=Fe^~tr&Sr,e[43]=Nr^~rr&Ee,e[4]=Ar^~Gt&sr,e[5]=Le^~Jt&or,e[14]=we^~Ce&Oe,e[15]=_e^~Ae&Be,e[24]=je^~nr&Se,e[25]=Ue^~ir&Rr,e[34]=Ie^~$e&Zt,e[35]=kr^~xr&Kt,e[44]=tr^~Sr&Ir,e[45]=rr^~Ee&xe,e[6]=Gt^~sr&at,e[7]=Jt^~or&ye,e[16]=Ce^~Oe&Tr,e[17]=Ae^~Be&De,e[26]=nr^~Se&Re,e[27]=ir^~Rr&Me,e[36]=$e^~Zt&Qt,e[37]=xr^~Kt&Yt,e[46]=Sr^~Ir&Te,e[47]=Ee^~xe&Cr,e[8]=sr^~at&Mr,e[9]=or^~ye&ke,e[18]=Oe^~Tr&Xt,e[19]=Be^~De&er,e[28]=Se^~Re&Ne,e[29]=Rr^~Me&Pe,e[38]=Zt^~Qt&be,e[39]=Kt^~Yt&Er,e[48]=Ir^~Te&Fe,e[49]=xe^~Cr&Nr,e[0]^=mc[t*2],e[1]^=mc[t*2+1]}};const ki=_u;function ln(){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}ln.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};ln.prototype.absorb=function(e){for(let t=0;t<e.length;++t)this.state[~~(this.count/4)]^=e[t]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(ki.p1600(this.state),this.count=0)};ln.prototype.absorbLastFewBits=function(e){this.state[~~(this.count/4)]^=e<<8*(this.count%4),e&128&&this.count===this.blockSize-1&&ki.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),ki.p1600(this.state),this.count=0,this.squeezing=!0};ln.prototype.squeeze=function(e){this.squeezing||this.absorbLastFewBits(1);const t=re.alloc(e);for(let r=0;r<e;++r)t[r]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(ki.p1600(this.state),this.count=0);return t};ln.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 pg=ln,gg=fg(pg);const mg=gg,vg=Ti;function Eu(e){return re.allocUnsafe(e).fill(0)}function Su(e,t,r){const n=Eu(t);return e=is(e),r?e.length<t?(e.copy(n),n):e.slice(0,t):e.length<t?(e.copy(n,t-e.length),n):e.slice(-t)}function yg(e,t){return Su(e,t,!0)}function is(e){if(!re.isBuffer(e))if(Array.isArray(e))e=re.from(e);else if(typeof e=="string")Ru(e)?e=re.from(_g(Mu(e)),"hex"):e=re.from(e);else if(typeof e=="number")e=intToBuffer(e);else if(e==null)e=re.allocUnsafe(0);else if(vg.isBN(e))e=e.toArrayLike(re);else if(e.toArray)e=re.from(e.toArray());else throw new Error("invalid type");return e}function bg(e){return e=is(e),"0x"+e.toString("hex")}function wg(e,t){return e=is(e),t||(t=256),mg("keccak"+t).update(e).digest()}function _g(e){return e.length%2?"0"+e:e}function Ru(e){return typeof e=="string"&&e.match(/^0x[0-9A-Fa-f]*$/)}function Mu(e){return typeof e=="string"&&e.startsWith("0x")?e.slice(2):e}var ku={zeros:Eu,setLength:Su,setLengthRight:yg,isHexString:Ru,stripHexPrefix:Mu,toBuffer:is,bufferToHex:bg,keccak:wg};const mr=ku,fr=Ti;function Iu(e){return e.startsWith("int[")?"int256"+e.slice(3):e==="int"?"int256":e.startsWith("uint[")?"uint256"+e.slice(4):e==="uint"?"uint256":e.startsWith("fixed[")?"fixed128x128"+e.slice(5):e==="fixed"?"fixed128x128":e.startsWith("ufixed[")?"ufixed128x128"+e.slice(6):e==="ufixed"?"ufixed128x128":e}function zr(e){return parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function vc(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[parseInt(t[1],10),parseInt(t[2],10)]}function Cu(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?t[2]===""?"dynamic":parseInt(t[2],10):null}function hr(e){var t=typeof e;if(t==="string")return mr.isHexString(e)?new fr(mr.stripHexPrefix(e),16):new fr(e,10);if(t==="number")return new fr(e);if(e.toArray)return e;throw new Error("Argument is not a number")}function Ct(e,t){var r,n,i,s;if(e==="address")return Ct("uint160",hr(t));if(e==="bool")return Ct("uint8",t?1:0);if(e==="string")return Ct("bytes",new re(t,"utf8"));if(Sg(e)){if(typeof t.length>"u")throw new Error("Not an array?");if(r=Cu(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(Ct(e,t[s]));if(r==="dynamic"){var a=Ct("uint256",t.length);i.unshift(a)}return re.concat(i)}else{if(e==="bytes")return t=new re(t),i=re.concat([Ct("uint256",t.length),t]),t.length%32!==0&&(i=re.concat([i,mr.zeros(32-t.length%32)])),i;if(e.startsWith("bytes")){if(r=zr(e),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return mr.setLengthRight(t,32)}else if(e.startsWith("uint")){if(r=zr(e),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=hr(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(re,"be",32)}else if(e.startsWith("int")){if(r=zr(e),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=hr(t),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(re,"be",32)}else if(e.startsWith("ufixed")){if(r=vc(e),n=hr(t),n<0)throw new Error("Supplied ufixed is negative");return Ct("uint256",n.mul(new fr(2).pow(new fr(r[1]))))}else if(e.startsWith("fixed"))return r=vc(e),Ct("int256",hr(t).mul(new fr(2).pow(new fr(r[1]))))}throw new Error("Unsupported or invalid type: "+e)}function Eg(e){return e==="string"||e==="bytes"||Cu(e)==="dynamic"}function Sg(e){return e.lastIndexOf("]")===e.length-1}function Rg(e,t){var r=[],n=[],i=32*e.length;for(var s in e){var a=Iu(e[s]),l=t[s],h=Ct(a,l);Eg(a)?(r.push(Ct("uint256",i)),n.push(h),i+=h.length):r.push(h)}return re.concat(r.concat(n))}function Au(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;s<e.length;s++){var a=Iu(e[s]),l=t[s];if(a==="bytes")i.push(l);else if(a==="string")i.push(new re(l,"utf8"));else if(a==="bool")i.push(new re(l?"01":"00","hex"));else if(a==="address")i.push(mr.setLength(l,20));else if(a.startsWith("bytes")){if(r=zr(a),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);i.push(mr.setLengthRight(l,r))}else if(a.startsWith("uint")){if(r=zr(a),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=hr(l),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());i.push(n.toArrayLike(re,"be",r/8))}else if(a.startsWith("int")){if(r=zr(a),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=hr(l),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());i.push(n.toTwos(r).toArrayLike(re,"be",r/8))}else throw new Error("Unsupported or invalid type: "+a)}return re.concat(i)}function Mg(e,t){return mr.keccak(Au(e,t))}var kg={rawEncode:Rg,solidityPack:Au,soliditySHA3:Mg};const bt=ku,vn=kg,xu={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"]},ro={encodeData(e,t,r,n=!0){const i=["bytes32"],s=[this.hashType(e,r)];if(n){const a=(l,h,d)=>{if(r[h]!==void 0)return["bytes32",d==null?"0x0000000000000000000000000000000000000000000000000000000000000000":bt.keccak(this.encodeData(h,d,r,n))];if(d===void 0)throw new Error(`missing value for field ${l} of type ${h}`);if(h==="bytes")return["bytes32",bt.keccak(d)];if(h==="string")return typeof d=="string"&&(d=re.from(d,"utf8")),["bytes32",bt.keccak(d)];if(h.lastIndexOf("]")===h.length-1){const f=h.slice(0,h.lastIndexOf("[")),R=d.map(_=>a(l,f,_));return["bytes32",bt.keccak(vn.rawEncode(R.map(([_])=>_),R.map(([,_])=>_)))]}return[h,d]};for(const l of r[e]){const[h,d]=a(l.name,l.type,t[l.name]);i.push(h),s.push(d)}}else for(const a of r[e]){let l=t[a.name];if(l!==void 0)if(a.type==="bytes")i.push("bytes32"),l=bt.keccak(l),s.push(l);else if(a.type==="string")i.push("bytes32"),typeof l=="string"&&(l=re.from(l,"utf8")),l=bt.keccak(l),s.push(l);else if(r[a.type]!==void 0)i.push("bytes32"),l=bt.keccak(this.encodeData(a.type,l,r,n)),s.push(l);else{if(a.type.lastIndexOf("]")===a.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(a.type),s.push(l)}}return vn.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:a,type:l})=>l+" "+a).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 bt.keccak(this.encodeData(e,t,r,n))},hashType(e,t){return bt.keccak(this.encodeType(e,t))},sanitizeData(e){const t={};for(const r in xu.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=[re.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)),bt.keccak(re.concat(n))}};var Ig={TYPED_MESSAGE_SCHEMA:xu,TypedDataUtils:ro,hashForSignTypedDataLegacy:function(e){return Cg(e.data)},hashForSignTypedData_v3:function(e){return ro.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return ro.hash(e.data)}};function Cg(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"?bt.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 vn.soliditySHA3(["bytes32","bytes32"],[vn.soliditySHA3(new Array(e.length).fill("string"),i),vn.soliditySHA3(n,r)])}var en={};Object.defineProperty(en,"__esModule",{value:!0});en.filterFromParam=en.FilterPolyfill=void 0;const Ur=Ge,rt=q,Ag=5*60*1e3,dr={jsonrpc:"2.0",id:0};class xg{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,Ur.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=t}async newFilter(t){const r=Tu(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,rt.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,rt.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,rt.hexStringFromIntNumber)(t)}uninstallFilter(t){const r=(0,rt.intNumberFromHexString)(t);return console.info(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(t){const r=(0,rt.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(ii())}async getFilterLogs(t){const r=(0,rt.intNumberFromHexString)(t),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},dr),{method:"eth_getLogs",params:[yc(n)]})):ii()}makeFilterId(){return(0,Ur.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 ii();const i=await this.getCurrentBlockHeight(),s=r.toBlock==="latest"?i:r.toBlock;if(n>i||n>Number(r.toBlock))return si();console.info(`Fetching logs from ${n} to ${s} for filter ${t}`);const a=await this.sendAsyncPromise(Object.assign(Object.assign({},dr),{method:"eth_getLogs",params:[yc(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:s}))]}));if(Array.isArray(a.result)){const l=a.result.map(d=>(0,rt.intNumberFromHexString)(d.blockNumber||"0x0")),h=Math.max(...l);if(h&&h>n){const d=(0,Ur.IntNumber)(h+1);console.info(`Moving cursor position for filter (${t}) from ${n} to ${d}`),this.cursors.set(t,d)}}return a}async getBlockFilterChanges(t){const r=this.cursors.get(t);if(!r)return ii();const n=await this.getCurrentBlockHeight();if(r>n)return si();console.info(`Fetching blocks from ${r} to ${n} for filter (${t})`);const i=(await Promise.all((0,rt.range)(r,n+1).map(a=>this.getBlockHashByNumber((0,Ur.IntNumber)(a))))).filter(a=>!!a),s=(0,Ur.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({},dr),{result:i})}async getPendingTransactionFilterChanges(t){return Promise.resolve(si())}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)},Ag);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({},dr),{method:"eth_blockNumber",params:[]}));return(0,rt.intNumberFromHexString)((0,rt.ensureHexString)(t))}async getBlockHashByNumber(t){const r=await this.sendAsyncPromise(Object.assign(Object.assign({},dr),{method:"eth_getBlockByNumber",params:[(0,rt.hexStringFromIntNumber)(t),!1]}));return r.result&&typeof r.result.hash=="string"?(0,rt.ensureHexString)(r.result.hash):null}}en.FilterPolyfill=xg;function Tu(e){return{fromBlock:bc(e.fromBlock),toBlock:bc(e.toBlock),addresses:e.address===void 0?null:Array.isArray(e.address)?e.address:[e.address],topics:e.topics||[]}}en.filterFromParam=Tu;function yc(e){const t={fromBlock:wc(e.fromBlock),toBlock:wc(e.toBlock),topics:e.topics};return e.addresses!==null&&(t.address=e.addresses),t}function bc(e){if(e===void 0||e==="latest"||e==="pending")return"latest";if(e==="earliest")return(0,Ur.IntNumber)(0);if((0,rt.isHexString)(e))return(0,rt.intNumberFromHexString)(e);throw new Error(`Invalid block option: ${String(e)}`)}function wc(e){return e==="latest"?e:(0,rt.hexStringFromIntNumber)(e)}function ii(){return Object.assign(Object.assign({},dr),{error:{code:-32e3,message:"filter not found"}})}function si(){return Object.assign(Object.assign({},dr),{result:[]})}var ss={},Nu={},os={},Vo=Tg;function Tg(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 _c=(e,t)=>function(){const r=t.promiseModule,n=new Array(arguments.length);for(let i=0;i<arguments.length;i++)n[i]=arguments[i];return new r((i,s)=>{t.errorFirst?n.push(function(a,l){if(t.multiArgs){const h=new Array(arguments.length-1);for(let d=1;d<arguments.length;d++)h[d-1]=arguments[d];a?(h.unshift(a),s(h)):i(h)}else a?s(a):i(l)}):n.push(function(a){if(t.multiArgs){const l=new Array(arguments.length-1);for(let h=0;h<arguments.length;h++)l[h]=arguments[h];i(l)}else i(a)}),e.apply(this,n)})};var Ng=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const r=i=>{const s=a=>typeof a=="string"?i===a:a.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):_c(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)?_c(s,t):s}return n},Hn={},Wn={};Object.defineProperty(Wn,"__esModule",{value:!0});const Pg=Jr;function Ec(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function Lg(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let $g=class extends Pg.EventEmitter{emit(t,...r){let n=t==="error";const i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){let a;if(r.length>0&&([a]=r),a instanceof Error)throw a;const l=new Error(`Unhandled error.${a?` (${a.message})`:""}`);throw l.context=a,l}const s=i[t];if(s===void 0)return!1;if(typeof s=="function")Ec(s,this,r);else{const a=s.length,l=Lg(s);for(let h=0;h<a;h+=1)Ec(l[h],this,r)}return!0}};Wn.default=$g;var Og=z&&z.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Hn,"__esModule",{value:!0});Hn.BaseBlockTracker=void 0;const Bg=Og(Wn),Dg=1e3,Fg=(e,t)=>e+t,Sc=["sync","latest"];class jg extends Bg.default{constructor(t){super(),this._blockResetDuration=t.blockResetDuration||20*Dg,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){Sc.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 Sc.map(t=>this.listenerCount(t)).reduce(Fg)}_shouldUseNewBlock(t){const r=this._currentBlock;if(!r)return!0;const n=Rc(t),i=Rc(r);return this._usePastBlocks&&n<i||n>i}_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}}Hn.BaseBlockTracker=jg;function Rc(e){return Number.parseInt(e,16)}var Pu={},Lu={},et={};class $u extends TypeError{constructor(t,r){let n;const{message:i,explanation:s,...a}=t,{path:l}=t,h=l.length===0?i:`At path: ${l.join(".")} -- ${i}`;super(s??h),s!=null&&(this.cause=h),Object.assign(this,a),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...r()])}}function Ug(e){return mt(e)&&typeof e[Symbol.iterator]=="function"}function mt(e){return typeof e=="object"&&e!=null}function Mc(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Je(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function Hg(e){const{done:t,value:r}=e.next();return t?void 0:r}function Wg(e,t,r,n){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:i,branch:s}=t,{type:a}=r,{refinement:l,message:h=`Expected a value of type \`${a}\`${l?` with refinement \`${l}\``:""}, but received: \`${Je(n)}\``}=e;return{value:n,type:a,refinement:l,key:i[i.length-1],path:i,branch:s,...e,message:h}}function*Ro(e,t,r,n){Ug(e)||(e=[e]);for(const i of e){const s=Wg(i,t,r,n);s&&(yield s)}}function*qo(e,t,r={}){const{path:n=[],branch:i=[e],coerce:s=!1,mask:a=!1}=r,l={path:n,branch:i};if(s&&(e=t.coercer(e,l),a&&t.type!=="type"&&mt(t.schema)&&mt(e)&&!Array.isArray(e)))for(const d in e)t.schema[d]===void 0&&delete e[d];let h="valid";for(const d of t.validator(e,l))d.explanation=r.message,h="not_valid",yield[d,void 0];for(let[d,f,R]of t.entries(e,l)){const _=qo(f,R,{path:d===void 0?n:[...n,d],branch:d===void 0?i:[...i,f],coerce:s,mask:a,message:r.message});for(const C of _)C[0]?(h=C[0].refinement!=null?"not_refined":"not_valid",yield[C[0],void 0]):s&&(f=C[1],d===void 0?e=f:e instanceof Map?e.set(d,f):e instanceof Set?e.add(f):mt(e)&&(f!==void 0||d in e)&&(e[d]=f))}if(h!=="not_valid")for(const d of t.refiner(e,l))d.explanation=r.message,h="not_refined",yield[d,void 0];h==="valid"&&(yield[void 0,e])}class qe{constructor(t){const{type:r,schema:n,validator:i,refiner:s,coercer:a=h=>h,entries:l=function*(){}}=t;this.type=r,this.schema=n,this.entries=l,this.coercer=a,i?this.validator=(h,d)=>{const f=i(h,d);return Ro(f,d,this,h)}:this.validator=()=>[],s?this.refiner=(h,d)=>{const f=s(h,d);return Ro(f,d,this,h)}:this.refiner=()=>[]}assert(t,r){return Ou(t,this,r)}create(t,r){return Bu(t,this,r)}is(t){return zo(t,this)}mask(t,r){return Du(t,this,r)}validate(t,r={}){return un(t,this,r)}}function Ou(e,t,r){const n=un(e,t,{message:r});if(n[0])throw n[0]}function Bu(e,t,r){const n=un(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function Du(e,t,r){const n=un(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function zo(e,t){return!un(e,t)[0]}function un(e,t,r={}){const n=qo(e,t,r),i=Hg(n);return i[0]?[new $u(i[0],function*(){for(const a of n)a[0]&&(yield a[0])}),void 0]:[void 0,i[1]]}function Vg(...e){const t=e[0].type==="type",r=e.map(i=>i.schema),n=Object.assign({},...r);return t?qn(n):Vn(n)}function ot(e,t){return new qe({type:e,schema:null,validator:t})}function qg(e,t){return new qe({...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 zg(e){return new qe({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 Gg(e){let t;return new qe({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 Jg(e,t){const{schema:r}=e,n={...r};for(const i of t)delete n[i];switch(e.type){case"type":return qn(n);default:return Vn(n)}}function Zg(e){const t=e instanceof qe,r=t?{...e.schema}:{...e};for(const n in r)r[n]=Fu(r[n]);return t&&e.type==="type"?qn(r):Vn(r)}function Kg(e,t){const{schema:r}=e,n={};for(const i of t)n[i]=r[i];switch(e.type){case"type":return qn(n);default:return Vn(n)}}function Qg(e,t){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),ot(e,t)}function Yg(){return ot("any",()=>!0)}function Xg(e){return new qe({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: ${Je(t)}`}})}function em(){return ot("bigint",e=>typeof e=="bigint")}function tm(){return ot("boolean",e=>typeof e=="boolean")}function rm(){return ot("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${Je(e)}`)}function nm(e){const t={},r=e.map(n=>Je(n)).join();for(const n of e)t[n]=n;return new qe({type:"enums",schema:t,validator(n){return e.includes(n)||`Expected one of \`${r}\`, but received: ${Je(n)}`}})}function im(){return ot("func",e=>typeof e=="function"||`Expected a function, but received: ${Je(e)}`)}function sm(e){return ot("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${Je(t)}`)}function om(){return ot("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${Je(e)}`)}function am(e){return new qe({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 cm(e){const t=Je(e),r=typeof e;return new qe({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(n){return n===e||`Expected the literal \`${t}\`, but received: ${Je(n)}`}})}function lm(e,t){return new qe({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: ${Je(r)}`}})}function Go(){return ot("never",()=>!1)}function um(e){return new qe({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function hm(){return ot("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${Je(e)}`)}function Vn(e){const t=e?Object.keys(e):[],r=Go();return new qe({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: ${Je(n)}`},coercer(n){return mt(n)?{...n}:n}})}function Fu(e){return new qe({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function dm(e,t){return new qe({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: ${Je(r)}`}})}function fm(){return ot("regexp",e=>e instanceof RegExp)}function pm(e){return new qe({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: ${Je(t)}`}})}function ju(){return ot("string",e=>typeof e=="string"||`Expected a string, but received: ${Je(e)}`)}function gm(e){const t=Go();return new qe({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],e[i]||t]}},validator(r){return Array.isArray(r)||`Expected an array, but received: ${Je(r)}`}})}function qn(e){const t=Object.keys(e);return new qe({type:"type",schema:e,*entries(r){if(mt(r))for(const n of t)yield[n,r[n],e[n]]},validator(r){return mt(r)||`Expected an object, but received: ${Je(r)}`},coercer(r){return mt(r)?{...r}:r}})}function mm(e){const t=e.map(r=>r.type).join(" | ");return new qe({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[...a]=qo(r,s,n),[l]=a;if(l[0])for(const[h]of a)h&&i.push(h);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${Je(r)}`,...i]}})}function Uu(){return ot("unknown",()=>!0)}function Jo(e,t,r){return new qe({...e,coercer:(n,i)=>zo(n,t)?e.coercer(r(n,i),i):e.coercer(n,i)})}function vm(e,t,r={}){return Jo(e,Uu(),n=>{const i=typeof t=="function"?t():t;if(n===void 0)return i;if(!r.strict&&Mc(n)&&Mc(i)){const s={...n};let a=!1;for(const l in i)s[l]===void 0&&(s[l]=i[l],a=!0);if(a)return s}return n})}function ym(e){return Jo(e,ju(),t=>t.trim())}function bm(e){return wr(e,"empty",t=>{const r=Hu(t);return r===0||`Expected an empty ${e.type} but received one with a size of \`${r}\``})}function Hu(e){return e instanceof Map||e instanceof Set?e.size:e.length}function wm(e,t,r={}){const{exclusive:n}=r;return wr(e,"max",i=>n?i<t:i<=t||`Expected a ${e.type} less than ${n?"":"or equal to "}${t} but received \`${i}\``)}function _m(e,t,r={}){const{exclusive:n}=r;return wr(e,"min",i=>n?i>t:i>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${i}\``)}function Em(e){return wr(e,"nonempty",t=>Hu(t)>0||`Expected a nonempty ${e.type} but received an empty one`)}function Sm(e,t){return wr(e,"pattern",r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`)}function Rm(e,t,r=t){const n=`Expected a ${e.type}`,i=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return wr(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:a}=s;return t<=a&&a<=r||`${n} with a size ${i} but received one with a size of \`${a}\``}else{const{length:a}=s;return t<=a&&a<=r||`${n} with a length ${i} but received one with a length of \`${a}\``}})}function wr(e,t,r){return new qe({...e,*refiner(n,i){yield*e.refiner(n,i);const s=r(n,i),a=Ro(s,i,e,n);for(const l of a)yield{...l,refinement:t}}})}const Mm=Object.freeze(Object.defineProperty({__proto__:null,Struct:qe,StructError:$u,any:Yg,array:Xg,assert:Ou,assign:Vg,bigint:em,boolean:tm,coerce:Jo,create:Bu,date:rm,defaulted:vm,define:ot,deprecated:qg,dynamic:zg,empty:bm,enums:nm,func:im,instance:sm,integer:om,intersection:am,is:zo,lazy:Gg,literal:cm,map:lm,mask:Du,max:wm,min:_m,never:Go,nonempty:Em,nullable:um,number:hm,object:Vn,omit:Jg,optional:Fu,partial:Zg,pattern:Sm,pick:Kg,record:dm,refine:wr,regexp:fm,set:pm,size:Rm,string:ju,struct:Qg,trimmed:ym,tuple:gm,type:qn,union:mm,unknown:Uu,validate:un},Symbol.toStringTag,{value:"Module"})),_r=vr(Mm);Object.defineProperty(et,"__esModule",{value:!0});et.assertExhaustive=et.assertStruct=et.assert=et.AssertionError=void 0;const km=_r;function Im(e){return typeof e=="object"&&e!==null&&"message"in e}function Cm(e){var t,r;return typeof((r=(t=e?.prototype)===null||t===void 0?void 0:t.constructor)===null||r===void 0?void 0:r.name)=="string"}function Am(e){const t=Im(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}function Wu(e,t){return Cm(e)?new e({message:t}):e({message:t})}class Zo extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}et.AssertionError=Zo;function xm(e,t="Assertion failed.",r=Zo){if(!e)throw t instanceof Error?t:Wu(r,t)}et.assert=xm;function Tm(e,t,r="Assertion failed",n=Zo){try{(0,km.assert)(e,t)}catch(i){throw Wu(n,`${r}: ${Am(i)}.`)}}et.assertStruct=Tm;function Nm(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}et.assertExhaustive=Nm;var zn={};Object.defineProperty(zn,"__esModule",{value:!0});zn.base64=void 0;const Pm=_r,Lm=et,$m=(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 a;s==="base64"?a=String.raw`[A-Za-z0-9+\/]`:((0,Lm.assert)(s==="base64url"),a=String.raw`[-_A-Za-z0-9]`);let l;return i?l=new RegExp(`^(?:${a}{4})*(?:${a}{3}=|${a}{2}==)?$`,"u"):l=new RegExp(`^(?:${a}{4})*(?:${a}{2,3}|${a}{3}=|${a}{2}==)?$`,"u"),(0,Pm.pattern)(e,l)};zn.base64=$m;var le={},Gn={};(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=_r,r=et;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(d){return(0,t.is)(d,e.HexStruct)}e.isHexString=n;function i(d){return(0,t.is)(d,e.StrictHexStruct)}e.isStrictHexString=i;function s(d){(0,r.assert)(n(d),"Value must be a hexadecimal string.")}e.assertIsHexString=s;function a(d){(0,r.assert)(i(d),'Value must be a hexadecimal string, starting with "0x".')}e.assertIsStrictHexString=a;function l(d){return d.startsWith("0x")?d:d.startsWith("0X")?`0x${d.substring(2)}`:`0x${d}`}e.add0x=l;function h(d){return d.startsWith("0x")||d.startsWith("0X")?d.substring(2):d}e.remove0x=h})(Gn);Object.defineProperty(le,"__esModule",{value:!0});le.createDataView=le.concatBytes=le.valueToBytes=le.stringToBytes=le.numberToBytes=le.signedBigIntToBytes=le.bigIntToBytes=le.hexToBytes=le.bytesToString=le.bytesToNumber=le.bytesToSignedBigInt=le.bytesToBigInt=le.bytesToHex=le.assertIsBytes=le.isBytes=void 0;const ut=et,Mo=Gn,kc=48,Ic=58,Cc=87;function Om(){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 Bm=Om();function Ko(e){return e instanceof Uint8Array}le.isBytes=Ko;function hn(e){(0,ut.assert)(Ko(e),"Value must be a Uint8Array.")}le.assertIsBytes=hn;function Vu(e){if(hn(e),e.length===0)return"0x";const t=Bm(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return(0,Mo.add0x)(r.join(""))}le.bytesToHex=Vu;function qu(e){hn(e);const t=Vu(e);return BigInt(t)}le.bytesToBigInt=qu;function Dm(e){hn(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(e.length*8,t)}le.bytesToSignedBigInt=Dm;function Fm(e){hn(e);const t=qu(e);return(0,ut.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)}le.bytesToNumber=Fm;function jm(e){return hn(e),new TextDecoder().decode(e)}le.bytesToString=jm;function as(e){var t;if(((t=e?.toLowerCase)===null||t===void 0?void 0:t.call(e))==="0x")return new Uint8Array;(0,Mo.assertIsHexString)(e);const r=(0,Mo.remove0x)(e).toLowerCase(),n=r.length%2===0?r:`0${r}`,i=new Uint8Array(n.length/2);for(let s=0;s<i.length;s++){const a=n.charCodeAt(s*2),l=n.charCodeAt(s*2+1),h=a-(a<Ic?kc:Cc),d=l-(l<Ic?kc:Cc);i[s]=h*16+d}return i}le.hexToBytes=as;function zu(e){(0,ut.assert)(typeof e=="bigint","Value must be a bigint."),(0,ut.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");const t=e.toString(16);return as(t)}le.bigIntToBytes=zu;function Um(e,t){(0,ut.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(t*8+-1))}function Hm(e,t){(0,ut.assert)(typeof e=="bigint","Value must be a bigint."),(0,ut.assert)(typeof t=="number","Byte length must be a number."),(0,ut.assert)(t>0,"Byte length must be greater than 0."),(0,ut.assert)(Um(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<n.length;i++)n[i]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return n.reverse()}le.signedBigIntToBytes=Hm;function Gu(e){(0,ut.assert)(typeof e=="number","Value must be a number."),(0,ut.assert)(e>=0,"Value must be a non-negative number."),(0,ut.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");const t=e.toString(16);return as(t)}le.numberToBytes=Gu;function Ju(e){return(0,ut.assert)(typeof e=="string","Value must be a string."),new TextEncoder().encode(e)}le.stringToBytes=Ju;function Zu(e){if(typeof e=="bigint")return zu(e);if(typeof e=="number")return Gu(e);if(typeof e=="string")return e.startsWith("0x")?as(e):Ju(e);if(Ko(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}le.valueToBytes=Zu;function Wm(e){const t=new Array(e.length);let r=0;for(let i=0;i<e.length;i++){const s=Zu(e[i]);t[i]=s,r+=s.length}const n=new Uint8Array(r);for(let i=0,s=0;i<t.length;i++)n.set(t[i],s),s+=t[i].length;return n}le.concatBytes=Wm;function Vm(e){if(typeof re<"u"&&e instanceof re){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}le.createDataView=Vm;var cs={};Object.defineProperty(cs,"__esModule",{value:!0});cs.ChecksumStruct=void 0;const Ac=_r,qm=zn;cs.ChecksumStruct=(0,Ac.size)((0,qm.base64)((0,Ac.string)(),{paddingRequired:!0}),44,44);var Nt={};Object.defineProperty(Nt,"__esModule",{value:!0});Nt.createHex=Nt.createBytes=Nt.createBigInt=Nt.createNumber=void 0;const Ve=_r,zm=et,Ku=le,ls=Gn,Qu=(0,Ve.union)([(0,Ve.number)(),(0,Ve.bigint)(),(0,Ve.string)(),ls.StrictHexStruct]),Gm=(0,Ve.coerce)((0,Ve.number)(),Qu,Number),Jm=(0,Ve.coerce)((0,Ve.bigint)(),Qu,BigInt);(0,Ve.union)([ls.StrictHexStruct,(0,Ve.instance)(Uint8Array)]);const Zm=(0,Ve.coerce)((0,Ve.instance)(Uint8Array),(0,Ve.union)([ls.StrictHexStruct]),Ku.hexToBytes),Km=(0,Ve.coerce)(ls.StrictHexStruct,(0,Ve.instance)(Uint8Array),Ku.bytesToHex);function Qm(e){try{const t=(0,Ve.create)(e,Gm);return(0,zm.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){throw t instanceof Ve.StructError?new Error(`Expected a number-like value, got "${e}".`):t}}Nt.createNumber=Qm;function Ym(e){try{return(0,Ve.create)(e,Jm)}catch(t){throw t instanceof Ve.StructError?new Error(`Expected a number-like value, got "${String(t.value)}".`):t}}Nt.createBigInt=Ym;function Xm(e){if(typeof e=="string"&&e.toLowerCase()==="0x")return new Uint8Array;try{return(0,Ve.create)(e,Zm)}catch(t){throw t instanceof Ve.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}Nt.createBytes=Xm;function ev(e){if(e instanceof Uint8Array&&e.length===0||typeof e=="string"&&e.toLowerCase()==="0x")return"0x";try{return(0,Ve.create)(e,Km)}catch(t){throw t instanceof Ve.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}Nt.createHex=ev;var tn={},Yu=z&&z.__classPrivateFieldSet||function(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},nt=z&&z.__classPrivateFieldGet||function(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)},yt,kt;Object.defineProperty(tn,"__esModule",{value:!0});tn.FrozenSet=tn.FrozenMap=void 0;class Qo{constructor(t){yt.set(this,void 0),Yu(this,yt,new Map(t),"f"),Object.freeze(this)}get size(){return nt(this,yt,"f").size}[(yt=new WeakMap,Symbol.iterator)](){return nt(this,yt,"f")[Symbol.iterator]()}entries(){return nt(this,yt,"f").entries()}forEach(t,r){return nt(this,yt,"f").forEach((n,i,s)=>t.call(r,n,i,this))}get(t){return nt(this,yt,"f").get(t)}has(t){return nt(this,yt,"f").has(t)}keys(){return nt(this,yt,"f").keys()}values(){return nt(this,yt,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([t,r])=>`${String(t)} => ${String(r)}`).join(", ")} `:""}}`}}tn.FrozenMap=Qo;class Yo{constructor(t){kt.set(this,void 0),Yu(this,kt,new Set(t),"f"),Object.freeze(this)}get size(){return nt(this,kt,"f").size}[(kt=new WeakMap,Symbol.iterator)](){return nt(this,kt,"f")[Symbol.iterator]()}entries(){return nt(this,kt,"f").entries()}forEach(t,r){return nt(this,kt,"f").forEach((n,i,s)=>t.call(r,n,i,this))}has(t){return nt(this,kt,"f").has(t)}keys(){return nt(this,kt,"f").keys()}values(){return nt(this,kt,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(t=>String(t)).join(", ")} `:""}}`}}tn.FrozenSet=Yo;Object.freeze(Qo);Object.freeze(Qo.prototype);Object.freeze(Yo);Object.freeze(Yo.prototype);var Xu={};Object.defineProperty(Xu,"__esModule",{value:!0});var eh={};(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=_r,r=et,n=()=>(0,t.define)("finite number",P=>(0,t.is)(P,(0,t.number)())&&Number.isFinite(P));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",(P,F)=>{function J(G,V){const Q=[...V.validator(G,F)];return Q.length>0?Q:!0}try{const G=J(P,e.UnsafeJsonStruct);return G!==!0?G:J(JSON.parse(JSON.stringify(P)),e.UnsafeJsonStruct)}catch(G){return G instanceof RangeError?"Circular reference detected":!1}});function i(P){return(0,t.is)(P,e.JsonStruct)}e.isValidJson=i;function s(P){(0,r.assertStruct)(P,e.JsonStruct,"Invalid JSON value");const F=JSON.stringify(P);return new TextEncoder().encode(F).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 a(P){return(0,t.is)(P,e.JsonRpcNotificationStruct)}e.isJsonRpcNotification=a;function l(P,F){(0,r.assertStruct)(P,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",F)}e.assertIsJsonRpcNotification=l;function h(P){return(0,t.is)(P,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=h;function d(P,F){(0,r.assertStruct)(P,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",F)}e.assertIsJsonRpcRequest=d,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 f(P){return(0,t.is)(P,e.PendingJsonRpcResponseStruct)}e.isPendingJsonRpcResponse=f;function R(P,F){(0,r.assertStruct)(P,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",F)}e.assertIsPendingJsonRpcResponse=R;function _(P){return(0,t.is)(P,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=_;function C(P,F){(0,r.assertStruct)(P,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",F)}e.assertIsJsonRpcResponse=C;function L(P){return(0,t.is)(P,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=L;function N(P,F){(0,r.assertStruct)(P,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",F)}e.assertIsJsonRpcSuccess=N;function $(P){return(0,t.is)(P,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=$;function M(P,F){(0,r.assertStruct)(P,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",F)}e.assertIsJsonRpcFailure=M;function x(P){return(0,t.is)(P,e.JsonRpcErrorStruct)}e.isJsonRpcError=x;function T(P,F){(0,r.assertStruct)(P,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",F)}e.assertIsJsonRpcError=T;function B(P){const{permitEmptyString:F,permitFractions:J,permitNull:G}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},P);return ie=>!!(typeof ie=="number"&&(J||Number.isInteger(ie))||typeof ie=="string"&&(F||ie.length>0)||G&&ie===null)}e.getJsonRpcIdValidator=B})(eh);var th={};Object.defineProperty(th,"__esModule",{value:!0});var rn={},tv=z&&z.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(rn,"__esModule",{value:!0});rn.createModuleLogger=rn.createProjectLogger=void 0;const rv=tv(xh),nv=(0,rv.default)("metamask");function iv(e){return nv.extend(e)}rn.createProjectLogger=iv;function sv(e,t){return e.extend(t)}rn.createModuleLogger=sv;var rh={};(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(d){return Array.isArray(d)&&d.length>0}e.isNonEmptyArray=t;function r(d){return d==null}e.isNullOrUndefined=r;function n(d){return!!d&&typeof d=="object"&&!Array.isArray(d)}e.isObject=n;const i=(d,f)=>Object.hasOwnProperty.call(d,f);e.hasProperty=i,function(d){d[d.Null=4]="Null",d[d.Comma=1]="Comma",d[d.Wrapper=1]="Wrapper",d[d.True=4]="True",d[d.False=5]="False",d[d.Quote=1]="Quote",d[d.Colon=1]="Colon",d[d.Date=24]="Date"}(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function s(d){if(typeof d!="object"||d===null)return!1;try{let f=d;for(;Object.getPrototypeOf(f)!==null;)f=Object.getPrototypeOf(f);return Object.getPrototypeOf(d)===f}catch{return!1}}e.isPlainObject=s;function a(d){return d.charCodeAt(0)<=127}e.isASCII=a;function l(d){var f;return d.split("").reduce((_,C)=>a(C)?_+1:_+2,0)+((f=d.match(e.ESCAPE_CHARACTERS_REGEXP))!==null&&f!==void 0?f:[]).length}e.calculateStringSize=l;function h(d){return d.toString().length}e.calculateNumberSize=h})(rh);var Pt={};Object.defineProperty(Pt,"__esModule",{value:!0});Pt.hexToBigInt=Pt.hexToNumber=Pt.bigIntToHex=Pt.numberToHex=void 0;const Gr=et,_n=Gn,ov=e=>((0,Gr.assert)(typeof e=="number","Value must be a number."),(0,Gr.assert)(e>=0,"Value must be a non-negative number."),(0,Gr.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,_n.add0x)(e.toString(16)));Pt.numberToHex=ov;const av=e=>((0,Gr.assert)(typeof e=="bigint","Value must be a bigint."),(0,Gr.assert)(e>=0,"Value must be a non-negative bigint."),(0,_n.add0x)(e.toString(16)));Pt.bigIntToHex=av;const cv=e=>{(0,_n.assertIsHexString)(e);const t=parseInt(e,16);return(0,Gr.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};Pt.hexToNumber=cv;const lv=e=>((0,_n.assertIsHexString)(e),BigInt((0,_n.add0x)(e)));Pt.hexToBigInt=lv;var nh={};Object.defineProperty(nh,"__esModule",{value:!0});var ih={};(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,a)=>{if(!t(s))throw new Error(`"${a}" must be a non-negative integer. Received: "${s}".`)};function n(s,a){return r(s,"count"),s*a}e.inMilliseconds=n;function i(s){return r(s,"timestamp"),Date.now()-s}e.timeSince=i})(ih);var sh={};Object.defineProperty(sh,"__esModule",{value:!0});var oh={},ko={exports:{}};const uv="2.0.0",ah=256,hv=Number.MAX_SAFE_INTEGER||9007199254740991,dv=16,fv=ah-6,pv=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var us={MAX_LENGTH:ah,MAX_SAFE_COMPONENT_LENGTH:dv,MAX_SAFE_BUILD_LENGTH:fv,MAX_SAFE_INTEGER:hv,RELEASE_TYPES:pv,SEMVER_SPEC_VERSION:uv,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},no={};const gv=typeof fe=="object"&&no&&no.NODE_DEBUG&&/\bsemver\b/i.test(no.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var hs=gv;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=us,s=hs;t=e.exports={};const a=t.re=[],l=t.safeRe=[],h=t.src=[],d=t.safeSrc=[],f=t.t={};let R=0;const _="[a-zA-Z0-9-]",C=[["\\s",1],["\\d",i],[_,n]],L=$=>{for(const[M,x]of C)$=$.split(`${M}*`).join(`${M}{0,${x}}`).split(`${M}+`).join(`${M}{1,${x}}`);return $},N=($,M,x)=>{const T=L(M),B=R++;s($,B,M),f[$]=B,h[B]=M,d[B]=T,a[B]=new RegExp(M,x?"g":void 0),l[B]=new RegExp(T,x?"g":void 0)};N("NUMERICIDENTIFIER","0|[1-9]\\d*"),N("NUMERICIDENTIFIERLOOSE","\\d+"),N("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${_}*`),N("MAINVERSION",`(${h[f.NUMERICIDENTIFIER]})\\.(${h[f.NUMERICIDENTIFIER]})\\.(${h[f.NUMERICIDENTIFIER]})`),N("MAINVERSIONLOOSE",`(${h[f.NUMERICIDENTIFIERLOOSE]})\\.(${h[f.NUMERICIDENTIFIERLOOSE]})\\.(${h[f.NUMERICIDENTIFIERLOOSE]})`),N("PRERELEASEIDENTIFIER",`(?:${h[f.NONNUMERICIDENTIFIER]}|${h[f.NUMERICIDENTIFIER]})`),N("PRERELEASEIDENTIFIERLOOSE",`(?:${h[f.NONNUMERICIDENTIFIER]}|${h[f.NUMERICIDENTIFIERLOOSE]})`),N("PRERELEASE",`(?:-(${h[f.PRERELEASEIDENTIFIER]}(?:\\.${h[f.PRERELEASEIDENTIFIER]})*))`),N("PRERELEASELOOSE",`(?:-?(${h[f.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${h[f.PRERELEASEIDENTIFIERLOOSE]})*))`),N("BUILDIDENTIFIER",`${_}+`),N("BUILD",`(?:\\+(${h[f.BUILDIDENTIFIER]}(?:\\.${h[f.BUILDIDENTIFIER]})*))`),N("FULLPLAIN",`v?${h[f.MAINVERSION]}${h[f.PRERELEASE]}?${h[f.BUILD]}?`),N("FULL",`^${h[f.FULLPLAIN]}$`),N("LOOSEPLAIN",`[v=\\s]*${h[f.MAINVERSIONLOOSE]}${h[f.PRERELEASELOOSE]}?${h[f.BUILD]}?`),N("LOOSE",`^${h[f.LOOSEPLAIN]}$`),N("GTLT","((?:<|>)?=?)"),N("XRANGEIDENTIFIERLOOSE",`${h[f.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),N("XRANGEIDENTIFIER",`${h[f.NUMERICIDENTIFIER]}|x|X|\\*`),N("XRANGEPLAIN",`[v=\\s]*(${h[f.XRANGEIDENTIFIER]})(?:\\.(${h[f.XRANGEIDENTIFIER]})(?:\\.(${h[f.XRANGEIDENTIFIER]})(?:${h[f.PRERELEASE]})?${h[f.BUILD]}?)?)?`),N("XRANGEPLAINLOOSE",`[v=\\s]*(${h[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${h[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${h[f.XRANGEIDENTIFIERLOOSE]})(?:${h[f.PRERELEASELOOSE]})?${h[f.BUILD]}?)?)?`),N("XRANGE",`^${h[f.GTLT]}\\s*${h[f.XRANGEPLAIN]}$`),N("XRANGELOOSE",`^${h[f.GTLT]}\\s*${h[f.XRANGEPLAINLOOSE]}$`),N("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),N("COERCE",`${h[f.COERCEPLAIN]}(?:$|[^\\d])`),N("COERCEFULL",h[f.COERCEPLAIN]+`(?:${h[f.PRERELEASE]})?(?:${h[f.BUILD]})?(?:$|[^\\d])`),N("COERCERTL",h[f.COERCE],!0),N("COERCERTLFULL",h[f.COERCEFULL],!0),N("LONETILDE","(?:~>?)"),N("TILDETRIM",`(\\s*)${h[f.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",N("TILDE",`^${h[f.LONETILDE]}${h[f.XRANGEPLAIN]}$`),N("TILDELOOSE",`^${h[f.LONETILDE]}${h[f.XRANGEPLAINLOOSE]}$`),N("LONECARET","(?:\\^)"),N("CARETTRIM",`(\\s*)${h[f.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",N("CARET",`^${h[f.LONECARET]}${h[f.XRANGEPLAIN]}$`),N("CARETLOOSE",`^${h[f.LONECARET]}${h[f.XRANGEPLAINLOOSE]}$`),N("COMPARATORLOOSE",`^${h[f.GTLT]}\\s*(${h[f.LOOSEPLAIN]})$|^$`),N("COMPARATOR",`^${h[f.GTLT]}\\s*(${h[f.FULLPLAIN]})$|^$`),N("COMPARATORTRIM",`(\\s*)${h[f.GTLT]}\\s*(${h[f.LOOSEPLAIN]}|${h[f.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",N("HYPHENRANGE",`^\\s*(${h[f.XRANGEPLAIN]})\\s+-\\s+(${h[f.XRANGEPLAIN]})\\s*$`),N("HYPHENRANGELOOSE",`^\\s*(${h[f.XRANGEPLAINLOOSE]})\\s+-\\s+(${h[f.XRANGEPLAINLOOSE]})\\s*$`),N("STAR","(<|>)?=?\\s*\\*"),N("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),N("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(ko,ko.exports);var Jn=ko.exports;const mv=Object.freeze({loose:!0}),vv=Object.freeze({}),yv=e=>e?typeof e!="object"?mv:e:vv;var Xo=yv;const xc=/^[0-9]+$/,ch=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:e<t?-1:1;const r=xc.test(e),n=xc.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},bv=(e,t)=>ch(t,e);var lh={compareIdentifiers:ch,rcompareIdentifiers:bv};const oi=hs,{MAX_LENGTH:Tc,MAX_SAFE_INTEGER:ai}=us,{safeRe:ci,t:li}=Jn,wv=Xo,{compareIdentifiers:io}=lh;let _v=class It{constructor(t,r){if(r=wv(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>Tc)throw new TypeError(`version is longer than ${Tc} characters`);oi("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=t.trim().match(r.loose?ci[li.LOOSE]:ci[li.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>ai||this.major<0)throw new TypeError("Invalid major version");if(this.minor>ai||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>ai||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<ai)return s}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(oi("SemVer.compare",this.version,this.options,t),!(t instanceof It)){if(typeof t=="string"&&t===this.version)return 0;t=new It(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof It||(t=new It(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:this.patch>t.patch?1:0}comparePre(t){if(t instanceof It||(t=new It(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{const n=this.prerelease[r],i=t.prerelease[r];if(oi("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return io(n,i)}while(++r)}compareBuild(t){t instanceof It||(t=new It(t,this.options));let r=0;do{const n=this.build[r],i=t.build[r];if(oi("build compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return io(n,i)}while(++r)}inc(t,r,n){if(t.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){const i=`-${r}`.match(this.options.loose?ci[li.PRERELEASELOOSE]:ci[li.PRERELEASE]);if(!i||i[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const i=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let s=[r,i];n===!1&&(s=[r]),io(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 it=_v;const Nc=it,Ev=(e,t,r=!1)=>{if(e instanceof Nc)return e;try{return new Nc(e,t)}catch(n){if(!r)return null;throw n}};var dn=Ev;const Sv=dn,Rv=(e,t)=>{const r=Sv(e,t);return r?r.version:null};var Mv=Rv;const kv=dn,Iv=(e,t)=>{const r=kv(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};var Cv=Iv;const Pc=it,Av=(e,t,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new Pc(e instanceof Pc?e.version:e,r).inc(t,n,i).version}catch{return null}};var xv=Av;const Lc=dn,Tv=(e,t)=>{const r=Lc(e,null,!0),n=Lc(t,null,!0),i=r.compare(n);if(i===0)return null;const s=i>0,a=s?r:n,l=s?n:r,h=!!a.prerelease.length;if(!!l.prerelease.length&&!h){if(!l.patch&&!l.minor)return"major";if(l.compareMain(a)===0)return l.minor&&!l.patch?"minor":"patch"}const f=h?"pre":"";return r.major!==n.major?f+"major":r.minor!==n.minor?f+"minor":r.patch!==n.patch?f+"patch":"prerelease"};var Nv=Tv;const Pv=it,Lv=(e,t)=>new Pv(e,t).major;var $v=Lv;const Ov=it,Bv=(e,t)=>new Ov(e,t).minor;var Dv=Bv;const Fv=it,jv=(e,t)=>new Fv(e,t).patch;var Uv=jv;const Hv=dn,Wv=(e,t)=>{const r=Hv(e,t);return r&&r.prerelease.length?r.prerelease:null};var Vv=Wv;const $c=it,qv=(e,t,r)=>new $c(e,r).compare(new $c(t,r));var Et=qv;const zv=Et,Gv=(e,t,r)=>zv(t,e,r);var Jv=Gv;const Zv=Et,Kv=(e,t)=>Zv(e,t,!0);var Qv=Kv;const Oc=it,Yv=(e,t,r)=>{const n=new Oc(e,r),i=new Oc(t,r);return n.compare(i)||n.compareBuild(i)};var ea=Yv;const Xv=ea,ey=(e,t)=>e.sort((r,n)=>Xv(r,n,t));var ty=ey;const ry=ea,ny=(e,t)=>e.sort((r,n)=>ry(n,r,t));var iy=ny;const sy=Et,oy=(e,t,r)=>sy(e,t,r)>0;var ds=oy;const ay=Et,cy=(e,t,r)=>ay(e,t,r)<0;var ta=cy;const ly=Et,uy=(e,t,r)=>ly(e,t,r)===0;var uh=uy;const hy=Et,dy=(e,t,r)=>hy(e,t,r)!==0;var hh=dy;const fy=Et,py=(e,t,r)=>fy(e,t,r)>=0;var ra=py;const gy=Et,my=(e,t,r)=>gy(e,t,r)<=0;var na=my;const vy=uh,yy=hh,by=ds,wy=ra,_y=ta,Ey=na,Sy=(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 vy(e,r,n);case"!=":return yy(e,r,n);case">":return by(e,r,n);case">=":return wy(e,r,n);case"<":return _y(e,r,n);case"<=":return Ey(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};var dh=Sy;const Ry=it,My=dn,{safeRe:ui,t:hi}=Jn,ky=(e,t)=>{if(e instanceof Ry)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(t.includePrerelease?ui[hi.COERCEFULL]:ui[hi.COERCE]);else{const h=t.includePrerelease?ui[hi.COERCERTLFULL]:ui[hi.COERCERTL];let d;for(;(d=h.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||d.index+d[0].length!==r.index+r[0].length)&&(r=d),h.lastIndex=d.index+d[1].length+d[2].length;h.lastIndex=-1}if(r===null)return null;const n=r[2],i=r[3]||"0",s=r[4]||"0",a=t.includePrerelease&&r[5]?`-${r[5]}`:"",l=t.includePrerelease&&r[6]?`+${r[6]}`:"";return My(`${n}.${i}.${s}${a}${l}`,t)};var Iy=ky;class Cy{constructor(){this.max=1e3,this.map=new Map}get(t){const r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){const i=this.map.keys().next().value;this.delete(i)}this.map.set(t,r)}return this}}var Ay=Cy,so,Bc;function St(){if(Bc)return so;Bc=1;const e=/\s+/g;class t{constructor(u,p){if(p=i(p),u instanceof t)return u.loose===!!p.loose&&u.includePrerelease===!!p.includePrerelease?u:new t(u.raw,p);if(u instanceof s)return this.raw=u.value,this.set=[[u]],this.formatted=void 0,this;if(this.options=p,this.loose=!!p.loose,this.includePrerelease=!!p.includePrerelease,this.raw=u.trim().replace(e," "),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(v=>!N(v[0])),this.set.length===0)this.set=[g];else if(this.set.length>1){for(const v of this.set)if(v.length===1&&$(v[0])){this.set=[v];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let u=0;u<this.set.length;u++){u>0&&(this.formatted+="||");const p=this.set[u];for(let g=0;g<p.length;g++)g>0&&(this.formatted+=" "),this.formatted+=p[g].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(u){const g=((this.options.includePrerelease&&C)|(this.options.loose&&L))+":"+u,v=n.get(g);if(v)return v;const E=this.options.loose,I=E?h[d.HYPHENRANGELOOSE]:h[d.HYPHENRANGE];u=u.replace(I,oe(this.options.includePrerelease)),a("hyphen replace",u),u=u.replace(h[d.COMPARATORTRIM],f),a("comparator trim",u),u=u.replace(h[d.TILDETRIM],R),a("tilde trim",u),u=u.replace(h[d.CARETTRIM],_),a("caret trim",u);let m=u.split(" ").map(U=>x(U,this.options)).join(" ").split(/\s+/).map(U=>Q(U,this.options));E&&(m=m.filter(U=>(a("loose invalid filter",U,this.options),!!U.match(h[d.COMPARATORLOOSE])))),a("range list",m);const c=new Map,y=m.map(U=>new s(U,this.options));for(const U of y){if(N(U))return[U];c.set(U.value,U)}c.size>1&&c.has("")&&c.delete("");const W=[...c.values()];return n.set(g,W),W}intersects(u,p){if(!(u instanceof t))throw new TypeError("a Range is required");return this.set.some(g=>M(g,p)&&u.set.some(v=>M(v,p)&&g.every(E=>v.every(I=>E.intersects(I,p)))))}test(u){if(!u)return!1;if(typeof u=="string")try{u=new l(u,this.options)}catch{return!1}for(let p=0;p<this.set.length;p++)if(S(this.set[p],u,this.options))return!0;return!1}}so=t;const r=Ay,n=new r,i=Xo,s=fs(),a=hs,l=it,{safeRe:h,t:d,comparatorTrimReplace:f,tildeTrimReplace:R,caretTrimReplace:_}=Jn,{FLAG_INCLUDE_PRERELEASE:C,FLAG_LOOSE:L}=us,N=o=>o.value==="<0.0.0-0",$=o=>o.value==="",M=(o,u)=>{let p=!0;const g=o.slice();let v=g.pop();for(;p&&g.length;)p=g.every(E=>v.intersects(E,u)),v=g.pop();return p},x=(o,u)=>(o=o.replace(h[d.BUILD],""),a("comp",o,u),o=F(o,u),a("caret",o),o=B(o,u),a("tildes",o),o=G(o,u),a("xrange",o),o=ie(o,u),a("stars",o),o),T=o=>!o||o.toLowerCase()==="x"||o==="*",B=(o,u)=>o.trim().split(/\s+/).map(p=>P(p,u)).join(" "),P=(o,u)=>{const p=u.loose?h[d.TILDELOOSE]:h[d.TILDE];return o.replace(p,(g,v,E,I,m)=>{a("tilde",o,g,v,E,I,m);let c;return T(v)?c="":T(E)?c=`>=${v}.0.0 <${+v+1}.0.0-0`:T(I)?c=`>=${v}.${E}.0 <${v}.${+E+1}.0-0`:m?(a("replaceTilde pr",m),c=`>=${v}.${E}.${I}-${m} <${v}.${+E+1}.0-0`):c=`>=${v}.${E}.${I} <${v}.${+E+1}.0-0`,a("tilde return",c),c})},F=(o,u)=>o.trim().split(/\s+/).map(p=>J(p,u)).join(" "),J=(o,u)=>{a("caret",o,u);const p=u.loose?h[d.CARETLOOSE]:h[d.CARET],g=u.includePrerelease?"-0":"";return o.replace(p,(v,E,I,m,c)=>{a("caret",o,v,E,I,m,c);let y;return T(E)?y="":T(I)?y=`>=${E}.0.0${g} <${+E+1}.0.0-0`:T(m)?E==="0"?y=`>=${E}.${I}.0${g} <${E}.${+I+1}.0-0`:y=`>=${E}.${I}.0${g} <${+E+1}.0.0-0`:c?(a("replaceCaret pr",c),E==="0"?I==="0"?y=`>=${E}.${I}.${m}-${c} <${E}.${I}.${+m+1}-0`:y=`>=${E}.${I}.${m}-${c} <${E}.${+I+1}.0-0`:y=`>=${E}.${I}.${m}-${c} <${+E+1}.0.0-0`):(a("no pr"),E==="0"?I==="0"?y=`>=${E}.${I}.${m}${g} <${E}.${I}.${+m+1}-0`:y=`>=${E}.${I}.${m}${g} <${E}.${+I+1}.0-0`:y=`>=${E}.${I}.${m} <${+E+1}.0.0-0`),a("caret return",y),y})},G=(o,u)=>(a("replaceXRanges",o,u),o.split(/\s+/).map(p=>V(p,u)).join(" ")),V=(o,u)=>{o=o.trim();const p=u.loose?h[d.XRANGELOOSE]:h[d.XRANGE];return o.replace(p,(g,v,E,I,m,c)=>{a("xRange",o,g,v,E,I,m,c);const y=T(E),W=y||T(I),U=W||T(m),k=U;return v==="="&&k&&(v=""),c=u.includePrerelease?"-0":"",y?v===">"||v==="<"?g="<0.0.0-0":g="*":v&&k?(W&&(I=0),m=0,v===">"?(v=">=",W?(E=+E+1,I=0,m=0):(I=+I+1,m=0)):v==="<="&&(v="<",W?E=+E+1:I=+I+1),v==="<"&&(c="-0"),g=`${v+E}.${I}.${m}${c}`):W?g=`>=${E}.0.0${c} <${+E+1}.0.0-0`:U&&(g=`>=${E}.${I}.0${c} <${E}.${+I+1}.0-0`),a("xRange return",g),g})},ie=(o,u)=>(a("replaceStars",o,u),o.trim().replace(h[d.STAR],"")),Q=(o,u)=>(a("replaceGTE0",o,u),o.trim().replace(h[u.includePrerelease?d.GTE0PRE:d.GTE0],"")),oe=o=>(u,p,g,v,E,I,m,c,y,W,U,k)=>(T(g)?p="":T(v)?p=`>=${g}.0.0${o?"-0":""}`:T(E)?p=`>=${g}.${v}.0${o?"-0":""}`:I?p=`>=${p}`:p=`>=${p}${o?"-0":""}`,T(y)?c="":T(W)?c=`<${+y+1}.0.0-0`:T(U)?c=`<${y}.${+W+1}.0-0`:k?c=`<=${y}.${W}.${U}-${k}`:o?c=`<${y}.${W}.${+U+1}-0`:c=`<=${c}`,`${p} ${c}`.trim()),S=(o,u,p)=>{for(let g=0;g<o.length;g++)if(!o[g].test(u))return!1;if(u.prerelease.length&&!p.includePrerelease){for(let g=0;g<o.length;g++)if(a(o[g].semver),o[g].semver!==s.ANY&&o[g].semver.prerelease.length>0){const v=o[g].semver;if(v.major===u.major&&v.minor===u.minor&&v.patch===u.patch)return!0}return!1}return!0};return so}var oo,Dc;function fs(){if(Dc)return oo;Dc=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(f,R){if(R=r(R),f instanceof t){if(f.loose===!!R.loose)return f;f=f.value}f=f.trim().split(/\s+/).join(" "),a("comparator",f,R),this.options=R,this.loose=!!R.loose,this.parse(f),this.semver===e?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}parse(f){const R=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],_=f.match(R);if(!_)throw new TypeError(`Invalid comparator: ${f}`);this.operator=_[1]!==void 0?_[1]:"",this.operator==="="&&(this.operator=""),_[2]?this.semver=new l(_[2],this.options.loose):this.semver=e}toString(){return this.value}test(f){if(a("Comparator.test",f,this.options.loose),this.semver===e||f===e)return!0;if(typeof f=="string")try{f=new l(f,this.options)}catch{return!1}return s(f,this.operator,this.semver,this.options)}intersects(f,R){if(!(f instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new h(f.value,R).test(this.value):f.operator===""?f.value===""?!0:new h(this.value,R).test(f.semver):(R=r(R),R.includePrerelease&&(this.value==="<0.0.0-0"||f.value==="<0.0.0-0")||!R.includePrerelease&&(this.value.startsWith("<0.0.0")||f.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&f.operator.startsWith(">")||this.operator.startsWith("<")&&f.operator.startsWith("<")||this.semver.version===f.semver.version&&this.operator.includes("=")&&f.operator.includes("=")||s(this.semver,"<",f.semver,R)&&this.operator.startsWith(">")&&f.operator.startsWith("<")||s(this.semver,">",f.semver,R)&&this.operator.startsWith("<")&&f.operator.startsWith(">")))}}oo=t;const r=Xo,{safeRe:n,t:i}=Jn,s=dh,a=hs,l=it,h=St();return oo}const xy=St(),Ty=(e,t,r)=>{try{t=new xy(t,r)}catch{return!1}return t.test(e)};var ps=Ty;const Ny=St(),Py=(e,t)=>new Ny(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var Ly=Py;const $y=it,Oy=St(),By=(e,t,r)=>{let n=null,i=null,s=null;try{s=new Oy(t,r)}catch{return null}return e.forEach(a=>{s.test(a)&&(!n||i.compare(a)===-1)&&(n=a,i=new $y(n,r))}),n};var Dy=By;const Fy=it,jy=St(),Uy=(e,t,r)=>{let n=null,i=null,s=null;try{s=new jy(t,r)}catch{return null}return e.forEach(a=>{s.test(a)&&(!n||i.compare(a)===1)&&(n=a,i=new Fy(n,r))}),n};var Hy=Uy;const ao=it,Wy=St(),Fc=ds,Vy=(e,t)=>{e=new Wy(e,t);let r=new ao("0.0.0");if(e.test(r)||(r=new ao("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n<e.set.length;++n){const i=e.set[n];let s=null;i.forEach(a=>{const l=new ao(a.semver.version);switch(a.operator){case">":l.prerelease.length===0?l.patch++:l.prerelease.push(0),l.raw=l.format();case"":case">=":(!s||Fc(l,s))&&(s=l);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),s&&(!r||Fc(r,s))&&(r=s)}return r&&e.test(r)?r:null};var qy=Vy;const zy=St(),Gy=(e,t)=>{try{return new zy(e,t).range||"*"}catch{return null}};var Jy=Gy;const Zy=it,fh=fs(),{ANY:Ky}=fh,Qy=St(),Yy=ps,jc=ds,Uc=ta,Xy=na,eb=ra,tb=(e,t,r,n)=>{e=new Zy(e,n),t=new Qy(t,n);let i,s,a,l,h;switch(r){case">":i=jc,s=Xy,a=Uc,l=">",h=">=";break;case"<":i=Uc,s=eb,a=jc,l="<",h="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Yy(e,t,n))return!1;for(let d=0;d<t.set.length;++d){const f=t.set[d];let R=null,_=null;if(f.forEach(C=>{C.semver===Ky&&(C=new fh(">=0.0.0")),R=R||C,_=_||C,i(C.semver,R.semver,n)?R=C:a(C.semver,_.semver,n)&&(_=C)}),R.operator===l||R.operator===h||(!_.operator||_.operator===l)&&s(e,_.semver))return!1;if(_.operator===h&&a(e,_.semver))return!1}return!0};var ia=tb;const rb=ia,nb=(e,t,r)=>rb(e,t,">",r);var ib=nb;const sb=ia,ob=(e,t,r)=>sb(e,t,"<",r);var ab=ob;const Hc=St(),cb=(e,t,r)=>(e=new Hc(e,r),t=new Hc(t,r),e.intersects(t,r));var lb=cb;const ub=ps,hb=Et;var db=(e,t,r)=>{const n=[];let i=null,s=null;const a=e.sort((f,R)=>hb(f,R,r));for(const f of a)ub(f,t,r)?(s=f,i||(i=f)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);const l=[];for(const[f,R]of n)f===R?l.push(f):!R&&f===a[0]?l.push("*"):R?f===a[0]?l.push(`<=${R}`):l.push(`${f} - ${R}`):l.push(`>=${f}`);const h=l.join(" || "),d=typeof t.raw=="string"?t.raw:String(t);return h.length<d.length?h:t};const Wc=St(),sa=fs(),{ANY:co}=sa,pn=ps,oa=Et,fb=(e,t,r={})=>{if(e===t)return!0;e=new Wc(e,r),t=new Wc(t,r);let n=!1;e:for(const i of e.set){for(const s of t.set){const a=gb(i,s,r);if(n=n||a!==null,a)continue e}if(n)return!1}return!0},pb=[new sa(">=0.0.0-0")],Vc=[new sa(">=0.0.0")],gb=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===co){if(t.length===1&&t[0].semver===co)return!0;r.includePrerelease?e=pb:e=Vc}if(t.length===1&&t[0].semver===co){if(r.includePrerelease)return!0;t=Vc}const n=new Set;let i,s;for(const C of e)C.operator===">"||C.operator===">="?i=qc(i,C,r):C.operator==="<"||C.operator==="<="?s=zc(s,C,r):n.add(C.semver);if(n.size>1)return null;let a;if(i&&s){if(a=oa(i.semver,s.semver,r),a>0)return null;if(a===0&&(i.operator!==">="||s.operator!=="<="))return null}for(const C of n){if(i&&!pn(C,String(i),r)||s&&!pn(C,String(s),r))return null;for(const L of t)if(!pn(C,String(L),r))return!1;return!0}let l,h,d,f,R=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,_=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;R&&R.prerelease.length===1&&s.operator==="<"&&R.prerelease[0]===0&&(R=!1);for(const C of t){if(f=f||C.operator===">"||C.operator===">=",d=d||C.operator==="<"||C.operator==="<=",i){if(_&&C.semver.prerelease&&C.semver.prerelease.length&&C.semver.major===_.major&&C.semver.minor===_.minor&&C.semver.patch===_.patch&&(_=!1),C.operator===">"||C.operator===">="){if(l=qc(i,C,r),l===C&&l!==i)return!1}else if(i.operator===">="&&!pn(i.semver,String(C),r))return!1}if(s){if(R&&C.semver.prerelease&&C.semver.prerelease.length&&C.semver.major===R.major&&C.semver.minor===R.minor&&C.semver.patch===R.patch&&(R=!1),C.operator==="<"||C.operator==="<="){if(h=zc(s,C,r),h===C&&h!==s)return!1}else if(s.operator==="<="&&!pn(s.semver,String(C),r))return!1}if(!C.operator&&(s||i)&&a!==0)return!1}return!(i&&d&&!s&&a!==0||s&&f&&!i&&a!==0||_||R)},qc=(e,t,r)=>{if(!e)return t;const n=oa(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},zc=(e,t,r)=>{if(!e)return t;const n=oa(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};var mb=fb;const lo=Jn,Gc=us,vb=it,Jc=lh,yb=dn,bb=Mv,wb=Cv,_b=xv,Eb=Nv,Sb=$v,Rb=Dv,Mb=Uv,kb=Vv,Ib=Et,Cb=Jv,Ab=Qv,xb=ea,Tb=ty,Nb=iy,Pb=ds,Lb=ta,$b=uh,Ob=hh,Bb=ra,Db=na,Fb=dh,jb=Iy,Ub=fs(),Hb=St(),Wb=ps,Vb=Ly,qb=Dy,zb=Hy,Gb=qy,Jb=Jy,Zb=ia,Kb=ib,Qb=ab,Yb=lb,Xb=db,ew=mb;var tw={parse:yb,valid:bb,clean:wb,inc:_b,diff:Eb,major:Sb,minor:Rb,patch:Mb,prerelease:kb,compare:Ib,rcompare:Cb,compareLoose:Ab,compareBuild:xb,sort:Tb,rsort:Nb,gt:Pb,lt:Lb,eq:$b,neq:Ob,gte:Bb,lte:Db,cmp:Fb,coerce:jb,Comparator:Ub,Range:Hb,satisfies:Wb,toComparators:Vb,maxSatisfying:qb,minSatisfying:zb,minVersion:Gb,validRange:Jb,outside:Zb,gtr:Kb,ltr:Qb,intersects:Yb,simplifyRange:Xb,subset:ew,SemVer:vb,re:lo.re,src:lo.src,tokens:lo.t,SEMVER_SPEC_VERSION:Gc.SEMVER_SPEC_VERSION,RELEASE_TYPES:Gc.RELEASE_TYPES,compareIdentifiers:Jc.compareIdentifiers,rcompareIdentifiers:Jc.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=tw,r=_r,n=et;e.VersionStruct=(0,r.refine)((0,r.string)(),"Version",R=>(0,t.valid)(R)===null?`Expected SemVer version, got "${R}"`:!0),e.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",R=>(0,t.validRange)(R)===null?`Expected SemVer range, got "${R}"`:!0);function i(R){return(0,r.is)(R,e.VersionStruct)}e.isValidSemVerVersion=i;function s(R){return(0,r.is)(R,e.VersionRangeStruct)}e.isValidSemVerRange=s;function a(R){(0,n.assertStruct)(R,e.VersionStruct)}e.assertIsSemVerVersion=a;function l(R){(0,n.assertStruct)(R,e.VersionRangeStruct)}e.assertIsSemVerRange=l;function h(R,_){return(0,t.gt)(R,_)}e.gtVersion=h;function d(R,_){return(0,t.gtr)(R,_)}e.gtRange=d;function f(R,_){return(0,t.satisfies)(R,_,{includePrerelease:!0})}e.satisfiesVersionRange=f})(oh);(function(e){var t=z&&z.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var l=Object.getOwnPropertyDescriptor(i,s);(!l||("get"in l?!i.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,l)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=z&&z.__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(et,e),r(zn,e),r(le,e),r(cs,e),r(Nt,e),r(tn,e),r(Xu,e),r(Gn,e),r(eh,e),r(th,e),r(rn,e),r(rh,e),r(Pt,e),r(nh,e),r(ih,e),r(sh,e),r(oh,e)})(Lu);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createModuleLogger=e.projectLogger=void 0;const t=Lu;Object.defineProperty(e,"createModuleLogger",{enumerable:!0,get:function(){return t.createModuleLogger}}),e.projectLogger=(0,t.createProjectLogger)("eth-block-tracker")})(Pu);var ph=z&&z.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(os,"__esModule",{value:!0});os.PollingBlockTracker=void 0;const rw=ph(Vo),nw=ph(Ng),iw=Hn,Zc=Pu,Kc=(0,Zc.createModuleLogger)(Zc.projectLogger,"polling-block-tracker"),sw=(0,rw.default)(),ow=1e3;class aw extends iw.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*ow,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=Qc(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:
|
|
3
|
-
${(t=r.stack)!==null&&t!==void 0?t:r}`);try{this.emit("error",n)}catch{console.error(n)}const i=Qc(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:sw(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(t.skipCache=!0),Kc("Making request",t);const r=await(0,nw.default)(n=>this._provider.sendAsync(t,n))();if(Kc("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
|
|
4
|
-
${r.error.message}`);return r.result}}os.PollingBlockTracker=aw;function Qc(e,t){return new Promise(r=>{const n=setTimeout(r,e);n.unref&&t&&n.unref()})}var gs={},cw=z&&z.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(gs,"__esModule",{value:!0});gs.SubscribeBlockTracker=void 0;const lw=cw(Vo),uw=Hn,hw=(0,lw.default)();class dw extends uw.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:hw(),method:t,params:r,jsonrpc:"2.0"},(s,a)=>{s?i(s):n(a.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)}}gs.SubscribeBlockTracker=dw;(function(e){var t=z&&z.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s),Object.defineProperty(n,a,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=z&&z.__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(os,e),r(gs,e)})(Nu);var aa={},ms={},Zn={};Object.defineProperty(Zn,"__esModule",{value:!0});Zn.getUniqueId=void 0;const gh=4294967295;let uo=Math.floor(Math.random()*gh);function fw(){return uo=(uo+1)%gh,uo}Zn.getUniqueId=fw;Object.defineProperty(ms,"__esModule",{value:!0});ms.createIdRemapMiddleware=void 0;const pw=Zn;function gw(){return(e,t,r,n)=>{const i=e.id,s=pw.getUniqueId();e.id=s,t.id=s,r(a=>{e.id=i,t.id=i,a()})}}ms.createIdRemapMiddleware=gw;var vs={};Object.defineProperty(vs,"__esModule",{value:!0});vs.createAsyncMiddleware=void 0;function mw(e){return async(t,r,n,i)=>{let s;const a=new Promise(f=>{s=f});let l=null,h=!1;const d=async()=>{h=!0,n(f=>{l=f,s()}),await a};try{await e(t,r,d),h?(await a,l(null)):i(null)}catch(f){l?l(f):i(f)}}}vs.createAsyncMiddleware=mw;var ys={};Object.defineProperty(ys,"__esModule",{value:!0});ys.createScaffoldMiddleware=void 0;function vw(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())}}ys.createScaffoldMiddleware=vw;var Kn={},ca={};Object.defineProperty(ca,"__esModule",{value:!0});const yw=Jr;function Yc(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function bw(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let ww=class extends yw.EventEmitter{emit(t,...r){let n=t==="error";const i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){let a;if(r.length>0&&([a]=r),a instanceof Error)throw a;const l=new Error(`Unhandled error.${a?` (${a.message})`:""}`);throw l.context=a,l}const s=i[t];if(s===void 0)return!1;if(typeof s=="function")Yc(s,this,r);else{const a=s.length,l=bw(s);for(let h=0;h<a;h+=1)Yc(l[h],this,r)}return!0}};ca.default=ww;var mh={},qt={};Object.defineProperty(qt,"__esModule",{value:!0});qt.EthereumProviderError=qt.EthereumRpcError=void 0;const _w=Th;class vh 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)}serialize(){const t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return _w.default(this.serialize(),Rw,2)}}qt.EthereumRpcError=vh;class Ew extends vh{constructor(t,r,n){if(!Sw(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}}qt.EthereumProviderError=Ew;function Sw(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function Rw(e,t){if(t!=="[Circular]")return t}var la={},zt={};Object.defineProperty(zt,"__esModule",{value:!0});zt.errorValues=zt.errorCodes=void 0;zt.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}};zt.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=zt,r=qt,n=t.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:n,message:a(n)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function a(_,C=i){if(Number.isInteger(_)){const L=_.toString();if(R(t.errorValues,L))return t.errorValues[L].message;if(d(_))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return C}e.getMessageFromCode=a;function l(_){if(!Number.isInteger(_))return!1;const C=_.toString();return!!(t.errorValues[C]||d(_))}e.isValidCode=l;function h(_,{fallbackError:C=s,shouldIncludeStack:L=!1}={}){var N,$;if(!C||!Number.isInteger(C.code)||typeof C.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(_)&&R(_,"code")&&l(_.code)){const T=_;M.code=T.code,T.message&&typeof T.message=="string"?(M.message=T.message,R(T,"data")&&(M.data=T.data)):(M.message=a(M.code),M.data={originalError:f(_)})}else{M.code=C.code;const T=(N=_)===null||N===void 0?void 0:N.message;M.message=T&&typeof T=="string"?T:C.message,M.data={originalError:f(_)}}const x=($=_)===null||$===void 0?void 0:$.stack;return L&&_&&x&&typeof x=="string"&&(M.stack=x),M}e.serializeError=h;function d(_){return _>=-32099&&_<=-32e3}function f(_){return _&&typeof _=="object"&&!Array.isArray(_)?Object.assign({},_):_}function R(_,C){return Object.prototype.hasOwnProperty.call(_,C)}})(la);var bs={};Object.defineProperty(bs,"__esModule",{value:!0});bs.ethErrors=void 0;const ua=qt,yh=la,tt=zt;bs.ethErrors={rpc:{parse:e=>dt(tt.errorCodes.rpc.parse,e),invalidRequest:e=>dt(tt.errorCodes.rpc.invalidRequest,e),invalidParams:e=>dt(tt.errorCodes.rpc.invalidParams,e),methodNotFound:e=>dt(tt.errorCodes.rpc.methodNotFound,e),internal:e=>dt(tt.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 dt(t,e)},invalidInput:e=>dt(tt.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>dt(tt.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>dt(tt.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>dt(tt.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>dt(tt.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>dt(tt.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>gn(tt.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>gn(tt.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>gn(tt.errorCodes.provider.unsupportedMethod,e),disconnected:e=>gn(tt.errorCodes.provider.disconnected,e),chainDisconnected:e=>gn(tt.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 ua.EthereumProviderError(t,r,n)}}};function dt(e,t){const[r,n]=bh(t);return new ua.EthereumRpcError(e,r||yh.getMessageFromCode(e),n)}function gn(e,t){const[r,n]=bh(t);return new ua.EthereumProviderError(e,r||yh.getMessageFromCode(e),n)}function bh(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=qt;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const r=la;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=bs;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=zt;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(mh);var Mw=z&&z.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Kn,"__esModule",{value:!0});Kn.JsonRpcEngine=void 0;const kw=Mw(ca),ft=mh;class $t extends kw.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,a,l]=await $t._runAllMiddleware(t,r,this._middleware);return a?(await $t._runReturnHandlers(l),i(s)):n(async h=>{try{await $t._runReturnHandlers(l)}catch(d){return h(d)}return h()})}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 a=new ft.EthereumRpcError(ft.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof t}`,{request:t});return r(a,{id:void 0,jsonrpc:"2.0",error:a})}if(typeof t.method!="string"){const a=new ft.EthereumRpcError(ft.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof t.method}`,{request:t});return r(a,{id:t.id,jsonrpc:"2.0",error:a})}const n=Object.assign({},t),i={id:n.id,jsonrpc:n.jsonrpc};let s=null;try{await this._processRequest(n,i)}catch(a){s=a}return s&&(delete i.result,i.error||(i.error=ft.serializeError(s))),r(s,i)}async _processRequest(t,r){const[n,i,s]=await $t._runAllMiddleware(t,r,this._middleware);if($t._checkForCompletion(t,r,i),await $t._runReturnHandlers(s),n)throw n}static async _runAllMiddleware(t,r,n){const i=[];let s=null,a=!1;for(const l of n)if([s,a]=await $t._runMiddleware(t,r,l,i),a)break;return[s,a,i.reverse()]}static _runMiddleware(t,r,n,i){return new Promise(s=>{const a=h=>{const d=h||r.error;d&&(r.error=ft.serializeError(d)),s([d,!0])},l=h=>{r.error?a(r.error):(h&&(typeof h!="function"&&a(new ft.EthereumRpcError(ft.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof h}" for request:
|
|
5
|
-
${ho(t)}`,{request:t})),i.push(h)),s([null,!1]))};try{n(t,r,l,a)}catch(h){a(h)}})}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 ft.EthereumRpcError(ft.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:
|
|
6
|
-
${ho(t)}`,{request:t});if(!n)throw new ft.EthereumRpcError(ft.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request:
|
|
7
|
-
${ho(t)}`,{request:t})}}Kn.JsonRpcEngine=$t;function ho(e){return JSON.stringify(e,null,2)}var ws={};Object.defineProperty(ws,"__esModule",{value:!0});ws.mergeMiddleware=void 0;const Iw=Kn;function Cw(e){const t=new Iw.JsonRpcEngine;return e.forEach(r=>t.push(r)),t.asMiddleware()}ws.mergeMiddleware=Cw;(function(e){var t=z&&z.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s),Object.defineProperty(n,a,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=z&&z.__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(vs,e),r(ys,e),r(Zn,e),r(Kn,e),r(ws,e)})(aa);var wh={},ha={};const da=vr(Nh);var _s={};Object.defineProperty(_s,"__esModule",{value:!0});var Xc=da,Aw=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 Xc.__awaiter(this,void 0,void 0,function(){var r,n,i;return Xc.__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}();_s.default=Aw;Object.defineProperty(ha,"__esModule",{value:!0});var el=da,xw=_s,Tw=function(){function e(){this._semaphore=new xw.default(1)}return e.prototype.acquire=function(){return el.__awaiter(this,void 0,void 0,function(){var t,r;return el.__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}();ha.default=Tw;var Es={};Object.defineProperty(Es,"__esModule",{value:!0});Es.withTimeout=void 0;var di=da;function Nw(e,t,r){var n=this;return r===void 0&&(r=new Error("timeout")),{acquire:function(){return new Promise(function(i,s){return di.__awaiter(n,void 0,void 0,function(){var a,l,h;return di.__generator(this,function(d){switch(d.label){case 0:return a=!1,setTimeout(function(){a=!0,s(r)},t),[4,e.acquire()];case 1:return l=d.sent(),a?(h=Array.isArray(l)?l[1]:l,h()):i(l),[2]}})})})},runExclusive:function(i){return di.__awaiter(this,void 0,void 0,function(){var s,a;return di.__generator(this,function(l){switch(l.label){case 0:s=function(){},l.label=1;case 1:return l.trys.push([1,,7,8]),[4,this.acquire()];case 2:return a=l.sent(),Array.isArray(a)?(s=a[1],[4,i(a[0])]):[3,4];case 3:return[2,l.sent()];case 4:return s=a,[4,i()];case 5:return[2,l.sent()];case 6:return[3,8];case 7:return s(),[7];case 8:return[2]}})})},release:function(){e.release()},isLocked:function(){return e.isLocked()}}}Es.withTimeout=Nw;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.withTimeout=e.Semaphore=e.Mutex=void 0;var t=ha;Object.defineProperty(e,"Mutex",{enumerable:!0,get:function(){return t.default}});var r=_s;Object.defineProperty(e,"Semaphore",{enumerable:!0,get:function(){return r.default}});var n=Es;Object.defineProperty(e,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}})})(wh);var Pw=$w,Lw=Object.prototype.hasOwnProperty;function $w(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var n in r)Lw.call(r,n)&&(e[n]=r[n])}return e}const Ow=Pw,Bw=Vo();var Dw=Y;function Y(e){const t=this;t.currentProvider=e}Y.prototype.getBalance=Qn(2,"eth_getBalance");Y.prototype.getCode=Qn(2,"eth_getCode");Y.prototype.getTransactionCount=Qn(2,"eth_getTransactionCount");Y.prototype.getStorageAt=Qn(3,"eth_getStorageAt");Y.prototype.call=Qn(2,"eth_call");Y.prototype.protocolVersion=ne("eth_protocolVersion");Y.prototype.syncing=ne("eth_syncing");Y.prototype.coinbase=ne("eth_coinbase");Y.prototype.mining=ne("eth_mining");Y.prototype.hashrate=ne("eth_hashrate");Y.prototype.gasPrice=ne("eth_gasPrice");Y.prototype.accounts=ne("eth_accounts");Y.prototype.blockNumber=ne("eth_blockNumber");Y.prototype.getBlockTransactionCountByHash=ne("eth_getBlockTransactionCountByHash");Y.prototype.getBlockTransactionCountByNumber=ne("eth_getBlockTransactionCountByNumber");Y.prototype.getUncleCountByBlockHash=ne("eth_getUncleCountByBlockHash");Y.prototype.getUncleCountByBlockNumber=ne("eth_getUncleCountByBlockNumber");Y.prototype.sign=ne("eth_sign");Y.prototype.sendTransaction=ne("eth_sendTransaction");Y.prototype.sendRawTransaction=ne("eth_sendRawTransaction");Y.prototype.estimateGas=ne("eth_estimateGas");Y.prototype.getBlockByHash=ne("eth_getBlockByHash");Y.prototype.getBlockByNumber=ne("eth_getBlockByNumber");Y.prototype.getTransactionByHash=ne("eth_getTransactionByHash");Y.prototype.getTransactionByBlockHashAndIndex=ne("eth_getTransactionByBlockHashAndIndex");Y.prototype.getTransactionByBlockNumberAndIndex=ne("eth_getTransactionByBlockNumberAndIndex");Y.prototype.getTransactionReceipt=ne("eth_getTransactionReceipt");Y.prototype.getUncleByBlockHashAndIndex=ne("eth_getUncleByBlockHashAndIndex");Y.prototype.getUncleByBlockNumberAndIndex=ne("eth_getUncleByBlockNumberAndIndex");Y.prototype.getCompilers=ne("eth_getCompilers");Y.prototype.compileLLL=ne("eth_compileLLL");Y.prototype.compileSolidity=ne("eth_compileSolidity");Y.prototype.compileSerpent=ne("eth_compileSerpent");Y.prototype.newFilter=ne("eth_newFilter");Y.prototype.newBlockFilter=ne("eth_newBlockFilter");Y.prototype.newPendingTransactionFilter=ne("eth_newPendingTransactionFilter");Y.prototype.uninstallFilter=ne("eth_uninstallFilter");Y.prototype.getFilterChanges=ne("eth_getFilterChanges");Y.prototype.getFilterLogs=ne("eth_getFilterLogs");Y.prototype.getLogs=ne("eth_getLogs");Y.prototype.getWork=ne("eth_getWork");Y.prototype.submitWork=ne("eth_submitWork");Y.prototype.submitHashrate=ne("eth_submitHashrate");Y.prototype.sendAsync=function(e,t){this.currentProvider.sendAsync(Fw(e),function(n,i){if(!n&&i.error&&(n=new Error("EthQuery - RPC Error - "+i.error.message)),n)return t(n);t(null,i.result)})};function ne(e){return function(){const t=this;var r=[].slice.call(arguments),n=r.pop();t.sendAsync({method:e,params:r},n)}}function Qn(e,t){return function(){const r=this;var n=[].slice.call(arguments),i=n.pop();n.length<e&&n.push("latest"),r.sendAsync({method:t,params:n},i)}}function Fw(e){return Ow({id:Bw(),jsonrpc:"2.0",params:[]},e)}const tl=(e,t,r,n)=>function(...i){const s=t.promiseModule;return new s((a,l)=>{t.multiArgs?i.push((...d)=>{t.errorFirst?d[0]?l(d):(d.shift(),a(d)):a(d)}):t.errorFirst?i.push((d,f)=>{d?l(d):a(f)}):i.push(a),Reflect.apply(e,this===r?n:this,i)})},rl=new WeakMap;var jw=(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=(a,l)=>{let h=rl.get(a);if(h||(h={},rl.set(a,h)),l in h)return h[l];const d=L=>typeof L=="string"||typeof l=="symbol"?l===L:L.test(l),f=Reflect.getOwnPropertyDescriptor(a,l),R=f===void 0||f.writable||f.configurable,C=(t.include?t.include.some(d):!t.exclude.some(d))&&R;return h[l]=C,C},i=new WeakMap,s=new Proxy(e,{apply(a,l,h){const d=i.get(a);if(d)return Reflect.apply(d,l,h);const f=t.excludeMain?a:tl(a,t,s,a);return i.set(a,f),Reflect.apply(f,l,h)},get(a,l){const h=a[l];if(!n(a,l)||h===Function.prototype[l])return h;const d=i.get(h);if(d)return d;if(typeof h=="function"){const f=tl(h,t,s,a);return i.set(h,f),f}return h}});return s};const Uw=Wn.default;let Hw=class extends Uw{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 fa=Hw;const Ww=fa;let Vw=class extends Ww{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 qw=Vw,Yn={minBlockRef:zw,maxBlockRef:Gw,sortBlockRefs:pa,bnToHex:Jw,blockRefIsNumber:Zw,hexToInt:Ii,incrementHexInt:Kw,intToHex:_h,unsafeRandomBytes:Qw};function zw(...e){return pa(e)[0]}function Gw(...e){const t=pa(e);return t[t.length-1]}function pa(e){return e.sort((t,r)=>t==="latest"||r==="earliest"?1:r==="latest"||t==="earliest"?-1:Ii(t)-Ii(r))}function Jw(e){return"0x"+e.toString(16)}function Zw(e){return e&&!["earliest","latest","pending"].includes(e)}function Ii(e){return e==null?e:Number.parseInt(e,16)}function Kw(e){if(e==null)return e;const t=Ii(e);return _h(t+1)}function _h(e){if(e==null)return e;let t=e.toString(16);return t.length%2&&(t="0"+t),"0x"+t}function Qw(e){let t="0x";for(let r=0;r<e;r++)t+=nl(),t+=nl();return t}function nl(){return Math.floor(Math.random()*16).toString(16)}const Yw=Dw,Xw=jw,e_=qw,{bnToHex:g2,hexToInt:fi,incrementHexInt:t_,minBlockRef:r_,blockRefIsNumber:n_}=Yn;let i_=class extends e_{constructor({provider:t,params:r}){super(),this.type="log",this.ethQuery=new Yw(t),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},r),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map(n=>n.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=r_(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=t_(t):i=r;const s=Object.assign({},this.params,{fromBlock:i,toBlock:n}),l=(await this._fetchLogs(s)).filter(h=>this.matchLog(h));this.addResults(l)}async _fetchLogs(t){return await Xw(n=>this.ethQuery.getLogs(t,n))()}matchLog(t){if(fi(this.params.fromBlock)>=fi(t.blockNumber)||n_(this.params.toBlock)&&fi(this.params.toBlock)<=fi(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 a=t.topics[s];if(!a)return!1;a=a.toLowerCase();let l=Array.isArray(i)?i:[i];return l.includes(null)?!0:(l=l.map(f=>f.toLowerCase()),l.includes(a))})}};var s_=i_,ga=o_;async function o_({provider:e,fromBlock:t,toBlock:r}){t||(t=r);const n=il(t),s=il(r)-n+1,a=Array(s).fill().map((h,d)=>n+d).map(a_);let l=await Promise.all(a.map(h=>l_(e,"eth_getBlockByNumber",[h,!1])));return l=l.filter(h=>h!==null),l}function il(e){return e==null?e:Number.parseInt(e,16)}function a_(e){return e==null?e:"0x"+e.toString(16)}function c_(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 l_(e,t,r){for(let n=0;n<3;n++)try{return await c_(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 u_=fa,h_=ga,{incrementHexInt:d_}=Yn;let f_=class extends u_{constructor({provider:t,params:r}){super(),this.type="block",this.provider=t}async update({oldBlock:t,newBlock:r}){const n=r,i=d_(t),a=(await h_({provider:this.provider,fromBlock:i,toBlock:n})).map(l=>l.hash);this.addResults(a)}};var p_=f_;const g_=fa,m_=ga,{incrementHexInt:v_}=Yn;let y_=class extends g_{constructor({provider:t}){super(),this.type="tx",this.provider=t}async update({oldBlock:t}){const r=t,n=v_(t),i=await m_({provider:this.provider,fromBlock:n,toBlock:r}),s=[];for(const a of i)s.push(...a.transactions);this.addResults(s)}};var b_=y_;const w_=wh.Mutex,{createAsyncMiddleware:__,createScaffoldMiddleware:E_}=aa,S_=s_,R_=p_,M_=b_,{intToHex:Eh,hexToInt:fo}=Yn;var k_=I_;function I_({blockTracker:e,provider:t}){let r=0,n={};const i=new w_,s=C_({mutex:i}),a=E_({eth_newFilter:s(po(h)),eth_newBlockFilter:s(po(d)),eth_newPendingTransactionFilter:s(po(f)),eth_uninstallFilter:s(_i(C)),eth_getFilterChanges:s(_i(R)),eth_getFilterLogs:s(_i(_))}),l=async({oldBlock:x,newBlock:T})=>{if(n.length===0)return;const B=await i.acquire();try{await Promise.all(Fr(n).map(async P=>{try{await P.update({oldBlock:x,newBlock:T})}catch(F){console.error(F)}}))}catch(P){console.error(P)}B()};return a.newLogFilter=h,a.newBlockFilter=d,a.newPendingTransactionFilter=f,a.uninstallFilter=C,a.getFilterChanges=R,a.getFilterLogs=_,a.destroy=()=>{$()},a;async function h(x){const T=new S_({provider:t,params:x});return await L(T),T}async function d(){const x=new R_({provider:t});return await L(x),x}async function f(){const x=new M_({provider:t});return await L(x),x}async function R(x){const T=fo(x),B=n[T];if(!B)throw new Error(`No filter for index "${T}"`);return B.getChangesAndClear()}async function _(x){const T=fo(x),B=n[T];if(!B)throw new Error(`No filter for index "${T}"`);let P=[];return B.type==="log"&&(P=B.getAllResults()),P}async function C(x){const T=fo(x),P=!!n[T];return P&&await N(T),P}async function L(x){const T=Fr(n).length,B=await e.getLatestBlock();await x.initialize({currentBlock:B}),r++,n[r]=x,x.id=r,x.idHex=Eh(r);const P=Fr(n).length;return M({prevFilterCount:T,newFilterCount:P}),r}async function N(x){const T=Fr(n).length;delete n[x];const B=Fr(n).length;M({prevFilterCount:T,newFilterCount:B})}async function $(){const x=Fr(n).length;n={},M({prevFilterCount:x,newFilterCount:0})}function M({prevFilterCount:x,newFilterCount:T}){if(x===0&&T>0){e.on("sync",l);return}if(x>0&&T===0){e.removeListener("sync",l);return}}}function po(e){return _i(async(...t)=>{const r=await e(...t);return Eh(r.id)})}function _i(e){return __(async(t,r)=>{const n=await e.apply(null,t.params);r.result=n})}function C_({mutex:e}){return t=>async(r,n,i,s)=>{(await e.acquire())(),t(r,n,i,s)}}function Fr(e,t){const r=[];for(let n in e)r.push(e[n]);return r}const A_=Wn.default,{createAsyncMiddleware:sl,createScaffoldMiddleware:x_}=aa,T_=k_,{unsafeRandomBytes:N_,incrementHexInt:P_}=Yn,L_=ga;var $_=O_;function O_({blockTracker:e,provider:t}){const r={},n=T_({blockTracker:e,provider:t});let i=!1;const s=new A_,a=x_({eth_subscribe:sl(l),eth_unsubscribe:sl(h)});return a.destroy=f,{events:s,middleware:a};async function l(R,_){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const C=R.params[0],L=N_(16);let N;switch(C){case"newHeads":N=$({subId:L});break;case"logs":const x=R.params[1],T=await n.newLogFilter(x);N=M({subId:L,filter:T});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${C}"`)}r[L]=N,_.result=L;return;function $({subId:x}){const T={type:C,destroy:async()=>{e.removeListener("sync",T.update)},update:async({oldBlock:B,newBlock:P})=>{const F=P,J=P_(B);(await L_({provider:t,fromBlock:J,toBlock:F})).map(B_).filter(ie=>ie!==null).forEach(ie=>{d(x,ie)})}};return e.on("sync",T.update),T}function M({subId:x,filter:T}){return T.on("update",P=>d(x,P)),{type:C,destroy:async()=>await n.uninstallFilter(T.idHex)}}}async function h(R,_){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const C=R.params[0],L=r[C];if(!L){_.result=!1;return}delete r[C],await L.destroy(),_.result=!0}function d(R,_){s.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:R,result:_}})}function f(){s.removeAllListeners();for(const R in r)r[R].destroy(),delete r[R];i=!0}}function B_(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(ss,"__esModule",{value:!0});ss.SubscriptionManager=void 0;const D_=Nu,F_=$_,ol=()=>{};class j_{constructor(t){const r=new D_.PollingBlockTracker({provider:t,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:n,middleware:i}=F_({blockTracker:r,provider:t});this.events=n,this.subscriptionMiddleware=i}async handleRequest(t){const r={};return await this.subscriptionMiddleware(t,r,ol,ol),r}destroy(){this.subscriptionMiddleware.destroy()}}ss.SubscriptionManager=j_;var Sh=z&&z.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Kr,"__esModule",{value:!0});Kr.CoinbaseWalletProvider=void 0;const U_=Sh(Ti),H_=o0,ae=Cn,te=q,W_=Nn,al=pt,pi=an,ct=nn,go=Sh(Ig),mn=on,V_=en,q_=ss,cl="DefaultChainId",ll="DefaultJsonRpcUrl";class z_ extends H_.EventEmitter{constructor(t){var r,n;super(),this._filterPolyfill=new V_.FilterPolyfill(this),this._subscriptionManager=new q_.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,te.prepend0x)(i.toString(16));this.emit("connect",{chainIdStr:s});const a=this._storage.getItem(al.LOCAL_STORAGE_ADDRESSES_KEY);if(a){const l=a.split(" ");l[0]!==""&&(this._addresses=l.map(h=>(0,te.ensureAddressString)(h)),this.emit("accountsChanged",l))}this._subscriptionManager.events.on("notification",l=>{this.emit("message",{type:l.method,data:l.params})}),this._isAuthorized()&&this.initializeRelay(),window.addEventListener("message",l=>{var h;if(!(l.origin!==location.origin||l.source!==window)&&l.data.type==="walletLinkMessage"&&l.data.data.action==="dappChainSwitched"){const d=l.data.data.chainId,f=(h=l.data.data.jsonRpcUrl)!==null&&h!==void 0?h:this.jsonRpcUrl;this.updateProviderInfo(f,Number(d))}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,te.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(ll))!==null&&t!==void 0?t:this._jsonRpcUrlFromOpts}set jsonRpcUrl(t){this._storage.setItem(ll,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(cl,r.toString(10)),((0,te.ensureIntNumber)(r)!==n||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(t,r,n,i,s,a){const h=await(await this.initializeRelay()).watchAsset(t,r,n,i,s,a?.toString()).promise;return(0,ct.isErrorResponse)(h)?!1:!!h.result}async addEthereumChain(t,r,n,i,s,a){var l,h;if((0,te.ensureIntNumber)(t)===this.getChainId())return!1;const d=await this.initializeRelay(),f=d.inlineAddEthereumChain(t.toString());!this._isAuthorized()&&!f&&await d.requestEthereumAccounts().promise;const R=await d.addEthereumChain(t.toString(),r,s,n,i,a).promise;return(0,ct.isErrorResponse)(R)?!1:(((l=R.result)===null||l===void 0?void 0:l.isApproved)===!0&&this.updateProviderInfo(r[0],t),((h=R.result)===null||h===void 0?void 0:h.isApproved)===!0)}async switchEthereumChain(t){const n=await(await this.initializeRelay()).switchEthereumChain(t.toString(10),this.selectedAddress||void 0).promise;if((0,ct.isErrorResponse)(n)){if(!n.errorCode)return;throw n.errorCode===ae.standardErrorCodes.provider.unsupportedChain?ae.standardErrors.provider.unsupportedChain():ae.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(mn.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?pi.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,ae.serializeError)(i,t)})}catch(n){throw(0,ae.serializeError)(n,t)}}_send(t,r){if(typeof t=="string"){const i=t,s=Array.isArray(r)?r:r!==void 0?[r]:[],a={jsonrpc:"2.0",id:0,method:i,params:s};return this._sendRequestAsync(a).then(l=>l.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,ae.serializeError)(n,t)})}catch(n){return Promise.reject((0,ae.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,ae.serializeError)(r,t.method)})}catch(r){return Promise.reject((0,ae.serializeError)(r,t.method))}}async _request(t){if(!t||typeof t!="object"||Array.isArray(t))throw ae.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 ae.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 ae.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,te.ensureRegExpString)(t)).promise;if((0,ct.isErrorResponse)(n))throw(0,ae.serializeError)(n.errorMessage,"scanQRCode");if(typeof n.result!="string")throw(0,ae.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,ct.isErrorResponse)(i))throw(0,ae.serializeError)(i.errorMessage,"generic");if(typeof i.result!="string")throw(0,ae.serializeError)("result was not a string","generic");return i.result}async connectAndSignIn(t){var r;(r=this.diagnostic)===null||r===void 0||r.log(mn.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::connectAndSignIn",sessionIdHash:this._relay?pi.Session.hash(this._relay.session.id):void 0});let n;try{const s=await this.initializeRelay();if(!(s instanceof W_.MobileRelay))throw new Error("connectAndSignIn is only supported on mobile");if(n=await s.connectAndSignIn(t).promise,(0,ct.isErrorResponse)(n))throw new Error(n.errorMessage)}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?ae.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,ct.isErrorResponse)(n))throw(0,ae.serializeError)(n.errorMessage,"selectProvider");if(typeof n.result!="string")throw(0,ae.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,te.ensureAddressString)(i));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(al.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(l=>r(Object.assign(Object.assign({},l),{id:t.id}))).catch(l=>n(l));return}const a=this._handleSubscriptionMethods(t);if(a!==void 0){a.then(l=>r({jsonrpc:"2.0",id:t.id,result:l.result})).catch(l=>n(l));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 a;throw(s.code===ae.standardErrorCodes.rpc.methodNotFound||s.code===ae.standardErrorCodes.rpc.methodNotSupported)&&((a=this.diagnostic)===null||a===void 0||a.log(mn.EVENTS.METHOD_NOT_IMPLEMENTED,{method:t.method,sessionIdHash:this._relay?pi.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,te.ensureAddressString)(t);return this._addresses.map(i=>(0,te.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(mn.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(t){const r=t.from?(0,te.ensureAddressString)(t.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);const n=t.to?(0,te.ensureAddressString)(t.to):null,i=t.value!=null?(0,te.ensureBN)(t.value):new U_.default(0),s=t.data?(0,te.ensureBuffer)(t.data):re.alloc(0),a=t.nonce!=null?(0,te.ensureIntNumber)(t.nonce):null,l=t.gasPrice!=null?(0,te.ensureBN)(t.gasPrice):null,h=t.maxFeePerGas!=null?(0,te.ensureBN)(t.maxFeePerGas):null,d=t.maxPriorityFeePerGas!=null?(0,te.ensureBN)(t.maxPriorityFeePerGas):null,f=t.gas!=null?(0,te.ensureBN)(t.gas):null,R=t.chainId?(0,te.ensureIntNumber)(t.chainId):this.getChainId();return{fromAddress:r,toAddress:n,weiValue:i,data:s,nonce:a,gasPriceInWei:l,maxFeePerGas:h,maxPriorityFeePerGas:d,gasLimit:f,chainId:R}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw ae.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw ae.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(t,r,n,i){this._ensureKnownAddress(r);try{const a=await(await this.initializeRelay()).signEthereumMessage(t,r,n,i).promise;if((0,ct.isErrorResponse)(a))throw new Error(a.errorMessage);return{jsonrpc:"2.0",id:0,result:a.result}}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?ae.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,ct.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,te.hexStringFromIntNumber)(this.getChainId())}getChainId(){const t=this._storage.getItem(cl);if(!t)return(0,te.ensureIntNumber)(this._chainIdFromOpts);const r=parseInt(t,10);return(0,te.ensureIntNumber)(r)}async _eth_requestAccounts(){var t;if((t=this.diagnostic)===null||t===void 0||t.log(mn.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?pi.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,ct.isErrorResponse)(r))throw new Error(r.errorMessage)}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?ae.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,te.ensureAddressString)(t[0]),n=(0,te.ensureBuffer)(t[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(t){const r=(0,te.ensureBuffer)(t[0]),n=(0,te.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(t){this._requireAuthorization();const r=(0,te.ensureBuffer)(t[0]),n=(0,te.ensureAddressString)(t[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(t){const r=(0,te.ensureBuffer)(t[0]),n=(0,te.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,ct.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)?ae.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(t){const r=(0,te.ensureBuffer)(t[0]),i=await(await this.initializeRelay()).submitEthereumTransaction(r,this.getChainId()).promise;if((0,ct.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,ct.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)?ae.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(t){this._requireAuthorization();const r=(0,te.ensureParsedJSONObject)(t[0]),n=(0,te.ensureAddressString)(t[1]);this._ensureKnownAddress(n);const i=go.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,te.ensureAddressString)(t[0]),n=(0,te.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const i=go.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,te.ensureAddressString)(t[0]),n=(0,te.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const i=go.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 a=t[0];if(((r=a.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(!a.chainName||a.chainName.trim()==="")throw ae.standardErrors.rpc.invalidParams("chainName is a required field");if(!a.nativeCurrency)throw ae.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const l=parseInt(a.chainId,16);return await this.addEthereumChain(l,(n=a.rpcUrls)!==null&&n!==void 0?n:[],(i=a.blockExplorerUrls)!==null&&i!==void 0?i:[],a.chainName,(s=a.iconUrls)!==null&&s!==void 0?s:[],a.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 ae.standardErrors.rpc.invalidParams("Type is required");if(r?.type!=="ERC20")throw ae.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!r?.options)throw ae.standardErrors.rpc.invalidParams("Options are required");if(!r?.options.address)throw ae.standardErrors.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:i,symbol:s,image:a,decimals:l}=r.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(r.type,i,s,l,a,n)}}_eth_uninstallFilter(t){const r=(0,te.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,te.ensureHexString)(t[0]);return this._filterPolyfill.getFilterChanges(r)}_eth_getFilterLogs(t){const r=(0,te.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))}}Kr.CoinbaseWalletProvider=z_;var Ss={};Object.defineProperty(Ss,"__esModule",{value:!0});Ss.RelayEventManager=void 0;const G_=q;class J_{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const t=this._nextRequestId,r=(0,G_.prepend0x)(t.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),t}}Ss.RelayEventManager=J_;Object.defineProperty(bn,"__esModule",{value:!0});bn.CoinbaseWalletSDK=void 0;const Z_=Ai,K_=xi,ul=q,Q_=Oi,Y_=Kr,X_=Nn,e2=Un,t2=Ss,r2=Dn,n2=Pn,Rh=sn;class Rs{constructor(t){var r,n,i;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const s=t.linkAPIUrl||K_.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 a=new URL(s),l=`${a.protocol}//${a.host}`;if(this._storage=new Q_.ScopedLocalStorage(`-walletlink:${l}`),this._storage.setItem("version",Rs.VERSION),this.walletExtension||this.coinbaseBrowser)return;this._relayEventManager=new t2.RelayEventManager;const h=(0,ul.isMobileWeb)(),d=t.uiConstructor||(R=>h?new e2.MobileRelayUI(R):new r2.WalletLinkRelayUI(R)),f={linkAPIUrl:s,version:Rh.LIB_VERSION,darkMode:!!t.darkMode,headlessMode:!!t.headlessMode,uiConstructor:d,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect,enableMobileWalletLink:t.enableMobileWalletLink};this._relay=h?new X_.MobileRelay(f):new n2.WalletLinkRelay(f),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 Y_.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,ul.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,Z_.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}}bn.CoinbaseWalletSDK=Rs;Rs.VERSION=Rh.LIB_VERSION;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CoinbaseWalletProvider=e.CoinbaseWalletSDK=void 0;const t=bn,r=Kr;var n=bn;Object.defineProperty(e,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return n.CoinbaseWalletSDK}});var i=Kr;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)})(Tl);const i2=Mh(Tl),b2=Object.freeze(Object.defineProperty({__proto__:null,default:i2},Symbol.toStringTag,{value:"Module"}));export{b2 as i};
|