PageSourceSearch

https://nesemulator.xyz/assets/index-BEhZEBtE.js

js nesemulator.xyz collected 2026-10-09 22:02:44 UTC 340,266 bytes, 7 lines download raw bytes

1import{as as wa,m as B,aC as Pn,o as ir,aD as ot,aE as Mo,aF as wl,g as af}from"./index-CRly4T18.js";import{p as cf,a as lf}from"./hooks.module-Dz_XB4AG.js";import{e as xn}from"./events-DPUt-arx.js";const uf=Object.freeze(Object.defineProperty({__proto__:null,EventEmitter:wa,default:wa},Symbol.toStringTag,{value:"Module"}));var Rs,Ea;function df(){if(Ea)return Rs;Ea=1;var e=1e3,t=e*60,r=t*60,n=r*24,i=n*7,s=n*365.25;Rs=function(u,d){d=d||{};var f=typeof u;if(f==="string"&&u.length>0)return o(u);if(f==="number"&&isFinite(u))return d.long?c(u):a(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function o(u){if(u=String(u),!(u.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(u);if(d){var f=parseFloat(d[1]),y=(d[2]||"ms").toLowerCase();switch(y){case"years":case"year":case"yrs":case"yr":case"y":return f*s;case"weeks":case"week":case"w":return f*i;case"days":case"day":case"d":return f*n;case"hours":case"hour":case"hrs":case"hr":case"h":return f*r;case"minutes":case"minute":case"mins":case"min":case"m":return f*t;case"seconds":case"second":case"secs":case"sec":case"s":return f*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return f;default:return}}}}function a(u){var d=Math.abs(u);return d>=n?Math.round(u/n)+"d":d>=r?Math.round(u/r)+"h":d>=t?Math.round(u/t)+"m":d>=e?Math.round(u/e)+"s":u+"ms"}function c(u){var d=Math.abs(u);return d>=n?l(u,d,n,"day"):d>=r?l(u,d,r,"hour"):d>=t?l(u,d,t,"minute"):d>=e?l(u,d,e,"second"):u+" ms"}function l(u,d,f,y){var S=d>=f*1.5;return Math.round(u/f)+" "+y+(S?"s":"")}return Rs}var Eo={exports:{}};const ff="2.0.0",El=256,hf=Number.MAX_SAFE_INTEGER||9007199254740991,pf=16,gf=El-6,yf=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var On={MAX_LENGTH:El,MAX_SAFE_COMPONENT_LENGTH:pf,MAX_SAFE_BUILD_LENGTH:gf,MAX_SAFE_INTEGER:hf,RELEASE_TYPES:yf,SEMVER_SPEC_VERSION:ff,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Cs={};const bf=typeof process=="object"&&Cs&&Cs.NODE_DEBUG&&/\bsemver\b/i.test(Cs.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var Mn=bf;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=On,s=Mn;t=e.exports={};const o=t.re=[],a=t.safeRe=[],c=t.src=[],l=t.safeSrc=[],u=t.t={};let d=0;const f="[a-zA-Z0-9-]",y=[["\\s",1],["\\d",i],[f,n]],S=w=>{for(const[p,m]of y)w=w.split(`${p}*`).join(`${p}{0,${m}}`).split(`${p}+`).join(`${p}{1,${m}}`);return w},_=(w,p,m)=>{const b=S(p),R=d++;s(w,R,p),u[w]=R,c[R]=p,l[R]=b,o[R]=new RegExp(p,m?"g":void 0),a[R]=new RegExp(b,m?"g":void 0)};_("NUMERICIDENTIFIER","0|[1-9]\\d*"),_("NUMERICIDENTIFIERLOOSE","\\d+"),_("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),_("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),_("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),_("PRERELEASEIDENTIFIER",`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),_("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),_("PRERELEASE",`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),_("PRERELEASELOOSE",`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),_("BUILDIDENTIFIER",`${f}+`),_("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),_("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),_("FULL",`^${c[u.FULLPLAIN]}$`),_("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),_("LOOSE",`^${c[u.LOOSEPLAIN]}$`),_("GTLT","((?:<|>)?=?)"),_("XRANGEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),_("XRANGEIDENTIFIER",`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),_("XRANGEPLAIN",`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),_("XRANGEPLAINLOOSE",`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),_("XRANGE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),_("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),_("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),_("COERCE",`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),_("COERCEFULL",c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`),_("COERCERTL",c[u.COERCE],!0),_("COERCERTLFULL",c[u.COERCEFULL],!0),_("LONETILDE","(?:~>?)"),_("TILDETRIM",`(\\s*)${c[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",_("TILDE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),_("TILDELOOSE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),_("LONECARET","(?:\\^)"),_("CARETTRIM",`(\\s*)${c[u.LONECARET]}
1\\s+`,!0),t.caretTrimReplace="$1^",_("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),_("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),_("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),_("COMPARATOR",`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),_("COMPARATORTRIM",`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",_("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),_("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),_("STAR","(<|>)?=?\\s*\\*"),_("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),_("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Eo,Eo.exports);var kr=Eo.exports;const mf=Object.freeze({loose:!0}),_f=Object.freeze({}),vf=e=>e?typeof e!="object"?mf:e:_f;var No=vf;const Sa=/^[0-9]+$/,Sl=(e,t)=>{const r=Sa.test(e),n=Sa.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},wf=(e,t)=>Sl(t,e);var Rl={compareIdentifiers:Sl,rcompareIdentifiers:wf};const nn=Mn,{MAX_LENGTH:Ra,MAX_SAFE_INTEGER:sn}=On,{safeRe:on,t:an}=kr,Ef=No,{compareIdentifiers:Nt}=Rl;let Sf=class Ge{constructor(t,r){if(r=Ef(r),t instanceof Ge){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>Ra)throw new TypeError(`version is longer than ${Ra} characters`);nn("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=t.trim().match(r.loose?on[an.LOOSE]:on[an.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>sn||this.major<0)throw new TypeError("Invalid major version");if(this.minor>sn||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>sn||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const s=+i;if(s>=0&&s<sn)return s}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(nn("SemVer.compare",this.version,this.options,t),!(t instanceof Ge)){if(typeof t=="string"&&t===this.version)return 0;t=new Ge(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof Ge||(t=new Ge(t,this.options)),Nt(this.major,t.major)||Nt(this.minor,t.minor)||Nt(this.patch,t.patch)}comparePre(t){if(t instanceof Ge||(t=new Ge(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{const n=this.prerelease[r],i=t.prerelease[r];if(nn("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 Nt(n,i)}while(++r)}compareBuild(t){t instanceof Ge||(t=new Ge(t,this.options));let r=0;do{const n=this.build[r],i=t.build[r];if(nn("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 Nt(n,i)}while(++r)}inc(t,r,n){if(t.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){const i=`-${r}`.match(this.options.loose?on[an.PRERELEASELOOSE]:on[an.PRERELEASE]);if(!i||i[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const i=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let s=[r,i];n===!1&&(s=[r]),Nt(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};
vendor: 13,448 bytes, line 1
1var Ce=Sf;const Ca=Ce,Rf=(e,t,r=!1)=>{if(e instanceof Ca)return e;try{return new Ca(e,t)}catch(n){if(!r)return null;throw n}};var sr=Rf;const Cf=sr,kf=(e,t)=>{const r=Cf(e,t);return r?r.version:null};var If=kf;const Af=sr,Tf=(e,t)=>{const r=Af(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};var Pf=Tf;const ka=Ce,xf=(e,t,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new ka(e instanceof ka?e.version:e,r).inc(t,n,i).version}catch{return null}};var Of=xf;const Ia=sr,Mf=(e,t)=>{const r=Ia(e,null,!0),n=Ia(t,null,!0),i=r.compare(n);if(i===0)return null;const s=i>0,o=s?r:n,a=s?n:r,c=!!o.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(o)===0)return a.minor&&!a.patch?"minor":"patch"}const u=c?"pre":"";return r.major!==n.major?u+"major":r.minor!==n.minor?u+"minor":r.patch!==n.patch?u+"patch":"prerelease"};var Nf=Mf;const Lf=Ce,$f=(e,t)=>new Lf(e,t).major;var Bf=$f;const Ff=Ce,jf=(e,t)=>new Ff(e,t).minor;var Df=jf;const Uf=Ce,Hf=(e,t)=>new Uf(e,t).patch;var Wf=Hf;const Vf=sr,qf=(e,t)=>{const r=Vf(e,t);return r&&r.prerelease.length?r.prerelease:null};var zf=qf;const Aa=Ce,Gf=(e,t,r)=>new Aa(e,r).compare(new Aa(t,r));var Ue=Gf;const Jf=Ue,Zf=(e,t,r)=>Jf(t,e,r);var Kf=Zf;const Qf=Ue,Yf=(e,t)=>Qf(e,t,!0);var Xf=Yf;const Ta=Ce,eh=(e,t,r)=>{const n=new Ta(e,r),i=new Ta(t,r);return n.compare(i)||n.compareBuild(i)};var Lo=eh;const th=Lo,rh=(e,t)=>e.sort((r,n)=>th(r,n,t));var nh=rh;const ih=Lo,sh=(e,t)=>e.sort((r,n)=>ih(n,r,t));var oh=sh;const ah=Ue,ch=(e,t,r)=>ah(e,t,r)>0;var Nn=ch;const lh=Ue,uh=(e,t,r)=>lh(e,t,r)<0;var $o=uh;const dh=Ue,fh=(e,t,r)=>dh(e,t,r)===0;var Cl=fh;const hh=Ue,ph=(e,t,r)=>hh(e,t,r)!==0;var kl=ph;const gh=Ue,yh=(e,t,r)=>gh(e,t,r)>=0;var Bo=yh;const bh=Ue,mh=(e,t,r)=>bh(e,t,r)<=0;var Fo=mh;const _h=Cl,vh=kl,wh=Nn,Eh=Bo,Sh=$o,Rh=Fo,Ch=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return _h(e,r,n);case"!=":return vh(e,r,n);case">":return wh(e,r,n);case">=":return Eh(e,r,n);case"<":return Sh(e,r,n);case"<=":return Rh(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};var Il=Ch;const kh=Ce,Ih=sr,{safeRe:cn,t:ln}=kr,Ah=(e,t)=>{if(e instanceof kh)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?cn[ln.COERCEFULL]:cn[ln.COERCE]);else{const c=t.includePrerelease?cn[ln.COERCERTLFULL]:cn[ln.COERCERTL];let l;for(;(l=c.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||l.index+l[0].length!==r.index+r[0].length)&&(r=l),c.lastIndex=l.index+l[1].length+l[2].length;c.lastIndex=-1}if(r===null)return null;const n=r[2],i=r[3]||"0",s=r[4]||"0",o=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return Ih(`${n}.${i}.${s}${o}${a}`,t)};var Th=Ah;class Ph{constructor(){this.max=1e3,this.map=new Map}get(t){const r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){const i=this.map.keys().next().value;this.delete(i)}this.map.set(t,r)}return this}}var xh=Ph,ks,Pa;function He(){if(Pa)return ks;Pa=1;const e=/\s+/g;class t{constructor(I,$){if($=i($),I instanceof t)return I.loose===!!$.loose&&I.includePrerelease===!!$.includePrerelease?I:new t(I.raw,$);if(I instanceof s)return this.raw=I.value,this.set=[[I]],this.formatted=void 0,this;if(this.options=$,this.loose=!!$.loose,this.includePrerelease=!!$.includePrerelease,this.raw=I.trim().replace(e," "),this.set=this.raw.split("||").map(O=>this.parseRange(O.trim())).filter(O=>O.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const O=this.set[0];if(this.set=this.set.filter(j=>!_(j[0])),this.set.length===0)this.set=[O];else if(this.set.length>1){for(const j of this.set)if(j.length===1&&w(j[0])){this.set=[j];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let I=0;I<this.set.length;I++){I>0&&(this.formatted+="||");const $=this.set[I];for(let O=0;O<$.length;O++)O>0&&(this.formatted+=" "),this.formatted+=$[O].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(I){const O=((this.options.includePrerelease&&y)|(this.options.loose&&S))+":"+I,j=n.get(O);if(j)return j;const M=this.options.loose,U=M?c[l.HYPHENRANGELOOSE]:c[l.HYPHENRANGE];I=I.replace(U,ie(this.options.includePrerelease)),o("hyphen replace",I),I=I.replace(c[l.COMPARATORTRIM],u),o("comparator trim",I),I=I.replace(c[l.TILDETRIM],d),o("tilde trim",I),I=I.replace(c[l.CARETTRIM],f),o("caret trim",I);let Z=I.split(" ").map(re=>m(re,this.options)).join(" ").split(/\s+/).map(re=>ae(re,this.options));M&&(Z=Z.filter(re=>(o("loose invalid filter",re,this.options),!!re.match(c[l.COMPARATORLOOSE])))),o("range list",Z);const W=new Map,K=Z.map(re=>new s(re,this.options));for(const re of K){if(_(re))return[re];W.set(re.value,re)}W.size>1&&W.has("")&&W.delete("");const de=[...W.values()];return n.set(O,de),de}intersects(I,$){if(!(I instanceof t))throw new TypeError("a Range is required");return this.set.some(O=>p(O,$)&&I.set.some(j=>p(j,$)&&O.every(M=>j.every(U=>M.intersects(U,$)))))}test(I){if(!I)return!1;if(typeof I=="string")try{I=new a(I,this.options)}catch{return!1}for(let $=0;$<this.set.length;$++)if(se(this.set[$],I,this.options))return!0;return!1}}ks=t;const r=xh,n=new r,i=No,s=Ln(),o=Mn,a=Ce,{safeRe:c,t:l,comparatorTrimReplace:u,tildeTrimReplace:d,caretTrimReplace:f}=kr,{FLAG_INCLUDE_PRERELEASE:y,FLAG_LOOSE:S}=On,_=P=>P.value==="<0.0.0-0",w=P=>P.value==="",p=(P,I)=>{let $=!0;const O=P.slice();let j=O.pop();for(;$&&O.length;)$=O.every(M=>j.intersects(M,I)),j=O.pop();return $},m=(P,I)=>(o("comp",P,I),P=T(P,I),o("caret",P),P=R(P,I),o("tildes",P),P=F(P,I),o("xrange",P),P=Y(P,I),o("stars",P),P),b=P=>!P||P.toLowerCase()==="x"||P==="*",R=(P,I)=>P.trim().split(/\s+/).map($=>C($,I)).join(" "),C=(P,I)=>{const $=I.loose?c[l.TILDELOOSE]:c[l.TILDE];return P.replace($,(O,j,M,U,Z)=>{o("tilde",P,O,j,M,U,Z);let W;return b(j)?W="":b(M)?W=`>=${j}.0.0 <${+j+1}.0.0-0`:b(U)?W=`>=${j}.${M}.0 <${j}.${+M+1}.0-0`:Z?(o("replaceTilde pr",Z),W=`>=${j}.${M}.${U}-${Z} <${j}.${+M+1}.0-0`):W=`>=${j}.${M}.${U} <${j}.${+M+1}.0-0`,o("tilde return",W),W})},T=(P,I)=>P.trim().split(/\s+/).map($=>H($,I)).join(" "),H=(P,I)=>{o("caret",P,I);const $=I.loose?c[l.CARETLOOSE]:c[l.CARET],O=I.includePrerelease?"-0":"";return P.replace($,(j,M,U,Z,W)=>{o("caret",P,j,M,U,Z,W);let K;return b(M)?K="":b(U)?K=`>=${M}.0.0${O} <${+M+1}.0.0-0`:b(Z)?M==="0"?K=`>=${M}.${U}.0${O} <${M}.${+U+1}.0-0`:K=`>=${M}.${U}.0${O} <${+M+1}.0.0-0`:W?(o("replaceCaret pr",W),M==="0"?U==="0"?K=`>=${M}.${U}.${Z}-${W} <${M}.${U}.${+Z+1}-0`:K=`>=${M}.${U}.${Z}-${W} <${M}.${+U+1}.0-0`:K=`>=${M}.${U}.${Z}-${W} <${+M+1}.0.0-0`):(o("no pr"),M==="0"?U==="0"?K=`>=${M}.${U}.${Z}${O} <${M}.${U}.${+Z+1}-0`:K=`>=${M}.${U}.${Z}${O} <${M}.${+U+1}.0-0`:K=`>=${M}.${U}.${Z} <${+M+1}.0.0-0`),o("caret return",K),K})},F=(P,I)=>(o("replaceXRanges",P,I),P.split(/\s+/).map($=>L($,I)).join(" ")),L=(P,I)=>{P=P.trim();const $=I.loose?c[l.XRANGELOOSE]:c[l.XRANGE];return P.replace($,(O,j,M,U,Z,W)=>{o("xRange",P,O,j,M,U,Z,W);const K=b(M),de=K||b(U),re=de||b(Z),v=re;return j==="="&&v&&(j=""),W=I.includePrerelease?"-0":"",K?j===">"||j==="<"?O="<0.0.0-0":O="*":j&&v?(de&&(U=0),Z=0,j===">"?(j=">=",de?(M=+M+1,U=0,Z=0):(U=+U+1,Z=0)):j==="<="&&(j="<",de?M=+M+1:U=+U+1),j==="<"&&(W="-0"),O=`${j+M}.${U}.${Z}${W}`):de?O=`>=${M}.0.0${W} <${+M+1}.0.0-0`:re&&(O=`>=${M}.${U}.0${W} <${M}.${+U+1}.0-0`),o("xRange return",O),O})},Y=(P,I)=>(o("replaceStars",P,I),P.trim().replace(c[l.STAR],"")),ae=(P,I)=>(o("replaceGTE0",P,I),P.trim().replace(c[I.includePrerelease?l.GTE0PRE:l.GTE0],"")),ie=P=>(I,$,O,j,M,U,Z,W,K,de,re,v)=>(b(O)?$="":b(j)?$=`>=${O}.0.0${P?"-0":""}`:b(M)?$=`>=${O}.${j}.0${P?"-0":""}`:U?$=`>=${$}`:$=`>=${$}${P?"-0":""}`,b(K)?W="":b(de)?W=`<${+K+1}.0.0-0`:b(re)?W=`<${K}.${+de+1}.0-0`:v?W=`<=${K}.${de}.${re}-${v}`:P?W=`<${K}.${de}.${+re+1}-0`:W=`<=${W}`,`${$} ${W}`.trim()),se=(P,I,$)=>{for(let O=0;O<P.length;O++)if(!P[O].test(I))return!1;if(I.prerelease.length&&!$.includePrerelease){for(let O=0;O<P.length;O++)if(o(P[O].semver),P[O].semver!==s.ANY&&P[O].semver.prerelease.length>0){const j=P[O].semver;if(j.major===I.major&&j.minor===I.minor&&j.patch===I.patch)return!0}return!1}return!0};return ks}var Is,xa;function Ln(){if(xa)return Is;xa=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(u,d){if(d=r(d),u instanceof t){if(u.loose===!!d.loose)return u;u=u.value}u=u.trim().split(/\s+/).join(" "),o("comparator",u,d),this.options=d,this.loose=!!d.loose,this.parse(u),this.semver===e?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(u){const d=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],f=u.match(d);if(!f)throw new TypeError(`Invalid comparator: ${u}`);this.operator=f[1]!==void 0?f[1]:"",this.operator==="="&&(this.operator=""),f[2]?this.semver=new a(f[2],this.options.loose):this.semver=e}toString(){return this.value}test(u){if(o("Comparator.test",u,this.options.loose),this.semver===e||u===e)return!0;if(typeof u=="string")try{u=new a(u,this.options)}catch{return!1}return s(u,this.operator,this.semver,this.options)}intersects(u,d){if(!(u instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(u.value,d).test(this.value):u.operator===""?u.value===""?!0:new c(this.value,d).test(u.semver):(d=r(d),d.includePrerelease&&(this.value==="<0.0.0-0"||u.value==="<0.0.0-0")||!d.includePrerelease&&(this.value.startsWith("<0.0.0")||u.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&u.operator.startsWith(">")||this.operator.startsWith("<")&&u.operator.startsWith("<")||this.semver.version===u.semver.version&&this.operator.includes("=")&&u.operator.includes("=")||s(this.semver,"<",u.semver,d)&&this.operator.startsWith(">")&&u.operator.startsWith("<")||s(this.semver,">",u.semver,d)&&this.operator.startsWith("<")&&u.operator.startsWith(">")))}}Is=t;const r=No,{safeRe:n,t:i}=kr,s=Il,o=Mn,a=Ce,c=He();return Is}const Oh=He(),Mh=(e,t,r)=>{try{t=new Oh(t,r)}catch{return!1}return t.test(e)};var $n=Mh;const Nh=He(),Lh=(e,t)=>new Nh(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var $h=Lh;const Bh=Ce,Fh=He(),jh=(e,t,r)=>{let n=null,i=null,s=null;try{s=new Fh(t,r)}catch{return null}return e.forEach(o=>{s.test(o)&&(!n||i.compare(o)===-1)&&(n=o,i=new Bh(n,r))}),n};var Dh=jh;const Uh=Ce,Hh=He(),Wh=(e,t,r)=>{let n=null,i=null,s=null;try{s=new Hh(t,r)}catch{return null}return e.forEach(o=>{s.test(o)&&(!n||i.compare(o)===1)&&(n=o,i=new Uh(n,r))}),n};var Vh=Wh;const As=Ce,qh=He(),Oa=Nn,zh=(e,t)=>{e=new qh(e,t);let r=new As("0.0.0");if(e.test(r)||(r=new As("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n<e.set.length;++n){const i=e.set[n];let s=null;i.forEach(o=>{const a=new As(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||Oa(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!r||Oa(r,s))&&(r=s)}return r&&e.test(r)?r:null};var Gh=zh;const Jh=He(),Zh=(e,t)=>{try{return new Jh(e,t).range||"*"}catch{return null}};var Kh=Zh;const Qh=Ce,Al=Ln(),{ANY:Yh}=Al,Xh=He(),e0=$n,Ma=Nn,Na=$o,t0=Fo,r0=Bo,n0=(e,t,r,n)=>{e=new Qh(e,n),t=new Xh(t,n);let i,s,o,a,c;switch(r){case">":i=Ma,s=t0,o=Na,a=">",c=">=";break;case"<":i=Na,s=r0,o=Ma,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(e0(e,t,n))return!1;for(let l=0;l<t.set.length;++l){const u=t.set[l];let d=null,f=null;if(u.forEach(y=>{y.semver===Yh&&(y=new Al(">=0.0.0")),d=d||y,f=f||y,i(y.semver,d.semver,n)?d=y:o(y.semver,f.semver,n)&&(f=y)}),d.operator===a||d.operator===c||(!f.operator||f.operator===a)&&s(e,f.semver))return!1;if(f.operator===c&&o(e,f.semver))return!1}return!0};var jo=n0;const i0=jo,s0=(e,t,r)=>i0(e,t,">",r);var o0=s0;const a0=jo,c0=(e,t,r)=>a0(e,t,"<",r);var l0=c0;const La=He(),u0=(e,t,r)=>(e=new La(e,r),t=new La(t,r),e.intersects(t,r));var d0=u0;const f0=$n,h0=Ue;var p0=(e,t,r)=>{const n=[];let i=null,s=null;const o=e.sort((u,d)=>h0(u,d,r));for(const u of o)f0(u,t,r)?(s=u,i||(i=u)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);const a=[];for(const[u,d]of n)u===d?a.push(u):!d&&u===o[0]?a.push("*"):d?u===o[0]?a.push(`<=${d}`):a.push(`${u} - ${d}`):a.push(`>=${u}`);const c=a.join(" || "),l=typeof t.raw=="string"?t.raw:String(t);return c.length<l.length?c:t};const $a=He(),Do=Ln(),{ANY:Ts}=Do,yr=$n,Uo=Ue,g0=(e,t,r={})=>{if(e===t)return!0;e=new $a(e,r),t=new $a(t,r);let n=!1;e:for(const i of e.set){for(const s of t.set){const o=b0(i,s,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},y0=[new Do(">=0.0.0-0")],Ba=[new Do(">=0.0.0")],b0=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===Ts){if(t.length===1&&t[0].semver===Ts)return!0;r.includePrerelease?e=y0:e=Ba}if(t.length===1&&t[0].semver===Ts){if(r.includePrerelease)return!0;t=Ba}const n=new Set;let i,s;for(const y of e)y.operator===">"||y.operator===">="?i=Fa(i,y,r):y.operator==="<"||y.operator==="<="?s=ja(s,y,r):n.add(y.semver);if(n.size>1)return null;let o;
1if(i&&s){if(o=Uo(i.semver,s.semver,r),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(const y of n){if(i&&!yr(y,String(i),r)||s&&!yr(y,String(s),r))return null;for(const S of t)if(!yr(y,String(S),r))return!1;return!0}let a,c,l,u,d=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,f=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;d&&d.prerelease.length===1&&s.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(const y of t){if(u=u||y.operator===">"||y.operator===">=",l=l||y.operator==="<"||y.operator==="<=",i){if(f&&y.semver.prerelease&&y.semver.prerelease.length&&y.semver.major===f.major&&y.semver.minor===f.minor&&y.semver.patch===f.patch&&(f=!1),y.operator===">"||y.operator===">="){if(a=Fa(i,y,r),a===y&&a!==i)return!1}else if(i.operator===">="&&!yr(i.semver,String(y),r))return!1}if(s){if(d&&y.semver.prerelease&&y.semver.prerelease.length&&y.semver.major===d.major&&y.semver.minor===d.minor&&y.semver.patch===d.patch&&(d=!1),y.operator==="<"||y.operator==="<="){if(c=ja(s,y,r),c===y&&c!==s)return!1}else if(s.operator==="<="&&!yr(s.semver,String(y),r))return!1}if(!y.operator&&(s||i)&&o!==0)return!1}return!(i&&l&&!s&&o!==0||s&&u&&!i&&o!==0||f||d)},Fa=(e,t,r)=>{if(!e)return t;const n=Uo(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},ja=(e,t,r)=>{if(!e)return t;const n=Uo(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};var m0=g0;const Ps=kr,Da=On,_0=Ce,Ua=Rl,v0=sr,w0=If,E0=Pf,S0=Of,R0=Nf,C0=Bf,k0=Df,I0=Wf,A0=zf,T0=Ue,P0=Kf,x0=Xf,O0=Lo,M0=nh,N0=oh,L0=Nn,$0=$o,B0=Cl,F0=kl,j0=Bo,D0=Fo,U0=Il,H0=Th,W0=Ln(),V0=He(),q0=$n,z0=$h,G0=Dh,J0=Vh,Z0=Gh,K0=Kh,Q0=jo,Y0=o0,X0=l0,ep=d0,tp=p0,rp=m0;var np={parse:v0,valid:w0,clean:E0,inc:S0,diff:R0,major:C0,minor:k0,patch:I0,prerelease:A0,compare:T0,rcompare:P0,compareLoose:x0,compareBuild:O0,sort:M0,rsort:N0,gt:L0,lt:$0,eq:B0,neq:F0,gte:j0,lte:D0,cmp:U0,coerce:H0,Comparator:W0,Range:V0,satisfies:q0,toComparators:z0,maxSatisfying:G0,minSatisfying:J0,minVersion:Z0,validRange:K0,outside:Q0,gtr:Y0,ltr:X0,intersects:ep,simplifyRange:tp,subset:rp,SemVer:_0,re:Ps.re,src:Ps.src,tokens:Ps.t,SEMVER_SPEC_VERSION:Da.SEMVER_SPEC_VERSION,RELEASE_TYPES:Da.RELEASE_TYPES,compareIdentifiers:Ua.compareIdentifiers,rcompareIdentifiers:Ua.rcompareIdentifiers},ip=wr;wr.default=wr;wr.stable=xl;wr.stableStringify=xl;var Sn="[...]",Tl="[Circular]",Ct=[],wt=[];function Pl(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function wr(e,t,r,n){typeof n>"u"&&(n=Pl()),So(e,"",0,[],void 0,0,n);var i;try{wt.length===0?i=JSON.stringify(e,t,r):i=JSON.stringify(e,Ol(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Ct.length!==0;){var s=Ct.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function Vt(e,t,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:e}),Ct.push([n,r,t,i])):wt.push([t,r,e]):(n[r]=e,Ct.push([n,r,t]))}function So(e,t,r,n,i,s,o){s+=1;var a;if(typeof e=="object"&&e!==null){for(a=0;a<n.length;a++)if(n[a]===e){Vt(Tl,e,t,i);return}if(typeof o.depthLimit<"u"&&s>o.depthLimit){Vt(Sn,e,t,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){Vt(Sn,e,t,i);return}if(n.push(e),Array.isArray(e))for(a=0;a<e.length;a++)So(e[a],a,a,n,e,s,o);else{var c=Object.keys(e);for(a=0;a<c.length;a++){var l=c[a];So(e[l],l,a,n,e,s,o)}}n.pop()}}function sp(e,t){return e<t?-1:e>t?1:0}function xl(e,t,r,n){typeof n>"u"&&(n=Pl());var i=Ro(e,"",0,[],void 0,0,n)||e,s;try{wt.length===0?s=JSON.stringify(i,t,r):s=JSON.stringify(i,Ol(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Ct.length!==0;){var o=Ct.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return s}function Ro(e,t,r,n,i,s,o){s+=1;var a;if(typeof e=="object"&&e!==null){for(a=0;a<n.length;a++)if(n[a]===e){Vt(Tl,e,t,i);return}try{if(typeof e.toJSON=="function")return}catch{return}if(typeof o.depthLimit<"u"&&s>o.depthLimit){Vt(Sn,e,t,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){Vt(Sn,e,t,i);return}if(n.push(e),Array.isArray(e))for(a=0;a<e.length;a++)Ro(e[a],a,a,n,e,s,o);else{var c={},l=Object.keys(e).sort(sp);for(a=0;a<l.length;a++){var u=l[a];Ro(e[u],u,a,n,e,s,o),c[u]=e[u]}if(typeof i<"u")Ct.push([i,t,e]),i[t]=c;else return c}n.pop()}}function Ol(e){return e=typeof e<"u"?e:function(t,r){return r},function(t,r){if(wt.length>0)for(var n=0;n<wt.length;n++){var i=wt[n];if(i[1]===t&&i[0]===r){r=i[2],wt.splice(n,1);break}}return e.call(this,t,r)}}var Ml={},Er={},Bn={};Object.defineProperty(Bn,"__esModule",{value:!0});Bn.walletLogo=void 0;const op=(e,t)=>{let r;switch(e){case"standard":return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}
1' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=t,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7
1h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.8
11,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};Bn.walletLogo=op;var Fn={};Object.defineProperty(Fn,"__esModule",{value:!0});Fn.LINK_API_URL=void 0;Fn.LINK_API_URL="https://www.walletlink.org";var N={},Ir={},it={};Object.defineProperty(it,"__esModule",{value:!0});it.errorValues=it.standardErrorCodes=void 0;it.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}};it.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 jn={},Dn={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=e.getErrorCode=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=it,r="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(f,y=r){if(f&&Number.isInteger(f)){const S=f.toString();if(u(t.errorValues,S))return t.errorValues[S].message;if(c(f))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return y}e.getMessageFromCode=n;function i(f){if(!Number.isInteger(f))return!1;const y=f.toString();return!!(t.errorValues[y]||c(f))}e.isValidCode=i;function s(f){var y;if(typeof f=="number")return f;if(o(f))return(y=f.code)!==null&&y!==void 0?y:f.errorCode}e.getErrorCode=s;function o(f){return typeof f=="object"&&f!==null&&(typeof f.code=="number"||typeof f.errorCode=="number")}function a(f,{shouldIncludeStack:y=!1}={}){const S={};if(f&&typeof f=="object"&&!Array.isArray(f)&&u(f,"code")&&i(f.code)){const _=f;S.code=_.code,_.message&&typeof _.message=="string"?(S.message=_.message,u(_,"data")&&(S.data=_.data)):(S.message=n(S.code),S.data={originalError:l(f)})}else S.code=t.standardErrorCodes.rpc.internal,S.message=d(f,"message")?f.message:r,S.data={originalError:l(f)};return y&&(S.stack=d(f,"stack")?f.stack:void 0),S}e.serialize=a;function c(f){return f>=-32099&&f<=-32e3}function l(f){return f&&typeof f=="object"&&!Array.isArray(f)?Object.assign({},f):f}function u(f,y){return Object.prototype.hasOwnProperty.call(f,y)}function d(f,y){return typeof f=="object"&&f!==null&&y in f&&typeof f[y]=="string"}})(Dn);Object.defineProperty(jn,"__esModule",{value:!0});jn.standardErrors=void 0;const _e=it,Nl=Dn;jn.standardErrors={rpc:{parse:e=>xe(_e.standardErrorCodes.rpc.parse,e),invalidRequest:e=>xe(_e.standardErrorCodes.rpc.invalidRequest,e),invalidParams:e=>xe(_e.standardErrorCodes.rpc.invalidParams,e),methodNotFound:e=>xe(_e.standardErrorCodes.rpc.methodNotFound,e),internal:e=>xe(_e.standardErrorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code 
1<= -32005');return xe(t,e)},invalidInput:e=>xe(_e.standardErrorCodes.rpc.invalidInput,e),resourceNotFound:e=>xe(_e.standardErrorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>xe(_e.standardErrorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>xe(_e.standardErrorCodes.rpc.transactionRejected,e),methodNotSupported:e=>xe(_e.standardErrorCodes.rpc.methodNotSupported,e),limitExceeded:e=>xe(_e.standardErrorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>Lt(_e.standardErrorCodes.provider.userRejectedRequest,e),unauthorized:e=>Lt(_e.standardErrorCodes.provider.unauthorized,e),unsupportedMethod:e=>Lt(_e.standardErrorCodes.provider.unsupportedMethod,e),disconnected:e=>Lt(_e.standardErrorCodes.provider.disconnected,e),chainDisconnected:e=>Lt(_e.standardErrorCodes.provider.chainDisconnected,e),unsupportedChain:e=>Lt(_e.standardErrorCodes.provider.unsupportedChain,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new Bl(t,r,n)}}};function xe(e,t){const[r,n]=Ll(t);return new $l(e,r||(0,Nl.getMessageFromCode)(e),n)}function Lt(e,t){const[r,n]=Ll(t);return new Bl(e,r||(0,Nl.getMessageFromCode)(e),n)}function Ll(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;
1if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}let $l=class extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}},Bl=class extends $l{constructor(t,r,n){if(!ap(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};function ap(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}var Un={},or={};Object.defineProperty(or,"__esModule",{value:!0});or.isErrorResponse=void 0;function cp(e){return e.errorMessage!==void 0}or.isErrorResponse=cp;var ar={};Object.defineProperty(ar,"__esModule",{value:!0});ar.LIB_VERSION=void 0;ar.LIB_VERSION="3.9.3";Object.defineProperty(Un,"__esModule",{value:!0});Un.serializeError=void 0;const lp=or,up=ar,dp=it,fp=Dn;function hp(e,t){const r=(0,fp.serialize)(pp(e),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",up.LIB_VERSION),n.searchParams.set("code",r.code.toString());const i=gp(r.data,t);return i&&n.searchParams.set("method",i),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}Un.serializeError=hp;function pp(e){return typeof e=="string"?{message:e,code:dp.standardErrorCodes.rpc.internal}:(0,lp.isErrorResponse)(e)?Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method}}):e}function gp(e,t){const r=e==null?void 0:e.method;if(r)return r;if(t!==void 0){if(typeof t=="string")return t;if(Array.isArray(t)){if(t.length>0)return t[0].method}else return t.method}}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.standardErrors=e.standardErrorCodes=e.serializeError=e.getMessageFromCode=e.getErrorCode=void 0;const t=it;Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return t.standardErrorCodes}});const r=jn;Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=Un;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const i=Dn;Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return i.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return i.getMessageFromCode}})})(Ir);var pe={};Object.defineProperty(pe,"__esModule",{value:!0});pe.ProviderType=pe.RegExpString=pe.IntNumber=pe.BigIntString=pe.AddressString=pe.HexString=pe.OpaqueType=void 0;function Ar(){return e=>e}pe.OpaqueType=Ar;pe.HexString=Ar();pe.AddressString=Ar();pe.BigIntString=Ar();function yp(e){return Math.floor(e)}pe.IntNumber=yp;pe.RegExpString=Ar();var Ha;(function(e){e.CoinbaseWallet="CoinbaseWallet",e.MetaMask="MetaMask",e.Unselected=""})(Ha||(pe.ProviderType=Ha={}));var bp=B&&B.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(N,"__esModule",{value:!0});N.isMobileWeb=N.getLocation=N.isInIFrame=N.createQrUrl=N.getFavicon=N.range=N.isBigNumber=N.ensureParsedJSONObject=N.ensureBN=N.ensureRegExpString=N.ensureIntNumber=N.ensureBuffer=N.ensureAddressString=N.ensureEvenLengthHexString=N.ensureHexString=N.isHexString=N.prepend0x=N.strip0x=N.has0xPrefix=N.hexStringFromIntNumber=N.intNumberFromHexString=N.bigIntStringFromBN=N.hexStringFromBuffer=N.hexStringToUint8Array=N.uint8ArrayToHex=N.randomBytesHex=void 0;const ut=bp(Pn),It=Ir,Le=pe,Fl=/^[0-9]*$/,jl=/^[a-f0-9]*$/;function mp(e){return Dl(crypto.getRandomValues(new Uint8Array(e)))}N.randomBytesHex=mp;function Dl(e){return[...e].map(t=>t.toString(16).padStart(2,"0")).join("")}N.uint8ArrayToHex=Dl;function _p(e){return new Uint8Array(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}N.hexStringToUint8Array=_p;function vp(e,t=!1){const r=e.toString("hex");return(0,Le.HexString)(t?`0x${r}`:r)}N.hexStringFromBuffer=vp;function wp(e){return(0,Le.BigIntString)(e.toString(10))}N.bigIntStringFromBN=wp;function Ep(e){return(0,Le.IntNumber)(new ut.default(Pr(e,!1),16).toNumber())}N.intNumberFromHexString=Ep;function Sp(e){return(0,Le.HexString)(`0x${new ut.default(e).toString(16)}`)}N.hexStringFromIntNumber=Sp;function Ho(e){return e.startsWith("0x")||e.startsWith("0X")}N.has0xPrefix=Ho;function Hn(e){return Ho(e)?e.slice(2):e}N.strip0x=Hn;function Ul(e){return Ho(e)?`0x${e.slice(2)}`:`0x${e}`}N.prepend0x=Ul;function Tr(e){if(typeof e!="string")return!1;const t=Hn(e).toLowerCase();return jl.test(t)}N.isHexString=Tr;function Hl(e,t=!1){if(typeof e=="string"){const r=Hn(e).toLowerCase();if(jl.test(r))return(0,Le.HexString)(t?`0x${r}`:r)}throw It.standardErrors.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}N.ensureHexString=Hl;function Pr(e,t=!1){let r=Hl(e,!1);return r.length%2===1&&(r=(0,Le.HexString)(`0${r}`)),t?(0,Le.HexString)(`0x${r}`):r}N.ensureEvenLengthHexString=Pr;function Rp(e){if(typeof e=="string"){const t=Hn(e).toLowerCase();if(Tr(t)&&t.length===40)return(0,Le.AddressString)(Ul(t))}throw It.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)}N.ensureAddressString=Rp;function Cp(e){if(Buffer.isBuffer(e))return e;if(typeof e=="string"){if(Tr(e)){const t=Pr(e,!1);return Buffer.from(t,"hex")}return Buffer.from(e,"utf8")}throw It.standardErrors.rpc.invalidParams(`Not binary data: ${String(e)}`)}N.ensureBuffer=Cp;function Wl(e){if(typeof e=="number"&&Number.isInteger(e))return(0,Le.IntNumber)(e);if(typeof e=="string"){if(Fl.test(e))return(0,Le.IntNumber)(Number(e));if(Tr(e))return(0,Le.IntNumber)(new ut.default(Pr(e,!1),16).toNumber())}throw It.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}N.ensureIntNumber=Wl;function kp(e){if(e instanceof RegExp)return(0,Le.RegExpString)(e.toString());throw It.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(e)}`)}N.ensureRegExpString=kp;function Ip(e){if(e!==null&&(ut.default.isBN(e)||Vl(e)))return new ut.default(e.toString(10),10);if(typeof e=="number")return new ut.default(Wl(e));if(typeof e=="string"){if(Fl.test(e))return new ut.default(e,10);if(Tr(e))return new ut.default(Pr(e,!1),16)}throw It.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}N.ensureBN=Ip;function Ap(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw It.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(e)}`)}N.ensureParsedJSONObject=Ap;function Vl(e){if(e==null||typeof e.constructor!="function")return!1;const{constructor:t}=e;return typeof t.config=="function"&&typeof t.EUCLID=="number"}N.isBigNumber=Vl;function Tp(e,t){return Array.from({length:t-e},(r,n)=>e+n)}N.range=Tp;function Pp(){const e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:t,host:r}=document.location,n=e?e.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?t+n:`${t}//${r}${n}`}N.getFavicon=Pp;function xp(e,t,r,n,i,s){const o=n?"parent-id":"id",a=new URLSearchParams({[o]:e,secret:t,server:r,v:i,chainId:s.toString()}).toString();return`${r}/#/link?${a}`}N.createQrUrl=xp;function ql(){try{return window.frameElement!==null}catch{return!1}}N.isInIFrame=ql;function Op(){try{return ql()&&window.top?window.top.location:window.location}catch{return window.location}}
1N.getLocation=Op;function Mp(){var e;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((e=window==null?void 0:window.navigator)===null||e===void 0?void 0:e.userAgent)}N.isMobileWeb=Mp;var Wn={};Object.defineProperty(Wn,"__esModule",{value:!0});Wn.ScopedLocalStorage=void 0;class Np{constructor(t){this.scope=t}setItem(t,r){localStorage.setItem(this.scopedKey(t),r)}getItem(t){return localStorage.getItem(this.scopedKey(t))}removeItem(t){localStorage.removeItem(this.scopedKey(t))}clear(){const t=this.scopedKey(""),r=[];for(let n=0;n<localStorage.length;n++){const i=localStorage.key(n);typeof i=="string"&&i.startsWith(t)&&r.push(i)}r.forEach(n=>localStorage.removeItem(n))}scopedKey(t){return`${this.scope}:${t}`}}Wn.ScopedLocalStorage=Np;var Zt={};const Lp=ir(uf);var xr={},Or={},cr={};Object.defineProperty(cr,"__esModule",{value:!0});cr.EVENTS=void 0;cr.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 Ne={};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.RelayAbstract=Ne.APP_VERSION_KEY=Ne.LOCAL_STORAGE_ADDRESSES_KEY=Ne.WALLET_USER_NAME_KEY=void 0;const Wa=Ir;Ne.WALLET_USER_NAME_KEY="walletUsername";Ne.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";Ne.APP_VERSION_KEY="AppVersion";class $p{async makeEthereumJSONRPCRequest(t,r){if(!r)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(r,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{if(!n)throw Wa.standardErrors.rpc.parse({});const i=n,{error:s}=i;if(s)throw(0,Wa.serializeError)(s,t.method);return i})}}Ne.RelayAbstract=$p;var lr={},zl={exports:{}},Co={exports:{}};typeof Object.create=="function"?Co.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Co.exports=function(t,r){if(r){t.super_=r;var n=function(){};n.prototype=r.prototype,t.prototype=new n,t.prototype.constructor=t}};var We=Co.exports,Bp={}.toString,Fp=Array.isArray||function(e){return Bp.call(e)=="[object Array]"},Mr=TypeError,Gl=Object,jp=Error,Dp=EvalError,Up=RangeError,Hp=ReferenceError,Jl=SyntaxError,Wp=URIError,Vp=Math.abs,qp=Math.floor,zp=Math.max,Gp=Math.min,Jp=Math.pow,Zp=Math.round,Kp=Number.isNaN||function(t){return t!==t},Qp=Kp,Yp=function(t){return Qp(t)||t===0?t:t<0?-1:1},Xp=Object.getOwnPropertyDescriptor,_n=Xp;if(_n)try{_n([],"length")}catch{_n=null}var Nr=_n,vn=Object.defineProperty||!1;if(vn)try{vn({},"a",{value:1})}catch{vn=!1}var Vn=vn,xs,Va;function Zl(){return Va||(Va=1,xs=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var s in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var o=Object.getOwnPropertySymbols(t);if(o.length!==1||o[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(t,r);
1if(a.value!==i||a.enumerable!==!0)return!1}return!0}),xs}var Os,qa;function eg(){if(qa)return Os;qa=1;var e=typeof Symbol<"u"&&Symbol,t=Zl();return Os=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},Os}var Ms,za;function Kl(){return za||(za=1,Ms=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Ms}var Ns,Ga;function Ql(){if(Ga)return Ns;Ga=1;var e=Gl;return Ns=e.getPrototypeOf||null,Ns}var tg="Function.prototype.bind called on incompatible ",rg=Object.prototype.toString,ng=Math.max,ig="[object Function]",Ja=function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var s=0;s<r.length;s+=1)n[s+t.length]=r[s];return n},sg=function(t,r){for(var n=[],i=r,s=0;i<t.length;i+=1,s+=1)n[s]=t[i];return n},og=function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},ag=function(t){var r=this;if(typeof r!="function"||rg.apply(r)!==ig)throw new TypeError(tg+r);for(var n=sg(arguments,1),i,s=function(){if(this instanceof i){var u=r.apply(this,Ja(n,arguments));return Object(u)===u?u:this}return r.apply(t,Ja(n,arguments))},o=ng(0,r.length-n.length),a=[],c=0;c<o;c++)a[c]="$"+c;if(i=Function("binder","return function ("+og(a,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var l=function(){};l.prototype=r.prototype,i.prototype=new l,l.prototype=null}return i},cg=ag,Lr=Function.prototype.bind||cg,Wo=Function.prototype.call,Ls,Za;function Vo(){return Za||(Za=1,Ls=Function.prototype.apply),Ls}var lg=typeof Reflect<"u"&&Reflect&&Reflect.apply,ug=Lr,dg=Vo(),fg=Wo,hg=lg,Yl=hg||ug.call(fg,dg),pg=Lr,gg=Mr,yg=Wo,bg=Yl,qo=function(t){if(t.length<1||typeof t[0]!="function")throw new gg("a function is required");return bg(pg,yg,t)},$s,Ka;function mg(){if(Ka)return $s;Ka=1;var e=qo,t=Nr,r;try{r=[].__proto__===Array.prototype}catch(o){if(!o||typeof o!="object"||!("code"in o)||o.code!=="ERR_PROTO_ACCESS")throw o}var n=!!r&&t&&t(Object.prototype,"__proto__"),i=Object,s=i.getPrototypeOf;return $s=n&&typeof n.get=="function"?e([n.get]):typeof s=="function"?function(a){return s(a==null?a:i(a))}:!1,$s}var Bs,Qa;function Xl(){if(Qa)return Bs;Qa=1;var e=Kl(),t=Ql(),r=mg();return Bs=e?function(i){return e(i)}:t?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return t(i)}:r?function(i){return r(i)}:null,Bs}var Fs,Ya;function _g(){if(Ya)return Fs;Ya=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,r=Lr;return Fs=r.call(e,t),Fs}var Q,vg=Gl,wg=jp,Eg=Dp,Sg=Up,Rg=Hp,Kt=Jl,qt=Mr,Cg=Wp,kg=Vp,Ig=qp,Ag=zp,Tg=Gp,Pg=Jp,xg=Zp,Og=Yp,eu=Function,js=function(e){try{return eu('"use strict"; return ('+e+").constructor;")()}catch{}},Sr=Nr,Mg=Vn,Ds=function(){throw new qt},Ng=Sr?function(){try{return arguments.callee,Ds}catch{try{return Sr(arguments,"callee").get}catch{return Ds}}}():Ds,$t=eg()(),be=Xl(),Lg=Ql(),$g=Kl(),tu=Vo(),$r=Wo,Ut={},Bg=typeof Uint8Array>"u"||!be?Q:be(Uint8Array),St={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Q:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Q:ArrayBuffer,"%ArrayIteratorPrototype%":$t&&be?be([][Symbol.iterator]()):Q,"%AsyncFromSyncIteratorPrototype%":Q,"%AsyncFunction%":Ut,"%AsyncGenerator%":Ut,"%AsyncGeneratorFunction%":Ut,"%AsyncIteratorPrototype%":Ut,"%Atomics%":typeof Atomics>"u"?Q:Atomics,"%BigInt%":typeof BigInt>"u"?Q:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Q:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Q:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Q:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":wg,"%eval%":eval,"%EvalError%":Eg,"%Float16Array%":typeof Float16Array>"u"?Q:Float16Array,"%Float32Array%":typeof Float32Array>"u"?Q:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Q:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Q:FinalizationRegistry,"%Function%":eu,"%GeneratorFunction%":Ut,"%Int8Array%":typeof Int8Array>"u"?Q:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Q:Int16Array,"%Int32Array%":typeof Int32Array>
vendor: 4,959 bytes, line 1
1"u"?Q:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":$t&&be?be(be([][Symbol.iterator]())):Q,"%JSON%":typeof JSON=="object"?JSON:Q,"%Map%":typeof Map>"u"?Q:Map,"%MapIteratorPrototype%":typeof Map>"u"||!$t||!be?Q:be(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":vg,"%Object.getOwnPropertyDescriptor%":Sr,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Q:Promise,"%Proxy%":typeof Proxy>"u"?Q:Proxy,"%RangeError%":Sg,"%ReferenceError%":Rg,"%Reflect%":typeof Reflect>"u"?Q:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Q:Set,"%SetIteratorPrototype%":typeof Set>"u"||!$t||!be?Q:be(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Q:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":$t&&be?be(""[Symbol.iterator]()):Q,"%Symbol%":$t?Symbol:Q,"%SyntaxError%":Kt,"%ThrowTypeError%":Ng,"%TypedArray%":Bg,"%TypeError%":qt,"%Uint8Array%":typeof Uint8Array>"u"?Q:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Q:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Q:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Q:Uint32Array,"%URIError%":Cg,"%WeakMap%":typeof WeakMap>"u"?Q:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Q:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Q:WeakSet,"%Function.prototype.call%":$r,"%Function.prototype.apply%":tu,"%Object.defineProperty%":Mg,"%Object.getPrototypeOf%":Lg,"%Math.abs%":kg,"%Math.floor%":Ig,"%Math.max%":Ag,"%Math.min%":Tg,"%Math.pow%":Pg,"%Math.round%":xg,"%Math.sign%":Og,"%Reflect.getPrototypeOf%":$g};if(be)try{null.error}catch(e){var Fg=be(be(e));St["%Error.prototype%"]=Fg}var jg=function e(t){var r;if(t==="%AsyncFunction%")r=js("async function () {}");else if(t==="%GeneratorFunction%")r=js("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=js("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&be&&(r=be(i.prototype))}return St[t]=r,r},Xa={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Br=Lr,Rn=_g(),Dg=Br.call($r,Array.prototype.concat),Ug=Br.call(tu,Array.prototype.splice),ec=Br.call($r,String.prototype.replace),Cn=Br.call($r,String.prototype.slice),Hg=Br.call($r,RegExp.prototype.exec),Wg=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Vg=/\\(\\)?/g,qg=function(t){var r=Cn(t,0,1),n=Cn(t,-1);
1if(r==="%"&&n!=="%")throw new Kt("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Kt("invalid intrinsic syntax, expected opening `%`");var i=[];return ec(t,Wg,function(s,o,a,c){i[i.length]=a?ec(c,Vg,"$1"):o||s}),i},zg=function(t,r){var n=t,i;if(Rn(Xa,n)&&(i=Xa[n],n="%"+i[0]+"%"),Rn(St,n)){var s=St[n];if(s===Ut&&(s=jg(n)),typeof s>"u"&&!r)throw new qt("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new Kt("intrinsic "+t+" does not exist!")},ru=function(t,r){if(typeof t!="string"||t.length===0)throw new qt("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new qt('"allowMissing" argument must be a boolean');if(Hg(/^%?[^%]*%?$/,t)===null)throw new Kt("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=qg(t),i=n.length>0?n[0]:"",s=zg("%"+i+"%",r),o=s.name,a=s.value,c=!1,l=s.alias;l&&(i=l[0],Ug(n,Dg([0,1],l)));for(var u=1,d=!0;u<n.length;u+=1){var f=n[u],y=Cn(f,0,1),S=Cn(f,-1);if((y==='"'||y==="'"||y==="`"||S==='"'||S==="'"||S==="`")&&y!==S)throw new Kt("property names with quotes must have matching quotes");if((f==="constructor"||!d)&&(c=!0),i+="."+f,o="%"+i+"%",Rn(St,o))a=St[o];else if(a!=null){if(!(f in a)){if(!r)throw new qt("base intrinsic for "+t+" exists, but the property is not available.");return}if(Sr&&u+1>=n.length){var _=Sr(a,f);d=!!_,d&&"get"in _&&!("originalValue"in _.get)?a=_.get:a=a[f]}else d=Rn(a,f),a=a[f];d&&!c&&(St[o]=a)}}return a},nu=ru,iu=qo,Gg=iu([nu("%String.prototype.indexOf%")]),su=function(t,r){var n=nu(t,!!r);return typeof n=="function"&&Gg(t,".prototype.")>-1?iu([n]):n},Us,tc;function Jg(){if(tc)return Us;tc=1;var e=Function.prototype.toString,t=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,r,n;if(typeof t=="function"&&typeof Object.defineProperty=="function")try{r=Object.defineProperty({},"length",{get:function(){throw n}}),n={},t(function(){throw 42},null,r)}catch(m){m!==n&&(t=null)}else t=null;var i=/^\s*class\b/,s=function(b){try{var R=e.call(b);return i.test(R)}catch{return!1}},o=function(b){try{return s(b)?!1:(e.call(b),!0)}catch{return!1}},a=Object.prototype.toString,c="[object Object]",l="[object Function]",u="[object GeneratorFunction]",d="[object HTMLAllCollection]",f="[object HTML document.all class]",y="[object HTMLCollection]",S=typeof Symbol=="function"&&!!Symbol.toStringTag,_=!(0 in[,]),w=function(){return!1};if(typeof document=="object"){var p=document.all;a.call(p)===a.call(document.all)&&(w=function(b){if((_||!b)&&(typeof b>"u"||typeof b=="object"))try{var R=a.call(b);return(R===d||R===f||R===y||R===c)&&b("")==null}catch{}return!1})}return Us=t?function(b){if(w(b))return!0;if(!b||typeof b!="function"&&typeof b!="object")return!1;try{t(b,null,r)}catch(R){if(R!==n)return!1}return!s(b)&&o(b)}:function(b){if(w(b))return!0;if(!b||typeof b!="function"&&typeof b!="object")return!1;if(S)return o(b);if(s(b))return!1;var R=a.call(b);return R!==l&&R!==u&&!/^\[object HTML/.test(R)?!1:o(b)},Us}var Hs,rc;function Zg(){if(rc)return Hs;rc=1;var e=Jg(),t=Object.prototype.toString,r=Object.prototype.hasOwnProperty,n=function(c,l,u){for(var d=0,f=c.length;d<f;d++)r.call(c,d)&&(u==null?l(c[d],d,c):l.call(u,c[d],d,c))},i=function(c,l,u){for(var d=0,f=c.length;d<f;d++)u==null?l(c.charAt(d),d,c):l.call(u,c.charAt(d),d,c)},s=function(c,l,u){for(var d in c)r.call(c,d)&&(u==null?l(c[d],d,c):l.call(u,c[d],d,c))};function o(a){return t.call(a)==="[object Array]"}return Hs=function(c,l,u){if(!e(l))throw new TypeError("iterator must be a function");var d;arguments.length>=3&&(d=u),o(c)?n(c,l,d):typeof c=="string"?i(c,l,d):s(c,l,d)},Hs}var Ws,nc;function Kg(){return nc||(nc=1,Ws=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),Ws}var Vs,ic;function Qg(){if(ic)return Vs;ic=1;var e=Kg(),t=typeof globalThis>"u"?B:globalThis;return Vs=function(){for(var n=[],i=0;i<e.length;i++)typeof t[e[i]]=="function"&&(n[n.length]=e[i]);return n},Vs}var qs={exports:{}},zs,sc;
1function Yg(){if(sc)return zs;sc=1;var e=Vn,t=Jl,r=Mr,n=Nr;return zs=function(s,o,a){if(!s||typeof s!="object"&&typeof s!="function")throw new r("`obj` must be an object or a function`");if(typeof o!="string"&&typeof o!="symbol")throw new r("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new r("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new r("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new r("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new r("`loose`, if provided, must be a boolean");var c=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,d=arguments.length>6?arguments[6]:!1,f=!!n&&n(s,o);if(e)e(s,o,{configurable:u===null&&f?f.configurable:!u,enumerable:c===null&&f?f.enumerable:!c,value:a,writable:l===null&&f?f.writable:!l});else if(d||!c&&!l&&!u)s[o]=a;else throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},zs}var Gs,oc;function Xg(){if(oc)return Gs;oc=1;var e=Vn,t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return e([],"length",{value:1}).length!==1}catch{return!0}},Gs=t,Gs}var Js,ac;function e1(){if(ac)return Js;ac=1;var e=ru,t=Yg(),r=Xg()(),n=Nr,i=Mr,s=e("%Math.floor%");return Js=function(a,c){if(typeof a!="function")throw new i("`fn` is not a function");if(typeof c!="number"||c<0||c>4294967295||s(c)!==c)throw new i("`length` must be a positive 32-bit integer");var l=arguments.length>2&&!!arguments[2],u=!0,d=!0;if("length"in a&&n){var f=n(a,"length");f&&!f.configurable&&(u=!1),f&&!f.writable&&(d=!1)}return(u||d||!l)&&(r?t(a,"length",c,!0,!0):t(a,"length",c)),a},Js}var Zs,cc;function t1(){if(cc)return Zs;cc=1;var e=Lr,t=Vo(),r=Yl;return Zs=function(){return r(e,t,arguments)},Zs}var lc;function r1(){return lc||(lc=1,function(e){var t=e1(),r=Vn,n=qo,i=t1();e.exports=function(o){var a=n(arguments),c=1+o.length-(arguments.length-1);return t(a,c>0?c:0,!0)},r?r(e.exports,"apply",{value:i}):e.exports.apply=i}(qs)),qs.exports}var Ks,uc;function n1(){if(uc)return Ks;uc=1;var e=Zl();return Ks=function(){return e()&&!!Symbol.toStringTag},Ks}var Qs,dc;function i1(){if(dc)return Qs;dc=1;var e=Zg(),t=Qg(),r=r1(),n=su,i=Nr,s=Xl(),o=n("Object.prototype.toString"),a=n1()(),c=typeof globalThis>"u"?B:globalThis,l=t(),u=n("String.prototype.slice"),d=n("Array.prototype.indexOf",!0)||function(p,m){for(var b=0;b<p.length;b+=1)if(p[b]===m)return b;return-1},f={__proto__:null};a&&i&&s?e(l,function(w){var p=new c[w];if(Symbol.toStringTag in p&&s){var m=s(p),b=i(m,Symbol.toStringTag);if(!b&&m){var R=s(m);b=i(R,Symbol.toStringTag)}if(b&&b.get){var C=r(b.get);f["$"+w]=C}}}):e(l,function(w){var p=new c[w],m=p.slice||p.set;if(m){var b=r(m);f["$"+w]=b}});function y(w){var p=!1;return e(f,function(m,b){if(!p)try{"$"+m(w)===b&&(p=u(b,1))}catch{}}),p}function S(w){var p=!1;return e(f,function(m,b){if(!p)try{m(w),p=u(b,1)}catch{}}),p}function _(w){return d(l,w)>-1}return Qs=function(p){if(!p||typeof p!="object")return!1;if(!a){var m=u(o(p),8,-1);return _(m)?m:m!=="Object"?!1:S(p)}return i?y(p):null},Qs}var Ys,fc;function s1(){if(fc)return Ys;fc=1;var e=i1();return Ys=function(r){return!!e(r)},Ys}var o1=Mr,a1=su,c1=a1("TypedArray.prototype.buffer",!0),l1=s1(),u1=c1||function(t){if(!l1(t))throw new o1("Not a Typed Array");return t.buffer},De=ot.Buffer,d1=Fp,f1=u1,h1=ArrayBuffer.isView||function(t){try{return f1(t),!0}catch{return!1}},p1=typeof Uint8Array<"u",ou=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",g1=ou&&(De.prototype instanceof Uint8Array||De.TYPED_ARRAY_SUPPORT),y1=function(t,r){if(De.isBuffer(t))return t.constructor&&!("isBuffer"in t)?De.from(t):t;if(typeof t=="string")return De.from(t,r);if(ou&&h1(t)){if(t.byteLength===0)return De.alloc(0);if(g1){var n=De.from(t.buffer,t.byteOffset,t.byteLength);if(n.byteLength===t.byteLength)return n}var i=t instanceof Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),s=De.from(i);if(s.length===t.byteLength)return s}if(p1&&t instanceof Uint8Array)return De.from(t);var o=d1(t);if(o)for(var a=0;a<t.length;a+=1){var c=t[a];if(typeof c!="number"||c<0||c>255||~~c!==c)throw new RangeError("Array items must be numbers in the range 0-255.")}if(o||De.isBuffer(t)&&t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t))return De.from(t);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')},b1=ot.Buffer,m1=y1;function qn(e,t){this._block=b1.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}qn.prototype.update=function(e,t){e=m1(e,t||"utf8");for(var r=this._block,n=this._blockSize,i=e.length,s=this._len,o=0;o<i;){for(var a=s%n,c=Math.min(i-o,n-a),l=0;l<c;l++)r[a+l]=e[o+l];s+=c,o+=c,s%n===0&&this._update(r)}return this._len+=i,this};qn.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(r&4294967295)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var s=this._hash();return e?s.toString(e):s};qn.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var ur=qn,_1=We,au=ur,v1=ot.Buffer,w1=[1518500249,1859775393,-1894007588,-899497514],E1=new Array(80);function Fr(){this.init(),this._w=E1,au.call(this,64,56)}_1(Fr,au);Fr.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function S1(e){return e<<5|e>>>27}function R1(e){return e<<30|e>>>2}function C1(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}Fr.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=0;a<16;++a)t[a]=e.readInt32BE(a*4);for(;a<80;++a)t[a]=t[a-3]^t[a-8]^t[a-14]^t[a-16];for(var c=0;c<80;++c){var l=~~(c/20),u=S1(r)+C1(l,n,i,s)+o+t[c]+w1[l]|0;o=s,s=i,i=R1(n),n=r,r=u}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0};Fr.prototype._hash=function(){var e=v1.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var k1=Fr,I1=We,cu=ur,A1=ot.Buffer,T1=[1518500249,1859775393,-1894007588,-899497514],P1=new Array(80);function jr(){this.init(),this._w=P1,cu.call(this,64,56)}I1(jr,cu);jr.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function x1(e){return e<<1|e>>>31}function O1(e){return e<<5|e>>>27}function M1(e){return e<<30|e>>>2}function N1(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}jr.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=0;a<16;++a)t[a]=e.readInt32BE(a*4);for(;a<80;++a)t[a]=x1(t[a-3]^t[a-8]^t[a-14]^t[a-16]);for(var c=0;c<80;++c){var l=~~(c/20),u=O1(r)+N1(l,n,i,s)+o+t[c]+T1[l]|0;o=s,s=i,i=M1(n),n=r,r=u}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0};jr.prototype._hash=function(){var e=A1.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var L1=jr,$1=We,lu=ur,B1=ot.Buffer,F1=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756
1734187,3204031479,3329325298],j1=new Array(64);function Dr(){this.init(),this._w=j1,lu.call(this,64,56)}$1(Dr,lu);Dr.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 D1(e,t,r){return r^e&(t^r)}function U1(e,t,r){return e&t|r&(e|t)}function H1(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function W1(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function V1(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function q1(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}Dr.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=this._f|0,c=this._g|0,l=this._h|0,u=0;u<16;++u)t[u]=e.readInt32BE(u*4);for(;u<64;++u)t[u]=q1(t[u-2])+t[u-7]+V1(t[u-15])+t[u-16]|0;for(var d=0;d<64;++d){var f=l+W1(o)+D1(o,a,c)+F1[d]+t[d]|0,y=H1(r)+U1(r,n,i)|0;l=c,c=a,a=o,o=s+f|0,s=i,i=n,n=r,r=f+y|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0,this._f=a+this._f|0,this._g=c+this._g|0,this._h=l+this._h|0};Dr.prototype._hash=function(){var e=B1.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var uu=Dr,z1=We,G1=uu,J1=ur,Z1=ot.Buffer,K1=new Array(64);function zn(){this.init(),this._w=K1,J1.call(this,64,56)}z1(zn,G1);zn.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};zn.prototype._hash=function(){var e=Z1.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var Q1=zn,Y1=We,du=ur,X1=ot.Buffer,hc=[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,
11126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],ey=new Array(160);function Ur(){this.init(),this._w=ey,du.call(this,128,112)}Y1(Ur,du);Ur.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 pc(e,t,r){return r^e&(t^r)}function gc(e,t,r){return e&t|r&(e|t)}function yc(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function bc(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function ty(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function ry(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function ny(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function iy(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function ye(e,t){return e>>>0<t>>>0?1:0}Ur.prototype._update=function(e){for(var t=this._w,r=this._ah|0,n=this._bh|0,i=this._ch|0,s=this._dh|0,o=this._eh|0,a=this._fh|0,c=this._gh|0,l=this._hh|0,u=this._al|0,d=this._bl|0,f=this._cl|0,y=this._dl|0,S=this._el|0,_=this._fl|0,w=this._gl|0,p=this._hl|0,m=0;m<32;m+=2)t[m]=e.readInt32BE(m*4),t[m+1]=e.readInt32BE(m*4+4);for(;m<160;m+=2){var b=t[m-30],R=t[m-15*2+1],C=ty(b,R),T=ry(R,b);b=t[m-2*2],R=t[m-2*2+1];var H=ny(b,R),F=iy(R,b),L=t[m-7*2],Y=t[m-7*2+1],ae=t[m-16*2],ie=t[m-16*2+1],se=T+Y|0,P=C+L+ye(se,T)|0;se=se+F|0,P=P+H+ye(se,F)|0,se=se+ie|0,P=P+ae+ye(se,ie)|0,t[m]=P,t[m+1]=se}for(var I=0;I<160;I+=2){P=t[I],se=t[I+1];var $=gc(r,n,i),O=gc(u,d,f),j=yc(r,u),M=yc(u,r),U=bc(o,S),Z=bc(S,o),W=hc[I],K=hc[I+1],de=pc(o,a,c),re=pc(S,_,w),v=p+Z|0,E=l+U+ye(v,p)|0;v=v+re|0,E=E+de+ye(v,re)|0,v=v+K|0,E=E+W+ye(v,K)|0,v=v+se|0,E=E+P+ye(v,se)|0;var A=M+O|0,D=j+$+ye(A,M)|0;l=c,p=w,c=a,w=_,a=o,_=S,S=y+v|0,o=s+E+ye(S,y)|0,s=i,y=f,i=n,f=d,n=r,d=u,u=v+A|0,r=E+D+ye(u,v)|0}this._al=this._al+u|0,this._bl=this._bl+d|0,this._cl=this._cl+f|0,this._dl=this._dl+y|0,this._el=this._el+S|0,this._fl=this._fl+_|0,this._gl=this._gl+w|0,this._hl=this._hl+p|0,this._ah=this._ah+r+ye(this._al,u)|0,this._bh=this._bh+n+ye(this._bl,d)|0,this._ch=this._ch+i+ye(this._cl,f)|0,this._dh=this._dh+s+ye(this._dl,y)|0,this._eh=this._eh+o+ye(this._el,S)|0,this._fh=this._fh+a+ye(this._fl,_)|0,this._gh=this._gh+c+ye(this._gl,w)|0,this._hh=this._hh+l+ye(this._hl,p)|0};Ur.prototype._hash=function(){var e=X1.allocUnsafe(64);function t(r,n,i){e.writeInt32BE(r,i),e.writeInt32BE(n,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var fu=Ur,sy=We,oy=fu,ay=ur,cy=ot.Buffer,ly=new Array(160);function Gn(){this.init(),this._w=ly,ay.call(this,128,112)}sy(Gn,oy);Gn.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};Gn.prototype._hash=function(){var e=cy.allocUnsafe(48);function t(r,n,i){e.writeInt32BE(r,i),e.writeInt32BE(n,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var uy=Gn;(function(e){e.exports=function(r){var n=r.toLowerCase(),i=e.exports[n];if(!i)throw new Error(n+" is not supported (we accept pull requests)");return new i},e.exports.sha=k1,e.exports.sha1=L1,e.exports.sha224=Q1,e.exports.sha256=uu,e.exports.sha384=uy,e.exports.sha512=fu})(zl);var dy=zl.exports;Object.defineProperty(lr,"__esModule",{value:!0});lr.Session=void 0;const mc=dy,_c=N,vc="session:id",wc="session:secret",Ec="session:linked";class zo{constructor(t,r,n,i){this._storage=t,this._id=r||(0,_c.randomBytesHex)(16),this._secret=n||(0,_c.randomBytesHex)(32),this._key=new mc.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(t){const r=t.getItem(vc),n=t.getItem(Ec),i=t.getItem(wc);return r&&i?new zo(t,r,i,n==="1"):null}static hash(t){return new mc.sha256().update(t).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(t){this._linked=t,this.persistLinked()}save(){return this._storage.setItem(vc,this._id),this._storage.setItem(wc,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(Ec,this._linked?"1":"0")}}lr.Session=zo;var Jn={},Zn={};Object.defineProperty(Zn,"__esModule",{value:!0});Zn.Cipher=void 0;const un=N;class fy{constructor(t){this.secret=t}async encrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),i=await crypto.subtle.importKey("raw",(0,un.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=new TextEncoder,o=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},i,s.encode(t)),a=16,c=o.slice(o.byteLength-a),l=o.slice(0,o.byteLength-a),u=new Uint8Array(c),d=new Uint8Array(l),f=new Uint8Array([...n,...u,...d]);return(0,un.uint8ArrayToHex)(f)}async decrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");return new Promise((n,i)=>{(async function(){const s=await crypto.subtle.importKey("raw",(0,un.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),o=(0,un.hexStringToUint8Array)(t),a=o.slice(0,12),c=o.slice(12,28),l=o.slice(28),u=new Uint8Array([...l,...c]),d={name:"AES-GCM",iv:new Uint8Array(a)};try{const f=await window.crypto.subtle.decrypt(d,s,u),y=new TextDecoder;n(y.decode(f))}catch(f){i(f)}})()})}}Zn.Cipher=fy;var Kn={};Object.defineProperty(Kn,"__esModule",{value:!0});Kn.WalletLinkHTTP=void 0;class hy{constructor(t,r,n){this.linkAPIUrl=t,this.sessionId=r;const i=`${r}:${n}`;this.auth=`Basic ${btoa(i)}`}async markUnseenEventsAsSeen(t){return Promise.all(t.map(r=>fetch(`${this.linkAPIUrl}/events/${r.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(r=>console.error("Unabled to mark event as failed:",r))}async fetchUnseenEvents(){var t;const r=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(r.ok){const{events:n,error:i}=await r.json();if(i)throw new Error(`Check unseen events failed: ${i}`);const s=(t=n==null?void 0:n.filter(o=>o.event==="Web3Response").map(o=>({type:"Event",sessionId:this.sessionId,eventId:o.id,event:o.event,data:o.data})))!==null&&t!==void 0?t:[];return this.markUnseenEventsAsSeen(s),s}throw new Error(`Check unseen events failed: ${r.status}`)}}Kn.WalletLinkHTTP=hy;var Qt={};
1Object.defineProperty(Qt,"__esModule",{value:!0});Qt.WalletLinkWebSocket=Qt.ConnectionState=void 0;var Wt;(function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"})(Wt||(Qt.ConnectionState=Wt={}));class py{setConnectionStateListener(t){this.connectionStateListener=t}setIncomingDataListener(t){this.incomingDataListener=t}constructor(t,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.pendingData=[],this.url=t.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((t,r)=>{var n;let i;try{this.webSocket=i=new this.WebSocketClass(this.url)}catch(s){r(s);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,Wt.CONNECTING),i.onclose=s=>{var o;this.clearWebSocket(),r(new Error(`websocket error ${s.code}: ${s.reason}`)),(o=this.connectionStateListener)===null||o===void 0||o.call(this,Wt.DISCONNECTED)},i.onopen=s=>{var o;t(),(o=this.connectionStateListener)===null||o===void 0||o.call(this,Wt.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(c=>this.sendData(c)),this.pendingData=[])},i.onmessage=s=>{var o,a;if(s.data==="h")(o=this.incomingDataListener)===null||o===void 0||o.call(this,{type:"Heartbeat"});else try{const c=JSON.parse(s.data);(a=this.incomingDataListener)===null||a===void 0||a.call(this,c)}catch{}}})}disconnect(){var t;const{webSocket:r}=this;if(r){this.clearWebSocket(),(t=this.connectionStateListener)===null||t===void 0||t.call(this,Wt.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{r.close()}catch{}}}sendData(t){const{webSocket:r}=this;if(!r){this.pendingData.push(t),this.connect();return}r.send(t)}clearWebSocket(){const{webSocket:t}=this;t&&(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}}Qt.WalletLinkWebSocket=py;Object.defineProperty(Jn,"__esModule",{value:!0});Jn.WalletLinkConnection=void 0;const Bt=pe,gy=Zn,qe=cr,Sc=Ne,Ft=lr,yy=Kn,dn=Qt,Rc=1e4,by=6e4;class my{constructor({session:t,linkAPIUrl:r,listener:n,diagnostic:i,WebSocketClass:s=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,Bt.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=a=>{if(!a)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",l=>a.JsonRpcUrl&&this.handleChainUpdated(l,a.JsonRpcUrl)]]).forEach((l,u)=>{const d=a[u];d!==void 0&&l(d)})},this.handleDestroyed=a=>{var c,l;a==="1"&&((c=this.listener)===null||c===void 0||c.resetAndReload(),(l=this.diagnostic)===null||l===void 0||l.log(qe.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:Ft.Session.hash(this.session.id)}))},this.handleAccountUpdated=async a=>{var c,l;try{const u=await this.cipher.decrypt(a);(c=this.listener)===null||c===void 0||c.accountUpdated(u)}catch{(l=this.diagnostic)===null||l===void 0||l.log(qe.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(a,c)=>{var l,u;try{const d=await this.cipher.decrypt(c);(l=this.listener)===null||l===void 0||l.metadataUpdated(a,d)}catch{(u=this.diagnostic)===null||u===void 0||u.log(qe.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:a})}},this.handleWalletUsernameUpdated=async a=>{this.handleMetadataUpdated(Sc.WALLET_USER_NAME_KEY,a)},this.handleAppVersionUpdated=async a=>{this.handleMetadataUpdated(Sc.APP_VERSION_KEY,a)},this.handleChainUpdated=async(a,c)=>{var l,u;try{const d=await this.cipher.decrypt(a),f=await this.cipher.decrypt(c);(l=this.listener)===null||l===void 0||l.chainUpdated(d,f)}catch{(u=this.diagnostic)===null||u===void 0||u.log(qe.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=t,this.cipher=new gy.Cipher(t.secret),this.diagnostic=i,this.listener=n;const o=new dn.WalletLinkWebSocket(`${r}/rpc`,s);o.setConnectionStateListener(async a=>{var c;(c=this.diagnostic)===null||c===void 0||c.log(qe.EVENTS.CONNECTED_STATE_CHANGE,{state:a,sessionIdHash:Ft.Session.hash(t.id)});let l=!1;switch(a){case dn.ConnectionState.DISCONNECTED:if(!this.destroyed){const u=async()=>{await new Promise(d=>setTimeout(d,5e3)),this.destroyed||o.connect().catch(()=>{u()})};u()}break;case dn.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),l=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},Rc),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case dn.ConnectionState.CONNECTING:break}this.connected!==l&&(this.connected=l)}),o.setIncomingDataListener(a=>{var c,l,u;switch(a.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const d=a.type==="IsLinkedOK"?a.linked:void 0;(c=this.diagnostic)===null||c===void 0||c.log(qe.EVENTS.LINKED,{sessionIdHash:Ft.Session.hash(t.id),linked:d,type:a.type,onlineGuests:a.onlineGuests}),this.linked=d||a.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(l=this.diagnostic)===null||l===void 0||l.log(qe.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:Ft.Session.hash(t.id),metadata_keys:a&&a.metadata?Object.keys(a.metadata):void 0}),this.handleSessionMetadataUpdated(a.metadata);break}case"Event":{this.handleIncomingEvent(a);break}}a.id!==void 0&&((u=this.requestResolutions.get(a.id))===null||u===void 0||u(a))}),this.ws=o,this.http=new yy.WalletLinkHTTP(r,t.id,t.key)}connect(){var t;if(this.destroyed)throw new Error("instance is destroyed");(t=this.diagnostic)===null||t===void 0||t.log(qe.EVENTS.STARTED_CONNECTING,{sessionIdHash:Ft.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var t;this.destroyed=!0,this.ws.disconnect(),(t=this.diagnostic)===null||t===void 0||t.log(qe.EVENTS.DISCONNECTED,{sessionIdHash:Ft.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(t){var r,n;this._connected=t,t&&((r=this.onceConnected)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.connectedUpdated(t)}setOnceConnected(t){return new Promise(r=>{this.connected?t().then(r):this.onceConnected=()=>{t().then(r),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(t){var r,n;this._linked=t,t&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(t)}setOnceLinked(t){return new Promise(r=>{this.linked?t().then(r):this.onceLinked=()=>{t().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(t){var r,n;if(!(t.type!=="Event"||t.event!=="Web3Response"))try{const i=await this.cipher.decrypt(t.data),s=JSON.parse(i);if(s.type!=="WEB3_RESPONSE")return;(r=this.listener)===null||r===void 0||r.handleWeb3ResponseMessage(s)}catch{(n=this.diagnostic)===null||n===void 0||n.log(qe.EVENTS.GENERAL_ER
1ROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(t=>setTimeout(t,250));try{await this.fetchUnseenEventsAPI()}catch(t){console.error("Unable to check for unseen events",t)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(r=>this.handleIncomingEvent(r))}async setSessionMetadata(t,r){const n={type:"SetSessionConfig",id:(0,Bt.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[t]:r}};return this.setOnceConnected(async()=>{const i=await this.makeRequest(n);if(i.type==="Fail")throw new Error(i.error||"failed to set session metadata")})}async publishEvent(t,r,n=!1){const i=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),s={type:"PublishEvent",id:(0,Bt.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:t,data:i,callWebhook:n};return this.setOnceLinked(async()=>{const o=await this.makeRequest(s);if(o.type==="Fail")throw new Error(o.error||"failed to publish event");return o.eventId})}sendData(t){this.ws.sendData(JSON.stringify(t))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>Rc*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(t,r=by){const n=t.id;this.sendData(t);let i;return Promise.race([new Promise((s,o)=>{i=window.setTimeout(()=>{o(new Error(`request ${n} timed out`))},r)}),new Promise(s=>{this.requestResolutions.set(n,o=>{clearTimeout(i),s(o),this.requestResolutions.delete(n)})})])}async authenticate(){const t={type:"HostSession",id:(0,Bt.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(t);if(r.type==="Fail")throw new Error(r.error||"failed to authentcate")}sendIsLinked(){const t={type:"IsLinked",id:(0,Bt.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}sendGetSessionConfig(){const t={type:"GetSessionConfig",id:(0,Bt.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}}Jn.WalletLinkConnection=my;var Hr={},Wr={},Go={};Object.defineProperty(Go,"__esModule",{value:!0});Go.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}';
1var _y=B&&B.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Wr,"__esModule",{value:!0});Wr.injectCssReset=void 0;const vy=_y(Go);function wy(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(vy.default)),document.documentElement.appendChild(e)}Wr.injectCssReset=wy;var Qn={};const ke=ir(cf);var Yn={};function hu(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=hu(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function Cc(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=hu(e))&&(n&&(n+=" "),n+=t);return n}const Ey=Object.freeze(Object.defineProperty({__proto__:null,clsx:Cc,default:Cc},Symbol.toStringTag,{value:"Module"})),Vr=ir(Ey),Xn=ir(lf);var Yt={},ei={};Object.defineProperty(ei,"__esModule",{value:!0});ei.CloseIcon=void 0;const kc=ke;function Sy(e){return(0,kc.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,kc.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"}))}ei.CloseIcon=Sy;var ti={};Object.defineProperty(ti,"__esModule",{value:!0});ti.CoinbaseWalletRound=void 0;const fn=ke;function Ry(e){return(0,fn.h)("svg",Object.assign({width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,fn.h)("circle",{cx:"14",cy:"14",r:"14",fill:"#0052FF"}),(0,fn.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,fn.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"}))}ti.CoinbaseWalletRound=Ry;var ri={};Object.defineProperty(ri,"__esModule",{value:!0});ri.QRCodeIcon=void 0;const br=ke;function Cy(e){return(0,br.h)("svg",Object.assign({width:"18",height:"18",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),(0,br.h)("path",{d:"M3 3V8.99939L5 8.99996V5H9V3H3Z"}),(0,br.h)("path",{d:"M15 21L21 21V15.0006L19 15V19L15 19V21Z"}),(0,br.h)("path",{d:"M21 9H19V5H15.0006L15 3H21V9Z"}),(0,br.h)("path",{d:"M3 15V21H8.99939L8.99996 19H5L5 15H3Z"}))}ri.QRCodeIcon=Cy;var ni={};function pu(e){this.mode=Te.MODE_8BIT_BYTE,this.data=e,this.parsedData=[];for(var t=0,r=this.data.length;t<r;t++){var n=[],i=this.data.charCodeAt(t);i>65536?(n[0]=240|(i&1835008)>>>18,n[1]=128|(i&258048)>>>12,n[2]=128|(i&4032)>>>6,n[3]=128|i&63):i>2048?(n[0]=224|(i&61440)>>>12,n[1]=128|(i&4032)>>>6,n[2]=128|i&63):i>128?(n[0]=192|(i&1984)>>>6,n[1]=128|i&63):n[0]=i,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}pu.prototype={getLength:function(e){return this.parsedData.length},write:function(e){for(var t=0,r=this.parsedData.length;t<r;t++)e.put(this.parsedData[t],8)}};function Qe(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}Qe.prototype={addData:function(e){var t=new pu(e);this.dataList.push(t),this.dataCache=null},isDark:function(e,t){if(e<0||this.moduleCount<=e||t<0||this.moduleCount<=t)throw new Error(e+","+t);return this.modules[e][t]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(e,t){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++)this.modules[r][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(e,t),this.typeNumber>=7&&this.setupTypeNumber(e),this.dataCache==null&&(this.dataCache=Qe.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var r=-1;r<=7;r++)if(!(e+r<=-1||this.moduleCount<=e+r))for(var n=-1;n<=7;n++)t+n<=-1||this.moduleCount<=t+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[e+r][t+n]=!0:this.modules[e+r][t+n]=!1)},getBestMaskPattern:function(){for(var e=0,t=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=le.getLostPoint(this);(r==0||e>n)&&(e=n,t=r)}return t},createMovieClip:function(e,t,r){var n=e.createEmptyMovieClip(t,r),i=1;this.make();for(var s=0;s<this.modules.length;s++)for(var o=s*i,a=0;a<this.modules[s].length;a++){var c=a*i,l=this.modules[s][a];l&&(n.beginFill(0,100),n.moveTo(c,o),n.lineTo(c+i,o),n.lineTo(c+i,o+i),n.lineTo(c,o+i),n.endFill())}return n},setupTimingPattern:function(){for(var e=8;e<this.moduleCount-8;e++)this.modules[e][6]==null&&(this.modules[e][6]=e%2==0);for(var t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)},setupPositionAdjustPattern:function(){for(var e=le.getPatternPosition(this.typeNumber),t=0;t<e.length;t++)for(var r=0;r<e.length;r++){var n=e[t],i=e[r];if(this.modules[n][i]==null)for(var s=-2;s<=2;s++)for(var o=-2;o<=2;o++)s==-2||s==2||o==-2||o==2||s==0&&o==0?this.modules[n+s][i+o]=!0:this.modules[n+s][i+o]=!1}},setupTypeNumber:function(e){for(var t=le.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(e,t){for(var r=this.errorCorrectLevel<<3|t,n=le.getBCHTypeInfo(r),i=0;i<15;i++){var s=!e&&(n>>i&1)==1;i<6?this.modules[i][8]=s:i<8?this.modules[i+1][8]=s:this.modules[this.moduleCount-15+i][8]=s}for(var i=0;i<15;i++){var s=!e&&(n>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=s:i<9?this.modules[8][15-i-1+1]=s:this.modules[8][15-i-1]=s}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var r=-1,n=this.moduleCount-1,i=7,s=0,o=this.moduleCount-1;o>0;o-=2)for(o==6&&o--;;){for(var a=0;a<2;a++)if(this.modules[n][o-a]==null){var c=!1;s<e.length&&(c=(e[s]>>>i&1)==1);var l=le.getMask(t,n,o-a);l&&(c=!c),this.modules[n][o-a]=c,i--,i==-1&&(s++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};Qe.PAD0=236;Qe.PAD1=17;Qe.createData=function(e,t,r){for(var n=Ke.getRSBlocks(e,t),i=new gu,s=0;s<r.length;s++){var o=r[s];i.put(o.mode,4),i.put(o.getLength(),le.getLengthInBits(o.mode,e)),o.write(i)}for(var a=0,s=0;s<n.length;s++)a+=n[s].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(Qe.PAD0,8),i.getLengthInBits()>=a*8));)i.put(Qe.PAD1,8);return Qe.createBytes(i,n)};Qe.createBytes=function(e,t){for(var r=0,n=0,i=0,s=new Array(t.length),o=new Array(t.length),a=0;a<t.length;a++){var c=t[a].dataCount,l=t[a].totalCount-c;n=Math.max(n,c),i=Math.max(i,l),s[a]=new Array(c);for(var u=0;u<s[a].length;u++)s[a][u]=255&e.buffer[u+r];r+=c;var d=le.getErrorCorrectPolynomial(l),f=new zt(s[a],d.getLength()-1),y=f.mod(d);o[a]=new Array(d.getLength()-1);for(var u=0;u<o[a].length;u++){var S=u+y.getLength()-o[a].length;o[a][u]=S>=0?y.get(S):0}}for(var _=0,u=0;u<t.length;u++)_+=t[u].totalCount;for(var w=new Array(_),p=0,u=0;u<n;u++)for(var a=0;a<t.length;a++)u<s[a].length&&(w[p++]=s[a][u]);for(var u=0;u<i;u++)for(var a=0;a<t.length;a++)u<o[a].length&&(w[p++]=o[a][u]);return w};var Te={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},dt={L:1,M:0,Q:3,H:2},ct={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},le={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(e){for(var t=e<<10;
vendor: 4,102 bytes, line 1
1le.getBCHDigit(t)-le.getBCHDigit(le.G15)>=0;)t^=le.G15<<le.getBCHDigit(t)-le.getBCHDigit(le.G15);return(e<<10|t)^le.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;le.getBCHDigit(t)-le.getBCHDigit(le.G18)>=0;)t^=le.G18<<le.getBCHDigit(t)-le.getBCHDigit(le.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;e!=0;)t++,e>>>=1;return t},getPatternPosition:function(e){return le.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,r){switch(e){case ct.PATTERN000:return(t+r)%2==0;case ct.PATTERN001:return t%2==0;case ct.PATTERN010:return r%3==0;case ct.PATTERN011:return(t+r)%3==0;case ct.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case ct.PATTERN101:return t*r%2+t*r%3==0;case ct.PATTERN110:return(t*r%2+t*r%3)%2==0;case ct.PATTERN111:return(t*r%3+(t+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new zt([1],0),r=0;r<e;r++)t=t.multiply(new zt([1,me.gexp(r)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){case Te.MODE_NUMBER:return 10;case Te.MODE_ALPHA_NUM:return 9;case Te.MODE_8BIT_BYTE:return 8;case Te.MODE_KANJI:return 8;default:throw new Error("mode:"+e)}else if(t<27)switch(e){case Te.MODE_NUMBER:return 12;case Te.MODE_ALPHA_NUM:return 11;case Te.MODE_8BIT_BYTE:return 16;case Te.MODE_KANJI:return 10;default:throw new Error("mode:"+e)}else if(t<41)switch(e){case Te.MODE_NUMBER:return 14;case Te.MODE_ALPHA_NUM:return 13;case Te.MODE_8BIT_BYTE:return 16;case Te.MODE_KANJI:return 12;default:throw new Error("mode:"+e)}else throw new Error("type:"+t)},getLostPoint:function(e){for(var t=e.getModuleCount(),r=0,n=0;n<t;n++)for(var i=0;i<t;i++){for(var s=0,o=e.isDark(n,i),a=-1;a<=1;a++)if(!(n+a<0||t<=n+a))for(var c=-1;c<=1;c++)i+c<0||t<=i+c||a==0&&c==0||o==e.isDark(n+a,i+c)&&s++;s>5&&(r+=3+s-5)}for(var n=0;n<t-1;n++)for(var i=0;i<t-1;i++){var l=0;e.isDark(n,i)&&l++,e.isDark(n+1,i)&&l++,e.isDark(n,i+1)&&l++,e.isDark(n+1,i+1)&&l++,(l==0||l==4)&&(r+=3)}for(var n=0;n<t;n++)for(var i=0;i<t-6;i++)e.isDark(n,i)&&!e.isDark(n,i+1)&&e.isDark(n,i+2)&&e.isDark(n,i+3)&&e.isDark(n,i+4)&&!e.isDark(n,i+5)&&e.isDark(n,i+6)&&(r+=40);for(var i=0;i<t;i++)for(var n=0;n<t-6;n++)e.isDark(n,i)&&!e.isDark(n+1,i)&&e.isDark(n+2,i)&&e.isDark(n+3,i)&&e.isDark(n+4,i)&&!e.isDark(n+5,i)&&e.isDark(n+6,i)&&(r+=40);for(var u=0,i=0;i<t;i++)for(var n=0;n<t;n++)e.isDark(n,i)&&u++;var d=Math.abs(100*u/t/t-50)/5;return r+=d*10,r}},me={glog:function(e){if(e<1)throw new Error("glog("+e+")");return me.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return me.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var ve=0;ve<8;ve++)me.EXP_TABLE[ve]=1<<ve;for(var ve=8;ve<256;ve++)me.EXP_TABLE[ve]=me.EXP_TABLE[ve-4]^me.EXP_TABLE[ve-5]^me.EXP_TABLE[ve-6]^me.EXP_TABLE[ve-8];for(var ve=0;ve<255;ve++)me.LOG_TABLE[me.EXP_TABLE[ve]]=ve;function zt(e,t){if(e.length==null)throw new Error(e.length+"/"+t);for(var r=0;r<e.length&&e[r]==0;)r++;this.num=new Array(e.length-r+t);for(var n=0;n<e.length-r;n++)this.num[n]=e[n+r]}zt.prototype={get:function(e){return this.num[e]},getLength:function(){return this.num.length},multiply:function(e){for(var t=new Array(this.getLength()+e.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<e.getLength();n++)t[r+n]^=me.gexp(me.glog(this.get(r))+me.glog(e.get(n)));return new zt(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=me.glog(this.get(0))-me.glog(e.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(var n=0;n<e.getLength();n++)r[n]^=me.gexp(me.glog(e.get(n))+t);return new zt(r,0).mod(e)}};function Ke(e,t){this.totalCount=e,this.dataCount=t}Ke.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
1],[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]];Ke.getRSBlocks=function(e,t){var r=Ke.getRsBlockTable(e,t);if(r==null)throw new Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);for(var n=r.length/3,i=[],s=0;s<n;s++)for(var o=r[s*3+0],a=r[s*3+1],c=r[s*3+2],l=0;l<o;l++)i.push(new Ke(a,c));return i};Ke.getRsBlockTable=function(e,t){switch(t){case dt.L:return Ke.RS_BLOCK_TABLE[(e-1)*4+0];case dt.M:return Ke.RS_BLOCK_TABLE[(e-1)*4+1];case dt.Q:return Ke.RS_BLOCK_TABLE[(e-1)*4+2];case dt.H:return Ke.RS_BLOCK_TABLE[(e-1)*4+3];default:return}};function gu(){this.buffer=[],this.length=0}gu.prototype={get:function(e){var t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(var r=0;r<t;r++)this.putBit((e>>>t-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var Xs=[[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 yu(e){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof e=="string"&&(e={content:e}),e)for(var t in e)this.options[t]=e[t];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function r(c){switch(c){case"L":return dt.L;case"M":return dt.M;case"Q":return dt.Q;case"H":return dt.H;default:throw new Error("Unknwon error correction level: "+c)}}function n(c,l){for(var u=i(c),d=1,f=0,y=0,S=Xs.length;y<=S;y++){var _=Xs[y];if(!_)throw new Error("Content too long: expected "+f+" but got "+u);switch(l){case"L":f=_[0];break;case"M":f=_[1];break;case"Q":f=_[2];break;case"H":f=_[3];break;default:throw new Error("Unknwon error correction level: "+l)}if(u<=f)break;d++}if(d>Xs.length)throw new Error("Content too long");return d}function i(c){var l=encodeURI(c).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return l.length+(l.length!=c?3:0)}var s=this.options.content,o=n(s,this.options.ecl),a=r(this.options.ecl);this.qrcode=new Qe(o,a),this.qrcode.addData(s),this.qrcode.make()}yu.prototype.svg=function(e){var t=this.options||{},r=this.qrcode.modules;typeof e>"u"&&(e={container:t.container||"svg"});for(var n=typeof t.pretty<"u"?!!t.pretty:!0,i=n?"  ":"",s=n?`\r
2`:"",o=t.width,a=t.height,c=r.length,l=o/(c+2*t.padding),u=a/(c+2*t.padding),d=typeof t.join<"u"?!!t.join:!1,f=typeof t.swap<"u"?!!t.swap:!1,y=typeof t.xmlDeclaration<"u"?!!t.xmlDeclaration:!0,S=typeof t.predefined<"u"?!!t.predefined:!1,_=S?i+'<defs><path id="qrmodule" d="M0 0 h'+u+" v"+l+' H0 z" style="fill:'+t.color+';shape-rendering:crispEdges;" /></defs>'+s:"",w=i+'<rect x="0" y="0" width="'+o+'" height="'+a+'" style="fill:'+t.background+';shape-rendering:crispEdges;"/>'+s,p="",m="",b=0;b<c;b++)for(var R=0;R<c;R++){var C=r[R][b];if(C){var T=R*l+t.padding*l,H=b*u+t.padding*u;if(f){var F=T;T=H,H=F}if(d){var L=l+T,Y=u+H;T=Number.isInteger(T)?Number(T):T.toFixed(2),H=Number.isInteger(H)?Number(H):H.toFixed(2),L=Number.isInteger(L)?Number(L):L.toFixed(2),Y=Number.isInteger(Y)?Number(Y):Y.toFixed(2),m+="M"+T+","+H+" V"+Y+" H"+L+" V"+H+" H"
2+T+" Z "}else S?p+=i+'<use x="'+T.toString()+'" y="'+H.toString()+'" href="#qrmodule" />'+s:p+=i+'<rect x="'+T.toString()+'" y="'+H.toString()+'" width="'+l+'" height="'+u+'" style="fill:'+t.color+';shape-rendering:crispEdges;"/>'+s}}d&&(p=i+'<path x="0" y="0" style="fill:'+t.color+';shape-rendering:crispEdges;" d="'+m+'" />');let ae="";if(this.options.image!==void 0&&this.options.image.svg){const se=o*this.options.image.width/100,P=a*this.options.image.height/100,I=o/2-se/2,$=a/2-P/2;ae+=`<svg x="${I}" y="${$}" width="${se}" height="${P}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,ae+=this.options.image.svg+s,ae+="</svg>"}var ie="";switch(e.container){case"svg":y&&(ie+='<?xml version="1.0" standalone="yes"?>'+s),ie+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+o+'" height="'+a+'">'+s,ie+=_+w+p,ie+=ae,ie+="</svg>";break;case"svg-viewbox":y&&(ie+='<?xml version="1.0" standalone="yes"?>'+s),ie+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+o+" "+a+'">'+s,ie+=_+w+p,ie+=ae,ie+="</svg>";break;case"g":ie+='<g width="'+o+'" height="'+a+'">'+s,ie+=_+w+p,ie+=ae,ie+="</g>";break;default:ie+=(_+w+p+ae).replace(/^\s+/,"");break}return ie};var ky=yu,Iy=B&&B.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ni,"__esModule",{value:!0});ni.QRCode=void 0;const Ay=ke,Ic=Xn,Ty=Iy(ky),Py=e=>{const[t,r]=(0,Ic.useState)("");return(0,Ic.useEffect)(()=>{var n,i;const s=new Ty.default({content:e.content,background:e.bgColor||"#ffffff",color:e.fgColor||"#000000",container:"svg",ecl:"M",width:(n=e.width)!==null&&n!==void 0?n:256,height:(i=e.height)!==null&&i!==void 0?i:256,padding:0,image:e.image}),o=Buffer.from(s.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${o}`)},[e.bgColor,e.content,e.fgColor,e.height,e.image,e.width]),t?(0,Ay.h)("img",{src:t,alt:"QR Code"}):null};ni.QRCode=Py;var ii={},Jo={};Object.defineProperty(Jo,"__esModule",{value:!0});Jo.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 xy=B&&B.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ii,"__esModule",{value:!0});ii.Spinner=void 0;const hn=ke,Oy=xy(Jo),My=e=>{var t;const r=(t=e.size)!==null&&t!==void 0?t:64,n=e.color||"#000";return(0,hn.h)("div",{class:"-cbwsdk-spinner"},(0,hn.h)("style",null,Oy.default),(0,hn.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,hn.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};ii.Spinner=My;var Zo={};Object.defineProperty(Zo,"__esModule",{value:!0});Zo.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;
2color:#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 bu=B&&B.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Yt,"__esModule",{value:!0});Yt.CoinbaseWalletSteps=Yt.ConnectContent=void 0;const Rt=bu(Vr),ee=ke,Ny=N,Ly=ar,$y=ei,By=ti,Fy=ri,jy=ni,Dy=ii,Uy=bu(Zo),eo={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:mu},Hy=e=>e==="light"?"#FFFFFF":"#0A0B0D";function Wy(e){const{theme:t}=e,r=(0,Ny.createQrUrl)(e.sessionId,e.sessionSecret,e.linkAPIUrl,e.isParentConnection,e.version,e.chainId),n=eo.steps;return(0,ee.h)("div",{"data-testid":"connect-content",className:(0,Rt.default)("-cbwsdk-connect-content",t)},(0,ee.h)("style",null,Uy.default),(0,ee.h)("div",{className:"-cbwsdk-connect-content-header"},(0,ee.h)("h2",{className:(0,Rt.default)("-cbwsdk-connect-content-heading",t)},"Scan to connect with our mobile app"),e.onCancel&&(0,ee.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:e.onCancel},(0,ee.h)($y.CloseIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,ee.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,ee.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,ee.h)(Vy,{title:eo.title,description:eo.description,theme:t})),(0,ee.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,ee.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,ee.h)(jy.QRCode,{content:r,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,ee.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:Ly.LIB_VERSION}),(0,ee.h)("input",{type:"hidden",value:r})),(0,ee.h)(n,{theme:t}),!e.isConnected&&(0,ee.h)("div",{"data-testid":"connecting-spinner",className:(0,Rt.default)("-cbwsdk-connect-content-qr-connecting",t)},(0,ee.h)(Dy.Spinner,{size:36,color:t==="dark"?"#FFF":"#000"}),(0,ee.h)("p",null,"Connecting...")))))}Yt.ConnectContent=Wy;function Vy({title:e,description:t,theme:r}){return(0,ee.h)("div",{className:(0,Rt.default)("-cbwsdk-connect-item",r)},(0,ee.h)("div",null,(0,ee.h)(By.CoinbaseWalletRound,null)),(0,ee.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,ee.h)("h3",{className:"-cbwsdk-connect-item-title"},e),(0,ee.h)("p",{className:"-cbwsdk-connect-item-description"},t)))}function mu({theme:e}){return(0,ee.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,ee.h)("li",{className:(0,Rt.default)("-cbwsdk-wallet-steps-item",e)},(0,ee.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,ee.h)("li",{className:(0,Rt.default)("-cbwsdk-wallet-steps-item",e)},(0,ee.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,ee.h)("span",null,"Tap ",(0,ee.h)("strong",null,"Scan")," "),(0,ee.h)("span",{className:(0,Rt.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,ee.h)(Fy.QRCodeIcon,{fill:Hy(e)})))))}Yt.CoinbaseWalletSteps=mu;var si={},oi={};Object.defineProperty(oi,"__esModule",{value:!0});oi.ArrowLeftIcon=void 0;const Ac=ke;function qy(e){return(0,Ac.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},e),(0,Ac.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"}))}oi.ArrowLeftIcon=qy;var ai={};Object.defineProperty(ai,"__esModule",{value:!0});ai.LaptopIcon=void 0;const to=ke;function zy(e){return(0,to.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,to.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,to.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"}))}ai.LaptopIcon=zy;var ci={};Object.defineProperty(ci,"__esModule",{value:!0});ci.SafeIcon=void 0;const Tc=ke;function Gy(e){return(0,Tc.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,Tc.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.8
2001 5.20598 8.8001 6.2001Z"}))}ci.SafeIcon=Gy;var Ko={};Object.defineProperty(Ko,"__esModule",{value:!0});Ko.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 _u=B&&B.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(si,"__esModule",{value:!0});si.TryExtensionContent=void 0;const gt=_u(Vr),he=ke,ro=Xn,Jy=oi,Zy=ai,Ky=ci,Qy=_u(Ko);function Yy({theme:e}){const[t,r]=(0,ro.useState)(!1),n=(0,ro.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,ro.useCallback)(()=>{t?window.location.reload():(n(),r(!0))},[n,t]);return(0,he.h)("div",{class:(0,gt.default)("-cbwsdk-try-extension",e)},(0,he.h)("style",null,Qy.default),(0,he.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,he.h)("h3",{class:(0,gt.default)("-cbwsdk-try-extension-heading",e)},"Or try the Coinbase Wallet browser extension"),(0,he.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,he.h)("button",{class:(0,gt.default)("-cbwsdk-try-extension-cta",e),onClick:i},t?"Refresh":"Install"),(0,he.h)("div",null,!t&&(0,he.h)(Jy.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:e==="light"?"#0052FF":"#588AF5"})))),(0,he.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,he.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,he.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,he.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,he.h)("span",{class:(0,gt.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,he.h)(Zy.LaptopIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,he.h)("div",{class:(0,gt.default)("-cbwsdk-try-extension-list-item-copy",e)},"Connect with dapps with just one click on your desktop browser")),(0,he.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,he.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,he.h)("span",{class:(0,gt.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,he.h)(Ky.SafeIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,he.h)("div",{class:(0,gt.default)("-cbwsdk-try-extension-list-item-copy",e)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}si.TryExtensionContent=Yy;var Qo={};Object.defineProperty(Qo,"__esModule",{value:!0});Qo.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}
2.-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 vu=B&&B.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.ConnectDialog=void 0;const no=vu(Vr),yt=ke,io=Xn,Xy=Yt,eb=si,tb=vu(Qo),rb=e=>{const{isOpen:t,darkMode:r}=e,[n,i]=(0,io.useState)(!t),[s,o]=(0,io.useState)(!t);(0,io.useEffect)(()=>{const c=[window.setTimeout(()=>{o(!t)},10)];return t?i(!1):c.push(window.setTimeout(()=>{i(!0)},360)),()=>{c.forEach(window.clearTimeout)}},[t]);const a=r?"dark":"light";return(0,yt.h)("div",{class:(0,no.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,yt.h)("style",null,tb.default),(0,yt.h)("div",{class:(0,no.default)("-cbwsdk-connect-dialog-backdrop",a,s&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,yt.h)("div",{class:"-cbwsdk-connect-dialog"},(0,yt.h)("div",{class:(0,no.default)("-cbwsdk-connect-dialog-box",s&&"-cbwsdk-connect-dialog-box-hidden")},e.connectDisabled?null:(0,yt.h)(Xy.ConnectContent,{theme:a,version:e.version,sessionId:e.sessionId,sessionSecret:e.sessionSecret,linkAPIUrl:e.linkAPIUrl,isConnected:e.isConnected,isParentConnection:e.isParentConnection,chainId:e.chainId,onCancel:e.onCancel}),(0,yt.h)(eb.TryExtensionContent,{theme:a}))))};Yn.ConnectDialog=rb;Object.defineProperty(Qn,"__esModule",{value:!0});Qn.LinkFlow=void 0;const so=ke,nb=Yn;class ib{constructor(t){this.connected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=t.darkMode,this.version=t.version,this.sessionId=t.sessionId,this.sessionSecret=t.sessionSecret,this.linkAPIUrl=t.linkAPIUrl,this.isParentConnection=t.isParentConnection}attach(t){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",t.appendChild(this.root),this.render()}setConnected(t){this.connected!==t&&(this.connected=t,this.render())}setChainId(t){this.chainId!==t&&(this.chainId=t,this.render())}detach(){var t;this.root&&((0,so.render)(null,this.root),(t=this.root.parentElement)===null||t===void 0||t.removeChild(this.root))}setConnectDisabled(t){this.connectDisabled=t}open(t){this.isOpen=!0,this.onCancel=t.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){this.root&&(0,so.render)((0,so.h)(nb.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)}}Qn.LinkFlow=ib;var Yo={},Xo={};Object.defineProperty(Xo,"__esModule",{value:!0});Xo.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;
2cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}";(function(e){var t=B&&B.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.SnackbarInstance=e.SnackbarContainer=e.Snackbar=void 0;const r=t(Vr),n=ke,i=Xn,s=t(Xo),o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",a="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwu
2NTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class c{constructor(f){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=f.darkMode}attach(f){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",f.appendChild(this.root),this.render()}presentItem(f){const y=this.nextItemKey++;return this.items.set(y,f),this.render(),()=>{this.items.delete(y),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(e.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([f,y])=>(0,n.h)(e.SnackbarInstance,Object.assign({},y,{key:f}))))),this.root)}}e.Snackbar=c;const l=d=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,n.h)("style",null,s.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},d.children));e.SnackbarContainer=l;const u=({autoExpand:d,message:f,menuItems:y})=>{const[S,_]=(0,i.useState)(!0),[w,p]=(0,i.useState)(d??!1);(0,i.useEffect)(()=>{const b=[window.setTimeout(()=>{_(!1)},1),window.setTimeout(()=>{p(!0)},1e4)];return()=>{b.forEach(window.clearTimeout)}});const m=()=>{p(!w)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",S&&"-cbwsdk-snackbar-instance-hidden",w&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:m},(0,n.h)("img",{src:o,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},f),(0,n.h)("div",{class:"-gear-container"},!w&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:a,class:"-gear-icon",title:"Expand"}))),y&&y.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},y.map((b,R)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",b.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:b.onClick,key:R},(0,n.h)("svg",{width:b.svgWidth,height:b.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":b.defaultFillRule,"clip-rule":b.defaultClipRule,d:b.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",b.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},b.info)))))};e.SnackbarInstance=u})(Yo);Object.defineProperty(Hr,"__esModule",{value:!0});Hr.WalletLinkRelayUI=void 0;const sb=Wr,ob=Qn,ab=Yo;class cb{constructor(t){this.standalone=null,this.attached=!1,this.snackbar=new ab.Snackbar({darkMode:t.darkMode}),this.linkFlow=new ob.LinkFlow({darkMode:t.darkMode,version:t.version,sessionId:t.session.id,sessionSecret:t.session.secret,linkAPIUrl:t.linkAPIUrl,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const t=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",t.appendChild(r),this.linkFlow.attach(r),this.snackbar.attach(r),this.attached=!0,(0,sb.injectCssReset)()}setConnected(t){this.linkFlow.setConnected(t)}setChainId(t){this.linkFlow.setChainId(t)}setConnectDisabled(t){this.linkFlow.setConnectDisabled(t)}addEthereumChain(){}watchAsset(){}switchEthereumChain(){}requestEthereumAccounts(t){this.linkFlow.open({onCancel:t.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}showConnecting(t){let r;return t.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.9687
25 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]}:r={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:t.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]},this.snackbar.presentItem(r)}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(t){this.standalone=t}isStandalone(){var t;return(t=this.standalone)!==null&&t!==void 0?t:!1}}Hr.WalletLinkRelayUI=cb;Object.defineProperty(Or,"__esModule",{value:!0});Or.WalletLinkRelay=void 0;const jt=Ir,lb=pe,ce=N,bt=cr,Pc=Ne,lt=lr,ub=Jn,mt=or,db=Hr;class nt extends Pc.RelayAbstract{constructor(t){var r;super(),this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.linkedUpdated=o=>{var a;this.isLinked=o;const c=this.storage.getItem(Pc.LOCAL_STORAGE_ADDRESSES_KEY);if(o&&(this.session.linked=o),this.isUnlinkedErrorState=!1,c){const l=c.split(" "),u=this.storage.getItem("IsStandaloneSigning")==="true";if(l[0]!==""&&!o&&this.session.linked&&!u){this.isUnlinkedErrorState=!0;const d=this.getSessionIdHash();(a=this.diagnostic)===null||a===void 0||a.log(bt.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:d})}}},this.metadataUpdated=(o,a)=>{this.storage.setItem(o,a)},this.chainUpdated=(o,a)=>{this.chainCallbackParams.chainId===o&&this.chainCallbackParams.jsonRpcUrl===a||(this.chainCallbackParams={chainId:o,jsonRpcUrl:a},this.chainCallback&&this.chainCallback(o,a))},this.accountUpdated=o=>{this.accountsCallback&&this.accountsCallback([o]),nt.accountRequestCallbackIds.size>0&&(Array.from(nt.accountRequestCallbackIds.values()).forEach(a=>{const c={type:"WEB3_RESPONSE",id:a,response:{method:"requestEthereumAccounts",result:[o]}};this.invokeCallback(Object.assign(Object.assign({},c),{id:a}))}),nt.accountRequestCallbackIds.clear())},this.connectedUpdated=o=>{this.ui.setConnected(o)},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=t.linkAPIUrl,this.storage=t.storage,this.options=t;const{session:n,ui:i,connection:s}=this.subscribe();this._session=n,this.connection=s,this.relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this._reloadOnDisconnect=(r=t.reloadOnDisconnect)!==null&&r!==void 0?r:!0,this.ui=i}subscribe(){const t=lt.Session.load(this.storage)||new lt.Session(this.storage).save(),{linkAPIUrl:r,diagnostic:n}=this,i=new ub.WalletLinkConnection({session:t,linkAPIUrl:r,diagnostic:n,listener:this}),{version:s,darkMode:o}=this.options,a=this.options.uiConstructor({linkAPIUrl:r,version:s,darkMode:o,session:t});return i.connect(),{session:t,ui:a,connection:i}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(t=>setTimeout(()=>t(null),1e3))]).then(()=>{var t,r;const n=this.ui.isStandalone();(t=this.diagnostic)===null||t===void 0||t.log(bt.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const i=lt.Session.load(this.storage);if((i==null?void 0:i.id)===this._session.id?this.storage.clear():i&&((r=this.diagnostic)===null||r===void 0||r.log(bt.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:lt.Session.hash(i.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);const{session:s,ui:o,connection:a}=this.subscribe();this._session=s,this.connection=a,this.ui=o,n&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.options.headlessMode||this.attachUI()}).catch(t=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(bt.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${t}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(t,r){this.appName=t,this.appLogoUrl=r}getStorageItem(t){return this.storage.getItem(t)}get session(){return this._session}setStorageItem(t,r){this.storage.setItem(t,r)}signEthereumMessage(t,r,n,i){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,ce.hexStringFromBuffer)(t,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(t,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,ce.hexStringFromBuffer)(t,!0),signature:(0,ce.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,ce.bigIntStringFromBN)(t.weiValue),data:(0,ce.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,ce.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.gasPriceInWei?(0,ce.bigIntStringFromBN)(t.gasPriceInWei):null,maxPriorityFeePerGas:t.gasPriceInWei?(0,ce.bigIntStringFromBN)(t.gasPriceInWei):null,gasLimit:t.gasLimit?(0,ce.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,ce.bigIntStringFromBN)(t.weiValue),data:(0,ce.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,ce.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.maxFeePerGas?(0,ce.bigIntStringFromBN)(t.maxFeePerGas):null,maxPriorityFeePerGas:t.maxPriorityFeePerGas?(0,ce.bigIntStringFromBN)(t.maxPriorityFeePerGas):null,gasLimit:t.gasLimit?(0,ce.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!0}})}submitEthereumTransaction(t,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,ce.hexStringFromBuffer)(t,!0),chainId:r}})}scanQRCode(t){return this.sendRequest({method:"scanQRCode",params:{regExp:t}})}getQRCodeUrl(){return(0,ce.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(t,r){return this.sendRequest({method:"generic",params:{action:r,data:t}})}sendGenericMessage(t){return this.sendRequest(t)}sendRequest(t){let r=null;const n=(0,ce.randomBytesHex)(8),i=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,t.method,o),r==null||r()};return{promise:new Promise((o,a)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,c=>{if(r==null||r(),(0,mt.isErrorResponse)(c))return a(new Error(c.errorMessage));o(c)}),this.ui.isStandalone()?this.sendRequestStandalone(n,t):this.publishWeb3RequestEvent(n,t)}),cancel:i}}setConnectDisabled(t){this.ui.setConnectDisabled(t)}setAccountsCallback(t){this.accountsCallback=t}setChainCallback(t){this.chainCallback=t}setDappDefaultChainCallback(t){this.dappDefaultChain=t,this.ui instanceof db.WalletLinkRelayUI&&this.ui.setChainId(t)}publishWeb3RequestEvent(t,r){var n;const i={type:"WEB3_REQUEST",id:t,request:r},s=lt.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(bt.EVENTS.WEB3_REQUEST,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?lt.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()}),this.publishEvent("Web3Request",i,!0).then(o=>{var a;(a=this.diagnostic)===null||a===void 0||a.log(bt.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?lt.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()})}).catch(o=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i.id,response:{method:r.method,errorMessage:o.message}})})}publishWeb3RequestCanceledEvent(t){const r={type:"WEB3_REQUEST_CANCELED",id:t};this.publishEvent("Web3RequestCanceled",r,!1).then()}publishEvent(t,r,n){return this.connection.publishEvent(t,r,n)}handleWeb3ResponseMessage(t){var r;const{response:n}=t;if((r=this.diagnostic)===null||r===void 0||r.log(bt.EVENTS.WEB3_RESPONSE,{eventId:t.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),n.method==="requestEthereumAccounts"){nt.accountRequestCallbackIds.forEach(i=>
2this.invokeCallback(Object.assign(Object.assign({},t),{id:i}))),nt.accountRequestCallbackIds.clear();return}this.invokeCallback(t)}handleErrorResponse(t,r,n,i){var s;const o=(s=n==null?void 0:n.message)!==null&&s!==void 0?s:(0,jt.getMessageFromCode)(i);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:{method:r,errorMessage:o,errorCode:i}})}invokeCallback(t){const r=this.relayEventManager.callbacks.get(t.id);r&&(r(t.response),this.relayEventManager.callbacks.delete(t.id))}requestEthereumAccounts(){const t={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=(0,ce.randomBytesHex)(8),n=s=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,t.method,s)};return{promise:new Promise((s,o)=>{if(this.relayEventManager.callbacks.set(r,a=>{if(this.ui.hideRequestEthereumAccounts(),(0,mt.isErrorResponse)(a))return o(new Error(a.errorMessage));s(a)}),this.ui.inlineAccountsResponse()){const a=c=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:r,response:{method:"requestEthereumAccounts",result:c}})};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:a})}else{const a=jt.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(a)})}nt.accountRequestCallbackIds.add(r),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(r,t)}),cancel:n}}selectProvider(t){const r={method:"selectProvider",params:{providerOptions:t}},n=(0,ce.randomBytesHex)(8),i=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,o)},s=new Promise((o,a)=>{this.relayEventManager.callbacks.set(n,u=>{if((0,mt.isErrorResponse)(u))return a(new Error(u.errorMessage));o(u)});const c=u=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:lb.ProviderType.Unselected}})},l=u=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:u}})};this.ui.selectProvider&&this.ui.selectProvider({onApprove:l,onCancel:c,providerOptions:t})});return{cancel:i,promise:s}}watchAsset(t,r,n,i,s,o){const a={method:"watchAsset",params:{type:t,options:{address:r,symbol:n,decimals:i,image:s},chainId:o}};let c=null;const l=(0,ce.randomBytesHex)(8),u=f=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,a.method,f),c==null||c()};this.ui.inlineWatchAsset()||(c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:u,onResetConnection:this.resetAndReload}));const d=new Promise((f,y)=>{this.relayEventManager.callbacks.set(l,w=>{if(c==null||c(),(0,mt.isErrorResponse)(w))return y(new Error(w.errorMessage));f(w)});const S=w=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:l,response:{method:"watchAsset",result:!1}})},_=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:l,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:_,onCancel:S,type:t,address:r,symbol:n,decimals:i,image:s,chainId:o}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(l,a)});return{cancel:u,promise:d}}addEthereumChain(t,r,n,i,s,o){const a={method:"addEthereumChain",params:{chainId:t,rpcUrls:r,blockExplorerUrls:i,chainName:s,iconUrls:n,nativeCurrency:o}};let c=null;const l=(0,ce.randomBytesHex)(8),u=f=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,a.method,f),c==null||c()};return this.ui.inlineAddEthereumChain(t)||(c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:u,onResetConnection:this.resetAndReload})),{promise:new Promise((f,y)=>{this.relayEventManager.callbacks.set(l,w=>{if(c==null||c(),(0,mt.isErrorResponse)(w))return y(new Error(w.errorMessage));f(w)});const S=w=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:l,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},_=w=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:l,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:w}}})};this.ui.inlineAddEthereumChain(t)&&this.ui.addEthereumChain({onCancel:S,onApprove:_,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(t)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(l,a)}),cancel:u}}
2switchEthereumChain(t,r){const n={method:"switchEthereumChain",params:Object.assign({chainId:t},{address:r})},i=(0,ce.randomBytesHex)(8),s=a=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,n.method,a)};return{promise:new Promise((a,c)=>{this.relayEventManager.callbacks.set(i,d=>{if((0,mt.isErrorResponse)(d)&&d.errorCode)return c(jt.standardErrors.provider.custom({code:d.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,mt.isErrorResponse)(d))return c(new Error(d.errorMessage));a(d)});const l=d=>{var f;if(d){const y=(f=(0,jt.getErrorCode)(d))!==null&&f!==void 0?f:jt.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(i,"switchEthereumChain",d instanceof Error?d:jt.standardErrors.provider.unsupportedChain(t),y)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},u=d=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:d}}})};this.ui.switchEthereumChain({onCancel:l,onApprove:u,chainId:n.params.chainId,address:n.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(i,n)}),cancel:s}}inlineAddEthereumChain(t){return this.ui.inlineAddEthereumChain(t)}getSessionIdHash(){return lt.Session.hash(this._session.id)}sendRequestStandalone(t,r){const n=s=>{this.handleErrorResponse(t,r.method,s)},i=s=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:s})};switch(r.method){case"signEthereumMessage":this.ui.signEthereumMessage({request:r,onSuccess:i,onCancel:n});break;case"signEthereumTransaction":this.ui.signEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case"submitEthereumTransaction":this.ui.submitEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case"ethereumAddressFromSignedMessage":this.ui.ethereumAddressFromSignedMessage({request:r,onSuccess:i});break;default:n();break}}}Or.WalletLinkRelay=nt;nt.accountRequestCallbackIds=new Set;var qr={},li={},wu={};(function(e){var t=B&&B.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,o,a)}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=B&&B.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(Yo,e)})(wu);var ea={};Object.defineProperty(ea,"__esModule",{value:!0});ea.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}
2.-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 Eu=B&&B.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(li,"__esModule",{value:!0});li.RedirectDialog=void 0;const fb=Eu(Vr),Ze=ke,hb=Wr,pb=wu,gb=Eu(ea);class yb{constructor(){this.root=null}attach(){const t=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",t.appendChild(this.root),(0,hb.injectCssReset)()}present(t){this.render(t)}clear(){this.render(null)}render(t){this.root&&((0,Ze.render)(null,this.root),t&&(0,Ze.render)((0,Ze.h)(bb,Object.assign({},t,{onDismiss:()=>{this.clear()}})),this.root))}}li.RedirectDialog=yb;const bb=({title:e,buttonText:t,darkMode:r,onButtonClick:n,onDismiss:i})=>{const s=r?"dark":"light";return(0,Ze.h)(pb.SnackbarContainer,{darkMode:r},(0,Ze.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,Ze.h)("style",null,gb.default),(0,Ze.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:i}),(0,Ze.h)("div",{class:(0,fb.default)("-cbwsdk-redirect-dialog-box",s)},(0,Ze.h)("p",null,e),(0,Ze.h)("button",{onClick:n},t))))};Object.defineProperty(qr,"__esModule",{value:!0});qr.MobileRelayUI=void 0;const mb=li;class _b{constructor(t){this.attached=!1,this.darkMode=!1,this.redirectDialog=new mb.RedirectDialog,this.darkMode=t.darkMode}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}setConnected(t){}redirectToCoinbaseWallet(t){const r=new URL("https://go.cb-w.com/walletlink");r.searchParams.append("redirect_url",window.location.href),t&&r.searchParams.append("wl_url",t);const n=document.createElement("a");n.target="cbw-opener",n.href=r.href,n.rel="noreferrer noopener",n.click()}openCoinbaseWalletDeeplink(t){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",darkMode:this.darkMode,onButtonClick:()=>{this.redirectToCoinbaseWallet(t)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(t)},99)}showConnecting(t){return()=>{this.redirectDialog.clear()}}hideRequestEthereumAccounts(){this.redirectDialog.clear()}requestEthereumAccounts(){}addEthereumChain(){}watchAsset(){}selectProvider(){}switchEthereumChain(){}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}reloadUI(){}setStandalone(){}setConnectDisabled(){}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}isStandalone(){return!1}}qr.MobileRelayUI=_b;Object.defineProperty(xr,"__esModule",{value:!0});xr.MobileRelay=void 0;const vb=N,wb=Or,Eb=qr;
2class Sb extends wb.WalletLinkRelay{constructor(t){var r;super(t),this._enableMobileWalletLink=(r=t.enableMobileWalletLink)!==null&&r!==void 0?r:!1}requestEthereumAccounts(){return this._enableMobileWalletLink?super.requestEthereumAccounts():{promise:new Promise(()=>{const t=(0,vb.getLocation)();t.href=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(t.href)}`}),cancel:()=>{}}}publishWeb3RequestEvent(t,r){if(super.publishWeb3RequestEvent(t,r),!(this._enableMobileWalletLink&&this.ui instanceof Eb.MobileRelayUI))return;let n=!1;switch(r.method){case"requestEthereumAccounts":case"connectAndSignIn":n=!0,this.ui.openCoinbaseWalletDeeplink(this.getQRCodeUrl());break;case"switchEthereumChain":return;default:n=!0,this.ui.openCoinbaseWalletDeeplink();break}n&&window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0})}handleWeb3ResponseMessage(t){super.handleWeb3ResponseMessage(t)}connectAndSignIn(t){if(!this._enableMobileWalletLink)throw new Error("connectAndSignIn is supported only when enableMobileWalletLink is on");return this.sendRequest({method:"connectAndSignIn",params:{appName:this.appName,appLogoUrl:this.appLogoUrl,domain:window.location.hostname,aud:window.location.href,version:"1",type:"eip4361",nonce:t.nonce,iat:new Date().toISOString(),chainId:`eip155:${this.dappDefaultChain}`,statement:t.statement,resources:t.resources}})}}xr.MobileRelay=Sb;var ko={exports:{}},Su=xn.EventEmitter,oo,xc;function Rb(){if(xc)return oo;xc=1;function e(S,_){var w=Object.keys(S);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(S);_&&(p=p.filter(function(m){return Object.getOwnPropertyDescriptor(S,m).enumerable})),w.push.apply(w,p)}return w}function t(S){for(var _=1;_<arguments.length;_++){var w=arguments[_]!=null?arguments[_]:{};_%2?e(Object(w),!0).forEach(function(p){r(S,p,w[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(S,Object.getOwnPropertyDescriptors(w)):e(Object(w)).forEach(function(p){Object.defineProperty(S,p,Object.getOwnPropertyDescriptor(w,p))})}return S}function r(S,_,w){return _=o(_),_ in S?Object.defineProperty(S,_,{value:w,enumerable:!0,configurable:!0,writable:!0}):S[_]=w,S}function n(S,_){if(!(S instanceof _))throw new TypeError("Cannot call a class as a function")}function i(S,_){for(var w=0;w<_.length;w++){var p=_[w];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(S,o(p.key),p)}}function s(S,_,w){return _&&i(S.prototype,_),Object.defineProperty(S,"prototype",{writable:!1}),S}function o(S){var _=a(S,"string");return typeof _=="symbol"?_:String(_)}function a(S,_){if(typeof S!="object"||S===null)return S;var w=S[Symbol.toPrimitive];if(w!==void 0){var p=w.call(S,_||"default");if(typeof p!="object")return p;throw new TypeError("@@toPrimitive must return a primitive value.")}return(_==="string"?String:Number)(S)}var c=Mo,l=c.Buffer,u=wl,d=u.inspect,f=d&&d.custom||"inspect";function y(S,_,w){l.prototype.copy.call(S,_,w)}return oo=function(){function S(){n(this,S),this.head=null,this.tail=null,this.length=0}return s(S,[{key:"push",value:function(w){var p={data:w,next:null};this.length>0?this.tail.next=p:this.head=p,this.tail=p,++this.length}},{key:"unshift",value:function(w){var p={data:w,next:this.head};this.length===0&&(this.tail=p),this.head=p,++this.length}},{key:"shift",value:function(){if(this.length!==0){var w=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,w}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(w){if(this.length===0)return"";for(var p=this.head,m=""+p.data;p=p.next;)m+=w+p.data;return m}},{key:"concat",value:function(w){if(this.length===0)return l.alloc(0);for(var p=l.allocUnsafe(w>>>0),m=this.head,b=0;m;)y(m.data,p,b),b+=m.data.length,m=m.next;return p}},{key:"consume",value:function(w,p){var m;return w<this.head.data.length?(m=this.head.data.slice(0,w),this.head.data=this.head.data.slice(w)):w===this.head.data.length?m=this.shift():m=p?this._getString(w):this._getBuffer(w),m}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(w){var p=this.head,m=1,b=p.data;for(w-=b.length;p=p.next;){var R=p.data,C=w>R.length?R.length:w;if(C===R.length?b+=R:b+=R.slice(0,w),w-=C,w===0){C===R.length?(++m,p.next?this.head=p.next:this.head=this.tail=null):(this.head=p,p.data=R.slice(C));break}++m}return this.length-=m,b}},{key:"_getBuffer",value:function(w){var p=l.allocUnsafe(w),m=this.head,b=1;for(m.data.copy(p),w-=m.data.length;m=m.next;){var R=m.data,C=w>R.length?R.length:w;if(R.copy(p,p.length-w,0,C),w-=C,w===0){C===R.length?(++b,m.next?this.head=m.next:this.head=this.tail=null):(this.head=m,m.data=R.slice(C));break}++b}return this.length-=b,p}},{key:f,value:function(w,p){return d(this,t(t({},p),{},{depth:0,customInspect:!1}))}}]),S}(),oo}function Cb(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(Io,this,e)):process.nextTick(Io,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(s){!t&&s?r._writableState?r._writableState.errorEmitted?process.nextTick(wn,r):(r._writableState.errorEmitted=!0,process.nextTick(Oc,r,s)):process.nextTick(Oc,r,s):t?(process.nextTick(wn,r),t(s)):process.nextTick(wn,r)}),this)}function Oc(e,t){Io(e,t),wn(e)}function wn(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function kb(){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 Io(e,t){e.emit("error",t)}function Ib(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}var Ru={destroy:Cb,undestroy:kb,errorOrDestroy:Ib},At={};function Ab(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var Cu={};function Be(e,t,r){r||(r=Error);function n(s,o,a){return typeof t=="string"?t:t(s,o,a)}var i=function(s){Ab(o,s);function o(a,c,l){return s.call(this,n(a,c,l))||this}return o}(r);i.prototype.name=r.name,i.prototype.code=e,Cu[e]=i}function Mc(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(n){return String(n)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:r===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function Tb(e,t,r){return e.substr(0,t.length)===t}function Pb(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function xb(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}Be("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invali
2d for option "'+e+'"'},TypeError);Be("ERR_INVALID_ARG_TYPE",function(e,t,r){var n;typeof t=="string"&&Tb(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";var i;if(Pb(e," argument"))i="The ".concat(e," ").concat(n," ").concat(Mc(t,"type"));else{var s=xb(e,".")?"property":"argument";i='The "'.concat(e,'" ').concat(s," ").concat(n," ").concat(Mc(t,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);Be("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Be("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});Be("ERR_STREAM_PREMATURE_CLOSE","Premature close");Be("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});Be("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Be("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Be("ERR_STREAM_WRITE_AFTER_END","write after end");Be("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Be("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);Be("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");At.codes=Cu;var Ob=At.codes.ERR_INVALID_OPT_VALUE;function Mb(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function Nb(e,t,r,n){var i=Mb(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var s=n?r:"highWaterMark";throw new Ob(s,i)}return Math.floor(i)}return e.objectMode?16:16*1024}var ku={getHighWaterMark:Nb},Lb=$b;function $b(e,t){if(ao("noDeprecation"))return e;var r=!1;function n(){if(!r){if(ao("throwDeprecation"))throw new Error(t);ao("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}return n}function ao(e){try{if(!B.localStorage)return!1}catch{return!1}var t=B.localStorage[e];return t==null?!1:String(t).toLowerCase()==="true"}var co,Nc;function Iu(){if(Nc)return co;Nc=1,co=F;function e(v){var E=this;this.next=null,this.entry=null,this.finish=function(){re(E,v)}}var t;F.WritableState=T;var r={deprecate:Lb},n=Su,i=Mo.Buffer,s=(typeof B<"u"?B:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function o(v){return i.from(v)}function a(v){return i.isBuffer(v)||v instanceof s}var c=Ru,l=ku,u=l.getHighWaterMark,d=At.codes,f=d.ERR_INVALID_ARG_TYPE,y=d.ERR_METHOD_NOT_IMPLEMENTED,S=d.ERR_MULTIPLE_CALLBACK,_=d.ERR_STREAM_CANNOT_PIPE,w=d.ERR_STREAM_DESTROYED,p=d.ERR_STREAM_NULL_VALUES,m=d.ERR_STREAM_WRITE_AFTER_END,b=d.ERR_UNKNOWN_ENCODING,R=c.errorOrDestroy;We(F,n);function C(){}function T(v,E,A){t=t||Xt(),v=v||{},typeof A!="boolean"&&(A=E instanceof t),this.objectMode=!!v.objectMode,A&&(this.objectMode=this.objectMode||!!v.writableObjectMode),this.highWaterMark=u(this,v,"writableHighWaterMark",A),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var D=v.decodeStrings===!1;this.decodeStrings=!D,this.defaultEncoding=v.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(G){$(E,G)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=v.emitClose!==!1,this.autoDestroy=!!v.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}T.prototype.getBuffer=function(){for(var E=this.bufferedRequest,A=[];E;)A.push(E),E=E.next;return A},function(){try{Object.defineProperty(T.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var H;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(H=Function.prototype[Symbol.hasInstance],Object.defineProperty(F,Symbol.hasInstance,{value:function(E){return H.call(this,E)?!0:this!==F?!1:E&&E._writableState instanceof T}})):H=function(E){return E instanceof this};function F(v){t=t||Xt();var E=this instanceof t;if(!E&&!H.call(F,this))return new F(v);this._writableState=new T(v,this,E),this.writable=!0,v&&(typeof v.write=="function"&&(this._write=v.write),typeof v.writev=="function"&&(this._writev=v.writev),typeof v.destroy=="function"&&(this._destroy=v.destroy),typeof v.final=="function"&&(this._final=v.final)),n.call(this)}F.prototype.pipe=function(){R(this,new _)};function L(v,E){var A=new m;R(v,A),process.nextTick(E,A)}function Y(v,E,A,D){var G;return A===null?G=new p:typeof A!="string"&&!E.objectMode&&(G=new f("chunk",["string","Buffer"],A)),G?(R(v,G),process.nextTick(D,G),!1):!0}F.prototype.write=function(v,E,A){var D=this._writableState,G=!1,h=!D.objectMode&&a(v);return h&&!i.isBuffer(v)&&(v=o(v)),typeof E=="function"&&(A=E,E=null),h?E="buffer":E||(E=D.defaultEncoding),typeof A!="function"&&(A=C),D.ending?L(this,A):(h||Y(this,D,v,A))&&(D.pendingcb++,G=ie(this,D,h,v,E,A)),G},F.prototype.cork=function(){this._writableState.corked++},F.prototype.uncork=function(){var v=this._writableState;v.corked&&(v.corked--,!v.writing&&!v.corked&&!v.bufferProcessing&&v.bufferedRequest&&M(this,v))},F.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 b(E);return this._writableState.defaultEncoding=E,this},Object.defineProperty(F.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function ae(v,E,A){return!v.objectMode&&v.decodeStrings!==!1&&typeof E=="string"&&(E=i.from(E,A)),E}Object.defineProperty(F.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function ie(v,E,A,D,G,h){if(!A){var g=ae(E,D,G);D!==g&&(A=!0,G="buffer",D=g)}var k=E.objectMode?1:D.length;E.length+=k;var x=E.length<E.highWaterMark;if(x||(E.needDrain=!0),E.writing||E.corked){var oe=E.lastBufferedRequest;E.lastBufferedRequest={chunk:D,encoding:G,isBuf:A,callback:h,next:null},oe?oe.next=E.lastBufferedRequest:E.bufferedRequest=E.lastBufferedRequest,E.bufferedRequestCount+=1}else se(v,E,!1,k,D,G,h);return x}function se(v,E,A,D,G,h,g){E.writelen=D,E.writecb=g,E.writing=!0,E.sync=!0,E.destroyed?E.onwrite(new w("write")):A?v._writev(G,E.onwrite):v._write(G,h,E.onwrite),E.sync=!1}function P(v,E,A,D,G){--E.pendingcb,A?(process.nextTick(G,D),process.nextTick(K,v,E),v._writableState.errorEmitted=!0,R(v,D)):(G(D),v._writableState.errorEmitted=!0,R(v,D),K(v,E))}function I(v){v.writing=!1,v.writecb=null,v.length-=v.writelen,v.writelen=0}function $(v,E){var A=v._writableState,D=A.sync,G=A.writecb;if(typeof G!="function")throw new S;if(I(A),E)P(v,A,D,E,G);else{var h=U(A)||v.destroyed;!h&&!A.corked&&!A.bufferProcessing&&A.bufferedRequest&&M(v,A),D?process.nextTick(O,v,A,h,G):O(v,A,h,G)}}function O(v,E,A,D){A||j(v,E),E.pendingcb--,D(),K(v,E)}function j(v,E){E.length===0&&E.needDrain&&(E.needDrain=!1,v.emit("drain"))}function M(v,E){E.bufferProcessing=!0;var A=E.bufferedRequest;if(v._writev&&A&&A.next){var D=E.bufferedRequestCount,G=new Array(D),h=E.corkedRequestsFree;h.entry=A;for(var g=0,k=!0;A;)G[g]=A,A.isBuf||(k=!1),A=A.next,g+=1;G.allBuffers=k,se(v,E,!0,E.length,G,"",h.finish),E.pendingcb++,E.lastBufferedRequest=null,h.next?(E.corkedRequestsFree=h.next,h.next=null):E.corkedRequestsFree=new e(E),E.bufferedRequestCount=0}else{for(;A;){var x=A.chunk,oe=A.encoding,z=A.callback,ne=E.objectMode?1:x.length;if(se(v,E,!1,ne,x,oe,z),A=A.next,E.bufferedRequestCount--,E.writing)break}A===null&&(E.lastBufferedRequest=null)}E.bufferedRequest=A,E.bufferProcessing=!1}F.prototype._write=function(v,E,A){A(new y("_write()"))},F.prototype._writev=null,F.prototype.end=function(v,E,A){var D=this._writableState;return typeof v=="function"?(A=v,v=null,E=null):typeof E=="function"&&(A=E,E=null),v!=null&&this.write(v,E),D.corked&&(D.corked=1,this.uncork()),D.ending||de(this,D,A),this},Object.defineProperty(F.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function U(v){return v.ending&&v.length===0&&v.bufferedRequest===null&&!v.finished&&!v.writing}function Z(v,E){v._final(function(A){E.pendingcb--,A&&R(v,A),E.prefinished=!0,v.emit("prefinish"),K(v,E)})}function W(v,E){!E.prefinished&&!E.finalCalled&&(typeof v._final=="function"&&!E.destroyed?(E.pendingcb++,E.finalCalled=!0,process.nextTick(Z,v,E)):(E.prefinished=!0,v.emit("prefinish")))}function K(v,E){var A=U(E);if(A&&(W(v,E),E.pendingcb===0&&(E.finished=!0,v.emit("finish"),E.autoDestroy))){var D=v._readableState;(!D||D.autoDestroy&&D.endEmitted)&&v.destroy()}return A}function de(v,E,A){E.ending=!0,K(v,E),A&&(E.finished?process.nextTick(A):v.once("finish",A)),E.ended=!0,v.writable=!1}function re(v,E,A){var D=v.entry;for(v.entry=null;D;){var G=D.callback;E.pendingcb--,G(A),D=D.next}E.corkedRequestsFree.next=v}return Object.defineProperty(F.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(E){this._writableState&&(this._writableState.destroyed=E)}}),F.prototype.destroy=c.destroy,F.prototype._undestroy=c.undestroy,F.prototype._destroy=function(v,E){E(v)},co}var lo,Lc;function Xt(){if(Lc)return lo;Lc=1;var e=Object.keys||function(l){var u=[];for(var d in l)u.push(d);return u};lo=o;var t=Tu(),r=Iu();We(o,t);for(var n=e(r.prototype),i=0;i<n.length;i++){var s=n[i];o.prototype[s]||(o.prototype[s]=r.prototype[s])}function o(l){if(!(this instanceof o))return new o(l);t.call(this,l),r.call(this,l),this.allowHalfOpen=!0,l&&(l.readable===!1&&(this.readable=!1),l.writable===!1&&(this.writable=!1),l.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",a)))}Object.defineProperty(o.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(o.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(o.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function a(){this._writableState.ended||process.nextTick(c,this)}function c(l){l.end()}return Object.defineProperty(o.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(u){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=u,this._writableState.destroyed=u)}}),lo}var uo={},$c;function Bc(){if($c)return uo;$c=1;var e=ot.Buffer,t=e.isEncoding||function(p){switch(p=""+p,p&&p.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(p){if(!p)return"utf8";for(var m;;)switch(p){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";
vendor: 4,452 bytes, line 2
2case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return p;default:if(m)return;p=(""+p).toLowerCase(),m=!0}}function n(p){var m=r(p);if(typeof m!="string"&&(e.isEncoding===t||!t(p)))throw new Error("Unknown encoding: "+p);return m||p}uo.StringDecoder=i;function i(p){this.encoding=n(p);var m;switch(this.encoding){case"utf16le":this.text=d,this.end=f,m=4;break;case"utf8":this.fillLast=c,m=4;break;case"base64":this.text=y,this.end=S,m=3;break;default:this.write=_,this.end=w;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(m)}i.prototype.write=function(p){if(p.length===0)return"";var m,b;if(this.lastNeed){if(m=this.fillLast(p),m===void 0)return"";b=this.lastNeed,this.lastNeed=0}else b=0;return b<p.length?m?m+this.text(p,b):this.text(p,b):m||""},i.prototype.end=u,i.prototype.text=l,i.prototype.fillLast=function(p){if(this.lastNeed<=p.length)return p.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);p.copy(this.lastChar,this.lastTotal-this.lastNeed,0,p.length),this.lastNeed-=p.length};function s(p){return p<=127?0:p>>5===6?2:p>>4===14?3:p>>3===30?4:p>>6===2?-1:-2}function o(p,m,b){var R=m.length-1;if(R<b)return 0;var C=s(m[R]);return C>=0?(C>0&&(p.lastNeed=C-1),C):--R<b||C===-2?0:(C=s(m[R]),C>=0?(C>0&&(p.lastNeed=C-2),C):--R<b||C===-2?0:(C=s(m[R]),C>=0?(C>0&&(C===2?C=0:p.lastNeed=C-3),C):0))}function a(p,m,b){if((m[0]&192)!==128)return p.lastNeed=0,"�";if(p.lastNeed>1&&m.length>1){if((m[1]&192)!==128)return p.lastNeed=1,"�";if(p.lastNeed>2&&m.length>2&&(m[2]&192)!==128)return p.lastNeed=2,"�"}}function c(p){var m=this.lastTotal-this.lastNeed,b=a(this,p);if(b!==void 0)return b;if(this.lastNeed<=p.length)return p.copy(this.lastChar,m,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);p.copy(this.lastChar,m,0,p.length),this.lastNeed-=p.length}function l(p,m){var b=o(this,p,m);if(!this.lastNeed)return p.toString("utf8",m);this.lastTotal=b;var R=p.length-(b-this.lastNeed);return p.copy(this.lastChar,0,R),p.toString("utf8",m,R)}function u(p){var m=p&&p.length?this.write(p):"";return this.lastNeed?m+"�":m}function d(p,m){if((p.length-m)%2===0){var b=p.toString("utf16le",m);if(b){var R=b.charCodeAt(b.length-1);if(R>=55296&&R<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=p[p.length-2],this.lastChar[1]=p[p.length-1],b.slice(0,-1)}return b}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=p[p.length-1],p.toString("utf16le",m,p.length-1)}function f(p){var m=p&&p.length?this.write(p):"";if(this.lastNeed){var b=this.lastTotal-this.lastNeed;return m+this.lastChar.toString("utf16le",0,b)}return m}function y(p,m){var b=(p.length-m)%3;return b===0?p.toString("base64",m):(this.lastNeed=3-b,this.lastTotal=3,b===1?this.lastChar[0]=p[p.length-1]:(this.lastChar[0]=p[p.length-2],this.lastChar[1]=p[p.length-1]),p.toString("base64",m,p.length-b))}function S(p){var m=p&&p.length?this.write(p):"";return this.lastNeed?m+this.lastChar.toString("base64",0,3-this.lastNeed):m}function _(p){return p.toString(this.encoding)}function w(p){return p&&p.length?this.write(p):""}return uo}var Fc=At.codes.ERR_STREAM_PREMATURE_CLOSE;function Bb(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}function Fb(){}function jb(e){return e.setHeader&&typeof e.abort=="function"}function Au(e,t,r){if(typeof t=="function")return Au(e,null,t);t||(t={}),r=Bb(r||Fb);var n=t.readable||t.readable!==!1&&e.readable,i=t.writable||t.writable!==!1&&e.writable,s=function(){e.writable||a()},o=e._writableState&&e._writableState.finished,a=function(){i=!1,o=!0,n||r.call(e)},c=e._readableState&&e._readableState.endEmitted,l=function(){n=!1,c=!0,i||r.call(e)},u=function(S){r.call(e,S)},d=function(){var S;if(n&&!c)return(!e._readableState||!e._readableState.ended)&&(S=new Fc),r.call(e,S);if(i&&!o)return(!e._writableState||!e._writableState.ended)&&(S=new Fc),r.call(e,S)},f=function(){e.req.on("finish",a)};return jb(e)?(e.on("complete",a),e.on("abort",d),e.req?f():e.on("request",f)):i&&!e._writableState&&(e.on("end",s),e.on("close",s)),e.on("end",l),e.on("finish",a),t.error!==!1&&e.on("error",u),e.on("close",d),function(){e.removeListener("complete",a),e.removeListener("abort",d),e.removeListener("request",f),e.req&&e.req.removeListener("finish",a),e.removeListener("end",s),e.removeListener("close",s
2),e.removeListener("finish",a),e.removeListener("end",l),e.removeListener("error",u),e.removeListener("close",d)}}var ta=Au,fo,jc;function Db(){if(jc)return fo;jc=1;var e;function t(b,R,C){return R=r(R),R in b?Object.defineProperty(b,R,{value:C,enumerable:!0,configurable:!0,writable:!0}):b[R]=C,b}function r(b){var R=n(b,"string");return typeof R=="symbol"?R:String(R)}function n(b,R){if(typeof b!="object"||b===null)return b;var C=b[Symbol.toPrimitive];if(C!==void 0){var T=C.call(b,R||"default");if(typeof T!="object")return T;throw new TypeError("@@toPrimitive must return a primitive value.")}return(R==="string"?String:Number)(b)}var i=ta,s=Symbol("lastResolve"),o=Symbol("lastReject"),a=Symbol("error"),c=Symbol("ended"),l=Symbol("lastPromise"),u=Symbol("handlePromise"),d=Symbol("stream");function f(b,R){return{value:b,done:R}}function y(b){var R=b[s];if(R!==null){var C=b[d].read();C!==null&&(b[l]=null,b[s]=null,b[o]=null,R(f(C,!1)))}}function S(b){process.nextTick(y,b)}function _(b,R){return function(C,T){b.then(function(){if(R[c]){C(f(void 0,!0));return}R[u](C,T)},T)}}var w=Object.getPrototypeOf(function(){}),p=Object.setPrototypeOf((e={get stream(){return this[d]},next:function(){var R=this,C=this[a];if(C!==null)return Promise.reject(C);if(this[c])return Promise.resolve(f(void 0,!0));if(this[d].destroyed)return new Promise(function(L,Y){process.nextTick(function(){R[a]?Y(R[a]):L(f(void 0,!0))})});var T=this[l],H;if(T)H=new Promise(_(T,this));else{var F=this[d].read();if(F!==null)return Promise.resolve(f(F,!1));H=new Promise(this[u])}return this[l]=H,H}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var R=this;return new Promise(function(C,T){R[d].destroy(null,function(H){if(H){T(H);return}C(f(void 0,!0))})})}),e),w),m=function(R){var C,T=Object.create(p,(C={},t(C,d,{value:R,writable:!0}),t(C,s,{value:null,writable:!0}),t(C,o,{value:null,writable:!0}),t(C,a,{value:null,writable:!0}),t(C,c,{value:R._readableState.endEmitted,writable:!0}),t(C,u,{value:function(F,L){var Y=T[d].read();Y?(T[l]=null,T[s]=null,T[o]=null,F(f(Y,!1))):(T[s]=F,T[o]=L)},writable:!0}),C));return T[l]=null,i(R,function(H){if(H&&H.code!=="ERR_STREAM_PREMATURE_CLOSE"){var F=T[o];F!==null&&(T[l]=null,T[s]=null,T[o]=null,F(H)),T[a]=H;return}var L=T[s];L!==null&&(T[l]=null,T[s]=null,T[o]=null,L(f(void 0,!0))),T[c]=!0}),R.on("readable",S.bind(null,T)),T};return fo=m,fo}var ho,Dc;function Ub(){return Dc||(Dc=1,ho=function(){throw new Error("Readable.from is not available in the browser")}),ho}var po,Uc;function Tu(){if(Uc)return po;Uc=1,po=L;var e;L.ReadableState=F,xn.EventEmitter;var t=function(g,k){return g.listeners(k).length},r=Su,n=Mo.Buffer,i=(typeof B<"u"?B:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(h){return n.from(h)}function o(h){return n.isBuffer(h)||h instanceof i}var a=wl,c;a&&a.debuglog?c=a.debuglog("stream"):c=function(){};var l=Rb(),u=Ru,d=ku,f=d.getHighWaterMark,y=At.codes,S=y.ERR_INVALID_ARG_TYPE,_=y.ERR_STREAM_PUSH_AFTER_EOF,w=y.ERR_METHOD_NOT_IMPLEMENTED,p=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,m,b,R;We(L,r);var C=u.errorOrDestroy,T=["error","close","destroy","pause","resume"];function H(h,g,k){if(typeof h.prependListener=="function")return h.prependListener(g,k);!h._events||!h._events[g]?h.on(g,k):Array.isArray(h._events[g])?h._events[g].unshift(k):h._events[g]=[k,h._events[g]]}function F(h,g,k){e=e||Xt(),h=h||{},typeof k!="boolean"&&(k=g instanceof e),this.objectMode=!!h.objectMode,k&&(this.objectMode=this.objectMode||!!h.readableObjectMode),this.highWaterMark=f(this,h,"readableHighWaterMark",k),this.buffer=new l,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=h.emitClose!==!1,this.autoDestroy=!!h.autoDestroy,this.destroyed=!1,this.defaultEncoding=h.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,h.encoding&&(m||(m=Bc().StringDecoder),this.decoder=new m(h.encoding),this.encoding=h.encoding)}function L(h){if(e=e||Xt(),!(this instanceof L))return new L(h);var g=this instanceof e;this._readableState=new F(h,this,g),this.readable=!0,h&&(typeof h.read=="function"&&(this._read=h.read),typeof h.destroy=="function"&&(this._destroy=h.destroy)),r.call(this)}Object.defineProperty(L.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(g){this._readableState&&(this._readableState.destroyed=g)}}),L.prototype.destroy=u.destroy,L.prototype._undestroy=u.undestroy,L.prototype._destroy=function(h,g){g(h)},L.prototype.push=function(h,g){var k=this._readableState,x;return k.objectMode?x=!0:typeof h=="string"&&(g=g||k.defaultEncoding,g!==k.encoding&&(h=n.from(h,g),g=""),x=!0),Y(this,h,g,!1,x)},L.prototype.unshift=function(h){return Y(this,h,null,!0,!1)};function Y(h,g,k,x,oe){c("readableAddChunk",g);var z=h._readableState;if(g===null)z.reading=!1,$(h,z);else{var ne;if(oe||(ne=ie(z,g)),ne)C(h,ne);else if(z.objectMode||g&&g.length>
vendor: 5,541 bytes, line 2
20)if(typeof g!="string"&&!z.objectMode&&Object.getPrototypeOf(g)!==n.prototype&&(g=s(g)),x)z.endEmitted?C(h,new p):ae(h,z,g,!0);else if(z.ended)C(h,new _);else{if(z.destroyed)return!1;z.reading=!1,z.decoder&&!k?(g=z.decoder.write(g),z.objectMode||g.length!==0?ae(h,z,g,!1):M(h,z)):ae(h,z,g,!1)}else x||(z.reading=!1,M(h,z))}return!z.ended&&(z.length<z.highWaterMark||z.length===0)}function ae(h,g,k,x){g.flowing&&g.length===0&&!g.sync?(g.awaitDrain=0,h.emit("data",k)):(g.length+=g.objectMode?1:k.length,x?g.buffer.unshift(k):g.buffer.push(k),g.needReadable&&O(h)),M(h,g)}function ie(h,g){var k;return!o(g)&&typeof g!="string"&&g!==void 0&&!h.objectMode&&(k=new S("chunk",["string","Buffer","Uint8Array"],g)),k}L.prototype.isPaused=function(){return this._readableState.flowing===!1},L.prototype.setEncoding=function(h){m||(m=Bc().StringDecoder);var g=new m(h);this._readableState.decoder=g,this._readableState.encoding=this._readableState.decoder.encoding;for(var k=this._readableState.buffer.head,x="";k!==null;)x+=g.write(k.data),k=k.next;return this._readableState.buffer.clear(),x!==""&&this._readableState.buffer.push(x),this._readableState.length=x.length,this};var se=1073741824;function P(h){return h>=se?h=se:(h--,h|=h>>>1,h|=h>>>2,h|=h>>>4,h|=h>>>8,h|=h>>>16,h++),h}function I(h,g){return h<=0||g.length===0&&g.ended?0:g.objectMode?1:h!==h?g.flowing&&g.length?g.buffer.head.data.length:g.length:(h>g.highWaterMark&&(g.highWaterMark=P(h)),h<=g.length?h:g.ended?g.length:(g.needReadable=!0,0))}L.prototype.read=function(h){c("read",h),h=parseInt(h,10);var g=this._readableState,k=h;if(h!==0&&(g.emittedReadable=!1),h===0&&g.needReadable&&((g.highWaterMark!==0?g.length>=g.highWaterMark:g.length>0)||g.ended))return c("read: emitReadable",g.length,g.ended),g.length===0&&g.ended?A(this):O(this),null;if(h=I(h,g),h===0&&g.ended)return g.length===0&&A(this),null;var x=g.needReadable;c("need readable",x),(g.length===0||g.length-h<g.highWaterMark)&&(x=!0,c("length less than watermark",x)),g.ended||g.reading?(x=!1,c("reading or ended",x)):x&&(c("do read"),g.reading=!0,g.sync=!0,g.length===0&&(g.needReadable=!0),this._read(g.highWaterMark),g.sync=!1,g.reading||(h=I(k,g)));var oe;return h>0?oe=E(h,g):oe=null,oe===null?(g.needReadable=g.length<=g.highWaterMark,h=0):(g.length-=h,g.awaitDrain=0),g.length===0&&(g.ended||(g.needReadable=!0),k!==h&&g.ended&&A(this)),oe!==null&&this.emit("data",oe),oe};function $(h,g){if(c("onEofChunk"),!g.ended){if(g.decoder){var k=g.decoder.end();k&&k.length&&(g.buffer.push(k),g.length+=g.objectMode?1:k.length)}g.ended=!0,g.sync?O(h):(g.needReadable=!1,g.emittedReadable||(g.emittedReadable=!0,j(h)))}}function O(h){var g=h._readableState;c("emitReadable",g.needReadable,g.emittedReadable),g.needReadable=!1,g.emittedReadable||(c("emitReadable",g.flowing),g.emittedReadable=!0,process.nextTick(j,h))}function j(h){var g=h._readableState;c("emitReadable_",g.destroyed,g.length,g.ended),!g.destroyed&&(g.length||g.ended)&&(h.emit("readable"),g.emittedReadable=!1),g.needReadable=!g.flowing&&!g.ended&&g.length<=g.highWaterMark,v(h)}function M(h,g){g.readingMore||(g.readingMore=!0,process.nextTick(U,h,g))}function U(h,g){for(;!g.reading&&!g.ended&&(g.length<g.highWaterMark||g.flowing&&g.length===0);){var k=g.length;if(c("maybeReadMore read 0"),h.read(0),k===g.length)break}g.readingMore=!1}L.prototype._read=function(h){C(this,new w("_read()"))},L.prototype.pipe=function(h,g){var k=this,x=this._readableState;switch(x.pipesCount){case 0:x.pipes=h;break;case 1:x.pipes=[x.pipes,h];break;default:x.pipes.push(h);break}x.pipesCount+=1,c("pipe count=%d opts=%j",x.pipesCount,g);var oe=(!g||g.end!==!1)&&h!==process.stdout&&h!==process.stderr,z=oe?et:at;x.endEmitted?process.nextTick(z):k.once("end",z),h.on("unpipe",ne);function ne(tt,Ve){c("onunpipe"),tt===k&&Ve&&Ve.hasUnpiped===!1&&(Ve.hasUnpiped=!0,rn())}function et(){c("onend"),h.end()}var pt=Z(k);h.on("drain",pt);var pr=!1;function rn(){c("cleanup"),h.removeListener("close",Ot),h.removeListener("finish",Mt),h.removeListener("drain",pt),h.removeListener("error",xt),h.removeListener("unpipe",ne),k.removeListener("end",et),k.removeListener("end",at),k.removeListener("data",gr),pr=!0,x.awaitDrain&&(!h._writableState||h._writableState.needDrain)&&pt()}k.on("data",gr);function gr(tt){c("ondata");var Ve=h.write(tt);c("dest.write",Ve),Ve===!1&&((x.pipesCount===1&&x.pipes===h||x.pipesCount>1&&G(x.pipes,h)!==-1)&&!pr&&(c("false write response, pause",x.awaitDrain),x.awaitDrain++),k.pause())}function xt(tt){c("onerror",tt),at(),h.removeListener("error",xt),t(h,"error")===0&&C(h,tt)}H(h,"error",xt);function Ot(){h.removeListener("finish",Mt),at()}h.once("close",Ot);function Mt(){c("onfinish"),h.removeListener("close",Ot),at()}h.once("finish",Mt);function at(){c("unpipe"),k.unpipe(h)}return h.emit("pipe",k),x.flowing||(c("pipe resume"),k.resume()),h};function Z(h){return function(){var k=h._readableState;c("pipeOnDrain",k.awaitDrain),k.awaitDrain&&k.awaitDrain--,k.awaitDrain===0&&t(h,"data")&&(k.flowing=!0,v(h))}}L.prototype.unpipe=function(h){var g=this._readableState,k={hasUnpiped:!1};if(g.pipesCount===0)return this;if(g.pipesCount===1)return h&&h!==g.pipes?this:(h||(h=g.pipes),g.pipes=null,g.pipesCount=0,g.flowing=!1,h&&h.emit("unpipe",this,k),this);if(!h){var x=g.pipes,oe=g.pipesCount;g.pipes=null,g.pipesCount=0,g.flowing=!1;for(var z=0;z<oe;z++)x[z].emit("unpipe",this,{hasUnpiped:!1});return this}var ne=G(g.pipes,h);return ne===-1?this:(g.pipes.splice(ne,1),g.pipesCount-=1,g.pipesCount===1&&(g.pipes=g.pipes[0]),h.emit
vendor: 4,076 bytes, line 2
2("unpipe",this,k),this)},L.prototype.on=function(h,g){var k=r.prototype.on.call(this,h,g),x=this._readableState;return h==="data"?(x.readableListening=this.listenerCount("readable")>0,x.flowing!==!1&&this.resume()):h==="readable"&&!x.endEmitted&&!x.readableListening&&(x.readableListening=x.needReadable=!0,x.flowing=!1,x.emittedReadable=!1,c("on readable",x.length,x.reading),x.length?O(this):x.reading||process.nextTick(K,this)),k},L.prototype.addListener=L.prototype.on,L.prototype.removeListener=function(h,g){var k=r.prototype.removeListener.call(this,h,g);return h==="readable"&&process.nextTick(W,this),k},L.prototype.removeAllListeners=function(h){var g=r.prototype.removeAllListeners.apply(this,arguments);return(h==="readable"||h===void 0)&&process.nextTick(W,this),g};function W(h){var g=h._readableState;g.readableListening=h.listenerCount("readable")>0,g.resumeScheduled&&!g.paused?g.flowing=!0:h.listenerCount("data")>0&&h.resume()}function K(h){c("readable nexttick read 0"),h.read(0)}L.prototype.resume=function(){var h=this._readableState;return h.flowing||(c("resume"),h.flowing=!h.readableListening,de(this,h)),h.paused=!1,this};function de(h,g){g.resumeScheduled||(g.resumeScheduled=!0,process.nextTick(re,h,g))}function re(h,g){c("resume",g.reading),g.reading||h.read(0),g.resumeScheduled=!1,h.emit("resume"),v(h),g.flowing&&!g.reading&&h.read(0)}L.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function v(h){var g=h._readableState;for(c("flow",g.flowing);g.flowing&&h.read()!==null;);}L.prototype.wrap=function(h){var g=this,k=this._readableState,x=!1;h.on("end",function(){if(c("wrapped end"),k.decoder&&!k.ended){var ne=k.decoder.end();ne&&ne.length&&g.push(ne)}g.push(null)}),h.on("data",function(ne){if(c("wrapped data"),k.decoder&&(ne=k.decoder.write(ne)),!(k.objectMode&&ne==null)&&!(!k.objectMode&&(!ne||!ne.length))){var et=g.push(ne);et||(x=!0,h.pause())}});for(var oe in h)this[oe]===void 0&&typeof h[oe]=="function"&&(this[oe]=function(et){return function(){return h[et].apply(h,arguments)}}(oe));for(var z=0;z<T.length;z++)h.on(T[z],this.emit.bind(this,T[z]));return this._read=function(ne){c("wrapped _read",ne),x&&(x=!1,h.resume())},this},typeof Symbol=="function"&&(L.prototype[Symbol.asyncIterator]=function(){return b===void 0&&(b=Db()),b(this)}),Object.defineProperty(L.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(L.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(L.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(g){this._readableState&&(this._readableState.flowing=g)}}),L._fromList=E,Object.defineProperty(L.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function E(h,g){if(g.length===0)return null;var k;return g.objectMode?k=g.buffer.shift():!h||h>=g.length?(g.decoder?k=g.buffer.join(""):g.buffer.length===1?k=g.buffer.first():k=g.buffer.concat(g.length),g.buffer.clear()):k=g.buffer.consume(h,g.decoder),k}function A(h){var g=h._readableState;c("endReadable",g.endEmitted),g.endEmitted||(g.ended=!0,process.nextTick(D,g,h))}function D(h,g){if(c("endReadableNT",h.endEmitted,h.length),!h.endEmitted&&h.length===0&&(h.endEmitted=!0,g.readable=!1,g.emit("end"),h.autoDestroy)){var k=g._writableState;(!k||k.autoDestroy&&k.finished)&&g.destroy()}}typeof Symbol=="function"&&(L.from=function(h,g){return R===void 0&&(R=Ub()),R(L,h,g)});function G(h,g){for(var k=0,x=h.length;k<x;k++)if(h[k]===g)return k;return-1}return po}var Pu=st,ui=At.codes,Hb=ui.ERR_METHOD_NOT_IMPLEMENTED,Wb=ui.ERR_MULTIPLE_CALLBACK,Vb=ui.ERR_TRANSFORM_ALREADY_TRANSFORMING,qb=ui.ERR_TRANSFORM_WITH_LENGTH_0,di=Xt();We(st,di);function zb(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;
2if(n===null)return this.emit("error",new Wb);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function st(e){if(!(this instanceof st))return new st(e);di.call(this,e),this._transformState={afterTransform:zb.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",Gb)}function Gb(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){Hc(e,t,r)}):Hc(this,null,null)}st.prototype.push=function(e,t){return this._transformState.needTransform=!1,di.prototype.push.call(this,e,t)};st.prototype._transform=function(e,t,r){r(new Hb("_transform()"))};st.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};st.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};st.prototype._destroy=function(e,t){di.prototype._destroy.call(this,e,function(r){t(r)})};function Hc(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new qb;if(e._transformState.transforming)throw new Vb;return e.push(null)}var Jb=Rr,xu=Pu;We(Rr,xu);function Rr(e){if(!(this instanceof Rr))return new Rr(e);xu.call(this,e)}Rr.prototype._transform=function(e,t,r){r(null,e)};var go;function Zb(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var Ou=At.codes,Kb=Ou.ERR_MISSING_ARGS,Qb=Ou.ERR_STREAM_DESTROYED;function Wc(e){if(e)throw e}function Yb(e){return e.setHeader&&typeof e.abort=="function"}function Xb(e,t,r,n){n=Zb(n);var i=!1;e.on("close",function(){i=!0}),go===void 0&&(go=ta),go(e,{readable:t,writable:r},function(o){if(o)return n(o);i=!0,n()});var s=!1;return function(o){if(!i&&!s){if(s=!0,Yb(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(o||new Qb("pipe"))}}}function Vc(e){e()}function em(e,t){return e.pipe(t)}function tm(e){return!e.length||typeof e[e.length-1]!="function"?Wc:e.pop()}function rm(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=tm(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Kb("streams");var i,s=t.map(function(o,a){var c=a<t.length-1,l=a>0;return Xb(o,c,l,function(u){i||(i=u),u&&s.forEach(Vc),!c&&(s.forEach(Vc),n(i))})});return t.reduce(em)}var nm=rm;(function(e,t){t=e.exports=Tu(),t.Stream=t,t.Readable=t,t.Writable=Iu(),t.Duplex=Xt(),t.Transform=Pu,t.PassThrough=Jb,t.finished=ta,t.pipeline=nm})(ko,ko.exports);var Mu=ko.exports;const{Transform:im}=Mu;var sm=e=>class Nu extends im{constructor(r,n,i,s,o){super(o),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._hashBitLength=s,this._options=o,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(o){s=o}i(s)}_flush(r){let n=null;try{this.push(this.digest())}catch(i){n=i}r(n)}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}digest(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let n=this._state.squeeze(this._hashBitLength/8);return r!==void 0&&(n=n.toString(r)),this._resetState(),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new Nu(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:om}=Mu;var am=e=>class Lu extends om{constructor(r,n,i,s){super(s),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._options=s,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(o){s=o}i(s)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}squeeze(r,n){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let i=this._state.squeeze(r);return n!==void 0&&(i=i.toString(n)),i}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new Lu(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const cm=sm,lm=am;var um=function(e){const t=cm(e),r=lm(e);return function(n,i){switch(typeof n=="string"?n.toLowerCase():n){case"keccak224":return new t(1152,448,null,224,i);case"keccak256":return new t(1088,512,null,256,i);case"keccak384":return new t(832,768,null,384,i);case"keccak512":return new t(576,1024,null,512,i);case"sha3-224":return new t(1152,448,6,224,i);case"sha3-256":return new t(1088,512,6,256,i);case"sha3-384":return new t(832,768,6,384,i);case"sha3-512":return new t(576,1024,6,512,i);case"shake128":return new r(1344,256,31,i);case"shake256":return new r(1088,512,31,i);default:throw new Error("Invald algorithm: "+n)}}},$u={};const qc=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];$u.p1600=function(e){for(let t=0;t<24;++t){const r=e[0]^e[10]^e[20]^e[30]^e[40],n=e[1]^e[11]^e[21]^e[31]^e[41],i=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],o=e[4]^e[14]^e[24]^e[34]^e[44],a=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],u=e[8]^e[18]^e[28]^e[38]^e[48],d=e[9]^e[19]^e[29]^e[39]^e[49];let f=u^(i<<1|s>>>31),y=d^(s<<1|i>>>31);const S=e[0]^f,_=e[1]^y,w=e[10]^f,p=e[11]^y,m=e[20]^f,b=e[21]^y,R=e[30]^f,C=e[31]^y,T=e[40]^f,H=e[41]^y;f=r^(o<<1|a>>>31),y=n^(a<<1|o>>>31);const F=e[2]^f,L=e[3]^y,Y=e[12]^f,ae=e[13]^y,ie=e[22]^f,se=e[23]^y,P=e[32]^f,I=e[33]^y,$=e[42]^f,O=e[43]^y;f=i^(c<<1|l>>>31),y=s^(l<<1|c>>>31);const j=e[4]^f,M=e[5]^y,U=e[14]^f,Z=e[15]^y,W=e[24]^f,K=e[25]^y,de=e[34]^f,re=e[35]^y,v=e[44]^f,E=e[45]^y;f=o^(u<<1|d>>>31),y=a^(d<<1|u>>>31);
2const A=e[6]^f,D=e[7]^y,G=e[16]^f,h=e[17]^y,g=e[26]^f,k=e[27]^y,x=e[36]^f,oe=e[37]^y,z=e[46]^f,ne=e[47]^y;f=c^(r<<1|n>>>31),y=l^(n<<1|r>>>31);const et=e[8]^f,pt=e[9]^y,pr=e[18]^f,rn=e[19]^y,gr=e[28]^f,xt=e[29]^y,Ot=e[38]^f,Mt=e[39]^y,at=e[48]^f,tt=e[49]^y,Ve=S,Ti=_,Pi=p<<4|w>>>28,xi=w<<4|p>>>28,Oi=m<<3|b>>>29,Mi=b<<3|m>>>29,Ni=C<<9|R>>>23,Li=R<<9|C>>>23,$i=T<<18|H>>>14,Bi=H<<18|T>>>14,Fi=F<<1|L>>>31,ji=L<<1|F>>>31,Di=ae<<12|Y>>>20,Ui=Y<<12|ae>>>20,Hi=ie<<10|se>>>22,Wi=se<<10|ie>>>22,Vi=I<<13|P>>>19,qi=P<<13|I>>>19,zi=$<<2|O>>>30,Gi=O<<2|$>>>30,Ji=M<<30|j>>>2,Zi=j<<30|M>>>2,Ki=U<<6|Z>>>26,Qi=Z<<6|U>>>26,Yi=K<<11|W>>>21,Xi=W<<11|K>>>21,es=de<<15|re>>>17,ts=re<<15|de>>>17,rs=E<<29|v>>>3,ns=v<<29|E>>>3,is=A<<28|D>>>4,ss=D<<28|A>>>4,os=h<<23|G>>>9,as=G<<23|h>>>9,cs=g<<25|k>>>7,ls=k<<25|g>>>7,us=x<<21|oe>>>11,ds=oe<<21|x>>>11,fs=ne<<24|z>>>8,hs=z<<24|ne>>>8,ps=et<<27|pt>>>5,gs=pt<<27|et>>>5,ys=pr<<20|rn>>>12,bs=rn<<20|pr>>>12,ms=xt<<7|gr>>>25,_s=gr<<7|xt>>>25,vs=Ot<<8|Mt>>>24,ws=Mt<<8|Ot>>>24,Es=at<<14|tt>>>18,Ss=tt<<14|at>>>18;e[0]=Ve^~Di&Yi,e[1]=Ti^~Ui&Xi,e[10]=is^~ys&Oi,e[11]=ss^~bs&Mi,e[20]=Fi^~Ki&cs,e[21]=ji^~Qi&ls,e[30]=ps^~Pi&Hi,e[31]=gs^~xi&Wi,e[40]=Ji^~os&ms,e[41]=Zi^~as&_s,e[2]=Di^~Yi&us,e[3]=Ui^~Xi&ds,e[12]=ys^~Oi&Vi,e[13]=bs^~Mi&qi,e[22]=Ki^~cs&vs,e[23]=Qi^~ls&ws,e[32]=Pi^~Hi&es,e[33]=xi^~Wi&ts,e[42]=os^~ms&Ni,e[43]=as^~_s&Li,e[4]=Yi^~us&Es,e[5]=Xi^~ds&Ss,e[14]=Oi^~Vi&rs,e[15]=Mi^~qi&ns,e[24]=cs^~vs&$i,e[25]=ls^~ws&Bi,e[34]=Hi^~es&fs,e[35]=Wi^~ts&hs,e[44]=ms^~Ni&zi,e[45]=_s^~Li&Gi,e[6]=us^~Es&Ve,e[7]=ds^~Ss&Ti,e[16]=Vi^~rs&is,e[17]=qi^~ns&ss,e[26]=vs^~$i&Fi,e[27]=ws^~Bi&ji,e[36]=es^~fs&ps,e[37]=ts^~hs&gs,e[46]=Ni^~zi&Ji,e[47]=Li^~Gi&Zi,e[8]=Es^~Ve&Di,e[9]=Ss^~Ti&Ui,e[18]=rs^~is&ys,e[19]=ns^~ss&bs,e[28]=$i^~Fi&Ki,e[29]=Bi^~ji&Qi,e[38]=fs^~ps&Pi,e[39]=hs^~gs&xi,e[48]=zi^~Ji&os,e[49]=Gi^~Zi&as,e[0]^=qc[t*2],e[1]^=qc[t*2+1]}};const kn=$u;function dr(){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}dr.prototype.initialize=function(e,t){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1};dr.prototype.absorb=function(e){for(let t=0;t<e.length;++t)this.state[~~(this.count/4)]^=e[t]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(kn.p1600(this.state),this.count=0)};dr.prototype.absorbLastFewBits=function(e){this.state[~~(this.count/4)]^=e<<8*(this.count%4),e&128&&this.count===this.blockSize-1&&kn.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),kn.p1600(this.state),this.count=0,this.squeezing=!0};dr.prototype.squeeze=function(e){this.squeezing||this.absorbLastFewBits(1);const t=Buffer.alloc(e);for(let r=0;r<e;++r)t[r]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(kn.p1600(this.state),this.count=0);return t};dr.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing};var dm=dr,fm=um(dm);const hm=fm,pm=Pn;function Bu(e){return Buffer.allocUnsafe(e).fill(0)}function Fu(e,t,r){const n=Bu(t);return e=fi(e),r?e.length<t?(e.copy(n),n):e.slice(0,t):e.length<t?(e.copy(n,t-e.length),n):e.slice(-t)}function gm(e,t){return Fu(e,t,!0)}function fi(e){if(!Buffer.isBuffer(e))if(Array.isArray(e))e=Buffer.from(e);else if(typeof e=="string")ju(e)?e=Buffer.from(mm(Du(e)),"hex"):e=Buffer.from(e);else if(typeof e=="number")e=intToBuffer(e);else if(e==null)e=Buffer.allocUnsafe(0);else if(pm.isBN(e))e=e.toArrayLike(Buffer);else if(e.toArray)e=Buffer.from(e.toArray());else throw new Error("invalid type");return e}function ym(e){return e=fi(e),"0x"+e.toString("hex")}function bm(e,t){return e=fi(e),t||(t=256),hm("keccak"+t).update(e).digest()}function mm(e){return e.length%2?"0"+e:e}function ju(e){return typeof e=="string"&&e.match(/^0x[0-9A-Fa-f]*$/)}function Du(e){return typeof e=="string"&&e.startsWith("0x")?e.slice(2):e}var Uu={zeros:Bu,setLength:Fu,setLengthRight:gm,isHexString:ju,stripHexPrefix:Du,toBuffer:fi,bufferToHex:ym,keccak:bm};const kt=Uu,Et=Pn;function Hu(e){return e.startsWith("int[")?"int256"+e.slice(3):e==="int"?"int256":e.startsWith("uint[")?"uint256"+e.slice(4):e==="uint"?"uint256":e.startsWith("fixed[")?"fixed128x128"+e.slice(5):e==="fixed"?"fixed128x128":e.startsWith("ufixed[")?"ufixed128x128"+e.slice(6):e==="ufixed"?"ufixed128x128":e}function Gt(e){return parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function zc(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[parseInt(t[1],10),parseInt(t[2],10)]}function Wu(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?t[2]===""?"dynamic":parseInt(t[2],10):null}function _t(e){var t=typeof e;if(t==="string")return kt.isHexString(e)?new Et(kt.stripHexPrefix(e),16):new Et(e,10);if(t==="number")return new Et(e);
2if(e.toArray)return e;throw new Error("Argument is not a number")}function Je(e,t){var r,n,i,s;if(e==="address")return Je("uint160",_t(t));if(e==="bool")return Je("uint8",t?1:0);if(e==="string")return Je("bytes",new Buffer(t,"utf8"));if(vm(e)){if(typeof t.length>"u")throw new Error("Not an array?");if(r=Wu(e),r!=="dynamic"&&r!==0&&t.length>r)throw new Error("Elements exceed array size: "+r);i=[],e=e.slice(0,e.lastIndexOf("[")),typeof t=="string"&&(t=JSON.parse(t));for(s in t)i.push(Je(e,t[s]));if(r==="dynamic"){var o=Je("uint256",t.length);i.unshift(o)}return Buffer.concat(i)}else{if(e==="bytes")return t=new Buffer(t),i=Buffer.concat([Je("uint256",t.length),t]),t.length%32!==0&&(i=Buffer.concat([i,kt.zeros(32-t.length%32)])),i;if(e.startsWith("bytes")){if(r=Gt(e),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return kt.setLengthRight(t,32)}else if(e.startsWith("uint")){if(r=Gt(e),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=_t(t),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(Buffer,"be",32)}else if(e.startsWith("int")){if(r=Gt(e),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=_t(t),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(Buffer,"be",32)}else if(e.startsWith("ufixed")){if(r=zc(e),n=_t(t),n<0)throw new Error("Supplied ufixed is negative");return Je("uint256",n.mul(new Et(2).pow(new Et(r[1]))))}else if(e.startsWith("fixed"))return r=zc(e),Je("int256",_t(t).mul(new Et(2).pow(new Et(r[1]))))}throw new Error("Unsupported or invalid type: "+e)}function _m(e){return e==="string"||e==="bytes"||Wu(e)==="dynamic"}function vm(e){return e.lastIndexOf("]")===e.length-1}function wm(e,t){var r=[],n=[],i=32*e.length;for(var s in e){var o=Hu(e[s]),a=t[s],c=Je(o,a);_m(o)?(r.push(Je("uint256",i)),n.push(c),i+=c.length):r.push(c)}return Buffer.concat(r.concat(n))}function Vu(e,t){if(e.length!==t.length)throw new Error("Number of types are not matching the values");for(var r,n,i=[],s=0;s<e.length;s++){var o=Hu(e[s]),a=t[s];if(o==="bytes")i.push(a);else if(o==="string")i.push(new Buffer(a,"utf8"));else if(o==="bool")i.push(new Buffer(a?"01":"00","hex"));else if(o==="address")i.push(kt.setLength(a,20));else if(o.startsWith("bytes")){if(r=Gt(o),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);i.push(kt.setLengthRight(a,r))}else if(o.startsWith("uint")){if(r=Gt(o),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=_t(a),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());i.push(n.toArrayLike(Buffer,"be",r/8))}else if(o.startsWith("int")){if(r=Gt(o),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=_t(a),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());i.push(n.toTwos(r).toArrayLike(Buffer,"be",r/8))}else throw new Error("Unsupported or invalid type: "+o)}return Buffer.concat(i)}function Em(e,t){return kt.keccak(Vu(e,t))}var Sm={rawEncode:wm,solidityPack:Vu,soliditySHA3:Em};const je=Uu,vr=Sm,qu={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"]},yo={encodeData(e,t,r,n=!0){const i=["bytes32"],s=[this.hashType(e,r)];if(n){const o=(a,c,l)=>{if(r[c]!==void 0)return["bytes32",l==null?"0x0000000000000000000000000000000000000000000000000000000000000000":je.keccak(this.encodeData(c,l,r,n))];if(l===void 0)throw new Error(`missing value for field ${a} of type ${c}`);if(c==="bytes")return["bytes32",je.keccak(l)];if(c==="string")return typeof l=="string"&&(l=Buffer.from(l,"utf8")),["bytes32",je.keccak(l)];if(c.lastIndexOf("]")===c.length-1){const u=c.slice(0,c.lastIndexOf("[")),d=l.map(f=>o(a,u,f));return["bytes32",je.keccak(vr.rawEncode(d.map(([f])=>f),d.map(([,f])=>f)))]}return[c,l]};
2for(const a of r[e]){const[c,l]=o(a.name,a.type,t[a.name]);i.push(c),s.push(l)}}else for(const o of r[e]){let a=t[o.name];if(a!==void 0)if(o.type==="bytes")i.push("bytes32"),a=je.keccak(a),s.push(a);else if(o.type==="string")i.push("bytes32"),typeof a=="string"&&(a=Buffer.from(a,"utf8")),a=je.keccak(a),s.push(a);else if(r[o.type]!==void 0)i.push("bytes32"),a=je.keccak(this.encodeData(o.type,a,r,n)),s.push(a);else{if(o.type.lastIndexOf("]")===o.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(o.type),s.push(a)}}return vr.rawEncode(i,s)},encodeType(e,t){let r="",n=this.findTypeDependencies(e,t).filter(i=>i!==e);n=[e].concat(n.sort());for(const i of n){if(!t[i])throw new Error("No type definition specified: "+i);r+=i+"("+t[i].map(({name:o,type:a})=>a+" "+o).join(",")+")"}return r},findTypeDependencies(e,t,r=[]){if(e=e.match(/^\w*/)[0],r.includes(e)||t[e]===void 0)return r;r.push(e);for(const n of t[e])for(const i of this.findTypeDependencies(n.type,t,r))!r.includes(i)&&r.push(i);return r},hashStruct(e,t,r,n=!0){return je.keccak(this.encodeData(e,t,r,n))},hashType(e,t){return je.keccak(this.encodeType(e,t))},sanitizeData(e){const t={};for(const r in qu.properties)e[r]&&(t[r]=e[r]);return t.types&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},hash(e,t=!0){const r=this.sanitizeData(e),n=[Buffer.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,t)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,t)),je.keccak(Buffer.concat(n))}};var Rm={TYPED_MESSAGE_SCHEMA:qu,TypedDataUtils:yo,hashForSignTypedDataLegacy:function(e){return Cm(e.data)},hashForSignTypedData_v3:function(e){return yo.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return yo.hash(e.data)}};function Cm(e){const t=new Error("Expect argument to be non-empty array");if(typeof e!="object"||!e.length)throw t;const r=e.map(function(s){return s.type==="bytes"?je.toBuffer(s.value):s.value}),n=e.map(function(s){return s.type}),i=e.map(function(s){if(!s.name)throw t;return s.type+" "+s.name});return vr.soliditySHA3(["bytes32","bytes32"],[vr.soliditySHA3(new Array(e.length).fill("string"),i),vr.soliditySHA3(n,r)])}var er={};Object.defineProperty(er,"__esModule",{value:!0});er.filterFromParam=er.FilterPolyfill=void 0;const Ht=pe,Se=N,km=5*60*1e3,vt={jsonrpc:"2.0",id:0};class Im{constructor(t){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,Ht.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=t}async newFilter(t){const r=zu(t),n=this.makeFilterId(),i=await this.setInitialCursorPosition(n,r.fromBlock);return console.info(`Installing new log filter(${n}):`,r,"initial cursor position:",i),this.logFilters.set(n,r),this.setFilterTimeout(n),(0,Se.hexStringFromIntNumber)(n)}async newBlockFilter(){const t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.info(`Installing new block filter (${t}) with initial cursor position:`,r),this.blockFilters.add(t),this.setFilterTimeout(t),(0,Se.hexStringFromIntNumber)(t)}async newPendingTransactionFilter(){const t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.info(`Installing new block filter (${t}) with initial cursor position:`,r),this.pendingTransactionFilters.add(t),this.setFilterTimeout(t),(0,Se.hexStringFromIntNumber)(t)}uninstallFilter(t){const r=(0,Se.intNumberFromHexString)(t);return console.info(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(t){const r=(0,Se.intNumberFromHexString)(t);return this.timeouts.has(r)&&this.setFilterTimeout(r),this.logFilters.has(r)?this.getLogFilterChanges(r):this.blockFilters.has(r)?this.getBlockFilterChanges(r):this.pendingTransactionFilters.has(r)?this.getPendingTransactionFilterChanges(r):Promise.resolve(pn())}async getFilterLogs(t){const r=(0,Se.intNumberFromHexString)(t),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},vt),{method:"eth_getLogs",params:[Gc(n)]})):pn()}makeFilterId(){return(0,Ht.IntNumber)(++this.nextFilterId)}sendAsyncPromise(t){return new Promise((r,n)=>{this.provider.sendAsync(t,(i,s)=>{if(i)return n(i);if(Array.isArray(s)||s==null)return n(new Error(`unexpected response received: ${JSON.stringify(s)}`));r(s)})})}deleteFilter(t){console.info(`Deleting filter (${t})`),this.logFilters.delete(t),this.blockFilters.delete(t),this.pendingTransactionFilters.delete(t),this.cursors.delete(t),this.timeouts.delete(t)}async getLogFilterChanges(t){const r=this.logFilters.get(t),n=this.cursors.get(t);if(!n||!r)return pn();const i=await this.getCurrentBlockHeight(),s=r.toBlock==="latest"?i:r.toBlock;if(n>i||n>Number(r.toBlock))return gn();console.info(`Fetching logs from ${n} to ${s} for filter ${t}`);const o=await this.sendAsyncPromise(Object.assign(Object.assign({},vt),{method:"eth_getLogs",params:[Gc(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:s}))]}));if(Array.isArray(o.result)){const a=o.result.map(l=>(0,Se.intNumberFromHexString)(l.blockNumber||"0x0")),c=Math.max(...a);if(c&&c>n){const l=(0,Ht.IntNumber)(c+1);console.info(`Moving cursor position for filter (${t}) from ${n} to ${l}`),this.cursors.set(t,l)}}return o}async getBlockFilterChanges(t){const r=this.cursors.get(t);if(!r)return pn();const n=await this.getCurrentBlockHeight();if(r>n)return gn();console.info(`Fetching blocks from ${r} to ${n} for filter (${t})`);const i=(await Promise.all((0,Se.range)(r,n+1).map(o=>this.getBlockHashByNumber((0,Ht.IntNumber)(o))))).filter(o=>!!o),s=(0,Ht.IntNumber)(r+i.length);return console.info(`Moving cursor position for filter (${t}) from ${r} to ${s}`),this.cursors.set(t,s),Object.assign(Object.assign({},vt),{result:i})}async getPendingTransactionFilterChanges(t){return Promise.resolve(gn())}async setInitialCursorPosition(t,r){const n=await this.getCurrentBlockHeight(),i=typeof r=="number"&&r>n?r:n;return this.cursors.set(t,i),i}setFilterTimeout(t){const r=this.timeouts.get(t);r&&window.clearTimeout(r);const n=window.setTimeout(()=>{console.info(`Filter (${t}) timed out`),this.deleteFilter(t)},km);this.timeouts.set(t,n)}async getCurrentBlockHeight(){const t=new Date;if(t.getTime()-this.lastFetchTimestamp.getTime()>this.REQUEST_THROTTLE_INTERVAL){this.lastFetchTimestamp=t;const r=await this._getCurrentBlockHeight();
2this.currentBlockHeight=r,this.resolvers.forEach(n=>n(r)),this.resolvers=[]}return this.currentBlockHeight?this.currentBlockHeight:new Promise(r=>this.resolvers.push(r))}async _getCurrentBlockHeight(){const{result:t}=await this.sendAsyncPromise(Object.assign(Object.assign({},vt),{method:"eth_blockNumber",params:[]}));return(0,Se.intNumberFromHexString)((0,Se.ensureHexString)(t))}async getBlockHashByNumber(t){const r=await this.sendAsyncPromise(Object.assign(Object.assign({},vt),{method:"eth_getBlockByNumber",params:[(0,Se.hexStringFromIntNumber)(t),!1]}));return r.result&&typeof r.result.hash=="string"?(0,Se.ensureHexString)(r.result.hash):null}}er.FilterPolyfill=Im;function zu(e){return{fromBlock:Jc(e.fromBlock),toBlock:Jc(e.toBlock),addresses:e.address===void 0?null:Array.isArray(e.address)?e.address:[e.address],topics:e.topics||[]}}er.filterFromParam=zu;function Gc(e){const t={fromBlock:Zc(e.fromBlock),toBlock:Zc(e.toBlock),topics:e.topics};return e.addresses!==null&&(t.address=e.addresses),t}function Jc(e){if(e===void 0||e==="latest"||e==="pending")return"latest";if(e==="earliest")return(0,Ht.IntNumber)(0);if((0,Se.isHexString)(e))return(0,Se.intNumberFromHexString)(e);throw new Error(`Invalid block option: ${String(e)}`)}function Zc(e){return e==="latest"?e:(0,Se.hexStringFromIntNumber)(e)}function pn(){return Object.assign(Object.assign({},vt),{error:{code:-32e3,message:"filter not found"}})}function gn(){return Object.assign(Object.assign({},vt),{result:[]})}var hi={},Gu={},pi={},ra=Am;function Am(e){e=e||{};var t=e.max||Number.MAX_SAFE_INTEGER,r=typeof e.start<"u"?e.start:Math.floor(Math.random()*t);return function(){return r=r%t,r++}}const Kc=(e,t)=>function(){const r=t.promiseModule,n=new Array(arguments.length);for(let i=0;i<arguments.length;i++)n[i]=arguments[i];return new r((i,s)=>{t.errorFirst?n.push(function(o,a){if(t.multiArgs){const c=new Array(arguments.length-1);for(let l=1;l<arguments.length;l++)c[l-1]=arguments[l];o?(c.unshift(o),s(c)):i(c)}else o?s(o):i(a)}):n.push(function(o){if(t.multiArgs){const a=new Array(arguments.length-1);for(let c=0;c<arguments.length;c++)a[c]=arguments[c];i(a)}else i(o)}),e.apply(this,n)})};var Tm=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const r=i=>{const s=o=>typeof o=="string"?i===o:o.test(i);return t.include?t.include.some(s):!t.exclude.some(s)};let n;typeof e=="function"?n=function(){return t.excludeMain?e.apply(this,arguments):Kc(e,t).apply(this,arguments)}:n=Object.create(Object.getPrototypeOf(e));for(const i in e){const s=e[i];n[i]=typeof s=="function"&&r(i)?Kc(s,t):s}return n},zr={},Gr={};Object.defineProperty(Gr,"__esModule",{value:!0});const Pm=xn;function Qc(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function xm(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let Om=class extends Pm.EventEmitter{emit(t,...r){let n=t==="error";const i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){let o;if(r.length>0&&([o]=r),o instanceof Error)throw o;const a=new Error(`Unhandled error.${o?` (${o.message})`:""}`);throw a.context=o,a}const s=i[t];if(s===void 0)return!1;if(typeof s=="function")Qc(s,this,r);else{const o=s.length,a=xm(s);for(let c=0;c<o;c+=1)Qc(a[c],this,r)}return!0}};Gr.default=Om;var Mm=B&&B.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(zr,"__esModule",{value:!0});zr.BaseBlockTracker=void 0;const Nm=Mm(Gr),Lm=1e3,$m=(e,t)=>e+t,Yc=["sync","latest"];class Bm extends Nm.default{constructor(t){super(),this._blockResetDuration=t.blockResetDuration||20*Lm,this._usePastBlocks=t.usePastBlocks||!1,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(r=>this.once("latest",r))}removeAllListeners(t){return t?super.removeAllListeners(t):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(t){Yc.includes(t)&&this._maybeStart()}
2_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 Yc.map(t=>this.listenerCount(t)).reduce($m)}_shouldUseNewBlock(t){const r=this._currentBlock;if(!r)return!0;const n=Xc(t),i=Xc(r);return this._usePastBlocks&&n<i||n>i}_newPotentialLatest(t){this._shouldUseNewBlock(t)&&this._setCurrentBlock(t)}_setCurrentBlock(t){const r=this._currentBlock;this._currentBlock=t,this.emit("latest",t),this.emit("sync",{oldBlock:r,newBlock:t})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}zr.BaseBlockTracker=Bm;function Xc(e){return Number.parseInt(e,16)}var Ju={},Zu={},we={};class Ku extends TypeError{constructor(t,r){let n;const{message:i,explanation:s,...o}=t,{path:a}=t,c=a.length===0?i:`At path: ${a.join(".")} -- ${i}`;super(s??c),s!=null&&(this.cause=c),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...r()])}}function Fm(e){return $e(e)&&typeof e[Symbol.iterator]=="function"}function $e(e){return typeof e=="object"&&e!=null}function el(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function ge(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function jm(e){const{done:t,value:r}=e.next();return t?void 0:r}function Dm(e,t,r,n){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:i,branch:s}=t,{type:o}=r,{refinement:a,message:c=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${ge(n)}\``}=e;return{value:n,type:o,refinement:a,key:i[i.length-1],path:i,branch:s,...e,message:c}}function*Ao(e,t,r,n){Fm(e)||(e=[e]);for(const i of e){const s=Dm(i,t,r,n);s&&(yield s)}}function*na(e,t,r={}){const{path:n=[],branch:i=[e],coerce:s=!1,mask:o=!1}=r,a={path:n,branch:i};if(s&&(e=t.coercer(e,a),o&&t.type!=="type"&&$e(t.schema)&&$e(e)&&!Array.isArray(e)))for(const l in e)t.schema[l]===void 0&&delete e[l];let c="valid";for(const l of t.validator(e,a))l.explanation=r.message,c="not_valid",yield[l,void 0];for(let[l,u,d]of t.entries(e,a)){const f=na(u,d,{path:l===void 0?n:[...n,l],branch:l===void 0?i:[...i,u],coerce:s,mask:o,message:r.message});for(const y of f)y[0]?(c=y[0].refinement!=null?"not_refined":"not_valid",yield[y[0],void 0]):s&&(u=y[1],l===void 0?e=u:e instanceof Map?e.set(l,u):e instanceof Set?e.add(u):$e(e)&&(u!==void 0||l in e)&&(e[l]=u))}
2if(c!=="not_valid")for(const l of t.refiner(e,a))l.explanation=r.message,c="not_refined",yield[l,void 0];c==="valid"&&(yield[void 0,e])}class fe{constructor(t){const{type:r,schema:n,validator:i,refiner:s,coercer:o=c=>c,entries:a=function*(){}}=t;this.type=r,this.schema=n,this.entries=a,this.coercer=o,i?this.validator=(c,l)=>{const u=i(c,l);return Ao(u,l,this,c)}:this.validator=()=>[],s?this.refiner=(c,l)=>{const u=s(c,l);return Ao(u,l,this,c)}:this.refiner=()=>[]}assert(t,r){return Qu(t,this,r)}create(t,r){return Yu(t,this,r)}is(t){return ia(t,this)}mask(t,r){return Xu(t,this,r)}validate(t,r={}){return fr(t,this,r)}}function Qu(e,t,r){const n=fr(e,t,{message:r});if(n[0])throw n[0]}function Yu(e,t,r){const n=fr(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function Xu(e,t,r){const n=fr(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function ia(e,t){return!fr(e,t)[0]}function fr(e,t,r={}){const n=na(e,t,r),i=jm(n);return i[0]?[new Ku(i[0],function*(){for(const o of n)o[0]&&(yield o[0])}),void 0]:[void 0,i[1]]}function Um(...e){const t=e[0].type==="type",r=e.map(i=>i.schema),n=Object.assign({},...r);return t?Zr(n):Jr(n)}function Ie(e,t){return new fe({type:e,schema:null,validator:t})}function Hm(e,t){return new fe({...e,refiner:(r,n)=>r===void 0||e.refiner(r,n),validator(r,n){return r===void 0?!0:(t(r,n),e.validator(r,n))}})}function Wm(e){return new fe({type:"dynamic",schema:null,*entries(t,r){yield*e(t,r).entries(t,r)},validator(t,r){return e(t,r).validator(t,r)},coercer(t,r){return e(t,r).coercer(t,r)},refiner(t,r){return e(t,r).refiner(t,r)}})}function Vm(e){let t;return new fe({type:"lazy",schema:null,*entries(r,n){t??(t=e()),yield*t.entries(r,n)},validator(r,n){return t??(t=e()),t.validator(r,n)},coercer(r,n){return t??(t=e()),t.coercer(r,n)},refiner(r,n){return t??(t=e()),t.refiner(r,n)}})}function qm(e,t){const{schema:r}=e,n={...r};for(const i of t)delete n[i];switch(e.type){case"type":return Zr(n);default:return Jr(n)}}function zm(e){const t=e instanceof fe,r=t?{...e.schema}:{...e};for(const n in r)r[n]=ed(r[n]);return t&&e.type==="type"?Zr(r):Jr(r)}function Gm(e,t){const{schema:r}=e,n={};for(const i of t)n[i]=r[i];switch(e.type){case"type":return Zr(n);default:return Jr(n)}}function Jm(e,t){return console.warn("[email protected] - The `struct` helper has been renamed to `define`."),Ie(e,t)}function Zm(){return Ie("any",()=>!0)}function Km(e){return new fe({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${ge(t)}`}})}function Qm(){return Ie("bigint",e=>typeof e=="bigint")}function Ym(){return Ie("boolean",e=>typeof e=="boolean")}function Xm(){return Ie("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${ge(e)}`)}function e_(e){const t={},r=e.map(n=>ge(n)).join();for(const n of e)t[n]=n;return new fe({type:"enums",schema:t,validator(n){return e.includes(n)||`Expected one of \`${r}\`, but received: ${ge(n)}`}})}function t_(){return Ie("func",e=>typeof e=="function"||`Expected a function, but received: ${ge(e)}`)}function r_(e){return Ie("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${ge(t)}`)}function n_(){return Ie("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${ge(e)}`)}function i_(e){return new fe({type:"intersection",schema:null,*entries(t,r){for(const n of e)yield*n.entries(t,r)},*validator(t,r){for(const n of e)yield*n.validator(t,r)},*refiner(t,r){for(const n of e)yield*n.refiner(t,r)}})}function s_(e){const t=ge(e),r=typeof e;return new fe({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(n){return n===e||`Expected the literal \`${t}\`, but received: ${ge(n)}`}})}function o_(e,t){return new fe({type:"map",schema:null,*entries(r){if(e&&t&&r instanceof Map)for(const[n,i]of r.entries())yield[n,n,e],yield[n,i,t]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${ge(r)}`}})}function sa(){return Ie("never",()=>!1)}function a_(e){return new fe({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function c_(){return Ie("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${ge(e)}`)}function Jr(e){const t=e?Object.keys(e):[],r=sa();return new fe({type:"object",schema:e||null,*entries(n){if(e&&$e(n)){const i=new Set(Object.keys(n));for(const s of t)i.delete(s),yield[s,n[s],e[s]];for(const s of i)yield[s,n[s],r]}},validator(n){return $e(n)||`Expected an object, but received: ${ge(n)}`},coercer(n){return $e(n)?{...n}:n}})}function ed(e){return new fe({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function l_(e,t){return new fe({type:"record",schema:null,*entries(r){if($e(r))for(const n in r){const i=r[n];yield[n,n,e],yield[n,i,t]}},validator(r){return $e(r)||`Expected an object, but received: ${ge(r)}`}})}
2function u_(){return Ie("regexp",e=>e instanceof RegExp)}function d_(e){return new fe({type:"set",schema:null,*entries(t){if(e&&t instanceof Set)for(const r of t)yield[r,r,e]},coercer(t){return t instanceof Set?new Set(t):t},validator(t){return t instanceof Set||`Expected a \`Set\` object, but received: ${ge(t)}`}})}function td(){return Ie("string",e=>typeof e=="string"||`Expected a string, but received: ${ge(e)}`)}function f_(e){const t=sa();return new fe({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],e[i]||t]}},validator(r){return Array.isArray(r)||`Expected an array, but received: ${ge(r)}`}})}function Zr(e){const t=Object.keys(e);return new fe({type:"type",schema:e,*entries(r){if($e(r))for(const n of t)yield[n,r[n],e[n]]},validator(r){return $e(r)||`Expected an object, but received: ${ge(r)}`},coercer(r){return $e(r)?{...r}:r}})}function h_(e){const t=e.map(r=>r.type).join(" | ");return new fe({type:"union",schema:null,coercer(r){for(const n of e){const[i,s]=n.validate(r,{coerce:!0});if(!i)return s}return r},validator(r,n){const i=[];for(const s of e){const[...o]=na(r,s,n),[a]=o;if(a[0])for(const[c]of o)c&&i.push(c);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${ge(r)}`,...i]}})}function rd(){return Ie("unknown",()=>!0)}function oa(e,t,r){return new fe({...e,coercer:(n,i)=>ia(n,t)?e.coercer(r(n,i),i):e.coercer(n,i)})}function p_(e,t,r={}){return oa(e,rd(),n=>{const i=typeof t=="function"?t():t;if(n===void 0)return i;if(!r.strict&&el(n)&&el(i)){const s={...n};let o=!1;for(const a in i)s[a]===void 0&&(s[a]=i[a],o=!0);if(o)return s}return n})}function g_(e){return oa(e,td(),t=>t.trim())}function y_(e){return Tt(e,"empty",t=>{const r=nd(t);return r===0||`Expected an empty ${e.type} but received one with a size of \`${r}\``})}function nd(e){return e instanceof Map||e instanceof Set?e.size:e.length}function b_(e,t,r={}){const{exclusive:n}=r;return Tt(e,"max",i=>n?i<t:i<=t||`Expected a ${e.type} less than ${n?"":"or equal to "}${t} but received \`${i}\``)}function m_(e,t,r={}){const{exclusive:n}=r;return Tt(e,"min",i=>n?i>t:i>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${i}\``)}function __(e){return Tt(e,"nonempty",t=>nd(t)>0||`Expected a nonempty ${e.type} but received an empty one`)}function v_(e,t){return Tt(e,"pattern",r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`)}function w_(e,t,r=t){const n=`Expected a ${e.type}`,i=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return Tt(e,"size",s=>{if(typeof s=="number"||s instanceof Date)return t<=s&&s<=r||`${n} ${i} but received \`${s}\``;if(s instanceof Map||s instanceof Set){const{size:o}=s;return t<=o&&o<=r||`${n} with a size ${i} but received one with a size of \`${o}\``}else{const{length:o}=s;return t<=o&&o<=r||`${n} with a length ${i} but received one with a length of \`${o}\``}})}function Tt(e,t,r){return new fe({...e,*refiner(n,i){yield*e.refiner(n,i);const s=r(n,i),o=Ao(s,i,e,n);for(const a of o)yield{...a,refinement:t}}})}const E_=Object.freeze(Object.defineProperty({__proto__:null,Struct:fe,StructError:Ku,any:Zm,array:Km,assert:Qu,assign:Um,bigint:Qm,boolean:Ym,coerce:oa,create:Yu,date:Xm,defaulted:p_,define:Ie,deprecated:Hm,dynamic:Wm,empty:y_,enums:e_,func:t_,instance:r_,integer:n_,intersection:i_,is:ia,lazy:Vm,literal:s_,map:o_,mask:Xu,max:b_,min:m_,never:sa,nonempty:__,nullable:a_,number:c_,object:Jr,omit:qm,optional:ed,partial:zm,pattern:v_,pick:Gm,record:l_,refine:Tt,regexp:u_,set:d_,size:w_,string:td,struct:Jm,trimmed:g_,tuple:f_,type:Zr,union:h_,unknown:rd,validate:fr},Symbol.toStringTag,{value:"Module"})),Pt=ir(E_);Object.defineProperty(we,"__esModule",{value:!0});we.assertExhaustive=we.assertStruct=we.assert=we.AssertionError=void 0;const S_=Pt;function R_(e){return typeof e=="object"&&e!==null&&"message"in e}function C_(e){var t,r;return typeof((r=(t=e==null?void 0:e.prototype)===null||t===void 0?void 0:t.constructor)===null||r===void 0?void 0:r.name)=="string"}function k_(e){const t=R_(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}function id(e,t){return C_(e)?new e({message:t}):e({message:t})}
2class aa extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}we.AssertionError=aa;function I_(e,t="Assertion failed.",r=aa){if(!e)throw t instanceof Error?t:id(r,t)}we.assert=I_;function A_(e,t,r="Assertion failed",n=aa){try{(0,S_.assert)(e,t)}catch(i){throw id(n,`${r}: ${k_(i)}.`)}}we.assertStruct=A_;function T_(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}we.assertExhaustive=T_;var Kr={};Object.defineProperty(Kr,"__esModule",{value:!0});Kr.base64=void 0;const P_=Pt,x_=we,O_=(e,t={})=>{var r,n;const i=(r=t.paddingRequired)!==null&&r!==void 0?r:!1,s=(n=t.characterSet)!==null&&n!==void 0?n:"base64";let o;s==="base64"?o=String.raw`[A-Za-z0-9+\/]`:((0,x_.assert)(s==="base64url"),o=String.raw`[-_A-Za-z0-9]`);let a;return i?a=new RegExp(`^(?:${o}{4})*(?:${o}{3}=|${o}{2}==)?$`,"u"):a=new RegExp(`^(?:${o}{4})*(?:${o}{2,3}|${o}{3}=|${o}{2}==)?$`,"u"),(0,P_.pattern)(e,a)};Kr.base64=O_;var te={},Qr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.remove0x=e.add0x=e.assertIsStrictHexString=e.assertIsHexString=e.isStrictHexString=e.isHexString=e.StrictHexStruct=e.HexStruct=void 0;const t=Pt,r=we;e.HexStruct=(0,t.pattern)((0,t.string)(),/^(?:0x)?[0-9a-f]+$/iu),e.StrictHexStruct=(0,t.pattern)((0,t.string)(),/^0x[0-9a-f]+$/iu);function n(l){return(0,t.is)(l,e.HexStruct)}e.isHexString=n;function i(l){return(0,t.is)(l,e.StrictHexStruct)}e.isStrictHexString=i;function s(l){(0,r.assert)(n(l),"Value must be a hexadecimal string.")}e.assertIsHexString=s;function o(l){(0,r.assert)(i(l),'Value must be a hexadecimal string, starting with "0x".')}e.assertIsStrictHexString=o;function a(l){return l.startsWith("0x")?l:l.startsWith("0X")?`0x${l.substring(2)}`:`0x${l}`}e.add0x=a;function c(l){return l.startsWith("0x")||l.startsWith("0X")?l.substring(2):l}e.remove0x=c})(Qr);Object.defineProperty(te,"__esModule",{value:!0});te.createDataView=te.concatBytes=te.valueToBytes=te.stringToBytes=te.numberToBytes=te.signedBigIntToBytes=te.bigIntToBytes=te.hexToBytes=te.bytesToString=te.bytesToNumber=te.bytesToSignedBigInt=te.bytesToBigInt=te.bytesToHex=te.assertIsBytes=te.isBytes=void 0;const Pe=we,To=Qr,tl=48,rl=58,nl=87;function M_(){const e=[];return()=>{if(e.length===0)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}const N_=M_();function ca(e){return e instanceof Uint8Array}te.isBytes=ca;function hr(e){(0,Pe.assert)(ca(e),"Value must be a Uint8Array.")}te.assertIsBytes=hr;function sd(e){if(hr(e),e.length===0)return"0x";const t=N_(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return(0,To.add0x)(r.join(""))}te.bytesToHex=sd;function od(e){hr(e);const t=sd(e);return BigInt(t)}te.bytesToBigInt=od;function L_(e){hr(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(e.length*8,t)}te.bytesToSignedBigInt=L_;function $_(e){hr(e);const t=od(e);return(0,Pe.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)}te.bytesToNumber=$_;function B_(e){return hr(e),new TextDecoder().decode(e)}te.bytesToString=B_;function gi(e){var t;if(((t=e==null?void 0:e.toLowerCase)===null||t===void 0?void 0:t.call(e))==="0x")return new Uint8Array;(0,To.assertIsHexString)(e);const r=(0,To.remove0x)(e).toLowerCase(),n=r.length%2===0?r:`0${r}`,i=new Uint8Array(n.length/2);for(let s=0;s<i.length;s++){const o=n.charCodeAt(s*2),a=n.charCodeAt(s*2+1),c=o-(o<rl?tl:nl),l=a-(a<rl?tl:nl);i[s]=c*16+l}return i}te.hexToBytes=gi;function ad(e){(0,Pe.assert)(typeof e=="bigint","Value must be a bigint."),(0,Pe.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");const t=e.toString(16);return gi(t)}te.bigIntToBytes=ad;function F_(e,t){(0,Pe.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(t*8+-1))}function j_(e,t){(0,Pe.assert)(typeof e=="bigint","Value must be a bigint."),(0,Pe.assert)(typeof t=="number","Byte length must be a number."),(0,Pe.assert)(t>0,"Byte length must be greater than 0."),(0,Pe.assert)(F_(e,t),"Byte length is too small to represent the given value.");let r=e;const n=new Uint8Array(t);for(let i=0;i<n.length;i++)n[i]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return n.reverse()}te.signedBigIntToBytes=j_;function cd(e){(0,Pe.assert)(typeof e=="number","Value must be a number."),(0,Pe.assert)(e>=0,"Value must be a non-negative number."),(0,Pe.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");const t=e.toString(16);return gi(t)}te.numberToBytes=cd;function ld(e){return(0,Pe.assert)(typeof e=="string","Value must be a string."),new TextEncoder().encode(e)}te.stringToBytes=ld;function ud(e){if(typeof e=="bigint")return ad(e);if(typeof e=="number")return cd(e);if(typeof e=="string")return e.startsWith("0x")?gi(e):ld(e);if(ca(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}te.valueToBytes=ud;function D_(e){const t=new Array(e.length);let r=0;for(let i=0;i<e.length;i++){const s=ud(e[i]);t[i]=s,r+=s.length}const n=new Uint8Array(r);for(let i=0,s=0;i<t.length;i++)n.set(t[i],s),s+=t[i].length;return n}te.concatBytes=D_;function U_(e){if(typeof Buffer<"u"&&e instanceof Buffer){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}te.createDataView=U_;var yi={};Object.defineProperty(yi,"__esModule",{value:!0});yi.ChecksumStruct=void 0;const il=Pt,H_=Kr;yi.ChecksumStruct=(0,il.size)((0,H_.base64)((0,il.string)(),{paddingRequired:!0}),44,44);var Ye={};
2Object.defineProperty(Ye,"__esModule",{value:!0});Ye.createHex=Ye.createBytes=Ye.createBigInt=Ye.createNumber=void 0;const ue=Pt,W_=we,dd=te,bi=Qr,fd=(0,ue.union)([(0,ue.number)(),(0,ue.bigint)(),(0,ue.string)(),bi.StrictHexStruct]),V_=(0,ue.coerce)((0,ue.number)(),fd,Number),q_=(0,ue.coerce)((0,ue.bigint)(),fd,BigInt);(0,ue.union)([bi.StrictHexStruct,(0,ue.instance)(Uint8Array)]);const z_=(0,ue.coerce)((0,ue.instance)(Uint8Array),(0,ue.union)([bi.StrictHexStruct]),dd.hexToBytes),G_=(0,ue.coerce)(bi.StrictHexStruct,(0,ue.instance)(Uint8Array),dd.bytesToHex);function J_(e){try{const t=(0,ue.create)(e,V_);return(0,W_.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){throw t instanceof ue.StructError?new Error(`Expected a number-like value, got "${e}".`):t}}Ye.createNumber=J_;function Z_(e){try{return(0,ue.create)(e,q_)}catch(t){throw t instanceof ue.StructError?new Error(`Expected a number-like value, got "${String(t.value)}".`):t}}Ye.createBigInt=Z_;function K_(e){if(typeof e=="string"&&e.toLowerCase()==="0x")return new Uint8Array;try{return(0,ue.create)(e,z_)}catch(t){throw t instanceof ue.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}Ye.createBytes=K_;function Q_(e){if(e instanceof Uint8Array&&e.length===0||typeof e=="string"&&e.toLowerCase()==="0x")return"0x";try{return(0,ue.create)(e,G_)}catch(t){throw t instanceof ue.StructError?new Error(`Expected a bytes-like value, got "${String(t.value)}".`):t}}Ye.createHex=Q_;var tr={},hd=B&&B.__classPrivateFieldSet||function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},Re=B&&B.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},Fe,ze;Object.defineProperty(tr,"__esModule",{value:!0});tr.FrozenSet=tr.FrozenMap=void 0;class la{constructor(t){Fe.set(this,void 0),hd(this,Fe,new Map(t),"f"),Object.freeze(this)}get size(){return Re(this,Fe,"f").size}[(Fe=new WeakMap,Symbol.iterator)](){return Re(this,Fe,"f")[Symbol.iterator]()}entries(){return Re(this,Fe,"f").entries()}forEach(t,r){return Re(this,Fe,"f").forEach((n,i,s)=>t.call(r,n,i,this))}get(t){return Re(this,Fe,"f").get(t)}has(t){return Re(this,Fe,"f").has(t)}keys(){return Re(this,Fe,"f").keys()}values(){return Re(this,Fe,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([t,r])=>`${String(t)} => ${String(r)}`).join(", ")} `:""}}`}}tr.FrozenMap=la;class ua{constructor(t){ze.set(this,void 0),hd(this,ze,new Set(t),"f"),Object.freeze(this)}get size(){return Re(this,ze,"f").size}[(ze=new WeakMap,Symbol.iterator)](){return Re(this,ze,"f")[Symbol.iterator]()}entries(){return Re(this,ze,"f").entries()}forEach(t,r){return Re(this,ze,"f").forEach((n,i,s)=>t.call(r,n,i,this))}has(t){return Re(this,ze,"f").has(t)}keys(){return Re(this,ze,"f").keys()}values(){return Re(this,ze,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(t=>String(t)).join(", ")} `:""}}`}}tr.FrozenSet=ua;Object.freeze(la);Object.freeze(la.prototype);Object.freeze(ua);Object.freeze(ua.prototype);var pd={};Object.defineProperty(pd,"__esModule",{value:!0});var gd={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsonRpcIdValidator=e.assertIsJsonRpcError=e.isJsonRpcError=e.assertIsJsonRpcFailure=e.isJsonRpcFailure=e.assertIsJsonRpcSuccess=e.isJsonRpcSuccess=e.assertIsJsonRpcResponse=e.isJsonRpcResponse=e.assertIsPendingJsonRpcResponse=e.isPendingJsonRpcResponse=e.JsonRpcResponseStruct=e.JsonRpcFailureStruct=e.JsonRpcSuccessStruct=e.PendingJsonRpcResponseStruct=e.assertIsJsonRpcRequest=e.isJ
2sonRpcRequest=e.assertIsJsonRpcNotification=e.isJsonRpcNotification=e.JsonRpcNotificationStruct=e.JsonRpcRequestStruct=e.JsonRpcParamsStruct=e.JsonRpcErrorStruct=e.JsonRpcIdStruct=e.JsonRpcVersionStruct=e.jsonrpc2=e.getJsonSize=e.isValidJson=e.JsonStruct=e.UnsafeJsonStruct=void 0;const t=Pt,r=we,n=()=>(0,t.define)("finite number",C=>(0,t.is)(C,(0,t.number)())&&Number.isFinite(C));e.UnsafeJsonStruct=(0,t.union)([(0,t.literal)(null),(0,t.boolean)(),n(),(0,t.string)(),(0,t.array)((0,t.lazy)(()=>e.UnsafeJsonStruct)),(0,t.record)((0,t.string)(),(0,t.lazy)(()=>e.UnsafeJsonStruct))]),e.JsonStruct=(0,t.define)("Json",(C,T)=>{function H(F,L){const ae=[...L.validator(F,T)];return ae.length>0?ae:!0}try{const F=H(C,e.UnsafeJsonStruct);return F!==!0?F:H(JSON.parse(JSON.stringify(C)),e.UnsafeJsonStruct)}catch(F){return F instanceof RangeError?"Circular reference detected":!1}});function i(C){return(0,t.is)(C,e.JsonStruct)}e.isValidJson=i;function s(C){(0,r.assertStruct)(C,e.JsonStruct,"Invalid JSON value");const T=JSON.stringify(C);return new TextEncoder().encode(T).byteLength}e.getJsonSize=s,e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,t.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,t.nullable)((0,t.union)([(0,t.number)(),(0,t.string)()])),e.JsonRpcErrorStruct=(0,t.object)({code:(0,t.integer)(),message:(0,t.string)(),data:(0,t.optional)(e.JsonStruct),stack:(0,t.optional)((0,t.string)())}),e.JsonRpcParamsStruct=(0,t.optional)((0,t.union)([(0,t.record)((0,t.string)(),e.JsonStruct),(0,t.array)(e.JsonStruct)])),e.JsonRpcRequestStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,t.string)(),params:e.JsonRpcParamsStruct}),e.JsonRpcNotificationStruct=(0,t.omit)(e.JsonRpcRequestStruct,["id"]);function o(C){return(0,t.is)(C,e.JsonRpcNotificationStruct)}e.isJsonRpcNotification=o;function a(C,T){(0,r.assertStruct)(C,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",T)}e.assertIsJsonRpcNotification=a;function c(C){return(0,t.is)(C,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=c;function l(C,T){(0,r.assertStruct)(C,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",T)}e.assertIsJsonRpcRequest=l,e.PendingJsonRpcResponseStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:(0,t.optional)((0,t.unknown)()),error:(0,t.optional)(e.JsonRpcErrorStruct)}),e.JsonRpcSuccessStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:e.JsonStruct}),e.JsonRpcFailureStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,error:e.JsonRpcErrorStruct}),e.JsonRpcResponseStruct=(0,t.union)([e.JsonRpcSuccessStruct,e.JsonRpcFailureStruct]);function u(C){return(0,t.is)(C,e.PendingJsonRpcResponseStruct)}e.isPendingJsonRpcResponse=u;function d(C,T){(0,r.assertStruct)(C,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",T)}e.assertIsPendingJsonRpcResponse=d;function f(C){return(0,t.is)(C,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=f;function y(C,T){(0,r.assertStruct)(C,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",T)}e.assertIsJsonRpcResponse=y;function S(C){return(0,t.is)(C,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=S;function _(C,T){(0,r.assertStruct)(C,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",T)}e.assertIsJsonRpcSuccess=_;function w(C){return(0,t.is)(C,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=w;function p(C,T){(0,r.assertStruct)(C,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",T)}e.assertIsJsonRpcFailure=p;function m(C){return(0,t.is)(C,e.JsonRpcErrorStruct)}e.isJsonRpcError=m;function b(C,T){(0,r.assertStruct)(C,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",T)}e.assertIsJsonRpcError=b;function R(C){const{permitEmptyString:T,permitFractions:H,permitNull:F}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},C);return Y=>!!(typeof Y=="number"&&(H||Number.isInteger(Y))||typeof Y=="string"&&(T||Y.length>0)||F&&Y===null)}e.getJsonRpcIdValidator=R})(gd);var yd={};Object.defineProperty(yd,"__esModule",{value:!0});var rr={},Po={exports:{}};function Y_(e){r.debug=r,r.default=r,r.coerce=c,r.disable=o,r.enable=i,r.enabled=a,r.humanize=df(),r.destroy=l,Object.keys(e).forEach(u=>{r[u]=e[u]}),r.names=[],r.skips=[],r.formatters={};function t(u){let d=0;for(let f=0;f<u.length;f++)d=(d<<5)-d+u.charCodeAt(f),d|=0;return r.colors[Math.abs(d)%r.colors.length]}r.selectColor=t;function r(u){let d,f=null,y,S;function _(...w){if(!_.enabled)return;const p=_,m=Number(new Date),b=m-(d||m);p.diff=b,p.prev=d,p.curr=m,d=m,w[0]=r.coerce(w[0]),typeof w[0]!="str
2ing"&&w.unshift("%O");let R=0;w[0]=w[0].replace(/%([a-zA-Z%])/g,(T,H)=>{if(T==="%%")return"%";R++;const F=r.formatters[H];if(typeof F=="function"){const L=w[R];T=F.call(p,L),w.splice(R,1),R--}return T}),r.formatArgs.call(p,w),(p.log||r.log).apply(p,w)}return _.namespace=u,_.useColors=r.useColors(),_.color=r.selectColor(u),_.extend=n,_.destroy=r.destroy,Object.defineProperty(_,"enabled",{enumerable:!0,configurable:!1,get:()=>f!==null?f:(y!==r.namespaces&&(y=r.namespaces,S=r.enabled(u)),S),set:w=>{f=w}}),typeof r.init=="function"&&r.init(_),_}function n(u,d){const f=r(this.namespace+(typeof d>"u"?":":d)+u);return f.log=this.log,f}function i(u){r.save(u),r.namespaces=u,r.names=[],r.skips=[];const d=(typeof u=="string"?u:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const f of d)f[0]==="-"?r.skips.push(f.slice(1)):r.names.push(f)}function s(u,d){let f=0,y=0,S=-1,_=0;for(;f<u.length;)if(y<d.length&&(d[y]===u[f]||d[y]==="*"))d[y]==="*"?(S=y,_=f,y++):(f++,y++);else if(S!==-1)y=S+1,_++,f=_;else return!1;for(;y<d.length&&d[y]==="*";)y++;return y===d.length}function o(){const u=[...r.names,...r.skips.map(d=>"-"+d)].join(",");return r.enable(""),u}function a(u){for(const d of r.skips)if(s(u,d))return!1;for(const d of r.names)if(s(u,d))return!0;return!1}function c(u){return u instanceof Error?u.stack||u.message:u}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}var X_=Y_;(function(e,t){var r={};t.formatArgs=i,t.save=s,t.load=o,t.useColors=n,t.storage=a(),t.destroy=(()=>{let l=!1;return()=>{l||(l=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){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 l;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&&(l=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(l[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function i(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const u="color: "+this.color;l.splice(1,0,u,"color: inherit");let d=0,f=0;l[0].replace(/%[a-zA-Z%]/g,y=>{y!=="%%"&&(d++,y==="%c"&&(f=d))}),l.splice(f,0,u)}t.log=console.debug||console.log||(()=>{});function s(l){try{l?t.storage.setItem("debug",l):t.storage.removeItem("debug")}catch{}}function o(){let l;try{l=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch{}return!l&&typeof process<"u"&&"env"in process&&(l=r.DEBUG),l}function a(){try{return localStorage}catch{}}e.exports=X_(t);const{formatters:c}=e.exports;c.j=function(l){try{return JSON.stringify(l)}catch(u){return"[UnexpectedJSONParseError]: "+u.message}}}
2)(Po,Po.exports);var ev=Po.exports,tv=B&&B.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(rr,"__esModule",{value:!0});rr.createModuleLogger=rr.createProjectLogger=void 0;const rv=tv(ev),nv=(0,rv.default)("metamask");function iv(e){return nv.extend(e)}rr.createProjectLogger=iv;function sv(e,t){return e.extend(t)}rr.createModuleLogger=sv;var bd={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.calculateNumberSize=e.calculateStringSize=e.isASCII=e.isPlainObject=e.ESCAPE_CHARACTERS_REGEXP=e.JsonSize=e.hasProperty=e.isObject=e.isNullOrUndefined=e.isNonEmptyArray=void 0;function t(l){return Array.isArray(l)&&l.length>0}e.isNonEmptyArray=t;function r(l){return l==null}e.isNullOrUndefined=r;function n(l){return!!l&&typeof l=="object"&&!Array.isArray(l)}e.isObject=n;const i=(l,u)=>Object.hasOwnProperty.call(l,u);e.hasProperty=i,function(l){l[l.Null=4]="Null",l[l.Comma=1]="Comma",l[l.Wrapper=1]="Wrapper",l[l.True=4]="True",l[l.False=5]="False",l[l.Quote=1]="Quote",l[l.Colon=1]="Colon",l[l.Date=24]="Date"}(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function s(l){if(typeof l!="object"||l===null)return!1;try{let u=l;for(;Object.getPrototypeOf(u)!==null;)u=Object.getPrototypeOf(u);return Object.getPrototypeOf(l)===u}catch{return!1}}e.isPlainObject=s;function o(l){return l.charCodeAt(0)<=127}e.isASCII=o;function a(l){var u;return l.split("").reduce((f,y)=>o(y)?f+1:f+2,0)+((u=l.match(e.ESCAPE_CHARACTERS_REGEXP))!==null&&u!==void 0?u:[]).length}e.calculateStringSize=a;function c(l){return l.toString().length}e.calculateNumberSize=c})(bd);var Xe={};Object.defineProperty(Xe,"__esModule",{value:!0});Xe.hexToBigInt=Xe.hexToNumber=Xe.bigIntToHex=Xe.numberToHex=void 0;const Jt=we,Cr=Qr,ov=e=>((0,Jt.assert)(typeof e=="number","Value must be a number."),(0,Jt.assert)(e>=0,"Value must be a non-negative number."),(0,Jt.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Cr.add0x)(e.toString(16)));Xe.numberToHex=ov;const av=e=>((0,Jt.assert)(typeof e=="bigint","Value must be a bigint."),(0,Jt.assert)(e>=0,"Value must be a non-negative bigint."),(0,Cr.add0x)(e.toString(16)));Xe.bigIntToHex=av;const cv=e=>{(0,Cr.assertIsHexString)(e);const t=parseInt(e,16);return(0,Jt.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};Xe.hexToNumber=cv;const lv=e=>((0,Cr.assertIsHexString)(e),BigInt((0,Cr.add0x)(e)));Xe.hexToBigInt=lv;var md={};Object.defineProperty(md,"__esModule",{value:!0});var _d={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.Duration=void 0,function(s){s[s.Millisecond=1]="Millisecond",s[s.Second=1e3]="Second",s[s.Minute=6e4]="Minute",s[s.Hour=36e5]="Hour",s[s.Day=864e5]="Day",s[s.Week=6048e5]="Week",s[s.Year=31536e6]="Year"}(e.Duration||(e.Duration={}));const t=s=>Number.isInteger(s)&&s>=0,r=(s,o)=>
2{if(!t(s))throw new Error(`"${o}" must be a non-negative integer. Received: "${s}".`)};function n(s,o){return r(s,"count"),s*o}e.inMilliseconds=n;function i(s){return r(s,"timestamp"),Date.now()-s}e.timeSince=i})(_d);var vd={};Object.defineProperty(vd,"__esModule",{value:!0});var wd={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.satisfiesVersionRange=e.gtRange=e.gtVersion=e.assertIsSemVerRange=e.assertIsSemVerVersion=e.isValidSemVerRange=e.isValidSemVerVersion=e.VersionRangeStruct=e.VersionStruct=void 0;const t=np,r=Pt,n=we;e.VersionStruct=(0,r.refine)((0,r.string)(),"Version",d=>(0,t.valid)(d)===null?`Expected SemVer version, got "${d}"`:!0),e.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",d=>(0,t.validRange)(d)===null?`Expected SemVer range, got "${d}"`:!0);function i(d){return(0,r.is)(d,e.VersionStruct)}e.isValidSemVerVersion=i;function s(d){return(0,r.is)(d,e.VersionRangeStruct)}e.isValidSemVerRange=s;function o(d){(0,n.assertStruct)(d,e.VersionStruct)}e.assertIsSemVerVersion=o;function a(d){(0,n.assertStruct)(d,e.VersionRangeStruct)}e.assertIsSemVerRange=a;function c(d,f){return(0,t.gt)(d,f)}e.gtVersion=c;function l(d,f){return(0,t.gtr)(d,f)}e.gtRange=l;function u(d,f){return(0,t.satisfies)(d,f,{includePrerelease:!0})}e.satisfiesVersionRange=u})(wd);(function(e){var t=B&&B.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,o,a)}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=B&&B.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(we,e),r(Kr,e),r(te,e),r(yi,e),r(Ye,e),r(tr,e),r(pd,e),r(Qr,e),r(gd,e),r(yd,e),r(rr,e),r(bd,e),r(Xe,e),r(md,e),r(_d,e),r(vd,e),r(wd,e)})(Zu);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createModuleLogger=e.projectLogger=void 0;const t=Zu;Object.defineProperty(e,"createModuleLogger",{enumerable:!0,get:function(){return t.createModuleLogger}}),e.projectLogger=(0,t.createProjectLogger)("eth-block-tracker")})(Ju);var Ed=B&&B.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(pi,"__esModule",{value:!0});pi.PollingBlockTracker=void 0;const uv=Ed(ra),dv=Ed(Tm),fv=zr,sl=Ju,ol=(0,sl.createModuleLogger)(sl.projectLogger,"polling-block-tracker"),hv=(0,uv.default)(),pv=1e3;class gv extends fv.BaseBlockTracker{constructor(t={}){var r;if(!t.provider)throw new Error("PollingBlockTracker - no provider specified.");super(Object.assign(Object.assign({},t),{blockResetDuration:(r=t.blockResetDuration)!==null&&r!==void 0?r:t.pollingInterval})),this._provider=t.provider,this._pollingInterval=t.pollingInterval||20*pv,this._retryTimeout=t.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=t.keepEventLoopActive===void 0?!0:t.keepEventLoopActive,this._setSkipCacheFlag=t.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var t;this._isRunning;)try{await this._updateLatestBlock();const r=al(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await r}catch(r){const n=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:
3${(t=r.stack)!==null&&t!==void 0?t:r}`);try{this.emit("error",n)}catch{console.error(n)}const i=al(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await i}}async _updateLatestBlock(){const t=await this._fetchLatestBlock();this._newPotentialLatest(t)}async _fetchLatestBlock(){const t={jsonrpc:"2.0",id:hv(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(t.skipCache=!0),ol("Making request",t);const r=await(0,dv.default)(n=>this._provider.sendAsync(t,n))();if(ol("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
4${r.error.message}`);return r.result}}pi.PollingBlockTracker=gv;function al(e,t){return new Promise(r=>{const n=setTimeout(r,e);n.unref&&t&&n.unref()})}var mi={}
4,yv=B&&B.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(mi,"__esModule",{value:!0});mi.SubscribeBlockTracker=void 0;const bv=yv(ra),mv=zr,_v=(0,bv.default)();class vv extends mv.BaseBlockTracker{constructor(t={}){if(!t.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(t),this._provider=t.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const t=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(t)}catch(t){this.emit("error",t)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(t){this.emit("error",t)}}_call(t,...r){return new Promise((n,i)=>{this._provider.sendAsync({id:_v(),method:t,params:r,jsonrpc:"2.0"},(s,o)=>{s?i(s):n(o.result)})})}_handleSubData(t,r){var n;r.method==="eth_subscription"&&((n=r.params)===null||n===void 0?void 0:n.subscription)===this._subscriptionId&&this._newPotentialLatest(r.params.result.number)}}mi.SubscribeBlockTracker=vv;(function(e){var t=B&&B.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s),Object.defineProperty(n,o,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=B&&B.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(pi,e),r(mi,e)})(Gu);var da={},_i={},Yr={};Object.defineProperty(Yr,"__esModule",{value:!0});Yr.getUniqueId=void 0;const Sd=4294967295;let bo=Math.floor(Math.random()*Sd);function wv(){return bo=(bo+1)%Sd,bo}Yr.getUniqueId=wv;Object.defineProperty(_i,"__esModule",{value:!0});_i.createIdRemapMiddleware=void 0;const Ev=Yr;function Sv(){return(e,t,r,n)=>{const i=e.id,s=Ev.getUniqueId();e.id=s,t.id=s,r(o=>{e.id=i,t.id=i,o()})}}_i.createIdRemapMiddleware=Sv;var vi={};Object.defineProperty(vi,"__esModule",{value:!0});vi.createAsyncMiddleware=void 0;function Rv(e){return async(t,r,n,i)=>{let s;const o=new Promise(u=>{s=u});let a=null,c=!1;const l=async()=>{c=!0,n(u=>{a=u,s()}),await o};try{await e(t,r,l),c?(await o,a(null)):i(null)}catch(u){a?a(u):i(u)}}}vi.createAsyncMiddleware=Rv;var wi={};Object.defineProperty(wi,"__esModule",{value:!0});wi.createScaffoldMiddleware=void 0;function Cv(e){return(t,r,n,i)=>{const s=e[t.method];return s===void 0?n():typeof s=="function"?s(t,r,n,i):(r.result=s,i())}}wi.createScaffoldMiddleware=Cv;var Xr={},fa={};Object.defineProperty(fa,"__esModule",{value:!0});const kv=xn;function cl(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function Iv(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}let Av=class extends kv.EventEmitter{emit(t,...r){let n=t==="error";const i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){let o;if(r.length>0&&([o]=r),o instanceof Error)throw o;const a=new Error(`Unhandled error.${o?` (${o.message})`:""}`);throw a.context=o,a}const s=i[t];if(s===void 0)return!1;if(typeof s=="function")cl(s,this,r);else{const o=s.length,a=Iv(s);for(let c=0;c<o;c+=1)cl(a[c],this,r)}return!0}};fa.default=Av;var Rd={},ft={};Object.defineProperty(ft,"__esModule",{value:!0});ft.EthereumProviderError=ft.EthereumRpcError=void 0;const Tv=ip;class Cd extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}serialize(){const t={code:this.code,message:this.message};return this.data!==void 0&&(t.data=this.data),this.stack&&(t.stack=this.stack),t}toString(){return Tv.default(this.serialize(),Ov,2)}}ft.EthereumRpcError=Cd;class Pv extends Cd{constructor(t,r,n){if(!xv(t))throw new Error('"code" must be an integer such that: 1000 <= code 
4<= 4999');super(t,r,n)}}ft.EthereumProviderError=Pv;function xv(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}function Ov(e,t){if(t!=="[Circular]")return t}var ha={},ht={};Object.defineProperty(ht,"__esModule",{value:!0});ht.errorValues=ht.errorCodes=void 0;ht.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}};ht.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=ht,r=ft,n=t.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:n,message:o(n)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function o(f,y=i){if(Number.isInteger(f)){const S=f.toString();if(d(t.errorValues,S))return t.errorValues[S].message;if(l(f))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return y}e.getMessageFromCode=o;function a(f){if(!Number.isInteger(f))return!1;const y=f.toString();return!!(t.errorValues[y]||l(f))}e.isValidCode=a;function c(f,{fallbackError:y=s,shouldIncludeStack:S=!1}={}){var _,w;if(!y||!Number.isInteger(y.code)||typeof y.message!="string")throw new Error("Mu
4st provide fallback error with integer number code and string message.");if(f instanceof r.EthereumRpcError)return f.serialize();const p={};if(f&&typeof f=="object"&&!Array.isArray(f)&&d(f,"code")&&a(f.code)){const b=f;p.code=b.code,b.message&&typeof b.message=="string"?(p.message=b.message,d(b,"data")&&(p.data=b.data)):(p.message=o(p.code),p.data={originalError:u(f)})}else{p.code=y.code;const b=(_=f)===null||_===void 0?void 0:_.message;p.message=b&&typeof b=="string"?b:y.message,p.data={originalError:u(f)}}const m=(w=f)===null||w===void 0?void 0:w.stack;return S&&f&&m&&typeof m=="string"&&(p.stack=m),p}e.serializeError=c;function l(f){return f>=-32099&&f<=-32e3}function u(f){return f&&typeof f=="object"&&!Array.isArray(f)?Object.assign({},f):f}function d(f,y){return Object.prototype.hasOwnProperty.call(f,y)}})(ha);var Ei={};Object.defineProperty(Ei,"__esModule",{value:!0});Ei.ethErrors=void 0;const pa=ft,kd=ha,Ee=ht;Ei.ethErrors={rpc:{parse:e=>Oe(Ee.errorCodes.rpc.parse,e),invalidRequest:e=>Oe(Ee.errorCodes.rpc.invalidRequest,e),invalidParams:e=>Oe(Ee.errorCodes.rpc.invalidParams,e),methodNotFound:e=>Oe(Ee.errorCodes.rpc.methodNotFound,e),internal:e=>Oe(Ee.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code 
4<= -32005');return Oe(t,e)},invalidInput:e=>Oe(Ee.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>Oe(Ee.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>Oe(Ee.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>Oe(Ee.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>Oe(Ee.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>Oe(Ee.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>mr(Ee.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>mr(Ee.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>mr(Ee.errorCodes.provider.unsupportedMethod,e),disconnected:e=>mr(Ee.errorCodes.provider.disconnected,e),chainDisconnected:e=>mr(Ee.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new pa.EthereumProviderError(t,r,n)}}};function Oe(e,t){const[r,n]=Id(t);return new pa.EthereumRpcError(e,r||kd.getMessageFromCode(e),n)}function mr(e,t){const[r,n]=Id(t);return new pa.EthereumProviderError(e,r||kd.getMessageFromCode(e),n)}function Id(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;
4if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const t=ft;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const r=ha;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=Ei;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=ht;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(Rd);var Mv=B&&B.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Xr,"__esModule",{value:!0});Xr.JsonRpcEngine=void 0;const Nv=Mv(fa),Me=Rd;class rt extends Nv.default{constructor(){super(),this._middleware=[]}push(t){this._middleware.push(t)}handle(t,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(t)?r?this._handleBatch(t,r):this._handleBatch(t):r?this._handle(t,r):this._promiseHandle(t)}asMiddleware(){return async(t,r,n,i)=>{try{const[s,o,a]=await rt._runAllMiddleware(t,r,this._middleware);return o?(await rt._runReturnHandlers(a),i(s)):n(async c=>{try{await rt._runReturnHandlers(a)}catch(l){return c(l)}return c()})}catch(s){return i(s)}}}async _handleBatch(t,r){try{const n=await Promise.all(t.map(this._promiseHandle.bind(this)));return r?r(null,n):n}catch(n){if(r)return r(n);throw n}}_promiseHandle(t){return new Promise(r=>{this._handle(t,(n,i)=>{r(i)})})}async _handle(t,r){if(!t||Array.isArray(t)||typeof t!="object"){const o=new Me.EthereumRpcError(Me.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof t}`,{request:t});return r(o,{id:void 0,jsonrpc:"2.0",error:o})}if(typeof t.method!="string"){const o=new Me.EthereumRpcError(Me.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof t.method}`,{request:t});return r(o,{id:t.id,jsonrpc:"2.0",error:o})}const n=Object.assign({},t),i={id:n.id,jsonrpc:n.jsonrpc};let s=null;try{await this._processRequest(n,i)}catch(o){s=o}return s&&(delete i.result,i.error||(i.error=Me.serializeError(s))),r(s,i)}async _processRequest(t,r){const[n,i,s]=await rt._runAllMiddleware(t,r,this._middleware);if(rt._checkForCompletion(t,r,i),await rt._runReturnHandlers(s),n)throw n}static async _runAllMiddleware(t,r,n){const i=[];let s=null,o=!1;for(const a of n)if([s,o]=await rt._runMiddleware(t,r,a,i),o)break;return[s,o,i.reverse()]}static _runMiddleware(t,r,n,i){return new Promise(s=>{const o=c=>{const l=c||r.error;l&&(r.error=Me.serializeError(l)),s([l,!0])},a=c=>{r.error?o(r.error):(c&&(typeof c!="function"&&o(new Me.EthereumRpcError(Me.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof c}" for request:
5${mo(t)}`,{request:t})),i.push(c)),s([null,!1]))};try{n(t,r,a,o)}catch(c){o(c)}})}static async _runReturnHandlers(t){for(const r of t)await new Promise((n,i)=>{r(s=>s?i(s):n())})}static _checkForCompletion(t,r,n){if(!("result"in r)&&!("error"in r))throw new Me.EthereumRpcError(Me.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:
6${mo(t)}`,{request:t});if(!n)throw new Me.EthereumRpcError(Me.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request:
7${mo(t)}`,{request:t})}}Xr.JsonRpcEngine=rt;function mo(e){return JSON.stringify(e,null,2)}var Si={};Object.defineProperty(Si,"__esModule",{value:!0});Si.mergeMiddleware=void 0;const Lv=Xr;function $v(e){const t=new Lv.JsonRpcEngine;return e.forEach(r=>t.push(r)),t.asMiddleware()}Si.mergeMiddleware=$v;(function(e){var t=B&&B.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s),Object.defineProperty(n,o,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}
vendor: 4,517 bytes, line 7
7),r=B&&B.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(_i,e),r(vi,e),r(wi,e),r(Yr,e),r(Xr,e),r(Si,e)})(da);var Ad={},ga={},xo=function(e,t){return xo=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])},xo(e,t)};function Td(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");xo(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var In=function(){return In=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},In.apply(this,arguments)};function Pd(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function xd(e,t,r,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,r,s):o(t,r))||s);return i>3&&s&&Object.defineProperty(t,r,s),s}function Od(e,t){return function(r,n){t(r,n,e)}}function Md(e,t,r,n,i,s){function o(p){if(p!==void 0&&typeof p!="function")throw new TypeError("Function expected");return p}for(var a=n.kind,c=a==="getter"?"get":a==="setter"?"set":"value",l=!t&&e?n.static?e:e.prototype:null,u=t||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),d,f=!1,y=r.length-1;y>=0;y--){var S={};for(var _ in n)S[_]=_==="access"?{}:n[_];for(var _ in n.access)S.access[_]=n.access[_];S.addInitializer=function(p){if(f)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(p||null))};var w=(0,r[y])(a==="accessor"?{get:u.get,set:u.set}:u[c],S);if(a==="accessor"){if(w===void 0)continue;if(w===null||typeof w!="object")throw new TypeError("Object expected");(d=o(w.get))&&(u.get=d),(d=o(w.set))&&(u.set=d),(d=o(w.init))&&i.unshift(d)}else(d=o(w))&&(a==="field"?i.unshift(d):u[c]=d)}l&&Object.defineProperty(l,n.name,u),f=!0}function Nd(e,t,r){for(var n=arguments.length>2,i=0;i<t.length;i++)r=n?t[i].call(e,r):t[i].call(e);return n?r:void 0}function Ld(e){return typeof e=="symbol"?e:"".concat(e)}function $d(e,t,r){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function Bd(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function Fd(e,t,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(u){try{l(n.next(u))}catch(d){o(d)}}function c(u){try{l(n.throw(u))}catch(d){o(d)}}function l(u){u.done?s(u.value):i(u.value).then(a,c)}l((n=n.apply(e,t||[])).next())})}function jd(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(u){return c([l,u])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(r=0)),r;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=t.call(e,r)}catch(u){l=[6,u],i=0}finally{n=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}var Ri=Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);
vendor: 4,713 bytes, line 7
7(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]};function Dd(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Ri(t,e,r)}function An(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function ya(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function Ud(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(ya(arguments[t]));return e}function Hd(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),i=0,t=0;t<r;t++)for(var s=arguments[t],o=0,a=s.length;o<a;o++,i++)n[i]=s[o];return n}function Wd(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,s;n<i;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))}function nr(e){return this instanceof nr?(this.v=e,this):new nr(e)}function Vd(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(y){return function(S){return Promise.resolve(S).then(y,d)}}function a(y,S){n[y]&&(i[y]=function(_){return new Promise(function(w,p){s.push([y,_,w,p])>1||c(y,_)})},S&&(i[y]=S(i[y])))}function c(y,S){try{l(n[y](S))}catch(_){f(s[0][3],_)}}function l(y){y.value instanceof nr?Promise.resolve(y.value.v).then(u,d):f(s[0][2],y)}function u(y){c("next",y)}function d(y){c("throw",y)}function f(y,S){y(S),s.shift(),s.length&&c(s[0][0],s[0][1])}}function qd(e){var t,r;return t={},n("next"),n("throw",function(i){throw i}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(i,s){t[i]=e[i]?function(o){return(r=!r)?{value:nr(e[i](o)),done:!1}:s?s(o):o}:s}}function zd(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof An=="function"?An(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=e[s]&&function(o){return new Promise(function(a,c){o=e[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function Gd(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var Bv=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},Oo=function(e){return Oo=Object.getOwnPropertyNames||function(t){var r=[];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[r.length]=n);return r},Oo(e)};function Jd(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=Oo(e),n=0;n<r.length;n++)r[n]!=="default"&&Ri(t,e,r[n]);return Bv(t,e),t}function Zd(e){return e&&e.__esModule?e:{default:e}}function Kd(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}function Qd(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r}function Yd(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function Xd(e,t,r){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var n,i;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],r&&(i=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");
7i&&(n=function(){try{i.call(this)}catch(s){return Promise.reject(s)}}),e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}var Fv=typeof SuppressedError=="function"?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function ef(e){function t(s){e.error=e.hasError?new Fv(s,e.error,"An error was suppressed during disposal."):s,e.hasError=!0}var r,n=0;function i(){for(;r=e.stack.pop();)try{if(!r.async&&n===1)return n=0,e.stack.push(r),Promise.resolve().then(i);if(r.dispose){var s=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(s).then(i,function(o){return t(o),i()})}else n|=1}catch(o){t(o)}if(n===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return i()}function tf(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,n,i,s,o){return n?t?".jsx":".js":i&&(!s||!o)?r:i+s+"."+o.toLowerCase()+"js"}):e}const jv={__extends:Td,__assign:In,__rest:Pd,__decorate:xd,__param:Od,__esDecorate:Md,__runInitializers:Nd,__propKey:Ld,__setFunctionName:$d,__metadata:Bd,__awaiter:Fd,__generator:jd,__createBinding:Ri,__exportStar:Dd,__values:An,__read:ya,__spread:Ud,__spreadArrays:Hd,__spreadArray:Wd,__await:nr,__asyncGenerator:Vd,__asyncDelegator:qd,__asyncValues:zd,__makeTemplateOb
7ject:Gd,__importStar:Jd,__importDefault:Zd,__classPrivateFieldGet:Kd,__classPrivateFieldSet:Qd,__classPrivateFieldIn:Yd,__addDisposableResource:Xd,__disposeResources:ef,__rewriteRelativeImportExtension:tf},Dv=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:Xd,get __assign(){return In},__asyncDelegator:qd,__asyncGenerator:Vd,__asyncValues:zd,__await:nr,__awaiter:Fd,__classPrivateFieldGet:Kd,__classPrivateFieldIn:Yd,__classPrivateFieldSet:Qd,__createBinding:Ri,__decorate:xd,__disposeResources:ef,__esDecorate:Md,__exportStar:Dd,__extends:Td,__generator:jd,__importDefault:Zd,__importStar:Jd,__makeTemplateObject:Gd,__metadata:Bd,__param:Od,__propKey:Ld,__read:ya,__rest:Pd,__rewriteRelativeImportExtension:tf,__runInitializers:Nd,__setFunctionName:$d,__spread:Ud,__spreadArray:Wd,__spreadArrays:Hd,__values:An,default:jv},Symbol.toStringTag,{value:"Module"})),ba=ir(Dv);var Ci={};Object.defineProperty(Ci,"__esModule",{value:!0});var ll=ba,Uv=function(){function e(t){if(this._maxConcurrency=t,this._queue=[],t<=0)throw new Error("semaphore must be initialized to a positive value");this._value=t}return e.prototype.acquire=function(){var t=this,r=this.isLocked(),n=new Promise(function(i){return t._queue.push(i)});return r||this._dispatch(),n},e.prototype.runExclusive=function(t){return ll.__awaiter(this,void 0,void 0,function(){var r,n,i;return ll.__generator(this,function(s){switch(s.label){case 0:return[4,this.acquire()];case 1:r=s.sent(),n=r[0],i=r[1],s.label=2;case 2:return s.trys.push([2,,4,5]),[4,t(n)];case 3:return[2,s.sent()];case 4:return i(),[7];case 5:return[2]}})})},e.prototype.isLocked=function(){return this._value<=0},e.prototype.release=function(){if(this._maxConcurrency>1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var t=this._currentReleaser;this._currentReleaser=void 0,t()}},e.prototype._dispatch=function(){var t=this,r=this._queue.shift();if(r){var n=!1;this._currentReleaser=function(){n||(n=!0,t._value++,t._dispatch())},r([this._value--,this._currentReleaser])}},e}();Ci.default=Uv;Object.defineProperty(ga,"__esModule",{value:!0});var ul=ba,Hv=Ci,Wv=function(){function e(){this._semaphore=new Hv.default(1)}return e.prototype.acquire=function(){return ul.__awaiter(this,void 0,void 0,function(){var t,r;return ul.__generator(this,function(n){switch(n.label){case 0:return[4,this._semaphore.acquire()];case 1:return t=n.sent(),r=t[1],[2,r]}})})},e.prototype.runExclusive=function(t){return this._semaphore.runExclusive(function(){return t()})},e.prototype.isLocked=function(){return this._semaphore.isLocked()},e.prototype.release=function(){this._semaphore.release()},e}();ga.default=Wv;var ki={};Object.defineProperty(ki,"__esModule",{value:!0});ki.withTimeout=void 0;var yn=ba;function Vv(e,t,r){var n=this;return r===void 0&&(r=new Error("timeout")),{acquire:function(){return new Promise(function(i,s){return yn.__awaiter(n,void 0,void 0,function(){var o,a,c;return yn.__generator(this,function(l){switch(l.label){case 0:return o=!1,setTimeout(function(){o=!0,s(r)},t),[4,e.acquire()];case 1:return a=l.sent(),o?(c=Array.isArray(a)?a[1]:a,c()):i(a),[2]}})})})},runExclusive:function(i){return yn.__awaiter(this,void 0,void 0,function(){var s,o;return yn.__generator(this,function(a){switch(a.label){case 0:s=function(){},a.label=1;case 1:return a.trys.push([1,,7,8]),[4,this.acquire()];case 2:return o=a.sent(),Array.isArray(o)?(s=o[1],[4,i(o[0])]):[3,4];case 3:return[2,a.sent()];case 4:return s=o,[4,i()];case 5:return[2,a.sent()];case 6:return[3,8];case 7:return s(),[7];case 8:return[2]}})})},release:function(){e.release()},isLocked:function(){return e.isLocked()}}}ki.withTimeout=Vv;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.withTimeout=e.Semaphore=e.Mutex=void 0;var t=ga;Object.defineProperty(e,"Mutex",{enumerable:!0,get:function(){return t.default}});var r=Ci;Object.defineProperty(e,"Semaphore",{enumerable:!0,get:function(){return r.default}});var n=ki;Object.defineProperty(e,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}})})(Ad);var qv=Gv,zv=Object.prototype.hasOwnProperty;function Gv(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];
7for(var n in r)zv.call(r,n)&&(e[n]=r[n])}return e}const Jv=qv,Zv=ra();var Kv=V;function V(e){const t=this;t.currentProvider=e}V.prototype.getBalance=en(2,"eth_getBalance");V.prototype.getCode=en(2,"eth_getCode");V.prototype.getTransactionCount=en(2,"eth_getTransactionCount");V.prototype.getStorageAt=en(3,"eth_getStorageAt");V.prototype.call=en(2,"eth_call");V.prototype.protocolVersion=J("eth_protocolVersion");V.prototype.syncing=J("eth_syncing");V.prototype.coinbase=J("eth_coinbase");V.prototype.mining=J("eth_mining");V.prototype.hashrate=J("eth_hashrate");V.prototype.gasPrice=J("eth_gasPrice");V.prototype.accounts=J("eth_accounts");V.prototype.blockNumber=J("eth_blockNumber");V.prototype.getBlockTransactionCountByHash=J("eth_getBlockTransactionCountByHash");V.prototype.getBlockTransactionCountByNumber=J("eth_getBlockTransactionCountByNumber");V.prototype.getUncleCountByBlockHash=J("eth_getUncleCountByBlockHash");V.prototype.getUncleCountByBlockNumber=J("eth_getUncleCountByBlockNumber");V.prototype.sign=J("eth_sign");V.prototype.sendTransaction=J("eth_sendTransaction");V.prototype.sendRawTransaction=J("eth_sendRawTransaction");V.prototype.estimateGas=J("eth_estimateGas");V.prototype.getBlockByHash=J("eth_getBlockByHash");V.prototype.getBlockByNumber=J("eth_getBlockByNumber");V.prototype.getTransactionByHash=J("eth_getTransactionByHash");V.prototype.getTransactionByBlockHashAndIndex=J("eth_getTransactionByBlockHashAndIndex");V.prototype.getTransactionByBlockNumberAndIndex=J("eth_getTransactionByBlockNumberAndIndex");V.prototype.getTransactionReceipt=J("eth_getTransactionReceipt");V.prototype.getUncleByBlockHashAndIndex=J("eth_getUncleByBlockHashAndIndex");V.prototype.getUncleByBlockNumberAndIndex=J("eth_getUncleByBlockNumberAndIndex");V.prototype.getCompilers=J("eth_getCompilers");V.prototype.compileLLL=J("eth_compileLLL");V.prototype.compileSolidity=J("eth_compileSolidity");V.prototype.compileSerpent=J("eth_compileSerpent");V.prototype.newFilter=J("eth_newFilter");V.prototype.newBlockFilter=J("eth_newBlockFilter");V.prototype.newPendingTransactionFilter=J("eth_newPendingTransactionFilter");V.prototype.uninstallFilter=J("eth_uninstallFilter");V.prototype.getFilterChanges=J("eth_getFilterChanges");V.prototype.getFilterLogs=J("eth_getFilterLogs");V.prototype.getLogs=J("eth_getLogs");V.prototype.getWork=J("eth_getWork");V.prototype.submitWork=J("eth_submitWork");V.prototype.submitHashrate=J("eth_submitHashrate");V.prototype.sendAsync=function(e,t){this.currentProvider.sendAsync(Qv(e),function(n,i){if(!n&&i.error&&(n=new Error("EthQuery - RPC Error - "+i.error.message)),n)return t(n);t(null,i.result)})};function J(e){return function(){const t=this;var r=[].slice.call(arguments),n=r.pop();t.sendAsync({method:e,params:r},n)}}function en(e,t){return function(){const r=this;var n=[].slice.call(arguments),i=n.pop();n.length<e&&n.push("latest"),r.sendAsync({method:t,params:n},i)}}function Qv(e){return Jv({id:Zv(),jsonrpc:"2.0",params:[]},e)}const dl=(e,t,r,n)=>function(...i){const s=t.promiseModule;return new s((o,a)=>{t.multiArgs?i.push((...l)=>{t.errorFirst?l[0]?a(l):(l.shift(),o(l)):o(l)}):t.errorFirst?i.push((l,u)=>{l?a(l):o(u)}):i.push(o),Reflect.apply(e,this===r?n:this,i)})},fl=new WeakMap;var Yv=(e,t)=>{t={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...t};const r=typeof e;if(!(e!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${e===null?"null":r}\``);const n=(o,a)=>{let c=fl.get(o);if(c||(c={},fl.set(o,c)),a in c)return c[a];const l=S=>typeof S=="string"||typeof a=="symbol"?a===S:S.test(a),u=Reflect.getOwnPropertyDescriptor(o,a),d=u===void 0||u.writable||u.configurable,y=(t.include?t.include.some(l):!t.exclude.some(l))&&d;return c[a]=y,y},i=new WeakMap,s=new Proxy(e,{apply(o,a,c){const l=i.get(o);if(l)return Reflect.apply(l,a,c);const u=t.excludeMain?o:dl(o,t,s,o);return i.set(o,u),Reflect.apply(u,a,c)},get(o,a){const c=o[a];if(!n(o,a)||c===Function.prototype[a])return c;const l=i.get(c);if(l)return l;if(typeof c=="function"){const u=dl(c,t,s,o);return i.set(c,u),u}return c}});return s};const Xv=Gr.default;let ew=class extends Xv{constructor(){super(),this.updates=[]}async initialize(){}
7async update(){throw new Error("BaseFilter - no update method specified")}addResults(t){this.updates=this.updates.concat(t),t.forEach(r=>this.emit("update",r))}addInitialResults(t){}getChangesAndClear(){const t=this.updates;return this.updates=[],t}};var ma=ew;const tw=ma;let rw=class extends tw{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(t){this.allResults=this.allResults.concat(t),super.addResults(t)}addInitialResults(t){this.allResults=this.allResults.concat(t),super.addInitialResults(t)}getAllResults(){return this.allResults}};var nw=rw,tn={minBlockRef:iw,maxBlockRef:sw,sortBlockRefs:_a,bnToHex:ow,blockRefIsNumber:aw,hexToInt:Tn,incrementHexInt:cw,intToHex:rf,unsafeRandomBytes:lw};function iw(...e){return _a(e)[0]}function sw(...e){const t=_a(e);return t[t.length-1]}function _a(e){return e.sort((t,r)=>t==="latest"||r==="earliest"?1:r==="latest"||t==="earliest"?-1:Tn(t)-Tn(r))}function ow(e){return"0x"+e.toString(16)}function aw(e){return e&&!["earliest","latest","pending"].includes(e)}function Tn(e){return e==null?e:Number.parseInt(e,16)}function cw(e){if(e==null)return e;const t=Tn(e);return rf(t+1)}function rf(e){if(e==null)return e;let t=e.toString(16);return t.length%2&&(t="0"+t),"0x"+t}function lw(e){let t="0x";for(let r=0;r<e;r++)t+=hl(),t+=hl();return t}function hl(){return Math.floor(Math.random()*16).toString(16)}const uw=Kv,dw=Yv,fw=nw,{bnToHex:k2,hexToInt:bn,incrementHexInt:hw,minBlockRef:pw,blockRefIsNumber:gw}=tn;let yw=class extends fw{constructor({provider:t,params:r}){super(),this.type="log",this.ethQuery=new uw(t),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},r),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map(n=>n.toLowerCase()))}async initialize({currentBlock:t}){let r=this.params.fromBlock;["latest","pending"].includes(r)&&(r=t),r==="earliest"&&(r="0x0"),this.params.fromBlock=r;const n=pw(this.params.toBlock,t),i=Object.assign({},this.params,{toBlock:n}),s=await this._fetchLogs(i);this.addInitialResults(s)}async update({oldBlock:t,newBlock:r}){const n=r;let i;t?i=hw(t):i=r;const s=Object.assign({},this.params,{fromBlock:i,toBlock:n}),a=(await this._fetchLogs(s)).filter(c=>this.matchLog(c));this.addResults(a)}async _fetchLogs(t){return await dw(n=>this.ethQuery.getLogs(t,n))()}matchLog(t){if(bn(this.params.fromBlock)>=bn(t.blockNumber)||gw(this.params.toBlock)&&bn(this.params.toBlock)<=bn(t.blockNumber))return!1;const r=t.address&&t.address.toLowerCase();return this.params.address&&r&&!this.params.address.includes(r)?!1:this.params.topics.every((i,s)=>{let o=t.topics[s];if(!o)return!1;o=o.toLowerCase();let a=Array.isArray(i)?i:[i];return a.includes(null)?!0:(a=a.map(u=>u.toLowerCase()),a.includes(o))})}};var bw=yw,va=mw;async function mw({provider:e,fromBlock:t,toBlock:r}){t||(t=r);const n=pl(t),s=pl(r)-n+1,o=Array(s).fill().map((c,l)=>n+l).map(_w);let a=await Promise.all(o.map(c=>ww(e,"eth_getBlockByNumber",[c,!1])));return a=a.filter(c=>c!==null),a}function pl(e){return e==null?e:Number.parseInt(e,16)}function _w(e){return e==null?e:"0x"+e.toString(16)}function vw(e,t){return new Promise((r,n)=>{e.sendAsync(t,(i,s)=>{i?n(i):s.error?n(s.error):s.result?r(s.result):n(new Error("Result was empty"))})})}async function ww(e,t,r){for(let n=0;n<3;n++)try{return await vw(e,{id:1,jsonrpc:"2.0",method:t,params:r})}catch(i){console.error(`provider.sendAsync failed: ${i.stack||i.message||i}`)}return null}const Ew=ma,Sw=va,{incrementHexInt:Rw}=tn;let Cw=class extends Ew{constructor({provider:t,params:r}){super(),this.type="block",this.provider=t}async update({oldBlock:t,newBlock:r}){const n=r,i=Rw(t),o=(await Sw({provider:this.provider,fromBlock:i,toBlock:n})).map(a=>a.hash);this.addResults(o)}};var kw=Cw;const Iw=ma,Aw=va,{incrementHexInt:Tw}=tn;let Pw=class extends Iw{constructor({provider:t}){super(),this.type="tx",this.provider=t}async update({oldBlock:t}){const r=t,n=Tw(t),i=await Aw({provider:this.provider,fromBlock:n,toBlock:r}),s=[];for(const o of i)s.push(...o.transactions);this.addResults(s)}};var xw=Pw;const Ow=Ad.Mutex,{createAsyncMiddleware:Mw,createScaffoldMiddleware:Nw}=da,Lw=bw,$w=kw,Bw=xw,{intToHex:nf,hexToInt:_o}=tn;var Fw=jw;function jw({blockTracker:e,provider:t}){let r=0,n={};const i=new Ow,s=Dw({mutex:i}),o=Nw({eth_newFilter:s(vo(c)),eth_newBlockFilter:s(vo(l)),eth_newPendingTransactionFilter:s(vo(u)),eth_uninstallFilter:s(En(y)),eth_getFilterChanges:s(En(d)),eth_getFilterLogs:s(En(f))}),a=async({oldBlock:m,newBlock:b})=>{if(n.length===0)return;const R=await i.acquire();try{await Promise.all(Dt(n).map(async C=>{try{await C.update({oldBlock:m,newBlock:b})}catch(T){console.error(T)}}))}catch(C){console.error(C)}R()};return o.newLogFilter=c,o.newBlockFilter=l,o.newPendingTransactionFilter=u,o.uninstallFilter=y,o.getFilterChanges=d,o.getFilterLogs=f,o.destroy=()=>{w()},o;async function c(m){const b=new Lw({provider:t,params:m});return await S(b),b}async function l(){const m=new $w({provider:t});return await S(m),m}async function u(){const m=new Bw({provider:t});return await S(m),m}async function d(m){const b=_o(m),R=n[b];if(!R)throw new Error(`No filter for index "${b}"`);return R.getChangesAndClear()}async function f(m){const b=_o(m),R=n[b];if(!R)throw new Error(`No filter for index "${b}"`);let C=[];return R.type==="log"&&(C=R.getAllResults()),C}async function y(m){const b=_o(m),C=!!n[b];return C&&await _(b),C}async function S(m){const b=Dt(n).length,R=await e.getLatestBlock();await m.initialize({currentBlock:R}),r++,n[r]=m,m.id=r,m.idHex=nf(r);const C=Dt(n).length;return p({prevFilterCount:b,newFilterCount:C}),r}async function _(m){const b=Dt(n).length;delete n[m];const R=Dt(n).length;p({prevFilterCount:b,newFilterCount:R})}async function w(){const m=Dt(n).length;n={},p({prevFilterCount:m,newFilterCount:0})}function p({prevFilterCount:m,newFilterCount:b}){if(m===0&&b>0){e.on("sync",a);return}if(m>0&&b===0){e.removeListener("sync",a);return}}}function vo(e){return En(async(...t)=>{const r=await e(...t);return nf(r.id)})}function En(e){return Mw(async(t,r)=>{const n=await e.apply(null,t.params);r.result=n})}function Dw({mutex:e}){return t=>async(r,n,i,s)=>{(await e.acquire())(),t(r,n,i,s)}}function Dt(e,t){const r=[];for(let n in e)r.push(e[n]);return r}const Uw=Gr.default,{createAsyncMiddleware:gl,createScaffoldMiddleware:Hw}=da,Ww=Fw,{unsafeRandomBytes:Vw,incrementHexInt:qw}=tn,zw=va;var Gw=Jw;function Jw({blockTracker:e,provider:t}){const r={},n=Ww({blockTracker:e,provider:t});let i=!1;
7const s=new Uw,o=Hw({eth_subscribe:gl(a),eth_unsubscribe:gl(c)});return o.destroy=u,{events:s,middleware:o};async function a(d,f){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const y=d.params[0],S=Vw(16);let _;switch(y){case"newHeads":_=w({subId:S});break;case"logs":const m=d.params[1],b=await n.newLogFilter(m);_=p({subId:S,filter:b});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${y}"`)}r[S]=_,f.result=S;return;function w({subId:m}){const b={type:y,destroy:async()=>{e.removeListener("sync",b.update)},update:async({oldBlock:R,newBlock:C})=>{const T=C,H=qw(R);(await zw({provider:t,fromBlock:H,toBlock:T})).map(Zw).filter(Y=>Y!==null).forEach(Y=>{l(m,Y)})}};return e.on("sync",b.update),b}function p({subId:m,filter:b}){return b.on("update",C=>l(m,C)),{type:y,destroy:async()=>await n.uninstallFilter(b.idHex)}}}async function c(d,f){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const y=d.params[0],S=r[y];if(!S){f.result=!1;return}delete r[y],await S.destroy(),f.result=!0}function l(d,f){s.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:d,result:f}})}function u(){s.removeAllListeners();for(const d in r)r[d].destroy(),delete r[d];i=!0}}function Zw(e){return e==null?null:{hash:e.hash,parentHash:e.parentHash,sha3Uncles:e.sha3Uncles,miner:e.miner,stateRoot:e.stateRoot,transactionsRoot:e.transactionsRoot,receiptsRoot:e.receiptsRoot,logsBloom:e.logsBloom,difficulty:e.difficulty,number:e.number,gasLimit:e.gasLimit,gasUsed:e.gasUsed,nonce:e.nonce,mixHash:e.mixHash,timestamp:e.timestamp,extraData:e.extraData}}Object.defineProperty(hi,"__esModule",{value:!0});hi.SubscriptionManager=void 0;const Kw=Gu,Qw=Gw,yl=()=>{};class Yw{constructor(t){const r=new Kw.PollingBlockTracker({provider:t,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:n,middleware:i}=Qw({blockTracker:r,provider:t});this.events=n,this.subscriptionMiddleware=i}async handleRequest(t){const r={};return await this.subscriptionMiddleware(t,r,yl,yl),r}destroy(){this.subscriptionMiddleware.destroy()}}hi.SubscriptionManager=Yw;var sf=B&&B.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Zt,"__esModule",{value:!0});Zt.CoinbaseWalletProvider=void 0;const Xw=sf(Pn),e2=Lp,X=Ir,q=N,t2=xr,bl=Ne,mn=lr,Ae=or,wo=sf(Rm),_r=cr,r2=er,n2=hi,ml="DefaultChainId",_l="DefaultJsonRpcUrl";class i2 extends e2.EventEmitter{constructor(t){var r,n;super(),this._filterPolyfill=new r2.FilterPolyfill(this),this._subscriptionManager=new n2.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=t.chainId,this._jsonRpcUrlFromOpts=t.jsonRpcUrl,this._overrideIsMetaMask=t.overrideIsMetaMask,this._relayProvider=t.relayProvider,this._storage=t.storage,this._relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=(r=t.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this.isCoinbaseBrowser=(n=t.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this.qrUrl=t.qrUrl;const i=this.getChainId(),s=(0,q.prepend0x)(i.toString(16));this.emit("connect",{chainIdStr:s});const o=this._storage.getItem(bl.LOCAL_STORAGE_ADDRESSES_KEY);if(o){const a=o.split(" ");a[0]!==""&&(this._addresses=a.map(c=>(0,q.ensureAddressString)(c)),this.emit("accountsChanged",a))}this._subscriptionManager.events.on("notification",a=>{this.emit("message",{type:a.method,data:a.params})}),this._isAuthorized()&&this.initializeRelay(),window.addEventListener("message",a=>{var c;if(!(a.origin!==location.origin||a.source!==window)&&a.data.type==="walletLinkMessage"&&a.data.data.action==="dappChainSwitched"){const l=a.data.data.chainId,u=(c=a.data.data.jsonRpcUrl)!==null&&c!==void 0?c:this.jsonRpcUrl;
7this.updateProviderInfo(u,Number(l))}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,q.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var t;return(t=this._storage.getItem(_l))!==null&&t!==void 0?t:this._jsonRpcUrlFromOpts}set jsonRpcUrl(t){this._storage.setItem(_l,t)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(t,r){this.isCoinbaseBrowser||(this._chainIdFromOpts=r,this._jsonRpcUrlFromOpts=t),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(t,r){this.jsonRpcUrl=t;const n=this.getChainId();this._storage.setItem(ml,r.toString(10)),((0,q.ensureIntNumber)(r)!==n||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(t,r,n,i,s,o){const c=await(await this.initializeRelay()).watchAsset(t,r,n,i,s,o==null?void 0:o.toString()).promise;return(0,Ae.isErrorResponse)(c)?!1:!!c.result}async addEthereumChain(t,r,n,i,s,o){var a,c;if((0,q.ensureIntNumber)(t)===this.getChainId())return!1;const l=await this.initializeRelay(),u=l.inlineAddEthereumChain(t.toString());!this._isAuthorized()&&!u&&await l.requestEthereumAccounts().promise;const d=await l.addEthereumChain(t.toString(),r,s,n,i,o).promise;return(0,Ae.isErrorResponse)(d)?!1:(((a=d.result)===null||a===void 0?void 0:a.isApproved)===!0&&this.updateProviderInfo(r[0],t),((c=d.result)===null||c===void 0?void 0:c.isApproved)===!0)}async switchEthereumChain(t){const n=await(await this.initializeRelay()).switchEthereumChain(t.toString(10),this.selectedAddress||void 0).promise;if((0,Ae.isErrorResponse)(n)){if(!n.errorCode)return;throw n.errorCode===X.standardErrorCodes.provider.unsupportedChain?X.standardErrors.provider.unsupportedChain():X.standardErrors.provider.custom({message:n.errorMessage,code:n.errorCode})}const i=n.result;i.isApproved&&i.rpcUrl.length>0&&this.updateProviderInfo(i.rpcUrl,t)}setAppInfo(t,r){this.initializeRelay().then(n=>n.setAppInfo(t,r))}async enable(){var t;return(t=this.diagnostic)===null||t===void 0||t.log(_r.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?mn.Session.hash(this._relay.session.id):void 0}),this._isAuthorized()?[...this._addresses]:await this.send("eth_requestAccounts")}async close(){(await this.initializeRelay()).resetAndReload()}send(t,r){try{const n=this._send(t,r);if(n instanceof Promise)return n.catch(i=>{throw(0,X.serializeError)(i,t)})}catch(n){throw(0,X.serializeError)(n,t)}}_send(t,r){if(typeof t=="string"){const i=t,s=Array.isArray(r)?r:r!==void 0?[r]:[],o={jsonrpc:"2.0",id:0,method:i,params:s};return this._sendRequestAsync(o).then(a=>a.result)}if(typeof r=="function"){const i=t,s=r;return this._sendAsync(i,s)}if(Array.isArray(t))return t.map(s=>this._sendRequest(s));const n=t;return this._sendRequest(n)}async sendAsync(t,r){try{return this._sendAsync(t,r).catch(n=>{throw(0,X.serializeError)(n,t)})}catch(n){return Promise.reject((0,X.serializeError)(n,t))}}async _sendAsync(t,r){if(typeof r!="function")throw new Error("callback is required");if(Array.isArray(t)){const i=r;this._sendMultipleRequestsAsync(t).then(s=>i(null,s)).catch(s=>i(s,null));return}const n=r;return this._sendRequestAsync(t).then(i=>n(null,i)).catch(i=>n(i,null))}async request(t){try{return this._request(t).catch(r=>{throw(0,X.serializeError)(r,t.method)})}catch(r){return Promise.reject((0,X.serializeError)(r,t.method))}}async _request(t){if(!t||typeof t!="object"||Array.isArray(t))throw X.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:t});const{method:r,params:n}=t;if(typeof r!="string"||r.length===0)throw X.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:t});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw X.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:t});const i=n===void 0?[]:n,s=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:r,params:i,jsonrpc:"2.0",id:s})).result}
7async scanQRCode(t){const n=await(await this.initializeRelay()).scanQRCode((0,q.ensureRegExpString)(t)).promise;if((0,Ae.isErrorResponse)(n))throw(0,X.serializeError)(n.errorMessage,"scanQRCode");if(typeof n.result!="string")throw(0,X.serializeError)("result was not a string","scanQRCode");return n.result}async genericRequest(t,r){const i=await(await this.initializeRelay()).genericRequest(t,r).promise;if((0,Ae.isErrorResponse)(i))throw(0,X.serializeError)(i.errorMessage,"generic");if(typeof i.result!="string")throw(0,X.serializeError)("result was not a string","generic");return i.result}async connectAndSignIn(t){var r;(r=this.diagnostic)===null||r===void 0||r.log(_r.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::connectAndSignIn",sessionIdHash:this._relay?mn.Session.hash(this._relay.session.id):void 0});let n;try{const s=await this.initializeRelay();if(!(s instanceof t2.MobileRelay))throw new Error("connectAndSignIn is only supported on mobile");if(n=await s.connectAndSignIn(t).promise,(0,Ae.isErrorResponse)(n))throw new Error(n.errorMessage)}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?X.standardErrors.provider.userRejectedRequest("User denied account authorization"):s}if(!n.result)throw new Error("accounts received is empty");const{accounts:i}=n.result;return this._setAddresses(i),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),n.result}async selectProvider(t){const n=await(await this.initializeRelay()).selectProvider(t).promise;if((0,Ae.isErrorResponse)(n))throw(0,X.serializeError)(n.errorMessage,"selectProvider");if(typeof n.result!="string")throw(0,X.serializeError)("result was not a string","selectProvider");return n.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(t){const r={jsonrpc:"2.0",id:t.id},{method:n}=t;if(r.result=this._handleSynchronousMethods(t),r.result===void 0)throw new Error(`Coinbase Wallet does not support calling ${n} synchronously without a callback. Please provide a callback parameter to call ${n} asynchronously.`);return r}_setAddresses(t,r){if(!Array.isArray(t))throw new Error("addresses is not an array");const n=t.map(i=>(0,q.ensureAddressString)(i));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(bl.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" ")))}_sendRequestAsync(t){return new Promise((r,n)=>{try{const i=this._handleSynchronousMethods(t);if(i!==void 0)return r({jsonrpc:"2.0",id:t.id,result:i});const s=this._handleAsynchronousFilterMethods(t);if(s!==void 0){s.then(a=>r(Object.assign(Object.assign({},a),{id:t.id}))).catch(a=>n(a));return}const o=this._handleSubscriptionMethods(t);if(o!==void 0){o.then(a=>r({jsonrpc:"2.0",id:t.id,result:a.result})).catch(a=>n(a));return}}catch(i){return n(i)}this._handleAsynchronousMethods(t).then(i=>i&&r(Object.assign(Object.assign({},i),{id:t.id}))).catch(i=>n(i))})}_sendMultipleRequestsAsync(t){return Promise.all(t.map(r=>this._sendRequestAsync(r)))}_handleSynchronousMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"eth_uninstallFilter":return this._eth_uninstallFilter(n);case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(n);case"eth_ecRecover":return this._eth_ecRecover(n);case"personal_sign":return this._personal_sign(n);case"personal_ecRecover":return this._personal_ecRecover(n);case"eth_signTransaction":return this._eth_signTransaction(n);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(n);case"eth_sendTransaction":return this._eth_sendTransaction(n);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(n);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(n);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(n);case"cbWallet_arbitrary":return this._cbwallet_arbitrary(n);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(n);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(n);case"wallet_watchAsset":return this._wallet_watchAsset(n)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(t,this.jsonRpcUrl).cat
7ch(s=>{var o;throw(s.code===X.standardErrorCodes.rpc.methodNotFound||s.code===X.standardErrorCodes.rpc.methodNotSupported)&&((o=this.diagnostic)===null||o===void 0||o.log(_r.EVENTS.METHOD_NOT_IMPLEMENTED,{method:t.method,sessionIdHash:this._relay?mn.Session.hash(this._relay.session.id):void 0})),s})}_handleAsynchronousFilterMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_newFilter":return this._eth_newFilter(n);case"eth_newBlockFilter":return this._eth_newBlockFilter();case"eth_newPendingTransactionFilter":return this._eth_newPendingTransactionFilter();case"eth_getFilterChanges":return this._eth_getFilterChanges(n);case"eth_getFilterLogs":return this._eth_getFilterLogs(n)}}_handleSubscriptionMethods(t){switch(t.method){case"eth_subscribe":case"eth_unsubscribe":return this._subscriptionManager.handleRequest(t)}}_isKnownAddress(t){try{const r=(0,q.ensureAddressString)(t);return this._addresses.map(i=>(0,q.ensureAddressString)(i)).includes(r)}catch{}return!1}_ensureKnownAddress(t){var r;if(!this._isKnownAddress(t))throw(r=this.diagnostic)===null||r===void 0||r.log(_r.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(t){const r=t.from?(0,q.ensureAddressString)(t.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);const n=t.to?(0,q.ensureAddressString)(t.to):null,i=t.value!=null?(0,q.ensureBN)(t.value):new Xw.default(0),s=t.data?(0,q.ensureBuffer)(t.data):Buffer.alloc(0),o=t.nonce!=null?(0,q.ensureIntNumber)(t.nonce):null,a=t.gasPrice!=null?(0,q.ensureBN)(t.gasPrice):null,c=t.maxFeePerGas!=null?(0,q.ensureBN)(t.maxFeePerGas):null,l=t.maxPriorityFeePerGas!=null?(0,q.ensureBN)(t.maxPriorityFeePerGas):null,u=t.gas!=null?(0,q.ensureBN)(t.gas):null,d=t.chainId?(0,q.ensureIntNumber)(t.chainId):this.getChainId();return{fromAddress:r,toAddress:n,weiValue:i,data:s,nonce:o,gasPriceInWei:a,maxFeePerGas:c,maxPriorityFeePerGas:l,gasLimit:u,chainId:d}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw X.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw X.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(t,r,n,i){this._ensureKnownAddress(r);try{const o=await(await this.initializeRelay()).signEthereumMessage(t,r,n,i).promise;if((0,Ae.isErrorResponse)(o))throw new Error(o.errorMessage);return{jsonrpc:"2.0",id:0,result:o.result}}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?X.standardErrors.provider.userRejectedRequest("User denied message signature"):s}}async _ethereumAddressFromSignedMessage(t,r,n){const s=await(await this.initializeRelay()).ethereumAddressFromSignedMessage(t,r,n).promise;if((0,Ae.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,q.hexStringFromIntNumber)(this.getChainId())}getChainId(){const t=this._storage.getItem(ml);if(!t)return(0,q.ensureIntNumber)(this._chainIdFromOpts);const r=parseInt(t,10);return(0,q.ensureIntNumber)(r)}async _eth_requestAccounts(){var t;if((t=this.diagnostic)===null||t===void 0||t.log(_r.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?mn.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,Ae.isErrorResponse)(r))throw new Error(r.errorMessage)}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?X.standardErrors.provider.userRejectedRequest("User denied account authorization"):n}if(!r.result)throw new Error("accounts received is empty");return this._setAddresses(r.result),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(t){this._requireAuthorization();const r=(0,q.ensureAddressString)(t[0]),n=(0,q.ensureBuffer)(t[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(t){const r=(0,q.ensureBuffer)(t[0]),n=(0,q.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(t){this._requireAuthorization();const r=(0,q.ensureBuffer)(t[0]),n=(0,q.ensureAddressString)(t[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(t){const r=(0,q.ensureBuffer)(t[0]),n=(0,q.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!0)}async _eth_signTransaction(t){this._requireAuthorization();const r=this._prepareTransactionParams(t[0]||{});try{const i=await(await this.initializeRelay()).signEthereumTransaction(r).promise;if((0,Ae.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)?X.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(t){const r=(0,q.ensureBuffer)(t[0]),i=await(await this.initializeRelay()).submitEthereumTransaction(r,this.getChainId()).promise;if((0,Ae.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}async _eth_sendTransaction(t){this._requireAuthorization();const r=this._prepareTransactionParams(t[0]||{});try{const i=await(await this.initializeRelay()).signAndSubmitEthereumTransaction(r).promise;if((0,Ae.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)?X.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(t){this._requireAuthorization();const r=(0,q.ensureParsedJSONObject)(t[0]),n=(0,q.ensureAddressString)(t[1]);this._ensureKnownAddress(n);const i=wo.default.hashForSignTypedDataLegacy({data:r}),s=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,s)}async _eth_signTypedData_v3(t){this._requireAuthorization();const r=(0,q.ensureAddressString)(t[0]),n=(0,q.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const i=wo.default.hashForSignTypedData_v3({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _eth_signTypedData_v4(t){this._requireAuthorization();const r=(0,q.ensureAddressString)(t[0]),n=(0,q.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const i=wo.default.hashForSignTypedData_v4({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _cbwallet_arbitrary(t){const r=t[0],n=t[1];
7if(typeof n!="string")throw new Error("parameter must be a string");if(typeof r!="object"||r===null)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(r,n)}}async _wallet_addEthereumChain(t){var r,n,i,s;const o=t[0];if(((r=o.rpcUrls)===null||r===void 0?void 0:r.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!o.chainName||o.chainName.trim()==="")throw X.standardErrors.rpc.invalidParams("chainName is a required field");if(!o.nativeCurrency)throw X.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const a=parseInt(o.chainId,16);return await this.addEthereumChain(a,(n=o.rpcUrls)!==null&&n!==void 0?n:[],(i=o.blockExplorerUrls)!==null&&i!==void 0?i:[],o.chainName,(s=o.iconUrls)!==null&&s!==void 0?s:[],o.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(t){const r=t[0];return await this.switchEthereumChain(parseInt(r.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(t){const r=Array.isArray(t)?t[0]:t;if(!r.type)throw X.standardErrors.rpc.invalidParams("Type is required");if((r==null?void 0:r.type)!=="ERC20")throw X.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!(r!=null&&r.options))throw X.standardErrors.rpc.invalidParams("Options are required");if(!(r!=null&&r.options.address))throw X.standardErrors.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:i,symbol:s,image:o,decimals:a}=r.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(r.type,i,s,a,o,n)}}_eth_uninstallFilter(t){const r=(0,q.ensureHexString)(t[0]);return this._filterPolyfill.uninstallFilter(r)}async _eth_newFilter(t){const r=t[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(r)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(t){const r=(0,q.ensureHexString)(t[0]);return this._filterPolyfill.getFilterChanges(r)}_eth_getFilterLogs(t){const r=(0,q.ensureHexString)(t[0]);return this._filterPolyfill.getFilterLogs(r)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(t=>(t.setAccountsCallback((r,n)=>this._setAddresses(r,n)),t.setChainCallback((r,n)=>{this.updateProviderInfo(n,parseInt(r,10))}),t.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=t,t))}}Zt.CoinbaseWalletProvider=i2;var Ii={};Object.defineProperty(Ii,"__esModule",{value:!0});Ii.RelayEventManager=void 0;const s2=N;class o2{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const t=this._nextRequestId,r=(0,s2.prepend0x)(t.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),t}}Ii.RelayEventManager=o2;Object.defineProperty(Er,"__esModule",{value:!0});Er.CoinbaseWalletSDK=void 0;const a2=Bn,c2=Fn,vl=N,l2=Wn,u2=Zt,d2=xr,f2=qr,h2=Ii,p2=Hr,g2=Or,of=ar;class Ai{constructor(t){var r,n,i;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const s=t.linkAPIUrl||c2.LINK_API_URL;typeof t.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=t.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(r=t.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this._overrideIsCoinbaseBrowser=(n=t.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this._diagnosticLogger=t.diagnosticLogger,this._reloadOnDisconnect=(i=t.reloadOnDisconnect)!==null&&i!==void 0?i:!0;const o=new URL(s),a=`${o.protocol}//${o.host}`;if(this._storage=new l2.ScopedLocalStorage(`-walletlink:${a}`),this._storage.setItem("version",Ai.VERSION),this.walletExtension||this.coinbaseBrowser)return;this._relayEventManager=new h2.RelayEventManager;const c=(0,vl.isMobileWeb)(),l=t.uiConstructor||(d=>c?new f2.MobileRelayUI(d):new p2.WalletLinkRelayUI(d)),u={linkAPIUrl:s,version:of.LIB_VERSION,darkMode:!!t.darkMode,headlessMode:!!t.headlessMode,uiConstructor:l,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect,enableMobileWalletLink:t.enableMobileWalletLink};this._relay=c?new d2.MobileRelay(u):new g2.WalletLinkRelay(u),this.setAppInfo(t.appName,t.appLogoUrl),!t.headlessMode&&this._relay.attachUI()}makeWeb3Provider(t="",r=1){const n=this.walletExtension;if(n)return this.isCipherProvider(n)||n.setProviderInfo(t,r),this._reloadOnDisconnect===!1&&typeof n.disableReloadOnDisconnect=="function"&&n.disableReloadOnDisconnect(),n;const i=this.coinbaseBrowser;if(i)return i;const s=this._relay;if(!s||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return t||s.setConnectDisabled(!0),new u2.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(s),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:t,chainId:r,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(t,r){var n;this._appName=t||"DApp",this._appLogoUrl=r||(0,vl.getFavicon)();const i=this.walletExtension;i?this.isCipherProvider(i)||i.setAppInfo(this._appName,this._appLogoUrl):(n=this._relay)===null||n===void 0||n.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var t;const r=this===null||this===void 0?void 0:this.walletExtension;r?r.close():(t=this._relay)===null||t===void 0||t.resetAndReload()}getQrUrl(){var t,r;return(r=(t=this._relay)===null||t===void 0?void 0:t.getQRCodeUrl())!==null&&r!==void 0?r:null}getCoinbaseWalletLogo(t,r=240){return(0,a2.walletLogo)(t,r)}get walletExtension(){var t;return(t=window.coinbaseWalletExtension)!==null&&t!==void 0?t:window.walletLinkExtension}get coinbaseBrowser(){var t,r;try{const n=(t=window.ethereum)!==null&&t!==void 0?t:(r=window.top)===null||r===void 0?void 0:r.ethereum;return n&&"isCoinbaseBrowser"in n&&n.isCoinbaseBrowser?n:void 0}catch{return}}isCipherProvider(t){return typeof t.isCipher=="boolean"&&t.isCipher}}Er.CoinbaseWalletSDK=Ai;Ai.VERSION=of.LIB_VERSION;
7(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CoinbaseWalletProvider=e.CoinbaseWalletSDK=void 0;const t=Er,r=Zt;var n=Er;Object.defineProperty(e,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return n.CoinbaseWalletSDK}});var i=Zt;Object.defineProperty(e,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return i.CoinbaseWalletProvider}}),e.default=t.CoinbaseWalletSDK,typeof window<"u"&&(window.CoinbaseWalletSDK=t.CoinbaseWalletSDK,window.CoinbaseWalletProvider=r.CoinbaseWalletProvider,window.WalletLink=t.CoinbaseWalletSDK,window.WalletLinkProvider=r.CoinbaseWalletProvider)})(Ml);const y2=af(Ml),P2=Object.freeze(Object.defineProperty({__proto__:null,default:y2},Symbol.toStringTag,{value:"Module"}));export{P2 as i};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.