asyncfunctiont(t){conste=Object.keys(t);return(awaitPromise.all(e.map((e=>Promise.resolve(t[e]))))).reduce(((t,r,n)=>(t[e[n]]=r,t)),{})}functione(t,e){constr=e.split("|").map((t=>t.trim()));for(letn=0;n<r.length;n++)switch(e){case"any":return;case"boolean":case"number":case"string":if(typeoft===e)return}thrownewError("invalid value for type")}functionr(t,r,n,s){for(letiinr){leto=r[i];consta=s?s[i]:void0;if(void0!==a)o=a;else{constt=n?n[i]:null;t&&e(o,t)}Object.defineProperty(t,i,{enumerable:!0,value:o,writable:!1})}}varn,s=window&&window.__classPrivateFieldSet||function(t,e,r,n,s){if("m"===n)thrownewTypeError("Private method is not writable");if("a"===n&&!s)thrownewTypeError("Private accessor was defined without a setter");if("function"==typeofe?t!==e||!s:!e.has(t))thrownewTypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,r):s?s.value=r:e.set(t,r),r},i=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)thrownewTypeError("Private accessor was defined without a getter");if("function"==typeofe?t!==e||!n:!e.has(t))thrownewTypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};classo{constructor(t,e,i){n.set(this,void0),s(this,n,e,"f"),r(this,{emitter:t,filter:i})}asyncremoveListener(){null!=i(this,n,"f")&&awaitthis.emitter.off(this.filter,i(this,n,"f"))}}functiona(t,e){returnt[e]}functionc(t,e,r){if(Object.isFrozen(t))thrownewError("frozen object is immuatable; cannot set "+e);t[e]=r}functionl(t,e){returnt&&t.code===e}functionu(t){returnl(t,"CALL_EXCEPTION")}n=newWeakMap;varh,f,d,p,w=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)thrownewTypeError("Private accessor was defined without a getter");if("function"==typeofe?t!==e||!n:!e.has(t))thrownewTypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};!function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"}(p||(p={}));constg={debug:1,default:2,info:2,warning:3,error:4,off:5};letm=g.default,y=null;constb=["NFD","NFC","NFKD","NFKC"].reduce(((t,e)=>{try{if("test"!=="test".normalize(e))thrownewError("bad");if("NFD"===e){constt=String.fromCharCode(233).normalize("NFD");if(t!==String.fromCharCode(101,769))thrownewError("broken")}t.push(e)}catch(t){}returnt}),[]);functionv(t,e,r){Object.defineProperty(t,e,{enumerable:!0,writable:!1,value:r})}constE=9007199254740991,A={};A.INVALID_ARGUMENT=TypeError,A.NUMERIC_FAULT=RangeError,A.BUFFER_OVERRUN=RangeError;classT{constructor(t){h.add(this),v(this,"version",t||"_")}makeError(t,e,r){{consts=[];if(r)for(consttinr){conste=r[t];try{s.push(t+"="+JSON.stringify(e))}catch(n){s.push(t+"=[could not serialize object]")}}s.push(`code=${e}`),s.push(`version=${this.version}`),s.length&&(t+=" ("+s.join(", ")+")")}constn=new(A[e]||Error)(t);if(v(n,"code",e),r)for(consttinr)v(n,t,r[t]);returnn}throwError(t,e,r){throwthis.makeError(t,e,r)}throwArgumentError(t,e,r){returnthis.throwError(t,"INVALID_ARGUMENT",{argument:e,value:r})}assert(t,e,r,n){t||this.throwError(e,r||"UNKNOWN_ERROR",n)}assertArgument(t,e,r,n){returnthis.assert(t,e,"INVALID_ARGUMENT",{argument:r,value:n})}assertIntegerArgument(t,e,r,n){lets=null;"number"!=typeofe?s="expected a number":Number.isInteger(e)?(null!=r&&e<r||null!=n&&e>n)&&(s="value is out of range"):s="invalid integer",s&&this.throwArgumentError(s,t,e)}assertSafeUint53(t,e){this.assertArgument("number"==typeoft,"invalid number","value",t),null==e&&(e="value not safe");constr="assertSafeInteger";this.assert(t>=0&&t<9007199254740991,e,"NUMERIC_FAULT",{operation:r,fault:"out-of-safe-range",value:t}),this.assert(t%1==0,e,"NUMERIC_FAULT",{operation:r,fault:"non-integer",value:t})}assertNormalize(t){-1===b.indexOf(t)&&this.throwError("platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{fo
constMe=t=>newUint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),je=t=>newDataView(t.buffer,t.byteOffset,t.byteLength),Ge=(t,e)=>t<<32-e|t>>>e;if(!(68===newUint8Array(newUint32Array([287454020]).buffer)[0]))thrownewError("Non little-endian hardware is not supported");Array.from({length:256},((t,e)=>e.toString(16).padStart(2,"0")));const$e=(()=>{constt="undefined"!=typeofmodule&&"function"==typeofmodule.require&&module.require.bind(module);try{if(t){const{setImmediate:e}=t("timers");return()=>newPromise((t=>e(t)))}}catch(t){}return()=>newPromise((t=>setTimeout(t,0)))})();asyncfunctionze(t,e,r){letn=Date.now();for(lets=0;s<t;s++){r(s);constt=Date.now()-n;t>=0&&t<e||(await$e(),n+=t)}}functionWe(t){if("string"==typeoft&&(t=function(t){if("string"!=typeoft)thrownewTypeError("utf8ToBytes expected string, got "+typeoft);return(newTextEncoder).encode(t)}(t)),!(tinstanceofUint8Array))thrownewTypeError(`Expected input type is Uint8Array (got ${typeoft})`);returnt}functionHe(t){if(!Number.isSafeInteger(t)||t<0)thrownewError(`Wrong positive integer: ${t}`)}functionVe(t){if("function"!=typeoft||"function"!=typeoft.create)thrownewError("Hash should be wrapped by utils.wrapConstructor");He(t.outputLen),He(t.blockLen)}classKe{clone(){returnthis._cloneInto()}}functionJe(t,e){if(void0!==e&&("object"!=typeofe||(r=e,"[object Object]"!==Object.prototype.toString.call(r)||r.constructor!==Object)))thrownewTypeError("Options should be object or undefined");varr;returnObject.assign(t,e)}functionqe(t){conste=e=>t().update(We(e)).digest(),r=t();returne.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}classXeextendsKe{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,Ve(t);constr=We(e);if(this.iHash=t.create(),!(this.iHashinstanceofKe))thrownewTypeError("Expected instance of class which extends utils.Hash");constn=this.blockLen=this.iHash.blockLen;this.outputLen=this.iHash.outputLen;consts=newUint8Array(n);s.set(r.length>this.iHash.blockLen?t.create().update(r).digest():r);for(lett=0;t<s.length;t++)s[t]^=54;this.iHash.update(s),this.oHash=t.create();for(lett=0;t<s.length;t++)s[t]^=106;this.oHash.update(s),s.fill(0)}update(t){if(this.destroyed)thrownewError("instance is destroyed");returnthis.iHash.update(t),this}digestInto(t){if(this.destroyed)thrownewError("instance is destroyed");if(!(tinstanceofUint8Array)||t.length!==this.outputLen)thrownewError("HMAC: Invalid output buffer");if(this.finished)thrownewError("digest() was already called");this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){constt=newUint8Array(this.oHash.outputLen);returnthis.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:e,iHash:r,finished:n,destroyed:s,blockLen:i,outputLen:o}=this;return(t=t).finished=n,t.destroyed=s,t.blockLen=i,t.outputLen=o,t.oHash=e._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}constYe=(t,e,r)=>newXe(t,e).update(r).digest();functionZe(t,e,r,n){const{c:s,dkLen:i,DK:o,PRF:a,PRFSalt:c}=function(t,e,r,n){Ve(t);consts=Je({dkLen:32,asyncTick:10},n),{c:i,dkLen:o,asyncTick:a}=s;if(He(i),He(o),He(a),i<1)thrownewError("PBKDF2: iterations (c) should be >= 1");constc=We(e),l=We(r),u=newUint8Array(o),h=Ye.create(t,c),f=h._cloneInto().update(l);return{c:i,dkLen:o,asyncTick:a,DK:u,PRF:h,PRFSalt:f}}(t,e,r,n);letl;constu=newUint8Array(4),h=je(u),f=newUint8Array(a.outputLen);for(lett=1,e=0;e<i;t++,e+=a.outputLen){constr=o.subarray(e,e+a.outputLen);h.setInt32(0,t,!1),(l=c._cloneInto(l)).update(u).digestInto(f),r.set(f.subarray(0,r.length));for(lett=1;t<s;t++){a._cloneInto(l).update(f).digestInto(f);for(lett=0;t<r.length;t++)r[t]^=f[t]}}returnfunction(t,e,r,n,s){returnt.destroy(),e.destroy(),n&&n.destroy(),s.fill(0),r}(a,c,o,l,f)}Ye.create=(t,e)=>newXe(t,e);classQeextendsKe{constructor(t,e,r,n){super(),this.blockLen=t,this.outputLen=e,this.padOffset=r,this.isLE
/*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */constAa=BigInt(0),Ta=BigInt(1),ka=BigInt(2),Pa=BigInt(3),Na=BigInt(8),xa=ka**BigInt(256),Oa={a:Aa,b:BigInt(7),P:xa-ka**BigInt(32)-BigInt(977),n:xa-BigInt("432420386565659656852420866394968145599"),h:Ta,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee")};functionIa(t){const{a:e,b:r}=Oa,n=Ja(t*t),s=Ja(n*t);returnJa(s+e*t+r)}constSa=Oa.a===Aa;classRa{constructor(t,e,r){this.x=t,this.y=e,this.z=r}staticfromAffine(t){if(!(tinstanceof_a))thrownewTypeError("JacobianPoint#fromAffine: expected Point");returnnewRa(t.x,t.y,Ta)}statictoAffineBatch(t){conste=function(t,e=Oa.P){constr=newArray(t.length),n=Xa(t.reduce(((t,n,s)=>n===Aa?t:(r[s]=t,Ja(t*n,e))),Ta),e);returnt.reduceRight(((t,n,s)=>n===Aa?t:(r[s]=Ja(t*r[s],e),Ja(t*n,e))),n),r}(t.map((t=>t.z)));returnt.map(((t,r)=>t.toAffine(e[r])))}staticnormalizeZ(t){returnRa.toAffineBatch(t).map(Ra.fromAffine)}equals(t){if(!(tinstanceofRa))thrownewTypeError("JacobianPoint expected");const{x:e,y:r,z:n}=this,{x:s,y:i,z:o}=t,a=Ja(n**ka),c=Ja(o**ka),l=Ja(e*c),u=Ja(s*a),h=Ja(Ja(r*o)*c),f=Ja(Ja(i*n)*a);returnl===u&&h===f}negate(){returnnewRa(this.x,Ja(-this.y),this.z)}double(){const{x:t,y:e,z:r}=this,n=Ja(t**ka),s=Ja(e**ka),i=Ja(s**ka),o=Ja(ka*(Ja((t+s)**ka)-n-i)),a=Ja(Pa*n),c=Ja(a**ka),l=Ja(c-ka*o),u=Ja(a*(o-l)-Na*i),h=Ja(ka*e*r);returnnewRa(l,u,h)}add(t){if(!(tinstanceofRa))thrownewTypeError("JacobianPoint expected");const{x:e,y:r,z:n}=this,{x:s,y:i,z:o}=t;if(s===Aa||i===Aa)returnthis;if(e===Aa||r===Aa)returnt;consta=Ja(n**ka),c=Ja(o**ka),l=Ja(e*c),u=Ja(s*a),h=Ja(Ja(r*o)*c),f=Ja(Ja(i*n)*a),d=Ja(u-l),p=Ja(f-h);if(d===Aa)returnp===Aa?this.double():Ra.ZERO;constw=Ja(d**ka),g=Ja(d*w),m=Ja(l*w),y=Ja(p**ka-g-ka*m),b=Ja(p*(m-y)-h*g),v=Ja(n*o*d);returnnewRa(y,b,v)}subtract(t){returnthis.add(t.negate())}multiplyUnsafe(t){lete=Ka(t);constr=Ra.ZERO;if(e===Aa)returnr;if(e===Ta)returnthis;if(!Sa){lett=r,n=this;for(;e>Aa;)e&Ta&&(t=t.add(n)),n=n.double(),e>>=Ta;returnt}let{k1neg:n,k1:s,k2neg:i,k2:o}=Qa(e),a=r,c=r,l=this;for(;s>Aa||o>Aa;)s&Ta&&(a=a.add(l)),o&Ta&&(c=c.add(l)),l=l.double(),s>>=Ta,o>>=Ta;returnn&&(a=a.negate()),i&&(c=c.negate()),c=newRa(Ja(c.x*Oa.beta),c.y,c.z),a.add(c)}precomputeWindow(t){conste=Sa?128/t+1:256/t+1,r=[];letn=this,s=n;for(leti=0;i<e;i++){s=n,r.push(s);for(lete=1;e<2**(t-1);e++)s=s.add(n),r.push(s);n=s.double()}returnr}wNAF(t,e){!e&&this.equals(Ra.BASE)&&(e=_a.BASE);constr=e&&e._WINDOW_SIZE||1;if(256%r)thrownewError("Point#wNAF: Invalid precomputation window, must be power of 2");letn=e&&Ba.get(e);n||(n=this.precomputeWindow(r),e&&1!==r&&(n=Ra.normalizeZ(n),Ba.set(e,n)));lets=Ra.ZERO,i=Ra.ZERO;consto=1+(Sa?128/r:256/r),a=2**(r-1),c=BigInt(2**r-1),l=2**r,u=BigInt(r);for(lete=0;e<o;e++){constr=e*a;leto=Number(t&c);if(t>>=u,o>a&&(o-=l,t+=Ta),0===o){lett=n[r];e%2&&(t=t.negate()),i=i.add(t)}else{lett=n[r+Math.abs(o)-1];o<0&&(t=t.negate()),s=s.add(t)}}return{p:s,f:i}}multiply(t,e){letr,n,s=Ka(t);if(Sa){const{k1neg:t,k1:i,k2neg:o,k2:a}=Qa(s);let{p:c,f:l}=this.wNAF(i,e),{p:u,f:h}=this.wNAF(a,e);t&&(c=c.negate()),o&&(u=u.negate()),u=newRa(Ja(u.x*Oa.beta),u.y,u.z),r=c.add(u),n=l.add(h)}else{const{p:t,f:i}=this.wNAF(s,e);r=t,n=i}returnRa.normalizeZ([r,n])[0]}toAffine(t=Xa(this.z)){const{x:e,y:r,z:n}=this,s=t,i=Ja(s*s),o=Ja(i*s),a=Ja(e*i),c=Ja(r*o);if(Ja(n*s)!==Ta)thrownewError("invZ was invalid");returnnew_a(a,c)}}Ra.BASE=newRa(Oa.Gx,Oa.Gy,Ta),Ra.ZERO=newRa(Aa,Ta,Aa);constBa=newWeakMap;class_a{constructor(t,e){this.x=t,this.y=e}_setWindowSize(t){this._WINDOW_SIZE=t,Ba.delete(this)}staticfromCompressedHex(t){conste=32===t.length,r=Ha(e?t:t.subarray(1));if(!rc(r))thrownewError("Point is not on curve");letn=function(t){const{P:e}=Oa,r=BigInt(6),n=BigInt(11),s=BigInt(22),i=BigInt(23),o=BigInt(44),a=BigInt(88),c=t*t*t%e,l=c*c*t%e,u=qa
/*! MIT License. Copyright 2015-2022 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */Ed=newWeakMap;varUd,Ld,Dd,Md=window&&window.__classPrivateFieldSet||function(t,e,r,n,s){if("m"===n)thrownewTypeError("Private method is not writable");if("a"===n&&!s)thrownewTypeError("Private accessor was defined without a setter");if("function"==typeofe?t!==e||!s:!e.has(t))thrownewTypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?s.call(t,r):s?s.value=r:e.set(t,r),r},jd=window&&window.__classPrivateFieldGet||function(t,e,r,n){if("a"===r&&!n)thrownewTypeError("Private accessor was defined without a getter");if("function"==typeofe?t!==e||!n:!e.has(t))thrownewTypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)};constGd={16:10,24:12,32:14},$d=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],zd=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],Wd=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],Hd=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,56397766