@prosopo/account 2.8.86 → 2.8.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build$colon$cjs.log +3 -3
- package/.turbo/turbo-build$colon$tsc.log +7 -7
- package/.turbo/turbo-build.log +4 -4
- package/CHANGELOG.md +59 -0
- package/dist/cjs/workers/cryptoWorker.cjs +1 -1
- package/dist/workers/cryptoWorker.js +1 -1
- package/package.json +11 -11
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/workers/cryptoWorker.ts?worker&inline
|
|
2
|
-
var jsContent = "(function(){function e(e){return e(`return this`)}let t=typeof globalThis<`u`?globalThis:typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:e(Function);function n(e,n){return t[e]===void 0?n:t[e]}let r=n(`TextEncoder`,class{encode(e){let t=e.length,n=new Uint8Array(t);for(let r=0;r<t;r++)n[r]=e.charCodeAt(r);return n}});function i(e){return e(`return this`)}let a=typeof globalThis<`u`?globalThis:typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:i(Function);function o(e,t){return a[e]===void 0?t:a[e]}function s(e){return typeof e==`function`}function c(){return NaN}let l=o(`BigInt`,c),u=`0123456789abcdef`,d=new Uint8Array(256),f=new Uint8Array(256*256);for(let e=0;e<16;e++)d[u[e].charCodeAt(0)|0]=e|0,e>9&&(d[u[e].toUpperCase().charCodeAt(0)|0]=e|0);for(let e=0;e<256;e++){let t=e<<8;for(let n=0;n<256;n++)f[t|n]=d[e]<<4|d[n]}function p(e,t=-1){if(!e)return new Uint8Array;let n=e.startsWith(`0x`)?2:0,r=Math.ceil((e.length-n)/2),i=Math.ceil(t===-1?r:t/8),a=new Uint8Array(i),o=i>r?i-r:0;for(let t=o;t<i;t++,n+=2)a[t]=f[e.charCodeAt(n)<<8|e.charCodeAt(n+1)];return a}let m=/^0x[\\da-fA-F]+$/;function h(e,t=-1,n){return typeof e==`string`&&(e===`0x`||m.test(e))&&(t===-1?n||e.length%2==0:e.length===2+Math.ceil(t/4))}typeof l==`function`&&l.asIntN;let g=typeof a.Buffer==`function`&&typeof a.Buffer.isBuffer==`function`;a.process;function _(e){return g&&!!e&&s(e.readDoubleLE)&&a.Buffer.isBuffer(e)}function v(e){return(e&&e.constructor)===Uint8Array||e instanceof Uint8Array}let y=new r;function b(e){return e?y.encode(e.toString()):new Uint8Array}function x(e,t=!1){if(t&&e==null)throw Error(`u8aToU8a: Expected non-null, non-undefined value`);return v(e)?_(e)?new Uint8Array(e):e:h(e)?p(e):Array.isArray(e)?new Uint8Array(e):b(e)}let S=typeof globalThis==`object`&&`crypto`in globalThis?globalThis.crypto:void 0;\n/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nfunction C(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`}function w(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`positive integer expected, got `+e)}function T(e,...t){if(!C(e))throw Error(`Uint8Array expected`);if(t.length>0&&!t.includes(e.length))throw Error(`Uint8Array expected of length `+t+`, got length=`+e.length)}function ee(e){if(typeof e!=`function`||typeof e.create!=`function`)throw Error(`Hash should be wrapped by utils.createHasher`);w(e.outputLen),w(e.blockLen)}function E(e,t=!0){if(e.destroyed)throw Error(`Hash instance has been destroyed`);if(t&&e.finished)throw Error(`Hash#digest() has already been called`)}function te(e,t){T(e);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least `+n)}function D(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function ne(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function O(e,t){return e<<32-t|e>>>t}let re=typeof Uint8Array.from([]).toHex==`function`&&typeof Uint8Array.fromHex==`function`,ie=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function ae(e){if(T(e),re)return e.toHex();let t=``;for(let n=0;n<e.length;n++)t+=ie[e[n]];return t}let k={_0:48,_9:57,A:65,F:70,a:97,f:102};function oe(e){if(e>=k._0&&e<=k._9)return e-k._0;if(e>=k.A&&e<=k.F)return e-(k.A-10);if(e>=k.a&&e<=k.f)return e-(k.a-10)}function se(e){if(typeof e!=`string`)throw Error(`hex string expected, got `+typeof e);if(re)return Uint8Array.fromHex(e);let t=e.length,n=t/2;if(t%2)throw Error(`hex string expected, got unpadded hex of length `+t);let r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){let n=oe(e.charCodeAt(i)),a=oe(e.charCodeAt(i+1));if(n===void 0||a===void 0){let t=e[i]+e[i+1];throw Error(`hex string expected, got non-hex character \"`+t+`\" at index `+i)}r[t]=n*16+a}return r}function ce(e){if(typeof e!=`string`)throw Error(`string expected`);return new Uint8Array(new TextEncoder().encode(e))}function le(e){return typeof e==`string`&&(e=ce(e)),T(e),e}function ue(e){return typeof e==`string`&&(e=ce(e)),T(e),e}function de(...e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];T(r),t+=r.length}let n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){let i=e[t];n.set(i,r),r+=i.length}return n}function fe(e,t){if(t!==void 0&&{}.toString.call(t)!==`[object Object]`)throw Error(`options should be object or undefined`);return Object.assign(e,t)}var pe=class{};function me(e){let t=t=>e().update(le(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function he(e=32){if(S&&typeof S.getRandomValues==`function`)return S.getRandomValues(new Uint8Array(e));if(S&&typeof S.randomBytes==`function`)return Uint8Array.from(S.randomBytes(e));throw Error(`crypto.getRandomValues must be defined`)}function ge(e,t,n,r){if(typeof e.setBigUint64==`function`)return e.setBigUint64(t,n,r);let i=BigInt(32),a=BigInt(4294967295),o=Number(n>>i&a),s=Number(n&a),c=r?4:0,l=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+l,s,r)}function _e(e,t,n){return e&t^~e&n}function ve(e,t,n){return e&t^e&n^t&n}var ye=class extends pe{constructor(e,t,n,r){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=ne(this.buffer)}update(e){E(this),e=le(e),T(e);let{view:t,buffer:n,blockLen:r}=this,i=e.length;for(let a=0;a<i;){let o=Math.min(r-this.pos,i-a);if(o===r){let t=ne(e);for(;r<=i-a;a+=r)this.process(t,a);continue}n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){E(this),te(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:a}=this;t[a++]=128,D(this.buffer.subarray(a)),this.padOffset>r-a&&(this.process(n,0),a=0);for(let e=a;e<r;e++)t[e]=0;ge(n,r-8,BigInt(this.length*8),i),this.process(n,0);let o=ne(e),s=this.outputLen;if(s%4)throw Error(`_sha2: outputLen should be aligned to 32bit`);let c=s/4,l=this.get();if(c>l.length)throw Error(`_sha2: outputLen bigger than state`);for(let e=0;e<c;e++)o.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:n,length:r,finished:i,destroyed:a,pos:o}=this;return e.destroyed=a,e.finished=i,e.length=r,e.pos=o,r%t&&e.buffer.set(n),e}clone(){return this._cloneInto()}};let A=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),j=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),be=BigInt(2**32-1),xe=BigInt(32);function Se(e,t=!1){return t?{h:Number(e&be),l:Number(e>>xe&be)}:{h:Number(e>>xe&be)|0,l:Number(e&be)|0}}function Ce(e,t=!1){let n=e.length,r=new Uint32Array(n),i=new Uint32Array(n);for(let a=0;a<n;a++){let{h:n,l:o}=Se(e[a],t);[r[a],i[a]]=[n,o]}return[r,i]}let we=(e,t,n)=>e>>>n,Te=(e,t,n)=>e<<32-n|t>>>n,M=(e,t,n)=>e>>>n|t<<32-n,N=(e,t,n)=>e<<32-n|t>>>n,Ee=(e,t,n)=>e<<64-n|t>>>n-32,De=(e,t,n)=>e>>>n-32|t<<64-n;function P(e,t,n,r){let i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:i|0}}let Oe=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),ke=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,Ae=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),je=(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0,Me=(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0),Ne=(e,t,n,r,i,a)=>t+n+r+i+a+(e/2**32|0)|0;function Pe(e){return e(`return this`)}let Fe=(typeof globalThis<`u`?globalThis:typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:Pe(Function)).crypto;function Ie(e){return Fe.getRandomValues(e)}function Le(e=32){return Ie(new Uint8Array(e))}var Re=class extends pe{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,ee(e);let n=le(t);if(this.iHash=e.create(),typeof this.iHash.update!=`function`)throw Error(`Expected instance of class which extends utils.Hash`);this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let r=this.blockLen,i=new Uint8Array(r);i.set(n.length>r?e.create().update(n).digest():n);for(let e=0;e<i.length;e++)i[e]^=54;this.iHash.update(i),this.oHash=e.create();for(let e=0;e<i.length;e++)i[e]^=106;this.oHash.update(i),D(i)}update(e){return E(this),this.iHash.update(e),this}digestInto(e){E(this),T(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||=Object.create(Object.getPrototypeOf(this),{});let{oHash:t,iHash:n,finished:r,destroyed:i,blockLen:a,outputLen:o}=this;return e=e,e.finished=r,e.destroyed=i,e.blockLen=a,e.outputLen=o,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};let ze=(e,t,n)=>new Re(e,t).update(n).digest();ze.create=(e,t)=>new Re(e,t);function Be(e,t,n,r){ee(e);let{c:i,dkLen:a,asyncTick:o}=fe({dkLen:32,asyncTick:10},r);if(w(i),w(a),w(o),i<1)throw Error(`iterations (c) should be >= 1`);let s=ue(t),c=ue(n),l=new Uint8Array(a),u=ze.create(e,s);return{c:i,dkLen:a,asyncTick:o,DK:l,PRF:u,PRFSalt:u._cloneInto().update(c)}}function Ve(e,t,n,r,i){return e.destroy(),t.destroy(),r&&r.destroy(),D(i),n}function He(e,t,n,r){let{c:i,dkLen:a,DK:o,PRF:s,PRFSalt:c}=Be(e,t,n,r),l,u=new Uint8Array(4),d=ne(u),f=new Uint8Array(s.outputLen);for(let e=1,t=0;t<a;e++,t+=s.outputLen){let n=o.subarray(t,t+s.outputLen);d.setInt32(0,e,!1),(l=c._cloneInto(l)).update(u).digestInto(f),n.set(f.subarray(0,n.length));for(let e=1;e<i;e++){s._cloneInto(l).update(f).digestInto(f);for(let e=0;e<n.length;e++)n[e]^=f[e]}}return Ve(s,c,o,l,f)}let Ue=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),F=new Uint32Array(64);var We=class extends ye{constructor(e=32){super(64,e,8,!1),this.A=A[0]|0,this.B=A[1]|0,this.C=A[2]|0,this.D=A[3]|0,this.E=A[4]|0,this.F=A[5]|0,this.G=A[6]|0,this.H=A[7]|0}get(){let{A:e,B:t,C:n,D:r,E:i,F:a,G:o,H:s}=this;return[e,t,n,r,i,a,o,s]}set(e,t,n,r,i,a,o,s){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0,this.F=a|0,this.G=o|0,this.H=s|0}process(e,t){for(let n=0;n<16;n++,t+=4)F[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=F[e-15],n=F[e-2],r=O(t,7)^O(t,18)^t>>>3,i=O(n,17)^O(n,19)^n>>>10;F[e]=i+F[e-7]+r+F[e-16]|0}let{A:n,B:r,C:i,D:a,E:o,F:s,G:c,H:l}=this;for(let e=0;e<64;e++){let t=O(o,6)^O(o,11)^O(o,25),u=l+t+_e(o,s,c)+Ue[e]+F[e]|0,d=(O(n,2)^O(n,13)^O(n,22))+ve(n,r,i)|0;l=c,c=s,s=o,o=a+u|0,a=i,i=r,r=n,n=u+d|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,a=a+this.D|0,o=o+this.E|0,s=s+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,i,a,o,s,c,l)}roundClean(){D(F)}destroy(){this.set(0,0,0,0,0,0,0,0),D(this.buffer)}};let Ge=Ce(`0x428a2f98d728ae22.0x7137449123ef65cd.0xb5c0fbcfec4d3b2f.0xe9b5dba58189dbbc.0x3956c25bf348b538.0x59f111f1b605d019.0x923f82a4af194f9b.0xab1c5ed5da6d8118.0xd807aa98a3030242.0x12835b0145706fbe.0x243185be4ee4b28c.0x550c7dc3d5ffb4e2.0x72be5d74f27b896f.0x80deb1fe3b1696b1.0x9bdc06a725c71235.0xc19bf174cf692694.0xe49b69c19ef14ad2.0xefbe4786384f25e3.0x0fc19dc68b8cd5b5.0x240ca1cc77ac9c65.0x2de92c6f592b0275.0x4a7484aa6ea6e483.0x5cb0a9dcbd41fbd4.0x76f988da831153b5.0x983e5152ee66dfab.0xa831c66d2db43210.0xb00327c898fb213f.0xbf597fc7beef0ee4.0xc6e00bf33da88fc2.0xd5a79147930aa725.0x06ca6351e003826f.0x142929670a0e6e70.0x27b70a8546d22ffc.0x2e1b21385c26c926.0x4d2c6dfc5ac42aed.0x53380d139d95b3df.0x650a73548baf63de.0x766a0abb3c77b2a8.0x81c2c92e47edaee6.0x92722c851482353b.0xa2bfe8a14cf10364.0xa81a664bbc423001.0xc24b8b70d0f89791.0xc76c51a30654be30.0xd192e819d6ef5218.0xd69906245565a910.0xf40e35855771202a.0x106aa07032bbd1b8.0x19a4c116b8d2d0c8.0x1e376c085141ab53.0x2748774cdf8eeb99.0x34b0bcb5e19b48a8.0x391c0cb3c5c95a63.0x4ed8aa4ae3418acb.0x5b9cca4f7763e373.0x682e6ff3d6b2b8a3.0x748f82ee5defb2fc.0x78a5636f43172f60.0x84c87814a1f0ab72.0x8cc702081a6439ec.0x90befffa23631e28.0xa4506cebde82bde9.0xbef9a3f7b2c67915.0xc67178f2e372532b.0xca273eceea26619c.0xd186b8c721c0c207.0xeada7dd6cde0eb1e.0xf57d4f7fee6ed178.0x06f067aa72176fba.0x0a637dc5a2c898a6.0x113f9804bef90dae.0x1b710b35131c471b.0x28db77f523047d84.0x32caab7b40c72493.0x3c9ebe0a15c9bebc.0x431d67c49c100d4c.0x4cc5d4becb3e42b6.0x597f299cfc657e2a.0x5fcb6fab3ad6faec.0x6c44198c4a475817`.split(`.`).map(e=>BigInt(e))),Ke=Ge[0],qe=Ge[1],I=new Uint32Array(80),L=new Uint32Array(80);var Je=class extends ye{constructor(e=64){super(128,e,16,!1),this.Ah=j[0]|0,this.Al=j[1]|0,this.Bh=j[2]|0,this.Bl=j[3]|0,this.Ch=j[4]|0,this.Cl=j[5]|0,this.Dh=j[6]|0,this.Dl=j[7]|0,this.Eh=j[8]|0,this.El=j[9]|0,this.Fh=j[10]|0,this.Fl=j[11]|0,this.Gh=j[12]|0,this.Gl=j[13]|0,this.Hh=j[14]|0,this.Hl=j[15]|0}get(){let{Ah:e,Al:t,Bh:n,Bl:r,Ch:i,Cl:a,Dh:o,Dl:s,Eh:c,El:l,Fh:u,Fl:d,Gh:f,Gl:p,Hh:m,Hl:h}=this;return[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h]}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=r|0,this.Ch=i|0,this.Cl=a|0,this.Dh=o|0,this.Dl=s|0,this.Eh=c|0,this.El=l|0,this.Fh=u|0,this.Fl=d|0,this.Gh=f|0,this.Gl=p|0,this.Hh=m|0,this.Hl=h|0}process(e,t){for(let n=0;n<16;n++,t+=4)I[n]=e.getUint32(t),L[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=I[e-15]|0,n=L[e-15]|0,r=M(t,n,1)^M(t,n,8)^we(t,n,7),i=N(t,n,1)^N(t,n,8)^Te(t,n,7),a=I[e-2]|0,o=L[e-2]|0,s=M(a,o,19)^Ee(a,o,61)^we(a,o,6),c=N(a,o,19)^De(a,o,61)^Te(a,o,6),l=Ae(i,c,L[e-7],L[e-16]),u=je(l,r,s,I[e-7],I[e-16]);I[e]=u|0,L[e]=l|0}let{Ah:n,Al:r,Bh:i,Bl:a,Ch:o,Cl:s,Dh:c,Dl:l,Eh:u,El:d,Fh:f,Fl:p,Gh:m,Gl:h,Hh:g,Hl:_}=this;for(let e=0;e<80;e++){let t=M(u,d,14)^M(u,d,18)^Ee(u,d,41),v=N(u,d,14)^N(u,d,18)^De(u,d,41),y=u&f^~u&m,b=d&p^~d&h,x=Me(_,v,b,qe[e],L[e]),S=Ne(x,g,t,y,Ke[e],I[e]),C=x|0,w=M(n,r,28)^Ee(n,r,34)^Ee(n,r,39),T=N(n,r,28)^De(n,r,34)^De(n,r,39),ee=n&i^n&o^i&o,E=r&a^r&s^a&s;g=m|0,_=h|0,m=f|0,h=p|0,f=u|0,p=d|0,{h:u,l:d}=P(c|0,l|0,S|0,C|0),c=o|0,l=s|0,o=i|0,s=a|0,i=n|0,a=r|0;let te=Oe(C,T,E);n=ke(te,S,w,ee),r=te|0}({h:n,l:r}=P(this.Ah|0,this.Al|0,n|0,r|0)),{h:i,l:a}=P(this.Bh|0,this.Bl|0,i|0,a|0),{h:o,l:s}=P(this.Ch|0,this.Cl|0,o|0,s|0),{h:c,l}=P(this.Dh|0,this.Dl|0,c|0,l|0),{h:u,l:d}=P(this.Eh|0,this.El|0,u|0,d|0),{h:f,l:p}=P(this.Fh|0,this.Fl|0,f|0,p|0),{h:m,l:h}=P(this.Gh|0,this.Gl|0,m|0,h|0),{h:g,l:_}=P(this.Hh|0,this.Hl|0,g|0,_|0),this.set(n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_)}roundClean(){D(I,L)}destroy(){D(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};let Ye=me(()=>new We),Xe=me(()=>new Je),Ze=BigInt(0),Qe=BigInt(1)\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n;function $e(e,t){if(typeof t!=`boolean`)throw Error(e+` boolean expected, got `+t)}function et(e){if(typeof e!=`string`)throw Error(`hex string expected, got `+typeof e);return e===``?Ze:BigInt(`0x`+e)}function tt(e){return et(ae(e))}function R(e){return T(e),et(ae(Uint8Array.from(e).reverse()))}function nt(e,t){return se(e.toString(16).padStart(t*2,`0`))}function z(e,t){return nt(e,t).reverse()}function B(e,t,n){let r;if(typeof t==`string`)try{r=se(t)}catch(t){throw Error(e+` must be hex string or Uint8Array, cause: `+t)}else if(C(t))r=Uint8Array.from(t);else throw Error(e+` must be hex string or Uint8Array`);let i=r.length;if(typeof n==`number`&&i!==n)throw Error(e+` of length `+n+` expected, got `+i);return r}function rt(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return n===0}let it=e=>typeof e==`bigint`&&Ze<=e;function at(e,t,n){return it(e)&&it(t)&&it(n)&&t<=e&&e<n}function V(e,t,n,r){if(!at(t,n,r))throw Error(`expected valid `+e+`: `+n+` <= n < `+r+`, got `+t)}function ot(e){let t;for(t=0;e>Ze;e>>=Qe,t+=1);return t}let st=e=>(Qe<<BigInt(e))-Qe;function ct(e,t,n={}){if(!e||typeof e!=`object`)throw Error(`expected valid options object`);function r(t,n,r){let i=e[t];if(r&&i===void 0)return;let a=typeof i;if(a!==n||i===null)throw Error(`param \"${t}\" is invalid: expected ${n}, got ${a}`)}Object.entries(t).forEach(([e,t])=>r(e,t,!1)),Object.entries(n).forEach(([e,t])=>r(e,t,!0))}function lt(e){let t=new WeakMap;return(n,...r)=>{let i=t.get(n);if(i!==void 0)return i;let a=e(n,...r);return t.set(n,a),a}}\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nlet H=BigInt(0),U=BigInt(1),W=BigInt(2),ut=BigInt(3),dt=BigInt(4),ft=BigInt(5),pt=BigInt(8);function G(e,t){let n=e%t;return n>=H?n:t+n}function K(e,t,n){let r=e;for(;t-->H;)r*=r,r%=n;return r}function mt(e,t){if(e===H)throw Error(`invert: expected non-zero number`);if(t<=H)throw Error(`invert: expected positive modulus, got `+t);let n=G(e,t),r=t,i=H,a=U,o=U,s=H;for(;n!==H;){let e=r/n,t=r%n,c=i-o*e,l=a-s*e;r=n,n=t,i=o,a=s,o=c,s=l}if(r!==U)throw Error(`invert: does not exist`);return G(i,t)}function ht(e,t){let n=(e.ORDER+U)/dt,r=e.pow(t,n);if(!e.eql(e.sqr(r),t))throw Error(`Cannot find square root`);return r}function gt(e,t){let n=(e.ORDER-ft)/pt,r=e.mul(t,W),i=e.pow(r,n),a=e.mul(t,i),o=e.mul(e.mul(a,W),i),s=e.mul(a,e.sub(o,e.ONE));if(!e.eql(e.sqr(s),t))throw Error(`Cannot find square root`);return s}function _t(e){if(e<BigInt(3))throw Error(`sqrt is not defined for small field`);let t=e-U,n=0;for(;t%W===H;)t/=W,n++;let r=W,i=Tt(e);for(;Ct(i,r)===1;)if(r++>1e3)throw Error(`Cannot find square root: probably non-prime P`);if(n===1)return ht;let a=i.pow(r,t),o=(t+U)/W;return function(e,r){if(e.is0(r))return r;if(Ct(e,r)!==1)throw Error(`Cannot find square root`);let i=n,s=e.mul(e.ONE,a),c=e.pow(r,t),l=e.pow(r,o);for(;!e.eql(c,e.ONE);){if(e.is0(c))return e.ZERO;let t=1,n=e.sqr(c);for(;!e.eql(n,e.ONE);)if(t++,n=e.sqr(n),t===i)throw Error(`Cannot find square root`);let r=U<<BigInt(i-t-1),a=e.pow(s,r);i=t,s=e.sqr(a),c=e.mul(c,s),l=e.mul(l,a)}return l}}function vt(e){return e%dt===ut?ht:e%pt===ft?gt:_t(e)}let q=(e,t)=>(G(e,t)&U)===U,yt=[`create`,`isValid`,`is0`,`neg`,`inv`,`sqrt`,`sqr`,`eql`,`add`,`sub`,`mul`,`pow`,`div`,`addN`,`subN`,`mulN`,`sqrN`];function bt(e){return ct(e,yt.reduce((e,t)=>(e[t]=`function`,e),{ORDER:`bigint`,MASK:`bigint`,BYTES:`number`,BITS:`number`})),e}function xt(e,t,n){if(n<H)throw Error(`invalid exponent, negatives unsupported`);if(n===H)return e.ONE;if(n===U)return t;let r=e.ONE,i=t;for(;n>H;)n&U&&(r=e.mul(r,i)),i=e.sqr(i),n>>=U;return r}function St(e,t,n=!1){let r=Array(t.length).fill(n?e.ZERO:void 0),i=t.reduce((t,n,i)=>e.is0(n)?t:(r[i]=t,e.mul(t,n)),e.ONE),a=e.inv(i);return t.reduceRight((t,n,i)=>e.is0(n)?t:(r[i]=e.mul(t,r[i]),e.mul(t,n)),a),r}function Ct(e,t){let n=(e.ORDER-U)/W,r=e.pow(t,n),i=e.eql(r,e.ONE),a=e.eql(r,e.ZERO),o=e.eql(r,e.neg(e.ONE));if(!i&&!a&&!o)throw Error(`invalid Legendre symbol result`);return i?1:a?0:-1}function wt(e,t){t!==void 0&&w(t);let n=t===void 0?e.toString(2).length:t;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function Tt(e,t,n=!1,r={}){if(e<=H)throw Error(`invalid field: expected ORDER > 0, got `+e);let i,a;if(typeof t==`object`&&t){if(r.sqrt||n)throw Error(`cannot specify opts in two arguments`);let e=t;e.BITS&&(i=e.BITS),e.sqrt&&(a=e.sqrt),typeof e.isLE==`boolean`&&(n=e.isLE)}else typeof t==`number`&&(i=t),r.sqrt&&(a=r.sqrt);let{nBitLength:o,nByteLength:s}=wt(e,i);if(s>2048)throw Error(`invalid field: expected ORDER of <= 2048 bytes`);let c,l=Object.freeze({ORDER:e,isLE:n,BITS:o,BYTES:s,MASK:st(o),ZERO:H,ONE:U,create:t=>G(t,e),isValid:t=>{if(typeof t!=`bigint`)throw Error(`invalid field element: expected bigint, got `+typeof t);return H<=t&&t<e},is0:e=>e===H,isValidNot0:e=>!l.is0(e)&&l.isValid(e),isOdd:e=>(e&U)===U,neg:t=>G(-t,e),eql:(e,t)=>e===t,sqr:t=>G(t*t,e),add:(t,n)=>G(t+n,e),sub:(t,n)=>G(t-n,e),mul:(t,n)=>G(t*n,e),pow:(e,t)=>xt(l,e,t),div:(t,n)=>G(t*mt(n,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>mt(t,e),sqrt:a||(t=>(c||=vt(e),c(l,t))),toBytes:e=>n?z(e,s):nt(e,s),fromBytes:e=>{if(e.length!==s)throw Error(`Field.fromBytes: expected `+s+` bytes, got `+e.length);return n?R(e):tt(e)},invertBatch:e=>St(l,e),cmov:(e,t,n)=>n?t:e});return Object.freeze(l)}\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nlet Et=BigInt(0),Dt=BigInt(1);function Ot(e,t){let n=t.negate();return e?n:t}function kt(e,t,n){let r=t===`pz`?e=>e.pz:e=>e.ez,i=St(e.Fp,n.map(r));return n.map((e,t)=>e.toAffine(i[t])).map(e.fromAffine)}function At(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw Error(`invalid window size, expected [1..`+t+`], got W=`+e)}function jt(e,t){At(e,t);let n=Math.ceil(t/e)+1,r=2**(e-1),i=2**e;return{windows:n,windowSize:r,mask:st(e),maxNumber:i,shiftBy:BigInt(e)}}function Mt(e,t,n){let{windowSize:r,mask:i,maxNumber:a,shiftBy:o}=n,s=Number(e&i),c=e>>o;s>r&&(s-=a,c+=Dt);let l=t*r,u=l+Math.abs(s)-1,d=s===0,f=s<0,p=t%2!=0;return{nextN:c,offset:u,isZero:d,isNeg:f,isNegF:p,offsetF:l}}function Nt(e,t){if(!Array.isArray(e))throw Error(`array expected`);e.forEach((e,n)=>{if(!(e instanceof t))throw Error(`invalid point at index `+n)})}function Pt(e,t){if(!Array.isArray(e))throw Error(`array of scalars expected`);e.forEach((e,n)=>{if(!t.isValid(e))throw Error(`invalid scalar at index `+n)})}let Ft=new WeakMap,It=new WeakMap;function Lt(e){return It.get(e)||1}function Rt(e){if(e!==Et)throw Error(`invalid wNAF`)}function zt(e,t){return{constTimeNegate:Ot,hasPrecomputes(e){return Lt(e)!==1},unsafeLadder(t,n,r=e.ZERO){let i=t;for(;n>Et;)n&Dt&&(r=r.add(i)),i=i.double(),n>>=Dt;return r},precomputeWindow(e,n){let{windows:r,windowSize:i}=jt(n,t),a=[],o=e,s=o;for(let e=0;e<r;e++){s=o,a.push(s);for(let e=1;e<i;e++)s=s.add(o),a.push(s);o=s.double()}return a},wNAF(n,r,i){let a=e.ZERO,o=e.BASE,s=jt(n,t);for(let e=0;e<s.windows;e++){let{nextN:t,offset:n,isZero:c,isNeg:l,isNegF:u,offsetF:d}=Mt(i,e,s);i=t,c?o=o.add(Ot(u,r[d])):a=a.add(Ot(l,r[n]))}return Rt(i),{p:a,f:o}},wNAFUnsafe(n,r,i,a=e.ZERO){let o=jt(n,t);for(let e=0;e<o.windows&&i!==Et;e++){let{nextN:t,offset:n,isZero:s,isNeg:c}=Mt(i,e,o);if(i=t,!s){let e=r[n];a=a.add(c?e.negate():e)}}return Rt(i),a},getPrecomputes(e,t,n){let r=Ft.get(t);return r||(r=this.precomputeWindow(t,e),e!==1&&(typeof n==`function`&&(r=n(r)),Ft.set(t,r))),r},wNAFCached(e,t,n){let r=Lt(e);return this.wNAF(r,this.getPrecomputes(r,e,n),t)},wNAFCachedUnsafe(e,t,n,r){let i=Lt(e);return i===1?this.unsafeLadder(e,t,r):this.wNAFUnsafe(i,this.getPrecomputes(i,e,n),t,r)},setWindowSize(e,n){At(n,t),It.set(e,n),Ft.delete(e)}}}function Bt(e,t,n,r){Nt(n,e),Pt(r,t);let i=n.length,a=r.length;if(i!==a)throw Error(`arrays of points and scalars must have equal length`);let o=e.ZERO,s=ot(BigInt(i)),c=1;s>12?c=s-3:s>4?c=s-2:s>0&&(c=2);let l=st(c),u=Array(Number(l)+1).fill(o),d=Math.floor((t.BITS-1)/c)*c,f=o;for(let e=d;e>=0;e-=c){u.fill(o);for(let t=0;t<a;t++){let i=r[t],a=Number(i>>BigInt(e)&l);u[a]=u[a].add(n[t])}let t=o;for(let e=u.length-1,n=o;e>0;e--)n=n.add(u[e]),t=t.add(n);if(f=f.add(t),e!==0)for(let e=0;e<c;e++)f=f.double()}return f}function Vt(e,t){if(t){if(t.ORDER!==e)throw Error(`Field.ORDER must match order: Fp == p, Fn == n`);return bt(t),t}else return Tt(e)}function Ht(e,t,n={}){if(!t||typeof t!=`object`)throw Error(`expected valid ${e} CURVE object`);for(let e of[`p`,`n`,`h`]){let n=t[e];if(!(typeof n==`bigint`&&n>Et))throw Error(`CURVE.${e} must be positive bigint`)}let r=Vt(t.p,n.Fp),i=Vt(t.n,n.Fn),a=[`Gx`,`Gy`,`a`,e===`weierstrass`?`b`:`d`];for(let e of a)if(!r.isValid(t[e]))throw Error(`CURVE.${e} must be valid field element of CURVE.Fp`);return{Fp:r,Fn:i}}\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nlet J=BigInt(0),Y=BigInt(1),Ut=BigInt(2),Wt=BigInt(8),Gt={zip215:!0};function Kt(e,t,n,r){let i=e.sqr(n),a=e.sqr(r),o=e.add(e.mul(t.a,i),a),s=e.add(e.ONE,e.mul(t.d,e.mul(i,a)));return e.eql(o,s)}function qt(e,t={}){let{Fp:n,Fn:r}=Ht(`edwards`,e,t),{h:i,n:a}=e;ct(t,{},{uvRatio:`function`});let o=Ut<<BigInt(r.BYTES*8)-Y,s=e=>n.create(e),c=t.uvRatio||((e,t)=>{try{return{isValid:!0,value:n.sqrt(n.div(e,t))}}catch{return{isValid:!1,value:J}}});if(!Kt(n,e,e.Gx,e.Gy))throw Error(`bad curve params: generator point`);function l(e,t,n=!1){let r=n?Y:J;return V(`coordinate `+e,t,r,o),t}function u(e){if(!(e instanceof p))throw Error(`ExtendedPoint expected`)}let d=lt((e,t)=>{let{ex:r,ey:i,ez:a}=e,o=e.is0();t??=o?Wt:n.inv(a);let c=s(r*t),l=s(i*t),u=s(a*t);if(o)return{x:J,y:Y};if(u!==Y)throw Error(`invZ was invalid`);return{x:c,y:l}}),f=lt(t=>{let{a:n,d:r}=e;if(t.is0())throw Error(`bad point: ZERO`);let{ex:i,ey:a,ez:o,et:c}=t,l=s(i*i),u=s(a*a),d=s(o*o),f=s(d*d),p=s(l*n);if(s(d*s(p+u))!==s(f+s(r*s(l*u))))throw Error(`bad point: equation left != right (1)`);if(s(i*a)!==s(o*c))throw Error(`bad point: equation left != right (2)`);return!0});class p{constructor(e,t,n,r){this.ex=l(`x`,e),this.ey=l(`y`,t),this.ez=l(`z`,n,!0),this.et=l(`t`,r),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(e){if(e instanceof p)throw Error(`extended point not allowed`);let{x:t,y:n}=e||{};return l(`x`,t),l(`y`,n),new p(t,n,Y,s(t*n))}static normalizeZ(e){return kt(p,`ez`,e)}static msm(e,t){return Bt(p,r,e,t)}_setWindowSize(e){this.precompute(e)}precompute(e=8,t=!0){return m.setWindowSize(this,e),t||this.multiply(Ut),this}assertValidity(){f(this)}equals(e){u(e);let{ex:t,ey:n,ez:r}=this,{ex:i,ey:a,ez:o}=e,c=s(t*o),l=s(i*r),d=s(n*o),f=s(a*r);return c===l&&d===f}is0(){return this.equals(p.ZERO)}negate(){return new p(s(-this.ex),this.ey,this.ez,s(-this.et))}double(){let{a:t}=e,{ex:n,ey:r,ez:i}=this,a=s(n*n),o=s(r*r),c=s(Ut*s(i*i)),l=s(t*a),u=n+r,d=s(s(u*u)-a-o),f=l+o,m=f-c,h=l-o,g=s(d*m),_=s(f*h),v=s(d*h),y=s(m*f);return new p(g,_,y,v)}add(t){u(t);let{a:n,d:r}=e,{ex:i,ey:a,ez:o,et:c}=this,{ex:l,ey:d,ez:f,et:m}=t,h=s(i*l),g=s(a*d),_=s(c*r*m),v=s(o*f),y=s((i+a)*(l+d)-h-g),b=v-_,x=v+_,S=s(g-n*h),C=s(y*b),w=s(x*S),T=s(y*S),ee=s(b*x);return new p(C,w,ee,T)}subtract(e){return this.add(e.negate())}multiply(e){let t=e;V(`scalar`,t,Y,a);let{p:n,f:r}=m.wNAFCached(this,t,p.normalizeZ);return p.normalizeZ([n,r])[0]}multiplyUnsafe(e,t=p.ZERO){let n=e;return V(`scalar`,n,J,a),n===J?p.ZERO:this.is0()||n===Y?this:m.wNAFCachedUnsafe(this,n,p.normalizeZ,t)}isSmallOrder(){return this.multiplyUnsafe(i).is0()}isTorsionFree(){return m.wNAFCachedUnsafe(this,a).is0()}toAffine(e){return d(this,e)}clearCofactor(){return i===Y?this:this.multiplyUnsafe(i)}static fromBytes(e,t=!1){return T(e),this.fromHex(e,t)}static fromHex(t,r=!1){let{d:i,a}=e,l=n.BYTES;t=B(`pointHex`,t,l),$e(`zip215`,r);let u=t.slice(),d=t[l-1];u[l-1]=d&-129;let f=R(u),m=r?o:n.ORDER;V(`pointHex.y`,f,J,m);let h=s(f*f),g=s(h-Y),_=s(i*h-a),{isValid:v,value:y}=c(g,_);if(!v)throw Error(`Point.fromHex: invalid y coordinate`);let b=(y&Y)===Y,x=(d&128)!=0;if(!r&&y===J&&x)throw Error(`Point.fromHex: x=0 and x_0=1`);return x!==b&&(y=s(-y)),p.fromAffine({x:y,y:f})}static fromPrivateScalar(e){return p.BASE.multiply(e)}toBytes(){let{x:e,y:t}=this.toAffine(),r=z(t,n.BYTES);return r[r.length-1]|=e&Y?128:0,r}toRawBytes(){return this.toBytes()}toHex(){return ae(this.toBytes())}toString(){return`<Point ${this.is0()?`ZERO`:this.toHex()}>`}}p.BASE=new p(e.Gx,e.Gy,Y,s(e.Gx*e.Gy)),p.ZERO=new p(J,Y,Y,J),p.Fp=n,p.Fn=r;let m=zt(p,r.BYTES*8);return p}function Jt(e,t){ct(t,{hash:`function`},{adjustScalarBytes:`function`,randomBytes:`function`,domain:`function`,prehash:`function`,mapToCurve:`function`});let{prehash:n,hash:r}=t,{BASE:i,Fp:a,Fn:o}=e,s=o.ORDER,c=t.randomBytes||he,l=t.adjustScalarBytes||(e=>e),u=t.domain||((e,t,n)=>{if($e(`phflag`,n),t.length||n)throw Error(`Contexts/pre-hash are not supported`);return e});function d(e){return o.create(e)}function f(e){return d(R(e))}function p(e){let t=a.BYTES;e=B(`private key`,e,t);let n=B(`hashed private key`,r(e),2*t),i=l(n.slice(0,t));return{head:i,prefix:n.slice(t,2*t),scalar:f(i)}}function m(e){let{head:t,prefix:n,scalar:r}=p(e),a=i.multiply(r);return{head:t,prefix:n,scalar:r,point:a,pointBytes:a.toBytes()}}function h(e){return m(e).pointBytes}function g(e=Uint8Array.of(),...t){let i=de(...t);return f(r(u(i,B(`context`,e),!!n)))}function _(e,t,r={}){e=B(`message`,e),n&&(e=n(e));let{prefix:o,scalar:c,pointBytes:l}=m(t),u=g(r.context,o,e),f=i.multiply(u).toBytes(),p=d(u+g(r.context,f,l,e)*c);V(`signature.s`,p,J,s);let h=a.BYTES;return B(`result`,de(f,z(p,h)),h*2)}let v=Gt;function y(t,r,o,s=v){let{context:c,zip215:l}=s,u=a.BYTES;t=B(`signature`,t,2*u),r=B(`message`,r),o=B(`publicKey`,o,u),l!==void 0&&$e(`zip215`,l),n&&(r=n(r));let d=R(t.slice(u,2*u)),f,p,m;try{f=e.fromHex(o,l),p=e.fromHex(t.slice(0,u),l),m=i.multiplyUnsafe(d)}catch{return!1}if(!l&&f.isSmallOrder())return!1;let h=g(c,p.toBytes(),f.toBytes(),r);return p.add(f.multiplyUnsafe(h)).subtract(m).clearCofactor().is0()}return i.precompute(8),{getPublicKey:h,sign:_,verify:y,utils:{getExtendedPublicKey:m,randomPrivateKey:()=>c(a.BYTES),precompute(t=8,n=e.BASE){return n.precompute(t,!1)}},Point:e}}function Yt(e){let t={a:e.a,d:e.d,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy};return{CURVE:t,curveOpts:{Fp:e.Fp,Fn:Tt(t.n,e.nBitLength,!0),uvRatio:e.uvRatio},eddsaOpts:{hash:e.hash,randomBytes:e.randomBytes,adjustScalarBytes:e.adjustScalarBytes,domain:e.domain,prehash:e.prehash,mapToCurve:e.mapToCurve}}}function Xt(e,t){return Object.assign({},t,{ExtendedPoint:t.Point,CURVE:e})}function Zt(e){let{CURVE:t,curveOpts:n,eddsaOpts:r}=Yt(e);return Xt(e,Jt(qt(t,n),r))}\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nlet Qt=BigInt(0),X=BigInt(1),$t=BigInt(2),en=BigInt(5),tn={p:BigInt(`0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed`),n:BigInt(`0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed`),h:BigInt(8),a:BigInt(`0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec`),d:BigInt(`0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3`),Gx:BigInt(`0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a`),Gy:BigInt(`0x6666666666666666666666666666666666666666666666666666666666666658`)};function nn(e){let t=BigInt(10),n=BigInt(20),r=BigInt(40),i=BigInt(80),a=tn.p,o=e*e%a*e%a,s=K(K(o,$t,a)*o%a,X,a)*e%a,c=K(s,en,a)*s%a,l=K(c,t,a)*c%a,u=K(l,n,a)*l%a,d=K(u,r,a)*u%a;return{pow_p_5_8:K(K(K(K(d,i,a)*d%a,i,a)*d%a,t,a)*c%a,$t,a)*e%a,b2:o}}function rn(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}let an=BigInt(`19681161376707505956807079304988542015446066515923890162744021073123829784752`);function on(e,t){let n=tn.p,r=G(t*t*t,n),i=nn(e*G(r*r*t,n)).pow_p_5_8,a=G(e*r*i,n),o=G(t*a*a,n),s=a,c=G(a*an,n),l=o===e,u=o===G(-e,n),d=o===G(-e*an,n);return l&&(a=s),(u||d)&&(a=c),q(a,n)&&(a=G(-a,n)),{isValid:l||u,value:a}}let Z=Tt(tn.p,void 0,!0),Q=Zt({...tn,Fp:Z,hash:Xe,adjustScalarBytes:rn,uvRatio:on});function sn(e){if(!(e instanceof $))throw Error(`RistrettoPoint expected`)}let cn=an,ln=BigInt(`25063068953384623474111414158702152701244531502492656460079210482610430750235`),un=BigInt(`54469307008909316920995813868745141605393597292927456921205312896311721017578`),dn=BigInt(`1159843021668779879193775521855586647937357759715417654439879720876111806838`),fn=BigInt(`40440834346308536858101042469323190826248399146238708352240133220865137265952`),pn=e=>on(X,e),mn=BigInt(`0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff`),hn=e=>Q.CURVE.Fp.create(R(e)&mn);function gn(e){let{d:t}=Q.CURVE,n=Q.CURVE.Fp.ORDER,r=Q.CURVE.Fp.create,i=r(cn*e*e),a=r((i+X)*dn),o=BigInt(-1),s=r((o-t*i)*r(i+t)),{isValid:c,value:l}=on(a,s),u=r(l*e);q(u,n)||(u=r(-u)),c||(l=u),c||(o=i);let d=r(o*(i-X)*fn-s),f=l*l,p=r((l+l)*s),m=r(d*ln),h=r(X-f),g=r(X+f);return new Q.Point(r(p*g),r(h*m),r(m*g),r(p*h))}var $=class e{constructor(e){this.ep=e}static fromAffine(t){return new e(Q.Point.fromAffine(t))}static hashToCurve(t){t=B(`ristrettoHash`,t,64);let n=gn(hn(t.slice(0,32))),r=gn(hn(t.slice(32,64)));return new e(n.add(r))}static fromBytes(e){return T(e),this.fromHex(e)}static fromHex(t){t=B(`ristrettoHex`,t,32);let{a:n,d:r}=Q.CURVE,i=Z.ORDER,a=Z.create,o=`RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint`,s=hn(t);if(!rt(z(s,32),t)||q(s,i))throw Error(o);let c=a(s*s),l=a(X+n*c),u=a(X-n*c),d=a(l*l),f=a(u*u),p=a(n*r*d-f),{isValid:m,value:h}=pn(a(p*f)),g=a(h*u),_=a(h*g*p),v=a((s+s)*g);q(v,i)&&(v=a(-v));let y=a(l*_),b=a(v*y);if(!m||q(b,i)||y===Qt)throw Error(o);return new e(new Q.Point(v,y,X,b))}static msm(t,n){let r=Tt(Q.CURVE.n,Q.CURVE.nBitLength);return Bt(e,r,t,n)}toBytes(){let{ex:e,ey:t,ez:n,et:r}=this.ep,i=Z.ORDER,a=Z.create,o=a(a(n+t)*a(n-t)),s=a(e*t),c=a(s*s),{value:l}=pn(a(o*c)),u=a(l*o),d=a(l*s),f=a(u*d*r),p;if(q(r*f,i)){let n=a(t*cn),r=a(e*cn);e=n,t=r,p=a(u*un)}else p=d;q(e*f,i)&&(t=a(-t));let m=a((n-t)*p);return q(m,i)&&(m=a(-m)),z(m,32)}toRawBytes(){return this.toBytes()}toHex(){return ae(this.toBytes())}toString(){return this.toHex()}equals(e){sn(e);let{ex:t,ey:n}=this.ep,{ex:r,ey:i}=e.ep,a=Z.create,o=a(t*i)===a(n*r),s=a(n*i)===a(t*r);return o||s}add(t){return sn(t),new e(this.ep.add(t.ep))}subtract(t){return sn(t),new e(this.ep.subtract(t.ep))}multiply(t){return new e(this.ep.multiply(t))}multiplyUnsafe(t){return new e(this.ep.multiplyUnsafe(t))}double(){return new e(this.ep.double())}negate(){return new e(this.ep.negate())}};let _n=($.BASE||=new $(Q.Point.BASE),$.ZERO||=new $(Q.Point.ZERO),$),vn=Xe,yn=BigInt(3);function bn(e,t,...n){if(!C(t))throw Error(`${e}: Uint8Array expected`);if(n.length&&!n.includes(t.length))throw Error(`${e}: Uint8Array expected of length ${n}, not of length=${t.length}`)}function xn(...e){for(let t of e)t.fill(0)}Q.CURVE.n;let Sn=st(256),Cn=e=>z(e<<yn&Sn,32),wn=e=>R(e)>>yn;function Tn(e){bn(`seed`,e,32);let t=vn(e);t[0]&=248,t[31]&=63,t[31]|=64;let n=Cn(wn(t.subarray(0,32))),r=t.subarray(32,64),i=de(n,r);return xn(n,r,t),i}ce(`substrate`);function En(e,t=Le(),n=2048,r){return{password:He(vn,x(e),x(t),{c:n,dkLen:64}),rounds:n,salt:t}}var Dn={256:Ye,512:vn},On=Dn[256];Dn[512];var kn=`abandon|ability|able|about|above|absent|absorb|abstract|absurd|abuse|access|accident|account|accuse|achieve|acid|acoustic|acquire|across|act|action|actor|actress|actual|adapt|add|addict|address|adjust|admit|adult|advance|advice|aerobic|affair|afford|afraid|again|age|agent|agree|ahead|aim|air|airport|aisle|alarm|album|alcohol|alert|alien|all|alley|allow|almost|alone|alpha|already|also|alter|always|amateur|amazing|among|amount|amused|analyst|anchor|ancient|anger|angle|angry|animal|ankle|announce|annual|another|answer|antenna|antique|anxiety|any|apart|apology|appear|apple|approve|april|arch|arctic|area|arena|argue|arm|armed|armor|army|around|arrange|arrest|arrive|arrow|art|artefact|artist|artwork|ask|aspect|assault|asset|assist|assume|asthma|athlete|atom|attack|attend|attitude|attract|auction|audit|august|aunt|author|auto|autumn|average|avocado|avoid|awake|aware|away|awesome|awful|awkward|axis|baby|bachelor|bacon|badge|bag|balance|balcony|ball|bamboo|banana|banner|bar|barely|bargain|barrel|base|basic|basket|battle|beach|bean|beauty|because|become|beef|before|begin|behave|behind|believe|below|belt|bench|benefit|best|betray|better|between|beyond|bicycle|bid|bike|bind|biology|bird|birth|bitter|black|blade|blame|blanket|blast|bleak|bless|blind|blood|blossom|blouse|blue|blur|blush|board|boat|body|boil|bomb|bone|bonus|book|boost|border|boring|borrow|boss|bottom|bounce|box|boy|bracket|brain|brand|brass|brave|bread|breeze|brick|bridge|brief|bright|bring|brisk|broccoli|broken|bronze|broom|brother|brown|brush|bubble|buddy|budget|buffalo|build|bulb|bulk|bullet|bundle|bunker|burden|burger|burst|bus|business|busy|butter|buyer|buzz|cabbage|cabin|cable|cactus|cage|cake|call|calm|camera|camp|can|canal|cancel|candy|cannon|canoe|canvas|canyon|capable|capital|captain|car|carbon|card|cargo|carpet|carry|cart|case|cash|casino|castle|casual|cat|catalog|catch|category|cattle|caught|cause|caution|cave|ceiling|celery|cement|census|century|cereal|certain|chair|chalk|champion|change|chaos|chapter|charge|chase|chat|cheap|check|cheese|chef|cherry|chest|chicken|chief|child|chimney|choice|choose|chronic|chuckle|chunk|churn|cigar|cinnamon|circle|citizen|city|civil|claim|clap|clarify|claw|clay|clean|clerk|clever|click|client|cliff|climb|clinic|clip|clock|clog|close|cloth|cloud|clown|club|clump|cluster|clutch|coach|coast|coconut|code|coffee|coil|coin|collect|color|column|combine|come|comfort|comic|common|company|concert|conduct|confirm|congress|connect|consider|control|convince|cook|cool|copper|copy|coral|core|corn|correct|cost|cotton|couch|country|couple|course|cousin|cover|coyote|crack|cradle|craft|cram|crane|crash|crater|crawl|crazy|cream|credit|creek|crew|cricket|crime|crisp|critic|crop|cross|crouch|crowd|crucial|cruel|cruise|crumble|crunch|crush|cry|crystal|cube|culture|cup|cupboard|curious|current|curtain|curve|cushion|custom|cute|cycle|dad|damage|damp|dance|danger|daring|dash|daughter|dawn|day|deal|debate|debris|decade|december|decide|decline|decorate|decrease|deer|defense|define|defy|degree|delay|deliver|demand|demise|denial|dentist|deny|depart|depend|deposit|depth|deputy|derive|describe|desert|design|desk|despair|destroy|detail|detect|develop|device|devote|diagram|dial|diamond|diary|dice|diesel|diet|differ|digital|dignity|dilemma|dinner|dinosaur|direct|dirt|disagree|discover|disease|dish|dismiss|disorder|display|distance|divert|divide|divorce|dizzy|doctor|document|dog|doll|dolphin|domain|donate|donkey|donor|door|dose|double|dove|draft|dragon|drama|drastic|draw|dream|dress|drift|drill|drink|drip|drive|drop|drum|dry|duck|dumb|dune|during|dust|dutch|duty|dwarf|dynamic|eager|eagle|early|earn|earth|easily|east|easy|echo|ecology|economy|edge|edit|educate|effort|egg|eight|either|elbow|elder|electric|elegant|element|elephant|elevator|elite|else|embark|embody|embrace|emerge|emotion|employ|empower|empty|enable|enact|end|endless|endorse|enemy|energy|enforce|engage|engine|enhance|enjoy|enlist|enough|enrich|enroll|ensure|enter|entire|entry|envelope|episode|equal|equip|era|erase|erode|erosion|error|erupt|escape|essay|essence|estate|eternal|ethics|evidence|evil|evoke|evolve|exact|example|excess|exchange|excite|exclude|excuse|execute|exercise|exhaust|exhibit|exile|exist|exit|exotic|expand|expect|expire|explain|expose|express|extend|extra|eye|eyebrow|fabric|face|faculty|fade|faint|faith|fall|false|fame|family|famous|fan|fancy|fantasy|farm|fashion|fat|fatal|father|fatigue|fault|favorite|feature|february|federal|fee|feed|feel|female|fence|festival|fetch|fever|few|fiber|fiction|field|figure|file|film|filter|final|find|fine|finger|finish|fire|firm|first|fiscal|fish|fit|fitness|fix|flag|flame|flash|flat|flavor|flee|flight|flip|float|flock|floor|flower|fluid|flush|fly|foam|focus|fog|foil|fold|follow|food|foot|force|forest|forget|fork|fortune|forum|forward|fossil|foster|found|fox|fragile|frame|frequent|fresh|friend|fringe|frog|front|frost|frown|frozen|fruit|fuel|fun|funny|furnace|fury|future|gadget|gain|galaxy|gallery|game|gap|garage|garbage|garden|garlic|garment|gas|gasp|gate|gather|gauge|gaze|general|genius|genre|gentle|genuine|gesture|ghost|giant|gift|giggle|ginger|giraffe|girl|give|glad|glance|glare|glass|glide|glimpse|globe|gloom|glory|glove|glow|glue|goat|goddess|gold|good|goose|gorilla|gospel|gossip|govern|gown|grab|grace|grain|grant|grape|grass|gravity|great|green|grid|grief|grit|grocery|group|grow|grunt|guard|guess|guide|guilt|guitar|gun|gym|habit|hair|half|hammer|hamster|hand|happy|harbor|hard|harsh|harvest|hat|have|hawk|hazard|head|health|heart|heavy|hedgehog|height|hello|helmet|help|hen|hero|hidden|high|hill|hint|hip|hire|history|hobby|hockey|hold|hole|holiday|hollow|home|honey|hood|hope|horn|horror|horse|hospital|host|hotel|hour|hover|hub|huge|human|humble|humor|hundred|hungry|hunt|hurdle|hurry|hurt|husband|hybrid|ice|icon|idea|identify|idle|ignore|ill|illegal|illness|image|imitate|immense|immune|impact|impose|improve|impulse|inch|include|income|increase|index|indicate|indoor|industry|infant|inflict|inform|inhale|inherit|initial|inject|injury|inmate|inner|innocent|input|inquiry|insane|insect|inside|inspire|install|intact|interest|into|invest|invite|involve|iron|island|isolate|issue|item|ivory|jacket|jaguar|jar|jazz|jealous|jeans|jelly|jewel|job|join|joke|journey|joy|judge|juice|jump|jungle|junior|junk|just|kangaroo|keen|keep|ketchup|key|kick|kid|kidney|kind|kingdom|kiss|kit|kitchen|kite|kitten|kiwi|knee|knife|knock|know|lab|label|labor|ladder|lady|lake|lamp|language|laptop|large|later|latin|laugh|laundry|lava|law|lawn|lawsuit|layer|lazy|leader|leaf|learn|leave|lecture|left|leg|legal|legend|leisure|lemon|lend|length|lens|leopard|lesson|letter|level|liar|liberty|library|license|life|lift|light|like|limb|limit|link|lion|liquid|list|little|live|lizard|load|loan|lobster|local|lock|logic|lonely|long|loop|lottery|loud|lounge|love|loyal|lucky|luggage|lumber|lunar|lunch|luxury|lyrics|machine|mad|magic|magnet|maid|mail|main|major|make|mammal|man|manage|mandate|mango|mansion|manual|maple|marble|march|margin|marine|market|marriage|mask|mass|master|match|material|math|matrix|matter|maximum|maze|meadow|mean|measure|meat|mechanic|medal|media|melody|melt|member|memory|mention|menu|mercy|merge|merit|merry|mesh|message|metal|method|middle|midnight|milk|million|mimic|mind|minimum|minor|minute|miracle|mirror|misery|miss|mistake|mix|mixed|mixture|mobile|model|modify|mom|moment|monitor|monkey|monster|month|moon|moral|more|morning|mosquito|mother|motion|motor|mountain|mouse|move|movie|much|muffin|mule|multiply|muscle|museum|mushroom|music|must|mutual|myself|mystery|myth|naive|name|napkin|narrow|nasty|nation|nature|near|neck|need|negative|neglect|neither|nephew|nerve|nest|net|network|neutral|never|news|next|nice|night|noble|noise|nominee|noodle|normal|north|nose|notable|note|nothing|notice|novel|now|nuclear|number|nurse|nut|oak|obey|object|oblige|obscure|observe|obtain|obvious|occur|ocean|october|odor|off|offer|office|often|oil|okay|old|olive|olympic|omit|once|one|onion|online|only|open|opera|opinion|oppose|option|orange|orbit|orchard|order|ordinary|organ|orient|original|orphan|ostrich|other|outdoor|outer|output|outside|oval|oven|over|own|owner|oxygen|oyster|ozone|pact|paddle|page|pair|palace|palm|panda|panel|panic|panther|paper|parade|parent|park|parrot|party|pass|patch|path|patient|patrol|pattern|pause|pave|payment|peace|peanut|pear|peasant|pelican|pen|penalty|pencil|people|pepper|perfect|permit|person|pet|phone|photo|phrase|physical|piano|picnic|picture|piece|pig|pigeon|pill|pilot|pink|pioneer|pipe|pistol|pitch|pizza|place|planet|plastic|plate|play|please|pledge|pluck|plug|plunge|poem|poet|point|polar|pole|police|pond|pony|pool|popular|portion|position|possible|post|potato|pottery|poverty|powder|power|practice|praise|predict|prefer|prepare|present|pretty|prevent|price|pride|primary|print|priority|prison|private|prize|problem|process|produce|profit|program|project|promote|proof|property|prosper|protect|proud|provide|public|pudding|pull|pulp|pulse|pumpkin|punch|pupil|puppy|purchase|purity|purpose|purse|push|put|puzzle|pyramid|quality|quantum|quarter|question|quick|quit|quiz|quote|rabbit|raccoon|race|rack|radar|radio|rail|rain|raise|rally|ramp|ranch|random|range|rapid|rare|rate|rather|raven|raw|razor|ready|real|reason|rebel|rebuild|recall|receive|recipe|record|recycle|reduce|reflect|reform|refuse|region|regret|regular|reject|relax|release|relief|rely|remain|remember|remind|remove|render|renew|rent|reopen|repair|repeat|replace|report|require|rescue|resemble|resist|resource|response|result|retire|retreat|return|reunion|reveal|review|reward|rhythm|rib|ribbon|rice|rich|ride|ridge|rifle|right|rigid|ring|riot|ripple|risk|ritual|rival|river|road|roast|robot|robust|rocket|romance|roof|rookie|room|rose|rotate|rough|round|route|royal|rubber|rude|rug|rule|run|runway|rural|sad|saddle|sadness|safe|sail|salad|salmon|salon|salt|salute|same|sample|sand|satisfy|satoshi|sauce|sausage|save|say|scale|scan|scare|scatter|scene|scheme|school|science|scissors|scorpion|scout|scrap|screen|script|scrub|sea|search|season|seat|second|secret|section|security|seed|seek|segment|select|sell|seminar|senior|sense|sentence|series|service|session|settle|setup|seven|shadow|shaft|shallow|share|shed|shell|sheriff|shield|shift|shine|ship|shiver|shock|shoe|shoot|shop|short|shoulder|shove|shrimp|shrug|shuffle|shy|sibling|sick|side|siege|sight|sign|silent|silk|silly|silver|similar|simple|since|sing|siren|sister|situate|six|size|skate|sketch|ski|skill|skin|skirt|skull|slab|slam|sleep|slender|slice|slide|slight|slim|slogan|slot|slow|slush|small|smart|smile|smoke|smooth|snack|snake|snap|sniff|snow|soap|soccer|social|sock|soda|soft|solar|soldier|solid|solution|solve|someone|song|soon|sorry|sort|soul|sound|soup|source|south|space|spare|spatial|spawn|speak|special|speed|spell|spend|sphere|spice|spider|spike|spin|spirit|split|spoil|sponsor|spoon|sport|spot|spray|spread|spring|spy|square|squeeze|squirrel|stable|stadium|staff|stage|stairs|stamp|stand|start|state|stay|steak|steel|stem|step|stereo|stick|still|sting|stock|stomach|stone|stool|story|stove|strategy|street|strike|strong|struggle|student|stuff|stumble|style|subject|submit|subway|success|such|sudden|suffer|sugar|suggest|suit|summer|sun|sunny|sunset|super|supply|supreme|sure|surface|surge|surprise|surround|survey|suspect|sustain|swallow|swamp|swap|swarm|swear|sweet|swift|swim|swing|switch|sword|symbol|symptom|syrup|system|table|tackle|tag|tail|talent|talk|tank|tape|target|task|taste|tattoo|taxi|teach|team|tell|ten|tenant|tennis|tent|term|test|text|thank|that|theme|then|theory|there|they|thing|this|thought|three|thrive|throw|thumb|thunder|ticket|tide|tiger|tilt|timber|time|tiny|tip|tired|tissue|title|toast|tobacco|today|toddler|toe|together|toilet|token|tomato|tomorrow|tone|tongue|tonight|tool|tooth|top|topic|topple|torch|tornado|tortoise|toss|total|tourist|toward|tower|town|toy|track|trade|traffic|tragic|train|transfer|trap|trash|travel|tray|treat|tree|trend|trial|tribe|trick|trigger|trim|trip|trophy|trouble|truck|true|truly|trumpet|trust|truth|try|tube|tuition|tumble|tuna|tunnel|turkey|turn|turtle|twelve|twenty|twice|twin|twist|two|type|typical|ugly|umbrella|unable|unaware|uncle|uncover|under|undo|unfair|unfold|unhappy|uniform|unique|unit|universe|unknown|unlock|until|unusual|unveil|update|upgrade|uphold|upon|upper|upset|urban|urge|usage|use|used|useful|useless|usual|utility|vacant|vacuum|vague|valid|valley|valve|van|vanish|vapor|various|vast|vault|vehicle|velvet|vendor|venture|venue|verb|verify|version|very|vessel|veteran|viable|vibrant|vicious|victory|video|view|village|vintage|violin|virtual|virus|visa|visit|visual|vital|vivid|vocal|voice|void|volcano|volume|vote|voyage|wage|wagon|wait|walk|wall|walnut|want|warfare|warm|warrior|wash|wasp|waste|water|wave|way|wealth|weapon|wear|weasel|weather|web|wedding|weekend|weird|welcome|west|wet|whale|what|wheat|wheel|when|where|whip|whisper|wide|width|wife|wild|will|win|window|wine|wing|wink|winner|winter|wire|wisdom|wise|wish|witness|wolf|woman|wonder|wood|wool|word|work|world|worry|worth|wrap|wreck|wrestle|wrist|write|wrong|yard|year|yellow|you|young|youth|zebra|zero|zone|zoo`.split(`|`),An=`Invalid mnemonic`,jn=`Invalid entropy`,Mn=`Invalid mnemonic checksum`;function Nn(e){return(e||``).normalize(`NFKD`)}function Pn(e){return Number.parseInt(e,2)}function Fn(e){return e.map(e=>e.toString(2).padStart(8,`0`)).join(``)}function In(e){return Fn(Array.from(On(e))).slice(0,e.length*8/32)}function Ln(e,t=kn){let n=Nn(e).split(` `);if(n.length%3!=0)throw Error(An);let r=n.map(e=>{let n=t.indexOf(e);if(n===-1)throw Error(An);return n.toString(2).padStart(11,`0`)}).join(``),i=Math.floor(r.length/33)*32,a=r.slice(0,i),o=r.slice(i),s=a.match(/(.{1,8})/g)?.map(Pn);if(!s||s.length%4!=0||s.length<16||s.length>32)throw Error(jn);let c=x(s);if(In(c)!==o)throw Error(Mn);return c}function Rn(e,t=kn){if(e.length%4!=0||e.length<16||e.length>32)throw Error(jn);let n=`${Fn(Array.from(e))}${In(e)}`.match(/(.{1,11})/g)?.map(e=>t[Pn(e)]);if(!n||n.length<12)throw Error(`Unable to map entropy to mnemonic`);return n.join(` `)}function zn(e,t){try{Ln(e,t)}catch{return!1}return!0}function Bn(e,t,n){return Ln(e,t)}function Vn(e,t){return zn(e,t)}function Hn(e,t=``,n,r){if(!Vn(e,n))throw Error(`Invalid bip39 mnemonic specified`);return En(Bn(e,n),b(`mnemonic${t}`)).password.slice(0,32)}function Un(e){let t=x(e);if(t.length!==32)throw Error(`Expected a seed of 32 bytes, found ${t.length}`);let n=Tn(t),r=R(n.subarray(0,32))>>3n,i=_n.BASE.multiply(r).toRawBytes();return{publicKey:new Uint8Array(i),secretKey:new Uint8Array(n)}}self.addEventListener(`message`,async e=>{let{taskId:t,task:n,data:r}=e.data;try{let e;switch(n){case`test`:e=`ready`;break;case`entropyToMnemonic`:if(!r.entropy)throw Error(`Entropy data is required`);e=Rn(r.entropy);break;case`entropyToKeypair`:if(!r.entropy)throw Error(`Entropy data is required`);e=Wn(r.entropy);break;default:throw Error(`Unknown task: ${n}`)}let i={taskId:t,result:e};self.postMessage(i)}catch(e){let n={taskId:t,error:e instanceof Error?e.message:`Unknown error`};self.postMessage(n)}});function Wn(e){let t=Rn(e),{publicKey:n,secretKey:r}=Un(Hn(t));return{mnemonic:t,publicKey:n,secretKey:r}}})();";
|
|
2
|
+
var jsContent = "(function(){function e(e){return e(`return this`)}let t=typeof globalThis<`u`?globalThis:typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:e(Function);function n(e,n){return t[e]===void 0?n:t[e]}let r=n(`TextEncoder`,class{encode(e){let t=e.length,n=new Uint8Array(t);for(let r=0;r<t;r++)n[r]=e.charCodeAt(r);return n}});function i(e){return e(`return this`)}let a=typeof globalThis<`u`?globalThis:typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:i(Function);function o(e,t){return a[e]===void 0?t:a[e]}function s(e){return typeof e==`function`}function c(){return NaN}let l=o(`BigInt`,c),u=`0123456789abcdef`,d=new Uint8Array(256),f=new Uint8Array(256*256);for(let e=0;e<16;e++)d[u[e].charCodeAt(0)|0]=e|0,e>9&&(d[u[e].toUpperCase().charCodeAt(0)|0]=e|0);for(let e=0;e<256;e++){let t=e<<8;for(let n=0;n<256;n++)f[t|n]=d[e]<<4|d[n]}function p(e,t=-1){if(!e)return new Uint8Array;let n=e.startsWith(`0x`)?2:0,r=Math.ceil((e.length-n)/2),i=Math.ceil(t===-1?r:t/8),a=new Uint8Array(i),o=i>r?i-r:0;for(let t=o;t<i;t++,n+=2)a[t]=f[e.charCodeAt(n)<<8|e.charCodeAt(n+1)];return a}let m=/^0x[\\da-fA-F]+$/;function h(e,t=-1,n){return typeof e==`string`&&(e===`0x`||m.test(e))&&(t===-1?n||e.length%2==0:e.length===2+Math.ceil(t/4))}typeof l==`function`&&l.asIntN;let g=typeof a.Buffer==`function`&&typeof a.Buffer.isBuffer==`function`;a.process;function _(e){return g&&!!e&&s(e.readDoubleLE)&&a.Buffer.isBuffer(e)}function v(e){return(e&&e.constructor)===Uint8Array||e instanceof Uint8Array}let y=new r;function b(e){return e?y.encode(e.toString()):new Uint8Array}function x(e,t=!1){if(t&&e==null)throw Error(`u8aToU8a: Expected non-null, non-undefined value`);return v(e)?_(e)?new Uint8Array(e):e:h(e)?p(e):Array.isArray(e)?new Uint8Array(e):b(e)}\n/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nfunction S(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`}function C(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`positive integer expected, got `+e)}function w(e,...t){if(!S(e))throw Error(`Uint8Array expected`);if(t.length>0&&!t.includes(e.length))throw Error(`Uint8Array expected of length `+t+`, got length=`+e.length)}function T(e){if(typeof e!=`function`||typeof e.create!=`function`)throw Error(`Hash should be wrapped by utils.createHasher`);C(e.outputLen),C(e.blockLen)}function E(e,t=!0){if(e.destroyed)throw Error(`Hash instance has been destroyed`);if(t&&e.finished)throw Error(`Hash#digest() has already been called`)}function ee(e,t){w(e);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least `+n)}function D(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function te(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function O(e,t){return e<<32-t|e>>>t}function ne(e){if(typeof e!=`string`)throw Error(`string expected`);return new Uint8Array(new TextEncoder().encode(e))}function re(e){return typeof e==`string`&&(e=ne(e)),w(e),e}function ie(e){return typeof e==`string`&&(e=ne(e)),w(e),e}function ae(e,t){if(t!==void 0&&{}.toString.call(t)!==`[object Object]`)throw Error(`options should be object or undefined`);return Object.assign(e,t)}var oe=class{};function se(e){let t=t=>e().update(re(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function ce(e,t,n,r){if(typeof e.setBigUint64==`function`)return e.setBigUint64(t,n,r);let i=BigInt(32),a=BigInt(4294967295),o=Number(n>>i&a),s=Number(n&a),c=r?4:0,l=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+l,s,r)}function le(e,t,n){return e&t^~e&n}function ue(e,t,n){return e&t^e&n^t&n}var de=class extends oe{constructor(e,t,n,r){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=te(this.buffer)}update(e){E(this),e=re(e),w(e);let{view:t,buffer:n,blockLen:r}=this,i=e.length;for(let a=0;a<i;){let o=Math.min(r-this.pos,i-a);if(o===r){let t=te(e);for(;r<=i-a;a+=r)this.process(t,a);continue}n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){E(this),ee(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:a}=this;t[a++]=128,D(this.buffer.subarray(a)),this.padOffset>r-a&&(this.process(n,0),a=0);for(let e=a;e<r;e++)t[e]=0;ce(n,r-8,BigInt(this.length*8),i),this.process(n,0);let o=te(e),s=this.outputLen;if(s%4)throw Error(`_sha2: outputLen should be aligned to 32bit`);let c=s/4,l=this.get();if(c>l.length)throw Error(`_sha2: outputLen bigger than state`);for(let e=0;e<c;e++)o.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:n,length:r,finished:i,destroyed:a,pos:o}=this;return e.destroyed=a,e.finished=i,e.length=r,e.pos=o,r%t&&e.buffer.set(n),e}clone(){return this._cloneInto()}};let k=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),A=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),fe=BigInt(2**32-1),pe=BigInt(32);function me(e,t=!1){return t?{h:Number(e&fe),l:Number(e>>pe&fe)}:{h:Number(e>>pe&fe)|0,l:Number(e&fe)|0}}function he(e,t=!1){let n=e.length,r=new Uint32Array(n),i=new Uint32Array(n);for(let a=0;a<n;a++){let{h:n,l:o}=me(e[a],t);[r[a],i[a]]=[n,o]}return[r,i]}let ge=(e,t,n)=>e>>>n,_e=(e,t,n)=>e<<32-n|t>>>n,j=(e,t,n)=>e>>>n|t<<32-n,M=(e,t,n)=>e<<32-n|t>>>n,ve=(e,t,n)=>e<<64-n|t>>>n-32,ye=(e,t,n)=>e>>>n-32|t<<64-n;function N(e,t,n,r){let i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:i|0}}let be=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),xe=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,Se=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),Ce=(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0,we=(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0),Te=(e,t,n,r,i,a)=>t+n+r+i+a+(e/2**32|0)|0;function Ee(e){return e(`return this`)}let De=(typeof globalThis<`u`?globalThis:typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:Ee(Function)).crypto;function Oe(e){return De.getRandomValues(e)}function ke(e=32){return Oe(new Uint8Array(e))}var Ae=class extends oe{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,T(e);let n=re(t);if(this.iHash=e.create(),typeof this.iHash.update!=`function`)throw Error(`Expected instance of class which extends utils.Hash`);this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let r=this.blockLen,i=new Uint8Array(r);i.set(n.length>r?e.create().update(n).digest():n);for(let e=0;e<i.length;e++)i[e]^=54;this.iHash.update(i),this.oHash=e.create();for(let e=0;e<i.length;e++)i[e]^=106;this.oHash.update(i),D(i)}update(e){return E(this),this.iHash.update(e),this}digestInto(e){E(this),w(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||=Object.create(Object.getPrototypeOf(this),{});let{oHash:t,iHash:n,finished:r,destroyed:i,blockLen:a,outputLen:o}=this;return e=e,e.finished=r,e.destroyed=i,e.blockLen=a,e.outputLen=o,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};let je=(e,t,n)=>new Ae(e,t).update(n).digest();je.create=(e,t)=>new Ae(e,t);function Me(e,t,n,r){T(e);let{c:i,dkLen:a,asyncTick:o}=ae({dkLen:32,asyncTick:10},r);if(C(i),C(a),C(o),i<1)throw Error(`iterations (c) should be >= 1`);let s=ie(t),c=ie(n),l=new Uint8Array(a),u=je.create(e,s);return{c:i,dkLen:a,asyncTick:o,DK:l,PRF:u,PRFSalt:u._cloneInto().update(c)}}function Ne(e,t,n,r,i){return e.destroy(),t.destroy(),r&&r.destroy(),D(i),n}function Pe(e,t,n,r){let{c:i,dkLen:a,DK:o,PRF:s,PRFSalt:c}=Me(e,t,n,r),l,u=new Uint8Array(4),d=te(u),f=new Uint8Array(s.outputLen);for(let e=1,t=0;t<a;e++,t+=s.outputLen){let n=o.subarray(t,t+s.outputLen);d.setInt32(0,e,!1),(l=c._cloneInto(l)).update(u).digestInto(f),n.set(f.subarray(0,n.length));for(let e=1;e<i;e++){s._cloneInto(l).update(f).digestInto(f);for(let e=0;e<n.length;e++)n[e]^=f[e]}}return Ne(s,c,o,l,f)}let Fe=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),P=new Uint32Array(64);var Ie=class extends de{constructor(e=32){super(64,e,8,!1),this.A=k[0]|0,this.B=k[1]|0,this.C=k[2]|0,this.D=k[3]|0,this.E=k[4]|0,this.F=k[5]|0,this.G=k[6]|0,this.H=k[7]|0}get(){let{A:e,B:t,C:n,D:r,E:i,F:a,G:o,H:s}=this;return[e,t,n,r,i,a,o,s]}set(e,t,n,r,i,a,o,s){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0,this.F=a|0,this.G=o|0,this.H=s|0}process(e,t){for(let n=0;n<16;n++,t+=4)P[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=P[e-15],n=P[e-2],r=O(t,7)^O(t,18)^t>>>3,i=O(n,17)^O(n,19)^n>>>10;P[e]=i+P[e-7]+r+P[e-16]|0}let{A:n,B:r,C:i,D:a,E:o,F:s,G:c,H:l}=this;for(let e=0;e<64;e++){let t=O(o,6)^O(o,11)^O(o,25),u=l+t+le(o,s,c)+Fe[e]+P[e]|0,d=(O(n,2)^O(n,13)^O(n,22))+ue(n,r,i)|0;l=c,c=s,s=o,o=a+u|0,a=i,i=r,r=n,n=u+d|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,a=a+this.D|0,o=o+this.E|0,s=s+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,i,a,o,s,c,l)}roundClean(){D(P)}destroy(){this.set(0,0,0,0,0,0,0,0),D(this.buffer)}};let Le=he(`0x428a2f98d728ae22.0x7137449123ef65cd.0xb5c0fbcfec4d3b2f.0xe9b5dba58189dbbc.0x3956c25bf348b538.0x59f111f1b605d019.0x923f82a4af194f9b.0xab1c5ed5da6d8118.0xd807aa98a3030242.0x12835b0145706fbe.0x243185be4ee4b28c.0x550c7dc3d5ffb4e2.0x72be5d74f27b896f.0x80deb1fe3b1696b1.0x9bdc06a725c71235.0xc19bf174cf692694.0xe49b69c19ef14ad2.0xefbe4786384f25e3.0x0fc19dc68b8cd5b5.0x240ca1cc77ac9c65.0x2de92c6f592b0275.0x4a7484aa6ea6e483.0x5cb0a9dcbd41fbd4.0x76f988da831153b5.0x983e5152ee66dfab.0xa831c66d2db43210.0xb00327c898fb213f.0xbf597fc7beef0ee4.0xc6e00bf33da88fc2.0xd5a79147930aa725.0x06ca6351e003826f.0x142929670a0e6e70.0x27b70a8546d22ffc.0x2e1b21385c26c926.0x4d2c6dfc5ac42aed.0x53380d139d95b3df.0x650a73548baf63de.0x766a0abb3c77b2a8.0x81c2c92e47edaee6.0x92722c851482353b.0xa2bfe8a14cf10364.0xa81a664bbc423001.0xc24b8b70d0f89791.0xc76c51a30654be30.0xd192e819d6ef5218.0xd69906245565a910.0xf40e35855771202a.0x106aa07032bbd1b8.0x19a4c116b8d2d0c8.0x1e376c085141ab53.0x2748774cdf8eeb99.0x34b0bcb5e19b48a8.0x391c0cb3c5c95a63.0x4ed8aa4ae3418acb.0x5b9cca4f7763e373.0x682e6ff3d6b2b8a3.0x748f82ee5defb2fc.0x78a5636f43172f60.0x84c87814a1f0ab72.0x8cc702081a6439ec.0x90befffa23631e28.0xa4506cebde82bde9.0xbef9a3f7b2c67915.0xc67178f2e372532b.0xca273eceea26619c.0xd186b8c721c0c207.0xeada7dd6cde0eb1e.0xf57d4f7fee6ed178.0x06f067aa72176fba.0x0a637dc5a2c898a6.0x113f9804bef90dae.0x1b710b35131c471b.0x28db77f523047d84.0x32caab7b40c72493.0x3c9ebe0a15c9bebc.0x431d67c49c100d4c.0x4cc5d4becb3e42b6.0x597f299cfc657e2a.0x5fcb6fab3ad6faec.0x6c44198c4a475817`.split(`.`).map(e=>BigInt(e))),Re=Le[0],ze=Le[1],F=new Uint32Array(80),I=new Uint32Array(80);var Be=class extends de{constructor(e=64){super(128,e,16,!1),this.Ah=A[0]|0,this.Al=A[1]|0,this.Bh=A[2]|0,this.Bl=A[3]|0,this.Ch=A[4]|0,this.Cl=A[5]|0,this.Dh=A[6]|0,this.Dl=A[7]|0,this.Eh=A[8]|0,this.El=A[9]|0,this.Fh=A[10]|0,this.Fl=A[11]|0,this.Gh=A[12]|0,this.Gl=A[13]|0,this.Hh=A[14]|0,this.Hl=A[15]|0}get(){let{Ah:e,Al:t,Bh:n,Bl:r,Ch:i,Cl:a,Dh:o,Dl:s,Eh:c,El:l,Fh:u,Fl:d,Gh:f,Gl:p,Hh:m,Hl:h}=this;return[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h]}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=r|0,this.Ch=i|0,this.Cl=a|0,this.Dh=o|0,this.Dl=s|0,this.Eh=c|0,this.El=l|0,this.Fh=u|0,this.Fl=d|0,this.Gh=f|0,this.Gl=p|0,this.Hh=m|0,this.Hl=h|0}process(e,t){for(let n=0;n<16;n++,t+=4)F[n]=e.getUint32(t),I[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=F[e-15]|0,n=I[e-15]|0,r=j(t,n,1)^j(t,n,8)^ge(t,n,7),i=M(t,n,1)^M(t,n,8)^_e(t,n,7),a=F[e-2]|0,o=I[e-2]|0,s=j(a,o,19)^ve(a,o,61)^ge(a,o,6),c=M(a,o,19)^ye(a,o,61)^_e(a,o,6),l=Se(i,c,I[e-7],I[e-16]),u=Ce(l,r,s,F[e-7],F[e-16]);F[e]=u|0,I[e]=l|0}let{Ah:n,Al:r,Bh:i,Bl:a,Ch:o,Cl:s,Dh:c,Dl:l,Eh:u,El:d,Fh:f,Fl:p,Gh:m,Gl:h,Hh:g,Hl:_}=this;for(let e=0;e<80;e++){let t=j(u,d,14)^j(u,d,18)^ve(u,d,41),v=M(u,d,14)^M(u,d,18)^ye(u,d,41),y=u&f^~u&m,b=d&p^~d&h,x=we(_,v,b,ze[e],I[e]),S=Te(x,g,t,y,Re[e],F[e]),C=x|0,w=j(n,r,28)^ve(n,r,34)^ve(n,r,39),T=M(n,r,28)^ye(n,r,34)^ye(n,r,39),E=n&i^n&o^i&o,ee=r&a^r&s^a&s;g=m|0,_=h|0,m=f|0,h=p|0,f=u|0,p=d|0,{h:u,l:d}=N(c|0,l|0,S|0,C|0),c=o|0,l=s|0,o=i|0,s=a|0,i=n|0,a=r|0;let D=be(C,T,ee);n=xe(D,S,w,E),r=D|0}({h:n,l:r}=N(this.Ah|0,this.Al|0,n|0,r|0)),{h:i,l:a}=N(this.Bh|0,this.Bl|0,i|0,a|0),{h:o,l:s}=N(this.Ch|0,this.Cl|0,o|0,s|0),{h:c,l}=N(this.Dh|0,this.Dl|0,c|0,l|0),{h:u,l:d}=N(this.Eh|0,this.El|0,u|0,d|0),{h:f,l:p}=N(this.Fh|0,this.Fl|0,f|0,p|0),{h:m,l:h}=N(this.Gh|0,this.Gl|0,m|0,h|0),{h:g,l:_}=N(this.Hh|0,this.Hl|0,g|0,_|0),this.set(n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_)}roundClean(){D(F,I)}destroy(){D(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};let Ve=se(()=>new Ie),He=se(()=>new Be);function Ue(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`&&`BYTES_PER_ELEMENT`in e&&e.BYTES_PER_ELEMENT===1}let We=e=>e?`\"${e}\" `:``;function Ge(e,t=``){if(typeof e!=`number`)throw TypeError(We(t)+`expected number, got `+typeof e);if(!Number.isSafeInteger(e)||e<0)throw RangeError(We(t)+`expected integer >= 0, got `+e);return e}function Ke(e,t,n=``){if(Ue(e)&&(t===void 0||e.length===t))return e;t!==void 0&&Ge(t,`length`);let r=Ue(e),i=t===void 0?``:` of length ${t}`,a=r?`length=${e.length}`:`type=${typeof e}`,o=We(n)+`expected Uint8Array`+i+`, got `+a;throw r?RangeError(o):TypeError(o)}let qe=typeof Uint8Array.from([]).toHex==`function`&&typeof Uint8Array.fromHex==`function`,Je=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function Ye(e){if(Ke(e),qe)return e.toHex();let t=``;for(let n=0;n<e.length;n++)t+=Je[e[n]];return t}function Xe(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function Ze(e){if(typeof e!=`string`)throw TypeError(`hex string expected, got `+typeof e);if(qe)try{return Uint8Array.fromHex(e)}catch(e){throw e instanceof SyntaxError?RangeError(e.message):e}let t=e.length,n=t/2;if(t%2)throw RangeError(`hex string expected, got unpadded hex of length `+t);let r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){let n=Xe(e.charCodeAt(i)),a=Xe(e.charCodeAt(i+1));if(n===void 0||a===void 0){let t=e[i]+e[i+1];throw RangeError(`hex string expected, got non-hex character \"`+t+`\" at index `+i)}r[t]=n*16+a}return r}function Qe(e=32){Ge(e,`bytesLength`);let t=typeof globalThis==`object`?globalThis.crypto:null;if(typeof t?.getRandomValues!=`function`)throw Error(`crypto.getRandomValues must be defined`);if(e>65536)throw RangeError(`\"bytesLength\" expected <= 65536, got ${e}`);return t.getRandomValues(new Uint8Array(e))}\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nfunction $e(e,t,n=()=>{}){if(!Array.isArray(e))throw TypeError(`\"${t}\" expected array, got type=${typeof e}`);for(let r=0;r<e.length;r++)n(e[r],`${t}[${r}]`);return e}let L=(e,t,n)=>Ke(e,t,n),et=Ge;function R(e,t=`object`){if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError(t===`object`?`expected valid options object`:`\"${t}\" expected object, got type=${typeof e}`);return e}function z(e,t){if(typeof e!=`function`)throw TypeError(`\"${t}\" is invalid: expected function, got ${typeof e}`);return e}let tt=Ye,nt=e=>Ze(e),rt=Ue,it=e=>Qe(e),at=BigInt(0),ot=BigInt(1),st=e=>e?`\"${e}\" `:``;function ct(e,t=``){if(typeof e!=`boolean`)throw TypeError(st(t)+`expected boolean, got type=`+typeof e);return e}function lt(e){if(typeof e==`bigint`){if(!V(e))throw RangeError(`positive bigint expected, got `+e)}else et(e);return e}function ut(e,t=``){if(typeof e!=`number`){let n=t&&`\"${t}\" `;throw TypeError(n+`expected number, got type=`+typeof e)}if(!Number.isSafeInteger(e)){let n=t&&`\"${t}\" `;throw RangeError(n+`expected safe integer, got `+e)}}function dt(e){if(typeof e!=`string`)throw TypeError(`hex string expected, got `+typeof e);return e===``?at:BigInt(`0x`+e)}function ft(e){return dt(Ye(e))}function B(e){return dt(Ye(gt(Ke(e)).reverse()))}function pt(e,t){if(Ge(t),t===0)throw Error(`zero output length is invalid`);e=lt(e);let n=t*2,r=e.toString(16);if(r.length>n)throw RangeError(`number is too large`);return Ze(r.padStart(n,`0`))}function mt(e,t){return pt(e,t).reverse()}function ht(e,t){if(e=L(e),t=L(t),e.length!==t.length)return!1;let n=0;for(let r=0;r<e.length;r++)n|=e[r]^t[r];return n===0}function gt(e){return Uint8Array.from(L(e))}function V(e){return typeof e==`bigint`&&at<=e}function _t(e,t,n){return V(e)&&V(t)&&V(n)&&t<=e&&e<n}function vt(e,t,n,r){if(!_t(t,n,r))throw RangeError(`expected valid `+e+`: `+n+` <= n < `+r+`, got `+t)}function yt(e){if(e<at)throw Error(`expected non-negative bigint, got `+e);return e===at?0:e.toString(2).length}let bt=e=>(ut(e,`n`),(ot<<BigInt(e))-ot);function xt(e,t={},n={},r=`object`){R(e,r),R(t,`fields`),R(n,`optFields`);function i(t,n,i){let a=r===`object`?`param \"${String(t)}\"`:`\"${r}.${String(t)}\"`,o=e[t];if(!Object.hasOwn(e,t)&&(i?o!==void 0:n!==`function`))throw TypeError(`${a} is invalid: expected own property`);if(i&&o===void 0)return;let s=typeof o;if(s!==n||o===null)throw TypeError(`${a} is invalid: expected ${n}, got ${s}`)}let a=(e,t)=>Object.entries(e).forEach(([e,n])=>i(e,n,t));a(t,!1),a(n,!0)}let St=()=>{throw Error(`not implemented`)},H=BigInt(0),U=BigInt(1),W=BigInt(2),Ct=BigInt(3),wt=BigInt(4),Tt=BigInt(5),Et=BigInt(7),Dt=BigInt(8),Ot=BigInt(9),kt=BigInt(15),At=BigInt(16),jt=BigInt(`0x10000000000000000`)\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n;function G(e,t){if(t<=H)throw Error(`mod: expected positive modulus, got `+t);let n=e%t;return n>=H?n:t+n}function Mt(e,t,n){if(n<=U)throw Error(`pow: expected modulus > 1, got `+n);if(typeof t!=`bigint`)throw TypeError(`invalid exponent: expected bigint, got `+typeof t);if(t<H)throw Error(`invalid exponent, negatives unsupported`);if(t===H)return U;if(t===U)return e;let r=e%n;if(r<H&&(r+=n),t<jt){let e=U;for(;t>H;)t&U&&(e=e*r%n),r=r*r%n,t>>=U;return e}let i=[];for(;t>H;)i.push(Number(t&kt)),t>>=wt;let a=Array(16);a[0]=U,a[1]=r;for(let e=2;e<16;e++)a[e]=a[e-1]*r%n;let o=a[i[i.length-1]];for(let e=i.length-2;e>=0;e--){o=o*o%n,o=o*o%n,o=o*o%n,o=o*o%n;let t=i[e];t!==0&&(o=o*a[t]%n)}return o}function K(e,t,n){if(n<=U)throw Error(`pow2: expected modulus > 1, got `+n);if(t<H)throw Error(`pow2: expected non-negative exponent, got `+t);let r=e;for(;t-->H;)r*=r,r%=n;return r}function Nt(e,t){if(e===H)throw Error(`invert: expected non-zero number`);if(t<=U)throw Error(`invert: expected modulus > 1, got `+t);let n=G(e,t),r=t,i=H,a=U;for(;n!==H;){let e=r/n,t=r-n*e,o=i-a*e;r=n,n=t,i=a,a=o}if(r!==U)throw Error(`invert: does not exist`);return G(i,t)}function Pt(e,t,n){let r=e;if(!r.eql(r.sqr(t),n))throw Error(`Cannot find square root`)}function Ft(e,t){if((e&U)===H)throw Error(t+`: expected odd modulus, got `+e)}function It(e,t){let n=e,r=(n.ORDER+U)/wt,i=n.pow(t,r);return Pt(n,i,t),i}function Lt(e,t){let n=e,r=(n.ORDER-Tt)/Dt,i=n.mul(t,W),a=n.pow(i,r),o=n.mul(t,a),s=n.mul(n.mul(o,W),a),c=n.mul(o,n.sub(s,n.ONE));return Pt(n,c,t),c}function Rt(e){let t=Yt(e),n=zt(e),r=n(t,t.neg(t.ONE)),i=n(t,r),a=n(t,t.neg(r)),o=(e+Et)/At;return((e,t)=>{let n=e,s=n.pow(t,o),c=n.mul(s,r),l=n.mul(s,i),u=n.mul(s,a),d=n.eql(n.sqr(c),t),f=n.eql(n.sqr(l),t);s=n.cmov(s,c,d),c=n.cmov(u,l,f);let p=n.eql(n.sqr(c),t),m=n.cmov(s,c,p);return Pt(n,m,t),m})}function zt(e){if(e<Ct)throw Error(`sqrt is not defined for small field`);Ft(e,`tonelliShanks`);let t=e-U,n=0;for(;t%W===H;)t/=W,n++;let r=W,i=Yt(e);for(;Gt(i,r)===1;)if(r++>1e3)throw Error(`Cannot find square root: probably non-prime P`);if(n===1)return It;let a=i.pow(r,t),o=(t+U)/W;return function(e,r){let i=e;if(i.is0(r))return r;if(Gt(i,r)!==1)throw Error(`Cannot find square root`);let s=n,c=i.mul(i.ONE,a),l=i.pow(r,t),u=i.pow(r,o);for(;!i.eql(l,i.ONE);){if(i.is0(l))throw Error(`Cannot find square root: probably non-prime P`);let e=1,t=i.sqr(l);for(;!i.eql(t,i.ONE);)if(e++,t=i.sqr(t),e===s)throw Error(`Cannot find square root`);let n=U<<BigInt(s-e-1),r=i.pow(c,n);s=e,c=i.sqr(r),l=i.mul(l,c),u=i.mul(u,r)}return u}}function Bt(e){return Ft(e,`Fp.sqrt`),e%wt===Ct?It:e%Dt===Tt?Lt:e%At===Ot?Rt(e):zt(e)}let Vt=(e,t)=>(G(e,t)&U)===U,Ht=[`create`,`isValid`,`is0`,`neg`,`inv`,`sqrt`,`sqr`,`eql`,`add`,`sub`,`mul`,`pow`,`div`,`addN`,`subN`,`mulN`,`sqrN`];function Ut(e){if(R(e,`field`),typeof e.ORDER!=`bigint`)throw TypeError(`param \"ORDER\" is invalid: expected bigint, got `+typeof e.ORDER);ut(e.BYTES,`BYTES`),ut(e.BITS,`BITS`);for(let t of Ht)z(e[t],`field.`+t);if(e.BYTES<1||e.BITS<1)throw Error(`invalid field: expected BYTES/BITS > 0`);if(e.ORDER<=U)throw Error(`invalid field: expected ORDER > 1, got `+e.ORDER);return e}function Wt(e,t,n=!1){Ut(e),$e(t,`nums`),ct(n,`passZero`);let r=e,i=Array(t.length).fill(n?r.ZERO:void 0),a=t.reduce((e,t,n)=>r.is0(t)?e:(i[n]=e,r.mul(e,t)),r.ONE),o=r.inv(a);return t.reduceRight((e,t,n)=>r.is0(t)?e:(i[n]=r.mul(e,i[n]),r.mul(e,t)),o),i}function Gt(e,t){Ut(e);let n=e;Ft(n.ORDER,`FpLegendre`);let r=(n.ORDER-U)/W,i=n.pow(t,r),a=n.eql(i,n.ONE),o=n.eql(i,n.ZERO),s=n.eql(i,n.neg(n.ONE));if(!a&&!o&&!s)throw Error(`invalid Legendre symbol result`);return a?1:o?0:-1}function Kt(e,t){if(t!==void 0&&et(t),e<=H)throw Error(`invalid n length: expected positive n, got `+e);if(t!==void 0&&t<1)throw Error(`invalid n length: expected positive bit length, got `+t);let n=yt(e);if(t!==void 0&&t<n)throw Error(`invalid n length: expected nBitLength (${t}) >= bitLen(n) (${n})`);let r=t===void 0?n:t;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}let qt=new WeakMap;var Jt=class{ORDER;BITS;BYTES;isLE;ZERO=H;ONE=U;_lengths;_mod;constructor(e,t={}){if(e<=U)throw Error(`invalid field: expected ORDER > 1, got `+e);let n;this.isLE=!1,typeof t==`object`&&t&&(typeof t.BITS==`number`&&(n=t.BITS),typeof t.sqrt==`function`&&Object.defineProperty(this,\"sqrt\",{value:t.sqrt,enumerable:!0}),typeof t.isLE==`boolean`&&(this.isLE=t.isLE),t.allowedLengths&&(this._lengths=Object.freeze(t.allowedLengths.slice())),typeof t.modFromBytes==`boolean`&&(this._mod=t.modFromBytes));let{nBitLength:r,nByteLength:i}=Kt(e,n);if(i>2048)throw Error(`invalid field: expected ORDER of <= 2048 bytes`);this.ORDER=e,this.BITS=r,this.BYTES=i,Object.freeze(this)}create(e){return G(e,this.ORDER)}isValid(e){if(typeof e!=`bigint`)throw TypeError(`invalid field element: expected bigint, got `+typeof e);return H<=e&&e<this.ORDER}is0(e){return e===H}isValidNot0(e){return!this.is0(e)&&this.isValid(e)}isOdd(e){return(e&U)===U}neg(e){return G(-e,this.ORDER)}eql(e,t){return e===t}sqr(e){return G(e*e,this.ORDER)}add(e,t){return G(e+t,this.ORDER)}sub(e,t){return G(e-t,this.ORDER)}mul(e,t){return G(e*t,this.ORDER)}pow(e,t){return Mt(e,t,this.ORDER)}div(e,t){return G(e*Nt(t,this.ORDER),this.ORDER)}sqrN(e){return e*e}addN(e,t){return e+t}subN(e,t){return e-t}mulN(e,t){return e*t}inv(e){return Nt(e,this.ORDER)}sqrt(e){let t=qt.get(this);return t||qt.set(this,t=Bt(this.ORDER)),t(this,e)}toBytes(e){return this.isLE?mt(e,this.BYTES):pt(e,this.BYTES)}fromBytes(e,t=!1){L(e);let{_lengths:n,BYTES:r,isLE:i,ORDER:a,_mod:o}=this;if(n){if(e.length<1||!n.includes(e.length)||e.length>r)throw Error(`Field.fromBytes: expected `+n+` bytes, got `+e.length);let t=new Uint8Array(r);t.set(e,i?0:t.length-e.length),e=t}if(e.length!==r)throw Error(`Field.fromBytes: expected `+r+` bytes, got `+e.length);let s=i?B(e):ft(e);if(o&&(s=G(s,a)),!t&&!this.isValid(s))throw Error(`invalid field element: outside of range 0..ORDER`);return s}invertBatch(e){return Wt(this,e,!0)}cmov(e,t,n){return ct(n,`condition`),n?t:e}};function Yt(e,t={}){return Object.freeze(Jt.prototype),new Jt(e,t)}\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nlet Xt=BigInt(0),Zt=BigInt(1),Qt=BigInt(4),$t=2**31;function en(e){let t=e;if(typeof t!=`function`)throw TypeError(`\"Point\" expected constructor, got type=`+typeof e);z(t.fromAffine,`Point.fromAffine`),z(t.fromBytes,`Point.fromBytes`),z(t.fromHex,`Point.fromHex`),R(t.BASE,`Point.BASE`),R(t.ZERO,`Point.ZERO`),Ut(t.Fp),Ut(t.Fn)}function tn(e,t){en(e),on(t,e);let n=Wt(e.Fp,t.map(e=>e.Z));return t.map((t,r)=>e.fromAffine(t.toAffine(n[r])))}function nn(e,t,n=1){if(!Number.isSafeInteger(e)||e<n||e>t)throw Error(`invalid window size, expected [`+n+`..`+t+`], got W=`+e)}function rn(e,t){let n=e*(4*t+128);if(n>$t)throw Error(`invalid window size: table would need ~`+Math.ceil(n/2**20)+` MiB, max `+$t/2**20+` MiB`)}function an(e,t){if(e!==void 0){z(e,`randomBytes`);try{let n=e(t);if(!rt(n)||n.length!==t)return}catch{return}return e}}function on(e,t){$e(e,`points`),e.forEach((e,n)=>{if(!(e instanceof t))throw Error(`invalid point at index `+n)})}function sn(e,t,n){if(!Array.isArray(e))throw Error(`array of scalars expected`);e.forEach((e,r)=>{if(!(n===void 0?t.isValid(e):V(e)&&e<n))throw Error(`invalid scalar at index `+r)})}let cn=new WeakMap;function ln(e){return cn.get(e)||1}function un(e,t){let n=e.double(),r=[e];for(let e=1;e<t;e++)r.push(r[e-1].add(n));return r}function dn(e,t){let n=2**t,r=n/2,i=BigInt(n-1),a=[];for(;e>Xt;){let t=0;e&Zt&&(t=Number(e&i),t>=r&&(t-=n),e-=BigInt(t)),a.push(t),e>>=Zt}return a}function fn(e,t,n){let r=2**t,i=r/2,a=BigInt(r-1),o=BigInt(t),s=[];for(let t=0;t<n;t++){let t=Number(e&a);e>>=o,t>i&&(t-=r,e+=Zt),s.push(t)}if(e!==Xt)throw Error(`invalid wnaf`);return s}function pn(e,t,n){let r=0;for(let e of n)r=Math.max(r,e.length);let i=e;for(let e=r-1;e>=0;e--){e!==r-1&&(i=i.double());for(let r=0;r<n.length;r++){let a=n[r][e];if(a){let e=t[r][Math.abs(a)-1>>1];i=i.add(a<0?e.negate():e)}}}return i}var mn=class{Point;BASE;ZERO;randomBytes;wnafPrecomputes=new WeakMap;baseCanBeBlinded;bits;constructor(e,t){en(e),this.randomBytes=an(t,16),this.Point=e,this.BASE=e.BASE,this.ZERO=e.ZERO,this.bits=e.Fn.BITS}buildWnafTable(e,t,n){let r=Math.ceil(n/t)+1,i=2**(t-1),a=[],o=e;for(let e=0;e<r;e++){let e=o;for(let t=0;t<i;t++)a.push(e),e=e.add(o);o=a[a.length-1].double()}return{W:t,bits:n,windows:r,comp:a}}wnafCachedCT(e,t){let{W:n,windows:r,comp:i}=e,a=2**(n-1),o=fn(t,n,r),s=this.ZERO,c=this.BASE;for(let e=0;e<r;e++){let t=o[e],n=e*a,r=Math.abs(t)-1,l=i[n];for(let e=1;e<a;e++)l=e===r?i[n+e]:l;let u=l.negate();t===0?c=c.add(i[n]):s=s.add(t<0?u:l)}return{p:s,f:c}}getWnafPrecomputes(e,t,n,r){let i=this.wnafPrecomputes.get(t),a=i?.find(t=>t.W===e&&t.bits===n);return a||(a=this.buildWnafTable(t,e,n),typeof r==`function`&&(a={...a,comp:r(a.comp)}),i||(i=[],this.wnafPrecomputes.set(t,i)),i.push(a)),a}assertPoint(e){if(!(e instanceof this.Point))throw TypeError(`\"point\" expected Point instance, got type=`+typeof e)}validateMulInput(e,t){if(this.assertPoint(e),!_t(t,Zt,this.Point.Fn.ORDER))throw Error(`invalid scalar`)}runCT(e,t,n,r){let i=ln(e);return i===1?this.fixedWindowCT(e,t,n):this.wnafCachedCT(this.getWnafPrecomputes(i,e,n,r),t)}mulCT(e,t,n){return this.validateMulInput(e,t),this.runCT(e,t,this.bits,n)}mulCTBlinded(e,t,n){if(this.validateMulInput(e,t),this.randomBytes===void 0)throw Error(`randomBytes is required for scalar blinding`);let r=this.Point.Fn.BITS+128,i=this.randomBytes(16);if(!rt(i)||i.length!==16)throw Error(`randomBytes returned invalid byte array`);i[0]=i[0]&63|128;let a=t+ft(i)*this.Point.Fn.ORDER;return this.runCT(e,a,r,n)}fixedWindowCT(e,t,n){let r=bt(5),i=Array(32);i[0]=this.ZERO;for(let t=1;t<32;t++)i[t]=i[t-1].add(e);let a=Math.ceil(n/5),o=this.ZERO;for(let e=a-1;e>=0;e--){if(e!==a-1)for(let e=0;e<5;e++)o=o.double();let n=Number(t>>BigInt(e*5)&r),s=i[0];for(let e=1;e<32;e++)s=e===n?i[e]:s;o=o.add(s)}return{p:o,f:o}}shouldBlind(e,t){return this.randomBytes===void 0?!1:t===Zt?!0:e===this.BASE?(this.baseCanBeBlinded===void 0&&(this.baseCanBeBlinded=this.mulUnsafe(this.BASE,this.Point.Fn.ORDER).is0()),this.baseCanBeBlinded):!1}mulSecret(e,t,n,r){return this.shouldBlind(e,n)?this.mulCTBlinded(e,t,r):this.mulCT(e,t,r)}mulUnsafe(e,t,n){if(this.assertPoint(e),!V(t))throw Error(`invalid scalar`);let r=ln(e);if(r===1||t>=this.Point.Fn.ORDER)return hn(this.Point,[e],[t],!0);let i=this.getWnafPrecomputes(r,e,this.bits,n);return this.wnafCachedCT(i,t).p}setWindowSize(e,t){this.assertPoint(e),nn(t,this.bits),rn((Math.ceil((this.bits+128)/t)+1)*2**(t-1),this.Point.Fp.BYTES),cn.set(e,t),this.wnafPrecomputes.delete(e)}hasWindowSize(e){return ln(e)!==1}};function hn(e,t,n,r=!1){if(en(e),on(t,e),ct(r,`allowOversized`),sn(n,e.Fn,r?e.Fn.ORDER**Qt:void 0),t.length!==n.length)throw Error(`arrays of points and scalars must have equal length`);let i=t.map(e=>un(e,4)),a=n.map(e=>dn(e,4));return pn(e.ZERO,i,a)}function gn(e,t,n){if(t){if(t.ORDER!==e)throw Error(`Field.ORDER must match order: Fp == p, Fn == n`);return Ut(t),t}else return Yt(e,{isLE:n})}function _n(e,t,n={},r){if(e!==`weierstrass`&&e!==`edwards`)throw Error(`expected curve type \"weierstrass\" or \"edwards\"`);if(r===void 0&&(r=e===`edwards`),!t||typeof t!=`object`)throw Error(`expected valid ${e} CURVE object`);xt(n);for(let e of[`p`,`n`,`h`]){let n=t[e];if(!(V(n)&&n!==Xt))throw Error(`CURVE.${e} must be positive bigint`)}let i=gn(t.p,n.Fp,r),a=gn(t.n,n.Fn,r),o=[`Gx`,`Gy`,`a`,e===`weierstrass`?`b`:`d`];for(let e of o)if(!i.isValid(t[e]))throw Error(`CURVE.${e} must be valid field element of CURVE.Fp`);return t=Object.freeze(Object.assign({},t)),{CURVE:t,Fp:i,Fn:a}}\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\nlet vn=BigInt(0),yn=BigInt(1),bn=BigInt(2),xn=BigInt(4),Sn=BigInt(8);function Cn(e,t,n,r){let i=e.sqr(n),a=e.sqr(r),o=e.add(e.mul(t.a,i),a),s=e.add(e.ONE,e.mul(t.d,e.mul(i,a)));return e.eql(o,s)}function wn(e,t={}){xt(t,{},{},`extraOpts`);let n=t,r=_n(`edwards`,e,n,n.FpFnLE),{Fp:i,Fn:a}=r,o=r.CURVE,{h:s}=o;if(Gt(i,o.a)!==1)throw Error(`edwards: CURVE.a must be a square in Fp for complete addition formulas`);if(Gt(i,o.d)!==-1)throw Error(`edwards: CURVE.d must be a non-square in Fp for complete addition formulas`);xt(n,{},{uvRatio:`function`,randomBytes:`function`});let c=n.randomBytes===void 0?it:n.randomBytes,l=bn<<BigInt(i.BYTES*8)-yn;function u(e){if(!i.isOdd)throw Error(`Field does not have .isOdd()`);return i.isOdd(e)}let d=n.uvRatio===void 0?(e,t)=>{try{return{isValid:!0,value:i.sqrt(i.div(e,t))}}catch{return{isValid:!1,value:vn}}}:n.uvRatio;if(!Cn(i,o,o.Gx,o.Gy))throw Error(`bad curve params: generator point`);let f=i.eql(o.a,i.neg(i.ONE))?e=>i.neg(e):i.eql(o.a,i.ONE)?e=>e:e=>i.mul(o.a,e);function p(e,t,n=!1){let r=n?yn:vn;return vt(`coordinate `+e,t,r,l),t}function m(e){if(!(e instanceof h))throw Error(`EdwardsPoint expected`)}class h{static BASE=new h(o.Gx,o.Gy,i.ONE,i.mul(o.Gx,o.Gy));static ZERO=new h(i.ZERO,i.ONE,i.ONE,i.ZERO);static Fp=i;static Fn=a;X;Y;Z;T;constructor(e,t,n,r){this.X=p(`x`,e),this.Y=p(`y`,t),this.Z=p(`z`,n,!0),this.T=p(`t`,r),Object.freeze(this)}static CURVE(){return o}static fromAffine(e){if(e instanceof h)throw Error(`extended point not allowed`);let{x:t,y:n}=e||{};return p(`x`,t),p(`y`,n),new h(t,n,i.ONE,i.mul(t,n))}static fromBytes(e,t=!1){let n=i.BYTES,{a:r,d:a}=o;e=gt(L(e,n,`point`)),ct(t,`zip215`);let s=gt(e),c=e[n-1];s[n-1]=c&-129;let f=B(s),p=t?l:i.ORDER;vt(`point.y`,f,vn,p);let m=i.sqr(f),g=i.sub(m,i.ONE),_=i.sub(i.mulN(a,m),r),{isValid:v,value:y}=d(g,_);if(!v)throw Error(`bad point: invalid y coordinate`);let b=u(y),x=(c&128)!=0;if(!t&&i.is0(y)&&x)throw Error(`bad point: x=0 and x_0=1`);return x!==b&&(y=i.neg(y)),h.fromAffine({x:y,y:f})}static fromHex(e,t=!1){return h.fromBytes(nt(e),t)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(e=6,t=!0){return _.setWindowSize(this,e),t||this.multiply(bn),this}assertValidity(){let e=this,{a:t,d:n}=o;if(e.is0())throw Error(`bad point: ZERO`);let{X:r,Y:a,Z:s,T:c}=e,l=i.sqr(r),u=i.sqr(a),d=i.sqr(s),f=i.sqr(d),p=i.mul(l,t),m=i.mul(i.add(p,u),d),h=i.add(f,i.mul(n,i.mul(l,u)));if(!i.eql(m,h))throw Error(`bad point: equation left != right (1)`);let g=i.mul(r,a),_=i.mul(s,c);if(!i.eql(g,_))throw Error(`bad point: equation left != right (2)`)}equals(e){m(e);let{X:t,Y:n,Z:r}=this,{X:a,Y:o,Z:s}=e,c=i.mul(t,s),l=i.mul(a,r),u=i.mul(n,s),d=i.mul(o,r);return i.eql(c,l)&&i.eql(u,d)}is0(){return this.equals(h.ZERO)}negate(){return new h(i.neg(this.X),this.Y,this.Z,i.neg(this.T))}double(){let{X:e,Y:t,Z:n}=this,r=i.sqr(e),a=i.sqr(t),o=i.mul(i.sqr(n),bn),s=f(r),c=i.addN(e,t),l=i.sub(i.subN(i.sqr(c),r),a),u=i.addN(s,a),d=i.subN(u,o),p=i.subN(s,a),m=i.mul(l,d),g=i.mul(u,p),_=i.mul(l,p),v=i.mul(d,u);return new h(m,g,v,_)}add(e){m(e);let{d:t}=o,{X:n,Y:r,Z:a,T:s}=this,{X:c,Y:l,Z:u,T:d}=e,p=i.mul(n,c),g=i.mul(r,l),_=i.mul(i.mulN(s,t),d),v=i.mul(a,u),y=i.sub(i.subN(i.mulN(i.addN(n,r),i.addN(c,l)),p),g),b=i.subN(v,_),x=i.addN(v,_),S=i.sub(g,f(p)),C=i.mul(y,b),w=i.mul(x,S),T=i.mul(y,S),E=i.mul(b,x);return new h(C,w,E,T)}subtract(e){return m(e),this.add(e.negate())}multiply(e){if(!a.isValidNot0(e))throw RangeError(`invalid scalar: expected 1 <= sc < curve.n`);let{p:t,f:n}=_.mulSecret(this,e,s,g);return g([t,n])[0]}multiplyUnsafe(e){if(!a.isValid(e))throw RangeError(`invalid scalar: expected 0 <= sc < curve.n`);return e===vn?h.ZERO:this.is0()||e===yn?this:_.mulUnsafe(this,e,g)}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){return _.mulUnsafe(this,o.n).is0()}toAffine(e){let t=this,n=e;if(n!=null&&typeof n!=`bigint`)throw TypeError(`\"invertedZ\" expected bigint, got type=`+typeof n);let{X:r,Y:a,Z:o}=t,s=t.is0();n??=s?i.create(Sn):i.inv(o);let c=i.mul(r,n),l=i.mul(a,n),u=i.mul(o,n);if(s)return{x:i.ZERO,y:i.ONE};if(!i.eql(u,i.ONE))throw Error(`invZ was invalid`);return{x:c,y:l}}clearCofactor(){return s===yn?this:s===bn?this.double():s===xn?this.double().double():s===Sn?this.double().double().double():this.multiplyUnsafe(s)}toBytes(){let{x:e,y:t}=this.toAffine(),n=i.toBytes(t);return n[n.length-1]|=u(e)?128:0,n}toHex(){return tt(this.toBytes())}toString(){return`<Point ${this.is0()?`ZERO`:this.toHex()}>`}}let g=e=>tn(h,e),_=new mn(h,c);return _.bits>=6&&h.BASE.precompute(6),Object.freeze(h.prototype),Object.freeze(h),h}var Tn=class{static BASE;static ZERO;static Fp;static Fn;ep;constructor(e){this.ep=e}static fromBytes(e){St()}static fromHex(e){St()}get x(){return this.toAffine().x}get y(){return this.toAffine().y}clearCofactor(){return this}assertValidity(){this.ep.assertValidity()}toAffine(e){return this.ep.toAffine(e)}toHex(){return tt(this.toBytes())}toString(){return this.toHex()}isTorsionFree(){return!0}isSmallOrder(){return!1}add(e){return this.assertSame(e),this.init(this.ep.add(e.ep))}subtract(e){return this.assertSame(e),this.init(this.ep.subtract(e.ep))}multiply(e){return this.init(this.ep.multiply(e))}multiplyUnsafe(e){return this.init(this.ep.multiplyUnsafe(e))}double(){return this.init(this.ep.double())}negate(){return this.init(this.ep.negate())}precompute(e,t){return this.ep.precompute(e,t),this}};let En=BigInt(1),Dn=BigInt(2),On=BigInt(5),kn=BigInt(8),An=BigInt(`0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed`),jn={p:An,n:BigInt(`0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed`),h:kn,a:BigInt(`0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec`),d:BigInt(`0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3`),Gx:BigInt(`0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a`),Gy:BigInt(`0x6666666666666666666666666666666666666666666666666666666666666658`)}\n/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */\n;function Mn(e){let t=BigInt(10),n=BigInt(20),r=BigInt(40),i=BigInt(80),a=An,o=e*e%a*e%a,s=K(K(o,Dn,a)*o%a,En,a)*e%a,c=K(s,On,a)*s%a,l=K(c,t,a)*c%a,u=K(l,n,a)*l%a,d=K(u,r,a)*u%a;return{pow_p_5_8:K(K(K(K(d,i,a)*d%a,i,a)*d%a,t,a)*c%a,Dn,a)*e%a,b2:o}}let Nn=BigInt(`19681161376707505956807079304988542015446066515923890162744021073123829784752`);function Pn(e,t){let n=An,r=G(t*t*t,n),i=Mn(e*G(r*r*t,n)).pow_p_5_8,a=G(e*r*i,n),o=G(t*a*a,n),s=a,c=G(a*Nn,n),l=o===e,u=o===G(-e,n),d=o===G(-e*Nn,n);return l&&(a=s),(u||d)&&(a=c),Vt(a,n)&&(a=G(-a,n)),{isValid:l||u,value:a}}let q=wn(jn,{uvRatio:Pn}),J=q.Fp,Fn=q.Fn,In=Nn,Ln=BigInt(`54469307008909316920995813868745141605393597292927456921205312896311721017578`),Rn=e=>Pn(En,e),zn=BigInt(`0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff`),Bn=e=>J.create(B(e)&zn);var Vn=class e extends Tn{static BASE=new e(q.BASE);static ZERO=new e(q.ZERO);static Fp=J;static Fn=Fn;constructor(e){super(e)}static fromAffine(t){return new e(q.fromAffine(t))}assertSame(t){if(!(t instanceof e))throw Error(`RistrettoPoint expected`)}init(t){return new e(t)}static fromBytes(t){Ke(t,32);let{a:n,d:r}=jn,i=Bn(t);if(!ht(J.toBytes(i),t)||J.isOdd(i))throw Error(`invalid ristretto255 encoding 1`);let a=J.sqr(i),o=J.add(En,J.mulN(n,a)),s=J.sub(En,J.mulN(n,a)),c=J.sqr(o),l=J.sqr(s),u=J.sub(J.mulN(J.mulN(n,r),c),l),{isValid:d,value:f}=Rn(J.mul(u,l)),p=J.mul(f,s),m=J.mul(J.mulN(f,p),u),h=J.mul(J.addN(i,i),p);J.isOdd(h)&&(h=J.neg(h));let g=J.mul(o,m),_=J.mul(h,g);if(!d||J.isOdd(_)||J.is0(g))throw Error(`invalid ristretto255 encoding 2`);return new e(new q(h,g,J.ONE,_))}static fromHex(t){return e.fromBytes(Ze(t))}toBytes(){let{X:e,Y:t,Z:n,T:r}=this.ep,i=J.mul(J.add(n,t),J.sub(n,t)),a=J.mul(e,t),o=J.sqr(a),{value:s}=Rn(J.mul(i,o)),c=J.mul(s,i),l=J.mul(s,a),u=J.mul(J.mulN(c,l),r),d;if(J.isOdd(J.mul(r,u))){let n=J.mul(t,In),r=J.mul(e,In);e=n,t=r,d=J.mul(c,Ln)}else d=l;J.isOdd(J.mul(e,u))&&(t=J.neg(t));let f=J.mul(J.subN(n,t),d);return J.isOdd(f)&&(f=J.neg(f)),J.toBytes(f)}equals(e){this.assertSame(e);let{X:t,Y:n}=this.ep,{X:r,Y:i}=e.ep,a=J.eql(J.mul(t,i),J.mul(n,r)),o=J.eql(J.mul(n,i),J.mul(t,r));return a||o}is0(){return this.equals(e.ZERO)}};let Hn=(Object.freeze(Vn.BASE),Object.freeze(Vn.ZERO),Object.freeze(Vn.prototype),Object.freeze(Vn),Object.freeze({Point:Vn})),Un=BigInt(2**32-1),Wn=BigInt(32);function Gn(e,t=!1){return t?{h:Number(e&Un),l:Number(e>>Wn&Un)}:{h:Number(e>>Wn&Un)|0,l:Number(e&Un)|0}}function Kn(e,t=!1){let n=e.length,r=new Uint32Array(n),i=new Uint32Array(n);for(let a=0;a<n;a++){let{h:n,l:o}=Gn(e[a],t);[r[a],i[a]]=[n,o]}return[r,i]}let qn=e=>e/2**32|0,Jn=e=>e>>>0;function Yn(e,t,n,r){let i=qn(n),a=Jn(n);e.setUint32(t,r?a:i,r),e.setUint32(t+4,r?i:a,r)}let Xn=(e,t,n)=>e>>>n,Zn=(e,t,n)=>e<<32-n|t>>>n,Y=(e,t,n)=>e>>>n|t<<32-n,X=(e,t,n)=>e<<32-n|t>>>n,Qn=(e,t,n)=>e<<64-n|t>>>n-32,$n=(e,t,n)=>e>>>n-32|t<<64-n;function Z(e,t,n,r){let i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:i|0}}let er=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),tr=(e,t,n,r)=>t+n+r+(e/2**32|0)|0,nr=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),rr=(e,t,n,r,i)=>t+n+r+i+(e/2**32|0)|0,ir=(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0),ar=(e,t,n,r,i,a)=>t+n+r+i+a+(e/2**32|0)|0;function or(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`&&`BYTES_PER_ELEMENT`in e&&e.BYTES_PER_ELEMENT===1}let sr=e=>e?`\"${e}\" `:``;function cr(e,t=``){if(typeof e!=`number`)throw TypeError(sr(t)+`expected number, got `+typeof e);if(!Number.isSafeInteger(e)||e<0)throw RangeError(sr(t)+`expected integer >= 0, got `+e);return e}function lr(e,t,n=``){if(or(e)&&(t===void 0||e.length===t))return e;t!==void 0&&cr(t,`length`);let r=or(e),i=t===void 0?``:` of length ${t}`,a=r?`length=${e.length}`:`type=${typeof e}`,o=sr(n)+`expected Uint8Array`+i+`, got `+a;throw r?RangeError(o):TypeError(o)}let ur=(e,t)=>{if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError((t===`object`?``:`\"${t}\" `)+`expected object, got type=`+typeof e)},dr=(e,t)=>{ur(e,t);let n=Object.getPrototypeOf(e);if(n!==Object.prototype&&n!==null)throw TypeError(`\"${t}\" expected plain object`);if(Object.hasOwn(e,`__proto__`))throw TypeError(`\"${t}.__proto__\" is not allowed`)};function fr(e,t=!0){if(e.destroyed)throw Error(`hash was destroyed`);if(t&&e.finished)throw Error(`digest() was already called`)}function pr(e,t){lr(e,void 0,`output`);let n=t.outputLen;if(!(e.length>=n))throw RangeError(`\"output\" expected length >= `+n)}function mr(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function hr(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function gr(...e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];lr(r),t+=r.length}let n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){let i=e[t];n.set(i,r),r+=i.length}return n}function _r(e,t,n=`opts`){return dr(e,`defaults`),t!==void 0&&dr(t,n),Object.assign(Object.create(null),e,t)}function vr(e,t={}){if(typeof e!=`function`)throw TypeError(`\"hashCons\" expected function, got type=`+typeof e);t=_r({},t,`info`);let n=(t,n)=>e(n).update(t).digest(),r=e(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.canXOF=r.canXOF,n.create=t=>e(t),Object.assign(n,t),Object.freeze(n)}let yr=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});var br=class{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,t,n,r){this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=hr(this.buffer)}update(e){fr(this),lr(e);let{view:t,buffer:n,blockLen:r}=this,i=e.length,a=!1;for(let o=0;o<i;){let s=Math.min(r-this.pos,i-o);if(s===r){let t=hr(e);for(;r<=i-o;o+=r)this.process(t,o);a=!0;continue}n.set(o===0&&s===i?e:e.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===r&&(this.process(t,0),this.pos=0,a=!0)}return this.length+=e.length,a&&this.roundClean(),this}digestInto(e){fr(this),pr(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:a}=this;t[a++]=128,t.fill(0,a),this.padOffset>r-a&&(this.process(n,0),t.fill(0)),Yn(n,r-8,this.length*8,i),this.process(n,0),this.roundClean();let o=e===t?n:hr(e),s=this.outputLen,c=s/4,l=this.get();if(s%4||c>l.length)throw Error(`invalid outputLen`);for(let e=0;e<c;e++)o.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneIntoMeta(e){let{buffer:t,length:n,finished:r,destroyed:i,pos:a}=this;return e.destroyed=i,e.finished=r,e.length=n,e.pos=a,a&&e.buffer.set(t),e}clone(){return this._cloneInto()}};let xr=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),Sr=Kn(`0x428a2f98d728ae22.0x7137449123ef65cd.0xb5c0fbcfec4d3b2f.0xe9b5dba58189dbbc.0x3956c25bf348b538.0x59f111f1b605d019.0x923f82a4af194f9b.0xab1c5ed5da6d8118.0xd807aa98a3030242.0x12835b0145706fbe.0x243185be4ee4b28c.0x550c7dc3d5ffb4e2.0x72be5d74f27b896f.0x80deb1fe3b1696b1.0x9bdc06a725c71235.0xc19bf174cf692694.0xe49b69c19ef14ad2.0xefbe4786384f25e3.0x0fc19dc68b8cd5b5.0x240ca1cc77ac9c65.0x2de92c6f592b0275.0x4a7484aa6ea6e483.0x5cb0a9dcbd41fbd4.0x76f988da831153b5.0x983e5152ee66dfab.0xa831c66d2db43210.0xb00327c898fb213f.0xbf597fc7beef0ee4.0xc6e00bf33da88fc2.0xd5a79147930aa725.0x06ca6351e003826f.0x142929670a0e6e70.0x27b70a8546d22ffc.0x2e1b21385c26c926.0x4d2c6dfc5ac42aed.0x53380d139d95b3df.0x650a73548baf63de.0x766a0abb3c77b2a8.0x81c2c92e47edaee6.0x92722c851482353b.0xa2bfe8a14cf10364.0xa81a664bbc423001.0xc24b8b70d0f89791.0xc76c51a30654be30.0xd192e819d6ef5218.0xd69906245565a910.0xf40e35855771202a.0x106aa07032bbd1b8.0x19a4c116b8d2d0c8.0x1e376c085141ab53.0x2748774cdf8eeb99.0x34b0bcb5e19b48a8.0x391c0cb3c5c95a63.0x4ed8aa4ae3418acb.0x5b9cca4f7763e373.0x682e6ff3d6b2b8a3.0x748f82ee5defb2fc.0x78a5636f43172f60.0x84c87814a1f0ab72.0x8cc702081a6439ec.0x90befffa23631e28.0xa4506cebde82bde9.0xbef9a3f7b2c67915.0xc67178f2e372532b.0xca273eceea26619c.0xd186b8c721c0c207.0xeada7dd6cde0eb1e.0xf57d4f7fee6ed178.0x06f067aa72176fba.0x0a637dc5a2c898a6.0x113f9804bef90dae.0x1b710b35131c471b.0x28db77f523047d84.0x32caab7b40c72493.0x3c9ebe0a15c9bebc.0x431d67c49c100d4c.0x4cc5d4becb3e42b6.0x597f299cfc657e2a.0x5fcb6fab3ad6faec.0x6c44198c4a475817`.split(`.`).map(e=>BigInt(e))),Cr=Sr[0],wr=Sr[1],Q=new Uint32Array(80),$=new Uint32Array(80);var Tr=class extends br{Ah=0;Al=0;Bh=0;Bl=0;Ch=0;Cl=0;Dh=0;Dl=0;Eh=0;El=0;Fh=0;Fl=0;Gh=0;Gl=0;Hh=0;Hl=0;constructor(e,t){super(128,e,16,!1),this.Ah=t[0]|0,this.Al=t[1]|0,this.Bh=t[2]|0,this.Bl=t[3]|0,this.Ch=t[4]|0,this.Cl=t[5]|0,this.Dh=t[6]|0,this.Dl=t[7]|0,this.Eh=t[8]|0,this.El=t[9]|0,this.Fh=t[10]|0,this.Fl=t[11]|0,this.Gh=t[12]|0,this.Gl=t[13]|0,this.Hh=t[14]|0,this.Hl=t[15]|0}get(){let{Ah:e,Al:t,Bh:n,Bl:r,Ch:i,Cl:a,Dh:o,Dl:s,Eh:c,El:l,Fh:u,Fl:d,Gh:f,Gl:p,Hh:m,Hl:h}=this;return[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h]}set(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=r|0,this.Ch=i|0,this.Cl=a|0,this.Dh=o|0,this.Dl=s|0,this.Eh=c|0,this.El=l|0,this.Fh=u|0,this.Fl=d|0,this.Gh=f|0,this.Gl=p|0,this.Hh=m|0,this.Hl=h|0}_cloneInto(e){return(e||=new this.constructor).set(...this.get()),this._cloneIntoMeta(e)}process(e,t){for(let n=0;n<16;n++,t+=4)Q[n]=e.getUint32(t),$[n]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=Q[e-15]|0,n=$[e-15]|0,r=Y(t,n,1)^Y(t,n,8)^Xn(t,n,7),i=X(t,n,1)^X(t,n,8)^Zn(t,n,7),a=Q[e-2]|0,o=$[e-2]|0,s=Y(a,o,19)^Qn(a,o,61)^Xn(a,o,6),c=X(a,o,19)^$n(a,o,61)^Zn(a,o,6),l=nr(i,c,$[e-7],$[e-16]),u=rr(l,r,s,Q[e-7],Q[e-16]);Q[e]=u|0,$[e]=l|0}let{Ah:n,Al:r,Bh:i,Bl:a,Ch:o,Cl:s,Dh:c,Dl:l,Eh:u,El:d,Fh:f,Fl:p,Gh:m,Gl:h,Hh:g,Hl:_}=this;for(let e=0;e<80;e++){let t=Y(u,d,14)^Y(u,d,18)^Qn(u,d,41),v=X(u,d,14)^X(u,d,18)^$n(u,d,41),y=u&f^~u&m,b=d&p^~d&h,x=ir(_,v,b,wr[e],$[e]),S=ar(x,g,t,y,Cr[e],Q[e]),C=x|0,w=Y(n,r,28)^Qn(n,r,34)^Qn(n,r,39),T=X(n,r,28)^$n(n,r,34)^$n(n,r,39),E=n&i^n&o^i&o,ee=r&a^r&s^a&s;g=m|0,_=h|0,m=f|0,h=p|0,f=u|0,p=d|0,{h:u,l:d}=Z(c|0,l|0,S|0,C|0),c=o|0,l=s|0,o=i|0,s=a|0,i=n|0,a=r|0;let D=er(C,T,ee);n=tr(D,S,w,E),r=D|0}({h:n,l:r}=Z(this.Ah|0,this.Al|0,n|0,r|0)),{h:i,l:a}=Z(this.Bh|0,this.Bl|0,i|0,a|0),{h:o,l:s}=Z(this.Ch|0,this.Cl|0,o|0,s|0),{h:c,l}=Z(this.Dh|0,this.Dl|0,c|0,l|0),{h:u,l:d}=Z(this.Eh|0,this.El|0,u|0,d|0),{h:f,l:p}=Z(this.Fh|0,this.Fl|0,f|0,p|0),{h:m,l:h}=Z(this.Gh|0,this.Gl|0,m|0,h|0),{h:g,l:_}=Z(this.Hh|0,this.Hl|0,g|0,_|0),this.set(n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_)}roundClean(){mr(Q,$)}destroy(){this.destroyed=!0,mr(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},Er=class extends Tr{constructor(){super(64,xr)}};let Dr=vr(()=>new Er,yr(3)),Or=BigInt(3);function kr(e,t,...n){if(!rt(t))throw TypeError(`${e}: Uint8Array expected`);if(n.length&&!n.includes(t.length))throw RangeError(`${e}: Uint8Array expected of length ${n}, not of length=${t.length}`)}function Ar(...e){for(let t of e)t.fill(0)}let jr=bt(256),Mr=e=>mt(e<<Or&jr,32),Nr=e=>B(e)>>Or;function Pr(e){kr(`seed`,e,32);let t=Dr(e);t[0]&=248,t[31]&=63,t[31]|=64;let n=Mr(Nr(t.subarray(0,32))),r=t.subarray(32,64),i=gr(n,r);return Ar(n,r,t),i}let Fr=He;function Ir(e,t=ke(),n=2048,r){return{password:Pe(Fr,x(e),x(t),{c:n,dkLen:64}),rounds:n,salt:t}}var Lr={256:Ve,512:Fr},Rr=Lr[256];Lr[512];var zr=`abandon|ability|able|about|above|absent|absorb|abstract|absurd|abuse|access|accident|account|accuse|achieve|acid|acoustic|acquire|across|act|action|actor|actress|actual|adapt|add|addict|address|adjust|admit|adult|advance|advice|aerobic|affair|afford|afraid|again|age|agent|agree|ahead|aim|air|airport|aisle|alarm|album|alcohol|alert|alien|all|alley|allow|almost|alone|alpha|already|also|alter|always|amateur|amazing|among|amount|amused|analyst|anchor|ancient|anger|angle|angry|animal|ankle|announce|annual|another|answer|antenna|antique|anxiety|any|apart|apology|appear|apple|approve|april|arch|arctic|area|arena|argue|arm|armed|armor|army|around|arrange|arrest|arrive|arrow|art|artefact|artist|artwork|ask|aspect|assault|asset|assist|assume|asthma|athlete|atom|attack|attend|attitude|attract|auction|audit|august|aunt|author|auto|autumn|average|avocado|avoid|awake|aware|away|awesome|awful|awkward|axis|baby|bachelor|bacon|badge|bag|balance|balcony|ball|bamboo|banana|banner|bar|barely|bargain|barrel|base|basic|basket|battle|beach|bean|beauty|because|become|beef|before|begin|behave|behind|believe|below|belt|bench|benefit|best|betray|better|between|beyond|bicycle|bid|bike|bind|biology|bird|birth|bitter|black|blade|blame|blanket|blast|bleak|bless|blind|blood|blossom|blouse|blue|blur|blush|board|boat|body|boil|bomb|bone|bonus|book|boost|border|boring|borrow|boss|bottom|bounce|box|boy|bracket|brain|brand|brass|brave|bread|breeze|brick|bridge|brief|bright|bring|brisk|broccoli|broken|bronze|broom|brother|brown|brush|bubble|buddy|budget|buffalo|build|bulb|bulk|bullet|bundle|bunker|burden|burger|burst|bus|business|busy|butter|buyer|buzz|cabbage|cabin|cable|cactus|cage|cake|call|calm|camera|camp|can|canal|cancel|candy|cannon|canoe|canvas|canyon|capable|capital|captain|car|carbon|card|cargo|carpet|carry|cart|case|cash|casino|castle|casual|cat|catalog|catch|category|cattle|caught|cause|caution|cave|ceiling|celery|cement|census|century|cereal|certain|chair|chalk|champion|change|chaos|chapter|charge|chase|chat|cheap|check|cheese|chef|cherry|chest|chicken|chief|child|chimney|choice|choose|chronic|chuckle|chunk|churn|cigar|cinnamon|circle|citizen|city|civil|claim|clap|clarify|claw|clay|clean|clerk|clever|click|client|cliff|climb|clinic|clip|clock|clog|close|cloth|cloud|clown|club|clump|cluster|clutch|coach|coast|coconut|code|coffee|coil|coin|collect|color|column|combine|come|comfort|comic|common|company|concert|conduct|confirm|congress|connect|consider|control|convince|cook|cool|copper|copy|coral|core|corn|correct|cost|cotton|couch|country|couple|course|cousin|cover|coyote|crack|cradle|craft|cram|crane|crash|crater|crawl|crazy|cream|credit|creek|crew|cricket|crime|crisp|critic|crop|cross|crouch|crowd|crucial|cruel|cruise|crumble|crunch|crush|cry|crystal|cube|culture|cup|cupboard|curious|current|curtain|curve|cushion|custom|cute|cycle|dad|damage|damp|dance|danger|daring|dash|daughter|dawn|day|deal|debate|debris|decade|december|decide|decline|decorate|decrease|deer|defense|define|defy|degree|delay|deliver|demand|demise|denial|dentist|deny|depart|depend|deposit|depth|deputy|derive|describe|desert|design|desk|despair|destroy|detail|detect|develop|device|devote|diagram|dial|diamond|diary|dice|diesel|diet|differ|digital|dignity|dilemma|dinner|dinosaur|direct|dirt|disagree|discover|disease|dish|dismiss|disorder|display|distance|divert|divide|divorce|dizzy|doctor|document|dog|doll|dolphin|domain|donate|donkey|donor|door|dose|double|dove|draft|dragon|drama|drastic|draw|dream|dress|drift|drill|drink|drip|drive|drop|drum|dry|duck|dumb|dune|during|dust|dutch|duty|dwarf|dynamic|eager|eagle|early|earn|earth|easily|east|easy|echo|ecology|economy|edge|edit|educate|effort|egg|eight|either|elbow|elder|electric|elegant|element|elephant|elevator|elite|else|embark|embody|embrace|emerge|emotion|employ|empower|empty|enable|enact|end|endless|endorse|enemy|energy|enforce|engage|engine|enhance|enjoy|enlist|enough|enrich|enroll|ensure|enter|entire|entry|envelope|episode|equal|equip|era|erase|erode|erosion|error|erupt|escape|essay|essence|estate|eternal|ethics|evidence|evil|evoke|evolve|exact|example|excess|exchange|excite|exclude|excuse|execute|exercise|exhaust|exhibit|exile|exist|exit|exotic|expand|expect|expire|explain|expose|express|extend|extra|eye|eyebrow|fabric|face|faculty|fade|faint|faith|fall|false|fame|family|famous|fan|fancy|fantasy|farm|fashion|fat|fatal|father|fatigue|fault|favorite|feature|february|federal|fee|feed|feel|female|fence|festival|fetch|fever|few|fiber|fiction|field|figure|file|film|filter|final|find|fine|finger|finish|fire|firm|first|fiscal|fish|fit|fitness|fix|flag|flame|flash|flat|flavor|flee|flight|flip|float|flock|floor|flower|fluid|flush|fly|foam|focus|fog|foil|fold|follow|food|foot|force|forest|forget|fork|fortune|forum|forward|fossil|foster|found|fox|fragile|frame|frequent|fresh|friend|fringe|frog|front|frost|frown|frozen|fruit|fuel|fun|funny|furnace|fury|future|gadget|gain|galaxy|gallery|game|gap|garage|garbage|garden|garlic|garment|gas|gasp|gate|gather|gauge|gaze|general|genius|genre|gentle|genuine|gesture|ghost|giant|gift|giggle|ginger|giraffe|girl|give|glad|glance|glare|glass|glide|glimpse|globe|gloom|glory|glove|glow|glue|goat|goddess|gold|good|goose|gorilla|gospel|gossip|govern|gown|grab|grace|grain|grant|grape|grass|gravity|great|green|grid|grief|grit|grocery|group|grow|grunt|guard|guess|guide|guilt|guitar|gun|gym|habit|hair|half|hammer|hamster|hand|happy|harbor|hard|harsh|harvest|hat|have|hawk|hazard|head|health|heart|heavy|hedgehog|height|hello|helmet|help|hen|hero|hidden|high|hill|hint|hip|hire|history|hobby|hockey|hold|hole|holiday|hollow|home|honey|hood|hope|horn|horror|horse|hospital|host|hotel|hour|hover|hub|huge|human|humble|humor|hundred|hungry|hunt|hurdle|hurry|hurt|husband|hybrid|ice|icon|idea|identify|idle|ignore|ill|illegal|illness|image|imitate|immense|immune|impact|impose|improve|impulse|inch|include|income|increase|index|indicate|indoor|industry|infant|inflict|inform|inhale|inherit|initial|inject|injury|inmate|inner|innocent|input|inquiry|insane|insect|inside|inspire|install|intact|interest|into|invest|invite|involve|iron|island|isolate|issue|item|ivory|jacket|jaguar|jar|jazz|jealous|jeans|jelly|jewel|job|join|joke|journey|joy|judge|juice|jump|jungle|junior|junk|just|kangaroo|keen|keep|ketchup|key|kick|kid|kidney|kind|kingdom|kiss|kit|kitchen|kite|kitten|kiwi|knee|knife|knock|know|lab|label|labor|ladder|lady|lake|lamp|language|laptop|large|later|latin|laugh|laundry|lava|law|lawn|lawsuit|layer|lazy|leader|leaf|learn|leave|lecture|left|leg|legal|legend|leisure|lemon|lend|length|lens|leopard|lesson|letter|level|liar|liberty|library|license|life|lift|light|like|limb|limit|link|lion|liquid|list|little|live|lizard|load|loan|lobster|local|lock|logic|lonely|long|loop|lottery|loud|lounge|love|loyal|lucky|luggage|lumber|lunar|lunch|luxury|lyrics|machine|mad|magic|magnet|maid|mail|main|major|make|mammal|man|manage|mandate|mango|mansion|manual|maple|marble|march|margin|marine|market|marriage|mask|mass|master|match|material|math|matrix|matter|maximum|maze|meadow|mean|measure|meat|mechanic|medal|media|melody|melt|member|memory|mention|menu|mercy|merge|merit|merry|mesh|message|metal|method|middle|midnight|milk|million|mimic|mind|minimum|minor|minute|miracle|mirror|misery|miss|mistake|mix|mixed|mixture|mobile|model|modify|mom|moment|monitor|monkey|monster|month|moon|moral|more|morning|mosquito|mother|motion|motor|mountain|mouse|move|movie|much|muffin|mule|multiply|muscle|museum|mushroom|music|must|mutual|myself|mystery|myth|naive|name|napkin|narrow|nasty|nation|nature|near|neck|need|negative|neglect|neither|nephew|nerve|nest|net|network|neutral|never|news|next|nice|night|noble|noise|nominee|noodle|normal|north|nose|notable|note|nothing|notice|novel|now|nuclear|number|nurse|nut|oak|obey|object|oblige|obscure|observe|obtain|obvious|occur|ocean|october|odor|off|offer|office|often|oil|okay|old|olive|olympic|omit|once|one|onion|online|only|open|opera|opinion|oppose|option|orange|orbit|orchard|order|ordinary|organ|orient|original|orphan|ostrich|other|outdoor|outer|output|outside|oval|oven|over|own|owner|oxygen|oyster|ozone|pact|paddle|page|pair|palace|palm|panda|panel|panic|panther|paper|parade|parent|park|parrot|party|pass|patch|path|patient|patrol|pattern|pause|pave|payment|peace|peanut|pear|peasant|pelican|pen|penalty|pencil|people|pepper|perfect|permit|person|pet|phone|photo|phrase|physical|piano|picnic|picture|piece|pig|pigeon|pill|pilot|pink|pioneer|pipe|pistol|pitch|pizza|place|planet|plastic|plate|play|please|pledge|pluck|plug|plunge|poem|poet|point|polar|pole|police|pond|pony|pool|popular|portion|position|possible|post|potato|pottery|poverty|powder|power|practice|praise|predict|prefer|prepare|present|pretty|prevent|price|pride|primary|print|priority|prison|private|prize|problem|process|produce|profit|program|project|promote|proof|property|prosper|protect|proud|provide|public|pudding|pull|pulp|pulse|pumpkin|punch|pupil|puppy|purchase|purity|purpose|purse|push|put|puzzle|pyramid|quality|quantum|quarter|question|quick|quit|quiz|quote|rabbit|raccoon|race|rack|radar|radio|rail|rain|raise|rally|ramp|ranch|random|range|rapid|rare|rate|rather|raven|raw|razor|ready|real|reason|rebel|rebuild|recall|receive|recipe|record|recycle|reduce|reflect|reform|refuse|region|regret|regular|reject|relax|release|relief|rely|remain|remember|remind|remove|render|renew|rent|reopen|repair|repeat|replace|report|require|rescue|resemble|resist|resource|response|result|retire|retreat|return|reunion|reveal|review|reward|rhythm|rib|ribbon|rice|rich|ride|ridge|rifle|right|rigid|ring|riot|ripple|risk|ritual|rival|river|road|roast|robot|robust|rocket|romance|roof|rookie|room|rose|rotate|rough|round|route|royal|rubber|rude|rug|rule|run|runway|rural|sad|saddle|sadness|safe|sail|salad|salmon|salon|salt|salute|same|sample|sand|satisfy|satoshi|sauce|sausage|save|say|scale|scan|scare|scatter|scene|scheme|school|science|scissors|scorpion|scout|scrap|screen|script|scrub|sea|search|season|seat|second|secret|section|security|seed|seek|segment|select|sell|seminar|senior|sense|sentence|series|service|session|settle|setup|seven|shadow|shaft|shallow|share|shed|shell|sheriff|shield|shift|shine|ship|shiver|shock|shoe|shoot|shop|short|shoulder|shove|shrimp|shrug|shuffle|shy|sibling|sick|side|siege|sight|sign|silent|silk|silly|silver|similar|simple|since|sing|siren|sister|situate|six|size|skate|sketch|ski|skill|skin|skirt|skull|slab|slam|sleep|slender|slice|slide|slight|slim|slogan|slot|slow|slush|small|smart|smile|smoke|smooth|snack|snake|snap|sniff|snow|soap|soccer|social|sock|soda|soft|solar|soldier|solid|solution|solve|someone|song|soon|sorry|sort|soul|sound|soup|source|south|space|spare|spatial|spawn|speak|special|speed|spell|spend|sphere|spice|spider|spike|spin|spirit|split|spoil|sponsor|spoon|sport|spot|spray|spread|spring|spy|square|squeeze|squirrel|stable|stadium|staff|stage|stairs|stamp|stand|start|state|stay|steak|steel|stem|step|stereo|stick|still|sting|stock|stomach|stone|stool|story|stove|strategy|street|strike|strong|struggle|student|stuff|stumble|style|subject|submit|subway|success|such|sudden|suffer|sugar|suggest|suit|summer|sun|sunny|sunset|super|supply|supreme|sure|surface|surge|surprise|surround|survey|suspect|sustain|swallow|swamp|swap|swarm|swear|sweet|swift|swim|swing|switch|sword|symbol|symptom|syrup|system|table|tackle|tag|tail|talent|talk|tank|tape|target|task|taste|tattoo|taxi|teach|team|tell|ten|tenant|tennis|tent|term|test|text|thank|that|theme|then|theory|there|they|thing|this|thought|three|thrive|throw|thumb|thunder|ticket|tide|tiger|tilt|timber|time|tiny|tip|tired|tissue|title|toast|tobacco|today|toddler|toe|together|toilet|token|tomato|tomorrow|tone|tongue|tonight|tool|tooth|top|topic|topple|torch|tornado|tortoise|toss|total|tourist|toward|tower|town|toy|track|trade|traffic|tragic|train|transfer|trap|trash|travel|tray|treat|tree|trend|trial|tribe|trick|trigger|trim|trip|trophy|trouble|truck|true|truly|trumpet|trust|truth|try|tube|tuition|tumble|tuna|tunnel|turkey|turn|turtle|twelve|twenty|twice|twin|twist|two|type|typical|ugly|umbrella|unable|unaware|uncle|uncover|under|undo|unfair|unfold|unhappy|uniform|unique|unit|universe|unknown|unlock|until|unusual|unveil|update|upgrade|uphold|upon|upper|upset|urban|urge|usage|use|used|useful|useless|usual|utility|vacant|vacuum|vague|valid|valley|valve|van|vanish|vapor|various|vast|vault|vehicle|velvet|vendor|venture|venue|verb|verify|version|very|vessel|veteran|viable|vibrant|vicious|victory|video|view|village|vintage|violin|virtual|virus|visa|visit|visual|vital|vivid|vocal|voice|void|volcano|volume|vote|voyage|wage|wagon|wait|walk|wall|walnut|want|warfare|warm|warrior|wash|wasp|waste|water|wave|way|wealth|weapon|wear|weasel|weather|web|wedding|weekend|weird|welcome|west|wet|whale|what|wheat|wheel|when|where|whip|whisper|wide|width|wife|wild|will|win|window|wine|wing|wink|winner|winter|wire|wisdom|wise|wish|witness|wolf|woman|wonder|wood|wool|word|work|world|worry|worth|wrap|wreck|wrestle|wrist|write|wrong|yard|year|yellow|you|young|youth|zebra|zero|zone|zoo`.split(`|`),Br=`Invalid mnemonic`,Vr=`Invalid entropy`,Hr=`Invalid mnemonic checksum`;function Ur(e){return(e||``).normalize(`NFKD`)}function Wr(e){return Number.parseInt(e,2)}function Gr(e){return e.map(e=>e.toString(2).padStart(8,`0`)).join(``)}function Kr(e){return Gr(Array.from(Rr(e))).slice(0,e.length*8/32)}function qr(e,t=zr){let n=Ur(e).split(` `);if(n.length%3!=0)throw Error(Br);let r=n.map(e=>{let n=t.indexOf(e);if(n===-1)throw Error(Br);return n.toString(2).padStart(11,`0`)}).join(``),i=Math.floor(r.length/33)*32,a=r.slice(0,i),o=r.slice(i),s=a.match(/(.{1,8})/g)?.map(Wr);if(!s||s.length%4!=0||s.length<16||s.length>32)throw Error(Vr);let c=x(s);if(Kr(c)!==o)throw Error(Hr);return c}function Jr(e,t=zr){if(e.length%4!=0||e.length<16||e.length>32)throw Error(Vr);let n=`${Gr(Array.from(e))}${Kr(e)}`.match(/(.{1,11})/g)?.map(e=>t[Wr(e)]);if(!n||n.length<12)throw Error(`Unable to map entropy to mnemonic`);return n.join(` `)}function Yr(e,t){try{qr(e,t)}catch{return!1}return!0}function Xr(e,t,n){return qr(e,t)}function Zr(e,t){return Yr(e,t)}function Qr(e,t=``,n,r){if(!Zr(e,n))throw Error(`Invalid bip39 mnemonic specified`);return Ir(Xr(e,n),b(`mnemonic${t}`)).password.slice(0,32)}function $r(e){let t=x(e);if(t.length!==32)throw Error(`Expected a seed of 32 bytes, found ${t.length}`);let n=Pr(t),r=B(n.subarray(0,32))>>3n,i=Hn.Point.BASE.multiply(r).toBytes();return{publicKey:new Uint8Array(i),secretKey:new Uint8Array(n)}}self.addEventListener(`message`,async e=>{let{taskId:t,task:n,data:r}=e.data;try{let e;switch(n){case`test`:e=`ready`;break;case`entropyToMnemonic`:if(!r.entropy)throw Error(`Entropy data is required`);e=Jr(r.entropy);break;case`entropyToKeypair`:if(!r.entropy)throw Error(`Entropy data is required`);e=ei(r.entropy);break;default:throw Error(`Unknown task: ${n}`)}let i={taskId:t,result:e};self.postMessage(i)}catch(e){let n={taskId:t,error:e instanceof Error?e.message:`Unknown error`};self.postMessage(n)}});function ei(e){let t=Jr(e),{publicKey:n,secretKey:r}=$r(Qr(t));return{mnemonic:t,publicKey:n,secretKey:r}}})();";
|
|
3
3
|
var blob = typeof self !== "undefined" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", jsContent], { type: "text/javascript;charset=utf-8" });
|
|
4
4
|
function WorkerWrapper(options) {
|
|
5
5
|
let objURL;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prosopo/account",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.88",
|
|
4
4
|
"description": "Services and Utils for Prosopo account gen and management",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -51,18 +51,18 @@
|
|
|
51
51
|
"@polkadot/extension-dapp": "0.63.1",
|
|
52
52
|
"@polkadot/extension-inject": "0.63.1",
|
|
53
53
|
"@polkadot/util": "13.5.7",
|
|
54
|
-
"@polkadot/util-crypto": "
|
|
55
|
-
"@prosopo/common": "3.1.
|
|
56
|
-
"@prosopo/fingerprint": "2.7.
|
|
57
|
-
"@prosopo/keyring": "2.9.
|
|
58
|
-
"@prosopo/types": "5.
|
|
59
|
-
"@prosopo/util": "3.3.
|
|
60
|
-
"@prosopo/util-crypto": "13.5.
|
|
54
|
+
"@polkadot/util-crypto": "14.0.3",
|
|
55
|
+
"@prosopo/common": "3.1.54",
|
|
56
|
+
"@prosopo/fingerprint": "2.7.42",
|
|
57
|
+
"@prosopo/keyring": "2.9.85",
|
|
58
|
+
"@prosopo/types": "5.7.0",
|
|
59
|
+
"@prosopo/util": "3.3.9",
|
|
60
|
+
"@prosopo/util-crypto": "13.5.31"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@prosopo/config": "3.3.
|
|
63
|
+
"@prosopo/config": "3.3.14",
|
|
64
64
|
"@types/node": "22.10.2",
|
|
65
|
-
"@vitest/coverage-v8": "4.1.
|
|
65
|
+
"@vitest/coverage-v8": "4.1.11",
|
|
66
66
|
"concurrently": "9.0.1",
|
|
67
67
|
"del-cli": "6.0.0",
|
|
68
68
|
"dotenv": "16.4.5",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"tsx": "4.20.3",
|
|
72
72
|
"typescript": "5.6.2",
|
|
73
73
|
"vite": "8.1.5",
|
|
74
|
-
"vitest": "4.1.
|
|
74
|
+
"vitest": "4.1.11"
|
|
75
75
|
},
|
|
76
76
|
"sideEffects": false
|
|
77
77
|
}
|