Last active
December 4, 2024 20:53
-
-
Save jkobus/57f7a198c521237d980753d9025893b8 to your computer and use it in GitHub Desktop.
A copy of the lottie-player malware from incident that occured on Oct 30 2024 (https://github.com/LottieFiles/lottie-player/issues/254)
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(()=>{var Qat=Object.create;var OT=Object.defineProperty;var Zat=Object.getOwnPropertyDescriptor;var Yat=Object.getOwnPropertyNames;var Jat=Object.getPrototypeOf,Xat=Object.prototype.hasOwnProperty;var s5=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var F=(t,e)=>()=>(t&&(e=t(t=0)),e);var X=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),qr=(t,e)=>{for(var r in e)OT(t,r,{get:e[r],enumerable:!0})},NT=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Yat(e))!Xat.call(t,i)&&i!==r&&OT(t,i,{get:()=>e[i],enumerable:!(n=Zat(e,i))||n.enumerable});return t},ui=(t,e,r)=>(NT(t,e,"default"),r&&NT(r,e,"default")),It=(t,e,r)=>(r=t!=null?Qat(Jat(t)):{},NT(e||!t||!t.__esModule?OT(r,"default",{value:t,enumerable:!0}):r,t)),zn=t=>NT(OT({},"__esModule",{value:!0}),t);var Az,ude=F(()=>{Az="2.19.9"});function fde(t,e){return e?.(t)?t:t&&typeof t=="object"&&"cause"in t?fde(t.cause,e):e?null:t}var Sz,Oe,mn=F(()=>{ude();Sz={getDocsUrl:({docsBaseUrl:t,docsPath:e="",docsSlug:r})=>e?`${t??"https://viem.sh"}${e}${r?`#${r}`:""}`:void 0,version:Az},Oe=class t extends Error{constructor(e,r={}){let n=r.cause instanceof t?r.cause.details:r.cause?.message?r.cause.message:r.details,i=r.cause instanceof t&&r.cause.docsPath||r.docsPath,o=Sz.getDocsUrl?.({...r,docsPath:i}),s=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...o?[`Docs: ${o}`]:[],...n?[`Details: ${n}`]:[],...Sz.version?[`Version: ${Sz.version}`]:[]].join(` | |
`);super(s,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=n,this.docsPath=i,this.metaMessages=r.metaMessages,this.name=r.name??this.name,this.shortMessage=e,this.version=Az}walk(e){return fde(this,e)}}});var PT,BT,DT,LT=F(()=>{mn();PT=class extends Oe{constructor({max:e,min:r,signed:n,size:i,value:o}){super(`Number "${o}" is not in safe ${i?`${i*8}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${r} to ${e})`:`(above ${r})`}`,{name:"IntegerOutOfRangeError"})}},BT=class extends Oe{constructor(e){super(`Bytes value "${e}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}},DT=class extends Oe{constructor({givenSize:e,maxSize:r}){super(`Size cannot exceed ${r} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}});var iE,oE,sE,UT=F(()=>{mn();iE=class extends Oe{constructor({offset:e,position:r,size:n}){super(`Slice ${r==="start"?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${n}).`,{name:"SliceOffsetOutOfBoundsError"})}},oE=class extends Oe{constructor({size:e,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${r}).`,{name:"SizeExceedsPaddingSizeError"})}},sE=class extends Oe{constructor({size:e,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} is expected to be ${r} ${n} long, but is ${e} ${n} long.`,{name:"InvalidBytesLengthError"})}}});function bd(t,{dir:e,size:r=32}={}){return typeof t=="string"?Gp(t,{dir:e,size:r}):ect(t,{dir:e,size:r})}function Gp(t,{dir:e,size:r=32}={}){if(r===null)return t;let n=t.replace("0x","");if(n.length>r*2)throw new oE({size:Math.ceil(n.length/2),targetSize:r,type:"hex"});return`0x${n[e==="right"?"padEnd":"padStart"](r*2,"0")}`}function ect(t,{dir:e,size:r=32}={}){if(r===null)return t;if(t.length>r)throw new oE({size:t.length,targetSize:r,type:"bytes"});let n=new Uint8Array(r);for(let i=0;i<r;i++){let o=e==="right";n[o?i:r-i-1]=t[o?i:t.length-i-1]}return n}var aE=F(()=>{UT()});function ws(t,{strict:e=!0}={}){return!t||typeof t!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x")}var xd=F(()=>{});function fi(t){return ws(t,{strict:!1})?Math.ceil((t.length-2)/2):t.length}var Ed=F(()=>{xd()});function is(t,{dir:e="left"}={}){let r=typeof t=="string"?t.replace("0x",""):t,n=0;for(let i=0;i<r.length-1&&r[e==="left"?i:r.length-i-1].toString()==="0";i++)n++;return r=e==="left"?r.slice(n):r.slice(0,r.length-n),typeof t=="string"?(r.length===1&&e==="right"&&(r=`${r}0`),`0x${r.length%2===1?`0${r}`:r}`):r}var og=F(()=>{});function $u(t,e={}){return typeof t=="number"||typeof t=="bigint"?nct(t,e):typeof t=="boolean"?rct(t,e):ws(t)?Ko(t,e):oh(t,e)}function rct(t,e={}){let r=new Uint8Array(1);return r[0]=Number(t),typeof e.size=="number"?(el(r,{size:e.size}),bd(r,{size:e.size})):r}function hde(t){if(t>=Qp.zero&&t<=Qp.nine)return t-Qp.zero;if(t>=Qp.A&&t<=Qp.F)return t-(Qp.A-10);if(t>=Qp.a&&t<=Qp.f)return t-(Qp.a-10)}function Ko(t,e={}){let r=t;e.size&&(el(r,{size:e.size}),r=bd(r,{dir:"right",size:e.size}));let n=r.slice(2);n.length%2&&(n=`0${n}`);let i=n.length/2,o=new Uint8Array(i);for(let s=0,a=0;s<i;s++){let l=hde(n.charCodeAt(a++)),u=hde(n.charCodeAt(a++));if(l===void 0||u===void 0)throw new Oe(`Invalid byte sequence ("${n[a-2]}${n[a-1]}" in "${n}").`);o[s]=l*16+u}return o}function nct(t,e){let r=tr(t,e);return Ko(r)}function oh(t,e={}){let r=tct.encode(t);return typeof e.size=="number"?(el(r,{size:e.size}),bd(r,{dir:"right",size:e.size})):r}var tct,Qp,aa=F(()=>{mn();xd();aE();Na();Vr();tct=new TextEncoder;Qp={zero:48,nine:57,A:65,F:70,a:97,f:102}});function el(t,{size:e}){if(fi(t)>e)throw new DT({givenSize:fi(t),maxSize:e})}function Wn(t,e={}){let{signed:r}=e;e.size&&el(t,{size:e.size});let n=BigInt(t);if(!r)return n;let i=(t.length-2)/2,o=(1n<<BigInt(i)*8n-1n)-1n;return n<=o?n:n-BigInt(`0x${"f".padStart(i*2,"f")}`)-1n}function Ps(t,e={}){return Number(Wn(t,e))}function cE(t,e={}){let r=Ko(t);return e.size&&(el(r,{size:e.size}),r=is(r,{dir:"right"})),new TextDecoder().decode(r)}var Na=F(()=>{LT();Ed();og();aa()});function Pt(t,e={}){return typeof t=="number"||typeof t=="bigint"?tr(t,e):typeof t=="string"?sh(t,e):typeof t=="boolean"?jT(t,e):ri(t,e)}function jT(t,e={}){let r=`0x${Number(t)}`;return typeof e.size=="number"?(el(r,{size:e.size}),bd(r,{size:e.size})):r}function ri(t,e={}){let r="";for(let i=0;i<t.length;i++)r+=ict[t[i]];let n=`0x${r}`;return typeof e.size=="number"?(el(n,{size:e.size}),bd(n,{dir:"right",size:e.size})):n}function tr(t,e={}){let{signed:r,size:n}=e,i=BigInt(t),o;n?r?o=(1n<<BigInt(n)*8n-1n)-1n:o=2n**(BigInt(n)*8n)-1n:typeof t=="number"&&(o=BigInt(Number.MAX_SAFE_INTEGER));let s=typeof o=="bigint"&&r?-o-1n:0;if(o&&i>o||i<s){let l=typeof t=="bigint"?"n":"";throw new PT({max:o?`${o}${l}`:void 0,min:`${s}${l}`,signed:r,size:n,value:`${t}${l}`})}let a=`0x${(r&&i<0?(1n<<BigInt(n*8))+BigInt(i):i).toString(16)}`;return n?bd(a,{size:n}):a}function sh(t,e={}){let r=oct.encode(t);return ri(r,e)}var ict,oct,Vr=F(()=>{LT();aE();Na();ict=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));oct=new TextEncoder});async function lE(t,{chain:e}){let{id:r,name:n,nativeCurrency:i,rpcUrls:o,blockExplorers:s}=e;await t.request({method:"wallet_addEthereumChain",params:[{chainId:tr(r),chainName:n,nativeCurrency:i,rpcUrls:o.default.http,blockExplorerUrls:s?Object.values(s).map(({url:a})=>a):void 0}]},{dedupe:!0,retryCount:0})}var _z=F(()=>{Vr()});function Cd(t,{includeName:e=!1}={}){if(t.type!=="function"&&t.type!=="event"&&t.type!=="error")throw new $T(t.type);return`${t.name}(${FT(t.inputs,{includeName:e})})`}function FT(t,{includeName:e=!1}={}){return t?t.map(r=>sct(r,{includeName:e})).join(e?", ":","):""}function sct(t,{includeName:e}){return t.type.startsWith("tuple")?`(${FT(t.components,{includeName:e})})${t.type.slice(5)}`:t.type+(e&&t.name?` ${t.name}`:"")}var uE=F(()=>{Hl()});var qT,fE,HT,Ad,zT,WT,VT,a5,sg,KT,GT,QT,ZT,YT,JT,$T,Hl=F(()=>{uE();Ed();mn();qT=class extends Oe{constructor({docsPath:e}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(` | |
`),{docsPath:e,name:"AbiConstructorNotFoundError"})}},fE=class extends Oe{constructor({docsPath:e}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(` | |
`),{docsPath:e,name:"AbiConstructorParamsNotFoundError"})}},HT=class extends Oe{constructor({data:e,params:r,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join(` | |
`),{metaMessages:[`Params: (${FT(r,{includeName:!0})})`,`Data: ${e} (${n} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e,this.params=r,this.size=n}},Ad=class extends Oe{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}},zT=class extends Oe{constructor({expectedLength:e,givenLength:r,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${e}`,`Given length: ${r}`].join(` | |
`),{name:"AbiEncodingArrayLengthMismatchError"})}},WT=class extends Oe{constructor({expectedSize:e,value:r}){super(`Size of bytes "${r}" (bytes${fi(r)}) does not match expected size (bytes${e}).`,{name:"AbiEncodingBytesSizeMismatchError"})}},VT=class extends Oe{constructor({expectedLength:e,givenLength:r}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${r}`].join(` | |
`),{name:"AbiEncodingLengthMismatchError"})}},a5=class extends Oe{constructor(e,{docsPath:r}){super([`Encoded error signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${e}.`].join(` | |
`),{docsPath:r,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}},sg=class extends Oe{constructor(e,{docsPath:r}={}){super([`Function ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(` | |
`),{docsPath:r,name:"AbiFunctionNotFoundError"})}},KT=class extends Oe{constructor(e,{docsPath:r}){super([`Function "${e}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(` | |
`),{docsPath:r,name:"AbiFunctionOutputsNotFoundError"})}},GT=class extends Oe{constructor(e,r){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${Cd(e.abiItem)}\`, and`,`\`${r.type}\` in \`${Cd(r.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}},QT=class extends Oe{constructor({expectedSize:e,givenSize:r}){super(`Expected bytes${e}, got bytes${r}.`,{name:"BytesSizeMismatchError"})}},ZT=class extends Oe{constructor(e,{docsPath:r}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(` | |
`),{docsPath:r,name:"InvalidAbiEncodingType"})}},YT=class extends Oe{constructor(e,{docsPath:r}){super([`Type "${e}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(` | |
`),{docsPath:r,name:"InvalidAbiDecodingType"})}},JT=class extends Oe{constructor(e){super([`Value "${e}" is not a valid array.`].join(` | |
`),{name:"InvalidArrayError"})}},$T=class extends Oe{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(` | |
`),{name:"InvalidDefinitionTypeError"})}}});function gc(t){return typeof t[0]=="string"?Bs(t):act(t)}function act(t){let e=0;for(let i of t)e+=i.length;let r=new Uint8Array(e),n=0;for(let i of t)r.set(i,n),n+=i.length;return r}function Bs(t){return`0x${t.reduce((e,r)=>e+r.replace("0x",""),"")}`}var zl=F(()=>{});var ni,qu=F(()=>{mn();ni=class extends Oe{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}});var ag,XT=F(()=>{ag=class extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}set(e,r){return super.set(e,r),this.maxSize&&this.size>this.maxSize&&this.delete(this.keys().next().value),this}}});function hE(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`positive integer expected, not ${t}`)}function cct(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}function cg(t,...e){if(!cct(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error(`Uint8Array expected of length ${e}, not of length=${t.length}`)}function dde(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");hE(t.outputLen),hE(t.blockLen)}function Zp(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function ek(t,e){cg(t);let r=e.outputLen;if(t.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}var dE=F(()=>{});function lct(t,e=!1){return e?{h:Number(t&tk),l:Number(t>>pde&tk)}:{h:Number(t>>pde&tk)|0,l:Number(t&tk)|0}}function mde(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;i<t.length;i++){let{h:o,l:s}=lct(t[i],e);[r[i],n[i]]=[o,s]}return[r,n]}var tk,pde,gde,wde,vde,yde,bde=F(()=>{tk=BigInt(4294967295),pde=BigInt(32);gde=(t,e,r)=>t<<r|e>>>32-r,wde=(t,e,r)=>e<<r|t>>>32-r,vde=(t,e,r)=>e<<r-32|t>>>64-r,yde=(t,e,r)=>t<<r-32|e>>>64-r});var rk,xde=F(()=>{rk=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0});function Tz(t){for(let e=0;e<t.length;e++)t[e]=uct(t[e])}function fct(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function ug(t){return typeof t=="string"&&(t=fct(t)),cg(t),t}function Cde(...t){let e=0;for(let n=0;n<t.length;n++){let i=t[n];cg(i),e+=i.length}let r=new Uint8Array(e);for(let n=0,i=0;n<t.length;n++){let o=t[n];r.set(o,i),i+=o.length}return r}function ik(t){let e=n=>t().update(ug(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function Ade(t){let e=(n,i)=>t(i).update(ug(n)).digest(),r=t({});return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=n=>t(n),e}function ok(t=32){if(rk&&typeof rk.getRandomValues=="function")return rk.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}var Ede,nk,ah,Iz,uct,lg,$Xt,h3=F(()=>{xde();dE();Ede=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),nk=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),ah=(t,e)=>t<<32-e|t>>>e,Iz=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,uct=t=>t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255;lg=class{clone(){return this._cloneInto()}},$Xt={}.toString});function yct(t,e=24){let r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let s=0;s<10;s++)r[s]=t[s]^t[s+10]^t[s+20]^t[s+30]^t[s+40];for(let s=0;s<10;s+=2){let a=(s+8)%10,l=(s+2)%10,u=r[l],d=r[l+1],p=Sde(u,d,1)^r[a],v=_de(u,d,1)^r[a+1];for(let y=0;y<50;y+=10)t[s+y]^=p,t[s+y+1]^=v}let i=t[2],o=t[3];for(let s=0;s<24;s++){let a=Tde[s],l=Sde(i,o,a),u=_de(i,o,a),d=Ide[s];i=t[d],o=t[d+1],t[d]=l,t[d+1]=u}for(let s=0;s<50;s+=10){for(let a=0;a<10;a++)r[a]=t[s+a];for(let a=0;a<10;a++)t[s+a]^=~r[(a+2)%10]&r[(a+4)%10]}t[0]^=wct[n],t[1]^=vct[n]}r.fill(0)}var Ide,Tde,kde,hct,pE,dct,pct,mct,gct,wct,vct,Sde,_de,sk,fg,VXt,KXt,GXt,QXt,ZXt,Rde,YXt,JXt,Mde,XXt,eer,Nde=F(()=>{dE();bde();h3();Ide=[],Tde=[],kde=[],hct=BigInt(0),pE=BigInt(1),dct=BigInt(2),pct=BigInt(7),mct=BigInt(256),gct=BigInt(113);for(let t=0,e=pE,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],Ide.push(2*(5*n+r)),Tde.push((t+1)*(t+2)/2%64);let i=hct;for(let o=0;o<7;o++)e=(e<<pE^(e>>pct)*gct)%mct,e&dct&&(i^=pE<<(pE<<BigInt(o))-pE);kde.push(i)}[wct,vct]=mde(kde,!0),Sde=(t,e,r)=>r>32?vde(t,e,r):gde(t,e,r),_de=(t,e,r)=>r>32?yde(t,e,r):wde(t,e,r);sk=class t extends lg{constructor(e,r,n,i=!1,o=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,hE(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Ede(this.state)}keccak(){Iz||Tz(this.state32),yct(this.state32,this.rounds),Iz||Tz(this.state32),this.posOut=0,this.pos=0}update(e){Zp(this);let{blockLen:r,state:n}=this;e=ug(e);let i=e.length;for(let o=0;o<i;){let s=Math.min(r-this.pos,i-o);for(let a=0;a<s;a++)n[this.pos++]^=e[o++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:r,pos:n,blockLen:i}=this;e[n]^=r,r&128&&n===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){Zp(this,!1),cg(e),this.finish();let r=this.state,{blockLen:n}=this;for(let i=0,o=e.length;i<o;){this.posOut>=n&&this.keccak();let s=Math.min(n-this.posOut,o-i);e.set(r.subarray(this.posOut,this.posOut+s),i),this.posOut+=s,i+=s}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return hE(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(ek(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){let{blockLen:r,suffix:n,outputLen:i,rounds:o,enableXOF:s}=this;return e||(e=new t(r,n,i,s,o)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=o,e.suffix=n,e.outputLen=i,e.enableXOF=s,e.destroyed=this.destroyed,e}},fg=(t,e,r)=>ik(()=>new sk(e,t,r)),VXt=fg(6,144,224/8),KXt=fg(6,136,256/8),GXt=fg(6,104,384/8),QXt=fg(6,72,512/8),ZXt=fg(1,144,224/8),Rde=fg(1,136,256/8),YXt=fg(1,104,384/8),JXt=fg(1,72,512/8),Mde=(t,e,r)=>Ade((n={})=>new sk(e,t,n.dkLen===void 0?r:n.dkLen,!0)),XXt=Mde(31,168,128/8),eer=Mde(31,136,256/8)});function Fi(t,e){let r=e||"hex",n=Rde(ws(t,{strict:!1})?$u(t):t);return r==="bytes"?n:Pt(n)}var Sd=F(()=>{Nde();xd();aa();Vr()});function _d(t,e){if(kz.has(`${t}.${e}`))return kz.get(`${t}.${e}`);let r=e?`${e}${t.toLowerCase()}`:t.substring(2).toLowerCase(),n=Fi(oh(r),"bytes"),i=(e?r.substring(`${e}0x`.length):r).split("");for(let s=0;s<40;s+=2)n[s>>1]>>4>=8&&i[s]&&(i[s]=i[s].toUpperCase()),(n[s>>1]&15)>=8&&i[s+1]&&(i[s+1]=i[s+1].toUpperCase());let o=`0x${i.join("")}`;return kz.set(`${t}.${e}`,o),o}function Yi(t,e){if(!$n(t,{strict:!1}))throw new ni({address:t});return _d(t,e)}var kz,hg=F(()=>{qu();aa();Sd();XT();Wl();kz=new ag(8192)});function $n(t,e){let{strict:r=!0}=e??{},n=`${t}.${r}`;if(Rz.has(n))return Rz.get(n);let i=bct.test(t)?t.toLowerCase()===t?!0:r?_d(t)===t:!0:!1;return Rz.set(n,i),i}var bct,Rz,Wl=F(()=>{XT();hg();bct=/^0x[a-fA-F0-9]{40}$/,Rz=new ag(8192)});function Yp(t,e,r,{strict:n}={}){return ws(t,{strict:!1})?xct(t,e,r,{strict:n}):Mz(t,e,r,{strict:n})}function Ode(t,e){if(typeof e=="number"&&e>0&&e>fi(t)-1)throw new iE({offset:e,position:"start",size:fi(t)})}function Pde(t,e,r){if(typeof e=="number"&&typeof r=="number"&&fi(t)!==r-e)throw new iE({offset:r,position:"end",size:fi(t)})}function Mz(t,e,r,{strict:n}={}){Ode(t,e);let i=t.slice(e,r);return n&&Pde(i,e,r),i}function xct(t,e,r,{strict:n}={}){Ode(t,e);let i=`0x${t.replace("0x","").slice((e??0)*2,(r??t.length)*2)}`;return n&&Pde(i,e,r),i}var c5=F(()=>{UT();xd();Ed()});function Jp(t,e){if(t.length!==e.length)throw new VT({expectedLength:t.length,givenLength:e.length});let r=Ect({params:t,values:e}),n=Oz(r);return n.length===0?"0x":n}function Ect({params:t,values:e}){let r=[];for(let n=0;n<t.length;n++)r.push(Nz({param:t[n],value:e[n]}));return r}function Nz({param:t,value:e}){let r=ak(t.type);if(r){let[n,i]=r;return Act(e,{length:n,param:{...t,type:i}})}if(t.type==="tuple")return kct(e,{param:t});if(t.type==="address")return Cct(e);if(t.type==="bool")return _ct(e);if(t.type.startsWith("uint")||t.type.startsWith("int")){let n=t.type.startsWith("int");return Ict(e,{signed:n})}if(t.type.startsWith("bytes"))return Sct(e,{param:t});if(t.type==="string")return Tct(e);throw new ZT(t.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function Oz(t){let e=0;for(let o=0;o<t.length;o++){let{dynamic:s,encoded:a}=t[o];s?e+=32:e+=fi(a)}let r=[],n=[],i=0;for(let o=0;o<t.length;o++){let{dynamic:s,encoded:a}=t[o];s?(r.push(tr(e+i,{size:32})),n.push(a),i+=fi(a)):r.push(a)}return gc([...r,...n])}function Cct(t){if(!$n(t))throw new ni({address:t});return{dynamic:!1,encoded:Gp(t.toLowerCase())}}function Act(t,{length:e,param:r}){let n=e===null;if(!Array.isArray(t))throw new JT(t);if(!n&&t.length!==e)throw new zT({expectedLength:e,givenLength:t.length,type:`${r.type}[${e}]`});let i=!1,o=[];for(let s=0;s<t.length;s++){let a=Nz({param:r,value:t[s]});a.dynamic&&(i=!0),o.push(a)}if(n||i){let s=Oz(o);if(n){let a=tr(o.length,{size:32});return{dynamic:!0,encoded:o.length>0?gc([a,s]):a}}if(i)return{dynamic:!0,encoded:s}}return{dynamic:!1,encoded:gc(o.map(({encoded:s})=>s))}}function Sct(t,{param:e}){let[,r]=e.type.split("bytes"),n=fi(t);if(!r){let i=t;return n%32!==0&&(i=Gp(i,{dir:"right",size:Math.ceil((t.length-2)/2/32)*32})),{dynamic:!0,encoded:gc([Gp(tr(n,{size:32})),i])}}if(n!==Number.parseInt(r))throw new WT({expectedSize:Number.parseInt(r),value:t});return{dynamic:!1,encoded:Gp(t,{dir:"right"})}}function _ct(t){if(typeof t!="boolean")throw new Oe(`Invalid boolean value: "${t}" (type: ${typeof t}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Gp(jT(t))}}function Ict(t,{signed:e}){return{dynamic:!1,encoded:tr(t,{size:32,signed:e})}}function Tct(t){let e=sh(t),r=Math.ceil(fi(e)/32),n=[];for(let i=0;i<r;i++)n.push(Gp(Yp(e,i*32,(i+1)*32),{dir:"right"}));return{dynamic:!0,encoded:gc([Gp(tr(fi(e),{size:32})),...n])}}function kct(t,{param:e}){let r=!1,n=[];for(let i=0;i<e.components.length;i++){let o=e.components[i],s=Array.isArray(t)?i:o.name,a=Nz({param:o,value:t[s]});n.push(a),a.dynamic&&(r=!0)}return{dynamic:r,encoded:r?Oz(n):gc(n.map(({encoded:i})=>i))}}function ak(t){let e=t.match(/^(.*)\[(\d+)?\]$/);return e?[e[2]?Number(e[2]):null,e[1]]:void 0}var l5=F(()=>{Hl();qu();mn();Wl();zl();aE();Ed();c5();Vr()});function mE(t){let{abi:e,args:r,bytecode:n}=t;if(!r||r.length===0)return n;let i=e.find(s=>"type"in s&&s.type==="constructor");if(!i)throw new qT({docsPath:Pz});if(!("inputs"in i))throw new fE({docsPath:Pz});if(!i.inputs||i.inputs.length===0)throw new fE({docsPath:Pz});let o=Jp(i.inputs,r);return Bs([n,o])}var Pz,Bz=F(()=>{Hl();zl();l5();Pz="/docs/contract/encodeDeployData"});function Ti(t){return typeof t=="string"?{address:t,type:"json-rpc"}:t}var tl=F(()=>{});var Hu,u5,f5=F(()=>{mn();Hu=class extends Oe{constructor({docsPath:e}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(` | |
`),{docsPath:e,docsSlug:"account",name:"AccountNotFoundError"})}},u5=class extends Oe{constructor({docsPath:e,metaMessages:r,type:n}){super(`Account type "${n}" is not supported.`,{docsPath:e,metaMessages:r,name:"AccountTypeNotSupportedError"})}}});function Bde(t){let e=Fi(`0x${t.substring(4)}`).substring(26);return _d(`0x${e}`)}var Dde=F(()=>{hg();Sd()});function Rct(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);let i=BigInt(32),o=BigInt(4294967295),s=Number(r>>i&o),a=Number(r&o),l=n?4:0,u=n?0:4;t.setUint32(e+l,s,n),t.setUint32(e+u,a,n)}var Lde,Ude,ck,jde=F(()=>{dE();h3();Lde=(t,e,r)=>t&e^~t&r,Ude=(t,e,r)=>t&e^t&r^e&r,ck=class extends lg{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=nk(this.buffer)}update(e){Zp(this);let{view:r,buffer:n,blockLen:i}=this;e=ug(e);let o=e.length;for(let s=0;s<o;){let a=Math.min(i-this.pos,o-s);if(a===i){let l=nk(e);for(;i<=o-s;s+=i)this.process(l,s);continue}n.set(e.subarray(s,s+a),this.pos),this.pos+=a,s+=a,this.pos===i&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Zp(this),ek(e,this),this.finished=!0;let{buffer:r,view:n,blockLen:i,isLE:o}=this,{pos:s}=this;r[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>i-s&&(this.process(n,0),s=0);for(let p=s;p<i;p++)r[p]=0;Rct(n,i-8,BigInt(this.length*8),o),this.process(n,0);let a=nk(e),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let u=l/4,d=this.get();if(u>d.length)throw new Error("_sha2: outputLen bigger than state");for(let p=0;p<u;p++)a.setUint32(4*p,d[p],o)}digest(){let{buffer:e,outputLen:r}=this;this.digestInto(e);let n=e.slice(0,r);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:r,buffer:n,length:i,finished:o,destroyed:s,pos:a}=this;return e.length=i,e.pos=a,e.finished=o,e.destroyed=s,i%r&&e.buffer.set(n),e}}});var Mct,dg,pg,Dz,d3,Lz=F(()=>{jde();h3();Mct=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),dg=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),pg=new Uint32Array(64),Dz=class extends ck{constructor(){super(64,32,8,!1),this.A=dg[0]|0,this.B=dg[1]|0,this.C=dg[2]|0,this.D=dg[3]|0,this.E=dg[4]|0,this.F=dg[5]|0,this.G=dg[6]|0,this.H=dg[7]|0}get(){let{A:e,B:r,C:n,D:i,E:o,F:s,G:a,H:l}=this;return[e,r,n,i,o,s,a,l]}set(e,r,n,i,o,s,a,l){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=o|0,this.F=s|0,this.G=a|0,this.H=l|0}process(e,r){for(let p=0;p<16;p++,r+=4)pg[p]=e.getUint32(r,!1);for(let p=16;p<64;p++){let v=pg[p-15],y=pg[p-2],S=ah(v,7)^ah(v,18)^v>>>3,R=ah(y,17)^ah(y,19)^y>>>10;pg[p]=R+pg[p-7]+S+pg[p-16]|0}let{A:n,B:i,C:o,D:s,E:a,F:l,G:u,H:d}=this;for(let p=0;p<64;p++){let v=ah(a,6)^ah(a,11)^ah(a,25),y=d+v+Lde(a,l,u)+Mct[p]+pg[p]|0,R=(ah(n,2)^ah(n,13)^ah(n,22))+Ude(n,i,o)|0;d=u,u=l,l=a,a=s+y|0,s=o,o=i,i=n,n=y+R|0}n=n+this.A|0,i=i+this.B|0,o=o+this.C|0,s=s+this.D|0,a=a+this.E|0,l=l+this.F|0,u=u+this.G|0,d=d+this.H|0,this.set(n,i,o,s,a,l,u,d)}roundClean(){pg.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},d3=ik(()=>new Dz)});var $z={};qr($z,{abytes:()=>zu,bitGet:()=>Lct,bitLen:()=>Dct,bitMask:()=>wE,bitSet:()=>Uct,bytesToHex:()=>p3,bytesToNumberBE:()=>vs,bytesToNumberLE:()=>uk,concatBytes:()=>Oa,createHmacDrbg:()=>Fz,ensureBytes:()=>ys,equalBytes:()=>Bct,hexToBytes:()=>m3,hexToNumber:()=>jz,isBytes:()=>mg,numberToBytesBE:()=>ch,numberToBytesLE:()=>fk,numberToHexUnpadded:()=>Hde,numberToVarBytesBE:()=>Pct,utf8ToBytes:()=>gE,validateObject:()=>Id});function mg(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}function zu(t){if(!mg(t))throw new Error("Uint8Array expected")}function p3(t){zu(t);let e="";for(let r=0;r<t.length;r++)e+=Oct[t[r]];return e}function Hde(t){let e=t.toString(16);return e.length&1?`0${e}`:e}function jz(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return BigInt(t===""?"0":`0x${t}`)}function Fde(t){if(t>=Xp._0&&t<=Xp._9)return t-Xp._0;if(t>=Xp._A&&t<=Xp._F)return t-(Xp._A-10);if(t>=Xp._a&&t<=Xp._f)return t-(Xp._a-10)}function m3(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);let e=t.length,r=e/2;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);let n=new Uint8Array(r);for(let i=0,o=0;i<r;i++,o+=2){let s=Fde(t.charCodeAt(o)),a=Fde(t.charCodeAt(o+1));if(s===void 0||a===void 0){let l=t[o]+t[o+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+o)}n[i]=s*16+a}return n}function vs(t){return jz(p3(t))}function uk(t){return zu(t),jz(p3(Uint8Array.from(t).reverse()))}function ch(t,e){return m3(t.toString(16).padStart(e*2,"0"))}function fk(t,e){return ch(t,e).reverse()}function Pct(t){return m3(Hde(t))}function ys(t,e,r){let n;if(typeof e=="string")try{n=m3(e)}catch(o){throw new Error(`${t} must be valid hex string, got "${e}". Cause: ${o}`)}else if(mg(e))n=Uint8Array.from(e);else throw new Error(`${t} must be hex string or Uint8Array`);let i=n.length;if(typeof r=="number"&&i!==r)throw new Error(`${t} expected ${r} bytes, got ${i}`);return n}function Oa(...t){let e=0;for(let n=0;n<t.length;n++){let i=t[n];zu(i),e+=i.length}let r=new Uint8Array(e);for(let n=0,i=0;n<t.length;n++){let o=t[n];r.set(o,i),i+=o.length}return r}function Bct(t,e){if(t.length!==e.length)return!1;let r=0;for(let n=0;n<t.length;n++)r|=t[n]^e[n];return r===0}function gE(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function Dct(t){let e;for(e=0;t>qde;t>>=lk,e+=1);return e}function Lct(t,e){return t>>BigInt(e)&lk}function Uct(t,e,r){return t|(r?lk:qde)<<BigInt(e)}function Fz(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=Uz(t),i=Uz(t),o=0,s=()=>{n.fill(1),i.fill(0),o=0},a=(...p)=>r(i,n,...p),l=(p=Uz())=>{i=a($de([0]),p),n=a(),p.length!==0&&(i=a($de([1]),p),n=a())},u=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let p=0,v=[];for(;p<e;){n=a();let y=n.slice();v.push(y),p+=n.length}return Oa(...v)};return(p,v)=>{s(),l(p);let y;for(;!(y=v(u()));)l();return s(),y}}function Id(t,e,r={}){let n=(i,o,s)=>{let a=jct[o];if(typeof a!="function")throw new Error(`Invalid validator "${o}", expected function`);let l=t[i];if(!(s&&l===void 0)&&!a(l,t))throw new Error(`Invalid param ${String(i)}=${l} (${typeof l}), expected ${o}`)};for(let[i,o]of Object.entries(e))n(i,o,!1);for(let[i,o]of Object.entries(r))n(i,o,!0);return t}var qde,lk,Nct,Oct,Xp,wE,Uz,$de,jct,g3=F(()=>{qde=BigInt(0),lk=BigInt(1),Nct=BigInt(2);Oct=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));Xp={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};wE=t=>(Nct<<BigInt(t-1))-lk,Uz=t=>new Uint8Array(t),$de=t=>Uint8Array.from(t);jct={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||mg(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)}});function Go(t,e){let r=t%e;return r>=bs?r:e+r}function Hct(t,e,r){if(r<=bs||e<bs)throw new Error("Expected power/modulo > 0");if(r===Io)return bs;let n=Io;for(;e>bs;)e&Io&&(n=n*t%r),t=t*t%r,e>>=Io;return n}function Vl(t,e,r){let n=t;for(;e-- >bs;)n*=n,n%=r;return n}function hk(t,e){if(t===bs||e<=bs)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=Go(t,e),n=e,i=bs,o=Io,s=Io,a=bs;for(;r!==bs;){let u=n/r,d=n%r,p=i-s*u,v=o-a*u;n=r,r=d,i=s,o=a,s=p,a=v}if(n!==Io)throw new Error("invert: does not exist");return Go(i,e)}function zct(t){let e=(t-Io)/w3,r,n,i;for(r=t-Io,n=0;r%w3===bs;r/=w3,n++);for(i=w3;i<t&&Hct(i,e,t)!==t-Io;i++);if(n===1){let s=(t+Io)/qz;return function(l,u){let d=l.pow(u,s);if(!l.eql(l.sqr(d),u))throw new Error("Cannot find square root");return d}}let o=(r+Io)/w3;return function(a,l){if(a.pow(l,e)===a.neg(a.ONE))throw new Error("Cannot find square root");let u=n,d=a.pow(a.mul(a.ONE,i),r),p=a.pow(l,o),v=a.pow(l,r);for(;!a.eql(v,a.ONE);){if(a.eql(v,a.ZERO))return a.ZERO;let y=1;for(let R=a.sqr(v);y<u&&!a.eql(R,a.ONE);y++)R=a.sqr(R);let S=a.pow(d,Io<<BigInt(u-y-1));d=a.sqr(S),p=a.mul(p,S),v=a.mul(v,d),u=y}return p}}function Wct(t){if(t%qz===Fct){let e=(t+Io)/qz;return function(n,i){let o=n.pow(i,e);if(!n.eql(n.sqr(o),i))throw new Error("Cannot find square root");return o}}if(t%Wde===zde){let e=(t-zde)/Wde;return function(n,i){let o=n.mul(i,w3),s=n.pow(o,e),a=n.mul(i,s),l=n.mul(n.mul(a,w3),s),u=n.mul(a,n.sub(l,n.ONE));if(!n.eql(n.sqr(u),i))throw new Error("Cannot find square root");return u}}return t%qct,zct(t)}function dk(t){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=Vct.reduce((n,i)=>(n[i]="function",n),e);return Id(t,r)}function Kct(t,e,r){if(r<bs)throw new Error("Expected power > 0");if(r===bs)return t.ONE;if(r===Io)return e;let n=t.ONE,i=e;for(;r>bs;)r&Io&&(n=t.mul(n,i)),i=t.sqr(i),r>>=Io;return n}function Gct(t,e){let r=new Array(e.length),n=e.reduce((o,s,a)=>t.is0(s)?o:(r[a]=o,t.mul(o,s)),t.ONE),i=t.inv(n);return e.reduceRight((o,s,a)=>t.is0(s)?o:(r[a]=t.mul(o,r[a]),t.mul(o,s)),i),r}function Hz(t,e){let r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function Vde(t,e,r=!1,n={}){if(t<=bs)throw new Error(`Expected Field ORDER > 0, got ${t}`);let{nBitLength:i,nByteLength:o}=Hz(t,e);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");let s=Wct(t),a=Object.freeze({ORDER:t,BITS:i,BYTES:o,MASK:wE(i),ZERO:bs,ONE:Io,create:l=>Go(l,t),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return bs<=l&&l<t},is0:l=>l===bs,isOdd:l=>(l&Io)===Io,neg:l=>Go(-l,t),eql:(l,u)=>l===u,sqr:l=>Go(l*l,t),add:(l,u)=>Go(l+u,t),sub:(l,u)=>Go(l-u,t),mul:(l,u)=>Go(l*u,t),pow:(l,u)=>Kct(a,l,u),div:(l,u)=>Go(l*hk(u,t),t),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>hk(l,t),sqrt:n.sqrt||(l=>s(a,l)),invertBatch:l=>Gct(a,l),cmov:(l,u,d)=>d?u:l,toBytes:l=>r?fk(l,o):ch(l,o),fromBytes:l=>{if(l.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${l.length}`);return r?uk(l):vs(l)}});return Object.freeze(a)}function Kde(t){if(typeof t!="bigint")throw new Error("field order must be bigint");let e=t.toString(2).length;return Math.ceil(e/8)}function zz(t){let e=Kde(t);return e+Math.ceil(e/2)}function Gde(t,e,r=!1){let n=t.length,i=Kde(e),o=zz(e);if(n<16||n<o||n>1024)throw new Error(`expected ${o}-1024 bytes of input, got ${n}`);let s=r?vs(t):uk(t),a=Go(s,e-Io)+Io;return r?fk(a,i):ch(a,i)}var bs,Io,w3,Fct,qz,zde,Wde,$ct,qct,Vct,vE=F(()=>{g3();bs=BigInt(0),Io=BigInt(1),w3=BigInt(2),Fct=BigInt(3),qz=BigInt(4),zde=BigInt(5),Wde=BigInt(8),$ct=BigInt(9),qct=BigInt(16);Vct=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"]});function Qde(t,e){let r=(i,o)=>{let s=o.negate();return i?s:o},n=i=>{let o=Math.ceil(e/i)+1,s=2**(i-1);return{windows:o,windowSize:s}};return{constTimeNegate:r,unsafeLadder(i,o){let s=t.ZERO,a=i;for(;o>Zct;)o&Wz&&(s=s.add(a)),a=a.double(),o>>=Wz;return s},precomputeWindow(i,o){let{windows:s,windowSize:a}=n(o),l=[],u=i,d=u;for(let p=0;p<s;p++){d=u,l.push(d);for(let v=1;v<a;v++)d=d.add(u),l.push(d);u=d.double()}return l},wNAF(i,o,s){let{windows:a,windowSize:l}=n(i),u=t.ZERO,d=t.BASE,p=BigInt(2**i-1),v=2**i,y=BigInt(i);for(let S=0;S<a;S++){let R=S*l,O=Number(s&p);s>>=y,O>l&&(O-=v,s+=Wz);let k=R,M=R+Math.abs(O)-1,D=S%2!==0,j=O<0;O===0?d=d.add(r(D,o[k])):u=u.add(r(j,o[M]))}return{p:u,f:d}},wNAFCached(i,o,s,a){let l=i._WINDOW_SIZE||1,u=o.get(i);return u||(u=this.precomputeWindow(i,l),l!==1&&o.set(i,a(u))),this.wNAF(l,u,s)}}}function Vz(t){return dk(t.Fp),Id(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Hz(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}var Zct,Wz,Zde=F(()=>{vE();g3();Zct=BigInt(0),Wz=BigInt(1)});function Yct(t){let e=Vz(t);Id(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}function elt(t){let e=Yct(t),{Fp:r}=e,n=e.toBytes||((S,R,O)=>{let k=R.toAffine();return Oa(Uint8Array.from([4]),r.toBytes(k.x),r.toBytes(k.y))}),i=e.fromBytes||(S=>{let R=S.subarray(1),O=r.fromBytes(R.subarray(0,r.BYTES)),k=r.fromBytes(R.subarray(r.BYTES,2*r.BYTES));return{x:O,y:k}});function o(S){let{a:R,b:O}=e,k=r.sqr(S),M=r.mul(k,S);return r.add(r.add(M,r.mul(S,R)),O)}if(!r.eql(r.sqr(e.Gy),o(e.Gx)))throw new Error("bad generator point: equation left != right");function s(S){return typeof S=="bigint"&&lh<S&&S<e.n}function a(S){if(!s(S))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function l(S){let{allowedPrivateKeyLengths:R,nByteLength:O,wrapPrivateKey:k,n:M}=e;if(R&&typeof S!="bigint"){if(mg(S)&&(S=p3(S)),typeof S!="string"||!R.includes(S.length))throw new Error("Invalid key");S=S.padStart(O*2,"0")}let D;try{D=typeof S=="bigint"?S:vs(ys("private key",S,O))}catch{throw new Error(`private key must be ${O} bytes, hex or bigint, not ${typeof S}`)}return k&&(D=Go(D,M)),a(D),D}let u=new Map;function d(S){if(!(S instanceof p))throw new Error("ProjectivePoint expected")}class p{constructor(R,O,k){if(this.px=R,this.py=O,this.pz=k,R==null||!r.isValid(R))throw new Error("x required");if(O==null||!r.isValid(O))throw new Error("y required");if(k==null||!r.isValid(k))throw new Error("z required")}static fromAffine(R){let{x:O,y:k}=R||{};if(!R||!r.isValid(O)||!r.isValid(k))throw new Error("invalid affine point");if(R instanceof p)throw new Error("projective point not allowed");let M=D=>r.eql(D,r.ZERO);return M(O)&&M(k)?p.ZERO:new p(O,k,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(R){let O=r.invertBatch(R.map(k=>k.pz));return R.map((k,M)=>k.toAffine(O[M])).map(p.fromAffine)}static fromHex(R){let O=p.fromAffine(i(ys("pointHex",R)));return O.assertValidity(),O}static fromPrivateKey(R){return p.BASE.multiply(l(R))}_setWindowSize(R){this._WINDOW_SIZE=R,u.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!r.is0(this.py))return;throw new Error("bad point: ZERO")}let{x:R,y:O}=this.toAffine();if(!r.isValid(R)||!r.isValid(O))throw new Error("bad point: x or y not FE");let k=r.sqr(O),M=o(R);if(!r.eql(k,M))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:R}=this.toAffine();if(r.isOdd)return!r.isOdd(R);throw new Error("Field doesn't support isOdd")}equals(R){d(R);let{px:O,py:k,pz:M}=this,{px:D,py:j,pz:q}=R,W=r.eql(r.mul(O,q),r.mul(D,M)),V=r.eql(r.mul(k,q),r.mul(j,M));return W&&V}negate(){return new p(this.px,r.neg(this.py),this.pz)}double(){let{a:R,b:O}=e,k=r.mul(O,pk),{px:M,py:D,pz:j}=this,q=r.ZERO,W=r.ZERO,V=r.ZERO,P=r.mul(M,M),$=r.mul(D,D),U=r.mul(j,j),L=r.mul(M,D);return L=r.add(L,L),V=r.mul(M,j),V=r.add(V,V),q=r.mul(R,V),W=r.mul(k,U),W=r.add(q,W),q=r.sub($,W),W=r.add($,W),W=r.mul(q,W),q=r.mul(L,q),V=r.mul(k,V),U=r.mul(R,U),L=r.sub(P,U),L=r.mul(R,L),L=r.add(L,V),V=r.add(P,P),P=r.add(V,P),P=r.add(P,U),P=r.mul(P,L),W=r.add(W,P),U=r.mul(D,j),U=r.add(U,U),P=r.mul(U,L),q=r.sub(q,P),V=r.mul(U,$),V=r.add(V,V),V=r.add(V,V),new p(q,W,V)}add(R){d(R);let{px:O,py:k,pz:M}=this,{px:D,py:j,pz:q}=R,W=r.ZERO,V=r.ZERO,P=r.ZERO,$=e.a,U=r.mul(e.b,pk),L=r.mul(O,D),z=r.mul(k,j),f=r.mul(M,q),h=r.add(O,k),m=r.add(D,j);h=r.mul(h,m),m=r.add(L,z),h=r.sub(h,m),m=r.add(O,M);let b=r.add(D,q);return m=r.mul(m,b),b=r.add(L,f),m=r.sub(m,b),b=r.add(k,M),W=r.add(j,q),b=r.mul(b,W),W=r.add(z,f),b=r.sub(b,W),P=r.mul($,m),W=r.mul(U,f),P=r.add(W,P),W=r.sub(z,P),P=r.add(z,P),V=r.mul(W,P),z=r.add(L,L),z=r.add(z,L),f=r.mul($,f),m=r.mul(U,m),z=r.add(z,f),f=r.sub(L,f),f=r.mul($,f),m=r.add(m,f),L=r.mul(z,m),V=r.add(V,L),L=r.mul(b,m),W=r.mul(h,W),W=r.sub(W,L),L=r.mul(h,z),P=r.mul(b,P),P=r.add(P,L),new p(W,V,P)}subtract(R){return this.add(R.negate())}is0(){return this.equals(p.ZERO)}wNAF(R){return y.wNAFCached(this,u,R,O=>{let k=r.invertBatch(O.map(M=>M.pz));return O.map((M,D)=>M.toAffine(k[D])).map(p.fromAffine)})}multiplyUnsafe(R){let O=p.ZERO;if(R===lh)return O;if(a(R),R===To)return this;let{endo:k}=e;if(!k)return y.unsafeLadder(this,R);let{k1neg:M,k1:D,k2neg:j,k2:q}=k.splitScalar(R),W=O,V=O,P=this;for(;D>lh||q>lh;)D&To&&(W=W.add(P)),q&To&&(V=V.add(P)),P=P.double(),D>>=To,q>>=To;return M&&(W=W.negate()),j&&(V=V.negate()),V=new p(r.mul(V.px,k.beta),V.py,V.pz),W.add(V)}multiply(R){a(R);let O=R,k,M,{endo:D}=e;if(D){let{k1neg:j,k1:q,k2neg:W,k2:V}=D.splitScalar(O),{p:P,f:$}=this.wNAF(q),{p:U,f:L}=this.wNAF(V);P=y.constTimeNegate(j,P),U=y.constTimeNegate(W,U),U=new p(r.mul(U.px,D.beta),U.py,U.pz),k=P.add(U),M=$.add(L)}else{let{p:j,f:q}=this.wNAF(O);k=j,M=q}return p.normalizeZ([k,M])[0]}multiplyAndAddUnsafe(R,O,k){let M=p.BASE,D=(q,W)=>W===lh||W===To||!q.equals(M)?q.multiplyUnsafe(W):q.multiply(W),j=D(this,O).add(D(R,k));return j.is0()?void 0:j}toAffine(R){let{px:O,py:k,pz:M}=this,D=this.is0();R==null&&(R=D?r.ONE:r.inv(M));let j=r.mul(O,R),q=r.mul(k,R),W=r.mul(M,R);if(D)return{x:r.ZERO,y:r.ZERO};if(!r.eql(W,r.ONE))throw new Error("invZ was invalid");return{x:j,y:q}}isTorsionFree(){let{h:R,isTorsionFree:O}=e;if(R===To)return!0;if(O)return O(p,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:R,clearCofactor:O}=e;return R===To?this:O?O(p,this):this.multiplyUnsafe(e.h)}toRawBytes(R=!0){return this.assertValidity(),n(p,this,R)}toHex(R=!0){return p3(this.toRawBytes(R))}}p.BASE=new p(e.Gx,e.Gy,r.ONE),p.ZERO=new p(r.ZERO,r.ONE,r.ZERO);let v=e.nBitLength,y=Qde(p,e.endo?Math.ceil(v/2):v);return{CURVE:e,ProjectivePoint:p,normPrivateKeyToScalar:l,weierstrassEquation:o,isWithinCurveOrder:s}}function tlt(t){let e=Vz(t);return Id(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function Jde(t){let e=tlt(t),{Fp:r,n}=e,i=r.BYTES+1,o=2*r.BYTES+1;function s(m){return lh<m&&m<r.ORDER}function a(m){return Go(m,n)}function l(m){return hk(m,n)}let{ProjectivePoint:u,normPrivateKeyToScalar:d,weierstrassEquation:p,isWithinCurveOrder:v}=elt({...e,toBytes(m,b,C){let T=b.toAffine(),N=r.toBytes(T.x),I=Oa;return C?I(Uint8Array.from([b.hasEvenY()?2:3]),N):I(Uint8Array.from([4]),N,r.toBytes(T.y))},fromBytes(m){let b=m.length,C=m[0],T=m.subarray(1);if(b===i&&(C===2||C===3)){let N=vs(T);if(!s(N))throw new Error("Point is not on curve");let I=p(N),g;try{g=r.sqrt(I)}catch(re){let A=re instanceof Error?": "+re.message:"";throw new Error("Point is not on curve"+A)}let x=(g&To)===To;return(C&1)===1!==x&&(g=r.neg(g)),{x:N,y:g}}else if(b===o&&C===4){let N=r.fromBytes(T.subarray(0,r.BYTES)),I=r.fromBytes(T.subarray(r.BYTES,2*r.BYTES));return{x:N,y:I}}else throw new Error(`Point of length ${b} was invalid. Expected ${i} compressed bytes or ${o} uncompressed bytes`)}}),y=m=>p3(ch(m,e.nByteLength));function S(m){let b=n>>To;return m>b}function R(m){return S(m)?a(-m):m}let O=(m,b,C)=>vs(m.slice(b,C));class k{constructor(b,C,T){this.r=b,this.s=C,this.recovery=T,this.assertValidity()}static fromCompact(b){let C=e.nByteLength;return b=ys("compactSignature",b,C*2),new k(O(b,0,C),O(b,C,2*C))}static fromDER(b){let{r:C,s:T}=v3.toSig(ys("DER",b));return new k(C,T)}assertValidity(){if(!v(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!v(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(b){return new k(this.r,this.s,b)}recoverPublicKey(b){let{r:C,s:T,recovery:N}=this,I=V(ys("msgHash",b));if(N==null||![0,1,2,3].includes(N))throw new Error("recovery id invalid");let g=N===2||N===3?C+e.n:C;if(g>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");let x=N&1?"03":"02",Q=u.fromHex(x+y(g)),re=l(g),A=a(-I*re),G=a(T*re),Z=u.BASE.multiplyAndAddUnsafe(Q,A,G);if(!Z)throw new Error("point at infinify");return Z.assertValidity(),Z}hasHighS(){return S(this.s)}normalizeS(){return this.hasHighS()?new k(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return m3(this.toDERHex())}toDERHex(){return v3.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return m3(this.toCompactHex())}toCompactHex(){return y(this.r)+y(this.s)}}let M={isValidPrivateKey(m){try{return d(m),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{let m=zz(e.n);return Gde(e.randomBytes(m),e.n)},precompute(m=8,b=u.BASE){return b._setWindowSize(m),b.multiply(BigInt(3)),b}};function D(m,b=!0){return u.fromPrivateKey(m).toRawBytes(b)}function j(m){let b=mg(m),C=typeof m=="string",T=(b||C)&&m.length;return b?T===i||T===o:C?T===2*i||T===2*o:m instanceof u}function q(m,b,C=!0){if(j(m))throw new Error("first arg must be private key");if(!j(b))throw new Error("second arg must be public key");return u.fromHex(b).multiply(d(m)).toRawBytes(C)}let W=e.bits2int||function(m){let b=vs(m),C=m.length*8-e.nBitLength;return C>0?b>>BigInt(C):b},V=e.bits2int_modN||function(m){return a(W(m))},P=wE(e.nBitLength);function $(m){if(typeof m!="bigint")throw new Error("bigint expected");if(!(lh<=m&&m<P))throw new Error(`bigint expected < 2^${e.nBitLength}`);return ch(m,e.nByteLength)}function U(m,b,C=L){if(["recovered","canonical"].some(ue=>ue in C))throw new Error("sign() legacy options not supported");let{hash:T,randomBytes:N}=e,{lowS:I,prehash:g,extraEntropy:x}=C;I==null&&(I=!0),m=ys("msgHash",m),g&&(m=ys("prehashed msgHash",T(m)));let Q=V(m),re=d(b),A=[$(re),$(Q)];if(x!=null&&x!==!1){let ue=x===!0?N(r.BYTES):x;A.push(ys("extraEntropy",ue))}let G=Oa(...A),Z=Q;function Y(ue){let fe=W(ue);if(!v(fe))return;let ae=l(fe),me=u.BASE.multiply(fe).toAffine(),Ce=a(me.x);if(Ce===lh)return;let le=a(ae*a(Z+Ce*re));if(le===lh)return;let Se=(me.x===Ce?0:2)|Number(me.y&To),gt=le;return I&&S(le)&&(gt=R(le),Se^=1),new k(Ce,gt,Se)}return{seed:G,k2sig:Y}}let L={lowS:e.lowS,prehash:!1},z={lowS:e.lowS,prehash:!1};function f(m,b,C=L){let{seed:T,k2sig:N}=U(m,b,C),I=e;return Fz(I.hash.outputLen,I.nByteLength,I.hmac)(T,N)}u.BASE._setWindowSize(8);function h(m,b,C,T=z){let N=m;if(b=ys("msgHash",b),C=ys("publicKey",C),"strict"in T)throw new Error("options.strict was renamed to lowS");let{lowS:I,prehash:g}=T,x,Q;try{if(typeof N=="string"||mg(N))try{x=k.fromDER(N)}catch(me){if(!(me instanceof v3.Err))throw me;x=k.fromCompact(N)}else if(typeof N=="object"&&typeof N.r=="bigint"&&typeof N.s=="bigint"){let{r:me,s:Ce}=N;x=new k(me,Ce)}else throw new Error("PARSE");Q=u.fromHex(C)}catch(me){if(me.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(I&&x.hasHighS())return!1;g&&(b=e.hash(b));let{r:re,s:A}=x,G=V(b),Z=l(A),Y=a(G*Z),ue=a(re*Z),fe=u.BASE.multiplyAndAddUnsafe(Q,Y,ue)?.toAffine();return fe?a(fe.x)===re:!1}return{CURVE:e,getPublicKey:D,getSharedSecret:q,sign:f,verify:h,ProjectivePoint:u,Signature:k,utils:M}}function rlt(t,e){let r=t.ORDER,n=lh;for(let S=r-To;S%gg===lh;S/=gg)n+=To;let i=n,o=gg<<i-To-To,s=o*gg,a=(r-To)/s,l=(a-To)/gg,u=s-To,d=o,p=t.pow(e,a),v=t.pow(e,(a+To)/gg),y=(S,R)=>{let O=p,k=t.pow(R,u),M=t.sqr(k);M=t.mul(M,R);let D=t.mul(S,M);D=t.pow(D,l),D=t.mul(D,k),k=t.mul(D,R),M=t.mul(D,S);let j=t.mul(M,k);D=t.pow(j,d);let q=t.eql(D,t.ONE);k=t.mul(M,v),D=t.mul(j,O),M=t.cmov(k,M,q),j=t.cmov(D,j,q);for(let W=i;W>To;W--){let V=W-gg;V=gg<<V-To;let P=t.pow(j,V),$=t.eql(P,t.ONE);k=t.mul(M,O),O=t.mul(O,O),P=t.mul(j,O),M=t.cmov(k,M,$),j=t.cmov(P,j,$)}return{isValid:q,value:M}};if(t.ORDER%Yde===pk){let S=(t.ORDER-pk)/Yde,R=t.sqrt(t.neg(e));y=(O,k)=>{let M=t.sqr(k),D=t.mul(O,k);M=t.mul(M,D);let j=t.pow(M,S);j=t.mul(j,D);let q=t.mul(j,R),W=t.mul(t.sqr(j),k),V=t.eql(W,O),P=t.cmov(q,j,V);return{isValid:V,value:P}}}return y}function Xde(t,e){if(dk(t),!t.isValid(e.A)||!t.isValid(e.B)||!t.isValid(e.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");let r=rlt(t,e.Z);if(!t.isOdd)throw new Error("Fp.isOdd is not implemented!");return n=>{let i,o,s,a,l,u,d,p;i=t.sqr(n),i=t.mul(i,e.Z),o=t.sqr(i),o=t.add(o,i),s=t.add(o,t.ONE),s=t.mul(s,e.B),a=t.cmov(e.Z,t.neg(o),!t.eql(o,t.ZERO)),a=t.mul(a,e.A),o=t.sqr(s),u=t.sqr(a),l=t.mul(u,e.A),o=t.add(o,l),o=t.mul(o,s),u=t.mul(u,a),l=t.mul(u,e.B),o=t.add(o,l),d=t.mul(i,s);let{isValid:v,value:y}=r(o,u);p=t.mul(i,n),p=t.mul(p,y),d=t.cmov(d,s,v),p=t.cmov(p,y,v);let S=t.isOdd(n)===t.isOdd(p);return p=t.cmov(t.neg(p),p,S),d=t.div(d,a),{x:d,y:p}}}var Jct,Xct,v3,lh,To,gg,pk,Yde,Kz=F(()=>{vE();g3();g3();Zde();({bytesToNumberBE:Jct,hexToBytes:Xct}=$z),v3={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){let{Err:e}=v3;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");let r=t[1],n=t.subarray(2,r+2);if(!r||n.length!==r)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:Jct(n),l:t.subarray(r+2)}},toSig(t){let{Err:e}=v3,r=typeof t=="string"?Xct(t):t;zu(r);let n=r.length;if(n<2||r[0]!=48)throw new e("Invalid signature tag");if(r[1]!==n-2)throw new e("Invalid signature: incorrect length");let{d:i,l:o}=v3._parseInt(r.subarray(2)),{d:s,l:a}=v3._parseInt(o);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s}},hexFromSig(t){let e=u=>Number.parseInt(u[0],16)&8?"00"+u:u,r=u=>{let d=u.toString(16);return d.length&1?`0${d}`:d},n=e(r(t.s)),i=e(r(t.r)),o=n.length/2,s=i.length/2,a=r(o),l=r(s);return`30${r(s+o+4)}02${l}${i}02${a}${n}`}},lh=BigInt(0),To=BigInt(1),gg=BigInt(2),pk=BigInt(3),Yde=BigInt(4)});function wg(t,e){if(t<0||t>=1<<8*e)throw new Error(`bad I2OSP call: value=${t} length=${e}`);let r=Array.from({length:e}).fill(0);for(let n=e-1;n>=0;n--)r[n]=t&255,t>>>=8;return new Uint8Array(r)}function ilt(t,e){let r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t[n]^e[n];return r}function Gz(t){if(!Number.isSafeInteger(t))throw new Error("number expected")}function olt(t,e,r,n){zu(t),zu(e),Gz(r),e.length>255&&(e=n(Oa(gE("H2C-OVERSIZE-DST-"),e)));let{outputLen:i,blockLen:o}=n,s=Math.ceil(r/i);if(s>255)throw new Error("Invalid xmd length");let a=Oa(e,wg(e.length,1)),l=wg(0,o),u=wg(r,2),d=new Array(s),p=n(Oa(l,t,u,wg(0,1),a));d[0]=n(Oa(p,wg(1,1),a));for(let y=1;y<=s;y++){let S=[ilt(p,d[y-1]),wg(y+1,1),a];d[y]=n(Oa(...S))}return Oa(...d).slice(0,r)}function slt(t,e,r,n,i){if(zu(t),zu(e),Gz(r),e.length>255){let o=Math.ceil(2*n/8);e=i.create({dkLen:o}).update(gE("H2C-OVERSIZE-DST-")).update(e).digest()}if(r>65535||e.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return i.create({dkLen:r}).update(t).update(wg(r,2)).update(e).update(wg(e.length,1)).digest()}function e0e(t,e,r){Id(r,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});let{p:n,k:i,m:o,hash:s,expand:a,DST:l}=r;zu(t),Gz(e);let u=typeof l=="string"?gE(l):l,d=n.toString(2).length,p=Math.ceil((d+i)/8),v=e*o*p,y;if(a==="xmd")y=olt(t,u,v,s);else if(a==="xof")y=slt(t,u,v,i,s);else if(a==="_internal_pass")y=t;else throw new Error('expand must be "xmd" or "xof"');let S=new Array(e);for(let R=0;R<e;R++){let O=new Array(o);for(let k=0;k<o;k++){let M=p*(k+R*o),D=y.subarray(M,M+p);O[k]=Go(nlt(D),n)}S[R]=O}return S}function t0e(t,e){let r=e.map(n=>Array.from(n).reverse());return(n,i)=>{let[o,s,a,l]=r.map(u=>u.reduce((d,p)=>t.add(t.mul(d,n),p)));return n=t.div(o,s),i=t.mul(i,t.div(a,l)),{x:n,y:i}}}function r0e(t,e,r){if(typeof e!="function")throw new Error("mapToCurve() must be defined");return{hashToCurve(n,i){let o=e0e(n,2,{...r,DST:r.DST,...i}),s=t.fromAffine(e(o[0])),a=t.fromAffine(e(o[1])),l=s.add(a).clearCofactor();return l.assertValidity(),l},encodeToCurve(n,i){let o=e0e(n,1,{...r,DST:r.encodeDST,...i}),s=t.fromAffine(e(o[0])).clearCofactor();return s.assertValidity(),s}}}var nlt,n0e=F(()=>{vE();g3();nlt=vs});var mk,Qz,i0e=F(()=>{dE();h3();mk=class extends lg{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,dde(e);let n=ug(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,o=new Uint8Array(i);o.set(n.length>i?e.create().update(n).digest():n);for(let s=0;s<o.length;s++)o[s]^=54;this.iHash.update(o),this.oHash=e.create();for(let s=0;s<o.length;s++)o[s]^=106;this.oHash.update(o),o.fill(0)}update(e){return Zp(this),this.iHash.update(e),this}digestInto(e){Zp(this),cg(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));let{oHash:r,iHash:n,finished:i,destroyed:o,blockLen:s,outputLen:a}=this;return e=e,e.finished=i,e.destroyed=o,e.blockLen=s,e.outputLen=a,e.oHash=r._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},Qz=(t,e,r)=>new mk(t,e).update(r).digest();Qz.create=(t,e)=>new mk(t,e)});function alt(t){return{hash:t,hmac:(e,...r)=>Qz(t,e,Cde(...r)),randomBytes:ok}}function o0e(t,e){let r=n=>Jde({...t,...alt(n)});return Object.freeze({...r(e),create:r})}var s0e=F(()=>{i0e();h3();Kz();});var g0e={};qr(g0e,{encodeToCurve:()=>glt,hashToCurve:()=>mlt,schnorr:()=>hlt,secp256k1:()=>bE});function u0e(t){let e=yk,r=BigInt(3),n=BigInt(6),i=BigInt(11),o=BigInt(22),s=BigInt(23),a=BigInt(44),l=BigInt(88),u=t*t*t%e,d=u*u*t%e,p=Vl(d,r,e)*d%e,v=Vl(p,r,e)*d%e,y=Vl(v,wk,e)*u%e,S=Vl(y,i,e)*y%e,R=Vl(S,o,e)*S%e,O=Vl(R,a,e)*R%e,k=Vl(O,l,e)*O%e,M=Vl(k,a,e)*R%e,D=Vl(M,r,e)*d%e,j=Vl(D,s,e)*S%e,q=Vl(j,n,e)*u%e,W=Vl(q,wk,e);if(!vg.eql(vg.sqr(W),t))throw new Error("Cannot find square root");return W}function vk(t,...e){let r=c0e[t];if(r===void 0){let n=d3(Uint8Array.from(t,i=>i.charCodeAt(0)));r=Oa(n,n),c0e[t]=r}return d3(Oa(r,...e))}function Jz(t){let e=bE.utils.normPrivateKeyToScalar(t),r=eW.fromPrivateKey(e);return{scalar:r.hasEvenY()?e:yE(-e),bytes:Xz(r)}}function h0e(t){if(!f0e(t))throw new Error("bad x: need 0 < x < p");let e=Zz(t*t),r=Zz(e*t+BigInt(7)),n=u0e(r);n%wk!==bk&&(n=Zz(-n));let i=new eW(t,n,l0e);return i.assertValidity(),i}function d0e(...t){return yE(vs(vk("BIP0340/challenge",...t)))}function ult(t){return Jz(t).bytes}function flt(t,e,r=ok(32)){let n=ys("message",t),{bytes:i,scalar:o}=Jz(e),s=ys("auxRand",r,32),a=Yz(o^vs(vk("BIP0340/aux",s))),l=vk("BIP0340/nonce",a,i,n),u=yE(vs(l));if(u===bk)throw new Error("sign failed: k is zero");let{bytes:d,scalar:p}=Jz(u),v=d0e(d,i,n),y=new Uint8Array(64);if(y.set(d,0),y.set(Yz(yE(p+v*o)),32),!p0e(y,n,i))throw new Error("sign: Invalid signature produced");return y}function p0e(t,e,r){let n=ys("signature",t,64),i=ys("message",e),o=ys("publicKey",r,32);try{let s=h0e(vs(o)),a=vs(n.subarray(0,32));if(!f0e(a))return!1;let l=vs(n.subarray(32,64));if(!clt(l))return!1;let u=d0e(Yz(a),Xz(s),i),d=llt(s,l,yE(-u));return!(!d||!d.hasEvenY()||d.toAffine().x!==a)}catch{return!1}}var yk,gk,l0e,wk,a0e,vg,bE,bk,f0e,clt,c0e,Xz,Yz,Zz,yE,eW,llt,hlt,dlt,plt,m0e,mlt,glt,w0e=F(()=>{Lz();h3();vE();Kz();g3();n0e();s0e();yk=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),gk=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),l0e=BigInt(1),wk=BigInt(2),a0e=(t,e)=>(t+e/wk)/e;vg=Vde(yk,void 0,void 0,{sqrt:u0e}),bE=o0e({a:BigInt(0),b:BigInt(7),Fp:vg,n:gk,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{let e=gk,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-l0e*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,s=BigInt("0x100000000000000000000000000000000"),a=a0e(o*t,e),l=a0e(-n*t,e),u=Go(t-a*r-l*i,e),d=Go(-a*n-l*o,e),p=u>s,v=d>s;if(p&&(u=e-u),v&&(d=e-d),u>s||d>s)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:p,k1:u,k2neg:v,k2:d}}}},d3),bk=BigInt(0),f0e=t=>typeof t=="bigint"&&bk<t&&t<yk,clt=t=>typeof t=="bigint"&&bk<t&&t<gk,c0e={};Xz=t=>t.toRawBytes(!0).slice(1),Yz=t=>ch(t,32),Zz=t=>Go(t,yk),yE=t=>Go(t,gk),eW=bE.ProjectivePoint,llt=(t,e,r)=>eW.BASE.multiplyAndAddUnsafe(t,e,r);hlt={getPublicKey:ult,sign:flt,verify:p0e,utils:{randomPrivateKey:bE.utils.randomPrivateKey,lift_x:h0e,pointToBytes:Xz,numberToBytesBE:ch,bytesToNumberBE:vs,taggedHash:vk,mod:Go}},dlt=t0e(vg,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(t=>t.map(e=>BigInt(e)))),plt=Xde(vg,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:vg.create(BigInt("-11"))}),m0e=r0e(bE.ProjectivePoint,t=>{let{x:e,y:r}=plt(vg.create(t[0]));return dlt(e,r)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:vg.ORDER,m:1,k:128,expand:"xmd",hash:d3}),mlt=m0e.hashToCurve,glt=m0e.encodeToCurve});async function y0e({hash:t,signature:e}){let r=ws(t)?t:Pt(t),{secp256k1:n}=await Promise.resolve().then(()=>(w0e(),g0e));return`0x${(()=>{if(typeof e=="object"&&"r"in e&&"s"in e){let{r:u,s:d,v:p,yParity:v}=e,y=Number(v??p),S=v0e(y);return new n.Signature(Wn(u),Wn(d)).addRecoveryBit(S)}let s=ws(e)?e:Pt(e),a=Ps(`0x${s.slice(130)}`),l=v0e(a);return n.Signature.fromCompact(s.substring(2,130)).addRecoveryBit(l)})().recoverPublicKey(r.substring(2)).toHex(!1)}`}function v0e(t){if(t===0||t===1)return t;if(t===27)return 0;if(t===28)return 1;throw new Error("Invalid yParityOrV value")}var b0e=F(()=>{xd();Na();Vr()});async function x0e({hash:t,signature:e}){return Bde(await y0e({hash:t,signature:e}))}var E0e=F(()=>{Dde();b0e()});var xE,xk,Ek,C0e=F(()=>{mn();xE=class extends Oe{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`,{name:"NegativeOffsetError"})}},xk=class extends Oe{constructor({length:e,position:r}){super(`Position \`${r}\` is out of bounds (\`0 < position < ${e}\`).`,{name:"PositionOutOfBoundsError"})}},Ek=class extends Oe{constructor({count:e,limit:r}){super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${e}\`).`,{name:"RecursiveReadLimitExceededError"})}}});function h5(t,{recursiveReadLimit:e=8192}={}){let r=Object.create(wlt);return r.bytes=t,r.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=e,r}var wlt,Ck=F(()=>{C0e();wlt={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new Ek({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(t){if(t<0||t>this.bytes.length-1)throw new xk({length:this.bytes.length,position:t})},decrementPosition(t){if(t<0)throw new xE({offset:t});let e=this.position-t;this.assertPosition(e),this.position=e},getReadCount(t){return this.positionReadCount.get(t||this.position)||0},incrementPosition(t){if(t<0)throw new xE({offset:t});let e=this.position+t;this.assertPosition(e),this.position=e},inspectByte(t){let e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectBytes(t,e){let r=e??this.position;return this.assertPosition(r+t-1),this.bytes.subarray(r,r+t)},inspectUint8(t){let e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectUint16(t){let e=t??this.position;return this.assertPosition(e+1),this.dataView.getUint16(e)},inspectUint24(t){let e=t??this.position;return this.assertPosition(e+2),(this.dataView.getUint16(e)<<8)+this.dataView.getUint8(e+2)},inspectUint32(t){let e=t??this.position;return this.assertPosition(e+3),this.dataView.getUint32(e)},pushByte(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushBytes(t){this.assertPosition(this.position+t.length-1),this.bytes.set(t,this.position),this.position+=t.length},pushUint8(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushUint16(t){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,t),this.position+=2},pushUint24(t){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,t>>8),this.dataView.setUint8(this.position+2,t&255),this.position+=3},pushUint32(t){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,t),this.position+=4},readByte(){this.assertReadLimit(),this._touch();let t=this.inspectByte();return this.position++,t},readBytes(t,e){this.assertReadLimit(),this._touch();let r=this.inspectBytes(t);return this.position+=e??t,r},readUint8(){this.assertReadLimit(),this._touch();let t=this.inspectUint8();return this.position+=1,t},readUint16(){this.assertReadLimit(),this._touch();let t=this.inspectUint16();return this.position+=2,t},readUint24(){this.assertReadLimit(),this._touch();let t=this.inspectUint24();return this.position+=3,t},readUint32(){this.assertReadLimit(),this._touch();let t=this.inspectUint32();return this.position+=4,t},get remaining(){return this.bytes.length-this.position},setPosition(t){let e=this.position;return this.assertPosition(t),this.position=t,()=>this.position=e},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;let t=this.getReadCount();this.positionReadCount.set(this.position,t+1),t>0&&this.recursiveReadCount++}}});function wc(t,e="hex"){let r=A0e(t),n=h5(new Uint8Array(r.length));return r.encode(n),e==="hex"?ri(n.bytes):n.bytes}function A0e(t){return Array.isArray(t)?vlt(t.map(e=>A0e(e))):ylt(t)}function vlt(t){let e=t.reduce((i,o)=>i+o.length,0),r=S0e(e);return{length:e<=55?1+e:1+r+e,encode(i){e<=55?i.pushByte(192+e):(i.pushByte(247+r),r===1?i.pushUint8(e):r===2?i.pushUint16(e):r===3?i.pushUint24(e):i.pushUint32(e));for(let{encode:o}of t)o(i)}}}function ylt(t){let e=typeof t=="string"?Ko(t):t,r=S0e(e.length);return{length:e.length===1&&e[0]<128?1:e.length<=55?1+e.length:1+r+e.length,encode(i){e.length===1&&e[0]<128?i.pushBytes(e):e.length<=55?(i.pushByte(128+e.length),i.pushBytes(e)):(i.pushByte(183+r),r===1?i.pushUint8(e.length):r===2?i.pushUint16(e.length):r===3?i.pushUint24(e.length):i.pushUint32(e.length),i.pushBytes(e))}}}function S0e(t){if(t<2**8)return 1;if(t<2**16)return 2;if(t<2**24)return 3;if(t<2**32)return 4;throw new Oe("Length is too large.")}var d5=F(()=>{mn();Ck();aa();Vr()});function _0e(t){let{chainId:e,contractAddress:r,nonce:n,to:i}=t,o=Fi(Bs(["0x05",wc([tr(e),r,tr(n)])]));return i==="bytes"?Ko(o):o}var I0e=F(()=>{zl();aa();Vr();d5();Sd()});async function Ak(t){let{authorization:e,signature:r}=t;return x0e({hash:_0e(e),signature:r??e})}var tW=F(()=>{E0e();I0e()});var y3,Sk,_k,EE,uh,b3=F(()=>{mn();y3=class extends Oe{constructor({blockNumber:e,chain:r,contract:n}){super(`Chain "${r.name}" does not support contract "${n.name}".`,{metaMessages:["This could be due to any of the following:",...e&&n.blockCreated&&n.blockCreated>e?[`- The contract "${n.name}" was not deployed until block ${n.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${n.name}" configured.`]],name:"ChainDoesNotSupportContract"})}},Sk=class extends Oe{constructor({chain:e,currentChainId:r}){super(`The current chain of the wallet (id: ${r}) does not match the target chain for the transaction (id: ${e.id} \u2013 ${e.name}).`,{metaMessages:[`Current Chain ID: ${r}`,`Expected Chain ID: ${e.id} \u2013 ${e.name}`],name:"ChainMismatchError"})}},_k=class extends Oe{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(` | |
`),{name:"ChainNotFoundError"})}},EE=class extends Oe{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}},uh=class extends Oe{constructor({chainId:e}){super(typeof e=="number"?`Chain ID "${e}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}});function Ik({chain:t,currentChainId:e}){if(!t)throw new _k;if(e!==t.id)throw new Sk({chain:t,currentChainId:e})}var rW=F(()=>{b3()});var nW,iW,oW,Tk=F(()=>{nW={gwei:9,wei:18},iW={ether:-9,wei:9},oW={ether:-18,gwei:-9}});function Td(t,e){let r=t.toString(),n=r.startsWith("-");n&&(r=r.slice(1)),r=r.padStart(e,"0");let[i,o]=[r.slice(0,r.length-e),r.slice(r.length-e)];return o=o.replace(/(0+)$/,""),`${n?"-":""}${i||"0"}${o?`.${o}`:""}`}var kk=F(()=>{});function xs(t,e="wei"){return Td(t,iW[e])}var p5=F(()=>{Tk();kk()});var em,rl,m5,g5,w5,v5,y5,b5,x5,E5,Wu,kd,yg=F(()=>{p5();mn();em=class extends Oe{constructor({cause:e,message:r}={}){let n=r?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${n?`with reason: ${n}`:"for an unknown reason"}.`,{cause:e,name:"ExecutionRevertedError"})}};Object.defineProperty(em,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(em,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});rl=class extends Oe{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${xs(r)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e,name:"FeeCapTooHighError"})}};Object.defineProperty(rl,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});m5=class extends Oe{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${xs(r)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e,name:"FeeCapTooLowError"})}};Object.defineProperty(m5,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});g5=class extends Oe{constructor({cause:e,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}is higher than the next one expected.`,{cause:e,name:"NonceTooHighError"})}};Object.defineProperty(g5,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});w5=class extends Oe{constructor({cause:e,nonce:r}={}){super([`Nonce provided for the transaction ${r?`(${r}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(` | |
`),{cause:e,name:"NonceTooLowError"})}};Object.defineProperty(w5,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});v5=class extends Oe{constructor({cause:e,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}exceeds the maximum allowed nonce.`,{cause:e,name:"NonceMaxValueError"})}};Object.defineProperty(v5,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});y5=class extends Oe{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(` | |
`),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}};Object.defineProperty(y5,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds/});b5=class extends Oe{constructor({cause:e,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e,name:"IntrinsicGasTooHighError"})}};Object.defineProperty(b5,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});x5=class extends Oe{constructor({cause:e,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction is too low.`,{cause:e,name:"IntrinsicGasTooLowError"})}};Object.defineProperty(x5,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});E5=class extends Oe{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e,name:"TransactionTypeNotSupportedError"})}};Object.defineProperty(E5,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});Wu=class extends Oe{constructor({cause:e,maxPriorityFeePerGas:r,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${r?` = ${xs(r)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${xs(n)} gwei`:""}).`].join(` | |
`),{cause:e,name:"TipAboveFeeCapError"})}};Object.defineProperty(Wu,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});kd=class extends Oe{constructor({cause:e}){super(`An error occurred while executing: ${e?.shortMessage}`,{cause:e,name:"UnknownNodeError"})}}});function C5(t,e="wei"){return Td(t,nW[e])}var Rk=F(()=>{Tk();kk()});function x3(t){let e=Object.entries(t).map(([n,i])=>i===void 0||i===!1?null:[n,i]).filter(Boolean),r=e.reduce((n,[i])=>Math.max(n,i.length),0);return e.map(([n,i])=>` ${`${n}:`.padEnd(r+1)} ${i}`).join(` | |
`)}var Mk,Nk,Ok,Pk,Bk,A5,S5,CE,fh=F(()=>{Rk();p5();mn();Mk=class extends Oe{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(` | |
`),{name:"FeeConflictError"})}},Nk=class extends Oe{constructor({v:e}){super(`Invalid \`v\` value "${e}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}},Ok=class extends Oe{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",x3(e),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}},Pk=class extends Oe{constructor({storageKey:e}){super(`Size for storage key "${e}" is invalid. Expected 32 bytes. Got ${Math.floor((e.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}},Bk=class extends Oe{constructor(e,{account:r,docsPath:n,chain:i,data:o,gas:s,gasPrice:a,maxFeePerGas:l,maxPriorityFeePerGas:u,nonce:d,to:p,value:v}){let y=x3({chain:i&&`${i?.name} (id: ${i?.id})`,from:r?.address,to:p,value:typeof v<"u"&&`${C5(v)} ${i?.nativeCurrency?.symbol||"ETH"}`,data:o,gas:s,gasPrice:typeof a<"u"&&`${xs(a)} gwei`,maxFeePerGas:typeof l<"u"&&`${xs(l)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${xs(u)} gwei`,nonce:d});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Request Arguments:",y].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}},A5=class extends Oe{constructor({blockHash:e,blockNumber:r,blockTag:n,hash:i,index:o}){let s="Transaction";n&&o!==void 0&&(s=`Transaction at block time "${n}" at index "${o}"`),e&&o!==void 0&&(s=`Transaction at block hash "${e}" at index "${o}"`),r&&o!==void 0&&(s=`Transaction at block number "${r}" at index "${o}"`),i&&(s=`Transaction with hash "${i}"`),super(`${s} could not be found.`,{name:"TransactionNotFoundError"})}},S5=class extends Oe{constructor({hash:e}){super(`Transaction receipt with hash "${e}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}},CE=class extends Oe{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}});var so,Rd=F(()=>{so=(t,e,r)=>JSON.stringify(t,(n,i)=>{let o=typeof i=="bigint"?i.toString():i;return typeof e=="function"?e(n,o):o},r)});var T0e,E3,Dk=F(()=>{T0e=t=>t,E3=t=>t});var Vu,_5,AE,I5=F(()=>{Rd();mn();Dk();Vu=class extends Oe{constructor({body:e,cause:r,details:n,headers:i,status:o,url:s}){super("HTTP request failed.",{cause:r,details:n,metaMessages:[o&&`Status: ${o}`,`URL: ${E3(s)}`,e&&`Request body: ${so(e)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=i,this.status=o,this.url=s}},_5=class extends Oe{constructor({body:e,error:r,url:n}){super("RPC Request failed.",{cause:r,details:r.message,metaMessages:[`URL: ${E3(n)}`,`Request body: ${so(e)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=r.code}},AE=class extends Oe{constructor({body:e,url:r}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${E3(r)}`,`Request body: ${so(e)}`],name:"TimeoutError"})}}});var blt,ca,tm,C3,A3,S3,_3,Md,I3,T3,hh,k3,R3,bg,M3,yi,N3,O3,P3,B3,la,SE,Lk=F(()=>{mn();I5();blt=-1,ca=class extends Oe{constructor(e,{code:r,docsPath:n,metaMessages:i,name:o,shortMessage:s}){super(s,{cause:e,docsPath:n,metaMessages:i||e?.metaMessages,name:o||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=o||e.name,this.code=e instanceof _5?e.code:r??blt}},tm=class extends ca{constructor(e,r){super(e,r),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=r.data}},C3=class t extends ca{constructor(e){super(e,{code:t.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}};Object.defineProperty(C3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});A3=class t extends ca{constructor(e){super(e,{code:t.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}};Object.defineProperty(A3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});S3=class t extends ca{constructor(e,{method:r}={}){super(e,{code:t.code,name:"MethodNotFoundRpcError",shortMessage:`The method${r?` "${r}"`:""} does not exist / is not available.`})}};Object.defineProperty(S3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});_3=class t extends ca{constructor(e){super(e,{code:t.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(` | |
`)})}};Object.defineProperty(_3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});Md=class t extends ca{constructor(e){super(e,{code:t.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}};Object.defineProperty(Md,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});I3=class t extends ca{constructor(e){super(e,{code:t.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(` | |
`)})}};Object.defineProperty(I3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});T3=class t extends ca{constructor(e){super(e,{code:t.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}};Object.defineProperty(T3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});hh=class t extends ca{constructor(e){super(e,{code:t.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}};Object.defineProperty(hh,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});k3=class t extends ca{constructor(e){super(e,{code:t.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}};Object.defineProperty(k3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});R3=class t extends ca{constructor(e,{method:r}={}){super(e,{code:t.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${r?` "${r}"`:""} is not implemented.`})}};Object.defineProperty(R3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});bg=class t extends ca{constructor(e){super(e,{code:t.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}};Object.defineProperty(bg,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});M3=class t extends ca{constructor(e){super(e,{code:t.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}};Object.defineProperty(M3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});yi=class t extends tm{constructor(e){super(e,{code:t.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}};Object.defineProperty(yi,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});N3=class t extends tm{constructor(e){super(e,{code:t.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}};Object.defineProperty(N3,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});O3=class t extends tm{constructor(e,{method:r}={}){super(e,{code:t.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${r?` " ${r}"`:""}.`})}};Object.defineProperty(O3,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});P3=class t extends tm{constructor(e){super(e,{code:t.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}};Object.defineProperty(P3,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});B3=class t extends tm{constructor(e){super(e,{code:t.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}};Object.defineProperty(B3,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});la=class t extends tm{constructor(e){super(e,{code:t.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}};Object.defineProperty(la,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});SE=class extends ca{constructor(e){super(e,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}});function T5(t,e){let r=(t.details||"").toLowerCase(),n=t instanceof Oe?t.walk(i=>i.code===em.code):t;return n instanceof Oe?new em({cause:t,message:n.details}):em.nodeMessage.test(r)?new em({cause:t,message:t.details}):rl.nodeMessage.test(r)?new rl({cause:t,maxFeePerGas:e?.maxFeePerGas}):m5.nodeMessage.test(r)?new m5({cause:t,maxFeePerGas:e?.maxFeePerGas}):g5.nodeMessage.test(r)?new g5({cause:t,nonce:e?.nonce}):w5.nodeMessage.test(r)?new w5({cause:t,nonce:e?.nonce}):v5.nodeMessage.test(r)?new v5({cause:t,nonce:e?.nonce}):y5.nodeMessage.test(r)?new y5({cause:t}):b5.nodeMessage.test(r)?new b5({cause:t,gas:e?.gas}):x5.nodeMessage.test(r)?new x5({cause:t,gas:e?.gas}):E5.nodeMessage.test(r)?new E5({cause:t}):Wu.nodeMessage.test(r)?new Wu({cause:t,maxFeePerGas:e?.maxFeePerGas,maxPriorityFeePerGas:e?.maxPriorityFeePerGas}):new kd({cause:t})}var Uk=F(()=>{mn();yg()});function k0e(t,{docsPath:e,...r}){let n=(()=>{let i=T5(t,r);return i instanceof kd?t:i})();return new Bk(n,{docsPath:e,...r})}var R0e=F(()=>{yg();fh();Uk()});function k5(t,{format:e}){if(!e)return{};let r={};function n(o){let s=Object.keys(o);for(let a of s)a in t&&(r[a]=t[a]),o[a]&&typeof o[a]=="object"&&!Array.isArray(o[a])&&n(o[a])}let i=e(t||{});return n(i),r}var jk=F(()=>{});function xg(t,e){return({exclude:r,format:n})=>({exclude:r,format:i=>{let o=e(i);if(r)for(let s of r)delete o[s];return{...o,...n(i)}},type:t})}var _E=F(()=>{});function rm(t){let e={};return typeof t.authorizationList<"u"&&(e.authorizationList=Elt(t.authorizationList)),typeof t.accessList<"u"&&(e.accessList=t.accessList),typeof t.blobVersionedHashes<"u"&&(e.blobVersionedHashes=t.blobVersionedHashes),typeof t.blobs<"u"&&(typeof t.blobs[0]!="string"?e.blobs=t.blobs.map(r=>ri(r)):e.blobs=t.blobs),typeof t.data<"u"&&(e.data=t.data),typeof t.from<"u"&&(e.from=t.from),typeof t.gas<"u"&&(e.gas=tr(t.gas)),typeof t.gasPrice<"u"&&(e.gasPrice=tr(t.gasPrice)),typeof t.maxFeePerBlobGas<"u"&&(e.maxFeePerBlobGas=tr(t.maxFeePerBlobGas)),typeof t.maxFeePerGas<"u"&&(e.maxFeePerGas=tr(t.maxFeePerGas)),typeof t.maxPriorityFeePerGas<"u"&&(e.maxPriorityFeePerGas=tr(t.maxPriorityFeePerGas)),typeof t.nonce<"u"&&(e.nonce=tr(t.nonce)),typeof t.to<"u"&&(e.to=t.to),typeof t.type<"u"&&(e.type=xlt[t.type]),typeof t.value<"u"&&(e.value=tr(t.value)),e}function Elt(t){return t.map(e=>({address:e.contractAddress,r:e.r,s:e.s,chainId:tr(e.chainId),nonce:tr(e.nonce),...typeof e.yParity<"u"?{yParity:tr(e.yParity)}:{},...typeof e.v<"u"&&typeof e.yParity>"u"?{v:tr(e.v)}:{}}))}var xlt,Fk,D3=F(()=>{Vr();_E();xlt={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};Fk=xg("transactionRequest",rm)});function en(t,e,r){let n=t[e.name];if(typeof n=="function")return n;let i=t[r];return typeof i=="function"?i:o=>e(t,o)}var Pa=F(()=>{});function Nd(t){let{account:e,gasPrice:r,maxFeePerGas:n,maxPriorityFeePerGas:i,to:o}=t,s=e?Ti(e):void 0;if(s&&!$n(s.address))throw new ni({address:s.address});if(o&&!$n(o))throw new ni({address:o});if(typeof r<"u"&&(typeof n<"u"||typeof i<"u"))throw new Mk;if(n&&n>2n**256n-1n)throw new rl({maxFeePerGas:n});if(i&&n&&i>n)throw new Wu({maxFeePerGas:n,maxPriorityFeePerGas:i})}var R5=F(()=>{tl();qu();yg();fh();Wl()});async function Eg(t){let e=await t.request({method:"eth_chainId"},{dedupe:!0});return Ps(e)}var IE=F(()=>{Na()});var $k,Cg,qk,Hk=F(()=>{p5();mn();$k=class extends Oe{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}},Cg=class extends Oe{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}},qk=class extends Oe{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${xs(e)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}});var M5,sW=F(()=>{mn();M5=class extends Oe{constructor({blockHash:e,blockNumber:r}){let n="Block";e&&(n=`Block at hash "${e}"`),r&&(n=`Block at number "${r}"`),super(`${n} could not be found.`,{name:"BlockNotFoundError"})}}});function nm(t){let e={...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,chainId:t.chainId?Ps(t.chainId):void 0,gas:t.gas?BigInt(t.gas):void 0,gasPrice:t.gasPrice?BigInt(t.gasPrice):void 0,maxFeePerBlobGas:t.maxFeePerBlobGas?BigInt(t.maxFeePerBlobGas):void 0,maxFeePerGas:t.maxFeePerGas?BigInt(t.maxFeePerGas):void 0,maxPriorityFeePerGas:t.maxPriorityFeePerGas?BigInt(t.maxPriorityFeePerGas):void 0,nonce:t.nonce?Ps(t.nonce):void 0,to:t.to?t.to:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,type:t.type?aW[t.type]:void 0,typeHex:t.type?t.type:void 0,value:t.value?BigInt(t.value):void 0,v:t.v?BigInt(t.v):void 0};return t.authorizationList&&(e.authorizationList=Clt(t.authorizationList)),e.yParity=(()=>{if(t.yParity)return Number(t.yParity);if(typeof e.v=="bigint"){if(e.v===0n||e.v===27n)return 0;if(e.v===1n||e.v===28n)return 1;if(e.v>=35n)return e.v%2n===0n?1:0}})(),e.type==="legacy"&&(delete e.accessList,delete e.maxFeePerBlobGas,delete e.maxFeePerGas,delete e.maxPriorityFeePerGas,delete e.yParity),e.type==="eip2930"&&(delete e.maxFeePerBlobGas,delete e.maxFeePerGas,delete e.maxPriorityFeePerGas),e.type==="eip1559"&&delete e.maxFeePerBlobGas,e}function Clt(t){return t.map(e=>({contractAddress:e.address,r:e.r,s:e.s,chainId:Number(e.chainId),nonce:Number(e.nonce),...typeof e.yParity<"u"?{yParity:Number(e.yParity)}:{},...typeof e.v<"u"&&typeof e.yParity>"u"?{v:Number(e.v)}:{}}))}var aW,N5,L3=F(()=>{Na();_E();aW={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};N5=xg("transaction",nm)});function cW(t){let e=t.transactions?.map(r=>typeof r=="string"?r:nm(r));return{...t,baseFeePerGas:t.baseFeePerGas?BigInt(t.baseFeePerGas):null,blobGasUsed:t.blobGasUsed?BigInt(t.blobGasUsed):void 0,difficulty:t.difficulty?BigInt(t.difficulty):void 0,excessBlobGas:t.excessBlobGas?BigInt(t.excessBlobGas):void 0,gasLimit:t.gasLimit?BigInt(t.gasLimit):void 0,gasUsed:t.gasUsed?BigInt(t.gasUsed):void 0,hash:t.hash?t.hash:null,logsBloom:t.logsBloom?t.logsBloom:null,nonce:t.nonce?t.nonce:null,number:t.number?BigInt(t.number):null,size:t.size?BigInt(t.size):void 0,timestamp:t.timestamp?BigInt(t.timestamp):void 0,transactions:e,totalDifficulty:t.totalDifficulty?BigInt(t.totalDifficulty):null}}var O5,TE=F(()=>{_E();L3();O5=xg("block",cW)});async function im(t,{blockHash:e,blockNumber:r,blockTag:n,includeTransactions:i}={}){let o=n??"latest",s=i??!1,a=r!==void 0?tr(r):void 0,l=null;if(e?l=await t.request({method:"eth_getBlockByHash",params:[e,s]},{dedupe:!0}):l=await t.request({method:"eth_getBlockByNumber",params:[a||o,s]},{dedupe:!!a}),!l)throw new M5({blockHash:e,blockNumber:r});return(t.chain?.formatters?.block?.format||cW)(l)}var kE=F(()=>{sW();Vr();TE()});async function zk(t){let e=await t.request({method:"eth_gasPrice"});return BigInt(e)}var lW=F(()=>{});async function M0e(t,e){let{block:r,chain:n=t.chain,request:i}=e||{};if(typeof n?.fees?.defaultPriorityFee=="function"){let o=r||await en(t,im,"getBlock")({});return n.fees.defaultPriorityFee({block:o,client:t,request:i})}if(typeof n?.fees?.defaultPriorityFee<"u")return n?.fees?.defaultPriorityFee;try{let o=await t.request({method:"eth_maxPriorityFeePerGas"});return Wn(o)}catch{let[o,s]=await Promise.all([r?Promise.resolve(r):en(t,im,"getBlock")({}),en(t,zk,"getGasPrice")({})]);if(typeof o.baseFeePerGas!="bigint")throw new Cg;let a=s-o.baseFeePerGas;return a<0n?0n:a}}var N0e=F(()=>{Hk();Na();Pa();kE();lW()});async function uW(t,e){let{block:r,chain:n=t.chain,request:i,type:o="eip1559"}=e||{},s=await(async()=>typeof n?.fees?.baseFeeMultiplier=="function"?n.fees.baseFeeMultiplier({block:r,client:t,request:i}):n?.fees?.baseFeeMultiplier??1.2)();if(s<1)throw new $k;let l=10**(s.toString().split(".")[1]?.length??0),u=v=>v*BigInt(Math.ceil(s*l))/BigInt(l),d=r||await en(t,im,"getBlock")({});if(typeof n?.fees?.estimateFeesPerGas=="function"){let v=await n.fees.estimateFeesPerGas({block:r,client:t,multiply:u,request:i,type:o});if(v!==null)return v}if(o==="eip1559"){if(typeof d.baseFeePerGas!="bigint")throw new Cg;let v=typeof i?.maxPriorityFeePerGas=="bigint"?i.maxPriorityFeePerGas:await M0e(t,{block:d,chain:n,request:i}),y=u(d.baseFeePerGas);return{maxFeePerGas:i?.maxFeePerGas??y+v,maxPriorityFeePerGas:v}}return{gasPrice:i?.gasPrice??u(await en(t,zk,"getGasPrice")({}))}}var O0e=F(()=>{Hk();Pa();N0e();kE();lW()});var Wk,P0e=F(()=>{Rk();p5();mn();fh();Wk=class extends Oe{constructor(e,{account:r,docsPath:n,chain:i,data:o,gas:s,gasPrice:a,maxFeePerGas:l,maxPriorityFeePerGas:u,nonce:d,to:p,value:v}){let y=x3({from:r?.address,to:p,value:typeof v<"u"&&`${C5(v)} ${i?.nativeCurrency?.symbol||"ETH"}`,data:o,gas:s,gasPrice:typeof a<"u"&&`${xs(a)} gwei`,maxFeePerGas:typeof l<"u"&&`${xs(l)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${xs(u)} gwei`,nonce:d});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",y].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}});function B0e(t,{docsPath:e,...r}){let n=(()=>{let i=T5(t,r);return i instanceof kd?t:i})();return new Wk(n,{docsPath:e,...r})}var D0e=F(()=>{P0e();yg();Uk()});function L0e(t){return t.reduce((e,{slot:r,value:n})=>`${e} ${r}: ${n} | |
`,"")}function U0e(t){return t.reduce((e,{address:r,...n})=>{let i=`${e} ${r}: | |
`;return n.nonce&&(i+=` nonce: ${n.nonce} | |
`),n.balance&&(i+=` balance: ${n.balance} | |
`),n.code&&(i+=` code: ${n.code} | |
`),n.state&&(i+=` state: | |
`,i+=L0e(n.state)),n.stateDiff&&(i+=` stateDiff: | |
`,i+=L0e(n.stateDiff)),i},` State Override: | |
`).slice(0,-1)}var Vk,Kk,fW=F(()=>{mn();Vk=class extends Oe{constructor({address:e}){super(`State for account "${e}" is set multiple times.`,{name:"AccountStateConflictError"})}},Kk=class extends Oe{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}});function j0e(t){if(!(!t||t.length===0))return t.reduce((e,{slot:r,value:n})=>{if(r.length!==66)throw new sE({size:r.length,targetSize:66,type:"hex"});if(n.length!==66)throw new sE({size:n.length,targetSize:66,type:"hex"});return e[r]=n,e},{})}function Alt(t){let{balance:e,nonce:r,state:n,stateDiff:i,code:o}=t,s={};if(o!==void 0&&(s.code=o),e!==void 0&&(s.balance=tr(e)),r!==void 0&&(s.nonce=tr(r)),n!==void 0&&(s.state=j0e(n)),i!==void 0){if(s.state)throw new Kk;s.stateDiff=j0e(i)}return s}function Gk(t){if(!t)return;let e={};for(let{address:r,...n}of t){if(!$n(r,{strict:!1}))throw new ni({address:r});if(e[r])throw new Vk({address:r});e[r]=Alt(n)}return e}var hW=F(()=>{qu();UT();fW();Wl();Vr()});async function RE(t,{address:e,blockNumber:r,blockTag:n="latest"}){let i=r?tr(r):void 0,o=await t.request({method:"eth_getBalance",params:[e,i||n]});return BigInt(o)}var dW=F(()=>{Vr()});async function U3(t,e){let r=e.account??t.account,n=r?Ti(r):void 0;try{let L=function(f){let{block:h,request:m,rpcStateOverride:b}=f;return t.request({method:"eth_estimateGas",params:b?[m,h??"latest",b]:h?[m,h]:[m]})},{accessList:i,authorizationList:o,blobs:s,blobVersionedHashes:a,blockNumber:l,blockTag:u,data:d,gas:p,gasPrice:v,maxFeePerBlobGas:y,maxFeePerGas:S,maxPriorityFeePerGas:R,nonce:O,value:k,stateOverride:M,...D}=await om(t,{...e,parameters:n?.type==="local"?void 0:["blobVersionedHashes"]}),q=(l?tr(l):void 0)||u,W=Gk(M),V=await(async()=>{if(D.to)return D.to;if(o&&o.length>0)return await Ak({authorization:o[0]}).catch(()=>{throw new Oe("`to` is required. Could not infer from `authorizationList`")})})();Nd(e);let P=t.chain?.formatters?.transactionRequest?.format,U=(P||rm)({...k5(D,{format:P}),from:n?.address,accessList:i,authorizationList:o,blobs:s,blobVersionedHashes:a,data:d,gas:p,gasPrice:v,maxFeePerBlobGas:y,maxFeePerGas:S,maxPriorityFeePerGas:R,nonce:O,to:V,value:k}),z=BigInt(await L({block:q,request:U,rpcStateOverride:W}));if(o){let f=await RE(t,{address:U.from}),h=await Promise.all(o.map(async m=>{let{contractAddress:b}=m,C=await L({block:q,request:{authorizationList:void 0,data:d,from:n?.address,to:b,value:tr(f)},rpcStateOverride:W}).catch(()=>100000n);return 2n*BigInt(C)}));z+=h.reduce((m,b)=>m+b,0n)}return z}catch(i){throw B0e(i,{...e,account:n,chain:t.chain})}}var pW=F(()=>{tl();mn();tW();Vr();D0e();jk();D3();hW();R5();ME();dW()});async function F0e(t,{address:e,blockTag:r="latest",blockNumber:n}){let i=await t.request({method:"eth_getTransactionCount",params:[e,n?tr(n):r]},{dedupe:!!n});return Ps(i)}var $0e=F(()=>{Na();Vr()});function P5(t){let{kzg:e}=t,r=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),n=typeof t.blobs[0]=="string"?t.blobs.map(o=>Ko(o)):t.blobs,i=[];for(let o of n)i.push(Uint8Array.from(e.blobToKzgCommitment(o)));return r==="bytes"?i:i.map(o=>ri(o))}var Qk=F(()=>{aa();Vr()});function B5(t){let{kzg:e}=t,r=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),n=typeof t.blobs[0]=="string"?t.blobs.map(s=>Ko(s)):t.blobs,i=typeof t.commitments[0]=="string"?t.commitments.map(s=>Ko(s)):t.commitments,o=[];for(let s=0;s<n.length;s++){let a=n[s],l=i[s];o.push(Uint8Array.from(e.computeBlobKzgProof(a,l)))}return r==="bytes"?o:o.map(s=>ri(s))}var Zk=F(()=>{aa();Vr()});function Yk(t,e){let r=e||"hex",n=d3(ws(t,{strict:!1})?$u(t):t);return r==="bytes"?n:Pt(n)}var mW=F(()=>{Lz();xd();aa();Vr()});function q0e(t){let{commitment:e,version:r=1}=t,n=t.to??(typeof e=="string"?"hex":"bytes"),i=Yk(e,"bytes");return i.set([r],0),n==="bytes"?i:ri(i)}var H0e=F(()=>{Vr();mW()});function Jk(t){let{commitments:e,version:r}=t,n=t.to??(typeof e[0]=="string"?"hex":"bytes"),i=[];for(let o of e)i.push(q0e({commitment:o,to:n,version:r}));return i}var gW=F(()=>{H0e()});var Xk,D5,eR,tR,wW=F(()=>{mn();Xk=class extends Oe{constructor({maxSize:e,size:r}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${r} bytes`],name:"BlobSizeTooLargeError"})}},D5=class extends Oe{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}},eR=class extends Oe{constructor({hash:e,size:r}){super(`Versioned hash "${e}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${r}`],name:"InvalidVersionedHashSizeError"})}},tR=class extends Oe{constructor({hash:e,version:r}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:[`Expected: ${1}`,`Received: ${r}`],name:"InvalidVersionedHashVersionError"})}}});function z0e(t){let e=t.to??(typeof t.data=="string"?"hex":"bytes"),r=typeof t.data=="string"?Ko(t.data):t.data,n=fi(r);if(!n)throw new D5;if(n>761855)throw new Xk({maxSize:761855,size:n});let i=[],o=!0,s=0;for(;o;){let a=h5(new Uint8Array(131072)),l=0;for(;l<4096;){let u=r.slice(s,s+31);if(a.pushByte(0),a.pushBytes(u),u.length<31){a.pushByte(128),o=!1;break}l++,s+=31}i.push(a)}return e==="bytes"?i.map(a=>a.bytes):i.map(a=>ri(a.bytes))}var W0e=F(()=>{wW();Ck();Ed();aa();Vr()});function rR(t){let{data:e,kzg:r,to:n}=t,i=t.blobs??z0e({data:e,to:n}),o=t.commitments??P5({blobs:i,kzg:r,to:n}),s=t.proofs??B5({blobs:i,commitments:o,kzg:r,to:n}),a=[];for(let l=0;l<i.length;l++)a.push({blob:i[l],commitment:o[l],proof:s[l]});return a}var vW=F(()=>{Qk();Zk();W0e()});function nR(t){if(t.type)return t.type;if(typeof t.authorizationList<"u")return"eip7702";if(typeof t.blobs<"u"||typeof t.blobVersionedHashes<"u"||typeof t.maxFeePerBlobGas<"u"||typeof t.sidecars<"u")return"eip4844";if(typeof t.maxFeePerGas<"u"||typeof t.maxPriorityFeePerGas<"u")return"eip1559";if(typeof t.gasPrice<"u")return typeof t.accessList<"u"?"eip2930":"legacy";throw new Ok({transaction:t})}var yW=F(()=>{fh()});async function om(t,e){let{account:r=t.account,blobs:n,chain:i,gas:o,kzg:s,nonce:a,parameters:l=iR,type:u}=e,d=r?Ti(r):void 0,p={...e,...d?{from:d?.address}:{}},v;async function y(){return v||(v=await en(t,im,"getBlock")({blockTag:"latest"}),v)}let S;async function R(){return S||(i?i.id:typeof e.chainId<"u"?e.chainId:(S=await en(t,Eg,"getChainId")({}),S))}if((l.includes("blobVersionedHashes")||l.includes("sidecars"))&&n&&s){let O=P5({blobs:n,kzg:s});if(l.includes("blobVersionedHashes")){let k=Jk({commitments:O,to:"hex"});p.blobVersionedHashes=k}if(l.includes("sidecars")){let k=B5({blobs:n,commitments:O,kzg:s}),M=rR({blobs:n,commitments:O,proofs:k,to:"hex"});p.sidecars=M}}if(l.includes("chainId")&&(p.chainId=await R()),l.includes("nonce")&&typeof a>"u"&&d)if(d.nonceManager){let O=await R();p.nonce=await d.nonceManager.consume({address:d.address,chainId:O,client:t})}else p.nonce=await en(t,F0e,"getTransactionCount")({address:d.address,blockTag:"pending"});if((l.includes("fees")||l.includes("type"))&&typeof u>"u")try{p.type=nR(p)}catch{let O=await y();p.type=typeof O?.baseFeePerGas=="bigint"?"eip1559":"legacy"}if(l.includes("fees"))if(p.type!=="legacy"&&p.type!=="eip2930"){if(typeof p.maxFeePerGas>"u"||typeof p.maxPriorityFeePerGas>"u"){let O=await y(),{maxFeePerGas:k,maxPriorityFeePerGas:M}=await uW(t,{block:O,chain:i,request:p});if(typeof e.maxPriorityFeePerGas>"u"&&e.maxFeePerGas&&e.maxFeePerGas<M)throw new qk({maxPriorityFeePerGas:M});p.maxPriorityFeePerGas=M,p.maxFeePerGas=k}}else{if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")throw new Cg;let O=await y(),{gasPrice:k}=await uW(t,{block:O,chain:i,request:p,type:"legacy"});p.gasPrice=k}return l.includes("gas")&&typeof o>"u"&&(p.gas=await en(t,U3,"estimateGas")({...p,account:d?{address:d.address,type:"json-rpc"}:void 0})),Nd(p),delete p.parameters,p}var iR,ME=F(()=>{tl();O0e();pW();kE();$0e();Hk();Qk();Zk();gW();vW();Pa();R5();yW();IE();iR=["blobVersionedHashes","chainId","fees","gas","nonce","type"]});async function oR(t,{serializedTransaction:e}){return t.request({method:"eth_sendRawTransaction",params:[e]},{retryCount:0})}var bW=F(()=>{});async function sm(t,e){let{account:r=t.account,chain:n=t.chain,accessList:i,authorizationList:o,blobs:s,data:a,gas:l,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:p,maxPriorityFeePerGas:v,nonce:y,value:S,...R}=e;if(!r)throw new Hu({docsPath:"/docs/actions/wallet/sendTransaction"});let O=Ti(r);try{Nd(e);let k=await(async()=>{if(e.to)return e.to;if(o&&o.length>0)return await Ak({authorization:o[0]}).catch(()=>{throw new Oe("`to` is required. Could not infer from `authorizationList`.")})})();if(O.type==="json-rpc"){let M;n!==null&&(M=await en(t,Eg,"getChainId")({}),Ik({currentChainId:M,chain:n}));let D=t.chain?.formatters?.transactionRequest?.format,q=(D||rm)({...k5(R,{format:D}),accessList:i,authorizationList:o,blobs:s,chainId:M,data:a,from:O.address,gas:l,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:p,maxPriorityFeePerGas:v,nonce:y,to:k,value:S});return await t.request({method:"eth_sendTransaction",params:[q]},{retryCount:0})}if(O.type==="local"){let M=await en(t,om,"prepareTransactionRequest")({account:O,accessList:i,authorizationList:o,blobs:s,chain:n,data:a,gas:l,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:p,maxPriorityFeePerGas:v,nonce:y,parameters:[...iR,"sidecars"],value:S,...R,to:k}),D=n?.serializers?.transaction,j=await O.signTransaction(M,{serializer:D});return await en(t,oR,"sendRawTransaction")({serializedTransaction:j})}throw O.type==="smart"?new u5({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new u5({docsPath:"/docs/actions/wallet/sendTransaction",type:O.type})}catch(k){throw k instanceof u5?k:k0e(k,{...e,account:O,chain:e.chain||void 0})}}var NE=F(()=>{tl();f5();mn();tW();rW();R0e();jk();D3();Pa();R5();IE();ME();bW()});function V0e(t,e){let{abi:r,args:n,bytecode:i,...o}=e,s=mE({abi:r,args:n,bytecode:i});return sm(t,{...o,data:s})}var K0e=F(()=>{Bz();NE()});var OE,G0e,sR,Q0e,xW,EW,L5=F(()=>{OE=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],G0e=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"},{inputs:[],name:"ResolverNotContract",type:"error"},{inputs:[{name:"returnData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{components:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"errors",type:"tuple[]"}],name:"HttpError",type:"error"}],sR=[...G0e,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]},{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],Q0e=[...G0e,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]},{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],xW=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],EW=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}]});function Z0e(t,e={}){typeof e.size<"u"&&el(t,{size:e.size});let r=ri(t,e);return Wn(r,e)}function Y0e(t,e={}){let r=t;if(typeof e.size<"u"&&(el(r,{size:e.size}),r=is(r)),r.length>1||r[0]>1)throw new BT(r);return!!r[0]}function Od(t,e={}){typeof e.size<"u"&&el(t,{size:e.size});let r=ri(t,e);return Ps(r,e)}function J0e(t,e={}){let r=t;return typeof e.size<"u"&&(el(r,{size:e.size}),r=is(r,{dir:"right"})),new TextDecoder().decode(r)}var X0e=F(()=>{LT();og();Na();Vr()});function aR(t,e){let r=typeof e=="string"?Ko(e):e,n=h5(r);if(fi(r)===0&&t.length>0)throw new Ad;if(fi(e)&&fi(e)<32)throw new HT({data:typeof e=="string"?e:ri(e),params:t,size:fi(e)});let i=0,o=[];for(let s=0;s<t.length;++s){let a=t[s];n.setPosition(i);let[l,u]=U5(n,a,{staticPosition:0});i+=u,o.push(l)}return o}function U5(t,e,{staticPosition:r}){let n=ak(e.type);if(n){let[i,o]=n;return Tlt(t,{...e,type:o},{length:i,staticPosition:r})}if(e.type==="tuple")return Nlt(t,e,{staticPosition:r});if(e.type==="address")return Ilt(t);if(e.type==="bool")return klt(t);if(e.type.startsWith("bytes"))return Rlt(t,e,{staticPosition:r});if(e.type.startsWith("uint")||e.type.startsWith("int"))return Mlt(t,e);if(e.type==="string")return Olt(t,{staticPosition:r});throw new YT(e.type,{docsPath:"/docs/contract/decodeAbiParameters"})}function Ilt(t){let e=t.readBytes(32);return[_d(ri(Mz(e,-20))),32]}function Tlt(t,e,{length:r,staticPosition:n}){if(!r){let s=Od(t.readBytes(CW)),a=n+s,l=a+epe;t.setPosition(a);let u=Od(t.readBytes(epe)),d=PE(e),p=0,v=[];for(let y=0;y<u;++y){t.setPosition(l+(d?y*32:p));let[S,R]=U5(t,e,{staticPosition:l});p+=R,v.push(S)}return t.setPosition(n+32),[v,32]}if(PE(e)){let s=Od(t.readBytes(CW)),a=n+s,l=[];for(let u=0;u<r;++u){t.setPosition(a+u*32);let[d]=U5(t,e,{staticPosition:a});l.push(d)}return t.setPosition(n+32),[l,32]}let i=0,o=[];for(let s=0;s<r;++s){let[a,l]=U5(t,e,{staticPosition:n+i});i+=l,o.push(a)}return[o,i]}function klt(t){return[Y0e(t.readBytes(32),{size:32}),32]}function Rlt(t,e,{staticPosition:r}){let[n,i]=e.type.split("bytes");if(!i){let s=Od(t.readBytes(32));t.setPosition(r+s);let a=Od(t.readBytes(32));if(a===0)return t.setPosition(r+32),["0x",32];let l=t.readBytes(a);return t.setPosition(r+32),[ri(l),32]}return[ri(t.readBytes(Number.parseInt(i),32)),32]}function Mlt(t,e){let r=e.type.startsWith("int"),n=Number.parseInt(e.type.split("int")[1]||"256"),i=t.readBytes(32);return[n>48?Z0e(i,{signed:r}):Od(i,{signed:r}),32]}function Nlt(t,e,{staticPosition:r}){let n=e.components.length===0||e.components.some(({name:s})=>!s),i=n?[]:{},o=0;if(PE(e)){let s=Od(t.readBytes(CW)),a=r+s;for(let l=0;l<e.components.length;++l){let u=e.components[l];t.setPosition(a+o);let[d,p]=U5(t,u,{staticPosition:a});o+=p,i[n?l:u?.name]=d}return t.setPosition(r+32),[i,32]}for(let s=0;s<e.components.length;++s){let a=e.components[s],[l,u]=U5(t,a,{staticPosition:r});i[n?s:a?.name]=l,o+=u}return[i,o]}function Olt(t,{staticPosition:e}){let r=Od(t.readBytes(32)),n=e+r;t.setPosition(n);let i=Od(t.readBytes(32));if(i===0)return t.setPosition(e+32),["",32];let o=t.readBytes(i,32),s=J0e(is(o));return t.setPosition(e+32),[s,32]}function PE(t){let{type:e}=t;if(e==="string"||e==="bytes"||e.endsWith("[]"))return!0;if(e==="tuple")return t.components?.some(PE);let r=ak(t.type);return!!(r&&PE({...t,type:r[1]}))}var epe,CW,AW=F(()=>{Hl();hg();Ck();Ed();c5();og();X0e();aa();Vr();l5();epe=32,CW=32});function tpe(t){return Plt(t)}var Plt,rpe=F(()=>{aa();Sd();Plt=t=>Fi($u(t))});var npe,ipe=F(()=>{npe="1.0.5"});var Es,j5=F(()=>{ipe();Es=class t extends Error{constructor(e,r={}){let n=r.cause instanceof t?r.cause.details:r.cause?.message?r.cause.message:r.details,i=r.cause instanceof t&&r.cause.docsPath||r.docsPath,o=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...i?[`Docs: https://abitype.dev${i}`]:[],...n?[`Details: ${n}`]:[],`Version: abitype@${npe}`].join(` | |
`);super(o),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),r.cause&&(this.cause=r.cause),this.details=n,this.docsPath=i,this.metaMessages=r.metaMessages,this.shortMessage=e}}});function Ku(t,e){return t.exec(e)?.groups}var SW,_W,cR,BE=F(()=>{SW=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,_W=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,cR=/^\(.+?\).*?$/});function lR(t){let e=t.type;if(ope.test(t.type)&&"components"in t){e="(";let r=t.components.length;for(let i=0;i<r;i++){let o=t.components[i];e+=lR(o),i<r-1&&(e+=", ")}let n=Ku(ope,t.type);return e+=`)${n?.array??""}`,lR({...t,type:e})}return"indexed"in t&&t.indexed&&(e=`${e} indexed`),t.name?`${e} ${t.name}`:e}var ope,spe=F(()=>{BE();ope=/^tuple(?<array>(\[(\d*)\])*)$/});function F5(t){let e="",r=t.length;for(let n=0;n<r;n++){let i=t[n];e+=lR(i),n!==r-1&&(e+=", ")}return e}var ape=F(()=>{spe()});function IW(t){return t.type==="function"?`function ${t.name}(${F5(t.inputs)})${t.stateMutability&&t.stateMutability!=="nonpayable"?` ${t.stateMutability}`:""}${t.outputs.length?` returns (${F5(t.outputs)})`:""}`:t.type==="event"?`event ${t.name}(${F5(t.inputs)})`:t.type==="error"?`error ${t.name}(${F5(t.inputs)})`:t.type==="constructor"?`constructor(${F5(t.inputs)})${t.stateMutability==="payable"?" payable":""}`:t.type==="fallback"?"fallback()":"receive() external payable"}var cpe=F(()=>{ape()});function upe(t){return lpe.test(t)}function fpe(t){return Ku(lpe,t)}function dpe(t){return hpe.test(t)}function ppe(t){return Ku(hpe,t)}function gpe(t){return mpe.test(t)}function wpe(t){return Ku(mpe,t)}function uR(t){return vpe.test(t)}function ype(t){return Ku(vpe,t)}function xpe(t){return bpe.test(t)}function Epe(t){return Ku(bpe,t)}function Cpe(t){return Blt.test(t)}function Ape(t){return Dlt.test(t)}var lpe,hpe,mpe,vpe,bpe,Blt,Dlt,Spe,fR,hR=F(()=>{BE();lpe=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;hpe=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;mpe=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;vpe=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;bpe=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;Blt=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;Dlt=/^receive\(\) external payable$/;Spe=new Set(["indexed"]),fR=new Set(["calldata","memory","storage"])});var dR,pR,TW=F(()=>{j5();dR=class extends Es{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}},pR=class extends Es{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}});var mR,gR,wR,vR,yR,kW=F(()=>{j5();mR=class extends Es{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}},gR=class extends Es{constructor({param:e,name:r}){super("Invalid ABI parameter.",{details:e,metaMessages:[`"${r}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}},wR=class extends Es{constructor({param:e,type:r,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${r?` in "${r}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}},vR=class extends Es{constructor({param:e,type:r,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${r?` in "${r}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${n}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}},yR=class extends Es{constructor({abiParameter:e}){super("Invalid ABI parameter.",{details:JSON.stringify(e,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}});var am,bR,xR,RW=F(()=>{j5();am=class extends Es{constructor({signature:e,type:r}){super(`Invalid ${r} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}},bR=class extends Es{constructor({signature:e}){super("Unknown signature.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}},xR=class extends Es{constructor({signature:e}){super("Invalid struct signature.",{details:e,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}});var ER,_pe=F(()=>{j5();ER=class extends Es{constructor({type:e}){super("Circular reference detected.",{metaMessages:[`Struct "${e}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}});var CR,Ipe=F(()=>{j5();CR=class extends Es{constructor({current:e,depth:r}){super("Unbalanced parentheses.",{metaMessages:[`"${e.trim()}" has too many ${r>0?"opening":"closing"} parentheses.`],details:`Depth "${r}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}});function Tpe(t,e){return e?`${e}:${t}`:t}var AR,kpe=F(()=>{AR=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]])});function Rpe(t,e={}){if(gpe(t)){let r=wpe(t);if(!r)throw new am({signature:t,type:"function"});let n=dh(r.parameters),i=[],o=n.length;for(let a=0;a<o;a++)i.push(Ag(n[a],{modifiers:fR,structs:e,type:"function"}));let s=[];if(r.returns){let a=dh(r.returns),l=a.length;for(let u=0;u<l;u++)s.push(Ag(a[u],{modifiers:fR,structs:e,type:"function"}))}return{name:r.name,type:"function",stateMutability:r.stateMutability??"nonpayable",inputs:i,outputs:s}}if(dpe(t)){let r=ppe(t);if(!r)throw new am({signature:t,type:"event"});let n=dh(r.parameters),i=[],o=n.length;for(let s=0;s<o;s++)i.push(Ag(n[s],{modifiers:Spe,structs:e,type:"event"}));return{name:r.name,type:"event",inputs:i}}if(upe(t)){let r=fpe(t);if(!r)throw new am({signature:t,type:"error"});let n=dh(r.parameters),i=[],o=n.length;for(let s=0;s<o;s++)i.push(Ag(n[s],{structs:e,type:"error"}));return{name:r.name,type:"error",inputs:i}}if(xpe(t)){let r=Epe(t);if(!r)throw new am({signature:t,type:"constructor"});let n=dh(r.parameters),i=[],o=n.length;for(let s=0;s<o;s++)i.push(Ag(n[s],{structs:e,type:"constructor"}));return{type:"constructor",stateMutability:r.stateMutability??"nonpayable",inputs:i}}if(Cpe(t))return{type:"fallback"};if(Ape(t))return{type:"receive",stateMutability:"payable"};throw new bR({signature:t})}function Ag(t,e){let r=Tpe(t,e?.type);if(AR.has(r))return AR.get(r);let n=cR.test(t),i=Ku(n?Ult:Llt,t);if(!i)throw new mR({param:t});if(i.name&&$lt(i.name))throw new gR({param:t,name:i.name});let o=i.name?{name:i.name}:{},s=i.modifier==="indexed"?{indexed:!0}:{},a=e?.structs??{},l,u={};if(n){l="tuple";let p=dh(i.type),v=[],y=p.length;for(let S=0;S<y;S++)v.push(Ag(p[S],{structs:a}));u={components:v}}else if(i.type in a)l="tuple",u={components:a[i.type]};else if(jlt.test(i.type))l=`${i.type}256`;else if(l=i.type,e?.type!=="struct"&&!MW(l))throw new pR({type:l});if(i.modifier){if(!e?.modifiers?.has?.(i.modifier))throw new wR({param:t,type:e?.type,modifier:i.modifier});if(fR.has(i.modifier)&&!qlt(l,!!i.array))throw new vR({param:t,type:e?.type,modifier:i.modifier})}let d={type:`${l}${i.array??""}`,...o,...s,...u};return AR.set(r,d),d}function dh(t,e=[],r="",n=0){let i=t.trim().length;for(let o=0;o<i;o++){let s=t[o],a=t.slice(o+1);switch(s){case",":return n===0?dh(a,[...e,r.trim()]):dh(a,e,`${r}${s}`,n);case"(":return dh(a,e,`${r}${s}`,n+1);case")":return dh(a,e,`${r}${s}`,n-1);default:return dh(a,e,`${r}${s}`,n)}}if(r==="")return e;if(n!==0)throw new CR({current:r,depth:n});return e.push(r.trim()),e}function MW(t){return t==="address"||t==="bool"||t==="function"||t==="string"||SW.test(t)||_W.test(t)}function $lt(t){return t==="address"||t==="bool"||t==="function"||t==="string"||t==="tuple"||SW.test(t)||_W.test(t)||Flt.test(t)}function qlt(t,e){return e||t==="bytes"||t==="string"||t==="tuple"}var Llt,Ult,jlt,Flt,NW=F(()=>{BE();TW();kW();RW();Ipe();kpe();hR();Llt=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Ult=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,jlt=/^u?int$/;Flt=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/});function Mpe(t){let e={},r=t.length;for(let s=0;s<r;s++){let a=t[s];if(!uR(a))continue;let l=ype(a);if(!l)throw new am({signature:a,type:"struct"});let u=l.properties.split(";"),d=[],p=u.length;for(let v=0;v<p;v++){let S=u[v].trim();if(!S)continue;let R=Ag(S,{type:"struct"});d.push(R)}if(!d.length)throw new xR({signature:a});e[l.name]=d}let n={},i=Object.entries(e),o=i.length;for(let s=0;s<o;s++){let[a,l]=i[s];n[a]=Npe(l,e)}return n}function Npe(t,e,r=new Set){let n=[],i=t.length;for(let o=0;o<i;o++){let s=t[o];if(cR.test(s.type))n.push(s);else{let l=Ku(Hlt,s.type);if(!l?.type)throw new yR({abiParameter:s});let{array:u,type:d}=l;if(d in e){if(r.has(d))throw new ER({type:d});n.push({...s,type:`tuple${u??""}`,components:Npe(e[d]??[],e,new Set([...r,d]))})}else if(MW(d))n.push(s);else throw new dR({type:d})}}return n}var Hlt,Ope=F(()=>{BE();TW();kW();RW();_pe();hR();NW();Hlt=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/});function SR(t){let e=Mpe(t),r=[],n=t.length;for(let i=0;i<n;i++){let o=t[i];uR(o)||r.push(Rpe(o,e))}return r}var Ppe=F(()=>{hR();Ope();NW()});var OW=F(()=>{cpe();Ppe()});function Bpe(t){let e=!0,r="",n=0,i="",o=!1;for(let s=0;s<t.length;s++){let a=t[s];if(["(",")",","].includes(a)&&(e=!0),a==="("&&n++,a===")"&&n--,!!e){if(n===0){if(a===" "&&["event","function",""].includes(i))i="";else if(i+=a,a===")"){o=!0;break}continue}if(a===" "){t[s-1]!==","&&r!==","&&r!==",("&&(r="",e=!1);continue}i+=a,r+=a}}if(!o)throw new Oe("Unable to normalize signature.");return i}var Dpe=F(()=>{mn()});var Lpe,Upe=F(()=>{OW();Dpe();Lpe=t=>{let e=typeof t=="string"?t:IW(t);return Bpe(e)}});function _R(t){return tpe(Lpe(t))}var PW=F(()=>{rpe();Upe()});var jpe,Fpe=F(()=>{PW();jpe=_R});var $5,IR=F(()=>{c5();PW();$5=t=>Yp(_R(t),0,4)});function q5(t){let{abi:e,args:r=[],name:n}=t,i=ws(n,{strict:!1}),o=e.filter(a=>i?a.type==="function"?$5(a)===n:a.type==="event"?jpe(a)===n:!1:"name"in a&&a.name===n);if(o.length===0)return;if(o.length===1)return o[0];let s;for(let a of o){if(!("inputs"in a))continue;if(!r||r.length===0){if(!a.inputs||a.inputs.length===0)return a;continue}if(!a.inputs||a.inputs.length===0||a.inputs.length!==r.length)continue;if(r.every((u,d)=>{let p="inputs"in a&&a.inputs[d];return p?BW(u,p):!1})){if(s&&"inputs"in s&&s.inputs){let u=$pe(a.inputs,s.inputs,r);if(u)throw new GT({abiItem:a,type:u[0]},{abiItem:s,type:u[1]})}s=a}}return s||o[0]}function BW(t,e){let r=typeof t,n=e.type;switch(n){case"address":return $n(t,{strict:!1});case"bool":return r==="boolean";case"function":return r==="string";case"string":return r==="string";default:return n==="tuple"&&"components"in e?Object.values(e.components).every((i,o)=>BW(Object.values(t)[o],i)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(n)?r==="number"||r==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(n)?r==="string"||t instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(n)?Array.isArray(t)&&t.every(i=>BW(i,{...e,type:n.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function $pe(t,e,r){for(let n in t){let i=t[n],o=e[n];if(i.type==="tuple"&&o.type==="tuple"&&"components"in i&&"components"in o)return $pe(i.components,o.components,r[n]);let s=[i.type,o.type];if(s.includes("address")&&s.includes("bytes20")?!0:s.includes("address")&&s.includes("string")?$n(r[n],{strict:!1}):s.includes("address")&&s.includes("bytes")?$n(r[n],{strict:!1}):!1)return s}}var TR=F(()=>{Hl();xd();Wl();Fpe();IR()});function Gu(t){let{abi:e,args:r,functionName:n,data:i}=t,o=e[0];if(n){let a=q5({abi:e,args:r,name:n});if(!a)throw new sg(n,{docsPath:DW});o=a}if(o.type!=="function")throw new sg(void 0,{docsPath:DW});if(!o.outputs)throw new KT(o.name,{docsPath:DW});let s=aR(o.outputs,i);if(s&&s.length>1)return s;if(s&&s.length===1)return s[0]}var DW,j3=F(()=>{Hl();AW();TR();DW="/docs/contract/decodeFunctionResult"});function Hpe(t){let{abi:e,args:r,functionName:n}=t,i=e[0];if(n){let o=q5({abi:e,args:r,name:n});if(!o)throw new sg(n,{docsPath:qpe});i=o}if(i.type!=="function")throw new sg(void 0,{docsPath:qpe});return{abi:[i],functionName:$5(Cd(i))}}var qpe,zpe=F(()=>{Hl();IR();uE();TR();qpe="/docs/contract/encodeFunctionData"});function Ds(t){let{args:e}=t,{abi:r,functionName:n}=t.abi.length===1&&t.functionName?.startsWith("0x")?t:Hpe(t),i=r[0],o=n,s="inputs"in i&&i.inputs?Jp(i.inputs,e??[]):void 0;return Bs([o,s??"0x"])}var cm=F(()=>{zl();l5();zpe()});function Pd({blockNumber:t,chain:e,contract:r}){let n=e?.contracts?.[r];if(!n)throw new y3({chain:e,contract:{name:r}});if(t&&n.blockCreated&&n.blockCreated>t)throw new y3({blockNumber:t,chain:e,contract:{name:r,blockCreated:n.blockCreated}});return n.address}var H5=F(()=>{b3()});var kR,Wpe,Vpe,RR=F(()=>{kR={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},Wpe={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},Vpe={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"}});function MR(t){let{abi:e,data:r}=t,n=Yp(r,0,4);if(n==="0x")throw new Ad;let o=[...e||[],Wpe,Vpe].find(s=>s.type==="error"&&n===$5(Cd(s)));if(!o)throw new a5(n,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:o,args:"inputs"in o&&o.inputs&&o.inputs.length>0?aR(o.inputs,Yp(r,4)):void 0,errorName:o.name}}var LW=F(()=>{RR();Hl();c5();IR();AW();uE()});function UW({abiItem:t,args:e,includeFunctionName:r=!0,includeName:n=!1}){if("name"in t&&"inputs"in t&&t.inputs)return`${r?t.name:""}(${t.inputs.map((i,o)=>`${n&&i.name?`${i.name}: `:""}${typeof e[o]=="object"?so(e[o]):e[o]}`).join(", ")})`}var Kpe=F(()=>{Rd()});var DE,lm,Sg,LE,UE,um,F3=F(()=>{tl();RR();LW();uE();Kpe();TR();Rk();p5();Hl();mn();fW();fh();Dk();DE=class extends Oe{constructor(e,{account:r,docsPath:n,chain:i,data:o,gas:s,gasPrice:a,maxFeePerGas:l,maxPriorityFeePerGas:u,nonce:d,to:p,value:v,stateOverride:y}){let S=r?Ti(r):void 0,R=x3({from:S?.address,to:p,value:typeof v<"u"&&`${C5(v)} ${i?.nativeCurrency?.symbol||"ETH"}`,data:o,gas:s,gasPrice:typeof a<"u"&&`${xs(a)} gwei`,maxFeePerGas:typeof l<"u"&&`${xs(l)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${xs(u)} gwei`,nonce:d});y&&(R+=` | |
${U0e(y)}`),super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",R].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}},lm=class extends Oe{constructor(e,{abi:r,args:n,contractAddress:i,docsPath:o,functionName:s,sender:a}){let l=q5({abi:r,args:n,name:s}),u=l?UW({abiItem:l,args:n,includeFunctionName:!1,includeName:!1}):void 0,d=l?Cd(l,{includeName:!0}):void 0,p=x3({address:i&&T0e(i),function:d,args:u&&u!=="()"&&`${[...Array(s?.length??0).keys()].map(()=>" ").join("")}${u}`,sender:a});super(e.shortMessage||`An unknown error occurred while executing the contract function "${s}".`,{cause:e,docsPath:o,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],p&&"Contract Call:",p].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=r,this.args=n,this.cause=e,this.contractAddress=i,this.functionName=s,this.sender=a}},Sg=class extends Oe{constructor({abi:e,data:r,functionName:n,message:i}){let o,s,a,l;if(r&&r!=="0x")try{s=MR({abi:e,data:r});let{abiItem:d,errorName:p,args:v}=s;if(p==="Error")l=v[0];else if(p==="Panic"){let[y]=v;l=kR[y]}else{let y=d?Cd(d,{includeName:!0}):void 0,S=d&&v?UW({abiItem:d,args:v,includeFunctionName:!1,includeName:!1}):void 0;a=[y?`Error: ${y}`:"",S&&S!=="()"?` ${[...Array(p?.length??0).keys()].map(()=>" ").join("")}${S}`:""]}}catch(d){o=d}else i&&(l=i);let u;o instanceof a5&&(u=o.signature,a=[`Unable to decode signature "${u}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${u}.`]),super(l&&l!=="execution reverted"||u?[`The contract function "${n}" reverted with the following ${u?"signature":"reason"}:`,l||u].join(` | |
`):`The contract function "${n}" reverted.`,{cause:o,metaMessages:a,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=s,this.reason=l,this.signature=u}},LE=class extends Oe{constructor({functionName:e}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${e}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError"})}},UE=class extends Oe{constructor({factory:e}){super(`Deployment for counterfactual contract call failed${e?` for factory "${e}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}},um=class extends Oe{constructor({data:e,message:r}){super(r||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}});function z5(t,e){if(!(t instanceof Oe))return!1;let r=t.walk(n=>n instanceof Sg);return r instanceof Sg?!!(r.data?.errorName==="ResolverNotFound"||r.data?.errorName==="ResolverWildcardNotSupported"||r.data?.errorName==="ResolverNotContract"||r.data?.errorName==="ResolverError"||r.data?.errorName==="HttpError"||r.reason?.includes("Wildcard on non-extended resolvers is not supported")||e==="reverse"&&r.reason===kR[50]):!1}var NR=F(()=>{RR();mn();F3()});function OR(t){if(t.length!==66||t.indexOf("[")!==0||t.indexOf("]")!==65)return null;let e=`0x${t.slice(1,65)}`;return ws(e)?e:null}var jW=F(()=>{xd()});function W5(t){let e=new Uint8Array(32).fill(0);if(!t)return ri(e);let r=t.split(".");for(let n=r.length-1;n>=0;n-=1){let i=OR(r[n]),o=i?$u(i):Fi(oh(r[n]),"bytes");e=Fi(gc([e,o]),"bytes")}return ri(e)}var FW=F(()=>{zl();aa();Vr();Sd();jW()});function Gpe(t){return`[${t.slice(2)}]`}var Qpe=F(()=>{});function Zpe(t){let e=new Uint8Array(32).fill(0);return t?OR(t)||Fi(oh(t)):ri(e)}var Ype=F(()=>{aa();Vr();Sd();jW()});function V5(t){let e=t.replace(/^\.|\.$/gm,"");if(e.length===0)return new Uint8Array(1);let r=new Uint8Array(oh(e).byteLength+2),n=0,i=e.split(".");for(let o=0;o<i.length;o++){let s=oh(i[o]);s.byteLength>255&&(s=oh(Gpe(Zpe(i[o])))),r[n]=s.length,r.set(s,n+1),n+=s.length+1}return r.byteLength!==n+1?r.slice(0,n+1):r}var PR=F(()=>{aa();Qpe();Ype()});function fm(t,{abi:e,address:r,args:n,docsPath:i,functionName:o,sender:s}){let{code:a,data:l,message:u,shortMessage:d}=t instanceof um?t:t instanceof Oe?t.walk(v=>"data"in v)||t.walk():{},p=t instanceof Ad?new LE({functionName:o}):[zlt,Md.code].includes(a)&&(l||u||d)?new Sg({abi:e,data:typeof l=="object"?l.data:l,functionName:o,message:d??u}):t;return new lm(p,{abi:e,args:n,contractAddress:r,docsPath:i,functionName:o,sender:s})}var zlt,jE=F(()=>{Hl();mn();F3();Lk();zlt=3});var Jpe,Xpe=F(()=>{Jpe="0x82ad56cb"});var eme,tme,rme=F(()=>{eme="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",tme="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe"});function nme(t,{docsPath:e,...r}){let n=(()=>{let i=T5(t,r);return i instanceof kd?t:i})();return new DE(n,{docsPath:e,...r})}var ime=F(()=>{F3();yg();Uk()});function BR({fn:t,id:e,shouldSplitBatch:r,wait:n=0,sort:i}){let o=async()=>{let d=l();s();let p=d.map(({args:v})=>v);p.length!==0&&t(p).then(v=>{i&&Array.isArray(v)&&v.sort(i);for(let y=0;y<d.length;y++){let{pendingPromise:S}=d[y];S.resolve?.([v[y],v])}}).catch(v=>{for(let y=0;y<d.length;y++){let{pendingPromise:S}=d[y];S.reject?.(v)}})},s=()=>$W.delete(e),a=()=>l().map(({args:d})=>d),l=()=>$W.get(e)||[],u=d=>$W.set(e,[...l(),d]);return{flush:s,async schedule(d){let p={},v=new Promise((R,O)=>{p.resolve=R,p.reject=O});return r?.([...a(),d])&&o(),l().length>0?(u({args:d,pendingPromise:p}),v):(u({args:d,pendingPromise:p}),setTimeout(o,n),v)}}}var $W,qW=F(()=>{$W=new Map});var DR,LR,UR,ome=F(()=>{Rd();mn();Dk();DR=class extends Oe{constructor({callbackSelector:e,cause:r,data:n,extraData:i,sender:o,urls:s}){super(r.shortMessage||"An error occurred while fetching for an offchain result.",{cause:r,metaMessages:[...r.metaMessages||[],r.metaMessages?.length?"":[],"Offchain Gateway Call:",s&&[" Gateway URL(s):",...s.map(a=>` ${E3(a)}`)],` Sender: ${o}`,` Data: ${n}`,` Callback selector: ${e}`,` Extra data: ${i}`].flat(),name:"OffchainLookupError"})}},LR=class extends Oe{constructor({result:e,url:r}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${E3(r)}`,`Response: ${so(e)}`],name:"OffchainLookupResponseMalformedError"})}},UR=class extends Oe{constructor({sender:e,to:r}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${r}`,`OffchainLookup sender address: ${e}`],name:"OffchainLookupSenderMismatchError"})}}});function sme(t,e){if(!$n(t,{strict:!1}))throw new ni({address:t});if(!$n(e,{strict:!1}))throw new ni({address:e});return t.toLowerCase()===e.toLowerCase()}var ame=F(()=>{qu();Wl()});var ume={};qr(ume,{ccipRequest:()=>lme,offchainLookup:()=>Vlt,offchainLookupAbiItem:()=>cme,offchainLookupSignature:()=>Wlt});async function Vlt(t,{blockNumber:e,blockTag:r,data:n,to:i}){let{args:o}=MR({data:n,abi:[cme]}),[s,a,l,u,d]=o,{ccipRead:p}=t,v=p&&typeof p?.request=="function"?p.request:lme;try{if(!sme(i,s))throw new UR({sender:s,to:i});let y=await v({data:l,sender:s,urls:a}),{data:S}=await hm(t,{blockNumber:e,blockTag:r,data:gc([u,Jp([{type:"bytes"},{type:"bytes"}],[y,d])]),to:i});return S}catch(y){throw new DR({callbackSelector:u,cause:y,data:n,extraData:d,sender:s,urls:a})}}async function lme({data:t,sender:e,urls:r}){let n=new Error("An unknown error occurred.");for(let i=0;i<r.length;i++){let o=r[i],s=o.includes("{data}")?"GET":"POST",a=s==="POST"?{data:t,sender:e}:void 0;try{let l=await fetch(o.replace("{sender}",e).replace("{data}",t),{body:JSON.stringify(a),method:s}),u;if(l.headers.get("Content-Type")?.startsWith("application/json")?u=(await l.json()).data:u=await l.text(),!l.ok){n=new Vu({body:a,details:u?.error?so(u.error):l.statusText,headers:l.headers,status:l.status,url:o});continue}if(!ws(u)){n=new LR({result:u,url:o});continue}return u}catch(l){n=new Vu({body:a,details:l.message,url:o})}}throw n}var Wlt,cme,fme=F(()=>{FE();ome();I5();LW();l5();ame();zl();xd();Rd();Wlt="0x556f1830",cme={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]}});async function hm(t,e){let{account:r=t.account,batch:n=!!t.batch?.multicall,blockNumber:i,blockTag:o="latest",accessList:s,blobs:a,code:l,data:u,factory:d,factoryData:p,gas:v,gasPrice:y,maxFeePerBlobGas:S,maxFeePerGas:R,maxPriorityFeePerGas:O,nonce:k,to:M,value:D,stateOverride:j,...q}=e,W=r?Ti(r):void 0;if(l&&(d||p))throw new Oe("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(l&&M)throw new Oe("Cannot provide both `code` & `to` as parameters.");let V=l&&u,P=d&&p&&M&&u,$=V||P,U=V?Qlt({code:l,data:u}):P?Zlt({data:u,factory:d,factoryData:p,to:M}):u;try{Nd(e);let z=(i?tr(i):void 0)||o,f=Gk(j),h=t.chain?.formatters?.transactionRequest?.format,b=(h||rm)({...k5(q,{format:h}),from:W?.address,accessList:s,blobs:a,data:U,gas:v,gasPrice:y,maxFeePerBlobGas:S,maxFeePerGas:R,maxPriorityFeePerGas:O,nonce:k,to:$?void 0:M,value:D});if(n&&Klt({request:b})&&!f)try{return await Glt(t,{...b,blockNumber:i,blockTag:o})}catch(T){if(!(T instanceof EE)&&!(T instanceof y3))throw T}let C=await t.request({method:"eth_call",params:f?[b,z,f]:[b,z]});return C==="0x"?{data:void 0}:{data:C}}catch(L){let z=Ylt(L),{offchainLookup:f,offchainLookupSignature:h}=await Promise.resolve().then(()=>(fme(),ume));if(t.ccipRead!==!1&&z?.slice(0,10)===h&&M)return{data:await f(t,{data:z,to:M})};throw $&&z?.slice(0,10)==="0x101bb98d"?new UE({factory:d}):nme(L,{...e,account:W,chain:t.chain})}}function Klt({request:t}){let{data:e,to:r,...n}=t;return!(!e||e.startsWith(Jpe)||!r||Object.values(n).filter(i=>typeof i<"u").length>0)}async function Glt(t,e){let{batchSize:r=1024,wait:n=0}=typeof t.batch?.multicall=="object"?t.batch.multicall:{},{blockNumber:i,blockTag:o="latest",data:s,multicallAddress:a,to:l}=e,u=a;if(!u){if(!t.chain)throw new EE;u=Pd({blockNumber:i,chain:t.chain,contract:"multicall3"})}let p=(i?tr(i):void 0)||o,{schedule:v}=BR({id:`${t.uid}.${p}`,wait:n,shouldSplitBatch(R){return R.reduce((k,{data:M})=>k+(M.length-2),0)>r*2},fn:async R=>{let O=R.map(D=>({allowFailure:!0,callData:D.data,target:D.to})),k=Ds({abi:OE,args:[O],functionName:"aggregate3"}),M=await t.request({method:"eth_call",params:[{data:k,to:u},p]});return Gu({abi:OE,args:[O],functionName:"aggregate3",data:M||"0x"})}}),[{returnData:y,success:S}]=await v({data:s,to:l});if(!S)throw new um({data:y});return y==="0x"?{data:void 0}:{data:y}}function Qlt(t){let{code:e,data:r}=t;return mE({abi:SR(["constructor(bytes, bytes)"]),bytecode:eme,args:[e,r]})}function Zlt(t){let{data:e,factory:r,factoryData:n,to:i}=t;return mE({abi:SR(["constructor(address, bytes, address, bytes)"]),bytecode:tme,args:[i,e,r,n]})}function Ylt(t){if(!(t instanceof Oe))return;let e=t.walk();return typeof e?.data=="object"?e.data?.data:e.data}var FE=F(()=>{OW();tl();L5();Xpe();rme();mn();b3();F3();j3();Bz();cm();H5();Vr();ime();jk();D3();qW();hW();R5()});async function nl(t,e){let{abi:r,address:n,args:i,functionName:o,...s}=e,a=Ds({abi:r,args:i,functionName:o});try{let{data:l}=await en(t,hm,"call")({...s,data:a,to:n});return Gu({abi:r,args:i,functionName:o,data:l||"0x"})}catch(l){throw fm(l,{abi:r,address:n,args:i,docsPath:"/docs/contract/readContract",functionName:o})}}var $3=F(()=>{j3();cm();jE();Pa();FE()});async function HW(t,{blockNumber:e,blockTag:r,coinType:n,name:i,gatewayUrls:o,strict:s,universalResolverAddress:a}){let l=a;if(!l){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");l=Pd({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{let u=Ds({abi:EW,functionName:"addr",...n!=null?{args:[W5(i),BigInt(n)]}:{args:[W5(i)]}}),d={address:l,abi:sR,functionName:"resolve",args:[Pt(V5(i)),u],blockNumber:e,blockTag:r},p=en(t,nl,"readContract"),v=o?await p({...d,args:[...d.args,o]}):await p(d);if(v[0]==="0x")return null;let y=Gu({abi:EW,args:n!=null?[W5(i),BigInt(n)]:void 0,functionName:"addr",data:v[0]});return y==="0x"||is(y)==="0x00"?null:y}catch(u){if(s)throw u;if(z5(u,"resolve"))return null;throw u}}var hme=F(()=>{L5();j3();cm();H5();og();Vr();NR();FW();PR();Pa();$3()});var jR,_g,K5,FR,dme=F(()=>{mn();jR=class extends Oe{constructor({data:e}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(e)}`],name:"EnsAvatarInvalidMetadataError"})}},_g=class extends Oe{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`,{name:"EnsAvatarInvalidNftUriError"})}},K5=class extends Oe{constructor({uri:e}){super(`Unable to resolve ENS avatar URI "${e}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}},FR=class extends Oe{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}});async function rut(t){try{let e=await fetch(t,{method:"HEAD"});return e.status===200?e.headers.get("content-type")?.startsWith("image/"):!1}catch(e){return typeof e=="object"&&typeof e.response<"u"||!globalThis.hasOwnProperty("Image")?!1:new Promise(r=>{let n=new Image;n.onload=()=>{r(!0)},n.onerror=()=>{r(!1)},n.src=t})}}function pme(t,e){return t?t.endsWith("/")?t.slice(0,-1):t:e}function zW({uri:t,gatewayUrls:e}){let r=eut.test(t);if(r)return{uri:t,isOnChain:!0,isEncoded:r};let n=pme(e?.ipfs,"https://ipfs.io"),i=pme(e?.arweave,"https://arweave.net"),o=t.match(Jlt),{protocol:s,subpath:a,target:l,subtarget:u=""}=o?.groups||{},d=s==="ipns:/"||a==="ipns/",p=s==="ipfs:/"||a==="ipfs/"||Xlt.test(t);if(t.startsWith("http")&&!d&&!p){let y=t;return e?.arweave&&(y=t.replace(/https:\/\/arweave.net/g,e?.arweave)),{uri:y,isOnChain:!1,isEncoded:!1}}if((d||p)&&l)return{uri:`${n}/${d?"ipns":"ipfs"}/${l}${u}`,isOnChain:!1,isEncoded:!1};if(s==="ar:/"&&l)return{uri:`${i}/${l}${u||""}`,isOnChain:!1,isEncoded:!1};let v=t.replace(tut,"");if(v.startsWith("<svg")&&(v=`data:image/svg+xml;base64,${btoa(v)}`),v.startsWith("data:")||v.startsWith("{"))return{uri:v,isOnChain:!0,isEncoded:!1};throw new K5({uri:t})}function WW(t){if(typeof t!="object"||!("image"in t)&&!("image_url"in t)&&!("image_data"in t))throw new jR({data:t});return t.image||t.image_url||t.image_data}async function mme({gatewayUrls:t,uri:e}){try{let r=await fetch(e).then(i=>i.json());return await $R({gatewayUrls:t,uri:WW(r)})}catch{throw new K5({uri:e})}}async function $R({gatewayUrls:t,uri:e}){let{uri:r,isOnChain:n}=zW({uri:e,gatewayUrls:t});if(n||await rut(r))return r;throw new K5({uri:e})}function gme(t){let e=t;e.startsWith("did:nft:")&&(e=e.replace("did:nft:","").replace(/_/g,"/"));let[r,n,i]=e.split("/"),[o,s]=r.split(":"),[a,l]=n.split(":");if(!o||o.toLowerCase()!=="eip155")throw new _g({reason:"Only EIP-155 supported"});if(!s)throw new _g({reason:"Chain ID not found"});if(!l)throw new _g({reason:"Contract address not found"});if(!i)throw new _g({reason:"Token ID not found"});if(!a)throw new _g({reason:"ERC namespace not found"});return{chainID:Number.parseInt(s),namespace:a.toLowerCase(),contractAddress:l,tokenID:i}}async function wme(t,{nft:e}){if(e.namespace==="erc721")return nl(t,{address:e.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(e.tokenID)]});if(e.namespace==="erc1155")return nl(t,{address:e.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(e.tokenID)]});throw new FR({namespace:e.namespace})}var Jlt,Xlt,eut,tut,vme=F(()=>{$3();dme();Jlt=/(?<protocol>https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,Xlt=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,eut=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,tut=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/});async function yme(t,{gatewayUrls:e,record:r}){return/eip155:/i.test(r)?nut(t,{gatewayUrls:e,record:r}):$R({uri:r,gatewayUrls:e})}async function nut(t,{gatewayUrls:e,record:r}){let n=gme(r),i=await wme(t,{nft:n}),{uri:o,isOnChain:s,isEncoded:a}=zW({uri:i,gatewayUrls:e});if(s&&(o.includes("data:application/json;base64,")||o.startsWith("{"))){let u=a?atob(o.replace("data:application/json;base64,","")):o,d=JSON.parse(u);return $R({uri:WW(d),gatewayUrls:e})}let l=n.tokenID;return n.namespace==="erc1155"&&(l=l.replace("0x","").padStart(64,"0")),mme({gatewayUrls:e,uri:o.replace(/(?:0x)?{id}/,l)})}var bme=F(()=>{vme()});async function xme(t,{blockNumber:e,blockTag:r,name:n,key:i,gatewayUrls:o,strict:s,universalResolverAddress:a}){let l=a;if(!l){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");l=Pd({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{let u={address:l,abi:sR,functionName:"resolve",args:[Pt(V5(n)),Ds({abi:xW,functionName:"text",args:[W5(n),i]})],blockNumber:e,blockTag:r},d=en(t,nl,"readContract"),p=o?await d({...u,args:[...u.args,o]}):await d(u);if(p[0]==="0x")return null;let v=Gu({abi:xW,functionName:"text",data:p[0]});return v===""?null:v}catch(u){if(s)throw u;if(z5(u,"resolve"))return null;throw u}}var Eme=F(()=>{L5();j3();cm();H5();Vr();NR();FW();PR();Pa();$3()});async function VW(t,{blockNumber:e,blockTag:r,assetGatewayUrls:n,name:i,gatewayUrls:o,strict:s,universalResolverAddress:a}){let l=await en(t,xme,"getEnsText")({blockNumber:e,blockTag:r,key:"avatar",name:i,universalResolverAddress:a,gatewayUrls:o,strict:s});if(!l)return null;try{return await yme(t,{record:l,gatewayUrls:n})}catch{return null}}var Cme=F(()=>{bme();Pa();Eme()});async function KW(t,{address:e,blockNumber:r,blockTag:n,gatewayUrls:i,strict:o,universalResolverAddress:s}){let a=s;if(!a){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");a=Pd({blockNumber:r,chain:t.chain,contract:"ensUniversalResolver"})}let l=`${e.toLowerCase().substring(2)}.addr.reverse`;try{let u={address:a,abi:Q0e,functionName:"reverse",args:[Pt(V5(l))],blockNumber:r,blockTag:n},d=en(t,nl,"readContract"),[p,v]=i?await d({...u,args:[...u.args,i]}):await d(u);return e.toLowerCase()!==v.toLowerCase()?null:p}catch(u){if(o)throw u;if(z5(u,"reverse"))return null;throw u}}var Ame=F(()=>{L5();H5();Vr();NR();PR();Pa();$3()});function Sme(t){let e=(i,o)=>({clear:()=>o.delete(i),get:()=>o.get(i),set:s=>o.set(i,s)}),r=e(t,iut),n=e(t,out);return{clear:()=>{r.clear(),n.clear()},promise:r,response:n}}async function _me(t,{cacheKey:e,cacheTime:r=Number.POSITIVE_INFINITY}){let n=Sme(e),i=n.response.get();if(i&&r>0&&new Date().getTime()-i.created.getTime()<r)return i.data;let o=n.promise.get();o||(o=t(),n.promise.set(o));try{let s=await o;return n.response.set({created:new Date,data:s}),s}finally{n.promise.clear()}}var iut,out,Ime=F(()=>{iut=new Map,out=new Map});async function Tme(t,{cacheTime:e=t.cacheTime}={}){let r=await _me(()=>t.request({method:"eth_blockNumber"}),{cacheKey:sut(t.uid),cacheTime:e});return BigInt(r)}var sut,kme=F(()=>{Ime();sut=t=>`blockNumber.${t}`});function qR(t,{args:e,eventName:r}={}){return{...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,logIndex:t.logIndex?Number(t.logIndex):null,transactionHash:t.transactionHash?t.transactionHash:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,...r?{args:e,eventName:r}:{}}}var GW=F(()=>{});async function $E(t,{blockHash:e,blockNumber:r,blockTag:n,hash:i,index:o}){let s=n||"latest",a=r!==void 0?tr(r):void 0,l=null;if(i?l=await t.request({method:"eth_getTransactionByHash",params:[i]},{dedupe:!0}):e?l=await t.request({method:"eth_getTransactionByBlockHashAndIndex",params:[e,tr(o)]},{dedupe:!0}):(a||s)&&(l=await t.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[a||s,tr(o)]},{dedupe:!!a})),!l)throw new A5({blockHash:e,blockNumber:r,blockTag:s,hash:i,index:o});return(t.chain?.formatters?.transaction?.format||nm)(l)}var QW=F(()=>{fh();Vr();L3()});function ZW(t){let e={...t,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,contractAddress:t.contractAddress?t.contractAddress:null,cumulativeGasUsed:t.cumulativeGasUsed?BigInt(t.cumulativeGasUsed):null,effectiveGasPrice:t.effectiveGasPrice?BigInt(t.effectiveGasPrice):null,gasUsed:t.gasUsed?BigInt(t.gasUsed):null,logs:t.logs?t.logs.map(r=>qR(r)):null,to:t.to?t.to:null,transactionIndex:t.transactionIndex?Ps(t.transactionIndex):null,status:t.status?aut[t.status]:null,type:t.type?aW[t.type]||t.type:null};return t.blobGasPrice&&(e.blobGasPrice=BigInt(t.blobGasPrice)),t.blobGasUsed&&(e.blobGasUsed=BigInt(t.blobGasUsed)),e}var aut,HR,zR=F(()=>{Na();_E();GW();L3();aut={"0x0":"reverted","0x1":"success"};HR=xg("transactionReceipt",ZW)});async function YW(t,{hash:e}){let r=await t.request({method:"eth_getTransactionReceipt",params:[e]},{dedupe:!0});if(!r)throw new S5({hash:e});return(t.chain?.formatters?.transactionReceipt?.format||ZW)(r)}var Rme=F(()=>{fh();zR()});async function JW(t,e){let{allowFailure:r=!0,batchSize:n,blockNumber:i,blockTag:o,multicallAddress:s,stateOverride:a}=e,l=e.contracts,u=n??(typeof t.batch?.multicall=="object"&&t.batch.multicall.batchSize||1024),d=s;if(!d){if(!t.chain)throw new Error("client chain not configured. multicallAddress is required.");d=Pd({blockNumber:i,chain:t.chain,contract:"multicall3"})}let p=[[]],v=0,y=0;for(let O=0;O<l.length;O++){let{abi:k,address:M,args:D,functionName:j}=l[O];try{let q=Ds({abi:k,args:D,functionName:j});y+=(q.length-2)/2,u>0&&y>u&&p[v].length>0&&(v++,y=(q.length-2)/2,p[v]=[]),p[v]=[...p[v],{allowFailure:!0,callData:q,target:M}]}catch(q){let W=fm(q,{abi:k,address:M,args:D,docsPath:"/docs/contract/multicall",functionName:j});if(!r)throw W;p[v]=[...p[v],{allowFailure:!0,callData:"0x",target:M}]}}let S=await Promise.allSettled(p.map(O=>en(t,nl,"readContract")({abi:OE,address:d,args:[O],blockNumber:i,blockTag:o,functionName:"aggregate3",stateOverride:a}))),R=[];for(let O=0;O<S.length;O++){let k=S[O];if(k.status==="rejected"){if(!r)throw k.reason;for(let D=0;D<p[O].length;D++)R.push({status:"failure",error:k.reason,result:void 0});continue}let M=k.value;for(let D=0;D<M.length;D++){let{returnData:j,success:q}=M[D],{callData:W}=p[O][D],{abi:V,address:P,functionName:$,args:U}=l[R.length];try{if(W==="0x")throw new Ad;if(!q)throw new um({data:j});let L=Gu({abi:V,args:U,data:j,functionName:$});R.push(r?{result:L,status:"success"}:L)}catch(L){let z=fm(L,{abi:V,address:P,args:U,docsPath:"/docs/contract/multicall",functionName:$});if(!r)throw z;R.push({error:z,result:void 0,status:"failure"})}}}if(R.length!==l.length)throw new Oe("multicall results mismatch");return R}var Mme=F(()=>{L5();Hl();mn();F3();j3();cm();H5();jE();Pa();$3()});function qE(t,e,r){let n=++cut,i=()=>XW.get(t)||[],o=()=>{let d=i();XW.set(t,d.filter(p=>p.id!==n))},s=()=>{let d=Nme.get(t);i().length===1&&d&&d(),o()},a=i();if(XW.set(t,[...a,{id:n,fns:e}]),a&&a.length>0)return s;let l={};for(let d in e)l[d]=(...p)=>{let v=i();if(v.length!==0)for(let y of v)y.fns[d]?.(...p)};let u=r(l);return typeof u=="function"&&Nme.set(t,u),s}var XW,Nme,cut,eV=F(()=>{XW=new Map,Nme=new Map,cut=0});async function HE(t){return new Promise(e=>setTimeout(e,t))}var tV=F(()=>{});function Ome(t,{emitOnBegin:e,initialWaitTime:r,interval:n}){let i=!0,o=()=>i=!1;return(async()=>{let a;e&&(a=await t({unpoll:o}));let l=await r?.(a)??n;await HE(l);let u=async()=>{i&&(await t({unpoll:o}),await HE(n),u())};u()})(),o}var Pme=F(()=>{tV()});function Bme(t,{emitOnBegin:e=!1,emitMissed:r=!1,onBlockNumber:n,onError:i,poll:o,pollingInterval:s=t.pollingInterval}){let a=typeof o<"u"?o:!(t.transport.type==="webSocket"||t.transport.type==="fallback"&&t.transport.transports[0].config.type==="webSocket"),l;return a?(()=>{let p=so(["watchBlockNumber",t.uid,e,r,s]);return qE(p,{onBlockNumber:n,onError:i},v=>Ome(async()=>{try{let y=await en(t,Tme,"getBlockNumber")({cacheTime:0});if(l){if(y===l)return;if(y-l>1&&r)for(let S=l+1n;S<y;S++)v.onBlockNumber(S,l),l=S}(!l||y>l)&&(v.onBlockNumber(y,l),l=y)}catch(y){v.onError?.(y)}},{emitOnBegin:e,interval:s}))})():(()=>{let p=so(["watchBlockNumber",t.uid,e,r]);return qE(p,{onBlockNumber:n,onError:i},v=>{let y=!0,S=()=>y=!1;return(async()=>{try{let R=(()=>{if(t.transport.type==="fallback"){let k=t.transport.transports.find(M=>M.config.type==="webSocket");return k?k.value:t.transport}return t.transport})(),{unsubscribe:O}=await R.subscribe({params:["newHeads"],onData(k){if(!y)return;let M=Wn(k.result?.number);v.onBlockNumber(M,l),l=M},onError(k){v.onError?.(k)}});S=O,y||S()}catch(R){i?.(R)}})(),()=>S()})})()}var Dme=F(()=>{Na();Pa();eV();Pme();Rd();kme()});async function Lme(t){return t.account?.type==="local"?[t.account.address]:(await t.request({method:"eth_accounts"},{dedupe:!0})).map(r=>_d(r))}var Ume=F(()=>{hg()});async function jme(t){return await t.request({method:"wallet_getPermissions"},{dedupe:!0})}var Fme=F(()=>{});function $me(t,{enabled:e=!0,id:r}){if(!e||!r)return t();if(WR.get(r))return WR.get(r);let n=t().finally(()=>WR.delete(r));return WR.set(r,n),n}var WR,qme=F(()=>{XT();WR=new ag(8192)});function Ig(t,{delay:e=100,retryCount:r=2,shouldRetry:n=()=>!0}={}){return new Promise((i,o)=>{let s=async({count:a=0}={})=>{let l=async({error:u})=>{let d=typeof e=="function"?e({count:a,error:u}):e;d&&await HE(d),s({count:a+1})};try{let u=await t();i(u)}catch(u){if(a<r&&await n({count:a,error:u}))return l({error:u});o(u)}};s()})}var VR=F(()=>{tV()});function Hme(t,e={}){return async(r,n={})=>{let{dedupe:i=!1,retryDelay:o=150,retryCount:s=3,uid:a}={...e,...n},l=i?Fi(sh(`${a}.${so(r)}`)):void 0;return $me(()=>Ig(async()=>{try{return await t(r)}catch(u){let d=u;switch(d.code){case C3.code:throw new C3(d);case A3.code:throw new A3(d);case S3.code:throw new S3(d,{method:r.method});case _3.code:throw new _3(d);case Md.code:throw new Md(d);case I3.code:throw new I3(d);case T3.code:throw new T3(d);case hh.code:throw new hh(d);case k3.code:throw new k3(d);case R3.code:throw new R3(d,{method:r.method});case bg.code:throw new bg(d);case M3.code:throw new M3(d);case yi.code:throw new yi(d);case N3.code:throw new N3(d);case O3.code:throw new O3(d);case P3.code:throw new P3(d);case B3.code:throw new B3(d);case la.code:throw new la(d);case 5e3:throw new yi(d);default:throw u instanceof Oe?u:new SE(d)}}},{delay:({count:u,error:d})=>{if(d&&d instanceof Vu){let p=d?.headers?.get("Retry-After");if(p?.match(/\d/))return Number.parseInt(p)*1e3}return~~(1<<u)*o},retryCount:s,shouldRetry:({error:u})=>lut(u)}),{enabled:i,id:l})}}function lut(t){return"code"in t&&typeof t.code=="number"?t.code===-1||t.code===bg.code||t.code===Md.code:t instanceof Vu&&t.status?t.status===403||t.status===408||t.status===413||t.status===429||t.status===500||t.status===502||t.status===503||t.status===504:!0}var zme=F(()=>{mn();I5();Lk();Vr();Sd();qme();VR();Rd()});function sr(t){return{formatters:void 0,fees:void 0,serializers:void 0,...t}}var ii=F(()=>{});var Wme,Vme,Kme=F(()=>{Wme=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Vme=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/});function q3(t,{errorInstance:e=new Error("timed out"),timeout:r,signal:n}){return new Promise((i,o)=>{(async()=>{let s;try{let a=new AbortController;r>0&&(s=setTimeout(()=>{n?a.abort():o(e)},r)),i(await t({signal:a?.signal||null}))}catch(a){a?.name==="AbortError"&&o(e),o(a)}finally{clearTimeout(s)}})()})}var rV=F(()=>{});function uut(){return{current:0,take(){return this.current++},reset(){this.current=0}}}var nV,Gme=F(()=>{nV=uut()});function Qme(t,e={}){return{async request(r){let{body:n,onRequest:i=e.onRequest,onResponse:o=e.onResponse,timeout:s=e.timeout??1e4}=r,a={...e.fetchOptions??{},...r.fetchOptions??{}},{headers:l,method:u,signal:d}=a;try{let p=await q3(async({signal:y})=>{let S={...a,body:Array.isArray(n)?so(n.map(k=>({jsonrpc:"2.0",id:k.id??nV.take(),...k}))):so({jsonrpc:"2.0",id:n.id??nV.take(),...n}),headers:{"Content-Type":"application/json",...l},method:u||"POST",signal:d||(s>0?y:null)},R=new Request(t,S);return i&&await i(R),await fetch(t,S)},{errorInstance:new AE({body:n,url:t}),timeout:s,signal:!0});o&&await o(p);let v;if(p.headers.get("Content-Type")?.startsWith("application/json")?v=await p.json():(v=await p.text(),v=JSON.parse(v||"{}")),!p.ok)throw new Vu({body:n,details:so(v.error)||p.statusText,headers:p.headers,status:p.status,url:t});return v}catch(p){throw p instanceof Vu||p instanceof AE?p:new Vu({body:n,cause:p,url:t})}}}}var Zme=F(()=>{I5();rV();Rd();Gme()});function iV(t){let{domain:e={},message:r,primaryType:n}=t,i={EIP712Domain:GR({domain:e}),...t.types};KR({domain:e,message:r,primaryType:n,types:i});let o=["0x1901"];return e&&o.push(Yme({domain:e,types:i})),n!=="EIP712Domain"&&o.push(Jme({data:r,primaryType:n,types:i})),Fi(gc(o))}function Yme({domain:t,types:e}){return Jme({data:t,primaryType:"EIP712Domain",types:e})}function Jme({data:t,primaryType:e,types:r}){let n=Xme({data:t,primaryType:e,types:r});return Fi(n)}function Xme({data:t,primaryType:e,types:r}){let n=[{type:"bytes32"}],i=[fut({primaryType:e,types:r})];for(let o of r[e]){let[s,a]=t1e({types:r,name:o.name,type:o.type,value:t[o.name]});n.push(s),i.push(a)}return Jp(n,i)}function fut({primaryType:t,types:e}){let r=Pt(hut({primaryType:t,types:e}));return Fi(r)}function hut({primaryType:t,types:e}){let r="",n=e1e({primaryType:t,types:e});n.delete(t);let i=[t,...Array.from(n).sort()];for(let o of i)r+=`${o}(${e[o].map(({name:s,type:a})=>`${a} ${s}`).join(",")})`;return r}function e1e({primaryType:t,types:e},r=new Set){let i=t.match(/^\w*/u)?.[0];if(r.has(i)||e[i]===void 0)return r;r.add(i);for(let o of e[i])e1e({primaryType:o.type,types:e},r);return r}function t1e({types:t,name:e,type:r,value:n}){if(t[r]!==void 0)return[{type:"bytes32"},Fi(Xme({data:n,primaryType:r,types:t}))];if(r==="bytes")return n=`0x${(n.length%2?"0":"")+n.slice(2)}`,[{type:"bytes32"},Fi(n)];if(r==="string")return[{type:"bytes32"},Fi(Pt(n))];if(r.lastIndexOf("]")===r.length-1){let i=r.slice(0,r.lastIndexOf("[")),o=n.map(s=>t1e({name:e,type:i,types:t,value:s}));return[{type:"bytes32"},Fi(Jp(o.map(([s])=>s),o.map(([,s])=>s)))]}return[{type:r},n]}var r1e=F(()=>{l5();zl();Vr();Sd();oV()});function n1e(t){let{domain:e,message:r,primaryType:n,types:i}=t,o=(l,u)=>{let d={...u};for(let p of l){let{name:v,type:y}=p;y==="address"&&(d[v]=d[v].toLowerCase())}return d},s=i.EIP712Domain?e?o(i.EIP712Domain,e):{}:{},a=(()=>{if(n!=="EIP712Domain")return o(i[n],r)})();return so({domain:s,message:a,primaryType:n,types:i})}function KR(t){let{domain:e,message:r,primaryType:n,types:i}=t,o=(s,a)=>{for(let l of s){let{name:u,type:d}=l,p=a[u],v=d.match(Vme);if(v&&(typeof p=="number"||typeof p=="bigint")){let[R,O,k]=v;tr(p,{signed:O==="int",size:Number.parseInt(k)/8})}if(d==="address"&&typeof p=="string"&&!$n(p))throw new ni({address:p});let y=d.match(Wme);if(y){let[R,O]=y;if(O&&fi(p)!==Number.parseInt(O))throw new QT({expectedSize:Number.parseInt(O),givenSize:fi(p)})}let S=i[d];S&&o(S,p)}};i.EIP712Domain&&e&&o(i.EIP712Domain,e),n!=="EIP712Domain"&&o(i[n],r)}function GR({domain:t}){return[typeof t?.name=="string"&&{name:"name",type:"string"},t?.version&&{name:"version",type:"string"},typeof t?.chainId=="number"&&{name:"chainId",type:"uint256"},t?.verifyingContract&&{name:"verifyingContract",type:"address"},t?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}var oV=F(()=>{Hl();qu();Wl();Ed();Vr();Kme();Rd()});var i1e,o1e=F(()=>{i1e=`Ethereum Signed Message: | |
`});function s1e(t){let e=typeof t=="string"?sh(t):typeof t.raw=="string"?t.raw:ri(t.raw),r=sh(`${i1e}${fi(e)}`);return gc([r,e])}var a1e=F(()=>{o1e();zl();Ed();Vr()});function sV(t,e){return Fi(s1e(t),e)}var c1e=F(()=>{Sd();a1e()});function l1e(t){let{authorizationList:e}=t;if(e)for(let r of e){let{contractAddress:n,chainId:i}=r;if(!$n(n))throw new ni({address:n});if(i<=0)throw new uh({chainId:i})}QR(t)}function u1e(t){let{blobVersionedHashes:e}=t;if(e){if(e.length===0)throw new D5;for(let r of e){let n=fi(r),i=Ps(Yp(r,0,1));if(n!==32)throw new eR({hash:r,size:n});if(i!==1)throw new tR({hash:r,version:i})}}QR(t)}function QR(t){let{chainId:e,maxPriorityFeePerGas:r,maxFeePerGas:n,to:i}=t;if(e<=0)throw new uh({chainId:e});if(i&&!$n(i))throw new ni({address:i});if(n&&n>2n**256n-1n)throw new rl({maxFeePerGas:n});if(r&&n&&r>n)throw new Wu({maxFeePerGas:n,maxPriorityFeePerGas:r})}function f1e(t){let{chainId:e,maxPriorityFeePerGas:r,gasPrice:n,maxFeePerGas:i,to:o}=t;if(e<=0)throw new uh({chainId:e});if(o&&!$n(o))throw new ni({address:o});if(r||i)throw new Oe("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(n&&n>2n**256n-1n)throw new rl({maxFeePerGas:n})}function h1e(t){let{chainId:e,maxPriorityFeePerGas:r,gasPrice:n,maxFeePerGas:i,to:o}=t;if(o&&!$n(o))throw new ni({address:o});if(typeof e<"u"&&e<=0)throw new uh({chainId:e});if(r||i)throw new Oe("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(n&&n>2n**256n-1n)throw new rl({maxFeePerGas:n})}var d1e=F(()=>{qu();mn();wW();b3();yg();Wl();Ed();c5();Na()});function p1e(t){if(!t||t.length===0)return[];let e=[];for(let r of t){let{contractAddress:n,chainId:i,nonce:o,...s}=r;e.push([Pt(i),n,Pt(o),...Tg({},s)])}return e}var m1e=F(()=>{Vr();zE()});function H3(t){if(!t||t.length===0)return[];let e=[];for(let r=0;r<t.length;r++){let{address:n,storageKeys:i}=t[r];for(let o=0;o<i.length;o++)if(i[o].length-2!==64)throw new Pk({storageKey:i[o]});if(!$n(n,{strict:!1}))throw new ni({address:n});e.push([n,i])}return e}var aV=F(()=>{qu();fh();Wl()});function ZR(t,e){let r=nR(t);return r==="eip1559"?mut(t,e):r==="eip2930"?gut(t,e):r==="eip4844"?put(t,e):r==="eip7702"?dut(t,e):wut(t,e)}function dut(t,e){let{authorizationList:r,chainId:n,gas:i,nonce:o,to:s,value:a,maxFeePerGas:l,maxPriorityFeePerGas:u,accessList:d,data:p}=t;l1e(t);let v=H3(d),y=p1e(r);return Bs(["0x04",wc([Pt(n),o?Pt(o):"0x",u?Pt(u):"0x",l?Pt(l):"0x",i?Pt(i):"0x",s??"0x",a?Pt(a):"0x",p??"0x",v,y,...Tg(t,e)])])}function put(t,e){let{chainId:r,gas:n,nonce:i,to:o,value:s,maxFeePerBlobGas:a,maxFeePerGas:l,maxPriorityFeePerGas:u,accessList:d,data:p}=t;u1e(t);let v=t.blobVersionedHashes,y=t.sidecars;if(t.blobs&&(typeof v>"u"||typeof y>"u")){let D=typeof t.blobs[0]=="string"?t.blobs:t.blobs.map(W=>ri(W)),j=t.kzg,q=P5({blobs:D,kzg:j});if(typeof v>"u"&&(v=Jk({commitments:q})),typeof y>"u"){let W=B5({blobs:D,commitments:q,kzg:j});y=rR({blobs:D,commitments:q,proofs:W})}}let S=H3(d),R=[Pt(r),i?Pt(i):"0x",u?Pt(u):"0x",l?Pt(l):"0x",n?Pt(n):"0x",o??"0x",s?Pt(s):"0x",p??"0x",S,a?Pt(a):"0x",v??[],...Tg(t,e)],O=[],k=[],M=[];if(y)for(let D=0;D<y.length;D++){let{blob:j,commitment:q,proof:W}=y[D];O.push(j),k.push(q),M.push(W)}return Bs(["0x03",y?wc([R,O,k,M]):wc(R)])}function mut(t,e){let{chainId:r,gas:n,nonce:i,to:o,value:s,maxFeePerGas:a,maxPriorityFeePerGas:l,accessList:u,data:d}=t;QR(t);let p=H3(u),v=[Pt(r),i?Pt(i):"0x",l?Pt(l):"0x",a?Pt(a):"0x",n?Pt(n):"0x",o??"0x",s?Pt(s):"0x",d??"0x",p,...Tg(t,e)];return Bs(["0x02",wc(v)])}function gut(t,e){let{chainId:r,gas:n,data:i,nonce:o,to:s,value:a,accessList:l,gasPrice:u}=t;f1e(t);let d=H3(l),p=[Pt(r),o?Pt(o):"0x",u?Pt(u):"0x",n?Pt(n):"0x",s??"0x",a?Pt(a):"0x",i??"0x",d,...Tg(t,e)];return Bs(["0x01",wc(p)])}function wut(t,e){let{chainId:r=0,gas:n,data:i,nonce:o,to:s,value:a,gasPrice:l}=t;h1e(t);let u=[o?Pt(o):"0x",l?Pt(l):"0x",n?Pt(n):"0x",s??"0x",a?Pt(a):"0x",i??"0x"];if(e){let d=(()=>{if(e.v>=35n)return(e.v-35n)/2n>0?e.v:27n+(e.v===35n?0n:1n);if(r>0)return BigInt(r*2)+BigInt(35n+e.v-27n);let y=27n+(e.v===27n?0n:1n);if(e.v!==y)throw new Nk({v:e.v});return y})(),p=is(e.r),v=is(e.s);u=[...u,Pt(d),p==="0x00"?"0x":p,v==="0x00"?"0x":v]}else r>0&&(u=[...u,Pt(r),"0x","0x"]);return wc(u)}function Tg(t,e){let r=e??t,{v:n,yParity:i}=r;if(typeof r.r>"u")return[];if(typeof r.s>"u")return[];if(typeof n>"u"&&typeof i>"u")return[];let o=is(r.r),s=is(r.s);return[typeof i=="number"?i?Pt(1):"0x":n===0n?"0x":n===1n?Pt(1):n===27n?"0x":Pt(1),o==="0x00"?"0x":o,s==="0x00"?"0x":s]}var zE=F(()=>{fh();Qk();Zk();gW();vW();zl();og();Vr();d5();m1e();d1e();yW();aV()});function cV(t,e){let[r,n="0"]=t.split("."),i=r.startsWith("-");if(i&&(r=r.slice(1)),n=n.replace(/(0+)$/,""),e===0)Math.round(+`.${n}`)===1&&(r=`${BigInt(r)+1n}`),n="";else if(n.length>e){let[o,s,a]=[n.slice(0,e-1),n.slice(e-1,e),n.slice(e)],l=Math.round(+`${s}.${a}`);l>9?n=`${BigInt(o)+BigInt(1)}0`.padStart(o.length+1,"0"):n=`${o}${l}`,n.length>e&&(n=n.slice(1),r=`${BigInt(r)+1n}`),n=n.slice(0,e)}else n=n.padEnd(e,"0");return BigInt(`${i?"-":""}${r}${n}`)}var g1e=F(()=>{});var w1e=F(()=>{tl();hg()});async function lV(t,{confirmations:e=1,hash:r,onReplaced:n,pollingInterval:i=t.pollingInterval,retryCount:o=6,retryDelay:s=({count:l})=>~~(1<<l)*200,timeout:a}){let l=so(["waitForTransactionReceipt",t.uid,r]),u=0,d,p,v,y=!1;return new Promise((S,R)=>{a&&setTimeout(()=>R(new CE({hash:r})),a);let O=qE(l,{onReplaced:n,resolve:S,reject:R},k=>{let M=en(t,Bme,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:i,async onBlockNumber(D){let j=W=>{M(),W(),O()},q=D;if(!y){u>o&&j(()=>k.reject(new CE({hash:r})));try{if(v){if(e>1&&(!v.blockNumber||q-v.blockNumber+1n<e))return;j(()=>k.resolve(v));return}if(d||(y=!0,await Ig(async()=>{d=await en(t,$E,"getTransaction")({hash:r}),d.blockNumber&&(q=d.blockNumber)},{delay:s,retryCount:o}),y=!1),v=await en(t,YW,"getTransactionReceipt")({hash:r}),e>1&&(!v.blockNumber||q-v.blockNumber+1n<e))return;j(()=>k.resolve(v))}catch(W){if(W instanceof A5||W instanceof S5){if(!d){y=!1;return}try{p=d,y=!0;let V=await Ig(()=>en(t,im,"getBlock")({blockNumber:q,includeTransactions:!0}),{delay:s,retryCount:o,shouldRetry:({error:U})=>U instanceof M5});y=!1;let P=V.transactions.find(({from:U,nonce:L})=>U===p.from&&L===p.nonce);if(!P||(v=await en(t,YW,"getTransactionReceipt")({hash:P.hash}),e>1&&(!v.blockNumber||q-v.blockNumber+1n<e)))return;let $="replaced";P.to===p.to&&P.value===p.value?$="repriced":P.from===P.to&&P.value===0n&&($="cancelled"),j(()=>{k.onReplaced?.({reason:$,replacedTransaction:p,transaction:P,transactionReceipt:v}),k.resolve(v)})}catch(V){j(()=>k.reject(V))}}else j(()=>k.reject(W))}finally{u++}}}})})})}var v1e=F(()=>{sW();fh();Pa();eV();VR();Rd();kE();QW();Rme();Dme()});async function y1e(t){return(await t.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(r=>Yi(r))}var b1e=F(()=>{hg()});async function x1e(t,e){return t.request({method:"wallet_requestPermissions",params:[e]},{retryCount:0})}var E1e=F(()=>{});async function C1e(t,e){let{account:r=t.account,chain:n=t.chain,...i}=e;if(!r)throw new Hu({docsPath:"/docs/actions/wallet/signTransaction"});let o=Ti(r);Nd({account:o,...e});let s=await en(t,Eg,"getChainId")({});n!==null&&Ik({currentChainId:s,chain:n});let l=(n?.formatters||t.chain?.formatters)?.transactionRequest?.format||rm;return o.signTransaction?o.signTransaction({...i,chainId:s},{serializer:t.chain?.serializers?.transaction}):await t.request({method:"eth_signTransaction",params:[{...l(i),chainId:tr(s),from:o.address}]},{retryCount:0})}var A1e=F(()=>{tl();f5();rW();Vr();D3();Pa();R5();IE()});async function WE(t,{account:e=t.account,message:r}){if(!e)throw new Hu({docsPath:"/docs/actions/wallet/signMessage"});let n=Ti(e);if(n.signMessage)return n.signMessage({message:r});let i=typeof r=="string"?sh(r):r.raw instanceof Uint8Array?Pt(r.raw):r.raw;return t.request({method:"personal_sign",params:[i,n.address]},{retryCount:0})}var uV=F(()=>{tl();f5();Vr()});async function S1e(t,e){let{account:r=t.account,domain:n,message:i,primaryType:o}=e;if(!r)throw new Hu({docsPath:"/docs/actions/wallet/signTypedData"});let s=Ti(r),a={EIP712Domain:GR({domain:n}),...e.types};if(KR({domain:n,message:i,primaryType:o,types:a}),s.signTypedData)return s.signTypedData({domain:n,message:i,primaryType:o,types:a});let l=n1e({domain:n,message:i,primaryType:o,types:a});return t.request({method:"eth_signTypedData_v4",params:[s.address,l]},{retryCount:0})}var _1e=F(()=>{tl();f5();oV()});async function fV(t,e){let{abi:r,address:n,args:i,dataSuffix:o,functionName:s,...a}=e,l=a.account?Ti(a.account):t.account,u=Ds({abi:r,args:i,functionName:s});try{let{data:d}=await en(t,hm,"call")({batch:!1,data:`${u}${o?o.replace("0x",""):""}`,to:n,...a,account:l}),p=Gu({abi:r,args:i,functionName:s,data:d||"0x"}),v=r.filter(y=>"name"in y&&y.name===e.functionName);return{result:p,request:{abi:v,address:n,args:i,dataSuffix:o,functionName:s,...a,account:l}}}catch(d){throw fm(d,{abi:r,address:n,args:i,docsPath:"/docs/contract/simulateContract",functionName:s,sender:l?.address})}}var I1e=F(()=>{tl();j3();cm();jE();Pa();FE()});async function T1e(t,{id:e}){await t.request({method:"wallet_switchEthereumChain",params:[{chainId:tr(e)}]},{retryCount:0})}var k1e=F(()=>{Vr()});async function R1e(t,e){return await t.request({method:"wallet_watchAsset",params:e},{retryCount:0})}var M1e=F(()=>{});async function VE(t,e){let{abi:r,account:n=t.account,address:i,args:o,dataSuffix:s,functionName:a,...l}=e;if(!n)throw new Hu({docsPath:"/docs/contract/writeContract"});let u=Ti(n),d=Ds({abi:r,args:o,functionName:a});try{return await en(t,sm,"sendTransaction")({data:`${d}${s?s.replace("0x",""):""}`,to:i,account:u,...l})}catch(p){throw fm(p,{abi:r,address:i,args:o,docsPath:"/docs/contract/writeContract",functionName:a,sender:u.address})}}var hV=F(()=>{tl();f5();cm();jE();Pa();NE()});function tM(t=11){if(!eM||XR+t>256*2){eM="",XR=0;for(let e=0;e<256;e++)eM+=(256+Math.random()*256|0).toString(16).substring(1)}return eM.substring(XR,XR+++t)}var XR,eM,dV=F(()=>{XR=256});function Y5(t){let{batch:e,cacheTime:r=t.pollingInterval??4e3,ccipRead:n,key:i="base",name:o="Base Client",pollingInterval:s=4e3,type:a="base"}=t,l=t.chain,u=t.account?Ti(t.account):void 0,{config:d,request:p,value:v}=t.transport({chain:l,pollingInterval:s}),y={...d,...v},S={account:u,batch:e,cacheTime:r,ccipRead:n,chain:l,key:i,name:o,pollingInterval:s,request:p,transport:y,type:a,uid:tM()};function R(O){return k=>{let M=k(O);for(let j in S)delete M[j];let D={...O,...M};return Object.assign(D,{extend:R(D)})}}return Object.assign(S,{extend:R(S)})}var B1e=F(()=>{tl();dV()});function rM({key:t,name:e,request:r,retryCount:n=3,retryDelay:i=150,timeout:o,type:s},a){let l=tM();return{config:{key:t,name:e,request:r,retryCount:n,retryDelay:i,timeout:o,type:s},request:Hme(r,{retryCount:n,retryDelay:i,uid:l}),value:a}}var pV=F(()=>{zme();dV()});function J5(t,e={}){let{key:r="custom",name:n="Custom Provider",retryDelay:i}=e;return({retryCount:o})=>rM({key:r,name:n,request:t.request.bind(t),retryCount:e.retryCount??o,retryDelay:i,type:"custom"})}var D1e=F(()=>{pV()});var nM,L1e=F(()=>{mn();nM=class extends Oe{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}});function z3(t,e={}){let{batch:r,fetchOptions:n,key:i="http",name:o="HTTP JSON-RPC",onFetchRequest:s,onFetchResponse:a,retryDelay:l}=e;return({chain:u,retryCount:d,timeout:p})=>{let{batchSize:v=1e3,wait:y=0}=typeof r=="object"?r:{},S=e.retryCount??d,R=p??e.timeout??1e4,O=t||u?.rpcUrls.default.http[0];if(!O)throw new nM;let k=Qme(O,{fetchOptions:n,onRequest:s,onResponse:a,timeout:R});return rM({key:i,name:o,async request({method:M,params:D}){let j={method:M,params:D},{schedule:q}=BR({id:O,wait:y,shouldSplitBatch($){return $.length>v},fn:$=>k.request({body:$}),sort:($,U)=>$.id-U.id}),W=async $=>r?q($):[await k.request({body:$})],[{error:V,result:P}]=await W(j);if(V)throw new _5({body:j,error:V,url:O});return P},retryCount:S,retryDelay:l,timeout:R,type:"http"},{fetchOptions:n,url:O})}}var U1e=F(()=>{I5();L1e();qW();Zme();pV()});function iM(t){return{addChain:e=>lE(t,e),deployContract:e=>V0e(t,e),getAddresses:()=>Lme(t),getChainId:()=>Eg(t),getPermissions:()=>jme(t),prepareTransactionRequest:e=>om(t,e),requestAddresses:()=>y1e(t),requestPermissions:e=>x1e(t,e),sendRawTransaction:e=>oR(t,e),sendTransaction:e=>sm(t,e),signMessage:e=>WE(t,e),signTransaction:e=>C1e(t,e),signTypedData:e=>S1e(t,e),switchChain:e=>T1e(t,e),watchAsset:e=>R1e(t,e),writeContract:e=>VE(t,e)}}var j1e=F(()=>{IE();_z();K0e();Ume();Fme();ME();b1e();E1e();bW();NE();uV();A1e();_1e();k1e();M1e();hV()});var Wdr,Vdr,Kdr,Gdr,Qdr,Zdr,Ydr,Jdr,Xdr,e0r,t0r,r0r,n0r,i0r,o0r,s0r,a0r,c0r,l0r,u0r,f0r,h0r,d0r,p0r,m0r,g0r,w0r,v0r,y0r,b0r,x0r,E0r,C0r,A0r,S0r,_0r,I0r,T0r,k0r,R0r,M0r,N0r,O0r,P0r,B0r,D0r,L0r,U0r,j0r,F0r,$0r,q0r,H0r,z0r,W0r,V0r,K0r,G0r,Q0r,Z0r,Y0r,J0r,X0r,epr,tpr,F1e,rpr,npr,ipr,opr,spr,apr,cpr,lpr,upr,fpr,hpr,dpr,ppr,mpr,gpr,wpr,vpr,ypr,bpr,xpr,Epr,Cpr,Apr,Spr,_pr,Ipr,Tpr,kpr,Rpr,Mpr,$1e=F(()=>{Wdr=2n**(8n-1n)-1n,Vdr=2n**(16n-1n)-1n,Kdr=2n**(24n-1n)-1n,Gdr=2n**(32n-1n)-1n,Qdr=2n**(40n-1n)-1n,Zdr=2n**(48n-1n)-1n,Ydr=2n**(56n-1n)-1n,Jdr=2n**(64n-1n)-1n,Xdr=2n**(72n-1n)-1n,e0r=2n**(80n-1n)-1n,t0r=2n**(88n-1n)-1n,r0r=2n**(96n-1n)-1n,n0r=2n**(104n-1n)-1n,i0r=2n**(112n-1n)-1n,o0r=2n**(120n-1n)-1n,s0r=2n**(128n-1n)-1n,a0r=2n**(136n-1n)-1n,c0r=2n**(144n-1n)-1n,l0r=2n**(152n-1n)-1n,u0r=2n**(160n-1n)-1n,f0r=2n**(168n-1n)-1n,h0r=2n**(176n-1n)-1n,d0r=2n**(184n-1n)-1n,p0r=2n**(192n-1n)-1n,m0r=2n**(200n-1n)-1n,g0r=2n**(208n-1n)-1n,w0r=2n**(216n-1n)-1n,v0r=2n**(224n-1n)-1n,y0r=2n**(232n-1n)-1n,b0r=2n**(240n-1n)-1n,x0r=2n**(248n-1n)-1n,E0r=2n**(256n-1n)-1n,C0r=-(2n**(8n-1n)),A0r=-(2n**(16n-1n)),S0r=-(2n**(24n-1n)),_0r=-(2n**(32n-1n)),I0r=-(2n**(40n-1n)),T0r=-(2n**(48n-1n)),k0r=-(2n**(56n-1n)),R0r=-(2n**(64n-1n)),M0r=-(2n**(72n-1n)),N0r=-(2n**(80n-1n)),O0r=-(2n**(88n-1n)),P0r=-(2n**(96n-1n)),B0r=-(2n**(104n-1n)),D0r=-(2n**(112n-1n)),L0r=-(2n**(120n-1n)),U0r=-(2n**(128n-1n)),j0r=-(2n**(136n-1n)),F0r=-(2n**(144n-1n)),$0r=-(2n**(152n-1n)),q0r=-(2n**(160n-1n)),H0r=-(2n**(168n-1n)),z0r=-(2n**(176n-1n)),W0r=-(2n**(184n-1n)),V0r=-(2n**(192n-1n)),K0r=-(2n**(200n-1n)),G0r=-(2n**(208n-1n)),Q0r=-(2n**(216n-1n)),Z0r=-(2n**(224n-1n)),Y0r=-(2n**(232n-1n)),J0r=-(2n**(240n-1n)),X0r=-(2n**(248n-1n)),epr=-(2n**(256n-1n)),tpr=2n**8n-1n,F1e=2n**16n-1n,rpr=2n**24n-1n,npr=2n**32n-1n,ipr=2n**40n-1n,opr=2n**48n-1n,spr=2n**56n-1n,apr=2n**64n-1n,cpr=2n**72n-1n,lpr=2n**80n-1n,upr=2n**88n-1n,fpr=2n**96n-1n,hpr=2n**104n-1n,dpr=2n**112n-1n,ppr=2n**120n-1n,mpr=2n**128n-1n,gpr=2n**136n-1n,wpr=2n**144n-1n,vpr=2n**152n-1n,ypr=2n**160n-1n,bpr=2n**168n-1n,xpr=2n**176n-1n,Epr=2n**184n-1n,Cpr=2n**192n-1n,Apr=2n**200n-1n,Spr=2n**208n-1n,_pr=2n**216n-1n,Ipr=2n**224n-1n,Tpr=2n**232n-1n,kpr=2n**240n-1n,Rpr=2n**248n-1n,Mpr=2n**256n-1n});var vc=F(()=>{B1e();D1e();U1e();j1e();Tk();F3();Lk();cm();r1e();Vr();VR();rV();kk();Na();hg();c1e();g1e();og()});var fM=X(()=>{});var Rn=X((hM,V1e)=>{(function(t,e){typeof hM=="object"?V1e.exports=hM=e():typeof define=="function"&&define.amd?define([],e):t.CryptoJS=e()})(hM,function(){var t=t||function(e,r){var n;if(typeof window<"u"&&window.crypto&&(n=window.crypto),typeof self<"u"&&self.crypto&&(n=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(n=globalThis.crypto),!n&&typeof window<"u"&&window.msCrypto&&(n=window.msCrypto),!n&&typeof global<"u"&&global.crypto&&(n=global.crypto),!n&&typeof s5=="function")try{n=fM()}catch{}var i=function(){if(n){if(typeof n.getRandomValues=="function")try{return n.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof n.randomBytes=="function")try{return n.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function k(){}return function(M){var D;return k.prototype=M,D=new k,k.prototype=null,D}}(),s={},a=s.lib={},l=a.Base=function(){return{extend:function(k){var M=o(this);return k&&M.mixIn(k),(!M.hasOwnProperty("init")||this.init===M.init)&&(M.init=function(){M.$super.init.apply(this,arguments)}),M.init.prototype=M,M.$super=this,M},create:function(){var k=this.extend();return k.init.apply(k,arguments),k},init:function(){},mixIn:function(k){for(var M in k)k.hasOwnProperty(M)&&(this[M]=k[M]);k.hasOwnProperty("toString")&&(this.toString=k.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),u=a.WordArray=l.extend({init:function(k,M){k=this.words=k||[],M!=r?this.sigBytes=M:this.sigBytes=k.length*4},toString:function(k){return(k||p).stringify(this)},concat:function(k){var M=this.words,D=k.words,j=this.sigBytes,q=k.sigBytes;if(this.clamp(),j%4)for(var W=0;W<q;W++){var V=D[W>>>2]>>>24-W%4*8&255;M[j+W>>>2]|=V<<24-(j+W)%4*8}else for(var P=0;P<q;P+=4)M[j+P>>>2]=D[P>>>2];return this.sigBytes+=q,this},clamp:function(){var k=this.words,M=this.sigBytes;k[M>>>2]&=4294967295<<32-M%4*8,k.length=e.ceil(M/4)},clone:function(){var k=l.clone.call(this);return k.words=this.words.slice(0),k},random:function(k){for(var M=[],D=0;D<k;D+=4)M.push(i());return new u.init(M,k)}}),d=s.enc={},p=d.Hex={stringify:function(k){for(var M=k.words,D=k.sigBytes,j=[],q=0;q<D;q++){var W=M[q>>>2]>>>24-q%4*8&255;j.push((W>>>4).toString(16)),j.push((W&15).toString(16))}return j.join("")},parse:function(k){for(var M=k.length,D=[],j=0;j<M;j+=2)D[j>>>3]|=parseInt(k.substr(j,2),16)<<24-j%8*4;return new u.init(D,M/2)}},v=d.Latin1={stringify:function(k){for(var M=k.words,D=k.sigBytes,j=[],q=0;q<D;q++){var W=M[q>>>2]>>>24-q%4*8&255;j.push(String.fromCharCode(W))}return j.join("")},parse:function(k){for(var M=k.length,D=[],j=0;j<M;j++)D[j>>>2]|=(k.charCodeAt(j)&255)<<24-j%4*8;return new u.init(D,M)}},y=d.Utf8={stringify:function(k){try{return decodeURIComponent(escape(v.stringify(k)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(k){return v.parse(unescape(encodeURIComponent(k)))}},S=a.BufferedBlockAlgorithm=l.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(k){typeof k=="string"&&(k=y.parse(k)),this._data.concat(k),this._nDataBytes+=k.sigBytes},_process:function(k){var M,D=this._data,j=D.words,q=D.sigBytes,W=this.blockSize,V=W*4,P=q/V;k?P=e.ceil(P):P=e.max((P|0)-this._minBufferSize,0);var $=P*W,U=e.min($*4,q);if($){for(var L=0;L<$;L+=W)this._doProcessBlock(j,L);M=j.splice(0,$),D.sigBytes-=U}return new u.init(M,U)},clone:function(){var k=l.clone.call(this);return k._data=this._data.clone(),k},_minBufferSize:0}),R=a.Hasher=S.extend({cfg:l.extend(),init:function(k){this.cfg=this.cfg.extend(k),this.reset()},reset:function(){S.reset.call(this),this._doReset()},update:function(k){return this._append(k),this._process(),this},finalize:function(k){k&&this._append(k);var M=this._doFinalize();return M},blockSize:512/32,_createHelper:function(k){return function(M,D){return new k.init(D).finalize(M)}},_createHmacHelper:function(k){return function(M,D){return new O.HMAC.init(k,D).finalize(M)}}}),O=s.algo={};return s}(Math);return t})});var JE=X((dM,K1e)=>{(function(t,e){typeof dM=="object"?K1e.exports=dM=e(Rn()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(dM,function(t){return function(e){var r=t,n=r.lib,i=n.Base,o=n.WordArray,s=r.x64={},a=s.Word=i.extend({init:function(u,d){this.high=u,this.low=d}}),l=s.WordArray=i.extend({init:function(u,d){u=this.words=u||[],d!=e?this.sigBytes=d:this.sigBytes=u.length*8},toX32:function(){for(var u=this.words,d=u.length,p=[],v=0;v<d;v++){var y=u[v];p.push(y.high),p.push(y.low)}return o.create(p,this.sigBytes)},clone:function(){for(var u=i.clone.call(this),d=u.words=this.words.slice(0),p=d.length,v=0;v<p;v++)d[v]=d[v].clone();return u}})}(),t})});var Q1e=X((pM,G1e)=>{(function(t,e){typeof pM=="object"?G1e.exports=pM=e(Rn()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(pM,function(t){return function(){if(typeof ArrayBuffer=="function"){var e=t,r=e.lib,n=r.WordArray,i=n.init,o=n.init=function(s){if(s instanceof ArrayBuffer&&(s=new Uint8Array(s)),(s instanceof Int8Array||typeof Uint8ClampedArray<"u"&&s instanceof Uint8ClampedArray||s instanceof Int16Array||s instanceof Uint16Array||s instanceof Int32Array||s instanceof Uint32Array||s instanceof Float32Array||s instanceof Float64Array)&&(s=new Uint8Array(s.buffer,s.byteOffset,s.byteLength)),s instanceof Uint8Array){for(var a=s.byteLength,l=[],u=0;u<a;u++)l[u>>>2]|=s[u]<<24-u%4*8;i.call(this,l,a)}else i.apply(this,arguments)};o.prototype=n}}(),t.lib.WordArray})});var Y1e=X((mM,Z1e)=>{(function(t,e){typeof mM=="object"?Z1e.exports=mM=e(Rn()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(mM,function(t){return function(){var e=t,r=e.lib,n=r.WordArray,i=e.enc,o=i.Utf16=i.Utf16BE={stringify:function(a){for(var l=a.words,u=a.sigBytes,d=[],p=0;p<u;p+=2){var v=l[p>>>2]>>>16-p%4*8&65535;d.push(String.fromCharCode(v))}return d.join("")},parse:function(a){for(var l=a.length,u=[],d=0;d<l;d++)u[d>>>1]|=a.charCodeAt(d)<<16-d%2*16;return n.create(u,l*2)}};i.Utf16LE={stringify:function(a){for(var l=a.words,u=a.sigBytes,d=[],p=0;p<u;p+=2){var v=s(l[p>>>2]>>>16-p%4*8&65535);d.push(String.fromCharCode(v))}return d.join("")},parse:function(a){for(var l=a.length,u=[],d=0;d<l;d++)u[d>>>1]|=s(a.charCodeAt(d)<<16-d%2*16);return n.create(u,l*2)}};function s(a){return a<<8&4278255360|a>>>8&16711935}}(),t.enc.Utf16})});var Og=X((gM,J1e)=>{(function(t,e){typeof gM=="object"?J1e.exports=gM=e(Rn()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(gM,function(t){return function(){var e=t,r=e.lib,n=r.WordArray,i=e.enc,o=i.Base64={stringify:function(a){var l=a.words,u=a.sigBytes,d=this._map;a.clamp();for(var p=[],v=0;v<u;v+=3)for(var y=l[v>>>2]>>>24-v%4*8&255,S=l[v+1>>>2]>>>24-(v+1)%4*8&255,R=l[v+2>>>2]>>>24-(v+2)%4*8&255,O=y<<16|S<<8|R,k=0;k<4&&v+k*.75<u;k++)p.push(d.charAt(O>>>6*(3-k)&63));var M=d.charAt(64);if(M)for(;p.length%4;)p.push(M);return p.join("")},parse:function(a){var l=a.length,u=this._map,d=this._reverseMap;if(!d){d=this._reverseMap=[];for(var p=0;p<u.length;p++)d[u.charCodeAt(p)]=p}var v=u.charAt(64);if(v){var y=a.indexOf(v);y!==-1&&(l=y)}return s(a,l,d)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function s(a,l,u){for(var d=[],p=0,v=0;v<l;v++)if(v%4){var y=u[a.charCodeAt(v-1)]<<v%4*2,S=u[a.charCodeAt(v)]>>>6-v%4*2,R=y|S;d[p>>>2]|=R<<24-p%4*8,p++}return n.create(d,p)}}(),t.enc.Base64})});var ege=X((wM,X1e)=>{(function(t,e){typeof wM=="object"?X1e.exports=wM=e(Rn()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(wM,function(t){return function(){var e=t,r=e.lib,n=r.WordArray,i=e.enc,o=i.Base64url={stringify:function(a,l){l===void 0&&(l=!0);var u=a.words,d=a.sigBytes,p=l?this._safe_map:this._map;a.clamp();for(var v=[],y=0;y<d;y+=3)for(var S=u[y>>>2]>>>24-y%4*8&255,R=u[y+1>>>2]>>>24-(y+1)%4*8&255,O=u[y+2>>>2]>>>24-(y+2)%4*8&255,k=S<<16|R<<8|O,M=0;M<4&&y+M*.75<d;M++)v.push(p.charAt(k>>>6*(3-M)&63));var D=p.charAt(64);if(D)for(;v.length%4;)v.push(D);return v.join("")},parse:function(a,l){l===void 0&&(l=!0);var u=a.length,d=l?this._safe_map:this._map,p=this._reverseMap;if(!p){p=this._reverseMap=[];for(var v=0;v<d.length;v++)p[d.charCodeAt(v)]=v}var y=d.charAt(64);if(y){var S=a.indexOf(y);S!==-1&&(u=S)}return s(a,u,p)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function s(a,l,u){for(var d=[],p=0,v=0;v<l;v++)if(v%4){var y=u[a.charCodeAt(v-1)]<<v%4*2,S=u[a.charCodeAt(v)]>>>6-v%4*2,R=y|S;d[p>>>2]|=R<<24-p%4*8,p++}return n.create(d,p)}}(),t.enc.Base64url})});var Pg=X((vM,tge)=>{(function(t,e){typeof vM=="object"?tge.exports=vM=e(Rn()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(vM,function(t){return function(e){var r=t,n=r.lib,i=n.WordArray,o=n.Hasher,s=r.algo,a=[];(function(){for(var y=0;y<64;y++)a[y]=e.abs(e.sin(y+1))*4294967296|0})();var l=s.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(y,S){for(var R=0;R<16;R++){var O=S+R,k=y[O];y[O]=(k<<8|k>>>24)&16711935|(k<<24|k>>>8)&4278255360}var M=this._hash.words,D=y[S+0],j=y[S+1],q=y[S+2],W=y[S+3],V=y[S+4],P=y[S+5],$=y[S+6],U=y[S+7],L=y[S+8],z=y[S+9],f=y[S+10],h=y[S+11],m=y[S+12],b=y[S+13],C=y[S+14],T=y[S+15],N=M[0],I=M[1],g=M[2],x=M[3];N=u(N,I,g,x,D,7,a[0]),x=u(x,N,I,g,j,12,a[1]),g=u(g,x,N,I,q,17,a[2]),I=u(I,g,x,N,W,22,a[3]),N=u(N,I,g,x,V,7,a[4]),x=u(x,N,I,g,P,12,a[5]),g=u(g,x,N,I,$,17,a[6]),I=u(I,g,x,N,U,22,a[7]),N=u(N,I,g,x,L,7,a[8]),x=u(x,N,I,g,z,12,a[9]),g=u(g,x,N,I,f,17,a[10]),I=u(I,g,x,N,h,22,a[11]),N=u(N,I,g,x,m,7,a[12]),x=u(x,N,I,g,b,12,a[13]),g=u(g,x,N,I,C,17,a[14]),I=u(I,g,x,N,T,22,a[15]),N=d(N,I,g,x,j,5,a[16]),x=d(x,N,I,g,$,9,a[17]),g=d(g,x,N,I,h,14,a[18]),I=d(I,g,x,N,D,20,a[19]),N=d(N,I,g,x,P,5,a[20]),x=d(x,N,I,g,f,9,a[21]),g=d(g,x,N,I,T,14,a[22]),I=d(I,g,x,N,V,20,a[23]),N=d(N,I,g,x,z,5,a[24]),x=d(x,N,I,g,C,9,a[25]),g=d(g,x,N,I,W,14,a[26]),I=d(I,g,x,N,L,20,a[27]),N=d(N,I,g,x,b,5,a[28]),x=d(x,N,I,g,q,9,a[29]),g=d(g,x,N,I,U,14,a[30]),I=d(I,g,x,N,m,20,a[31]),N=p(N,I,g,x,P,4,a[32]),x=p(x,N,I,g,L,11,a[33]),g=p(g,x,N,I,h,16,a[34]),I=p(I,g,x,N,C,23,a[35]),N=p(N,I,g,x,j,4,a[36]),x=p(x,N,I,g,V,11,a[37]),g=p(g,x,N,I,U,16,a[38]),I=p(I,g,x,N,f,23,a[39]),N=p(N,I,g,x,b,4,a[40]),x=p(x,N,I,g,D,11,a[41]),g=p(g,x,N,I,W,16,a[42]),I=p(I,g,x,N,$,23,a[43]),N=p(N,I,g,x,z,4,a[44]),x=p(x,N,I,g,m,11,a[45]),g=p(g,x,N,I,T,16,a[46]),I=p(I,g,x,N,q,23,a[47]),N=v(N,I,g,x,D,6,a[48]),x=v(x,N,I,g,U,10,a[49]),g=v(g,x,N,I,C,15,a[50]),I=v(I,g,x,N,P,21,a[51]),N=v(N,I,g,x,m,6,a[52]),x=v(x,N,I,g,W,10,a[53]),g=v(g,x,N,I,f,15,a[54]),I=v(I,g,x,N,j,21,a[55]),N=v(N,I,g,x,L,6,a[56]),x=v(x,N,I,g,T,10,a[57]),g=v(g,x,N,I,$,15,a[58]),I=v(I,g,x,N,b,21,a[59]),N=v(N,I,g,x,V,6,a[60]),x=v(x,N,I,g,h,10,a[61]),g=v(g,x,N,I,q,15,a[62]),I=v(I,g,x,N,z,21,a[63]),M[0]=M[0]+N|0,M[1]=M[1]+I|0,M[2]=M[2]+g|0,M[3]=M[3]+x|0},_doFinalize:function(){var y=this._data,S=y.words,R=this._nDataBytes*8,O=y.sigBytes*8;S[O>>>5]|=128<<24-O%32;var k=e.floor(R/4294967296),M=R;S[(O+64>>>9<<4)+15]=(k<<8|k>>>24)&16711935|(k<<24|k>>>8)&4278255360,S[(O+64>>>9<<4)+14]=(M<<8|M>>>24)&16711935|(M<<24|M>>>8)&4278255360,y.sigBytes=(S.length+1)*4,this._process();for(var D=this._hash,j=D.words,q=0;q<4;q++){var W=j[q];j[q]=(W<<8|W>>>24)&16711935|(W<<24|W>>>8)&4278255360}return D},clone:function(){var y=o.clone.call(this);return y._hash=this._hash.clone(),y}});function u(y,S,R,O,k,M,D){var j=y+(S&R|~S&O)+k+D;return(j<<M|j>>>32-M)+S}function d(y,S,R,O,k,M,D){var j=y+(S&O|R&~O)+k+D;return(j<<M|j>>>32-M)+S}function p(y,S,R,O,k,M,D){var j=y+(S^R^O)+k+D;return(j<<M|j>>>32-M)+S}function v(y,S,R,O,k,M,D){var j=y+(R^(S|~O))+k+D;return(j<<M|j>>>32-M)+S}r.MD5=o._createHelper(l),r.HmacMD5=o._createHmacHelper(l)}(Math),t.MD5})});var MV=X((yM,rge)=>{(function(t,e){typeof yM=="object"?rge.exports=yM=e(Rn()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(yM,function(t){return function(){var e=t,r=e.lib,n=r.WordArray,i=r.Hasher,o=e.algo,s=[],a=o.SHA1=i.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(l,u){for(var d=this._hash.words,p=d[0],v=d[1],y=d[2],S=d[3],R=d[4],O=0;O<80;O++){if(O<16)s[O]=l[u+O]|0;else{var k=s[O-3]^s[O-8]^s[O-14]^s[O-16];s[O]=k<<1|k>>>31}var M=(p<<5|p>>>27)+R+s[O];O<20?M+=(v&y|~v&S)+1518500249:O<40?M+=(v^y^S)+1859775393:O<60?M+=(v&y|v&S|y&S)-1894007588:M+=(v^y^S)-899497514,R=S,S=y,y=v<<30|v>>>2,v=p,p=M}d[0]=d[0]+p|0,d[1]=d[1]+v|0,d[2]=d[2]+y|0,d[3]=d[3]+S|0,d[4]=d[4]+R|0},_doFinalize:function(){var l=this._data,u=l.words,d=this._nDataBytes*8,p=l.sigBytes*8;return u[p>>>5]|=128<<24-p%32,u[(p+64>>>9<<4)+14]=Math.floor(d/4294967296),u[(p+64>>>9<<4)+15]=d,l.sigBytes=u.length*4,this._process(),this._hash},clone:function(){var l=i.clone.call(this);return l._hash=this._hash.clone(),l}});e.SHA1=i._createHelper(a),e.HmacSHA1=i._createHmacHelper(a)}(),t.SHA1})});var xM=X((bM,nge)=>{(function(t,e){typeof bM=="object"?nge.exports=bM=e(Rn()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(bM,function(t){return function(e){var r=t,n=r.lib,i=n.WordArray,o=n.Hasher,s=r.algo,a=[],l=[];(function(){function p(R){for(var O=e.sqrt(R),k=2;k<=O;k++)if(!(R%k))return!1;return!0}function v(R){return(R-(R|0))*4294967296|0}for(var y=2,S=0;S<64;)p(y)&&(S<8&&(a[S]=v(e.pow(y,1/2))),l[S]=v(e.pow(y,1/3)),S++),y++})();var u=[],d=s.SHA256=o.extend({_doReset:function(){this._hash=new i.init(a.slice(0))},_doProcessBlock:function(p,v){for(var y=this._hash.words,S=y[0],R=y[1],O=y[2],k=y[3],M=y[4],D=y[5],j=y[6],q=y[7],W=0;W<64;W++){if(W<16)u[W]=p[v+W]|0;else{var V=u[W-15],P=(V<<25|V>>>7)^(V<<14|V>>>18)^V>>>3,$=u[W-2],U=($<<15|$>>>17)^($<<13|$>>>19)^$>>>10;u[W]=P+u[W-7]+U+u[W-16]}var L=M&D^~M&j,z=S&R^S&O^R&O,f=(S<<30|S>>>2)^(S<<19|S>>>13)^(S<<10|S>>>22),h=(M<<26|M>>>6)^(M<<21|M>>>11)^(M<<7|M>>>25),m=q+h+L+l[W]+u[W],b=f+z;q=j,j=D,D=M,M=k+m|0,k=O,O=R,R=S,S=m+b|0}y[0]=y[0]+S|0,y[1]=y[1]+R|0,y[2]=y[2]+O|0,y[3]=y[3]+k|0,y[4]=y[4]+M|0,y[5]=y[5]+D|0,y[6]=y[6]+j|0,y[7]=y[7]+q|0},_doFinalize:function(){var p=this._data,v=p.words,y=this._nDataBytes*8,S=p.sigBytes*8;return v[S>>>5]|=128<<24-S%32,v[(S+64>>>9<<4)+14]=e.floor(y/4294967296),v[(S+64>>>9<<4)+15]=y,p.sigBytes=v.length*4,this._process(),this._hash},clone:function(){var p=o.clone.call(this);return p._hash=this._hash.clone(),p}});r.SHA256=o._createHelper(d),r.HmacSHA256=o._createHmacHelper(d)}(Math),t.SHA256})});var oge=X((EM,ige)=>{(function(t,e,r){typeof EM=="object"?ige.exports=EM=e(Rn(),xM()):typeof define=="function"&&define.amd?define(["./core","./sha256"],e):e(t.CryptoJS)})(EM,function(t){return function(){var e=t,r=e.lib,n=r.WordArray,i=e.algo,o=i.SHA256,s=i.SHA224=o.extend({_doReset:function(){this._hash=new n.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var a=o._doFinalize.call(this);return a.sigBytes-=4,a}});e.SHA224=o._createHelper(s),e.HmacSHA224=o._createHmacHelper(s)}(),t.SHA224})});var NV=X((CM,sge)=>{(function(t,e,r){typeof CM=="object"?sge.exports=CM=e(Rn(),JE()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],e):e(t.CryptoJS)})(CM,function(t){return function(){var e=t,r=e.lib,n=r.Hasher,i=e.x64,o=i.Word,s=i.WordArray,a=e.algo;function l(){return o.create.apply(o,arguments)}var u=[l(1116352408,3609767458),l(1899447441,602891725),l(3049323471,3964484399),l(3921009573,2173295548),l(961987163,4081628472),l(1508970993,3053834265),l(2453635748,2937671579),l(2870763221,3664609560),l(3624381080,2734883394),l(310598401,1164996542),l(607225278,1323610764),l(1426881987,3590304994),l(1925078388,4068182383),l(2162078206,991336113),l(2614888103,633803317),l(3248222580,3479774868),l(3835390401,2666613458),l(4022224774,944711139),l(264347078,2341262773),l(604807628,2007800933),l(770255983,1495990901),l(1249150122,1856431235),l(1555081692,3175218132),l(1996064986,2198950837),l(2554220882,3999719339),l(2821834349,766784016),l(2952996808,2566594879),l(3210313671,3203337956),l(3336571891,1034457026),l(3584528711,2466948901),l(113926993,3758326383),l(338241895,168717936),l(666307205,1188179964),l(773529912,1546045734),l(1294757372,1522805485),l(1396182291,2643833823),l(1695183700,2343527390),l(1986661051,1014477480),l(2177026350,1206759142),l(2456956037,344077627),l(2730485921,1290863460),l(2820302411,3158454273),l(3259730800,3505952657),l(3345764771,106217008),l(3516065817,3606008344),l(3600352804,1432725776),l(4094571909,1467031594),l(275423344,851169720),l(430227734,3100823752),l(506948616,1363258195),l(659060556,3750685593),l(883997877,3785050280),l(958139571,3318307427),l(1322822218,3812723403),l(1537002063,2003034995),l(1747873779,3602036899),l(1955562222,1575990012),l(2024104815,1125592928),l(2227730452,2716904306),l(2361852424,442776044),l(2428436474,593698344),l(2756734187,3733110249),l(3204031479,2999351573),l(3329325298,3815920427),l(3391569614,3928383900),l(3515267271,566280711),l(3940187606,3454069534),l(4118630271,4000239992),l(116418474,1914138554),l(174292421,2731055270),l(289380356,3203993006),l(460393269,320620315),l(685471733,587496836),l(852142971,1086792851),l(1017036298,365543100),l(1126000580,2618297676),l(1288033470,3409855158),l(1501505948,4234509866),l(1607167915,987167468),l(1816402316,1246189591)],d=[];(function(){for(var v=0;v<80;v++)d[v]=l()})();var p=a.SHA512=n.extend({_doReset:function(){this._hash=new s.init([new o.init(1779033703,4089235720),new o.init(3144134277,2227873595),new o.init(1013904242,4271175723),new o.init(2773480762,1595750129),new o.init(1359893119,2917565137),new o.init(2600822924,725511199),new o.init(528734635,4215389547),new o.init(1541459225,327033209)])},_doProcessBlock:function(v,y){for(var S=this._hash.words,R=S[0],O=S[1],k=S[2],M=S[3],D=S[4],j=S[5],q=S[6],W=S[7],V=R.high,P=R.low,$=O.high,U=O.low,L=k.high,z=k.low,f=M.high,h=M.low,m=D.high,b=D.low,C=j.high,T=j.low,N=q.high,I=q.low,g=W.high,x=W.low,Q=V,re=P,A=$,G=U,Z=L,Y=z,ue=f,fe=h,ae=m,me=b,Ce=C,le=T,Se=N,gt=I,Qe=g,ur=x,mt=0;mt<80;mt++){var qe,Vt,wt=d[mt];if(mt<16)Vt=wt.high=v[y+mt*2]|0,qe=wt.low=v[y+mt*2+1]|0;else{var nt=d[mt-15],er=nt.high,de=nt.low,ge=(er>>>1|de<<31)^(er>>>8|de<<24)^er>>>7,be=(de>>>1|er<<31)^(de>>>8|er<<24)^(de>>>7|er<<25),ye=d[mt-2],_e=ye.high,ft=ye.low,Ve=(_e>>>19|ft<<13)^(_e<<3|ft>>>29)^_e>>>6,Le=(ft>>>19|_e<<13)^(ft<<3|_e>>>29)^(ft>>>6|_e<<26),Ut=d[mt-7],Xe=Ut.high,ze=Ut.low,hr=d[mt-16],bt=hr.high,tt=hr.low;qe=be+ze,Vt=ge+Xe+(qe>>>0<be>>>0?1:0),qe=qe+Le,Vt=Vt+Ve+(qe>>>0<Le>>>0?1:0),qe=qe+tt,Vt=Vt+bt+(qe>>>0<tt>>>0?1:0),wt.high=Vt,wt.low=qe}var Er=ae&Ce^~ae&Se,Et=me&le^~me>,st=Q&A^Q&Z^A&Z,vr=re&G^re&Y^G&Y,St=(Q>>>28|re<<4)^(Q<<30|re>>>2)^(Q<<25|re>>>7),at=(re>>>28|Q<<4)^(re<<30|Q>>>2)^(re<<25|Q>>>7),Cr=(ae>>>14|me<<18)^(ae>>>18|me<<14)^(ae<<23|me>>>9),_t=(me>>>14|ae<<18)^(me>>>18|ae<<14)^(me<<23|ae>>>9),it=u[mt],Ar=it.high,Ct=it.low,Ke=ur+_t,ar=Qe+Cr+(Ke>>>0<ur>>>0?1:0),Ke=Ke+Et,ar=ar+Er+(Ke>>>0<Et>>>0?1:0),Ke=Ke+Ct,ar=ar+Ar+(Ke>>>0<Ct>>>0?1:0),Ke=Ke+qe,ar=ar+Vt+(Ke>>>0<qe>>>0?1:0),At=at+vr,ot=St+st+(At>>>0<at>>>0?1:0);Qe=Se,ur=gt,Se=Ce,gt=le,Ce=ae,le=me,me=fe+Ke|0,ae=ue+ar+(me>>>0<fe>>>0?1:0)|0,ue=Z,fe=Y,Z=A,Y=G,A=Q,G=re,re=Ke+At|0,Q=ar+ot+(re>>>0<Ke>>>0?1:0)|0}P=R.low=P+re,R.high=V+Q+(P>>>0<re>>>0?1:0),U=O.low=U+G,O.high=$+A+(U>>>0<G>>>0?1:0),z=k.low=z+Y,k.high=L+Z+(z>>>0<Y>>>0?1:0),h=M.low=h+fe,M.high=f+ue+(h>>>0<fe>>>0?1:0),b=D.low=b+me,D.high=m+ae+(b>>>0<me>>>0?1:0),T=j.low=T+le,j.high=C+Ce+(T>>>0<le>>>0?1:0),I=q.low=I+gt,q.high=N+Se+(I>>>0<gt>>>0?1:0),x=W.low=x+ur,W.high=g+Qe+(x>>>0<ur>>>0?1:0)},_doFinalize:function(){var v=this._data,y=v.words,S=this._nDataBytes*8,R=v.sigBytes*8;y[R>>>5]|=128<<24-R%32,y[(R+128>>>10<<5)+30]=Math.floor(S/4294967296),y[(R+128>>>10<<5)+31]=S,v.sigBytes=y.length*4,this._process();var O=this._hash.toX32();return O},clone:function(){var v=n.clone.call(this);return v._hash=this._hash.clone(),v},blockSize:1024/32});e.SHA512=n._createHelper(p),e.HmacSHA512=n._createHmacHelper(p)}(),t.SHA512})});var cge=X((AM,age)=>{(function(t,e,r){typeof AM=="object"?age.exports=AM=e(Rn(),JE(),NV()):typeof define=="function"&&define.amd?define(["./core","./x64-core","./sha512"],e):e(t.CryptoJS)})(AM,function(t){return function(){var e=t,r=e.x64,n=r.Word,i=r.WordArray,o=e.algo,s=o.SHA512,a=o.SHA384=s.extend({_doReset:function(){this._hash=new i.init([new n.init(3418070365,3238371032),new n.init(1654270250,914150663),new n.init(2438529370,812702999),new n.init(355462360,4144912697),new n.init(1731405415,4290775857),new n.init(2394180231,1750603025),new n.init(3675008525,1694076839),new n.init(1203062813,3204075428)])},_doFinalize:function(){var l=s._doFinalize.call(this);return l.sigBytes-=16,l}});e.SHA384=s._createHelper(a),e.HmacSHA384=s._createHmacHelper(a)}(),t.SHA384})});var uge=X((SM,lge)=>{(function(t,e,r){typeof SM=="object"?lge.exports=SM=e(Rn(),JE()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],e):e(t.CryptoJS)})(SM,function(t){return function(e){var r=t,n=r.lib,i=n.WordArray,o=n.Hasher,s=r.x64,a=s.Word,l=r.algo,u=[],d=[],p=[];(function(){for(var S=1,R=0,O=0;O<24;O++){u[S+5*R]=(O+1)*(O+2)/2%64;var k=R%5,M=(2*S+3*R)%5;S=k,R=M}for(var S=0;S<5;S++)for(var R=0;R<5;R++)d[S+5*R]=R+(2*S+3*R)%5*5;for(var D=1,j=0;j<24;j++){for(var q=0,W=0,V=0;V<7;V++){if(D&1){var P=(1<<V)-1;P<32?W^=1<<P:q^=1<<P-32}D&128?D=D<<1^113:D<<=1}p[j]=a.create(q,W)}})();var v=[];(function(){for(var S=0;S<25;S++)v[S]=a.create()})();var y=l.SHA3=o.extend({cfg:o.cfg.extend({outputLength:512}),_doReset:function(){for(var S=this._state=[],R=0;R<25;R++)S[R]=new a.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(S,R){for(var O=this._state,k=this.blockSize/2,M=0;M<k;M++){var D=S[R+2*M],j=S[R+2*M+1];D=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360,j=(j<<8|j>>>24)&16711935|(j<<24|j>>>8)&4278255360;var q=O[M];q.high^=j,q.low^=D}for(var W=0;W<24;W++){for(var V=0;V<5;V++){for(var P=0,$=0,U=0;U<5;U++){var q=O[V+5*U];P^=q.high,$^=q.low}var L=v[V];L.high=P,L.low=$}for(var V=0;V<5;V++)for(var z=v[(V+4)%5],f=v[(V+1)%5],h=f.high,m=f.low,P=z.high^(h<<1|m>>>31),$=z.low^(m<<1|h>>>31),U=0;U<5;U++){var q=O[V+5*U];q.high^=P,q.low^=$}for(var b=1;b<25;b++){var P,$,q=O[b],C=q.high,T=q.low,N=u[b];N<32?(P=C<<N|T>>>32-N,$=T<<N|C>>>32-N):(P=T<<N-32|C>>>64-N,$=C<<N-32|T>>>64-N);var I=v[d[b]];I.high=P,I.low=$}var g=v[0],x=O[0];g.high=x.high,g.low=x.low;for(var V=0;V<5;V++)for(var U=0;U<5;U++){var b=V+5*U,q=O[b],Q=v[b],re=v[(V+1)%5+5*U],A=v[(V+2)%5+5*U];q.high=Q.high^~re.high&A.high,q.low=Q.low^~re.low&A.low}var q=O[0],G=p[W];q.high^=G.high,q.low^=G.low}},_doFinalize:function(){var S=this._data,R=S.words,O=this._nDataBytes*8,k=S.sigBytes*8,M=this.blockSize*32;R[k>>>5]|=1<<24-k%32,R[(e.ceil((k+1)/M)*M>>>5)-1]|=128,S.sigBytes=R.length*4,this._process();for(var D=this._state,j=this.cfg.outputLength/8,q=j/8,W=[],V=0;V<q;V++){var P=D[V],$=P.high,U=P.low;$=($<<8|$>>>24)&16711935|($<<24|$>>>8)&4278255360,U=(U<<8|U>>>24)&16711935|(U<<24|U>>>8)&4278255360,W.push(U),W.push($)}return new i.init(W,j)},clone:function(){for(var S=o.clone.call(this),R=S._state=this._state.slice(0),O=0;O<25;O++)R[O]=R[O].clone();return S}});r.SHA3=o._createHelper(y),r.HmacSHA3=o._createHmacHelper(y)}(Math),t.SHA3})});var hge=X((_M,fge)=>{(function(t,e){typeof _M=="object"?fge.exports=_M=e(Rn()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(_M,function(t){return function(e){var r=t,n=r.lib,i=n.WordArray,o=n.Hasher,s=r.algo,a=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),l=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),u=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),d=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),p=i.create([0,1518500249,1859775393,2400959708,2840853838]),v=i.create([1352829926,1548603684,1836072691,2053994217,0]),y=s.RIPEMD160=o.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(j,q){for(var W=0;W<16;W++){var V=q+W,P=j[V];j[V]=(P<<8|P>>>24)&16711935|(P<<24|P>>>8)&4278255360}var $=this._hash.words,U=p.words,L=v.words,z=a.words,f=l.words,h=u.words,m=d.words,b,C,T,N,I,g,x,Q,re,A;g=b=$[0],x=C=$[1],Q=T=$[2],re=N=$[3],A=I=$[4];for(var G,W=0;W<80;W+=1)G=b+j[q+z[W]]|0,W<16?G+=S(C,T,N)+U[0]:W<32?G+=R(C,T,N)+U[1]:W<48?G+=O(C,T,N)+U[2]:W<64?G+=k(C,T,N)+U[3]:G+=M(C,T,N)+U[4],G=G|0,G=D(G,h[W]),G=G+I|0,b=I,I=N,N=D(T,10),T=C,C=G,G=g+j[q+f[W]]|0,W<16?G+=M(x,Q,re)+L[0]:W<32?G+=k(x,Q,re)+L[1]:W<48?G+=O(x,Q,re)+L[2]:W<64?G+=R(x,Q,re)+L[3]:G+=S(x,Q,re)+L[4],G=G|0,G=D(G,m[W]),G=G+A|0,g=A,A=re,re=D(Q,10),Q=x,x=G;G=$[1]+T+re|0,$[1]=$[2]+N+A|0,$[2]=$[3]+I+g|0,$[3]=$[4]+b+x|0,$[4]=$[0]+C+Q|0,$[0]=G},_doFinalize:function(){var j=this._data,q=j.words,W=this._nDataBytes*8,V=j.sigBytes*8;q[V>>>5]|=128<<24-V%32,q[(V+64>>>9<<4)+14]=(W<<8|W>>>24)&16711935|(W<<24|W>>>8)&4278255360,j.sigBytes=(q.length+1)*4,this._process();for(var P=this._hash,$=P.words,U=0;U<5;U++){var L=$[U];$[U]=(L<<8|L>>>24)&16711935|(L<<24|L>>>8)&4278255360}return P},clone:function(){var j=o.clone.call(this);return j._hash=this._hash.clone(),j}});function S(j,q,W){return j^q^W}function R(j,q,W){return j&q|~j&W}function O(j,q,W){return(j|~q)^W}function k(j,q,W){return j&W|q&~W}function M(j,q,W){return j^(q|~W)}function D(j,q){return j<<q|j>>>32-q}r.RIPEMD160=o._createHelper(y),r.HmacRIPEMD160=o._createHmacHelper(y)}(Math),t.RIPEMD160})});var TM=X((IM,dge)=>{(function(t,e){typeof IM=="object"?dge.exports=IM=e(Rn()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(IM,function(t){(function(){var e=t,r=e.lib,n=r.Base,i=e.enc,o=i.Utf8,s=e.algo,a=s.HMAC=n.extend({init:function(l,u){l=this._hasher=new l.init,typeof u=="string"&&(u=o.parse(u));var d=l.blockSize,p=d*4;u.sigBytes>p&&(u=l.finalize(u)),u.clamp();for(var v=this._oKey=u.clone(),y=this._iKey=u.clone(),S=v.words,R=y.words,O=0;O<d;O++)S[O]^=1549556828,R[O]^=909522486;v.sigBytes=y.sigBytes=p,this.reset()},reset:function(){var l=this._hasher;l.reset(),l.update(this._iKey)},update:function(l){return this._hasher.update(l),this},finalize:function(l){var u=this._hasher,d=u.finalize(l);u.reset();var p=u.finalize(this._oKey.clone().concat(d));return p}})})()})});var mge=X((kM,pge)=>{(function(t,e,r){typeof kM=="object"?pge.exports=kM=e(Rn(),xM(),TM()):typeof define=="function"&&define.amd?define(["./core","./sha256","./hmac"],e):e(t.CryptoJS)})(kM,function(t){return function(){var e=t,r=e.lib,n=r.Base,i=r.WordArray,o=e.algo,s=o.SHA256,a=o.HMAC,l=o.PBKDF2=n.extend({cfg:n.extend({keySize:128/32,hasher:s,iterations:25e4}),init:function(u){this.cfg=this.cfg.extend(u)},compute:function(u,d){for(var p=this.cfg,v=a.create(p.hasher,u),y=i.create(),S=i.create([1]),R=y.words,O=S.words,k=p.keySize,M=p.iterations;R.length<k;){var D=v.update(d).finalize(S);v.reset();for(var j=D.words,q=j.length,W=D,V=1;V<M;V++){W=v.finalize(W),v.reset();for(var P=W.words,$=0;$<q;$++)j[$]^=P[$]}y.concat(D),O[0]++}return y.sigBytes=k*4,y}});e.PBKDF2=function(u,d,p){return l.create(p).compute(u,d)}}(),t.PBKDF2})});var dm=X((RM,gge)=>{(function(t,e,r){typeof RM=="object"?gge.exports=RM=e(Rn(),MV(),TM()):typeof define=="function"&&define.amd?define(["./core","./sha1","./hmac"],e):e(t.CryptoJS)})(RM,function(t){return function(){var e=t,r=e.lib,n=r.Base,i=r.WordArray,o=e.algo,s=o.MD5,a=o.EvpKDF=n.extend({cfg:n.extend({keySize:128/32,hasher:s,iterations:1}),init:function(l){this.cfg=this.cfg.extend(l)},compute:function(l,u){for(var d,p=this.cfg,v=p.hasher.create(),y=i.create(),S=y.words,R=p.keySize,O=p.iterations;S.length<R;){d&&v.update(d),d=v.update(l).finalize(u),v.reset();for(var k=1;k<O;k++)d=v.finalize(d),v.reset();y.concat(d)}return y.sigBytes=R*4,y}});e.EvpKDF=function(l,u,d){return a.create(d).compute(l,u)}}(),t.EvpKDF})});var As=X((MM,wge)=>{(function(t,e,r){typeof MM=="object"?wge.exports=MM=e(Rn(),dm()):typeof define=="function"&&define.amd?define(["./core","./evpkdf"],e):e(t.CryptoJS)})(MM,function(t){t.lib.Cipher||function(e){var r=t,n=r.lib,i=n.Base,o=n.WordArray,s=n.BufferedBlockAlgorithm,a=r.enc,l=a.Utf8,u=a.Base64,d=r.algo,p=d.EvpKDF,v=n.Cipher=s.extend({cfg:i.extend(),createEncryptor:function(L,z){return this.create(this._ENC_XFORM_MODE,L,z)},createDecryptor:function(L,z){return this.create(this._DEC_XFORM_MODE,L,z)},init:function(L,z,f){this.cfg=this.cfg.extend(f),this._xformMode=L,this._key=z,this.reset()},reset:function(){s.reset.call(this),this._doReset()},process:function(L){return this._append(L),this._process()},finalize:function(L){L&&this._append(L);var z=this._doFinalize();return z},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function L(z){return typeof z=="string"?U:V}return function(z){return{encrypt:function(f,h,m){return L(h).encrypt(z,f,h,m)},decrypt:function(f,h,m){return L(h).decrypt(z,f,h,m)}}}}()}),y=n.StreamCipher=v.extend({_doFinalize:function(){var L=this._process(!0);return L},blockSize:1}),S=r.mode={},R=n.BlockCipherMode=i.extend({createEncryptor:function(L,z){return this.Encryptor.create(L,z)},createDecryptor:function(L,z){return this.Decryptor.create(L,z)},init:function(L,z){this._cipher=L,this._iv=z}}),O=S.CBC=function(){var L=R.extend();L.Encryptor=L.extend({processBlock:function(f,h){var m=this._cipher,b=m.blockSize;z.call(this,f,h,b),m.encryptBlock(f,h),this._prevBlock=f.slice(h,h+b)}}),L.Decryptor=L.extend({processBlock:function(f,h){var m=this._cipher,b=m.blockSize,C=f.slice(h,h+b);m.decryptBlock(f,h),z.call(this,f,h,b),this._prevBlock=C}});function z(f,h,m){var b,C=this._iv;C?(b=C,this._iv=e):b=this._prevBlock;for(var T=0;T<m;T++)f[h+T]^=b[T]}return L}(),k=r.pad={},M=k.Pkcs7={pad:function(L,z){for(var f=z*4,h=f-L.sigBytes%f,m=h<<24|h<<16|h<<8|h,b=[],C=0;C<h;C+=4)b.push(m);var T=o.create(b,h);L.concat(T)},unpad:function(L){var z=L.words[L.sigBytes-1>>>2]&255;L.sigBytes-=z}},D=n.BlockCipher=v.extend({cfg:v.cfg.extend({mode:O,padding:M}),reset:function(){var L;v.reset.call(this);var z=this.cfg,f=z.iv,h=z.mode;this._xformMode==this._ENC_XFORM_MODE?L=h.createEncryptor:(L=h.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==L?this._mode.init(this,f&&f.words):(this._mode=L.call(h,this,f&&f.words),this._mode.__creator=L)},_doProcessBlock:function(L,z){this._mode.processBlock(L,z)},_doFinalize:function(){var L,z=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(z.pad(this._data,this.blockSize),L=this._process(!0)):(L=this._process(!0),z.unpad(L)),L},blockSize:128/32}),j=n.CipherParams=i.extend({init:function(L){this.mixIn(L)},toString:function(L){return(L||this.formatter).stringify(this)}}),q=r.format={},W=q.OpenSSL={stringify:function(L){var z,f=L.ciphertext,h=L.salt;return h?z=o.create([1398893684,1701076831]).concat(h).concat(f):z=f,z.toString(u)},parse:function(L){var z,f=u.parse(L),h=f.words;return h[0]==1398893684&&h[1]==1701076831&&(z=o.create(h.slice(2,4)),h.splice(0,4),f.sigBytes-=16),j.create({ciphertext:f,salt:z})}},V=n.SerializableCipher=i.extend({cfg:i.extend({format:W}),encrypt:function(L,z,f,h){h=this.cfg.extend(h);var m=L.createEncryptor(f,h),b=m.finalize(z),C=m.cfg;return j.create({ciphertext:b,key:f,iv:C.iv,algorithm:L,mode:C.mode,padding:C.padding,blockSize:L.blockSize,formatter:h.format})},decrypt:function(L,z,f,h){h=this.cfg.extend(h),z=this._parse(z,h.format);var m=L.createDecryptor(f,h).finalize(z.ciphertext);return m},_parse:function(L,z){return typeof L=="string"?z.parse(L,this):L}}),P=r.kdf={},$=P.OpenSSL={execute:function(L,z,f,h,m){if(h||(h=o.random(64/8)),m)var b=p.create({keySize:z+f,hasher:m}).compute(L,h);else var b=p.create({keySize:z+f}).compute(L,h);var C=o.create(b.words.slice(z),f*4);return b.sigBytes=z*4,j.create({key:b,iv:C,salt:h})}},U=n.PasswordBasedCipher=V.extend({cfg:V.cfg.extend({kdf:$}),encrypt:function(L,z,f,h){h=this.cfg.extend(h);var m=h.kdf.execute(f,L.keySize,L.ivSize,h.salt,h.hasher);h.iv=m.iv;var b=V.encrypt.call(this,L,z,m.key,h);return b.mixIn(m),b},decrypt:function(L,z,f,h){h=this.cfg.extend(h),z=this._parse(z,h.format);var m=h.kdf.execute(f,L.keySize,L.ivSize,z.salt,h.hasher);h.iv=m.iv;var b=V.decrypt.call(this,L,z,m.key,h);return b}})}()})});var yge=X((NM,vge)=>{(function(t,e,r){typeof NM=="object"?vge.exports=NM=e(Rn(),As()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(NM,function(t){return t.mode.CFB=function(){var e=t.lib.BlockCipherMode.extend();e.Encryptor=e.extend({processBlock:function(n,i){var o=this._cipher,s=o.blockSize;r.call(this,n,i,s,o),this._prevBlock=n.slice(i,i+s)}}),e.Decryptor=e.extend({processBlock:function(n,i){var o=this._cipher,s=o.blockSize,a=n.slice(i,i+s);r.call(this,n,i,s,o),this._prevBlock=a}});function r(n,i,o,s){var a,l=this._iv;l?(a=l.slice(0),this._iv=void 0):a=this._prevBlock,s.encryptBlock(a,0);for(var u=0;u<o;u++)n[i+u]^=a[u]}return e}(),t.mode.CFB})});var xge=X((OM,bge)=>{(function(t,e,r){typeof OM=="object"?bge.exports=OM=e(Rn(),As()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(OM,function(t){return t.mode.CTR=function(){var e=t.lib.BlockCipherMode.extend(),r=e.Encryptor=e.extend({processBlock:function(n,i){var o=this._cipher,s=o.blockSize,a=this._iv,l=this._counter;a&&(l=this._counter=a.slice(0),this._iv=void 0);var u=l.slice(0);o.encryptBlock(u,0),l[s-1]=l[s-1]+1|0;for(var d=0;d<s;d++)n[i+d]^=u[d]}});return e.Decryptor=r,e}(),t.mode.CTR})});var Cge=X((PM,Ege)=>{(function(t,e,r){typeof PM=="object"?Ege.exports=PM=e(Rn(),As()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(PM,function(t){return t.mode.CTRGladman=function(){var e=t.lib.BlockCipherMode.extend();function r(o){if((o>>24&255)===255){var s=o>>16&255,a=o>>8&255,l=o&255;s===255?(s=0,a===255?(a=0,l===255?l=0:++l):++a):++s,o=0,o+=s<<16,o+=a<<8,o+=l}else o+=1<<24;return o}function n(o){return(o[0]=r(o[0]))===0&&(o[1]=r(o[1])),o}var i=e.Encryptor=e.extend({processBlock:function(o,s){var a=this._cipher,l=a.blockSize,u=this._iv,d=this._counter;u&&(d=this._counter=u.slice(0),this._iv=void 0),n(d);var p=d.slice(0);a.encryptBlock(p,0);for(var v=0;v<l;v++)o[s+v]^=p[v]}});return e.Decryptor=i,e}(),t.mode.CTRGladman})});var Sge=X((BM,Age)=>{(function(t,e,r){typeof BM=="object"?Age.exports=BM=e(Rn(),As()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(BM,function(t){return t.mode.OFB=function(){var e=t.lib.BlockCipherMode.extend(),r=e.Encryptor=e.extend({processBlock:function(n,i){var o=this._cipher,s=o.blockSize,a=this._iv,l=this._keystream;a&&(l=this._keystream=a.slice(0),this._iv=void 0),o.encryptBlock(l,0);for(var u=0;u<s;u++)n[i+u]^=l[u]}});return e.Decryptor=r,e}(),t.mode.OFB})});var Ige=X((DM,_ge)=>{(function(t,e,r){typeof DM=="object"?_ge.exports=DM=e(Rn(),As()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(DM,function(t){return t.mode.ECB=function(){var e=t.lib.BlockCipherMode.extend();return e.Encryptor=e.extend({processBlock:function(r,n){this._cipher.encryptBlock(r,n)}}),e.Decryptor=e.extend({processBlock:function(r,n){this._cipher.decryptBlock(r,n)}}),e}(),t.mode.ECB})});var kge=X((LM,Tge)=>{(function(t,e,r){typeof LM=="object"?Tge.exports=LM=e(Rn(),As()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(LM,function(t){return t.pad.AnsiX923={pad:function(e,r){var n=e.sigBytes,i=r*4,o=i-n%i,s=n+o-1;e.clamp(),e.words[s>>>2]|=o<<24-s%4*8,e.sigBytes+=o},unpad:function(e){var r=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=r}},t.pad.Ansix923})});var Mge=X((UM,Rge)=>{(function(t,e,r){typeof UM=="object"?Rge.exports=UM=e(Rn(),As()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(UM,function(t){return t.pad.Iso10126={pad:function(e,r){var n=r*4,i=n-e.sigBytes%n;e.concat(t.lib.WordArray.random(i-1)).concat(t.lib.WordArray.create([i<<24],1))},unpad:function(e){var r=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=r}},t.pad.Iso10126})});var Oge=X((jM,Nge)=>{(function(t,e,r){typeof jM=="object"?Nge.exports=jM=e(Rn(),As()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(jM,function(t){return t.pad.Iso97971={pad:function(e,r){e.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(e,r)},unpad:function(e){t.pad.ZeroPadding.unpad(e),e.sigBytes--}},t.pad.Iso97971})});var Bge=X((FM,Pge)=>{(function(t,e,r){typeof FM=="object"?Pge.exports=FM=e(Rn(),As()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(FM,function(t){return t.pad.ZeroPadding={pad:function(e,r){var n=r*4;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},unpad:function(e){for(var r=e.words,n=e.sigBytes-1,n=e.sigBytes-1;n>=0;n--)if(r[n>>>2]>>>24-n%4*8&255){e.sigBytes=n+1;break}}},t.pad.ZeroPadding})});var Lge=X(($M,Dge)=>{(function(t,e,r){typeof $M=="object"?Dge.exports=$M=e(Rn(),As()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})($M,function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding})});var jge=X((qM,Uge)=>{(function(t,e,r){typeof qM=="object"?Uge.exports=qM=e(Rn(),As()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(qM,function(t){return function(e){var r=t,n=r.lib,i=n.CipherParams,o=r.enc,s=o.Hex,a=r.format,l=a.Hex={stringify:function(u){return u.ciphertext.toString(s)},parse:function(u){var d=s.parse(u);return i.create({ciphertext:d})}}}(),t.format.Hex})});var $ge=X((HM,Fge)=>{(function(t,e,r){typeof HM=="object"?Fge.exports=HM=e(Rn(),Og(),Pg(),dm(),As()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(HM,function(t){return function(){var e=t,r=e.lib,n=r.BlockCipher,i=e.algo,o=[],s=[],a=[],l=[],u=[],d=[],p=[],v=[],y=[],S=[];(function(){for(var k=[],M=0;M<256;M++)M<128?k[M]=M<<1:k[M]=M<<1^283;for(var D=0,j=0,M=0;M<256;M++){var q=j^j<<1^j<<2^j<<3^j<<4;q=q>>>8^q&255^99,o[D]=q,s[q]=D;var W=k[D],V=k[W],P=k[V],$=k[q]*257^q*16843008;a[D]=$<<24|$>>>8,l[D]=$<<16|$>>>16,u[D]=$<<8|$>>>24,d[D]=$;var $=P*16843009^V*65537^W*257^D*16843008;p[q]=$<<24|$>>>8,v[q]=$<<16|$>>>16,y[q]=$<<8|$>>>24,S[q]=$,D?(D=W^k[k[k[P^W]]],j^=k[k[j]]):D=j=1}})();var R=[0,1,2,4,8,16,32,64,128,27,54],O=i.AES=n.extend({_doReset:function(){var k;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var M=this._keyPriorReset=this._key,D=M.words,j=M.sigBytes/4,q=this._nRounds=j+6,W=(q+1)*4,V=this._keySchedule=[],P=0;P<W;P++)P<j?V[P]=D[P]:(k=V[P-1],P%j?j>6&&P%j==4&&(k=o[k>>>24]<<24|o[k>>>16&255]<<16|o[k>>>8&255]<<8|o[k&255]):(k=k<<8|k>>>24,k=o[k>>>24]<<24|o[k>>>16&255]<<16|o[k>>>8&255]<<8|o[k&255],k^=R[P/j|0]<<24),V[P]=V[P-j]^k);for(var $=this._invKeySchedule=[],U=0;U<W;U++){var P=W-U;if(U%4)var k=V[P];else var k=V[P-4];U<4||P<=4?$[U]=k:$[U]=p[o[k>>>24]]^v[o[k>>>16&255]]^y[o[k>>>8&255]]^S[o[k&255]]}}},encryptBlock:function(k,M){this._doCryptBlock(k,M,this._keySchedule,a,l,u,d,o)},decryptBlock:function(k,M){var D=k[M+1];k[M+1]=k[M+3],k[M+3]=D,this._doCryptBlock(k,M,this._invKeySchedule,p,v,y,S,s);var D=k[M+1];k[M+1]=k[M+3],k[M+3]=D},_doCryptBlock:function(k,M,D,j,q,W,V,P){for(var $=this._nRounds,U=k[M]^D[0],L=k[M+1]^D[1],z=k[M+2]^D[2],f=k[M+3]^D[3],h=4,m=1;m<$;m++){var b=j[U>>>24]^q[L>>>16&255]^W[z>>>8&255]^V[f&255]^D[h++],C=j[L>>>24]^q[z>>>16&255]^W[f>>>8&255]^V[U&255]^D[h++],T=j[z>>>24]^q[f>>>16&255]^W[U>>>8&255]^V[L&255]^D[h++],N=j[f>>>24]^q[U>>>16&255]^W[L>>>8&255]^V[z&255]^D[h++];U=b,L=C,z=T,f=N}var b=(P[U>>>24]<<24|P[L>>>16&255]<<16|P[z>>>8&255]<<8|P[f&255])^D[h++],C=(P[L>>>24]<<24|P[z>>>16&255]<<16|P[f>>>8&255]<<8|P[U&255])^D[h++],T=(P[z>>>24]<<24|P[f>>>16&255]<<16|P[U>>>8&255]<<8|P[L&255])^D[h++],N=(P[f>>>24]<<24|P[U>>>16&255]<<16|P[L>>>8&255]<<8|P[z&255])^D[h++];k[M]=b,k[M+1]=C,k[M+2]=T,k[M+3]=N},keySize:256/32});e.AES=n._createHelper(O)}(),t.AES})});var Hge=X((zM,qge)=>{(function(t,e,r){typeof zM=="object"?qge.exports=zM=e(Rn(),Og(),Pg(),dm(),As()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(zM,function(t){return function(){var e=t,r=e.lib,n=r.WordArray,i=r.BlockCipher,o=e.algo,s=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],a=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],l=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],u=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],d=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],p=o.DES=i.extend({_doReset:function(){for(var R=this._key,O=R.words,k=[],M=0;M<56;M++){var D=s[M]-1;k[M]=O[D>>>5]>>>31-D%32&1}for(var j=this._subKeys=[],q=0;q<16;q++){for(var W=j[q]=[],V=l[q],M=0;M<24;M++)W[M/6|0]|=k[(a[M]-1+V)%28]<<31-M%6,W[4+(M/6|0)]|=k[28+(a[M+24]-1+V)%28]<<31-M%6;W[0]=W[0]<<1|W[0]>>>31;for(var M=1;M<7;M++)W[M]=W[M]>>>(M-1)*4+3;W[7]=W[7]<<5|W[7]>>>27}for(var P=this._invSubKeys=[],M=0;M<16;M++)P[M]=j[15-M]},encryptBlock:function(R,O){this._doCryptBlock(R,O,this._subKeys)},decryptBlock:function(R,O){this._doCryptBlock(R,O,this._invSubKeys)},_doCryptBlock:function(R,O,k){this._lBlock=R[O],this._rBlock=R[O+1],v.call(this,4,252645135),v.call(this,16,65535),y.call(this,2,858993459),y.call(this,8,16711935),v.call(this,1,1431655765);for(var M=0;M<16;M++){for(var D=k[M],j=this._lBlock,q=this._rBlock,W=0,V=0;V<8;V++)W|=u[V][((q^D[V])&d[V])>>>0];this._lBlock=q,this._rBlock=j^W}var P=this._lBlock;this._lBlock=this._rBlock,this._rBlock=P,v.call(this,1,1431655765),y.call(this,8,16711935),y.call(this,2,858993459),v.call(this,16,65535),v.call(this,4,252645135),R[O]=this._lBlock,R[O+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function v(R,O){var k=(this._lBlock>>>R^this._rBlock)&O;this._rBlock^=k,this._lBlock^=k<<R}function y(R,O){var k=(this._rBlock>>>R^this._lBlock)&O;this._lBlock^=k,this._rBlock^=k<<R}e.DES=i._createHelper(p);var S=o.TripleDES=i.extend({_doReset:function(){var R=this._key,O=R.words;if(O.length!==2&&O.length!==4&&O.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var k=O.slice(0,2),M=O.length<4?O.slice(0,2):O.slice(2,4),D=O.length<6?O.slice(0,2):O.slice(4,6);this._des1=p.createEncryptor(n.create(k)),this._des2=p.createEncryptor(n.create(M)),this._des3=p.createEncryptor(n.create(D))},encryptBlock:function(R,O){this._des1.encryptBlock(R,O),this._des2.decryptBlock(R,O),this._des3.encryptBlock(R,O)},decryptBlock:function(R,O){this._des3.decryptBlock(R,O),this._des2.encryptBlock(R,O),this._des1.decryptBlock(R,O)},keySize:192/32,ivSize:64/32,blockSize:64/32});e.TripleDES=i._createHelper(S)}(),t.TripleDES})});var Wge=X((WM,zge)=>{(function(t,e,r){typeof WM=="object"?zge.exports=WM=e(Rn(),Og(),Pg(),dm(),As()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(WM,function(t){return function(){var e=t,r=e.lib,n=r.StreamCipher,i=e.algo,o=i.RC4=n.extend({_doReset:function(){for(var l=this._key,u=l.words,d=l.sigBytes,p=this._S=[],v=0;v<256;v++)p[v]=v;for(var v=0,y=0;v<256;v++){var S=v%d,R=u[S>>>2]>>>24-S%4*8&255;y=(y+p[v]+R)%256;var O=p[v];p[v]=p[y],p[y]=O}this._i=this._j=0},_doProcessBlock:function(l,u){l[u]^=s.call(this)},keySize:256/32,ivSize:0});function s(){for(var l=this._S,u=this._i,d=this._j,p=0,v=0;v<4;v++){u=(u+1)%256,d=(d+l[u])%256;var y=l[u];l[u]=l[d],l[d]=y,p|=l[(l[u]+l[d])%256]<<24-v*8}return this._i=u,this._j=d,p}e.RC4=n._createHelper(o);var a=i.RC4Drop=o.extend({cfg:o.cfg.extend({drop:192}),_doReset:function(){o._doReset.call(this);for(var l=this.cfg.drop;l>0;l--)s.call(this)}});e.RC4Drop=n._createHelper(a)}(),t.RC4})});var Kge=X((VM,Vge)=>{(function(t,e,r){typeof VM=="object"?Vge.exports=VM=e(Rn(),Og(),Pg(),dm(),As()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(VM,function(t){return function(){var e=t,r=e.lib,n=r.StreamCipher,i=e.algo,o=[],s=[],a=[],l=i.Rabbit=n.extend({_doReset:function(){for(var d=this._key.words,p=this.cfg.iv,v=0;v<4;v++)d[v]=(d[v]<<8|d[v]>>>24)&16711935|(d[v]<<24|d[v]>>>8)&4278255360;var y=this._X=[d[0],d[3]<<16|d[2]>>>16,d[1],d[0]<<16|d[3]>>>16,d[2],d[1]<<16|d[0]>>>16,d[3],d[2]<<16|d[1]>>>16],S=this._C=[d[2]<<16|d[2]>>>16,d[0]&4294901760|d[1]&65535,d[3]<<16|d[3]>>>16,d[1]&4294901760|d[2]&65535,d[0]<<16|d[0]>>>16,d[2]&4294901760|d[3]&65535,d[1]<<16|d[1]>>>16,d[3]&4294901760|d[0]&65535];this._b=0;for(var v=0;v<4;v++)u.call(this);for(var v=0;v<8;v++)S[v]^=y[v+4&7];if(p){var R=p.words,O=R[0],k=R[1],M=(O<<8|O>>>24)&16711935|(O<<24|O>>>8)&4278255360,D=(k<<8|k>>>24)&16711935|(k<<24|k>>>8)&4278255360,j=M>>>16|D&4294901760,q=D<<16|M&65535;S[0]^=M,S[1]^=j,S[2]^=D,S[3]^=q,S[4]^=M,S[5]^=j,S[6]^=D,S[7]^=q;for(var v=0;v<4;v++)u.call(this)}},_doProcessBlock:function(d,p){var v=this._X;u.call(this),o[0]=v[0]^v[5]>>>16^v[3]<<16,o[1]=v[2]^v[7]>>>16^v[5]<<16,o[2]=v[4]^v[1]>>>16^v[7]<<16,o[3]=v[6]^v[3]>>>16^v[1]<<16;for(var y=0;y<4;y++)o[y]=(o[y]<<8|o[y]>>>24)&16711935|(o[y]<<24|o[y]>>>8)&4278255360,d[p+y]^=o[y]},blockSize:128/32,ivSize:64/32});function u(){for(var d=this._X,p=this._C,v=0;v<8;v++)s[v]=p[v];p[0]=p[0]+1295307597+this._b|0,p[1]=p[1]+3545052371+(p[0]>>>0<s[0]>>>0?1:0)|0,p[2]=p[2]+886263092+(p[1]>>>0<s[1]>>>0?1:0)|0,p[3]=p[3]+1295307597+(p[2]>>>0<s[2]>>>0?1:0)|0,p[4]=p[4]+3545052371+(p[3]>>>0<s[3]>>>0?1:0)|0,p[5]=p[5]+886263092+(p[4]>>>0<s[4]>>>0?1:0)|0,p[6]=p[6]+1295307597+(p[5]>>>0<s[5]>>>0?1:0)|0,p[7]=p[7]+3545052371+(p[6]>>>0<s[6]>>>0?1:0)|0,this._b=p[7]>>>0<s[7]>>>0?1:0;for(var v=0;v<8;v++){var y=d[v]+p[v],S=y&65535,R=y>>>16,O=((S*S>>>17)+S*R>>>15)+R*R,k=((y&4294901760)*y|0)+((y&65535)*y|0);a[v]=O^k}d[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,d[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,d[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,d[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,d[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,d[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,d[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,d[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.Rabbit=n._createHelper(l)}(),t.Rabbit})});var Qge=X((KM,Gge)=>{(function(t,e,r){typeof KM=="object"?Gge.exports=KM=e(Rn(),Og(),Pg(),dm(),As()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(KM,function(t){return function(){var e=t,r=e.lib,n=r.StreamCipher,i=e.algo,o=[],s=[],a=[],l=i.RabbitLegacy=n.extend({_doReset:function(){var d=this._key.words,p=this.cfg.iv,v=this._X=[d[0],d[3]<<16|d[2]>>>16,d[1],d[0]<<16|d[3]>>>16,d[2],d[1]<<16|d[0]>>>16,d[3],d[2]<<16|d[1]>>>16],y=this._C=[d[2]<<16|d[2]>>>16,d[0]&4294901760|d[1]&65535,d[3]<<16|d[3]>>>16,d[1]&4294901760|d[2]&65535,d[0]<<16|d[0]>>>16,d[2]&4294901760|d[3]&65535,d[1]<<16|d[1]>>>16,d[3]&4294901760|d[0]&65535];this._b=0;for(var S=0;S<4;S++)u.call(this);for(var S=0;S<8;S++)y[S]^=v[S+4&7];if(p){var R=p.words,O=R[0],k=R[1],M=(O<<8|O>>>24)&16711935|(O<<24|O>>>8)&4278255360,D=(k<<8|k>>>24)&16711935|(k<<24|k>>>8)&4278255360,j=M>>>16|D&4294901760,q=D<<16|M&65535;y[0]^=M,y[1]^=j,y[2]^=D,y[3]^=q,y[4]^=M,y[5]^=j,y[6]^=D,y[7]^=q;for(var S=0;S<4;S++)u.call(this)}},_doProcessBlock:function(d,p){var v=this._X;u.call(this),o[0]=v[0]^v[5]>>>16^v[3]<<16,o[1]=v[2]^v[7]>>>16^v[5]<<16,o[2]=v[4]^v[1]>>>16^v[7]<<16,o[3]=v[6]^v[3]>>>16^v[1]<<16;for(var y=0;y<4;y++)o[y]=(o[y]<<8|o[y]>>>24)&16711935|(o[y]<<24|o[y]>>>8)&4278255360,d[p+y]^=o[y]},blockSize:128/32,ivSize:64/32});function u(){for(var d=this._X,p=this._C,v=0;v<8;v++)s[v]=p[v];p[0]=p[0]+1295307597+this._b|0,p[1]=p[1]+3545052371+(p[0]>>>0<s[0]>>>0?1:0)|0,p[2]=p[2]+886263092+(p[1]>>>0<s[1]>>>0?1:0)|0,p[3]=p[3]+1295307597+(p[2]>>>0<s[2]>>>0?1:0)|0,p[4]=p[4]+3545052371+(p[3]>>>0<s[3]>>>0?1:0)|0,p[5]=p[5]+886263092+(p[4]>>>0<s[4]>>>0?1:0)|0,p[6]=p[6]+1295307597+(p[5]>>>0<s[5]>>>0?1:0)|0,p[7]=p[7]+3545052371+(p[6]>>>0<s[6]>>>0?1:0)|0,this._b=p[7]>>>0<s[7]>>>0?1:0;for(var v=0;v<8;v++){var y=d[v]+p[v],S=y&65535,R=y>>>16,O=((S*S>>>17)+S*R>>>15)+R*R,k=((y&4294901760)*y|0)+((y&65535)*y|0);a[v]=O^k}d[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,d[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,d[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,d[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,d[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,d[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,d[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,d[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.RabbitLegacy=n._createHelper(l)}(),t.RabbitLegacy})});var Yge=X((GM,Zge)=>{(function(t,e,r){typeof GM=="object"?Zge.exports=GM=e(Rn(),Og(),Pg(),dm(),As()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(GM,function(t){return function(){var e=t,r=e.lib,n=r.BlockCipher,i=e.algo;let o=16,s=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],a=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var l={pbox:[],sbox:[]};function u(S,R){let O=R>>24&255,k=R>>16&255,M=R>>8&255,D=R&255,j=S.sbox[0][O]+S.sbox[1][k];return j=j^S.sbox[2][M],j=j+S.sbox[3][D],j}function d(S,R,O){let k=R,M=O,D;for(let j=0;j<o;++j)k=k^S.pbox[j],M=u(S,k)^M,D=k,k=M,M=D;return D=k,k=M,M=D,M=M^S.pbox[o],k=k^S.pbox[o+1],{left:k,right:M}}function p(S,R,O){let k=R,M=O,D;for(let j=o+1;j>1;--j)k=k^S.pbox[j],M=u(S,k)^M,D=k,k=M,M=D;return D=k,k=M,M=D,M=M^S.pbox[1],k=k^S.pbox[0],{left:k,right:M}}function v(S,R,O){for(let q=0;q<4;q++){S.sbox[q]=[];for(let W=0;W<256;W++)S.sbox[q][W]=a[q][W]}let k=0;for(let q=0;q<o+2;q++)S.pbox[q]=s[q]^R[k],k++,k>=O&&(k=0);let M=0,D=0,j=0;for(let q=0;q<o+2;q+=2)j=d(S,M,D),M=j.left,D=j.right,S.pbox[q]=M,S.pbox[q+1]=D;for(let q=0;q<4;q++)for(let W=0;W<256;W+=2)j=d(S,M,D),M=j.left,D=j.right,S.sbox[q][W]=M,S.sbox[q][W+1]=D;return!0}var y=i.Blowfish=n.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var S=this._keyPriorReset=this._key,R=S.words,O=S.sigBytes/4;v(l,R,O)}},encryptBlock:function(S,R){var O=d(l,S[R],S[R+1]);S[R]=O.left,S[R+1]=O.right},decryptBlock:function(S,R){var O=p(l,S[R],S[R+1]);S[R]=O.left,S[R+1]=O.right},blockSize:64/32,keySize:128/32,ivSize:64/32});e.Blowfish=n._createHelper(y)}(),t.Blowfish})});var OV=X((QM,Jge)=>{(function(t,e,r){typeof QM=="object"?Jge.exports=QM=e(Rn(),JE(),Q1e(),Y1e(),Og(),ege(),Pg(),MV(),xM(),oge(),NV(),cge(),uge(),hge(),TM(),mge(),dm(),As(),yge(),xge(),Cge(),Sge(),Ige(),kge(),Mge(),Oge(),Bge(),Lge(),jge(),$ge(),Hge(),Wge(),Kge(),Qge(),Yge()):typeof define=="function"&&define.amd?define(["./core","./x64-core","./lib-typedarrays","./enc-utf16","./enc-base64","./enc-base64url","./md5","./sha1","./sha256","./sha224","./sha512","./sha384","./sha3","./ripemd160","./hmac","./pbkdf2","./evpkdf","./cipher-core","./mode-cfb","./mode-ctr","./mode-ctr-gladman","./mode-ofb","./mode-ecb","./pad-ansix923","./pad-iso10126","./pad-iso97971","./pad-zeropadding","./pad-nopadding","./format-hex","./aes","./tripledes","./rc4","./rabbit","./rabbit-legacy","./blowfish"],e):t.CryptoJS=e(t.CryptoJS)})(QM,function(t){return t})});var u2e=X(Cn=>{"use strict";var XE=Symbol.for("react.element"),vut=Symbol.for("react.portal"),yut=Symbol.for("react.fragment"),but=Symbol.for("react.strict_mode"),xut=Symbol.for("react.profiler"),Eut=Symbol.for("react.provider"),Cut=Symbol.for("react.context"),Aut=Symbol.for("react.forward_ref"),Sut=Symbol.for("react.suspense"),_ut=Symbol.for("react.memo"),Iut=Symbol.for("react.lazy"),Xge=Symbol.iterator;function Tut(t){return t===null||typeof t!="object"?null:(t=Xge&&t[Xge]||t["@@iterator"],typeof t=="function"?t:null)}var r2e={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},n2e=Object.assign,i2e={};function e4(t,e,r){this.props=t,this.context=e,this.refs=i2e,this.updater=r||r2e}e4.prototype.isReactComponent={};e4.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};e4.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function o2e(){}o2e.prototype=e4.prototype;function BV(t,e,r){this.props=t,this.context=e,this.refs=i2e,this.updater=r||r2e}var DV=BV.prototype=new o2e;DV.constructor=BV;n2e(DV,e4.prototype);DV.isPureReactComponent=!0;var e2e=Array.isArray,s2e=Object.prototype.hasOwnProperty,LV={current:null},a2e={key:!0,ref:!0,__self:!0,__source:!0};function c2e(t,e,r){var n,i={},o=null,s=null;if(e!=null)for(n in e.ref!==void 0&&(s=e.ref),e.key!==void 0&&(o=""+e.key),e)s2e.call(e,n)&&!a2e.hasOwnProperty(n)&&(i[n]=e[n]);var a=arguments.length-2;if(a===1)i.children=r;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];i.children=l}if(t&&t.defaultProps)for(n in a=t.defaultProps,a)i[n]===void 0&&(i[n]=a[n]);return{$$typeof:XE,type:t,key:o,ref:s,props:i,_owner:LV.current}}function kut(t,e){return{$$typeof:XE,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function UV(t){return typeof t=="object"&&t!==null&&t.$$typeof===XE}function Rut(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(r){return e[r]})}var t2e=/\/+/g;function PV(t,e){return typeof t=="object"&&t!==null&&t.key!=null?Rut(""+t.key):e.toString(36)}function YM(t,e,r,n,i){var o=typeof t;(o==="undefined"||o==="boolean")&&(t=null);var s=!1;if(t===null)s=!0;else switch(o){case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case XE:case vut:s=!0}}if(s)return s=t,i=i(s),t=n===""?"."+PV(s,0):n,e2e(i)?(r="",t!=null&&(r=t.replace(t2e,"$&/")+"/"),YM(i,e,r,"",function(u){return u})):i!=null&&(UV(i)&&(i=kut(i,r+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(t2e,"$&/")+"/")+t)),e.push(i)),1;if(s=0,n=n===""?".":n+":",e2e(t))for(var a=0;a<t.length;a++){o=t[a];var l=n+PV(o,a);s+=YM(o,e,r,l,i)}else if(l=Tut(t),typeof l=="function")for(t=l.call(t),a=0;!(o=t.next()).done;)o=o.value,l=n+PV(o,a++),s+=YM(o,e,r,l,i);else if(o==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return s}function ZM(t,e,r){if(t==null)return t;var n=[],i=0;return YM(t,n,"","",function(o){return e.call(r,o,i++)}),n}function Mut(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(r){(t._status===0||t._status===-1)&&(t._status=1,t._result=r)},function(r){(t._status===0||t._status===-1)&&(t._status=2,t._result=r)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var yc={current:null},JM={transition:null},Nut={ReactCurrentDispatcher:yc,ReactCurrentBatchConfig:JM,ReactCurrentOwner:LV};function l2e(){throw Error("act(...) is not supported in production builds of React.")}Cn.Children={map:ZM,forEach:function(t,e,r){ZM(t,function(){e.apply(this,arguments)},r)},count:function(t){var e=0;return ZM(t,function(){e++}),e},toArray:function(t){return ZM(t,function(e){return e})||[]},only:function(t){if(!UV(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};Cn.Component=e4;Cn.Fragment=yut;Cn.Profiler=xut;Cn.PureComponent=BV;Cn.StrictMode=but;Cn.Suspense=Sut;Cn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Nut;Cn.act=l2e;Cn.cloneElement=function(t,e,r){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var n=n2e({},t.props),i=t.key,o=t.ref,s=t._owner;if(e!=null){if(e.ref!==void 0&&(o=e.ref,s=LV.current),e.key!==void 0&&(i=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(l in e)s2e.call(e,l)&&!a2e.hasOwnProperty(l)&&(n[l]=e[l]===void 0&&a!==void 0?a[l]:e[l])}var l=arguments.length-2;if(l===1)n.children=r;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];n.children=a}return{$$typeof:XE,type:t.type,key:i,ref:o,props:n,_owner:s}};Cn.createContext=function(t){return t={$$typeof:Cut,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:Eut,_context:t},t.Consumer=t};Cn.createElement=c2e;Cn.createFactory=function(t){var e=c2e.bind(null,t);return e.type=t,e};Cn.createRef=function(){return{current:null}};Cn.forwardRef=function(t){return{$$typeof:Aut,render:t}};Cn.isValidElement=UV;Cn.lazy=function(t){return{$$typeof:Iut,_payload:{_status:-1,_result:t},_init:Mut}};Cn.memo=function(t,e){return{$$typeof:_ut,type:t,compare:e===void 0?null:e}};Cn.startTransition=function(t){var e=JM.transition;JM.transition={};try{t()}finally{JM.transition=e}};Cn.unstable_act=l2e;Cn.useCallback=function(t,e){return yc.current.useCallback(t,e)};Cn.useContext=function(t){return yc.current.useContext(t)};Cn.useDebugValue=function(){};Cn.useDeferredValue=function(t){return yc.current.useDeferredValue(t)};Cn.useEffect=function(t,e){return yc.current.useEffect(t,e)};Cn.useId=function(){return yc.current.useId()};Cn.useImperativeHandle=function(t,e,r){return yc.current.useImperativeHandle(t,e,r)};Cn.useInsertionEffect=function(t,e){return yc.current.useInsertionEffect(t,e)};Cn.useLayoutEffect=function(t,e){return yc.current.useLayoutEffect(t,e)};Cn.useMemo=function(t,e){return yc.current.useMemo(t,e)};Cn.useReducer=function(t,e,r){return yc.current.useReducer(t,e,r)};Cn.useRef=function(t){return yc.current.useRef(t)};Cn.useState=function(t){return yc.current.useState(t)};Cn.useSyncExternalStore=function(t,e,r){return yc.current.useSyncExternalStore(t,e,r)};Cn.useTransition=function(){return yc.current.useTransition()};Cn.version="18.3.1"});var Ls=X((Z1r,f2e)=>{"use strict";f2e.exports=u2e()});var rN=X((cgr,FV)=>{"use strict";var Fut=Object.prototype.hasOwnProperty,bc="~";function t9(){}Object.create&&(t9.prototype=Object.create(null),new t9().__proto__||(bc=!1));function $ut(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function v2e(t,e,r,n,i){if(typeof r!="function")throw new TypeError("The listener must be a function");var o=new $ut(r,n||t,i),s=bc?bc+e:e;return t._events[s]?t._events[s].fn?t._events[s]=[t._events[s],o]:t._events[s].push(o):(t._events[s]=o,t._eventsCount++),t}function tN(t,e){--t._eventsCount===0?t._events=new t9:delete t._events[e]}function Ua(){this._events=new t9,this._eventsCount=0}Ua.prototype.eventNames=function(){var e=[],r,n;if(this._eventsCount===0)return e;for(n in r=this._events)Fut.call(r,n)&&e.push(bc?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(r)):e};Ua.prototype.listeners=function(e){var r=bc?bc+e:e,n=this._events[r];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,s=new Array(o);i<o;i++)s[i]=n[i].fn;return s};Ua.prototype.listenerCount=function(e){var r=bc?bc+e:e,n=this._events[r];return n?n.fn?1:n.length:0};Ua.prototype.emit=function(e,r,n,i,o,s){var a=bc?bc+e:e;if(!this._events[a])return!1;var l=this._events[a],u=arguments.length,d,p;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),u){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,r),!0;case 3:return l.fn.call(l.context,r,n),!0;case 4:return l.fn.call(l.context,r,n,i),!0;case 5:return l.fn.call(l.context,r,n,i,o),!0;case 6:return l.fn.call(l.context,r,n,i,o,s),!0}for(p=1,d=new Array(u-1);p<u;p++)d[p-1]=arguments[p];l.fn.apply(l.context,d)}else{var v=l.length,y;for(p=0;p<v;p++)switch(l[p].once&&this.removeListener(e,l[p].fn,void 0,!0),u){case 1:l[p].fn.call(l[p].context);break;case 2:l[p].fn.call(l[p].context,r);break;case 3:l[p].fn.call(l[p].context,r,n);break;case 4:l[p].fn.call(l[p].context,r,n,i);break;default:if(!d)for(y=1,d=new Array(u-1);y<u;y++)d[y-1]=arguments[y];l[p].fn.apply(l[p].context,d)}}return!0};Ua.prototype.on=function(e,r,n){return v2e(this,e,r,n,!1)};Ua.prototype.once=function(e,r,n){return v2e(this,e,r,n,!0)};Ua.prototype.removeListener=function(e,r,n,i){var o=bc?bc+e:e;if(!this._events[o])return this;if(!r)return tN(this,o),this;var s=this._events[o];if(s.fn)s.fn===r&&(!i||s.once)&&(!n||s.context===n)&&tN(this,o);else{for(var a=0,l=[],u=s.length;a<u;a++)(s[a].fn!==r||i&&!s[a].once||n&&s[a].context!==n)&&l.push(s[a]);l.length?this._events[o]=l.length===1?l[0]:l:tN(this,o)}return this};Ua.prototype.removeAllListeners=function(e){var r;return e?(r=bc?bc+e:e,this._events[r]&&tN(this,r)):(this._events=new t9,this._eventsCount=0),this};Ua.prototype.off=Ua.prototype.removeListener;Ua.prototype.addListener=Ua.prototype.on;Ua.prefixed=bc;Ua.EventEmitter=Ua;typeof FV<"u"&&(FV.exports=Ua)});var T2e=X(I2e=>{"use strict";var r4=Ls();function Wut(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Vut=typeof Object.is=="function"?Object.is:Wut,Kut=r4.useState,Gut=r4.useEffect,Qut=r4.useLayoutEffect,Zut=r4.useDebugValue;function Yut(t,e){var r=e(),n=Kut({inst:{value:r,getSnapshot:e}}),i=n[0].inst,o=n[1];return Qut(function(){i.value=r,i.getSnapshot=e,GV(i)&&o({inst:i})},[t,r,e]),Gut(function(){return GV(i)&&o({inst:i}),t(function(){GV(i)&&o({inst:i})})},[t]),Zut(r),r}function GV(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!Vut(t,r)}catch{return!0}}function Jut(t,e){return e()}var Xut=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Jut:Yut;I2e.useSyncExternalStore=r4.useSyncExternalStore!==void 0?r4.useSyncExternalStore:Xut});var QV=X((I2r,k2e)=>{"use strict";k2e.exports=T2e()});var M2e=X(R2e=>{"use strict";var uN=Ls(),eft=QV();function tft(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var rft=typeof Object.is=="function"?Object.is:tft,nft=eft.useSyncExternalStore,ift=uN.useRef,oft=uN.useEffect,sft=uN.useMemo,aft=uN.useDebugValue;R2e.useSyncExternalStoreWithSelector=function(t,e,r,n,i){var o=ift(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=sft(function(){function l(y){if(!u){if(u=!0,d=y,y=n(y),i!==void 0&&s.hasValue){var S=s.value;if(i(S,y))return p=S}return p=y}if(S=p,rft(d,y))return S;var R=n(y);return i!==void 0&&i(S,R)?S:(d=y,p=R)}var u=!1,d,p,v=r===void 0?null:r;return[function(){return l(e())},v===null?void 0:function(){return l(v())}]},[e,r,n,i]);var a=nft(t,o[0],o[1]);return oft(function(){s.hasValue=!0,s.value=a},[a]),aft(a),a}});var O2e=X((k2r,N2e)=>{"use strict";N2e.exports=M2e()});var nwe=X(wN=>{"use strict";var mft=Ls(),gft=Symbol.for("react.element"),wft=Symbol.for("react.fragment"),vft=Object.prototype.hasOwnProperty,yft=mft.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,bft={key:!0,ref:!0,__self:!0,__source:!0};function rwe(t,e,r){var n,i={},o=null,s=null;r!==void 0&&(o=""+r),e.key!==void 0&&(o=""+e.key),e.ref!==void 0&&(s=e.ref);for(n in e)vft.call(e,n)&&!bft.hasOwnProperty(n)&&(i[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps,e)i[n]===void 0&&(i[n]=e[n]);return{$$typeof:gft,type:t,key:o,ref:s,props:i,_owner:yft.current}}wN.Fragment=wft;wN.jsx=rwe;wN.jsxs=rwe});var o9=X((Jwr,iwe)=>{"use strict";iwe.exports=nwe()});var Ewe=X(IN=>{"use strict";Object.defineProperty(IN,"__esModule",{value:!0});IN.walletLogo=void 0;var Bft=(t,e)=>{let r;switch(t){case"standard":return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};IN.walletLogo=Bft});var a9=X(l4=>{"use strict";Object.defineProperty(l4,"__esModule",{value:!0});l4.errorValues=l4.standardErrorCodes=void 0;l4.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}};l4.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 QK=X(Kl=>{"use strict";Object.defineProperty(Kl,"__esModule",{value:!0});Kl.serialize=Kl.getErrorCode=Kl.isValidCode=Kl.getMessageFromCode=Kl.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;var TN=a9(),Swe="Unspecified error message.";Kl.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function _we(t,e=Swe){if(t&&Number.isInteger(t)){let r=t.toString();if(GK(TN.errorValues,r))return TN.errorValues[r].message;if(Twe(t))return Kl.JSON_RPC_SERVER_ERROR_MESSAGE}return e}Kl.getMessageFromCode=_we;function Iwe(t){if(!Number.isInteger(t))return!1;let e=t.toString();return!!(TN.errorValues[e]||Twe(t))}Kl.isValidCode=Iwe;function Dft(t){var e;if(typeof t=="number")return t;if(Lft(t))return(e=t.code)!==null&&e!==void 0?e:t.errorCode}Kl.getErrorCode=Dft;function Lft(t){return typeof t=="object"&&t!==null&&(typeof t.code=="number"||typeof t.errorCode=="number")}function Uft(t,{shouldIncludeStack:e=!1}={}){let r={};if(t&&typeof t=="object"&&!Array.isArray(t)&&GK(t,"code")&&Iwe(t.code)){let n=t;r.code=n.code,n.message&&typeof n.message=="string"?(r.message=n.message,GK(n,"data")&&(r.data=n.data)):(r.message=_we(r.code),r.data={originalError:Cwe(t)})}else r.code=TN.standardErrorCodes.rpc.internal,r.message=Awe(t,"message")?t.message:Swe,r.data={originalError:Cwe(t)};return e&&(r.stack=Awe(t,"stack")?t.stack:void 0),r}Kl.serialize=Uft;function Twe(t){return t>=-32099&&t<=-32e3}function Cwe(t){return t&&typeof t=="object"&&!Array.isArray(t)?Object.assign({},t):t}function GK(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Awe(t,e){return typeof t=="object"&&t!==null&&e in t&&typeof t[e]=="string"}});var Mwe=X(MN=>{"use strict";Object.defineProperty(MN,"__esModule",{value:!0});MN.standardErrors=void 0;var ua=a9(),kwe=QK();MN.standardErrors={rpc:{parse:t=>Zu(ua.standardErrorCodes.rpc.parse,t),invalidRequest:t=>Zu(ua.standardErrorCodes.rpc.invalidRequest,t),invalidParams:t=>Zu(ua.standardErrorCodes.rpc.invalidParams,t),methodNotFound:t=>Zu(ua.standardErrorCodes.rpc.methodNotFound,t),internal:t=>Zu(ua.standardErrorCodes.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");let{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Zu(e,t)},invalidInput:t=>Zu(ua.standardErrorCodes.rpc.invalidInput,t),resourceNotFound:t=>Zu(ua.standardErrorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>Zu(ua.standardErrorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>Zu(ua.standardErrorCodes.rpc.transactionRejected,t),methodNotSupported:t=>Zu(ua.standardErrorCodes.rpc.methodNotSupported,t),limitExceeded:t=>Zu(ua.standardErrorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>u4(ua.standardErrorCodes.provider.userRejectedRequest,t),unauthorized:t=>u4(ua.standardErrorCodes.provider.unauthorized,t),unsupportedMethod:t=>u4(ua.standardErrorCodes.provider.unsupportedMethod,t),disconnected:t=>u4(ua.standardErrorCodes.provider.disconnected,t),chainDisconnected:t=>u4(ua.standardErrorCodes.provider.chainDisconnected,t),unsupportedChain:t=>u4(ua.standardErrorCodes.provider.unsupportedChain,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");let{code:e,message:r,data:n}=t;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new RN(e,r,n)}}};function Zu(t,e){let[r,n]=Rwe(e);return new kN(t,r||(0,kwe.getMessageFromCode)(t),n)}function u4(t,e){let[r,n]=Rwe(e);return new RN(t,r||(0,kwe.getMessageFromCode)(t),n)}function Rwe(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){let{message:e,data:r}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}var kN=class extends Error{constructor(e,r,n){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=e,n!==void 0&&(this.data=n)}},RN=class extends kN{constructor(e,r,n){if(!jft(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,r,n)}};function jft(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}});var Ld=X(f4=>{"use strict";Object.defineProperty(f4,"__esModule",{value:!0});f4.standardErrors=f4.standardErrorCodes=void 0;var Fft=a9();Object.defineProperty(f4,"standardErrorCodes",{enumerable:!0,get:function(){return Fft.standardErrorCodes}});var $ft=Mwe();Object.defineProperty(f4,"standardErrors",{enumerable:!0,get:function(){return $ft.standardErrors}})});var ON=X(NN=>{"use strict";Object.defineProperty(NN,"__esModule",{value:!0});NN.isErrorResponse=void 0;function qft(t){return t.errorMessage!==void 0}NN.isErrorResponse=qft});var c9=X(PN=>{"use strict";Object.defineProperty(PN,"__esModule",{value:!0});PN.LIB_VERSION=void 0;PN.LIB_VERSION="4.0.4"});var Nwe=X(BN=>{"use strict";Object.defineProperty(BN,"__esModule",{value:!0});BN.serializeError=void 0;var Hft=ON(),zft=c9(),Wft=a9(),Vft=QK();function Kft(t,e){let r=(0,Vft.serialize)(Gft(t),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",zft.LIB_VERSION),n.searchParams.set("code",r.code.toString());let i=Qft(r.data,e);return i&&n.searchParams.set("method",i),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}BN.serializeError=Kft;function Gft(t){return typeof t=="string"?{message:t,code:Wft.standardErrorCodes.rpc.internal}:(0,Hft.isErrorResponse)(t)?Object.assign(Object.assign({},t),{message:t.errorMessage,code:t.errorCode,data:{method:t.method}}):t}function Qft(t,e){let r=t?.method;if(r)return r;if(e!==void 0){if(typeof e=="string")return e;if(Array.isArray(e)){if(e.length>0)return e[0].method}else return e.method}}});var DN=X(sl=>{"use strict";Object.defineProperty(sl,"__esModule",{value:!0});sl.RegExpString=sl.IntNumber=sl.BigIntString=sl.AddressString=sl.HexString=sl.OpaqueType=void 0;function l9(){return t=>t}sl.OpaqueType=l9;sl.HexString=l9();sl.AddressString=l9();sl.BigIntString=l9();function Zft(t){return Math.floor(t)}sl.IntNumber=Zft;sl.RegExpString=l9()});var Ud=X(Dr=>{"use strict";Object.defineProperty(Dr,"__esModule",{value:!0});Dr.areAddressArraysEqual=Dr.getFavicon=Dr.range=Dr.isBigNumber=Dr.ensureParsedJSONObject=Dr.ensureBigInt=Dr.ensureRegExpString=Dr.ensureIntNumber=Dr.ensureBuffer=Dr.ensureAddressString=Dr.ensureEvenLengthHexString=Dr.ensureHexString=Dr.isHexString=Dr.prepend0x=Dr.strip0x=Dr.has0xPrefix=Dr.hexStringFromIntNumber=Dr.intNumberFromHexString=Dr.bigIntStringFromBigInt=Dr.hexStringFromBuffer=Dr.hexStringToUint8Array=Dr.uint8ArrayToHex=Dr.randomBytesHex=void 0;var W3=Ld(),Yu=DN(),Owe=/^[0-9]*$/,Pwe=/^[a-f0-9]*$/;function Yft(t){return Bwe(crypto.getRandomValues(new Uint8Array(t)))}Dr.randomBytesHex=Yft;function Bwe(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}Dr.uint8ArrayToHex=Bwe;function Jft(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>parseInt(e,16)))}Dr.hexStringToUint8Array=Jft;function Xft(t,e=!1){let r=t.toString("hex");return(0,Yu.HexString)(e?`0x${r}`:r)}Dr.hexStringFromBuffer=Xft;function eht(t){return(0,Yu.BigIntString)(t.toString(10))}Dr.bigIntStringFromBigInt=eht;function tht(t){return(0,Yu.IntNumber)(Number(BigInt(f9(t,!0))))}Dr.intNumberFromHexString=tht;function rht(t){return(0,Yu.HexString)(`0x${BigInt(t).toString(16)}`)}Dr.hexStringFromIntNumber=rht;function ZK(t){return t.startsWith("0x")||t.startsWith("0X")}Dr.has0xPrefix=ZK;function LN(t){return ZK(t)?t.slice(2):t}Dr.strip0x=LN;function Dwe(t){return ZK(t)?`0x${t.slice(2)}`:`0x${t}`}Dr.prepend0x=Dwe;function u9(t){if(typeof t!="string")return!1;let e=LN(t).toLowerCase();return Pwe.test(e)}Dr.isHexString=u9;function Lwe(t,e=!1){if(typeof t=="string"){let r=LN(t).toLowerCase();if(Pwe.test(r))return(0,Yu.HexString)(e?`0x${r}`:r)}throw W3.standardErrors.rpc.invalidParams(`"${String(t)}" is not a hexadecimal string`)}Dr.ensureHexString=Lwe;function f9(t,e=!1){let r=Lwe(t,!1);return r.length%2===1&&(r=(0,Yu.HexString)(`0${r}`)),e?(0,Yu.HexString)(`0x${r}`):r}Dr.ensureEvenLengthHexString=f9;function nht(t){if(typeof t=="string"){let e=LN(t).toLowerCase();if(u9(e)&&e.length===40)return(0,Yu.AddressString)(Dwe(e))}throw W3.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(t)}`)}Dr.ensureAddressString=nht;function iht(t){if(Buffer.isBuffer(t))return t;if(typeof t=="string"){if(u9(t)){let e=f9(t,!1);return Buffer.from(e,"hex")}return Buffer.from(t,"utf8")}throw W3.standardErrors.rpc.invalidParams(`Not binary data: ${String(t)}`)}Dr.ensureBuffer=iht;function Uwe(t){if(typeof t=="number"&&Number.isInteger(t))return(0,Yu.IntNumber)(t);if(typeof t=="string"){if(Owe.test(t))return(0,Yu.IntNumber)(Number(t));if(u9(t))return(0,Yu.IntNumber)(Number(BigInt(f9(t,!0))))}throw W3.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}Dr.ensureIntNumber=Uwe;function oht(t){if(t instanceof RegExp)return(0,Yu.RegExpString)(t.toString());throw W3.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(t)}`)}Dr.ensureRegExpString=oht;function sht(t){if(t!==null&&(typeof t=="bigint"||jwe(t)))return BigInt(t.toString(10));if(typeof t=="number")return BigInt(Uwe(t));if(typeof t=="string"){if(Owe.test(t))return BigInt(t);if(u9(t))return BigInt(f9(t,!0))}throw W3.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}Dr.ensureBigInt=sht;function aht(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw W3.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(t)}`)}Dr.ensureParsedJSONObject=aht;function jwe(t){if(t==null||typeof t.constructor!="function")return!1;let{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}Dr.isBigNumber=jwe;function cht(t,e){return Array.from({length:e-t},(r,n)=>t+n)}Dr.range=cht;function lht(){let t=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:r}=document.location,n=t?t.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?e+n:`${e}//${r}${n}`}Dr.getFavicon=lht;function uht(t,e){return t.length===e.length&&t.every((r,n)=>r===e[n])}Dr.areAddressArraysEqual=uht});var YK=X(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});Us.decryptContent=Us.encryptContent=Us.importKeyFromHexString=Us.exportKeyToHexString=Us.decrypt=Us.encrypt=Us.deriveSharedSecret=Us.generateKeyPair=void 0;var Fwe=Ud();async function fht(){return crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!0,["deriveKey"])}Us.generateKeyPair=fht;async function hht(t,e){return crypto.subtle.deriveKey({name:"ECDH",public:e},t,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}Us.deriveSharedSecret=hht;async function $we(t,e){let r=crypto.getRandomValues(new Uint8Array(12)),n=await crypto.subtle.encrypt({name:"AES-GCM",iv:r},t,new TextEncoder().encode(e));return{iv:r,cipherText:n}}Us.encrypt=$we;async function qwe(t,{iv:e,cipherText:r}){let n=await crypto.subtle.decrypt({name:"AES-GCM",iv:e},t,r);return new TextDecoder().decode(n)}Us.decrypt=qwe;function Hwe(t){switch(t){case"public":return"spki";case"private":return"pkcs8"}}async function dht(t,e){let r=Hwe(t),n=await crypto.subtle.exportKey(r,e);return(0,Fwe.uint8ArrayToHex)(new Uint8Array(n))}Us.exportKeyToHexString=dht;async function pht(t,e){let r=Hwe(t),n=(0,Fwe.hexStringToUint8Array)(e).buffer;return await crypto.subtle.importKey(r,n,{name:"ECDH",namedCurve:"P-256"},!0,t==="private"?["deriveKey"]:[])}Us.importKeyFromHexString=pht;async function mht(t,e){let r=JSON.stringify(t,(n,i)=>{if(!(i instanceof Error))return i;let o=i;return Object.assign(Object.assign({},o.code?{code:o.code}:{}),{message:o.message})});return $we(e,r)}Us.encryptContent=mht;async function ght(t,e){return JSON.parse(await qwe(e,t))}Us.decryptContent=ght});var Ug=X(UN=>{"use strict";Object.defineProperty(UN,"__esModule",{value:!0});UN.ScopedLocalStorage=void 0;var JK=class t{constructor(e,r){this.scope=e,this.module=r}setItem(e,r){localStorage.setItem(this.scopedKey(e),r)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){let e=this.scopedKey(""),r=[];for(let n=0;n<localStorage.length;n++){let i=localStorage.key(n);typeof i=="string"&&i.startsWith(e)&&r.push(i)}r.forEach(n=>localStorage.removeItem(n))}scopedKey(e){return`-${this.scope}${this.module?`:${this.module}`:""}:${e}`}static clearAll(){new t("CBWSDK").clear(),new t("walletlink").clear()}};UN.ScopedLocalStorage=JK});var zwe=X(FN=>{"use strict";Object.defineProperty(FN,"__esModule",{value:!0});FN.SCWKeyManager=void 0;var jN=YK(),wht=Ug(),XK={storageKey:"ownPrivateKey",keyType:"private"},eG={storageKey:"ownPublicKey",keyType:"public"},tG={storageKey:"peerPublicKey",keyType:"public"},rG=class{constructor(){this.storage=new wht.ScopedLocalStorage("CBWSDK","SCWKeyManager"),this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null}async getOwnPublicKey(){return await this.loadKeysIfNeeded(),this.ownPublicKey}async getSharedSecret(){return await this.loadKeysIfNeeded(),this.sharedSecret}async setPeerPublicKey(e){this.sharedSecret=null,this.peerPublicKey=e,await this.storeKey(tG,e),await this.loadKeysIfNeeded()}async clear(){this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null,this.storage.removeItem(eG.storageKey),this.storage.removeItem(XK.storageKey),this.storage.removeItem(tG.storageKey)}async generateKeyPair(){let e=await(0,jN.generateKeyPair)();this.ownPrivateKey=e.privateKey,this.ownPublicKey=e.publicKey,await this.storeKey(XK,e.privateKey),await this.storeKey(eG,e.publicKey)}async loadKeysIfNeeded(){if(this.ownPrivateKey===null&&(this.ownPrivateKey=await this.loadKey(XK)),this.ownPublicKey===null&&(this.ownPublicKey=await this.loadKey(eG)),(this.ownPrivateKey===null||this.ownPublicKey===null)&&await this.generateKeyPair(),this.peerPublicKey===null&&(this.peerPublicKey=await this.loadKey(tG)),this.sharedSecret===null){if(this.ownPrivateKey===null||this.peerPublicKey===null)return;this.sharedSecret=await(0,jN.deriveSharedSecret)(this.ownPrivateKey,this.peerPublicKey)}}async loadKey(e){let r=this.storage.getItem(e.storageKey);return r?(0,jN.importKeyFromHexString)(e.keyType,r):null}async storeKey(e,r){let n=await(0,jN.exportKeyToHexString)(e.keyType,r);this.storage.setItem(e.storageKey,n)}};FN.SCWKeyManager=rG});var Qwe=X($N=>{"use strict";Object.defineProperty($N,"__esModule",{value:!0});$N.SCWStateManager=void 0;var vht=Ug(),Wwe="accounts",Vwe="activeChain",Kwe="availableChains",Gwe="walletCapabilities",nG=class{get accounts(){return this._accounts}get activeChain(){return this._activeChain}get walletCapabilities(){return this._walletCapabilities}constructor(e){var r,n;this.storage=new vht.ScopedLocalStorage("CBWSDK","SCWStateManager"),this.updateListener=e.updateListener,this.availableChains=this.loadItemFromStorage(Kwe),this._walletCapabilities=this.loadItemFromStorage(Gwe);let i=this.loadItemFromStorage(Wwe),o=this.loadItemFromStorage(Vwe);i&&this.updateListener.onAccountsUpdate({accounts:i,source:"storage"}),o&&this.updateListener.onChainUpdate({chain:o,source:"storage"}),this._accounts=i||[],this._activeChain=o||{id:(n=(r=e.appChainIds)===null||r===void 0?void 0:r[0])!==null&&n!==void 0?n:1}}updateAccounts(e){this._accounts=e,this.storeItemToStorage(Wwe,e),this.updateListener.onAccountsUpdate({accounts:e,source:"wallet"})}switchChain(e){var r;let n=(r=this.availableChains)===null||r===void 0?void 0:r.find(i=>i.id===e);return n?(n===this._activeChain||(this._activeChain=n,this.storeItemToStorage(Vwe,n),this.updateListener.onChainUpdate({chain:n,source:"wallet"})),!0):!1}updateAvailableChains(e){if(!e||Object.keys(e).length===0)return;let r=Object.entries(e).map(([n,i])=>({id:Number(n),rpcUrl:i}));this.availableChains=r,this.storeItemToStorage(Kwe,r),this.switchChain(this._activeChain.id)}updateWalletCapabilities(e){this._walletCapabilities=e,this.storeItemToStorage(Gwe,e)}storeItemToStorage(e,r){this.storage.setItem(e,JSON.stringify(r))}loadItemFromStorage(e){let r=this.storage.getItem(e);return r?JSON.parse(r):void 0}clear(){this.storage.clear()}};$N.SCWStateManager=nG});var Ywe=X(zN=>{"use strict";Object.defineProperty(zN,"__esModule",{value:!0});zN.SCWSigner=void 0;var yht=zwe(),bht=Qwe(),qN=Ld(),Zwe=Ud(),HN=YK(),iG=class{constructor(e){this.metadata=e.metadata,this.communicator=e.communicator,this.keyManager=new yht.SCWKeyManager,this.stateManager=new bht.SCWStateManager({appChainIds:this.metadata.appChainIds,updateListener:e.updateListener}),this.handshake=this.handshake.bind(this),this.request=this.request.bind(this),this.createRequestMessage=this.createRequestMessage.bind(this),this.decryptResponseMessage=this.decryptResponseMessage.bind(this)}async handshake(){let e=await this.createRequestMessage({handshake:{method:"eth_requestAccounts",params:this.metadata}}),r=await this.communicator.postRequestAndWaitForResponse(e);if("failure"in r.content)throw r.content.failure;let n=await(0,HN.importKeyFromHexString)("public",r.sender);await this.keyManager.setPeerPublicKey(n);let i=await this.decryptResponseMessage(r);this.updateInternalState({method:"eth_requestAccounts"},i);let o=i.result;if("error"in o)throw o.error;return this.stateManager.accounts}async request(e){let r=this.tryLocalHandling(e);if(r!==void 0){if(r instanceof Error)throw r;return r}await this.communicator.waitForPopupLoaded();let n=await this.sendEncryptedRequest(e),i=await this.decryptResponseMessage(n);this.updateInternalState(e,i);let o=i.result;if("error"in o)throw o.error;return o.value}async disconnect(){this.stateManager.clear(),await this.keyManager.clear()}tryLocalHandling(e){var r;switch(e.method){case"wallet_switchEthereumChain":{let n=e.params;if(!n||!(!((r=n[0])===null||r===void 0)&&r.chainId))throw qN.standardErrors.rpc.invalidParams();let i=(0,Zwe.ensureIntNumber)(n[0].chainId);return this.stateManager.switchChain(i)?null:void 0}case"wallet_getCapabilities":{let n=this.stateManager.walletCapabilities;if(!n)throw qN.standardErrors.provider.unauthorized("No wallet capabilities found, please disconnect and reconnect");return n}default:return}}async sendEncryptedRequest(e){let r=await this.keyManager.getSharedSecret();if(!r)throw qN.standardErrors.provider.unauthorized("No valid session found, try requestAccounts before other methods");let n=await(0,HN.encryptContent)({action:e,chainId:this.stateManager.activeChain.id},r),i=await this.createRequestMessage({encrypted:n});return this.communicator.postRequestAndWaitForResponse(i)}async createRequestMessage(e){let r=await(0,HN.exportKeyToHexString)("public",await this.keyManager.getOwnPublicKey());return{id:crypto.randomUUID(),sender:r,content:e,timestamp:new Date}}async decryptResponseMessage(e){let r=e.content;if("failure"in r)throw r.failure;let n=await this.keyManager.getSharedSecret();if(!n)throw qN.standardErrors.provider.unauthorized("Invalid session");return(0,HN.decryptContent)(r.encrypted,n)}updateInternalState(e,r){var n,i;let o=(n=r.data)===null||n===void 0?void 0:n.chains;o&&this.stateManager.updateAvailableChains(o);let s=(i=r.data)===null||i===void 0?void 0:i.capabilities;s&&this.stateManager.updateWalletCapabilities(s);let a=r.result;if(!("error"in a))switch(e.method){case"eth_requestAccounts":{let l=a.value;this.stateManager.updateAccounts(l);break}case"wallet_switchEthereumChain":{if(a.value!==null)return;let l=e.params,u=(0,Zwe.ensureIntNumber)(l[0].chainId);this.stateManager.switchChain(u);break}default:break}}};zN.SCWSigner=iG});var jd=X((b5r,oG)=>{"use strict";var h4=typeof Reflect=="object"?Reflect:null,Jwe=h4&&typeof h4.apply=="function"?h4.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},WN;h4&&typeof h4.ownKeys=="function"?WN=h4.ownKeys:Object.getOwnPropertySymbols?WN=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:WN=function(e){return Object.getOwnPropertyNames(e)};function xht(t){console&&console.warn&&console.warn(t)}var e3e=Number.isNaN||function(e){return e!==e};function Ci(){Ci.init.call(this)}oG.exports=Ci;oG.exports.once=Sht;Ci.EventEmitter=Ci;Ci.prototype._events=void 0;Ci.prototype._eventsCount=0;Ci.prototype._maxListeners=void 0;var Xwe=10;function VN(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(Ci,"defaultMaxListeners",{enumerable:!0,get:function(){return Xwe},set:function(t){if(typeof t!="number"||t<0||e3e(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Xwe=t}});Ci.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};Ci.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||e3e(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function t3e(t){return t._maxListeners===void 0?Ci.defaultMaxListeners:t._maxListeners}Ci.prototype.getMaxListeners=function(){return t3e(this)};Ci.prototype.emit=function(e){for(var r=[],n=1;n<arguments.length;n++)r.push(arguments[n]);var i=e==="error",o=this._events;if(o!==void 0)i=i&&o.error===void 0;else if(!i)return!1;if(i){var s;if(r.length>0&&(s=r[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var l=o[e];if(l===void 0)return!1;if(typeof l=="function")Jwe(l,this,r);else for(var u=l.length,d=s3e(l,u),n=0;n<u;++n)Jwe(d[n],this,r);return!0};function r3e(t,e,r,n){var i,o,s;if(VN(r),o=t._events,o===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),s===void 0)s=o[e]=r,++t._eventsCount;else if(typeof s=="function"?s=o[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),i=t3e(t),i>0&&s.length>i&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,xht(a)}return t}Ci.prototype.addListener=function(e,r){return r3e(this,e,r,!1)};Ci.prototype.on=Ci.prototype.addListener;Ci.prototype.prependListener=function(e,r){return r3e(this,e,r,!0)};function Eht(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function n3e(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=Eht.bind(n);return i.listener=r,n.wrapFn=i,i}Ci.prototype.once=function(e,r){return VN(r),this.on(e,n3e(this,e,r)),this};Ci.prototype.prependOnceListener=function(e,r){return VN(r),this.prependListener(e,n3e(this,e,r)),this};Ci.prototype.removeListener=function(e,r){var n,i,o,s,a;if(VN(r),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(o=-1,s=n.length-1;s>=0;s--)if(n[s]===r||n[s].listener===r){a=n[s].listener,o=s;break}if(o<0)return this;o===0?n.shift():Cht(n,o),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,a||r)}return this};Ci.prototype.off=Ci.prototype.removeListener;Ci.prototype.removeAllListeners=function(e){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var o=Object.keys(n),s;for(i=0;i<o.length;++i)s=o[i],s!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=n[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(i=r.length-1;i>=0;i--)this.removeListener(e,r[i]);return this};function i3e(t,e,r){var n=t._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?Aht(i):s3e(i,i.length)}Ci.prototype.listeners=function(e){return i3e(this,e,!0)};Ci.prototype.rawListeners=function(e){return i3e(this,e,!1)};Ci.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):o3e.call(t,e)};Ci.prototype.listenerCount=o3e;function o3e(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}Ci.prototype.eventNames=function(){return this._eventsCount>0?WN(this._events):[]};function s3e(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function Cht(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function Aht(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function Sht(t,e){return new Promise(function(r,n){function i(s){t.removeListener(e,o),n(s)}function o(){typeof t.removeListener=="function"&&t.removeListener("error",i),r([].slice.call(arguments))}a3e(t,e,o,{once:!0}),e!=="error"&&_ht(t,i,{once:!0})})}function _ht(t,e,r){typeof t.on=="function"&&a3e(t,"error",e,r)}function a3e(t,e,r,n){if(typeof t.on=="function")n.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,function i(o){n.once&&t.removeEventListener(e,i),r(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}});var sG=X((x5r,c3e)=>{c3e.exports=jd().EventEmitter});var f3e=X(KN=>{"use strict";KN.byteLength=Tht;KN.toByteArray=Rht;KN.fromByteArray=Oht;var Fd=[],Ju=[],Iht=typeof Uint8Array<"u"?Uint8Array:Array,aG="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(V3=0,l3e=aG.length;V3<l3e;++V3)Fd[V3]=aG[V3],Ju[aG.charCodeAt(V3)]=V3;var V3,l3e;Ju[45]=62;Ju[95]=63;function u3e(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function Tht(t){var e=u3e(t),r=e[0],n=e[1];return(r+n)*3/4-n}function kht(t,e,r){return(e+r)*3/4-r}function Rht(t){var e,r=u3e(t),n=r[0],i=r[1],o=new Iht(kht(t,n,i)),s=0,a=i>0?n-4:n,l;for(l=0;l<a;l+=4)e=Ju[t.charCodeAt(l)]<<18|Ju[t.charCodeAt(l+1)]<<12|Ju[t.charCodeAt(l+2)]<<6|Ju[t.charCodeAt(l+3)],o[s++]=e>>16&255,o[s++]=e>>8&255,o[s++]=e&255;return i===2&&(e=Ju[t.charCodeAt(l)]<<2|Ju[t.charCodeAt(l+1)]>>4,o[s++]=e&255),i===1&&(e=Ju[t.charCodeAt(l)]<<10|Ju[t.charCodeAt(l+1)]<<4|Ju[t.charCodeAt(l+2)]>>2,o[s++]=e>>8&255,o[s++]=e&255),o}function Mht(t){return Fd[t>>18&63]+Fd[t>>12&63]+Fd[t>>6&63]+Fd[t&63]}function Nht(t,e,r){for(var n,i=[],o=e;o<r;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),i.push(Mht(n));return i.join("")}function Oht(t){for(var e,r=t.length,n=r%3,i=[],o=16383,s=0,a=r-n;s<a;s+=o)i.push(Nht(t,s,s+o>a?a:s+o));return n===1?(e=t[r-1],i.push(Fd[e>>2]+Fd[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Fd[e>>10]+Fd[e>>4&63]+Fd[e<<2&63]+"=")),i.join("")}});var h3e=X(cG=>{cG.read=function(t,e,r,n,i){var o,s,a=i*8-n-1,l=(1<<a)-1,u=l>>1,d=-7,p=r?i-1:0,v=r?-1:1,y=t[e+p];for(p+=v,o=y&(1<<-d)-1,y>>=-d,d+=a;d>0;o=o*256+t[e+p],p+=v,d-=8);for(s=o&(1<<-d)-1,o>>=-d,d+=n;d>0;s=s*256+t[e+p],p+=v,d-=8);if(o===0)o=1-u;else{if(o===l)return s?NaN:(y?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-u}return(y?-1:1)*s*Math.pow(2,o-n)};cG.write=function(t,e,r,n,i,o){var s,a,l,u=o*8-i-1,d=(1<<u)-1,p=d>>1,v=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=n?0:o-1,S=n?1:-1,R=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=d):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+p>=1?e+=v/l:e+=v*Math.pow(2,1-p),e*l>=2&&(s++,l/=2),s+p>=d?(a=0,s=d):s+p>=1?(a=(e*l-1)*Math.pow(2,i),s=s+p):(a=e*Math.pow(2,p-1)*Math.pow(2,i),s=0));i>=8;t[r+y]=a&255,y+=S,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;t[r+y]=s&255,y+=S,s/=256,u-=8);t[r+y-S]|=R*128}});var w4=X(g4=>{"use strict";var lG=f3e(),p4=h3e(),d3e=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;g4.Buffer=Ue;g4.SlowBuffer=jht;g4.INSPECT_MAX_BYTES=50;var GN=2147483647;g4.kMaxLength=GN;Ue.TYPED_ARRAY_SUPPORT=Pht();!Ue.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Pht(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}Object.defineProperty(Ue.prototype,"parent",{enumerable:!0,get:function(){if(Ue.isBuffer(this))return this.buffer}});Object.defineProperty(Ue.prototype,"offset",{enumerable:!0,get:function(){if(Ue.isBuffer(this))return this.byteOffset}});function gm(t){if(t>GN)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,Ue.prototype),e}function Ue(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return dG(t)}return w3e(t,e,r)}Ue.poolSize=8192;function w3e(t,e,r){if(typeof t=="string")return Dht(t,e);if(ArrayBuffer.isView(t))return Lht(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if($d(t,ArrayBuffer)||t&&$d(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&($d(t,SharedArrayBuffer)||t&&$d(t.buffer,SharedArrayBuffer)))return fG(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=t.valueOf&&t.valueOf();if(n!=null&&n!==t)return Ue.from(n,e,r);let i=Uht(t);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return Ue.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}Ue.from=function(t,e,r){return w3e(t,e,r)};Object.setPrototypeOf(Ue.prototype,Uint8Array.prototype);Object.setPrototypeOf(Ue,Uint8Array);function v3e(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function Bht(t,e,r){return v3e(t),t<=0?gm(t):e!==void 0?typeof r=="string"?gm(t).fill(e,r):gm(t).fill(e):gm(t)}Ue.alloc=function(t,e,r){return Bht(t,e,r)};function dG(t){return v3e(t),gm(t<0?0:pG(t)|0)}Ue.allocUnsafe=function(t){return dG(t)};Ue.allocUnsafeSlow=function(t){return dG(t)};function Dht(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Ue.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=y3e(t,e)|0,n=gm(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}function uG(t){let e=t.length<0?0:pG(t.length)|0,r=gm(e);for(let n=0;n<e;n+=1)r[n]=t[n]&255;return r}function Lht(t){if($d(t,Uint8Array)){let e=new Uint8Array(t);return fG(e.buffer,e.byteOffset,e.byteLength)}return uG(t)}function fG(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return e===void 0&&r===void 0?n=new Uint8Array(t):r===void 0?n=new Uint8Array(t,e):n=new Uint8Array(t,e,r),Object.setPrototypeOf(n,Ue.prototype),n}function Uht(t){if(Ue.isBuffer(t)){let e=pG(t.length)|0,r=gm(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||gG(t.length)?gm(0):uG(t);if(t.type==="Buffer"&&Array.isArray(t.data))return uG(t.data)}function pG(t){if(t>=GN)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+GN.toString(16)+" bytes");return t|0}function jht(t){return+t!=t&&(t=0),Ue.alloc(+t)}Ue.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==Ue.prototype};Ue.compare=function(e,r){if($d(e,Uint8Array)&&(e=Ue.from(e,e.offset,e.byteLength)),$d(r,Uint8Array)&&(r=Ue.from(r,r.offset,r.byteLength)),!Ue.isBuffer(e)||!Ue.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let n=e.length,i=r.length;for(let o=0,s=Math.min(n,i);o<s;++o)if(e[o]!==r[o]){n=e[o],i=r[o];break}return n<i?-1:i<n?1:0};Ue.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};Ue.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return Ue.alloc(0);let n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;let i=Ue.allocUnsafe(r),o=0;for(n=0;n<e.length;++n){let s=e[n];if($d(s,Uint8Array))o+s.length>i.length?(Ue.isBuffer(s)||(s=Ue.from(s)),s.copy(i,o)):Uint8Array.prototype.set.call(i,s,o);else if(Ue.isBuffer(s))s.copy(i,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=s.length}return i};function y3e(t,e){if(Ue.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||$d(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return hG(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return T3e(t).length;default:if(i)return n?-1:hG(t).length;e=(""+e).toLowerCase(),i=!0}}Ue.byteLength=y3e;function Fht(t,e,r){let n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return Zht(this,e,r);case"utf8":case"utf-8":return x3e(this,e,r);case"ascii":return Ght(this,e,r);case"latin1":case"binary":return Qht(this,e,r);case"base64":return Vht(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Yht(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}Ue.prototype._isBuffer=!0;function K3(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}Ue.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<e;r+=2)K3(this,r,r+1);return this};Ue.prototype.swap32=function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<e;r+=4)K3(this,r,r+3),K3(this,r+1,r+2);return this};Ue.prototype.swap64=function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<e;r+=8)K3(this,r,r+7),K3(this,r+1,r+6),K3(this,r+2,r+5),K3(this,r+3,r+4);return this};Ue.prototype.toString=function(){let e=this.length;return e===0?"":arguments.length===0?x3e(this,0,e):Fht.apply(this,arguments)};Ue.prototype.toLocaleString=Ue.prototype.toString;Ue.prototype.equals=function(e){if(!Ue.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:Ue.compare(this,e)===0};Ue.prototype.inspect=function(){let e="",r=g4.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"};d3e&&(Ue.prototype[d3e]=Ue.prototype.inspect);Ue.prototype.compare=function(e,r,n,i,o){if($d(e,Uint8Array)&&(e=Ue.from(e,e.offset,e.byteLength)),!Ue.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),r<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===e)return 0;let s=o-i,a=n-r,l=Math.min(s,a),u=this.slice(i,o),d=e.slice(r,n);for(let p=0;p<l;++p)if(u[p]!==d[p]){s=u[p],a=d[p];break}return s<a?-1:a<s?1:0};function b3e(t,e,r,n,i){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,gG(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof e=="string"&&(e=Ue.from(e,n)),Ue.isBuffer(e))return e.length===0?-1:p3e(t,e,r,n,i);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):p3e(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function p3e(t,e,r,n,i){let o=1,s=t.length,a=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,s/=2,a/=2,r/=2}function l(d,p){return o===1?d[p]:d.readUInt16BE(p*o)}let u;if(i){let d=-1;for(u=r;u<s;u++)if(l(t,u)===l(e,d===-1?0:u-d)){if(d===-1&&(d=u),u-d+1===a)return d*o}else d!==-1&&(u-=u-d),d=-1}else for(r+a>s&&(r=s-a),u=r;u>=0;u--){let d=!0;for(let p=0;p<a;p++)if(l(t,u+p)!==l(e,p)){d=!1;break}if(d)return u}return-1}Ue.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};Ue.prototype.indexOf=function(e,r,n){return b3e(this,e,r,n,!0)};Ue.prototype.lastIndexOf=function(e,r,n){return b3e(this,e,r,n,!1)};function $ht(t,e,r,n){r=Number(r)||0;let i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;let o=e.length;n>o/2&&(n=o/2);let s;for(s=0;s<n;++s){let a=parseInt(e.substr(s*2,2),16);if(gG(a))return s;t[r+s]=a}return s}function qht(t,e,r,n){return QN(hG(e,t.length-r),t,r,n)}function Hht(t,e,r,n){return QN(tdt(e),t,r,n)}function zht(t,e,r,n){return QN(T3e(e),t,r,n)}function Wht(t,e,r,n){return QN(rdt(e,t.length-r),t,r,n)}Ue.prototype.write=function(e,r,n,i){if(r===void 0)i="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")i=r,n=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-r;if((n===void 0||n>o)&&(n=o),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let s=!1;for(;;)switch(i){case"hex":return $ht(this,e,r,n);case"utf8":case"utf-8":return qht(this,e,r,n);case"ascii":case"latin1":case"binary":return Hht(this,e,r,n);case"base64":return zht(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Wht(this,e,r,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}};Ue.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Vht(t,e,r){return e===0&&r===t.length?lG.fromByteArray(t):lG.fromByteArray(t.slice(e,r))}function x3e(t,e,r){r=Math.min(t.length,r);let n=[],i=e;for(;i<r;){let o=t[i],s=null,a=o>239?4:o>223?3:o>191?2:1;if(i+a<=r){let l,u,d,p;switch(a){case 1:o<128&&(s=o);break;case 2:l=t[i+1],(l&192)===128&&(p=(o&31)<<6|l&63,p>127&&(s=p));break;case 3:l=t[i+1],u=t[i+2],(l&192)===128&&(u&192)===128&&(p=(o&15)<<12|(l&63)<<6|u&63,p>2047&&(p<55296||p>57343)&&(s=p));break;case 4:l=t[i+1],u=t[i+2],d=t[i+3],(l&192)===128&&(u&192)===128&&(d&192)===128&&(p=(o&15)<<18|(l&63)<<12|(u&63)<<6|d&63,p>65535&&p<1114112&&(s=p))}}s===null?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),i+=a}return Kht(n)}var m3e=4096;function Kht(t){let e=t.length;if(e<=m3e)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=m3e));return r}function Ght(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]&127);return n}function Qht(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function Zht(t,e,r){let n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let o=e;o<r;++o)i+=ndt[t[o]];return i}function Yht(t,e,r){let n=t.slice(e,r),i="";for(let o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}Ue.prototype.slice=function(e,r){let n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);let i=this.subarray(e,r);return Object.setPrototypeOf(i,Ue.prototype),i};function js(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}Ue.prototype.readUintLE=Ue.prototype.readUIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||js(e,r,this.length);let i=this[e],o=1,s=0;for(;++s<r&&(o*=256);)i+=this[e+s]*o;return i};Ue.prototype.readUintBE=Ue.prototype.readUIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||js(e,r,this.length);let i=this[e+--r],o=1;for(;r>0&&(o*=256);)i+=this[e+--r]*o;return i};Ue.prototype.readUint8=Ue.prototype.readUInt8=function(e,r){return e=e>>>0,r||js(e,1,this.length),this[e]};Ue.prototype.readUint16LE=Ue.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||js(e,2,this.length),this[e]|this[e+1]<<8};Ue.prototype.readUint16BE=Ue.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||js(e,2,this.length),this[e]<<8|this[e+1]};Ue.prototype.readUint32LE=Ue.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||js(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};Ue.prototype.readUint32BE=Ue.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||js(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};Ue.prototype.readBigUInt64LE=jg(function(e){e=e>>>0,m4(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&h9(e,this.length-8);let i=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,o=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(i)+(BigInt(o)<<BigInt(32))});Ue.prototype.readBigUInt64BE=jg(function(e){e=e>>>0,m4(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&h9(e,this.length-8);let i=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],o=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(i)<<BigInt(32))+BigInt(o)});Ue.prototype.readIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||js(e,r,this.length);let i=this[e],o=1,s=0;for(;++s<r&&(o*=256);)i+=this[e+s]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*r)),i};Ue.prototype.readIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||js(e,r,this.length);let i=r,o=1,s=this[e+--i];for(;i>0&&(o*=256);)s+=this[e+--i]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*r)),s};Ue.prototype.readInt8=function(e,r){return e=e>>>0,r||js(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};Ue.prototype.readInt16LE=function(e,r){e=e>>>0,r||js(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};Ue.prototype.readInt16BE=function(e,r){e=e>>>0,r||js(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};Ue.prototype.readInt32LE=function(e,r){return e=e>>>0,r||js(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};Ue.prototype.readInt32BE=function(e,r){return e=e>>>0,r||js(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};Ue.prototype.readBigInt64LE=jg(function(e){e=e>>>0,m4(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&h9(e,this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(i)<<BigInt(32))+BigInt(r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)});Ue.prototype.readBigInt64BE=jg(function(e){e=e>>>0,m4(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&h9(e,this.length-8);let i=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(i)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)});Ue.prototype.readFloatLE=function(e,r){return e=e>>>0,r||js(e,4,this.length),p4.read(this,e,!0,23,4)};Ue.prototype.readFloatBE=function(e,r){return e=e>>>0,r||js(e,4,this.length),p4.read(this,e,!1,23,4)};Ue.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||js(e,8,this.length),p4.read(this,e,!0,52,8)};Ue.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||js(e,8,this.length),p4.read(this,e,!1,52,8)};function al(t,e,r,n,i,o){if(!Ue.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}Ue.prototype.writeUintLE=Ue.prototype.writeUIntLE=function(e,r,n,i){if(e=+e,r=r>>>0,n=n>>>0,!i){let a=Math.pow(2,8*n)-1;al(this,e,r,n,a,0)}let o=1,s=0;for(this[r]=e&255;++s<n&&(o*=256);)this[r+s]=e/o&255;return r+n};Ue.prototype.writeUintBE=Ue.prototype.writeUIntBE=function(e,r,n,i){if(e=+e,r=r>>>0,n=n>>>0,!i){let a=Math.pow(2,8*n)-1;al(this,e,r,n,a,0)}let o=n-1,s=1;for(this[r+o]=e&255;--o>=0&&(s*=256);)this[r+o]=e/s&255;return r+n};Ue.prototype.writeUint8=Ue.prototype.writeUInt8=function(e,r,n){return e=+e,r=r>>>0,n||al(this,e,r,1,255,0),this[r]=e&255,r+1};Ue.prototype.writeUint16LE=Ue.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||al(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};Ue.prototype.writeUint16BE=Ue.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||al(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};Ue.prototype.writeUint32LE=Ue.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||al(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};Ue.prototype.writeUint32BE=Ue.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||al(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function E3e(t,e,r,n,i){I3e(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s,r}function C3e(t,e,r,n,i){I3e(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o=o>>8,t[r+6]=o,o=o>>8,t[r+5]=o,o=o>>8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s=s>>8,t[r+2]=s,s=s>>8,t[r+1]=s,s=s>>8,t[r]=s,r+8}Ue.prototype.writeBigUInt64LE=jg(function(e,r=0){return E3e(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});Ue.prototype.writeBigUInt64BE=jg(function(e,r=0){return C3e(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});Ue.prototype.writeIntLE=function(e,r,n,i){if(e=+e,r=r>>>0,!i){let l=Math.pow(2,8*n-1);al(this,e,r,n,l-1,-l)}let o=0,s=1,a=0;for(this[r]=e&255;++o<n&&(s*=256);)e<0&&a===0&&this[r+o-1]!==0&&(a=1),this[r+o]=(e/s>>0)-a&255;return r+n};Ue.prototype.writeIntBE=function(e,r,n,i){if(e=+e,r=r>>>0,!i){let l=Math.pow(2,8*n-1);al(this,e,r,n,l-1,-l)}let o=n-1,s=1,a=0;for(this[r+o]=e&255;--o>=0&&(s*=256);)e<0&&a===0&&this[r+o+1]!==0&&(a=1),this[r+o]=(e/s>>0)-a&255;return r+n};Ue.prototype.writeInt8=function(e,r,n){return e=+e,r=r>>>0,n||al(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};Ue.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||al(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};Ue.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||al(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};Ue.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||al(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};Ue.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||al(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};Ue.prototype.writeBigInt64LE=jg(function(e,r=0){return E3e(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});Ue.prototype.writeBigInt64BE=jg(function(e,r=0){return C3e(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function A3e(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function S3e(t,e,r,n,i){return e=+e,r=r>>>0,i||A3e(t,e,r,4,34028234663852886e22,-34028234663852886e22),p4.write(t,e,r,n,23,4),r+4}Ue.prototype.writeFloatLE=function(e,r,n){return S3e(this,e,r,!0,n)};Ue.prototype.writeFloatBE=function(e,r,n){return S3e(this,e,r,!1,n)};function _3e(t,e,r,n,i){return e=+e,r=r>>>0,i||A3e(t,e,r,8,17976931348623157e292,-17976931348623157e292),p4.write(t,e,r,n,52,8),r+8}Ue.prototype.writeDoubleLE=function(e,r,n){return _3e(this,e,r,!0,n)};Ue.prototype.writeDoubleBE=function(e,r,n){return _3e(this,e,r,!1,n)};Ue.prototype.copy=function(e,r,n,i){if(!Ue.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i<n&&(i=n),i===n||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-r<i-n&&(i=e.length-r+n);let o=i-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,i):Uint8Array.prototype.set.call(e,this.subarray(n,i),r),o};Ue.prototype.fill=function(e,r,n,i){if(typeof e=="string"){if(typeof r=="string"?(i=r,r=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!Ue.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(e.length===1){let s=e.charCodeAt(0);(i==="utf8"&&s<128||i==="latin1")&&(e=s)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);let o;if(typeof e=="number")for(o=r;o<n;++o)this[o]=e;else{let s=Ue.isBuffer(e)?e:Ue.from(e,i),a=s.length;if(a===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-r;++o)this[o+r]=s[o%a]}return this};var d4={};function mG(t,e,r){d4[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(i){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:i,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}mG("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);mG("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);mG("ERR_OUT_OF_RANGE",function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=g3e(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=g3e(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n},RangeError);function g3e(t){let e="",r=t.length,n=t[0]==="-"?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function Jht(t,e,r){m4(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&h9(e,t.length-(r+1))}function I3e(t,e,r,n,i,o){if(t>r||t<e){let s=typeof e=="bigint"?"n":"",a;throw o>3?e===0||e===BigInt(0)?a=`>= 0${s} and < 2${s} ** ${(o+1)*8}${s}`:a=`>= -(2${s} ** ${(o+1)*8-1}${s}) and < 2 ** ${(o+1)*8-1}${s}`:a=`>= ${e}${s} and <= ${r}${s}`,new d4.ERR_OUT_OF_RANGE("value",a,t)}Jht(n,i,o)}function m4(t,e){if(typeof t!="number")throw new d4.ERR_INVALID_ARG_TYPE(e,"number",t)}function h9(t,e,r){throw Math.floor(t)!==t?(m4(t,r),new d4.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new d4.ERR_BUFFER_OUT_OF_BOUNDS:new d4.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}var Xht=/[^+/0-9A-Za-z-_]/g;function edt(t){if(t=t.split("=")[0],t=t.trim().replace(Xht,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function hG(t,e){e=e||1/0;let r,n=t.length,i=null,o=[];for(let s=0;s<n;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function tdt(t){let e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function rdt(t,e){let r,n,i,o=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function T3e(t){return lG.toByteArray(edt(t))}function QN(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function $d(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function gG(t){return t!==t}var ndt=function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function jg(t){return typeof BigInt>"u"?idt:t}function idt(){throw new Error("BigInt not supported")}});var wG=X(()=>{});var P3e=X((T5r,O3e)=>{"use strict";function k3e(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function R3e(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?k3e(Object(r),!0).forEach(function(n){odt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):k3e(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function odt(t,e,r){return e=N3e(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function sdt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function M3e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,N3e(n.key),n)}}function adt(t,e,r){return e&&M3e(t.prototype,e),r&&M3e(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function N3e(t){var e=cdt(t,"string");return typeof e=="symbol"?e:String(e)}function cdt(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var ldt=w4(),ZN=ldt.Buffer,udt=wG(),vG=udt.inspect,fdt=vG&&vG.custom||"inspect";function hdt(t,e,r){ZN.prototype.copy.call(t,e,r)}O3e.exports=function(){function t(){sdt(this,t),this.head=null,this.tail=null,this.length=0}return adt(t,[{key:"push",value:function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i}},{key:"concat",value:function(r){if(this.length===0)return ZN.alloc(0);for(var n=ZN.allocUnsafe(r>>>0),i=this.head,o=0;i;)hdt(i.data,n,o),o+=i.data.length,i=i.next;return n}},{key:"consume",value:function(r,n){var i;return r<this.head.data.length?(i=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?i=this.shift():i=n?this._getString(r):this._getBuffer(r),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var n=this.head,i=1,o=n.data;for(r-=o.length;n=n.next;){var s=n.data,a=r>s.length?s.length:r;if(a===s.length?o+=s:o+=s.slice(0,r),r-=a,r===0){a===s.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=s.slice(a));break}++i}return this.length-=i,o}},{key:"_getBuffer",value:function(r){var n=ZN.allocUnsafe(r),i=this.head,o=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var s=i.data,a=r>s.length?s.length:r;if(s.copy(n,n.length-r,0,a),r-=a,r===0){a===s.length?(++o,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=s.slice(a));break}++o}return this.length-=o,n}},{key:fdt,value:function(r,n){return vG(this,R3e(R3e({},n),{},{depth:0,customInspect:!1}))}}]),t}()});var bG=X((k5r,D3e)=>{"use strict";function ddt(t,e){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(yG,this,t)):process.nextTick(yG,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(o){!e&&o?r._writableState?r._writableState.errorEmitted?process.nextTick(YN,r):(r._writableState.errorEmitted=!0,process.nextTick(B3e,r,o)):process.nextTick(B3e,r,o):e?(process.nextTick(YN,r),e(o)):process.nextTick(YN,r)}),this)}function B3e(t,e){yG(t,e),YN(t)}function YN(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function pdt(){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 yG(t,e){t.emit("error",e)}function mdt(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}D3e.exports={destroy:ddt,undestroy:pdt,errorOrDestroy:mdt}});var G3=X((R5r,j3e)=>{"use strict";function gdt(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var U3e={};function Xu(t,e,r){r||(r=Error);function n(o,s,a){return typeof e=="string"?e:e(o,s,a)}var i=function(o){gdt(s,o);function s(a,l,u){return o.call(this,n(a,l,u))||this}return s}(r);i.prototype.name=r.name,i.prototype.code=t,U3e[t]=i}function L3e(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map(function(n){return String(n)}),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:r===2?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}else return"of ".concat(e," ").concat(String(t))}function wdt(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function vdt(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function ydt(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}Xu("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);Xu("ERR_INVALID_ARG_TYPE",function(t,e,r){var n;typeof e=="string"&&wdt(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";var i;if(vdt(t," argument"))i="The ".concat(t," ").concat(n," ").concat(L3e(e,"type"));else{var o=ydt(t,".")?"property":"argument";i='The "'.concat(t,'" ').concat(o," ").concat(n," ").concat(L3e(e,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);Xu("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Xu("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});Xu("ERR_STREAM_PREMATURE_CLOSE","Premature close");Xu("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});Xu("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Xu("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Xu("ERR_STREAM_WRITE_AFTER_END","write after end");Xu("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Xu("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);Xu("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");j3e.exports.codes=U3e});var xG=X((M5r,F3e)=>{"use strict";var bdt=G3().codes.ERR_INVALID_OPT_VALUE;function xdt(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function Edt(t,e,r,n){var i=xdt(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var o=n?r:"highWaterMark";throw new bdt(o,i)}return Math.floor(i)}return t.objectMode?16:16*1024}F3e.exports={getHighWaterMark:Edt}});var ef=X((N5r,EG)=>{typeof Object.create=="function"?EG.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:EG.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}}});var q3e=X((O5r,$3e)=>{$3e.exports=Cdt;function Cdt(t,e){if(CG("noDeprecation"))return t;var r=!1;function n(){if(!r){if(CG("throwDeprecation"))throw new Error(e);CG("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}return n}function CG(t){try{if(!global.localStorage)return!1}catch{return!1}var e=global.localStorage[t];return e==null?!1:String(e).toLowerCase()==="true"}});var _G=X((P5r,G3e)=>{"use strict";G3e.exports=ko;function z3e(t){var e=this;this.next=null,this.entry=null,this.finish=function(){Zdt(e,t)}}var v4;ko.WritableState=p9;var Adt={deprecate:q3e()},W3e=sG(),XN=w4().Buffer,Sdt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function _dt(t){return XN.from(t)}function Idt(t){return XN.isBuffer(t)||t instanceof Sdt}var SG=bG(),Tdt=xG(),kdt=Tdt.getHighWaterMark,Fg=G3().codes,Rdt=Fg.ERR_INVALID_ARG_TYPE,Mdt=Fg.ERR_METHOD_NOT_IMPLEMENTED,Ndt=Fg.ERR_MULTIPLE_CALLBACK,Odt=Fg.ERR_STREAM_CANNOT_PIPE,Pdt=Fg.ERR_STREAM_DESTROYED,Bdt=Fg.ERR_STREAM_NULL_VALUES,Ddt=Fg.ERR_STREAM_WRITE_AFTER_END,Ldt=Fg.ERR_UNKNOWN_ENCODING,y4=SG.errorOrDestroy;ef()(ko,W3e);function Udt(){}function p9(t,e,r){v4=v4||Q3(),t=t||{},typeof r!="boolean"&&(r=e instanceof v4),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=kdt(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=t.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){Wdt(e,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new z3e(this)}p9.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(p9.prototype,"buffer",{get:Adt.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var JN;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(JN=Function.prototype[Symbol.hasInstance],Object.defineProperty(ko,Symbol.hasInstance,{value:function(e){return JN.call(this,e)?!0:this!==ko?!1:e&&e._writableState instanceof p9}})):JN=function(e){return e instanceof this};function ko(t){v4=v4||Q3();var e=this instanceof v4;if(!e&&!JN.call(ko,this))return new ko(t);this._writableState=new p9(t,this,e),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),W3e.call(this)}ko.prototype.pipe=function(){y4(this,new Odt)};function jdt(t,e){var r=new Ddt;y4(t,r),process.nextTick(e,r)}function Fdt(t,e,r,n){var i;return r===null?i=new Bdt:typeof r!="string"&&!e.objectMode&&(i=new Rdt("chunk",["string","Buffer"],r)),i?(y4(t,i),process.nextTick(n,i),!1):!0}ko.prototype.write=function(t,e,r){var n=this._writableState,i=!1,o=!n.objectMode&&Idt(t);return o&&!XN.isBuffer(t)&&(t=_dt(t)),typeof e=="function"&&(r=e,e=null),o?e="buffer":e||(e=n.defaultEncoding),typeof r!="function"&&(r=Udt),n.ending?jdt(this,r):(o||Fdt(this,n,t,r))&&(n.pendingcb++,i=qdt(this,n,o,t,e,r)),i};ko.prototype.cork=function(){this._writableState.corked++};ko.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&V3e(this,t))};ko.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new Ldt(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(ko.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function $dt(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=XN.from(e,r)),e}Object.defineProperty(ko.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function qdt(t,e,r,n,i,o){if(!r){var s=$dt(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var l=e.length<e.highWaterMark;if(l||(e.needDrain=!0),e.writing||e.corked){var u=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},u?u.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else AG(t,e,!1,a,n,i,o);return l}function AG(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new Pdt("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function Hdt(t,e,r,n,i){--e.pendingcb,r?(process.nextTick(i,n),process.nextTick(d9,t,e),t._writableState.errorEmitted=!0,y4(t,n)):(i(n),t._writableState.errorEmitted=!0,y4(t,n),d9(t,e))}function zdt(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function Wdt(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new Ndt;if(zdt(r),e)Hdt(t,r,n,e,i);else{var o=K3e(r)||t.destroyed;!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&V3e(t,r),n?process.nextTick(H3e,t,r,o,i):H3e(t,r,o,i)}}function H3e(t,e,r,n){r||Vdt(t,e),e.pendingcb--,n(),d9(t,e)}function Vdt(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function V3e(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var s=0,a=!0;r;)i[s]=r,r.isBuf||(a=!1),r=r.next,s+=1;i.allBuffers=a,AG(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new z3e(e),e.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,u=r.encoding,d=r.callback,p=e.objectMode?1:l.length;if(AG(t,e,!1,p,l,u,d),r=r.next,e.bufferedRequestCount--,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}ko.prototype._write=function(t,e,r){r(new Mdt("_write()"))};ko.prototype._writev=null;ko.prototype.end=function(t,e,r){var n=this._writableState;return typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),t!=null&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||Qdt(this,n,r),this};Object.defineProperty(ko.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function K3e(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function Kdt(t,e){t._final(function(r){e.pendingcb--,r&&y4(t,r),e.prefinished=!0,t.emit("prefinish"),d9(t,e)})}function Gdt(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(Kdt,t,e)):(e.prefinished=!0,t.emit("prefinish")))}function d9(t,e){var r=K3e(e);if(r&&(Gdt(t,e),e.pendingcb===0&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}function Qdt(t,e,r){e.ending=!0,d9(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}function Zdt(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}Object.defineProperty(ko.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});ko.prototype.destroy=SG.destroy;ko.prototype._undestroy=SG.undestroy;ko.prototype._destroy=function(t,e){e(t)}});var Q3=X((B5r,Z3e)=>{"use strict";var Ydt=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};Z3e.exports=qd;var Q3e=kG(),TG=_G();ef()(qd,Q3e);for(IG=Ydt(TG.prototype),eO=0;eO<IG.length;eO++)tO=IG[eO],qd.prototype[tO]||(qd.prototype[tO]=TG.prototype[tO]);var IG,tO,eO;function qd(t){if(!(this instanceof qd))return new qd(t);Q3e.call(this,t),TG.call(this,t),this.allowHalfOpen=!0,t&&(t.readable===!1&&(this.readable=!1),t.writable===!1&&(this.writable=!1),t.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",Jdt)))}Object.defineProperty(qd.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(qd.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(qd.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function Jdt(){this._writableState.ended||process.nextTick(Xdt,this)}function Xdt(t){t.end()}Object.defineProperty(qd.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})});var wm=X((RG,J3e)=>{var rO=w4(),Hd=rO.Buffer;function Y3e(t,e){for(var r in t)e[r]=t[r]}Hd.from&&Hd.alloc&&Hd.allocUnsafe&&Hd.allocUnsafeSlow?J3e.exports=rO:(Y3e(rO,RG),RG.Buffer=Z3);function Z3(t,e,r){return Hd(t,e,r)}Z3.prototype=Object.create(Hd.prototype);Y3e(Hd,Z3);Z3.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Hd(t,e,r)};Z3.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=Hd(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};Z3.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Hd(t)};Z3.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return rO.SlowBuffer(t)}});var OG=X(eve=>{"use strict";var NG=wm().Buffer,X3e=NG.isEncoding||function(t){switch(t=""+t,t&&t.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 e0t(t){if(!t)return"utf8";for(var e;;)switch(t){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 t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function t0t(t){var e=e0t(t);if(typeof e!="string"&&(NG.isEncoding===X3e||!X3e(t)))throw new Error("Unknown encoding: "+t);return e||t}eve.StringDecoder=m9;function m9(t){this.encoding=t0t(t);var e;switch(this.encoding){case"utf16le":this.text=a0t,this.end=c0t,e=4;break;case"utf8":this.fillLast=i0t,e=4;break;case"base64":this.text=l0t,this.end=u0t,e=3;break;default:this.write=f0t,this.end=h0t;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=NG.allocUnsafe(e)}m9.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};m9.prototype.end=s0t;m9.prototype.text=o0t;m9.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function MG(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function r0t(t,e,r){var n=e.length-1;if(n<r)return 0;var i=MG(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||i===-2?0:(i=MG(e[n]),i>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||i===-2?0:(i=MG(e[n]),i>=0?(i>0&&(i===2?i=0:t.lastNeed=i-3),i):0))}function n0t(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function i0t(t){var e=this.lastTotal-this.lastNeed,r=n0t(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function o0t(t,e){var r=r0t(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}function s0t(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function a0t(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c0t(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function l0t(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function u0t(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function f0t(t){return t.toString(this.encoding)}function h0t(t){return t&&t.length?this.write(t):""}});var nO=X((L5r,nve)=>{"use strict";var tve=G3().codes.ERR_STREAM_PREMATURE_CLOSE;function d0t(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}function p0t(){}function m0t(t){return t.setHeader&&typeof t.abort=="function"}function rve(t,e,r){if(typeof e=="function")return rve(t,null,e);e||(e={}),r=d0t(r||p0t);var n=e.readable||e.readable!==!1&&t.readable,i=e.writable||e.writable!==!1&&t.writable,o=function(){t.writable||a()},s=t._writableState&&t._writableState.finished,a=function(){i=!1,s=!0,n||r.call(t)},l=t._readableState&&t._readableState.endEmitted,u=function(){n=!1,l=!0,i||r.call(t)},d=function(S){r.call(t,S)},p=function(){var S;if(n&&!l)return(!t._readableState||!t._readableState.ended)&&(S=new tve),r.call(t,S);if(i&&!s)return(!t._writableState||!t._writableState.ended)&&(S=new tve),r.call(t,S)},v=function(){t.req.on("finish",a)};return m0t(t)?(t.on("complete",a),t.on("abort",p),t.req?v():t.on("request",v)):i&&!t._writableState&&(t.on("end",o),t.on("close",o)),t.on("end",u),t.on("finish",a),e.error!==!1&&t.on("error",d),t.on("close",p),function(){t.removeListener("complete",a),t.removeListener("abort",p),t.removeListener("request",v),t.req&&t.req.removeListener("finish",a),t.removeListener("end",o),t.removeListener("close",o),t.removeListener("finish",a),t.removeListener("end",u),t.removeListener("error",d),t.removeListener("close",p)}}nve.exports=rve});var ove=X((U5r,ive)=>{"use strict";var iO;function $g(t,e,r){return e=g0t(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function g0t(t){var e=w0t(t,"string");return typeof e=="symbol"?e:String(e)}function w0t(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var v0t=nO(),qg=Symbol("lastResolve"),Y3=Symbol("lastReject"),g9=Symbol("error"),oO=Symbol("ended"),J3=Symbol("lastPromise"),PG=Symbol("handlePromise"),X3=Symbol("stream");function Hg(t,e){return{value:t,done:e}}function y0t(t){var e=t[qg];if(e!==null){var r=t[X3].read();r!==null&&(t[J3]=null,t[qg]=null,t[Y3]=null,e(Hg(r,!1)))}}function b0t(t){process.nextTick(y0t,t)}function x0t(t,e){return function(r,n){t.then(function(){if(e[oO]){r(Hg(void 0,!0));return}e[PG](r,n)},n)}}var E0t=Object.getPrototypeOf(function(){}),C0t=Object.setPrototypeOf((iO={get stream(){return this[X3]},next:function(){var e=this,r=this[g9];if(r!==null)return Promise.reject(r);if(this[oO])return Promise.resolve(Hg(void 0,!0));if(this[X3].destroyed)return new Promise(function(s,a){process.nextTick(function(){e[g9]?a(e[g9]):s(Hg(void 0,!0))})});var n=this[J3],i;if(n)i=new Promise(x0t(n,this));else{var o=this[X3].read();if(o!==null)return Promise.resolve(Hg(o,!1));i=new Promise(this[PG])}return this[J3]=i,i}},$g(iO,Symbol.asyncIterator,function(){return this}),$g(iO,"return",function(){var e=this;return new Promise(function(r,n){e[X3].destroy(null,function(i){if(i){n(i);return}r(Hg(void 0,!0))})})}),iO),E0t),A0t=function(e){var r,n=Object.create(C0t,(r={},$g(r,X3,{value:e,writable:!0}),$g(r,qg,{value:null,writable:!0}),$g(r,Y3,{value:null,writable:!0}),$g(r,g9,{value:null,writable:!0}),$g(r,oO,{value:e._readableState.endEmitted,writable:!0}),$g(r,PG,{value:function(o,s){var a=n[X3].read();a?(n[J3]=null,n[qg]=null,n[Y3]=null,o(Hg(a,!1))):(n[qg]=o,n[Y3]=s)},writable:!0}),r));return n[J3]=null,v0t(e,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=n[Y3];o!==null&&(n[J3]=null,n[qg]=null,n[Y3]=null,o(i)),n[g9]=i;return}var s=n[qg];s!==null&&(n[J3]=null,n[qg]=null,n[Y3]=null,s(Hg(void 0,!0))),n[oO]=!0}),e.on("readable",b0t.bind(null,n)),n};ive.exports=A0t});var ave=X((j5r,sve)=>{sve.exports=function(){throw new Error("Readable.from is not available in the browser")}});var kG=X(($5r,wve)=>{"use strict";wve.exports=Yn;var b4;Yn.ReadableState=fve;var F5r=jd().EventEmitter,uve=function(e,r){return e.listeners(r).length},v9=sG(),sO=w4().Buffer,S0t=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function _0t(t){return sO.from(t)}function I0t(t){return sO.isBuffer(t)||t instanceof S0t}var BG=wG(),gn;BG&&BG.debuglog?gn=BG.debuglog("stream"):gn=function(){};var T0t=P3e(),qG=bG(),k0t=xG(),R0t=k0t.getHighWaterMark,aO=G3().codes,M0t=aO.ERR_INVALID_ARG_TYPE,N0t=aO.ERR_STREAM_PUSH_AFTER_EOF,O0t=aO.ERR_METHOD_NOT_IMPLEMENTED,P0t=aO.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,x4,DG,LG;ef()(Yn,v9);var w9=qG.errorOrDestroy,UG=["error","close","destroy","pause","resume"];function B0t(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}function fve(t,e,r){b4=b4||Q3(),t=t||{},typeof r!="boolean"&&(r=e instanceof b4),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=R0t(this,t,"readableHighWaterMark",r),this.buffer=new T0t,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=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(x4||(x4=OG().StringDecoder),this.decoder=new x4(t.encoding),this.encoding=t.encoding)}function Yn(t){if(b4=b4||Q3(),!(this instanceof Yn))return new Yn(t);var e=this instanceof b4;this._readableState=new fve(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),v9.call(this)}Object.defineProperty(Yn.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});Yn.prototype.destroy=qG.destroy;Yn.prototype._undestroy=qG.undestroy;Yn.prototype._destroy=function(t,e){e(t)};Yn.prototype.push=function(t,e){var r=this._readableState,n;return r.objectMode?n=!0:typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=sO.from(t,e),e=""),n=!0),hve(this,t,e,!1,n)};Yn.prototype.unshift=function(t){return hve(this,t,null,!0,!1)};function hve(t,e,r,n,i){gn("readableAddChunk",e);var o=t._readableState;if(e===null)o.reading=!1,U0t(t,o);else{var s;if(i||(s=D0t(o,e)),s)w9(t,s);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==sO.prototype&&(e=_0t(e)),n)o.endEmitted?w9(t,new P0t):jG(t,o,e,!0);else if(o.ended)w9(t,new N0t);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||e.length!==0?jG(t,o,e,!1):$G(t,o)):jG(t,o,e,!1)}else n||(o.reading=!1,$G(t,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function jG(t,e,r,n){e.flowing&&e.length===0&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&cO(t)),$G(t,e)}function D0t(t,e){var r;return!I0t(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new M0t("chunk",["string","Buffer","Uint8Array"],e)),r}Yn.prototype.isPaused=function(){return this._readableState.flowing===!1};Yn.prototype.setEncoding=function(t){x4||(x4=OG().StringDecoder);var e=new x4(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var cve=1073741824;function L0t(t){return t>=cve?t=cve:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function lve(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=L0t(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}Yn.prototype.read=function(t){gn("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return gn("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?FG(this):cO(this),null;if(t=lve(t,e),t===0&&e.ended)return e.length===0&&FG(this),null;var n=e.needReadable;gn("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,gn("length less than watermark",n)),e.ended||e.reading?(n=!1,gn("reading or ended",n)):n&&(gn("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=lve(r,e)));var i;return t>0?i=mve(t,e):i=null,i===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&FG(this)),i!==null&&this.emit("data",i),i};function U0t(t,e){if(gn("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?cO(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,dve(t)))}}function cO(t){var e=t._readableState;gn("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(gn("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(dve,t))}function dve(t){var e=t._readableState;gn("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,HG(t)}function $G(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(j0t,t,e))}function j0t(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var r=e.length;if(gn("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}Yn.prototype._read=function(t){w9(this,new O0t("_read()"))};Yn.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t);break}n.pipesCount+=1,gn("pipe count=%d opts=%j",n.pipesCount,e);var i=(!e||e.end!==!1)&&t!==process.stdout&&t!==process.stderr,o=i?a:R;n.endEmitted?process.nextTick(o):r.once("end",o),t.on("unpipe",s);function s(O,k){gn("onunpipe"),O===r&&k&&k.hasUnpiped===!1&&(k.hasUnpiped=!0,d())}function a(){gn("onend"),t.end()}var l=F0t(r);t.on("drain",l);var u=!1;function d(){gn("cleanup"),t.removeListener("close",y),t.removeListener("finish",S),t.removeListener("drain",l),t.removeListener("error",v),t.removeListener("unpipe",s),r.removeListener("end",a),r.removeListener("end",R),r.removeListener("data",p),u=!0,n.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&l()}r.on("data",p);function p(O){gn("ondata");var k=t.write(O);gn("dest.write",k),k===!1&&((n.pipesCount===1&&n.pipes===t||n.pipesCount>1&&gve(n.pipes,t)!==-1)&&!u&&(gn("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function v(O){gn("onerror",O),R(),t.removeListener("error",v),uve(t,"error")===0&&w9(t,O)}B0t(t,"error",v);function y(){t.removeListener("finish",S),R()}t.once("close",y);function S(){gn("onfinish"),t.removeListener("close",y),R()}t.once("finish",S);function R(){gn("unpipe"),r.unpipe(t)}return t.emit("pipe",r),n.flowing||(gn("pipe resume"),r.resume()),t};function F0t(t){return function(){var r=t._readableState;gn("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&uve(t,"data")&&(r.flowing=!0,HG(t))}}Yn.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=gve(e.pipes,t);return s===-1?this:(e.pipes.splice(s,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)};Yn.prototype.on=function(t,e){var r=v9.prototype.on.call(this,t,e),n=this._readableState;return t==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,gn("on readable",n.length,n.reading),n.length?cO(this):n.reading||process.nextTick($0t,this)),r};Yn.prototype.addListener=Yn.prototype.on;Yn.prototype.removeListener=function(t,e){var r=v9.prototype.removeListener.call(this,t,e);return t==="readable"&&process.nextTick(pve,this),r};Yn.prototype.removeAllListeners=function(t){var e=v9.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&process.nextTick(pve,this),e};function pve(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function $0t(t){gn("readable nexttick read 0"),t.read(0)}Yn.prototype.resume=function(){var t=this._readableState;return t.flowing||(gn("resume"),t.flowing=!t.readableListening,q0t(this,t)),t.paused=!1,this};function q0t(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(H0t,t,e))}function H0t(t,e){gn("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),HG(t),e.flowing&&!e.reading&&t.read(0)}Yn.prototype.pause=function(){return gn("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(gn("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function HG(t){var e=t._readableState;for(gn("flow",e.flowing);e.flowing&&t.read()!==null;);}Yn.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;t.on("end",function(){if(gn("wrapped end"),r.decoder&&!r.ended){var s=r.decoder.end();s&&s.length&&e.push(s)}e.push(null)}),t.on("data",function(s){if(gn("wrapped data"),r.decoder&&(s=r.decoder.write(s)),!(r.objectMode&&s==null)&&!(!r.objectMode&&(!s||!s.length))){var a=e.push(s);a||(n=!0,t.pause())}});for(var i in t)this[i]===void 0&&typeof t[i]=="function"&&(this[i]=function(a){return function(){return t[a].apply(t,arguments)}}(i));for(var o=0;o<UG.length;o++)t.on(UG[o],this.emit.bind(this,UG[o]));return this._read=function(s){gn("wrapped _read",s),n&&(n=!1,t.resume())},this};typeof Symbol=="function"&&(Yn.prototype[Symbol.asyncIterator]=function(){return DG===void 0&&(DG=ove()),DG(this)});Object.defineProperty(Yn.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(Yn.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(Yn.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}});Yn._fromList=mve;Object.defineProperty(Yn.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function mve(t,e){if(e.length===0)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function FG(t){var e=t._readableState;gn("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(z0t,e,t))}function z0t(t,e){if(gn("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}typeof Symbol=="function"&&(Yn.from=function(t,e){return LG===void 0&&(LG=ave()),LG(Yn,t,e)});function gve(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}});var zG=X((q5r,yve)=>{"use strict";yve.exports=vm;var lO=G3().codes,W0t=lO.ERR_METHOD_NOT_IMPLEMENTED,V0t=lO.ERR_MULTIPLE_CALLBACK,K0t=lO.ERR_TRANSFORM_ALREADY_TRANSFORMING,G0t=lO.ERR_TRANSFORM_WITH_LENGTH_0,uO=Q3();ef()(vm,uO);function Q0t(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new V0t);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function vm(t){if(!(this instanceof vm))return new vm(t);uO.call(this,t),this._transformState={afterTransform:Q0t.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",Z0t)}function Z0t(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){vve(t,e,r)}):vve(this,null,null)}vm.prototype.push=function(t,e){return this._transformState.needTransform=!1,uO.prototype.push.call(this,t,e)};vm.prototype._transform=function(t,e,r){r(new W0t("_transform()"))};vm.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};vm.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};vm.prototype._destroy=function(t,e){uO.prototype._destroy.call(this,t,function(r){e(r)})};function vve(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new G0t;if(t._transformState.transforming)throw new K0t;return t.push(null)}});var Eve=X((H5r,xve)=>{"use strict";xve.exports=y9;var bve=zG();ef()(y9,bve);function y9(t){if(!(this instanceof y9))return new y9(t);bve.call(this,t)}y9.prototype._transform=function(t,e,r){r(null,t)}});var Ive=X((z5r,_ve)=>{"use strict";var WG;function Y0t(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var Sve=G3().codes,J0t=Sve.ERR_MISSING_ARGS,X0t=Sve.ERR_STREAM_DESTROYED;function Cve(t){if(t)throw t}function ept(t){return t.setHeader&&typeof t.abort=="function"}function tpt(t,e,r,n){n=Y0t(n);var i=!1;t.on("close",function(){i=!0}),WG===void 0&&(WG=nO()),WG(t,{readable:e,writable:r},function(s){if(s)return n(s);i=!0,n()});var o=!1;return function(s){if(!i&&!o){if(o=!0,ept(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();n(s||new X0t("pipe"))}}}function Ave(t){t()}function rpt(t,e){return t.pipe(e)}function npt(t){return!t.length||typeof t[t.length-1]!="function"?Cve:t.pop()}function ipt(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=npt(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new J0t("streams");var i,o=e.map(function(s,a){var l=a<e.length-1,u=a>0;return tpt(s,l,u,function(d){i||(i=d),d&&o.forEach(Ave),!l&&(o.forEach(Ave),n(i))})});return e.reduce(rpt)}_ve.exports=ipt});var VG=X((tf,Tve)=>{tf=Tve.exports=kG();tf.Stream=tf;tf.Readable=tf;tf.Writable=_G();tf.Duplex=Q3();tf.Transform=zG();tf.PassThrough=Eve();tf.finished=nO();tf.pipeline=Ive()});var Mve=X((W5r,Rve)=>{var{Transform:opt}=VG();Rve.exports=t=>class kve extends opt{constructor(r,n,i,o,s){super(s),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._hashBitLength=o,this._options=s,this._state=new t,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let o=null;try{this.update(r,n)}catch(s){o=s}i(o)}_flush(r){let n=null;try{this.push(this.digest())}catch(i){n=i}r(n)}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}digest(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let n=this._state.squeeze(this._hashBitLength/8);return r!==void 0&&(n=n.toString(r)),this._resetState(),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){let r=new kve(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}}});var Pve=X((V5r,Ove)=>{var{Transform:spt}=VG();Ove.exports=t=>class Nve extends spt{constructor(r,n,i,o){super(o),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._options=o,this._state=new t,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let o=null;try{this.update(r,n)}catch(s){o=s}i(o)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}squeeze(r,n){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let i=this._state.squeeze(r);return n!==void 0&&(i=i.toString(n)),i}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){let r=new Nve(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}}});var Dve=X((K5r,Bve)=>{var apt=Mve(),cpt=Pve();Bve.exports=function(t){let e=apt(t),r=cpt(t);return function(n,i){switch(typeof n=="string"?n.toLowerCase():n){case"keccak224":return new e(1152,448,null,224,i);case"keccak256":return new e(1088,512,null,256,i);case"keccak384":return new e(832,768,null,384,i);case"keccak512":return new e(576,1024,null,512,i);case"sha3-224":return new e(1152,448,6,224,i);case"sha3-256":return new e(1088,512,6,256,i);case"sha3-384":return new e(832,768,6,384,i);case"sha3-512":return new e(576,1024,6,512,i);case"shake128":return new r(1344,256,31,i);case"shake256":return new r(1088,512,31,i);default:throw new Error("Invald algorithm: "+n)}}}});var jve=X(Uve=>{var Lve=[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];Uve.p1600=function(t){for(let e=0;e<24;++e){let r=t[0]^t[10]^t[20]^t[30]^t[40],n=t[1]^t[11]^t[21]^t[31]^t[41],i=t[2]^t[12]^t[22]^t[32]^t[42],o=t[3]^t[13]^t[23]^t[33]^t[43],s=t[4]^t[14]^t[24]^t[34]^t[44],a=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],u=t[7]^t[17]^t[27]^t[37]^t[47],d=t[8]^t[18]^t[28]^t[38]^t[48],p=t[9]^t[19]^t[29]^t[39]^t[49],v=d^(i<<1|o>>>31),y=p^(o<<1|i>>>31),S=t[0]^v,R=t[1]^y,O=t[10]^v,k=t[11]^y,M=t[20]^v,D=t[21]^y,j=t[30]^v,q=t[31]^y,W=t[40]^v,V=t[41]^y;v=r^(s<<1|a>>>31),y=n^(a<<1|s>>>31);let P=t[2]^v,$=t[3]^y,U=t[12]^v,L=t[13]^y,z=t[22]^v,f=t[23]^y,h=t[32]^v,m=t[33]^y,b=t[42]^v,C=t[43]^y;v=i^(l<<1|u>>>31),y=o^(u<<1|l>>>31);let T=t[4]^v,N=t[5]^y,I=t[14]^v,g=t[15]^y,x=t[24]^v,Q=t[25]^y,re=t[34]^v,A=t[35]^y,G=t[44]^v,Z=t[45]^y;v=s^(d<<1|p>>>31),y=a^(p<<1|d>>>31);let Y=t[6]^v,ue=t[7]^y,fe=t[16]^v,ae=t[17]^y,me=t[26]^v,Ce=t[27]^y,le=t[36]^v,Se=t[37]^y,gt=t[46]^v,Qe=t[47]^y;v=l^(r<<1|n>>>31),y=u^(n<<1|r>>>31);let ur=t[8]^v,mt=t[9]^y,qe=t[18]^v,Vt=t[19]^y,wt=t[28]^v,nt=t[29]^y,er=t[38]^v,de=t[39]^y,ge=t[48]^v,be=t[49]^y,ye=S,_e=R,ft=k<<4|O>>>28,Ve=O<<4|k>>>28,Le=M<<3|D>>>29,Ut=D<<3|M>>>29,Xe=q<<9|j>>>23,ze=j<<9|q>>>23,hr=W<<18|V>>>14,bt=V<<18|W>>>14,tt=P<<1|$>>>31,Er=$<<1|P>>>31,Et=L<<12|U>>>20,st=U<<12|L>>>20,vr=z<<10|f>>>22,St=f<<10|z>>>22,at=m<<13|h>>>19,Cr=h<<13|m>>>19,_t=b<<2|C>>>30,it=C<<2|b>>>30,Ar=N<<30|T>>>2,Ct=T<<30|N>>>2,Ke=I<<6|g>>>26,ar=g<<6|I>>>26,At=Q<<11|x>>>21,ot=x<<11|Q>>>21,kr=re<<15|A>>>17,kt=A<<15|re>>>17,lt=Z<<29|G>>>3,Rr=G<<29|Z>>>3,Rt=Y<<28|ue>>>4,ut=ue<<28|Y>>>4,Mr=ae<<23|fe>>>9,Mt=fe<<23|ae>>>9,ct=me<<25|Ce>>>7,yr=Ce<<25|me>>>7,An=le<<21|Se>>>11,Sn=Se<<21|le>>>11,_n=Qe<<24|gt>>>8,In=gt<<24|Qe>>>8,Tn=ur<<27|mt>>>5,Gi=mt<<27|ur>>>5,$o=qe<<20|Vt>>>12,Qi=Vt<<20|qe>>>12,qo=nt<<7|wt>>>25,Ho=wt<<7|nt>>>25,zo=er<<8|de>>>24,Co=de<<8|er>>>24,Ao=ge<<14|be>>>18,So=be<<14|ge>>>18;t[0]=ye^~Et&At,t[1]=_e^~st&ot,t[10]=Rt^~$o&Le,t[11]=ut^~Qi&Ut,t[20]=tt^~Ke&ct,t[21]=Er^~ar&yr,t[30]=Tn^~ft&vr,t[31]=Gi^~Ve&St,t[40]=Ar^~Mr&qo,t[41]=Ct^~Mt&Ho,t[2]=Et^~At&An,t[3]=st^~ot&Sn,t[12]=$o^~Le&at,t[13]=Qi^~Ut&Cr,t[22]=Ke^~ct&zo,t[23]=ar^~yr&Co,t[32]=ft^~vr&kr,t[33]=Ve^~St&kt,t[42]=Mr^~qo&Xe,t[43]=Mt^~Ho&ze,t[4]=At^~An&Ao,t[5]=ot^~Sn&So,t[14]=Le^~at<,t[15]=Ut^~Cr&Rr,t[24]=ct^~zo&hr,t[25]=yr^~Co&bt,t[34]=vr^~kr&_n,t[35]=St^~kt&In,t[44]=qo^~Xe&_t,t[45]=Ho^~ze&it,t[6]=An^~Ao&ye,t[7]=Sn^~So&_e,t[16]=at^~lt&Rt,t[17]=Cr^~Rr&ut,t[26]=zo^~hr&tt,t[27]=Co^~bt&Er,t[36]=kr^~_n&Tn,t[37]=kt^~In&Gi,t[46]=Xe^~_t&Ar,t[47]=ze^~it&Ct,t[8]=Ao^~ye&Et,t[9]=So^~_e&st,t[18]=lt^~Rt&$o,t[19]=Rr^~ut&Qi,t[28]=hr^~tt&Ke,t[29]=bt^~Er&ar,t[38]=_n^~Tn&ft,t[39]=In^~Gi&Ve,t[48]=_t^~Ar&Mr,t[49]=it^~Ct&Mt,t[0]^=Lve[e*2],t[1]^=Lve[e*2+1]}}});var $ve=X((Q5r,Fve)=>{var fO=jve();function E4(){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}E4.prototype.initialize=function(t,e){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=t/8,this.count=0,this.squeezing=!1};E4.prototype.absorb=function(t){for(let e=0;e<t.length;++e)this.state[~~(this.count/4)]^=t[e]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(fO.p1600(this.state),this.count=0)};E4.prototype.absorbLastFewBits=function(t){this.state[~~(this.count/4)]^=t<<8*(this.count%4),t&128&&this.count===this.blockSize-1&&fO.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),fO.p1600(this.state),this.count=0,this.squeezing=!0};E4.prototype.squeeze=function(t){this.squeezing||this.absorbLastFewBits(1);let e=Buffer.alloc(t);for(let r=0;r<t;++r)e[r]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(fO.p1600(this.state),this.count=0);return e};E4.prototype.copy=function(t){for(let e=0;e<50;++e)t.state[e]=this.state[e];t.blockSize=this.blockSize,t.count=this.count,t.squeezing=this.squeezing};Fve.exports=E4});var KG=X((Z5r,qve)=>{qve.exports=Dve()($ve())});var GG=X((Y5r,Gve)=>{var lpt=KG();function Hve(t){return Buffer.allocUnsafe(t).fill(0)}function upt(t){return t.toString(2).length}function zve(t,e){let r=t.toString(16);r.length%2!==0&&(r="0"+r);let n=r.match(/.{1,2}/g).map(i=>parseInt(i,16));for(;n.length<e;)n.unshift(0);return Buffer.from(n)}function fpt(t,e){let r=t<0n,n;if(r){let i=(1n<<BigInt(e))-1n;n=(~t&i)+1n}else n=t;return n&=(1n<<BigInt(e))-1n,n}function Wve(t,e,r){let n=Hve(e);return t=hO(t),r?t.length<e?(t.copy(n),n):t.slice(0,e):t.length<e?(t.copy(n,e-t.length),n):t.slice(-e)}function hpt(t,e){return Wve(t,e,!0)}function hO(t){if(!Buffer.isBuffer(t))if(Array.isArray(t))t=Buffer.from(t);else if(typeof t=="string")Vve(t)?t=Buffer.from(mpt(Kve(t)),"hex"):t=Buffer.from(t);else if(typeof t=="number")t=intToBuffer(t);else if(t==null)t=Buffer.allocUnsafe(0);else if(typeof t=="bigint")t=zve(t);else if(t.toArray)t=Buffer.from(t.toArray());else throw new Error("invalid type");return t}function dpt(t){return t=hO(t),"0x"+t.toString("hex")}function ppt(t,e){return t=hO(t),e||(e=256),lpt("keccak"+e).update(t).digest()}function mpt(t){return t.length%2?"0"+t:t}function Vve(t){return typeof t=="string"&&t.match(/^0x[0-9A-Fa-f]*$/)}function Kve(t){return typeof t=="string"&&t.startsWith("0x")?t.slice(2):t}Gve.exports={zeros:Hve,setLength:Wve,setLengthRight:hpt,isHexString:Vve,stripHexPrefix:Kve,toBuffer:hO,bufferToHex:dpt,keccak:ppt,bitLengthFromBigInt:upt,bufferBEFromBigInt:zve,twosFromBigInt:fpt}});var eye=X((J5r,Xve)=>{var xc=GG();function Zve(t){return t.startsWith("int[")?"int256"+t.slice(3):t==="int"?"int256":t.startsWith("uint[")?"uint256"+t.slice(4):t==="uint"?"uint256":t.startsWith("fixed[")?"fixed128x128"+t.slice(5):t==="fixed"?"fixed128x128":t.startsWith("ufixed[")?"ufixed128x128"+t.slice(6):t==="ufixed"?"ufixed128x128":t}function C4(t){return parseInt(/^\D+(\d+)$/.exec(t)[1],10)}function Qve(t){var e=/^\D+(\d+)x(\d+)$/.exec(t);return[parseInt(e[1],10),parseInt(e[2],10)]}function Yve(t){var e=t.match(/(.*)\[(.*?)\]$/);return e?e[2]===""?"dynamic":parseInt(e[2],10):null}function ev(t){var e=typeof t;if(e==="string"||e==="number")return BigInt(t);if(e==="bigint")return t;throw new Error("Argument is not a number")}function zd(t,e){var r,n,i,o;if(t==="address")return zd("uint160",ev(e));if(t==="bool")return zd("uint8",e?1:0);if(t==="string")return zd("bytes",new Buffer(e,"utf8"));if(wpt(t)){if(typeof e.length>"u")throw new Error("Not an array?");if(r=Yve(t),r!=="dynamic"&&r!==0&&e.length>r)throw new Error("Elements exceed array size: "+r);i=[],t=t.slice(0,t.lastIndexOf("[")),typeof e=="string"&&(e=JSON.parse(e));for(o in e)i.push(zd(t,e[o]));if(r==="dynamic"){var s=zd("uint256",e.length);i.unshift(s)}return Buffer.concat(i)}else{if(t==="bytes")return e=new Buffer(e),i=Buffer.concat([zd("uint256",e.length),e]),e.length%32!==0&&(i=Buffer.concat([i,xc.zeros(32-e.length%32)])),i;if(t.startsWith("bytes")){if(r=C4(t),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return xc.setLengthRight(e,32)}else if(t.startsWith("uint")){if(r=C4(t),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);n=ev(e);let a=xc.bitLengthFromBigInt(n);if(a>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+a);if(n<0)throw new Error("Supplied uint is negative");return xc.bufferBEFromBigInt(n,32)}else if(t.startsWith("int")){if(r=C4(t),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);n=ev(e);let a=xc.bitLengthFromBigInt(n);if(a>r)throw new Error("Supplied int exceeds width: "+r+" vs "+a);let l=xc.twosFromBigInt(n,256);return xc.bufferBEFromBigInt(l,32)}else if(t.startsWith("ufixed")){if(r=Qve(t),n=ev(e),n<0)throw new Error("Supplied ufixed is negative");return zd("uint256",n*BigInt(2)**BigInt(r[1]))}else if(t.startsWith("fixed"))return r=Qve(t),zd("int256",ev(e)*BigInt(2)**BigInt(r[1]))}throw new Error("Unsupported or invalid type: "+t)}function gpt(t){return t==="string"||t==="bytes"||Yve(t)==="dynamic"}function wpt(t){return t.lastIndexOf("]")===t.length-1}function vpt(t,e){var r=[],n=[],i=32*t.length;for(var o in t){var s=Zve(t[o]),a=e[o],l=zd(s,a);gpt(s)?(r.push(zd("uint256",i)),n.push(l),i+=l.length):r.push(l)}return Buffer.concat(r.concat(n))}function Jve(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var r,n,i=[],o=0;o<t.length;o++){var s=Zve(t[o]),a=e[o];if(s==="bytes")i.push(a);else if(s==="string")i.push(new Buffer(a,"utf8"));else if(s==="bool")i.push(new Buffer(a?"01":"00","hex"));else if(s==="address")i.push(xc.setLength(a,20));else if(s.startsWith("bytes")){if(r=C4(s),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);i.push(xc.setLengthRight(a,r))}else if(s.startsWith("uint")){if(r=C4(s),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);n=ev(a);let l=xc.bitLengthFromBigInt(n);if(l>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+l);i.push(xc.bufferBEFromBigInt(n,r/8))}else if(s.startsWith("int")){if(r=C4(s),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);n=ev(a);let l=xc.bitLengthFromBigInt(n);if(l>r)throw new Error("Supplied int exceeds width: "+r+" vs "+l);let u=xc.twosFromBigInt(n,r);i.push(xc.bufferBEFromBigInt(u,r/8))}else throw new Error("Unsupported or invalid type: "+s)}return Buffer.concat(i)}function ypt(t,e){return xc.keccak(Jve(t,e))}Xve.exports={rawEncode:vpt,solidityPack:Jve,soliditySHA3:ypt}});var nye=X((X5r,rye)=>{var ph=GG(),b9=eye(),tye={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"]},QG={encodeData(t,e,r,n=!0){let i=["bytes32"],o=[this.hashType(t,r)];if(n){let s=(a,l,u)=>{if(r[l]!==void 0)return["bytes32",u==null?"0x0000000000000000000000000000000000000000000000000000000000000000":ph.keccak(this.encodeData(l,u,r,n))];if(u===void 0)throw new Error(`missing value for field ${a} of type ${l}`);if(l==="bytes")return["bytes32",ph.keccak(u)];if(l==="string")return typeof u=="string"&&(u=Buffer.from(u,"utf8")),["bytes32",ph.keccak(u)];if(l.lastIndexOf("]")===l.length-1){let d=l.slice(0,l.lastIndexOf("[")),p=u.map(v=>s(a,d,v));return["bytes32",ph.keccak(b9.rawEncode(p.map(([v])=>v),p.map(([,v])=>v)))]}return[l,u]};for(let a of r[t]){let[l,u]=s(a.name,a.type,e[a.name]);i.push(l),o.push(u)}}else for(let s of r[t]){let a=e[s.name];if(a!==void 0)if(s.type==="bytes")i.push("bytes32"),a=ph.keccak(a),o.push(a);else if(s.type==="string")i.push("bytes32"),typeof a=="string"&&(a=Buffer.from(a,"utf8")),a=ph.keccak(a),o.push(a);else if(r[s.type]!==void 0)i.push("bytes32"),a=ph.keccak(this.encodeData(s.type,a,r,n)),o.push(a);else{if(s.type.lastIndexOf("]")===s.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(s.type),o.push(a)}}return b9.rawEncode(i,o)},encodeType(t,e){let r="",n=this.findTypeDependencies(t,e).filter(i=>i!==t);n=[t].concat(n.sort());for(let i of n){if(!e[i])throw new Error("No type definition specified: "+i);r+=i+"("+e[i].map(({name:s,type:a})=>a+" "+s).join(",")+")"}return r},findTypeDependencies(t,e,r=[]){if(t=t.match(/^\w*/)[0],r.includes(t)||e[t]===void 0)return r;r.push(t);for(let n of e[t])for(let i of this.findTypeDependencies(n.type,e,r))!r.includes(i)&&r.push(i);return r},hashStruct(t,e,r,n=!0){return ph.keccak(this.encodeData(t,e,r,n))},hashType(t,e){return ph.keccak(this.encodeType(t,e))},sanitizeData(t){let e={};for(let r in tye.properties)t[r]&&(e[r]=t[r]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash(t,e=!0){let r=this.sanitizeData(t),n=[Buffer.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,e)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,e)),ph.keccak(Buffer.concat(n))}};rye.exports={TYPED_MESSAGE_SCHEMA:tye,TypedDataUtils:QG,hashForSignTypedDataLegacy:function(t){return bpt(t.data)},hashForSignTypedData_v3:function(t){return QG.hash(t.data,!1)},hashForSignTypedData_v4:function(t){return QG.hash(t.data)}};function bpt(t){let e=new Error("Expect argument to be non-empty array");if(typeof t!="object"||!t.length)throw e;let r=t.map(function(o){return o.type==="bytes"?ph.toBuffer(o.value):o.value}),n=t.map(function(o){return o.type}),i=t.map(function(o){if(!o.name)throw e;return o.type+" "+o.name});return b9.soliditySHA3(["bytes32","bytes32"],[b9.soliditySHA3(new Array(t.length).fill("string"),i),b9.soliditySHA3(n,r)])}});var dO=X(zg=>{"use strict";Object.defineProperty(zg,"__esModule",{value:!0});zg.APP_VERSION_KEY=zg.LOCAL_STORAGE_ADDRESSES_KEY=zg.WALLET_USER_NAME_KEY=void 0;zg.WALLET_USER_NAME_KEY="walletUsername";zg.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";zg.APP_VERSION_KEY="AppVersion"});var YG=X(pO=>{"use strict";Object.defineProperty(pO,"__esModule",{value:!0});pO.RelayEventManager=void 0;var xpt=Ud(),ZG=class{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;let e=this._nextRequestId,r=(0,xpt.prepend0x)(e.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),e}};pO.RelayEventManager=ZG});var iye=X(gO=>{"use strict";Object.defineProperty(gO,"__esModule",{value:!0});gO.WalletLinkCipher=void 0;var mO=Ud(),JG=class{constructor(e){this.secret=e}async encrypt(e){let r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");let n=crypto.getRandomValues(new Uint8Array(12)),i=await crypto.subtle.importKey("raw",(0,mO.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),o=new TextEncoder,s=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},i,o.encode(e)),a=16,l=s.slice(s.byteLength-a),u=s.slice(0,s.byteLength-a),d=new Uint8Array(l),p=new Uint8Array(u),v=new Uint8Array([...n,...d,...p]);return(0,mO.uint8ArrayToHex)(v)}async decrypt(e){let r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");return new Promise((n,i)=>{(async function(){let o=await crypto.subtle.importKey("raw",(0,mO.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=(0,mO.hexStringToUint8Array)(e),a=s.slice(0,12),l=s.slice(12,28),u=s.slice(28),d=new Uint8Array([...u,...l]),p={name:"AES-GCM",iv:new Uint8Array(a)};try{let v=await window.crypto.subtle.decrypt(p,o,d),y=new TextDecoder;n(y.decode(v))}catch(v){i(v)}})()})}};gO.WalletLinkCipher=JG});var oye=X(wO=>{"use strict";Object.defineProperty(wO,"__esModule",{value:!0});wO.WalletLinkHTTP=void 0;var XG=class{constructor(e,r,n){this.linkAPIUrl=e,this.sessionId=r;let i=`${r}:${n}`;this.auth=`Basic ${btoa(i)}`}async markUnseenEventsAsSeen(e){return Promise.all(e.map(r=>fetch(`${this.linkAPIUrl}/events/${r.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(r=>console.error("Unabled to mark event as failed:",r))}async fetchUnseenEvents(){var e;let r=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(r.ok){let{events:n,error:i}=await r.json();if(i)throw new Error(`Check unseen events failed: ${i}`);let o=(e=n?.filter(s=>s.event==="Web3Response").map(s=>({type:"Event",sessionId:this.sessionId,eventId:s.id,event:s.event,data:s.data})))!==null&&e!==void 0?e:[];return this.markUnseenEventsAsSeen(o),o}throw new Error(`Check unseen events failed: ${r.status}`)}};wO.WalletLinkHTTP=XG});var sye=X(S4=>{"use strict";Object.defineProperty(S4,"__esModule",{value:!0});S4.WalletLinkWebSocket=S4.ConnectionState=void 0;var A4;(function(t){t[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED"})(A4||(S4.ConnectionState=A4={}));var eQ=class{setConnectionStateListener(e){this.connectionStateListener=e}setIncomingDataListener(e){this.incomingDataListener=e}constructor(e,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.pendingData=[],this.url=e.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((e,r)=>{var n;let i;try{this.webSocket=i=new this.WebSocketClass(this.url)}catch(o){r(o);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,A4.CONNECTING),i.onclose=o=>{var s;this.clearWebSocket(),r(new Error(`websocket error ${o.code}: ${o.reason}`)),(s=this.connectionStateListener)===null||s===void 0||s.call(this,A4.DISCONNECTED)},i.onopen=o=>{var s;e(),(s=this.connectionStateListener)===null||s===void 0||s.call(this,A4.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(l=>this.sendData(l)),this.pendingData=[])},i.onmessage=o=>{var s,a;if(o.data==="h")(s=this.incomingDataListener)===null||s===void 0||s.call(this,{type:"Heartbeat"});else try{let l=JSON.parse(o.data);(a=this.incomingDataListener)===null||a===void 0||a.call(this,l)}catch{}}})}disconnect(){var e;let{webSocket:r}=this;if(r){this.clearWebSocket(),(e=this.connectionStateListener)===null||e===void 0||e.call(this,A4.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{r.close()}catch{}}}sendData(e){let{webSocket:r}=this;if(!r){this.pendingData.push(e),this.connect();return}r.send(e)}clearWebSocket(){let{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}};S4.WalletLinkWebSocket=eQ});var lye=X(yO=>{"use strict";Object.defineProperty(yO,"__esModule",{value:!0});yO.WalletLinkConnection=void 0;var aye=dO(),Ept=iye(),Cpt=oye(),vO=sye(),_4=DN(),cye=1e4,Apt=6e4,tQ=class{constructor({session:e,linkAPIUrl:r,listener:n,WebSocketClass:i=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,_4.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=s=>{if(!s)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",l=>s.JsonRpcUrl&&this.handleChainUpdated(l,s.JsonRpcUrl)]]).forEach((l,u)=>{let d=s[u];d!==void 0&&l(d)})},this.handleDestroyed=s=>{var a;s==="1"&&((a=this.listener)===null||a===void 0||a.resetAndReload())},this.handleAccountUpdated=async s=>{var a;{let l=await this.cipher.decrypt(s);(a=this.listener)===null||a===void 0||a.accountUpdated(l)}},this.handleMetadataUpdated=async(s,a)=>{var l;{let u=await this.cipher.decrypt(a);(l=this.listener)===null||l===void 0||l.metadataUpdated(s,u)}},this.handleWalletUsernameUpdated=async s=>{this.handleMetadataUpdated(aye.WALLET_USER_NAME_KEY,s)},this.handleAppVersionUpdated=async s=>{this.handleMetadataUpdated(aye.APP_VERSION_KEY,s)},this.handleChainUpdated=async(s,a)=>{var l;{let u=await this.cipher.decrypt(s),d=await this.cipher.decrypt(a);(l=this.listener)===null||l===void 0||l.chainUpdated(u,d)}},this.session=e,this.cipher=new Ept.WalletLinkCipher(e.secret),this.listener=n;let o=new vO.WalletLinkWebSocket(`${r}/rpc`,i);o.setConnectionStateListener(async s=>{let a=!1;switch(s){case vO.ConnectionState.DISCONNECTED:if(!this.destroyed){let l=async()=>{await new Promise(u=>setTimeout(u,5e3)),this.destroyed||o.connect().catch(()=>{l()})};l()}break;case vO.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),a=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},cye),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case vO.ConnectionState.CONNECTING:break}this.connected!==a&&(this.connected=a)}),o.setIncomingDataListener(s=>{var a;switch(s.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{let l=s.type==="IsLinkedOK"?s.linked:void 0;this.linked=l||s.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{this.handleSessionMetadataUpdated(s.metadata);break}case"Event":{this.handleIncomingEvent(s);break}}s.id!==void 0&&((a=this.requestResolutions.get(s.id))===null||a===void 0||a(s))}),this.ws=o,this.http=new Cpt.WalletLinkHTTP(r,e.id,e.key)}connect(){if(this.destroyed)throw new Error("instance is destroyed");this.ws.connect()}destroy(){this.destroyed=!0,this.ws.disconnect(),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(e){var r;this._connected=e,e&&((r=this.onceConnected)===null||r===void 0||r.call(this))}setOnceConnected(e){return new Promise(r=>{this.connected?e().then(r):this.onceConnected=()=>{e().then(r),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(e){var r,n;this._linked=e,e&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(e)}setOnceLinked(e){return new Promise(r=>{this.linked?e().then(r):this.onceLinked=()=>{e().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(e){var r;if(!(e.type!=="Event"||e.event!=="Web3Response")){let n=await this.cipher.decrypt(e.data),i=JSON.parse(n);if(i.type!=="WEB3_RESPONSE")return;(r=this.listener)===null||r===void 0||r.handleWeb3ResponseMessage(i)}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(e=>setTimeout(e,250));try{await this.fetchUnseenEventsAPI()}catch(e){console.error("Unable to check for unseen events",e)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(r=>this.handleIncomingEvent(r))}async setSessionMetadata(e,r){let n={type:"SetSessionConfig",id:(0,_4.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[e]:r}};return this.setOnceConnected(async()=>{let i=await this.makeRequest(n);if(i.type==="Fail")throw new Error(i.error||"failed to set session metadata")})}async publishEvent(e,r,n=!1){let i=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin,relaySource:"coinbaseWalletExtension"in window&&window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),o={type:"PublishEvent",id:(0,_4.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:e,data:i,callWebhook:n};return this.setOnceLinked(async()=>{let s=await this.makeRequest(o);if(s.type==="Fail")throw new Error(s.error||"failed to publish event");return s.eventId})}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>cye*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(e,r=Apt){let n=e.id;this.sendData(e);let i;return Promise.race([new Promise((o,s)=>{i=window.setTimeout(()=>{s(new Error(`request ${n} timed out`))},r)}),new Promise(o=>{this.requestResolutions.set(n,s=>{clearTimeout(i),o(s),this.requestResolutions.delete(n)})})])}async authenticate(){let e={type:"HostSession",id:(0,_4.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(e);if(r.type==="Fail")throw new Error(r.error||"failed to authenticate")}sendIsLinked(){let e={type:"IsLinked",id:(0,_4.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}sendGetSessionConfig(){let e={type:"GetSessionConfig",id:(0,_4.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}};yO.WalletLinkConnection=tQ});var tv=X((s4r,fye)=>{var uye=wm().Buffer;function bO(t,e){this._block=uye.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}bO.prototype.update=function(t,e){typeof t=="string"&&(e=e||"utf8",t=uye.from(t,e));for(var r=this._block,n=this._blockSize,i=t.length,o=this._len,s=0;s<i;){for(var a=o%n,l=Math.min(i-s,n-a),u=0;u<l;u++)r[a+u]=t[s+u];o+=l,s+=l,o%n===0&&this._update(r)}return this._len+=i,this};bO.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=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 o=this._hash();return t?o.toString(t):o};bO.prototype._update=function(){throw new Error("_update must be implemented by subclass")};fye.exports=bO});var pye=X((a4r,dye)=>{var Spt=ef(),hye=tv(),_pt=wm().Buffer,Ipt=[1518500249,1859775393,-1894007588,-899497514],Tpt=new Array(80);function x9(){this.init(),this._w=Tpt,hye.call(this,64,56)}Spt(x9,hye);x9.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function kpt(t){return t<<5|t>>>27}function Rpt(t){return t<<30|t>>>2}function Mpt(t,e,r,n){return t===0?e&r|~e&n:t===2?e&r|e&n|r&n:e^r^n}x9.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,o=this._d|0,s=this._e|0,a=0;a<16;++a)e[a]=t.readInt32BE(a*4);for(;a<80;++a)e[a]=e[a-3]^e[a-8]^e[a-14]^e[a-16];for(var l=0;l<80;++l){var u=~~(l/20),d=kpt(r)+Mpt(u,n,i,o)+s+e[l]+Ipt[u]|0;s=o,o=i,i=Rpt(n),n=r,r=d}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0};x9.prototype._hash=function(){var t=_pt.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};dye.exports=x9});var wye=X((c4r,gye)=>{var Npt=ef(),mye=tv(),Opt=wm().Buffer,Ppt=[1518500249,1859775393,-1894007588,-899497514],Bpt=new Array(80);function E9(){this.init(),this._w=Bpt,mye.call(this,64,56)}Npt(E9,mye);E9.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Dpt(t){return t<<1|t>>>31}function Lpt(t){return t<<5|t>>>27}function Upt(t){return t<<30|t>>>2}function jpt(t,e,r,n){return t===0?e&r|~e&n:t===2?e&r|e&n|r&n:e^r^n}E9.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,o=this._d|0,s=this._e|0,a=0;a<16;++a)e[a]=t.readInt32BE(a*4);for(;a<80;++a)e[a]=Dpt(e[a-3]^e[a-8]^e[a-14]^e[a-16]);for(var l=0;l<80;++l){var u=~~(l/20),d=Lpt(r)+jpt(u,n,i,o)+s+e[l]+Ppt[u]|0;s=o,o=i,i=Upt(n),n=r,r=d}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0};E9.prototype._hash=function(){var t=Opt.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};gye.exports=E9});var rQ=X((l4r,yye)=>{var Fpt=ef(),vye=tv(),$pt=wm().Buffer,qpt=[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],Hpt=new Array(64);function C9(){this.init(),this._w=Hpt,vye.call(this,64,56)}Fpt(C9,vye);C9.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 zpt(t,e,r){return r^t&(e^r)}function Wpt(t,e,r){return t&e|r&(t|e)}function Vpt(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function Kpt(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function Gpt(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}function Qpt(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10}C9.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,o=this._d|0,s=this._e|0,a=this._f|0,l=this._g|0,u=this._h|0,d=0;d<16;++d)e[d]=t.readInt32BE(d*4);for(;d<64;++d)e[d]=Qpt(e[d-2])+e[d-7]+Gpt(e[d-15])+e[d-16]|0;for(var p=0;p<64;++p){var v=u+Kpt(s)+zpt(s,a,l)+qpt[p]+e[p]|0,y=Vpt(r)+Wpt(r,n,i)|0;u=l,l=a,a=s,s=o+v|0,o=i,i=n,n=r,r=v+y|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0,this._f=a+this._f|0,this._g=l+this._g|0,this._h=u+this._h|0};C9.prototype._hash=function(){var t=$pt.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t};yye.exports=C9});var xye=X((u4r,bye)=>{var Zpt=ef(),Ypt=rQ(),Jpt=tv(),Xpt=wm().Buffer,emt=new Array(64);function xO(){this.init(),this._w=emt,Jpt.call(this,64,56)}Zpt(xO,Ypt);xO.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};xO.prototype._hash=function(){var t=Xpt.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t};bye.exports=xO});var nQ=X((f4r,Tye)=>{var tmt=ef(),Iye=tv(),rmt=wm().Buffer,Eye=[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],nmt=new Array(160);function A9(){this.init(),this._w=nmt,Iye.call(this,128,112)}tmt(A9,Iye);A9.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 Cye(t,e,r){return r^t&(e^r)}function Aye(t,e,r){return t&e|r&(t|e)}function Sye(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function _ye(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function imt(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function omt(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function smt(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function amt(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function Fs(t,e){return t>>>0<e>>>0?1:0}A9.prototype._update=function(t){for(var e=this._w,r=this._ah|0,n=this._bh|0,i=this._ch|0,o=this._dh|0,s=this._eh|0,a=this._fh|0,l=this._gh|0,u=this._hh|0,d=this._al|0,p=this._bl|0,v=this._cl|0,y=this._dl|0,S=this._el|0,R=this._fl|0,O=this._gl|0,k=this._hl|0,M=0;M<32;M+=2)e[M]=t.readInt32BE(M*4),e[M+1]=t.readInt32BE(M*4+4);for(;M<160;M+=2){var D=e[M-30],j=e[M-15*2+1],q=imt(D,j),W=omt(j,D);D=e[M-2*2],j=e[M-2*2+1];var V=smt(D,j),P=amt(j,D),$=e[M-7*2],U=e[M-7*2+1],L=e[M-16*2],z=e[M-16*2+1],f=W+U|0,h=q+$+Fs(f,W)|0;f=f+P|0,h=h+V+Fs(f,P)|0,f=f+z|0,h=h+L+Fs(f,z)|0,e[M]=h,e[M+1]=f}for(var m=0;m<160;m+=2){h=e[m],f=e[m+1];var b=Aye(r,n,i),C=Aye(d,p,v),T=Sye(r,d),N=Sye(d,r),I=_ye(s,S),g=_ye(S,s),x=Eye[m],Q=Eye[m+1],re=Cye(s,a,l),A=Cye(S,R,O),G=k+g|0,Z=u+I+Fs(G,k)|0;G=G+A|0,Z=Z+re+Fs(G,A)|0,G=G+Q|0,Z=Z+x+Fs(G,Q)|0,G=G+f|0,Z=Z+h+Fs(G,f)|0;var Y=N+C|0,ue=T+b+Fs(Y,N)|0;u=l,k=O,l=a,O=R,a=s,R=S,S=y+G|0,s=o+Z+Fs(S,y)|0,o=i,y=v,i=n,v=p,n=r,p=d,d=G+Y|0,r=Z+ue+Fs(d,G)|0}this._al=this._al+d|0,this._bl=this._bl+p|0,this._cl=this._cl+v|0,this._dl=this._dl+y|0,this._el=this._el+S|0,this._fl=this._fl+R|0,this._gl=this._gl+O|0,this._hl=this._hl+k|0,this._ah=this._ah+r+Fs(this._al,d)|0,this._bh=this._bh+n+Fs(this._bl,p)|0,this._ch=this._ch+i+Fs(this._cl,v)|0,this._dh=this._dh+o+Fs(this._dl,y)|0,this._eh=this._eh+s+Fs(this._el,S)|0,this._fh=this._fh+a+Fs(this._fl,R)|0,this._gh=this._gh+l+Fs(this._gl,O)|0,this._hh=this._hh+u+Fs(this._hl,k)|0};A9.prototype._hash=function(){var t=rmt.allocUnsafe(64);function e(r,n,i){t.writeInt32BE(r,i),t.writeInt32BE(n,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t};Tye.exports=A9});var Rye=X((h4r,kye)=>{var cmt=ef(),lmt=nQ(),umt=tv(),fmt=wm().Buffer,hmt=new Array(160);function EO(){this.init(),this._w=hmt,umt.call(this,128,112)}cmt(EO,lmt);EO.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};EO.prototype._hash=function(){var t=fmt.allocUnsafe(48);function e(r,n,i){t.writeInt32BE(r,i),t.writeInt32BE(n,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t};kye.exports=EO});var iQ=X((ym,Mye)=>{var ym=Mye.exports=function(e){e=e.toLowerCase();var r=ym[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r};ym.sha=pye();ym.sha1=wye();ym.sha224=xye();ym.sha256=rQ();ym.sha384=Rye();ym.sha512=nQ()});var Dye=X(CO=>{"use strict";Object.defineProperty(CO,"__esModule",{value:!0});CO.WalletLinkSession=void 0;var dmt=iQ(),Nye=Ud(),Oye="session:id",Pye="session:secret",Bye="session:linked",oQ=class t{constructor(e,r,n,i){this._storage=e,this._id=r||(0,Nye.randomBytesHex)(16),this._secret=n||(0,Nye.randomBytesHex)(32),this._key=new dmt.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(e){let r=e.getItem(Oye),n=e.getItem(Bye),i=e.getItem(Pye);return r&&i?new t(e,r,i,n==="1"):null}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this._storage.setItem(Oye,this._id),this._storage.setItem(Pye,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(Bye,this._linked?"1":"0")}};CO.WalletLinkSession=oQ});var S9=X(Wd=>{"use strict";Object.defineProperty(Wd,"__esModule",{value:!0});Wd.isDarkMode=Wd.isMobileWeb=Wd.getLocation=Wd.createQrUrl=void 0;function pmt(t,e,r,n,i,o){let s=n?"parent-id":"id",a=new URLSearchParams({[s]:t,secret:e,server:r,v:i,chainId:o.toString()}).toString();return`${r}/#/link?${a}`}Wd.createQrUrl=pmt;function mmt(){try{return window.frameElement!==null}catch{return!1}}function gmt(){try{return mmt()&&window.top?window.top.location:window.location}catch{return window.location}}Wd.getLocation=gmt;function wmt(){var t;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((t=window?.navigator)===null||t===void 0?void 0:t.userAgent)}Wd.isMobileWeb=wmt;function vmt(){var t,e;return(e=(t=window?.matchMedia)===null||t===void 0?void 0:t.call(window,"(prefers-color-scheme: dark)").matches)!==null&&e!==void 0?e:!1}Wd.isDarkMode=vmt});var Lye=X(sQ=>{"use strict";Object.defineProperty(sQ,"__esModule",{value:!0});sQ.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 aQ=X(I4=>{"use strict";var ymt=I4&&I4.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(I4,"__esModule",{value:!0});I4.injectCssReset=void 0;var bmt=ymt(Lye());function xmt(){let t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(bmt.default)),document.documentElement.appendChild(t)}I4.injectCssReset=xmt});var Wg=X((w4r,cQ)=>{function jye(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(r=jye(t[e]))&&(n&&(n+=" "),n+=r);else for(e in t)t[e]&&(n&&(n+=" "),n+=e);return n}function Uye(){for(var t,e,r=0,n="";r<arguments.length;)(t=arguments[r++])&&(e=jye(t))&&(n&&(n+=" "),n+=e);return n}cQ.exports=Uye,cQ.exports.clsx=Uye});var fa={};qr(fa,{Component:()=>I9,Fragment:()=>R9,cloneElement:()=>Tmt,createContext:()=>kmt,createElement:()=>Qye,createRef:()=>Cmt,h:()=>Qye,hydrate:()=>rbe,isValidElement:()=>zye,options:()=>qi,render:()=>tbe,toChildArray:()=>Xye});function bm(t,e){for(var r in e)t[r]=e[r];return t}function Gye(t){var e=t.parentNode;e&&e.removeChild(t)}function Qye(t,e,r){var n,i,o,s={};for(o in e)o=="key"?n=e[o]:o=="ref"?i=e[o]:s[o]=e[o];if(arguments.length>2&&(s.children=arguments.length>3?k9.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(o in t.defaultProps)s[o]===void 0&&(s[o]=t.defaultProps[o]);return _9(t,s,n,i,null)}function _9(t,e,r,n,i){var o={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++Hye,__i:-1,__u:0};return i==null&&qi.vnode!=null&&qi.vnode(o),o}function Cmt(){return{current:null}}function R9(t){return t.children}function I9(t,e){this.props=t,this.context=e}function nv(t,e){if(e==null)return t.__?nv(t.__,t.__i+1):null;for(var r;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null)return r.__e;return typeof t.type=="function"?nv(t):null}function Zye(t){var e,r;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null){t.__e=t.__c.base=r.__e;break}return Zye(t)}}function hQ(t){(!t.__d&&(t.__d=!0)&&rv.push(t)&&!SO.__r++||Fye!==qi.debounceRendering)&&((Fye=qi.debounceRendering)||Wye)(SO)}function SO(){var t,e,r,n,i,o,s,a;for(rv.sort(lQ);t=rv.shift();)t.__d&&(e=rv.length,n=void 0,o=(i=(r=t).__v).__e,s=[],a=[],r.__P&&((n=bm({},i)).__v=i.__v+1,qi.vnode&&qi.vnode(n),mQ(r.__P,n,i,r.__n,r.__P.namespaceURI,32&i.__u?[o]:null,s,o??nv(i),!!(32&i.__u),a),n.__v=i.__v,n.__.__k[n.__i]=n,ebe(s,n,a),n.__e!=o&&Zye(n)),rv.length>e&&rv.sort(lQ));SO.__r=0}function Yye(t,e,r,n,i,o,s,a,l,u,d){var p,v,y,S,R,O=n&&n.__k||Kye,k=e.length;for(r.__d=l,Amt(r,e,O),l=r.__d,p=0;p<k;p++)(y=r.__k[p])!=null&&typeof y!="boolean"&&typeof y!="function"&&(v=y.__i===-1?T9:O[y.__i]||T9,y.__i=p,mQ(t,y,v,i,o,s,a,l,u,d),S=y.__e,y.ref&&v.ref!=y.ref&&(v.ref&&gQ(v.ref,null,y),d.push(y.ref,y.__c||S,y)),R==null&&S!=null&&(R=S),65536&y.__u||v.__k===y.__k?l=Jye(y,l,t):typeof y.type=="function"&&y.__d!==void 0?l=y.__d:S&&(l=S.nextSibling),y.__d=void 0,y.__u&=-196609);r.__d=l,r.__e=R}function Amt(t,e,r){var n,i,o,s,a,l=e.length,u=r.length,d=u,p=0;for(t.__k=[],n=0;n<l;n++)s=n+p,(i=t.__k[n]=(i=e[n])==null||typeof i=="boolean"||typeof i=="function"?null:typeof i=="string"||typeof i=="number"||typeof i=="bigint"||i.constructor==String?_9(null,i,null,null,null):_O(i)?_9(R9,{children:i},null,null,null):i.constructor===void 0&&i.__b>0?_9(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=t,i.__b=t.__b+1,a=Smt(i,r,s,d),i.__i=a,o=null,a!==-1&&(d--,(o=r[a])&&(o.__u|=131072)),o==null||o.__v===null?(a==-1&&p--,typeof i.type!="function"&&(i.__u|=65536)):a!==s&&(a==s-1?p--:a==s+1?p++:a>s?d>l-s?p+=a-s:p--:a<s&&(a==s-p?p-=a-s:p++),a!==n+p&&(i.__u|=65536))):(o=r[s])&&o.key==null&&o.__e&&!(131072&o.__u)&&(o.__e==t.__d&&(t.__d=nv(o)),dQ(o,o,!1),r[s]=null,d--);if(d)for(n=0;n<u;n++)(o=r[n])!=null&&!(131072&o.__u)&&(o.__e==t.__d&&(t.__d=nv(o)),dQ(o,o))}function Jye(t,e,r){var n,i;if(typeof t.type=="function"){for(n=t.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=t,e=Jye(n[i],e,r));return e}t.__e!=e&&(e&&t.type&&!r.contains(e)&&(e=nv(t)),r.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType===8);return e}function Xye(t,e){return e=e||[],t==null||typeof t=="boolean"||(_O(t)?t.some(function(r){Xye(r,e)}):e.push(t)),e}function Smt(t,e,r,n){var i=t.key,o=t.type,s=r-1,a=r+1,l=e[r];if(l===null||l&&i==l.key&&o===l.type&&!(131072&l.__u))return r;if(n>(l!=null&&!(131072&l.__u)?1:0))for(;s>=0||a<e.length;){if(s>=0){if((l=e[s])&&!(131072&l.__u)&&i==l.key&&o===l.type)return s;s--}if(a<e.length){if((l=e[a])&&!(131072&l.__u)&&i==l.key&&o===l.type)return a;a++}}return-1}function $ye(t,e,r){e[0]==="-"?t.setProperty(e,r??""):t[e]=r==null?"":typeof r!="number"||Emt.test(e)?r:r+"px"}function AO(t,e,r,n,i){var o;e:if(e==="style")if(typeof r=="string")t.style.cssText=r;else{if(typeof n=="string"&&(t.style.cssText=n=""),n)for(e in n)r&&e in r||$ye(t.style,e,"");if(r)for(e in r)n&&r[e]===n[e]||$ye(t.style,e,r[e])}else if(e[0]==="o"&&e[1]==="n")o=e!==(e=e.replace(/(PointerCapture)$|Capture$/i,"$1")),e=e.toLowerCase()in t||e==="onFocusOut"||e==="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=r,r?n?r.u=n.u:(r.u=pQ,t.addEventListener(e,o?fQ:uQ,o)):t.removeEventListener(e,o?fQ:uQ,o);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&e[4]!=="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&r==1?"":r))}}function qye(t){return function(e){if(this.l){var r=this.l[e.type+t];if(e.t==null)e.t=pQ++;else if(e.t<r.u)return;return r(qi.event?qi.event(e):e)}}}function mQ(t,e,r,n,i,o,s,a,l,u){var d,p,v,y,S,R,O,k,M,D,j,q,W,V,P,$,U=e.type;if(e.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),o=[a=e.__e=r.__e]),(d=qi.__b)&&d(e);e:if(typeof U=="function")try{if(k=e.props,M="prototype"in U&&U.prototype.render,D=(d=U.contextType)&&n[d.__c],j=d?D?D.props.value:d.__:n,r.__c?O=(p=e.__c=r.__c).__=p.__E:(M?e.__c=p=new U(k,j):(e.__c=p=new I9(k,j),p.constructor=U,p.render=Imt),D&&D.sub(p),p.props=k,p.state||(p.state={}),p.context=j,p.__n=n,v=p.__d=!0,p.__h=[],p._sb=[]),M&&p.__s==null&&(p.__s=p.state),M&&U.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=bm({},p.__s)),bm(p.__s,U.getDerivedStateFromProps(k,p.__s))),y=p.props,S=p.state,p.__v=e,v)M&&U.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),M&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(M&&U.getDerivedStateFromProps==null&&k!==y&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(k,j),!p.__e&&(p.shouldComponentUpdate!=null&&p.shouldComponentUpdate(k,p.__s,j)===!1||e.__v===r.__v)){for(e.__v!==r.__v&&(p.props=k,p.state=p.__s,p.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.forEach(function(L){L&&(L.__=e)}),q=0;q<p._sb.length;q++)p.__h.push(p._sb[q]);p._sb=[],p.__h.length&&s.push(p);break e}p.componentWillUpdate!=null&&p.componentWillUpdate(k,p.__s,j),M&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(y,S,R)})}if(p.context=j,p.props=k,p.__P=t,p.__e=!1,W=qi.__r,V=0,M){for(p.state=p.__s,p.__d=!1,W&&W(e),d=p.render(p.props,p.state,p.context),P=0;P<p._sb.length;P++)p.__h.push(p._sb[P]);p._sb=[]}else do p.__d=!1,W&&W(e),d=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++V<25);p.state=p.__s,p.getChildContext!=null&&(n=bm(bm({},n),p.getChildContext())),M&&!v&&p.getSnapshotBeforeUpdate!=null&&(R=p.getSnapshotBeforeUpdate(y,S)),Yye(t,_O($=d!=null&&d.type===R9&&d.key==null?d.props.children:d)?$:[$],e,r,n,i,o,s,a,l,u),p.base=e.__e,e.__u&=-161,p.__h.length&&s.push(p),O&&(p.__E=p.__=null)}catch(L){if(e.__v=null,l||o!=null){for(e.__u|=l?160:32;a&&a.nodeType===8&&a.nextSibling;)a=a.nextSibling;o[o.indexOf(a)]=null,e.__e=a}else e.__e=r.__e,e.__k=r.__k;qi.__e(L,e,r)}else o==null&&e.__v===r.__v?(e.__k=r.__k,e.__e=r.__e):e.__e=_mt(r.__e,e,r,n,i,o,s,l,u);(d=qi.diffed)&&d(e)}function ebe(t,e,r){e.__d=void 0;for(var n=0;n<r.length;n++)gQ(r[n],r[++n],r[++n]);qi.__c&&qi.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(o){o.call(i)})}catch(o){qi.__e(o,i.__v)}})}function _mt(t,e,r,n,i,o,s,a,l){var u,d,p,v,y,S,R,O=r.props,k=e.props,M=e.type;if(M==="svg"?i="http://www.w3.org/2000/svg":M==="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(u=0;u<o.length;u++)if((y=o[u])&&"setAttribute"in y==!!M&&(M?y.localName===M:y.nodeType===3)){t=y,o[u]=null;break}}if(t==null){if(M===null)return document.createTextNode(k);t=document.createElementNS(i,M,k.is&&k),o=null,a=!1}if(M===null)O===k||a&&t.data===k||(t.data=k);else{if(o=o&&k9.call(t.childNodes),O=r.props||T9,!a&&o!=null)for(O={},u=0;u<t.attributes.length;u++)O[(y=t.attributes[u]).name]=y.value;for(u in O)if(y=O[u],u!="children"){if(u=="dangerouslySetInnerHTML")p=y;else if(u!=="key"&&!(u in k)){if(u=="value"&&"defaultValue"in k||u=="checked"&&"defaultChecked"in k)continue;AO(t,u,null,y,i)}}for(u in k)y=k[u],u=="children"?v=y:u=="dangerouslySetInnerHTML"?d=y:u=="value"?S=y:u=="checked"?R=y:u==="key"||a&&typeof y!="function"||O[u]===y||AO(t,u,y,O[u],i);if(d)a||p&&(d.__html===p.__html||d.__html===t.innerHTML)||(t.innerHTML=d.__html),e.__k=[];else if(p&&(t.innerHTML=""),Yye(t,_O(v)?v:[v],e,r,n,M==="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,s,o?o[0]:r.__k&&nv(r,0),a,l),o!=null)for(u=o.length;u--;)o[u]!=null&&Gye(o[u]);a||(u="value",S!==void 0&&(S!==t[u]||M==="progress"&&!S||M==="option"&&S!==O[u])&&AO(t,u,S,O[u],i),u="checked",R!==void 0&&R!==t[u]&&AO(t,u,R,O[u],i))}return t}function gQ(t,e,r){try{if(typeof t=="function"){var n=typeof t.__u=="function";n&&t.__u(),n&&e==null||(t.__u=t(e))}else t.current=e}catch(i){qi.__e(i,r)}}function dQ(t,e,r){var n,i;if(qi.unmount&&qi.unmount(t),(n=t.ref)&&(n.current&&n.current!==t.__e||gQ(n,null,e)),(n=t.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(o){qi.__e(o,e)}n.base=n.__P=null}if(n=t.__k)for(i=0;i<n.length;i++)n[i]&&dQ(n[i],e,r||typeof t.type!="function");r||t.__e==null||Gye(t.__e),t.__c=t.__=t.__e=t.__d=void 0}function Imt(t,e,r){return this.constructor(t,r)}function tbe(t,e,r){var n,i,o,s;qi.__&&qi.__(t,e),i=(n=typeof r=="function")?null:r&&r.__k||e.__k,o=[],s=[],mQ(e,t=(!n&&r||e).__k=Qye(R9,null,[t]),i||T9,T9,e.namespaceURI,!n&&r?[r]:i?null:e.firstChild?k9.call(e.childNodes):null,o,!n&&r?r:i?i.__e:e.firstChild,n,s),ebe(o,t,s)}function rbe(t,e){tbe(t,e,rbe)}function Tmt(t,e,r){var n,i,o,s,a=bm({},t.props);for(o in t.type&&t.type.defaultProps&&(s=t.type.defaultProps),e)o=="key"?n=e[o]:o=="ref"?i=e[o]:a[o]=e[o]===void 0&&s!==void 0?s[o]:e[o];return arguments.length>2&&(a.children=arguments.length>3?k9.call(arguments,2):r),_9(t.type,a,n||t.key,i||t.ref,null)}function kmt(t,e){var r={__c:e="__cC"+Vye++,__:t,Consumer:function(n,i){return n.children(i)},Provider:function(n){var i,o;return this.getChildContext||(i=[],(o={})[e]=this,this.getChildContext=function(){return o},this.componentWillUnmount=function(){i=null},this.shouldComponentUpdate=function(s){this.props.value!==s.value&&i.some(function(a){a.__e=!0,hQ(a)})},this.sub=function(s){i.push(s);var a=s.componentWillUnmount;s.componentWillUnmount=function(){i&&i.splice(i.indexOf(s),1),a&&a.call(s)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}var k9,qi,Hye,zye,rv,Fye,Wye,lQ,pQ,uQ,fQ,Vye,T9,Kye,Emt,_O,$s=F(()=>{T9={},Kye=[],Emt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,_O=Array.isArray;k9=Kye.slice,qi={__e:function(t,e,r,n){for(var i,o,s;e=e.__;)if((i=e.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(t)),s=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,n||{}),s=i.__d),s)return i.__E=i}catch(a){t=a}throw t}},Hye=0,zye=function(t){return t!=null&&t.constructor==null},I9.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=bm({},this.state),typeof t=="function"&&(t=t(bm({},r),this.props)),t&&bm(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),hQ(this))},I9.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),hQ(this))},I9.prototype.render=R9,rv=[],Wye=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,lQ=function(t,e){return t.__v.__b-e.__v.__b},SO.__r=0,pQ=0,uQ=qye(!1),fQ=qye(!0),Vye=0});var k4={};qr(k4,{useCallback:()=>Omt,useContext:()=>Pmt,useDebugValue:()=>Bmt,useEffect:()=>Rmt,useErrorBoundary:()=>Dmt,useId:()=>Lmt,useImperativeHandle:()=>Nmt,useLayoutEffect:()=>pbe,useMemo:()=>yQ,useReducer:()=>dbe,useRef:()=>Mmt,useState:()=>hbe});function iv(t,e){ao.__h&&ao.__h(ki,t,T4||e),T4=0;var r=ki.__H||(ki.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function hbe(t){return T4=1,dbe(mbe,t)}function dbe(t,e,r){var n=iv(xm++,2);if(n.t=t,!n.__c&&(n.__=[r?r(e):mbe(void 0,e),function(a){var l=n.__N?n.__N[0]:n.__[0],u=n.t(l,a);l!==u&&(n.__N=[u,n.__[1]],n.__c.setState({}))}],n.__c=ki,!ki.u)){var i=function(a,l,u){if(!n.__c.__H)return!0;var d=n.__c.__H.__.filter(function(v){return!!v.__c});if(d.every(function(v){return!v.__N}))return!o||o.call(this,a,l,u);var p=!1;return d.forEach(function(v){if(v.__N){var y=v.__[0];v.__=v.__N,v.__N=void 0,y!==v.__[0]&&(p=!0)}}),!(!p&&n.__c.props===a)&&(!o||o.call(this,a,l,u))};ki.u=!0;var o=ki.shouldComponentUpdate,s=ki.componentWillUpdate;ki.componentWillUpdate=function(a,l,u){if(this.__e){var d=o;o=void 0,i(a,l,u),o=d}s&&s.call(this,a,l,u)},ki.shouldComponentUpdate=i}return n.__N||n.__}function Rmt(t,e){var r=iv(xm++,3);!ao.__s&&bQ(r.__H,e)&&(r.__=t,r.i=e,ki.__H.__h.push(r))}function pbe(t,e){var r=iv(xm++,4);!ao.__s&&bQ(r.__H,e)&&(r.__=t,r.i=e,ki.__h.push(r))}function Mmt(t){return T4=5,yQ(function(){return{current:t}},[])}function Nmt(t,e,r){T4=6,pbe(function(){return typeof t=="function"?(t(e()),function(){return t(null)}):t?(t.current=e(),function(){return t.current=null}):void 0},r==null?r:r.concat(t))}function yQ(t,e){var r=iv(xm++,7);return bQ(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function Omt(t,e){return T4=8,yQ(function(){return t},e)}function Pmt(t){var e=ki.context[t.__c],r=iv(xm++,9);return r.c=t,e?(r.__==null&&(r.__=!0,e.sub(ki)),e.props.value):t.__}function Bmt(t,e){ao.useDebugValue&&ao.useDebugValue(e?e(t):t)}function Dmt(t){var e=iv(xm++,10),r=hbe();return e.__=t,ki.componentDidCatch||(ki.componentDidCatch=function(n,i){e.__&&e.__(n,i),r[1](n)}),[r[0],function(){r[1](void 0)}]}function Lmt(){var t=iv(xm++,11);if(!t.__){for(var e=ki.__v;e!==null&&!e.__m&&e.__!==null;)e=e.__;var r=e.__m||(e.__m=[0,0]);t.__="P"+r[0]+"-"+r[1]++}return t.__}function Umt(){for(var t;t=fbe.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(IO),t.__H.__h.forEach(vQ),t.__H.__h=[]}catch(e){t.__H.__h=[],ao.__e(e,t.__v)}}function jmt(t){var e,r=function(){clearTimeout(n),ube&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,100);ube&&(e=requestAnimationFrame(r))}function IO(t){var e=ki,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),ki=e}function vQ(t){var e=ki;t.__c=t.__(),ki=e}function bQ(t,e){return!t||t.length!==e.length||e.some(function(r,n){return r!==t[n]})}function mbe(t,e){return typeof e=="function"?e(t):e}var xm,ki,wQ,nbe,T4,fbe,ao,ibe,obe,sbe,abe,cbe,lbe,ube,R4=F(()=>{$s();T4=0,fbe=[],ao=qi,ibe=ao.__b,obe=ao.__r,sbe=ao.diffed,abe=ao.__c,cbe=ao.unmount,lbe=ao.__;ao.__b=function(t){ki=null,ibe&&ibe(t)},ao.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),lbe&&lbe(t,e)},ao.__r=function(t){obe&&obe(t),xm=0;var e=(ki=t.__c).__H;e&&(wQ===ki?(e.__h=[],ki.__h=[],e.__.forEach(function(r){r.__N&&(r.__=r.__N),r.i=r.__N=void 0})):(e.__h.forEach(IO),e.__h.forEach(vQ),e.__h=[],xm=0)),wQ=ki},ao.diffed=function(t){sbe&&sbe(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(fbe.push(e)!==1&&nbe===ao.requestAnimationFrame||((nbe=ao.requestAnimationFrame)||jmt)(Umt)),e.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.i=void 0})),wQ=ki=null},ao.__c=function(t,e){e.some(function(r){try{r.__h.forEach(IO),r.__h=r.__h.filter(function(n){return!n.__||vQ(n)})}catch(n){e.some(function(i){i.__h&&(i.__h=[])}),e=[],ao.__e(n,r.__v)}}),abe&&abe(t,e)},ao.unmount=function(t){cbe&&cbe(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{IO(n)}catch(i){e=i}}),r.__H=void 0,e&&ao.__e(e,r.__v))};ube=typeof requestAnimationFrame=="function"});var gbe=X(xQ=>{"use strict";Object.defineProperty(xQ,"__esModule",{value:!0});xQ.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}"});var AQ=X(rf=>{"use strict";var wbe=rf&&rf.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(rf,"__esModule",{value:!0});rf.SnackbarInstance=rf.SnackbarContainer=rf.Snackbar=void 0;var TO=wbe(Wg()),os=($s(),zn(fa)),EQ=(R4(),zn(k4)),Fmt=S9(),$mt=wbe(gbe()),qmt="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",Hmt="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=",CQ=class{constructor(){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=(0,Fmt.isDarkMode)()}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",e.appendChild(this.root),this.render()}presentItem(e){let r=this.nextItemKey++;return this.items.set(r,e),this.render(),()=>{this.items.delete(r),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,os.render)((0,os.h)("div",null,(0,os.h)(rf.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([e,r])=>(0,os.h)(rf.SnackbarInstance,Object.assign({},r,{key:e}))))),this.root)}};rf.Snackbar=CQ;var zmt=t=>(0,os.h)("div",{class:(0,TO.default)("-cbwsdk-snackbar-container")},(0,os.h)("style",null,$mt.default),(0,os.h)("div",{class:"-cbwsdk-snackbar"},t.children));rf.SnackbarContainer=zmt;var Wmt=({autoExpand:t,message:e,menuItems:r})=>{let[n,i]=(0,EQ.useState)(!0),[o,s]=(0,EQ.useState)(t??!1);(0,EQ.useEffect)(()=>{let l=[window.setTimeout(()=>{i(!1)},1),window.setTimeout(()=>{s(!0)},1e4)];return()=>{l.forEach(window.clearTimeout)}});let a=()=>{s(!o)};return(0,os.h)("div",{class:(0,TO.default)("-cbwsdk-snackbar-instance",n&&"-cbwsdk-snackbar-instance-hidden",o&&"-cbwsdk-snackbar-instance-expanded")},(0,os.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:a},(0,os.h)("img",{src:qmt,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,os.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},e),(0,os.h)("div",{class:"-gear-container"},!o&&(0,os.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,os.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,os.h)("img",{src:Hmt,class:"-gear-icon",title:"Expand"}))),r&&r.length>0&&(0,os.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},r.map((l,u)=>(0,os.h)("div",{class:(0,TO.default)("-cbwsdk-snackbar-instance-menu-item",l.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:l.onClick,key:u},(0,os.h)("svg",{width:l.svgWidth,height:l.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,os.h)("path",{"fill-rule":l.defaultFillRule,"clip-rule":l.defaultClipRule,d:l.path,fill:"#AAAAAA"})),(0,os.h)("span",{class:(0,TO.default)("-cbwsdk-snackbar-instance-menu-item-info",l.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},l.info)))))};rf.SnackbarInstance=Wmt});var vbe=X(kO=>{"use strict";Object.defineProperty(kO,"__esModule",{value:!0});kO.WalletLinkRelayUI=void 0;var Vmt=aQ(),Kmt=AQ(),SQ=class{constructor(){this.attached=!1,this.snackbar=new Kmt.Snackbar}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");let e=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",e.appendChild(r),this.snackbar.attach(r),this.attached=!0,(0,Vmt.injectCssReset)()}showConnecting(e){let r;return e.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:r={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(r)}};kO.WalletLinkRelayUI=SQ});var ybe=X(_Q=>{"use strict";Object.defineProperty(_Q,"__esModule",{value:!0});_Q.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 xbe=X(M4=>{"use strict";var bbe=M4&&M4.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(M4,"__esModule",{value:!0});M4.RedirectDialog=void 0;var Gmt=bbe(Wg()),Vd=($s(),zn(fa)),Qmt=aQ(),Zmt=AQ(),Ymt=S9(),Jmt=bbe(ybe()),IQ=class{constructor(){this.root=null,this.darkMode=(0,Ymt.isDarkMode)()}attach(){let e=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",e.appendChild(this.root),(0,Qmt.injectCssReset)()}present(e){this.render(e)}clear(){this.render(null)}render(e){this.root&&((0,Vd.render)(null,this.root),e&&(0,Vd.render)((0,Vd.h)(Xmt,Object.assign({},e,{onDismiss:()=>{this.clear()},darkMode:this.darkMode})),this.root))}};M4.RedirectDialog=IQ;var Xmt=({title:t,buttonText:e,darkMode:r,onButtonClick:n,onDismiss:i})=>{let o=r?"dark":"light";return(0,Vd.h)(Zmt.SnackbarContainer,{darkMode:r},(0,Vd.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,Vd.h)("style",null,Jmt.default),(0,Vd.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:i}),(0,Vd.h)("div",{class:(0,Gmt.default)("-cbwsdk-redirect-dialog-box",o)},(0,Vd.h)("p",null,t),(0,Vd.h)("button",{onClick:n},e))))}});var RO=X(Vg=>{"use strict";Object.defineProperty(Vg,"__esModule",{value:!0});Vg.CBW_MOBILE_DEEPLINK_URL=Vg.WALLETLINK_URL=Vg.CB_KEYS_URL=void 0;Vg.CB_KEYS_URL="https://keys.coinbase.com/connect";Vg.WALLETLINK_URL="https://www.walletlink.org";Vg.CBW_MOBILE_DEEPLINK_URL="https://go.cb-w.com/walletlink"});var Ebe=X(MO=>{"use strict";Object.defineProperty(MO,"__esModule",{value:!0});MO.WLMobileRelayUI=void 0;var e1t=xbe(),t1t=S9(),r1t=RO(),TQ=class{constructor(){this.attached=!1,this.redirectDialog=new e1t.RedirectDialog}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}redirectToCoinbaseWallet(e){let r=new URL(r1t.CBW_MOBILE_DEEPLINK_URL);r.searchParams.append("redirect_url",(0,t1t.getLocation)().href),e&&r.searchParams.append("wl_url",e);let n=document.createElement("a");n.target="cbw-opener",n.href=r.href,n.rel="noreferrer noopener",n.click()}openCoinbaseWalletDeeplink(e){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",onButtonClick:()=>{this.redirectToCoinbaseWallet(e)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(e)},99)}showConnecting(e){return()=>{this.redirectDialog.clear()}}};MO.WLMobileRelayUI=TQ});var Abe=X(OO=>{"use strict";Object.defineProperty(OO,"__esModule",{value:!0});OO.WalletLinkRelay=void 0;var n1t=lye(),i1t=dO(),o1t=YG(),kQ=Dye(),N4=ON(),s1t=S9(),a1t=vbe(),Cbe=Ebe(),c1t=Ld(),Qo=Ud(),l1t=Ug(),NO=class t{constructor(e){this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.isMobileWeb=(0,s1t.isMobileWeb)(),this.appName="",this.appLogoUrl=null,this.linkedUpdated=o=>{this.isLinked=o;let s=this.storage.getItem(i1t.LOCAL_STORAGE_ADDRESSES_KEY);if(o&&(this._session.linked=o),this.isUnlinkedErrorState=!1,s){let a=s.split(" "),l=this.storage.getItem("IsStandaloneSigning")==="true";a[0]!==""&&!o&&this._session.linked&&!l&&(this.isUnlinkedErrorState=!0)}},this.metadataUpdated=(o,s)=>{this.storage.setItem(o,s)},this.chainUpdated=(o,s)=>{this.chainCallbackParams.chainId===o&&this.chainCallbackParams.jsonRpcUrl===s||(this.chainCallbackParams={chainId:o,jsonRpcUrl:s},this.chainCallback&&this.chainCallback(o,s))},this.accountUpdated=o=>{this.accountsCallback&&this.accountsCallback([o]),t.accountRequestCallbackIds.size>0&&(Array.from(t.accountRequestCallbackIds.values()).forEach(s=>{let a={type:"WEB3_RESPONSE",id:s,response:{method:"requestEthereumAccounts",result:[o]}};this.invokeCallback(Object.assign(Object.assign({},a),{id:s}))}),t.accountRequestCallbackIds.clear())},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage;let{session:r,ui:n,connection:i}=this.subscribe();this._session=r,this.connection=i,this.relayEventManager=new o1t.RelayEventManager,this.ui=n}subscribe(){let e=kQ.WalletLinkSession.load(this.storage)||new kQ.WalletLinkSession(this.storage).save(),{linkAPIUrl:r}=this,n=new n1t.WalletLinkConnection({session:e,linkAPIUrl:r,listener:this}),i=this.isMobileWeb?new Cbe.WLMobileRelayUI:new a1t.WalletLinkRelayUI;return n.connect(),{session:e,ui:i,connection:n}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(e=>setTimeout(()=>e(null),1e3))]).then(()=>{this.connection.destroy();let e=kQ.WalletLinkSession.load(this.storage);e?.id===this._session.id&&l1t.ScopedLocalStorage.clearAll(),document.location.reload()}).catch(e=>{})}setAppInfo(e,r){this.appName=e,this.appLogoUrl=r}getStorageItem(e){return this.storage.getItem(e)}setStorageItem(e,r){this.storage.setItem(e,r)}signEthereumMessage(e,r,n,i){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,Qo.hexStringFromBuffer)(e,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(e,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,Qo.hexStringFromBuffer)(e,!0),signature:(0,Qo.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,Qo.bigIntStringFromBigInt)(e.weiValue),data:(0,Qo.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,Qo.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,Qo.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,Qo.bigIntStringFromBigInt)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,Qo.bigIntStringFromBigInt)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,Qo.bigIntStringFromBigInt)(e.weiValue),data:(0,Qo.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,Qo.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,Qo.bigIntStringFromBigInt)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,Qo.bigIntStringFromBigInt)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,Qo.bigIntStringFromBigInt)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,Qo.hexStringFromBuffer)(e,!0),chainId:r}})}scanQRCode(e){return this.sendRequest({method:"scanQRCode",params:{regExp:e}})}getWalletLinkSession(){return this._session}genericRequest(e,r){return this.sendRequest({method:"generic",params:{action:r,data:e}})}sendGenericMessage(e){return this.sendRequest(e)}sendRequest(e){let r=null,n=(0,Qo.randomBytesHex)(8),i=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,o),r?.()};return new Promise((o,s)=>{r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload}),this.relayEventManager.callbacks.set(n,a=>{if(r?.(),(0,N4.isErrorResponse)(a))return s(new Error(a.errorMessage));o(a)}),this.publishWeb3RequestEvent(n,e)})}setAccountsCallback(e){this.accountsCallback=e}setChainCallback(e){this.chainCallback=e}setDappDefaultChainCallback(e){this.dappDefaultChain=e}publishWeb3RequestEvent(e,r){let n={type:"WEB3_REQUEST",id:e,request:r};this.publishEvent("Web3Request",n,!0).then(i=>{}).catch(i=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n.id,response:{method:r.method,errorMessage:i.message}})}),this.isMobileWeb&&this.openCoinbaseWalletDeeplink(r.method)}openCoinbaseWalletDeeplink(e){if(this.ui instanceof Cbe.WLMobileRelayUI)switch(e){case"requestEthereumAccounts":case"switchEthereumChain":return;default:window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0}),this.ui.openCoinbaseWalletDeeplink();break}}publishWeb3RequestCanceledEvent(e){let r={type:"WEB3_REQUEST_CANCELED",id:e};this.publishEvent("Web3RequestCanceled",r,!1).then()}publishEvent(e,r,n){return this.connection.publishEvent(e,r,n)}handleWeb3ResponseMessage(e){let{response:r}=e;if(r.method==="requestEthereumAccounts"){t.accountRequestCallbackIds.forEach(n=>this.invokeCallback(Object.assign(Object.assign({},e),{id:n}))),t.accountRequestCallbackIds.clear();return}this.invokeCallback(e)}handleErrorResponse(e,r,n){var i;let o=(i=n?.message)!==null&&i!==void 0?i:"Unspecified error message.";this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:e,response:{method:r,errorMessage:o}})}invokeCallback(e){let r=this.relayEventManager.callbacks.get(e.id);r&&(r(e.response),this.relayEventManager.callbacks.delete(e.id))}requestEthereumAccounts(){let e={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=null,n=(0,Qo.randomBytesHex)(8);return new Promise((i,o)=>{this.relayEventManager.callbacks.set(n,s=>{if(r?.(),(0,N4.isErrorResponse)(s))return o(new Error(s.errorMessage));i(s)}),t.accountRequestCallbackIds.add(n),this.publishWeb3RequestEvent(n,e)})}watchAsset(e,r,n,i,o,s){let a={method:"watchAsset",params:{type:e,options:{address:r,symbol:n,decimals:i,image:o},chainId:s}},l=null,u=(0,Qo.randomBytesHex)(8),d=p=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,a.method,p),l?.()};return l=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:d,onResetConnection:this.resetAndReload}),new Promise((p,v)=>{this.relayEventManager.callbacks.set(u,y=>{if(l?.(),(0,N4.isErrorResponse)(y))return v(new Error(y.errorMessage));p(y)}),this.publishWeb3RequestEvent(u,a)})}addEthereumChain(e,r,n,i,o,s){let a={method:"addEthereumChain",params:{chainId:e,rpcUrls:r,blockExplorerUrls:i,chainName:o,iconUrls:n,nativeCurrency:s}},l=null,u=(0,Qo.randomBytesHex)(8),d=p=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,a.method,p),l?.()};return l=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:d,onResetConnection:this.resetAndReload}),new Promise((p,v)=>{this.relayEventManager.callbacks.set(u,y=>{if(l?.(),(0,N4.isErrorResponse)(y))return v(new Error(y.errorMessage));p(y)}),this.publishWeb3RequestEvent(u,a)})}switchEthereumChain(e,r){let n={method:"switchEthereumChain",params:Object.assign({chainId:e},{address:r})},i=(0,Qo.randomBytesHex)(8);return new Promise((o,s)=>{this.relayEventManager.callbacks.set(i,a=>{if((0,N4.isErrorResponse)(a)&&a.errorCode)return s(c1t.standardErrors.provider.custom({code:a.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,N4.isErrorResponse)(a))return s(new Error(a.errorMessage));o(a)}),this.publishWeb3RequestEvent(i,n)})}};OO.WalletLinkRelay=NO;NO.accountRequestCallbackIds=new Set});var Tbe=X(O4=>{"use strict";var u1t=O4&&O4.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(O4,"__esModule",{value:!0});O4.WalletLinkSigner=void 0;var RQ=u1t(nye()),Sbe=dO(),f1t=YG(),Em=ON(),h1t=Abe(),_be=RO(),qs=Ld(),Vn=Ud(),d1t=Ug(),MQ="DefaultChainId",Ibe="DefaultJsonRpcUrl",NQ=class{constructor(e){var r,n;this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1;let{appName:i,appLogoUrl:o}=e.metadata;this._appName=i,this._appLogoUrl=o,this._storage=new d1t.ScopedLocalStorage("walletlink",_be.WALLETLINK_URL),this.updateListener=e.updateListener,this._relayEventManager=new f1t.RelayEventManager,this._jsonRpcUrlFromOpts="";let s=this._storage.getItem(Sbe.LOCAL_STORAGE_ADDRESSES_KEY);if(s){let l=s.split(" ");l[0]!==""&&(this._addresses=l.map(u=>(0,Vn.ensureAddressString)(u)),(r=this.updateListener)===null||r===void 0||r.onAccountsUpdate({accounts:this._addresses,source:"storage"}))}this._storage.getItem(MQ)&&((n=this.updateListener)===null||n===void 0||n.onChainUpdate({chain:{id:this.getChainId(),rpcUrl:this.jsonRpcUrl},source:"storage"}),this.hasMadeFirstChainChangedEmission=!0),this.initializeRelay()}getSession(){let e=this.initializeRelay(),{id:r,secret:n}=e.getWalletLinkSession();return{id:r,secret:n}}async handshake(){return await this.request({method:"eth_requestAccounts"})}get selectedAddress(){return this._addresses[0]||void 0}get jsonRpcUrl(){var e;return(e=this._storage.getItem(Ibe))!==null&&e!==void 0?e:this._jsonRpcUrlFromOpts}set jsonRpcUrl(e){this._storage.setItem(Ibe,e)}updateProviderInfo(e,r){var n;this.jsonRpcUrl=e;let i=this.getChainId();this._storage.setItem(MQ,r.toString(10)),((0,Vn.ensureIntNumber)(r)!==i||!this.hasMadeFirstChainChangedEmission)&&((n=this.updateListener)===null||n===void 0||n.onChainUpdate({chain:{id:r,rpcUrl:e},source:"wallet"}),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(e,r,n,i,o,s){let l=await this.initializeRelay().watchAsset(e,r,n,i,o,s?.toString());return(0,Em.isErrorResponse)(l)?!1:!!l.result}async addEthereumChain(e,r,n,i,o,s){var a,l;if((0,Vn.ensureIntNumber)(e)===this.getChainId())return!1;let u=this.initializeRelay();this._isAuthorized()||await u.requestEthereumAccounts();let d=await u.addEthereumChain(e.toString(),r,o,n,i,s);return(0,Em.isErrorResponse)(d)?!1:(((a=d.result)===null||a===void 0?void 0:a.isApproved)===!0&&this.updateProviderInfo(r[0],e),((l=d.result)===null||l===void 0?void 0:l.isApproved)===!0)}async switchEthereumChain(e){let n=await this.initializeRelay().switchEthereumChain(e.toString(10),this.selectedAddress||void 0);if((0,Em.isErrorResponse)(n)){if(!n.errorCode)return;throw n.errorCode===qs.standardErrorCodes.provider.unsupportedChain?qs.standardErrors.provider.unsupportedChain():qs.standardErrors.provider.custom({message:n.errorMessage,code:n.errorCode})}let i=n.result;i.isApproved&&i.rpcUrl.length>0&&this.updateProviderInfo(i.rpcUrl,e)}async disconnect(){this._relay&&this._relay.resetAndReload(),this._storage.clear()}async request(e){try{return this._request(e).catch(r=>{throw r})}catch(r){return Promise.reject(r)}}async _request(e){if(!e||typeof e!="object"||Array.isArray(e))throw qs.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:e});let{method:r,params:n}=e;if(typeof r!="string"||r.length===0)throw qs.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:e});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw qs.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:e});let i=n===void 0?[]:n,o=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:r,params:i,jsonrpc:"2.0",id:o})).result}_setAddresses(e,r){var n;if(!Array.isArray(e))throw new Error("addresses is not an array");let i=e.map(o=>(0,Vn.ensureAddressString)(o));JSON.stringify(i)!==JSON.stringify(this._addresses)&&(this._addresses=i,(n=this.updateListener)===null||n===void 0||n.onAccountsUpdate({accounts:i,source:"wallet"}),this._storage.setItem(Sbe.LOCAL_STORAGE_ADDRESSES_KEY,i.join(" ")))}_sendRequestAsync(e){return new Promise((r,n)=>{try{let i=this._handleSynchronousMethods(e);if(i!==void 0)return r({jsonrpc:"2.0",id:e.id,result:i})}catch(i){return n(i)}this._handleAsynchronousMethods(e).then(i=>i&&r(Object.assign(Object.assign({},i),{id:e.id}))).catch(i=>n(i))})}_handleSynchronousMethods(e){let{method:r}=e;switch(r){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(e){let{method:r}=e,n=e.params||[];switch(r){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(n);case"eth_ecRecover":return this._eth_ecRecover(n);case"personal_sign":return this._personal_sign(n);case"personal_ecRecover":return this._personal_ecRecover(n);case"eth_signTransaction":return this._eth_signTransaction(n);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(n);case"eth_sendTransaction":return this._eth_sendTransaction(n);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(n);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(n);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(n);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(n);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(n);case"wallet_watchAsset":return this._wallet_watchAsset(n);default:return this._throwUnsupportedMethodError()}}_isKnownAddress(e){try{let r=(0,Vn.ensureAddressString)(e);return this._addresses.map(i=>(0,Vn.ensureAddressString)(i)).includes(r)}catch{}return!1}_ensureKnownAddress(e){if(!this._isKnownAddress(e))throw new Error("Unknown Ethereum address")}_prepareTransactionParams(e){let r=e.from?(0,Vn.ensureAddressString)(e.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);let n=e.to?(0,Vn.ensureAddressString)(e.to):null,i=e.value!=null?(0,Vn.ensureBigInt)(e.value):BigInt(0),o=e.data?(0,Vn.ensureBuffer)(e.data):Buffer.alloc(0),s=e.nonce!=null?(0,Vn.ensureIntNumber)(e.nonce):null,a=e.gasPrice!=null?(0,Vn.ensureBigInt)(e.gasPrice):null,l=e.maxFeePerGas!=null?(0,Vn.ensureBigInt)(e.maxFeePerGas):null,u=e.maxPriorityFeePerGas!=null?(0,Vn.ensureBigInt)(e.maxPriorityFeePerGas):null,d=e.gas!=null?(0,Vn.ensureBigInt)(e.gas):null,p=e.chainId?(0,Vn.ensureIntNumber)(e.chainId):this.getChainId();return{fromAddress:r,toAddress:n,weiValue:i,data:o,nonce:s,gasPriceInWei:a,maxFeePerGas:l,maxPriorityFeePerGas:u,gasLimit:d,chainId:p}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw qs.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw qs.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(e,r,n,i){this._ensureKnownAddress(r);try{let s=await this.initializeRelay().signEthereumMessage(e,r,n,i);if((0,Em.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}catch(o){throw typeof o.message=="string"&&o.message.match(/(denied|rejected)/i)?qs.standardErrors.provider.userRejectedRequest("User denied message signature"):o}}async _ethereumAddressFromSignedMessage(e,r,n){let o=await this.initializeRelay().ethereumAddressFromSignedMessage(e,r,n);if((0,Em.isErrorResponse)(o))throw new Error(o.errorMessage);return{jsonrpc:"2.0",id:0,result:o.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,Vn.hexStringFromIntNumber)(this.getChainId())}getChainId(){let e=this._storage.getItem(MQ);if(!e)return(0,Vn.ensureIntNumber)(1);let r=parseInt(e,10);return(0,Vn.ensureIntNumber)(r)}async _eth_requestAccounts(){if(this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let e;try{if(e=await this.initializeRelay().requestEthereumAccounts(),(0,Em.isErrorResponse)(e))throw new Error(e.errorMessage)}catch(r){throw typeof r.message=="string"&&r.message.match(/(denied|rejected)/i)?qs.standardErrors.provider.userRejectedRequest("User denied account authorization"):r}if(!e.result)throw new Error("accounts received is empty");return this._setAddresses(e.result),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(e){this._requireAuthorization();let r=(0,Vn.ensureAddressString)(e[0]),n=(0,Vn.ensureBuffer)(e[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(e){let r=(0,Vn.ensureBuffer)(e[0]),n=(0,Vn.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(e){this._requireAuthorization();let r=(0,Vn.ensureBuffer)(e[0]),n=(0,Vn.ensureAddressString)(e[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(e){let r=(0,Vn.ensureBuffer)(e[0]),n=(0,Vn.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(r,n,!0)}async _eth_signTransaction(e){this._requireAuthorization();let r=this._prepareTransactionParams(e[0]||{});try{let i=await this.initializeRelay().signEthereumTransaction(r);if((0,Em.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)?qs.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(e){let r=(0,Vn.ensureBuffer)(e[0]),i=await this.initializeRelay().submitEthereumTransaction(r,this.getChainId());if((0,Em.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}async _eth_sendTransaction(e){this._requireAuthorization();let r=this._prepareTransactionParams(e[0]||{});try{let i=await this.initializeRelay().signAndSubmitEthereumTransaction(r);if((0,Em.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)?qs.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(e){this._requireAuthorization();let r=(0,Vn.ensureParsedJSONObject)(e[0]),n=(0,Vn.ensureAddressString)(e[1]);this._ensureKnownAddress(n);let i=RQ.default.hashForSignTypedDataLegacy({data:r}),o=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,o)}async _eth_signTypedData_v3(e){this._requireAuthorization();let r=(0,Vn.ensureAddressString)(e[0]),n=(0,Vn.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);let i=RQ.default.hashForSignTypedData_v3({data:n}),o=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,o)}async _eth_signTypedData_v4(e){this._requireAuthorization();let r=(0,Vn.ensureAddressString)(e[0]),n=(0,Vn.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);let i=RQ.default.hashForSignTypedData_v4({data:n}),o=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,o)}async _wallet_addEthereumChain(e){var r,n,i,o;let s=e[0];if(((r=s.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(!s.chainName||s.chainName.trim()==="")throw qs.standardErrors.rpc.invalidParams("chainName is a required field");if(!s.nativeCurrency)throw qs.standardErrors.rpc.invalidParams("nativeCurrency is a required field");let a=parseInt(s.chainId,16);return await this.addEthereumChain(a,(n=s.rpcUrls)!==null&&n!==void 0?n:[],(i=s.blockExplorerUrls)!==null&&i!==void 0?i:[],s.chainName,(o=s.iconUrls)!==null&&o!==void 0?o:[],s.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(e){let r=e[0];return await this.switchEthereumChain(parseInt(r.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(e){let r=Array.isArray(e)?e[0]:e;if(!r.type)throw qs.standardErrors.rpc.invalidParams("Type is required");if(r?.type!=="ERC20")throw qs.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!r?.options)throw qs.standardErrors.rpc.invalidParams("Options are required");if(!r?.options.address)throw qs.standardErrors.rpc.invalidParams("Address is required");let n=this.getChainId(),{address:i,symbol:o,image:s,decimals:a}=r.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(r.type,i,o,a,s,n)}}initializeRelay(){if(!this._relay){let e=new h1t.WalletLinkRelay({linkAPIUrl:_be.WALLETLINK_URL,storage:this._storage});e.setAppInfo(this._appName,this._appLogoUrl),e.attachUI(),e.setAccountsCallback((r,n)=>this._setAddresses(r,n)),e.setChainCallback((r,n)=>{this.updateProviderInfo(n,parseInt(r,10))}),this._relay=e}return this._relay}};O4.WalletLinkSigner=NQ});var BO=X(Kd=>{"use strict";Object.defineProperty(Kd,"__esModule",{value:!0});Kd.checkErrorForInvalidRequestArgs=Kd.getCoinbaseInjectedProvider=Kd.getCoinbaseInjectedSigner=Kd.fetchRPCRequest=void 0;var p1t=c9(),PO=Ld();async function m1t(t,e){if(!e.rpcUrl)throw PO.standardErrors.rpc.internal("No RPC URL set for chain");let r=Object.assign(Object.assign({},t),{jsonrpc:"2.0",id:crypto.randomUUID()});return(await(await window.fetch(e.rpcUrl,{method:"POST",body:JSON.stringify(r),mode:"cors",headers:{"Content-Type":"application/json","X-Cbw-Sdk-Version":p1t.LIB_VERSION}})).json()).result}Kd.fetchRPCRequest=m1t;function kbe(){return globalThis.coinbaseWalletSigner}Kd.getCoinbaseInjectedSigner=kbe;function g1t(){return globalThis.coinbaseWalletExtension}function w1t(){var t,e;try{let r=globalThis;return(t=r.ethereum)!==null&&t!==void 0?t:(e=r.top)===null||e===void 0?void 0:e.ethereum}catch{return}}function v1t({metadata:t,preference:e}){var r;if(e.options!=="smartWalletOnly"){if(kbe())return;let o=g1t();if(o){let{appName:s,appLogoUrl:a,appChainIds:l}=t;return(r=o.setAppInfo)===null||r===void 0||r.call(o,s,a,l),o}}let n=w1t();if(n?.isCoinbaseBrowser)return n}Kd.getCoinbaseInjectedProvider=v1t;function y1t(t){if(!t||typeof t!="object"||Array.isArray(t))return PO.standardErrors.rpc.invalidParams({message:"Expected a single, non-array, object argument.",data:t});let{method:e,params:r}=t;if(typeof e!="string"||e.length===0)return PO.standardErrors.rpc.invalidParams({message:"'args.method' must be a non-empty string.",data:t});if(r!==void 0&&!Array.isArray(r)&&(typeof r!="object"||r===null))return PO.standardErrors.rpc.invalidParams({message:"'args.params' must be an object or array if provided.",data:t})}Kd.checkErrorForInvalidRequestArgs=y1t});var Obe=X(Gd=>{"use strict";Object.defineProperty(Gd,"__esModule",{value:!0});Gd.createSigner=Gd.fetchSignerType=Gd.storeSignerType=Gd.loadSignerType=void 0;var b1t=Ywe(),Rbe=Tbe(),x1t=Ld(),E1t=BO(),C1t=Ug(),Mbe="SignerType",Nbe=new C1t.ScopedLocalStorage("CBWSDK","SignerConfigurator");function A1t(){return Nbe.getItem(Mbe)}Gd.loadSignerType=A1t;function S1t(t){Nbe.setItem(Mbe,t)}Gd.storeSignerType=S1t;async function _1t(t){let{communicator:e,metadata:r}=t;T1t(e,r).catch(()=>{});let n={id:crypto.randomUUID(),event:"selectSignerType",data:t.preference},{data:i}=await e.postRequestAndWaitForResponse(n);return i}Gd.fetchSignerType=_1t;function I1t(t){let{signerType:e,metadata:r,communicator:n,updateListener:i}=t;switch(e){case"scw":return new b1t.SCWSigner({metadata:r,updateListener:i,communicator:n});case"walletlink":return new Rbe.WalletLinkSigner({metadata:r,updateListener:i});case"extension":{let o=(0,E1t.getCoinbaseInjectedSigner)();if(!o)throw x1t.standardErrors.rpc.internal("injected signer not found");return o}}}Gd.createSigner=I1t;async function T1t(t,e){await t.onMessage(({event:n})=>n==="WalletLinkSessionRequest");let r=new Rbe.WalletLinkSigner({metadata:e});t.postMessage({event:"WalletLinkUpdate",data:{session:r.getSession()}}),await r.handshake(),t.postMessage({event:"WalletLinkUpdate",data:{connected:!0}})}});var Dbe=X(P4=>{"use strict";Object.defineProperty(P4,"__esModule",{value:!0});P4.closePopup=P4.openPopup=void 0;var k1t=Ld(),Pbe=420,Bbe=540;function R1t(t){let e=(window.innerWidth-Pbe)/2+window.screenX,r=(window.innerHeight-Bbe)/2+window.screenY,n=window.open(t,"Smart Wallet",`width=${Pbe}, height=${Bbe}, left=${e}, top=${r}`);if(n?.focus(),!n)throw k1t.standardErrors.rpc.internal("Pop up window failed to open");return n}P4.openPopup=R1t;function M1t(t){t&&!t.closed&&t.close()}P4.closePopup=M1t});var jbe=X(DO=>{"use strict";Object.defineProperty(DO,"__esModule",{value:!0});DO.Communicator=void 0;var N1t=c9(),Lbe=Dbe(),O1t=RO(),Ube=Ld(),OQ=class{constructor(e=O1t.CB_KEYS_URL){this.popup=null,this.listeners=new Map,this.postMessage=async r=>{(await this.waitForPopupLoaded()).postMessage(r,this.url.origin)},this.postRequestAndWaitForResponse=async r=>{let n=this.onMessage(({requestId:i})=>i===r.id);return this.postMessage(r),await n},this.onMessage=async r=>new Promise((n,i)=>{let o=s=>{if(s.origin!==this.url.origin)return;let a=s.data;r(a)&&(n(a),window.removeEventListener("message",o),this.listeners.delete(o))};window.addEventListener("message",o),this.listeners.set(o,{reject:i})}),this.disconnect=()=>{(0,Lbe.closePopup)(this.popup),this.popup=null,this.listeners.forEach(({reject:r},n)=>{r(Ube.standardErrors.provider.userRejectedRequest("Request rejected")),window.removeEventListener("message",n)}),this.listeners.clear()},this.waitForPopupLoaded=async()=>this.popup&&!this.popup.closed?(this.popup.focus(),this.popup):(this.popup=(0,Lbe.openPopup)(this.url),this.onMessage(({event:r})=>r==="PopupUnload").then(this.disconnect).catch(()=>{}),this.onMessage(({event:r})=>r==="PopupLoaded").then(r=>{this.postMessage({requestId:r.id,data:{version:N1t.LIB_VERSION}})}).then(()=>{if(!this.popup)throw Ube.standardErrors.rpc.internal();return this.popup})),this.url=new URL(e)}};DO.Communicator=OQ});var $be=X(LO=>{"use strict";Object.defineProperty(LO,"__esModule",{value:!0});LO.determineMethodCategory=void 0;var Fbe={handshake:["eth_requestAccounts"],sign:["eth_ecRecover","personal_sign","personal_ecRecover","eth_signTransaction","eth_sendTransaction","eth_signTypedData_v1","eth_signTypedData_v3","eth_signTypedData_v4","eth_signTypedData","wallet_addEthereumChain","wallet_switchEthereumChain","wallet_watchAsset","wallet_getCapabilities","wallet_sendCalls","wallet_showCallsStatus"],state:["eth_chainId","eth_accounts","eth_coinbase","net_version"],deprecated:["eth_sign","eth_signTypedData_v2"],unsupported:["eth_subscribe","eth_unsubscribe"],fetch:[]};function P1t(t){for(let e in Fbe){let r=e;if(Fbe[r].includes(t))return r}}LO.determineMethodCategory=P1t});var Hbe=X(Kg=>{"use strict";var B1t=Kg&&Kg.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r},D1t=Kg&&Kg.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Kg,"__esModule",{value:!0});Kg.CoinbaseWalletProvider=void 0;var L1t=D1t(rN()),B4=Ld(),U1t=Nwe(),UO=DN(),M9=Ud(),jO=Obe(),qbe=BO(),j1t=jbe(),F1t=$be(),$1t=Ug(),PQ=class extends L1t.default{constructor(e){var r,n,{metadata:i}=e,o=e.preference,{keysUrl:s}=o,a=B1t(o,["keysUrl"]);super(),this.accounts=[],this.handlers={handshake:async u=>{try{if(this.connected)return this.emit("connect",{chainId:(0,M9.hexStringFromIntNumber)((0,UO.IntNumber)(this.chain.id))}),this.accounts;let d=await this.requestSignerSelection(),p=this.initSigner(d),v=await p.handshake();return this.signer=p,(0,jO.storeSignerType)(d),this.emit("connect",{chainId:(0,M9.hexStringFromIntNumber)((0,UO.IntNumber)(this.chain.id))}),v}catch(d){throw this.handleUnauthorizedError(d),d}},sign:async u=>{if(!this.connected||!this.signer)throw B4.standardErrors.provider.unauthorized("Must call 'eth_requestAccounts' before other methods");try{return await this.signer.request(u)}catch(d){throw this.handleUnauthorizedError(d),d}},fetch:u=>(0,qbe.fetchRPCRequest)(u,this.chain),state:u=>{let d=()=>{if(this.connected)return this.accounts;throw B4.standardErrors.provider.unauthorized("Must call 'eth_requestAccounts' before other methods")};switch(u.method){case"eth_chainId":return(0,M9.hexStringFromIntNumber)((0,UO.IntNumber)(this.chain.id));case"net_version":return this.chain.id;case"eth_accounts":return d();case"eth_coinbase":return d()[0];default:return this.handlers.unsupported(u)}},deprecated:({method:u})=>{throw B4.standardErrors.rpc.methodNotSupported(`Method ${u} is deprecated.`)},unsupported:({method:u})=>{throw B4.standardErrors.rpc.methodNotSupported(`Method ${u} is not supported.`)}},this.isCoinbaseWallet=!0,this.updateListener={onAccountsUpdate:({accounts:u,source:d})=>{(0,M9.areAddressArraysEqual)(this.accounts,u)||(this.accounts=u,d!=="storage"&&this.emit("accountsChanged",this.accounts))},onChainUpdate:({chain:u,source:d})=>{u.id===this.chain.id&&u.rpcUrl===this.chain.rpcUrl||(this.chain=u,d!=="storage"&&this.emit("chainChanged",(0,M9.hexStringFromIntNumber)((0,UO.IntNumber)(u.id))))}},this.metadata=i,this.preference=a,this.communicator=new j1t.Communicator(s),this.chain={id:(n=(r=i.appChainIds)===null||r===void 0?void 0:r[0])!==null&&n!==void 0?n:1};let l=(0,jO.loadSignerType)();this.signer=l?this.initSigner(l):null}get connected(){return this.accounts.length>0}async request(e){var r;try{let n=(0,qbe.checkErrorForInvalidRequestArgs)(e);if(n)throw n;let i=(r=(0,F1t.determineMethodCategory)(e.method))!==null&&r!==void 0?r:"fetch";return this.handlers[i](e)}catch(n){return Promise.reject((0,U1t.serializeError)(n,e.method))}}handleUnauthorizedError(e){e.code===B4.standardErrorCodes.provider.unauthorized&&this.disconnect()}async enable(){return console.warn('.enable() has been deprecated. Please use .request({ method: "eth_requestAccounts" }) instead.'),await this.request({method:"eth_requestAccounts"})}async disconnect(){this.accounts=[],this.chain={id:1},$1t.ScopedLocalStorage.clearAll(),this.emit("disconnect",B4.standardErrors.provider.disconnected("User initiated disconnection"))}requestSignerSelection(){return(0,jO.fetchSignerType)({communicator:this.communicator,preference:this.preference,metadata:this.metadata})}initSigner(e){return(0,jO.createSigner)({signerType:e,metadata:this.metadata,communicator:this.communicator,updateListener:this.updateListener})}};Kg.CoinbaseWalletProvider=PQ});var DQ=X(FO=>{"use strict";Object.defineProperty(FO,"__esModule",{value:!0});FO.CoinbaseWalletSDK=void 0;var q1t=Ewe(),H1t=Hbe(),z1t=Ug(),W1t=c9(),V1t=Ud(),K1t=BO(),BQ=class{constructor(e){this.metadata={appName:e.appName||"Dapp",appLogoUrl:e.appLogoUrl||(0,V1t.getFavicon)(),appChainIds:e.appChainIds||[]},this.storeLatestVersion()}makeWeb3Provider(e={options:"all"}){var r;let n={metadata:this.metadata,preference:e};return(r=(0,K1t.getCoinbaseInjectedProvider)(n))!==null&&r!==void 0?r:new H1t.CoinbaseWalletProvider(n)}getCoinbaseWalletLogo(e,r=240){return(0,q1t.walletLogo)(e,r)}storeLatestVersion(){new z1t.ScopedLocalStorage("CBWSDK").setItem("VERSION",W1t.LIB_VERSION)}};FO.CoinbaseWalletSDK=BQ});var zbe=X(N9=>{"use strict";Object.defineProperty(N9,"__esModule",{value:!0});N9.CoinbaseWalletSDK=void 0;var G1t=DQ();N9.default=G1t.CoinbaseWalletSDK;var Q1t=DQ();Object.defineProperty(N9,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return Q1t.CoinbaseWalletSDK}})});var Wbe=X($O=>{"use strict";Object.defineProperty($O,"__esModule",{value:!0});$O.walletLogo=void 0;var Z1t=(t,e)=>{let r;switch(t){case"standard":return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};$O.walletLogo=Z1t});var Vbe=X(qO=>{"use strict";Object.defineProperty(qO,"__esModule",{value:!0});qO.LINK_API_URL=void 0;qO.LINK_API_URL="https://www.walletlink.org"});var Kbe=X(()=>{});var O9=X((Gbe,LQ)=>{(function(t,e){"use strict";function r(f,h){if(!f)throw new Error(h||"Assertion failed")}function n(f,h){f.super_=h;var m=function(){};m.prototype=h.prototype,f.prototype=new m,f.prototype.constructor=f}function i(f,h,m){if(i.isBN(f))return f;this.negative=0,this.words=null,this.length=0,this.red=null,f!==null&&((h==="le"||h==="be")&&(m=h,h=10),this._init(f||0,h||10,m||"be"))}typeof t=="object"?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=Kbe().Buffer}catch{}i.isBN=function(h){return h instanceof i?!0:h!==null&&typeof h=="object"&&h.constructor.wordSize===i.wordSize&&Array.isArray(h.words)},i.max=function(h,m){return h.cmp(m)>0?h:m},i.min=function(h,m){return h.cmp(m)<0?h:m},i.prototype._init=function(h,m,b){if(typeof h=="number")return this._initNumber(h,m,b);if(typeof h=="object")return this._initArray(h,m,b);m==="hex"&&(m=16),r(m===(m|0)&&m>=2&&m<=36),h=h.toString().replace(/\s+/g,"");var C=0;h[0]==="-"&&(C++,this.negative=1),C<h.length&&(m===16?this._parseHex(h,C,b):(this._parseBase(h,m,C),b==="le"&&this._initArray(this.toArray(),m,b)))},i.prototype._initNumber=function(h,m,b){h<0&&(this.negative=1,h=-h),h<67108864?(this.words=[h&67108863],this.length=1):h<4503599627370496?(this.words=[h&67108863,h/67108864&67108863],this.length=2):(r(h<9007199254740992),this.words=[h&67108863,h/67108864&67108863,1],this.length=3),b==="le"&&this._initArray(this.toArray(),m,b)},i.prototype._initArray=function(h,m,b){if(r(typeof h.length=="number"),h.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(h.length/3),this.words=new Array(this.length);for(var C=0;C<this.length;C++)this.words[C]=0;var T,N,I=0;if(b==="be")for(C=h.length-1,T=0;C>=0;C-=3)N=h[C]|h[C-1]<<8|h[C-2]<<16,this.words[T]|=N<<I&67108863,this.words[T+1]=N>>>26-I&67108863,I+=24,I>=26&&(I-=26,T++);else if(b==="le")for(C=0,T=0;C<h.length;C+=3)N=h[C]|h[C+1]<<8|h[C+2]<<16,this.words[T]|=N<<I&67108863,this.words[T+1]=N>>>26-I&67108863,I+=24,I>=26&&(I-=26,T++);return this._strip()};function s(f,h){var m=f.charCodeAt(h);if(m>=48&&m<=57)return m-48;if(m>=65&&m<=70)return m-55;if(m>=97&&m<=102)return m-87;r(!1,"Invalid character in "+f)}function a(f,h,m){var b=s(f,m);return m-1>=h&&(b|=s(f,m-1)<<4),b}i.prototype._parseHex=function(h,m,b){this.length=Math.ceil((h.length-m)/6),this.words=new Array(this.length);for(var C=0;C<this.length;C++)this.words[C]=0;var T=0,N=0,I;if(b==="be")for(C=h.length-1;C>=m;C-=2)I=a(h,m,C)<<T,this.words[N]|=I&67108863,T>=18?(T-=18,N+=1,this.words[N]|=I>>>26):T+=8;else{var g=h.length-m;for(C=g%2===0?m+1:m;C<h.length;C+=2)I=a(h,m,C)<<T,this.words[N]|=I&67108863,T>=18?(T-=18,N+=1,this.words[N]|=I>>>26):T+=8}this._strip()};function l(f,h,m,b){for(var C=0,T=0,N=Math.min(f.length,m),I=h;I<N;I++){var g=f.charCodeAt(I)-48;C*=b,g>=49?T=g-49+10:g>=17?T=g-17+10:T=g,r(g>=0&&T<b,"Invalid character"),C+=T}return C}i.prototype._parseBase=function(h,m,b){this.words=[0],this.length=1;for(var C=0,T=1;T<=67108863;T*=m)C++;C--,T=T/m|0;for(var N=h.length-b,I=N%C,g=Math.min(N,N-I)+b,x=0,Q=b;Q<g;Q+=C)x=l(h,Q,Q+C,m),this.imuln(T),this.words[0]+x<67108864?this.words[0]+=x:this._iaddn(x);if(I!==0){var re=1;for(x=l(h,Q,h.length,m),Q=0;Q<I;Q++)re*=m;this.imuln(re),this.words[0]+x<67108864?this.words[0]+=x:this._iaddn(x)}this._strip()},i.prototype.copy=function(h){h.words=new Array(this.length);for(var m=0;m<this.length;m++)h.words[m]=this.words[m];h.length=this.length,h.negative=this.negative,h.red=this.red};function u(f,h){f.words=h.words,f.length=h.length,f.negative=h.negative,f.red=h.red}if(i.prototype._move=function(h){u(h,this)},i.prototype.clone=function(){var h=new i(null);return this.copy(h),h},i.prototype._expand=function(h){for(;this.length<h;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=d}catch{i.prototype.inspect=d}else i.prototype.inspect=d;function d(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var p=["","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"],v=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],y=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(h,m){h=h||10,m=m|0||1;var b;if(h===16||h==="hex"){b="";for(var C=0,T=0,N=0;N<this.length;N++){var I=this.words[N],g=((I<<C|T)&16777215).toString(16);T=I>>>24-C&16777215,C+=2,C>=26&&(C-=26,N--),T!==0||N!==this.length-1?b=p[6-g.length]+g+b:b=g+b}for(T!==0&&(b=T.toString(16)+b);b.length%m!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}if(h===(h|0)&&h>=2&&h<=36){var x=v[h],Q=y[h];b="";var re=this.clone();for(re.negative=0;!re.isZero();){var A=re.modrn(Q).toString(h);re=re.idivn(Q),re.isZero()?b=A+b:b=p[x-A.length]+A+b}for(this.isZero()&&(b="0"+b);b.length%m!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var h=this.words[0];return this.length===2?h+=this.words[1]*67108864:this.length===3&&this.words[2]===1?h+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-h:h},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(h,m){return this.toArrayLike(o,h,m)}),i.prototype.toArray=function(h,m){return this.toArrayLike(Array,h,m)};var S=function(h,m){return h.allocUnsafe?h.allocUnsafe(m):new h(m)};i.prototype.toArrayLike=function(h,m,b){this._strip();var C=this.byteLength(),T=b||Math.max(1,C);r(C<=T,"byte array longer than desired length"),r(T>0,"Requested array length <= 0");var N=S(h,T),I=m==="le"?"LE":"BE";return this["_toArrayLike"+I](N,C),N},i.prototype._toArrayLikeLE=function(h,m){for(var b=0,C=0,T=0,N=0;T<this.length;T++){var I=this.words[T]<<N|C;h[b++]=I&255,b<h.length&&(h[b++]=I>>8&255),b<h.length&&(h[b++]=I>>16&255),N===6?(b<h.length&&(h[b++]=I>>24&255),C=0,N=0):(C=I>>>24,N+=2)}if(b<h.length)for(h[b++]=C;b<h.length;)h[b++]=0},i.prototype._toArrayLikeBE=function(h,m){for(var b=h.length-1,C=0,T=0,N=0;T<this.length;T++){var I=this.words[T]<<N|C;h[b--]=I&255,b>=0&&(h[b--]=I>>8&255),b>=0&&(h[b--]=I>>16&255),N===6?(b>=0&&(h[b--]=I>>24&255),C=0,N=0):(C=I>>>24,N+=2)}if(b>=0)for(h[b--]=C;b>=0;)h[b--]=0},Math.clz32?i.prototype._countBits=function(h){return 32-Math.clz32(h)}:i.prototype._countBits=function(h){var m=h,b=0;return m>=4096&&(b+=13,m>>>=13),m>=64&&(b+=7,m>>>=7),m>=8&&(b+=4,m>>>=4),m>=2&&(b+=2,m>>>=2),b+m},i.prototype._zeroBits=function(h){if(h===0)return 26;var m=h,b=0;return m&8191||(b+=13,m>>>=13),m&127||(b+=7,m>>>=7),m&15||(b+=4,m>>>=4),m&3||(b+=2,m>>>=2),m&1||b++,b},i.prototype.bitLength=function(){var h=this.words[this.length-1],m=this._countBits(h);return(this.length-1)*26+m};function R(f){for(var h=new Array(f.bitLength()),m=0;m<h.length;m++){var b=m/26|0,C=m%26;h[m]=f.words[b]>>>C&1}return h}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var h=0,m=0;m<this.length;m++){var b=this._zeroBits(this.words[m]);if(h+=b,b!==26)break}return h},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(h){return this.negative!==0?this.abs().inotn(h).iaddn(1):this.clone()},i.prototype.fromTwos=function(h){return this.testn(h-1)?this.notn(h).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return this.negative!==0},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(h){for(;this.length<h.length;)this.words[this.length++]=0;for(var m=0;m<h.length;m++)this.words[m]=this.words[m]|h.words[m];return this._strip()},i.prototype.ior=function(h){return r((this.negative|h.negative)===0),this.iuor(h)},i.prototype.or=function(h){return this.length>h.length?this.clone().ior(h):h.clone().ior(this)},i.prototype.uor=function(h){return this.length>h.length?this.clone().iuor(h):h.clone().iuor(this)},i.prototype.iuand=function(h){var m;this.length>h.length?m=h:m=this;for(var b=0;b<m.length;b++)this.words[b]=this.words[b]&h.words[b];return this.length=m.length,this._strip()},i.prototype.iand=function(h){return r((this.negative|h.negative)===0),this.iuand(h)},i.prototype.and=function(h){return this.length>h.length?this.clone().iand(h):h.clone().iand(this)},i.prototype.uand=function(h){return this.length>h.length?this.clone().iuand(h):h.clone().iuand(this)},i.prototype.iuxor=function(h){var m,b;this.length>h.length?(m=this,b=h):(m=h,b=this);for(var C=0;C<b.length;C++)this.words[C]=m.words[C]^b.words[C];if(this!==m)for(;C<m.length;C++)this.words[C]=m.words[C];return this.length=m.length,this._strip()},i.prototype.ixor=function(h){return r((this.negative|h.negative)===0),this.iuxor(h)},i.prototype.xor=function(h){return this.length>h.length?this.clone().ixor(h):h.clone().ixor(this)},i.prototype.uxor=function(h){return this.length>h.length?this.clone().iuxor(h):h.clone().iuxor(this)},i.prototype.inotn=function(h){r(typeof h=="number"&&h>=0);var m=Math.ceil(h/26)|0,b=h%26;this._expand(m),b>0&&m--;for(var C=0;C<m;C++)this.words[C]=~this.words[C]&67108863;return b>0&&(this.words[C]=~this.words[C]&67108863>>26-b),this._strip()},i.prototype.notn=function(h){return this.clone().inotn(h)},i.prototype.setn=function(h,m){r(typeof h=="number"&&h>=0);var b=h/26|0,C=h%26;return this._expand(b+1),m?this.words[b]=this.words[b]|1<<C:this.words[b]=this.words[b]&~(1<<C),this._strip()},i.prototype.iadd=function(h){var m;if(this.negative!==0&&h.negative===0)return this.negative=0,m=this.isub(h),this.negative^=1,this._normSign();if(this.negative===0&&h.negative!==0)return h.negative=0,m=this.isub(h),h.negative=1,m._normSign();var b,C;this.length>h.length?(b=this,C=h):(b=h,C=this);for(var T=0,N=0;N<C.length;N++)m=(b.words[N]|0)+(C.words[N]|0)+T,this.words[N]=m&67108863,T=m>>>26;for(;T!==0&&N<b.length;N++)m=(b.words[N]|0)+T,this.words[N]=m&67108863,T=m>>>26;if(this.length=b.length,T!==0)this.words[this.length]=T,this.length++;else if(b!==this)for(;N<b.length;N++)this.words[N]=b.words[N];return this},i.prototype.add=function(h){var m;return h.negative!==0&&this.negative===0?(h.negative=0,m=this.sub(h),h.negative^=1,m):h.negative===0&&this.negative!==0?(this.negative=0,m=h.sub(this),this.negative=1,m):this.length>h.length?this.clone().iadd(h):h.clone().iadd(this)},i.prototype.isub=function(h){if(h.negative!==0){h.negative=0;var m=this.iadd(h);return h.negative=1,m._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(h),this.negative=1,this._normSign();var b=this.cmp(h);if(b===0)return this.negative=0,this.length=1,this.words[0]=0,this;var C,T;b>0?(C=this,T=h):(C=h,T=this);for(var N=0,I=0;I<T.length;I++)m=(C.words[I]|0)-(T.words[I]|0)+N,N=m>>26,this.words[I]=m&67108863;for(;N!==0&&I<C.length;I++)m=(C.words[I]|0)+N,N=m>>26,this.words[I]=m&67108863;if(N===0&&I<C.length&&C!==this)for(;I<C.length;I++)this.words[I]=C.words[I];return this.length=Math.max(this.length,I),C!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(h){return this.clone().isub(h)};function O(f,h,m){m.negative=h.negative^f.negative;var b=f.length+h.length|0;m.length=b,b=b-1|0;var C=f.words[0]|0,T=h.words[0]|0,N=C*T,I=N&67108863,g=N/67108864|0;m.words[0]=I;for(var x=1;x<b;x++){for(var Q=g>>>26,re=g&67108863,A=Math.min(x,h.length-1),G=Math.max(0,x-f.length+1);G<=A;G++){var Z=x-G|0;C=f.words[Z]|0,T=h.words[G]|0,N=C*T+re,Q+=N/67108864|0,re=N&67108863}m.words[x]=re|0,g=Q|0}return g!==0?m.words[x]=g|0:m.length--,m._strip()}var k=function(h,m,b){var C=h.words,T=m.words,N=b.words,I=0,g,x,Q,re=C[0]|0,A=re&8191,G=re>>>13,Z=C[1]|0,Y=Z&8191,ue=Z>>>13,fe=C[2]|0,ae=fe&8191,me=fe>>>13,Ce=C[3]|0,le=Ce&8191,Se=Ce>>>13,gt=C[4]|0,Qe=gt&8191,ur=gt>>>13,mt=C[5]|0,qe=mt&8191,Vt=mt>>>13,wt=C[6]|0,nt=wt&8191,er=wt>>>13,de=C[7]|0,ge=de&8191,be=de>>>13,ye=C[8]|0,_e=ye&8191,ft=ye>>>13,Ve=C[9]|0,Le=Ve&8191,Ut=Ve>>>13,Xe=T[0]|0,ze=Xe&8191,hr=Xe>>>13,bt=T[1]|0,tt=bt&8191,Er=bt>>>13,Et=T[2]|0,st=Et&8191,vr=Et>>>13,St=T[3]|0,at=St&8191,Cr=St>>>13,_t=T[4]|0,it=_t&8191,Ar=_t>>>13,Ct=T[5]|0,Ke=Ct&8191,ar=Ct>>>13,At=T[6]|0,ot=At&8191,kr=At>>>13,kt=T[7]|0,lt=kt&8191,Rr=kt>>>13,Rt=T[8]|0,ut=Rt&8191,Mr=Rt>>>13,Mt=T[9]|0,ct=Mt&8191,yr=Mt>>>13;b.negative=h.negative^m.negative,b.length=19,g=Math.imul(A,ze),x=Math.imul(A,hr),x=x+Math.imul(G,ze)|0,Q=Math.imul(G,hr);var An=(I+g|0)+((x&8191)<<13)|0;I=(Q+(x>>>13)|0)+(An>>>26)|0,An&=67108863,g=Math.imul(Y,ze),x=Math.imul(Y,hr),x=x+Math.imul(ue,ze)|0,Q=Math.imul(ue,hr),g=g+Math.imul(A,tt)|0,x=x+Math.imul(A,Er)|0,x=x+Math.imul(G,tt)|0,Q=Q+Math.imul(G,Er)|0;var Sn=(I+g|0)+((x&8191)<<13)|0;I=(Q+(x>>>13)|0)+(Sn>>>26)|0,Sn&=67108863,g=Math.imul(ae,ze),x=Math.imul(ae,hr),x=x+Math.imul(me,ze)|0,Q=Math.imul(me,hr),g=g+Math.imul(Y,tt)|0,x=x+Math.imul(Y,Er)|0,x=x+Math.imul(ue,tt)|0,Q=Q+Math.imul(ue,Er)|0,g=g+Math.imul(A,st)|0,x=x+Math.imul(A,vr)|0,x=x+Math.imul(G,st)|0,Q=Q+Math.imul(G,vr)|0;var _n=(I+g|0)+((x&8191)<<13)|0;I=(Q+(x>>>13)|0)+(_n>>>26)|0,_n&=67108863,g=Math.imul(le,ze),x=Math.imul(le,hr),x=x+Math.imul(Se,ze)|0,Q=Math.imul(Se,hr),g=g+Math.imul(ae,tt)|0,x=x+Math.imul(ae,Er)|0,x=x+Math.imul(me,tt)|0,Q=Q+Math.imul(me,Er)|0,g=g+Math.imul(Y,st)|0,x=x+Math.imul(Y,vr)|0,x=x+Math.imul(ue,st)|0,Q=Q+Math.imul(ue,vr)|0,g=g+Math.imul(A,at)|0,x=x+Math.imul(A,Cr)|0,x=x+Math.imul(G,at)|0,Q=Q+Math.imul(G,Cr)|0;var In=(I+g|0)+((x&8191)<<13)|0;I=(Q+(x>>>13)|0)+(In>>>26)|0,In&=67108863,g=Math.imul(Qe,ze),x=Math.imul(Qe,hr),x=x+Math.imul(ur,ze)|0,Q=Math.imul(ur,hr),g=g+Math.imul(le,tt)|0,x=x+Math.imul(le,Er)|0,x=x+Math.imul(Se,tt)|0,Q=Q+Math.imul(Se,Er)|0,g=g+Math.imul(ae,st)|0,x=x+Math.imul(ae,vr)|0,x=x+Math.imul(me,st)|0,Q=Q+Math.imul(me,vr)|0,g=g+Math.imul(Y,at)|0,x=x+Math.imul(Y,Cr)|0,x=x+Math.imul(ue,at)|0,Q=Q+Math.imul(ue,Cr)|0,g=g+Math.imul(A,it)|0,x=x+Math.imul(A,Ar)|0,x=x+Math.imul(G,it)|0,Q=Q+Math.imul(G,Ar)|0;var Tn=(I+g|0)+((x&8191)<<13)|0;I=(Q+(x>>>13)|0)+(Tn>>>26)|0,Tn&=67108863,g=Math.imul(qe,ze),x=Math.imul(qe,hr),x=x+Math.imul(Vt,ze)|0,Q=Math.imul(Vt,hr),g=g+Math.imul(Qe,tt)|0,x=x+Math.imul(Qe,Er)|0,x=x+Math.imul(ur,tt)|0,Q=Q+Math.imul(ur,Er)|0,g=g+Math.imul(le,st)|0,x=x+Math.imul(le,vr)|0,x=x+Math.imul(Se,st)|0,Q=Q+Math.imul(Se,vr)|0,g=g+Math.imul(ae,at)|0,x=x+Math.imul(ae,Cr)|0,x=x+Math.imul(me,at)|0,Q=Q+Math.imul(me,Cr)|0,g=g+Math.imul(Y,it)|0,x=x+Math.imul(Y,Ar)|0,x=x+Math.imul(ue,it)|0,Q=Q+Math.imul(ue,Ar)|0,g=g+Math.imul(A,Ke)|0,x=x+Math.imul(A,ar)|0,x=x+Math.imul(G,Ke)|0,Q=Q+Math.imul(G,ar)|0;var Gi=(I+g|0)+((x&8191)<<13)|0;I=(Q+(x>>>13)|0)+(Gi>>>26)|0,Gi&=67108863,g=Math.imul(nt,ze),x=Math.imul(nt,hr),x=x+Math.imul(er,ze)|0,Q=Math.imul(er,hr),g=g+Math.imul(qe,tt)|0,x=x+Math.imul(qe,Er)|0,x=x+Math.imul(Vt,tt)|0,Q=Q+Math.imul(Vt,Er)|0,g=g+Math.imul(Qe,st)|0,x=x+Math.imul(Qe,vr)|0,x=x+Math.imul(ur,st)|0,Q=Q+Math.imul(ur,vr)|0,g=g+Math.imul(le,at)|0,x=x+Math.imul(le,Cr)|0,x=x+Math.imul(Se,at)|0,Q=Q+Math.imul(Se,Cr)|0,g=g+Math.imul(ae,it)|0,x=x+Math.imul(ae,Ar)|0,x=x+Math.imul(me,it)|0,Q=Q+Math.imul(me,Ar)|0,g=g+Math.imul(Y,Ke)|0,x=x+Math.imul(Y,ar)|0,x=x+Math.imul(ue,Ke)|0,Q=Q+Math.imul(ue,ar)|0,g=g+Math.imul(A,ot)|0,x=x+Math.imul(A,kr)|0,x=x+Math.imul(G,ot)|0,Q=Q+Math.imul(G,kr)|0;var $o=(I+g|0)+((x&8191)<<13)|0;I=(Q+(x>>>13)|0)+($o>>>26)|0,$o&=67108863,g=Math.imul(ge,ze),x=Math.imul(ge,hr),x=x+Math.imul(be,ze)|0,Q=Math.imul(be,hr),g=g+Math.imul(nt,tt)|0,x=x+Math.imul(nt,Er)|0,x=x+Math.imul(er,tt)|0,Q=Q+Math.imul(er,Er)|0,g=g+Math.imul(qe,st)|0,x=x+Math.imul(qe,vr)|0,x=x+Math.imul(Vt,st)|0,Q=Q+Math.imul(Vt,vr)|0,g=g+Math.imul(Qe,at)|0,x=x+Math.imul(Qe,Cr)|0,x=x+Math.imul(ur,at)|0,Q=Q+Math.imul(ur,Cr)|0,g=g+Math.imul(le,it)|0,x=x+Math.imul(le,Ar)|0,x=x+Math.imul(Se,it)|0,Q=Q+Math.imul(Se,Ar)|0,g=g+Math.imul(ae,Ke)|0,x=x+Math.imul(ae,ar)|0,x=x+Math.imul(me,Ke)|0,Q=Q+Math.imul(me,ar)|0,g=g+Math.imul(Y,ot)|0,x=x+Math.imul(Y,kr)|0,x=x+Math.imul(ue,ot)|0,Q=Q+Math.imul(ue,kr)|0,g=g+Math.imul(A,lt)|0,x=x+Math.imul(A,Rr)|0,x=x+Math.imul(G,lt)|0,Q=Q+Math.imul(G,Rr)|0;var Qi=(I+g|0)+((x&8191)<<13)|0;I=(Q+(x>>>13)|0)+(Qi>>>26)|0,Qi&=67108863,g=Math.imul(_e,ze),x=Math.imul(_e,hr),x=x+Math.imul(ft,ze)|0,Q=Math.imul(ft,hr),g=g+Math.imul(ge,tt)|0,x=x+Math.imul(ge,Er)|0,x=x+Math.imul(be,tt)|0,Q=Q+Math.imul(be,Er)|0,g=g+Math.imul(nt,st)|0,x=x+Math.imul(nt,vr)|0,x=x+Math.imul(er,st)|0,Q=Q+Math.imul(er,vr)|0,g=g+Math.imul(qe,at)|0,x=x+Math.imul(qe,Cr)|0,x=x+Math.imul(Vt,at)|0,Q=Q+Math.imul(Vt,Cr)|0,g=g+Math.imul(Qe,it)|0,x=x+Math.imul(Qe,Ar)|0,x=x+Math.imul(ur,it)|0,Q=Q+Math.imul(ur,Ar)|0,g=g+Math.imul(le,Ke)|0,x=x+Math.imul(le,ar)|0,x=x+Math.imul(Se,Ke)|0,Q=Q+Math.imul(Se,ar)|0,g=g+Math.imul(ae,ot)|0,x=x+Math.imul(ae,kr)|0,x=x+Math.imul(me,ot)|0,Q=Q+Math.imul(me,kr)|0,g=g+Math.imul(Y,lt)|0,x=x+Math.imul(Y,Rr)|0,x=x+Math.imul(ue,lt)|0,Q=Q+Math.imul(ue,Rr)|0,g=g+Math.imul(A,ut)|0,x=x+Math.imul(A,Mr)|0,x=x+Math.imul(G,ut)|0,Q=Q+Math.imul(G,Mr)|0;var qo=(I+g|0)+((x&8191)<<13)|0;I=(Q+(x>>>13)|0)+(qo>>>26)|0,qo&=67108863,g=Math.imul(Le,ze),x=Math.imul(Le,hr),x=x+Math.imul(Ut,ze)|0,Q=Math.imul(Ut,hr),g=g+Math.imul(_e,tt)|0,x=x+Math.imul(_e,Er)|0,x=x+Math.imul(ft,tt)|0,Q=Q+Math.imul(ft,Er)|0,g=g+Math.imul(ge,st)|0,x=x+Math.imul(ge,vr)|0,x=x+Math.imul(be,st)|0,Q=Q+Math.imul(be,vr)|0,g=g+Math.imul(nt,at)|0,x=x+Math.imul(nt,Cr)|0,x=x+Math.imul(er,at)|0,Q=Q+Math.imul(er,Cr)|0,g=g+Math.imul(qe,it)|0,x=x+Math.imul(qe,Ar)|0,x=x+Math.imul(Vt,it)|0,Q=Q+Math.imul(Vt,Ar)|0,g=g+Math.imul(Qe,Ke)|0,x=x+Math.imul(Qe,ar)|0,x=x+Math.imul(ur,Ke)|0,Q=Q+Math.imul(ur,ar)|0,g=g+Math.imul(le,ot)|0,x=x+Math.imul(le,kr)|0,x=x+Math.imul(Se,ot)|0,Q=Q+Math.imul(Se,kr)|0,g=g+Math.imul(ae,lt)|0,x=x+Math.imul(ae,Rr)|0,x=x+Math.imul(me,lt)|0,Q=Q+Math.imul(me,Rr)|0,g=g+Math.imul(Y,ut)|0,x=x+Math.imul(Y,Mr)|0,x=x+Math.imul(ue,ut)|0,Q=Q+Math.imul(ue,Mr)|0,g=g+Math.imul(A,ct)|0,x=x+Math.imul(A,yr)|0,x=x+Math.imul(G,ct)|0,Q=Q+Math.imul(G,yr)|0;var Ho=(I+g|0)+((x&8191)<<13)|0;I=(Q+(x>>>13)|0)+(Ho>>>26)|0,Ho&=67108863,g=Math.imul(Le,tt),x=Math.imul(Le,Er),x=x+Math.imul(Ut,tt)|0,Q=Math.imul(Ut,Er),g=g+Math.imul(_e,st)|0,x=x+Math.imul(_e,vr)|0,x=x+Math.imul(ft,st)|0,Q=Q+Math.imul(ft,vr)|0,g=g+Math.imul(ge,at)|0,x=x+Math.imul(ge,Cr)|0,x=x+Math.imul(be,at)|0,Q=Q+Math.imul(be,Cr)|0,g=g+Math.imul(nt,it)|0,x=x+Math.imul(nt,Ar)|0,x=x+Math.imul(er,it)|0,Q=Q+Math.imul(er,Ar)|0,g=g+Math.imul(qe,Ke)|0,x=x+Math.imul(qe,ar)|0,x=x+Math.imul(Vt,Ke)|0,Q=Q+Math.imul(Vt,ar)|0,g=g+Math.imul(Qe,ot)|0,x=x+Math.imul(Qe,kr)|0,x=x+Math.imul(ur,ot)|0,Q=Q+Math.imul(ur,kr)|0,g=g+Math.imul(le,lt)|0,x=x+Math.imul(le,Rr)|0,x=x+Math.imul(Se,lt)|0,Q=Q+Math.imul(Se,Rr)|0,g=g+Math.imul(ae,ut)|0,x=x+Math.imul(ae,Mr)|0,x=x+Math.imul(me,ut)|0,Q=Q+Math.imul(me,Mr)|0,g=g+Math.imul(Y,ct)|0,x=x+Math.imul(Y,yr)|0,x=x+Math.imul(ue,ct)|0,Q=Q+Math.imul(ue,yr)|0;var zo=(I+g|0)+((x&8191)<<13)|0;I=(Q+(x>>>13)|0)+(zo>>>26)|0,zo&=67108863,g=Math.imul(Le,st),x=Math.imul(Le,vr),x=x+Math.imul(Ut,st)|0,Q=Math.imul(Ut,vr),g=g+Math.imul(_e,at)|0,x=x+Math.imul(_e,Cr)|0,x=x+Math.imul(ft,at)|0,Q=Q+Math.imul(ft,Cr)|0,g=g+Math.imul(ge,it)|0,x=x+Math.imul(ge,Ar)|0,x=x+Math.imul(be,it)|0,Q=Q+Math.imul(be,Ar)|0,g=g+Math.imul(nt,Ke)|0,x=x+Math.imul(nt,ar)|0,x=x+Math.imul(er,Ke)|0,Q=Q+Math.imul(er,ar)|0,g=g+Math.imul(qe,ot)|0,x=x+Math.imul(qe,kr)|0,x=x+Math.imul(Vt,ot)|0,Q=Q+Math.imul(Vt,kr)|0,g=g+Math.imul(Qe,lt)|0,x=x+Math.imul(Qe,Rr)|0,x=x+Math.imul(ur,lt)|0,Q=Q+Math.imul(ur,Rr)|0,g=g+Math.imul(le,ut)|0,x=x+Math.imul(le,Mr)|0,x=x+Math.imul(Se,ut)|0,Q=Q+Math.imul(Se,Mr)|0,g=g+Math.imul(ae,ct)|0,x=x+Math.imul(ae,yr)|0,x=x+Math.imul(me,ct)|0,Q=Q+Math.imul(me,yr)|0;var Co=(I+g|0)+((x&8191)<<13)|0;I=(Q+(x>>>13)|0)+(Co>>>26)|0,Co&=67108863,g=Math.imul(Le,at),x=Math.imul(Le,Cr),x=x+Math.imul(Ut,at)|0,Q=Math.imul(Ut,Cr),g=g+Math.imul(_e,it)|0,x=x+Math.imul(_e,Ar)|0,x=x+Math.imul(ft,it)|0,Q=Q+Math.imul(ft,Ar)|0,g=g+Math.imul(ge,Ke)|0,x=x+Math.imul(ge,ar)|0,x=x+Math.imul(be,Ke)|0,Q=Q+Math.imul(be,ar)|0,g=g+Math.imul(nt,ot)|0,x=x+Math.imul(nt,kr)|0,x=x+Math.imul(er,ot)|0,Q=Q+Math.imul(er,kr)|0,g=g+Math.imul(qe,lt)|0,x=x+Math.imul(qe,Rr)|0,x=x+Math.imul(Vt,lt)|0,Q=Q+Math.imul(Vt,Rr)|0,g=g+Math.imul(Qe,ut)|0,x=x+Math.imul(Qe,Mr)|0,x=x+Math.imul(ur,ut)|0,Q=Q+Math.imul(ur,Mr)|0,g=g+Math.imul(le,ct)|0,x=x+Math.imul(le,yr)|0,x=x+Math.imul(Se,ct)|0,Q=Q+Math.imul(Se,yr)|0;var Ao=(I+g|0)+((x&8191)<<13)|0;I=(Q+(x>>>13)|0)+(Ao>>>26)|0,Ao&=67108863,g=Math.imul(Le,it),x=Math.imul(Le,Ar),x=x+Math.imul(Ut,it)|0,Q=Math.imul(Ut,Ar),g=g+Math.imul(_e,Ke)|0,x=x+Math.imul(_e,ar)|0,x=x+Math.imul(ft,Ke)|0,Q=Q+Math.imul(ft,ar)|0,g=g+Math.imul(ge,ot)|0,x=x+Math.imul(ge,kr)|0,x=x+Math.imul(be,ot)|0,Q=Q+Math.imul(be,kr)|0,g=g+Math.imul(nt,lt)|0,x=x+Math.imul(nt,Rr)|0,x=x+Math.imul(er,lt)|0,Q=Q+Math.imul(er,Rr)|0,g=g+Math.imul(qe,ut)|0,x=x+Math.imul(qe,Mr)|0,x=x+Math.imul(Vt,ut)|0,Q=Q+Math.imul(Vt,Mr)|0,g=g+Math.imul(Qe,ct)|0,x=x+Math.imul(Qe,yr)|0,x=x+Math.imul(ur,ct)|0,Q=Q+Math.imul(ur,yr)|0;var So=(I+g|0)+((x&8191)<<13)|0;I=(Q+(x>>>13)|0)+(So>>>26)|0,So&=67108863,g=Math.imul(Le,Ke),x=Math.imul(Le,ar),x=x+Math.imul(Ut,Ke)|0,Q=Math.imul(Ut,ar),g=g+Math.imul(_e,ot)|0,x=x+Math.imul(_e,kr)|0,x=x+Math.imul(ft,ot)|0,Q=Q+Math.imul(ft,kr)|0,g=g+Math.imul(ge,lt)|0,x=x+Math.imul(ge,Rr)|0,x=x+Math.imul(be,lt)|0,Q=Q+Math.imul(be,Rr)|0,g=g+Math.imul(nt,ut)|0,x=x+Math.imul(nt,Mr)|0,x=x+Math.imul(er,ut)|0,Q=Q+Math.imul(er,Mr)|0,g=g+Math.imul(qe,ct)|0,x=x+Math.imul(qe,yr)|0,x=x+Math.imul(Vt,ct)|0,Q=Q+Math.imul(Vt,yr)|0;var ta=(I+g|0)+((x&8191)<<13)|0;I=(Q+(x>>>13)|0)+(ta>>>26)|0,ta&=67108863,g=Math.imul(Le,ot),x=Math.imul(Le,kr),x=x+Math.imul(Ut,ot)|0,Q=Math.imul(Ut,kr),g=g+Math.imul(_e,lt)|0,x=x+Math.imul(_e,Rr)|0,x=x+Math.imul(ft,lt)|0,Q=Q+Math.imul(ft,Rr)|0,g=g+Math.imul(ge,ut)|0,x=x+Math.imul(ge,Mr)|0,x=x+Math.imul(be,ut)|0,Q=Q+Math.imul(be,Mr)|0,g=g+Math.imul(nt,ct)|0,x=x+Math.imul(nt,yr)|0,x=x+Math.imul(er,ct)|0,Q=Q+Math.imul(er,yr)|0;var ra=(I+g|0)+((x&8191)<<13)|0;I=(Q+(x>>>13)|0)+(ra>>>26)|0,ra&=67108863,g=Math.imul(Le,lt),x=Math.imul(Le,Rr),x=x+Math.imul(Ut,lt)|0,Q=Math.imul(Ut,Rr),g=g+Math.imul(_e,ut)|0,x=x+Math.imul(_e,Mr)|0,x=x+Math.imul(ft,ut)|0,Q=Q+Math.imul(ft,Mr)|0,g=g+Math.imul(ge,ct)|0,x=x+Math.imul(ge,yr)|0,x=x+Math.imul(be,ct)|0,Q=Q+Math.imul(be,yr)|0;var na=(I+g|0)+((x&8191)<<13)|0;I=(Q+(x>>>13)|0)+(na>>>26)|0,na&=67108863,g=Math.imul(Le,ut),x=Math.imul(Le,Mr),x=x+Math.imul(Ut,ut)|0,Q=Math.imul(Ut,Mr),g=g+Math.imul(_e,ct)|0,x=x+Math.imul(_e,yr)|0,x=x+Math.imul(ft,ct)|0,Q=Q+Math.imul(ft,yr)|0;var ia=(I+g|0)+((x&8191)<<13)|0;I=(Q+(x>>>13)|0)+(ia>>>26)|0,ia&=67108863,g=Math.imul(Le,ct),x=Math.imul(Le,yr),x=x+Math.imul(Ut,ct)|0,Q=Math.imul(Ut,yr);var Wb=(I+g|0)+((x&8191)<<13)|0;return I=(Q+(x>>>13)|0)+(Wb>>>26)|0,Wb&=67108863,N[0]=An,N[1]=Sn,N[2]=_n,N[3]=In,N[4]=Tn,N[5]=Gi,N[6]=$o,N[7]=Qi,N[8]=qo,N[9]=Ho,N[10]=zo,N[11]=Co,N[12]=Ao,N[13]=So,N[14]=ta,N[15]=ra,N[16]=na,N[17]=ia,N[18]=Wb,I!==0&&(N[19]=I,b.length++),b};Math.imul||(k=O);function M(f,h,m){m.negative=h.negative^f.negative,m.length=f.length+h.length;for(var b=0,C=0,T=0;T<m.length-1;T++){var N=C;C=0;for(var I=b&67108863,g=Math.min(T,h.length-1),x=Math.max(0,T-f.length+1);x<=g;x++){var Q=T-x,re=f.words[Q]|0,A=h.words[x]|0,G=re*A,Z=G&67108863;N=N+(G/67108864|0)|0,Z=Z+I|0,I=Z&67108863,N=N+(Z>>>26)|0,C+=N>>>26,N&=67108863}m.words[T]=I,b=N,N=C}return b!==0?m.words[T]=b:m.length--,m._strip()}function D(f,h,m){return M(f,h,m)}i.prototype.mulTo=function(h,m){var b,C=this.length+h.length;return this.length===10&&h.length===10?b=k(this,h,m):C<63?b=O(this,h,m):C<1024?b=M(this,h,m):b=D(this,h,m),b};function j(f,h){this.x=f,this.y=h}j.prototype.makeRBT=function(h){for(var m=new Array(h),b=i.prototype._countBits(h)-1,C=0;C<h;C++)m[C]=this.revBin(C,b,h);return m},j.prototype.revBin=function(h,m,b){if(h===0||h===b-1)return h;for(var C=0,T=0;T<m;T++)C|=(h&1)<<m-T-1,h>>=1;return C},j.prototype.permute=function(h,m,b,C,T,N){for(var I=0;I<N;I++)C[I]=m[h[I]],T[I]=b[h[I]]},j.prototype.transform=function(h,m,b,C,T,N){this.permute(N,h,m,b,C,T);for(var I=1;I<T;I<<=1)for(var g=I<<1,x=Math.cos(2*Math.PI/g),Q=Math.sin(2*Math.PI/g),re=0;re<T;re+=g)for(var A=x,G=Q,Z=0;Z<I;Z++){var Y=b[re+Z],ue=C[re+Z],fe=b[re+Z+I],ae=C[re+Z+I],me=A*fe-G*ae;ae=A*ae+G*fe,fe=me,b[re+Z]=Y+fe,C[re+Z]=ue+ae,b[re+Z+I]=Y-fe,C[re+Z+I]=ue-ae,Z!==g&&(me=x*A-Q*G,G=x*G+Q*A,A=me)}},j.prototype.guessLen13b=function(h,m){var b=Math.max(m,h)|1,C=b&1,T=0;for(b=b/2|0;b;b=b>>>1)T++;return 1<<T+1+C},j.prototype.conjugate=function(h,m,b){if(!(b<=1))for(var C=0;C<b/2;C++){var T=h[C];h[C]=h[b-C-1],h[b-C-1]=T,T=m[C],m[C]=-m[b-C-1],m[b-C-1]=-T}},j.prototype.normalize13b=function(h,m){for(var b=0,C=0;C<m/2;C++){var T=Math.round(h[2*C+1]/m)*8192+Math.round(h[2*C]/m)+b;h[C]=T&67108863,T<67108864?b=0:b=T/67108864|0}return h},j.prototype.convert13b=function(h,m,b,C){for(var T=0,N=0;N<m;N++)T=T+(h[N]|0),b[2*N]=T&8191,T=T>>>13,b[2*N+1]=T&8191,T=T>>>13;for(N=2*m;N<C;++N)b[N]=0;r(T===0),r((T&-8192)===0)},j.prototype.stub=function(h){for(var m=new Array(h),b=0;b<h;b++)m[b]=0;return m},j.prototype.mulp=function(h,m,b){var C=2*this.guessLen13b(h.length,m.length),T=this.makeRBT(C),N=this.stub(C),I=new Array(C),g=new Array(C),x=new Array(C),Q=new Array(C),re=new Array(C),A=new Array(C),G=b.words;G.length=C,this.convert13b(h.words,h.length,I,C),this.convert13b(m.words,m.length,Q,C),this.transform(I,N,g,x,C,T),this.transform(Q,N,re,A,C,T);for(var Z=0;Z<C;Z++){var Y=g[Z]*re[Z]-x[Z]*A[Z];x[Z]=g[Z]*A[Z]+x[Z]*re[Z],g[Z]=Y}return this.conjugate(g,x,C),this.transform(g,x,G,N,C,T),this.conjugate(G,N,C),this.normalize13b(G,C),b.negative=h.negative^m.negative,b.length=h.length+m.length,b._strip()},i.prototype.mul=function(h){var m=new i(null);return m.words=new Array(this.length+h.length),this.mulTo(h,m)},i.prototype.mulf=function(h){var m=new i(null);return m.words=new Array(this.length+h.length),D(this,h,m)},i.prototype.imul=function(h){return this.clone().mulTo(h,this)},i.prototype.imuln=function(h){var m=h<0;m&&(h=-h),r(typeof h=="number"),r(h<67108864);for(var b=0,C=0;C<this.length;C++){var T=(this.words[C]|0)*h,N=(T&67108863)+(b&67108863);b>>=26,b+=T/67108864|0,b+=N>>>26,this.words[C]=N&67108863}return b!==0&&(this.words[C]=b,this.length++),m?this.ineg():this},i.prototype.muln=function(h){return this.clone().imuln(h)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(h){var m=R(h);if(m.length===0)return new i(1);for(var b=this,C=0;C<m.length&&m[C]===0;C++,b=b.sqr());if(++C<m.length)for(var T=b.sqr();C<m.length;C++,T=T.sqr())m[C]!==0&&(b=b.mul(T));return b},i.prototype.iushln=function(h){r(typeof h=="number"&&h>=0);var m=h%26,b=(h-m)/26,C=67108863>>>26-m<<26-m,T;if(m!==0){var N=0;for(T=0;T<this.length;T++){var I=this.words[T]&C,g=(this.words[T]|0)-I<<m;this.words[T]=g|N,N=I>>>26-m}N&&(this.words[T]=N,this.length++)}if(b!==0){for(T=this.length-1;T>=0;T--)this.words[T+b]=this.words[T];for(T=0;T<b;T++)this.words[T]=0;this.length+=b}return this._strip()},i.prototype.ishln=function(h){return r(this.negative===0),this.iushln(h)},i.prototype.iushrn=function(h,m,b){r(typeof h=="number"&&h>=0);var C;m?C=(m-m%26)/26:C=0;var T=h%26,N=Math.min((h-T)/26,this.length),I=67108863^67108863>>>T<<T,g=b;if(C-=N,C=Math.max(0,C),g){for(var x=0;x<N;x++)g.words[x]=this.words[x];g.length=N}if(N!==0)if(this.length>N)for(this.length-=N,x=0;x<this.length;x++)this.words[x]=this.words[x+N];else this.words[0]=0,this.length=1;var Q=0;for(x=this.length-1;x>=0&&(Q!==0||x>=C);x--){var re=this.words[x]|0;this.words[x]=Q<<26-T|re>>>T,Q=re&I}return g&&Q!==0&&(g.words[g.length++]=Q),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(h,m,b){return r(this.negative===0),this.iushrn(h,m,b)},i.prototype.shln=function(h){return this.clone().ishln(h)},i.prototype.ushln=function(h){return this.clone().iushln(h)},i.prototype.shrn=function(h){return this.clone().ishrn(h)},i.prototype.ushrn=function(h){return this.clone().iushrn(h)},i.prototype.testn=function(h){r(typeof h=="number"&&h>=0);var m=h%26,b=(h-m)/26,C=1<<m;if(this.length<=b)return!1;var T=this.words[b];return!!(T&C)},i.prototype.imaskn=function(h){r(typeof h=="number"&&h>=0);var m=h%26,b=(h-m)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=b)return this;if(m!==0&&b++,this.length=Math.min(b,this.length),m!==0){var C=67108863^67108863>>>m<<m;this.words[this.length-1]&=C}return this._strip()},i.prototype.maskn=function(h){return this.clone().imaskn(h)},i.prototype.iaddn=function(h){return r(typeof h=="number"),r(h<67108864),h<0?this.isubn(-h):this.negative!==0?this.length===1&&(this.words[0]|0)<=h?(this.words[0]=h-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(h),this.negative=1,this):this._iaddn(h)},i.prototype._iaddn=function(h){this.words[0]+=h;for(var m=0;m<this.length&&this.words[m]>=67108864;m++)this.words[m]-=67108864,m===this.length-1?this.words[m+1]=1:this.words[m+1]++;return this.length=Math.max(this.length,m+1),this},i.prototype.isubn=function(h){if(r(typeof h=="number"),r(h<67108864),h<0)return this.iaddn(-h);if(this.negative!==0)return this.negative=0,this.iaddn(h),this.negative=1,this;if(this.words[0]-=h,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var m=0;m<this.length&&this.words[m]<0;m++)this.words[m]+=67108864,this.words[m+1]-=1;return this._strip()},i.prototype.addn=function(h){return this.clone().iaddn(h)},i.prototype.subn=function(h){return this.clone().isubn(h)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(h,m,b){var C=h.length+b,T;this._expand(C);var N,I=0;for(T=0;T<h.length;T++){N=(this.words[T+b]|0)+I;var g=(h.words[T]|0)*m;N-=g&67108863,I=(N>>26)-(g/67108864|0),this.words[T+b]=N&67108863}for(;T<this.length-b;T++)N=(this.words[T+b]|0)+I,I=N>>26,this.words[T+b]=N&67108863;if(I===0)return this._strip();for(r(I===-1),I=0,T=0;T<this.length;T++)N=-(this.words[T]|0)+I,I=N>>26,this.words[T]=N&67108863;return this.negative=1,this._strip()},i.prototype._wordDiv=function(h,m){var b=this.length-h.length,C=this.clone(),T=h,N=T.words[T.length-1]|0,I=this._countBits(N);b=26-I,b!==0&&(T=T.ushln(b),C.iushln(b),N=T.words[T.length-1]|0);var g=C.length-T.length,x;if(m!=="mod"){x=new i(null),x.length=g+1,x.words=new Array(x.length);for(var Q=0;Q<x.length;Q++)x.words[Q]=0}var re=C.clone()._ishlnsubmul(T,1,g);re.negative===0&&(C=re,x&&(x.words[g]=1));for(var A=g-1;A>=0;A--){var G=(C.words[T.length+A]|0)*67108864+(C.words[T.length+A-1]|0);for(G=Math.min(G/N|0,67108863),C._ishlnsubmul(T,G,A);C.negative!==0;)G--,C.negative=0,C._ishlnsubmul(T,1,A),C.isZero()||(C.negative^=1);x&&(x.words[A]=G)}return x&&x._strip(),C._strip(),m!=="div"&&b!==0&&C.iushrn(b),{div:x||null,mod:C}},i.prototype.divmod=function(h,m,b){if(r(!h.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var C,T,N;return this.negative!==0&&h.negative===0?(N=this.neg().divmod(h,m),m!=="mod"&&(C=N.div.neg()),m!=="div"&&(T=N.mod.neg(),b&&T.negative!==0&&T.iadd(h)),{div:C,mod:T}):this.negative===0&&h.negative!==0?(N=this.divmod(h.neg(),m),m!=="mod"&&(C=N.div.neg()),{div:C,mod:N.mod}):this.negative&h.negative?(N=this.neg().divmod(h.neg(),m),m!=="div"&&(T=N.mod.neg(),b&&T.negative!==0&&T.isub(h)),{div:N.div,mod:T}):h.length>this.length||this.cmp(h)<0?{div:new i(0),mod:this}:h.length===1?m==="div"?{div:this.divn(h.words[0]),mod:null}:m==="mod"?{div:null,mod:new i(this.modrn(h.words[0]))}:{div:this.divn(h.words[0]),mod:new i(this.modrn(h.words[0]))}:this._wordDiv(h,m)},i.prototype.div=function(h){return this.divmod(h,"div",!1).div},i.prototype.mod=function(h){return this.divmod(h,"mod",!1).mod},i.prototype.umod=function(h){return this.divmod(h,"mod",!0).mod},i.prototype.divRound=function(h){var m=this.divmod(h);if(m.mod.isZero())return m.div;var b=m.div.negative!==0?m.mod.isub(h):m.mod,C=h.ushrn(1),T=h.andln(1),N=b.cmp(C);return N<0||T===1&&N===0?m.div:m.div.negative!==0?m.div.isubn(1):m.div.iaddn(1)},i.prototype.modrn=function(h){var m=h<0;m&&(h=-h),r(h<=67108863);for(var b=(1<<26)%h,C=0,T=this.length-1;T>=0;T--)C=(b*C+(this.words[T]|0))%h;return m?-C:C},i.prototype.modn=function(h){return this.modrn(h)},i.prototype.idivn=function(h){var m=h<0;m&&(h=-h),r(h<=67108863);for(var b=0,C=this.length-1;C>=0;C--){var T=(this.words[C]|0)+b*67108864;this.words[C]=T/h|0,b=T%h}return this._strip(),m?this.ineg():this},i.prototype.divn=function(h){return this.clone().idivn(h)},i.prototype.egcd=function(h){r(h.negative===0),r(!h.isZero());var m=this,b=h.clone();m.negative!==0?m=m.umod(h):m=m.clone();for(var C=new i(1),T=new i(0),N=new i(0),I=new i(1),g=0;m.isEven()&&b.isEven();)m.iushrn(1),b.iushrn(1),++g;for(var x=b.clone(),Q=m.clone();!m.isZero();){for(var re=0,A=1;!(m.words[0]&A)&&re<26;++re,A<<=1);if(re>0)for(m.iushrn(re);re-- >0;)(C.isOdd()||T.isOdd())&&(C.iadd(x),T.isub(Q)),C.iushrn(1),T.iushrn(1);for(var G=0,Z=1;!(b.words[0]&Z)&&G<26;++G,Z<<=1);if(G>0)for(b.iushrn(G);G-- >0;)(N.isOdd()||I.isOdd())&&(N.iadd(x),I.isub(Q)),N.iushrn(1),I.iushrn(1);m.cmp(b)>=0?(m.isub(b),C.isub(N),T.isub(I)):(b.isub(m),N.isub(C),I.isub(T))}return{a:N,b:I,gcd:b.iushln(g)}},i.prototype._invmp=function(h){r(h.negative===0),r(!h.isZero());var m=this,b=h.clone();m.negative!==0?m=m.umod(h):m=m.clone();for(var C=new i(1),T=new i(0),N=b.clone();m.cmpn(1)>0&&b.cmpn(1)>0;){for(var I=0,g=1;!(m.words[0]&g)&&I<26;++I,g<<=1);if(I>0)for(m.iushrn(I);I-- >0;)C.isOdd()&&C.iadd(N),C.iushrn(1);for(var x=0,Q=1;!(b.words[0]&Q)&&x<26;++x,Q<<=1);if(x>0)for(b.iushrn(x);x-- >0;)T.isOdd()&&T.iadd(N),T.iushrn(1);m.cmp(b)>=0?(m.isub(b),C.isub(T)):(b.isub(m),T.isub(C))}var re;return m.cmpn(1)===0?re=C:re=T,re.cmpn(0)<0&&re.iadd(h),re},i.prototype.gcd=function(h){if(this.isZero())return h.abs();if(h.isZero())return this.abs();var m=this.clone(),b=h.clone();m.negative=0,b.negative=0;for(var C=0;m.isEven()&&b.isEven();C++)m.iushrn(1),b.iushrn(1);do{for(;m.isEven();)m.iushrn(1);for(;b.isEven();)b.iushrn(1);var T=m.cmp(b);if(T<0){var N=m;m=b,b=N}else if(T===0||b.cmpn(1)===0)break;m.isub(b)}while(!0);return b.iushln(C)},i.prototype.invm=function(h){return this.egcd(h).a.umod(h)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(h){return this.words[0]&h},i.prototype.bincn=function(h){r(typeof h=="number");var m=h%26,b=(h-m)/26,C=1<<m;if(this.length<=b)return this._expand(b+1),this.words[b]|=C,this;for(var T=C,N=b;T!==0&&N<this.length;N++){var I=this.words[N]|0;I+=T,T=I>>>26,I&=67108863,this.words[N]=I}return T!==0&&(this.words[N]=T,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(h){var m=h<0;if(this.negative!==0&&!m)return-1;if(this.negative===0&&m)return 1;this._strip();var b;if(this.length>1)b=1;else{m&&(h=-h),r(h<=67108863,"Number is too big");var C=this.words[0]|0;b=C===h?0:C<h?-1:1}return this.negative!==0?-b|0:b},i.prototype.cmp=function(h){if(this.negative!==0&&h.negative===0)return-1;if(this.negative===0&&h.negative!==0)return 1;var m=this.ucmp(h);return this.negative!==0?-m|0:m},i.prototype.ucmp=function(h){if(this.length>h.length)return 1;if(this.length<h.length)return-1;for(var m=0,b=this.length-1;b>=0;b--){var C=this.words[b]|0,T=h.words[b]|0;if(C!==T){C<T?m=-1:C>T&&(m=1);break}}return m},i.prototype.gtn=function(h){return this.cmpn(h)===1},i.prototype.gt=function(h){return this.cmp(h)===1},i.prototype.gten=function(h){return this.cmpn(h)>=0},i.prototype.gte=function(h){return this.cmp(h)>=0},i.prototype.ltn=function(h){return this.cmpn(h)===-1},i.prototype.lt=function(h){return this.cmp(h)===-1},i.prototype.lten=function(h){return this.cmpn(h)<=0},i.prototype.lte=function(h){return this.cmp(h)<=0},i.prototype.eqn=function(h){return this.cmpn(h)===0},i.prototype.eq=function(h){return this.cmp(h)===0},i.red=function(h){return new L(h)},i.prototype.toRed=function(h){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),h.convertTo(this)._forceRed(h)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(h){return this.red=h,this},i.prototype.forceRed=function(h){return r(!this.red,"Already a number in reduction context"),this._forceRed(h)},i.prototype.redAdd=function(h){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,h)},i.prototype.redIAdd=function(h){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,h)},i.prototype.redSub=function(h){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,h)},i.prototype.redISub=function(h){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,h)},i.prototype.redShl=function(h){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,h)},i.prototype.redMul=function(h){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.mul(this,h)},i.prototype.redIMul=function(h){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.imul(this,h)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(h){return r(this.red&&!h.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,h)};var q={k256:null,p224:null,p192:null,p25519:null};function W(f,h){this.name=f,this.p=new i(h,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}W.prototype._tmp=function(){var h=new i(null);return h.words=new Array(Math.ceil(this.n/13)),h},W.prototype.ireduce=function(h){var m=h,b;do this.split(m,this.tmp),m=this.imulK(m),m=m.iadd(this.tmp),b=m.bitLength();while(b>this.n);var C=b<this.n?-1:m.ucmp(this.p);return C===0?(m.words[0]=0,m.length=1):C>0?m.isub(this.p):m.strip!==void 0?m.strip():m._strip(),m},W.prototype.split=function(h,m){h.iushrn(this.n,0,m)},W.prototype.imulK=function(h){return h.imul(this.k)};function V(){W.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(V,W),V.prototype.split=function(h,m){for(var b=4194303,C=Math.min(h.length,9),T=0;T<C;T++)m.words[T]=h.words[T];if(m.length=C,h.length<=9){h.words[0]=0,h.length=1;return}var N=h.words[9];for(m.words[m.length++]=N&b,T=10;T<h.length;T++){var I=h.words[T]|0;h.words[T-10]=(I&b)<<4|N>>>22,N=I}N>>>=22,h.words[T-10]=N,N===0&&h.length>10?h.length-=10:h.length-=9},V.prototype.imulK=function(h){h.words[h.length]=0,h.words[h.length+1]=0,h.length+=2;for(var m=0,b=0;b<h.length;b++){var C=h.words[b]|0;m+=C*977,h.words[b]=m&67108863,m=C*64+(m/67108864|0)}return h.words[h.length-1]===0&&(h.length--,h.words[h.length-1]===0&&h.length--),h};function P(){W.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(P,W);function $(){W.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n($,W);function U(){W.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(U,W),U.prototype.imulK=function(h){for(var m=0,b=0;b<h.length;b++){var C=(h.words[b]|0)*19+m,T=C&67108863;C>>>=26,h.words[b]=T,m=C}return m!==0&&(h.words[h.length++]=m),h},i._prime=function(h){if(q[h])return q[h];var m;if(h==="k256")m=new V;else if(h==="p224")m=new P;else if(h==="p192")m=new $;else if(h==="p25519")m=new U;else throw new Error("Unknown prime "+h);return q[h]=m,m};function L(f){if(typeof f=="string"){var h=i._prime(f);this.m=h.p,this.prime=h}else r(f.gtn(1),"modulus must be greater than 1"),this.m=f,this.prime=null}L.prototype._verify1=function(h){r(h.negative===0,"red works only with positives"),r(h.red,"red works only with red numbers")},L.prototype._verify2=function(h,m){r((h.negative|m.negative)===0,"red works only with positives"),r(h.red&&h.red===m.red,"red works only with red numbers")},L.prototype.imod=function(h){return this.prime?this.prime.ireduce(h)._forceRed(this):(u(h,h.umod(this.m)._forceRed(this)),h)},L.prototype.neg=function(h){return h.isZero()?h.clone():this.m.sub(h)._forceRed(this)},L.prototype.add=function(h,m){this._verify2(h,m);var b=h.add(m);return b.cmp(this.m)>=0&&b.isub(this.m),b._forceRed(this)},L.prototype.iadd=function(h,m){this._verify2(h,m);var b=h.iadd(m);return b.cmp(this.m)>=0&&b.isub(this.m),b},L.prototype.sub=function(h,m){this._verify2(h,m);var b=h.sub(m);return b.cmpn(0)<0&&b.iadd(this.m),b._forceRed(this)},L.prototype.isub=function(h,m){this._verify2(h,m);var b=h.isub(m);return b.cmpn(0)<0&&b.iadd(this.m),b},L.prototype.shl=function(h,m){return this._verify1(h),this.imod(h.ushln(m))},L.prototype.imul=function(h,m){return this._verify2(h,m),this.imod(h.imul(m))},L.prototype.mul=function(h,m){return this._verify2(h,m),this.imod(h.mul(m))},L.prototype.isqr=function(h){return this.imul(h,h.clone())},L.prototype.sqr=function(h){return this.mul(h,h)},L.prototype.sqrt=function(h){if(h.isZero())return h.clone();var m=this.m.andln(3);if(r(m%2===1),m===3){var b=this.m.add(new i(1)).iushrn(2);return this.pow(h,b)}for(var C=this.m.subn(1),T=0;!C.isZero()&&C.andln(1)===0;)T++,C.iushrn(1);r(!C.isZero());var N=new i(1).toRed(this),I=N.redNeg(),g=this.m.subn(1).iushrn(1),x=this.m.bitLength();for(x=new i(2*x*x).toRed(this);this.pow(x,g).cmp(I)!==0;)x.redIAdd(I);for(var Q=this.pow(x,C),re=this.pow(h,C.addn(1).iushrn(1)),A=this.pow(h,C),G=T;A.cmp(N)!==0;){for(var Z=A,Y=0;Z.cmp(N)!==0;Y++)Z=Z.redSqr();r(Y<G);var ue=this.pow(Q,new i(1).iushln(G-Y-1));re=re.redMul(ue),Q=ue.redSqr(),A=A.redMul(Q),G=Y}return re},L.prototype.invm=function(h){var m=h._invmp(this.m);return m.negative!==0?(m.negative=0,this.imod(m).redNeg()):this.imod(m)},L.prototype.pow=function(h,m){if(m.isZero())return new i(1).toRed(this);if(m.cmpn(1)===0)return h.clone();var b=4,C=new Array(1<<b);C[0]=new i(1).toRed(this),C[1]=h;for(var T=2;T<C.length;T++)C[T]=this.mul(C[T-1],h);var N=C[0],I=0,g=0,x=m.bitLength()%26;for(x===0&&(x=26),T=m.length-1;T>=0;T--){for(var Q=m.words[T],re=x-1;re>=0;re--){var A=Q>>re&1;if(N!==C[0]&&(N=this.sqr(N)),A===0&&I===0){g=0;continue}I<<=1,I|=A,g++,!(g!==b&&(T!==0||re!==0))&&(N=this.mul(N,C[I]),g=0,I=0)}x=26}return N},L.prototype.convertTo=function(h){var m=h.umod(this.m);return m===h?m.clone():m},L.prototype.convertFrom=function(h){var m=h.clone();return m.red=null,m},i.mont=function(h){return new z(h)};function z(f){L.call(this,f),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(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)}n(z,L),z.prototype.convertTo=function(h){return this.imod(h.ushln(this.shift))},z.prototype.convertFrom=function(h){var m=this.imod(h.mul(this.rinv));return m.red=null,m},z.prototype.imul=function(h,m){if(h.isZero()||m.isZero())return h.words[0]=0,h.length=1,h;var b=h.imul(m),C=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),T=b.isub(C).iushrn(this.shift),N=T;return T.cmp(this.m)>=0?N=T.isub(this.m):T.cmpn(0)<0&&(N=T.iadd(this.m)),N._forceRed(this)},z.prototype.mul=function(h,m){if(h.isZero()||m.isZero())return new i(0)._forceRed(this);var b=h.mul(m),C=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),T=b.isub(C).iushrn(this.shift),N=T;return T.cmp(this.m)>=0?N=T.isub(this.m):T.cmpn(0)<0&&(N=T.iadd(this.m)),N._forceRed(this)},z.prototype.invm=function(h){var m=this.imod(h._invmp(this.m).mul(this.r2));return m._forceRed(this)}})(typeof LQ>"u"||LQ,Gbe)});var P9=X(D4=>{"use strict";Object.defineProperty(D4,"__esModule",{value:!0});D4.errorValues=D4.standardErrorCodes=void 0;D4.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}};D4.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 zO=X(Gl=>{"use strict";Object.defineProperty(Gl,"__esModule",{value:!0});Gl.serialize=Gl.getErrorCode=Gl.isValidCode=Gl.getMessageFromCode=Gl.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;var HO=P9(),Ybe="Unspecified error message.";Gl.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function Jbe(t,e=Ybe){if(t&&Number.isInteger(t)){let r=t.toString();if(UQ(HO.errorValues,r))return HO.errorValues[r].message;if(e5e(t))return Gl.JSON_RPC_SERVER_ERROR_MESSAGE}return e}Gl.getMessageFromCode=Jbe;function Xbe(t){if(!Number.isInteger(t))return!1;let e=t.toString();return!!(HO.errorValues[e]||e5e(t))}Gl.isValidCode=Xbe;function Y1t(t){var e;if(typeof t=="number")return t;if(J1t(t))return(e=t.code)!==null&&e!==void 0?e:t.errorCode}Gl.getErrorCode=Y1t;function J1t(t){return typeof t=="object"&&t!==null&&(typeof t.code=="number"||typeof t.errorCode=="number")}function X1t(t,{shouldIncludeStack:e=!1}={}){let r={};if(t&&typeof t=="object"&&!Array.isArray(t)&&UQ(t,"code")&&Xbe(t.code)){let n=t;r.code=n.code,n.message&&typeof n.message=="string"?(r.message=n.message,UQ(n,"data")&&(r.data=n.data)):(r.message=Jbe(r.code),r.data={originalError:Qbe(t)})}else r.code=HO.standardErrorCodes.rpc.internal,r.message=Zbe(t,"message")?t.message:Ybe,r.data={originalError:Qbe(t)};return e&&(r.stack=Zbe(t,"stack")?t.stack:void 0),r}Gl.serialize=X1t;function e5e(t){return t>=-32099&&t<=-32e3}function Qbe(t){return t&&typeof t=="object"&&!Array.isArray(t)?Object.assign({},t):t}function UQ(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Zbe(t,e){return typeof t=="object"&&t!==null&&e in t&&typeof t[e]=="string"}});var n5e=X(KO=>{"use strict";Object.defineProperty(KO,"__esModule",{value:!0});KO.standardErrors=void 0;var ha=P9(),t5e=zO();KO.standardErrors={rpc:{parse:t=>nf(ha.standardErrorCodes.rpc.parse,t),invalidRequest:t=>nf(ha.standardErrorCodes.rpc.invalidRequest,t),invalidParams:t=>nf(ha.standardErrorCodes.rpc.invalidParams,t),methodNotFound:t=>nf(ha.standardErrorCodes.rpc.methodNotFound,t),internal:t=>nf(ha.standardErrorCodes.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");let{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return nf(e,t)},invalidInput:t=>nf(ha.standardErrorCodes.rpc.invalidInput,t),resourceNotFound:t=>nf(ha.standardErrorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>nf(ha.standardErrorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>nf(ha.standardErrorCodes.rpc.transactionRejected,t),methodNotSupported:t=>nf(ha.standardErrorCodes.rpc.methodNotSupported,t),limitExceeded:t=>nf(ha.standardErrorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>L4(ha.standardErrorCodes.provider.userRejectedRequest,t),unauthorized:t=>L4(ha.standardErrorCodes.provider.unauthorized,t),unsupportedMethod:t=>L4(ha.standardErrorCodes.provider.unsupportedMethod,t),disconnected:t=>L4(ha.standardErrorCodes.provider.disconnected,t),chainDisconnected:t=>L4(ha.standardErrorCodes.provider.chainDisconnected,t),unsupportedChain:t=>L4(ha.standardErrorCodes.provider.unsupportedChain,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");let{code:e,message:r,data:n}=t;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new VO(e,r,n)}}};function nf(t,e){let[r,n]=r5e(e);return new WO(t,r||(0,t5e.getMessageFromCode)(t),n)}function L4(t,e){let[r,n]=r5e(e);return new VO(t,r||(0,t5e.getMessageFromCode)(t),n)}function r5e(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){let{message:e,data:r}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}var WO=class extends Error{constructor(e,r,n){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=e,n!==void 0&&(this.data=n)}},VO=class extends WO{constructor(e,r,n){if(!egt(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,r,n)}};function egt(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}});var QO=X(GO=>{"use strict";Object.defineProperty(GO,"__esModule",{value:!0});GO.isErrorResponse=void 0;function tgt(t){return t.errorMessage!==void 0}GO.isErrorResponse=tgt});var YO=X(ZO=>{"use strict";Object.defineProperty(ZO,"__esModule",{value:!0});ZO.LIB_VERSION=void 0;ZO.LIB_VERSION="3.9.3"});var i5e=X(JO=>{"use strict";Object.defineProperty(JO,"__esModule",{value:!0});JO.serializeError=void 0;var rgt=QO(),ngt=YO(),igt=P9(),ogt=zO();function sgt(t,e){let r=(0,ogt.serialize)(agt(t),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",ngt.LIB_VERSION),n.searchParams.set("code",r.code.toString());let i=cgt(r.data,e);return i&&n.searchParams.set("method",i),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}JO.serializeError=sgt;function agt(t){return typeof t=="string"?{message:t,code:igt.standardErrorCodes.rpc.internal}:(0,rgt.isErrorResponse)(t)?Object.assign(Object.assign({},t),{message:t.errorMessage,code:t.errorCode,data:{method:t.method}}):t}function cgt(t,e){let r=t?.method;if(r)return r;if(e!==void 0){if(typeof e=="string")return e;if(Array.isArray(e)){if(e.length>0)return e[0].method}else return e.method}}});var B9=X(of=>{"use strict";Object.defineProperty(of,"__esModule",{value:!0});of.standardErrors=of.standardErrorCodes=of.serializeError=of.getMessageFromCode=of.getErrorCode=void 0;var lgt=P9();Object.defineProperty(of,"standardErrorCodes",{enumerable:!0,get:function(){return lgt.standardErrorCodes}});var ugt=n5e();Object.defineProperty(of,"standardErrors",{enumerable:!0,get:function(){return ugt.standardErrors}});var fgt=i5e();Object.defineProperty(of,"serializeError",{enumerable:!0,get:function(){return fgt.serializeError}});var o5e=zO();Object.defineProperty(of,"getErrorCode",{enumerable:!0,get:function(){return o5e.getErrorCode}});Object.defineProperty(of,"getMessageFromCode",{enumerable:!0,get:function(){return o5e.getMessageFromCode}})});var L9=X(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});ja.ProviderType=ja.RegExpString=ja.IntNumber=ja.BigIntString=ja.AddressString=ja.HexString=ja.OpaqueType=void 0;function D9(){return t=>t}ja.OpaqueType=D9;ja.HexString=D9();ja.AddressString=D9();ja.BigIntString=D9();function hgt(t){return Math.floor(t)}ja.IntNumber=hgt;ja.RegExpString=D9();var s5e;(function(t){t.CoinbaseWallet="CoinbaseWallet",t.MetaMask="MetaMask",t.Unselected=""})(s5e||(ja.ProviderType=s5e={}))});var Qd=X(pr=>{"use strict";var dgt=pr&&pr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(pr,"__esModule",{value:!0});pr.isMobileWeb=pr.getLocation=pr.isInIFrame=pr.createQrUrl=pr.getFavicon=pr.range=pr.isBigNumber=pr.ensureParsedJSONObject=pr.ensureBN=pr.ensureRegExpString=pr.ensureIntNumber=pr.ensureBuffer=pr.ensureAddressString=pr.ensureEvenLengthHexString=pr.ensureHexString=pr.isHexString=pr.prepend0x=pr.strip0x=pr.has0xPrefix=pr.hexStringFromIntNumber=pr.intNumberFromHexString=pr.bigIntStringFromBN=pr.hexStringFromBuffer=pr.hexStringToUint8Array=pr.uint8ArrayToHex=pr.randomBytesHex=void 0;var Gg=dgt(O9()),ov=B9(),sf=L9(),a5e=/^[0-9]*$/,c5e=/^[a-f0-9]*$/;function pgt(t){return l5e(crypto.getRandomValues(new Uint8Array(t)))}pr.randomBytesHex=pgt;function l5e(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}pr.uint8ArrayToHex=l5e;function mgt(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>parseInt(e,16)))}pr.hexStringToUint8Array=mgt;function ggt(t,e=!1){let r=t.toString("hex");return(0,sf.HexString)(e?`0x${r}`:r)}pr.hexStringFromBuffer=ggt;function wgt(t){return(0,sf.BigIntString)(t.toString(10))}pr.bigIntStringFromBN=wgt;function vgt(t){return(0,sf.IntNumber)(new Gg.default(j9(t,!1),16).toNumber())}pr.intNumberFromHexString=vgt;function ygt(t){return(0,sf.HexString)(`0x${new Gg.default(t).toString(16)}`)}pr.hexStringFromIntNumber=ygt;function jQ(t){return t.startsWith("0x")||t.startsWith("0X")}pr.has0xPrefix=jQ;function XO(t){return jQ(t)?t.slice(2):t}pr.strip0x=XO;function u5e(t){return jQ(t)?`0x${t.slice(2)}`:`0x${t}`}pr.prepend0x=u5e;function U9(t){if(typeof t!="string")return!1;let e=XO(t).toLowerCase();return c5e.test(e)}pr.isHexString=U9;function f5e(t,e=!1){if(typeof t=="string"){let r=XO(t).toLowerCase();if(c5e.test(r))return(0,sf.HexString)(e?`0x${r}`:r)}throw ov.standardErrors.rpc.invalidParams(`"${String(t)}" is not a hexadecimal string`)}pr.ensureHexString=f5e;function j9(t,e=!1){let r=f5e(t,!1);return r.length%2===1&&(r=(0,sf.HexString)(`0${r}`)),e?(0,sf.HexString)(`0x${r}`):r}pr.ensureEvenLengthHexString=j9;function bgt(t){if(typeof t=="string"){let e=XO(t).toLowerCase();if(U9(e)&&e.length===40)return(0,sf.AddressString)(u5e(e))}throw ov.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(t)}`)}pr.ensureAddressString=bgt;function xgt(t){if(Buffer.isBuffer(t))return t;if(typeof t=="string"){if(U9(t)){let e=j9(t,!1);return Buffer.from(e,"hex")}return Buffer.from(t,"utf8")}throw ov.standardErrors.rpc.invalidParams(`Not binary data: ${String(t)}`)}pr.ensureBuffer=xgt;function h5e(t){if(typeof t=="number"&&Number.isInteger(t))return(0,sf.IntNumber)(t);if(typeof t=="string"){if(a5e.test(t))return(0,sf.IntNumber)(Number(t));if(U9(t))return(0,sf.IntNumber)(new Gg.default(j9(t,!1),16).toNumber())}throw ov.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}pr.ensureIntNumber=h5e;function Egt(t){if(t instanceof RegExp)return(0,sf.RegExpString)(t.toString());throw ov.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(t)}`)}pr.ensureRegExpString=Egt;function Cgt(t){if(t!==null&&(Gg.default.isBN(t)||d5e(t)))return new Gg.default(t.toString(10),10);if(typeof t=="number")return new Gg.default(h5e(t));if(typeof t=="string"){if(a5e.test(t))return new Gg.default(t,10);if(U9(t))return new Gg.default(j9(t,!1),16)}throw ov.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}pr.ensureBN=Cgt;function Agt(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw ov.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(t)}`)}pr.ensureParsedJSONObject=Agt;function d5e(t){if(t==null||typeof t.constructor!="function")return!1;let{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}pr.isBigNumber=d5e;function Sgt(t,e){return Array.from({length:e-t},(r,n)=>t+n)}pr.range=Sgt;function _gt(){let t=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:r}=document.location,n=t?t.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?e+n:`${e}//${r}${n}`}pr.getFavicon=_gt;function Igt(t,e,r,n,i,o){let s=n?"parent-id":"id",a=new URLSearchParams({[s]:t,secret:e,server:r,v:i,chainId:o.toString()}).toString();return`${r}/#/link?${a}`}pr.createQrUrl=Igt;function p5e(){try{return window.frameElement!==null}catch{return!1}}pr.isInIFrame=p5e;function Tgt(){try{return p5e()&&window.top?window.top.location:window.location}catch{return window.location}}pr.getLocation=Tgt;function kgt(){var t;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((t=window?.navigator)===null||t===void 0?void 0:t.userAgent)}pr.isMobileWeb=kgt});var m5e=X(eP=>{"use strict";Object.defineProperty(eP,"__esModule",{value:!0});eP.ScopedLocalStorage=void 0;var FQ=class{constructor(e){this.scope=e}setItem(e,r){localStorage.setItem(this.scopedKey(e),r)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){let e=this.scopedKey(""),r=[];for(let n=0;n<localStorage.length;n++){let i=localStorage.key(n);typeof i=="string"&&i.startsWith(e)&&r.push(i)}r.forEach(n=>localStorage.removeItem(n))}scopedKey(e){return`${this.scope}:${e}`}};eP.ScopedLocalStorage=FQ});var rP=X(tP=>{"use strict";Object.defineProperty(tP,"__esModule",{value:!0});tP.EVENTS=void 0;tP.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 nP=X(Zd=>{"use strict";Object.defineProperty(Zd,"__esModule",{value:!0});Zd.RelayAbstract=Zd.APP_VERSION_KEY=Zd.LOCAL_STORAGE_ADDRESSES_KEY=Zd.WALLET_USER_NAME_KEY=void 0;var g5e=B9();Zd.WALLET_USER_NAME_KEY="walletUsername";Zd.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";Zd.APP_VERSION_KEY="AppVersion";var $Q=class{async makeEthereumJSONRPCRequest(e,r){if(!r)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(r,{method:"POST",body:JSON.stringify(e),mode:"cors",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{if(!n)throw g5e.standardErrors.rpc.parse({});let i=n,{error:o}=i;if(o)throw(0,g5e.serializeError)(o,e.method);return i})}};Zd.RelayAbstract=$Q});var oP=X(iP=>{"use strict";Object.defineProperty(iP,"__esModule",{value:!0});iP.Session=void 0;var w5e=iQ(),v5e=Qd(),y5e="session:id",b5e="session:secret",x5e="session:linked",qQ=class t{constructor(e,r,n,i){this._storage=e,this._id=r||(0,v5e.randomBytesHex)(16),this._secret=n||(0,v5e.randomBytesHex)(32),this._key=new w5e.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(e){let r=e.getItem(y5e),n=e.getItem(x5e),i=e.getItem(b5e);return r&&i?new t(e,r,i,n==="1"):null}static hash(e){return new w5e.sha256().update(e).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this._storage.setItem(y5e,this._id),this._storage.setItem(b5e,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(x5e,this._linked?"1":"0")}};iP.Session=qQ});var E5e=X(aP=>{"use strict";Object.defineProperty(aP,"__esModule",{value:!0});aP.Cipher=void 0;var sP=Qd(),HQ=class{constructor(e){this.secret=e}async encrypt(e){let r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");let n=crypto.getRandomValues(new Uint8Array(12)),i=await crypto.subtle.importKey("raw",(0,sP.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),o=new TextEncoder,s=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},i,o.encode(e)),a=16,l=s.slice(s.byteLength-a),u=s.slice(0,s.byteLength-a),d=new Uint8Array(l),p=new Uint8Array(u),v=new Uint8Array([...n,...d,...p]);return(0,sP.uint8ArrayToHex)(v)}async decrypt(e){let r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");return new Promise((n,i)=>{(async function(){let o=await crypto.subtle.importKey("raw",(0,sP.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=(0,sP.hexStringToUint8Array)(e),a=s.slice(0,12),l=s.slice(12,28),u=s.slice(28),d=new Uint8Array([...u,...l]),p={name:"AES-GCM",iv:new Uint8Array(a)};try{let v=await window.crypto.subtle.decrypt(p,o,d),y=new TextDecoder;n(y.decode(v))}catch(v){i(v)}})()})}};aP.Cipher=HQ});var C5e=X(cP=>{"use strict";Object.defineProperty(cP,"__esModule",{value:!0});cP.WalletLinkHTTP=void 0;var zQ=class{constructor(e,r,n){this.linkAPIUrl=e,this.sessionId=r;let i=`${r}:${n}`;this.auth=`Basic ${btoa(i)}`}async markUnseenEventsAsSeen(e){return Promise.all(e.map(r=>fetch(`${this.linkAPIUrl}/events/${r.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(r=>console.error("Unabled to mark event as failed:",r))}async fetchUnseenEvents(){var e;let r=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(r.ok){let{events:n,error:i}=await r.json();if(i)throw new Error(`Check unseen events failed: ${i}`);let o=(e=n?.filter(s=>s.event==="Web3Response").map(s=>({type:"Event",sessionId:this.sessionId,eventId:s.id,event:s.event,data:s.data})))!==null&&e!==void 0?e:[];return this.markUnseenEventsAsSeen(o),o}throw new Error(`Check unseen events failed: ${r.status}`)}};cP.WalletLinkHTTP=zQ});var A5e=X(j4=>{"use strict";Object.defineProperty(j4,"__esModule",{value:!0});j4.WalletLinkWebSocket=j4.ConnectionState=void 0;var U4;(function(t){t[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED"})(U4||(j4.ConnectionState=U4={}));var WQ=class{setConnectionStateListener(e){this.connectionStateListener=e}setIncomingDataListener(e){this.incomingDataListener=e}constructor(e,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.pendingData=[],this.url=e.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((e,r)=>{var n;let i;try{this.webSocket=i=new this.WebSocketClass(this.url)}catch(o){r(o);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,U4.CONNECTING),i.onclose=o=>{var s;this.clearWebSocket(),r(new Error(`websocket error ${o.code}: ${o.reason}`)),(s=this.connectionStateListener)===null||s===void 0||s.call(this,U4.DISCONNECTED)},i.onopen=o=>{var s;e(),(s=this.connectionStateListener)===null||s===void 0||s.call(this,U4.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(l=>this.sendData(l)),this.pendingData=[])},i.onmessage=o=>{var s,a;if(o.data==="h")(s=this.incomingDataListener)===null||s===void 0||s.call(this,{type:"Heartbeat"});else try{let l=JSON.parse(o.data);(a=this.incomingDataListener)===null||a===void 0||a.call(this,l)}catch{}}})}disconnect(){var e;let{webSocket:r}=this;if(r){this.clearWebSocket(),(e=this.connectionStateListener)===null||e===void 0||e.call(this,U4.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{r.close()}catch{}}}sendData(e){let{webSocket:r}=this;if(!r){this.pendingData.push(e),this.connect();return}r.send(e)}clearWebSocket(){let{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}};j4.WalletLinkWebSocket=WQ});var I5e=X(uP=>{"use strict";Object.defineProperty(uP,"__esModule",{value:!0});uP.WalletLinkConnection=void 0;var F4=L9(),Rgt=E5e(),Yd=rP(),S5e=nP(),$4=oP(),Mgt=C5e(),lP=A5e(),_5e=1e4,Ngt=6e4,VQ=class{constructor({session:e,linkAPIUrl:r,listener:n,diagnostic:i,WebSocketClass:o=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,F4.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=a=>{if(!a)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",u=>a.JsonRpcUrl&&this.handleChainUpdated(u,a.JsonRpcUrl)]]).forEach((u,d)=>{let p=a[d];p!==void 0&&u(p)})},this.handleDestroyed=a=>{var l,u;a==="1"&&((l=this.listener)===null||l===void 0||l.resetAndReload(),(u=this.diagnostic)===null||u===void 0||u.log(Yd.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:$4.Session.hash(this.session.id)}))},this.handleAccountUpdated=async a=>{var l,u;try{let d=await this.cipher.decrypt(a);(l=this.listener)===null||l===void 0||l.accountUpdated(d)}catch{(u=this.diagnostic)===null||u===void 0||u.log(Yd.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(a,l)=>{var u,d;try{let p=await this.cipher.decrypt(l);(u=this.listener)===null||u===void 0||u.metadataUpdated(a,p)}catch{(d=this.diagnostic)===null||d===void 0||d.log(Yd.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:a})}},this.handleWalletUsernameUpdated=async a=>{this.handleMetadataUpdated(S5e.WALLET_USER_NAME_KEY,a)},this.handleAppVersionUpdated=async a=>{this.handleMetadataUpdated(S5e.APP_VERSION_KEY,a)},this.handleChainUpdated=async(a,l)=>{var u,d;try{let p=await this.cipher.decrypt(a),v=await this.cipher.decrypt(l);(u=this.listener)===null||u===void 0||u.chainUpdated(p,v)}catch{(d=this.diagnostic)===null||d===void 0||d.log(Yd.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=e,this.cipher=new Rgt.Cipher(e.secret),this.diagnostic=i,this.listener=n;let s=new lP.WalletLinkWebSocket(`${r}/rpc`,o);s.setConnectionStateListener(async a=>{var l;(l=this.diagnostic)===null||l===void 0||l.log(Yd.EVENTS.CONNECTED_STATE_CHANGE,{state:a,sessionIdHash:$4.Session.hash(e.id)});let u=!1;switch(a){case lP.ConnectionState.DISCONNECTED:if(!this.destroyed){let d=async()=>{await new Promise(p=>setTimeout(p,5e3)),this.destroyed||s.connect().catch(()=>{d()})};d()}break;case lP.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),u=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},_5e),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case lP.ConnectionState.CONNECTING:break}this.connected!==u&&(this.connected=u)}),s.setIncomingDataListener(a=>{var l,u,d;switch(a.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{let p=a.type==="IsLinkedOK"?a.linked:void 0;(l=this.diagnostic)===null||l===void 0||l.log(Yd.EVENTS.LINKED,{sessionIdHash:$4.Session.hash(e.id),linked:p,type:a.type,onlineGuests:a.onlineGuests}),this.linked=p||a.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(u=this.diagnostic)===null||u===void 0||u.log(Yd.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:$4.Session.hash(e.id),metadata_keys:a&&a.metadata?Object.keys(a.metadata):void 0}),this.handleSessionMetadataUpdated(a.metadata);break}case"Event":{this.handleIncomingEvent(a);break}}a.id!==void 0&&((d=this.requestResolutions.get(a.id))===null||d===void 0||d(a))}),this.ws=s,this.http=new Mgt.WalletLinkHTTP(r,e.id,e.key)}connect(){var e;if(this.destroyed)throw new Error("instance is destroyed");(e=this.diagnostic)===null||e===void 0||e.log(Yd.EVENTS.STARTED_CONNECTING,{sessionIdHash:$4.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var e;this.destroyed=!0,this.ws.disconnect(),(e=this.diagnostic)===null||e===void 0||e.log(Yd.EVENTS.DISCONNECTED,{sessionIdHash:$4.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(e){var r,n;this._connected=e,e&&((r=this.onceConnected)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.connectedUpdated(e)}setOnceConnected(e){return new Promise(r=>{this.connected?e().then(r):this.onceConnected=()=>{e().then(r),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(e){var r,n;this._linked=e,e&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(e)}setOnceLinked(e){return new Promise(r=>{this.linked?e().then(r):this.onceLinked=()=>{e().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(e){var r,n;if(!(e.type!=="Event"||e.event!=="Web3Response"))try{let i=await this.cipher.decrypt(e.data),o=JSON.parse(i);if(o.type!=="WEB3_RESPONSE")return;(r=this.listener)===null||r===void 0||r.handleWeb3ResponseMessage(o)}catch{(n=this.diagnostic)===null||n===void 0||n.log(Yd.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(e=>setTimeout(e,250));try{await this.fetchUnseenEventsAPI()}catch(e){console.error("Unable to check for unseen events",e)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(r=>this.handleIncomingEvent(r))}async setSessionMetadata(e,r){let n={type:"SetSessionConfig",id:(0,F4.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[e]:r}};return this.setOnceConnected(async()=>{let i=await this.makeRequest(n);if(i.type==="Fail")throw new Error(i.error||"failed to set session metadata")})}async publishEvent(e,r,n=!1){let i=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),o={type:"PublishEvent",id:(0,F4.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:e,data:i,callWebhook:n};return this.setOnceLinked(async()=>{let s=await this.makeRequest(o);if(s.type==="Fail")throw new Error(s.error||"failed to publish event");return s.eventId})}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>_5e*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(e,r=Ngt){let n=e.id;this.sendData(e);let i;return Promise.race([new Promise((o,s)=>{i=window.setTimeout(()=>{s(new Error(`request ${n} timed out`))},r)}),new Promise(o=>{this.requestResolutions.set(n,s=>{clearTimeout(i),o(s),this.requestResolutions.delete(n)})})])}async authenticate(){let e={type:"HostSession",id:(0,F4.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(e);if(r.type==="Fail")throw new Error(r.error||"failed to authentcate")}sendIsLinked(){let e={type:"IsLinked",id:(0,F4.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}sendGetSessionConfig(){let e={type:"GetSessionConfig",id:(0,F4.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}};uP.WalletLinkConnection=VQ});var T5e=X(KQ=>{"use strict";Object.defineProperty(KQ,"__esModule",{value:!0});KQ.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 GQ=X(q4=>{"use strict";var Ogt=q4&&q4.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(q4,"__esModule",{value:!0});q4.injectCssReset=void 0;var Pgt=Ogt(T5e());function Bgt(){let t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(Pgt.default)),document.documentElement.appendChild(t)}q4.injectCssReset=Bgt});var R5e=X(fP=>{"use strict";Object.defineProperty(fP,"__esModule",{value:!0});fP.CloseIcon=void 0;var k5e=($s(),zn(fa));function Dgt(t){return(0,k5e.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),(0,k5e.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"}))}fP.CloseIcon=Dgt});var M5e=X(dP=>{"use strict";Object.defineProperty(dP,"__esModule",{value:!0});dP.CoinbaseWalletRound=void 0;var hP=($s(),zn(fa));function Lgt(t){return(0,hP.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),(0,hP.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,hP.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,hP.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"}))}dP.CoinbaseWalletRound=Lgt});var N5e=X(pP=>{"use strict";Object.defineProperty(pP,"__esModule",{value:!0});pP.QRCodeIcon=void 0;var F9=($s(),zn(fa));function Ugt(t){return(0,F9.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t),(0,F9.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,F9.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,F9.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,F9.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}pP.QRCodeIcon=Ugt});var L5e=X((c6r,D5e)=>{function O5e(t){this.mode=Ql.MODE_8BIT_BYTE,this.data=t,this.parsedData=[];for(var e=0,r=this.data.length;e<r;e++){var n=[],i=this.data.charCodeAt(e);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))}O5e.prototype={getLength:function(t){return this.parsedData.length},write:function(t){for(var e=0,r=this.parsedData.length;e<r;e++)t.put(this.parsedData[e],8)}};function Xd(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}Xd.prototype={addData:function(t){var e=new O5e(t);this.dataList.push(e),this.dataCache=null},isDark:function(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(t+","+e);return this.modules[t][e]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(t,e){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(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=Xd.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(t,e){for(var r=-1;r<=7;r++)if(!(t+r<=-1||this.moduleCount<=t+r))for(var n=-1;n<=7;n++)e+n<=-1||this.moduleCount<=e+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[t+r][e+n]=!0:this.modules[t+r][e+n]=!1)},getBestMaskPattern:function(){for(var t=0,e=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=co.getLostPoint(this);(r==0||t>n)&&(t=n,e=r)}return e},createMovieClip:function(t,e,r){var n=t.createEmptyMovieClip(e,r),i=1;this.make();for(var o=0;o<this.modules.length;o++)for(var s=o*i,a=0;a<this.modules[o].length;a++){var l=a*i,u=this.modules[o][a];u&&(n.beginFill(0,100),n.moveTo(l,s),n.lineTo(l+i,s),n.lineTo(l+i,s+i),n.lineTo(l,s+i),n.endFill())}return n},setupTimingPattern:function(){for(var t=8;t<this.moduleCount-8;t++)this.modules[t][6]==null&&(this.modules[t][6]=t%2==0);for(var e=8;e<this.moduleCount-8;e++)this.modules[6][e]==null&&(this.modules[6][e]=e%2==0)},setupPositionAdjustPattern:function(){for(var t=co.getPatternPosition(this.typeNumber),e=0;e<t.length;e++)for(var r=0;r<t.length;r++){var n=t[e],i=t[r];if(this.modules[n][i]==null)for(var o=-2;o<=2;o++)for(var s=-2;s<=2;s++)o==-2||o==2||s==-2||s==2||o==0&&s==0?this.modules[n+o][i+s]=!0:this.modules[n+o][i+s]=!1}},setupTypeNumber:function(t){for(var e=co.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var n=!t&&(e>>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!t&&(e>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(t,e){for(var r=this.errorCorrectLevel<<3|e,n=co.getBCHTypeInfo(r),i=0;i<15;i++){var o=!t&&(n>>i&1)==1;i<6?this.modules[i][8]=o:i<8?this.modules[i+1][8]=o:this.modules[this.moduleCount-15+i][8]=o}for(var i=0;i<15;i++){var o=!t&&(n>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=o:i<9?this.modules[8][15-i-1+1]=o:this.modules[8][15-i-1]=o}this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var r=-1,n=this.moduleCount-1,i=7,o=0,s=this.moduleCount-1;s>0;s-=2)for(s==6&&s--;;){for(var a=0;a<2;a++)if(this.modules[n][s-a]==null){var l=!1;o<t.length&&(l=(t[o]>>>i&1)==1);var u=co.getMask(e,n,s-a);u&&(l=!l),this.modules[n][s-a]=l,i--,i==-1&&(o++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};Xd.PAD0=236;Xd.PAD1=17;Xd.createData=function(t,e,r){for(var n=Jd.getRSBlocks(t,e),i=new P5e,o=0;o<r.length;o++){var s=r[o];i.put(s.mode,4),i.put(s.getLength(),co.getLengthInBits(s.mode,t)),s.write(i)}for(var a=0,o=0;o<n.length;o++)a+=n[o].dataCount;if(i.getLengthInBits()>a*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+a*8+")");for(i.getLengthInBits()+4<=a*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=a*8||(i.put(Xd.PAD0,8),i.getLengthInBits()>=a*8));)i.put(Xd.PAD1,8);return Xd.createBytes(i,n)};Xd.createBytes=function(t,e){for(var r=0,n=0,i=0,o=new Array(e.length),s=new Array(e.length),a=0;a<e.length;a++){var l=e[a].dataCount,u=e[a].totalCount-l;n=Math.max(n,l),i=Math.max(i,u),o[a]=new Array(l);for(var d=0;d<o[a].length;d++)o[a][d]=255&t.buffer[d+r];r+=l;var p=co.getErrorCorrectPolynomial(u),v=new H4(o[a],p.getLength()-1),y=v.mod(p);s[a]=new Array(p.getLength()-1);for(var d=0;d<s[a].length;d++){var S=d+y.getLength()-s[a].length;s[a][d]=S>=0?y.get(S):0}}for(var R=0,d=0;d<e.length;d++)R+=e[d].totalCount;for(var O=new Array(R),k=0,d=0;d<n;d++)for(var a=0;a<e.length;a++)d<o[a].length&&(O[k++]=o[a][d]);for(var d=0;d<i;d++)for(var a=0;a<e.length;a++)d<s[a].length&&(O[k++]=s[a][d]);return O};var Ql={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Zg={L:1,M:0,Q:3,H:2},Qg={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},co={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(t){for(var e=t<<10;co.getBCHDigit(e)-co.getBCHDigit(co.G15)>=0;)e^=co.G15<<co.getBCHDigit(e)-co.getBCHDigit(co.G15);return(t<<10|e)^co.G15_MASK},getBCHTypeNumber:function(t){for(var e=t<<12;co.getBCHDigit(e)-co.getBCHDigit(co.G18)>=0;)e^=co.G18<<co.getBCHDigit(e)-co.getBCHDigit(co.G18);return t<<12|e},getBCHDigit:function(t){for(var e=0;t!=0;)e++,t>>>=1;return e},getPatternPosition:function(t){return co.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,r){switch(t){case Qg.PATTERN000:return(e+r)%2==0;case Qg.PATTERN001:return e%2==0;case Qg.PATTERN010:return r%3==0;case Qg.PATTERN011:return(e+r)%3==0;case Qg.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2==0;case Qg.PATTERN101:return e*r%2+e*r%3==0;case Qg.PATTERN110:return(e*r%2+e*r%3)%2==0;case Qg.PATTERN111:return(e*r%3+(e+r)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new H4([1],0),r=0;r<t;r++)e=e.multiply(new H4([1,Hs.gexp(r)],0));return e},getLengthInBits:function(t,e){if(1<=e&&e<10)switch(t){case Ql.MODE_NUMBER:return 10;case Ql.MODE_ALPHA_NUM:return 9;case Ql.MODE_8BIT_BYTE:return 8;case Ql.MODE_KANJI:return 8;default:throw new Error("mode:"+t)}else if(e<27)switch(t){case Ql.MODE_NUMBER:return 12;case Ql.MODE_ALPHA_NUM:return 11;case Ql.MODE_8BIT_BYTE:return 16;case Ql.MODE_KANJI:return 10;default:throw new Error("mode:"+t)}else if(e<41)switch(t){case Ql.MODE_NUMBER:return 14;case Ql.MODE_ALPHA_NUM:return 13;case Ql.MODE_8BIT_BYTE:return 16;case Ql.MODE_KANJI:return 12;default:throw new Error("mode:"+t)}else throw new Error("type:"+e)},getLostPoint:function(t){for(var e=t.getModuleCount(),r=0,n=0;n<e;n++)for(var i=0;i<e;i++){for(var o=0,s=t.isDark(n,i),a=-1;a<=1;a++)if(!(n+a<0||e<=n+a))for(var l=-1;l<=1;l++)i+l<0||e<=i+l||a==0&&l==0||s==t.isDark(n+a,i+l)&&o++;o>5&&(r+=3+o-5)}for(var n=0;n<e-1;n++)for(var i=0;i<e-1;i++){var u=0;t.isDark(n,i)&&u++,t.isDark(n+1,i)&&u++,t.isDark(n,i+1)&&u++,t.isDark(n+1,i+1)&&u++,(u==0||u==4)&&(r+=3)}for(var n=0;n<e;n++)for(var i=0;i<e-6;i++)t.isDark(n,i)&&!t.isDark(n,i+1)&&t.isDark(n,i+2)&&t.isDark(n,i+3)&&t.isDark(n,i+4)&&!t.isDark(n,i+5)&&t.isDark(n,i+6)&&(r+=40);for(var i=0;i<e;i++)for(var n=0;n<e-6;n++)t.isDark(n,i)&&!t.isDark(n+1,i)&&t.isDark(n+2,i)&&t.isDark(n+3,i)&&t.isDark(n+4,i)&&!t.isDark(n+5,i)&&t.isDark(n+6,i)&&(r+=40);for(var d=0,i=0;i<e;i++)for(var n=0;n<e;n++)t.isDark(n,i)&&d++;var p=Math.abs(100*d/e/e-50)/5;return r+=p*10,r}},Hs={glog:function(t){if(t<1)throw new Error("glog("+t+")");return Hs.LOG_TABLE[t]},gexp:function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return Hs.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(ss=0;ss<8;ss++)Hs.EXP_TABLE[ss]=1<<ss;var ss;for(ss=8;ss<256;ss++)Hs.EXP_TABLE[ss]=Hs.EXP_TABLE[ss-4]^Hs.EXP_TABLE[ss-5]^Hs.EXP_TABLE[ss-6]^Hs.EXP_TABLE[ss-8];var ss;for(ss=0;ss<255;ss++)Hs.LOG_TABLE[Hs.EXP_TABLE[ss]]=ss;var ss;function H4(t,e){if(t.length==null)throw new Error(t.length+"/"+e);for(var r=0;r<t.length&&t[r]==0;)r++;this.num=new Array(t.length-r+e);for(var n=0;n<t.length-r;n++)this.num[n]=t[n+r]}H4.prototype={get:function(t){return this.num[t]},getLength:function(){return this.num.length},multiply:function(t){for(var e=new Array(this.getLength()+t.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<t.getLength();n++)e[r+n]^=Hs.gexp(Hs.glog(this.get(r))+Hs.glog(t.get(n)));return new H4(e,0)},mod:function(t){if(this.getLength()-t.getLength()<0)return this;for(var e=Hs.glog(this.get(0))-Hs.glog(t.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(var n=0;n<t.getLength();n++)r[n]^=Hs.gexp(Hs.glog(t.get(n))+e);return new H4(r,0).mod(t)}};function Jd(t,e){this.totalCount=t,this.dataCount=e}Jd.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]];Jd.getRSBlocks=function(t,e){var r=Jd.getRsBlockTable(t,e);if(r==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);for(var n=r.length/3,i=[],o=0;o<n;o++)for(var s=r[o*3+0],a=r[o*3+1],l=r[o*3+2],u=0;u<s;u++)i.push(new Jd(a,l));return i};Jd.getRsBlockTable=function(t,e){switch(e){case Zg.L:return Jd.RS_BLOCK_TABLE[(t-1)*4+0];case Zg.M:return Jd.RS_BLOCK_TABLE[(t-1)*4+1];case Zg.Q:return Jd.RS_BLOCK_TABLE[(t-1)*4+2];case Zg.H:return Jd.RS_BLOCK_TABLE[(t-1)*4+3];default:return}};function P5e(){this.buffer=[],this.length=0}P5e.prototype={get:function(t){var e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)==1},put:function(t,e){for(var r=0;r<e;r++)this.putBit((t>>>e-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var QQ=[[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 B5e(t){var e=this;if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof t=="string"&&(t={content:t}),t)for(var r in t)this.options[r]=t[r];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 n(u){switch(u){case"L":return Zg.L;case"M":return Zg.M;case"Q":return Zg.Q;case"H":return Zg.H;default:throw new Error("Unknwon error correction level: "+u)}}function i(u,d){for(var p=o(u),v=1,y=0,S=0,R=QQ.length;S<=R;S++){var O=QQ[S];if(!O)throw new Error("Content too long: expected "+y+" but got "+p);switch(d){case"L":y=O[0];break;case"M":y=O[1];break;case"Q":y=O[2];break;case"H":y=O[3];break;default:throw new Error("Unknwon error correction level: "+d)}if(p<=y)break;v++}if(v>QQ.length)throw new Error("Content too long");return v}function o(u){var d=encodeURI(u).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return d.length+(d.length!=u?3:0)}var s=this.options.content,a=i(s,this.options.ecl),l=n(this.options.ecl);this.qrcode=new Xd(a,l),this.qrcode.addData(s),this.qrcode.make()}B5e.prototype.svg=function(t){var e=this.options||{},r=this.qrcode.modules;typeof t>"u"&&(t={container:e.container||"svg"});for(var n=typeof e.pretty<"u"?!!e.pretty:!0,i=n?" ":"",o=n?`\r | |
`:"",s=e.width,a=e.height,l=r.length,u=s/(l+2*e.padding),d=a/(l+2*e.padding),p=typeof e.join<"u"?!!e.join:!1,v=typeof e.swap<"u"?!!e.swap:!1,y=typeof e.xmlDeclaration<"u"?!!e.xmlDeclaration:!0,S=typeof e.predefined<"u"?!!e.predefined:!1,R=S?i+'<defs><path id="qrmodule" d="M0 0 h'+d+" v"+u+' H0 z" style="fill:'+e.color+';shape-rendering:crispEdges;" /></defs>'+o:"",O=i+'<rect x="0" y="0" width="'+s+'" height="'+a+'" style="fill:'+e.background+';shape-rendering:crispEdges;"/>'+o,k="",M="",D=0;D<l;D++)for(var j=0;j<l;j++){var q=r[j][D];if(q){var W=j*u+e.padding*u,V=D*d+e.padding*d;if(v){var P=W;W=V,V=P}if(p){var $=u+W,U=d+V;W=Number.isInteger(W)?Number(W):W.toFixed(2),V=Number.isInteger(V)?Number(V):V.toFixed(2),$=Number.isInteger($)?Number($):$.toFixed(2),U=Number.isInteger(U)?Number(U):U.toFixed(2),M+="M"+W+","+V+" V"+U+" H"+$+" V"+V+" H"+W+" Z "}else S?k+=i+'<use x="'+W.toString()+'" y="'+V.toString()+'" href="#qrmodule" />'+o:k+=i+'<rect x="'+W.toString()+'" y="'+V.toString()+'" width="'+u+'" height="'+d+'" style="fill:'+e.color+';shape-rendering:crispEdges;"/>'+o}}p&&(k=i+'<path x="0" y="0" style="fill:'+e.color+';shape-rendering:crispEdges;" d="'+M+'" />');let L="";if(this.options.image!==void 0&&this.options.image.svg){let f=s*this.options.image.width/100,h=a*this.options.image.height/100,m=s/2-f/2,b=a/2-h/2;L+=`<svg x="${m}" y="${b}" width="${f}" height="${h}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,L+=this.options.image.svg+o,L+="</svg>"}var z="";switch(t.container){case"svg":y&&(z+='<?xml version="1.0" standalone="yes"?>'+o),z+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+s+'" height="'+a+'">'+o,z+=R+O+k,z+=L,z+="</svg>";break;case"svg-viewbox":y&&(z+='<?xml version="1.0" standalone="yes"?>'+o),z+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+s+" "+a+'">'+o,z+=R+O+k,z+=L,z+="</svg>";break;case"g":z+='<g width="'+s+'" height="'+a+'">'+o,z+=R+O+k,z+=L,z+="</g>";break;default:z+=(R+O+k+L).replace(/^\s+/,"");break}return z};D5e.exports=B5e});var j5e=X(z4=>{"use strict";var jgt=z4&&z4.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(z4,"__esModule",{value:!0});z4.QRCode=void 0;var Fgt=($s(),zn(fa)),U5e=(R4(),zn(k4)),$gt=jgt(L5e()),qgt=t=>{let[e,r]=(0,U5e.useState)("");return(0,U5e.useEffect)(()=>{var n,i;let o=new $gt.default({content:t.content,background:t.bgColor||"#ffffff",color:t.fgColor||"#000000",container:"svg",ecl:"M",width:(n=t.width)!==null&&n!==void 0?n:256,height:(i=t.height)!==null&&i!==void 0?i:256,padding:0,image:t.image}),s=Buffer.from(o.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${s}`)},[t.bgColor,t.content,t.fgColor,t.height,t.image,t.width]),e?(0,Fgt.h)("img",{src:e,alt:"QR Code"}):null};z4.QRCode=qgt});var F5e=X(ZQ=>{"use strict";Object.defineProperty(ZQ,"__esModule",{value:!0});ZQ.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 $5e=X(W4=>{"use strict";var Hgt=W4&&W4.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(W4,"__esModule",{value:!0});W4.Spinner=void 0;var mP=($s(),zn(fa)),zgt=Hgt(F5e()),Wgt=t=>{var e;let r=(e=t.size)!==null&&e!==void 0?e:64,n=t.color||"#000";return(0,mP.h)("div",{class:"-cbwsdk-spinner"},(0,mP.h)("style",null,zgt.default),(0,mP.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,mP.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};W4.Spinner=Wgt});var q5e=X(YQ=>{"use strict";Object.defineProperty(YQ,"__esModule",{value:!0});YQ.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 W5e=X(Yg=>{"use strict";var H5e=Yg&&Yg.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Yg,"__esModule",{value:!0});Yg.CoinbaseWalletSteps=Yg.ConnectContent=void 0;var sv=H5e(Wg()),Jn=($s(),zn(fa)),Vgt=Qd(),Kgt=YO(),Ggt=R5e(),Qgt=M5e(),Zgt=N5e(),Ygt=j5e(),Jgt=$5e(),Xgt=H5e(q5e()),JQ={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:z5e},e2t=t=>t==="light"?"#FFFFFF":"#0A0B0D";function t2t(t){let{theme:e}=t,r=(0,Vgt.createQrUrl)(t.sessionId,t.sessionSecret,t.linkAPIUrl,t.isParentConnection,t.version,t.chainId),n=JQ.steps;return(0,Jn.h)("div",{"data-testid":"connect-content",className:(0,sv.default)("-cbwsdk-connect-content",e)},(0,Jn.h)("style",null,Xgt.default),(0,Jn.h)("div",{className:"-cbwsdk-connect-content-header"},(0,Jn.h)("h2",{className:(0,sv.default)("-cbwsdk-connect-content-heading",e)},"Scan to connect with our mobile app"),t.onCancel&&(0,Jn.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:t.onCancel},(0,Jn.h)(Ggt.CloseIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Jn.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,Jn.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,Jn.h)(r2t,{title:JQ.title,description:JQ.description,theme:e})),(0,Jn.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,Jn.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,Jn.h)(Ygt.QRCode,{content:r,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,Jn.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:Kgt.LIB_VERSION}),(0,Jn.h)("input",{type:"hidden",value:r})),(0,Jn.h)(n,{theme:e}),!t.isConnected&&(0,Jn.h)("div",{"data-testid":"connecting-spinner",className:(0,sv.default)("-cbwsdk-connect-content-qr-connecting",e)},(0,Jn.h)(Jgt.Spinner,{size:36,color:e==="dark"?"#FFF":"#000"}),(0,Jn.h)("p",null,"Connecting...")))))}Yg.ConnectContent=t2t;function r2t({title:t,description:e,theme:r}){return(0,Jn.h)("div",{className:(0,sv.default)("-cbwsdk-connect-item",r)},(0,Jn.h)("div",null,(0,Jn.h)(Qgt.CoinbaseWalletRound,null)),(0,Jn.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,Jn.h)("h3",{className:"-cbwsdk-connect-item-title"},t),(0,Jn.h)("p",{className:"-cbwsdk-connect-item-description"},e)))}function z5e({theme:t}){return(0,Jn.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,Jn.h)("li",{className:(0,sv.default)("-cbwsdk-wallet-steps-item",t)},(0,Jn.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,Jn.h)("li",{className:(0,sv.default)("-cbwsdk-wallet-steps-item",t)},(0,Jn.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,Jn.h)("span",null,"Tap ",(0,Jn.h)("strong",null,"Scan")," "),(0,Jn.h)("span",{className:(0,sv.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,Jn.h)(Zgt.QRCodeIcon,{fill:e2t(t)})))))}Yg.CoinbaseWalletSteps=z5e});var K5e=X(gP=>{"use strict";Object.defineProperty(gP,"__esModule",{value:!0});gP.ArrowLeftIcon=void 0;var V5e=($s(),zn(fa));function n2t(t){return(0,V5e.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},t),(0,V5e.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"}))}gP.ArrowLeftIcon=n2t});var G5e=X(wP=>{"use strict";Object.defineProperty(wP,"__esModule",{value:!0});wP.LaptopIcon=void 0;var XQ=($s(),zn(fa));function i2t(t){return(0,XQ.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,XQ.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,XQ.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"}))}wP.LaptopIcon=i2t});var Z5e=X(vP=>{"use strict";Object.defineProperty(vP,"__esModule",{value:!0});vP.SafeIcon=void 0;var Q5e=($s(),zn(fa));function o2t(t){return(0,Q5e.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,Q5e.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"}))}vP.SafeIcon=o2t});var Y5e=X(eZ=>{"use strict";Object.defineProperty(eZ,"__esModule",{value:!0});eZ.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 X5e=X(V4=>{"use strict";var J5e=V4&&V4.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(V4,"__esModule",{value:!0});V4.TryExtensionContent=void 0;var av=J5e(Wg()),as=($s(),zn(fa)),tZ=(R4(),zn(k4)),s2t=K5e(),a2t=G5e(),c2t=Z5e(),l2t=J5e(Y5e());function u2t({theme:t}){let[e,r]=(0,tZ.useState)(!1),n=(0,tZ.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,tZ.useCallback)(()=>{e?window.location.reload():(n(),r(!0))},[n,e]);return(0,as.h)("div",{class:(0,av.default)("-cbwsdk-try-extension",t)},(0,as.h)("style",null,l2t.default),(0,as.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,as.h)("h3",{class:(0,av.default)("-cbwsdk-try-extension-heading",t)},"Or try the Coinbase Wallet browser extension"),(0,as.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,as.h)("button",{class:(0,av.default)("-cbwsdk-try-extension-cta",t),onClick:i},e?"Refresh":"Install"),(0,as.h)("div",null,!e&&(0,as.h)(s2t.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:t==="light"?"#0052FF":"#588AF5"})))),(0,as.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,as.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,as.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,as.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,as.h)("span",{class:(0,av.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,as.h)(a2t.LaptopIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,as.h)("div",{class:(0,av.default)("-cbwsdk-try-extension-list-item-copy",t)},"Connect with dapps with just one click on your desktop browser")),(0,as.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,as.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,as.h)("span",{class:(0,av.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,as.h)(c2t.SafeIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,as.h)("div",{class:(0,av.default)("-cbwsdk-try-extension-list-item-copy",t)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}V4.TryExtensionContent=u2t});var e4e=X(rZ=>{"use strict";Object.defineProperty(rZ,"__esModule",{value:!0});rZ.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 r4e=X(K4=>{"use strict";var t4e=K4&&K4.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(K4,"__esModule",{value:!0});K4.ConnectDialog=void 0;var nZ=t4e(Wg()),cv=($s(),zn(fa)),iZ=(R4(),zn(k4)),f2t=W5e(),h2t=X5e(),d2t=t4e(e4e()),p2t=t=>{let{isOpen:e,darkMode:r}=t,[n,i]=(0,iZ.useState)(!e),[o,s]=(0,iZ.useState)(!e);(0,iZ.useEffect)(()=>{let l=[window.setTimeout(()=>{s(!e)},10)];return e?i(!1):l.push(window.setTimeout(()=>{i(!0)},360)),()=>{l.forEach(window.clearTimeout)}},[e]);let a=r?"dark":"light";return(0,cv.h)("div",{class:(0,nZ.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,cv.h)("style",null,d2t.default),(0,cv.h)("div",{class:(0,nZ.default)("-cbwsdk-connect-dialog-backdrop",a,o&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,cv.h)("div",{class:"-cbwsdk-connect-dialog"},(0,cv.h)("div",{class:(0,nZ.default)("-cbwsdk-connect-dialog-box",o&&"-cbwsdk-connect-dialog-box-hidden")},t.connectDisabled?null:(0,cv.h)(f2t.ConnectContent,{theme:a,version:t.version,sessionId:t.sessionId,sessionSecret:t.sessionSecret,linkAPIUrl:t.linkAPIUrl,isConnected:t.isConnected,isParentConnection:t.isParentConnection,chainId:t.chainId,onCancel:t.onCancel}),(0,cv.h)(h2t.TryExtensionContent,{theme:a}))))};K4.ConnectDialog=p2t});var n4e=X(yP=>{"use strict";Object.defineProperty(yP,"__esModule",{value:!0});yP.LinkFlow=void 0;var oZ=($s(),zn(fa)),m2t=r4e(),sZ=class{constructor(e){this.connected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=e.darkMode,this.version=e.version,this.sessionId=e.sessionId,this.sessionSecret=e.sessionSecret,this.linkAPIUrl=e.linkAPIUrl,this.isParentConnection=e.isParentConnection}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",e.appendChild(this.root),this.render()}setConnected(e){this.connected!==e&&(this.connected=e,this.render())}setChainId(e){this.chainId!==e&&(this.chainId=e,this.render())}detach(){var e;this.root&&((0,oZ.render)(null,this.root),(e=this.root.parentElement)===null||e===void 0||e.removeChild(this.root))}setConnectDisabled(e){this.connectDisabled=e}open(e){this.isOpen=!0,this.onCancel=e.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){this.root&&(0,oZ.render)((0,oZ.h)(m2t.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)}};yP.LinkFlow=sZ});var i4e=X(aZ=>{"use strict";Object.defineProperty(aZ,"__esModule",{value:!0});aZ.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}"});var uZ=X(af=>{"use strict";var o4e=af&&af.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(af,"__esModule",{value:!0});af.SnackbarInstance=af.SnackbarContainer=af.Snackbar=void 0;var bP=o4e(Wg()),cs=($s(),zn(fa)),cZ=(R4(),zn(k4)),g2t=o4e(i4e()),w2t="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",v2t="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=",lZ=class{constructor(e){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=e.darkMode}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",e.appendChild(this.root),this.render()}presentItem(e){let r=this.nextItemKey++;return this.items.set(r,e),this.render(),()=>{this.items.delete(r),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,cs.render)((0,cs.h)("div",null,(0,cs.h)(af.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([e,r])=>(0,cs.h)(af.SnackbarInstance,Object.assign({},r,{key:e}))))),this.root)}};af.Snackbar=lZ;var y2t=t=>(0,cs.h)("div",{class:(0,bP.default)("-cbwsdk-snackbar-container")},(0,cs.h)("style",null,g2t.default),(0,cs.h)("div",{class:"-cbwsdk-snackbar"},t.children));af.SnackbarContainer=y2t;var b2t=({autoExpand:t,message:e,menuItems:r})=>{let[n,i]=(0,cZ.useState)(!0),[o,s]=(0,cZ.useState)(t??!1);(0,cZ.useEffect)(()=>{let l=[window.setTimeout(()=>{i(!1)},1),window.setTimeout(()=>{s(!0)},1e4)];return()=>{l.forEach(window.clearTimeout)}});let a=()=>{s(!o)};return(0,cs.h)("div",{class:(0,bP.default)("-cbwsdk-snackbar-instance",n&&"-cbwsdk-snackbar-instance-hidden",o&&"-cbwsdk-snackbar-instance-expanded")},(0,cs.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:a},(0,cs.h)("img",{src:w2t,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,cs.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},e),(0,cs.h)("div",{class:"-gear-container"},!o&&(0,cs.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,cs.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,cs.h)("img",{src:v2t,class:"-gear-icon",title:"Expand"}))),r&&r.length>0&&(0,cs.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},r.map((l,u)=>(0,cs.h)("div",{class:(0,bP.default)("-cbwsdk-snackbar-instance-menu-item",l.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:l.onClick,key:u},(0,cs.h)("svg",{width:l.svgWidth,height:l.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,cs.h)("path",{"fill-rule":l.defaultFillRule,"clip-rule":l.defaultClipRule,d:l.path,fill:"#AAAAAA"})),(0,cs.h)("span",{class:(0,bP.default)("-cbwsdk-snackbar-instance-menu-item-info",l.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},l.info)))))};af.SnackbarInstance=b2t});var hZ=X(xP=>{"use strict";Object.defineProperty(xP,"__esModule",{value:!0});xP.WalletLinkRelayUI=void 0;var x2t=GQ(),E2t=n4e(),C2t=uZ(),fZ=class{constructor(e){this.standalone=null,this.attached=!1,this.snackbar=new C2t.Snackbar({darkMode:e.darkMode}),this.linkFlow=new E2t.LinkFlow({darkMode:e.darkMode,version:e.version,sessionId:e.session.id,sessionSecret:e.session.secret,linkAPIUrl:e.linkAPIUrl,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");let e=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",e.appendChild(r),this.linkFlow.attach(r),this.snackbar.attach(r),this.attached=!0,(0,x2t.injectCssReset)()}setConnected(e){this.linkFlow.setConnected(e)}setChainId(e){this.linkFlow.setChainId(e)}setConnectDisabled(e){this.linkFlow.setConnectDisabled(e)}addEthereumChain(){}watchAsset(){}switchEthereumChain(){}requestEthereumAccounts(e){this.linkFlow.open({onCancel:e.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}showConnecting(e){let r;return e.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:r={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(r)}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(e){this.standalone=e}isStandalone(){var e;return(e=this.standalone)!==null&&e!==void 0?e:!1}};xP.WalletLinkRelayUI=fZ});var dZ=X(CP=>{"use strict";Object.defineProperty(CP,"__esModule",{value:!0});CP.WalletLinkRelay=void 0;var G4=B9(),A2t=L9(),lo=Qd(),lv=rP(),s4e=nP(),Jg=oP(),S2t=I5e(),uv=QO(),_2t=hZ(),EP=class t extends s4e.RelayAbstract{constructor(e){var r;super(),this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.linkedUpdated=s=>{var a;this.isLinked=s;let l=this.storage.getItem(s4e.LOCAL_STORAGE_ADDRESSES_KEY);if(s&&(this.session.linked=s),this.isUnlinkedErrorState=!1,l){let u=l.split(" "),d=this.storage.getItem("IsStandaloneSigning")==="true";if(u[0]!==""&&!s&&this.session.linked&&!d){this.isUnlinkedErrorState=!0;let p=this.getSessionIdHash();(a=this.diagnostic)===null||a===void 0||a.log(lv.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:p})}}},this.metadataUpdated=(s,a)=>{this.storage.setItem(s,a)},this.chainUpdated=(s,a)=>{this.chainCallbackParams.chainId===s&&this.chainCallbackParams.jsonRpcUrl===a||(this.chainCallbackParams={chainId:s,jsonRpcUrl:a},this.chainCallback&&this.chainCallback(s,a))},this.accountUpdated=s=>{this.accountsCallback&&this.accountsCallback([s]),t.accountRequestCallbackIds.size>0&&(Array.from(t.accountRequestCallbackIds.values()).forEach(a=>{let l={type:"WEB3_RESPONSE",id:a,response:{method:"requestEthereumAccounts",result:[s]}};this.invokeCallback(Object.assign(Object.assign({},l),{id:a}))}),t.accountRequestCallbackIds.clear())},this.connectedUpdated=s=>{this.ui.setConnected(s)},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage,this.options=e;let{session:n,ui:i,connection:o}=this.subscribe();this._session=n,this.connection=o,this.relayEventManager=e.relayEventManager,this.diagnostic=e.diagnosticLogger,this._reloadOnDisconnect=(r=e.reloadOnDisconnect)!==null&&r!==void 0?r:!0,this.ui=i}subscribe(){let e=Jg.Session.load(this.storage)||new Jg.Session(this.storage).save(),{linkAPIUrl:r,diagnostic:n}=this,i=new S2t.WalletLinkConnection({session:e,linkAPIUrl:r,diagnostic:n,listener:this}),{version:o,darkMode:s}=this.options,a=this.options.uiConstructor({linkAPIUrl:r,version:o,darkMode:s,session:e});return i.connect(),{session:e,ui:a,connection:i}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(e=>setTimeout(()=>e(null),1e3))]).then(()=>{var e,r;let n=this.ui.isStandalone();(e=this.diagnostic)===null||e===void 0||e.log(lv.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();let i=Jg.Session.load(this.storage);if(i?.id===this._session.id?this.storage.clear():i&&((r=this.diagnostic)===null||r===void 0||r.log(lv.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:Jg.Session.hash(i.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);let{session:o,ui:s,connection:a}=this.subscribe();this._session=o,this.connection=a,this.ui=s,n&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.options.headlessMode||this.attachUI()}).catch(e=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(lv.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${e}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(e,r){this.appName=e,this.appLogoUrl=r}getStorageItem(e){return this.storage.getItem(e)}get session(){return this._session}setStorageItem(e,r){this.storage.setItem(e,r)}signEthereumMessage(e,r,n,i){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,lo.hexStringFromBuffer)(e,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(e,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,lo.hexStringFromBuffer)(e,!0),signature:(0,lo.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,lo.bigIntStringFromBN)(e.weiValue),data:(0,lo.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,lo.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,lo.bigIntStringFromBN)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,lo.bigIntStringFromBN)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,lo.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,lo.bigIntStringFromBN)(e.weiValue),data:(0,lo.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,lo.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,lo.bigIntStringFromBN)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,lo.bigIntStringFromBN)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,lo.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,lo.hexStringFromBuffer)(e,!0),chainId:r}})}scanQRCode(e){return this.sendRequest({method:"scanQRCode",params:{regExp:e}})}getQRCodeUrl(){return(0,lo.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(e,r){return this.sendRequest({method:"generic",params:{action:r,data:e}})}sendGenericMessage(e){return this.sendRequest(e)}sendRequest(e){let r=null,n=(0,lo.randomBytesHex)(8),i=s=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,s),r?.()};return{promise:new Promise((s,a)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,l=>{if(r?.(),(0,uv.isErrorResponse)(l))return a(new Error(l.errorMessage));s(l)}),this.ui.isStandalone()?this.sendRequestStandalone(n,e):this.publishWeb3RequestEvent(n,e)}),cancel:i}}setConnectDisabled(e){this.ui.setConnectDisabled(e)}setAccountsCallback(e){this.accountsCallback=e}setChainCallback(e){this.chainCallback=e}setDappDefaultChainCallback(e){this.dappDefaultChain=e,this.ui instanceof _2t.WalletLinkRelayUI&&this.ui.setChainId(e)}publishWeb3RequestEvent(e,r){var n;let i={type:"WEB3_REQUEST",id:e,request:r},o=Jg.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(lv.EVENTS.WEB3_REQUEST,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:o?Jg.Session.hash(o.id):"",isSessionMismatched:(o?.id!==this._session.id).toString()}),this.publishEvent("Web3Request",i,!0).then(s=>{var a;(a=this.diagnostic)===null||a===void 0||a.log(lv.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:o?Jg.Session.hash(o.id):"",isSessionMismatched:(o?.id!==this._session.id).toString()})}).catch(s=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i.id,response:{method:r.method,errorMessage:s.message}})})}publishWeb3RequestCanceledEvent(e){let r={type:"WEB3_REQUEST_CANCELED",id:e};this.publishEvent("Web3RequestCanceled",r,!1).then()}publishEvent(e,r,n){return this.connection.publishEvent(e,r,n)}handleWeb3ResponseMessage(e){var r;let{response:n}=e;if((r=this.diagnostic)===null||r===void 0||r.log(lv.EVENTS.WEB3_RESPONSE,{eventId:e.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),n.method==="requestEthereumAccounts"){t.accountRequestCallbackIds.forEach(i=>this.invokeCallback(Object.assign(Object.assign({},e),{id:i}))),t.accountRequestCallbackIds.clear();return}this.invokeCallback(e)}handleErrorResponse(e,r,n,i){var o;let s=(o=n?.message)!==null&&o!==void 0?o:(0,G4.getMessageFromCode)(i);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:e,response:{method:r,errorMessage:s,errorCode:i}})}invokeCallback(e){let r=this.relayEventManager.callbacks.get(e.id);r&&(r(e.response),this.relayEventManager.callbacks.delete(e.id))}requestEthereumAccounts(){let e={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=null,n=(0,lo.randomBytesHex)(8),i=s=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,s),r?.()};return{promise:new Promise((s,a)=>{if(this.relayEventManager.callbacks.set(n,l=>{if(this.ui.hideRequestEthereumAccounts(),r?.(),(0,uv.isErrorResponse)(l))return a(new Error(l.errorMessage));s(l)}),this.ui.inlineAccountsResponse()){let l=u=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"requestEthereumAccounts",result:u}})};this.ui.requestEthereumAccounts({onCancel:i,onAccounts:l})}else{let l=G4.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>i(l)})}t.accountRequestCallbackIds.add(n),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(n,e)}),cancel:i}}selectProvider(e){let r={method:"selectProvider",params:{providerOptions:e}},n=(0,lo.randomBytesHex)(8),i=s=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,s)},o=new Promise((s,a)=>{this.relayEventManager.callbacks.set(n,d=>{if((0,uv.isErrorResponse)(d))return a(new Error(d.errorMessage));s(d)});let l=d=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:A2t.ProviderType.Unselected}})},u=d=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:d}})};this.ui.selectProvider&&this.ui.selectProvider({onApprove:u,onCancel:l,providerOptions:e})});return{cancel:i,promise:o}}watchAsset(e,r,n,i,o,s){let a={method:"watchAsset",params:{type:e,options:{address:r,symbol:n,decimals:i,image:o},chainId:s}},l=null,u=(0,lo.randomBytesHex)(8),d=v=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,a.method,v),l?.()};this.ui.inlineWatchAsset()||(l=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:d,onResetConnection:this.resetAndReload}));let p=new Promise((v,y)=>{this.relayEventManager.callbacks.set(u,O=>{if(l?.(),(0,uv.isErrorResponse)(O))return y(new Error(O.errorMessage));v(O)});let S=O=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:u,response:{method:"watchAsset",result:!1}})},R=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:u,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:R,onCancel:S,type:e,address:r,symbol:n,decimals:i,image:o,chainId:s}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(u,a)});return{cancel:d,promise:p}}addEthereumChain(e,r,n,i,o,s){let a={method:"addEthereumChain",params:{chainId:e,rpcUrls:r,blockExplorerUrls:i,chainName:o,iconUrls:n,nativeCurrency:s}},l=null,u=(0,lo.randomBytesHex)(8),d=v=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,a.method,v),l?.()};return this.ui.inlineAddEthereumChain(e)||(l=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:d,onResetConnection:this.resetAndReload})),{promise:new Promise((v,y)=>{this.relayEventManager.callbacks.set(u,O=>{if(l?.(),(0,uv.isErrorResponse)(O))return y(new Error(O.errorMessage));v(O)});let S=O=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:u,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},R=O=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:u,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:O}}})};this.ui.inlineAddEthereumChain(e)&&this.ui.addEthereumChain({onCancel:S,onApprove:R,chainId:a.params.chainId,rpcUrls:a.params.rpcUrls,blockExplorerUrls:a.params.blockExplorerUrls,chainName:a.params.chainName,iconUrls:a.params.iconUrls,nativeCurrency:a.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(e)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(u,a)}),cancel:d}}switchEthereumChain(e,r){let n={method:"switchEthereumChain",params:Object.assign({chainId:e},{address:r})},i=(0,lo.randomBytesHex)(8),o=a=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,n.method,a)};return{promise:new Promise((a,l)=>{this.relayEventManager.callbacks.set(i,p=>{if((0,uv.isErrorResponse)(p)&&p.errorCode)return l(G4.standardErrors.provider.custom({code:p.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,uv.isErrorResponse)(p))return l(new Error(p.errorMessage));a(p)});let u=p=>{var v;if(p){let y=(v=(0,G4.getErrorCode)(p))!==null&&v!==void 0?v:G4.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(i,"switchEthereumChain",p instanceof Error?p:G4.standardErrors.provider.unsupportedChain(e),y)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},d=p=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:p}}})};this.ui.switchEthereumChain({onCancel:u,onApprove:d,chainId:n.params.chainId,address:n.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(i,n)}),cancel:o}}inlineAddEthereumChain(e){return this.ui.inlineAddEthereumChain(e)}getSessionIdHash(){return Jg.Session.hash(this._session.id)}sendRequestStandalone(e,r){let n=o=>{this.handleErrorResponse(e,r.method,o)},i=o=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:e,response:o})};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}}};CP.WalletLinkRelay=EP;EP.accountRequestCallbackIds=new Set});var a4e=X(fv=>{"use strict";var I2t=fv&&fv.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),T2t=fv&&fv.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&I2t(e,t,r)};Object.defineProperty(fv,"__esModule",{value:!0});T2t(uZ(),fv)});var c4e=X(pZ=>{"use strict";Object.defineProperty(pZ,"__esModule",{value:!0});pZ.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 u4e=X(Q4=>{"use strict";var l4e=Q4&&Q4.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Q4,"__esModule",{value:!0});Q4.RedirectDialog=void 0;var k2t=l4e(Wg()),e0=($s(),zn(fa)),R2t=GQ(),M2t=a4e(),N2t=l4e(c4e()),mZ=class{constructor(){this.root=null}attach(){let e=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",e.appendChild(this.root),(0,R2t.injectCssReset)()}present(e){this.render(e)}clear(){this.render(null)}render(e){this.root&&((0,e0.render)(null,this.root),e&&(0,e0.render)((0,e0.h)(O2t,Object.assign({},e,{onDismiss:()=>{this.clear()}})),this.root))}};Q4.RedirectDialog=mZ;var O2t=({title:t,buttonText:e,darkMode:r,onButtonClick:n,onDismiss:i})=>{let o=r?"dark":"light";return(0,e0.h)(M2t.SnackbarContainer,{darkMode:r},(0,e0.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,e0.h)("style",null,N2t.default),(0,e0.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:i}),(0,e0.h)("div",{class:(0,k2t.default)("-cbwsdk-redirect-dialog-box",o)},(0,e0.h)("p",null,t),(0,e0.h)("button",{onClick:n},e))))}});var wZ=X(AP=>{"use strict";Object.defineProperty(AP,"__esModule",{value:!0});AP.MobileRelayUI=void 0;var P2t=u4e(),gZ=class{constructor(e){this.attached=!1,this.darkMode=!1,this.redirectDialog=new P2t.RedirectDialog,this.darkMode=e.darkMode}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}setConnected(e){}redirectToCoinbaseWallet(e){let r=new URL("https://go.cb-w.com/walletlink");r.searchParams.append("redirect_url",window.location.href),e&&r.searchParams.append("wl_url",e);let n=document.createElement("a");n.target="cbw-opener",n.href=r.href,n.rel="noreferrer noopener",n.click()}openCoinbaseWalletDeeplink(e){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",darkMode:this.darkMode,onButtonClick:()=>{this.redirectToCoinbaseWallet(e)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(e)},99)}showConnecting(e){return()=>{this.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}};AP.MobileRelayUI=gZ});var yZ=X(SP=>{"use strict";Object.defineProperty(SP,"__esModule",{value:!0});SP.MobileRelay=void 0;var B2t=Qd(),D2t=dZ(),L2t=wZ(),vZ=class extends D2t.WalletLinkRelay{constructor(e){var r;super(e),this._enableMobileWalletLink=(r=e.enableMobileWalletLink)!==null&&r!==void 0?r:!1}requestEthereumAccounts(){return this._enableMobileWalletLink?super.requestEthereumAccounts():{promise:new Promise(()=>{let e=(0,B2t.getLocation)();e.href=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(e.href)}`}),cancel:()=>{}}}publishWeb3RequestEvent(e,r){if(super.publishWeb3RequestEvent(e,r),!(this._enableMobileWalletLink&&this.ui instanceof L2t.MobileRelayUI))return;let n=!1;switch(r.method){case"requestEthereumAccounts":case"connectAndSignIn":n=!0,this.ui.openCoinbaseWalletDeeplink(this.getQRCodeUrl());break;case"switchEthereumChain":return;default:n=!0,this.ui.openCoinbaseWalletDeeplink();break}n&&window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0})}handleWeb3ResponseMessage(e){super.handleWeb3ResponseMessage(e)}connectAndSignIn(e){if(!this._enableMobileWalletLink)throw new Error("connectAndSignIn is supported only when enableMobileWalletLink is on");return this.sendRequest({method:"connectAndSignIn",params:{appName:this.appName,appLogoUrl:this.appLogoUrl,domain:window.location.hostname,aud:window.location.href,version:"1",type:"eip4361",nonce:e.nonce,iat:new Date().toISOString(),chainId:`eip155:${this.dappDefaultChain}`,statement:e.statement,resources:e.resources}})}};SP.MobileRelay=vZ});var bZ=X((M6r,m4e)=>{var U2t=KG(),j2t=O9();function f4e(t){return Buffer.allocUnsafe(t).fill(0)}function h4e(t,e,r){let n=f4e(e);return t=_P(t),r?t.length<e?(t.copy(n),n):t.slice(0,e):t.length<e?(t.copy(n,e-t.length),n):t.slice(-e)}function F2t(t,e){return h4e(t,e,!0)}function _P(t){if(!Buffer.isBuffer(t))if(Array.isArray(t))t=Buffer.from(t);else if(typeof t=="string")d4e(t)?t=Buffer.from(H2t(p4e(t)),"hex"):t=Buffer.from(t);else if(typeof t=="number")t=intToBuffer(t);else if(t==null)t=Buffer.allocUnsafe(0);else if(j2t.isBN(t))t=t.toArrayLike(Buffer);else if(t.toArray)t=Buffer.from(t.toArray());else throw new Error("invalid type");return t}function $2t(t){return t=_P(t),"0x"+t.toString("hex")}function q2t(t,e){return t=_P(t),e||(e=256),U2t("keccak"+e).update(t).digest()}function H2t(t){return t.length%2?"0"+t:t}function d4e(t){return typeof t=="string"&&t.match(/^0x[0-9A-Fa-f]*$/)}function p4e(t){return typeof t=="string"&&t.startsWith("0x")?t.slice(2):t}m4e.exports={zeros:f4e,setLength:h4e,setLengthRight:F2t,isHexString:d4e,stripHexPrefix:p4e,toBuffer:_P,bufferToHex:$2t,keccak:q2t}});var x4e=X((N6r,b4e)=>{var pv=bZ(),dv=O9();function w4e(t){return t.startsWith("int[")?"int256"+t.slice(3):t==="int"?"int256":t.startsWith("uint[")?"uint256"+t.slice(4):t==="uint"?"uint256":t.startsWith("fixed[")?"fixed128x128"+t.slice(5):t==="fixed"?"fixed128x128":t.startsWith("ufixed[")?"ufixed128x128"+t.slice(6):t==="ufixed"?"ufixed128x128":t}function Z4(t){return parseInt(/^\D+(\d+)$/.exec(t)[1],10)}function g4e(t){var e=/^\D+(\d+)x(\d+)$/.exec(t);return[parseInt(e[1],10),parseInt(e[2],10)]}function v4e(t){var e=t.match(/(.*)\[(.*?)\]$/);return e?e[2]===""?"dynamic":parseInt(e[2],10):null}function hv(t){var e=typeof t;if(e==="string")return pv.isHexString(t)?new dv(pv.stripHexPrefix(t),16):new dv(t,10);if(e==="number")return new dv(t);if(t.toArray)return t;throw new Error("Argument is not a number")}function t0(t,e){var r,n,i,o;if(t==="address")return t0("uint160",hv(e));if(t==="bool")return t0("uint8",e?1:0);if(t==="string")return t0("bytes",new Buffer(e,"utf8"));if(W2t(t)){if(typeof e.length>"u")throw new Error("Not an array?");if(r=v4e(t),r!=="dynamic"&&r!==0&&e.length>r)throw new Error("Elements exceed array size: "+r);i=[],t=t.slice(0,t.lastIndexOf("[")),typeof e=="string"&&(e=JSON.parse(e));for(o in e)i.push(t0(t,e[o]));if(r==="dynamic"){var s=t0("uint256",e.length);i.unshift(s)}return Buffer.concat(i)}else{if(t==="bytes")return e=new Buffer(e),i=Buffer.concat([t0("uint256",e.length),e]),e.length%32!==0&&(i=Buffer.concat([i,pv.zeros(32-e.length%32)])),i;if(t.startsWith("bytes")){if(r=Z4(t),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return pv.setLengthRight(e,32)}else if(t.startsWith("uint")){if(r=Z4(t),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=hv(e),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(Buffer,"be",32)}else if(t.startsWith("int")){if(r=Z4(t),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=hv(e),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(Buffer,"be",32)}else if(t.startsWith("ufixed")){if(r=g4e(t),n=hv(e),n<0)throw new Error("Supplied ufixed is negative");return t0("uint256",n.mul(new dv(2).pow(new dv(r[1]))))}else if(t.startsWith("fixed"))return r=g4e(t),t0("int256",hv(e).mul(new dv(2).pow(new dv(r[1]))))}throw new Error("Unsupported or invalid type: "+t)}function z2t(t){return t==="string"||t==="bytes"||v4e(t)==="dynamic"}function W2t(t){return t.lastIndexOf("]")===t.length-1}function V2t(t,e){var r=[],n=[],i=32*t.length;for(var o in t){var s=w4e(t[o]),a=e[o],l=t0(s,a);z2t(s)?(r.push(t0("uint256",i)),n.push(l),i+=l.length):r.push(l)}return Buffer.concat(r.concat(n))}function y4e(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var r,n,i=[],o=0;o<t.length;o++){var s=w4e(t[o]),a=e[o];if(s==="bytes")i.push(a);else if(s==="string")i.push(new Buffer(a,"utf8"));else if(s==="bool")i.push(new Buffer(a?"01":"00","hex"));else if(s==="address")i.push(pv.setLength(a,20));else if(s.startsWith("bytes")){if(r=Z4(s),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);i.push(pv.setLengthRight(a,r))}else if(s.startsWith("uint")){if(r=Z4(s),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=hv(a),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());i.push(n.toArrayLike(Buffer,"be",r/8))}else if(s.startsWith("int")){if(r=Z4(s),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=hv(a),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());i.push(n.toTwos(r).toArrayLike(Buffer,"be",r/8))}else throw new Error("Unsupported or invalid type: "+s)}return Buffer.concat(i)}function K2t(t,e){return pv.keccak(y4e(t,e))}b4e.exports={rawEncode:V2t,solidityPack:y4e,soliditySHA3:K2t}});var A4e=X((O6r,C4e)=>{var mh=bZ(),$9=x4e(),E4e={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"]},xZ={encodeData(t,e,r,n=!0){let i=["bytes32"],o=[this.hashType(t,r)];if(n){let s=(a,l,u)=>{if(r[l]!==void 0)return["bytes32",u==null?"0x0000000000000000000000000000000000000000000000000000000000000000":mh.keccak(this.encodeData(l,u,r,n))];if(u===void 0)throw new Error(`missing value for field ${a} of type ${l}`);if(l==="bytes")return["bytes32",mh.keccak(u)];if(l==="string")return typeof u=="string"&&(u=Buffer.from(u,"utf8")),["bytes32",mh.keccak(u)];if(l.lastIndexOf("]")===l.length-1){let d=l.slice(0,l.lastIndexOf("[")),p=u.map(v=>s(a,d,v));return["bytes32",mh.keccak($9.rawEncode(p.map(([v])=>v),p.map(([,v])=>v)))]}return[l,u]};for(let a of r[t]){let[l,u]=s(a.name,a.type,e[a.name]);i.push(l),o.push(u)}}else for(let s of r[t]){let a=e[s.name];if(a!==void 0)if(s.type==="bytes")i.push("bytes32"),a=mh.keccak(a),o.push(a);else if(s.type==="string")i.push("bytes32"),typeof a=="string"&&(a=Buffer.from(a,"utf8")),a=mh.keccak(a),o.push(a);else if(r[s.type]!==void 0)i.push("bytes32"),a=mh.keccak(this.encodeData(s.type,a,r,n)),o.push(a);else{if(s.type.lastIndexOf("]")===s.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(s.type),o.push(a)}}return $9.rawEncode(i,o)},encodeType(t,e){let r="",n=this.findTypeDependencies(t,e).filter(i=>i!==t);n=[t].concat(n.sort());for(let i of n){if(!e[i])throw new Error("No type definition specified: "+i);r+=i+"("+e[i].map(({name:s,type:a})=>a+" "+s).join(",")+")"}return r},findTypeDependencies(t,e,r=[]){if(t=t.match(/^\w*/)[0],r.includes(t)||e[t]===void 0)return r;r.push(t);for(let n of e[t])for(let i of this.findTypeDependencies(n.type,e,r))!r.includes(i)&&r.push(i);return r},hashStruct(t,e,r,n=!0){return mh.keccak(this.encodeData(t,e,r,n))},hashType(t,e){return mh.keccak(this.encodeType(t,e))},sanitizeData(t){let e={};for(let r in E4e.properties)t[r]&&(e[r]=t[r]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash(t,e=!0){let r=this.sanitizeData(t),n=[Buffer.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,e)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,e)),mh.keccak(Buffer.concat(n))}};C4e.exports={TYPED_MESSAGE_SCHEMA:E4e,TypedDataUtils:xZ,hashForSignTypedDataLegacy:function(t){return G2t(t.data)},hashForSignTypedData_v3:function(t){return xZ.hash(t.data,!1)},hashForSignTypedData_v4:function(t){return xZ.hash(t.data)}};function G2t(t){let e=new Error("Expect argument to be non-empty array");if(typeof t!="object"||!t.length)throw e;let r=t.map(function(o){return o.type==="bytes"?mh.toBuffer(o.value):o.value}),n=t.map(function(o){return o.type}),i=t.map(function(o){if(!o.name)throw e;return o.type+" "+o.name});return $9.soliditySHA3(["bytes32","bytes32"],[$9.soliditySHA3(new Array(t.length).fill("string"),i),$9.soliditySHA3(n,r)])}});var k4e=X(J4=>{"use strict";Object.defineProperty(J4,"__esModule",{value:!0});J4.filterFromParam=J4.FilterPolyfill=void 0;var Y4=L9(),Ec=Qd(),Q2t=5*60*1e3,mv={jsonrpc:"2.0",id:0},EZ=class{constructor(e){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,Y4.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=e}async newFilter(e){let r=T4e(e),n=this.makeFilterId(),i=await this.setInitialCursorPosition(n,r.fromBlock);return console.info(`Installing new log filter(${n}):`,r,"initial cursor position:",i),this.logFilters.set(n,r),this.setFilterTimeout(n),(0,Ec.hexStringFromIntNumber)(n)}async newBlockFilter(){let e=this.makeFilterId(),r=await this.setInitialCursorPosition(e,"latest");return console.info(`Installing new block filter (${e}) with initial cursor position:`,r),this.blockFilters.add(e),this.setFilterTimeout(e),(0,Ec.hexStringFromIntNumber)(e)}async newPendingTransactionFilter(){let e=this.makeFilterId(),r=await this.setInitialCursorPosition(e,"latest");return console.info(`Installing new block filter (${e}) with initial cursor position:`,r),this.pendingTransactionFilters.add(e),this.setFilterTimeout(e),(0,Ec.hexStringFromIntNumber)(e)}uninstallFilter(e){let r=(0,Ec.intNumberFromHexString)(e);return console.info(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(e){let r=(0,Ec.intNumberFromHexString)(e);return this.timeouts.has(r)&&this.setFilterTimeout(r),this.logFilters.has(r)?this.getLogFilterChanges(r):this.blockFilters.has(r)?this.getBlockFilterChanges(r):this.pendingTransactionFilters.has(r)?this.getPendingTransactionFilterChanges(r):Promise.resolve(IP())}async getFilterLogs(e){let r=(0,Ec.intNumberFromHexString)(e),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},mv),{method:"eth_getLogs",params:[S4e(n)]})):IP()}makeFilterId(){return(0,Y4.IntNumber)(++this.nextFilterId)}sendAsyncPromise(e){return new Promise((r,n)=>{this.provider.sendAsync(e,(i,o)=>{if(i)return n(i);if(Array.isArray(o)||o==null)return n(new Error(`unexpected response received: ${JSON.stringify(o)}`));r(o)})})}deleteFilter(e){console.info(`Deleting filter (${e})`),this.logFilters.delete(e),this.blockFilters.delete(e),this.pendingTransactionFilters.delete(e),this.cursors.delete(e),this.timeouts.delete(e)}async getLogFilterChanges(e){let r=this.logFilters.get(e),n=this.cursors.get(e);if(!n||!r)return IP();let i=await this.getCurrentBlockHeight(),o=r.toBlock==="latest"?i:r.toBlock;if(n>i||n>Number(r.toBlock))return TP();console.info(`Fetching logs from ${n} to ${o} for filter ${e}`);let s=await this.sendAsyncPromise(Object.assign(Object.assign({},mv),{method:"eth_getLogs",params:[S4e(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:o}))]}));if(Array.isArray(s.result)){let a=s.result.map(u=>(0,Ec.intNumberFromHexString)(u.blockNumber||"0x0")),l=Math.max(...a);if(l&&l>n){let u=(0,Y4.IntNumber)(l+1);console.info(`Moving cursor position for filter (${e}) from ${n} to ${u}`),this.cursors.set(e,u)}}return s}async getBlockFilterChanges(e){let r=this.cursors.get(e);if(!r)return IP();let n=await this.getCurrentBlockHeight();if(r>n)return TP();console.info(`Fetching blocks from ${r} to ${n} for filter (${e})`);let i=(await Promise.all((0,Ec.range)(r,n+1).map(s=>this.getBlockHashByNumber((0,Y4.IntNumber)(s))))).filter(s=>!!s),o=(0,Y4.IntNumber)(r+i.length);return console.info(`Moving cursor position for filter (${e}) from ${r} to ${o}`),this.cursors.set(e,o),Object.assign(Object.assign({},mv),{result:i})}async getPendingTransactionFilterChanges(e){return Promise.resolve(TP())}async setInitialCursorPosition(e,r){let n=await this.getCurrentBlockHeight(),i=typeof r=="number"&&r>n?r:n;return this.cursors.set(e,i),i}setFilterTimeout(e){let r=this.timeouts.get(e);r&&window.clearTimeout(r);let n=window.setTimeout(()=>{console.info(`Filter (${e}) timed out`),this.deleteFilter(e)},Q2t);this.timeouts.set(e,n)}async getCurrentBlockHeight(){let e=new Date;if(e.getTime()-this.lastFetchTimestamp.getTime()>this.REQUEST_THROTTLE_INTERVAL){this.lastFetchTimestamp=e;let 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(){let{result:e}=await this.sendAsyncPromise(Object.assign(Object.assign({},mv),{method:"eth_blockNumber",params:[]}));return(0,Ec.intNumberFromHexString)((0,Ec.ensureHexString)(e))}async getBlockHashByNumber(e){let r=await this.sendAsyncPromise(Object.assign(Object.assign({},mv),{method:"eth_getBlockByNumber",params:[(0,Ec.hexStringFromIntNumber)(e),!1]}));return r.result&&typeof r.result.hash=="string"?(0,Ec.ensureHexString)(r.result.hash):null}};J4.FilterPolyfill=EZ;function T4e(t){return{fromBlock:_4e(t.fromBlock),toBlock:_4e(t.toBlock),addresses:t.address===void 0?null:Array.isArray(t.address)?t.address:[t.address],topics:t.topics||[]}}J4.filterFromParam=T4e;function S4e(t){let e={fromBlock:I4e(t.fromBlock),toBlock:I4e(t.toBlock),topics:t.topics};return t.addresses!==null&&(e.address=t.addresses),e}function _4e(t){if(t===void 0||t==="latest"||t==="pending")return"latest";if(t==="earliest")return(0,Y4.IntNumber)(0);if((0,Ec.isHexString)(t))return(0,Ec.intNumberFromHexString)(t);throw new Error(`Invalid block option: ${String(t)}`)}function I4e(t){return t==="latest"?t:(0,Ec.hexStringFromIntNumber)(t)}function IP(){return Object.assign(Object.assign({},mv),{error:{code:-32e3,message:"filter not found"}})}function TP(){return Object.assign(Object.assign({},mv),{result:[]})}});var kP=X((B6r,R4e)=>{R4e.exports=Z2t;function Z2t(t){t=t||{};var e=t.max||Number.MAX_SAFE_INTEGER,r=typeof t.start<"u"?t.start:Math.floor(Math.random()*e);return function(){return r=r%e,r++}}});var O4e=X((D6r,N4e)=>{"use strict";var M4e=(t,e)=>function(){let r=e.promiseModule,n=new Array(arguments.length);for(let i=0;i<arguments.length;i++)n[i]=arguments[i];return new r((i,o)=>{e.errorFirst?n.push(function(s,a){if(e.multiArgs){let l=new Array(arguments.length-1);for(let u=1;u<arguments.length;u++)l[u-1]=arguments[u];s?(l.unshift(s),o(l)):i(l)}else s?o(s):i(a)}):n.push(function(s){if(e.multiArgs){let a=new Array(arguments.length-1);for(let l=0;l<arguments.length;l++)a[l]=arguments[l];i(a)}else i(s)}),t.apply(this,n)})};N4e.exports=(t,e)=>{e=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},e);let r=i=>{let o=s=>typeof s=="string"?i===s:s.test(i);return e.include?e.include.some(o):!e.exclude.some(o)},n;typeof t=="function"?n=function(){return e.excludeMain?t.apply(this,arguments):M4e(t,e).apply(this,arguments)}:n=Object.create(Object.getPrototypeOf(t));for(let i in t){let o=t[i];n[i]=typeof o=="function"&&r(i)?M4e(o,e):o}return n}});var RP=X(AZ=>{"use strict";Object.defineProperty(AZ,"__esModule",{value:!0});var Y2t=jd();function P4e(t,e,r){try{Reflect.apply(t,e,r)}catch(n){setTimeout(()=>{throw n})}}function J2t(t){let e=t.length,r=new Array(e);for(let n=0;n<e;n+=1)r[n]=t[n];return r}var CZ=class extends Y2t.EventEmitter{emit(e,...r){let n=e==="error",i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){let s;if(r.length>0&&([s]=r),s instanceof Error)throw s;let a=new Error(`Unhandled error.${s?` (${s.message})`:""}`);throw a.context=s,a}let o=i[e];if(o===void 0)return!1;if(typeof o=="function")P4e(o,this,r);else{let s=o.length,a=J2t(o);for(let l=0;l<s;l+=1)P4e(a[l],this,r)}return!0}};AZ.default=CZ});var _Z=X(X4=>{"use strict";var X2t=X4&&X4.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(X4,"__esModule",{value:!0});X4.BaseBlockTracker=void 0;var ewt=X2t(RP()),twt=1e3,rwt=(t,e)=>t+e,B4e=["sync","latest"],SZ=class extends ewt.default{constructor(e){super(),this._blockResetDuration=e.blockResetDuration||20*twt,this._usePastBlocks=e.usePastBlocks||!1,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(r=>this.once("latest",r))}removeAllListeners(e){return e?super.removeAllListeners(e):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(e){B4e.includes(e)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return B4e.map(e=>this.listenerCount(e)).reduce(rwt)}_shouldUseNewBlock(e){let r=this._currentBlock;if(!r)return!0;let n=D4e(e),i=D4e(r);return this._usePastBlocks&&n<i||n>i}_newPotentialLatest(e){this._shouldUseNewBlock(e)&&this._setCurrentBlock(e)}_setCurrentBlock(e){let r=this._currentBlock;this._currentBlock=e,this.emit("latest",e),this.emit("sync",{oldBlock:r,newBlock:e})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}};X4.BaseBlockTracker=SZ;function D4e(t){return Number.parseInt(t,16)}});var Xg=X((MP,L4e)=>{(function(t,e){typeof MP=="object"&&typeof L4e<"u"?e(MP):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.Superstruct={}))})(MP,function(t){"use strict";class e extends TypeError{constructor(ge,be){let ye,{message:_e,explanation:ft,...Ve}=ge,{path:Le}=ge,Ut=Le.length===0?_e:`At path: ${Le.join(".")} -- ${_e}`;super(ft??Ut),ft!=null&&(this.cause=Ut),Object.assign(this,Ve),this.name=this.constructor.name,this.failures=()=>ye??(ye=[ge,...be()])}}function r(de){return n(de)&&typeof de[Symbol.iterator]=="function"}function n(de){return typeof de=="object"&&de!=null}function i(de){if(Object.prototype.toString.call(de)!=="[object Object]")return!1;let ge=Object.getPrototypeOf(de);return ge===null||ge===Object.prototype}function o(de){return typeof de=="symbol"?de.toString():typeof de=="string"?JSON.stringify(de):`${de}`}function s(de){let{done:ge,value:be}=de.next();return ge?void 0:be}function a(de,ge,be,ye){if(de===!0)return;de===!1?de={}:typeof de=="string"&&(de={message:de});let{path:_e,branch:ft}=ge,{type:Ve}=be,{refinement:Le,message:Ut=`Expected a value of type \`${Ve}\`${Le?` with refinement \`${Le}\``:""}, but received: \`${o(ye)}\``}=de;return{value:ye,type:Ve,refinement:Le,key:_e[_e.length-1],path:_e,branch:ft,...de,message:Ut}}function*l(de,ge,be,ye){r(de)||(de=[de]);for(let _e of de){let ft=a(_e,ge,be,ye);ft&&(yield ft)}}function*u(de,ge,be={}){let{path:ye=[],branch:_e=[de],coerce:ft=!1,mask:Ve=!1}=be,Le={path:ye,branch:_e};if(ft&&(de=ge.coercer(de,Le),Ve&&ge.type!=="type"&&n(ge.schema)&&n(de)&&!Array.isArray(de)))for(let Xe in de)ge.schema[Xe]===void 0&&delete de[Xe];let Ut="valid";for(let Xe of ge.validator(de,Le))Xe.explanation=be.message,Ut="not_valid",yield[Xe,void 0];for(let[Xe,ze,hr]of ge.entries(de,Le)){let bt=u(ze,hr,{path:Xe===void 0?ye:[...ye,Xe],branch:Xe===void 0?_e:[..._e,ze],coerce:ft,mask:Ve,message:be.message});for(let tt of bt)tt[0]?(Ut=tt[0].refinement!=null?"not_refined":"not_valid",yield[tt[0],void 0]):ft&&(ze=tt[1],Xe===void 0?de=ze:de instanceof Map?de.set(Xe,ze):de instanceof Set?de.add(ze):n(de)&&(ze!==void 0||Xe in de)&&(de[Xe]=ze))}if(Ut!=="not_valid")for(let Xe of ge.refiner(de,Le))Xe.explanation=be.message,Ut="not_refined",yield[Xe,void 0];Ut==="valid"&&(yield[void 0,de])}class d{constructor(ge){let{type:be,schema:ye,validator:_e,refiner:ft,coercer:Ve=Ut=>Ut,entries:Le=function*(){}}=ge;this.type=be,this.schema=ye,this.entries=Le,this.coercer=Ve,_e?this.validator=(Ut,Xe)=>{let ze=_e(Ut,Xe);return l(ze,Xe,this,Ut)}:this.validator=()=>[],ft?this.refiner=(Ut,Xe)=>{let ze=ft(Ut,Xe);return l(ze,Xe,this,Ut)}:this.refiner=()=>[]}assert(ge,be){return p(ge,this,be)}create(ge,be){return v(ge,this,be)}is(ge){return S(ge,this)}mask(ge,be){return y(ge,this,be)}validate(ge,be={}){return R(ge,this,be)}}function p(de,ge,be){let ye=R(de,ge,{message:be});if(ye[0])throw ye[0]}function v(de,ge,be){let ye=R(de,ge,{coerce:!0,message:be});if(ye[0])throw ye[0];return ye[1]}function y(de,ge,be){let ye=R(de,ge,{coerce:!0,mask:!0,message:be});if(ye[0])throw ye[0];return ye[1]}function S(de,ge){return!R(de,ge)[0]}function R(de,ge,be={}){let ye=u(de,ge,be),_e=s(ye);return _e[0]?[new e(_e[0],function*(){for(let Ve of ye)Ve[0]&&(yield Ve[0])}),void 0]:[void 0,_e[1]]}function O(...de){let ge=de[0].type==="type",be=de.map(_e=>_e.schema),ye=Object.assign({},...be);return ge?ae(ye):re(ye)}function k(de,ge){return new d({type:de,schema:null,validator:ge})}function M(de,ge){return new d({...de,refiner:(be,ye)=>be===void 0||de.refiner(be,ye),validator(be,ye){return be===void 0?!0:(ge(be,ye),de.validator(be,ye))}})}function D(de){return new d({type:"dynamic",schema:null,*entries(ge,be){yield*de(ge,be).entries(ge,be)},validator(ge,be){return de(ge,be).validator(ge,be)},coercer(ge,be){return de(ge,be).coercer(ge,be)},refiner(ge,be){return de(ge,be).refiner(ge,be)}})}function j(de){let ge;return new d({type:"lazy",schema:null,*entries(be,ye){ge??(ge=de()),yield*ge.entries(be,ye)},validator(be,ye){return ge??(ge=de()),ge.validator(be,ye)},coercer(be,ye){return ge??(ge=de()),ge.coercer(be,ye)},refiner(be,ye){return ge??(ge=de()),ge.refiner(be,ye)}})}function q(de,ge){let{schema:be}=de,ye={...be};for(let _e of ge)delete ye[_e];switch(de.type){case"type":return ae(ye);default:return re(ye)}}function W(de){let ge=de instanceof d,be=ge?{...de.schema}:{...de};for(let ye in be)be[ye]=A(be[ye]);return ge&&de.type==="type"?ae(be):re(be)}function V(de,ge){let{schema:be}=de,ye={};for(let _e of ge)ye[_e]=be[_e];switch(de.type){case"type":return ae(ye);default:return re(ye)}}function P(de,ge){return console.warn("[email protected] - The `struct` helper has been renamed to `define`."),k(de,ge)}function $(){return k("any",()=>!0)}function U(de){return new d({type:"array",schema:de,*entries(ge){if(de&&Array.isArray(ge))for(let[be,ye]of ge.entries())yield[be,ye,de]},coercer(ge){return Array.isArray(ge)?ge.slice():ge},validator(ge){return Array.isArray(ge)||`Expected an array value, but received: ${o(ge)}`}})}function L(){return k("bigint",de=>typeof de=="bigint")}function z(){return k("boolean",de=>typeof de=="boolean")}function f(){return k("date",de=>de instanceof Date&&!isNaN(de.getTime())||`Expected a valid \`Date\` object, but received: ${o(de)}`)}function h(de){let ge={},be=de.map(ye=>o(ye)).join();for(let ye of de)ge[ye]=ye;return new d({type:"enums",schema:ge,validator(ye){return de.includes(ye)||`Expected one of \`${be}\`, but received: ${o(ye)}`}})}function m(){return k("func",de=>typeof de=="function"||`Expected a function, but received: ${o(de)}`)}function b(de){return k("instance",ge=>ge instanceof de||`Expected a \`${de.name}\` instance, but received: ${o(ge)}`)}function C(){return k("integer",de=>typeof de=="number"&&!isNaN(de)&&Number.isInteger(de)||`Expected an integer, but received: ${o(de)}`)}function T(de){return new d({type:"intersection",schema:null,*entries(ge,be){for(let ye of de)yield*ye.entries(ge,be)},*validator(ge,be){for(let ye of de)yield*ye.validator(ge,be)},*refiner(ge,be){for(let ye of de)yield*ye.refiner(ge,be)}})}function N(de){let ge=o(de),be=typeof de;return new d({type:"literal",schema:be==="string"||be==="number"||be==="boolean"?de:null,validator(ye){return ye===de||`Expected the literal \`${ge}\`, but received: ${o(ye)}`}})}function I(de,ge){return new d({type:"map",schema:null,*entries(be){if(de&&ge&&be instanceof Map)for(let[ye,_e]of be.entries())yield[ye,ye,de],yield[ye,_e,ge]},coercer(be){return be instanceof Map?new Map(be):be},validator(be){return be instanceof Map||`Expected a \`Map\` object, but received: ${o(be)}`}})}function g(){return k("never",()=>!1)}function x(de){return new d({...de,validator:(ge,be)=>ge===null||de.validator(ge,be),refiner:(ge,be)=>ge===null||de.refiner(ge,be)})}function Q(){return k("number",de=>typeof de=="number"&&!isNaN(de)||`Expected a number, but received: ${o(de)}`)}function re(de){let ge=de?Object.keys(de):[],be=g();return new d({type:"object",schema:de||null,*entries(ye){if(de&&n(ye)){let _e=new Set(Object.keys(ye));for(let ft of ge)_e.delete(ft),yield[ft,ye[ft],de[ft]];for(let ft of _e)yield[ft,ye[ft],be]}},validator(ye){return n(ye)||`Expected an object, but received: ${o(ye)}`},coercer(ye){return n(ye)?{...ye}:ye}})}function A(de){return new d({...de,validator:(ge,be)=>ge===void 0||de.validator(ge,be),refiner:(ge,be)=>ge===void 0||de.refiner(ge,be)})}function G(de,ge){return new d({type:"record",schema:null,*entries(be){if(n(be))for(let ye in be){let _e=be[ye];yield[ye,ye,de],yield[ye,_e,ge]}},validator(be){return n(be)||`Expected an object, but received: ${o(be)}`}})}function Z(){return k("regexp",de=>de instanceof RegExp)}function Y(de){return new d({type:"set",schema:null,*entries(ge){if(de&&ge instanceof Set)for(let be of ge)yield[be,be,de]},coercer(ge){return ge instanceof Set?new Set(ge):ge},validator(ge){return ge instanceof Set||`Expected a \`Set\` object, but received: ${o(ge)}`}})}function ue(){return k("string",de=>typeof de=="string"||`Expected a string, but received: ${o(de)}`)}function fe(de){let ge=g();return new d({type:"tuple",schema:null,*entries(be){if(Array.isArray(be)){let ye=Math.max(de.length,be.length);for(let _e=0;_e<ye;_e++)yield[_e,be[_e],de[_e]||ge]}},validator(be){return Array.isArray(be)||`Expected an array, but received: ${o(be)}`}})}function ae(de){let ge=Object.keys(de);return new d({type:"type",schema:de,*entries(be){if(n(be))for(let ye of ge)yield[ye,be[ye],de[ye]]},validator(be){return n(be)||`Expected an object, but received: ${o(be)}`},coercer(be){return n(be)?{...be}:be}})}function me(de){let ge=de.map(be=>be.type).join(" | ");return new d({type:"union",schema:null,coercer(be){for(let ye of de){let[_e,ft]=ye.validate(be,{coerce:!0});if(!_e)return ft}return be},validator(be,ye){let _e=[];for(let ft of de){let[...Ve]=u(be,ft,ye),[Le]=Ve;if(Le[0])for(let[Ut]of Ve)Ut&&_e.push(Ut);else return[]}return[`Expected the value to satisfy a union of \`${ge}\`, but received: ${o(be)}`,..._e]}})}function Ce(){return k("unknown",()=>!0)}function le(de,ge,be){return new d({...de,coercer:(ye,_e)=>S(ye,ge)?de.coercer(be(ye,_e),_e):de.coercer(ye,_e)})}function Se(de,ge,be={}){return le(de,Ce(),ye=>{let _e=typeof ge=="function"?ge():ge;if(ye===void 0)return _e;if(!be.strict&&i(ye)&&i(_e)){let ft={...ye},Ve=!1;for(let Le in _e)ft[Le]===void 0&&(ft[Le]=_e[Le],Ve=!0);if(Ve)return ft}return ye})}function gt(de){return le(de,ue(),ge=>ge.trim())}function Qe(de){return er(de,"empty",ge=>{let be=ur(ge);return be===0||`Expected an empty ${de.type} but received one with a size of \`${be}\``})}function ur(de){return de instanceof Map||de instanceof Set?de.size:de.length}function mt(de,ge,be={}){let{exclusive:ye}=be;return er(de,"max",_e=>ye?_e<ge:_e<=ge||`Expected a ${de.type} less than ${ye?"":"or equal to "}${ge} but received \`${_e}\``)}function qe(de,ge,be={}){let{exclusive:ye}=be;return er(de,"min",_e=>ye?_e>ge:_e>=ge||`Expected a ${de.type} greater than ${ye?"":"or equal to "}${ge} but received \`${_e}\``)}function Vt(de){return er(de,"nonempty",ge=>ur(ge)>0||`Expected a nonempty ${de.type} but received an empty one`)}function wt(de,ge){return er(de,"pattern",be=>ge.test(be)||`Expected a ${de.type} matching \`/${ge.source}/\` but received "${be}"`)}function nt(de,ge,be=ge){let ye=`Expected a ${de.type}`,_e=ge===be?`of \`${ge}\``:`between \`${ge}\` and \`${be}\``;return er(de,"size",ft=>{if(typeof ft=="number"||ft instanceof Date)return ge<=ft&&ft<=be||`${ye} ${_e} but received \`${ft}\``;if(ft instanceof Map||ft instanceof Set){let{size:Ve}=ft;return ge<=Ve&&Ve<=be||`${ye} with a size ${_e} but received one with a size of \`${Ve}\``}else{let{length:Ve}=ft;return ge<=Ve&&Ve<=be||`${ye} with a length ${_e} but received one with a length of \`${Ve}\``}})}function er(de,ge,be){return new d({...de,*refiner(ye,_e){yield*de.refiner(ye,_e);let ft=be(ye,_e),Ve=l(ft,_e,de,ye);for(let Le of Ve)yield{...Le,refinement:ge}}})}t.Struct=d,t.StructError=e,t.any=$,t.array=U,t.assert=p,t.assign=O,t.bigint=L,t.boolean=z,t.coerce=le,t.create=v,t.date=f,t.defaulted=Se,t.define=k,t.deprecated=M,t.dynamic=D,t.empty=Qe,t.enums=h,t.func=m,t.instance=b,t.integer=C,t.intersection=T,t.is=S,t.lazy=j,t.literal=N,t.map=I,t.mask=y,t.max=mt,t.min=qe,t.never=g,t.nonempty=Vt,t.nullable=x,t.number=Q,t.object=re,t.omit=q,t.optional=A,t.partial=W,t.pattern=wt,t.pick=V,t.record=G,t.refine=er,t.regexp=Z,t.set=Y,t.size=nt,t.string=ue,t.struct=P,t.trimmed=gt,t.tuple=fe,t.type=ae,t.union=me,t.unknown=Ce,t.validate=R})});var Cm=X(r0=>{"use strict";Object.defineProperty(r0,"__esModule",{value:!0});r0.assertExhaustive=r0.assertStruct=r0.assert=r0.AssertionError=void 0;var nwt=Xg();function iwt(t){return typeof t=="object"&&t!==null&&"message"in t}function owt(t){var e,r;return typeof((r=(e=t?.prototype)===null||e===void 0?void 0:e.constructor)===null||r===void 0?void 0:r.name)=="string"}function swt(t){let e=iwt(t)?t.message:String(t);return e.endsWith(".")?e.slice(0,-1):e}function U4e(t,e){return owt(t)?new t({message:e}):t({message:e})}var q9=class extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}};r0.AssertionError=q9;function awt(t,e="Assertion failed.",r=q9){if(!t)throw e instanceof Error?e:U4e(r,e)}r0.assert=awt;function cwt(t,e,r="Assertion failed",n=q9){try{(0,nwt.assert)(t,e)}catch(i){throw U4e(n,`${r}: ${swt(i)}.`)}}r0.assertStruct=cwt;function lwt(t){throw new Error("Invalid branch reached. Should be detected during compilation.")}r0.assertExhaustive=lwt});var IZ=X(NP=>{"use strict";Object.defineProperty(NP,"__esModule",{value:!0});NP.base64=void 0;var uwt=Xg(),fwt=Cm(),hwt=(t,e={})=>{var r,n;let i=(r=e.paddingRequired)!==null&&r!==void 0?r:!1,o=(n=e.characterSet)!==null&&n!==void 0?n:"base64",s;o==="base64"?s=String.raw`[A-Za-z0-9+\/]`:((0,fwt.assert)(o==="base64url"),s=String.raw`[-_A-Za-z0-9]`);let a;return i?a=new RegExp(`^(?:${s}{4})*(?:${s}{3}=|${s}{2}==)?$`,"u"):a=new RegExp(`^(?:${s}{4})*(?:${s}{2,3}|${s}{3}=|${s}{2}==)?$`,"u"),(0,uwt.pattern)(t,a)};NP.base64=hwt});var H9=X(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});ls.remove0x=ls.add0x=ls.assertIsStrictHexString=ls.assertIsHexString=ls.isStrictHexString=ls.isHexString=ls.StrictHexStruct=ls.HexStruct=void 0;var e6=Xg(),j4e=Cm();ls.HexStruct=(0,e6.pattern)((0,e6.string)(),/^(?:0x)?[0-9a-f]+$/iu);ls.StrictHexStruct=(0,e6.pattern)((0,e6.string)(),/^0x[0-9a-f]+$/iu);function F4e(t){return(0,e6.is)(t,ls.HexStruct)}ls.isHexString=F4e;function $4e(t){return(0,e6.is)(t,ls.StrictHexStruct)}ls.isStrictHexString=$4e;function dwt(t){(0,j4e.assert)(F4e(t),"Value must be a hexadecimal string.")}ls.assertIsHexString=dwt;function pwt(t){(0,j4e.assert)($4e(t),'Value must be a hexadecimal string, starting with "0x".')}ls.assertIsStrictHexString=pwt;function mwt(t){return t.startsWith("0x")?t:t.startsWith("0X")?`0x${t.substring(2)}`:`0x${t}`}ls.add0x=mwt;function gwt(t){return t.startsWith("0x")||t.startsWith("0X")?t.substring(2):t}ls.remove0x=gwt});var RZ=X(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.createDataView=oi.concatBytes=oi.valueToBytes=oi.stringToBytes=oi.numberToBytes=oi.signedBigIntToBytes=oi.bigIntToBytes=oi.hexToBytes=oi.bytesToString=oi.bytesToNumber=oi.bytesToSignedBigInt=oi.bytesToBigInt=oi.bytesToHex=oi.assertIsBytes=oi.isBytes=void 0;var Zl=Cm(),TZ=H9(),q4e=48,H4e=58,z4e=87;function wwt(){let t=[];return()=>{if(t.length===0)for(let e=0;e<256;e++)t.push(e.toString(16).padStart(2,"0"));return t}}var vwt=wwt();function kZ(t){return t instanceof Uint8Array}oi.isBytes=kZ;function t6(t){(0,Zl.assert)(kZ(t),"Value must be a Uint8Array.")}oi.assertIsBytes=t6;function W4e(t){if(t6(t),t.length===0)return"0x";let e=vwt(),r=new Array(t.length);for(let n=0;n<t.length;n++)r[n]=e[t[n]];return(0,TZ.add0x)(r.join(""))}oi.bytesToHex=W4e;function V4e(t){t6(t);let e=W4e(t);return BigInt(e)}oi.bytesToBigInt=V4e;function ywt(t){t6(t);let e=BigInt(0);for(let r of t)e=(e<<BigInt(8))+BigInt(r);return BigInt.asIntN(t.length*8,e)}oi.bytesToSignedBigInt=ywt;function bwt(t){t6(t);let e=V4e(t);return(0,Zl.assert)(e<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(e)}oi.bytesToNumber=bwt;function xwt(t){return t6(t),new TextDecoder().decode(t)}oi.bytesToString=xwt;function OP(t){var e;if(((e=t?.toLowerCase)===null||e===void 0?void 0:e.call(t))==="0x")return new Uint8Array;(0,TZ.assertIsHexString)(t);let r=(0,TZ.remove0x)(t).toLowerCase(),n=r.length%2===0?r:`0${r}`,i=new Uint8Array(n.length/2);for(let o=0;o<i.length;o++){let s=n.charCodeAt(o*2),a=n.charCodeAt(o*2+1),l=s-(s<H4e?q4e:z4e),u=a-(a<H4e?q4e:z4e);i[o]=l*16+u}return i}oi.hexToBytes=OP;function K4e(t){(0,Zl.assert)(typeof t=="bigint","Value must be a bigint."),(0,Zl.assert)(t>=BigInt(0),"Value must be a non-negative bigint.");let e=t.toString(16);return OP(e)}oi.bigIntToBytes=K4e;function Ewt(t,e){(0,Zl.assert)(e>0);let r=t>>BigInt(31);return!((~t&r)+(t&~r)>>BigInt(e*8+-1))}function Cwt(t,e){(0,Zl.assert)(typeof t=="bigint","Value must be a bigint."),(0,Zl.assert)(typeof e=="number","Byte length must be a number."),(0,Zl.assert)(e>0,"Byte length must be greater than 0."),(0,Zl.assert)(Ewt(t,e),"Byte length is too small to represent the given value.");let r=t,n=new Uint8Array(e);for(let i=0;i<n.length;i++)n[i]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return n.reverse()}oi.signedBigIntToBytes=Cwt;function G4e(t){(0,Zl.assert)(typeof t=="number","Value must be a number."),(0,Zl.assert)(t>=0,"Value must be a non-negative number."),(0,Zl.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToBytes` instead.");let e=t.toString(16);return OP(e)}oi.numberToBytes=G4e;function Q4e(t){return(0,Zl.assert)(typeof t=="string","Value must be a string."),new TextEncoder().encode(t)}oi.stringToBytes=Q4e;function Z4e(t){if(typeof t=="bigint")return K4e(t);if(typeof t=="number")return G4e(t);if(typeof t=="string")return t.startsWith("0x")?OP(t):Q4e(t);if(kZ(t))return t;throw new TypeError(`Unsupported value type: "${typeof t}".`)}oi.valueToBytes=Z4e;function Awt(t){let e=new Array(t.length),r=0;for(let i=0;i<t.length;i++){let o=Z4e(t[i]);e[i]=o,r+=o.length}let n=new Uint8Array(r);for(let i=0,o=0;i<e.length;i++)n.set(e[i],o),o+=e[i].length;return n}oi.concatBytes=Awt;function Swt(t){if(typeof Buffer<"u"&&t instanceof Buffer){let e=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);return new DataView(e)}return new DataView(t.buffer,t.byteOffset,t.byteLength)}oi.createDataView=Swt});var J4e=X(PP=>{"use strict";Object.defineProperty(PP,"__esModule",{value:!0});PP.ChecksumStruct=void 0;var Y4e=Xg(),_wt=IZ();PP.ChecksumStruct=(0,Y4e.size)((0,_wt.base64)((0,Y4e.string)(),{paddingRequired:!0}),44,44)});var t6e=X(n0=>{"use strict";Object.defineProperty(n0,"__esModule",{value:!0});n0.createHex=n0.createBytes=n0.createBigInt=n0.createNumber=void 0;var uo=Xg(),Iwt=Cm(),X4e=RZ(),BP=H9(),e6e=(0,uo.union)([(0,uo.number)(),(0,uo.bigint)(),(0,uo.string)(),BP.StrictHexStruct]),Twt=(0,uo.coerce)((0,uo.number)(),e6e,Number),kwt=(0,uo.coerce)((0,uo.bigint)(),e6e,BigInt),z6r=(0,uo.union)([BP.StrictHexStruct,(0,uo.instance)(Uint8Array)]),Rwt=(0,uo.coerce)((0,uo.instance)(Uint8Array),(0,uo.union)([BP.StrictHexStruct]),X4e.hexToBytes),Mwt=(0,uo.coerce)(BP.StrictHexStruct,(0,uo.instance)(Uint8Array),X4e.bytesToHex);function Nwt(t){try{let e=(0,uo.create)(t,Twt);return(0,Iwt.assert)(Number.isFinite(e),`Expected a number-like value, got "${t}".`),e}catch(e){throw e instanceof uo.StructError?new Error(`Expected a number-like value, got "${t}".`):e}}n0.createNumber=Nwt;function Owt(t){try{return(0,uo.create)(t,kwt)}catch(e){throw e instanceof uo.StructError?new Error(`Expected a number-like value, got "${String(e.value)}".`):e}}n0.createBigInt=Owt;function Pwt(t){if(typeof t=="string"&&t.toLowerCase()==="0x")return new Uint8Array;try{return(0,uo.create)(t,Rwt)}catch(e){throw e instanceof uo.StructError?new Error(`Expected a bytes-like value, got "${String(e.value)}".`):e}}n0.createBytes=Pwt;function Bwt(t){if(t instanceof Uint8Array&&t.length===0||typeof t=="string"&&t.toLowerCase()==="0x")return"0x";try{return(0,uo.create)(t,Mwt)}catch(e){throw e instanceof uo.StructError?new Error(`Expected a bytes-like value, got "${String(e.value)}".`):e}}n0.createHex=Bwt});var n6e=X(o0=>{"use strict";var r6e=o0&&o0.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Cc=o0&&o0.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},gh,i0;Object.defineProperty(o0,"__esModule",{value:!0});o0.FrozenSet=o0.FrozenMap=void 0;var z9=class{constructor(e){gh.set(this,void 0),r6e(this,gh,new Map(e),"f"),Object.freeze(this)}get size(){return Cc(this,gh,"f").size}[(gh=new WeakMap,Symbol.iterator)](){return Cc(this,gh,"f")[Symbol.iterator]()}entries(){return Cc(this,gh,"f").entries()}forEach(e,r){return Cc(this,gh,"f").forEach((n,i,o)=>e.call(r,n,i,this))}get(e){return Cc(this,gh,"f").get(e)}has(e){return Cc(this,gh,"f").has(e)}keys(){return Cc(this,gh,"f").keys()}values(){return Cc(this,gh,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([e,r])=>`${String(e)} => ${String(r)}`).join(", ")} `:""}}`}};o0.FrozenMap=z9;var W9=class{constructor(e){i0.set(this,void 0),r6e(this,i0,new Set(e),"f"),Object.freeze(this)}get size(){return Cc(this,i0,"f").size}[(i0=new WeakMap,Symbol.iterator)](){return Cc(this,i0,"f")[Symbol.iterator]()}entries(){return Cc(this,i0,"f").entries()}forEach(e,r){return Cc(this,i0,"f").forEach((n,i,o)=>e.call(r,n,i,this))}has(e){return Cc(this,i0,"f").has(e)}keys(){return Cc(this,i0,"f").keys()}values(){return Cc(this,i0,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(e=>String(e)).join(", ")} `:""}}`}};o0.FrozenSet=W9;Object.freeze(z9);Object.freeze(z9.prototype);Object.freeze(W9);Object.freeze(W9.prototype)});var o6e=X(i6e=>{"use strict";Object.defineProperty(i6e,"__esModule",{value:!0})});var s6e=X(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.getJsonRpcIdValidator=dt.assertIsJsonRpcError=dt.isJsonRpcError=dt.assertIsJsonRpcFailure=dt.isJsonRpcFailure=dt.assertIsJsonRpcSuccess=dt.isJsonRpcSuccess=dt.assertIsJsonRpcResponse=dt.isJsonRpcResponse=dt.assertIsPendingJsonRpcResponse=dt.isPendingJsonRpcResponse=dt.JsonRpcResponseStruct=dt.JsonRpcFailureStruct=dt.JsonRpcSuccessStruct=dt.PendingJsonRpcResponseStruct=dt.assertIsJsonRpcRequest=dt.isJsonRpcRequest=dt.assertIsJsonRpcNotification=dt.isJsonRpcNotification=dt.JsonRpcNotificationStruct=dt.JsonRpcRequestStruct=dt.JsonRpcParamsStruct=dt.JsonRpcErrorStruct=dt.JsonRpcIdStruct=dt.JsonRpcVersionStruct=dt.jsonrpc2=dt.getJsonSize=dt.isValidJson=dt.JsonStruct=dt.UnsafeJsonStruct=void 0;var Lr=Xg(),e2=Cm(),Dwt=()=>(0,Lr.define)("finite number",t=>(0,Lr.is)(t,(0,Lr.number)())&&Number.isFinite(t));dt.UnsafeJsonStruct=(0,Lr.union)([(0,Lr.literal)(null),(0,Lr.boolean)(),Dwt(),(0,Lr.string)(),(0,Lr.array)((0,Lr.lazy)(()=>dt.UnsafeJsonStruct)),(0,Lr.record)((0,Lr.string)(),(0,Lr.lazy)(()=>dt.UnsafeJsonStruct))]);dt.JsonStruct=(0,Lr.define)("Json",(t,e)=>{function r(n,i){let s=[...i.validator(n,e)];return s.length>0?s:!0}try{let n=r(t,dt.UnsafeJsonStruct);return n!==!0?n:r(JSON.parse(JSON.stringify(t)),dt.UnsafeJsonStruct)}catch(n){return n instanceof RangeError?"Circular reference detected":!1}});function Lwt(t){return(0,Lr.is)(t,dt.JsonStruct)}dt.isValidJson=Lwt;function Uwt(t){(0,e2.assertStruct)(t,dt.JsonStruct,"Invalid JSON value");let e=JSON.stringify(t);return new TextEncoder().encode(e).byteLength}dt.getJsonSize=Uwt;dt.jsonrpc2="2.0";dt.JsonRpcVersionStruct=(0,Lr.literal)(dt.jsonrpc2);dt.JsonRpcIdStruct=(0,Lr.nullable)((0,Lr.union)([(0,Lr.number)(),(0,Lr.string)()]));dt.JsonRpcErrorStruct=(0,Lr.object)({code:(0,Lr.integer)(),message:(0,Lr.string)(),data:(0,Lr.optional)(dt.JsonStruct),stack:(0,Lr.optional)((0,Lr.string)())});dt.JsonRpcParamsStruct=(0,Lr.optional)((0,Lr.union)([(0,Lr.record)((0,Lr.string)(),dt.JsonStruct),(0,Lr.array)(dt.JsonStruct)]));dt.JsonRpcRequestStruct=(0,Lr.object)({id:dt.JsonRpcIdStruct,jsonrpc:dt.JsonRpcVersionStruct,method:(0,Lr.string)(),params:dt.JsonRpcParamsStruct});dt.JsonRpcNotificationStruct=(0,Lr.omit)(dt.JsonRpcRequestStruct,["id"]);function jwt(t){return(0,Lr.is)(t,dt.JsonRpcNotificationStruct)}dt.isJsonRpcNotification=jwt;function Fwt(t,e){(0,e2.assertStruct)(t,dt.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",e)}dt.assertIsJsonRpcNotification=Fwt;function $wt(t){return(0,Lr.is)(t,dt.JsonRpcRequestStruct)}dt.isJsonRpcRequest=$wt;function qwt(t,e){(0,e2.assertStruct)(t,dt.JsonRpcRequestStruct,"Invalid JSON-RPC request",e)}dt.assertIsJsonRpcRequest=qwt;dt.PendingJsonRpcResponseStruct=(0,Lr.object)({id:dt.JsonRpcIdStruct,jsonrpc:dt.JsonRpcVersionStruct,result:(0,Lr.optional)((0,Lr.unknown)()),error:(0,Lr.optional)(dt.JsonRpcErrorStruct)});dt.JsonRpcSuccessStruct=(0,Lr.object)({id:dt.JsonRpcIdStruct,jsonrpc:dt.JsonRpcVersionStruct,result:dt.JsonStruct});dt.JsonRpcFailureStruct=(0,Lr.object)({id:dt.JsonRpcIdStruct,jsonrpc:dt.JsonRpcVersionStruct,error:dt.JsonRpcErrorStruct});dt.JsonRpcResponseStruct=(0,Lr.union)([dt.JsonRpcSuccessStruct,dt.JsonRpcFailureStruct]);function Hwt(t){return(0,Lr.is)(t,dt.PendingJsonRpcResponseStruct)}dt.isPendingJsonRpcResponse=Hwt;function zwt(t,e){(0,e2.assertStruct)(t,dt.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",e)}dt.assertIsPendingJsonRpcResponse=zwt;function Wwt(t){return(0,Lr.is)(t,dt.JsonRpcResponseStruct)}dt.isJsonRpcResponse=Wwt;function Vwt(t,e){(0,e2.assertStruct)(t,dt.JsonRpcResponseStruct,"Invalid JSON-RPC response",e)}dt.assertIsJsonRpcResponse=Vwt;function Kwt(t){return(0,Lr.is)(t,dt.JsonRpcSuccessStruct)}dt.isJsonRpcSuccess=Kwt;function Gwt(t,e){(0,e2.assertStruct)(t,dt.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",e)}dt.assertIsJsonRpcSuccess=Gwt;function Qwt(t){return(0,Lr.is)(t,dt.JsonRpcFailureStruct)}dt.isJsonRpcFailure=Qwt;function Zwt(t,e){(0,e2.assertStruct)(t,dt.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",e)}dt.assertIsJsonRpcFailure=Zwt;function Ywt(t){return(0,Lr.is)(t,dt.JsonRpcErrorStruct)}dt.isJsonRpcError=Ywt;function Jwt(t,e){(0,e2.assertStruct)(t,dt.JsonRpcErrorStruct,"Invalid JSON-RPC error",e)}dt.assertIsJsonRpcError=Jwt;function Xwt(t){let{permitEmptyString:e,permitFractions:r,permitNull:n}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},t);return o=>!!(typeof o=="number"&&(r||Number.isInteger(o))||typeof o=="string"&&(e||o.length>0)||n&&o===null)}dt.getJsonRpcIdValidator=Xwt});var c6e=X(a6e=>{"use strict";Object.defineProperty(a6e,"__esModule",{value:!0})});var u6e=X((Z6r,l6e)=>{var r6=1e3,n6=r6*60,i6=n6*60,gv=i6*24,e3t=gv*7,t3t=gv*365.25;l6e.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return r3t(t);if(r==="number"&&isFinite(t))return e.long?i3t(t):n3t(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function r3t(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*t3t;case"weeks":case"week":case"w":return r*e3t;case"days":case"day":case"d":return r*gv;case"hours":case"hour":case"hrs":case"hr":case"h":return r*i6;case"minutes":case"minute":case"mins":case"min":case"m":return r*n6;case"seconds":case"second":case"secs":case"sec":case"s":return r*r6;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function n3t(t){var e=Math.abs(t);return e>=gv?Math.round(t/gv)+"d":e>=i6?Math.round(t/i6)+"h":e>=n6?Math.round(t/n6)+"m":e>=r6?Math.round(t/r6)+"s":t+"ms"}function i3t(t){var e=Math.abs(t);return e>=gv?DP(t,e,gv,"day"):e>=i6?DP(t,e,i6,"hour"):e>=n6?DP(t,e,n6,"minute"):e>=r6?DP(t,e,r6,"second"):t+" ms"}function DP(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}});var h6e=X((Y6r,f6e)=>{function o3t(t){r.debug=r,r.default=r,r.coerce=l,r.disable=o,r.enable=i,r.enabled=s,r.humanize=u6e(),r.destroy=u,Object.keys(t).forEach(d=>{r[d]=t[d]}),r.names=[],r.skips=[],r.formatters={};function e(d){let p=0;for(let v=0;v<d.length;v++)p=(p<<5)-p+d.charCodeAt(v),p|=0;return r.colors[Math.abs(p)%r.colors.length]}r.selectColor=e;function r(d){let p,v=null,y,S;function R(...O){if(!R.enabled)return;let k=R,M=Number(new Date),D=M-(p||M);k.diff=D,k.prev=p,k.curr=M,p=M,O[0]=r.coerce(O[0]),typeof O[0]!="string"&&O.unshift("%O");let j=0;O[0]=O[0].replace(/%([a-zA-Z%])/g,(W,V)=>{if(W==="%%")return"%";j++;let P=r.formatters[V];if(typeof P=="function"){let $=O[j];W=P.call(k,$),O.splice(j,1),j--}return W}),r.formatArgs.call(k,O),(k.log||r.log).apply(k,O)}return R.namespace=d,R.useColors=r.useColors(),R.color=r.selectColor(d),R.extend=n,R.destroy=r.destroy,Object.defineProperty(R,"enabled",{enumerable:!0,configurable:!1,get:()=>v!==null?v:(y!==r.namespaces&&(y=r.namespaces,S=r.enabled(d)),S),set:O=>{v=O}}),typeof r.init=="function"&&r.init(R),R}function n(d,p){let v=r(this.namespace+(typeof p>"u"?":":p)+d);return v.log=this.log,v}function i(d){r.save(d),r.namespaces=d,r.names=[],r.skips=[];let p,v=(typeof d=="string"?d:"").split(/[\s,]+/),y=v.length;for(p=0;p<y;p++)v[p]&&(d=v[p].replace(/\*/g,".*?"),d[0]==="-"?r.skips.push(new RegExp("^"+d.slice(1)+"$")):r.names.push(new RegExp("^"+d+"$")))}function o(){let d=[...r.names.map(a),...r.skips.map(a).map(p=>"-"+p)].join(",");return r.enable(""),d}function s(d){if(d[d.length-1]==="*")return!0;let p,v;for(p=0,v=r.skips.length;p<v;p++)if(r.skips[p].test(d))return!1;for(p=0,v=r.names.length;p<v;p++)if(r.names[p].test(d))return!0;return!1}function a(d){return d.toString().substring(2,d.toString().length-2).replace(/\.\*\?$/,"*")}function l(d){return d instanceof Error?d.stack||d.message:d}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}f6e.exports=o3t});var d6e=X((Yl,LP)=>{Yl.formatArgs=a3t;Yl.save=c3t;Yl.load=l3t;Yl.useColors=s3t;Yl.storage=u3t();Yl.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Yl.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function s3t(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function a3t(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+LP.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}Yl.log=console.debug||console.log||(()=>{});function c3t(t){try{t?Yl.storage.setItem("debug",t):Yl.storage.removeItem("debug")}catch{}}function l3t(){let t;try{t=Yl.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function u3t(){try{return localStorage}catch{}}LP.exports=h6e()(Yl);var{formatters:f3t}=LP.exports;f3t.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var p6e=X(t2=>{"use strict";var h3t=t2&&t2.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(t2,"__esModule",{value:!0});t2.createModuleLogger=t2.createProjectLogger=void 0;var d3t=h3t(d6e()),p3t=(0,d3t.default)("metamask");function m3t(t){return p3t.extend(t)}t2.createProjectLogger=m3t;function g3t(t,e){return t.extend(e)}t2.createModuleLogger=g3t});var g6e=X(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.calculateNumberSize=Ji.calculateStringSize=Ji.isASCII=Ji.isPlainObject=Ji.ESCAPE_CHARACTERS_REGEXP=Ji.JsonSize=Ji.hasProperty=Ji.isObject=Ji.isNullOrUndefined=Ji.isNonEmptyArray=void 0;function w3t(t){return Array.isArray(t)&&t.length>0}Ji.isNonEmptyArray=w3t;function v3t(t){return t==null}Ji.isNullOrUndefined=v3t;function y3t(t){return!!t&&typeof t=="object"&&!Array.isArray(t)}Ji.isObject=y3t;var b3t=(t,e)=>Object.hasOwnProperty.call(t,e);Ji.hasProperty=b3t;var x3t;(function(t){t[t.Null=4]="Null",t[t.Comma=1]="Comma",t[t.Wrapper=1]="Wrapper",t[t.True=4]="True",t[t.False=5]="False",t[t.Quote=1]="Quote",t[t.Colon=1]="Colon",t[t.Date=24]="Date"})(x3t=Ji.JsonSize||(Ji.JsonSize={}));Ji.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function E3t(t){if(typeof t!="object"||t===null)return!1;try{let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}catch{return!1}}Ji.isPlainObject=E3t;function m6e(t){return t.charCodeAt(0)<=127}Ji.isASCII=m6e;function C3t(t){var e;return t.split("").reduce((n,i)=>m6e(i)?n+1:n+2,0)+((e=t.match(Ji.ESCAPE_CHARACTERS_REGEXP))!==null&&e!==void 0?e:[]).length}Ji.calculateStringSize=C3t;function A3t(t){return t.toString().length}Ji.calculateNumberSize=A3t});var w6e=X(s0=>{"use strict";Object.defineProperty(s0,"__esModule",{value:!0});s0.hexToBigInt=s0.hexToNumber=s0.bigIntToHex=s0.numberToHex=void 0;var o6=Cm(),V9=H9(),S3t=t=>((0,o6.assert)(typeof t=="number","Value must be a number."),(0,o6.assert)(t>=0,"Value must be a non-negative number."),(0,o6.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,V9.add0x)(t.toString(16)));s0.numberToHex=S3t;var _3t=t=>((0,o6.assert)(typeof t=="bigint","Value must be a bigint."),(0,o6.assert)(t>=0,"Value must be a non-negative bigint."),(0,V9.add0x)(t.toString(16)));s0.bigIntToHex=_3t;var I3t=t=>{(0,V9.assertIsHexString)(t);let e=parseInt(t,16);return(0,o6.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `hexToBigInt` instead."),e};s0.hexToNumber=I3t;var T3t=t=>((0,V9.assertIsHexString)(t),BigInt((0,V9.add0x)(t)));s0.hexToBigInt=T3t});var y6e=X(v6e=>{"use strict";Object.defineProperty(v6e,"__esModule",{value:!0})});var x6e=X(Am=>{"use strict";Object.defineProperty(Am,"__esModule",{value:!0});Am.timeSince=Am.inMilliseconds=Am.Duration=void 0;var k3t;(function(t){t[t.Millisecond=1]="Millisecond",t[t.Second=1e3]="Second",t[t.Minute=6e4]="Minute",t[t.Hour=36e5]="Hour",t[t.Day=864e5]="Day",t[t.Week=6048e5]="Week",t[t.Year=31536e6]="Year"})(k3t=Am.Duration||(Am.Duration={}));var R3t=t=>Number.isInteger(t)&&t>=0,b6e=(t,e)=>{if(!R3t(t))throw new Error(`"${e}" must be a non-negative integer. Received: "${t}".`)};function M3t(t,e){return b6e(t,"count"),t*e}Am.inMilliseconds=M3t;function N3t(t){return b6e(t,"timestamp"),Date.now()-t}Am.timeSince=N3t});var C6e=X(E6e=>{"use strict";Object.defineProperty(E6e,"__esModule",{value:!0})});var K9=X((ixr,A6e)=>{var O3t="2.0.0",P3t=Number.MAX_SAFE_INTEGER||9007199254740991,B3t=16,D3t=250,L3t=["major","premajor","minor","preminor","patch","prepatch","prerelease"];A6e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:B3t,MAX_SAFE_BUILD_LENGTH:D3t,MAX_SAFE_INTEGER:P3t,RELEASE_TYPES:L3t,SEMVER_SPEC_VERSION:O3t,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var G9=X((oxr,S6e)=>{var U3t=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};S6e.exports=U3t});var s6=X((Sm,_6e)=>{var{MAX_SAFE_COMPONENT_LENGTH:MZ,MAX_SAFE_BUILD_LENGTH:j3t,MAX_LENGTH:F3t}=K9(),$3t=G9();Sm=_6e.exports={};var q3t=Sm.re=[],H3t=Sm.safeRe=[],Gt=Sm.src=[],Qt=Sm.t={},z3t=0,NZ="[a-zA-Z0-9-]",W3t=[["\\s",1],["\\d",F3t],[NZ,j3t]],V3t=t=>{for(let[e,r]of W3t)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},Kr=(t,e,r)=>{let n=V3t(e),i=z3t++;$3t(t,i,e),Qt[t]=i,Gt[i]=e,q3t[i]=new RegExp(e,r?"g":void 0),H3t[i]=new RegExp(n,r?"g":void 0)};Kr("NUMERICIDENTIFIER","0|[1-9]\\d*");Kr("NUMERICIDENTIFIERLOOSE","\\d+");Kr("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${NZ}*`);Kr("MAINVERSION",`(${Gt[Qt.NUMERICIDENTIFIER]})\\.(${Gt[Qt.NUMERICIDENTIFIER]})\\.(${Gt[Qt.NUMERICIDENTIFIER]})`);Kr("MAINVERSIONLOOSE",`(${Gt[Qt.NUMERICIDENTIFIERLOOSE]})\\.(${Gt[Qt.NUMERICIDENTIFIERLOOSE]})\\.(${Gt[Qt.NUMERICIDENTIFIERLOOSE]})`);Kr("PRERELEASEIDENTIFIER",`(?:${Gt[Qt.NUMERICIDENTIFIER]}|${Gt[Qt.NONNUMERICIDENTIFIER]})`);Kr("PRERELEASEIDENTIFIERLOOSE",`(?:${Gt[Qt.NUMERICIDENTIFIERLOOSE]}|${Gt[Qt.NONNUMERICIDENTIFIER]})`);Kr("PRERELEASE",`(?:-(${Gt[Qt.PRERELEASEIDENTIFIER]}(?:\\.${Gt[Qt.PRERELEASEIDENTIFIER]})*))`);Kr("PRERELEASELOOSE",`(?:-?(${Gt[Qt.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${Gt[Qt.PRERELEASEIDENTIFIERLOOSE]})*))`);Kr("BUILDIDENTIFIER",`${NZ}+`);Kr("BUILD",`(?:\\+(${Gt[Qt.BUILDIDENTIFIER]}(?:\\.${Gt[Qt.BUILDIDENTIFIER]})*))`);Kr("FULLPLAIN",`v?${Gt[Qt.MAINVERSION]}${Gt[Qt.PRERELEASE]}?${Gt[Qt.BUILD]}?`);Kr("FULL",`^${Gt[Qt.FULLPLAIN]}$`);Kr("LOOSEPLAIN",`[v=\\s]*${Gt[Qt.MAINVERSIONLOOSE]}${Gt[Qt.PRERELEASELOOSE]}?${Gt[Qt.BUILD]}?`);Kr("LOOSE",`^${Gt[Qt.LOOSEPLAIN]}$`);Kr("GTLT","((?:<|>)?=?)");Kr("XRANGEIDENTIFIERLOOSE",`${Gt[Qt.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Kr("XRANGEIDENTIFIER",`${Gt[Qt.NUMERICIDENTIFIER]}|x|X|\\*`);Kr("XRANGEPLAIN",`[v=\\s]*(${Gt[Qt.XRANGEIDENTIFIER]})(?:\\.(${Gt[Qt.XRANGEIDENTIFIER]})(?:\\.(${Gt[Qt.XRANGEIDENTIFIER]})(?:${Gt[Qt.PRERELEASE]})?${Gt[Qt.BUILD]}?)?)?`);Kr("XRANGEPLAINLOOSE",`[v=\\s]*(${Gt[Qt.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Gt[Qt.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Gt[Qt.XRANGEIDENTIFIERLOOSE]})(?:${Gt[Qt.PRERELEASELOOSE]})?${Gt[Qt.BUILD]}?)?)?`);Kr("XRANGE",`^${Gt[Qt.GTLT]}\\s*${Gt[Qt.XRANGEPLAIN]}$`);Kr("XRANGELOOSE",`^${Gt[Qt.GTLT]}\\s*${Gt[Qt.XRANGEPLAINLOOSE]}$`);Kr("COERCEPLAIN",`(^|[^\\d])(\\d{1,${MZ}})(?:\\.(\\d{1,${MZ}}))?(?:\\.(\\d{1,${MZ}}))?`);Kr("COERCE",`${Gt[Qt.COERCEPLAIN]}(?:$|[^\\d])`);Kr("COERCEFULL",Gt[Qt.COERCEPLAIN]+`(?:${Gt[Qt.PRERELEASE]})?(?:${Gt[Qt.BUILD]})?(?:$|[^\\d])`);Kr("COERCERTL",Gt[Qt.COERCE],!0);Kr("COERCERTLFULL",Gt[Qt.COERCEFULL],!0);Kr("LONETILDE","(?:~>?)");Kr("TILDETRIM",`(\\s*)${Gt[Qt.LONETILDE]}\\s+`,!0);Sm.tildeTrimReplace="$1~";Kr("TILDE",`^${Gt[Qt.LONETILDE]}${Gt[Qt.XRANGEPLAIN]}$`);Kr("TILDELOOSE",`^${Gt[Qt.LONETILDE]}${Gt[Qt.XRANGEPLAINLOOSE]}$`);Kr("LONECARET","(?:\\^)");Kr("CARETTRIM",`(\\s*)${Gt[Qt.LONECARET]}\\s+`,!0);Sm.caretTrimReplace="$1^";Kr("CARET",`^${Gt[Qt.LONECARET]}${Gt[Qt.XRANGEPLAIN]}$`);Kr("CARETLOOSE",`^${Gt[Qt.LONECARET]}${Gt[Qt.XRANGEPLAINLOOSE]}$`);Kr("COMPARATORLOOSE",`^${Gt[Qt.GTLT]}\\s*(${Gt[Qt.LOOSEPLAIN]})$|^$`);Kr("COMPARATOR",`^${Gt[Qt.GTLT]}\\s*(${Gt[Qt.FULLPLAIN]})$|^$`);Kr("COMPARATORTRIM",`(\\s*)${Gt[Qt.GTLT]}\\s*(${Gt[Qt.LOOSEPLAIN]}|${Gt[Qt.XRANGEPLAIN]})`,!0);Sm.comparatorTrimReplace="$1$2$3";Kr("HYPHENRANGE",`^\\s*(${Gt[Qt.XRANGEPLAIN]})\\s+-\\s+(${Gt[Qt.XRANGEPLAIN]})\\s*$`);Kr("HYPHENRANGELOOSE",`^\\s*(${Gt[Qt.XRANGEPLAINLOOSE]})\\s+-\\s+(${Gt[Qt.XRANGEPLAINLOOSE]})\\s*$`);Kr("STAR","(<|>)?=?\\s*\\*");Kr("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Kr("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var UP=X((sxr,I6e)=>{var K3t=Object.freeze({loose:!0}),G3t=Object.freeze({}),Q3t=t=>t?typeof t!="object"?K3t:t:G3t;I6e.exports=Q3t});var OZ=X((axr,R6e)=>{var T6e=/^[0-9]+$/,k6e=(t,e)=>{let r=T6e.test(t),n=T6e.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},Z3t=(t,e)=>k6e(e,t);R6e.exports={compareIdentifiers:k6e,rcompareIdentifiers:Z3t}});var Fa=X((cxr,P6e)=>{var jP=G9(),{MAX_LENGTH:M6e,MAX_SAFE_INTEGER:FP}=K9(),{safeRe:N6e,t:O6e}=s6(),Y3t=UP(),{compareIdentifiers:a6}=OZ(),PZ=class t{constructor(e,r){if(r=Y3t(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>M6e)throw new TypeError(`version is longer than ${M6e} characters`);jP("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?N6e[O6e.LOOSE]:N6e[O6e.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>FP||this.major<0)throw new TypeError("Invalid major version");if(this.minor>FP||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>FP||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let o=+i;if(o>=0&&o<FP)return o}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(jP("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),a6(this.major,e.major)||a6(this.minor,e.minor)||a6(this.patch,e.patch)}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],i=e.prerelease[r];if(jP("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 a6(n,i)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let n=this.build[r],i=e.build[r];if(jP("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 a6(n,i)}while(++r)}inc(e,r,n){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let o=[r,i];n===!1&&(o=[r]),a6(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};P6e.exports=PZ});var wv=X((lxr,D6e)=>{var B6e=Fa(),J3t=(t,e,r=!1)=>{if(t instanceof B6e)return t;try{return new B6e(t,e)}catch(n){if(!r)return null;throw n}};D6e.exports=J3t});var U6e=X((uxr,L6e)=>{var X3t=wv(),evt=(t,e)=>{let r=X3t(t,e);return r?r.version:null};L6e.exports=evt});var F6e=X((fxr,j6e)=>{var tvt=wv(),rvt=(t,e)=>{let r=tvt(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};j6e.exports=rvt});var H6e=X((hxr,q6e)=>{var $6e=Fa(),nvt=(t,e,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new $6e(t instanceof $6e?t.version:t,r).inc(e,n,i).version}catch{return null}};q6e.exports=nvt});var V6e=X((dxr,W6e)=>{var z6e=wv(),ivt=(t,e)=>{let r=z6e(t,null,!0),n=z6e(e,null,!0),i=r.compare(n);if(i===0)return null;let o=i>0,s=o?r:n,a=o?n:r,l=!!s.prerelease.length;if(!!a.prerelease.length&&!l)return!a.patch&&!a.minor?"major":s.patch?"patch":s.minor?"minor":"major";let d=l?"pre":"";return r.major!==n.major?d+"major":r.minor!==n.minor?d+"minor":r.patch!==n.patch?d+"patch":"prerelease"};W6e.exports=ivt});var G6e=X((pxr,K6e)=>{var ovt=Fa(),svt=(t,e)=>new ovt(t,e).major;K6e.exports=svt});var Z6e=X((mxr,Q6e)=>{var avt=Fa(),cvt=(t,e)=>new avt(t,e).minor;Q6e.exports=cvt});var J6e=X((gxr,Y6e)=>{var lvt=Fa(),uvt=(t,e)=>new lvt(t,e).patch;Y6e.exports=uvt});var exe=X((wxr,X6e)=>{var fvt=wv(),hvt=(t,e)=>{let r=fvt(t,e);return r&&r.prerelease.length?r.prerelease:null};X6e.exports=hvt});var cf=X((vxr,rxe)=>{var txe=Fa(),dvt=(t,e,r)=>new txe(t,r).compare(new txe(e,r));rxe.exports=dvt});var ixe=X((yxr,nxe)=>{var pvt=cf(),mvt=(t,e,r)=>pvt(e,t,r);nxe.exports=mvt});var sxe=X((bxr,oxe)=>{var gvt=cf(),wvt=(t,e)=>gvt(t,e,!0);oxe.exports=wvt});var $P=X((xxr,cxe)=>{var axe=Fa(),vvt=(t,e,r)=>{let n=new axe(t,r),i=new axe(e,r);return n.compare(i)||n.compareBuild(i)};cxe.exports=vvt});var uxe=X((Exr,lxe)=>{var yvt=$P(),bvt=(t,e)=>t.sort((r,n)=>yvt(r,n,e));lxe.exports=bvt});var hxe=X((Cxr,fxe)=>{var xvt=$P(),Evt=(t,e)=>t.sort((r,n)=>xvt(n,r,e));fxe.exports=Evt});var Q9=X((Axr,dxe)=>{var Cvt=cf(),Avt=(t,e,r)=>Cvt(t,e,r)>0;dxe.exports=Avt});var qP=X((Sxr,pxe)=>{var Svt=cf(),_vt=(t,e,r)=>Svt(t,e,r)<0;pxe.exports=_vt});var BZ=X((_xr,mxe)=>{var Ivt=cf(),Tvt=(t,e,r)=>Ivt(t,e,r)===0;mxe.exports=Tvt});var DZ=X((Ixr,gxe)=>{var kvt=cf(),Rvt=(t,e,r)=>kvt(t,e,r)!==0;gxe.exports=Rvt});var HP=X((Txr,wxe)=>{var Mvt=cf(),Nvt=(t,e,r)=>Mvt(t,e,r)>=0;wxe.exports=Nvt});var zP=X((kxr,vxe)=>{var Ovt=cf(),Pvt=(t,e,r)=>Ovt(t,e,r)<=0;vxe.exports=Pvt});var LZ=X((Rxr,yxe)=>{var Bvt=BZ(),Dvt=DZ(),Lvt=Q9(),Uvt=HP(),jvt=qP(),Fvt=zP(),$vt=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return Bvt(t,r,n);case"!=":return Dvt(t,r,n);case">":return Lvt(t,r,n);case">=":return Uvt(t,r,n);case"<":return jvt(t,r,n);case"<=":return Fvt(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};yxe.exports=$vt});var xxe=X((Mxr,bxe)=>{var qvt=Fa(),Hvt=wv(),{safeRe:WP,t:VP}=s6(),zvt=(t,e)=>{if(t instanceof qvt)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?WP[VP.COERCEFULL]:WP[VP.COERCE]);else{let l=e.includePrerelease?WP[VP.COERCERTLFULL]:WP[VP.COERCERTL],u;for(;(u=l.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||u.index+u[0].length!==r.index+r[0].length)&&(r=u),l.lastIndex=u.index+u[1].length+u[2].length;l.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",o=r[4]||"0",s=e.includePrerelease&&r[5]?`-${r[5]}`:"",a=e.includePrerelease&&r[6]?`+${r[6]}`:"";return Hvt(`${n}.${i}.${o}${s}${a}`,e)};bxe.exports=zvt});var Cxe=X((Nxr,Exe)=>{var UZ=class{constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,r)}return this}};Exe.exports=UZ});var lf=X((Oxr,Ixe)=>{var Wvt=/\s+/g,jZ=class t{constructor(e,r){if(r=Kvt(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof FZ)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace(Wvt," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(i=>!Sxe(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&eyt(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let r=this.set[e];for(let n=0;n<r.length;n++)n>0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let n=((this.options.includePrerelease&&Jvt)|(this.options.loose&&Xvt))+":"+e,i=Axe.get(n);if(i)return i;let o=this.options.loose,s=o?cl[Ac.HYPHENRANGELOOSE]:cl[Ac.HYPHENRANGE];e=e.replace(s,uyt(this.options.includePrerelease)),Hi("hyphen replace",e),e=e.replace(cl[Ac.COMPARATORTRIM],Qvt),Hi("comparator trim",e),e=e.replace(cl[Ac.TILDETRIM],Zvt),Hi("tilde trim",e),e=e.replace(cl[Ac.CARETTRIM],Yvt),Hi("caret trim",e);let a=e.split(" ").map(p=>tyt(p,this.options)).join(" ").split(/\s+/).map(p=>lyt(p,this.options));o&&(a=a.filter(p=>(Hi("loose invalid filter",p,this.options),!!p.match(cl[Ac.COMPARATORLOOSE])))),Hi("range list",a);let l=new Map,u=a.map(p=>new FZ(p,this.options));for(let p of u){if(Sxe(p))return[p];l.set(p.value,p)}l.size>1&&l.has("")&&l.delete("");let d=[...l.values()];return Axe.set(n,d),d}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>_xe(n,r)&&e.set.some(i=>_xe(i,r)&&n.every(o=>i.every(s=>o.intersects(s,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new Gvt(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(fyt(this.set[r],e,this.options))return!0;return!1}};Ixe.exports=jZ;var Vvt=Cxe(),Axe=new Vvt,Kvt=UP(),FZ=Z9(),Hi=G9(),Gvt=Fa(),{safeRe:cl,t:Ac,comparatorTrimReplace:Qvt,tildeTrimReplace:Zvt,caretTrimReplace:Yvt}=s6(),{FLAG_INCLUDE_PRERELEASE:Jvt,FLAG_LOOSE:Xvt}=K9(),Sxe=t=>t.value==="<0.0.0-0",eyt=t=>t.value==="",_xe=(t,e)=>{let r=!0,n=t.slice(),i=n.pop();for(;r&&n.length;)r=n.every(o=>i.intersects(o,e)),i=n.pop();return r},tyt=(t,e)=>(Hi("comp",t,e),t=iyt(t,e),Hi("caret",t),t=ryt(t,e),Hi("tildes",t),t=syt(t,e),Hi("xrange",t),t=cyt(t,e),Hi("stars",t),t),Sc=t=>!t||t.toLowerCase()==="x"||t==="*",ryt=(t,e)=>t.trim().split(/\s+/).map(r=>nyt(r,e)).join(" "),nyt=(t,e)=>{let r=e.loose?cl[Ac.TILDELOOSE]:cl[Ac.TILDE];return t.replace(r,(n,i,o,s,a)=>{Hi("tilde",t,n,i,o,s,a);let l;return Sc(i)?l="":Sc(o)?l=`>=${i}.0.0 <${+i+1}.0.0-0`:Sc(s)?l=`>=${i}.${o}.0 <${i}.${+o+1}.0-0`:a?(Hi("replaceTilde pr",a),l=`>=${i}.${o}.${s}-${a} <${i}.${+o+1}.0-0`):l=`>=${i}.${o}.${s} <${i}.${+o+1}.0-0`,Hi("tilde return",l),l})},iyt=(t,e)=>t.trim().split(/\s+/).map(r=>oyt(r,e)).join(" "),oyt=(t,e)=>{Hi("caret",t,e);let r=e.loose?cl[Ac.CARETLOOSE]:cl[Ac.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(i,o,s,a,l)=>{Hi("caret",t,i,o,s,a,l);let u;return Sc(o)?u="":Sc(s)?u=`>=${o}.0.0${n} <${+o+1}.0.0-0`:Sc(a)?o==="0"?u=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`:u=`>=${o}.${s}.0${n} <${+o+1}.0.0-0`:l?(Hi("replaceCaret pr",l),o==="0"?s==="0"?u=`>=${o}.${s}.${a}-${l} <${o}.${s}.${+a+1}-0`:u=`>=${o}.${s}.${a}-${l} <${o}.${+s+1}.0-0`:u=`>=${o}.${s}.${a}-${l} <${+o+1}.0.0-0`):(Hi("no pr"),o==="0"?s==="0"?u=`>=${o}.${s}.${a}${n} <${o}.${s}.${+a+1}-0`:u=`>=${o}.${s}.${a}${n} <${o}.${+s+1}.0-0`:u=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),Hi("caret return",u),u})},syt=(t,e)=>(Hi("replaceXRanges",t,e),t.split(/\s+/).map(r=>ayt(r,e)).join(" ")),ayt=(t,e)=>{t=t.trim();let r=e.loose?cl[Ac.XRANGELOOSE]:cl[Ac.XRANGE];return t.replace(r,(n,i,o,s,a,l)=>{Hi("xRange",t,n,i,o,s,a,l);let u=Sc(o),d=u||Sc(s),p=d||Sc(a),v=p;return i==="="&&v&&(i=""),l=e.includePrerelease?"-0":"",u?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&v?(d&&(s=0),a=0,i===">"?(i=">=",d?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):i==="<="&&(i="<",d?o=+o+1:s=+s+1),i==="<"&&(l="-0"),n=`${i+o}.${s}.${a}${l}`):d?n=`>=${o}.0.0${l} <${+o+1}.0.0-0`:p&&(n=`>=${o}.${s}.0${l} <${o}.${+s+1}.0-0`),Hi("xRange return",n),n})},cyt=(t,e)=>(Hi("replaceStars",t,e),t.trim().replace(cl[Ac.STAR],"")),lyt=(t,e)=>(Hi("replaceGTE0",t,e),t.trim().replace(cl[e.includePrerelease?Ac.GTE0PRE:Ac.GTE0],"")),uyt=t=>(e,r,n,i,o,s,a,l,u,d,p,v)=>(Sc(n)?r="":Sc(i)?r=`>=${n}.0.0${t?"-0":""}`:Sc(o)?r=`>=${n}.${i}.0${t?"-0":""}`:s?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,Sc(u)?l="":Sc(d)?l=`<${+u+1}.0.0-0`:Sc(p)?l=`<${u}.${+d+1}.0-0`:v?l=`<=${u}.${d}.${p}-${v}`:t?l=`<${u}.${d}.${+p+1}-0`:l=`<=${l}`,`${r} ${l}`.trim()),fyt=(t,e,r)=>{for(let n=0;n<t.length;n++)if(!t[n].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let n=0;n<t.length;n++)if(Hi(t[n].semver),t[n].semver!==FZ.ANY&&t[n].semver.prerelease.length>0){let i=t[n].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}});var Z9=X((Pxr,Oxe)=>{var Y9=Symbol("SemVer ANY"),HZ=class t{static get ANY(){return Y9}constructor(e,r){if(r=Txe(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),qZ("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===Y9?this.value="":this.value=this.operator+this.semver.version,qZ("comp",this)}parse(e){let r=this.options.loose?kxe[Rxe.COMPARATORLOOSE]:kxe[Rxe.COMPARATOR],n=e.match(r);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new Mxe(n[2],this.options.loose):this.semver=Y9}toString(){return this.value}test(e){if(qZ("Comparator.test",e,this.options.loose),this.semver===Y9||e===Y9)return!0;if(typeof e=="string")try{e=new Mxe(e,this.options)}catch{return!1}return $Z(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new Nxe(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new Nxe(this.value,r).test(e.semver):(r=Txe(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||$Z(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||$Z(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};Oxe.exports=HZ;var Txe=UP(),{safeRe:kxe,t:Rxe}=s6(),$Z=LZ(),qZ=G9(),Mxe=Fa(),Nxe=lf()});var J9=X((Bxr,Pxe)=>{var hyt=lf(),dyt=(t,e,r)=>{try{e=new hyt(e,r)}catch{return!1}return e.test(t)};Pxe.exports=dyt});var Dxe=X((Dxr,Bxe)=>{var pyt=lf(),myt=(t,e)=>new pyt(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));Bxe.exports=myt});var Uxe=X((Lxr,Lxe)=>{var gyt=Fa(),wyt=lf(),vyt=(t,e,r)=>{let n=null,i=null,o=null;try{o=new wyt(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!n||i.compare(s)===-1)&&(n=s,i=new gyt(n,r))}),n};Lxe.exports=vyt});var Fxe=X((Uxr,jxe)=>{var yyt=Fa(),byt=lf(),xyt=(t,e,r)=>{let n=null,i=null,o=null;try{o=new byt(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!n||i.compare(s)===1)&&(n=s,i=new yyt(n,r))}),n};jxe.exports=xyt});var Hxe=X((jxr,qxe)=>{var zZ=Fa(),Eyt=lf(),$xe=Q9(),Cyt=(t,e)=>{t=new Eyt(t,e);let r=new zZ("0.0.0");if(t.test(r)||(r=new zZ("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n<t.set.length;++n){let i=t.set[n],o=null;i.forEach(s=>{let a=new zZ(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||$xe(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||$xe(r,o))&&(r=o)}return r&&t.test(r)?r:null};qxe.exports=Cyt});var Wxe=X((Fxr,zxe)=>{var Ayt=lf(),Syt=(t,e)=>{try{return new Ayt(t,e).range||"*"}catch{return null}};zxe.exports=Syt});var KP=X(($xr,Qxe)=>{var _yt=Fa(),Gxe=Z9(),{ANY:Iyt}=Gxe,Tyt=lf(),kyt=J9(),Vxe=Q9(),Kxe=qP(),Ryt=zP(),Myt=HP(),Nyt=(t,e,r,n)=>{t=new _yt(t,n),e=new Tyt(e,n);let i,o,s,a,l;switch(r){case">":i=Vxe,o=Ryt,s=Kxe,a=">",l=">=";break;case"<":i=Kxe,o=Myt,s=Vxe,a="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(kyt(t,e,n))return!1;for(let u=0;u<e.set.length;++u){let d=e.set[u],p=null,v=null;if(d.forEach(y=>{y.semver===Iyt&&(y=new Gxe(">=0.0.0")),p=p||y,v=v||y,i(y.semver,p.semver,n)?p=y:s(y.semver,v.semver,n)&&(v=y)}),p.operator===a||p.operator===l||(!v.operator||v.operator===a)&&o(t,v.semver))return!1;if(v.operator===l&&s(t,v.semver))return!1}return!0};Qxe.exports=Nyt});var Yxe=X((qxr,Zxe)=>{var Oyt=KP(),Pyt=(t,e,r)=>Oyt(t,e,">",r);Zxe.exports=Pyt});var Xxe=X((Hxr,Jxe)=>{var Byt=KP(),Dyt=(t,e,r)=>Byt(t,e,"<",r);Jxe.exports=Dyt});var r8e=X((zxr,t8e)=>{var e8e=lf(),Lyt=(t,e,r)=>(t=new e8e(t,r),e=new e8e(e,r),t.intersects(e,r));t8e.exports=Lyt});var i8e=X((Wxr,n8e)=>{var Uyt=J9(),jyt=cf();n8e.exports=(t,e,r)=>{let n=[],i=null,o=null,s=t.sort((d,p)=>jyt(d,p,r));for(let d of s)Uyt(d,e,r)?(o=d,i||(i=d)):(o&&n.push([i,o]),o=null,i=null);i&&n.push([i,null]);let a=[];for(let[d,p]of n)d===p?a.push(d):!p&&d===s[0]?a.push("*"):p?d===s[0]?a.push(`<=${p}`):a.push(`${d} - ${p}`):a.push(`>=${d}`);let l=a.join(" || "),u=typeof e.raw=="string"?e.raw:String(e);return l.length<u.length?l:e}});var u8e=X((Vxr,l8e)=>{var o8e=lf(),VZ=Z9(),{ANY:WZ}=VZ,X9=J9(),KZ=cf(),Fyt=(t,e,r={})=>{if(t===e)return!0;t=new o8e(t,r),e=new o8e(e,r);let n=!1;e:for(let i of t.set){for(let o of e.set){let s=qyt(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},$yt=[new VZ(">=0.0.0-0")],s8e=[new VZ(">=0.0.0")],qyt=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===WZ){if(e.length===1&&e[0].semver===WZ)return!0;r.includePrerelease?t=$yt:t=s8e}if(e.length===1&&e[0].semver===WZ){if(r.includePrerelease)return!0;e=s8e}let n=new Set,i,o;for(let y of t)y.operator===">"||y.operator===">="?i=a8e(i,y,r):y.operator==="<"||y.operator==="<="?o=c8e(o,y,r):n.add(y.semver);if(n.size>1)return null;let s;if(i&&o){if(s=KZ(i.semver,o.semver,r),s>0)return null;if(s===0&&(i.operator!==">="||o.operator!=="<="))return null}for(let y of n){if(i&&!X9(y,String(i),r)||o&&!X9(y,String(o),r))return null;for(let S of e)if(!X9(y,String(S),r))return!1;return!0}let a,l,u,d,p=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,v=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;p&&p.prerelease.length===1&&o.operator==="<"&&p.prerelease[0]===0&&(p=!1);for(let y of e){if(d=d||y.operator===">"||y.operator===">=",u=u||y.operator==="<"||y.operator==="<=",i){if(v&&y.semver.prerelease&&y.semver.prerelease.length&&y.semver.major===v.major&&y.semver.minor===v.minor&&y.semver.patch===v.patch&&(v=!1),y.operator===">"||y.operator===">="){if(a=a8e(i,y,r),a===y&&a!==i)return!1}else if(i.operator===">="&&!X9(i.semver,String(y),r))return!1}if(o){if(p&&y.semver.prerelease&&y.semver.prerelease.length&&y.semver.major===p.major&&y.semver.minor===p.minor&&y.semver.patch===p.patch&&(p=!1),y.operator==="<"||y.operator==="<="){if(l=c8e(o,y,r),l===y&&l!==o)return!1}else if(o.operator==="<="&&!X9(o.semver,String(y),r))return!1}if(!y.operator&&(o||i)&&s!==0)return!1}return!(i&&u&&!o&&s!==0||o&&d&&!i&&s!==0||v||p)},a8e=(t,e,r)=>{if(!t)return e;let n=KZ(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},c8e=(t,e,r)=>{if(!t)return e;let n=KZ(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};l8e.exports=Fyt});var p8e=X((Kxr,d8e)=>{var GZ=s6(),f8e=K9(),Hyt=Fa(),h8e=OZ(),zyt=wv(),Wyt=U6e(),Vyt=F6e(),Kyt=H6e(),Gyt=V6e(),Qyt=G6e(),Zyt=Z6e(),Yyt=J6e(),Jyt=exe(),Xyt=cf(),ebt=ixe(),tbt=sxe(),rbt=$P(),nbt=uxe(),ibt=hxe(),obt=Q9(),sbt=qP(),abt=BZ(),cbt=DZ(),lbt=HP(),ubt=zP(),fbt=LZ(),hbt=xxe(),dbt=Z9(),pbt=lf(),mbt=J9(),gbt=Dxe(),wbt=Uxe(),vbt=Fxe(),ybt=Hxe(),bbt=Wxe(),xbt=KP(),Ebt=Yxe(),Cbt=Xxe(),Abt=r8e(),Sbt=i8e(),_bt=u8e();d8e.exports={parse:zyt,valid:Wyt,clean:Vyt,inc:Kyt,diff:Gyt,major:Qyt,minor:Zyt,patch:Yyt,prerelease:Jyt,compare:Xyt,rcompare:ebt,compareLoose:tbt,compareBuild:rbt,sort:nbt,rsort:ibt,gt:obt,lt:sbt,eq:abt,neq:cbt,gte:lbt,lte:ubt,cmp:fbt,coerce:hbt,Comparator:dbt,Range:pbt,satisfies:mbt,toComparators:gbt,maxSatisfying:wbt,minSatisfying:vbt,minVersion:ybt,validRange:bbt,outside:xbt,gtr:Ebt,ltr:Cbt,intersects:Abt,simplifyRange:Sbt,subset:_bt,SemVer:Hyt,re:GZ.re,src:GZ.src,tokens:GZ.t,SEMVER_SPEC_VERSION:f8e.SEMVER_SPEC_VERSION,RELEASE_TYPES:f8e.RELEASE_TYPES,compareIdentifiers:h8e.compareIdentifiers,rcompareIdentifiers:h8e.rcompareIdentifiers}});var g8e=X(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.satisfiesVersionRange=Xi.gtRange=Xi.gtVersion=Xi.assertIsSemVerRange=Xi.assertIsSemVerVersion=Xi.isValidSemVerRange=Xi.isValidSemVerVersion=Xi.VersionRangeStruct=Xi.VersionStruct=void 0;var eC=p8e(),c6=Xg(),m8e=Cm();Xi.VersionStruct=(0,c6.refine)((0,c6.string)(),"Version",t=>(0,eC.valid)(t)===null?`Expected SemVer version, got "${t}"`:!0);Xi.VersionRangeStruct=(0,c6.refine)((0,c6.string)(),"Version range",t=>(0,eC.validRange)(t)===null?`Expected SemVer range, got "${t}"`:!0);function Ibt(t){return(0,c6.is)(t,Xi.VersionStruct)}Xi.isValidSemVerVersion=Ibt;function Tbt(t){return(0,c6.is)(t,Xi.VersionRangeStruct)}Xi.isValidSemVerRange=Tbt;function kbt(t){(0,m8e.assertStruct)(t,Xi.VersionStruct)}Xi.assertIsSemVerVersion=kbt;function Rbt(t){(0,m8e.assertStruct)(t,Xi.VersionRangeStruct)}Xi.assertIsSemVerRange=Rbt;function Mbt(t,e){return(0,eC.gt)(t,e)}Xi.gtVersion=Mbt;function Nbt(t,e){return(0,eC.gtr)(t,e)}Xi.gtRange=Nbt;function Obt(t,e){return(0,eC.satisfies)(t,e,{includePrerelease:!0})}Xi.satisfiesVersionRange=Obt});var w8e=X(fo=>{"use strict";var Pbt=fo&&fo.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),da=fo&&fo.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Pbt(e,t,r)};Object.defineProperty(fo,"__esModule",{value:!0});da(Cm(),fo);da(IZ(),fo);da(RZ(),fo);da(J4e(),fo);da(t6e(),fo);da(n6e(),fo);da(o6e(),fo);da(H9(),fo);da(s6e(),fo);da(c6e(),fo);da(p6e(),fo);da(g6e(),fo);da(w6e(),fo);da(y6e(),fo);da(x6e(),fo);da(C6e(),fo);da(g8e(),fo)});var y8e=X(l6=>{"use strict";Object.defineProperty(l6,"__esModule",{value:!0});l6.createModuleLogger=l6.projectLogger=void 0;var v8e=w8e();Object.defineProperty(l6,"createModuleLogger",{enumerable:!0,get:function(){return v8e.createModuleLogger}});l6.projectLogger=(0,v8e.createProjectLogger)("eth-block-tracker")});var A8e=X(u6=>{"use strict";var C8e=u6&&u6.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(u6,"__esModule",{value:!0});u6.PollingBlockTracker=void 0;var Bbt=C8e(kP()),Dbt=C8e(O4e()),Lbt=_Z(),b8e=y8e(),x8e=(0,b8e.createModuleLogger)(b8e.projectLogger,"polling-block-tracker"),Ubt=(0,Bbt.default)(),jbt=1e3,QZ=class extends Lbt.BaseBlockTracker{constructor(e={}){var r;if(!e.provider)throw new Error("PollingBlockTracker - no provider specified.");super(Object.assign(Object.assign({},e),{blockResetDuration:(r=e.blockResetDuration)!==null&&r!==void 0?r:e.pollingInterval})),this._provider=e.provider,this._pollingInterval=e.pollingInterval||20*jbt,this._retryTimeout=e.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=e.keepEventLoopActive===void 0?!0:e.keepEventLoopActive,this._setSkipCacheFlag=e.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var e;this._isRunning;)try{await this._updateLatestBlock();let r=E8e(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await r}catch(r){let n=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block: | |
${(e=r.stack)!==null&&e!==void 0?e:r}`);try{this.emit("error",n)}catch{console.error(n)}let i=E8e(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await i}}async _updateLatestBlock(){let e=await this._fetchLatestBlock();this._newPotentialLatest(e)}async _fetchLatestBlock(){let e={jsonrpc:"2.0",id:Ubt(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(e.skipCache=!0),x8e("Making request",e);let r=await(0,Dbt.default)(n=>this._provider.sendAsync(e,n))();if(x8e("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block: | |
${r.error.message}`);return r.result}};u6.PollingBlockTracker=QZ;function E8e(t,e){return new Promise(r=>{let n=setTimeout(r,t);n.unref&&e&&n.unref()})}});var S8e=X(f6=>{"use strict";var Fbt=f6&&f6.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(f6,"__esModule",{value:!0});f6.SubscribeBlockTracker=void 0;var $bt=Fbt(kP()),qbt=_Z(),Hbt=(0,$bt.default)(),ZZ=class extends qbt.BaseBlockTracker{constructor(e={}){if(!e.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(e),this._provider=e.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{let e=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(e)}catch(e){this.emit("error",e)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(e){this.emit("error",e)}}_call(e,...r){return new Promise((n,i)=>{this._provider.sendAsync({id:Hbt(),method:e,params:r,jsonrpc:"2.0"},(o,s)=>{o?i(o):n(s.result)})})}_handleSubData(e,r){var n;r.method==="eth_subscription"&&((n=r.params)===null||n===void 0?void 0:n.subscription)===this._subscriptionId&&this._newPotentialLatest(r.params.result.number)}};f6.SubscribeBlockTracker=ZZ});var I8e=X(r2=>{"use strict";var zbt=r2&&r2.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),_8e=r2&&r2.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&zbt(e,t,r)};Object.defineProperty(r2,"__esModule",{value:!0});_8e(A8e(),r2);_8e(S8e(),r2)});var JZ=X(GP=>{"use strict";Object.defineProperty(GP,"__esModule",{value:!0});GP.getUniqueId=void 0;var T8e=4294967295,YZ=Math.floor(Math.random()*T8e);function Wbt(){return YZ=(YZ+1)%T8e,YZ}GP.getUniqueId=Wbt});var k8e=X(QP=>{"use strict";Object.defineProperty(QP,"__esModule",{value:!0});QP.createIdRemapMiddleware=void 0;var Vbt=JZ();function Kbt(){return(t,e,r,n)=>{let i=t.id,o=Vbt.getUniqueId();t.id=o,e.id=o,r(s=>{t.id=i,e.id=i,s()})}}QP.createIdRemapMiddleware=Kbt});var R8e=X(ZP=>{"use strict";Object.defineProperty(ZP,"__esModule",{value:!0});ZP.createAsyncMiddleware=void 0;function Gbt(t){return async(e,r,n,i)=>{let o,s=new Promise(d=>{o=d}),a=null,l=!1,u=async()=>{l=!0,n(d=>{a=d,o()}),await s};try{await t(e,r,u),l?(await s,a(null)):i(null)}catch(d){a?a(d):i(d)}}}ZP.createAsyncMiddleware=Gbt});var M8e=X(YP=>{"use strict";Object.defineProperty(YP,"__esModule",{value:!0});YP.createScaffoldMiddleware=void 0;function Qbt(t){return(e,r,n,i)=>{let o=t[e.method];return o===void 0?n():typeof o=="function"?o(e,r,n,i):(r.result=o,i())}}YP.createScaffoldMiddleware=Qbt});var O8e=X(eY=>{"use strict";Object.defineProperty(eY,"__esModule",{value:!0});var Zbt=jd();function N8e(t,e,r){try{Reflect.apply(t,e,r)}catch(n){setTimeout(()=>{throw n})}}function Ybt(t){let e=t.length,r=new Array(e);for(let n=0;n<e;n+=1)r[n]=t[n];return r}var XZ=class extends Zbt.EventEmitter{emit(e,...r){let n=e==="error",i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){let s;if(r.length>0&&([s]=r),s instanceof Error)throw s;let a=new Error(`Unhandled error.${s?` (${s.message})`:""}`);throw a.context=s,a}let o=i[e];if(o===void 0)return!1;if(typeof o=="function")N8e(o,this,r);else{let s=o.length,a=Ybt(o);for(let l=0;l<s;l+=1)N8e(a[l],this,r)}return!0}};eY.default=XZ});var j8e=X((o8r,U8e)=>{U8e.exports=tC;tC.default=tC;tC.stable=D8e;tC.stableStringify=D8e;var JP="[...]",P8e="[Circular]",yv=[],vv=[];function B8e(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function tC(t,e,r,n){typeof n>"u"&&(n=B8e()),tY(t,"",0,[],void 0,0,n);var i;try{vv.length===0?i=JSON.stringify(t,e,r):i=JSON.stringify(t,L8e(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;yv.length!==0;){var o=yv.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return i}function h6(t,e,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:t}),yv.push([n,r,e,i])):vv.push([e,r,t]):(n[r]=t,yv.push([n,r,e]))}function tY(t,e,r,n,i,o,s){o+=1;var a;if(typeof t=="object"&&t!==null){for(a=0;a<n.length;a++)if(n[a]===t){h6(P8e,t,e,i);return}if(typeof s.depthLimit<"u"&&o>s.depthLimit){h6(JP,t,e,i);return}if(typeof s.edgesLimit<"u"&&r+1>s.edgesLimit){h6(JP,t,e,i);return}if(n.push(t),Array.isArray(t))for(a=0;a<t.length;a++)tY(t[a],a,a,n,t,o,s);else{var l=Object.keys(t);for(a=0;a<l.length;a++){var u=l[a];tY(t[u],u,a,n,t,o,s)}}n.pop()}}function Jbt(t,e){return t<e?-1:t>e?1:0}function D8e(t,e,r,n){typeof n>"u"&&(n=B8e());var i=rY(t,"",0,[],void 0,0,n)||t,o;try{vv.length===0?o=JSON.stringify(i,e,r):o=JSON.stringify(i,L8e(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;yv.length!==0;){var s=yv.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return o}function rY(t,e,r,n,i,o,s){o+=1;var a;if(typeof t=="object"&&t!==null){for(a=0;a<n.length;a++)if(n[a]===t){h6(P8e,t,e,i);return}try{if(typeof t.toJSON=="function")return}catch{return}if(typeof s.depthLimit<"u"&&o>s.depthLimit){h6(JP,t,e,i);return}if(typeof s.edgesLimit<"u"&&r+1>s.edgesLimit){h6(JP,t,e,i);return}if(n.push(t),Array.isArray(t))for(a=0;a<t.length;a++)rY(t[a],a,a,n,t,o,s);else{var l={},u=Object.keys(t).sort(Jbt);for(a=0;a<u.length;a++){var d=u[a];rY(t[d],d,a,n,t,o,s),l[d]=t[d]}if(typeof i<"u")yv.push([i,e,t]),i[e]=l;else return l}n.pop()}}function L8e(t){return t=typeof t<"u"?t:function(e,r){return r},function(e,r){if(vv.length>0)for(var n=0;n<vv.length;n++){var i=vv[n];if(i[1]===e&&i[0]===r){r=i[2],vv.splice(n,1);break}}return t.call(this,e,r)}}});var eB=X(d6=>{"use strict";Object.defineProperty(d6,"__esModule",{value:!0});d6.EthereumProviderError=d6.EthereumRpcError=void 0;var Xbt=j8e(),XP=class extends Error{constructor(e,r,n){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=e,n!==void 0&&(this.data=n)}serialize(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}toString(){return Xbt.default(this.serialize(),t5t,2)}};d6.EthereumRpcError=XP;var nY=class extends XP{constructor(e,r,n){if(!e5t(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,r,n)}};d6.EthereumProviderError=nY;function e5t(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}function t5t(t,e){if(e!=="[Circular]")return e}});var tB=X(p6=>{"use strict";Object.defineProperty(p6,"__esModule",{value:!0});p6.errorValues=p6.errorCodes=void 0;p6.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}};p6.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."}}});var sY=X(wh=>{"use strict";Object.defineProperty(wh,"__esModule",{value:!0});wh.serializeError=wh.isValidCode=wh.getMessageFromCode=wh.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;var rB=tB(),r5t=eB(),F8e=rB.errorCodes.rpc.internal,n5t="Unspecified error message. This is a bug, please report it.",i5t={code:F8e,message:oY(F8e)};wh.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function oY(t,e=n5t){if(Number.isInteger(t)){let r=t.toString();if(iY(rB.errorValues,r))return rB.errorValues[r].message;if(H8e(t))return wh.JSON_RPC_SERVER_ERROR_MESSAGE}return e}wh.getMessageFromCode=oY;function q8e(t){if(!Number.isInteger(t))return!1;let e=t.toString();return!!(rB.errorValues[e]||H8e(t))}wh.isValidCode=q8e;function o5t(t,{fallbackError:e=i5t,shouldIncludeStack:r=!1}={}){var n,i;if(!e||!Number.isInteger(e.code)||typeof e.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(t instanceof r5t.EthereumRpcError)return t.serialize();let o={};if(t&&typeof t=="object"&&!Array.isArray(t)&&iY(t,"code")&&q8e(t.code)){let a=t;o.code=a.code,a.message&&typeof a.message=="string"?(o.message=a.message,iY(a,"data")&&(o.data=a.data)):(o.message=oY(o.code),o.data={originalError:$8e(t)})}else{o.code=e.code;let a=(n=t)===null||n===void 0?void 0:n.message;o.message=a&&typeof a=="string"?a:e.message,o.data={originalError:$8e(t)}}let s=(i=t)===null||i===void 0?void 0:i.stack;return r&&t&&s&&typeof s=="string"&&(o.stack=s),o}wh.serializeError=o5t;function H8e(t){return t>=-32099&&t<=-32e3}function $8e(t){return t&&typeof t=="object"&&!Array.isArray(t)?Object.assign({},t):t}function iY(t,e){return Object.prototype.hasOwnProperty.call(t,e)}});var V8e=X(nB=>{"use strict";Object.defineProperty(nB,"__esModule",{value:!0});nB.ethErrors=void 0;var aY=eB(),z8e=sY(),$a=tB();nB.ethErrors={rpc:{parse:t=>uf($a.errorCodes.rpc.parse,t),invalidRequest:t=>uf($a.errorCodes.rpc.invalidRequest,t),invalidParams:t=>uf($a.errorCodes.rpc.invalidParams,t),methodNotFound:t=>uf($a.errorCodes.rpc.methodNotFound,t),internal:t=>uf($a.errorCodes.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");let{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return uf(e,t)},invalidInput:t=>uf($a.errorCodes.rpc.invalidInput,t),resourceNotFound:t=>uf($a.errorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>uf($a.errorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>uf($a.errorCodes.rpc.transactionRejected,t),methodNotSupported:t=>uf($a.errorCodes.rpc.methodNotSupported,t),limitExceeded:t=>uf($a.errorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>rC($a.errorCodes.provider.userRejectedRequest,t),unauthorized:t=>rC($a.errorCodes.provider.unauthorized,t),unsupportedMethod:t=>rC($a.errorCodes.provider.unsupportedMethod,t),disconnected:t=>rC($a.errorCodes.provider.disconnected,t),chainDisconnected:t=>rC($a.errorCodes.provider.chainDisconnected,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");let{code:e,message:r,data:n}=t;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new aY.EthereumProviderError(e,r,n)}}};function uf(t,e){let[r,n]=W8e(e);return new aY.EthereumRpcError(t,r||z8e.getMessageFromCode(t),n)}function rC(t,e){let[r,n]=W8e(e);return new aY.EthereumProviderError(t,r||z8e.getMessageFromCode(t),n)}function W8e(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){let{message:e,data:r}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}});var Q8e=X(ll=>{"use strict";Object.defineProperty(ll,"__esModule",{value:!0});ll.getMessageFromCode=ll.serializeError=ll.EthereumProviderError=ll.EthereumRpcError=ll.ethErrors=ll.errorCodes=void 0;var K8e=eB();Object.defineProperty(ll,"EthereumRpcError",{enumerable:!0,get:function(){return K8e.EthereumRpcError}});Object.defineProperty(ll,"EthereumProviderError",{enumerable:!0,get:function(){return K8e.EthereumProviderError}});var G8e=sY();Object.defineProperty(ll,"serializeError",{enumerable:!0,get:function(){return G8e.serializeError}});Object.defineProperty(ll,"getMessageFromCode",{enumerable:!0,get:function(){return G8e.getMessageFromCode}});var s5t=V8e();Object.defineProperty(ll,"ethErrors",{enumerable:!0,get:function(){return s5t.ethErrors}});var a5t=tB();Object.defineProperty(ll,"errorCodes",{enumerable:!0,get:function(){return a5t.errorCodes}})});var uY=X(m6=>{"use strict";var c5t=m6&&m6.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(m6,"__esModule",{value:!0});m6.JsonRpcEngine=void 0;var l5t=c5t(O8e()),ff=Q8e(),lY=class t extends l5t.default{constructor(){super(),this._middleware=[]}push(e){this._middleware.push(e)}handle(e,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(e)?r?this._handleBatch(e,r):this._handleBatch(e):r?this._handle(e,r):this._promiseHandle(e)}asMiddleware(){return async(e,r,n,i)=>{try{let[o,s,a]=await t._runAllMiddleware(e,r,this._middleware);return s?(await t._runReturnHandlers(a),i(o)):n(async l=>{try{await t._runReturnHandlers(a)}catch(u){return l(u)}return l()})}catch(o){return i(o)}}}async _handleBatch(e,r){try{let n=await Promise.all(e.map(this._promiseHandle.bind(this)));return r?r(null,n):n}catch(n){if(r)return r(n);throw n}}_promiseHandle(e){return new Promise(r=>{this._handle(e,(n,i)=>{r(i)})})}async _handle(e,r){if(!e||Array.isArray(e)||typeof e!="object"){let s=new ff.EthereumRpcError(ff.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof e}`,{request:e});return r(s,{id:void 0,jsonrpc:"2.0",error:s})}if(typeof e.method!="string"){let s=new ff.EthereumRpcError(ff.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof e.method}`,{request:e});return r(s,{id:e.id,jsonrpc:"2.0",error:s})}let n=Object.assign({},e),i={id:n.id,jsonrpc:n.jsonrpc},o=null;try{await this._processRequest(n,i)}catch(s){o=s}return o&&(delete i.result,i.error||(i.error=ff.serializeError(o))),r(o,i)}async _processRequest(e,r){let[n,i,o]=await t._runAllMiddleware(e,r,this._middleware);if(t._checkForCompletion(e,r,i),await t._runReturnHandlers(o),n)throw n}static async _runAllMiddleware(e,r,n){let i=[],o=null,s=!1;for(let a of n)if([o,s]=await t._runMiddleware(e,r,a,i),s)break;return[o,s,i.reverse()]}static _runMiddleware(e,r,n,i){return new Promise(o=>{let s=l=>{let u=l||r.error;u&&(r.error=ff.serializeError(u)),o([u,!0])},a=l=>{r.error?s(r.error):(l&&(typeof l!="function"&&s(new ff.EthereumRpcError(ff.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof l}" for request: | |
${cY(e)}`,{request:e})),i.push(l)),o([null,!1]))};try{n(e,r,a,s)}catch(l){s(l)}})}static async _runReturnHandlers(e){for(let r of e)await new Promise((n,i)=>{r(o=>o?i(o):n())})}static _checkForCompletion(e,r,n){if(!("result"in r)&&!("error"in r))throw new ff.EthereumRpcError(ff.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request: | |
${cY(e)}`,{request:e});if(!n)throw new ff.EthereumRpcError(ff.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request: | |
${cY(e)}`,{request:e})}};m6.JsonRpcEngine=lY;function cY(t){return JSON.stringify(t,null,2)}});var Z8e=X(iB=>{"use strict";Object.defineProperty(iB,"__esModule",{value:!0});iB.mergeMiddleware=void 0;var u5t=uY();function f5t(t){let e=new u5t.JsonRpcEngine;return t.forEach(r=>e.push(r)),e.asMiddleware()}iB.mergeMiddleware=f5t});var fY=X(hf=>{"use strict";var h5t=hf&&hf.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),g6=hf&&hf.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&h5t(e,t,r)};Object.defineProperty(hf,"__esModule",{value:!0});g6(k8e(),hf);g6(R8e(),hf);g6(M8e(),hf);g6(JZ(),hf);g6(uY(),hf);g6(Z8e(),hf)});var cB={};qr(cB,{__addDisposableResource:()=>w7e,__assign:()=>oB,__asyncDelegator:()=>l7e,__asyncGenerator:()=>c7e,__asyncValues:()=>u7e,__await:()=>w6,__awaiter:()=>r7e,__classPrivateFieldGet:()=>p7e,__classPrivateFieldIn:()=>g7e,__classPrivateFieldSet:()=>m7e,__createBinding:()=>aB,__decorate:()=>X8e,__disposeResources:()=>v7e,__esDecorate:()=>d5t,__exportStar:()=>i7e,__extends:()=>Y8e,__generator:()=>n7e,__importDefault:()=>d7e,__importStar:()=>h7e,__makeTemplateObject:()=>f7e,__metadata:()=>t7e,__param:()=>e7e,__propKey:()=>m5t,__read:()=>dY,__rest:()=>J8e,__runInitializers:()=>p5t,__setFunctionName:()=>g5t,__spread:()=>o7e,__spreadArray:()=>a7e,__spreadArrays:()=>s7e,__values:()=>sB,default:()=>y5t});function Y8e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");hY(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function J8e(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function X8e(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function e7e(t,e){return function(r,n){e(r,n,t)}}function d5t(t,e,r,n,i,o){function s(k){if(k!==void 0&&typeof k!="function")throw new TypeError("Function expected");return k}for(var a=n.kind,l=a==="getter"?"get":a==="setter"?"set":"value",u=!e&&t?n.static?t:t.prototype:null,d=e||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),p,v=!1,y=r.length-1;y>=0;y--){var S={};for(var R in n)S[R]=R==="access"?{}:n[R];for(var R in n.access)S.access[R]=n.access[R];S.addInitializer=function(k){if(v)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(k||null))};var O=(0,r[y])(a==="accessor"?{get:d.get,set:d.set}:d[l],S);if(a==="accessor"){if(O===void 0)continue;if(O===null||typeof O!="object")throw new TypeError("Object expected");(p=s(O.get))&&(d.get=p),(p=s(O.set))&&(d.set=p),(p=s(O.init))&&i.unshift(p)}else(p=s(O))&&(a==="field"?i.unshift(p):d[l]=p)}u&&Object.defineProperty(u,n.name,d),v=!0}function p5t(t,e,r){for(var n=arguments.length>2,i=0;i<e.length;i++)r=n?e[i].call(t,r):e[i].call(t);return n?r:void 0}function m5t(t){return typeof t=="symbol"?t:"".concat(t)}function g5t(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function t7e(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function r7e(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(d){try{u(n.next(d))}catch(p){s(p)}}function l(d){try{u(n.throw(d))}catch(p){s(p)}}function u(d){d.done?o(d.value):i(d.value).then(a,l)}u((n=n.apply(t,e||[])).next())})}function n7e(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(d){return l([u,d])}}function l(u){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(r=0)),r;)try{if(n=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){r.label=u[1];break}if(u[0]===6&&r.label<o[1]){r.label=o[1],o=u;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(u);break}o[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(d){u=[6,d],i=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function i7e(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&aB(e,t,r)}function sB(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function dY(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function o7e(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(dY(arguments[e]));return t}function s7e(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function a7e(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))}function w6(t){return this instanceof w6?(this.v=t,this):new w6(t)}function c7e(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",s),i[Symbol.asyncIterator]=function(){return this},i;function s(y){return function(S){return Promise.resolve(S).then(y,p)}}function a(y,S){n[y]&&(i[y]=function(R){return new Promise(function(O,k){o.push([y,R,O,k])>1||l(y,R)})},S&&(i[y]=S(i[y])))}function l(y,S){try{u(n[y](S))}catch(R){v(o[0][3],R)}}function u(y){y.value instanceof w6?Promise.resolve(y.value.v).then(d,p):v(o[0][2],y)}function d(y){l("next",y)}function p(y){l("throw",y)}function v(y,S){y(S),o.shift(),o.length&&l(o[0][0],o[0][1])}}function l7e(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(s){return(r=!r)?{value:w6(t[i](s)),done:!1}:o?o(s):s}:o}}function u7e(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof sB=="function"?sB(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,l){s=t[o](s),i(a,l,s.done,s.value)})}}function i(o,s,a,l){Promise.resolve(l).then(function(u){o({value:u,done:a})},s)}}function f7e(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function h7e(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&aB(e,t,r);return w5t(e,t),e}function d7e(t){return t&&t.__esModule?t:{default:t}}function p7e(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function m7e(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function g7e(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function w7e(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n,i;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],r&&(i=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");i&&(n=function(){try{i.call(this)}catch(o){return Promise.reject(o)}}),t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}function v7e(t){function e(o){t.error=t.hasError?new v5t(o,t.error,"An error was suppressed during disposal."):o,t.hasError=!0}var r,n=0;function i(){for(;r=t.stack.pop();)try{if(!r.async&&n===1)return n=0,t.stack.push(r),Promise.resolve().then(i);if(r.dispose){var o=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(o).then(i,function(s){return e(s),i()})}else n|=1}catch(s){e(s)}if(n===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return i()}var hY,oB,aB,w5t,v5t,y5t,lB=F(()=>{hY=function(t,e){return hY=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},hY(t,e)};oB=function(){return oB=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},oB.apply(this,arguments)};aB=Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]};w5t=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};v5t=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};y5t={__extends:Y8e,__assign:oB,__rest:J8e,__decorate:X8e,__param:e7e,__metadata:t7e,__awaiter:r7e,__generator:n7e,__createBinding:aB,__exportStar:i7e,__values:sB,__read:dY,__spread:o7e,__spreadArrays:s7e,__spreadArray:a7e,__await:w6,__asyncGenerator:c7e,__asyncDelegator:l7e,__asyncValues:u7e,__makeTemplateObject:f7e,__importStar:h7e,__importDefault:d7e,__classPrivateFieldGet:p7e,__classPrivateFieldSet:m7e,__classPrivateFieldIn:g7e,__addDisposableResource:w7e,__disposeResources:v7e}});var mY=X(pY=>{"use strict";Object.defineProperty(pY,"__esModule",{value:!0});var y7e=(lB(),zn(cB)),b5t=function(){function t(e){if(this._maxConcurrency=e,this._queue=[],e<=0)throw new Error("semaphore must be initialized to a positive value");this._value=e}return t.prototype.acquire=function(){var e=this,r=this.isLocked(),n=new Promise(function(i){return e._queue.push(i)});return r||this._dispatch(),n},t.prototype.runExclusive=function(e){return y7e.__awaiter(this,void 0,void 0,function(){var r,n,i;return y7e.__generator(this,function(o){switch(o.label){case 0:return[4,this.acquire()];case 1:r=o.sent(),n=r[0],i=r[1],o.label=2;case 2:return o.trys.push([2,,4,5]),[4,e(n)];case 3:return[2,o.sent()];case 4:return i(),[7];case 5:return[2]}})})},t.prototype.isLocked=function(){return this._value<=0},t.prototype.release=function(){if(this._maxConcurrency>1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var e=this._currentReleaser;this._currentReleaser=void 0,e()}},t.prototype._dispatch=function(){var e=this,r=this._queue.shift();if(r){var n=!1;this._currentReleaser=function(){n||(n=!0,e._value++,e._dispatch())},r([this._value--,this._currentReleaser])}},t}();pY.default=b5t});var x7e=X(gY=>{"use strict";Object.defineProperty(gY,"__esModule",{value:!0});var b7e=(lB(),zn(cB)),x5t=mY(),E5t=function(){function t(){this._semaphore=new x5t.default(1)}return t.prototype.acquire=function(){return b7e.__awaiter(this,void 0,void 0,function(){var e,r;return b7e.__generator(this,function(n){switch(n.label){case 0:return[4,this._semaphore.acquire()];case 1:return e=n.sent(),r=e[1],[2,r]}})})},t.prototype.runExclusive=function(e){return this._semaphore.runExclusive(function(){return e()})},t.prototype.isLocked=function(){return this._semaphore.isLocked()},t.prototype.release=function(){this._semaphore.release()},t}();gY.default=E5t});var E7e=X(fB=>{"use strict";Object.defineProperty(fB,"__esModule",{value:!0});fB.withTimeout=void 0;var uB=(lB(),zn(cB));function C5t(t,e,r){var n=this;return r===void 0&&(r=new Error("timeout")),{acquire:function(){return new Promise(function(i,o){return uB.__awaiter(n,void 0,void 0,function(){var s,a,l;return uB.__generator(this,function(u){switch(u.label){case 0:return s=!1,setTimeout(function(){s=!0,o(r)},e),[4,t.acquire()];case 1:return a=u.sent(),s?(l=Array.isArray(a)?a[1]:a,l()):i(a),[2]}})})})},runExclusive:function(i){return uB.__awaiter(this,void 0,void 0,function(){var o,s;return uB.__generator(this,function(a){switch(a.label){case 0:o=function(){},a.label=1;case 1:return a.trys.push([1,,7,8]),[4,this.acquire()];case 2:return s=a.sent(),Array.isArray(s)?(o=s[1],[4,i(s[0])]):[3,4];case 3:return[2,a.sent()];case 4:return o=s,[4,i()];case 5:return[2,a.sent()];case 6:return[3,8];case 7:return o(),[7];case 8:return[2]}})})},release:function(){t.release()},isLocked:function(){return t.isLocked()}}}fB.withTimeout=C5t});var C7e=X(n2=>{"use strict";Object.defineProperty(n2,"__esModule",{value:!0});n2.withTimeout=n2.Semaphore=n2.Mutex=void 0;var A5t=x7e();Object.defineProperty(n2,"Mutex",{enumerable:!0,get:function(){return A5t.default}});var S5t=mY();Object.defineProperty(n2,"Semaphore",{enumerable:!0,get:function(){return S5t.default}});var _5t=E7e();Object.defineProperty(n2,"withTimeout",{enumerable:!0,get:function(){return _5t.withTimeout}})});var S7e=X((v8r,A7e)=>{A7e.exports=T5t;var I5t=Object.prototype.hasOwnProperty;function T5t(){for(var t={},e=0;e<arguments.length;e++){var r=arguments[e];for(var n in r)I5t.call(r,n)&&(t[n]=r[n])}return t}});var I7e=X((y8r,_7e)=>{var k5t=S7e(),R5t=kP()();_7e.exports=Fr;function Fr(t){let e=this;e.currentProvider=t}Fr.prototype.getBalance=nC(2,"eth_getBalance");Fr.prototype.getCode=nC(2,"eth_getCode");Fr.prototype.getTransactionCount=nC(2,"eth_getTransactionCount");Fr.prototype.getStorageAt=nC(3,"eth_getStorageAt");Fr.prototype.call=nC(2,"eth_call");Fr.prototype.protocolVersion=wn("eth_protocolVersion");Fr.prototype.syncing=wn("eth_syncing");Fr.prototype.coinbase=wn("eth_coinbase");Fr.prototype.mining=wn("eth_mining");Fr.prototype.hashrate=wn("eth_hashrate");Fr.prototype.gasPrice=wn("eth_gasPrice");Fr.prototype.accounts=wn("eth_accounts");Fr.prototype.blockNumber=wn("eth_blockNumber");Fr.prototype.getBlockTransactionCountByHash=wn("eth_getBlockTransactionCountByHash");Fr.prototype.getBlockTransactionCountByNumber=wn("eth_getBlockTransactionCountByNumber");Fr.prototype.getUncleCountByBlockHash=wn("eth_getUncleCountByBlockHash");Fr.prototype.getUncleCountByBlockNumber=wn("eth_getUncleCountByBlockNumber");Fr.prototype.sign=wn("eth_sign");Fr.prototype.sendTransaction=wn("eth_sendTransaction");Fr.prototype.sendRawTransaction=wn("eth_sendRawTransaction");Fr.prototype.estimateGas=wn("eth_estimateGas");Fr.prototype.getBlockByHash=wn("eth_getBlockByHash");Fr.prototype.getBlockByNumber=wn("eth_getBlockByNumber");Fr.prototype.getTransactionByHash=wn("eth_getTransactionByHash");Fr.prototype.getTransactionByBlockHashAndIndex=wn("eth_getTransactionByBlockHashAndIndex");Fr.prototype.getTransactionByBlockNumberAndIndex=wn("eth_getTransactionByBlockNumberAndIndex");Fr.prototype.getTransactionReceipt=wn("eth_getTransactionReceipt");Fr.prototype.getUncleByBlockHashAndIndex=wn("eth_getUncleByBlockHashAndIndex");Fr.prototype.getUncleByBlockNumberAndIndex=wn("eth_getUncleByBlockNumberAndIndex");Fr.prototype.getCompilers=wn("eth_getCompilers");Fr.prototype.compileLLL=wn("eth_compileLLL");Fr.prototype.compileSolidity=wn("eth_compileSolidity");Fr.prototype.compileSerpent=wn("eth_compileSerpent");Fr.prototype.newFilter=wn("eth_newFilter");Fr.prototype.newBlockFilter=wn("eth_newBlockFilter");Fr.prototype.newPendingTransactionFilter=wn("eth_newPendingTransactionFilter");Fr.prototype.uninstallFilter=wn("eth_uninstallFilter");Fr.prototype.getFilterChanges=wn("eth_getFilterChanges");Fr.prototype.getFilterLogs=wn("eth_getFilterLogs");Fr.prototype.getLogs=wn("eth_getLogs");Fr.prototype.getWork=wn("eth_getWork");Fr.prototype.submitWork=wn("eth_submitWork");Fr.prototype.submitHashrate=wn("eth_submitHashrate");Fr.prototype.sendAsync=function(t,e){this.currentProvider.sendAsync(M5t(t),function(n,i){if(!n&&i.error&&(n=new Error("EthQuery - RPC Error - "+i.error.message)),n)return e(n);e(null,i.result)})};function wn(t){return function(){let e=this;var r=[].slice.call(arguments),n=r.pop();e.sendAsync({method:t,params:r},n)}}function nC(t,e){return function(){let r=this;var n=[].slice.call(arguments),i=n.pop();n.length<t&&n.push("latest"),r.sendAsync({method:e,params:n},i)}}function M5t(t){return k5t({id:R5t(),jsonrpc:"2.0",params:[]},t)}});var M7e=X((b8r,R7e)=>{"use strict";var T7e=(t,e,r,n)=>function(...i){let o=e.promiseModule;return new o((s,a)=>{e.multiArgs?i.push((...u)=>{e.errorFirst?u[0]?a(u):(u.shift(),s(u)):s(u)}):e.errorFirst?i.push((u,d)=>{u?a(u):s(d)}):i.push(s),Reflect.apply(t,this===r?n:this,i)})},k7e=new WeakMap;R7e.exports=(t,e)=>{e={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...e};let r=typeof t;if(!(t!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${t===null?"null":r}\``);let n=(s,a)=>{let l=k7e.get(s);if(l||(l={},k7e.set(s,l)),a in l)return l[a];let u=S=>typeof S=="string"||typeof a=="symbol"?a===S:S.test(a),d=Reflect.getOwnPropertyDescriptor(s,a),p=d===void 0||d.writable||d.configurable,y=(e.include?e.include.some(u):!e.exclude.some(u))&&p;return l[a]=y,y},i=new WeakMap,o=new Proxy(t,{apply(s,a,l){let u=i.get(s);if(u)return Reflect.apply(u,a,l);let d=e.excludeMain?s:T7e(s,e,o,s);return i.set(s,d),Reflect.apply(d,a,l)},get(s,a){let l=s[a];if(!n(s,a)||l===Function.prototype[a])return l;let u=i.get(l);if(u)return u;if(typeof l=="function"){let d=T7e(l,e,o,s);return i.set(l,d),d}return l}});return o}});var hB=X((x8r,N7e)=>{var N5t=RP().default,wY=class extends N5t{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(e){this.updates=this.updates.concat(e),e.forEach(r=>this.emit("update",r))}addInitialResults(e){}getChangesAndClear(){let e=this.updates;return this.updates=[],e}};N7e.exports=wY});var P7e=X((E8r,O7e)=>{var O5t=hB(),vY=class extends O5t{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(e){this.allResults=this.allResults.concat(e),super.addResults(e)}addInitialResults(e){this.allResults=this.allResults.concat(e),super.addInitialResults(e)}getAllResults(){return this.allResults}};O7e.exports=vY});var v6=X((C8r,L7e)=>{L7e.exports={minBlockRef:P5t,maxBlockRef:B5t,sortBlockRefs:yY,bnToHex:D5t,blockRefIsNumber:L5t,hexToInt:dB,incrementHexInt:U5t,intToHex:D7e,unsafeRandomBytes:j5t};function P5t(...t){return yY(t)[0]}function B5t(...t){let e=yY(t);return e[e.length-1]}function yY(t){return t.sort((e,r)=>e==="latest"||r==="earliest"?1:r==="latest"||e==="earliest"?-1:dB(e)-dB(r))}function D5t(t){return"0x"+t.toString(16)}function L5t(t){return t&&!["earliest","latest","pending"].includes(t)}function dB(t){return t==null?t:Number.parseInt(t,16)}function U5t(t){if(t==null)return t;let e=dB(t);return D7e(e+1)}function D7e(t){if(t==null)return t;let e=t.toString(16);return e.length%2&&(e="0"+e),"0x"+e}function j5t(t){let e="0x";for(let r=0;r<t;r++)e+=B7e(),e+=B7e();return e}function B7e(){return Math.floor(Math.random()*16).toString(16)}});var j7e=X((S8r,U7e)=>{var F5t=I7e(),$5t=M7e(),q5t=P7e(),{bnToHex:A8r,hexToInt:pB,incrementHexInt:H5t,minBlockRef:z5t,blockRefIsNumber:W5t}=v6(),bY=class extends q5t{constructor({provider:e,params:r}){super(),this.type="log",this.ethQuery=new F5t(e),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:e}){let r=this.params.fromBlock;["latest","pending"].includes(r)&&(r=e),r==="earliest"&&(r="0x0"),this.params.fromBlock=r;let n=z5t(this.params.toBlock,e),i=Object.assign({},this.params,{toBlock:n}),o=await this._fetchLogs(i);this.addInitialResults(o)}async update({oldBlock:e,newBlock:r}){let n=r,i;e?i=H5t(e):i=r;let o=Object.assign({},this.params,{fromBlock:i,toBlock:n}),a=(await this._fetchLogs(o)).filter(l=>this.matchLog(l));this.addResults(a)}async _fetchLogs(e){return await $5t(n=>this.ethQuery.getLogs(e,n))()}matchLog(e){if(pB(this.params.fromBlock)>=pB(e.blockNumber)||W5t(this.params.toBlock)&&pB(this.params.toBlock)<=pB(e.blockNumber))return!1;let r=e.address&&e.address.toLowerCase();return this.params.address&&r&&!this.params.address.includes(r)?!1:this.params.topics.every((i,o)=>{let s=e.topics[o];if(!s)return!1;s=s.toLowerCase();let a=Array.isArray(i)?i:[i];return a.includes(null)?!0:(a=a.map(d=>d.toLowerCase()),a.includes(s))})}};U7e.exports=bY});var mB=X((_8r,$7e)=>{$7e.exports=V5t;async function V5t({provider:t,fromBlock:e,toBlock:r}){e||(e=r);let n=F7e(e),o=F7e(r)-n+1,s=Array(o).fill().map((l,u)=>n+u).map(K5t),a=await Promise.all(s.map(l=>Q5t(t,"eth_getBlockByNumber",[l,!1])));return a=a.filter(l=>l!==null),a}function F7e(t){return t==null?t:Number.parseInt(t,16)}function K5t(t){return t==null?t:"0x"+t.toString(16)}function G5t(t,e){return new Promise((r,n)=>{t.sendAsync(e,(i,o)=>{i?n(i):o.error?n(o.error):o.result?r(o.result):n(new Error("Result was empty"))})})}async function Q5t(t,e,r){for(let n=0;n<3;n++)try{return await G5t(t,{id:1,jsonrpc:"2.0",method:e,params:r})}catch(i){console.error(`provider.sendAsync failed: ${i.stack||i.message||i}`)}return null}});var H7e=X((I8r,q7e)=>{var Z5t=hB(),Y5t=mB(),{incrementHexInt:J5t}=v6(),xY=class extends Z5t{constructor({provider:e,params:r}){super(),this.type="block",this.provider=e}async update({oldBlock:e,newBlock:r}){let n=r,i=J5t(e),s=(await Y5t({provider:this.provider,fromBlock:i,toBlock:n})).map(a=>a.hash);this.addResults(s)}};q7e.exports=xY});var W7e=X((T8r,z7e)=>{var X5t=hB(),e4t=mB(),{incrementHexInt:t4t}=v6(),EY=class extends X5t{constructor({provider:e}){super(),this.type="tx",this.provider=e}async update({oldBlock:e}){let r=e,n=t4t(e),i=await e4t({provider:this.provider,fromBlock:n,toBlock:r}),o=[];for(let s of i)o.push(...s.transactions);this.addResults(o)}};z7e.exports=EY});var G7e=X((k8r,K7e)=>{var r4t=C7e().Mutex,{createAsyncMiddleware:n4t,createScaffoldMiddleware:i4t}=fY(),o4t=j7e(),s4t=H7e(),a4t=W7e(),{intToHex:V7e,hexToInt:CY}=v6();K7e.exports=c4t;function c4t({blockTracker:t,provider:e}){let r=0,n={},i=new r4t,o=l4t({mutex:i}),s=i4t({eth_newFilter:o(AY(l)),eth_newBlockFilter:o(AY(u)),eth_newPendingTransactionFilter:o(AY(d)),eth_uninstallFilter:o(gB(y)),eth_getFilterChanges:o(gB(p)),eth_getFilterLogs:o(gB(v))}),a=async({oldBlock:M,newBlock:D})=>{if(n.length===0)return;let j=await i.acquire();try{await Promise.all(y6(n).map(async q=>{try{await q.update({oldBlock:M,newBlock:D})}catch(W){console.error(W)}}))}catch(q){console.error(q)}j()};return s.newLogFilter=l,s.newBlockFilter=u,s.newPendingTransactionFilter=d,s.uninstallFilter=y,s.getFilterChanges=p,s.getFilterLogs=v,s.destroy=()=>{O()},s;async function l(M){let D=new o4t({provider:e,params:M}),j=await S(D);return D}async function u(){let M=new s4t({provider:e}),D=await S(M);return M}async function d(){let M=new a4t({provider:e}),D=await S(M);return M}async function p(M){let D=CY(M),j=n[D];if(!j)throw new Error(`No filter for index "${D}"`);return j.getChangesAndClear()}async function v(M){let D=CY(M),j=n[D];if(!j)throw new Error(`No filter for index "${D}"`);let q=[];return j.type==="log"&&(q=j.getAllResults()),q}async function y(M){let D=CY(M),q=!!n[D];return q&&await R(D),q}async function S(M){let D=y6(n).length,j=await t.getLatestBlock();await M.initialize({currentBlock:j}),r++,n[r]=M,M.id=r,M.idHex=V7e(r);let q=y6(n).length;return k({prevFilterCount:D,newFilterCount:q}),r}async function R(M){let D=y6(n).length;delete n[M];let j=y6(n).length;k({prevFilterCount:D,newFilterCount:j})}async function O(){let M=y6(n).length;n={},k({prevFilterCount:M,newFilterCount:0})}function k({prevFilterCount:M,newFilterCount:D}){if(M===0&&D>0){t.on("sync",a);return}if(M>0&&D===0){t.removeListener("sync",a);return}}}function AY(t){return gB(async(...e)=>{let r=await t(...e);return V7e(r.id)})}function gB(t){return n4t(async(e,r)=>{let n=await t.apply(null,e.params);r.result=n})}function l4t({mutex:t}){return e=>async(r,n,i,o)=>{(await t.acquire())(),e(r,n,i,o)}}function y6(t,e){let r=[];for(let n in t)r.push(t[n]);return r}});var Y7e=X((R8r,Z7e)=>{var u4t=RP().default,{createAsyncMiddleware:Q7e,createScaffoldMiddleware:f4t}=fY(),h4t=G7e(),{unsafeRandomBytes:d4t,incrementHexInt:p4t}=v6(),m4t=mB();Z7e.exports=g4t;function g4t({blockTracker:t,provider:e}){let r={},n=h4t({blockTracker:t,provider:e}),i=!1,o=new u4t,s=f4t({eth_subscribe:Q7e(a),eth_unsubscribe:Q7e(l)});return s.destroy=d,{events:o,middleware:s};async function a(p,v){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");let y=p.params[0],S=d4t(16),R;switch(y){case"newHeads":R=O({subId:S});break;case"logs":let M=p.params[1],D=await n.newLogFilter(M);R=k({subId:S,filter:D});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${y}"`)}r[S]=R,v.result=S;return;function O({subId:M}){let D={type:y,destroy:async()=>{t.removeListener("sync",D.update)},update:async({oldBlock:j,newBlock:q})=>{let W=q,V=p4t(j);(await m4t({provider:e,fromBlock:V,toBlock:W})).map(w4t).filter(U=>U!==null).forEach(U=>{u(M,U)})}};return t.on("sync",D.update),D}function k({subId:M,filter:D}){return D.on("update",q=>u(M,q)),{type:y,destroy:async()=>await n.uninstallFilter(D.idHex)}}}async function l(p,v){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");let y=p.params[0],S=r[y];if(!S){v.result=!1;return}delete r[y],await S.destroy(),v.result=!0}function u(p,v){o.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:p,result:v}})}function d(){o.removeAllListeners();for(let p in r)r[p].destroy(),delete r[p];i=!0}}function w4t(t){return t==null?null:{hash:t.hash,parentHash:t.parentHash,sha3Uncles:t.sha3Uncles,miner:t.miner,stateRoot:t.stateRoot,transactionsRoot:t.transactionsRoot,receiptsRoot:t.receiptsRoot,logsBloom:t.logsBloom,difficulty:t.difficulty,number:t.number,gasLimit:t.gasLimit,gasUsed:t.gasUsed,nonce:t.nonce,mixHash:t.mixHash,timestamp:t.timestamp,extraData:t.extraData}}});var X7e=X(wB=>{"use strict";Object.defineProperty(wB,"__esModule",{value:!0});wB.SubscriptionManager=void 0;var v4t=I8e(),y4t=Y7e(),J7e=()=>{},SY=class{constructor(e){let r=new v4t.PollingBlockTracker({provider:e,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:n,middleware:i}=y4t({blockTracker:r,provider:e});this.events=n,this.subscriptionMiddleware=i}async handleRequest(e){let r={};return await this.subscriptionMiddleware(e,r,J7e,J7e),r}destroy(){this.subscriptionMiddleware.destroy()}};wB.SubscriptionManager=SY});var yB=X(b6=>{"use strict";var nEe=b6&&b6.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(b6,"__esModule",{value:!0});b6.CoinbaseWalletProvider=void 0;var b4t=nEe(O9()),x4t=rN(),Xn=B9(),un=Qd(),E4t=yZ(),eEe=nP(),vB=oP(),Jl=QO(),_Y=nEe(A4e()),iC=rP(),C4t=k4e(),A4t=X7e(),tEe="DefaultChainId",rEe="DefaultJsonRpcUrl",IY=class extends x4t.EventEmitter{constructor(e){var r,n;super(),this._filterPolyfill=new C4t.FilterPolyfill(this),this._subscriptionManager=new A4t.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=e.chainId,this._jsonRpcUrlFromOpts=e.jsonRpcUrl,this._overrideIsMetaMask=e.overrideIsMetaMask,this._relayProvider=e.relayProvider,this._storage=e.storage,this._relayEventManager=e.relayEventManager,this.diagnostic=e.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=(r=e.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this.isCoinbaseBrowser=(n=e.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this.qrUrl=e.qrUrl;let i=this.getChainId(),o=(0,un.prepend0x)(i.toString(16));this.emit("connect",{chainIdStr:o});let s=this._storage.getItem(eEe.LOCAL_STORAGE_ADDRESSES_KEY);if(s){let a=s.split(" ");a[0]!==""&&(this._addresses=a.map(l=>(0,un.ensureAddressString)(l)),this.emit("accountsChanged",a))}this._subscriptionManager.events.on("notification",a=>{this.emit("message",{type:a.method,data:a.params})}),this._isAuthorized()&&this.initializeRelay(),window.addEventListener("message",a=>{var l;if(!(a.origin!==location.origin||a.source!==window)&&a.data.type==="walletLinkMessage"&&a.data.data.action==="dappChainSwitched"){let u=a.data.data.chainId,d=(l=a.data.data.jsonRpcUrl)!==null&&l!==void 0?l:this.jsonRpcUrl;this.updateProviderInfo(d,Number(u))}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,un.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var e;return(e=this._storage.getItem(rEe))!==null&&e!==void 0?e:this._jsonRpcUrlFromOpts}set jsonRpcUrl(e){this._storage.setItem(rEe,e)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(e,r){this.isCoinbaseBrowser||(this._chainIdFromOpts=r,this._jsonRpcUrlFromOpts=e),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(e,r){this.jsonRpcUrl=e;let n=this.getChainId();this._storage.setItem(tEe,r.toString(10)),((0,un.ensureIntNumber)(r)!==n||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(e,r,n,i,o,s){let l=await(await this.initializeRelay()).watchAsset(e,r,n,i,o,s?.toString()).promise;return(0,Jl.isErrorResponse)(l)?!1:!!l.result}async addEthereumChain(e,r,n,i,o,s){var a,l;if((0,un.ensureIntNumber)(e)===this.getChainId())return!1;let u=await this.initializeRelay(),d=u.inlineAddEthereumChain(e.toString());!this._isAuthorized()&&!d&&await u.requestEthereumAccounts().promise;let p=await u.addEthereumChain(e.toString(),r,o,n,i,s).promise;return(0,Jl.isErrorResponse)(p)?!1:(((a=p.result)===null||a===void 0?void 0:a.isApproved)===!0&&this.updateProviderInfo(r[0],e),((l=p.result)===null||l===void 0?void 0:l.isApproved)===!0)}async switchEthereumChain(e){let n=await(await this.initializeRelay()).switchEthereumChain(e.toString(10),this.selectedAddress||void 0).promise;if((0,Jl.isErrorResponse)(n)){if(!n.errorCode)return;throw n.errorCode===Xn.standardErrorCodes.provider.unsupportedChain?Xn.standardErrors.provider.unsupportedChain():Xn.standardErrors.provider.custom({message:n.errorMessage,code:n.errorCode})}let i=n.result;i.isApproved&&i.rpcUrl.length>0&&this.updateProviderInfo(i.rpcUrl,e)}setAppInfo(e,r){this.initializeRelay().then(n=>n.setAppInfo(e,r))}async enable(){var e;return(e=this.diagnostic)===null||e===void 0||e.log(iC.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?vB.Session.hash(this._relay.session.id):void 0}),this._isAuthorized()?[...this._addresses]:await this.send("eth_requestAccounts")}async close(){(await this.initializeRelay()).resetAndReload()}send(e,r){try{let n=this._send(e,r);if(n instanceof Promise)return n.catch(i=>{throw(0,Xn.serializeError)(i,e)})}catch(n){throw(0,Xn.serializeError)(n,e)}}_send(e,r){if(typeof e=="string"){let i=e,o=Array.isArray(r)?r:r!==void 0?[r]:[],s={jsonrpc:"2.0",id:0,method:i,params:o};return this._sendRequestAsync(s).then(a=>a.result)}if(typeof r=="function"){let i=e,o=r;return this._sendAsync(i,o)}if(Array.isArray(e))return e.map(o=>this._sendRequest(o));let n=e;return this._sendRequest(n)}async sendAsync(e,r){try{return this._sendAsync(e,r).catch(n=>{throw(0,Xn.serializeError)(n,e)})}catch(n){return Promise.reject((0,Xn.serializeError)(n,e))}}async _sendAsync(e,r){if(typeof r!="function")throw new Error("callback is required");if(Array.isArray(e)){let i=r;this._sendMultipleRequestsAsync(e).then(o=>i(null,o)).catch(o=>i(o,null));return}let n=r;return this._sendRequestAsync(e).then(i=>n(null,i)).catch(i=>n(i,null))}async request(e){try{return this._request(e).catch(r=>{throw(0,Xn.serializeError)(r,e.method)})}catch(r){return Promise.reject((0,Xn.serializeError)(r,e.method))}}async _request(e){if(!e||typeof e!="object"||Array.isArray(e))throw Xn.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:e});let{method:r,params:n}=e;if(typeof r!="string"||r.length===0)throw Xn.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:e});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw Xn.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:e});let i=n===void 0?[]:n,o=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:r,params:i,jsonrpc:"2.0",id:o})).result}async scanQRCode(e){let n=await(await this.initializeRelay()).scanQRCode((0,un.ensureRegExpString)(e)).promise;if((0,Jl.isErrorResponse)(n))throw(0,Xn.serializeError)(n.errorMessage,"scanQRCode");if(typeof n.result!="string")throw(0,Xn.serializeError)("result was not a string","scanQRCode");return n.result}async genericRequest(e,r){let i=await(await this.initializeRelay()).genericRequest(e,r).promise;if((0,Jl.isErrorResponse)(i))throw(0,Xn.serializeError)(i.errorMessage,"generic");if(typeof i.result!="string")throw(0,Xn.serializeError)("result was not a string","generic");return i.result}async connectAndSignIn(e){var r;(r=this.diagnostic)===null||r===void 0||r.log(iC.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::connectAndSignIn",sessionIdHash:this._relay?vB.Session.hash(this._relay.session.id):void 0});let n;try{let o=await this.initializeRelay();if(!(o instanceof E4t.MobileRelay))throw new Error("connectAndSignIn is only supported on mobile");if(n=await o.connectAndSignIn(e).promise,(0,Jl.isErrorResponse)(n))throw new Error(n.errorMessage)}catch(o){throw typeof o.message=="string"&&o.message.match(/(denied|rejected)/i)?Xn.standardErrors.provider.userRejectedRequest("User denied account authorization"):o}if(!n.result)throw new Error("accounts received is empty");let{accounts:i}=n.result;return this._setAddresses(i),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),n.result}async selectProvider(e){let n=await(await this.initializeRelay()).selectProvider(e).promise;if((0,Jl.isErrorResponse)(n))throw(0,Xn.serializeError)(n.errorMessage,"selectProvider");if(typeof n.result!="string")throw(0,Xn.serializeError)("result was not a string","selectProvider");return n.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(e){let r={jsonrpc:"2.0",id:e.id},{method:n}=e;if(r.result=this._handleSynchronousMethods(e),r.result===void 0)throw new Error(`Coinbase Wallet does not support calling ${n} synchronously without a callback. Please provide a callback parameter to call ${n} asynchronously.`);return r}_setAddresses(e,r){if(!Array.isArray(e))throw new Error("addresses is not an array");let n=e.map(i=>(0,un.ensureAddressString)(i));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(eEe.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" ")))}_sendRequestAsync(e){return new Promise((r,n)=>{try{let i=this._handleSynchronousMethods(e);if(i!==void 0)return r({jsonrpc:"2.0",id:e.id,result:i});let o=this._handleAsynchronousFilterMethods(e);if(o!==void 0){o.then(a=>r(Object.assign(Object.assign({},a),{id:e.id}))).catch(a=>n(a));return}let s=this._handleSubscriptionMethods(e);if(s!==void 0){s.then(a=>r({jsonrpc:"2.0",id:e.id,result:a.result})).catch(a=>n(a));return}}catch(i){return n(i)}this._handleAsynchronousMethods(e).then(i=>i&&r(Object.assign(Object.assign({},i),{id:e.id}))).catch(i=>n(i))})}_sendMultipleRequestsAsync(e){return Promise.all(e.map(r=>this._sendRequestAsync(r)))}_handleSynchronousMethods(e){let{method:r}=e,n=e.params||[];switch(r){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"eth_uninstallFilter":return this._eth_uninstallFilter(n);case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(e){let{method:r}=e,n=e.params||[];switch(r){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(n);case"eth_ecRecover":return this._eth_ecRecover(n);case"personal_sign":return this._personal_sign(n);case"personal_ecRecover":return this._personal_ecRecover(n);case"eth_signTransaction":return this._eth_signTransaction(n);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(n);case"eth_sendTransaction":return this._eth_sendTransaction(n);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(n);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(n);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(n);case"cbWallet_arbitrary":return this._cbwallet_arbitrary(n);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(n);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(n);case"wallet_watchAsset":return this._wallet_watchAsset(n)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(e,this.jsonRpcUrl).catch(o=>{var s;throw(o.code===Xn.standardErrorCodes.rpc.methodNotFound||o.code===Xn.standardErrorCodes.rpc.methodNotSupported)&&((s=this.diagnostic)===null||s===void 0||s.log(iC.EVENTS.METHOD_NOT_IMPLEMENTED,{method:e.method,sessionIdHash:this._relay?vB.Session.hash(this._relay.session.id):void 0})),o})}_handleAsynchronousFilterMethods(e){let{method:r}=e,n=e.params||[];switch(r){case"eth_newFilter":return this._eth_newFilter(n);case"eth_newBlockFilter":return this._eth_newBlockFilter();case"eth_newPendingTransactionFilter":return this._eth_newPendingTransactionFilter();case"eth_getFilterChanges":return this._eth_getFilterChanges(n);case"eth_getFilterLogs":return this._eth_getFilterLogs(n)}}_handleSubscriptionMethods(e){switch(e.method){case"eth_subscribe":case"eth_unsubscribe":return this._subscriptionManager.handleRequest(e)}}_isKnownAddress(e){try{let r=(0,un.ensureAddressString)(e);return this._addresses.map(i=>(0,un.ensureAddressString)(i)).includes(r)}catch{}return!1}_ensureKnownAddress(e){var r;if(!this._isKnownAddress(e))throw(r=this.diagnostic)===null||r===void 0||r.log(iC.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(e){let r=e.from?(0,un.ensureAddressString)(e.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);let n=e.to?(0,un.ensureAddressString)(e.to):null,i=e.value!=null?(0,un.ensureBN)(e.value):new b4t.default(0),o=e.data?(0,un.ensureBuffer)(e.data):Buffer.alloc(0),s=e.nonce!=null?(0,un.ensureIntNumber)(e.nonce):null,a=e.gasPrice!=null?(0,un.ensureBN)(e.gasPrice):null,l=e.maxFeePerGas!=null?(0,un.ensureBN)(e.maxFeePerGas):null,u=e.maxPriorityFeePerGas!=null?(0,un.ensureBN)(e.maxPriorityFeePerGas):null,d=e.gas!=null?(0,un.ensureBN)(e.gas):null,p=e.chainId?(0,un.ensureIntNumber)(e.chainId):this.getChainId();return{fromAddress:r,toAddress:n,weiValue:i,data:o,nonce:s,gasPriceInWei:a,maxFeePerGas:l,maxPriorityFeePerGas:u,gasLimit:d,chainId:p}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw Xn.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw Xn.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(e,r,n,i){this._ensureKnownAddress(r);try{let s=await(await this.initializeRelay()).signEthereumMessage(e,r,n,i).promise;if((0,Jl.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}catch(o){throw typeof o.message=="string"&&o.message.match(/(denied|rejected)/i)?Xn.standardErrors.provider.userRejectedRequest("User denied message signature"):o}}async _ethereumAddressFromSignedMessage(e,r,n){let o=await(await this.initializeRelay()).ethereumAddressFromSignedMessage(e,r,n).promise;if((0,Jl.isErrorResponse)(o))throw new Error(o.errorMessage);return{jsonrpc:"2.0",id:0,result:o.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,un.hexStringFromIntNumber)(this.getChainId())}getChainId(){let e=this._storage.getItem(tEe);if(!e)return(0,un.ensureIntNumber)(this._chainIdFromOpts);let r=parseInt(e,10);return(0,un.ensureIntNumber)(r)}async _eth_requestAccounts(){var e;if((e=this.diagnostic)===null||e===void 0||e.log(iC.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?vB.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,Jl.isErrorResponse)(r))throw new Error(r.errorMessage)}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?Xn.standardErrors.provider.userRejectedRequest("User denied account authorization"):n}if(!r.result)throw new Error("accounts received is empty");return this._setAddresses(r.result),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(e){this._requireAuthorization();let r=(0,un.ensureAddressString)(e[0]),n=(0,un.ensureBuffer)(e[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(e){let r=(0,un.ensureBuffer)(e[0]),n=(0,un.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(e){this._requireAuthorization();let r=(0,un.ensureBuffer)(e[0]),n=(0,un.ensureAddressString)(e[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(e){let r=(0,un.ensureBuffer)(e[0]),n=(0,un.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(r,n,!0)}async _eth_signTransaction(e){this._requireAuthorization();let r=this._prepareTransactionParams(e[0]||{});try{let i=await(await this.initializeRelay()).signEthereumTransaction(r).promise;if((0,Jl.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)?Xn.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(e){let r=(0,un.ensureBuffer)(e[0]),i=await(await this.initializeRelay()).submitEthereumTransaction(r,this.getChainId()).promise;if((0,Jl.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}async _eth_sendTransaction(e){this._requireAuthorization();let r=this._prepareTransactionParams(e[0]||{});try{let i=await(await this.initializeRelay()).signAndSubmitEthereumTransaction(r).promise;if((0,Jl.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)?Xn.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(e){this._requireAuthorization();let r=(0,un.ensureParsedJSONObject)(e[0]),n=(0,un.ensureAddressString)(e[1]);this._ensureKnownAddress(n);let i=_Y.default.hashForSignTypedDataLegacy({data:r}),o=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,o)}async _eth_signTypedData_v3(e){this._requireAuthorization();let r=(0,un.ensureAddressString)(e[0]),n=(0,un.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);let i=_Y.default.hashForSignTypedData_v3({data:n}),o=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,o)}async _eth_signTypedData_v4(e){this._requireAuthorization();let r=(0,un.ensureAddressString)(e[0]),n=(0,un.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);let i=_Y.default.hashForSignTypedData_v4({data:n}),o=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,o)}async _cbwallet_arbitrary(e){let r=e[0],n=e[1];if(typeof n!="string")throw new Error("parameter must be a string");if(typeof r!="object"||r===null)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(r,n)}}async _wallet_addEthereumChain(e){var r,n,i,o;let s=e[0];if(((r=s.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(!s.chainName||s.chainName.trim()==="")throw Xn.standardErrors.rpc.invalidParams("chainName is a required field");if(!s.nativeCurrency)throw Xn.standardErrors.rpc.invalidParams("nativeCurrency is a required field");let a=parseInt(s.chainId,16);return await this.addEthereumChain(a,(n=s.rpcUrls)!==null&&n!==void 0?n:[],(i=s.blockExplorerUrls)!==null&&i!==void 0?i:[],s.chainName,(o=s.iconUrls)!==null&&o!==void 0?o:[],s.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(e){let r=e[0];return await this.switchEthereumChain(parseInt(r.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(e){let r=Array.isArray(e)?e[0]:e;if(!r.type)throw Xn.standardErrors.rpc.invalidParams("Type is required");if(r?.type!=="ERC20")throw Xn.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!r?.options)throw Xn.standardErrors.rpc.invalidParams("Options are required");if(!r?.options.address)throw Xn.standardErrors.rpc.invalidParams("Address is required");let n=this.getChainId(),{address:i,symbol:o,image:s,decimals:a}=r.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(r.type,i,o,a,s,n)}}_eth_uninstallFilter(e){let r=(0,un.ensureHexString)(e[0]);return this._filterPolyfill.uninstallFilter(r)}async _eth_newFilter(e){let r=e[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(r)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(e){let r=(0,un.ensureHexString)(e[0]);return this._filterPolyfill.getFilterChanges(r)}_eth_getFilterLogs(e){let r=(0,un.ensureHexString)(e[0]);return this._filterPolyfill.getFilterLogs(r)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(e=>(e.setAccountsCallback((r,n)=>this._setAddresses(r,n)),e.setChainCallback((r,n)=>{this.updateProviderInfo(n,parseInt(r,10))}),e.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=e,e))}};b6.CoinbaseWalletProvider=IY});var iEe=X(bB=>{"use strict";Object.defineProperty(bB,"__esModule",{value:!0});bB.RelayEventManager=void 0;var S4t=Qd(),TY=class{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;let e=this._nextRequestId,r=(0,S4t.prepend0x)(e.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),e}};bB.RelayEventManager=TY});var kY=X(EB=>{"use strict";Object.defineProperty(EB,"__esModule",{value:!0});EB.CoinbaseWalletSDK=void 0;var _4t=Wbe(),I4t=Vbe(),oEe=Qd(),T4t=m5e(),k4t=yB(),R4t=yZ(),M4t=wZ(),N4t=iEe(),O4t=hZ(),P4t=dZ(),sEe=YO(),xB=class t{constructor(e){var r,n,i;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;let o=e.linkAPIUrl||I4t.LINK_API_URL;typeof e.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=e.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(r=e.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this._overrideIsCoinbaseBrowser=(n=e.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this._diagnosticLogger=e.diagnosticLogger,this._reloadOnDisconnect=(i=e.reloadOnDisconnect)!==null&&i!==void 0?i:!0;let s=new URL(o),a=`${s.protocol}//${s.host}`;if(this._storage=new T4t.ScopedLocalStorage(`-walletlink:${a}`),this._storage.setItem("version",t.VERSION),this.walletExtension||this.coinbaseBrowser)return;this._relayEventManager=new N4t.RelayEventManager;let l=(0,oEe.isMobileWeb)(),u=e.uiConstructor||(p=>l?new M4t.MobileRelayUI(p):new O4t.WalletLinkRelayUI(p)),d={linkAPIUrl:o,version:sEe.LIB_VERSION,darkMode:!!e.darkMode,headlessMode:!!e.headlessMode,uiConstructor:u,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect,enableMobileWalletLink:e.enableMobileWalletLink};this._relay=l?new R4t.MobileRelay(d):new P4t.WalletLinkRelay(d),this.setAppInfo(e.appName,e.appLogoUrl),!e.headlessMode&&this._relay.attachUI()}makeWeb3Provider(e="",r=1){let n=this.walletExtension;if(n)return this.isCipherProvider(n)||n.setProviderInfo(e,r),this._reloadOnDisconnect===!1&&typeof n.disableReloadOnDisconnect=="function"&&n.disableReloadOnDisconnect(),n;let i=this.coinbaseBrowser;if(i)return i;let o=this._relay;if(!o||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return e||o.setConnectDisabled(!0),new k4t.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(o),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:e,chainId:r,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(e,r){var n;this._appName=e||"DApp",this._appLogoUrl=r||(0,oEe.getFavicon)();let i=this.walletExtension;i?this.isCipherProvider(i)||i.setAppInfo(this._appName,this._appLogoUrl):(n=this._relay)===null||n===void 0||n.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var e;let r=this===null||this===void 0?void 0:this.walletExtension;r?r.close():(e=this._relay)===null||e===void 0||e.resetAndReload()}getQrUrl(){var e,r;return(r=(e=this._relay)===null||e===void 0?void 0:e.getQRCodeUrl())!==null&&r!==void 0?r:null}getCoinbaseWalletLogo(e,r=240){return(0,_4t.walletLogo)(e,r)}get walletExtension(){var e;return(e=window.coinbaseWalletExtension)!==null&&e!==void 0?e:window.walletLinkExtension}get coinbaseBrowser(){var e,r;try{let n=(e=window.ethereum)!==null&&e!==void 0?e:(r=window.top)===null||r===void 0?void 0:r.ethereum;return n&&"isCoinbaseBrowser"in n&&n.isCoinbaseBrowser?n:void 0}catch{return}}isCipherProvider(e){return typeof e.isCipher=="boolean"&&e.isCipher}};EB.CoinbaseWalletSDK=xB;xB.VERSION=sEe.LIB_VERSION});var cEe=X(bv=>{"use strict";Object.defineProperty(bv,"__esModule",{value:!0});bv.CoinbaseWalletProvider=bv.CoinbaseWalletSDK=void 0;var RY=kY(),aEe=yB(),B4t=kY();Object.defineProperty(bv,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return B4t.CoinbaseWalletSDK}});var D4t=yB();Object.defineProperty(bv,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return D4t.CoinbaseWalletProvider}});bv.default=RY.CoinbaseWalletSDK;typeof window<"u"&&(window.CoinbaseWalletSDK=RY.CoinbaseWalletSDK,window.CoinbaseWalletProvider=aEe.CoinbaseWalletProvider,window.WalletLink=RY.CoinbaseWalletSDK,window.WalletLinkProvider=aEe.CoinbaseWalletProvider)});var CB,MY=F(()=>{CB=()=>"9.1.0"});var j4t,F4t,lEe,uEe=F(()=>{j4t=t=>t.toString(16).padStart(2,"0"),F4t=t=>{let e=new Uint8Array((t||40)/2);return window.crypto.getRandomValues(e),Array.from(e,j4t).join("")},lEe=()=>typeof window<"u"?F4t(10):new Date().getTime().toString(36)});var i2,NY=F(()=>{MY();uEe();i2=class{};i2.makeRequest=(t,e)=>({id:lEe(),method:t,params:e,env:{sdkVersion:CB()}});i2.makeResponse=(t,e,r)=>({id:t,success:!0,version:r,data:e});i2.makeErrorResponse=(t,e,r)=>({id:t,success:!1,error:e,version:r})});var Ro,oC,o2=F(()=>{(function(t){t.sendTransactions="sendTransactions",t.rpcCall="rpcCall",t.getChainInfo="getChainInfo",t.getSafeInfo="getSafeInfo",t.getTxBySafeTxHash="getTxBySafeTxHash",t.getSafeBalances="getSafeBalances",t.signMessage="signMessage",t.signTypedMessage="signTypedMessage",t.getEnvironmentInfo="getEnvironmentInfo",t.getOffChainSignature="getOffChainSignature",t.requestAddressBook="requestAddressBook",t.wallet_getPermissions="wallet_getPermissions",t.wallet_requestPermissions="wallet_requestPermissions"})(Ro||(Ro={}));(function(t){t.requestAddressBook="requestAddressBook"})(oC||(oC={}))});var OY,fEe,hEe=F(()=>{NY();o2();OY=class{constructor(e=null,r=!1){this.allowedOrigins=null,this.callbacks=new Map,this.debugMode=!1,this.isServer=typeof window>"u",this.isValidMessage=({origin:n,data:i,source:o})=>{let s=!i,a=!this.isServer&&o===window.parent,l=typeof i.version<"u"&&parseInt(i.version.split(".")[0]),u=typeof l=="number"&&l>=1,d=!0;return Array.isArray(this.allowedOrigins)&&(d=this.allowedOrigins.find(p=>p.test(n))!==void 0),!s&&a&&u&&d},this.logIncomingMessage=n=>{console.info(`Safe Apps SDK v1: A message was received from origin ${n.origin}. `,n.data)},this.onParentMessage=n=>{this.isValidMessage(n)&&(this.debugMode&&this.logIncomingMessage(n),this.handleIncomingMessage(n.data))},this.handleIncomingMessage=n=>{let{id:i}=n,o=this.callbacks.get(i);o&&(o(n),this.callbacks.delete(i))},this.send=(n,i)=>{let o=i2.makeRequest(n,i);if(this.isServer)throw new Error("Window doesn't exist");return window.parent.postMessage(o,"*"),new Promise((s,a)=>{this.callbacks.set(o.id,l=>{if(!l.success){a(new Error(l.error));return}s(l)})})},this.allowedOrigins=e,this.debugMode=r,this.isServer||window.addEventListener("message",this.onParentMessage)}},fEe=OY});var sC,dEe=F(()=>{sC=t=>typeof t=="object"&&t!=null&&"domain"in t&&"types"in t&&"message"in t});var pEe=F(()=>{});var gEe=X(df=>{"use strict";var PY=df&&df.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(d){try{u(n.next(d))}catch(p){s(p)}}function l(d){try{u(n.throw(d))}catch(p){s(p)}}function u(d){d.done?o(d.value):i(d.value).then(a,l)}u((n=n.apply(t,e||[])).next())})};Object.defineProperty(df,"__esModule",{value:!0});df.getData=df.fetchData=df.stringifyQuery=df.insertParams=void 0;var $4t=t=>typeof t=="object"&&t!==null&&"code"in t&&"message"in t;function q4t(t,e,r){return t.replace(new RegExp(`\\{${e}\\}`,"g"),r)}function H4t(t,e){return e?Object.keys(e).reduce((r,n)=>q4t(r,n,String(e[n])),t):t}df.insertParams=H4t;function z4t(t){if(!t)return"";let e=new URLSearchParams;Object.keys(t).forEach(n=>{t[n]!=null&&e.append(n,String(t[n]))});let r=e.toString();return r?`?${r}`:""}df.stringifyQuery=z4t;function mEe(t){return PY(this,void 0,void 0,function*(){let e;try{e=yield t.json()}catch{e={}}if(!t.ok){let r=$4t(e)?`CGW error - ${e.code}: ${e.message}`:`CGW error - status ${t.statusText}`;throw new Error(r)}return e})}function W4t(t,e,r,n,i){return PY(this,void 0,void 0,function*(){let o=Object.assign({"Content-Type":"application/json"},n),s={method:e??"POST",headers:o};i&&(s.credentials=i),r!=null&&(s.body=typeof r=="string"?r:JSON.stringify(r));let a=yield fetch(t,s);return mEe(a)})}df.fetchData=W4t;function V4t(t,e,r){return PY(this,void 0,void 0,function*(){let n={method:"GET"};e&&(n.headers=Object.assign(Object.assign({},e),{"Content-Type":"application/json"})),r&&(n.credentials=r);let i=yield fetch(t,n);return mEe(i)})}df.getData=V4t});var wEe=X(a0=>{"use strict";Object.defineProperty(a0,"__esModule",{value:!0});a0.getEndpoint=a0.deleteEndpoint=a0.putEndpoint=a0.postEndpoint=void 0;var xv=gEe();function AB(t,e,r,n){let i=(0,xv.insertParams)(e,r),o=(0,xv.stringifyQuery)(n);return`${t}${i}${o}`}function K4t(t,e,r){let n=AB(t,e,r?.path,r?.query);return(0,xv.fetchData)(n,"POST",r?.body,r?.headers,r?.credentials)}a0.postEndpoint=K4t;function G4t(t,e,r){let n=AB(t,e,r?.path,r?.query);return(0,xv.fetchData)(n,"PUT",r?.body,r?.headers,r?.credentials)}a0.putEndpoint=G4t;function Q4t(t,e,r){let n=AB(t,e,r?.path,r?.query);return(0,xv.fetchData)(n,"DELETE",r?.body,r?.headers,r?.credentials)}a0.deleteEndpoint=Q4t;function Z4t(t,e,r,n){if(n)return(0,xv.getData)(n,void 0,r?.credentials);let i=AB(t,e,r?.path,r?.query);return(0,xv.getData)(i,r?.headers,r?.credentials)}a0.getEndpoint=Z4t});var vEe=X(SB=>{"use strict";Object.defineProperty(SB,"__esModule",{value:!0});SB.DEFAULT_BASE_URL=void 0;SB.DEFAULT_BASE_URL="https://safe-client.safe.global"});var yEe=X(aC=>{"use strict";Object.defineProperty(aC,"__esModule",{value:!0});aC.ImplementationVersionState=void 0;var Y4t;(function(t){t.UP_TO_DATE="UP_TO_DATE",t.OUTDATED="OUTDATED",t.UNKNOWN="UNKNOWN"})(Y4t=aC.ImplementationVersionState||(aC.ImplementationVersionState={}))});var bEe=X(vh=>{"use strict";Object.defineProperty(vh,"__esModule",{value:!0});vh.SafeAppSocialPlatforms=vh.SafeAppFeatures=vh.SafeAppAccessPolicyTypes=void 0;var J4t;(function(t){t.NoRestrictions="NO_RESTRICTIONS",t.DomainAllowlist="DOMAIN_ALLOWLIST"})(J4t=vh.SafeAppAccessPolicyTypes||(vh.SafeAppAccessPolicyTypes={}));var X4t;(function(t){t.BATCHED_TRANSACTIONS="BATCHED_TRANSACTIONS"})(X4t=vh.SafeAppFeatures||(vh.SafeAppFeatures={}));var e6t;(function(t){t.TWITTER="TWITTER",t.GITHUB="GITHUB",t.DISCORD="DISCORD"})(e6t=vh.SafeAppSocialPlatforms||(vh.SafeAppSocialPlatforms={}))});var xEe=X(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.LabelValue=vn.StartTimeValue=vn.DurationType=vn.DetailedExecutionInfoType=vn.TransactionListItemType=vn.ConflictType=vn.TransactionInfoType=vn.SettingsInfoType=vn.TransactionTokenType=vn.TransferDirection=vn.TransactionStatus=vn.Operation=void 0;var t6t;(function(t){t[t.CALL=0]="CALL",t[t.DELEGATE=1]="DELEGATE"})(t6t=vn.Operation||(vn.Operation={}));var r6t;(function(t){t.AWAITING_CONFIRMATIONS="AWAITING_CONFIRMATIONS",t.AWAITING_EXECUTION="AWAITING_EXECUTION",t.CANCELLED="CANCELLED",t.FAILED="FAILED",t.SUCCESS="SUCCESS"})(r6t=vn.TransactionStatus||(vn.TransactionStatus={}));var n6t;(function(t){t.INCOMING="INCOMING",t.OUTGOING="OUTGOING",t.UNKNOWN="UNKNOWN"})(n6t=vn.TransferDirection||(vn.TransferDirection={}));var i6t;(function(t){t.ERC20="ERC20",t.ERC721="ERC721",t.NATIVE_COIN="NATIVE_COIN"})(i6t=vn.TransactionTokenType||(vn.TransactionTokenType={}));var o6t;(function(t){t.SET_FALLBACK_HANDLER="SET_FALLBACK_HANDLER",t.ADD_OWNER="ADD_OWNER",t.REMOVE_OWNER="REMOVE_OWNER",t.SWAP_OWNER="SWAP_OWNER",t.CHANGE_THRESHOLD="CHANGE_THRESHOLD",t.CHANGE_IMPLEMENTATION="CHANGE_IMPLEMENTATION",t.ENABLE_MODULE="ENABLE_MODULE",t.DISABLE_MODULE="DISABLE_MODULE",t.SET_GUARD="SET_GUARD",t.DELETE_GUARD="DELETE_GUARD"})(o6t=vn.SettingsInfoType||(vn.SettingsInfoType={}));var s6t;(function(t){t.TRANSFER="Transfer",t.SETTINGS_CHANGE="SettingsChange",t.CUSTOM="Custom",t.CREATION="Creation",t.SWAP_ORDER="SwapOrder",t.TWAP_ORDER="TwapOrder",t.SWAP_TRANSFER="SwapTransfer"})(s6t=vn.TransactionInfoType||(vn.TransactionInfoType={}));var a6t;(function(t){t.NONE="None",t.HAS_NEXT="HasNext",t.END="End"})(a6t=vn.ConflictType||(vn.ConflictType={}));var c6t;(function(t){t.TRANSACTION="TRANSACTION",t.LABEL="LABEL",t.CONFLICT_HEADER="CONFLICT_HEADER",t.DATE_LABEL="DATE_LABEL"})(c6t=vn.TransactionListItemType||(vn.TransactionListItemType={}));var l6t;(function(t){t.MULTISIG="MULTISIG",t.MODULE="MODULE"})(l6t=vn.DetailedExecutionInfoType||(vn.DetailedExecutionInfoType={}));var u6t;(function(t){t.AUTO="AUTO",t.LIMIT_DURATION="LIMIT_DURATION"})(u6t=vn.DurationType||(vn.DurationType={}));var f6t;(function(t){t.AT_MINING_TIME="AT_MINING_TIME",t.AT_EPOCH="AT_EPOCH"})(f6t=vn.StartTimeValue||(vn.StartTimeValue={}));var h6t;(function(t){t.Queued="Queued",t.Next="Next"})(h6t=vn.LabelValue||(vn.LabelValue={}))});var EEe=X(yh=>{"use strict";Object.defineProperty(yh,"__esModule",{value:!0});yh.FEATURES=yh.GAS_PRICE_TYPE=yh.RPC_AUTHENTICATION=void 0;var d6t;(function(t){t.API_KEY_PATH="API_KEY_PATH",t.NO_AUTHENTICATION="NO_AUTHENTICATION",t.UNKNOWN="UNKNOWN"})(d6t=yh.RPC_AUTHENTICATION||(yh.RPC_AUTHENTICATION={}));var p6t;(function(t){t.ORACLE="ORACLE",t.FIXED="FIXED",t.FIXED_1559="FIXED1559",t.UNKNOWN="UNKNOWN"})(p6t=yh.GAS_PRICE_TYPE||(yh.GAS_PRICE_TYPE={}));var m6t;(function(t){t.ERC721="ERC721",t.SAFE_APPS="SAFE_APPS",t.CONTRACT_INTERACTION="CONTRACT_INTERACTION",t.DOMAIN_LOOKUP="DOMAIN_LOOKUP",t.SPENDING_LIMIT="SPENDING_LIMIT",t.EIP1559="EIP1559",t.SAFE_TX_GAS_OPTIONAL="SAFE_TX_GAS_OPTIONAL",t.TX_SIMULATION="TX_SIMULATION",t.EIP1271="EIP1271"})(m6t=yh.FEATURES||(yh.FEATURES={}))});var CEe=X(cC=>{"use strict";Object.defineProperty(cC,"__esModule",{value:!0});cC.TokenType=void 0;var g6t;(function(t){t.ERC20="ERC20",t.ERC721="ERC721",t.NATIVE_TOKEN="NATIVE_TOKEN"})(g6t=cC.TokenType||(cC.TokenType={}))});var SEe=X(AEe=>{"use strict";Object.defineProperty(AEe,"__esModule",{value:!0})});var _Ee=X(lC=>{"use strict";Object.defineProperty(lC,"__esModule",{value:!0});lC.ConfirmationViewTypes=void 0;var w6t;(function(t){t.COW_SWAP_ORDER="COW_SWAP_ORDER",t.COW_SWAP_TWAP_ORDER="COW_SWAP_TWAP_ORDER"})(w6t=lC.ConfirmationViewTypes||(lC.ConfirmationViewTypes={}))});var IEe=X(s2=>{"use strict";Object.defineProperty(s2,"__esModule",{value:!0});s2.SafeMessageStatus=s2.SafeMessageListItemType=void 0;var v6t;(function(t){t.DATE_LABEL="DATE_LABEL",t.MESSAGE="MESSAGE"})(v6t=s2.SafeMessageListItemType||(s2.SafeMessageListItemType={}));var y6t;(function(t){t.NEEDS_CONFIRMATION="NEEDS_CONFIRMATION",t.CONFIRMED="CONFIRMED"})(y6t=s2.SafeMessageStatus||(s2.SafeMessageStatus={}))});var TEe=X(uC=>{"use strict";Object.defineProperty(uC,"__esModule",{value:!0});uC.DeviceType=void 0;var b6t;(function(t){t.ANDROID="ANDROID",t.IOS="IOS",t.WEB="WEB"})(b6t=uC.DeviceType||(uC.DeviceType={}))});var REe=X(kEe=>{"use strict";Object.defineProperty(kEe,"__esModule",{value:!0})});var MEe=X(He=>{"use strict";var x6t=He&&He.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),c0=He&&He.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&x6t(e,t,r)};Object.defineProperty(He,"__esModule",{value:!0});He.deleteAccount=He.getAccount=He.createAccount=He.verifyAuth=He.getAuthNonce=He.getContract=He.getSafeOverviews=He.unsubscribeAll=He.unsubscribeSingle=He.registerRecoveryModule=He.deleteRegisteredEmail=He.getRegisteredEmail=He.verifyEmail=He.resendEmailVerificationCode=He.changeEmail=He.registerEmail=He.unregisterDevice=He.unregisterSafe=He.registerDevice=He.getDelegates=He.confirmSafeMessage=He.proposeSafeMessage=He.getSafeMessage=He.getSafeMessages=He.getDecodedData=He.getMasterCopies=He.getSafeApps=He.getChainConfig=He.getChainsConfig=He.getConfirmationView=He.proposeTransaction=He.getNonces=He.postSafeGasEstimation=He.deleteTransaction=He.getTransactionDetails=He.getTransactionQueue=He.getTransactionHistory=He.getCollectiblesPage=He.getCollectibles=He.getAllOwnedSafes=He.getOwnedSafes=He.getFiatCurrencies=He.getBalances=He.getMultisigTransactions=He.getModuleTransactions=He.getIncomingTransfers=He.getSafeInfo=He.getRelayCount=He.relayTransaction=He.setBaseUrl=void 0;He.putAccountDataSettings=He.getAccountDataSettings=He.getAccountDataTypes=void 0;var Sr=wEe(),E6t=vEe();c0(yEe(),He);c0(bEe(),He);c0(xEe(),He);c0(EEe(),He);c0(CEe(),He);c0(SEe(),He);c0(_Ee(),He);c0(IEe(),He);c0(TEe(),He);c0(REe(),He);var br=E6t.DEFAULT_BASE_URL,C6t=t=>{br=t};He.setBaseUrl=C6t;function A6t(t,e){return(0,Sr.postEndpoint)(br,"/v1/chains/{chainId}/relay",{path:{chainId:t},body:e})}He.relayTransaction=A6t;function S6t(t,e){return(0,Sr.getEndpoint)(br,"/v1/chains/{chainId}/relay/{address}",{path:{chainId:t,address:e}})}He.getRelayCount=S6t;function _6t(t,e){return(0,Sr.getEndpoint)(br,"/v1/chains/{chainId}/safes/{address}",{path:{chainId:t,address:e}})}He.getSafeInfo=_6t;function I6t(t,e,r,n){return(0,Sr.getEndpoint)(br,"/v1/chains/{chainId}/safes/{address}/incoming-transfers/",{path:{chainId:t,address:e},query:r},n)}He.getIncomingTransfers=I6t;function T6t(t,e,r,n){return(0,Sr.getEndpoint)(br,"/v1/chains/{chainId}/safes/{address}/module-transactions/",{path:{chainId:t,address:e},query:r},n)}He.getModuleTransactions=T6t;function k6t(t,e,r,n){return(0,Sr.getEndpoint)(br,"/v1/chains/{chainId}/safes/{address}/multisig-transactions/",{path:{chainId:t,address:e},query:r},n)}He.getMultisigTransactions=k6t;function R6t(t,e,r="usd",n={}){return(0,Sr.getEndpoint)(br,"/v1/chains/{chainId}/safes/{address}/balances/{currency}",{path:{chainId:t,address:e,currency:r},query:n})}He.getBalances=R6t;function M6t(){return(0,Sr.getEndpoint)(br,"/v1/balances/supported-fiat-codes")}He.getFiatCurrencies=M6t;function N6t(t,e){return(0,Sr.getEndpoint)(br,"/v1/chains/{chainId}/owners/{address}/safes",{path:{chainId:t,address:e}})}He.getOwnedSafes=N6t;function O6t(t){return(0,Sr.getEndpoint)(br,"/v1/owners/{address}/safes",{path:{address:t}})}He.getAllOwnedSafes=O6t;function P6t(t,e,r={}){return(0,Sr.getEndpoint)(br,"/v1/chains/{chainId}/safes/{address}/collectibles",{path:{chainId:t,address:e},query:r})}He.getCollectibles=P6t;function B6t(t,e,r={},n){return(0,Sr.getEndpoint)(br,"/v2/chains/{chainId}/safes/{address}/collectibles",{path:{chainId:t,address:e},query:r},n)}He.getCollectiblesPage=B6t;function D6t(t,e,r={},n){return(0,Sr.getEndpoint)(br,"/v1/chains/{chainId}/safes/{safe_address}/transactions/history",{path:{chainId:t,safe_address:e},query:r},n)}He.getTransactionHistory=D6t;function L6t(t,e,r={},n){return(0,Sr.getEndpoint)(br,"/v1/chains/{chainId}/safes/{safe_address}/transactions/queued",{path:{chainId:t,safe_address:e},query:r},n)}He.getTransactionQueue=L6t;function U6t(t,e){return(0,Sr.getEndpoint)(br,"/v1/chains/{chainId}/transactions/{transactionId}",{path:{chainId:t,transactionId:e}})}He.getTransactionDetails=U6t;function j6t(t,e,r){return(0,Sr.deleteEndpoint)(br,"/v1/chains/{chainId}/transactions/{safeTxHash}",{path:{chainId:t,safeTxHash:e},body:{signature:r}})}He.deleteTransaction=j6t;function F6t(t,e,r){return(0,Sr.postEndpoint)(br,"/v2/chains/{chainId}/safes/{safe_address}/multisig-transactions/estimations",{path:{chainId:t,safe_address:e},body:r})}He.postSafeGasEstimation=F6t;function $6t(t,e){return(0,Sr.getEndpoint)(br,"/v1/chains/{chainId}/safes/{safe_address}/nonces",{path:{chainId:t,safe_address:e}})}He.getNonces=$6t;function q6t(t,e,r){return(0,Sr.postEndpoint)(br,"/v1/chains/{chainId}/transactions/{safe_address}/propose",{path:{chainId:t,safe_address:e},body:r})}He.proposeTransaction=q6t;function H6t(t,e,r,n){return(0,Sr.postEndpoint)(br,"/v1/chains/{chainId}/safes/{safe_address}/views/transaction-confirmation",{path:{chainId:t,safe_address:e},body:{data:r,to:n}})}He.getConfirmationView=H6t;function z6t(t){return(0,Sr.getEndpoint)(br,"/v1/chains",{query:t})}He.getChainsConfig=z6t;function W6t(t){return(0,Sr.getEndpoint)(br,"/v1/chains/{chainId}",{path:{chainId:t}})}He.getChainConfig=W6t;function V6t(t,e={}){return(0,Sr.getEndpoint)(br,"/v1/chains/{chainId}/safe-apps",{path:{chainId:t},query:e})}He.getSafeApps=V6t;function K6t(t){return(0,Sr.getEndpoint)(br,"/v1/chains/{chainId}/about/master-copies",{path:{chainId:t}})}He.getMasterCopies=K6t;function G6t(t,e,r){return(0,Sr.postEndpoint)(br,"/v1/chains/{chainId}/data-decoder",{path:{chainId:t},body:{data:e,to:r}})}He.getDecodedData=G6t;function Q6t(t,e,r){return(0,Sr.getEndpoint)(br,"/v1/chains/{chainId}/safes/{safe_address}/messages",{path:{chainId:t,safe_address:e},query:{}},r)}He.getSafeMessages=Q6t;function Z6t(t,e){return(0,Sr.getEndpoint)(br,"/v1/chains/{chainId}/messages/{message_hash}",{path:{chainId:t,message_hash:e}})}He.getSafeMessage=Z6t;function Y6t(t,e,r){return(0,Sr.postEndpoint)(br,"/v1/chains/{chainId}/safes/{safe_address}/messages",{path:{chainId:t,safe_address:e},body:r})}He.proposeSafeMessage=Y6t;function J6t(t,e,r){return(0,Sr.postEndpoint)(br,"/v1/chains/{chainId}/messages/{message_hash}/signatures",{path:{chainId:t,message_hash:e},body:r})}He.confirmSafeMessage=J6t;function X6t(t,e={}){return(0,Sr.getEndpoint)(br,"/v2/chains/{chainId}/delegates",{path:{chainId:t},query:e})}He.getDelegates=X6t;function ext(t){return(0,Sr.postEndpoint)(br,"/v1/register/notifications",{body:t})}He.registerDevice=ext;function txt(t,e,r){return(0,Sr.deleteEndpoint)(br,"/v1/chains/{chainId}/notifications/devices/{uuid}/safes/{safe_address}",{path:{chainId:t,safe_address:e,uuid:r}})}He.unregisterSafe=txt;function rxt(t,e){return(0,Sr.deleteEndpoint)(br,"/v1/chains/{chainId}/notifications/devices/{uuid}",{path:{chainId:t,uuid:e}})}He.unregisterDevice=rxt;function nxt(t,e,r,n){return(0,Sr.postEndpoint)(br,"/v1/chains/{chainId}/safes/{safe_address}/emails",{path:{chainId:t,safe_address:e},body:r,headers:n})}He.registerEmail=nxt;function ixt(t,e,r,n,i){return(0,Sr.putEndpoint)(br,"/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}",{path:{chainId:t,safe_address:e,signer:r},body:n,headers:i})}He.changeEmail=ixt;function oxt(t,e,r){return(0,Sr.postEndpoint)(br,"/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}/verify-resend",{path:{chainId:t,safe_address:e,signer:r},body:""})}He.resendEmailVerificationCode=oxt;function sxt(t,e,r,n){return(0,Sr.putEndpoint)(br,"/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}/verify",{path:{chainId:t,safe_address:e,signer:r},body:n})}He.verifyEmail=sxt;function axt(t,e,r,n){return(0,Sr.getEndpoint)(br,"/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}",{path:{chainId:t,safe_address:e,signer:r},headers:n})}He.getRegisteredEmail=axt;function cxt(t,e,r,n){return(0,Sr.deleteEndpoint)(br,"/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}",{path:{chainId:t,safe_address:e,signer:r},headers:n})}He.deleteRegisteredEmail=cxt;function lxt(t,e,r){return(0,Sr.postEndpoint)(br,"/v1/chains/{chainId}/safes/{safe_address}/recovery",{path:{chainId:t,safe_address:e},body:r})}He.registerRecoveryModule=lxt;function uxt(t){return(0,Sr.deleteEndpoint)(br,"/v1/subscriptions",{query:t})}He.unsubscribeSingle=uxt;function fxt(t){return(0,Sr.deleteEndpoint)(br,"/v1/subscriptions/all",{query:t})}He.unsubscribeAll=fxt;function hxt(t,e){return(0,Sr.getEndpoint)(br,"/v1/safes",{query:Object.assign(Object.assign({},e),{safes:t.join(",")})})}He.getSafeOverviews=hxt;function dxt(t,e){return(0,Sr.getEndpoint)(br,"/v1/chains/{chainId}/contracts/{contractAddress}",{path:{chainId:t,contractAddress:e}})}He.getContract=dxt;function pxt(){return(0,Sr.getEndpoint)(br,"/v1/auth/nonce",{credentials:"include"})}He.getAuthNonce=pxt;function mxt(t){return(0,Sr.postEndpoint)(br,"/v1/auth/verify",{body:t,credentials:"include"})}He.verifyAuth=mxt;function gxt(t){return(0,Sr.postEndpoint)(br,"/v1/accounts",{body:t,credentials:"include"})}He.createAccount=gxt;function wxt(t){return(0,Sr.getEndpoint)(br,"/v1/accounts/{address}",{path:{address:t},credentials:"include"})}He.getAccount=wxt;function vxt(t){return(0,Sr.deleteEndpoint)(br,"/v1/accounts/{address}",{path:{address:t},credentials:"include"})}He.deleteAccount=vxt;function yxt(){return(0,Sr.getEndpoint)(br,"/v1/accounts/data-types")}He.getAccountDataTypes=yxt;function bxt(t){return(0,Sr.getEndpoint)(br,"/v1/accounts/{address}/data-settings",{path:{address:t},credentials:"include"})}He.getAccountDataSettings=bxt;function xxt(t,e){return(0,Sr.putEndpoint)(br,"/v1/accounts/{address}/data-settings",{path:{address:t},body:e,credentials:"include"})}He.putAccountDataSettings=xxt});var a2,NEe=F(()=>{a2=It(MEe(),1)});var OEe=F(()=>{o2()});var _B=F(()=>{dEe();pEe();NEe();OEe()});var IB,PEe=F(()=>{o2();_B();IB=class{constructor(e){this.communicator=e}async getBySafeTxHash(e){if(!e)throw new Error("Invalid safeTxHash");return(await this.communicator.send(Ro.getTxBySafeTxHash,{safeTxHash:e})).data}async signMessage(e){let r={message:e};return(await this.communicator.send(Ro.signMessage,r)).data}async signTypedMessage(e){if(!sC(e))throw new Error("Invalid typed data");return(await this.communicator.send(Ro.signTypedMessage,{typedData:e})).data}async send({txs:e,params:r}){if(!e||!e.length)throw new Error("No transactions were passed");let n={txs:e,params:r};return(await this.communicator.send(Ro.sendTransactions,n)).data}}});var zs,TB=F(()=>{zs={eth_call:"eth_call",eth_gasPrice:"eth_gasPrice",eth_getLogs:"eth_getLogs",eth_getBalance:"eth_getBalance",eth_getCode:"eth_getCode",eth_getBlockByHash:"eth_getBlockByHash",eth_getBlockByNumber:"eth_getBlockByNumber",eth_getStorageAt:"eth_getStorageAt",eth_getTransactionByHash:"eth_getTransactionByHash",eth_getTransactionReceipt:"eth_getTransactionReceipt",eth_getTransactionCount:"eth_getTransactionCount",eth_estimateGas:"eth_estimateGas",safe_setSettings:"safe_setSettings"}});var _m,kB,BEe=F(()=>{TB();o2();_m={defaultBlockParam:(t="latest")=>t,returnFullTxObjectParam:(t=!1)=>t,blockNumberToHex:t=>Number.isInteger(t)?`0x${t.toString(16)}`:t},kB=class{constructor(e){this.communicator=e,this.call=this.buildRequest({call:zs.eth_call,formatters:[null,_m.defaultBlockParam]}),this.getBalance=this.buildRequest({call:zs.eth_getBalance,formatters:[null,_m.defaultBlockParam]}),this.getCode=this.buildRequest({call:zs.eth_getCode,formatters:[null,_m.defaultBlockParam]}),this.getStorageAt=this.buildRequest({call:zs.eth_getStorageAt,formatters:[null,_m.blockNumberToHex,_m.defaultBlockParam]}),this.getPastLogs=this.buildRequest({call:zs.eth_getLogs}),this.getBlockByHash=this.buildRequest({call:zs.eth_getBlockByHash,formatters:[null,_m.returnFullTxObjectParam]}),this.getBlockByNumber=this.buildRequest({call:zs.eth_getBlockByNumber,formatters:[_m.blockNumberToHex,_m.returnFullTxObjectParam]}),this.getTransactionByHash=this.buildRequest({call:zs.eth_getTransactionByHash}),this.getTransactionReceipt=this.buildRequest({call:zs.eth_getTransactionReceipt}),this.getTransactionCount=this.buildRequest({call:zs.eth_getTransactionCount,formatters:[null,_m.defaultBlockParam]}),this.getGasPrice=this.buildRequest({call:zs.eth_gasPrice}),this.getEstimateGas=r=>this.buildRequest({call:zs.eth_estimateGas})([r]),this.setSafeSettings=this.buildRequest({call:zs.safe_setSettings})}buildRequest(e){let{call:r,formatters:n}=e;return async i=>{n&&Array.isArray(i)&&n.forEach((a,l)=>{a&&(i[l]=a(i[l]))});let o={call:r,params:i||[]};return(await this.communicator.send(Ro.rpcCall,o)).data}}}});var DEe,LEe,UEe=F(()=>{DEe="0x1626ba7e",LEe="0x20c13b0b"});var Ev,BY=F(()=>{Ev=class t extends Error{constructor(e,r,n){super(e),this.code=r,this.data=n,Object.setPrototypeOf(this,t.prototype)}}});var E6,DY=F(()=>{o2();BY();E6=class{constructor(e){this.communicator=e}async getPermissions(){return(await this.communicator.send(Ro.wallet_getPermissions,void 0)).data}async requestPermissions(e){if(!this.isPermissionRequestValid(e))throw new Ev("Permissions request is invalid",4001);try{return(await this.communicator.send(Ro.wallet_requestPermissions,e)).data}catch{throw new Ev("Permissions rejected",4001)}}isPermissionRequestValid(e){return e.every(r=>typeof r=="object"?Object.keys(r).every(n=>!!Object.values(oC).includes(n)):!1)}}});var jEe,Ext,FEe,$Ee=F(()=>{DY();BY();jEe=(t,e)=>e.some(r=>r.parentCapability===t),Ext=()=>(t,e,r)=>{let n=r.value;return r.value=async function(){let i=new E6(this.communicator),o=await i.getPermissions();if(jEe(e,o)||(o=await i.requestPermissions([{[e]:{}}])),!jEe(e,o))throw new Ev("Permissions rejected",4001);return n.apply(this)},r},FEe=Ext});var Cxt,fC,qEe=F(()=>{vc();UEe();o2();TB();_B();$Ee();Cxt=function(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o},fC=class{constructor(e){this.communicator=e}async getChainInfo(){return(await this.communicator.send(Ro.getChainInfo,void 0)).data}async getInfo(){return(await this.communicator.send(Ro.getSafeInfo,void 0)).data}async experimental_getBalances({currency:e="usd"}={}){return(await this.communicator.send(Ro.getSafeBalances,{currency:e})).data}async check1271Signature(e,r="0x"){let n=await this.getInfo(),i=Ds({abi:[{constant:!1,inputs:[{name:"_dataHash",type:"bytes32"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[e,r]}),o={call:zs.eth_call,params:[{to:n.safeAddress,data:i},"latest"]};try{return(await this.communicator.send(Ro.rpcCall,o)).data.slice(0,10).toLowerCase()===DEe}catch{return!1}}async check1271SignatureBytes(e,r="0x"){let n=await this.getInfo(),i=Ds({abi:[{constant:!1,inputs:[{name:"_data",type:"bytes"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[e,r]}),o={call:zs.eth_call,params:[{to:n.safeAddress,data:i},"latest"]};try{return(await this.communicator.send(Ro.rpcCall,o)).data.slice(0,10).toLowerCase()===LEe}catch{return!1}}calculateMessageHash(e){return sV(e)}calculateTypedMessageHash(e){let r=typeof e.domain.chainId=="object"?e.domain.chainId.toNumber():Number(e.domain.chainId),n=e.primaryType;if(!n){let i=Object.values(e.types),o=Object.keys(e.types).filter(s=>i.every(a=>a.every(({type:l})=>l.replace("[","").replace("]","")!==s)));if(o.length===0||o.length>1)throw new Error("Please specify primaryType");n=o[0]}return iV({message:e.message,domain:{...e.domain,chainId:r,verifyingContract:e.domain.verifyingContract,salt:e.domain.salt},types:e.types,primaryType:n})}async getOffChainSignature(e){return(await this.communicator.send(Ro.getOffChainSignature,e)).data}async isMessageSigned(e,r="0x"){let n;if(typeof e=="string"&&(n=async()=>{let i=this.calculateMessageHash(e);return await this.isMessageHashSigned(i,r)}),sC(e)&&(n=async()=>{let i=this.calculateTypedMessageHash(e);return await this.isMessageHashSigned(i,r)}),n)return await n();throw new Error("Invalid message type")}async isMessageHashSigned(e,r="0x"){let n=[this.check1271Signature.bind(this),this.check1271SignatureBytes.bind(this)];for(let i of n)if(await i(e,r))return!0;return!1}async getEnvironmentInfo(){return(await this.communicator.send(Ro.getEnvironmentInfo,void 0)).data}async requestAddressBook(){return(await this.communicator.send(Ro.requestAddressBook,void 0)).data}};Cxt([FEe()],fC.prototype,"requestAddressBook",null)});var LY,HEe,UY=F(()=>{hEe();PEe();BEe();qEe();DY();LY=class{constructor(e={}){let{allowedDomains:r=null,debug:n=!1}=e;this.communicator=new fEe(r,n),this.eth=new kB(this.communicator),this.txs=new IB(this.communicator),this.safe=new fC(this.communicator),this.wallet=new E6(this.communicator)}},HEe=LY});var zEe={};qr(zEe,{MessageFormatter:()=>i2,Methods:()=>Ro,Operation:()=>a2.Operation,RPC_CALLS:()=>zs,RestrictedMethods:()=>oC,TokenType:()=>a2.TokenType,TransactionStatus:()=>a2.TransactionStatus,TransferDirection:()=>a2.TransferDirection,default:()=>Axt,getSDKVersion:()=>CB,isObjectEIP712TypedData:()=>sC});var Axt,WEe=F(()=>{UY();UY();_B();o2();NY();MY();TB();Axt=HEe});var VEe=X(MB=>{"use strict";Object.defineProperty(MB,"__esModule",{value:!0});MB.getLowerCase=void 0;function Sxt(t){return t&&t.toLowerCase()}MB.getLowerCase=Sxt});var KEe=X(OB=>{"use strict";Object.defineProperty(OB,"__esModule",{value:!0});OB.SafeAppProvider=void 0;var _xt=jd(),NB=VEe(),jY=class extends _xt.EventEmitter{constructor(e,r){super(),this.submittedTxs=new Map,this.safe=e,this.sdk=r}async connect(){this.emit("connect",{chainId:this.chainId})}async disconnect(){}get chainId(){return this.safe.chainId}async request(e){let{method:r,params:n=[]}=e;switch(r){case"eth_accounts":return[this.safe.safeAddress];case"net_version":case"eth_chainId":return`0x${this.chainId.toString(16)}`;case"personal_sign":{let[l,u]=n;if(this.safe.safeAddress.toLowerCase()!==u.toLowerCase())throw new Error("The address or message hash is invalid");let d=await this.sdk.txs.signMessage(l);return("signature"in d?d.signature:void 0)||"0x"}case"eth_sign":{let[l,u]=n;if(this.safe.safeAddress.toLowerCase()!==l.toLowerCase()||!u.startsWith("0x"))throw new Error("The address or message hash is invalid");let d=await this.sdk.txs.signMessage(u);return("signature"in d?d.signature:void 0)||"0x"}case"eth_signTypedData":case"eth_signTypedData_v4":{let[l,u]=n,d=typeof u=="string"?JSON.parse(u):u;if(this.safe.safeAddress.toLowerCase()!==l.toLowerCase())throw new Error("The address is invalid");let p=await this.sdk.txs.signTypedMessage(d);return("signature"in p?p.signature:void 0)||"0x"}case"eth_sendTransaction":let i={...n[0],value:n[0].value||"0",data:n[0].data||"0x"};typeof i.gas=="string"&&i.gas.startsWith("0x")&&(i.gas=parseInt(i.gas,16));let o=await this.sdk.txs.send({txs:[i],params:{safeTxGas:i.gas}});return this.submittedTxs.set(o.safeTxHash,{from:this.safe.safeAddress,hash:o.safeTxHash,gas:0,gasPrice:"0x00",nonce:0,input:i.data,value:i.value,to:i.to,blockHash:null,blockNumber:null,transactionIndex:null}),o.safeTxHash;case"eth_blockNumber":return(await this.sdk.eth.getBlockByNumber(["latest"])).number;case"eth_getBalance":return this.sdk.eth.getBalance([(0,NB.getLowerCase)(n[0]),n[1]]);case"eth_getCode":return this.sdk.eth.getCode([(0,NB.getLowerCase)(n[0]),n[1]]);case"eth_getTransactionCount":return this.sdk.eth.getTransactionCount([(0,NB.getLowerCase)(n[0]),n[1]]);case"eth_getStorageAt":return this.sdk.eth.getStorageAt([(0,NB.getLowerCase)(n[0]),n[1],n[2]]);case"eth_getBlockByNumber":return this.sdk.eth.getBlockByNumber([n[0],n[1]]);case"eth_getBlockByHash":return this.sdk.eth.getBlockByHash([n[0],n[1]]);case"eth_getTransactionByHash":let a=n[0];try{a=(await this.sdk.txs.getBySafeTxHash(a)).txHash||a}catch{}return this.submittedTxs.has(a)?this.submittedTxs.get(a):this.sdk.eth.getTransactionByHash([a]).then(l=>(l&&(l.hash=n[0]),l));case"eth_getTransactionReceipt":{let l=n[0];try{l=(await this.sdk.txs.getBySafeTxHash(l)).txHash||l}catch{}return this.sdk.eth.getTransactionReceipt([l]).then(u=>(u&&(u.transactionHash=n[0]),u))}case"eth_estimateGas":return this.sdk.eth.getEstimateGas(n[0]);case"eth_call":return this.sdk.eth.call([n[0],n[1]]);case"eth_getLogs":return this.sdk.eth.getPastLogs([n[0]]);case"eth_gasPrice":return this.sdk.eth.getGasPrice();case"wallet_getPermissions":return this.sdk.wallet.getPermissions();case"wallet_requestPermissions":return this.sdk.wallet.requestPermissions(n[0]);case"safe_setSettings":return this.sdk.eth.setSafeSettings([n[0]]);default:throw Error(`"${e.method}" not implemented`)}}send(e,r){e||r("Undefined request"),this.request(e).then(n=>r(null,{jsonrpc:"2.0",id:e.id,result:n})).catch(n=>r(n,null))}};OB.SafeAppProvider=jY});var GEe=X(PB=>{"use strict";Object.defineProperty(PB,"__esModule",{value:!0});PB.SafeAppProvider=void 0;var Ixt=KEe();Object.defineProperty(PB,"SafeAppProvider",{enumerable:!0,get:function(){return Ixt.SafeAppProvider}})});var C6={};qr(C6,{__assign:()=>$Y,__asyncDelegator:()=>Fxt,__asyncGenerator:()=>jxt,__asyncValues:()=>$xt,__await:()=>dC,__awaiter:()=>Oxt,__classPrivateFieldGet:()=>Wxt,__classPrivateFieldSet:()=>Vxt,__createBinding:()=>Bxt,__decorate:()=>Rxt,__exportStar:()=>Dxt,__extends:()=>Txt,__generator:()=>Pxt,__importDefault:()=>zxt,__importStar:()=>Hxt,__makeTemplateObject:()=>qxt,__metadata:()=>Nxt,__param:()=>Mxt,__read:()=>QEe,__rest:()=>kxt,__spread:()=>Lxt,__spreadArrays:()=>Uxt,__values:()=>qY});function Txt(t,e){FY(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function kxt(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function Rxt(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function Mxt(t,e){return function(r,n){e(r,n,t)}}function Nxt(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Oxt(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(d){try{u(n.next(d))}catch(p){s(p)}}function l(d){try{u(n.throw(d))}catch(p){s(p)}}function u(d){d.done?o(d.value):i(d.value).then(a,l)}u((n=n.apply(t,e||[])).next())})}function Pxt(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(d){return l([u,d])}}function l(u){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){r.label=u[1];break}if(u[0]===6&&r.label<o[1]){r.label=o[1],o=u;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(u);break}o[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(d){u=[6,d],i=0}finally{n=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Bxt(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}function Dxt(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function qY(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function QEe(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function Lxt(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(QEe(arguments[e]));return t}function Uxt(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function dC(t){return this instanceof dC?(this.v=t,this):new dC(t)}function jxt(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,o=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(v){n[v]&&(i[v]=function(y){return new Promise(function(S,R){o.push([v,y,S,R])>1||a(v,y)})})}function a(v,y){try{l(n[v](y))}catch(S){p(o[0][3],S)}}function l(v){v.value instanceof dC?Promise.resolve(v.value.v).then(u,d):p(o[0][2],v)}function u(v){a("next",v)}function d(v){a("throw",v)}function p(v,y){v(y),o.shift(),o.length&&a(o[0][0],o[0][1])}}function Fxt(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,o){e[i]=t[i]?function(s){return(r=!r)?{value:dC(t[i](s)),done:i==="return"}:o?o(s):s}:o}}function $xt(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof qY=="function"?qY(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=t[o]&&function(s){return new Promise(function(a,l){s=t[o](s),i(a,l,s.done,s.value)})}}function i(o,s,a,l){Promise.resolve(l).then(function(u){o({value:u,done:a})},s)}}function qxt(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function Hxt(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function zxt(t){return t&&t.__esModule?t:{default:t}}function Wxt(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function Vxt(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var FY,$Y,A6=F(()=>{FY=function(t,e){return FY=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},FY(t,e)};$Y=function(){return $Y=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},$Y.apply(this,arguments)}});var ZEe=X(BB=>{"use strict";Object.defineProperty(BB,"__esModule",{value:!0});BB.delay=void 0;function Kxt(t){return new Promise(e=>{setTimeout(()=>{e(!0)},t)})}BB.delay=Kxt});var YEe=X(S6=>{"use strict";Object.defineProperty(S6,"__esModule",{value:!0});S6.ONE_THOUSAND=S6.ONE_HUNDRED=void 0;S6.ONE_HUNDRED=100;S6.ONE_THOUSAND=1e3});var JEe=X(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0});zt.ONE_YEAR=zt.FOUR_WEEKS=zt.THREE_WEEKS=zt.TWO_WEEKS=zt.ONE_WEEK=zt.THIRTY_DAYS=zt.SEVEN_DAYS=zt.FIVE_DAYS=zt.THREE_DAYS=zt.ONE_DAY=zt.TWENTY_FOUR_HOURS=zt.TWELVE_HOURS=zt.SIX_HOURS=zt.THREE_HOURS=zt.ONE_HOUR=zt.SIXTY_MINUTES=zt.THIRTY_MINUTES=zt.TEN_MINUTES=zt.FIVE_MINUTES=zt.ONE_MINUTE=zt.SIXTY_SECONDS=zt.THIRTY_SECONDS=zt.TEN_SECONDS=zt.FIVE_SECONDS=zt.ONE_SECOND=void 0;zt.ONE_SECOND=1;zt.FIVE_SECONDS=5;zt.TEN_SECONDS=10;zt.THIRTY_SECONDS=30;zt.SIXTY_SECONDS=60;zt.ONE_MINUTE=zt.SIXTY_SECONDS;zt.FIVE_MINUTES=zt.ONE_MINUTE*5;zt.TEN_MINUTES=zt.ONE_MINUTE*10;zt.THIRTY_MINUTES=zt.ONE_MINUTE*30;zt.SIXTY_MINUTES=zt.ONE_MINUTE*60;zt.ONE_HOUR=zt.SIXTY_MINUTES;zt.THREE_HOURS=zt.ONE_HOUR*3;zt.SIX_HOURS=zt.ONE_HOUR*6;zt.TWELVE_HOURS=zt.ONE_HOUR*12;zt.TWENTY_FOUR_HOURS=zt.ONE_HOUR*24;zt.ONE_DAY=zt.TWENTY_FOUR_HOURS;zt.THREE_DAYS=zt.ONE_DAY*3;zt.FIVE_DAYS=zt.ONE_DAY*5;zt.SEVEN_DAYS=zt.ONE_DAY*7;zt.THIRTY_DAYS=zt.ONE_DAY*30;zt.ONE_WEEK=zt.SEVEN_DAYS;zt.TWO_WEEKS=zt.ONE_WEEK*2;zt.THREE_WEEKS=zt.ONE_WEEK*3;zt.FOUR_WEEKS=zt.ONE_WEEK*4;zt.ONE_YEAR=zt.ONE_DAY*365});var HY=X(DB=>{"use strict";Object.defineProperty(DB,"__esModule",{value:!0});var XEe=(A6(),zn(C6));XEe.__exportStar(YEe(),DB);XEe.__exportStar(JEe(),DB)});var t9e=X(_6=>{"use strict";Object.defineProperty(_6,"__esModule",{value:!0});_6.fromMiliseconds=_6.toMiliseconds=void 0;var e9e=HY();function Gxt(t){return t*e9e.ONE_THOUSAND}_6.toMiliseconds=Gxt;function Qxt(t){return Math.floor(t/e9e.ONE_THOUSAND)}_6.fromMiliseconds=Qxt});var n9e=X(LB=>{"use strict";Object.defineProperty(LB,"__esModule",{value:!0});var r9e=(A6(),zn(C6));r9e.__exportStar(ZEe(),LB);r9e.__exportStar(t9e(),LB)});var i9e=X(pC=>{"use strict";Object.defineProperty(pC,"__esModule",{value:!0});pC.Watch=void 0;var UB=class{constructor(){this.timestamps=new Map}start(e){if(this.timestamps.has(e))throw new Error(`Watch already started for label: ${e}`);this.timestamps.set(e,{started:Date.now()})}stop(e){let r=this.get(e);if(typeof r.elapsed<"u")throw new Error(`Watch already stopped for label: ${e}`);let n=Date.now()-r.started;this.timestamps.set(e,{started:r.started,elapsed:n})}get(e){let r=this.timestamps.get(e);if(typeof r>"u")throw new Error(`No timestamp found for label: ${e}`);return r}elapsed(e){let r=this.get(e);return r.elapsed||Date.now()-r.started}};pC.Watch=UB;pC.default=UB});var o9e=X(jB=>{"use strict";Object.defineProperty(jB,"__esModule",{value:!0});jB.IWatch=void 0;var zY=class{};jB.IWatch=zY});var s9e=X(WY=>{"use strict";Object.defineProperty(WY,"__esModule",{value:!0});var Zxt=(A6(),zn(C6));Zxt.__exportStar(o9e(),WY)});var VY=X(I6=>{"use strict";Object.defineProperty(I6,"__esModule",{value:!0});var FB=(A6(),zn(C6));FB.__exportStar(n9e(),I6);FB.__exportStar(i9e(),I6);FB.__exportStar(s9e(),I6);FB.__exportStar(HY(),I6)});var $B=X(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.getLocalStorage=Mi.getLocalStorageOrThrow=Mi.getCrypto=Mi.getCryptoOrThrow=Mi.getLocation=Mi.getLocationOrThrow=Mi.getNavigator=Mi.getNavigatorOrThrow=Mi.getDocument=Mi.getDocumentOrThrow=Mi.getFromWindowOrThrow=Mi.getFromWindow=void 0;function Cv(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}Mi.getFromWindow=Cv;function T6(t){let e=Cv(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}Mi.getFromWindowOrThrow=T6;function Yxt(){return T6("document")}Mi.getDocumentOrThrow=Yxt;function Jxt(){return Cv("document")}Mi.getDocument=Jxt;function Xxt(){return T6("navigator")}Mi.getNavigatorOrThrow=Xxt;function e8t(){return Cv("navigator")}Mi.getNavigator=e8t;function t8t(){return T6("location")}Mi.getLocationOrThrow=t8t;function r8t(){return Cv("location")}Mi.getLocation=r8t;function n8t(){return T6("crypto")}Mi.getCryptoOrThrow=n8t;function i8t(){return Cv("crypto")}Mi.getCrypto=i8t;function o8t(){return T6("localStorage")}Mi.getLocalStorageOrThrow=o8t;function s8t(){return Cv("localStorage")}Mi.getLocalStorage=s8t});var KY=X(qB=>{"use strict";Object.defineProperty(qB,"__esModule",{value:!0});qB.getWindowMetadata=void 0;var a9e=$B();function a8t(){let t,e;try{t=a9e.getDocumentOrThrow(),e=a9e.getLocationOrThrow()}catch{return null}function r(){let p=t.getElementsByTagName("link"),v=[];for(let y=0;y<p.length;y++){let S=p[y],R=S.getAttribute("rel");if(R&&R.toLowerCase().indexOf("icon")>-1){let O=S.getAttribute("href");if(O)if(O.toLowerCase().indexOf("https:")===-1&&O.toLowerCase().indexOf("http:")===-1&&O.indexOf("//")!==0){let k=e.protocol+"//"+e.host;if(O.indexOf("/")===0)k+=O;else{let M=e.pathname.split("/");M.pop();let D=M.join("/");k+=D+"/"+O}v.push(k)}else if(O.indexOf("//")===0){let k=e.protocol+O;v.push(k)}else v.push(O)}}return v}function n(...p){let v=t.getElementsByTagName("meta");for(let y=0;y<v.length;y++){let S=v[y],R=["itemprop","property","name"].map(O=>S.getAttribute(O)).filter(O=>O?p.includes(O):!1);if(R.length&&R){let O=S.getAttribute("content");if(O)return O}}return""}function i(){let p=n("name","og:site_name","og:title","twitter:title");return p||(p=t.title),p}function o(){return n("description","og:description","twitter:description","keywords")}let s=i(),a=o(),l=e.origin,u=r();return{description:a,url:l,icons:u,name:s}}qB.getWindowMetadata=a8t});var l9e=X((gEr,c9e)=>{"use strict";c9e.exports=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)});var p9e=X((wEr,d9e)=>{"use strict";var h9e="%[a-f0-9]{2}",u9e=new RegExp("("+h9e+")|([^%]+?)","gi"),f9e=new RegExp("("+h9e+")+","gi");function GY(t,e){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;e=e||1;var r=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],GY(r),GY(n))}function c8t(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(u9e)||[],r=1;r<e.length;r++)t=GY(e,r).join(""),e=t.match(u9e)||[];return t}}function l8t(t){for(var e={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},r=f9e.exec(t);r;){try{e[r[0]]=decodeURIComponent(r[0])}catch{var n=c8t(r[0]);n!==r[0]&&(e[r[0]]=n)}r=f9e.exec(t)}e["%C2"]="\uFFFD";for(var i=Object.keys(e),o=0;o<i.length;o++){var s=i[o];t=t.replace(new RegExp(s,"g"),e[s])}return t}d9e.exports=function(t){if(typeof t!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch{return l8t(t)}}});var g9e=X((vEr,m9e)=>{"use strict";m9e.exports=(t,e)=>{if(!(typeof t=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[t];let r=t.indexOf(e);return r===-1?[t]:[t.slice(0,r),t.slice(r+e.length)]}});var v9e=X((yEr,w9e)=>{"use strict";w9e.exports=function(t,e){for(var r={},n=Object.keys(t),i=Array.isArray(e),o=0;o<n.length;o++){var s=n[o],a=t[s];(i?e.indexOf(s)!==-1:e(s,a,t))&&(r[s]=a)}return r}});var ZY=X(ul=>{"use strict";var u8t=l9e(),f8t=p9e(),b9e=g9e(),h8t=v9e(),d8t=t=>t==null,QY=Symbol("encodeFragmentIdentifier");function p8t(t){switch(t.arrayFormat){case"index":return e=>(r,n)=>{let i=r.length;return n===void 0||t.skipNull&&n===null||t.skipEmptyString&&n===""?r:n===null?[...r,[Zo(e,t),"[",i,"]"].join("")]:[...r,[Zo(e,t),"[",Zo(i,t),"]=",Zo(n,t)].join("")]};case"bracket":return e=>(r,n)=>n===void 0||t.skipNull&&n===null||t.skipEmptyString&&n===""?r:n===null?[...r,[Zo(e,t),"[]"].join("")]:[...r,[Zo(e,t),"[]=",Zo(n,t)].join("")];case"colon-list-separator":return e=>(r,n)=>n===void 0||t.skipNull&&n===null||t.skipEmptyString&&n===""?r:n===null?[...r,[Zo(e,t),":list="].join("")]:[...r,[Zo(e,t),":list=",Zo(n,t)].join("")];case"comma":case"separator":case"bracket-separator":{let e=t.arrayFormat==="bracket-separator"?"[]=":"=";return r=>(n,i)=>i===void 0||t.skipNull&&i===null||t.skipEmptyString&&i===""?n:(i=i===null?"":i,n.length===0?[[Zo(r,t),e,Zo(i,t)].join("")]:[[n,Zo(i,t)].join(t.arrayFormatSeparator)])}default:return e=>(r,n)=>n===void 0||t.skipNull&&n===null||t.skipEmptyString&&n===""?r:n===null?[...r,Zo(e,t)]:[...r,[Zo(e,t),"=",Zo(n,t)].join("")]}}function m8t(t){let e;switch(t.arrayFormat){case"index":return(r,n,i)=>{if(e=/\[(\d*)\]$/.exec(r),r=r.replace(/\[\d*\]$/,""),!e){i[r]=n;return}i[r]===void 0&&(i[r]={}),i[r][e[1]]=n};case"bracket":return(r,n,i)=>{if(e=/(\[\])$/.exec(r),r=r.replace(/\[\]$/,""),!e){i[r]=n;return}if(i[r]===void 0){i[r]=[n];return}i[r]=[].concat(i[r],n)};case"colon-list-separator":return(r,n,i)=>{if(e=/(:list)$/.exec(r),r=r.replace(/:list$/,""),!e){i[r]=n;return}if(i[r]===void 0){i[r]=[n];return}i[r]=[].concat(i[r],n)};case"comma":case"separator":return(r,n,i)=>{let o=typeof n=="string"&&n.includes(t.arrayFormatSeparator),s=typeof n=="string"&&!o&&Im(n,t).includes(t.arrayFormatSeparator);n=s?Im(n,t):n;let a=o||s?n.split(t.arrayFormatSeparator).map(l=>Im(l,t)):n===null?n:Im(n,t);i[r]=a};case"bracket-separator":return(r,n,i)=>{let o=/(\[\])$/.test(r);if(r=r.replace(/\[\]$/,""),!o){i[r]=n&&Im(n,t);return}let s=n===null?[]:n.split(t.arrayFormatSeparator).map(a=>Im(a,t));if(i[r]===void 0){i[r]=s;return}i[r]=[].concat(i[r],s)};default:return(r,n,i)=>{if(i[r]===void 0){i[r]=n;return}i[r]=[].concat(i[r],n)}}}function x9e(t){if(typeof t!="string"||t.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function Zo(t,e){return e.encode?e.strict?u8t(t):encodeURIComponent(t):t}function Im(t,e){return e.decode?f8t(t):t}function E9e(t){return Array.isArray(t)?t.sort():typeof t=="object"?E9e(Object.keys(t)).sort((e,r)=>Number(e)-Number(r)).map(e=>t[e]):t}function C9e(t){let e=t.indexOf("#");return e!==-1&&(t=t.slice(0,e)),t}function g8t(t){let e="",r=t.indexOf("#");return r!==-1&&(e=t.slice(r)),e}function A9e(t){t=C9e(t);let e=t.indexOf("?");return e===-1?"":t.slice(e+1)}function y9e(t,e){return e.parseNumbers&&!Number.isNaN(Number(t))&&typeof t=="string"&&t.trim()!==""?t=Number(t):e.parseBooleans&&t!==null&&(t.toLowerCase()==="true"||t.toLowerCase()==="false")&&(t=t.toLowerCase()==="true"),t}function S9e(t,e){e=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},e),x9e(e.arrayFormatSeparator);let r=m8t(e),n=Object.create(null);if(typeof t!="string"||(t=t.trim().replace(/^[?#&]/,""),!t))return n;for(let i of t.split("&")){if(i==="")continue;let[o,s]=b9e(e.decode?i.replace(/\+/g," "):i,"=");s=s===void 0?null:["comma","separator","bracket-separator"].includes(e.arrayFormat)?s:Im(s,e),r(Im(o,e),s,n)}for(let i of Object.keys(n)){let o=n[i];if(typeof o=="object"&&o!==null)for(let s of Object.keys(o))o[s]=y9e(o[s],e);else n[i]=y9e(o,e)}return e.sort===!1?n:(e.sort===!0?Object.keys(n).sort():Object.keys(n).sort(e.sort)).reduce((i,o)=>{let s=n[o];return s&&typeof s=="object"&&!Array.isArray(s)?i[o]=E9e(s):i[o]=s,i},Object.create(null))}ul.extract=A9e;ul.parse=S9e;ul.stringify=(t,e)=>{if(!t)return"";e=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},e),x9e(e.arrayFormatSeparator);let r=s=>e.skipNull&&d8t(t[s])||e.skipEmptyString&&t[s]==="",n=p8t(e),i={};for(let s of Object.keys(t))r(s)||(i[s]=t[s]);let o=Object.keys(i);return e.sort!==!1&&o.sort(e.sort),o.map(s=>{let a=t[s];return a===void 0?"":a===null?Zo(s,e):Array.isArray(a)?a.length===0&&e.arrayFormat==="bracket-separator"?Zo(s,e)+"[]":a.reduce(n(s),[]).join("&"):Zo(s,e)+"="+Zo(a,e)}).filter(s=>s.length>0).join("&")};ul.parseUrl=(t,e)=>{e=Object.assign({decode:!0},e);let[r,n]=b9e(t,"#");return Object.assign({url:r.split("?")[0]||"",query:S9e(A9e(t),e)},e&&e.parseFragmentIdentifier&&n?{fragmentIdentifier:Im(n,e)}:{})};ul.stringifyUrl=(t,e)=>{e=Object.assign({encode:!0,strict:!0,[QY]:!0},e);let r=C9e(t.url).split("?")[0]||"",n=ul.extract(t.url),i=ul.parse(n,{sort:!1}),o=Object.assign(i,t.query),s=ul.stringify(o,e);s&&(s=`?${s}`);let a=g8t(t.url);return t.fragmentIdentifier&&(a=`#${e[QY]?Zo(t.fragmentIdentifier,e):t.fragmentIdentifier}`),`${r}${s}${a}`};ul.pick=(t,e,r)=>{r=Object.assign({parseFragmentIdentifier:!0,[QY]:!1},r);let{url:n,query:i,fragmentIdentifier:o}=ul.parseUrl(t,r);return ul.stringifyUrl({url:n,query:h8t(i,e),fragmentIdentifier:o},r)};ul.exclude=(t,e,r)=>{let n=Array.isArray(e)?i=>!e.includes(i):(i,o)=>!e(i,o);return ul.pick(t,n,r)}});var _9e=X(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});function w8t(t,e){var r=t>>>16&65535,n=t&65535,i=e>>>16&65535,o=e&65535;return n*o+(r*o+n*i<<16>>>0)|0}Xl.mul=Math.imul||w8t;function v8t(t,e){return t+e|0}Xl.add=v8t;function y8t(t,e){return t-e|0}Xl.sub=y8t;function b8t(t,e){return t<<e|t>>>32-e}Xl.rotl=b8t;function x8t(t,e){return t<<32-e|t>>>e}Xl.rotr=x8t;function E8t(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t}Xl.isInteger=Number.isInteger||E8t;Xl.MAX_SAFE_INTEGER=9007199254740991;Xl.isSafeInteger=function(t){return Xl.isInteger(t)&&t>=-Xl.MAX_SAFE_INTEGER&&t<=Xl.MAX_SAFE_INTEGER}});var mC=X(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});var I9e=_9e();function C8t(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}yn.readInt16BE=C8t;function A8t(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}yn.readUint16BE=A8t;function S8t(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}yn.readInt16LE=S8t;function _8t(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}yn.readUint16LE=_8t;function T9e(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}yn.writeUint16BE=T9e;yn.writeInt16BE=T9e;function k9e(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}yn.writeUint16LE=k9e;yn.writeInt16LE=k9e;function YY(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}yn.readInt32BE=YY;function JY(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}yn.readUint32BE=JY;function XY(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}yn.readInt32LE=XY;function eJ(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}yn.readUint32LE=eJ;function HB(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}yn.writeUint32BE=HB;yn.writeInt32BE=HB;function zB(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}yn.writeUint32LE=zB;yn.writeInt32LE=zB;function I8t(t,e){e===void 0&&(e=0);var r=YY(t,e),n=YY(t,e+4);return r*4294967296+n-(n>>31)*4294967296}yn.readInt64BE=I8t;function T8t(t,e){e===void 0&&(e=0);var r=JY(t,e),n=JY(t,e+4);return r*4294967296+n}yn.readUint64BE=T8t;function k8t(t,e){e===void 0&&(e=0);var r=XY(t,e),n=XY(t,e+4);return n*4294967296+r-(r>>31)*4294967296}yn.readInt64LE=k8t;function R8t(t,e){e===void 0&&(e=0);var r=eJ(t,e),n=eJ(t,e+4);return n*4294967296+r}yn.readUint64LE=R8t;function R9e(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),HB(t/4294967296>>>0,e,r),HB(t>>>0,e,r+4),e}yn.writeUint64BE=R9e;yn.writeInt64BE=R9e;function M9e(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),zB(t>>>0,e,r),zB(t/4294967296>>>0,e,r+4),e}yn.writeUint64LE=M9e;yn.writeInt64LE=M9e;function M8t(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,o=t/8+r-1;o>=r;o--)n+=e[o]*i,i*=256;return n}yn.readUintBE=M8t;function N8t(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,o=r;o<r+t/8;o++)n+=e[o]*i,i*=256;return n}yn.readUintLE=N8t;function O8t(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!I9e.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var i=1,o=t/8+n-1;o>=n;o--)r[o]=e/i&255,i*=256;return r}yn.writeUintBE=O8t;function P8t(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!I9e.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,o=n;o<n+t/8;o++)r[o]=e/i&255,i*=256;return r}yn.writeUintLE=P8t;function B8t(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}yn.readFloat32BE=B8t;function D8t(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}yn.readFloat32LE=D8t;function L8t(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}yn.readFloat64BE=L8t;function U8t(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}yn.readFloat64LE=U8t;function j8t(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t),e}yn.writeFloat32BE=j8t;function F8t(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t,!0),e}yn.writeFloat32LE=F8t;function $8t(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t),e}yn.writeFloat64BE=$8t;function q8t(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t,!0),e}yn.writeFloat64LE=q8t});var l0=X(tJ=>{"use strict";Object.defineProperty(tJ,"__esModule",{value:!0});function H8t(t){for(var e=0;e<t.length;e++)t[e]=0;return t}tJ.wipe=H8t});var O9e=X(WB=>{"use strict";Object.defineProperty(WB,"__esModule",{value:!0});var qa=mC(),rJ=l0(),z8t=20;function W8t(t,e,r){for(var n=1634760805,i=857760878,o=2036477234,s=1797285236,a=r[3]<<24|r[2]<<16|r[1]<<8|r[0],l=r[7]<<24|r[6]<<16|r[5]<<8|r[4],u=r[11]<<24|r[10]<<16|r[9]<<8|r[8],d=r[15]<<24|r[14]<<16|r[13]<<8|r[12],p=r[19]<<24|r[18]<<16|r[17]<<8|r[16],v=r[23]<<24|r[22]<<16|r[21]<<8|r[20],y=r[27]<<24|r[26]<<16|r[25]<<8|r[24],S=r[31]<<24|r[30]<<16|r[29]<<8|r[28],R=e[3]<<24|e[2]<<16|e[1]<<8|e[0],O=e[7]<<24|e[6]<<16|e[5]<<8|e[4],k=e[11]<<24|e[10]<<16|e[9]<<8|e[8],M=e[15]<<24|e[14]<<16|e[13]<<8|e[12],D=n,j=i,q=o,W=s,V=a,P=l,$=u,U=d,L=p,z=v,f=y,h=S,m=R,b=O,C=k,T=M,N=0;N<z8t;N+=2)D=D+V|0,m^=D,m=m>>>16|m<<16,L=L+m|0,V^=L,V=V>>>20|V<<12,j=j+P|0,b^=j,b=b>>>16|b<<16,z=z+b|0,P^=z,P=P>>>20|P<<12,q=q+$|0,C^=q,C=C>>>16|C<<16,f=f+C|0,$^=f,$=$>>>20|$<<12,W=W+U|0,T^=W,T=T>>>16|T<<16,h=h+T|0,U^=h,U=U>>>20|U<<12,q=q+$|0,C^=q,C=C>>>24|C<<8,f=f+C|0,$^=f,$=$>>>25|$<<7,W=W+U|0,T^=W,T=T>>>24|T<<8,h=h+T|0,U^=h,U=U>>>25|U<<7,j=j+P|0,b^=j,b=b>>>24|b<<8,z=z+b|0,P^=z,P=P>>>25|P<<7,D=D+V|0,m^=D,m=m>>>24|m<<8,L=L+m|0,V^=L,V=V>>>25|V<<7,D=D+P|0,T^=D,T=T>>>16|T<<16,f=f+T|0,P^=f,P=P>>>20|P<<12,j=j+$|0,m^=j,m=m>>>16|m<<16,h=h+m|0,$^=h,$=$>>>20|$<<12,q=q+U|0,b^=q,b=b>>>16|b<<16,L=L+b|0,U^=L,U=U>>>20|U<<12,W=W+V|0,C^=W,C=C>>>16|C<<16,z=z+C|0,V^=z,V=V>>>20|V<<12,q=q+U|0,b^=q,b=b>>>24|b<<8,L=L+b|0,U^=L,U=U>>>25|U<<7,W=W+V|0,C^=W,C=C>>>24|C<<8,z=z+C|0,V^=z,V=V>>>25|V<<7,j=j+$|0,m^=j,m=m>>>24|m<<8,h=h+m|0,$^=h,$=$>>>25|$<<7,D=D+P|0,T^=D,T=T>>>24|T<<8,f=f+T|0,P^=f,P=P>>>25|P<<7;qa.writeUint32LE(D+n|0,t,0),qa.writeUint32LE(j+i|0,t,4),qa.writeUint32LE(q+o|0,t,8),qa.writeUint32LE(W+s|0,t,12),qa.writeUint32LE(V+a|0,t,16),qa.writeUint32LE(P+l|0,t,20),qa.writeUint32LE($+u|0,t,24),qa.writeUint32LE(U+d|0,t,28),qa.writeUint32LE(L+p|0,t,32),qa.writeUint32LE(z+v|0,t,36),qa.writeUint32LE(f+y|0,t,40),qa.writeUint32LE(h+S|0,t,44),qa.writeUint32LE(m+R|0,t,48),qa.writeUint32LE(b+O|0,t,52),qa.writeUint32LE(C+k|0,t,56),qa.writeUint32LE(T+M|0,t,60)}function N9e(t,e,r,n,i){if(i===void 0&&(i=0),t.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length<r.length)throw new Error("ChaCha: destination is shorter than source");var o,s;if(i===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");o=new Uint8Array(16),s=o.length-e.length,o.set(e,s)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");o=e,s=i}for(var a=new Uint8Array(64),l=0;l<r.length;l+=64){W8t(a,o,t);for(var u=l;u<l+64&&u<r.length;u++)n[u]=r[u]^a[u-l];K8t(o,0,s)}return rJ.wipe(a),i===0&&rJ.wipe(o),n}WB.streamXOR=N9e;function V8t(t,e,r,n){return n===void 0&&(n=0),rJ.wipe(r),N9e(t,e,r,r,n)}WB.stream=V8t;function K8t(t,e,r){for(var n=1;r--;)n=n+(t[e]&255)|0,t[e]=n&255,n>>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}});var VB=X(k6=>{"use strict";Object.defineProperty(k6,"__esModule",{value:!0});function G8t(t,e,r){return~(t-1)&e|t-1&r}k6.select=G8t;function Q8t(t,e){return(t|0)-(e|0)-1>>>31&1}k6.lessOrEqual=Q8t;function P9e(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n<t.length;n++)r|=t[n]^e[n];return 1&r-1>>>8}k6.compare=P9e;function Z8t(t,e){return t.length===0||e.length===0?!1:P9e(t,e)!==0}k6.equal=Z8t});var D9e=X(Tm=>{"use strict";Object.defineProperty(Tm,"__esModule",{value:!0});var Y8t=VB(),KB=l0();Tm.DIGEST_LENGTH=16;var B9e=function(){function t(e){this.digestLength=Tm.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var r=e[0]|e[1]<<8;this._r[0]=r&8191;var n=e[2]|e[3]<<8;this._r[1]=(r>>>13|n<<3)&8191;var i=e[4]|e[5]<<8;this._r[2]=(n>>>10|i<<6)&7939;var o=e[6]|e[7]<<8;this._r[3]=(i>>>7|o<<9)&8191;var s=e[8]|e[9]<<8;this._r[4]=(o>>>4|s<<12)&255,this._r[5]=s>>>1&8190;var a=e[10]|e[11]<<8;this._r[6]=(s>>>14|a<<2)&8191;var l=e[12]|e[13]<<8;this._r[7]=(a>>>11|l<<5)&8065;var u=e[14]|e[15]<<8;this._r[8]=(l>>>8|u<<8)&8191,this._r[9]=u>>>5&127,this._pad[0]=e[16]|e[17]<<8,this._pad[1]=e[18]|e[19]<<8,this._pad[2]=e[20]|e[21]<<8,this._pad[3]=e[22]|e[23]<<8,this._pad[4]=e[24]|e[25]<<8,this._pad[5]=e[26]|e[27]<<8,this._pad[6]=e[28]|e[29]<<8,this._pad[7]=e[30]|e[31]<<8}return t.prototype._blocks=function(e,r,n){for(var i=this._fin?0:2048,o=this._h[0],s=this._h[1],a=this._h[2],l=this._h[3],u=this._h[4],d=this._h[5],p=this._h[6],v=this._h[7],y=this._h[8],S=this._h[9],R=this._r[0],O=this._r[1],k=this._r[2],M=this._r[3],D=this._r[4],j=this._r[5],q=this._r[6],W=this._r[7],V=this._r[8],P=this._r[9];n>=16;){var $=e[r+0]|e[r+1]<<8;o+=$&8191;var U=e[r+2]|e[r+3]<<8;s+=($>>>13|U<<3)&8191;var L=e[r+4]|e[r+5]<<8;a+=(U>>>10|L<<6)&8191;var z=e[r+6]|e[r+7]<<8;l+=(L>>>7|z<<9)&8191;var f=e[r+8]|e[r+9]<<8;u+=(z>>>4|f<<12)&8191,d+=f>>>1&8191;var h=e[r+10]|e[r+11]<<8;p+=(f>>>14|h<<2)&8191;var m=e[r+12]|e[r+13]<<8;v+=(h>>>11|m<<5)&8191;var b=e[r+14]|e[r+15]<<8;y+=(m>>>8|b<<8)&8191,S+=b>>>5|i;var C=0,T=C;T+=o*R,T+=s*(5*P),T+=a*(5*V),T+=l*(5*W),T+=u*(5*q),C=T>>>13,T&=8191,T+=d*(5*j),T+=p*(5*D),T+=v*(5*M),T+=y*(5*k),T+=S*(5*O),C+=T>>>13,T&=8191;var N=C;N+=o*O,N+=s*R,N+=a*(5*P),N+=l*(5*V),N+=u*(5*W),C=N>>>13,N&=8191,N+=d*(5*q),N+=p*(5*j),N+=v*(5*D),N+=y*(5*M),N+=S*(5*k),C+=N>>>13,N&=8191;var I=C;I+=o*k,I+=s*O,I+=a*R,I+=l*(5*P),I+=u*(5*V),C=I>>>13,I&=8191,I+=d*(5*W),I+=p*(5*q),I+=v*(5*j),I+=y*(5*D),I+=S*(5*M),C+=I>>>13,I&=8191;var g=C;g+=o*M,g+=s*k,g+=a*O,g+=l*R,g+=u*(5*P),C=g>>>13,g&=8191,g+=d*(5*V),g+=p*(5*W),g+=v*(5*q),g+=y*(5*j),g+=S*(5*D),C+=g>>>13,g&=8191;var x=C;x+=o*D,x+=s*M,x+=a*k,x+=l*O,x+=u*R,C=x>>>13,x&=8191,x+=d*(5*P),x+=p*(5*V),x+=v*(5*W),x+=y*(5*q),x+=S*(5*j),C+=x>>>13,x&=8191;var Q=C;Q+=o*j,Q+=s*D,Q+=a*M,Q+=l*k,Q+=u*O,C=Q>>>13,Q&=8191,Q+=d*R,Q+=p*(5*P),Q+=v*(5*V),Q+=y*(5*W),Q+=S*(5*q),C+=Q>>>13,Q&=8191;var re=C;re+=o*q,re+=s*j,re+=a*D,re+=l*M,re+=u*k,C=re>>>13,re&=8191,re+=d*O,re+=p*R,re+=v*(5*P),re+=y*(5*V),re+=S*(5*W),C+=re>>>13,re&=8191;var A=C;A+=o*W,A+=s*q,A+=a*j,A+=l*D,A+=u*M,C=A>>>13,A&=8191,A+=d*k,A+=p*O,A+=v*R,A+=y*(5*P),A+=S*(5*V),C+=A>>>13,A&=8191;var G=C;G+=o*V,G+=s*W,G+=a*q,G+=l*j,G+=u*D,C=G>>>13,G&=8191,G+=d*M,G+=p*k,G+=v*O,G+=y*R,G+=S*(5*P),C+=G>>>13,G&=8191;var Z=C;Z+=o*P,Z+=s*V,Z+=a*W,Z+=l*q,Z+=u*j,C=Z>>>13,Z&=8191,Z+=d*D,Z+=p*M,Z+=v*k,Z+=y*O,Z+=S*R,C+=Z>>>13,Z&=8191,C=(C<<2)+C|0,C=C+T|0,T=C&8191,C=C>>>13,N+=C,o=T,s=N,a=I,l=g,u=x,d=Q,p=re,v=A,y=G,S=Z,r+=16,n-=16}this._h[0]=o,this._h[1]=s,this._h[2]=a,this._h[3]=l,this._h[4]=u,this._h[5]=d,this._h[6]=p,this._h[7]=v,this._h[8]=y,this._h[9]=S},t.prototype.finish=function(e,r){r===void 0&&(r=0);var n=new Uint16Array(10),i,o,s,a;if(this._leftover){for(a=this._leftover,this._buffer[a++]=1;a<16;a++)this._buffer[a]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(i=this._h[1]>>>13,this._h[1]&=8191,a=2;a<10;a++)this._h[a]+=i,i=this._h[a]>>>13,this._h[a]&=8191;for(this._h[0]+=i*5,i=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=i,i=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=i,n[0]=this._h[0]+5,i=n[0]>>>13,n[0]&=8191,a=1;a<10;a++)n[a]=this._h[a]+i,i=n[a]>>>13,n[a]&=8191;for(n[9]-=8192,o=(i^1)-1,a=0;a<10;a++)n[a]&=o;for(o=~o,a=0;a<10;a++)this._h[a]=this._h[a]&o|n[a];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,s=this._h[0]+this._pad[0],this._h[0]=s&65535,a=1;a<8;a++)s=(this._h[a]+this._pad[a]|0)+(s>>>16)|0,this._h[a]=s&65535;return e[r+0]=this._h[0]>>>0,e[r+1]=this._h[0]>>>8,e[r+2]=this._h[1]>>>0,e[r+3]=this._h[1]>>>8,e[r+4]=this._h[2]>>>0,e[r+5]=this._h[2]>>>8,e[r+6]=this._h[3]>>>0,e[r+7]=this._h[3]>>>8,e[r+8]=this._h[4]>>>0,e[r+9]=this._h[4]>>>8,e[r+10]=this._h[5]>>>0,e[r+11]=this._h[5]>>>8,e[r+12]=this._h[6]>>>0,e[r+13]=this._h[6]>>>8,e[r+14]=this._h[7]>>>0,e[r+15]=this._h[7]>>>8,this._finished=!0,this},t.prototype.update=function(e){var r=0,n=e.length,i;if(this._leftover){i=16-this._leftover,i>n&&(i=n);for(var o=0;o<i;o++)this._buffer[this._leftover+o]=e[r+o];if(n-=i,r+=i,this._leftover+=i,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(n>=16&&(i=n-n%16,this._blocks(e,r,i),r+=i,n-=i),n){for(var o=0;o<n;o++)this._buffer[this._leftover+o]=e[r+o];this._leftover+=n}return this},t.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var e=new Uint8Array(16);return this.finish(e),e},t.prototype.clean=function(){return KB.wipe(this._buffer),KB.wipe(this._r),KB.wipe(this._h),KB.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},t}();Tm.Poly1305=B9e;function J8t(t,e){var r=new B9e(t);r.update(e);var n=r.digest();return r.clean(),n}Tm.oneTimeAuth=J8t;function X8t(t,e){return t.length!==Tm.DIGEST_LENGTH||e.length!==Tm.DIGEST_LENGTH?!1:Y8t.equal(t,e)}Tm.equal=X8t});var nJ=X(km=>{"use strict";Object.defineProperty(km,"__esModule",{value:!0});var GB=O9e(),e7t=D9e(),gC=l0(),L9e=mC(),t7t=VB();km.KEY_LENGTH=32;km.NONCE_LENGTH=12;km.TAG_LENGTH=16;var U9e=new Uint8Array(16),r7t=function(){function t(e){if(this.nonceLength=km.NONCE_LENGTH,this.tagLength=km.TAG_LENGTH,e.length!==km.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(e)}return t.prototype.seal=function(e,r,n,i){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var o=new Uint8Array(16);o.set(e,o.length-e.length);var s=new Uint8Array(32);GB.stream(this._key,o,s,4);var a=r.length+this.tagLength,l;if(i){if(i.length!==a)throw new Error("ChaCha20Poly1305: incorrect destination length");l=i}else l=new Uint8Array(a);return GB.streamXOR(this._key,o,r,l,4),this._authenticate(l.subarray(l.length-this.tagLength,l.length),s,l.subarray(0,l.length-this.tagLength),n),gC.wipe(o),l},t.prototype.open=function(e,r,n,i){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(r.length<this.tagLength)return null;var o=new Uint8Array(16);o.set(e,o.length-e.length);var s=new Uint8Array(32);GB.stream(this._key,o,s,4);var a=new Uint8Array(this.tagLength);if(this._authenticate(a,s,r.subarray(0,r.length-this.tagLength),n),!t7t.equal(a,r.subarray(r.length-this.tagLength,r.length)))return null;var l=r.length-this.tagLength,u;if(i){if(i.length!==l)throw new Error("ChaCha20Poly1305: incorrect destination length");u=i}else u=new Uint8Array(l);return GB.streamXOR(this._key,o,r.subarray(0,r.length-this.tagLength),u,4),gC.wipe(o),u},t.prototype.clean=function(){return gC.wipe(this._key),this},t.prototype._authenticate=function(e,r,n,i){var o=new e7t.Poly1305(r);i&&(o.update(i),i.length%16>0&&o.update(U9e.subarray(i.length%16))),o.update(n),n.length%16>0&&o.update(U9e.subarray(n.length%16));var s=new Uint8Array(8);i&&L9e.writeUint64LE(i.length,s),o.update(s),L9e.writeUint64LE(n.length,s),o.update(s);for(var a=o.digest(),l=0;l<a.length;l++)e[l]=a[l];o.clean(),gC.wipe(a),gC.wipe(s)},t}();km.ChaCha20Poly1305=r7t});var j9e=X(iJ=>{"use strict";Object.defineProperty(iJ,"__esModule",{value:!0});function n7t(t){return typeof t.saveState<"u"&&typeof t.restoreState<"u"&&typeof t.cleanSavedState<"u"}iJ.isSerializableHash=n7t});var $9e=X(wC=>{"use strict";Object.defineProperty(wC,"__esModule",{value:!0});var u0=j9e(),i7t=VB(),o7t=l0(),F9e=function(){function t(e,r){this._finished=!1,this._inner=new e,this._outer=new e,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var n=new Uint8Array(this.blockSize);r.length>this.blockSize?this._inner.update(r).finish(n).clean():n.set(r);for(var i=0;i<n.length;i++)n[i]^=54;this._inner.update(n);for(var i=0;i<n.length;i++)n[i]^=106;this._outer.update(n),u0.isSerializableHash(this._inner)&&u0.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),o7t.wipe(n)}return t.prototype.reset=function(){if(!u0.isSerializableHash(this._inner)||!u0.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.clean=function(){u0.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),u0.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},t.prototype.update=function(e){return this._inner.update(e),this},t.prototype.finish=function(e){return this._finished?(this._outer.finish(e),this):(this._inner.finish(e),this._outer.update(e.subarray(0,this.digestLength)).finish(e),this._finished=!0,this)},t.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},t.prototype.saveState=function(){if(!u0.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},t.prototype.restoreState=function(e){if(!u0.isSerializableHash(this._inner)||!u0.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(e),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.cleanSavedState=function(e){if(!u0.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},t}();wC.HMAC=F9e;function s7t(t,e,r){var n=new F9e(t,e);n.update(r);var i=n.digest();return n.clean(),i}wC.hmac=s7t;wC.equal=i7t.equal});var sJ=X(oJ=>{"use strict";Object.defineProperty(oJ,"__esModule",{value:!0});var q9e=$9e(),H9e=l0(),a7t=function(){function t(e,r,n,i){n===void 0&&(n=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=i;var o=q9e.hmac(this._hash,n,r);this._hmac=new q9e.HMAC(e,o),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return t.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(e===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),e>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},t.prototype.expand=function(e){for(var r=new Uint8Array(e),n=0;n<r.length;n++)this._bufpos===this._buffer.length&&this._fillBuffer(),r[n]=this._buffer[this._bufpos++];return r},t.prototype.clean=function(){this._hmac.clean(),H9e.wipe(this._buffer),H9e.wipe(this._counter),this._bufpos=0},t}();oJ.HKDF=a7t});var W9e=X(QB=>{"use strict";Object.defineProperty(QB,"__esModule",{value:!0});QB.BrowserRandomSource=void 0;var z9e=65536,aJ=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;let e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");let r=new Uint8Array(e);for(let n=0;n<r.length;n+=z9e)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,z9e)));return r}};QB.BrowserRandomSource=aJ});var V9e=X(ZB=>{"use strict";Object.defineProperty(ZB,"__esModule",{value:!0});ZB.NodeRandomSource=void 0;var c7t=l0(),cJ=class{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof s5<"u"){let e=fM();e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let r=this._crypto.randomBytes(e);if(r.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");let n=new Uint8Array(e);for(let i=0;i<n.length;i++)n[i]=r[i];return(0,c7t.wipe)(r),n}};ZB.NodeRandomSource=cJ});var K9e=X(YB=>{"use strict";Object.defineProperty(YB,"__esModule",{value:!0});YB.SystemRandomSource=void 0;var l7t=W9e(),u7t=V9e(),lJ=class{constructor(){if(this.isAvailable=!1,this.name="",this._source=new l7t.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new u7t.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}};YB.SystemRandomSource=lJ});var JB=X(Ha=>{"use strict";Object.defineProperty(Ha,"__esModule",{value:!0});Ha.randomStringForEntropy=Ha.randomString=Ha.randomUint32=Ha.randomBytes=Ha.defaultRandomSource=void 0;var f7t=K9e(),h7t=mC(),G9e=l0();Ha.defaultRandomSource=new f7t.SystemRandomSource;function uJ(t,e=Ha.defaultRandomSource){return e.randomBytes(t)}Ha.randomBytes=uJ;function d7t(t=Ha.defaultRandomSource){let e=uJ(4,t),r=(0,h7t.readUint32LE)(e);return(0,G9e.wipe)(e),r}Ha.randomUint32=d7t;var Q9e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function Z9e(t,e=Q9e,r=Ha.defaultRandomSource){if(e.length<2)throw new Error("randomString charset is too short");if(e.length>256)throw new Error("randomString charset is too long");let n="",i=e.length,o=256-256%i;for(;t>0;){let s=uJ(Math.ceil(t*256/o),r);for(let a=0;a<s.length&&t>0;a++){let l=s[a];l<o&&(n+=e.charAt(l%i),t--)}(0,G9e.wipe)(s)}return n}Ha.randomString=Z9e;function p7t(t,e=Q9e,r=Ha.defaultRandomSource){let n=Math.ceil(t/(Math.log(e.length)/Math.LN2));return Z9e(n,e,r)}Ha.randomStringForEntropy=p7t});var hJ=X(c2=>{"use strict";Object.defineProperty(c2,"__esModule",{value:!0});var eD=mC(),XB=l0();c2.DIGEST_LENGTH=32;c2.BLOCK_SIZE=64;var Y9e=function(){function t(){this.digestLength=c2.DIGEST_LENGTH,this.blockSize=c2.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return t.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},t.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},t.prototype.clean=function(){XB.wipe(this._buffer),XB.wipe(this._temp),this.reset()},t.prototype.update=function(e,r){if(r===void 0&&(r=e.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var n=0;if(this._bytesHashed+=r,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&r>0;)this._buffer[this._bufferLength++]=e[n++],r--;this._bufferLength===this.blockSize&&(fJ(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(r>=this.blockSize&&(n=fJ(this._temp,this._state,e,n,r),r%=this.blockSize);r>0;)this._buffer[this._bufferLength++]=e[n++],r--;return this},t.prototype.finish=function(e){if(!this._finished){var r=this._bytesHashed,n=this._bufferLength,i=r/536870912|0,o=r<<3,s=r%64<56?64:128;this._buffer[n]=128;for(var a=n+1;a<s-8;a++)this._buffer[a]=0;eD.writeUint32BE(i,this._buffer,s-8),eD.writeUint32BE(o,this._buffer,s-4),fJ(this._temp,this._state,this._buffer,0,s),this._finished=!0}for(var a=0;a<this.digestLength/4;a++)eD.writeUint32BE(this._state[a],e,a*4);return this},t.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},t.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},t.prototype.restoreState=function(e){return this._state.set(e.state),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},t.prototype.cleanSavedState=function(e){XB.wipe(e.state),e.buffer&&XB.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},t}();c2.SHA256=Y9e;var m7t=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function fJ(t,e,r,n,i){for(;i>=64;){for(var o=e[0],s=e[1],a=e[2],l=e[3],u=e[4],d=e[5],p=e[6],v=e[7],y=0;y<16;y++){var S=n+y*4;t[y]=eD.readUint32BE(r,S)}for(var y=16;y<64;y++){var R=t[y-2],O=(R>>>17|R<<15)^(R>>>19|R<<13)^R>>>10;R=t[y-15];var k=(R>>>7|R<<25)^(R>>>18|R<<14)^R>>>3;t[y]=(O+t[y-7]|0)+(k+t[y-16]|0)}for(var y=0;y<64;y++){var O=(((u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))+(u&d^~u&p)|0)+(v+(m7t[y]+t[y]|0)|0)|0,k=((o>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10))+(o&s^o&a^s&a)|0;v=p,p=d,d=u,u=l+O|0,l=a,a=s,s=o,o=O+k|0}e[0]+=o,e[1]+=s,e[2]+=a,e[3]+=l,e[4]+=u,e[5]+=d,e[6]+=p,e[7]+=v,n+=64,i-=64}return n}function g7t(t){var e=new Y9e;e.update(t);var r=e.digest();return e.clean(),r}c2.hash=g7t});var mJ=X(Mo=>{"use strict";Object.defineProperty(Mo,"__esModule",{value:!0});Mo.sharedKey=Mo.generateKeyPair=Mo.generateKeyPairFromSeed=Mo.scalarMultBase=Mo.scalarMult=Mo.SHARED_KEY_LENGTH=Mo.SECRET_KEY_LENGTH=Mo.PUBLIC_KEY_LENGTH=void 0;var w7t=JB(),v7t=l0();Mo.PUBLIC_KEY_LENGTH=32;Mo.SECRET_KEY_LENGTH=32;Mo.SHARED_KEY_LENGTH=32;function f0(t){let e=new Float64Array(16);if(t)for(let r=0;r<t.length;r++)e[r]=t[r];return e}var J9e=new Uint8Array(32);J9e[0]=9;var y7t=f0([56129,1]);function dJ(t){let e=1;for(let r=0;r<16;r++){let n=t[r]+e+65535;e=Math.floor(n/65536),t[r]=n-e*65536}t[0]+=e-1+37*(e-1)}function vC(t,e,r){let n=~(r-1);for(let i=0;i<16;i++){let o=n&(t[i]^e[i]);t[i]^=o,e[i]^=o}}function b7t(t,e){let r=f0(),n=f0();for(let i=0;i<16;i++)n[i]=e[i];dJ(n),dJ(n),dJ(n);for(let i=0;i<2;i++){r[0]=n[0]-65517;for(let s=1;s<15;s++)r[s]=n[s]-65535-(r[s-1]>>16&1),r[s-1]&=65535;r[15]=n[15]-32767-(r[14]>>16&1);let o=r[15]>>16&1;r[14]&=65535,vC(n,r,1-o)}for(let i=0;i<16;i++)t[2*i]=n[i]&255,t[2*i+1]=n[i]>>8}function x7t(t,e){for(let r=0;r<16;r++)t[r]=e[2*r]+(e[2*r+1]<<8);t[15]&=32767}function tD(t,e,r){for(let n=0;n<16;n++)t[n]=e[n]+r[n]}function rD(t,e,r){for(let n=0;n<16;n++)t[n]=e[n]-r[n]}function Rm(t,e,r){let n,i,o=0,s=0,a=0,l=0,u=0,d=0,p=0,v=0,y=0,S=0,R=0,O=0,k=0,M=0,D=0,j=0,q=0,W=0,V=0,P=0,$=0,U=0,L=0,z=0,f=0,h=0,m=0,b=0,C=0,T=0,N=0,I=r[0],g=r[1],x=r[2],Q=r[3],re=r[4],A=r[5],G=r[6],Z=r[7],Y=r[8],ue=r[9],fe=r[10],ae=r[11],me=r[12],Ce=r[13],le=r[14],Se=r[15];n=e[0],o+=n*I,s+=n*g,a+=n*x,l+=n*Q,u+=n*re,d+=n*A,p+=n*G,v+=n*Z,y+=n*Y,S+=n*ue,R+=n*fe,O+=n*ae,k+=n*me,M+=n*Ce,D+=n*le,j+=n*Se,n=e[1],s+=n*I,a+=n*g,l+=n*x,u+=n*Q,d+=n*re,p+=n*A,v+=n*G,y+=n*Z,S+=n*Y,R+=n*ue,O+=n*fe,k+=n*ae,M+=n*me,D+=n*Ce,j+=n*le,q+=n*Se,n=e[2],a+=n*I,l+=n*g,u+=n*x,d+=n*Q,p+=n*re,v+=n*A,y+=n*G,S+=n*Z,R+=n*Y,O+=n*ue,k+=n*fe,M+=n*ae,D+=n*me,j+=n*Ce,q+=n*le,W+=n*Se,n=e[3],l+=n*I,u+=n*g,d+=n*x,p+=n*Q,v+=n*re,y+=n*A,S+=n*G,R+=n*Z,O+=n*Y,k+=n*ue,M+=n*fe,D+=n*ae,j+=n*me,q+=n*Ce,W+=n*le,V+=n*Se,n=e[4],u+=n*I,d+=n*g,p+=n*x,v+=n*Q,y+=n*re,S+=n*A,R+=n*G,O+=n*Z,k+=n*Y,M+=n*ue,D+=n*fe,j+=n*ae,q+=n*me,W+=n*Ce,V+=n*le,P+=n*Se,n=e[5],d+=n*I,p+=n*g,v+=n*x,y+=n*Q,S+=n*re,R+=n*A,O+=n*G,k+=n*Z,M+=n*Y,D+=n*ue,j+=n*fe,q+=n*ae,W+=n*me,V+=n*Ce,P+=n*le,$+=n*Se,n=e[6],p+=n*I,v+=n*g,y+=n*x,S+=n*Q,R+=n*re,O+=n*A,k+=n*G,M+=n*Z,D+=n*Y,j+=n*ue,q+=n*fe,W+=n*ae,V+=n*me,P+=n*Ce,$+=n*le,U+=n*Se,n=e[7],v+=n*I,y+=n*g,S+=n*x,R+=n*Q,O+=n*re,k+=n*A,M+=n*G,D+=n*Z,j+=n*Y,q+=n*ue,W+=n*fe,V+=n*ae,P+=n*me,$+=n*Ce,U+=n*le,L+=n*Se,n=e[8],y+=n*I,S+=n*g,R+=n*x,O+=n*Q,k+=n*re,M+=n*A,D+=n*G,j+=n*Z,q+=n*Y,W+=n*ue,V+=n*fe,P+=n*ae,$+=n*me,U+=n*Ce,L+=n*le,z+=n*Se,n=e[9],S+=n*I,R+=n*g,O+=n*x,k+=n*Q,M+=n*re,D+=n*A,j+=n*G,q+=n*Z,W+=n*Y,V+=n*ue,P+=n*fe,$+=n*ae,U+=n*me,L+=n*Ce,z+=n*le,f+=n*Se,n=e[10],R+=n*I,O+=n*g,k+=n*x,M+=n*Q,D+=n*re,j+=n*A,q+=n*G,W+=n*Z,V+=n*Y,P+=n*ue,$+=n*fe,U+=n*ae,L+=n*me,z+=n*Ce,f+=n*le,h+=n*Se,n=e[11],O+=n*I,k+=n*g,M+=n*x,D+=n*Q,j+=n*re,q+=n*A,W+=n*G,V+=n*Z,P+=n*Y,$+=n*ue,U+=n*fe,L+=n*ae,z+=n*me,f+=n*Ce,h+=n*le,m+=n*Se,n=e[12],k+=n*I,M+=n*g,D+=n*x,j+=n*Q,q+=n*re,W+=n*A,V+=n*G,P+=n*Z,$+=n*Y,U+=n*ue,L+=n*fe,z+=n*ae,f+=n*me,h+=n*Ce,m+=n*le,b+=n*Se,n=e[13],M+=n*I,D+=n*g,j+=n*x,q+=n*Q,W+=n*re,V+=n*A,P+=n*G,$+=n*Z,U+=n*Y,L+=n*ue,z+=n*fe,f+=n*ae,h+=n*me,m+=n*Ce,b+=n*le,C+=n*Se,n=e[14],D+=n*I,j+=n*g,q+=n*x,W+=n*Q,V+=n*re,P+=n*A,$+=n*G,U+=n*Z,L+=n*Y,z+=n*ue,f+=n*fe,h+=n*ae,m+=n*me,b+=n*Ce,C+=n*le,T+=n*Se,n=e[15],j+=n*I,q+=n*g,W+=n*x,V+=n*Q,P+=n*re,$+=n*A,U+=n*G,L+=n*Z,z+=n*Y,f+=n*ue,h+=n*fe,m+=n*ae,b+=n*me,C+=n*Ce,T+=n*le,N+=n*Se,o+=38*q,s+=38*W,a+=38*V,l+=38*P,u+=38*$,d+=38*U,p+=38*L,v+=38*z,y+=38*f,S+=38*h,R+=38*m,O+=38*b,k+=38*C,M+=38*T,D+=38*N,i=1,n=o+i+65535,i=Math.floor(n/65536),o=n-i*65536,n=s+i+65535,i=Math.floor(n/65536),s=n-i*65536,n=a+i+65535,i=Math.floor(n/65536),a=n-i*65536,n=l+i+65535,i=Math.floor(n/65536),l=n-i*65536,n=u+i+65535,i=Math.floor(n/65536),u=n-i*65536,n=d+i+65535,i=Math.floor(n/65536),d=n-i*65536,n=p+i+65535,i=Math.floor(n/65536),p=n-i*65536,n=v+i+65535,i=Math.floor(n/65536),v=n-i*65536,n=y+i+65535,i=Math.floor(n/65536),y=n-i*65536,n=S+i+65535,i=Math.floor(n/65536),S=n-i*65536,n=R+i+65535,i=Math.floor(n/65536),R=n-i*65536,n=O+i+65535,i=Math.floor(n/65536),O=n-i*65536,n=k+i+65535,i=Math.floor(n/65536),k=n-i*65536,n=M+i+65535,i=Math.floor(n/65536),M=n-i*65536,n=D+i+65535,i=Math.floor(n/65536),D=n-i*65536,n=j+i+65535,i=Math.floor(n/65536),j=n-i*65536,o+=i-1+37*(i-1),i=1,n=o+i+65535,i=Math.floor(n/65536),o=n-i*65536,n=s+i+65535,i=Math.floor(n/65536),s=n-i*65536,n=a+i+65535,i=Math.floor(n/65536),a=n-i*65536,n=l+i+65535,i=Math.floor(n/65536),l=n-i*65536,n=u+i+65535,i=Math.floor(n/65536),u=n-i*65536,n=d+i+65535,i=Math.floor(n/65536),d=n-i*65536,n=p+i+65535,i=Math.floor(n/65536),p=n-i*65536,n=v+i+65535,i=Math.floor(n/65536),v=n-i*65536,n=y+i+65535,i=Math.floor(n/65536),y=n-i*65536,n=S+i+65535,i=Math.floor(n/65536),S=n-i*65536,n=R+i+65535,i=Math.floor(n/65536),R=n-i*65536,n=O+i+65535,i=Math.floor(n/65536),O=n-i*65536,n=k+i+65535,i=Math.floor(n/65536),k=n-i*65536,n=M+i+65535,i=Math.floor(n/65536),M=n-i*65536,n=D+i+65535,i=Math.floor(n/65536),D=n-i*65536,n=j+i+65535,i=Math.floor(n/65536),j=n-i*65536,o+=i-1+37*(i-1),t[0]=o,t[1]=s,t[2]=a,t[3]=l,t[4]=u,t[5]=d,t[6]=p,t[7]=v,t[8]=y,t[9]=S,t[10]=R,t[11]=O,t[12]=k,t[13]=M,t[14]=D,t[15]=j}function yC(t,e){Rm(t,e,e)}function E7t(t,e){let r=f0();for(let n=0;n<16;n++)r[n]=e[n];for(let n=253;n>=0;n--)yC(r,r),n!==2&&n!==4&&Rm(r,r,e);for(let n=0;n<16;n++)t[n]=r[n]}function pJ(t,e){let r=new Uint8Array(32),n=new Float64Array(80),i=f0(),o=f0(),s=f0(),a=f0(),l=f0(),u=f0();for(let y=0;y<31;y++)r[y]=t[y];r[31]=t[31]&127|64,r[0]&=248,x7t(n,e);for(let y=0;y<16;y++)o[y]=n[y];i[0]=a[0]=1;for(let y=254;y>=0;--y){let S=r[y>>>3]>>>(y&7)&1;vC(i,o,S),vC(s,a,S),tD(l,i,s),rD(i,i,s),tD(s,o,a),rD(o,o,a),yC(a,l),yC(u,i),Rm(i,s,i),Rm(s,o,l),tD(l,i,s),rD(i,i,s),yC(o,i),rD(s,a,u),Rm(i,s,y7t),tD(i,i,a),Rm(s,s,i),Rm(i,a,u),Rm(a,o,n),yC(o,l),vC(i,o,S),vC(s,a,S)}for(let y=0;y<16;y++)n[y+16]=i[y],n[y+32]=s[y],n[y+48]=o[y],n[y+64]=a[y];let d=n.subarray(32),p=n.subarray(16);E7t(d,d),Rm(p,p,d);let v=new Uint8Array(32);return b7t(v,p),v}Mo.scalarMult=pJ;function X9e(t){return pJ(t,J9e)}Mo.scalarMultBase=X9e;function eCe(t){if(t.length!==Mo.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${Mo.SECRET_KEY_LENGTH} bytes`);let e=new Uint8Array(t);return{publicKey:X9e(e),secretKey:e}}Mo.generateKeyPairFromSeed=eCe;function C7t(t){let e=(0,w7t.randomBytes)(32,t),r=eCe(e);return(0,v7t.wipe)(e),r}Mo.generateKeyPair=C7t;function A7t(t,e,r=!1){if(t.length!==Mo.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(e.length!==Mo.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");let n=pJ(t,e);if(r){let i=0;for(let o=0;o<n.length;o++)i|=n[o];if(i===0)throw new Error("X25519: invalid shared key")}return n}Mo.sharedKey=A7t});var tCe=F(()=>{});function nD(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}var iD=F(()=>{});var rCe=F(()=>{iD()});var nCe=F(()=>{});function S7t(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var o=t.charAt(i),s=o.charCodeAt(0);if(r[s]!==255)throw new TypeError(o+" is ambiguous");r[s]=i}var a=t.length,l=t.charAt(0),u=Math.log(a)/Math.log(256),d=Math.log(256)/Math.log(a);function p(S){if(S instanceof Uint8Array||(ArrayBuffer.isView(S)?S=new Uint8Array(S.buffer,S.byteOffset,S.byteLength):Array.isArray(S)&&(S=Uint8Array.from(S))),!(S instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(S.length===0)return"";for(var R=0,O=0,k=0,M=S.length;k!==M&&S[k]===0;)k++,R++;for(var D=(M-k)*d+1>>>0,j=new Uint8Array(D);k!==M;){for(var q=S[k],W=0,V=D-1;(q!==0||W<O)&&V!==-1;V--,W++)q+=256*j[V]>>>0,j[V]=q%a>>>0,q=q/a>>>0;if(q!==0)throw new Error("Non-zero carry");O=W,k++}for(var P=D-O;P!==D&&j[P]===0;)P++;for(var $=l.repeat(R);P<D;++P)$+=t.charAt(j[P]);return $}function v(S){if(typeof S!="string")throw new TypeError("Expected String");if(S.length===0)return new Uint8Array;var R=0;if(S[R]!==" "){for(var O=0,k=0;S[R]===l;)O++,R++;for(var M=(S.length-R)*u+1>>>0,D=new Uint8Array(M);S[R];){var j=r[S.charCodeAt(R)];if(j===255)return;for(var q=0,W=M-1;(j!==0||q<k)&&W!==-1;W--,q++)j+=a*D[W]>>>0,D[W]=j%256>>>0,j=j/256>>>0;if(j!==0)throw new Error("Non-zero carry");k=q,R++}if(S[R]!==" "){for(var V=M-k;V!==M&&D[V]===0;)V++;for(var P=new Uint8Array(O+(M-V)),$=O;V!==M;)P[$++]=D[V++];return P}}}function y(S){var R=v(S);if(R)return R;throw new Error(`Non-${e} character`)}return{encode:p,decodeUnsafe:v,decode:y}}var _7t,I7t,iCe,oCe=F(()=>{_7t=S7t,I7t=_7t,iCe=I7t});var zEr,sCe,Mm,aCe,cCe,l2=F(()=>{zEr=new Uint8Array(0),sCe=(t,e)=>{if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0},Mm=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},aCe=t=>new TextEncoder().encode(t),cCe=t=>new TextDecoder().decode(t)});var gJ,wJ,vJ,uCe,yJ,R6,u2,T7t,k7t,No,bh=F(()=>{oCe();l2();gJ=class{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},wJ=class{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return uCe(this,e)}},vJ=class{constructor(e){this.decoders=e}or(e){return uCe(this,e)}decode(e){let r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},uCe=(t,e)=>new vJ({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}}),yJ=class{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new gJ(e,r,n),this.decoder=new wJ(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},R6=({name:t,prefix:e,encode:r,decode:n})=>new yJ(t,e,r,n),u2=({prefix:t,name:e,alphabet:r})=>{let{encode:n,decode:i}=iCe(r,e);return R6({prefix:t,name:e,encode:n,decode:o=>Mm(i(o))})},T7t=(t,e,r,n)=>{let i={};for(let d=0;d<e.length;++d)i[e[d]]=d;let o=t.length;for(;t[o-1]==="=";)--o;let s=new Uint8Array(o*r/8|0),a=0,l=0,u=0;for(let d=0;d<o;++d){let p=i[t[d]];if(p===void 0)throw new SyntaxError(`Non-${n} character`);l=l<<r|p,a+=r,a>=8&&(a-=8,s[u++]=255&l>>a)}if(a>=r||255&l<<8-a)throw new SyntaxError("Unexpected end of data");return s},k7t=(t,e,r)=>{let n=e[e.length-1]==="=",i=(1<<r)-1,o="",s=0,a=0;for(let l=0;l<t.length;++l)for(a=a<<8|t[l],s+=8;s>r;)s-=r,o+=e[i&a>>s];if(s&&(o+=e[i&a<<r-s]),n)for(;o.length*r&7;)o+="=";return o},No=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>R6({prefix:e,name:t,encode(i){return k7t(i,n,r)},decode(i){return T7t(i,n,r,t)}})});var bJ={};qr(bJ,{identity:()=>R7t});var R7t,fCe=F(()=>{bh();l2();R7t=R6({prefix:"\0",name:"identity",encode:t=>cCe(t),decode:t=>aCe(t)})});var xJ={};qr(xJ,{base2:()=>M7t});var M7t,hCe=F(()=>{bh();M7t=No({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})});var EJ={};qr(EJ,{base8:()=>N7t});var N7t,dCe=F(()=>{bh();N7t=No({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})});var CJ={};qr(CJ,{base10:()=>O7t});var O7t,pCe=F(()=>{bh();O7t=u2({prefix:"9",name:"base10",alphabet:"0123456789"})});var AJ={};qr(AJ,{base16:()=>P7t,base16upper:()=>B7t});var P7t,B7t,mCe=F(()=>{bh();P7t=No({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),B7t=No({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})});var SJ={};qr(SJ,{base32:()=>M6,base32hex:()=>j7t,base32hexpad:()=>$7t,base32hexpadupper:()=>q7t,base32hexupper:()=>F7t,base32pad:()=>L7t,base32padupper:()=>U7t,base32upper:()=>D7t,base32z:()=>H7t});var M6,D7t,L7t,U7t,j7t,F7t,$7t,q7t,H7t,_J=F(()=>{bh();M6=No({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),D7t=No({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),L7t=No({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),U7t=No({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),j7t=No({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),F7t=No({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),$7t=No({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),q7t=No({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),H7t=No({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})});var IJ={};qr(IJ,{base36:()=>z7t,base36upper:()=>W7t});var z7t,W7t,gCe=F(()=>{bh();z7t=u2({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),W7t=u2({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})});var TJ={};qr(TJ,{base58btc:()=>h0,base58flickr:()=>V7t});var h0,V7t,kJ=F(()=>{bh();h0=u2({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),V7t=u2({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})});var RJ={};qr(RJ,{base64:()=>K7t,base64pad:()=>G7t,base64url:()=>Q7t,base64urlpad:()=>Z7t});var K7t,G7t,Q7t,Z7t,wCe=F(()=>{bh();K7t=No({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),G7t=No({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Q7t=No({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Z7t=No({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})});var MJ={};qr(MJ,{base256emoji:()=>tEt});function X7t(t){return t.reduce((e,r)=>(e+=Y7t[r],e),"")}function eEt(t){let e=[];for(let r of t){let n=J7t[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}var vCe,Y7t,J7t,tEt,yCe=F(()=>{bh();vCe=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),Y7t=vCe.reduce((t,e,r)=>(t[r]=e,t),[]),J7t=vCe.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);tEt=R6({prefix:"\u{1F680}",name:"base256emoji",encode:X7t,decode:eEt})});function ECe(t,e,r){e=e||[],r=r||0;for(var n=r;t>=oEt;)e[r++]=t&255|bCe,t/=128;for(;t&iEt;)e[r++]=t&255|bCe,t>>>=7;return e[r]=t|0,ECe.bytes=r-n+1,e}function NJ(t,n){var r=0,n=n||0,i=0,o=n,s,a=t.length;do{if(o>=a)throw NJ.bytes=0,new RangeError("Could not decode varint");s=t[o++],r+=i<28?(s&xCe)<<i:(s&xCe)*Math.pow(2,i),i+=7}while(s>=aEt);return NJ.bytes=o-n,r}var rEt,bCe,nEt,iEt,oEt,sEt,aEt,xCe,cEt,lEt,uEt,fEt,hEt,dEt,pEt,mEt,gEt,wEt,vEt,yEt,bC,CCe=F(()=>{rEt=ECe,bCe=128,nEt=127,iEt=~nEt,oEt=Math.pow(2,31);sEt=NJ,aEt=128,xCe=127;cEt=Math.pow(2,7),lEt=Math.pow(2,14),uEt=Math.pow(2,21),fEt=Math.pow(2,28),hEt=Math.pow(2,35),dEt=Math.pow(2,42),pEt=Math.pow(2,49),mEt=Math.pow(2,56),gEt=Math.pow(2,63),wEt=function(t){return t<cEt?1:t<lEt?2:t<uEt?3:t<fEt?4:t<hEt?5:t<dEt?6:t<pEt?7:t<mEt?8:t<gEt?9:10},vEt={encode:rEt,decode:sEt,encodingLength:wEt},yEt=vEt,bC=yEt});var xC,N6,O6,sD=F(()=>{CCe();xC=(t,e=0)=>[bC.decode(t,e),bC.decode.bytes],N6=(t,e,r=0)=>(bC.encode(t,e,r),e),O6=t=>bC.encodingLength(t)});var Av,ACe,SCe,P6,CC=F(()=>{l2();sD();Av=(t,e)=>{let r=e.byteLength,n=O6(t),i=n+O6(r),o=new Uint8Array(i+r);return N6(t,o,0),N6(r,o,n),o.set(e,i),new P6(t,r,e,o)},ACe=t=>{let e=Mm(t),[r,n]=xC(e),[i,o]=xC(e.subarray(n)),s=e.subarray(n+o);if(s.byteLength!==i)throw new Error("Incorrect length");return new P6(r,i,s,e)},SCe=(t,e)=>t===e?!0:t.code===e.code&&t.size===e.size&&sCe(t.bytes,e.bytes),P6=class{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}}});var PJ,OJ,BJ=F(()=>{CC();PJ=({name:t,code:e,encode:r})=>new OJ(t,e,r),OJ=class{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){let r=this.encode(e);return r instanceof Uint8Array?Av(this.code,r):r.then(n=>Av(this.code,n))}else throw Error("Unknown type, must be binary type")}}});var DJ={};qr(DJ,{sha256:()=>bEt,sha512:()=>xEt});var ICe,bEt,xEt,TCe=F(()=>{BJ();ICe=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),bEt=PJ({name:"sha2-256",code:18,encode:ICe("SHA-256")}),xEt=PJ({name:"sha2-512",code:19,encode:ICe("SHA-512")})});var LJ={};qr(LJ,{identity:()=>AEt});var kCe,EEt,RCe,CEt,AEt,MCe=F(()=>{l2();CC();kCe=0,EEt="identity",RCe=Mm,CEt=t=>Av(kCe,RCe(t)),AEt={code:kCe,name:EEt,encode:RCe,digest:CEt}});var NCe=F(()=>{l2()});var f9r,h9r,OCe=F(()=>{f9r=new TextEncoder,h9r=new TextDecoder});var lD,IEt,TEt,kEt,AC,REt,PCe,BCe,aD,cD,MEt,NEt,OEt,DCe=F(()=>{sD();CC();kJ();_J();l2();lD=class t{constructor(e,r,n,i){this.code=r,this.version=e,this.multihash=n,this.bytes=i,this.byteOffset=i.byteOffset,this.byteLength=i.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:cD,byteLength:cD,code:aD,version:aD,multihash:aD,bytes:aD,_baseCache:cD,asCID:cD})}toV0(){switch(this.version){case 0:return this;default:{let{code:e,multihash:r}=this;if(e!==AC)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==REt)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return t.createV0(r)}}}toV1(){switch(this.version){case 0:{let{code:e,digest:r}=this.multihash,n=Av(e,r);return t.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(e){return e&&this.code===e.code&&this.version===e.version&&SCe(this.multihash,e.multihash)}toString(e){let{bytes:r,version:n,_baseCache:i}=this;switch(n){case 0:return TEt(r,i,e||h0.encoder);default:return kEt(r,i,e||M6.encoder)}}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(e){return NEt(/^0\.0/,OEt),!!(e&&(e[BCe]||e.asCID===e))}get toBaseEncodedString(){throw new Error("Deprecated, use .toString()")}get codec(){throw new Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw new Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw new Error('"multibaseName" property is deprecated')}get prefix(){throw new Error('"prefix" property is deprecated')}static asCID(e){if(e instanceof t)return e;if(e!=null&&e.asCID===e){let{version:r,code:n,multihash:i,bytes:o}=e;return new t(r,n,i,o||PCe(r,n,i.bytes))}else if(e!=null&&e[BCe]===!0){let{version:r,multihash:n,code:i}=e,o=ACe(n);return t.create(r,i,o)}else return null}static create(e,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");switch(e){case 0:{if(r!==AC)throw new Error(`Version 0 CID must use dag-pb (code: ${AC}) block encoding`);return new t(e,r,n,n.bytes)}case 1:{let i=PCe(e,r,n.bytes);return new t(e,r,n,i)}default:throw new Error("Invalid version")}}static createV0(e){return t.create(0,AC,e)}static createV1(e,r){return t.create(1,e,r)}static decode(e){let[r,n]=t.decodeFirst(e);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(e){let r=t.inspectBytes(e),n=r.size-r.multihashSize,i=Mm(e.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let o=i.subarray(r.multihashSize-r.digestSize),s=new P6(r.multihashCode,r.digestSize,o,i);return[r.version===0?t.createV0(s):t.createV1(r.codec,s),e.subarray(r.size)]}static inspectBytes(e){let r=0,n=()=>{let[p,v]=xC(e.subarray(r));return r+=v,p},i=n(),o=AC;if(i===18?(i=0,r=0):i===1&&(o=n()),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let s=r,a=n(),l=n(),u=r+l,d=u-s;return{version:i,codec:o,multihashCode:a,digestSize:l,multihashSize:d,size:u}}static parse(e,r){let[n,i]=IEt(e,r),o=t.decode(i);return o._baseCache.set(n,e),o}},IEt=(t,e)=>{switch(t[0]){case"Q":{let r=e||h0;return[h0.prefix,r.decode(`${h0.prefix}${t}`)]}case h0.prefix:{let r=e||h0;return[h0.prefix,r.decode(t)]}case M6.prefix:{let r=e||M6;return[M6.prefix,r.decode(t)]}default:{if(e==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[t[0],e.decode(t)]}}},TEt=(t,e,r)=>{let{prefix:n}=r;if(n!==h0.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=e.get(n);if(i==null){let o=r.encode(t).slice(1);return e.set(n,o),o}else return i},kEt=(t,e,r)=>{let{prefix:n}=r,i=e.get(n);if(i==null){let o=r.encode(t);return e.set(n,o),o}else return i},AC=112,REt=18,PCe=(t,e,r)=>{let n=O6(t),i=n+O6(e),o=new Uint8Array(i+r.byteLength);return N6(t,o,0),N6(e,o,n),o.set(r,i),o},BCe=Symbol.for("@ipld/js-cid/CID"),aD={writable:!1,configurable:!1,enumerable:!0},cD={writable:!1,enumerable:!1,configurable:!1},MEt="0.0.0-dev",NEt=(t,e)=>{if(t.test(MEt))console.warn(e);else throw new Error(e)},OEt=`CID.isCID(v) is deprecated and will be removed in the next major release. | |
Following code pattern: | |
if (CID.isCID(value)) { | |
doSomethingWithCID(value) | |
} | |
Is replaced with: | |
const cid = CID.asCID(value) | |
if (cid) { | |
// Make sure to use cid instead of value | |
doSomethingWithCID(cid) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment