16 lines
327 KiB
JavaScript
16 lines
327 KiB
JavaScript
import{a as Ko}from"./chunk-G6S5B3Z4.js";import{a as gl,b as yl,c as wl,d as xl,e as _l,f as Sl}from"./chunk-IW7EDKR4.js";import{a as bl}from"./chunk-YHVKZE66.js";import{a as zf,b as pl,m as vl,n as ml}from"./chunk-O5S4AKID.js";import{A as cl,D as dl,F as ul,G as ll,J as Cf,K as hl,d as ol,e as al,f as fl,g as Ho}from"./chunk-QO4BJAKR.js";import{c as D,g as Df,o as P,p as I,q as O}from"./chunk-QTLWQ5AJ.js";var Uo=D(Fn=>{"use strict";P();O();Object.defineProperty(Fn,"__esModule",{value:!0});Fn.Assignable=Fn.Enum=void 0;var jo=class{constructor(t){if(Object.keys(t).length!==1)throw new Error("Enum can only take single value");Object.keys(t).map(r=>{this[r]=t[r],this.enum=r})}};Fn.Enum=jo;var Ro=class{constructor(t){Object.keys(t).map(r=>{this[r]=t[r]})}};Fn.Assignable=Ro});var Do=D(Tt=>{"use strict";P();O();Object.defineProperty(Tt,"__esModule",{value:!0});Tt.BinaryReader=Tt.BinaryWriter=Tt.BorshError=Tt.deserialize=Tt.serialize=Tt.base_decode=Tt.base_encode=void 0;var hn=Ko();Object.defineProperty(Tt,"base_encode",{enumerable:!0,get:function(){return hn.baseEncode}});Object.defineProperty(Tt,"base_decode",{enumerable:!0,get:function(){return hn.baseDecode}});Object.defineProperty(Tt,"serialize",{enumerable:!0,get:function(){return hn.serialize}});Object.defineProperty(Tt,"deserialize",{enumerable:!0,get:function(){return hn.deserialize}});Object.defineProperty(Tt,"BorshError",{enumerable:!0,get:function(){return hn.BorshError}});Object.defineProperty(Tt,"BinaryWriter",{enumerable:!0,get:function(){return hn.BinaryWriter}});Object.defineProperty(Tt,"BinaryReader",{enumerable:!0,get:function(){return hn.BinaryReader}})});var bn=D(X=>{"use strict";P();O();Object.defineProperty(X,"__esModule",{value:!0});X.bytes=X.stringToBytes=X.str=X.bytesToString=X.hex=X.utf8=X.bech32m=X.bech32=X.base58check=X.base58xmr=X.base58xrp=X.base58flickr=X.base58=X.base64url=X.base64=X.base32crockford=X.base32hex=X.base32=X.base16=X.utils=X.assertNumber=void 0;function Rr(e){if(!Number.isSafeInteger(e))throw new Error(`Wrong integer: ${e}`)}X.assertNumber=Rr;function or(...e){let t=(i,o)=>a=>i(o(a)),r=Array.from(e).reverse().reduce((i,o)=>i?t(i,o.encode):o.encode,void 0),n=e.reduce((i,o)=>i?t(i,o.decode):o.decode,void 0);return{encode:r,decode:n}}function yr(e){return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return t.map(r=>{if(Rr(r),r<0||r>=e.length)throw new Error(`Digit index outside alphabet: ${r} (alphabet: ${e.length})`);return e[r]})},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("alphabet.decode input should be array of strings");return t.map(r=>{if(typeof r!="string")throw new Error(`alphabet.decode: not string element=${r}`);let n=e.indexOf(r);if(n===-1)throw new Error(`Unknown letter: "${r}". Allowed: ${e}`);return n})}}}function vr(e=""){if(typeof e!="string")throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("join.encode input should be array of strings");for(let r of t)if(typeof r!="string")throw new Error(`join.encode: non-string input=${r}`);return t.join(e)},decode:t=>{if(typeof t!="string")throw new Error("join.decode input should be string");return t.split(e)}}}function Li(e,t="="){if(Rr(e),typeof t!="string")throw new Error("padding chr should be string");return{encode(r){if(!Array.isArray(r)||r.length&&typeof r[0]!="string")throw new Error("padding.encode input should be array of strings");for(let n of r)if(typeof n!="string")throw new Error(`padding.encode: non-string input=${n}`);for(;r.length*e%8;)r.push(t);return r},decode(r){if(!Array.isArray(r)||r.length&&typeof r[0]!="string")throw new Error("padding.encode input should be array of strings");for(let i of r)if(typeof i!="string")throw new Error(`padding.decode: non-string input=${i}`);let n=r.length;if(n*e%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;n>0&&r[n-1]===t;n--)if(!((n-1)*e%8))throw new Error("Invalid padding: string has too much padding");return r.slice(0,n)}}}function Gf(e){if(typeof e!="function")throw new Error("normalize fn should be function");return{encode:t=>t,decode:t=>e(t)}}function Ff(e,t,r){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(r<2)throw new Error(`convertRadix: wrong to=${r}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];let n=0,i=[],o=Array.from(e);for(o.forEach(a=>{if(Rr(a),a<0||a>=t)throw new Error(`Wrong integer: ${a}`)});;){let a=0,f=!0;for(let u=n;u<o.length;u++){let p=o[u],y=t*a+p;if(!Number.isSafeInteger(y)||t*a/t!==a||y-p!==t*a)throw new Error("convertRadix: carry overflow");if(a=y%r,o[u]=Math.floor(y/r),!Number.isSafeInteger(o[u])||o[u]*r+a!==y)throw new Error("convertRadix: carry overflow");if(f)o[u]?f=!1:n=u;else continue}if(i.push(a),f)break}for(let a=0;a<e.length-1&&e[a]===0;a++)i.push(0);return i.reverse()}var Xf=(e,t)=>t?Xf(t,e%t):e,cs=(e,t)=>e+(t-Xf(e,t));function Co(e,t,r,n){if(!Array.isArray(e))throw new Error("convertRadix2: data should be array");if(t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(r<=0||r>32)throw new Error(`convertRadix2: wrong to=${r}`);if(cs(t,r)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${r} carryBits=${cs(t,r)}`);let i=0,o=0,a=2**r-1,f=[];for(let u of e){if(Rr(u),u>=2**t)throw new Error(`convertRadix2: invalid data word=${u} from=${t}`);if(i=i<<t|u,o+t>32)throw new Error(`convertRadix2: carry overflow pos=${o} from=${t}`);for(o+=t;o>=r;o-=r)f.push((i>>o-r&a)>>>0);i&=2**o-1}if(i=i<<r-o&a,!n&&o>=t)throw new Error("Excess padding");if(!n&&i)throw new Error(`Non-zero padding: ${i}`);return n&&o>0&&f.push(i>>>0),f}function Yf(e){return Rr(e),{encode:t=>{if(!(t instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return Ff(Array.from(t),2**8,e)},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(Ff(t,e,2**8))}}}function qr(e,t=!1){if(Rr(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(cs(8,e)>32||cs(e,8)>32)throw new Error("radix2: carry overflow");return{encode:r=>{if(!(r instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return Co(Array.from(r),8,e,!t)},decode:r=>{if(!Array.isArray(r)||r.length&&typeof r[0]!="number")throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(Co(r,e,8,t))}}}function $f(e){if(typeof e!="function")throw new Error("unsafeWrapper fn should be function");return function(...t){try{return e.apply(null,t)}catch{}}}function Jf(e,t){if(Rr(e),typeof t!="function")throw new Error("checksum fn should be function");return{encode(r){if(!(r instanceof Uint8Array))throw new Error("checksum.encode: input should be Uint8Array");let n=t(r).slice(0,e),i=new Uint8Array(r.length+e);return i.set(r),i.set(n,r.length),i},decode(r){if(!(r instanceof Uint8Array))throw new Error("checksum.decode: input should be Uint8Array");let n=r.slice(0,-e),i=t(n).slice(0,e),o=r.slice(-e);for(let a=0;a<e;a++)if(i[a]!==o[a])throw new Error("Invalid checksum");return n}}}X.utils={alphabet:yr,chain:or,checksum:Jf,radix:Yf,radix2:qr,join:vr,padding:Li};X.base16=or(qr(4),yr("0123456789ABCDEF"),vr(""));X.base32=or(qr(5),yr("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),Li(5),vr(""));X.base32hex=or(qr(5),yr("0123456789ABCDEFGHIJKLMNOPQRSTUV"),Li(5),vr(""));X.base32crockford=or(qr(5),yr("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),vr(""),Gf(e=>e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")));X.base64=or(qr(6),yr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Li(6),vr(""));X.base64url=or(qr(6),yr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),Li(6),vr(""));var Fo=e=>or(Yf(58),yr(e),vr(""));X.base58=Fo("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");X.base58flickr=Fo("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ");X.base58xrp=Fo("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");var Vf=[0,2,3,5,6,7,9,10,11];X.base58xmr={encode(e){let t="";for(let r=0;r<e.length;r+=8){let n=e.subarray(r,r+8);t+=X.base58.encode(n).padStart(Vf[n.length],"1")}return t},decode(e){let t=[];for(let r=0;r<e.length;r+=11){let n=e.slice(r,r+11),i=Vf.indexOf(n.length),o=X.base58.decode(n);for(let a=0;a<o.length-i;a++)if(o[a]!==0)throw new Error("base58xmr: wrong padding");t=t.concat(Array.from(o.slice(o.length-i)))}return Uint8Array.from(t)}};var El=e=>or(Jf(4,t=>e(e(t))),X.base58);X.base58check=El;var zo=or(yr("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),vr("")),Wf=[996825010,642813549,513874426,1027748829,705979059];function ki(e){let t=e>>25,r=(e&33554431)<<5;for(let n=0;n<Wf.length;n++)(t>>n&1)===1&&(r^=Wf[n]);return r}function Zf(e,t,r=1){let n=e.length,i=1;for(let o=0;o<n;o++){let a=e.charCodeAt(o);if(a<33||a>126)throw new Error(`Invalid prefix (${e})`);i=ki(i)^a>>5}i=ki(i);for(let o=0;o<n;o++)i=ki(i)^e.charCodeAt(o)&31;for(let o of t)i=ki(i)^o;for(let o=0;o<6;o++)i=ki(i);return i^=r,zo.encode(Co([i%2**30],30,5,!1))}function Qf(e){let t=e==="bech32"?1:734539939,r=qr(5),n=r.decode,i=r.encode,o=$f(n);function a(y,g,x=90){if(typeof y!="string")throw new Error(`bech32.encode prefix should be string, not ${typeof y}`);if(!Array.isArray(g)||g.length&&typeof g[0]!="number")throw new Error(`bech32.encode words should be array of numbers, not ${typeof g}`);let w=y.length+7+g.length;if(x!==!1&&w>x)throw new TypeError(`Length ${w} exceeds limit ${x}`);return y=y.toLowerCase(),`${y}1${zo.encode(g)}${Zf(y,g,t)}`}function f(y,g=90){if(typeof y!="string")throw new Error(`bech32.decode input should be string, not ${typeof y}`);if(y.length<8||g!==!1&&y.length>g)throw new TypeError(`Wrong string length: ${y.length} (${y}). Expected (8..${g})`);let x=y.toLowerCase();if(y!==x&&y!==y.toUpperCase())throw new Error("String must be lowercase or uppercase");y=x;let w=y.lastIndexOf("1");if(w===0||w===-1)throw new Error('Letter "1" must be present between prefix and data only');let[_,v]=[y.slice(0,w),y.slice(w+1)];if(v.length<6)throw new Error("Data must be at least 6 characters long");let A=zo.decode(v).slice(0,-6),T=Zf(_,A,t);if(!v.endsWith(T))throw new Error(`Invalid checksum in ${y}: expected "${T}"`);return{prefix:_,words:A}}let u=$f(f);function p(y){let{prefix:g,words:x}=f(y,!1);return{prefix:g,words:x,bytes:n(x)}}return{encode:a,decode:f,decodeToBytes:p,decodeUnsafe:u,fromWords:n,fromWordsUnsafe:o,toWords:i}}X.bech32=Qf("bech32");X.bech32m=Qf("bech32m");X.utf8={encode:e=>new TextDecoder().decode(e),decode:e=>new TextEncoder().encode(e)};X.hex=or(qr(4),yr("0123456789abcdef"),vr(""),Gf(e=>{if(typeof e!="string"||e.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()}));var Ni={utf8:X.utf8,hex:X.hex,base16:X.base16,base32:X.base32,base64:X.base64,base64url:X.base64url,base58:X.base58,base58xmr:X.base58xmr},ec=`Invalid encoding type. Available types: ${Object.keys(Ni).join(", ")}`,Ml=(e,t)=>{if(typeof e!="string"||!Ni.hasOwnProperty(e))throw new TypeError(ec);if(!(t instanceof Uint8Array))throw new TypeError("bytesToString() expects Uint8Array");return Ni[e].encode(t)};X.bytesToString=Ml;X.str=X.bytesToString;var Al=(e,t)=>{if(!Ni.hasOwnProperty(e))throw new TypeError(ec);if(typeof t!="string")throw new TypeError("stringToBytes() expects string");return Ni[e].decode(t)};X.stringToBytes=Al;X.bytes=X.stringToBytes});var tc=D(Ur=>{"use strict";P();O();Object.defineProperty(Ur,"__esModule",{value:!0});Ur.base58=Ur.fromBase58=Ur.toBase58=void 0;var $o=bn();Object.defineProperty(Ur,"base58",{enumerable:!0,get:function(){return $o.base58}});function Bl(e){let t=I.Buffer.from(e);return $o.base58.encode(Uint8Array.from(t))}Ur.toBase58=Bl;function Il(e){return $o.base58.decode(e)}Ur.fromBase58=Il});var rc=D(ds=>{"use strict";P();O();Object.defineProperty(ds,"__esModule",{value:!0});ds.crypto=void 0;ds.crypto={node:void 0,web:typeof self=="object"&&"crypto"in self?self.crypto:void 0}});var It=D((ee,Hi)=>{"use strict";P();O();Object.defineProperty(ee,"__esModule",{value:!0});ee.randomBytes=ee.wrapConstructorWithOpts=ee.wrapConstructor=ee.checkOpts=ee.Hash=ee.assertHash=ee.assertBytes=ee.assertBool=ee.assertNumber=ee.concatBytes=ee.toBytes=ee.utf8ToBytes=ee.asyncLoop=ee.nextTick=ee.hexToBytes=ee.bytesToHex=ee.isLE=ee.rotr=ee.createView=ee.u32=ee.u8=void 0;var us=rc(),Pl=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength);ee.u8=Pl;var Ol=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4));ee.u32=Ol;var Tl=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);ee.createView=Tl;var ql=(e,t)=>e<<32-t|e>>>t;ee.rotr=ql;ee.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!ee.isLE)throw new Error("Non little-endian hardware is not supported");var kl=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Nl(e){let t="";for(let r=0;r<e.length;r++)t+=kl[e[r]];return t}ee.bytesToHex=Nl;function Ll(e){if(typeof e!="string")throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex");let t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){let n=r*2,i=e.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o))throw new Error("Invalid byte sequence");t[r]=o}return t}ee.hexToBytes=Ll;ee.nextTick=(()=>{let e=typeof Hi<"u"&&typeof Hi.require=="function"&&Hi.require.bind(Hi);try{if(e){let{setImmediate:t}=e("timers");return()=>new Promise(r=>t(r))}}catch{}return()=>new Promise(t=>setTimeout(t,0))})();async function Hl(e,t,r){let n=Date.now();for(let i=0;i<e;i++){r(i);let o=Date.now()-n;o>=0&&o<t||(await(0,ee.nextTick)(),n+=o)}}ee.asyncLoop=Hl;function nc(e){if(typeof e!="string")throw new TypeError(`utf8ToBytes expected string, got ${typeof e}`);return new TextEncoder().encode(e)}ee.utf8ToBytes=nc;function Zo(e){if(typeof e=="string"&&(e=nc(e)),!(e instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof e})`);return e}ee.toBytes=Zo;function Kl(...e){if(!e.every(n=>n instanceof Uint8Array))throw new Error("Uint8Array list expected");if(e.length===1)return e[0];let t=e.reduce((n,i)=>n+i.length,0),r=new Uint8Array(t);for(let n=0,i=0;n<e.length;n++){let o=e[n];r.set(o,i),i+=o.length}return r}ee.concatBytes=Kl;function Vo(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}ee.assertNumber=Vo;function jl(e){if(typeof e!="boolean")throw new Error(`Expected boolean, not ${e}`)}ee.assertBool=jl;function Rl(e,...t){if(!(e instanceof Uint8Array&&(!t.length||t.includes(e.length))))throw new TypeError(`Expected ${t} bytes, not ${typeof e} with length=${e.length}`)}ee.assertBytes=Rl;function Ul(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Vo(e.outputLen),Vo(e.blockLen)}ee.assertHash=Ul;var Wo=class{clone(){return this._cloneInto()}};ee.Hash=Wo;var Dl=e=>Object.prototype.toString.call(e)==="[object Object]"&&e.constructor===Object;function Cl(e,t){if(t!==void 0&&(typeof t!="object"||!Dl(t)))throw new TypeError("Options should be object or undefined");return Object.assign(e,t)}ee.checkOpts=Cl;function zl(e){let t=n=>e().update(Zo(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}ee.wrapConstructor=zl;function Fl(e){let t=(n,i)=>e(i).update(Zo(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}ee.wrapConstructorWithOpts=Fl;function $l(e=32){if(us.crypto.web)return us.crypto.web.getRandomValues(new Uint8Array(e));if(us.crypto.node)return new Uint8Array(us.crypto.node.randomBytes(e).buffer);throw new Error("The environment doesn't have randomBytes function")}ee.randomBytes=$l});var hs=D(ls=>{"use strict";P();O();Object.defineProperty(ls,"__esModule",{value:!0});ls.SHA2=void 0;var Ki=It();function Vl(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);let i=BigInt(32),o=BigInt(4294967295),a=Number(r>>i&o),f=Number(r&o),u=n?4:0,p=n?0:4;e.setUint32(t+u,a,n),e.setUint32(t+p,f,n)}var Go=class extends Ki.Hash{constructor(t,r,n,i){super(),this.blockLen=t,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=(0,Ki.createView)(this.buffer)}update(t){if(this.destroyed)throw new Error("instance is destroyed");let{view:r,buffer:n,blockLen:i,finished:o}=this;if(o)throw new Error("digest() was already called");t=(0,Ki.toBytes)(t);let a=t.length;for(let f=0;f<a;){let u=Math.min(i-this.pos,a-f);if(u===i){let p=(0,Ki.createView)(t);for(;i<=a-f;f+=i)this.process(p,f);continue}n.set(t.subarray(f,f+u),this.pos),this.pos+=u,f+=u,this.pos===i&&(this.process(r,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){if(this.destroyed)throw new Error("instance is destroyed");if(!(t instanceof Uint8Array)||t.length<this.outputLen)throw new Error("_Sha2: Invalid output buffer");if(this.finished)throw new Error("digest() was already called");this.finished=!0;let{buffer:r,view:n,blockLen:i,isLE:o}=this,{pos:a}=this;r[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>i-a&&(this.process(n,0),a=0);for(let u=a;u<i;u++)r[u]=0;Vl(n,i-8,BigInt(this.length*8),o),this.process(n,0);let f=(0,Ki.createView)(t);this.get().forEach((u,p)=>f.setUint32(4*p,u,o))}digest(){let{buffer:t,outputLen:r}=this;this.digestInto(t);let n=t.slice(0,r);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:r,buffer:n,length:i,finished:o,destroyed:a,pos:f}=this;return t.length=i,t.pos=f,t.finished=o,t.destroyed=a,i%r&&t.buffer.set(n),t}};ls.SHA2=Go});var $n=D(bs=>{"use strict";P();O();Object.defineProperty(bs,"__esModule",{value:!0});bs.sha256=void 0;var Wl=hs(),ar=It(),Zl=(e,t,r)=>e&t^~e&r,Gl=(e,t,r)=>e&t^e&r^t&r,Xl=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Dr=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Cr=new Uint32Array(64),Xo=class extends Wl.SHA2{constructor(){super(64,32,8,!1),this.A=Dr[0]|0,this.B=Dr[1]|0,this.C=Dr[2]|0,this.D=Dr[3]|0,this.E=Dr[4]|0,this.F=Dr[5]|0,this.G=Dr[6]|0,this.H=Dr[7]|0}get(){let{A:t,B:r,C:n,D:i,E:o,F:a,G:f,H:u}=this;return[t,r,n,i,o,a,f,u]}set(t,r,n,i,o,a,f,u){this.A=t|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=o|0,this.F=a|0,this.G=f|0,this.H=u|0}process(t,r){for(let g=0;g<16;g++,r+=4)Cr[g]=t.getUint32(r,!1);for(let g=16;g<64;g++){let x=Cr[g-15],w=Cr[g-2],_=(0,ar.rotr)(x,7)^(0,ar.rotr)(x,18)^x>>>3,v=(0,ar.rotr)(w,17)^(0,ar.rotr)(w,19)^w>>>10;Cr[g]=v+Cr[g-7]+_+Cr[g-16]|0}let{A:n,B:i,C:o,D:a,E:f,F:u,G:p,H:y}=this;for(let g=0;g<64;g++){let x=(0,ar.rotr)(f,6)^(0,ar.rotr)(f,11)^(0,ar.rotr)(f,25),w=y+x+Zl(f,u,p)+Xl[g]+Cr[g]|0,v=((0,ar.rotr)(n,2)^(0,ar.rotr)(n,13)^(0,ar.rotr)(n,22))+Gl(n,i,o)|0;y=p,p=u,u=f,f=a+w|0,a=o,o=i,i=n,n=w+v|0}n=n+this.A|0,i=i+this.B|0,o=o+this.C|0,a=a+this.D|0,f=f+this.E|0,u=u+this.F|0,p=p+this.G|0,y=y+this.H|0,this.set(n,i,o,a,f,u,p,y)}roundClean(){Cr.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};bs.sha256=(0,ar.wrapConstructor)(()=>new Xo)});var Vn=D(te=>{"use strict";P();O();Object.defineProperty(te,"__esModule",{value:!0});te.add5H=te.add5L=te.add4H=te.add4L=te.add3H=te.add3L=te.add=te.rotlBL=te.rotlBH=te.rotlSL=te.rotlSH=te.rotr32L=te.rotr32H=te.rotrBL=te.rotrBH=te.rotrSL=te.rotrSH=te.shrSL=te.shrSH=te.toBig=te.split=te.fromBig=void 0;var ps=BigInt(2**32-1),Yo=BigInt(32);function ic(e,t=!1){return t?{h:Number(e&ps),l:Number(e>>Yo&ps)}:{h:Number(e>>Yo&ps)|0,l:Number(e&ps)|0}}te.fromBig=ic;function Yl(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){let{h:o,l:a}=ic(e[i],t);[r[i],n[i]]=[o,a]}return[r,n]}te.split=Yl;var Jl=(e,t)=>BigInt(e>>>0)<<Yo|BigInt(t>>>0);te.toBig=Jl;var Ql=(e,t,r)=>e>>>r;te.shrSH=Ql;var eh=(e,t,r)=>e<<32-r|t>>>r;te.shrSL=eh;var th=(e,t,r)=>e>>>r|t<<32-r;te.rotrSH=th;var rh=(e,t,r)=>e<<32-r|t>>>r;te.rotrSL=rh;var nh=(e,t,r)=>e<<64-r|t>>>r-32;te.rotrBH=nh;var ih=(e,t,r)=>e>>>r-32|t<<64-r;te.rotrBL=ih;var sh=(e,t)=>t;te.rotr32H=sh;var oh=(e,t)=>e;te.rotr32L=oh;var ah=(e,t,r)=>e<<r|t>>>32-r;te.rotlSH=ah;var fh=(e,t,r)=>t<<r|e>>>32-r;te.rotlSL=fh;var ch=(e,t,r)=>t<<r-32|e>>>64-r;te.rotlBH=ch;var dh=(e,t,r)=>e<<r-32|t>>>64-r;te.rotlBL=dh;function uh(e,t,r,n){let i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:i|0}}te.add=uh;var lh=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);te.add3L=lh;var hh=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;te.add3H=hh;var bh=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);te.add4L=bh;var ph=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0;te.add4H=ph;var gh=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0);te.add5L=gh;var yh=(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0;te.add5H=yh});var gs=D(qt=>{"use strict";P();O();var vh=qt&&qt.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),mh=qt&&qt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),wh=qt&&qt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&vh(t,e,r);return mh(t,e),t};Object.defineProperty(qt,"__esModule",{value:!0});qt.sha384=qt.sha512_256=qt.sha512=qt.SHA512=void 0;var xh=hs(),se=wh(Vn()),ea=It(),[_h,Sh]=se.split(["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"].map(e=>BigInt(e))),zr=new Uint32Array(80),Fr=new Uint32Array(80),Wn=class extends xh.SHA2{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:t,Al:r,Bh:n,Bl:i,Ch:o,Cl:a,Dh:f,Dl:u,Eh:p,El:y,Fh:g,Fl:x,Gh:w,Gl:_,Hh:v,Hl:A}=this;return[t,r,n,i,o,a,f,u,p,y,g,x,w,_,v,A]}set(t,r,n,i,o,a,f,u,p,y,g,x,w,_,v,A){this.Ah=t|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=o|0,this.Cl=a|0,this.Dh=f|0,this.Dl=u|0,this.Eh=p|0,this.El=y|0,this.Fh=g|0,this.Fl=x|0,this.Gh=w|0,this.Gl=_|0,this.Hh=v|0,this.Hl=A|0}process(t,r){for(let q=0;q<16;q++,r+=4)zr[q]=t.getUint32(r),Fr[q]=t.getUint32(r+=4);for(let q=16;q<80;q++){let K=zr[q-15]|0,L=Fr[q-15]|0,k=se.rotrSH(K,L,1)^se.rotrSH(K,L,8)^se.shrSH(K,L,7),j=se.rotrSL(K,L,1)^se.rotrSL(K,L,8)^se.shrSL(K,L,7),H=zr[q-2]|0,G=Fr[q-2]|0,M=se.rotrSH(H,G,19)^se.rotrBH(H,G,61)^se.shrSH(H,G,6),s=se.rotrSL(H,G,19)^se.rotrBL(H,G,61)^se.shrSL(H,G,6),l=se.add4L(j,s,Fr[q-7],Fr[q-16]),h=se.add4H(l,k,M,zr[q-7],zr[q-16]);zr[q]=h|0,Fr[q]=l|0}let{Ah:n,Al:i,Bh:o,Bl:a,Ch:f,Cl:u,Dh:p,Dl:y,Eh:g,El:x,Fh:w,Fl:_,Gh:v,Gl:A,Hh:T,Hl:N}=this;for(let q=0;q<80;q++){let K=se.rotrSH(g,x,14)^se.rotrSH(g,x,18)^se.rotrBH(g,x,41),L=se.rotrSL(g,x,14)^se.rotrSL(g,x,18)^se.rotrBL(g,x,41),k=g&w^~g&v,j=x&_^~x&A,H=se.add5L(N,L,j,Sh[q],Fr[q]),G=se.add5H(H,T,K,k,_h[q],zr[q]),M=H|0,s=se.rotrSH(n,i,28)^se.rotrBH(n,i,34)^se.rotrBH(n,i,39),l=se.rotrSL(n,i,28)^se.rotrBL(n,i,34)^se.rotrBL(n,i,39),h=n&o^n&f^o&f,d=i&a^i&u^a&u;T=v|0,N=A|0,v=w|0,A=_|0,w=g|0,_=x|0,{h:g,l:x}=se.add(p|0,y|0,G|0,M|0),p=f|0,y=u|0,f=o|0,u=a|0,o=n|0,a=i|0;let b=se.add3L(M,l,d);n=se.add3H(b,G,s,h),i=b|0}({h:n,l:i}=se.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:o,l:a}=se.add(this.Bh|0,this.Bl|0,o|0,a|0),{h:f,l:u}=se.add(this.Ch|0,this.Cl|0,f|0,u|0),{h:p,l:y}=se.add(this.Dh|0,this.Dl|0,p|0,y|0),{h:g,l:x}=se.add(this.Eh|0,this.El|0,g|0,x|0),{h:w,l:_}=se.add(this.Fh|0,this.Fl|0,w|0,_|0),{h:v,l:A}=se.add(this.Gh|0,this.Gl|0,v|0,A|0),{h:T,l:N}=se.add(this.Hh|0,this.Hl|0,T|0,N|0),this.set(n,i,o,a,f,u,p,y,g,x,w,_,v,A,T,N)}roundClean(){zr.fill(0),Fr.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};qt.SHA512=Wn;var Jo=class extends Wn{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}},Qo=class extends Wn{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}};qt.sha512=(0,ea.wrapConstructor)(()=>new Wn);qt.sha512_256=(0,ea.wrapConstructor)(()=>new Jo);qt.sha384=(0,ea.wrapConstructor)(()=>new Qo)});var na=D(Zn=>{"use strict";P();O();Object.defineProperty(Zn,"__esModule",{value:!0});Zn.ripemd160=Zn.RIPEMD160=void 0;var Eh=hs(),Mh=It(),Ah=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),oc=Uint8Array.from({length:16},(e,t)=>t),Bh=oc.map(e=>(9*e+5)%16),ta=[oc],ra=[Bh];for(let e=0;e<4;e++)for(let t of[ta,ra])t.push(t[e].map(r=>Ah[r]));var ac=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(e=>new Uint8Array(e)),Ih=ta.map((e,t)=>e.map(r=>ac[t][r])),Ph=ra.map((e,t)=>e.map(r=>ac[t][r])),Oh=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),Th=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),ys=(e,t)=>e<<t|e>>>32-t;function sc(e,t,r,n){return e===0?t^r^n:e===1?t&r|~t&n:e===2?(t|~r)^n:e===3?t&n|r&~n:t^(r|~n)}var vs=new Uint32Array(16),ms=class extends Eh.SHA2{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){let{h0:t,h1:r,h2:n,h3:i,h4:o}=this;return[t,r,n,i,o]}set(t,r,n,i,o){this.h0=t|0,this.h1=r|0,this.h2=n|0,this.h3=i|0,this.h4=o|0}process(t,r){for(let w=0;w<16;w++,r+=4)vs[w]=t.getUint32(r,!0);let n=this.h0|0,i=n,o=this.h1|0,a=o,f=this.h2|0,u=f,p=this.h3|0,y=p,g=this.h4|0,x=g;for(let w=0;w<5;w++){let _=4-w,v=Oh[w],A=Th[w],T=ta[w],N=ra[w],q=Ih[w],K=Ph[w];for(let L=0;L<16;L++){let k=ys(n+sc(w,o,f,p)+vs[T[L]]+v,q[L])+g|0;n=g,g=p,p=ys(f,10)|0,f=o,o=k}for(let L=0;L<16;L++){let k=ys(i+sc(_,a,u,y)+vs[N[L]]+A,K[L])+x|0;i=x,x=y,y=ys(u,10)|0,u=a,a=k}}this.set(this.h1+f+y|0,this.h2+p+x|0,this.h3+g+i|0,this.h4+n+a|0,this.h0+o+u|0)}roundClean(){vs.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}};Zn.RIPEMD160=ms;Zn.ripemd160=(0,Mh.wrapConstructor)(()=>new ms)});var ws=D(le=>{"use strict";P();O();var qh=le&&le.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),kh=le&&le.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Nh=le&&le.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&qh(t,e,r);return kh(t,e),t};Object.defineProperty(le,"__esModule",{value:!0});le.shake256=le.shake128=le.keccak_512=le.keccak_384=le.keccak_256=le.keccak_224=le.sha3_512=le.sha3_384=le.sha3_256=le.sha3_224=le.Keccak=le.keccakP=void 0;var Ri=Nh(Vn()),pn=It(),[dc,uc,lc]=[[],[],[]],Lh=BigInt(0),ji=BigInt(1),Hh=BigInt(2),Kh=BigInt(7),jh=BigInt(256),Rh=BigInt(113);for(let e=0,t=ji,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],dc.push(2*(5*n+r)),uc.push((e+1)*(e+2)/2%64);let i=Lh;for(let o=0;o<7;o++)t=(t<<ji^(t>>Kh)*Rh)%jh,t&Hh&&(i^=ji<<(ji<<BigInt(o))-ji);lc.push(i)}var[Uh,Dh]=Ri.split(lc,!0),fc=(e,t,r)=>r>32?Ri.rotlBH(e,t,r):Ri.rotlSH(e,t,r),cc=(e,t,r)=>r>32?Ri.rotlBL(e,t,r):Ri.rotlSL(e,t,r);function hc(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let a=0;a<10;a++)r[a]=e[a]^e[a+10]^e[a+20]^e[a+30]^e[a+40];for(let a=0;a<10;a+=2){let f=(a+8)%10,u=(a+2)%10,p=r[u],y=r[u+1],g=fc(p,y,1)^r[f],x=cc(p,y,1)^r[f+1];for(let w=0;w<50;w+=10)e[a+w]^=g,e[a+w+1]^=x}let i=e[2],o=e[3];for(let a=0;a<24;a++){let f=uc[a],u=fc(i,o,f),p=cc(i,o,f),y=dc[a];i=e[y],o=e[y+1],e[y]=u,e[y+1]=p}for(let a=0;a<50;a+=10){for(let f=0;f<10;f++)r[f]=e[a+f];for(let f=0;f<10;f++)e[a+f]^=~r[(f+2)%10]&r[(f+4)%10]}e[0]^=Uh[n],e[1]^=Dh[n]}r.fill(0)}le.keccakP=hc;var gn=class extends pn.Hash{constructor(t,r,n,i=!1,o=24){if(super(),this.blockLen=t,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,pn.assertNumber)(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,pn.u32)(this.state)}keccak(){hc(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){if(this.destroyed)throw new Error("instance is destroyed");if(this.finished)throw new Error("digest() was already called");let{blockLen:r,state:n}=this;t=(0,pn.toBytes)(t);let i=t.length;for(let o=0;o<i;){let a=Math.min(r-this.pos,i-o);for(let f=0;f<a;f++)n[this.pos++]^=t[o++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:r,pos:n,blockLen:i}=this;t[n]^=r,(r&128)!==0&&n===i-1&&this.keccak(),t[i-1]^=128,this.keccak()}writeInto(t){if(this.destroyed)throw new Error("instance is destroyed");if(!(t instanceof Uint8Array))throw new Error("Keccak: invalid output buffer");this.finish();for(let r=0,n=t.length;r<n;){this.posOut>=this.blockLen&&this.keccak();let i=Math.min(this.blockLen-this.posOut,n-r);t.set(this.state.subarray(this.posOut,this.posOut+i),r),this.posOut+=i,r+=i}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return(0,pn.assertNumber)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(t.length<this.outputLen)throw new Error("Keccak: invalid output buffer");if(this.finished)throw new Error("digest() was already called");return this.finish(),this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:r,suffix:n,outputLen:i,rounds:o,enableXOF:a}=this;return t||(t=new gn(r,n,i,a,o)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=o,t.suffix=n,t.outputLen=i,t.enableXOF=a,t.destroyed=this.destroyed,t}};le.Keccak=gn;var $r=(e,t,r)=>(0,pn.wrapConstructor)(()=>new gn(t,e,r));le.sha3_224=$r(6,144,224/8);le.sha3_256=$r(6,136,256/8);le.sha3_384=$r(6,104,384/8);le.sha3_512=$r(6,72,512/8);le.keccak_224=$r(1,144,224/8);le.keccak_256=$r(1,136,256/8);le.keccak_384=$r(1,104,384/8);le.keccak_512=$r(1,72,512/8);var bc=(e,t,r)=>(0,pn.wrapConstructorWithOpts)((n={})=>new gn(t,e,n.dkLen!==void 0?n.dkLen:r,!0));le.shake128=bc(31,168,128/8);le.shake256=bc(31,136,256/8)});var xs=D(Gn=>{"use strict";P();O();Object.defineProperty(Gn,"__esModule",{value:!0});Gn.BLAKE2=Gn.SIGMA=void 0;var yn=It();Gn.SIGMA=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3]);var ia=class extends yn.Hash{constructor(t,r,n={},i,o,a){if(super(),this.blockLen=t,this.outputLen=r,this.length=0,this.pos=0,this.finished=!1,this.destroyed=!1,(0,yn.assertNumber)(t),(0,yn.assertNumber)(r),(0,yn.assertNumber)(i),r<0||r>i)throw new Error("Blake2: outputLen bigger than keyLen");if(n.key!==void 0&&(n.key.length<1||n.key.length>i))throw new Error(`Key should be up 1..${i} byte long or undefined`);if(n.salt!==void 0&&n.salt.length!==o)throw new Error(`Salt should be ${o} byte long or undefined`);if(n.personalization!==void 0&&n.personalization.length!==a)throw new Error(`Personalization should be ${a} byte long or undefined`);this.buffer32=(0,yn.u32)(this.buffer=new Uint8Array(t))}update(t){if(this.destroyed)throw new Error("instance is destroyed");let{finished:r,blockLen:n,buffer:i,buffer32:o}=this;if(r)throw new Error("digest() was already called");t=(0,yn.toBytes)(t);let a=t.length;for(let f=0;f<a;){this.pos===n&&(this.compress(o,0,!1),this.pos=0);let u=Math.min(n-this.pos,a-f),p=t.byteOffset+f;if(u===n&&!(p%4)&&f+u<a){let y=new Uint32Array(t.buffer,p,Math.floor((a-f)/4));for(let g=0;f+n<a;g+=o.length,f+=n)this.length+=n,this.compress(y,g,!1);continue}i.set(t.subarray(f,f+u),this.pos),this.pos+=u,this.length+=u,f+=u}return this}digestInto(t){if(this.destroyed)throw new Error("instance is destroyed");if(!(t instanceof Uint8Array)||t.length<this.outputLen)throw new Error("_Blake2: Invalid output buffer");let{finished:r,pos:n,buffer32:i}=this;if(r)throw new Error("digest() was already called");this.finished=!0,this.buffer.subarray(n).fill(0),this.compress(i,0,!0);let o=(0,yn.u32)(t);this.get().forEach((a,f)=>o[f]=a)}digest(){let{buffer:t,outputLen:r}=this;this.digestInto(t);let n=t.slice(0,r);return this.destroy(),n}_cloneInto(t){let{buffer:r,length:n,finished:i,destroyed:o,outputLen:a,pos:f}=this;return t||(t=new this.constructor({dkLen:a})),t.set(...this.get()),t.length=n,t.finished=i,t.destroyed=o,t.outputLen=a,t.buffer.set(r),t.pos=f,t}};Gn.BLAKE2=ia});var oa=D(mr=>{"use strict";P();O();var Ch=mr&&mr.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),zh=mr&&mr.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),gc=mr&&mr.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Ch(t,e,r);return zh(t,e),t};Object.defineProperty(mr,"__esModule",{value:!0});mr.blake2b=void 0;var pc=gc(xs()),Rt=gc(Vn()),Xn=It(),vt=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),z=new Uint32Array(32);function Vr(e,t,r,n,i,o){let a=i[o],f=i[o+1],u=z[2*e],p=z[2*e+1],y=z[2*t],g=z[2*t+1],x=z[2*r],w=z[2*r+1],_=z[2*n],v=z[2*n+1],A=Rt.add3L(u,y,a);p=Rt.add3H(A,p,g,f),u=A|0,{Dh:v,Dl:_}={Dh:v^p,Dl:_^u},{Dh:v,Dl:_}={Dh:Rt.rotr32H(v,_),Dl:Rt.rotr32L(v,_)},{h:w,l:x}=Rt.add(w,x,v,_),{Bh:g,Bl:y}={Bh:g^w,Bl:y^x},{Bh:g,Bl:y}={Bh:Rt.rotrSH(g,y,24),Bl:Rt.rotrSL(g,y,24)},z[2*e]=u,z[2*e+1]=p,z[2*t]=y,z[2*t+1]=g,z[2*r]=x,z[2*r+1]=w,z[2*n]=_,z[2*n+1]=v}function Wr(e,t,r,n,i,o){let a=i[o],f=i[o+1],u=z[2*e],p=z[2*e+1],y=z[2*t],g=z[2*t+1],x=z[2*r],w=z[2*r+1],_=z[2*n],v=z[2*n+1],A=Rt.add3L(u,y,a);p=Rt.add3H(A,p,g,f),u=A|0,{Dh:v,Dl:_}={Dh:v^p,Dl:_^u},{Dh:v,Dl:_}={Dh:Rt.rotrSH(v,_,16),Dl:Rt.rotrSL(v,_,16)},{h:w,l:x}=Rt.add(w,x,v,_),{Bh:g,Bl:y}={Bh:g^w,Bl:y^x},{Bh:g,Bl:y}={Bh:Rt.rotrBH(g,y,63),Bl:Rt.rotrBL(g,y,63)},z[2*e]=u,z[2*e+1]=p,z[2*t]=y,z[2*t+1]=g,z[2*r]=x,z[2*r+1]=w,z[2*n]=_,z[2*n+1]=v}var sa=class extends pc.BLAKE2{constructor(t={}){super(128,t.dkLen===void 0?64:t.dkLen,t,64,16,16),this.v0l=vt[0]|0,this.v0h=vt[1]|0,this.v1l=vt[2]|0,this.v1h=vt[3]|0,this.v2l=vt[4]|0,this.v2h=vt[5]|0,this.v3l=vt[6]|0,this.v3h=vt[7]|0,this.v4l=vt[8]|0,this.v4h=vt[9]|0,this.v5l=vt[10]|0,this.v5h=vt[11]|0,this.v6l=vt[12]|0,this.v6h=vt[13]|0,this.v7l=vt[14]|0,this.v7h=vt[15]|0;let r=t.key?t.key.length:0;if(this.v0l^=this.outputLen|r<<8|1<<16|1<<24,t.salt){let n=(0,Xn.u32)((0,Xn.toBytes)(t.salt));this.v4l^=n[0],this.v4h^=n[1],this.v5l^=n[2],this.v5h^=n[3]}if(t.personalization){let n=(0,Xn.u32)((0,Xn.toBytes)(t.personalization));this.v6l^=n[0],this.v6h^=n[1],this.v7l^=n[2],this.v7h^=n[3]}if(t.key){let n=new Uint8Array(this.blockLen);n.set((0,Xn.toBytes)(t.key)),this.update(n)}}get(){let{v0l:t,v0h:r,v1l:n,v1h:i,v2l:o,v2h:a,v3l:f,v3h:u,v4l:p,v4h:y,v5l:g,v5h:x,v6l:w,v6h:_,v7l:v,v7h:A}=this;return[t,r,n,i,o,a,f,u,p,y,g,x,w,_,v,A]}set(t,r,n,i,o,a,f,u,p,y,g,x,w,_,v,A){this.v0l=t|0,this.v0h=r|0,this.v1l=n|0,this.v1h=i|0,this.v2l=o|0,this.v2h=a|0,this.v3l=f|0,this.v3h=u|0,this.v4l=p|0,this.v4h=y|0,this.v5l=g|0,this.v5h=x|0,this.v6l=w|0,this.v6h=_|0,this.v7l=v|0,this.v7h=A|0}compress(t,r,n){this.get().forEach((u,p)=>z[p]=u),z.set(vt,16);let{h:i,l:o}=Rt.fromBig(BigInt(this.length));z[24]=vt[8]^o,z[25]=vt[9]^i,n&&(z[28]=~z[28],z[29]=~z[29]);let a=0,f=pc.SIGMA;for(let u=0;u<12;u++)Vr(0,4,8,12,t,r+2*f[a++]),Wr(0,4,8,12,t,r+2*f[a++]),Vr(1,5,9,13,t,r+2*f[a++]),Wr(1,5,9,13,t,r+2*f[a++]),Vr(2,6,10,14,t,r+2*f[a++]),Wr(2,6,10,14,t,r+2*f[a++]),Vr(3,7,11,15,t,r+2*f[a++]),Wr(3,7,11,15,t,r+2*f[a++]),Vr(0,5,10,15,t,r+2*f[a++]),Wr(0,5,10,15,t,r+2*f[a++]),Vr(1,6,11,12,t,r+2*f[a++]),Wr(1,6,11,12,t,r+2*f[a++]),Vr(2,7,8,13,t,r+2*f[a++]),Wr(2,7,8,13,t,r+2*f[a++]),Vr(3,4,9,14,t,r+2*f[a++]),Wr(3,4,9,14,t,r+2*f[a++]);this.v0l^=z[0]^z[16],this.v0h^=z[1]^z[17],this.v1l^=z[2]^z[18],this.v1h^=z[3]^z[19],this.v2l^=z[4]^z[20],this.v2h^=z[5]^z[21],this.v3l^=z[6]^z[22],this.v3h^=z[7]^z[23],this.v4l^=z[8]^z[24],this.v4h^=z[9]^z[25],this.v5l^=z[10]^z[26],this.v5h^=z[11]^z[27],this.v6l^=z[12]^z[28],this.v6h^=z[13]^z[29],this.v7l^=z[14]^z[30],this.v7h^=z[15]^z[31],z.fill(0)}destroy(){this.destroyed=!0,this.buffer32.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};mr.blake2b=(0,Xn.wrapConstructorWithOpts)(e=>new sa(e))});var Ui=D(_e=>{"use strict";P();O();Object.defineProperty(_e,"__esModule",{value:!0});_e.sha3_512=_e.sha3_256=_e.ripemd160=_e.sha512=_e.sha256=_e.magicHash=_e.blake2=_e.keccak256=_e.keccak=_e.hash160=_e.doubleSha256=void 0;var _s=$n();Object.defineProperty(_e,"sha256",{enumerable:!0,get:function(){return _s.sha256}});var Fh=gs();Object.defineProperty(_e,"sha512",{enumerable:!0,get:function(){return Fh.sha512}});var vc=na();Object.defineProperty(_e,"ripemd160",{enumerable:!0,get:function(){return vc.ripemd160}});var Yn=ws();Object.defineProperty(_e,"sha3_256",{enumerable:!0,get:function(){return Yn.sha3_256}});Object.defineProperty(_e,"sha3_512",{enumerable:!0,get:function(){return Yn.sha3_512}});var $h=oa();function mc(e){let t=(0,_s.sha256)(e);return(0,_s.sha256)(t)}_e.doubleSha256=mc;function Vh(e){let t=(0,_s.sha256)(e);return(0,vc.ripemd160)(t)}_e.hash160=Vh;var Wh=function(e,t=256){let r=I.Buffer.from(e);switch(t){case 224:return I.Buffer.from((0,Yn.keccak_224)(r));case 256:return I.Buffer.from((0,Yn.keccak_256)(r));case 384:return I.Buffer.from((0,Yn.keccak_384)(r));case 512:return I.Buffer.from((0,Yn.keccak_512)(r));default:throw new Error(`Invald algorithm: keccak${t}`)}};_e.keccak=Wh;var Zh=function(e){return(0,_e.keccak)(e)};_e.keccak256=Zh;function Gh(e,t,r){let n=Math.ceil(t/8);return(0,$h.blake2b)(e,{dkLen:n,key:r})}_e.blake2=Gh;function yc(e){let t;return e<253?(t=I.Buffer.alloc(1),t.writeUInt8(e,0)):e<65536?(t=I.Buffer.alloc(1+2),t.writeUInt8(253,0),t.writeUInt16LE(e,1)):e<4294967296?(t=I.Buffer.alloc(1+4),t.writeUInt8(254,0),t.writeUInt32LE(e,1)):(t=I.Buffer.alloc(1+8),t.writeUInt8(255,0),t.writeInt32LE(e&-1,1),t.writeUInt32LE(Math.floor(e/4294967296),5)),t}var Xh=I.Buffer.from(`Bitcoin Signed Message:
|
||
`);function Yh(e,t){let r=t?I.Buffer.from(t,"utf8"):Xh,n=yc(r.length),i=I.Buffer.from(e),o=yc(i.length),a=I.Buffer.concat([n,r,o,i]);return mc(a)}_e.magicHash=Yh});var _c=D(Jn=>{"use strict";P();O();Object.defineProperty(Jn,"__esModule",{value:!0});Jn.fromBase58Check=Jn.toBase58Check=void 0;var wc=Ui(),lg=cl(),xc=bn();function Jh(e){return(0,xc.base58check)(wc.sha256).encode(I.Buffer.from(e))}Jn.toBase58Check=Jh;function Qh(e){let t=(0,xc.base58check)(wc.sha256);return I.Buffer.from(t.decode(e))}Jn.fromBase58Check=Qh});var Sc=D(Qn=>{"use strict";P();O();Object.defineProperty(Qn,"__esModule",{value:!0});Qn.fromBech32=Qn.toBech32=void 0;var Ss=bn();function e1(e,t,r){let n=I.Buffer.from(t),i=Ss.bech32.toWords(Uint8Array.from(n));return Ss.bech32.encode(e,i,r)}Qn.toBech32=e1;function t1(e,t){let r=Ss.bech32.decode(e,t),n=Ss.bech32.fromWords(r.words);return[r.prefix,I.Buffer.from(n)]}Qn.fromBech32=t1});var Ec=D(wr=>{"use strict";P();O();Object.defineProperty(wr,"__esModule",{value:!0});wr.isHexPrefixed=wr.stripHexPrefix=wr.fromHex=wr.toHex=void 0;function r1(e,t=!1){let r=I.Buffer.from(e);return t?"0x"+r.toString("hex"):r.toString("hex")}wr.toHex=r1;function n1(e){return e.startsWith("0x")&&(e=e.substring(2)),I.Buffer.from(e,"hex")}wr.fromHex=n1;function i1(e){return e.startsWith("0x")?e.substring(2):e}wr.stripHexPrefix=i1;function s1(e){return e.startsWith("0x")}wr.isHexPrefixed=s1});var Ac=D(ei=>{"use strict";P();O();Object.defineProperty(ei,"__esModule",{value:!0});ei.fromBase64=ei.toBase64=void 0;var Mc=bn();function o1(e){let t=I.Buffer.from(e);return Mc.base64.encode(Uint8Array.from(t))}ei.toBase64=o1;function a1(e){return Mc.base64.decode(e)}ei.fromBase64=a1});var Ci=D(Di=>{"use strict";P();O();Object.defineProperty(Di,"__esModule",{value:!0});Di.hmac=void 0;var Es=It(),Ms=class extends Es.Hash{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,(0,Es.assertHash)(t);let n=(0,Es.toBytes)(r);if(this.iHash=t.create(),!(this.iHash instanceof Es.Hash))throw new TypeError("Expected instance of class which extends utils.Hash");let i=this.blockLen=this.iHash.blockLen;this.outputLen=this.iHash.outputLen;let o=new Uint8Array(i);o.set(n.length>this.iHash.blockLen?t.create().update(n).digest():n);for(let a=0;a<o.length;a++)o[a]^=54;this.iHash.update(o),this.oHash=t.create();for(let a=0;a<o.length;a++)o[a]^=106;this.oHash.update(o),o.fill(0)}update(t){if(this.destroyed)throw new Error("instance is destroyed");return this.iHash.update(t),this}digestInto(t){if(this.destroyed)throw new Error("instance is destroyed");if(!(t instanceof Uint8Array)||t.length!==this.outputLen)throw new Error("HMAC: Invalid output buffer");if(this.finished)throw new Error("digest() was already called");this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:r,iHash:n,finished:i,destroyed:o,blockLen:a,outputLen:f}=this;return t=t,t.finished=i,t.destroyed=o,t.blockLen=a,t.outputLen=f,t.oHash=r._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},f1=(e,t,r)=>new Ms(e,t).update(r).digest();Di.hmac=f1;Di.hmac.create=(e,t)=>new Ms(e,t)});var Pc=D(ti=>{"use strict";P();O();Object.defineProperty(ti,"__esModule",{value:!0});ti.hmacSHA512=ti.hmacSHA256=void 0;var Bc=Ci(),Ic=Ui();function c1(e,t){return I.Buffer.from((0,Bc.hmac)(Ic.sha256,e,t))}ti.hmacSHA256=c1;function d1(e,t){return I.Buffer.from((0,Bc.hmac)(Ic.sha512,e,t))}ti.hmacSHA512=d1});var Oc=D(ri=>{"use strict";P();O();Object.defineProperty(ri,"__esModule",{value:!0});ri.fromUtf8=ri.toUtf8=void 0;function u1(e){return new TextEncoder().encode(e)}ri.toUtf8=u1;function l1(e){return new TextDecoder("utf-8",{fatal:!0}).decode(e)}ri.fromUtf8=l1});var fa=D(Zr=>{"use strict";P();O();Object.defineProperty(Zr,"__esModule",{value:!0});Zr.checkIsUndefined=Zr.checkIsDefined=Zr.check=void 0;var aa=(e,t)=>{if(!e)throw t=t||"Invalid statement",t=t instanceof Error?t:new Error(t),t};Zr.check=aa;var h1=(e,t)=>(aa(typeof e<"u",t||"Expect defined but actually undefined"),e);Zr.checkIsDefined=h1;var b1=(e,t)=>{aa(typeof e>"u",t||`Expect undefined but actually ${e}`)};Zr.checkIsUndefined=b1});var qc=D(xr=>{"use strict";P();O();Object.defineProperty(xr,"__esModule",{value:!0});xr.string2BigNumber=xr.bigNumber2String=xr.fromBigIntHex=xr.toBigIntHex=void 0;var Tc=Gr(),p1=fa(),g1=e=>{let t=e.integerValue().toString(16);return t="0x"+t,t};xr.toBigIntHex=g1;var y1=e=>((0,p1.check)(e&&e.startsWith("0x"),`Invalid hex string. value: ${e}`),new Tc.BigNumber(e).integerValue());xr.fromBigIntHex=y1;var v1=(e,t)=>e.integerValue().toString(t);xr.bigNumber2String=v1;var m1=(e,t)=>new Tc.BigNumber(e,t);xr.string2BigNumber=m1});var mt=D((kc,ca)=>{P();O();(function(e,t){"use strict";function r(M,s){if(!M)throw new Error(s||"Assertion failed")}function n(M,s){M.super_=s;var l=function(){};l.prototype=s.prototype,M.prototype=new l,M.prototype.constructor=M}function i(M,s,l){if(i.isBN(M))return M;this.negative=0,this.words=null,this.length=0,this.red=null,M!==null&&((s==="le"||s==="be")&&(l=s,s=10),this._init(M||0,s||10,l||"be"))}typeof e=="object"?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=ol().Buffer}catch{}i.isBN=function(s){return s instanceof i?!0:s!==null&&typeof s=="object"&&s.constructor.wordSize===i.wordSize&&Array.isArray(s.words)},i.max=function(s,l){return s.cmp(l)>0?s:l},i.min=function(s,l){return s.cmp(l)<0?s:l},i.prototype._init=function(s,l,h){if(typeof s=="number")return this._initNumber(s,l,h);if(typeof s=="object")return this._initArray(s,l,h);l==="hex"&&(l=16),r(l===(l|0)&&l>=2&&l<=36),s=s.toString().replace(/\s+/g,"");var d=0;s[0]==="-"&&(d++,this.negative=1),d<s.length&&(l===16?this._parseHex(s,d,h):(this._parseBase(s,l,d),h==="le"&&this._initArray(this.toArray(),l,h)))},i.prototype._initNumber=function(s,l,h){s<0&&(this.negative=1,s=-s),s<67108864?(this.words=[s&67108863],this.length=1):s<4503599627370496?(this.words=[s&67108863,s/67108864&67108863],this.length=2):(r(s<9007199254740992),this.words=[s&67108863,s/67108864&67108863,1],this.length=3),h==="le"&&this._initArray(this.toArray(),l,h)},i.prototype._initArray=function(s,l,h){if(r(typeof s.length=="number"),s.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(s.length/3),this.words=new Array(this.length);for(var d=0;d<this.length;d++)this.words[d]=0;var b,E,B=0;if(h==="be")for(d=s.length-1,b=0;d>=0;d-=3)E=s[d]|s[d-1]<<8|s[d-2]<<16,this.words[b]|=E<<B&67108863,this.words[b+1]=E>>>26-B&67108863,B+=24,B>=26&&(B-=26,b++);else if(h==="le")for(d=0,b=0;d<s.length;d+=3)E=s[d]|s[d+1]<<8|s[d+2]<<16,this.words[b]|=E<<B&67108863,this.words[b+1]=E>>>26-B&67108863,B+=24,B>=26&&(B-=26,b++);return this.strip()};function a(M,s){var l=M.charCodeAt(s);return l>=65&&l<=70?l-55:l>=97&&l<=102?l-87:l-48&15}function f(M,s,l){var h=a(M,l);return l-1>=s&&(h|=a(M,l-1)<<4),h}i.prototype._parseHex=function(s,l,h){this.length=Math.ceil((s.length-l)/6),this.words=new Array(this.length);for(var d=0;d<this.length;d++)this.words[d]=0;var b=0,E=0,B;if(h==="be")for(d=s.length-1;d>=l;d-=2)B=f(s,l,d)<<b,this.words[E]|=B&67108863,b>=18?(b-=18,E+=1,this.words[E]|=B>>>26):b+=8;else{var m=s.length-l;for(d=m%2===0?l+1:l;d<s.length;d+=2)B=f(s,l,d)<<b,this.words[E]|=B&67108863,b>=18?(b-=18,E+=1,this.words[E]|=B>>>26):b+=8}this.strip()};function u(M,s,l,h){for(var d=0,b=Math.min(M.length,l),E=s;E<b;E++){var B=M.charCodeAt(E)-48;d*=h,B>=49?d+=B-49+10:B>=17?d+=B-17+10:d+=B}return d}i.prototype._parseBase=function(s,l,h){this.words=[0],this.length=1;for(var d=0,b=1;b<=67108863;b*=l)d++;d--,b=b/l|0;for(var E=s.length-h,B=E%d,m=Math.min(E,E-B)+h,c=0,S=h;S<m;S+=d)c=u(s,S,S+d,l),this.imuln(b),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(B!==0){var R=1;for(c=u(s,S,s.length,l),S=0;S<B;S++)R*=l;this.imuln(R),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this.strip()},i.prototype.copy=function(s){s.words=new Array(this.length);for(var l=0;l<this.length;l++)s.words[l]=this.words[l];s.length=this.length,s.negative=this.negative,s.red=this.red},i.prototype.clone=function(){var s=new i(null);return this.copy(s),s},i.prototype._expand=function(s){for(;this.length<s;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var p=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],y=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],g=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(s,l){s=s||10,l=l|0||1;var h;if(s===16||s==="hex"){h="";for(var d=0,b=0,E=0;E<this.length;E++){var B=this.words[E],m=((B<<d|b)&16777215).toString(16);b=B>>>24-d&16777215,b!==0||E!==this.length-1?h=p[6-m.length]+m+h:h=m+h,d+=2,d>=26&&(d-=26,E--)}for(b!==0&&(h=b.toString(16)+h);h.length%l!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}if(s===(s|0)&&s>=2&&s<=36){var c=y[s],S=g[s];h="";var R=this.clone();for(R.negative=0;!R.isZero();){var U=R.modn(S).toString(s);R=R.idivn(S),R.isZero()?h=U+h:h=p[c-U.length]+U+h}for(this.isZero()&&(h="0"+h);h.length%l!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var s=this.words[0];return this.length===2?s+=this.words[1]*67108864:this.length===3&&this.words[2]===1?s+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-s:s},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(s,l){return r(typeof o<"u"),this.toArrayLike(o,s,l)},i.prototype.toArray=function(s,l){return this.toArrayLike(Array,s,l)},i.prototype.toArrayLike=function(s,l,h){var d=this.byteLength(),b=h||Math.max(1,d);r(d<=b,"byte array longer than desired length"),r(b>0,"Requested array length <= 0"),this.strip();var E=l==="le",B=new s(b),m,c,S=this.clone();if(E){for(c=0;!S.isZero();c++)m=S.andln(255),S.iushrn(8),B[c]=m;for(;c<b;c++)B[c]=0}else{for(c=0;c<b-d;c++)B[c]=0;for(c=0;!S.isZero();c++)m=S.andln(255),S.iushrn(8),B[b-c-1]=m}return B},Math.clz32?i.prototype._countBits=function(s){return 32-Math.clz32(s)}:i.prototype._countBits=function(s){var l=s,h=0;return l>=4096&&(h+=13,l>>>=13),l>=64&&(h+=7,l>>>=7),l>=8&&(h+=4,l>>>=4),l>=2&&(h+=2,l>>>=2),h+l},i.prototype._zeroBits=function(s){if(s===0)return 26;var l=s,h=0;return(l&8191)===0&&(h+=13,l>>>=13),(l&127)===0&&(h+=7,l>>>=7),(l&15)===0&&(h+=4,l>>>=4),(l&3)===0&&(h+=2,l>>>=2),(l&1)===0&&h++,h},i.prototype.bitLength=function(){var s=this.words[this.length-1],l=this._countBits(s);return(this.length-1)*26+l};function x(M){for(var s=new Array(M.bitLength()),l=0;l<s.length;l++){var h=l/26|0,d=l%26;s[l]=(M.words[h]&1<<d)>>>d}return s}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var s=0,l=0;l<this.length;l++){var h=this._zeroBits(this.words[l]);if(s+=h,h!==26)break}return s},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(s){return this.negative!==0?this.abs().inotn(s).iaddn(1):this.clone()},i.prototype.fromTwos=function(s){return this.testn(s-1)?this.notn(s).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return this.negative!==0},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(s){for(;this.length<s.length;)this.words[this.length++]=0;for(var l=0;l<s.length;l++)this.words[l]=this.words[l]|s.words[l];return this.strip()},i.prototype.ior=function(s){return r((this.negative|s.negative)===0),this.iuor(s)},i.prototype.or=function(s){return this.length>s.length?this.clone().ior(s):s.clone().ior(this)},i.prototype.uor=function(s){return this.length>s.length?this.clone().iuor(s):s.clone().iuor(this)},i.prototype.iuand=function(s){var l;this.length>s.length?l=s:l=this;for(var h=0;h<l.length;h++)this.words[h]=this.words[h]&s.words[h];return this.length=l.length,this.strip()},i.prototype.iand=function(s){return r((this.negative|s.negative)===0),this.iuand(s)},i.prototype.and=function(s){return this.length>s.length?this.clone().iand(s):s.clone().iand(this)},i.prototype.uand=function(s){return this.length>s.length?this.clone().iuand(s):s.clone().iuand(this)},i.prototype.iuxor=function(s){var l,h;this.length>s.length?(l=this,h=s):(l=s,h=this);for(var d=0;d<h.length;d++)this.words[d]=l.words[d]^h.words[d];if(this!==l)for(;d<l.length;d++)this.words[d]=l.words[d];return this.length=l.length,this.strip()},i.prototype.ixor=function(s){return r((this.negative|s.negative)===0),this.iuxor(s)},i.prototype.xor=function(s){return this.length>s.length?this.clone().ixor(s):s.clone().ixor(this)},i.prototype.uxor=function(s){return this.length>s.length?this.clone().iuxor(s):s.clone().iuxor(this)},i.prototype.inotn=function(s){r(typeof s=="number"&&s>=0);var l=Math.ceil(s/26)|0,h=s%26;this._expand(l),h>0&&l--;for(var d=0;d<l;d++)this.words[d]=~this.words[d]&67108863;return h>0&&(this.words[d]=~this.words[d]&67108863>>26-h),this.strip()},i.prototype.notn=function(s){return this.clone().inotn(s)},i.prototype.setn=function(s,l){r(typeof s=="number"&&s>=0);var h=s/26|0,d=s%26;return this._expand(h+1),l?this.words[h]=this.words[h]|1<<d:this.words[h]=this.words[h]&~(1<<d),this.strip()},i.prototype.iadd=function(s){var l;if(this.negative!==0&&s.negative===0)return this.negative=0,l=this.isub(s),this.negative^=1,this._normSign();if(this.negative===0&&s.negative!==0)return s.negative=0,l=this.isub(s),s.negative=1,l._normSign();var h,d;this.length>s.length?(h=this,d=s):(h=s,d=this);for(var b=0,E=0;E<d.length;E++)l=(h.words[E]|0)+(d.words[E]|0)+b,this.words[E]=l&67108863,b=l>>>26;for(;b!==0&&E<h.length;E++)l=(h.words[E]|0)+b,this.words[E]=l&67108863,b=l>>>26;if(this.length=h.length,b!==0)this.words[this.length]=b,this.length++;else if(h!==this)for(;E<h.length;E++)this.words[E]=h.words[E];return this},i.prototype.add=function(s){var l;return s.negative!==0&&this.negative===0?(s.negative=0,l=this.sub(s),s.negative^=1,l):s.negative===0&&this.negative!==0?(this.negative=0,l=s.sub(this),this.negative=1,l):this.length>s.length?this.clone().iadd(s):s.clone().iadd(this)},i.prototype.isub=function(s){if(s.negative!==0){s.negative=0;var l=this.iadd(s);return s.negative=1,l._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(s),this.negative=1,this._normSign();var h=this.cmp(s);if(h===0)return this.negative=0,this.length=1,this.words[0]=0,this;var d,b;h>0?(d=this,b=s):(d=s,b=this);for(var E=0,B=0;B<b.length;B++)l=(d.words[B]|0)-(b.words[B]|0)+E,E=l>>26,this.words[B]=l&67108863;for(;E!==0&&B<d.length;B++)l=(d.words[B]|0)+E,E=l>>26,this.words[B]=l&67108863;if(E===0&&B<d.length&&d!==this)for(;B<d.length;B++)this.words[B]=d.words[B];return this.length=Math.max(this.length,B),d!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(s){return this.clone().isub(s)};function w(M,s,l){l.negative=s.negative^M.negative;var h=M.length+s.length|0;l.length=h,h=h-1|0;var d=M.words[0]|0,b=s.words[0]|0,E=d*b,B=E&67108863,m=E/67108864|0;l.words[0]=B;for(var c=1;c<h;c++){for(var S=m>>>26,R=m&67108863,U=Math.min(c,s.length-1),C=Math.max(0,c-M.length+1);C<=U;C++){var W=c-C|0;d=M.words[W]|0,b=s.words[C]|0,E=d*b+R,S+=E/67108864|0,R=E&67108863}l.words[c]=R|0,m=S|0}return m!==0?l.words[c]=m|0:l.length--,l.strip()}var _=function(s,l,h){var d=s.words,b=l.words,E=h.words,B=0,m,c,S,R=d[0]|0,U=R&8191,C=R>>>13,W=d[1]|0,J=W&8191,Q=W>>>13,Oe=d[2]|0,ye=Oe&8191,ue=Oe>>>13,Or=d[3]|0,Ie=Or&8191,pe=Or>>>13,Tr=d[4]|0,xe=Tr&8191,Pe=Tr>>>13,qi=d[5]|0,He=qi&8191,Ke=qi>>>13,Bf=d[6]|0,je=Bf&8191,Re=Bf>>>13,If=d[7]|0,Ue=If&8191,De=If>>>13,Pf=d[8]|0,Ce=Pf&8191,ze=Pf>>>13,Of=d[9]|0,Fe=Of&8191,$e=Of>>>13,Tf=b[0]|0,Ve=Tf&8191,We=Tf>>>13,qf=b[1]|0,Ze=qf&8191,Ge=qf>>>13,kf=b[2]|0,Xe=kf&8191,Ye=kf>>>13,Nf=b[3]|0,Je=Nf&8191,Qe=Nf>>>13,Lf=b[4]|0,et=Lf&8191,tt=Lf>>>13,Hf=b[5]|0,rt=Hf&8191,nt=Hf>>>13,Kf=b[6]|0,it=Kf&8191,st=Kf>>>13,jf=b[7]|0,ot=jf&8191,at=jf>>>13,Rf=b[8]|0,ft=Rf&8191,ct=Rf>>>13,Uf=b[9]|0,dt=Uf&8191,ut=Uf>>>13;h.negative=s.negative^l.negative,h.length=19,m=Math.imul(U,Ve),c=Math.imul(U,We),c=c+Math.imul(C,Ve)|0,S=Math.imul(C,We);var yo=(B+m|0)+((c&8191)<<13)|0;B=(S+(c>>>13)|0)+(yo>>>26)|0,yo&=67108863,m=Math.imul(J,Ve),c=Math.imul(J,We),c=c+Math.imul(Q,Ve)|0,S=Math.imul(Q,We),m=m+Math.imul(U,Ze)|0,c=c+Math.imul(U,Ge)|0,c=c+Math.imul(C,Ze)|0,S=S+Math.imul(C,Ge)|0;var vo=(B+m|0)+((c&8191)<<13)|0;B=(S+(c>>>13)|0)+(vo>>>26)|0,vo&=67108863,m=Math.imul(ye,Ve),c=Math.imul(ye,We),c=c+Math.imul(ue,Ve)|0,S=Math.imul(ue,We),m=m+Math.imul(J,Ze)|0,c=c+Math.imul(J,Ge)|0,c=c+Math.imul(Q,Ze)|0,S=S+Math.imul(Q,Ge)|0,m=m+Math.imul(U,Xe)|0,c=c+Math.imul(U,Ye)|0,c=c+Math.imul(C,Xe)|0,S=S+Math.imul(C,Ye)|0;var mo=(B+m|0)+((c&8191)<<13)|0;B=(S+(c>>>13)|0)+(mo>>>26)|0,mo&=67108863,m=Math.imul(Ie,Ve),c=Math.imul(Ie,We),c=c+Math.imul(pe,Ve)|0,S=Math.imul(pe,We),m=m+Math.imul(ye,Ze)|0,c=c+Math.imul(ye,Ge)|0,c=c+Math.imul(ue,Ze)|0,S=S+Math.imul(ue,Ge)|0,m=m+Math.imul(J,Xe)|0,c=c+Math.imul(J,Ye)|0,c=c+Math.imul(Q,Xe)|0,S=S+Math.imul(Q,Ye)|0,m=m+Math.imul(U,Je)|0,c=c+Math.imul(U,Qe)|0,c=c+Math.imul(C,Je)|0,S=S+Math.imul(C,Qe)|0;var wo=(B+m|0)+((c&8191)<<13)|0;B=(S+(c>>>13)|0)+(wo>>>26)|0,wo&=67108863,m=Math.imul(xe,Ve),c=Math.imul(xe,We),c=c+Math.imul(Pe,Ve)|0,S=Math.imul(Pe,We),m=m+Math.imul(Ie,Ze)|0,c=c+Math.imul(Ie,Ge)|0,c=c+Math.imul(pe,Ze)|0,S=S+Math.imul(pe,Ge)|0,m=m+Math.imul(ye,Xe)|0,c=c+Math.imul(ye,Ye)|0,c=c+Math.imul(ue,Xe)|0,S=S+Math.imul(ue,Ye)|0,m=m+Math.imul(J,Je)|0,c=c+Math.imul(J,Qe)|0,c=c+Math.imul(Q,Je)|0,S=S+Math.imul(Q,Qe)|0,m=m+Math.imul(U,et)|0,c=c+Math.imul(U,tt)|0,c=c+Math.imul(C,et)|0,S=S+Math.imul(C,tt)|0;var xo=(B+m|0)+((c&8191)<<13)|0;B=(S+(c>>>13)|0)+(xo>>>26)|0,xo&=67108863,m=Math.imul(He,Ve),c=Math.imul(He,We),c=c+Math.imul(Ke,Ve)|0,S=Math.imul(Ke,We),m=m+Math.imul(xe,Ze)|0,c=c+Math.imul(xe,Ge)|0,c=c+Math.imul(Pe,Ze)|0,S=S+Math.imul(Pe,Ge)|0,m=m+Math.imul(Ie,Xe)|0,c=c+Math.imul(Ie,Ye)|0,c=c+Math.imul(pe,Xe)|0,S=S+Math.imul(pe,Ye)|0,m=m+Math.imul(ye,Je)|0,c=c+Math.imul(ye,Qe)|0,c=c+Math.imul(ue,Je)|0,S=S+Math.imul(ue,Qe)|0,m=m+Math.imul(J,et)|0,c=c+Math.imul(J,tt)|0,c=c+Math.imul(Q,et)|0,S=S+Math.imul(Q,tt)|0,m=m+Math.imul(U,rt)|0,c=c+Math.imul(U,nt)|0,c=c+Math.imul(C,rt)|0,S=S+Math.imul(C,nt)|0;var _o=(B+m|0)+((c&8191)<<13)|0;B=(S+(c>>>13)|0)+(_o>>>26)|0,_o&=67108863,m=Math.imul(je,Ve),c=Math.imul(je,We),c=c+Math.imul(Re,Ve)|0,S=Math.imul(Re,We),m=m+Math.imul(He,Ze)|0,c=c+Math.imul(He,Ge)|0,c=c+Math.imul(Ke,Ze)|0,S=S+Math.imul(Ke,Ge)|0,m=m+Math.imul(xe,Xe)|0,c=c+Math.imul(xe,Ye)|0,c=c+Math.imul(Pe,Xe)|0,S=S+Math.imul(Pe,Ye)|0,m=m+Math.imul(Ie,Je)|0,c=c+Math.imul(Ie,Qe)|0,c=c+Math.imul(pe,Je)|0,S=S+Math.imul(pe,Qe)|0,m=m+Math.imul(ye,et)|0,c=c+Math.imul(ye,tt)|0,c=c+Math.imul(ue,et)|0,S=S+Math.imul(ue,tt)|0,m=m+Math.imul(J,rt)|0,c=c+Math.imul(J,nt)|0,c=c+Math.imul(Q,rt)|0,S=S+Math.imul(Q,nt)|0,m=m+Math.imul(U,it)|0,c=c+Math.imul(U,st)|0,c=c+Math.imul(C,it)|0,S=S+Math.imul(C,st)|0;var So=(B+m|0)+((c&8191)<<13)|0;B=(S+(c>>>13)|0)+(So>>>26)|0,So&=67108863,m=Math.imul(Ue,Ve),c=Math.imul(Ue,We),c=c+Math.imul(De,Ve)|0,S=Math.imul(De,We),m=m+Math.imul(je,Ze)|0,c=c+Math.imul(je,Ge)|0,c=c+Math.imul(Re,Ze)|0,S=S+Math.imul(Re,Ge)|0,m=m+Math.imul(He,Xe)|0,c=c+Math.imul(He,Ye)|0,c=c+Math.imul(Ke,Xe)|0,S=S+Math.imul(Ke,Ye)|0,m=m+Math.imul(xe,Je)|0,c=c+Math.imul(xe,Qe)|0,c=c+Math.imul(Pe,Je)|0,S=S+Math.imul(Pe,Qe)|0,m=m+Math.imul(Ie,et)|0,c=c+Math.imul(Ie,tt)|0,c=c+Math.imul(pe,et)|0,S=S+Math.imul(pe,tt)|0,m=m+Math.imul(ye,rt)|0,c=c+Math.imul(ye,nt)|0,c=c+Math.imul(ue,rt)|0,S=S+Math.imul(ue,nt)|0,m=m+Math.imul(J,it)|0,c=c+Math.imul(J,st)|0,c=c+Math.imul(Q,it)|0,S=S+Math.imul(Q,st)|0,m=m+Math.imul(U,ot)|0,c=c+Math.imul(U,at)|0,c=c+Math.imul(C,ot)|0,S=S+Math.imul(C,at)|0;var Eo=(B+m|0)+((c&8191)<<13)|0;B=(S+(c>>>13)|0)+(Eo>>>26)|0,Eo&=67108863,m=Math.imul(Ce,Ve),c=Math.imul(Ce,We),c=c+Math.imul(ze,Ve)|0,S=Math.imul(ze,We),m=m+Math.imul(Ue,Ze)|0,c=c+Math.imul(Ue,Ge)|0,c=c+Math.imul(De,Ze)|0,S=S+Math.imul(De,Ge)|0,m=m+Math.imul(je,Xe)|0,c=c+Math.imul(je,Ye)|0,c=c+Math.imul(Re,Xe)|0,S=S+Math.imul(Re,Ye)|0,m=m+Math.imul(He,Je)|0,c=c+Math.imul(He,Qe)|0,c=c+Math.imul(Ke,Je)|0,S=S+Math.imul(Ke,Qe)|0,m=m+Math.imul(xe,et)|0,c=c+Math.imul(xe,tt)|0,c=c+Math.imul(Pe,et)|0,S=S+Math.imul(Pe,tt)|0,m=m+Math.imul(Ie,rt)|0,c=c+Math.imul(Ie,nt)|0,c=c+Math.imul(pe,rt)|0,S=S+Math.imul(pe,nt)|0,m=m+Math.imul(ye,it)|0,c=c+Math.imul(ye,st)|0,c=c+Math.imul(ue,it)|0,S=S+Math.imul(ue,st)|0,m=m+Math.imul(J,ot)|0,c=c+Math.imul(J,at)|0,c=c+Math.imul(Q,ot)|0,S=S+Math.imul(Q,at)|0,m=m+Math.imul(U,ft)|0,c=c+Math.imul(U,ct)|0,c=c+Math.imul(C,ft)|0,S=S+Math.imul(C,ct)|0;var Mo=(B+m|0)+((c&8191)<<13)|0;B=(S+(c>>>13)|0)+(Mo>>>26)|0,Mo&=67108863,m=Math.imul(Fe,Ve),c=Math.imul(Fe,We),c=c+Math.imul($e,Ve)|0,S=Math.imul($e,We),m=m+Math.imul(Ce,Ze)|0,c=c+Math.imul(Ce,Ge)|0,c=c+Math.imul(ze,Ze)|0,S=S+Math.imul(ze,Ge)|0,m=m+Math.imul(Ue,Xe)|0,c=c+Math.imul(Ue,Ye)|0,c=c+Math.imul(De,Xe)|0,S=S+Math.imul(De,Ye)|0,m=m+Math.imul(je,Je)|0,c=c+Math.imul(je,Qe)|0,c=c+Math.imul(Re,Je)|0,S=S+Math.imul(Re,Qe)|0,m=m+Math.imul(He,et)|0,c=c+Math.imul(He,tt)|0,c=c+Math.imul(Ke,et)|0,S=S+Math.imul(Ke,tt)|0,m=m+Math.imul(xe,rt)|0,c=c+Math.imul(xe,nt)|0,c=c+Math.imul(Pe,rt)|0,S=S+Math.imul(Pe,nt)|0,m=m+Math.imul(Ie,it)|0,c=c+Math.imul(Ie,st)|0,c=c+Math.imul(pe,it)|0,S=S+Math.imul(pe,st)|0,m=m+Math.imul(ye,ot)|0,c=c+Math.imul(ye,at)|0,c=c+Math.imul(ue,ot)|0,S=S+Math.imul(ue,at)|0,m=m+Math.imul(J,ft)|0,c=c+Math.imul(J,ct)|0,c=c+Math.imul(Q,ft)|0,S=S+Math.imul(Q,ct)|0,m=m+Math.imul(U,dt)|0,c=c+Math.imul(U,ut)|0,c=c+Math.imul(C,dt)|0,S=S+Math.imul(C,ut)|0;var Ao=(B+m|0)+((c&8191)<<13)|0;B=(S+(c>>>13)|0)+(Ao>>>26)|0,Ao&=67108863,m=Math.imul(Fe,Ze),c=Math.imul(Fe,Ge),c=c+Math.imul($e,Ze)|0,S=Math.imul($e,Ge),m=m+Math.imul(Ce,Xe)|0,c=c+Math.imul(Ce,Ye)|0,c=c+Math.imul(ze,Xe)|0,S=S+Math.imul(ze,Ye)|0,m=m+Math.imul(Ue,Je)|0,c=c+Math.imul(Ue,Qe)|0,c=c+Math.imul(De,Je)|0,S=S+Math.imul(De,Qe)|0,m=m+Math.imul(je,et)|0,c=c+Math.imul(je,tt)|0,c=c+Math.imul(Re,et)|0,S=S+Math.imul(Re,tt)|0,m=m+Math.imul(He,rt)|0,c=c+Math.imul(He,nt)|0,c=c+Math.imul(Ke,rt)|0,S=S+Math.imul(Ke,nt)|0,m=m+Math.imul(xe,it)|0,c=c+Math.imul(xe,st)|0,c=c+Math.imul(Pe,it)|0,S=S+Math.imul(Pe,st)|0,m=m+Math.imul(Ie,ot)|0,c=c+Math.imul(Ie,at)|0,c=c+Math.imul(pe,ot)|0,S=S+Math.imul(pe,at)|0,m=m+Math.imul(ye,ft)|0,c=c+Math.imul(ye,ct)|0,c=c+Math.imul(ue,ft)|0,S=S+Math.imul(ue,ct)|0,m=m+Math.imul(J,dt)|0,c=c+Math.imul(J,ut)|0,c=c+Math.imul(Q,dt)|0,S=S+Math.imul(Q,ut)|0;var Bo=(B+m|0)+((c&8191)<<13)|0;B=(S+(c>>>13)|0)+(Bo>>>26)|0,Bo&=67108863,m=Math.imul(Fe,Xe),c=Math.imul(Fe,Ye),c=c+Math.imul($e,Xe)|0,S=Math.imul($e,Ye),m=m+Math.imul(Ce,Je)|0,c=c+Math.imul(Ce,Qe)|0,c=c+Math.imul(ze,Je)|0,S=S+Math.imul(ze,Qe)|0,m=m+Math.imul(Ue,et)|0,c=c+Math.imul(Ue,tt)|0,c=c+Math.imul(De,et)|0,S=S+Math.imul(De,tt)|0,m=m+Math.imul(je,rt)|0,c=c+Math.imul(je,nt)|0,c=c+Math.imul(Re,rt)|0,S=S+Math.imul(Re,nt)|0,m=m+Math.imul(He,it)|0,c=c+Math.imul(He,st)|0,c=c+Math.imul(Ke,it)|0,S=S+Math.imul(Ke,st)|0,m=m+Math.imul(xe,ot)|0,c=c+Math.imul(xe,at)|0,c=c+Math.imul(Pe,ot)|0,S=S+Math.imul(Pe,at)|0,m=m+Math.imul(Ie,ft)|0,c=c+Math.imul(Ie,ct)|0,c=c+Math.imul(pe,ft)|0,S=S+Math.imul(pe,ct)|0,m=m+Math.imul(ye,dt)|0,c=c+Math.imul(ye,ut)|0,c=c+Math.imul(ue,dt)|0,S=S+Math.imul(ue,ut)|0;var Io=(B+m|0)+((c&8191)<<13)|0;B=(S+(c>>>13)|0)+(Io>>>26)|0,Io&=67108863,m=Math.imul(Fe,Je),c=Math.imul(Fe,Qe),c=c+Math.imul($e,Je)|0,S=Math.imul($e,Qe),m=m+Math.imul(Ce,et)|0,c=c+Math.imul(Ce,tt)|0,c=c+Math.imul(ze,et)|0,S=S+Math.imul(ze,tt)|0,m=m+Math.imul(Ue,rt)|0,c=c+Math.imul(Ue,nt)|0,c=c+Math.imul(De,rt)|0,S=S+Math.imul(De,nt)|0,m=m+Math.imul(je,it)|0,c=c+Math.imul(je,st)|0,c=c+Math.imul(Re,it)|0,S=S+Math.imul(Re,st)|0,m=m+Math.imul(He,ot)|0,c=c+Math.imul(He,at)|0,c=c+Math.imul(Ke,ot)|0,S=S+Math.imul(Ke,at)|0,m=m+Math.imul(xe,ft)|0,c=c+Math.imul(xe,ct)|0,c=c+Math.imul(Pe,ft)|0,S=S+Math.imul(Pe,ct)|0,m=m+Math.imul(Ie,dt)|0,c=c+Math.imul(Ie,ut)|0,c=c+Math.imul(pe,dt)|0,S=S+Math.imul(pe,ut)|0;var Po=(B+m|0)+((c&8191)<<13)|0;B=(S+(c>>>13)|0)+(Po>>>26)|0,Po&=67108863,m=Math.imul(Fe,et),c=Math.imul(Fe,tt),c=c+Math.imul($e,et)|0,S=Math.imul($e,tt),m=m+Math.imul(Ce,rt)|0,c=c+Math.imul(Ce,nt)|0,c=c+Math.imul(ze,rt)|0,S=S+Math.imul(ze,nt)|0,m=m+Math.imul(Ue,it)|0,c=c+Math.imul(Ue,st)|0,c=c+Math.imul(De,it)|0,S=S+Math.imul(De,st)|0,m=m+Math.imul(je,ot)|0,c=c+Math.imul(je,at)|0,c=c+Math.imul(Re,ot)|0,S=S+Math.imul(Re,at)|0,m=m+Math.imul(He,ft)|0,c=c+Math.imul(He,ct)|0,c=c+Math.imul(Ke,ft)|0,S=S+Math.imul(Ke,ct)|0,m=m+Math.imul(xe,dt)|0,c=c+Math.imul(xe,ut)|0,c=c+Math.imul(Pe,dt)|0,S=S+Math.imul(Pe,ut)|0;var Oo=(B+m|0)+((c&8191)<<13)|0;B=(S+(c>>>13)|0)+(Oo>>>26)|0,Oo&=67108863,m=Math.imul(Fe,rt),c=Math.imul(Fe,nt),c=c+Math.imul($e,rt)|0,S=Math.imul($e,nt),m=m+Math.imul(Ce,it)|0,c=c+Math.imul(Ce,st)|0,c=c+Math.imul(ze,it)|0,S=S+Math.imul(ze,st)|0,m=m+Math.imul(Ue,ot)|0,c=c+Math.imul(Ue,at)|0,c=c+Math.imul(De,ot)|0,S=S+Math.imul(De,at)|0,m=m+Math.imul(je,ft)|0,c=c+Math.imul(je,ct)|0,c=c+Math.imul(Re,ft)|0,S=S+Math.imul(Re,ct)|0,m=m+Math.imul(He,dt)|0,c=c+Math.imul(He,ut)|0,c=c+Math.imul(Ke,dt)|0,S=S+Math.imul(Ke,ut)|0;var To=(B+m|0)+((c&8191)<<13)|0;B=(S+(c>>>13)|0)+(To>>>26)|0,To&=67108863,m=Math.imul(Fe,it),c=Math.imul(Fe,st),c=c+Math.imul($e,it)|0,S=Math.imul($e,st),m=m+Math.imul(Ce,ot)|0,c=c+Math.imul(Ce,at)|0,c=c+Math.imul(ze,ot)|0,S=S+Math.imul(ze,at)|0,m=m+Math.imul(Ue,ft)|0,c=c+Math.imul(Ue,ct)|0,c=c+Math.imul(De,ft)|0,S=S+Math.imul(De,ct)|0,m=m+Math.imul(je,dt)|0,c=c+Math.imul(je,ut)|0,c=c+Math.imul(Re,dt)|0,S=S+Math.imul(Re,ut)|0;var qo=(B+m|0)+((c&8191)<<13)|0;B=(S+(c>>>13)|0)+(qo>>>26)|0,qo&=67108863,m=Math.imul(Fe,ot),c=Math.imul(Fe,at),c=c+Math.imul($e,ot)|0,S=Math.imul($e,at),m=m+Math.imul(Ce,ft)|0,c=c+Math.imul(Ce,ct)|0,c=c+Math.imul(ze,ft)|0,S=S+Math.imul(ze,ct)|0,m=m+Math.imul(Ue,dt)|0,c=c+Math.imul(Ue,ut)|0,c=c+Math.imul(De,dt)|0,S=S+Math.imul(De,ut)|0;var ko=(B+m|0)+((c&8191)<<13)|0;B=(S+(c>>>13)|0)+(ko>>>26)|0,ko&=67108863,m=Math.imul(Fe,ft),c=Math.imul(Fe,ct),c=c+Math.imul($e,ft)|0,S=Math.imul($e,ct),m=m+Math.imul(Ce,dt)|0,c=c+Math.imul(Ce,ut)|0,c=c+Math.imul(ze,dt)|0,S=S+Math.imul(ze,ut)|0;var No=(B+m|0)+((c&8191)<<13)|0;B=(S+(c>>>13)|0)+(No>>>26)|0,No&=67108863,m=Math.imul(Fe,dt),c=Math.imul(Fe,ut),c=c+Math.imul($e,dt)|0,S=Math.imul($e,ut);var Lo=(B+m|0)+((c&8191)<<13)|0;return B=(S+(c>>>13)|0)+(Lo>>>26)|0,Lo&=67108863,E[0]=yo,E[1]=vo,E[2]=mo,E[3]=wo,E[4]=xo,E[5]=_o,E[6]=So,E[7]=Eo,E[8]=Mo,E[9]=Ao,E[10]=Bo,E[11]=Io,E[12]=Po,E[13]=Oo,E[14]=To,E[15]=qo,E[16]=ko,E[17]=No,E[18]=Lo,B!==0&&(E[19]=B,h.length++),h};Math.imul||(_=w);function v(M,s,l){l.negative=s.negative^M.negative,l.length=M.length+s.length;for(var h=0,d=0,b=0;b<l.length-1;b++){var E=d;d=0;for(var B=h&67108863,m=Math.min(b,s.length-1),c=Math.max(0,b-M.length+1);c<=m;c++){var S=b-c,R=M.words[S]|0,U=s.words[c]|0,C=R*U,W=C&67108863;E=E+(C/67108864|0)|0,W=W+B|0,B=W&67108863,E=E+(W>>>26)|0,d+=E>>>26,E&=67108863}l.words[b]=B,h=E,E=d}return h!==0?l.words[b]=h:l.length--,l.strip()}function A(M,s,l){var h=new T;return h.mulp(M,s,l)}i.prototype.mulTo=function(s,l){var h,d=this.length+s.length;return this.length===10&&s.length===10?h=_(this,s,l):d<63?h=w(this,s,l):d<1024?h=v(this,s,l):h=A(this,s,l),h};function T(M,s){this.x=M,this.y=s}T.prototype.makeRBT=function(s){for(var l=new Array(s),h=i.prototype._countBits(s)-1,d=0;d<s;d++)l[d]=this.revBin(d,h,s);return l},T.prototype.revBin=function(s,l,h){if(s===0||s===h-1)return s;for(var d=0,b=0;b<l;b++)d|=(s&1)<<l-b-1,s>>=1;return d},T.prototype.permute=function(s,l,h,d,b,E){for(var B=0;B<E;B++)d[B]=l[s[B]],b[B]=h[s[B]]},T.prototype.transform=function(s,l,h,d,b,E){this.permute(E,s,l,h,d,b);for(var B=1;B<b;B<<=1)for(var m=B<<1,c=Math.cos(2*Math.PI/m),S=Math.sin(2*Math.PI/m),R=0;R<b;R+=m)for(var U=c,C=S,W=0;W<B;W++){var J=h[R+W],Q=d[R+W],Oe=h[R+W+B],ye=d[R+W+B],ue=U*Oe-C*ye;ye=U*ye+C*Oe,Oe=ue,h[R+W]=J+Oe,d[R+W]=Q+ye,h[R+W+B]=J-Oe,d[R+W+B]=Q-ye,W!==m&&(ue=c*U-S*C,C=c*C+S*U,U=ue)}},T.prototype.guessLen13b=function(s,l){var h=Math.max(l,s)|1,d=h&1,b=0;for(h=h/2|0;h;h=h>>>1)b++;return 1<<b+1+d},T.prototype.conjugate=function(s,l,h){if(!(h<=1))for(var d=0;d<h/2;d++){var b=s[d];s[d]=s[h-d-1],s[h-d-1]=b,b=l[d],l[d]=-l[h-d-1],l[h-d-1]=-b}},T.prototype.normalize13b=function(s,l){for(var h=0,d=0;d<l/2;d++){var b=Math.round(s[2*d+1]/l)*8192+Math.round(s[2*d]/l)+h;s[d]=b&67108863,b<67108864?h=0:h=b/67108864|0}return s},T.prototype.convert13b=function(s,l,h,d){for(var b=0,E=0;E<l;E++)b=b+(s[E]|0),h[2*E]=b&8191,b=b>>>13,h[2*E+1]=b&8191,b=b>>>13;for(E=2*l;E<d;++E)h[E]=0;r(b===0),r((b&-8192)===0)},T.prototype.stub=function(s){for(var l=new Array(s),h=0;h<s;h++)l[h]=0;return l},T.prototype.mulp=function(s,l,h){var d=2*this.guessLen13b(s.length,l.length),b=this.makeRBT(d),E=this.stub(d),B=new Array(d),m=new Array(d),c=new Array(d),S=new Array(d),R=new Array(d),U=new Array(d),C=h.words;C.length=d,this.convert13b(s.words,s.length,B,d),this.convert13b(l.words,l.length,S,d),this.transform(B,E,m,c,d,b),this.transform(S,E,R,U,d,b);for(var W=0;W<d;W++){var J=m[W]*R[W]-c[W]*U[W];c[W]=m[W]*U[W]+c[W]*R[W],m[W]=J}return this.conjugate(m,c,d),this.transform(m,c,C,E,d,b),this.conjugate(C,E,d),this.normalize13b(C,d),h.negative=s.negative^l.negative,h.length=s.length+l.length,h.strip()},i.prototype.mul=function(s){var l=new i(null);return l.words=new Array(this.length+s.length),this.mulTo(s,l)},i.prototype.mulf=function(s){var l=new i(null);return l.words=new Array(this.length+s.length),A(this,s,l)},i.prototype.imul=function(s){return this.clone().mulTo(s,this)},i.prototype.imuln=function(s){r(typeof s=="number"),r(s<67108864);for(var l=0,h=0;h<this.length;h++){var d=(this.words[h]|0)*s,b=(d&67108863)+(l&67108863);l>>=26,l+=d/67108864|0,l+=b>>>26,this.words[h]=b&67108863}return l!==0&&(this.words[h]=l,this.length++),this},i.prototype.muln=function(s){return this.clone().imuln(s)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(s){var l=x(s);if(l.length===0)return new i(1);for(var h=this,d=0;d<l.length&&l[d]===0;d++,h=h.sqr());if(++d<l.length)for(var b=h.sqr();d<l.length;d++,b=b.sqr())l[d]!==0&&(h=h.mul(b));return h},i.prototype.iushln=function(s){r(typeof s=="number"&&s>=0);var l=s%26,h=(s-l)/26,d=67108863>>>26-l<<26-l,b;if(l!==0){var E=0;for(b=0;b<this.length;b++){var B=this.words[b]&d,m=(this.words[b]|0)-B<<l;this.words[b]=m|E,E=B>>>26-l}E&&(this.words[b]=E,this.length++)}if(h!==0){for(b=this.length-1;b>=0;b--)this.words[b+h]=this.words[b];for(b=0;b<h;b++)this.words[b]=0;this.length+=h}return this.strip()},i.prototype.ishln=function(s){return r(this.negative===0),this.iushln(s)},i.prototype.iushrn=function(s,l,h){r(typeof s=="number"&&s>=0);var d;l?d=(l-l%26)/26:d=0;var b=s%26,E=Math.min((s-b)/26,this.length),B=67108863^67108863>>>b<<b,m=h;if(d-=E,d=Math.max(0,d),m){for(var c=0;c<E;c++)m.words[c]=this.words[c];m.length=E}if(E!==0)if(this.length>E)for(this.length-=E,c=0;c<this.length;c++)this.words[c]=this.words[c+E];else this.words[0]=0,this.length=1;var S=0;for(c=this.length-1;c>=0&&(S!==0||c>=d);c--){var R=this.words[c]|0;this.words[c]=S<<26-b|R>>>b,S=R&B}return m&&S!==0&&(m.words[m.length++]=S),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(s,l,h){return r(this.negative===0),this.iushrn(s,l,h)},i.prototype.shln=function(s){return this.clone().ishln(s)},i.prototype.ushln=function(s){return this.clone().iushln(s)},i.prototype.shrn=function(s){return this.clone().ishrn(s)},i.prototype.ushrn=function(s){return this.clone().iushrn(s)},i.prototype.testn=function(s){r(typeof s=="number"&&s>=0);var l=s%26,h=(s-l)/26,d=1<<l;if(this.length<=h)return!1;var b=this.words[h];return!!(b&d)},i.prototype.imaskn=function(s){r(typeof s=="number"&&s>=0);var l=s%26,h=(s-l)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=h)return this;if(l!==0&&h++,this.length=Math.min(h,this.length),l!==0){var d=67108863^67108863>>>l<<l;this.words[this.length-1]&=d}return this.strip()},i.prototype.maskn=function(s){return this.clone().imaskn(s)},i.prototype.iaddn=function(s){return r(typeof s=="number"),r(s<67108864),s<0?this.isubn(-s):this.negative!==0?this.length===1&&(this.words[0]|0)<s?(this.words[0]=s-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(s),this.negative=1,this):this._iaddn(s)},i.prototype._iaddn=function(s){this.words[0]+=s;for(var l=0;l<this.length&&this.words[l]>=67108864;l++)this.words[l]-=67108864,l===this.length-1?this.words[l+1]=1:this.words[l+1]++;return this.length=Math.max(this.length,l+1),this},i.prototype.isubn=function(s){if(r(typeof s=="number"),r(s<67108864),s<0)return this.iaddn(-s);if(this.negative!==0)return this.negative=0,this.iaddn(s),this.negative=1,this;if(this.words[0]-=s,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var l=0;l<this.length&&this.words[l]<0;l++)this.words[l]+=67108864,this.words[l+1]-=1;return this.strip()},i.prototype.addn=function(s){return this.clone().iaddn(s)},i.prototype.subn=function(s){return this.clone().isubn(s)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(s,l,h){var d=s.length+h,b;this._expand(d);var E,B=0;for(b=0;b<s.length;b++){E=(this.words[b+h]|0)+B;var m=(s.words[b]|0)*l;E-=m&67108863,B=(E>>26)-(m/67108864|0),this.words[b+h]=E&67108863}for(;b<this.length-h;b++)E=(this.words[b+h]|0)+B,B=E>>26,this.words[b+h]=E&67108863;if(B===0)return this.strip();for(r(B===-1),B=0,b=0;b<this.length;b++)E=-(this.words[b]|0)+B,B=E>>26,this.words[b]=E&67108863;return this.negative=1,this.strip()},i.prototype._wordDiv=function(s,l){var h=this.length-s.length,d=this.clone(),b=s,E=b.words[b.length-1]|0,B=this._countBits(E);h=26-B,h!==0&&(b=b.ushln(h),d.iushln(h),E=b.words[b.length-1]|0);var m=d.length-b.length,c;if(l!=="mod"){c=new i(null),c.length=m+1,c.words=new Array(c.length);for(var S=0;S<c.length;S++)c.words[S]=0}var R=d.clone()._ishlnsubmul(b,1,m);R.negative===0&&(d=R,c&&(c.words[m]=1));for(var U=m-1;U>=0;U--){var C=(d.words[b.length+U]|0)*67108864+(d.words[b.length+U-1]|0);for(C=Math.min(C/E|0,67108863),d._ishlnsubmul(b,C,U);d.negative!==0;)C--,d.negative=0,d._ishlnsubmul(b,1,U),d.isZero()||(d.negative^=1);c&&(c.words[U]=C)}return c&&c.strip(),d.strip(),l!=="div"&&h!==0&&d.iushrn(h),{div:c||null,mod:d}},i.prototype.divmod=function(s,l,h){if(r(!s.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var d,b,E;return this.negative!==0&&s.negative===0?(E=this.neg().divmod(s,l),l!=="mod"&&(d=E.div.neg()),l!=="div"&&(b=E.mod.neg(),h&&b.negative!==0&&b.iadd(s)),{div:d,mod:b}):this.negative===0&&s.negative!==0?(E=this.divmod(s.neg(),l),l!=="mod"&&(d=E.div.neg()),{div:d,mod:E.mod}):(this.negative&s.negative)!==0?(E=this.neg().divmod(s.neg(),l),l!=="div"&&(b=E.mod.neg(),h&&b.negative!==0&&b.isub(s)),{div:E.div,mod:b}):s.length>this.length||this.cmp(s)<0?{div:new i(0),mod:this}:s.length===1?l==="div"?{div:this.divn(s.words[0]),mod:null}:l==="mod"?{div:null,mod:new i(this.modn(s.words[0]))}:{div:this.divn(s.words[0]),mod:new i(this.modn(s.words[0]))}:this._wordDiv(s,l)},i.prototype.div=function(s){return this.divmod(s,"div",!1).div},i.prototype.mod=function(s){return this.divmod(s,"mod",!1).mod},i.prototype.umod=function(s){return this.divmod(s,"mod",!0).mod},i.prototype.divRound=function(s){var l=this.divmod(s);if(l.mod.isZero())return l.div;var h=l.div.negative!==0?l.mod.isub(s):l.mod,d=s.ushrn(1),b=s.andln(1),E=h.cmp(d);return E<0||b===1&&E===0?l.div:l.div.negative!==0?l.div.isubn(1):l.div.iaddn(1)},i.prototype.modn=function(s){r(s<=67108863);for(var l=(1<<26)%s,h=0,d=this.length-1;d>=0;d--)h=(l*h+(this.words[d]|0))%s;return h},i.prototype.idivn=function(s){r(s<=67108863);for(var l=0,h=this.length-1;h>=0;h--){var d=(this.words[h]|0)+l*67108864;this.words[h]=d/s|0,l=d%s}return this.strip()},i.prototype.divn=function(s){return this.clone().idivn(s)},i.prototype.egcd=function(s){r(s.negative===0),r(!s.isZero());var l=this,h=s.clone();l.negative!==0?l=l.umod(s):l=l.clone();for(var d=new i(1),b=new i(0),E=new i(0),B=new i(1),m=0;l.isEven()&&h.isEven();)l.iushrn(1),h.iushrn(1),++m;for(var c=h.clone(),S=l.clone();!l.isZero();){for(var R=0,U=1;(l.words[0]&U)===0&&R<26;++R,U<<=1);if(R>0)for(l.iushrn(R);R-- >0;)(d.isOdd()||b.isOdd())&&(d.iadd(c),b.isub(S)),d.iushrn(1),b.iushrn(1);for(var C=0,W=1;(h.words[0]&W)===0&&C<26;++C,W<<=1);if(C>0)for(h.iushrn(C);C-- >0;)(E.isOdd()||B.isOdd())&&(E.iadd(c),B.isub(S)),E.iushrn(1),B.iushrn(1);l.cmp(h)>=0?(l.isub(h),d.isub(E),b.isub(B)):(h.isub(l),E.isub(d),B.isub(b))}return{a:E,b:B,gcd:h.iushln(m)}},i.prototype._invmp=function(s){r(s.negative===0),r(!s.isZero());var l=this,h=s.clone();l.negative!==0?l=l.umod(s):l=l.clone();for(var d=new i(1),b=new i(0),E=h.clone();l.cmpn(1)>0&&h.cmpn(1)>0;){for(var B=0,m=1;(l.words[0]&m)===0&&B<26;++B,m<<=1);if(B>0)for(l.iushrn(B);B-- >0;)d.isOdd()&&d.iadd(E),d.iushrn(1);for(var c=0,S=1;(h.words[0]&S)===0&&c<26;++c,S<<=1);if(c>0)for(h.iushrn(c);c-- >0;)b.isOdd()&&b.iadd(E),b.iushrn(1);l.cmp(h)>=0?(l.isub(h),d.isub(b)):(h.isub(l),b.isub(d))}var R;return l.cmpn(1)===0?R=d:R=b,R.cmpn(0)<0&&R.iadd(s),R},i.prototype.gcd=function(s){if(this.isZero())return s.abs();if(s.isZero())return this.abs();var l=this.clone(),h=s.clone();l.negative=0,h.negative=0;for(var d=0;l.isEven()&&h.isEven();d++)l.iushrn(1),h.iushrn(1);do{for(;l.isEven();)l.iushrn(1);for(;h.isEven();)h.iushrn(1);var b=l.cmp(h);if(b<0){var E=l;l=h,h=E}else if(b===0||h.cmpn(1)===0)break;l.isub(h)}while(!0);return h.iushln(d)},i.prototype.invm=function(s){return this.egcd(s).a.umod(s)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(s){return this.words[0]&s},i.prototype.bincn=function(s){r(typeof s=="number");var l=s%26,h=(s-l)/26,d=1<<l;if(this.length<=h)return this._expand(h+1),this.words[h]|=d,this;for(var b=d,E=h;b!==0&&E<this.length;E++){var B=this.words[E]|0;B+=b,b=B>>>26,B&=67108863,this.words[E]=B}return b!==0&&(this.words[E]=b,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(s){var l=s<0;if(this.negative!==0&&!l)return-1;if(this.negative===0&&l)return 1;this.strip();var h;if(this.length>1)h=1;else{l&&(s=-s),r(s<=67108863,"Number is too big");var d=this.words[0]|0;h=d===s?0:d<s?-1:1}return this.negative!==0?-h|0:h},i.prototype.cmp=function(s){if(this.negative!==0&&s.negative===0)return-1;if(this.negative===0&&s.negative!==0)return 1;var l=this.ucmp(s);return this.negative!==0?-l|0:l},i.prototype.ucmp=function(s){if(this.length>s.length)return 1;if(this.length<s.length)return-1;for(var l=0,h=this.length-1;h>=0;h--){var d=this.words[h]|0,b=s.words[h]|0;if(d!==b){d<b?l=-1:d>b&&(l=1);break}}return l},i.prototype.gtn=function(s){return this.cmpn(s)===1},i.prototype.gt=function(s){return this.cmp(s)===1},i.prototype.gten=function(s){return this.cmpn(s)>=0},i.prototype.gte=function(s){return this.cmp(s)>=0},i.prototype.ltn=function(s){return this.cmpn(s)===-1},i.prototype.lt=function(s){return this.cmp(s)===-1},i.prototype.lten=function(s){return this.cmpn(s)<=0},i.prototype.lte=function(s){return this.cmp(s)<=0},i.prototype.eqn=function(s){return this.cmpn(s)===0},i.prototype.eq=function(s){return this.cmp(s)===0},i.red=function(s){return new H(s)},i.prototype.toRed=function(s){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),s.convertTo(this)._forceRed(s)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(s){return this.red=s,this},i.prototype.forceRed=function(s){return r(!this.red,"Already a number in reduction context"),this._forceRed(s)},i.prototype.redAdd=function(s){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,s)},i.prototype.redIAdd=function(s){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,s)},i.prototype.redSub=function(s){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,s)},i.prototype.redISub=function(s){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,s)},i.prototype.redShl=function(s){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,s)},i.prototype.redMul=function(s){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,s),this.red.mul(this,s)},i.prototype.redIMul=function(s){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,s),this.red.imul(this,s)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(s){return r(this.red&&!s.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,s)};var N={k256:null,p224:null,p192:null,p25519:null};function q(M,s){this.name=M,this.p=new i(s,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}q.prototype._tmp=function(){var s=new i(null);return s.words=new Array(Math.ceil(this.n/13)),s},q.prototype.ireduce=function(s){var l=s,h;do this.split(l,this.tmp),l=this.imulK(l),l=l.iadd(this.tmp),h=l.bitLength();while(h>this.n);var d=h<this.n?-1:l.ucmp(this.p);return d===0?(l.words[0]=0,l.length=1):d>0?l.isub(this.p):l.strip!==void 0?l.strip():l._strip(),l},q.prototype.split=function(s,l){s.iushrn(this.n,0,l)},q.prototype.imulK=function(s){return s.imul(this.k)};function K(){q.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(K,q),K.prototype.split=function(s,l){for(var h=4194303,d=Math.min(s.length,9),b=0;b<d;b++)l.words[b]=s.words[b];if(l.length=d,s.length<=9){s.words[0]=0,s.length=1;return}var E=s.words[9];for(l.words[l.length++]=E&h,b=10;b<s.length;b++){var B=s.words[b]|0;s.words[b-10]=(B&h)<<4|E>>>22,E=B}E>>>=22,s.words[b-10]=E,E===0&&s.length>10?s.length-=10:s.length-=9},K.prototype.imulK=function(s){s.words[s.length]=0,s.words[s.length+1]=0,s.length+=2;for(var l=0,h=0;h<s.length;h++){var d=s.words[h]|0;l+=d*977,s.words[h]=l&67108863,l=d*64+(l/67108864|0)}return s.words[s.length-1]===0&&(s.length--,s.words[s.length-1]===0&&s.length--),s};function L(){q.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(L,q);function k(){q.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(k,q);function j(){q.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(j,q),j.prototype.imulK=function(s){for(var l=0,h=0;h<s.length;h++){var d=(s.words[h]|0)*19+l,b=d&67108863;d>>>=26,s.words[h]=b,l=d}return l!==0&&(s.words[s.length++]=l),s},i._prime=function(s){if(N[s])return N[s];var l;if(s==="k256")l=new K;else if(s==="p224")l=new L;else if(s==="p192")l=new k;else if(s==="p25519")l=new j;else throw new Error("Unknown prime "+s);return N[s]=l,l};function H(M){if(typeof M=="string"){var s=i._prime(M);this.m=s.p,this.prime=s}else r(M.gtn(1),"modulus must be greater than 1"),this.m=M,this.prime=null}H.prototype._verify1=function(s){r(s.negative===0,"red works only with positives"),r(s.red,"red works only with red numbers")},H.prototype._verify2=function(s,l){r((s.negative|l.negative)===0,"red works only with positives"),r(s.red&&s.red===l.red,"red works only with red numbers")},H.prototype.imod=function(s){return this.prime?this.prime.ireduce(s)._forceRed(this):s.umod(this.m)._forceRed(this)},H.prototype.neg=function(s){return s.isZero()?s.clone():this.m.sub(s)._forceRed(this)},H.prototype.add=function(s,l){this._verify2(s,l);var h=s.add(l);return h.cmp(this.m)>=0&&h.isub(this.m),h._forceRed(this)},H.prototype.iadd=function(s,l){this._verify2(s,l);var h=s.iadd(l);return h.cmp(this.m)>=0&&h.isub(this.m),h},H.prototype.sub=function(s,l){this._verify2(s,l);var h=s.sub(l);return h.cmpn(0)<0&&h.iadd(this.m),h._forceRed(this)},H.prototype.isub=function(s,l){this._verify2(s,l);var h=s.isub(l);return h.cmpn(0)<0&&h.iadd(this.m),h},H.prototype.shl=function(s,l){return this._verify1(s),this.imod(s.ushln(l))},H.prototype.imul=function(s,l){return this._verify2(s,l),this.imod(s.imul(l))},H.prototype.mul=function(s,l){return this._verify2(s,l),this.imod(s.mul(l))},H.prototype.isqr=function(s){return this.imul(s,s.clone())},H.prototype.sqr=function(s){return this.mul(s,s)},H.prototype.sqrt=function(s){if(s.isZero())return s.clone();var l=this.m.andln(3);if(r(l%2===1),l===3){var h=this.m.add(new i(1)).iushrn(2);return this.pow(s,h)}for(var d=this.m.subn(1),b=0;!d.isZero()&&d.andln(1)===0;)b++,d.iushrn(1);r(!d.isZero());var E=new i(1).toRed(this),B=E.redNeg(),m=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new i(2*c*c).toRed(this);this.pow(c,m).cmp(B)!==0;)c.redIAdd(B);for(var S=this.pow(c,d),R=this.pow(s,d.addn(1).iushrn(1)),U=this.pow(s,d),C=b;U.cmp(E)!==0;){for(var W=U,J=0;W.cmp(E)!==0;J++)W=W.redSqr();r(J<C);var Q=this.pow(S,new i(1).iushln(C-J-1));R=R.redMul(Q),S=Q.redSqr(),U=U.redMul(S),C=J}return R},H.prototype.invm=function(s){var l=s._invmp(this.m);return l.negative!==0?(l.negative=0,this.imod(l).redNeg()):this.imod(l)},H.prototype.pow=function(s,l){if(l.isZero())return new i(1).toRed(this);if(l.cmpn(1)===0)return s.clone();var h=4,d=new Array(1<<h);d[0]=new i(1).toRed(this),d[1]=s;for(var b=2;b<d.length;b++)d[b]=this.mul(d[b-1],s);var E=d[0],B=0,m=0,c=l.bitLength()%26;for(c===0&&(c=26),b=l.length-1;b>=0;b--){for(var S=l.words[b],R=c-1;R>=0;R--){var U=S>>R&1;if(E!==d[0]&&(E=this.sqr(E)),U===0&&B===0){m=0;continue}B<<=1,B|=U,m++,!(m!==h&&(b!==0||R!==0))&&(E=this.mul(E,d[B]),m=0,B=0)}c=26}return E},H.prototype.convertTo=function(s){var l=s.umod(this.m);return l===s?l.clone():l},H.prototype.convertFrom=function(s){var l=s.clone();return l.red=null,l},i.mont=function(s){return new G(s)};function G(M){H.call(this,M),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(G,H),G.prototype.convertTo=function(s){return this.imod(s.ushln(this.shift))},G.prototype.convertFrom=function(s){var l=this.imod(s.mul(this.rinv));return l.red=null,l},G.prototype.imul=function(s,l){if(s.isZero()||l.isZero())return s.words[0]=0,s.length=1,s;var h=s.imul(l),d=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),b=h.isub(d).iushrn(this.shift),E=b;return b.cmp(this.m)>=0?E=b.isub(this.m):b.cmpn(0)<0&&(E=b.iadd(this.m)),E._forceRed(this)},G.prototype.mul=function(s,l){if(s.isZero()||l.isZero())return new i(0)._forceRed(this);var h=s.mul(l),d=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),b=h.isub(d).iushrn(this.shift),E=b;return b.cmp(this.m)>=0?E=b.isub(this.m):b.cmpn(0)<0&&(E=b.iadd(this.m)),E._forceRed(this)},G.prototype.invm=function(s){var l=this.imod(s._invmp(this.m).mul(this.r2));return l._forceRed(this)}})(typeof ca>"u"||ca,kc)});var Kc=D(Dt=>{"use strict";P();O();var w1=Dt&&Dt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Dt,"__esModule",{value:!0});Dt.stripHexPrefix=Dt.isHexPrefixed=Dt.getLength=Dt.decode=Dt.encode=void 0;var x1=w1(mt());function Lc(e){if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++)t.push(Lc(e[n]));let r=I.Buffer.concat(t);return I.Buffer.concat([Nc(r.length,192),r])}else{let t=ba(e);return t.length===1&&t[0]<128?t:I.Buffer.concat([Nc(t.length,128),t])}}Dt.encode=Lc;function da(e,t){if(e[0]==="0"&&e[1]==="0")throw new Error("invalid RLP: extra zeros");return parseInt(e,t)}function Nc(e,t){if(e<56)return I.Buffer.from([e+t]);{let r=la(e),n=r.length/2,i=la(t+55+n);return I.Buffer.from(i+r,"hex")}}function _1(e,t=!1){if(!e||e.length===0)return I.Buffer.from([]);let r=ba(e),n=ua(r);if(t)return n;if(n.remainder.length!==0)throw new Error("invalid remainder");return n.data}Dt.decode=_1;function S1(e){if(!e||e.length===0)return I.Buffer.from([]);let t=ba(e),r=t[0];if(r<=127)return t.length;if(r<=183)return r-127;if(r<=191)return r-182;if(r<=247)return r-191;{let n=r-246,i=da(t.slice(1,n).toString("hex"),16);return n+i}}Dt.getLength=S1;function ua(e){let t,r,n,i,o,a=[],f=e[0];if(f<=127)return{data:e.slice(0,1),remainder:e.slice(1)};if(f<=183){if(t=f-127,f===128?n=I.Buffer.from([]):n=e.slice(1,t),t===2&&n[0]<128)throw new Error("invalid rlp encoding: byte must be less 0x80");return{data:n,remainder:e.slice(t)}}else if(f<=191){if(r=f-182,e.length-1<r)throw new Error("invalid RLP: not enough bytes for string length");if(t=da(e.slice(1,r).toString("hex"),16),t<=55)throw new Error("invalid RLP: expected string length to be greater than 55");if(n=e.slice(r,t+r),n.length<t)throw new Error("invalid RLP: not enough bytes for string");return{data:n,remainder:e.slice(t+r)}}else if(f<=247){for(t=f-191,i=e.slice(1,t);i.length;)o=ua(i),a.push(o.data),i=o.remainder;return{data:a,remainder:e.slice(t)}}else{r=f-246,t=da(e.slice(1,r).toString("hex"),16);let u=r+t;if(u>e.length)throw new Error("invalid rlp: total length is larger than the data");if(i=e.slice(r,u),i.length===0)throw new Error("invalid rlp, List has a invalid length");for(;i.length;)o=ua(i),a.push(o.data),i=o.remainder;return{data:a,remainder:e.slice(u)}}}function ha(e){return e.slice(0,2)==="0x"}Dt.isHexPrefixed=ha;function Hc(e){return ha(e)?e.slice(2):e}Dt.stripHexPrefix=Hc;function la(e){if(e<0)throw new Error("Invalid integer as argument, must be unsigned!");let t=e.toString(16);return t.length%2?`0${t}`:t}function E1(e){return e.length%2?`0${e}`:e}function M1(e){let t=la(e);return I.Buffer.from(t,"hex")}function ba(e){if(!I.Buffer.isBuffer(e)){if(typeof e=="string")return ha(e)?I.Buffer.from(E1(Hc(e)),"hex"):I.Buffer.from(e);if(typeof e=="number"||typeof e=="bigint")return e?M1(e):I.Buffer.from([]);if(e==null)return I.Buffer.from([]);if(e instanceof Uint8Array)return I.Buffer.from(e);if(x1.default.isBN(e))return I.Buffer.from(e.toArray());throw new Error("invalid type")}return e}});var jc=D(ni=>{"use strict";P();O();Object.defineProperty(ni,"__esModule",{value:!0});ni.validateHexString=ni.isHexString=void 0;function A1(e,t){return e.match(/^0x[0-9A-Fa-f]*$/)?!(t&&e.length!==2+2*t):!1}ni.isHexString=A1;function B1(e){if(!e)return!1;let t=e.toLowerCase().startsWith("0x")?e.substring(2).toLowerCase():e.toLowerCase();return!(t.length===0||t.length%2!==0||!t.match(/^[0-9A-Fa-f]*$/))}ni.validateHexString=B1});var Rc=D(As=>{"use strict";P();O();Object.defineProperty(As,"__esModule",{value:!0});As.encode=void 0;function I1(e){var t="0123456789abcdef";function r(L){var k,j="";for(k=0;k<=3;k++)j+=t.charAt(L>>k*8+4&15)+t.charAt(L>>k*8&15);return j}function n(L,k){var j=(L&65535)+(k&65535),H=(L>>16)+(k>>16)+(j>>16);return H<<16|j&65535}function i(L,k){return L<<k|L>>>32-k}function o(L,k,j,H,G,M){return n(i(n(n(k,L),n(H,M)),G),j)}function a(L,k,j,H,G,M,s){return o(k&j|~k&H,L,k,G,M,s)}function f(L,k,j,H,G,M,s){return o(k&H|j&~H,L,k,G,M,s)}function u(L,k,j,H,G,M,s){return o(k^j^H,L,k,G,M,s)}function p(L,k,j,H,G,M,s){return o(j^(k|~H),L,k,G,M,s)}function y(L){var k,j=(L.length+8>>6)+1,H=new Array(j*16);for(k=0;k<j*16;k++)H[k]=0;for(k=0;k<L.length;k++)H[k>>2]|=L.charCodeAt(k)<<k%4*8;return H[k>>2]|=128<<k%4*8,H[j*16-2]=L.length*8,H}var g,x=y(""+e),w=1732584193,_=-271733879,v=-1732584194,A=271733878,T,N,q,K;for(g=0;g<x.length;g+=16)T=w,N=_,q=v,K=A,w=a(w,_,v,A,x[g+0],7,-680876936),A=a(A,w,_,v,x[g+1],12,-389564586),v=a(v,A,w,_,x[g+2],17,606105819),_=a(_,v,A,w,x[g+3],22,-1044525330),w=a(w,_,v,A,x[g+4],7,-176418897),A=a(A,w,_,v,x[g+5],12,1200080426),v=a(v,A,w,_,x[g+6],17,-1473231341),_=a(_,v,A,w,x[g+7],22,-45705983),w=a(w,_,v,A,x[g+8],7,1770035416),A=a(A,w,_,v,x[g+9],12,-1958414417),v=a(v,A,w,_,x[g+10],17,-42063),_=a(_,v,A,w,x[g+11],22,-1990404162),w=a(w,_,v,A,x[g+12],7,1804603682),A=a(A,w,_,v,x[g+13],12,-40341101),v=a(v,A,w,_,x[g+14],17,-1502002290),_=a(_,v,A,w,x[g+15],22,1236535329),w=f(w,_,v,A,x[g+1],5,-165796510),A=f(A,w,_,v,x[g+6],9,-1069501632),v=f(v,A,w,_,x[g+11],14,643717713),_=f(_,v,A,w,x[g+0],20,-373897302),w=f(w,_,v,A,x[g+5],5,-701558691),A=f(A,w,_,v,x[g+10],9,38016083),v=f(v,A,w,_,x[g+15],14,-660478335),_=f(_,v,A,w,x[g+4],20,-405537848),w=f(w,_,v,A,x[g+9],5,568446438),A=f(A,w,_,v,x[g+14],9,-1019803690),v=f(v,A,w,_,x[g+3],14,-187363961),_=f(_,v,A,w,x[g+8],20,1163531501),w=f(w,_,v,A,x[g+13],5,-1444681467),A=f(A,w,_,v,x[g+2],9,-51403784),v=f(v,A,w,_,x[g+7],14,1735328473),_=f(_,v,A,w,x[g+12],20,-1926607734),w=u(w,_,v,A,x[g+5],4,-378558),A=u(A,w,_,v,x[g+8],11,-2022574463),v=u(v,A,w,_,x[g+11],16,1839030562),_=u(_,v,A,w,x[g+14],23,-35309556),w=u(w,_,v,A,x[g+1],4,-1530992060),A=u(A,w,_,v,x[g+4],11,1272893353),v=u(v,A,w,_,x[g+7],16,-155497632),_=u(_,v,A,w,x[g+10],23,-1094730640),w=u(w,_,v,A,x[g+13],4,681279174),A=u(A,w,_,v,x[g+0],11,-358537222),v=u(v,A,w,_,x[g+3],16,-722521979),_=u(_,v,A,w,x[g+6],23,76029189),w=u(w,_,v,A,x[g+9],4,-640364487),A=u(A,w,_,v,x[g+12],11,-421815835),v=u(v,A,w,_,x[g+15],16,530742520),_=u(_,v,A,w,x[g+2],23,-995338651),w=p(w,_,v,A,x[g+0],6,-198630844),A=p(A,w,_,v,x[g+7],10,1126891415),v=p(v,A,w,_,x[g+14],15,-1416354905),_=p(_,v,A,w,x[g+5],21,-57434055),w=p(w,_,v,A,x[g+12],6,1700485571),A=p(A,w,_,v,x[g+3],10,-1894986606),v=p(v,A,w,_,x[g+10],15,-1051523),_=p(_,v,A,w,x[g+1],21,-2054922799),w=p(w,_,v,A,x[g+8],6,1873313359),A=p(A,w,_,v,x[g+15],10,-30611744),v=p(v,A,w,_,x[g+6],15,-1560198380),_=p(_,v,A,w,x[g+13],21,1309151649),w=p(w,_,v,A,x[g+4],6,-145523070),A=p(A,w,_,v,x[g+11],10,-1120210379),v=p(v,A,w,_,x[g+2],15,718787259),_=p(_,v,A,w,x[g+9],21,-343485551),w=n(w,T),_=n(_,N),v=n(v,q),A=n(A,K);return r(w)+r(_)+r(v)+r(A)}As.encode=I1});var ga=D(ge=>{"use strict";P();O();var P1=ge&&ge.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),O1=ge&&ge.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Dc=ge&&ge.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&P1(t,e,r);return O1(t,e),t};Object.defineProperty(ge,"__esModule",{value:!0});ge.blake2s=ge.compress=ge.IV=void 0;var T1=Dc(Vn()),Uc=Dc(xs()),_r=It();ge.IV=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);function Xr(e,t,r,n,i){return e=e+t+i|0,n=(0,_r.rotr)(n^e,16),r=r+n|0,t=(0,_r.rotr)(t^r,12),{a:e,b:t,c:r,d:n}}function Yr(e,t,r,n,i){return e=e+t+i|0,n=(0,_r.rotr)(n^e,8),r=r+n|0,t=(0,_r.rotr)(t^r,7),{a:e,b:t,c:r,d:n}}function Cc(e,t,r,n,i,o,a,f,u,p,y,g,x,w,_,v,A,T,N,q){let K=0;for(let L=0;L<n;L++)({a:i,b:u,c:x,d:A}=Xr(i,u,x,A,r[t+e[K++]])),{a:i,b:u,c:x,d:A}=Yr(i,u,x,A,r[t+e[K++]]),{a:o,b:p,c:w,d:T}=Xr(o,p,w,T,r[t+e[K++]]),{a:o,b:p,c:w,d:T}=Yr(o,p,w,T,r[t+e[K++]]),{a,b:y,c:_,d:N}=Xr(a,y,_,N,r[t+e[K++]]),{a,b:y,c:_,d:N}=Yr(a,y,_,N,r[t+e[K++]]),{a:f,b:g,c:v,d:q}=Xr(f,g,v,q,r[t+e[K++]]),{a:f,b:g,c:v,d:q}=Yr(f,g,v,q,r[t+e[K++]]),{a:i,b:p,c:_,d:q}=Xr(i,p,_,q,r[t+e[K++]]),{a:i,b:p,c:_,d:q}=Yr(i,p,_,q,r[t+e[K++]]),{a:o,b:y,c:v,d:A}=Xr(o,y,v,A,r[t+e[K++]]),{a:o,b:y,c:v,d:A}=Yr(o,y,v,A,r[t+e[K++]]),{a,b:g,c:x,d:T}=Xr(a,g,x,T,r[t+e[K++]]),{a,b:g,c:x,d:T}=Yr(a,g,x,T,r[t+e[K++]]),{a:f,b:u,c:w,d:N}=Xr(f,u,w,N,r[t+e[K++]]),{a:f,b:u,c:w,d:N}=Yr(f,u,w,N,r[t+e[K++]]);return{v0:i,v1:o,v2:a,v3:f,v4:u,v5:p,v6:y,v7:g,v8:x,v9:w,v10:_,v11:v,v12:A,v13:T,v14:N,v15:q}}ge.compress=Cc;var pa=class extends Uc.BLAKE2{constructor(t={}){super(64,t.dkLen===void 0?32:t.dkLen,t,32,8,8),this.v0=ge.IV[0]|0,this.v1=ge.IV[1]|0,this.v2=ge.IV[2]|0,this.v3=ge.IV[3]|0,this.v4=ge.IV[4]|0,this.v5=ge.IV[5]|0,this.v6=ge.IV[6]|0,this.v7=ge.IV[7]|0;let r=t.key?t.key.length:0;if(this.v0^=this.outputLen|r<<8|1<<16|1<<24,t.salt){let n=(0,_r.u32)((0,_r.toBytes)(t.salt));this.v4^=n[0],this.v5^=n[1]}if(t.personalization){let n=(0,_r.u32)((0,_r.toBytes)(t.personalization));this.v6^=n[0],this.v7^=n[1]}if(t.key){let n=new Uint8Array(this.blockLen);n.set((0,_r.toBytes)(t.key)),this.update(n)}}get(){let{v0:t,v1:r,v2:n,v3:i,v4:o,v5:a,v6:f,v7:u}=this;return[t,r,n,i,o,a,f,u]}set(t,r,n,i,o,a,f,u){this.v0=t|0,this.v1=r|0,this.v2=n|0,this.v3=i|0,this.v4=o|0,this.v5=a|0,this.v6=f|0,this.v7=u|0}compress(t,r,n){let{h:i,l:o}=T1.fromBig(BigInt(this.length)),{v0:a,v1:f,v2:u,v3:p,v4:y,v5:g,v6:x,v7:w,v8:_,v9:v,v10:A,v11:T,v12:N,v13:q,v14:K,v15:L}=Cc(Uc.SIGMA,r,t,10,this.v0,this.v1,this.v2,this.v3,this.v4,this.v5,this.v6,this.v7,ge.IV[0],ge.IV[1],ge.IV[2],ge.IV[3],o^ge.IV[4],i^ge.IV[5],n?~ge.IV[6]:ge.IV[6],ge.IV[7]);this.v0^=a^_,this.v1^=f^v,this.v2^=u^A,this.v3^=p^T,this.v4^=y^N,this.v5^=g^q,this.v6^=x^K,this.v7^=w^L}destroy(){this.destroyed=!0,this.buffer32.fill(0),this.set(0,0,0,0,0,0,0,0)}};ge.blake2s=(0,_r.wrapConstructorWithOpts)(e=>new pa(e))});var Bs=D(ii=>{"use strict";P();O();Object.defineProperty(ii,"__esModule",{value:!0});ii.pbkdf2Async=ii.pbkdf2=void 0;var q1=Ci(),Sr=It();function zc(e,t,r,n){(0,Sr.assertHash)(e);let i=(0,Sr.checkOpts)({dkLen:32,asyncTick:10},n),{c:o,dkLen:a,asyncTick:f}=i;if((0,Sr.assertNumber)(o),(0,Sr.assertNumber)(a),(0,Sr.assertNumber)(f),o<1)throw new Error("PBKDF2: iterations (c) should be >= 1");let u=(0,Sr.toBytes)(t),p=(0,Sr.toBytes)(r),y=new Uint8Array(a),g=q1.hmac.create(e,u),x=g._cloneInto().update(p);return{c:o,dkLen:a,asyncTick:f,DK:y,PRF:g,PRFSalt:x}}function Fc(e,t,r,n,i){return e.destroy(),t.destroy(),n&&n.destroy(),i.fill(0),r}function k1(e,t,r,n){let{c:i,dkLen:o,DK:a,PRF:f,PRFSalt:u}=zc(e,t,r,n),p,y=new Uint8Array(4),g=(0,Sr.createView)(y),x=new Uint8Array(f.outputLen);for(let w=1,_=0;_<o;w++,_+=f.outputLen){let v=a.subarray(_,_+f.outputLen);g.setInt32(0,w,!1),(p=u._cloneInto(p)).update(y).digestInto(x),v.set(x.subarray(0,v.length));for(let A=1;A<i;A++){f._cloneInto(p).update(x).digestInto(x);for(let T=0;T<v.length;T++)v[T]^=x[T]}}return Fc(f,u,a,p,x)}ii.pbkdf2=k1;async function N1(e,t,r,n){let{c:i,dkLen:o,asyncTick:a,DK:f,PRF:u,PRFSalt:p}=zc(e,t,r,n),y,g=new Uint8Array(4),x=(0,Sr.createView)(g),w=new Uint8Array(u.outputLen);for(let _=1,v=0;v<o;_++,v+=u.outputLen){let A=f.subarray(v,v+u.outputLen);x.setInt32(0,_,!1),(y=p._cloneInto(y)).update(g).digestInto(w),A.set(w.subarray(0,A.length)),await(0,Sr.asyncLoop)(i-1,a,T=>{u._cloneInto(y).update(w).digestInto(w);for(let N=0;N<A.length;N++)A[N]^=w[N]})}return Fc(u,p,f,y,w)}ii.pbkdf2Async=N1});var Xc=D(oi=>{"use strict";P();O();Object.defineProperty(oi,"__esModule",{value:!0});oi.scryptAsync=oi.scrypt=void 0;var Vc=$n(),Wc=Bs(),Wt=It(),he=(e,t)=>e<<t|e>>>32-t;function $c(e,t,r,n,i,o){let a=e[t++]^r[n++],f=e[t++]^r[n++],u=e[t++]^r[n++],p=e[t++]^r[n++],y=e[t++]^r[n++],g=e[t++]^r[n++],x=e[t++]^r[n++],w=e[t++]^r[n++],_=e[t++]^r[n++],v=e[t++]^r[n++],A=e[t++]^r[n++],T=e[t++]^r[n++],N=e[t++]^r[n++],q=e[t++]^r[n++],K=e[t++]^r[n++],L=e[t++]^r[n++],k=a,j=f,H=u,G=p,M=y,s=g,l=x,h=w,d=_,b=v,E=A,B=T,m=N,c=q,S=K,R=L;for(let U=0;U<8;U+=2)M^=he(k+m|0,7),d^=he(M+k|0,9),m^=he(d+M|0,13),k^=he(m+d|0,18),b^=he(s+j|0,7),c^=he(b+s|0,9),j^=he(c+b|0,13),s^=he(j+c|0,18),S^=he(E+l|0,7),H^=he(S+E|0,9),l^=he(H+S|0,13),E^=he(l+H|0,18),G^=he(R+B|0,7),h^=he(G+R|0,9),B^=he(h+G|0,13),R^=he(B+h|0,18),j^=he(k+G|0,7),H^=he(j+k|0,9),G^=he(H+j|0,13),k^=he(G+H|0,18),l^=he(s+M|0,7),h^=he(l+s|0,9),M^=he(h+l|0,13),s^=he(M+h|0,18),B^=he(E+b|0,7),d^=he(B+E|0,9),b^=he(d+B|0,13),E^=he(b+d|0,18),m^=he(R+S|0,7),c^=he(m+R|0,9),S^=he(c+m|0,13),R^=he(S+c|0,18);i[o++]=a+k|0,i[o++]=f+j|0,i[o++]=u+H|0,i[o++]=p+G|0,i[o++]=y+M|0,i[o++]=g+s|0,i[o++]=x+l|0,i[o++]=w+h|0,i[o++]=_+d|0,i[o++]=v+b|0,i[o++]=A+E|0,i[o++]=T+B|0,i[o++]=N+m|0,i[o++]=q+c|0,i[o++]=K+S|0,i[o++]=L+R|0}function si(e,t,r,n,i){let o=n+0,a=n+16*i;for(let f=0;f<16;f++)r[a+f]=e[t+(2*i-1)*16+f];for(let f=0;f<i;f++,o+=16,t+=16)$c(r,a,e,t,r,o),f>0&&(a+=16),$c(r,o,e,t+=16,r,a)}function Zc(e,t,r){let n=(0,Wt.checkOpts)({dkLen:32,asyncTick:10,maxmem:1073742848},r),{N:i,r:o,p:a,dkLen:f,asyncTick:u,maxmem:p,onProgress:y}=n;if((0,Wt.assertNumber)(i),(0,Wt.assertNumber)(o),(0,Wt.assertNumber)(a),(0,Wt.assertNumber)(f),(0,Wt.assertNumber)(u),(0,Wt.assertNumber)(p),y!==void 0&&typeof y!="function")throw new Error("progressCb should be function");let g=128*o,x=g/4;if(i<=1||(i&i-1)!==0||i>=2**(g/8)||i>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(a<0||a>(2**32-1)*32/g)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(f<0||f>(2**32-1)*32)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");let w=g*(i+a);if(w>p)throw new Error(`Scrypt: parameters too large, ${w} (128 * r * (N + p)) > ${p} (maxmem)`);let _=(0,Wc.pbkdf2)(Vc.sha256,e,t,{c:1,dkLen:g*a}),v=(0,Wt.u32)(_),A=(0,Wt.u32)(new Uint8Array(g*i)),T=(0,Wt.u32)(new Uint8Array(g)),N=()=>{};if(y){let q=2*i*a,K=Math.max(Math.floor(q/1e4),1),L=0;N=()=>{L++,y&&(!(L%K)||L===q)&&y(L/q)}}return{N:i,r:o,p:a,dkLen:f,blockSize32:x,V:A,B32:v,B:_,tmp:T,blockMixCb:N,asyncTick:u}}function Gc(e,t,r,n,i){let o=(0,Wc.pbkdf2)(Vc.sha256,e,r,{c:1,dkLen:t});return r.fill(0),n.fill(0),i.fill(0),o}function L1(e,t,r){let{N:n,r:i,p:o,dkLen:a,blockSize32:f,V:u,B32:p,B:y,tmp:g,blockMixCb:x}=Zc(e,t,r);for(let w=0;w<o;w++){let _=f*w;for(let v=0;v<f;v++)u[v]=p[_+v];for(let v=0,A=0;v<n-1;v++)si(u,A,u,A+=f,i),x();si(u,(n-1)*f,p,_,i),x();for(let v=0;v<n;v++){let A=p[_+f-16]%n;for(let T=0;T<f;T++)g[T]=p[_+T]^u[A*f+T];si(g,0,p,_,i),x()}}return Gc(e,a,y,u,g)}oi.scrypt=L1;async function H1(e,t,r){let{N:n,r:i,p:o,dkLen:a,blockSize32:f,V:u,B32:p,B:y,tmp:g,blockMixCb:x,asyncTick:w}=Zc(e,t,r);for(let _=0;_<o;_++){let v=f*_;for(let T=0;T<f;T++)u[T]=p[v+T];let A=0;await(0,Wt.asyncLoop)(n-1,w,T=>{si(u,A,u,A+=f,i),x()}),si(u,(n-1)*f,p,v,i),x(),await(0,Wt.asyncLoop)(n,w,T=>{let N=p[v+f-16]%n;for(let q=0;q<f;q++)g[q]=p[v+q]^u[N*f+q];si(g,0,p,v,i),x()})}return Gc(e,a,y,u,g)}oi.scryptAsync=H1});var Qc=D(Er=>{"use strict";P();O();var K1=Er&&Er.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),j1=Er&&Er.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),ya=Er&&Er.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&K1(t,e,r);return j1(t,e),t};Object.defineProperty(Er,"__esModule",{value:!0});Er.blake3=void 0;var Yc=ya(Vn()),R1=ya(xs()),fr=ya(ga()),vn=It(),Zt;(function(e){e[e.CHUNK_START=1]="CHUNK_START",e[e.CHUNK_END=2]="CHUNK_END",e[e.PARENT=4]="PARENT",e[e.ROOT=8]="ROOT",e[e.KEYED_HASH=16]="KEYED_HASH",e[e.DERIVE_KEY_CONTEXT=32]="DERIVE_KEY_CONTEXT",e[e.DERIVE_KEY_MATERIAL=64]="DERIVE_KEY_MATERIAL"})(Zt||(Zt={}));var Jc=(()=>{let e=Array.from({length:16},(n,i)=>i),t=n=>[2,6,3,10,7,0,4,13,1,11,12,5,9,14,15,8].map(i=>n[i]),r=[];for(let n=0,i=e;n<7;n++,i=t(i))r.push(...i);return Uint8Array.from(r)})(),zi=class extends R1.BLAKE2{constructor(t={},r=0){if(super(64,t.dkLen===void 0?32:t.dkLen,{},Number.MAX_SAFE_INTEGER,0,0),this.flags=0,this.chunkPos=0,this.chunksDone=0,this.stack=[],this.posOut=0,this.bufferOut32=new Uint32Array(16),this.chunkOut=0,this.enableXOF=!0,this.outputLen=t.dkLen===void 0?32:t.dkLen,(0,vn.assertNumber)(this.outputLen),t.key!==void 0&&t.context!==void 0)throw new Error("Blake3: only key or context can be specified at same time");if(t.key!==void 0){let n=(0,vn.toBytes)(t.key);if(n.length!==32)throw new Error("Blake3: key should be 32 byte");this.IV=(0,vn.u32)(n),this.flags=r|Zt.KEYED_HASH}else if(t.context!==void 0){let n=new zi({dkLen:32},Zt.DERIVE_KEY_CONTEXT).update(t.context).digest();this.IV=(0,vn.u32)(n),this.flags=r|Zt.DERIVE_KEY_MATERIAL}else this.IV=fr.IV.slice(),this.flags=r;this.state=this.IV.slice(),this.bufferOut=(0,vn.u8)(this.bufferOut32)}get(){return[]}set(){}b2Compress(t,r,n,i=0){let{state:o,pos:a}=this,{h:f,l:u}=Yc.fromBig(BigInt(t),!0),{v0:p,v1:y,v2:g,v3:x,v4:w,v5:_,v6:v,v7:A,v8:T,v9:N,v10:q,v11:K,v12:L,v13:k,v14:j,v15:H}=fr.compress(Jc,i,n,7,o[0],o[1],o[2],o[3],o[4],o[5],o[6],o[7],fr.IV[0],fr.IV[1],fr.IV[2],fr.IV[3],f,u,a,r);o[0]=p^T,o[1]=y^N,o[2]=g^q,o[3]=x^K,o[4]=w^L,o[5]=_^k,o[6]=v^j,o[7]=A^H}compress(t,r=0,n=!1){let i=this.flags;if(this.chunkPos||(i|=Zt.CHUNK_START),(this.chunkPos===15||n)&&(i|=Zt.CHUNK_END),n||(this.pos=this.blockLen),this.b2Compress(this.chunksDone,i,t,r),this.chunkPos+=1,this.chunkPos===16||n){let o=this.state;this.state=this.IV.slice();for(let a,f=this.chunksDone+1;(n||!(f&1))&&(a=this.stack.pop());f>>=1)this.buffer32.set(a,0),this.buffer32.set(o,8),this.pos=this.blockLen,this.b2Compress(0,this.flags|Zt.PARENT,this.buffer32,0),o=this.state,this.state=this.IV.slice();this.chunksDone++,this.chunkPos=0,this.stack.push(o)}this.pos=0}_cloneInto(t){t=super._cloneInto(t);let{IV:r,flags:n,state:i,chunkPos:o,posOut:a,chunkOut:f,stack:u,chunksDone:p}=this;return t.state.set(i.slice()),t.stack=u.map(y=>Uint32Array.from(y)),t.IV.set(r),t.flags=n,t.chunkPos=o,t.chunksDone=p,t.posOut=a,t.chunkOut=f,t.enableXOF=this.enableXOF,t.bufferOut32.set(this.bufferOut32),t}destroy(){this.destroyed=!0,this.state.fill(0),this.buffer32.fill(0),this.IV.fill(0),this.bufferOut32.fill(0);for(let t of this.stack)t.fill(0)}b2CompressOut(){let{state:t,pos:r,flags:n,buffer32:i,bufferOut32:o}=this,{h:a,l:f}=Yc.fromBig(BigInt(this.chunkOut++)),{v0:u,v1:p,v2:y,v3:g,v4:x,v5:w,v6:_,v7:v,v8:A,v9:T,v10:N,v11:q,v12:K,v13:L,v14:k,v15:j}=fr.compress(Jc,0,i,7,t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],fr.IV[0],fr.IV[1],fr.IV[2],fr.IV[3],f,a,r,n);o[0]=u^A,o[1]=p^T,o[2]=y^N,o[3]=g^q,o[4]=x^K,o[5]=w^L,o[6]=_^k,o[7]=v^j,o[8]=t[0]^A,o[9]=t[1]^T,o[10]=t[2]^N,o[11]=t[3]^q,o[12]=t[4]^K,o[13]=t[5]^L,o[14]=t[6]^k,o[15]=t[7]^j,this.posOut=0}finish(){if(this.finished)return;this.finished=!0,this.buffer.fill(0,this.pos);let t=this.flags|Zt.ROOT;this.stack.length?(t|=Zt.PARENT,this.compress(this.buffer32,0,!0),this.chunksDone=0,this.pos=this.blockLen):t|=(this.chunkPos?0:Zt.CHUNK_START)|Zt.CHUNK_END,this.flags=t,this.b2CompressOut()}writeInto(t){if(this.destroyed)throw new Error("instance is destroyed");if(!(t instanceof Uint8Array))throw new Error("Blake3: Invalid output buffer");this.finish();let{blockLen:r,bufferOut:n}=this;for(let i=0,o=t.length;i<o;){this.posOut>=r&&this.b2CompressOut();let a=Math.min(this.blockLen-this.posOut,o-i);t.set(n.subarray(this.posOut,this.posOut+a),i),this.posOut+=a,i+=a}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF impossible after digest call");return this.writeInto(t)}xof(t){return(0,vn.assertNumber)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(t.length<this.outputLen)throw new Error("Blake3: Invalid output buffer");if(this.finished)throw new Error("digest() was already called");return this.enableXOF=!1,this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}};Er.blake3=(0,vn.wrapConstructorWithOpts)(e=>new zi(e))});var mn=D(ne=>{"use strict";P();O();var ed=ne&&ne.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),U1=ne&&ne.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Te=ne&&ne.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&ed(t,e,r)},va=ne&&ne.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&ed(t,e,r);return U1(t,e),t};Object.defineProperty(ne,"__esModule",{value:!0});ne.randomBytes=ne.concatBytes=ne.reverseBuffer=ne.md5=ne.rlp=void 0;Te(tc(),ne);Te(_c(),ne);Te(Sc(),ne);Te(Ec(),ne);Te(Ac(),ne);Te(Ui(),ne);Te(Pc(),ne);Te(Oc(),ne);Te(qc(),ne);Te(fa(),ne);ne.rlp=va(Kc());Te(jc(),ne);ne.md5=va(Rc());Te(bn(),ne);Te($n(),ne);Te(Ci(),ne);Te(na(),ne);Te(gs(),ne);Te(ws(),ne);Te(oa(),ne);Te(ga(),ne);Te(Bs(),ne);Te(Xc(),ne);Te(Qc(),ne);var D1=va(It()),C1=fl();function z1(e){if(e.length<1)return e;let t=e.length-1,r=0;for(let n=0;n<e.length/2;n++)r=e[n],e[n]=e[t],e[t]=r,t--;return e}ne.reverseBuffer=z1;function F1(e,t){return D1.concatBytes(Uint8Array.from(e),Uint8Array.from(t))}ne.concatBytes=F1;function $1(e){return C1(e)}ne.randomBytes=$1});var Vt=D(td=>{"use strict";P();O();var cr=td,V1=mt(),W1=dl(),Is=ll();cr.assert=W1;cr.toArray=Is.toArray;cr.zero2=Is.zero2;cr.toHex=Is.toHex;cr.encode=Is.encode;function Z1(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<<t+1,o=e.clone(),a=0;a<n.length;a++){var f,u=o.andln(i-1);o.isOdd()?(u>(i>>1)-1?f=(i>>1)-u:f=u,o.isubn(f)):f=0,n[a]=f,o.iushrn(1)}return n}cr.getNAF=Z1;function G1(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n=0,i=0,o;e.cmpn(-n)>0||t.cmpn(-i)>0;){var a=e.andln(3)+n&3,f=t.andln(3)+i&3;a===3&&(a=-1),f===3&&(f=-1);var u;(a&1)===0?u=0:(o=e.andln(7)+n&7,(o===3||o===5)&&f===2?u=-a:u=a),r[0].push(u);var p;(f&1)===0?p=0:(o=t.andln(7)+i&7,(o===3||o===5)&&a===2?p=-f:p=f),r[1].push(p),2*n===u+1&&(n=1-n),2*i===p+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r}cr.getJSF=G1;function X1(e,t,r){var n="_"+t;e.prototype[t]=function(){return this[n]!==void 0?this[n]:this[n]=r.call(this)}}cr.cachedProperty=X1;function Y1(e){return typeof e=="string"?cr.toArray(e,"hex"):e}cr.parseBytes=Y1;function J1(e){return new V1(e,"hex","le")}cr.intFromLE=J1});var $i=D((p8,rd)=>{"use strict";P();O();var Fi=Vt(),wn=mt(),Ps=Fi.getNAF,Q1=Fi.getJSF,Os=Fi.assert;function Jr(e,t){this.type=e,this.p=new wn(t.p,16),this.red=t.prime?wn.red(t.prime):wn.mont(this.p),this.zero=new wn(0).toRed(this.red),this.one=new wn(1).toRed(this.red),this.two=new wn(2).toRed(this.red),this.n=t.n&&new wn(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}rd.exports=Jr;Jr.prototype.point=function(){throw new Error("Not implemented")};Jr.prototype.validate=function(){throw new Error("Not implemented")};Jr.prototype._fixedNafMul=function(t,r){Os(t.precomputed);var n=t._getDoubles(),i=Ps(r,1,this._bitLength),o=(1<<n.step+1)-(n.step%2===0?2:1);o/=3;var a=[],f,u;for(f=0;f<i.length;f+=n.step){u=0;for(var p=f+n.step-1;p>=f;p--)u=(u<<1)+i[p];a.push(u)}for(var y=this.jpoint(null,null,null),g=this.jpoint(null,null,null),x=o;x>0;x--){for(f=0;f<a.length;f++)u=a[f],u===x?g=g.mixedAdd(n.points[f]):u===-x&&(g=g.mixedAdd(n.points[f].neg()));y=y.add(g)}return y.toP()};Jr.prototype._wnafMul=function(t,r){var n=4,i=t._getNAFPoints(n);n=i.wnd;for(var o=i.points,a=Ps(r,n,this._bitLength),f=this.jpoint(null,null,null),u=a.length-1;u>=0;u--){for(var p=0;u>=0&&a[u]===0;u--)p++;if(u>=0&&p++,f=f.dblp(p),u<0)break;var y=a[u];Os(y!==0),t.type==="affine"?y>0?f=f.mixedAdd(o[y-1>>1]):f=f.mixedAdd(o[-y-1>>1].neg()):y>0?f=f.add(o[y-1>>1]):f=f.add(o[-y-1>>1].neg())}return t.type==="affine"?f.toP():f};Jr.prototype._wnafMulAdd=function(t,r,n,i,o){var a=this._wnafT1,f=this._wnafT2,u=this._wnafT3,p=0,y,g,x;for(y=0;y<i;y++){x=r[y];var w=x._getNAFPoints(t);a[y]=w.wnd,f[y]=w.points}for(y=i-1;y>=1;y-=2){var _=y-1,v=y;if(a[_]!==1||a[v]!==1){u[_]=Ps(n[_],a[_],this._bitLength),u[v]=Ps(n[v],a[v],this._bitLength),p=Math.max(u[_].length,p),p=Math.max(u[v].length,p);continue}var A=[r[_],null,null,r[v]];r[_].y.cmp(r[v].y)===0?(A[1]=r[_].add(r[v]),A[2]=r[_].toJ().mixedAdd(r[v].neg())):r[_].y.cmp(r[v].y.redNeg())===0?(A[1]=r[_].toJ().mixedAdd(r[v]),A[2]=r[_].add(r[v].neg())):(A[1]=r[_].toJ().mixedAdd(r[v]),A[2]=r[_].toJ().mixedAdd(r[v].neg()));var T=[-3,-1,-5,-7,0,7,5,1,3],N=Q1(n[_],n[v]);for(p=Math.max(N[0].length,p),u[_]=new Array(p),u[v]=new Array(p),g=0;g<p;g++){var q=N[0][g]|0,K=N[1][g]|0;u[_][g]=T[(q+1)*3+(K+1)],u[v][g]=0,f[_]=A}}var L=this.jpoint(null,null,null),k=this._wnafT4;for(y=p;y>=0;y--){for(var j=0;y>=0;){var H=!0;for(g=0;g<i;g++)k[g]=u[g][y]|0,k[g]!==0&&(H=!1);if(!H)break;j++,y--}if(y>=0&&j++,L=L.dblp(j),y<0)break;for(g=0;g<i;g++){var G=k[g];G!==0&&(G>0?x=f[g][G-1>>1]:G<0&&(x=f[g][-G-1>>1].neg()),x.type==="affine"?L=L.mixedAdd(x):L=L.add(x))}}for(y=0;y<i;y++)f[y]=null;return o?L:L.toP()};function Gt(e,t){this.curve=e,this.type=t,this.precomputed=null}Jr.BasePoint=Gt;Gt.prototype.eq=function(){throw new Error("Not implemented")};Gt.prototype.validate=function(){return this.curve.validate(this)};Jr.prototype.decodePoint=function(t,r){t=Fi.toArray(t,r);var n=this.p.byteLength();if((t[0]===4||t[0]===6||t[0]===7)&&t.length-1===2*n){t[0]===6?Os(t[t.length-1]%2===0):t[0]===7&&Os(t[t.length-1]%2===1);var i=this.point(t.slice(1,1+n),t.slice(1+n,1+2*n));return i}else if((t[0]===2||t[0]===3)&&t.length-1===n)return this.pointFromX(t.slice(1,1+n),t[0]===3);throw new Error("Unknown point format")};Gt.prototype.encodeCompressed=function(t){return this.encode(t,!0)};Gt.prototype._encode=function(t){var r=this.curve.p.byteLength(),n=this.getX().toArray("be",r);return t?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",r))};Gt.prototype.encode=function(t,r){return Fi.encode(this._encode(r),t)};Gt.prototype.precompute=function(t){if(this.precomputed)return this;var r={doubles:null,naf:null,beta:null};return r.naf=this._getNAFPoints(8),r.doubles=this._getDoubles(4,t),r.beta=this._getBeta(),this.precomputed=r,this};Gt.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var r=this.precomputed.doubles;return r?r.points.length>=Math.ceil((t.bitLength()+1)/r.step):!1};Gt.prototype._getDoubles=function(t,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,o=0;o<r;o+=t){for(var a=0;a<t;a++)i=i.dbl();n.push(i)}return{step:t,points:n}};Gt.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var r=[this],n=(1<<t)-1,i=n===1?null:this.dbl(),o=1;o<n;o++)r[o]=r[o-1].add(i);return{wnd:t,points:r}};Gt.prototype._getBeta=function(){return null};Gt.prototype.dblp=function(t){for(var r=this,n=0;n<t;n++)r=r.dbl();return r}});var id=D((v8,nd)=>{"use strict";P();O();var eb=Vt(),qe=mt(),ma=Ho(),ai=$i(),tb=eb.assert;function Xt(e){ai.call(this,"short",e),this.a=new qe(e.a,16).toRed(this.red),this.b=new qe(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}ma(Xt,ai);nd.exports=Xt;Xt.prototype._getEndomorphism=function(t){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var r,n;if(t.beta)r=new qe(t.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);r=i[0].cmp(i[1])<0?i[0]:i[1],r=r.toRed(this.red)}if(t.lambda)n=new qe(t.lambda,16);else{var o=this._getEndoRoots(this.n);this.g.mul(o[0]).x.cmp(this.g.x.redMul(r))===0?n=o[0]:(n=o[1],tb(this.g.mul(n).x.cmp(this.g.x.redMul(r))===0))}var a;return t.basis?a=t.basis.map(function(f){return{a:new qe(f.a,16),b:new qe(f.b,16)}}):a=this._getEndoBasis(n),{beta:r,lambda:n,basis:a}}};Xt.prototype._getEndoRoots=function(t){var r=t===this.p?this.red:qe.mont(t),n=new qe(2).toRed(r).redInvm(),i=n.redNeg(),o=new qe(3).toRed(r).redNeg().redSqrt().redMul(n),a=i.redAdd(o).fromRed(),f=i.redSub(o).fromRed();return[a,f]};Xt.prototype._getEndoBasis=function(t){for(var r=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=t,i=this.n.clone(),o=new qe(1),a=new qe(0),f=new qe(0),u=new qe(1),p,y,g,x,w,_,v,A=0,T,N;n.cmpn(0)!==0;){var q=i.div(n);T=i.sub(q.mul(n)),N=f.sub(q.mul(o));var K=u.sub(q.mul(a));if(!g&&T.cmp(r)<0)p=v.neg(),y=o,g=T.neg(),x=N;else if(g&&++A===2)break;v=T,i=n,n=T,f=o,o=N,u=a,a=K}w=T.neg(),_=N;var L=g.sqr().add(x.sqr()),k=w.sqr().add(_.sqr());return k.cmp(L)>=0&&(w=p,_=y),g.negative&&(g=g.neg(),x=x.neg()),w.negative&&(w=w.neg(),_=_.neg()),[{a:g,b:x},{a:w,b:_}]};Xt.prototype._endoSplit=function(t){var r=this.endo.basis,n=r[0],i=r[1],o=i.b.mul(t).divRound(this.n),a=n.b.neg().mul(t).divRound(this.n),f=o.mul(n.a),u=a.mul(i.a),p=o.mul(n.b),y=a.mul(i.b),g=t.sub(f).sub(u),x=p.add(y).neg();return{k1:g,k2:x}};Xt.prototype.pointFromX=function(t,r){t=new qe(t,16),t.red||(t=t.toRed(this.red));var n=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var o=i.fromRed().isOdd();return(r&&!o||!r&&o)&&(i=i.redNeg()),this.point(t,i)};Xt.prototype.validate=function(t){if(t.inf)return!0;var r=t.x,n=t.y,i=this.a.redMul(r),o=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(o).cmpn(0)===0};Xt.prototype._endoWnafMulAdd=function(t,r,n){for(var i=this._endoWnafT1,o=this._endoWnafT2,a=0;a<t.length;a++){var f=this._endoSplit(r[a]),u=t[a],p=u._getBeta();f.k1.negative&&(f.k1.ineg(),u=u.neg(!0)),f.k2.negative&&(f.k2.ineg(),p=p.neg(!0)),i[a*2]=u,i[a*2+1]=p,o[a*2]=f.k1,o[a*2+1]=f.k2}for(var y=this._wnafMulAdd(1,i,o,a*2,n),g=0;g<a*2;g++)i[g]=null,o[g]=null;return y};function _t(e,t,r,n){ai.BasePoint.call(this,e,"affine"),t===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new qe(t,16),this.y=new qe(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}ma(_t,ai.BasePoint);Xt.prototype.point=function(t,r,n){return new _t(this,t,r,n)};Xt.prototype.pointFromJSON=function(t,r){return _t.fromJSON(this,t,r)};_t.prototype._getBeta=function(){if(!!this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var r=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var n=this.curve,i=function(o){return n.point(o.x.redMul(n.endo.beta),o.y)};t.beta=r,r.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(i)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(i)}}}return r}};_t.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]};_t.fromJSON=function(t,r,n){typeof r=="string"&&(r=JSON.parse(r));var i=t.point(r[0],r[1],n);if(!r[2])return i;function o(f){return t.point(f[0],f[1],n)}var a=r[2];return i.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[i].concat(a.doubles.points.map(o))},naf:a.naf&&{wnd:a.naf.wnd,points:[i].concat(a.naf.points.map(o))}},i};_t.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"};_t.prototype.isInfinity=function(){return this.inf};_t.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(this.x.cmp(t.x)===0)return this.curve.point(null,null);var r=this.y.redSub(t.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(t.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(t.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};_t.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(t.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=t.redInvm(),o=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),a=o.redSqr().redISub(this.x.redAdd(this.x)),f=o.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,f)};_t.prototype.getX=function(){return this.x.fromRed()};_t.prototype.getY=function(){return this.y.fromRed()};_t.prototype.mul=function(t){return t=new qe(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)};_t.prototype.mulAdd=function(t,r,n){var i=[this,r],o=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,o):this.curve._wnafMulAdd(1,i,o,2)};_t.prototype.jmulAdd=function(t,r,n){var i=[this,r],o=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,o,!0):this.curve._wnafMulAdd(1,i,o,2,!0)};_t.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||this.x.cmp(t.x)===0&&this.y.cmp(t.y)===0)};_t.prototype.neg=function(t){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var n=this.precomputed,i=function(o){return o.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};_t.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var t=this.curve.jpoint(this.x,this.y,this.curve.one);return t};function Pt(e,t,r,n){ai.BasePoint.call(this,e,"jacobian"),t===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new qe(0)):(this.x=new qe(t,16),this.y=new qe(r,16),this.z=new qe(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}ma(Pt,ai.BasePoint);Xt.prototype.jpoint=function(t,r,n){return new Pt(this,t,r,n)};Pt.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),r=t.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(t);return this.curve.point(n,i)};Pt.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};Pt.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var r=t.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),o=t.x.redMul(n),a=this.y.redMul(r.redMul(t.z)),f=t.y.redMul(n.redMul(this.z)),u=i.redSub(o),p=a.redSub(f);if(u.cmpn(0)===0)return p.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var y=u.redSqr(),g=y.redMul(u),x=i.redMul(y),w=p.redSqr().redIAdd(g).redISub(x).redISub(x),_=p.redMul(x.redISub(w)).redISub(a.redMul(g)),v=this.z.redMul(t.z).redMul(u);return this.curve.jpoint(w,_,v)};Pt.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=t.x.redMul(r),o=this.y,a=t.y.redMul(r).redMul(this.z),f=n.redSub(i),u=o.redSub(a);if(f.cmpn(0)===0)return u.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var p=f.redSqr(),y=p.redMul(f),g=n.redMul(p),x=u.redSqr().redIAdd(y).redISub(g).redISub(g),w=u.redMul(g.redISub(x)).redISub(o.redMul(y)),_=this.z.redMul(f);return this.curve.jpoint(x,w,_)};Pt.prototype.dblp=function(t){if(t===0)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r<t;r++)n=n.dbl();return n}var i=this.curve.a,o=this.curve.tinv,a=this.x,f=this.y,u=this.z,p=u.redSqr().redSqr(),y=f.redAdd(f);for(r=0;r<t;r++){var g=a.redSqr(),x=y.redSqr(),w=x.redSqr(),_=g.redAdd(g).redIAdd(g).redIAdd(i.redMul(p)),v=a.redMul(x),A=_.redSqr().redISub(v.redAdd(v)),T=v.redISub(A),N=_.redMul(T);N=N.redIAdd(N).redISub(w);var q=y.redMul(u);r+1<t&&(p=p.redMul(w)),a=A,u=q,y=N}return this.curve.jpoint(a,y.redMul(o),u)};Pt.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};Pt.prototype._zeroDbl=function(){var t,r,n;if(this.zOne){var i=this.x.redSqr(),o=this.y.redSqr(),a=o.redSqr(),f=this.x.redAdd(o).redSqr().redISub(i).redISub(a);f=f.redIAdd(f);var u=i.redAdd(i).redIAdd(i),p=u.redSqr().redISub(f).redISub(f),y=a.redIAdd(a);y=y.redIAdd(y),y=y.redIAdd(y),t=p,r=u.redMul(f.redISub(p)).redISub(y),n=this.y.redAdd(this.y)}else{var g=this.x.redSqr(),x=this.y.redSqr(),w=x.redSqr(),_=this.x.redAdd(x).redSqr().redISub(g).redISub(w);_=_.redIAdd(_);var v=g.redAdd(g).redIAdd(g),A=v.redSqr(),T=w.redIAdd(w);T=T.redIAdd(T),T=T.redIAdd(T),t=A.redISub(_).redISub(_),r=v.redMul(_.redISub(t)).redISub(T),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(t,r,n)};Pt.prototype._threeDbl=function(){var t,r,n;if(this.zOne){var i=this.x.redSqr(),o=this.y.redSqr(),a=o.redSqr(),f=this.x.redAdd(o).redSqr().redISub(i).redISub(a);f=f.redIAdd(f);var u=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),p=u.redSqr().redISub(f).redISub(f);t=p;var y=a.redIAdd(a);y=y.redIAdd(y),y=y.redIAdd(y),r=u.redMul(f.redISub(p)).redISub(y),n=this.y.redAdd(this.y)}else{var g=this.z.redSqr(),x=this.y.redSqr(),w=this.x.redMul(x),_=this.x.redSub(g).redMul(this.x.redAdd(g));_=_.redAdd(_).redIAdd(_);var v=w.redIAdd(w);v=v.redIAdd(v);var A=v.redAdd(v);t=_.redSqr().redISub(A),n=this.y.redAdd(this.z).redSqr().redISub(x).redISub(g);var T=x.redSqr();T=T.redIAdd(T),T=T.redIAdd(T),T=T.redIAdd(T),r=_.redMul(v.redISub(t)).redISub(T)}return this.curve.jpoint(t,r,n)};Pt.prototype._dbl=function(){var t=this.curve.a,r=this.x,n=this.y,i=this.z,o=i.redSqr().redSqr(),a=r.redSqr(),f=n.redSqr(),u=a.redAdd(a).redIAdd(a).redIAdd(t.redMul(o)),p=r.redAdd(r);p=p.redIAdd(p);var y=p.redMul(f),g=u.redSqr().redISub(y.redAdd(y)),x=y.redISub(g),w=f.redSqr();w=w.redIAdd(w),w=w.redIAdd(w),w=w.redIAdd(w);var _=u.redMul(x).redISub(w),v=n.redAdd(n).redMul(i);return this.curve.jpoint(g,_,v)};Pt.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr(),i=r.redSqr(),o=t.redAdd(t).redIAdd(t),a=o.redSqr(),f=this.x.redAdd(r).redSqr().redISub(t).redISub(i);f=f.redIAdd(f),f=f.redAdd(f).redIAdd(f),f=f.redISub(a);var u=f.redSqr(),p=i.redIAdd(i);p=p.redIAdd(p),p=p.redIAdd(p),p=p.redIAdd(p);var y=o.redIAdd(f).redSqr().redISub(a).redISub(u).redISub(p),g=r.redMul(y);g=g.redIAdd(g),g=g.redIAdd(g);var x=this.x.redMul(u).redISub(g);x=x.redIAdd(x),x=x.redIAdd(x);var w=this.y.redMul(y.redMul(p.redISub(y)).redISub(f.redMul(u)));w=w.redIAdd(w),w=w.redIAdd(w),w=w.redIAdd(w);var _=this.z.redAdd(f).redSqr().redISub(n).redISub(u);return this.curve.jpoint(x,w,_)};Pt.prototype.mul=function(t,r){return t=new qe(t,r),this.curve._wnafMul(this,t)};Pt.prototype.eq=function(t){if(t.type==="affine")return this.eq(t.toJ());if(this===t)return!0;var r=this.z.redSqr(),n=t.z.redSqr();if(this.x.redMul(n).redISub(t.x.redMul(r)).cmpn(0)!==0)return!1;var i=r.redMul(this.z),o=n.redMul(t.z);return this.y.redMul(o).redISub(t.y.redMul(i)).cmpn(0)===0};Pt.prototype.eqXToP=function(t){var r=this.z.redSqr(),n=t.toRed(this.curve.red).redMul(r);if(this.x.cmp(n)===0)return!0;for(var i=t.clone(),o=this.curve.redN.redMul(r);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(o),this.x.cmp(n)===0)return!0}};Pt.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"};Pt.prototype.isInfinity=function(){return this.z.cmpn(0)===0}});var ad=D((x8,od)=>{"use strict";P();O();var fi=mt(),sd=Ho(),Ts=$i(),rb=Vt();function ci(e){Ts.call(this,"mont",e),this.a=new fi(e.a,16).toRed(this.red),this.b=new fi(e.b,16).toRed(this.red),this.i4=new fi(4).toRed(this.red).redInvm(),this.two=new fi(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}sd(ci,Ts);od.exports=ci;ci.prototype.validate=function(t){var r=t.normalize().x,n=r.redSqr(),i=n.redMul(r).redAdd(n.redMul(this.a)).redAdd(r),o=i.redSqrt();return o.redSqr().cmp(i)===0};function St(e,t,r){Ts.BasePoint.call(this,e,"projective"),t===null&&r===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new fi(t,16),this.z=new fi(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}sd(St,Ts.BasePoint);ci.prototype.decodePoint=function(t,r){return this.point(rb.toArray(t,r),1)};ci.prototype.point=function(t,r){return new St(this,t,r)};ci.prototype.pointFromJSON=function(t){return St.fromJSON(this,t)};St.prototype.precompute=function(){};St.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};St.fromJSON=function(t,r){return new St(t,r[0],r[1]||t.one)};St.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"};St.prototype.isInfinity=function(){return this.z.cmpn(0)===0};St.prototype.dbl=function(){var t=this.x.redAdd(this.z),r=t.redSqr(),n=this.x.redSub(this.z),i=n.redSqr(),o=r.redSub(i),a=r.redMul(i),f=o.redMul(i.redAdd(this.curve.a24.redMul(o)));return this.curve.point(a,f)};St.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};St.prototype.diffAdd=function(t,r){var n=this.x.redAdd(this.z),i=this.x.redSub(this.z),o=t.x.redAdd(t.z),a=t.x.redSub(t.z),f=a.redMul(n),u=o.redMul(i),p=r.z.redMul(f.redAdd(u).redSqr()),y=r.x.redMul(f.redISub(u).redSqr());return this.curve.point(p,y)};St.prototype.mul=function(t){for(var r=t.clone(),n=this,i=this.curve.point(null,null),o=this,a=[];r.cmpn(0)!==0;r.iushrn(1))a.push(r.andln(1));for(var f=a.length-1;f>=0;f--)a[f]===0?(n=n.diffAdd(i,o),i=i.dbl()):(i=n.diffAdd(i,o),n=n.dbl());return i};St.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};St.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};St.prototype.eq=function(t){return this.getX().cmp(t.getX())===0};St.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};St.prototype.getX=function(){return this.normalize(),this.x.fromRed()}});var dd=D((E8,cd)=>{"use strict";P();O();var nb=Vt(),kr=mt(),fd=Ho(),qs=$i(),ib=nb.assert;function Mr(e){this.twisted=(e.a|0)!==1,this.mOneA=this.twisted&&(e.a|0)===-1,this.extended=this.mOneA,qs.call(this,"edwards",e),this.a=new kr(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new kr(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new kr(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),ib(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(e.c|0)===1}fd(Mr,qs);cd.exports=Mr;Mr.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)};Mr.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)};Mr.prototype.jpoint=function(t,r,n,i){return this.point(t,r,n,i)};Mr.prototype.pointFromX=function(t,r){t=new kr(t,16),t.red||(t=t.toRed(this.red));var n=t.redSqr(),i=this.c2.redSub(this.a.redMul(n)),o=this.one.redSub(this.c2.redMul(this.d).redMul(n)),a=i.redMul(o.redInvm()),f=a.redSqrt();if(f.redSqr().redSub(a).cmp(this.zero)!==0)throw new Error("invalid point");var u=f.fromRed().isOdd();return(r&&!u||!r&&u)&&(f=f.redNeg()),this.point(t,f)};Mr.prototype.pointFromY=function(t,r){t=new kr(t,16),t.red||(t=t.toRed(this.red));var n=t.redSqr(),i=n.redSub(this.c2),o=n.redMul(this.d).redMul(this.c2).redSub(this.a),a=i.redMul(o.redInvm());if(a.cmp(this.zero)===0){if(r)throw new Error("invalid point");return this.point(this.zero,t)}var f=a.redSqrt();if(f.redSqr().redSub(a).cmp(this.zero)!==0)throw new Error("invalid point");return f.fromRed().isOdd()!==r&&(f=f.redNeg()),this.point(f,t)};Mr.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var r=t.x.redSqr(),n=t.y.redSqr(),i=r.redMul(this.a).redAdd(n),o=this.c2.redMul(this.one.redAdd(this.d.redMul(r).redMul(n)));return i.cmp(o)===0};function me(e,t,r,n,i){qs.BasePoint.call(this,e,"projective"),t===null&&r===null&&n===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new kr(t,16),this.y=new kr(r,16),this.z=n?new kr(n,16):this.curve.one,this.t=i&&new kr(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}fd(me,qs.BasePoint);Mr.prototype.pointFromJSON=function(t){return me.fromJSON(this,t)};Mr.prototype.point=function(t,r,n,i){return new me(this,t,r,n,i)};me.fromJSON=function(t,r){return new me(t,r[0],r[1],r[2])};me.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"};me.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};me.prototype._extDbl=function(){var t=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var i=this.curve._mulA(t),o=this.x.redAdd(this.y).redSqr().redISub(t).redISub(r),a=i.redAdd(r),f=a.redSub(n),u=i.redSub(r),p=o.redMul(f),y=a.redMul(u),g=o.redMul(u),x=f.redMul(a);return this.curve.point(p,y,x,g)};me.prototype._projDbl=function(){var t=this.x.redAdd(this.y).redSqr(),r=this.x.redSqr(),n=this.y.redSqr(),i,o,a,f,u,p;if(this.curve.twisted){f=this.curve._mulA(r);var y=f.redAdd(n);this.zOne?(i=t.redSub(r).redSub(n).redMul(y.redSub(this.curve.two)),o=y.redMul(f.redSub(n)),a=y.redSqr().redSub(y).redSub(y)):(u=this.z.redSqr(),p=y.redSub(u).redISub(u),i=t.redSub(r).redISub(n).redMul(p),o=y.redMul(f.redSub(n)),a=y.redMul(p))}else f=r.redAdd(n),u=this.curve._mulC(this.z).redSqr(),p=f.redSub(u).redSub(u),i=this.curve._mulC(t.redISub(f)).redMul(p),o=this.curve._mulC(f).redMul(r.redISub(n)),a=f.redMul(p);return this.curve.point(i,o,a)};me.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};me.prototype._extAdd=function(t){var r=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),n=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),i=this.t.redMul(this.curve.dd).redMul(t.t),o=this.z.redMul(t.z.redAdd(t.z)),a=n.redSub(r),f=o.redSub(i),u=o.redAdd(i),p=n.redAdd(r),y=a.redMul(f),g=u.redMul(p),x=a.redMul(p),w=f.redMul(u);return this.curve.point(y,g,w,x)};me.prototype._projAdd=function(t){var r=this.z.redMul(t.z),n=r.redSqr(),i=this.x.redMul(t.x),o=this.y.redMul(t.y),a=this.curve.d.redMul(i).redMul(o),f=n.redSub(a),u=n.redAdd(a),p=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(i).redISub(o),y=r.redMul(f).redMul(p),g,x;return this.curve.twisted?(g=r.redMul(u).redMul(o.redSub(this.curve._mulA(i))),x=f.redMul(u)):(g=r.redMul(u).redMul(o.redSub(i)),x=this.curve._mulC(f).redMul(u)),this.curve.point(y,g,x)};me.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)};me.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)};me.prototype.mulAdd=function(t,r,n){return this.curve._wnafMulAdd(1,[this,r],[t,n],2,!1)};me.prototype.jmulAdd=function(t,r,n){return this.curve._wnafMulAdd(1,[this,r],[t,n],2,!0)};me.prototype.normalize=function(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this};me.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};me.prototype.getX=function(){return this.normalize(),this.x.fromRed()};me.prototype.getY=function(){return this.normalize(),this.y.fromRed()};me.prototype.eq=function(t){return this===t||this.getX().cmp(t.getX())===0&&this.getY().cmp(t.getY())===0};me.prototype.eqXToP=function(t){var r=t.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(r)===0)return!0;for(var n=t.clone(),i=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),this.x.cmp(r)===0)return!0}};me.prototype.toP=me.prototype.normalize;me.prototype.mixedAdd=me.prototype.add});var wa=D(ud=>{"use strict";P();O();var ks=ud;ks.base=$i();ks.short=id();ks.mont=ad();ks.edwards=dd()});var hd=D((O8,ld)=>{"use strict";P();O();ld.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}});var Ns=D(gd=>{"use strict";P();O();var _a=gd,Qr=Cf(),xa=wa(),sb=Vt(),bd=sb.assert;function pd(e){e.type==="short"?this.curve=new xa.short(e):e.type==="edwards"?this.curve=new xa.edwards(e):this.curve=new xa.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,bd(this.g.validate(),"Invalid curve"),bd(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}_a.PresetCurve=pd;function en(e,t){Object.defineProperty(_a,e,{configurable:!0,enumerable:!0,get:function(){var r=new pd(t);return Object.defineProperty(_a,e,{configurable:!0,enumerable:!0,value:r}),r}})}en("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Qr.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]});en("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Qr.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]});en("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Qr.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]});en("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Qr.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]});en("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Qr.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]});en("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Qr.sha256,gRed:!1,g:["9"]});en("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Qr.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var Sa;try{Sa=hd()}catch{Sa=void 0}en("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Qr.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",Sa]})});var vd=D((H8,yd)=>{"use strict";P();O();var ob=mt(),ab=Vt(),Ea=ab.assert;function kt(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}yd.exports=kt;kt.fromPublic=function(t,r,n){return r instanceof kt?r:new kt(t,{pub:r,pubEnc:n})};kt.fromPrivate=function(t,r,n){return r instanceof kt?r:new kt(t,{priv:r,privEnc:n})};kt.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}};kt.prototype.getPublic=function(t,r){return typeof t=="string"&&(r=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),r?this.pub.encode(r,t):this.pub};kt.prototype.getPrivate=function(t){return t==="hex"?this.priv.toString(16,2):this.priv};kt.prototype._importPrivate=function(t,r){this.priv=new ob(t,r||16),this.priv=this.priv.umod(this.ec.curve.n)};kt.prototype._importPublic=function(t,r){if(t.x||t.y){this.ec.curve.type==="mont"?Ea(t.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&Ea(t.x&&t.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(t.x,t.y);return}this.pub=this.ec.curve.decodePoint(t,r)};kt.prototype.derive=function(t){return t.validate()||Ea(t.validate(),"public point not validated"),t.mul(this.priv).getX()};kt.prototype.sign=function(t,r,n){return this.ec.sign(t,this,r,n)};kt.prototype.verify=function(t,r){return this.ec.verify(t,r,this)};kt.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}});var xd=D((R8,wd)=>{"use strict";P();O();var Ls=mt(),Ba=Vt(),fb=Ba.assert;function Vi(e,t,r){if(t instanceof Vi)return t;this._importDER(t,r)||(fb(t.r&&t.s,"Signature without r or s"),this.r=new Ls(t.r,16),this.s=new Ls(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam,this.curve=e,this.byteLength=this.curve.n.byteLength())}wd.exports=Vi;function cb(){this.place=0}function Ma(e,t){var r=e[t.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,o=0,a=t.place;o<n;o++,a++)i<<=8,i|=e[a],i>>>=0;return i<=127?!1:(t.place=a,i)}function md(e){for(var t=0,r=e.length-1;!e[t]&&!(e[t+1]&128)&&t<r;)t++;return t===0?e:e.slice(t)}Vi.prototype._importDER=function(t,r){t=Ba.toArray(t,r);var n=new cb;if(t[n.place++]!==48)return!1;var i=Ma(t,n);if(i===!1||i+n.place!==t.length||t[n.place++]!==2)return!1;var o=Ma(t,n);if(o===!1)return!1;var a=t.slice(n.place,o+n.place);if(n.place+=o,t[n.place++]!==2)return!1;var f=Ma(t,n);if(f===!1||t.length!==f+n.place)return!1;var u=t.slice(n.place,f+n.place);if(a[0]===0)if(a[1]&128)a=a.slice(1);else return!1;if(u[0]===0)if(u[1]&128)u=u.slice(1);else return!1;return this.r=new Ls(a),this.s=new Ls(u),this.recoveryParam=null,!0};function Aa(e,t){if(t<128){e.push(t);return}var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(r|128);--r;)e.push(t>>>(r<<3)&255);e.push(t)}Vi.prototype.toDER=function(t){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=md(r),n=md(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];Aa(i,r.length),i=i.concat(r),i.push(2),Aa(i,n.length);var o=i.concat(n),a=[48];return Aa(a,o.length),a=a.concat(o),Ba.encode(a,t)};Vi.prototype.toBytes=function(){let t=this.r.toArray("be",this.byteLength),r=this.s.toArray("be",this.byteLength);return t.concat(r)}});var Md=D((C8,Ed)=>{"use strict";P();O();var xn=mt(),_d=hl(),db=Vt(),Ia=Ns(),ub=ul(),Sd=db.assert,Pa=vd(),Hs=xd();function Yt(e){if(!(this instanceof Yt))return new Yt(e);typeof e=="string"&&(Sd(Object.prototype.hasOwnProperty.call(Ia,e),"Unknown curve "+e),e=Ia[e]),e instanceof Ia.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}Ed.exports=Yt;Yt.prototype.keyPair=function(t){return new Pa(this,t)};Yt.prototype.keyFromPrivate=function(t,r){return Pa.fromPrivate(this,t,r)};Yt.prototype.keyFromPublic=function(t,r){return Pa.fromPublic(this,t,r)};Yt.prototype.genKeyPair=function(t){t||(t={});for(var r=new _d({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||ub(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new xn(2));;){var o=new xn(r.generate(n));if(!(o.cmp(i)>0))return o.iaddn(1),this.keyFromPrivate(o)}};Yt.prototype._truncateToN=function(t,r){var n=t.byteLength()*8-this.n.bitLength();return n>0&&(t=t.ushrn(n)),!r&&t.cmp(this.n)>=0?t.sub(this.n):t};Yt.prototype.sign=function(t,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),t=this._truncateToN(new xn(t,16));for(var o=this.n.byteLength(),a=r.getPrivate().toArray("be",o),f=t.toArray("be",o),u=new _d({hash:this.hash,entropy:a,nonce:f,pers:i.pers,persEnc:i.persEnc||"utf8"}),p=this.n.sub(new xn(1)),y=0;;y++){var g=i.k?i.k(y):new xn(u.generate(this.n.byteLength()));if(g=this._truncateToN(g,!0),!(g.cmpn(1)<=0||g.cmp(p)>=0)){var x=this.g.mul(g);if(!x.isInfinity()){var w=x.getX(),_=w.umod(this.n);if(_.cmpn(0)!==0){var v=g.invm(this.n).mul(_.mul(r.getPrivate()).iadd(t));if(v=v.umod(this.n),v.cmpn(0)!==0){var A=(x.getY().isOdd()?1:0)|(w.cmp(_)!==0?2:0);return i.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),A^=1),new Hs(this.curve,{r:_,s:v,recoveryParam:A})}}}}}};Yt.prototype.verify=function(t,r,n,i){t=this._truncateToN(new xn(t,16)),n=this.keyFromPublic(n,i),r=new Hs(this.curve,r,"hex");var o=r.r,a=r.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0||a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var f=a.invm(this.n),u=f.mul(t).umod(this.n),p=f.mul(o).umod(this.n),y;return this.curve._maxwellTrick?(y=this.g.jmulAdd(u,n.getPublic(),p),y.isInfinity()?!1:y.eqXToP(o)):(y=this.g.mulAdd(u,n.getPublic(),p),y.isInfinity()?!1:y.getX().umod(this.n).cmp(o)===0)};Yt.prototype.recoverPubKey=function(e,t,r,n){Sd((3&r)===r,"The recovery param is more than two bits"),t=new Hs(this.curve,t,n);var i=this.n,o=new xn(e),a=t.r,f=t.s,u=r&1,p=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&p)throw new Error("Unable to find sencond key candinate");p?a=this.curve.pointFromX(a.add(this.curve.n),u):a=this.curve.pointFromX(a,u);var y=t.r.invm(i),g=i.sub(o).mul(y).umod(i),x=f.mul(y).umod(i);return this.g.mulAdd(g,a,x)};Yt.prototype.getKeyRecoveryParam=function(e,t,r,n){if(t=new Hs(this.curve,t,n),t.recoveryParam!==null)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch{continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}});var Pd=D(($8,Id)=>{"use strict";P();O();var Wi=Vt(),Bd=Wi.assert,Ad=Wi.parseBytes,di=Wi.cachedProperty;function Et(e,t){this.eddsa=e,this._secret=Ad(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=Ad(t.pub)}Et.fromPublic=function(t,r){return r instanceof Et?r:new Et(t,{pub:r})};Et.fromSecret=function(t,r){return r instanceof Et?r:new Et(t,{secret:r})};Et.prototype.secret=function(){return this._secret};di(Et,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});di(Et,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});di(Et,"privBytes",function(){var t=this.eddsa,r=this.hash(),n=t.encodingLength-1,i=r.slice(0,t.encodingLength);return i[0]&=248,i[n]&=127,i[n]|=64,i});di(Et,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});di(Et,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});di(Et,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});Et.prototype.sign=function(t){return Bd(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)};Et.prototype.verify=function(t,r){return this.eddsa.verify(t,r,this)};Et.prototype.getSecret=function(t){return Bd(this._secret,"KeyPair is public only"),Wi.encode(this.secret(),t)};Et.prototype.getPublic=function(t){return Wi.encode(this.pubBytes(),t)};Id.exports=Et});var Td=D((Z8,Od)=>{"use strict";P();O();var lb=mt(),Ks=Vt(),hb=Ks.assert,js=Ks.cachedProperty,bb=Ks.parseBytes;function _n(e,t){this.eddsa=e,typeof t!="object"&&(t=bb(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),hb(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof lb&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}js(_n,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});js(_n,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});js(_n,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});js(_n,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});_n.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};_n.prototype.toHex=function(){return Ks.encode(this.toBytes(),"hex").toUpperCase()};Od.exports=_n});var Hd=D((Y8,Ld)=>{"use strict";P();O();var pb=Cf(),gb=Ns(),ui=Vt(),yb=ui.assert,kd=ui.parseBytes,Nd=Pd(),qd=Td();function Ct(e){if(yb(e==="ed25519","only tested with ed25519 so far"),!(this instanceof Ct))return new Ct(e);e=gb[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=pb.sha512}Ld.exports=Ct;Ct.prototype.sign=function(t,r){t=kd(t);var n=this.keyFromSecret(r),i=this.hashInt(n.messagePrefix(),t),o=this.g.mul(i),a=this.encodePoint(o),f=this.hashInt(a,n.pubBytes(),t).mul(n.priv()),u=i.add(f).umod(this.curve.n);return this.makeSignature({R:o,S:u,Rencoded:a})};Ct.prototype.verify=function(t,r,n){t=kd(t),r=this.makeSignature(r);var i=this.keyFromPublic(n),o=this.hashInt(r.Rencoded(),i.pubBytes(),t),a=this.g.mul(r.S()),f=r.R().add(i.pub().mul(o));return f.eq(a)};Ct.prototype.hashInt=function(){for(var t=this.hash(),r=0;r<arguments.length;r++)t.update(arguments[r]);return ui.intFromLE(t.digest()).umod(this.curve.n)};Ct.prototype.keyFromPublic=function(t){return Nd.fromPublic(this,t)};Ct.prototype.keyFromSecret=function(t){return Nd.fromSecret(this,t)};Ct.prototype.makeSignature=function(t){return t instanceof qd?t:new qd(this,t)};Ct.prototype.encodePoint=function(t){var r=t.getY().toArray("le",this.encodingLength);return r[this.encodingLength-1]|=t.getX().isOdd()?128:0,r};Ct.prototype.decodePoint=function(t){t=ui.parseBytes(t);var r=t.length-1,n=t.slice(0,r).concat(t[r]&-129),i=(t[r]&128)!==0,o=ui.intFromLE(n);return this.curve.pointFromY(o,i)};Ct.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)};Ct.prototype.decodeInt=function(t){return ui.intFromLE(t)};Ct.prototype.isPoint=function(t){return t instanceof this.pointClass}});var li=D(Jt=>{"use strict";P();O();Object.defineProperty(Jt,"__esModule",{value:!0});Jt.utils=Jt.curves=Jt.curve=Jt.eddsa=Jt.ec=void 0;var vb=wa();Jt.curve=vb;var mb=Ns();Jt.curves=mb;var wb=Md();Jt.ec=wb;var xb=Hd();Jt.eddsa=xb;var _b=Vt();Jt.utils=_b});var Rd=D((Kd,jd)=>{"use strict";P();O();Object.defineProperty(Kd,"__esModule",{value:!0});var Sb=li(),Ar=new Sb.ec("secp256k1"),fe=Ar.curve,we=mt();function Eb(e,t){let r=new we(t);if(r.cmp(fe.p)>=0)return null;r=r.toRed(fe.red);let n=r.redSqr().redIMul(r).redIAdd(fe.b).redSqrt();e===3!==n.isOdd()&&(n=n.redNeg());let i=r.redSqr().redIMul(r);return n.redSqr().redISub(i.redIAdd(fe.b)).isZero()?Ar.keyPair({pub:{x:r,y:n}}):null}function Mb(e,t,r){let n=new we(t),i=new we(r);if(n.cmp(fe.p)>=0||i.cmp(fe.p)>=0||(n=n.toRed(fe.red),i=i.toRed(fe.red),(e===6||e===7)&&i.isOdd()!==(e===7)))return null;let o=n.redSqr().redIMul(n);return i.redSqr().redISub(o.redIAdd(fe.b)).isZero()?Ar.keyPair({pub:{x:n,y:i}}):null}function tn(e){let t=e[0];switch(t){case 2:case 3:return e.length!==33?null:Eb(t,e.subarray(1,33));case 4:case 6:case 7:return e.length!==65?null:Mb(t,e.subarray(1,33),e.subarray(33,65));default:return null}}jd.exports={contextRandomize(){return 0},privateKeyVerify(e){let t=new we(e);return t.cmp(fe.n)<0&&!t.isZero()},privateKeyNegate(e){let t=new we(e);return I.Buffer.from(fe.n.sub(t).umod(fe.n).toArray("be",32))},privateKeyTweakAdd(e,t){let r=new we(t);return r.cmp(fe.n)>=0||(r.iadd(new we(e)),r.cmp(fe.n)>=0&&r.isub(fe.n),r.isZero())?null:I.Buffer.from(r.toArray("be",32))},privateKeyTweakMul(e,t){let r=new we(t);return r.cmp(fe.n)>=0||r.isZero()?1:(r.imul(new we(e)),r.cmp(fe.n)>=0&&(r=r.umod(fe.n)),I.Buffer.from(r.toArray("be",32)))},publicKeyVerify(e){let t=tn(e);return t==null?null:t.validate().result},publicKeyCreate(e,t){let r=new we(e);if(r.cmp(fe.n)>=0||r.isZero())return null;let n=Ar.keyFromPrivate(e,null).getPublic();return I.Buffer.from(n.encode(null,t))},publicKeyConvert(e,t){let n=tn(e).getPublic();return I.Buffer.from(n.encode(null,t))},publicKeyNegate(e,t){let r=tn(e);if(r===null)return 1;let n=r.getPublic();return n.y=n.y.redNeg(),I.Buffer.from(n.encode(null,t))},publicKeyCombine(e,t){let r=new Array(e.length);for(let i=0;i<e.length;++i)if(r[i]=tn(e[i]),r[i]===null)return null;let n=r[0].getPublic();for(let i=1;i<r.length;++i)n=n.add(r[i].pub);return n.isInfinity()?null:I.Buffer.from(n.encode(null,t))},publicKeyTweakAdd(e,t,r){let n=tn(e);if(n===null||new we(t).cmp(fe.n)>=0)return null;let o=n.getPublic().add(fe.g.mul(t));return o.isInfinity()?null:I.Buffer.from(o.encode(null,r))},publicKeyTweakMul(e,t,r){let n=tn(e);if(n===null)return null;let i=new we(t);if(i.cmp(fe.n)>=0||i.isZero())return null;let o=n.getPublic().mul(t);return I.Buffer.from(o.encode(null,r))},signatureNormalize(e){let t=new we(e.subarray(0,32)),r=new we(e.subarray(32,64));return t.cmp(fe.n)>=0||r.cmp(fe.n)>=0?null:(r.cmp(Ar.nh)===1&&e.set(fe.n.sub(r).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(e,t){let r=t.subarray(0,32),n=t.subarray(32,64);if(new we(r).cmp(fe.n)>=0||new we(n).cmp(fe.n)>=0)return 1;let{output:i}=e,o=i.subarray(4,4+33);o[0]=0,o.set(r,1);let a=33,f=0;for(;a>1&&o[f]===0&&!(o[f+1]&128);--a,++f);if(o=o.subarray(f),o[0]&128||a>1&&o[0]===0&&!(o[1]&128))return 1;let u=i.subarray(6+33,6+33+33);u[0]=0,u.set(n,1);let p=33,y=0;for(;p>1&&u[y]===0&&!(u[y+1]&128);--p,++y);return u=u.subarray(y),u[0]&128||p>1&&u[0]===0&&!(u[1]&128)?1:(e.outputlen=6+a+p,i[0]=48,i[1]=e.outputlen-2,i[2]=2,i[3]=o.length,i.set(o,4),i[4+a]=2,i[5+a]=u.length,i.set(u,6+a),0)},signatureImport(e,t){if(t.length<8||t.length>72||t[0]!==48||t[1]!==t.length-2||t[2]!==2)return 1;let r=t[3];if(r===0||5+r>=t.length||t[4+r]!==2)return 1;let n=t[5+r];if(n===0||6+r+n!==t.length||t[4]&128||r>1&&t[4]===0&&!(t[5]&128)||t[r+6]&128||n>1&&t[r+6]===0&&!(t[r+7]&128))return 1;let i=t.subarray(4,4+r);if(i.length===33&&i[0]===0&&(i=i.subarray(1)),i.length>32)return 1;let o=t.subarray(6+r);if(o.length===33&&o[0]===0&&(o=o.slice(1)),o.length>32)throw new Error("S length is too long");let a=new we(i);a.cmp(fe.n)>=0&&(a=new we(0));let f=new we(t.subarray(6+r));return f.cmp(fe.n)>=0&&(f=new we(0)),e.set(a.toArrayLike(Uint8Array,"be",32),0),e.set(f.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(e,t){let r=new we(t);return r.cmp(fe.n)>=0||r.isZero()?null:Ar.sign(e,t,{canonical:!0}).toBytes()},ecdsaVerify(e,t,r){let n={r:e.subarray(0,32),s:e.subarray(32,64)},i=new we(n.r),o=new we(n.s);if(i.cmp(fe.n)>=0||o.cmp(fe.n)>=0)return 1;if(o.cmp(Ar.nh)===1||i.isZero()||o.isZero())return 3;let a=tn(r);if(a===null)return 2;let f=a.getPublic();return Ar.verify(t,n,f)},ecdsaRecover(e,t,r,n){let i={r:e.slice(0,32),s:e.slice(32,64)},o=new we(i.r),a=new we(i.s);if(o.cmp(fe.n)>=0||a.cmp(fe.n)>=0)return 1;if(o.isZero()||a.isZero())return 2;let f;try{f=Ar.recoverPubKey(r,i,t,null)}catch{return 2}return I.Buffer.from(f.encode(null,n))},ecdh(e,t,r,n,i,o,a){let f=tn(t);if(f===null)return 1;let u=new we(r);if(u.cmp(fe.n)>=0||u.isZero())return 2;let p=f.getPublic().mul(u);if(i===void 0){let y=p.encode(null,!0),g=Ar.hash().update(y).digest();for(let x=0;x<32;++x)e[x]=g[x]}else{o||(o=new Uint8Array(32));let y=p.getX().toArray("be",32);for(let _=0;_<32;++_)o[_]=y[_];a||(a=new Uint8Array(32));let g=p.getY().toArray("be",32);for(let _=0;_<32;++_)a[_]=g[_];let x=i(o,a,n);if(!(x instanceof Uint8Array&&x.length===e.length))return 2;e.set(x)}return 0}}});var Fd=D(Mt=>{"use strict";P();O();var Ab=Mt&&Mt.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Bb=Mt&&Mt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Ib=Mt&&Mt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Ab(t,e,r);return Bb(t,e),t};Object.defineProperty(Mt,"__esModule",{value:!0});Mt.fromSeed=Mt.fromPublicKey=Mt.fromPrivateKey=Mt.fromBase58=Mt.tinySecp256k1Interface=void 0;var Oa=Ib(mn()),Pb=bn(),Ob=Ui(),Dd=(0,Pb.base58check)(Ob.sha256),Cd=Rd(),Ot=zf(),Tb=pl();function qb(e){return{isPoint:t=>e.publicKeyVerify(t),isPrivate:t=>e.privateKeyVerify(t),pointAddScalar:(t,r,n)=>e.publicKeyTweakAdd(t,r,n),pointFromScalar:(t,r)=>e.publicKeyCreate(t,r),privateAdd:(t,r)=>e.privateKeyTweakAdd(new Uint8Array(t),r),sign:(t,r)=>e.ecdsaSign(t,r),verify:(t,r,n)=>e.ecdsaVerify(n,t,r)}}function kb(e){return{isPoint:t=>e.publicKeyVerify(t),pointCompress:(t,r)=>Uint8Array.from(e.publicKeyConvert(t,r??!0)),isPrivate:t=>e.privateKeyVerify(t),pointFromScalar:(t,r)=>{let n=e.publicKeyCreate(t,r??!0);return n==null?null:Uint8Array.from(n)},sign:(t,r,n)=>Uint8Array.from(e.ecdsaSign(t,r)),verify:(t,r,n,i)=>e.ecdsaVerify(n,t,r)}}var rn=qb(Cd);Mt.tinySecp256k1Interface=kb(Cd);var Ta=Ot.BufferN(32),Nb=Ot.compile({wif:Ot.UInt8,bip32:{public:Ot.UInt32,private:Ot.UInt32}}),Ds={messagePrefix:`Bitcoin Signed Message:
|
||
`,bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},Ud=2147483648,Lb=Math.pow(2,31)-1;function Hb(e){return Ot.String(e)&&e.match(/^(m\/)?(\d+'?\/)*\d+'?$/)!==null}function Kb(e){return Ot.UInt32(e)&&e<=Lb}var Rs=class{constructor(t,r,n,i,o=0,a=0,f=0){this.__D=t,this.__Q=r,this.chainCode=n,this.network=i,this.__DEPTH=o,this.__INDEX=a,this.__PARENT_FINGERPRINT=f,Ot(Nb,i),this.lowR=!1}get depth(){return this.__DEPTH}get index(){return this.__INDEX}get parentFingerprint(){return this.__PARENT_FINGERPRINT}get publicKey(){return this.__Q===void 0&&(this.__Q=I.Buffer.from(rn.pointFromScalar(this.__D,!0))),this.__Q}get privateKey(){return this.__D}get identifier(){return I.Buffer.from(Oa.hash160(this.publicKey))}get fingerprint(){return this.identifier.slice(0,4)}get compressed(){return!0}isNeutered(){return this.__D===void 0}neutered(){return Us(this.publicKey,this.chainCode,this.network,this.depth,this.index,this.parentFingerprint)}toBase58(){let t=this.network,r=this.isNeutered()?t.bip32.public:t.bip32.private,n=I.Buffer.allocUnsafe(78);return n.writeUInt32BE(r,0),n.writeUInt8(this.depth,4),n.writeUInt32BE(this.parentFingerprint,5),n.writeUInt32BE(this.index,9),this.chainCode.copy(n,13),this.isNeutered()?this.publicKey.copy(n,45):(n.writeUInt8(0,45),this.privateKey.copy(n,46)),Dd.encode(n)}toWIF(){if(!this.privateKey)throw new TypeError("Missing private key");return Tb.encode(this.network.wif,this.privateKey,!0)}derive(t){Ot(Ot.UInt32,t);let r=t>=Ud,n=I.Buffer.allocUnsafe(37);if(r){if(this.isNeutered())throw new TypeError("Missing private key for hardened child key");n[0]=0,this.privateKey.copy(n,1),n.writeUInt32BE(t,33)}else this.publicKey.copy(n,0),n.writeUInt32BE(t,33);let i=Oa.hmacSHA512(this.chainCode,n),o=i.slice(0,32),a=i.slice(32);if(!rn.isPrivate(o))return this.derive(t+1);let f;if(this.isNeutered()){let u=rn.pointAddScalar(this.publicKey,o,!0);if(u===null)return this.derive(t+1);f=Us(u,a,this.network,this.depth+1,t,this.fingerprint.readUInt32BE(0))}else{let u=rn.privateAdd(this.privateKey,o);if(u==null)return this.derive(t+1);f=qa(u,a,this.network,this.depth+1,t,this.fingerprint.readUInt32BE(0))}return f}deriveHardened(t){return Ot(Kb,t),this.derive(t+Ud)}derivePath(t){Ot(Hb,t);let r=t.split("/");if(r[0]==="m"){if(this.parentFingerprint)throw new TypeError("Expected master, got child");r=r.slice(1)}return r.reduce((n,i)=>{let o;return i.slice(-1)==="'"?(o=parseInt(i.slice(0,-1),10),n.deriveHardened(o)):(o=parseInt(i,10),n.derive(o))},this)}sign(t){if(!this.privateKey)throw new Error("Missing private key");return rn.sign(t,this.privateKey)}verify(t,r){return rn.verify(t,this.publicKey,r)}};function jb(e,t){let r=I.Buffer.from(Dd.decode(e));if(r.length!==78)throw new TypeError("Invalid buffer length");t=t||Ds;let n=r.readUInt32BE(0);if(n!==t.bip32.private&&n!==t.bip32.public)throw new TypeError("Invalid network version");let i=r[4],o=r.readUInt32BE(5);if(i===0&&o!==0)throw new TypeError("Invalid parent fingerprint");let a=r.readUInt32BE(9);if(i===0&&a!==0)throw new TypeError("Invalid index");let f=r.slice(13,45),u;if(n===t.bip32.private){if(r.readUInt8(45)!==0)throw new TypeError("Invalid private key");let p=r.slice(46,78);u=qa(p,f,t,i,a,o)}else{let p=r.slice(45,78);u=Us(p,f,t,i,a,o)}return u}Mt.fromBase58=jb;function zd(e,t,r){return qa(e,t,r)}Mt.fromPrivateKey=zd;function qa(e,t,r,n,i,o){if(Ot({privateKey:Ta,chainCode:Ta},{privateKey:e,chainCode:t}),r=r||Ds,!rn.isPrivate(e))throw new TypeError("Private key not in range [1, n)");return new Rs(e,void 0,t,r,n,i,o)}function Rb(e,t,r){return Us(e,t,r)}Mt.fromPublicKey=Rb;function Us(e,t,r,n,i,o){if(Ot({publicKey:Ot.BufferN(33),chainCode:Ta},{publicKey:e,chainCode:t}),r=r||Ds,!rn.isPoint(e))throw new TypeError("Point is not on the curve");return new Rs(void 0,e,t,r,n,i,o)}function Ub(e,t){if(Ot(Ot.Buffer,e),e.length<16)throw new TypeError("Seed should be at least 128 bits");if(e.length>64)throw new TypeError("Seed should be at most 512 bits");t=t||Ds;let r=Oa.hmacSHA512(I.Buffer.from("Bitcoin seed","utf8"),e),n=r.slice(0,32),i=r.slice(32);return zd(n,i,t)}Mt.fromSeed=Ub});var $d=D(Qt=>{"use strict";P();O();Object.defineProperty(Qt,"__esModule",{value:!0});Qt.fromPrivateKey=Qt.fromPublicKey=Qt.fromBase58=Qt.fromSeed=Qt.tinySecp256k1Interface=void 0;var Zi=Fd();Object.defineProperty(Qt,"tinySecp256k1Interface",{enumerable:!0,get:function(){return Zi.tinySecp256k1Interface}});Object.defineProperty(Qt,"fromSeed",{enumerable:!0,get:function(){return Zi.fromSeed}});Object.defineProperty(Qt,"fromBase58",{enumerable:!0,get:function(){return Zi.fromBase58}});Object.defineProperty(Qt,"fromPublicKey",{enumerable:!0,get:function(){return Zi.fromPublicKey}});Object.defineProperty(Qt,"fromPrivateKey",{enumerable:!0,get:function(){return Zi.fromPrivateKey}})});var Vd=D((u4,Db)=>{Db.exports=["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"]});var Na=D(Sn=>{"use strict";P();O();Object.defineProperty(Sn,"__esModule",{value:!0});Sn._default=Sn.wordlists=void 0;var ka={};Sn.wordlists=ka;var Cs;Sn._default=Cs;try{Sn._default=Cs=Vd(),ka.english=Cs,ka.EN=Cs}catch{}});var La=D(lt=>{"use strict";P();O();Object.defineProperty(lt,"__esModule",{value:!0});lt.wordlists=lt.getDefaultWordlist=lt.setDefaultWordlist=lt.validateMnemonic=lt.generateMnemonic=lt.entropyToMnemonic=lt.mnemonicToEntropy=lt.mnemonicToSeed=lt.mnemonicToSeedSync=void 0;var Zd=mn(),Gd=Bs(),zs=Na(),Xd=gs(),Gi=zs._default,Wd="Invalid mnemonic",En="Invalid entropy",Cb="Invalid mnemonic checksum",Yd=`A wordlist is required but a default could not be found.
|
||
Please pass a 2048 word array explicitly.`;function zb(e,t,r,n,i){let o=(0,Gd.pbkdf2)(Xd.sha512,e,t,{c:r,dkLen:n});return Promise.resolve(I.Buffer.from(o))}function Xi(e){return(e||"").normalize("NFKD")}function Jd(e,t,r){for(;e.length<r;)e=t+e;return e}function Qd(e){return parseInt(e,2)}function eu(e){return e.map(t=>Jd(t.toString(2),"0",8)).join("")}function tu(e){let r=e.length*8/32,n=(0,Zd.sha256)(e);return eu(Array.from(n)).slice(0,r)}function ru(e){return"mnemonic"+(e||"")}function Fb(e,t){let r=I.Buffer.from(Xi(e),"utf8"),n=I.Buffer.from(ru(Xi(t)),"utf8"),i=(0,Gd.pbkdf2)(Xd.sha512,r,n,{c:2048,dkLen:64});return I.Buffer.from(i)}lt.mnemonicToSeedSync=Fb;function $b(e,t){return Promise.resolve().then(()=>{let r=I.Buffer.from(Xi(e),"utf8"),n=I.Buffer.from(ru(Xi(t)),"utf8");return zb(r,n,2048,64,"sha512")})}lt.mnemonicToSeed=$b;function nu(e,t){if(t=t||Gi,!t)throw new Error(Yd);let r=Xi(e).split(" ");if(r.length%3!==0)throw new Error(Wd);let n=r.map(y=>{let g=t.indexOf(y);if(g===-1)throw new Error(Wd);return Jd(g.toString(2),"0",11)}).join(""),i=Math.floor(n.length/33)*32,o=n.slice(0,i),a=n.slice(i),f=o.match(/(.{1,8})/g).map(Qd);if(f.length<16)throw new Error(En);if(f.length>32)throw new Error(En);if(f.length%4!==0)throw new Error(En);let u=I.Buffer.from(f);if(tu(u)!==a)throw new Error(Cb);return u.toString("hex")}lt.mnemonicToEntropy=nu;function iu(e,t){if(I.Buffer.isBuffer(e)||(e=I.Buffer.from(e,"hex")),t=t||Gi,!t)throw new Error(Yd);if(e.length<16)throw new TypeError(En);if(e.length>32)throw new TypeError(En);if(e.length%4!==0)throw new TypeError(En);let r=eu(Array.from(e)),n=tu(e),a=(r+n).match(/(.{1,11})/g).map(f=>{let u=Qd(f);return t[u]});return t[0]==="\u3042\u3044\u3053\u304F\u3057\u3093"?a.join("\u3000"):a.join(" ")}lt.entropyToMnemonic=iu;function Vb(e,t,r){if(e=e||128,e%32!==0)throw new TypeError(En);return t=t||Zd.randomBytes,iu(t(e/8),r)}lt.generateMnemonic=Vb;function Wb(e,t){try{nu(e,t)}catch{return!1}return!0}lt.validateMnemonic=Wb;function Zb(e){let t=zs.wordlists[e];if(t)Gi=t;else throw new Error('Could not find wordlist for language "'+e+'"')}lt.setDefaultWordlist=Zb;function Gb(){if(!Gi)throw new Error("No Default Wordlist set");return Object.keys(zs.wordlists).filter(e=>e==="JA"||e==="EN"?!1:zs.wordlists[e].every((t,r)=>t===Gi[r]))[0]}lt.getDefaultWordlist=Gb;var Xb=Na();Object.defineProperty(lt,"wordlists",{enumerable:!0,get:function(){return Xb.wordlists}})});var ou=D(Nt=>{"use strict";P();O();Object.defineProperty(Nt,"__esModule",{value:!0});Nt.unpadBuffer=Nt.stripZeros=Nt.setLengthRight=Nt.setLengthLeft=Nt.zeros=Nt.assertIsBuffer=void 0;var Yb=function(e){if(!I.Buffer.isBuffer(e)){let t=`This method only supports Buffer but input was: ${e}`;throw new Error(t)}};Nt.assertIsBuffer=Yb;var Jb=function(e){return I.Buffer.allocUnsafe(e).fill(0)};Nt.zeros=Jb;var su=function(e,t,r){let n=(0,Nt.zeros)(t);return r?e.length<t?(e.copy(n),n):e.slice(0,t):e.length<t?(e.copy(n,t-e.length),n):e.slice(-t)},Qb=function(e,t){return I.Buffer.isBuffer(e)||(e=I.Buffer.from(e)),su(e,t,!1)};Nt.setLengthLeft=Qb;var e2=function(e,t){return I.Buffer.isBuffer(e)||(e=I.Buffer.from(e)),su(e,t,!0)};Nt.setLengthRight=e2;var t2=function(e){let t=e[0];for(;e.length>0&&t.toString()==="0";)e=e.slice(1),t=e[0];return e};Nt.stripZeros=t2;var r2=function(e){return I.Buffer.isBuffer(e)||(e=I.Buffer.from(e)),(0,Nt.stripZeros)(e)};Nt.unpadBuffer=r2});var Fs=D(ke=>{"use strict";P();O();Object.defineProperty(ke,"__esModule",{value:!0});ke.isHexString=ke.getKeys=ke.fromAscii=ke.fromUtf8=ke.toAscii=ke.arrayContainsArray=ke.getBinarySize=ke.padToEven=ke.stripHexPrefix=ke.isHexPrefixed=void 0;function au(e){if(typeof e!="string")throw new Error(`[isHexPrefixed] input must be type 'string', received type ${typeof e}`);return e[0]==="0"&&e[1]==="x"}ke.isHexPrefixed=au;var n2=e=>{if(typeof e!="string")throw new Error(`[stripHexPrefix] input must be type 'string', received ${typeof e}`);return au(e)?e.slice(2):e};ke.stripHexPrefix=n2;function fu(e){let t=e;if(typeof t!="string")throw new Error(`[padToEven] value must be type 'string', received ${typeof t}`);return t.length%2&&(t=`0${t}`),t}ke.padToEven=fu;function i2(e){if(typeof e!="string")throw new Error(`[getBinarySize] method requires input type 'string', received ${typeof e}`);return I.Buffer.byteLength(e,"utf8")}ke.getBinarySize=i2;function s2(e,t,r){if(Array.isArray(e)!==!0)throw new Error(`[arrayContainsArray] method requires input 'superset' to be an array, got type '${typeof e}'`);if(Array.isArray(t)!==!0)throw new Error(`[arrayContainsArray] method requires input 'subset' to be an array, got type '${typeof t}'`);return t[r===!0?"some":"every"](n=>e.indexOf(n)>=0)}ke.arrayContainsArray=s2;function o2(e){let t="",r=0,n=e.length;for(e.substring(0,2)==="0x"&&(r=2);r<n;r+=2){let i=parseInt(e.substr(r,2),16);t+=String.fromCharCode(i)}return t}ke.toAscii=o2;function a2(e){let t=I.Buffer.from(e,"utf8");return`0x${fu(t.toString("hex")).replace(/^0+|0+$/g,"")}`}ke.fromUtf8=a2;function f2(e){let t="";for(let r=0;r<e.length;r++){let i=e.charCodeAt(r).toString(16);t+=i.length<2?`0${i}`:i}return`0x${t}`}ke.fromAscii=f2;function c2(e,t,r){if(!Array.isArray(e))throw new Error(`[getKeys] method expects input 'params' to be an array, got ${typeof e}`);if(typeof t!="string")throw new Error(`[getKeys] method expects input 'key' to be type 'string', got ${typeof e}`);let n=[];for(let i=0;i<e.length;i++){let o=e[i][t];if(r===!0&&!o)o="";else if(typeof o!="string")throw new Error(`invalid abi - expected type 'string', received ${typeof o}`);n.push(o)}return n}ke.getKeys=c2;function d2(e,t){return!(typeof e!="string"||!e.match(/^0x[0-9A-Fa-f]*$/)||typeof t<"u"&&t>0&&e.length!==2+2*t)}ke.isHexString=d2});var cu=D(Br=>{"use strict";P();O();Object.defineProperty(Br,"__esModule",{value:!0});Br.assertIsString=Br.assertIsArray=Br.assertIsBuffer=Br.assertIsHexString=void 0;var u2=Fs(),l2=function(e){if(!(0,u2.isHexString)(e)){let t=`This method only supports 0x-prefixed hex strings but input was: ${e}`;throw new Error(t)}};Br.assertIsHexString=l2;var h2=function(e){if(!I.Buffer.isBuffer(e)){let t=`This method only supports Buffer but input was: ${e}`;throw new Error(t)}};Br.assertIsBuffer=h2;var b2=function(e){if(!Array.isArray(e)){let t=`This method only supports number arrays but input was: ${e}`;throw new Error(t)}};Br.assertIsArray=b2;var p2=function(e){if(typeof e!="string"){let t=`This method only supports strings but input was: ${e}`;throw new Error(t)}};Br.assertIsString=p2});var hu=D(Z=>{"use strict";P();O();Object.defineProperty(Z,"__esModule",{value:!0});Z.intToUnpaddedBuffer=Z.bigIntToUnpaddedBuffer=Z.bigIntToHex=Z.bufArrToArr=Z.arrToBufArr=Z.validateNoLeadingZeroes=Z.baToJSON=Z.toUtf8=Z.short=Z.addHexPrefix=Z.toUnsigned=Z.fromSigned=Z.bufferToInt=Z.bigIntToBuffer=Z.bufferToBigInt=Z.bufferToHex=Z.toBuffer=Z.unpadHexString=Z.unpadArray=Z.unpadBuffer=Z.setLengthRight=Z.setLengthLeft=Z.zeros=Z.intToBuffer=Z.intToHex=void 0;var Yi=cu(),Mn=Fs(),g2=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Received an invalid integer type: ${e}`);return`0x${e.toString(16)}`};Z.intToHex=g2;var y2=function(e){let t=(0,Z.intToHex)(e);return I.Buffer.from((0,Mn.padToEven)(t.slice(2)),"hex")};Z.intToBuffer=y2;var v2=function(e){return I.Buffer.allocUnsafe(e).fill(0)};Z.zeros=v2;var du=function(e,t,r){let n=(0,Z.zeros)(t);return r?e.length<t?(e.copy(n),n):e.slice(0,t):e.length<t?(e.copy(n,t-e.length),n):e.slice(-t)},m2=function(e,t){return(0,Yi.assertIsBuffer)(e),du(e,t,!1)};Z.setLengthLeft=m2;var w2=function(e,t){return(0,Yi.assertIsBuffer)(e),du(e,t,!0)};Z.setLengthRight=w2;var Ha=function(e){let t=e[0];for(;e.length>0&&t.toString()==="0";)e=e.slice(1),t=e[0];return e},x2=function(e){return(0,Yi.assertIsBuffer)(e),Ha(e)};Z.unpadBuffer=x2;var _2=function(e){return(0,Yi.assertIsArray)(e),Ha(e)};Z.unpadArray=_2;var S2=function(e){return(0,Yi.assertIsHexString)(e),e=(0,Mn.stripHexPrefix)(e),"0x"+Ha(e)};Z.unpadHexString=S2;var E2=function(e){if(e==null)return I.Buffer.allocUnsafe(0);if(I.Buffer.isBuffer(e))return I.Buffer.from(e);if(Array.isArray(e)||e instanceof Uint8Array)return I.Buffer.from(e);if(typeof e=="string"){if(!(0,Mn.isHexString)(e))throw new Error(`Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ${e}`);return I.Buffer.from((0,Mn.padToEven)((0,Mn.stripHexPrefix)(e)),"hex")}if(typeof e=="number")return(0,Z.intToBuffer)(e);if(typeof e=="bigint"){if(e<BigInt(0))throw new Error(`Cannot convert negative bigint to buffer. Given: ${e}`);let t=e.toString(16);return t.length%2&&(t="0"+t),I.Buffer.from(t,"hex")}if(e.toArray)return I.Buffer.from(e.toArray());if(e.toBuffer)return I.Buffer.from(e.toBuffer());throw new Error("invalid type")};Z.toBuffer=E2;var M2=function(e){return e=(0,Z.toBuffer)(e),"0x"+e.toString("hex")};Z.bufferToHex=M2;function Ka(e){let t=(0,Z.bufferToHex)(e);return BigInt(t==="0x"?0:t)}Z.bufferToBigInt=Ka;function ja(e){return(0,Z.toBuffer)("0x"+e.toString(16))}Z.bigIntToBuffer=ja;var A2=function(e){let t=Number(Ka(e));if(!Number.isSafeInteger(t))throw new Error("Number exceeds 53 bits");return t};Z.bufferToInt=A2;var B2=function(e){return BigInt.asIntN(256,Ka(e))};Z.fromSigned=B2;var I2=function(e){return ja(BigInt.asUintN(256,e))};Z.toUnsigned=I2;var P2=function(e){return typeof e!="string"||(0,Mn.isHexPrefixed)(e)?e:"0x"+e};Z.addHexPrefix=P2;function O2(e,t=50){let r=I.Buffer.isBuffer(e)?e.toString("hex"):e;return r.length<=t?r:r.slice(0,t)+"\u2026"}Z.short=O2;var T2=function(e){let t=/^(00)+|(00)+$/g;if(e=(0,Mn.stripHexPrefix)(e),e.length%2!==0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return I.Buffer.from(e.replace(t,""),"hex").toString("utf8")};Z.toUtf8=T2;var q2=function(e){if(I.Buffer.isBuffer(e))return`0x${e.toString("hex")}`;if(e instanceof Array){let t=[];for(let r=0;r<e.length;r++)t.push((0,Z.baToJSON)(e[r]));return t}};Z.baToJSON=q2;var k2=function(e){for(let[t,r]of Object.entries(e))if(r!==void 0&&r.length>0&&r[0]===0)throw new Error(`${t} cannot have leading zeroes, received: ${r.toString("hex")}`)};Z.validateNoLeadingZeroes=k2;function uu(e){return Array.isArray(e)?e.map(t=>uu(t)):I.Buffer.from(e)}Z.arrToBufArr=uu;function lu(e){return Array.isArray(e)?e.map(t=>lu(t)):Uint8Array.from(e??[])}Z.bufArrToArr=lu;var N2=e=>"0x"+e.toString(16);Z.bigIntToHex=N2;function L2(e){return(0,Z.unpadBuffer)(ja(e))}Z.bigIntToUnpaddedBuffer=L2;function H2(e){return(0,Z.unpadBuffer)((0,Z.intToBuffer)(e))}Z.intToUnpaddedBuffer=H2});var yu=D((O4,gu)=>{"use strict";P();O();var $s=ou(),hi=mn(),zt=mt(),{isHexString:K2,stripHexPrefix:j2,padToEven:R2}=Fs(),{intToBuffer:U2,addHexPrefix:D2,bufferToHex:C2}=hu(),Ae=function(){};function Vs(e){return e.startsWith("int[")?"int256"+e.slice(3):e==="int"?"int256":e.startsWith("uint[")?"uint256"+e.slice(4):e==="uint"?"uint256":e.startsWith("fixed[")?"fixed128x128"+e.slice(5):e==="fixed"?"fixed128x128":e.startsWith("ufixed[")?"ufixed128x128"+e.slice(6):e==="ufixed"?"ufixed128x128":e}function Ra(e){if(e==null)return I.Buffer.allocUnsafe(0);if(I.Buffer.isBuffer(e))return I.Buffer.from(e);if(Array.isArray(e)||e instanceof Uint8Array)return I.Buffer.from(e);if(typeof e=="string"){if(!K2(e))throw new Error(`Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ${e}`);return I.Buffer.from(R2(j2(e)),"hex")}if(typeof e=="number")return U2(e);if(typeof e=="bigint"){if(e<BigInt(0))throw new Error(`Cannot convert negative bigint to buffer. Given: ${e}`);let t=e.toString(16);return t.length%2&&(t="0"+t),I.Buffer.from(t,"hex")}if(e.toArray)return I.Buffer.from(e.toArray());if(e.toBuffer)return I.Buffer.from(e.toBuffer());throw new Error("invalid type")}function z2(e){if(!!e){if(typeof e=="number"){if(e<0)return"0x";let t=Ra(e);e=C2(t)}if(typeof e!="string"){let t="eth-sig-util.normalize() requires hex string or integer input.";throw t+=` received ${typeof e}: ${e}`,new Error(t)}return D2(e.toLowerCase())}}Ae.eventID=function(e,t){var r=e+"("+t.map(Vs).join(",")+")";return hi.keccak256(I.Buffer.from(r))};Ae.methodID=function(e,t){return Ae.eventID(e,t).slice(0,4)};function nn(e){return parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function Ua(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[parseInt(t[1],10),parseInt(t[2],10)]}function Qi(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?t[2]===""?"dynamic":parseInt(t[2],10):null}function An(e){var t=typeof e;if(t==="string")return hi.isHexPrefixed(e)?new zt(hi.stripHexPrefix(e),16):new zt(e,10);if(t==="number")return new zt(e);if(e.toArray)return e;throw new Error("Argument is not a number")}function pu(e){var t=/^(\w+)\((.*)\)$/.exec(e);if(t.length!==3)throw new Error("Invalid method signature");var r=/^(.+)\):\((.+)$/.exec(t[2]);if(r!==null&&r.length===3)return{method:t[1],args:r[1].split(","),retargs:r[2].split(",")};var n=t[2].split(",");return n.length===1&&n[0]===""&&(n=[]),{method:t[1],args:n}}function Ir(e,t){var r,n,i,o;if(e==="address")return Ir("uint160",An(t));if(e==="bool")return Ir("uint8",t?1:0);if(e==="string")return Ir("bytes",I.Buffer.from(t,"utf8"));if(Ji(e)){if(typeof t.length>"u")throw new Error("Not an array?");if(r=Qi(e),r!=="dynamic"&&r!==0&&t.length>r)throw new Error("Elements exceed array size: "+r);i=[],e=e.slice(0,e.lastIndexOf("[")),typeof t=="string"&&(t=JSON.parse(t));for(o in t)i.push(Ir(e,t[o]));if(r==="dynamic"){var a=Ir("uint256",t.length);i.unshift(a)}return I.Buffer.concat(i)}else{if(e==="bytes")return t=I.Buffer.from(t),i=I.Buffer.concat([Ir("uint256",t.length),t]),t.length%32!==0&&(i=I.Buffer.concat([i,$s.zeros(32-t.length%32)])),i;if(e.startsWith("bytes")){if(r=nn(e),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return $s.setLengthRight(t,32)}else if(e.startsWith("uint")){if(r=nn(e),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=An(t),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(I.Buffer,"be",32)}else if(e.startsWith("int")){if(r=nn(e),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=An(t),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(I.Buffer,"be",32)}else if(e.startsWith("ufixed")){if(r=Ua(e),n=An(t),n<0)throw new Error("Supplied ufixed is negative");return Ir("uint256",n.mul(new zt(2).pow(new zt(r[1]))))}else if(e.startsWith("fixed"))return r=Ua(e),Ir("int256",An(t).mul(new zt(2).pow(new zt(r[1]))))}throw new Error("Unsupported or invalid type: "+e)}function dr(e,t,r){typeof e=="string"&&(e=Da(e));var n,i,o,a;if(e.name==="address")return dr(e.rawType,t,r).toArrayLike(I.Buffer,"be",20).toString("hex");if(e.name==="bool")return dr(e.rawType,t,r).toString()===new zt(1).toString();if(e.name==="string"){var f=dr(e.rawType,t,r);return I.Buffer.from(f,"utf8").toString()}else if(e.isArray){for(o=[],n=e.size,e.size==="dynamic"&&(r=dr("uint256",t,r).toNumber(),n=dr("uint256",t,r).toNumber(),r=r+32),a=0;a<n;a++){var u=dr(e.subArray,t,r);o.push(u),r+=e.subArray.memoryUsage}return o}else{if(e.name==="bytes")return r=dr("uint256",t,r).toNumber(),n=dr("uint256",t,r).toNumber(),t.slice(r+32,r+32+n);if(e.name.startsWith("bytes"))return t.slice(r,r+e.size);if(e.name.startsWith("uint")){if(i=new zt(t.slice(r,r+32),16,"be"),i.bitLength()>e.size)throw new Error("Decoded int exceeds width: "+e.size+" vs "+i.bitLength());return i}else if(e.name.startsWith("int")){if(i=new zt(t.slice(r,r+32),16,"be").fromTwos(256),i.bitLength()>e.size)throw new Error("Decoded uint exceeds width: "+e.size+" vs "+i.bitLength());return i}else if(e.name.startsWith("ufixed")){if(n=new zt(2).pow(new zt(e.size[1])),i=dr("uint256",t,r),!i.mod(n).isZero())throw new Error("Decimals not supported yet");return i.div(n)}else if(e.name.startsWith("fixed")){if(n=new zt(2).pow(new zt(e.size[1])),i=dr("int256",t,r),!i.mod(n).isZero())throw new Error("Decimals not supported yet");return i.div(n)}}throw new Error("Unsupported or invalid type: "+e.name)}function Da(e){var t,r;if(Ji(e)){t=Qi(e);var n=e.slice(0,e.lastIndexOf("["));return n=Da(n),r={isArray:!0,name:e,size:t,memoryUsage:t==="dynamic"?32:n.memoryUsage*t,subArray:n},r}else{var i;switch(e){case"address":i="uint160";break;case"bool":i="uint8";break;case"string":i="bytes";break}if(r={rawType:i,name:e,memoryUsage:32},e.startsWith("bytes")&&e!=="bytes"||e.startsWith("uint")||e.startsWith("int")?r.size=nn(e):(e.startsWith("ufixed")||e.startsWith("fixed"))&&(r.size=Ua(e)),e.startsWith("bytes")&&e!=="bytes"&&(r.size<1||r.size>32))throw new Error("Invalid bytes<N> width: "+r.size);if((e.startsWith("uint")||e.startsWith("int"))&&(r.size%8||r.size<8||r.size>256))throw new Error("Invalid int/uint<N> width: "+r.size);return r}}function F2(e){return e==="string"||e==="bytes"||Qi(e)==="dynamic"}function Ji(e){return e.lastIndexOf("]")===e.length-1}Ae.rawEncode=function(e,t){var r=[],n=[],i=0;e.forEach(function(p){if(Ji(p)){var y=Qi(p);y!=="dynamic"?i+=32*y:i+=32}else i+=32});for(var o=0;o<e.length;o++){var a=Vs(e[o]),f=t[o],u=Ir(a,f);F2(a)?(r.push(Ir("uint256",i)),n.push(u),i+=u.length):r.push(u)}return I.Buffer.concat(r.concat(n))};Ae.rawDecode=function(e,t){var r=[];t=I.Buffer.from(t);for(var n=0,i=0;i<e.length;i++){var o=Vs(e[i]),a=Da(o,t,n),f=dr(a,t,n);n+=a.memoryUsage,r.push(f)}return r};Ae.simpleEncode=function(e){var t=Array.prototype.slice.call(arguments).slice(1),r=pu(e);if(t.length!==r.args.length)throw new Error("Argument count mismatch");return I.Buffer.concat([Ae.methodID(r.method,r.args),Ae.rawEncode(r.args,t)])};Ae.simpleDecode=function(e,t){var r=pu(e);if(!r.retargs)throw new Error("No return values in method");return Ae.rawDecode(r.retargs,t)};function bu(e,t){return e.startsWith("address")||e.startsWith("bytes")?"0x"+t.toString("hex"):t.toString()}Ae.stringify=function(e,t){var r=[];for(var n in e){var i=e[n],o=t[n];/^[^\[]+\[.*\]$/.test(i)?o=o.map(function(a){return bu(i,a)}).join(", "):o=bu(i,o),r.push(o)}return r};Ae.solidityHexValue=function(e,t,r){var n,i;if(Ji(e)){var o=e.replace(/\[.*?\]/,"");if(!Ji(o)){var a=Qi(e);if(a!=="dynamic"&&a!==0&&t.length>a)throw new Error("Elements exceed array size: "+a)}var f=t.map(function(y){return Ae.solidityHexValue(o,y,256)});return I.Buffer.concat(f)}else{if(e==="bytes")return t;if(e==="string")return I.Buffer.from(t,"utf8");if(e==="bool"){r=r||8;var u=Array(r/4).join("0");return I.Buffer.from(t?u+"1":u+"0","hex")}else if(e==="address"){var p=20;return r&&(p=r/8),$s.setLengthLeft(Ra(t),p)}else if(e.startsWith("bytes")){if(n=nn(e),n<1||n>32)throw new Error("Invalid bytes<N> width: "+n);return typeof t=="number"&&(t=z2(t)),$s.setLengthRight(Ra(t),n)}else if(e.startsWith("uint")){if(n=nn(e),n%8||n<8||n>256)throw new Error("Invalid uint<N> width: "+n);if(i=An(t),i.bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+i.bitLength());return r=r||n,i.toArrayLike(I.Buffer,"be",r/8)}else if(e.startsWith("int")){if(n=nn(e),n%8||n<8||n>256)throw new Error("Invalid int<N> width: "+n);if(i=An(t),i.bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+i.bitLength());return r=r||n,i.toTwos(n).toArrayLike(I.Buffer,"be",r/8)}else throw new Error("Unsupported or invalid type: "+e)}};Ae.solidityPack=function(e,t){if(e.length!==t.length)throw new Error("Number of types are not matching the values");for(var r=[],n=0;n<e.length;n++){var i=Vs(e[n]),o=t[n];r.push(Ae.solidityHexValue(i,o,null))}return I.Buffer.concat(r)};Ae.soliditySHA3=function(e,t){return hi.keccak256(Ae.solidityPack(e,t))};Ae.soliditySHA256=function(e,t){return hi.sha256(Ae.solidityPack(e,t))};Ae.solidityRIPEMD160=function(e,t){return hi.ripemd160(Ae.solidityPack(e,t),!0)};function $2(e){return e>="0"&&e<="9"}Ae.fromSerpent=function(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];if(n==="s")t.push("bytes");else if(n==="b"){for(var i="bytes",o=r+1;o<e.length&&$2(e[o]);)i+=e[o]-"0",o++;r=o-1,t.push(i)}else if(n==="i")t.push("int256");else if(n==="a")t.push("int256[]");else throw new Error("Unsupported or invalid type: "+n)}return t};Ae.toSerpent=function(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];if(n==="bytes")t.push("s");else if(n.startsWith("bytes"))t.push("b"+nn(n));else if(n==="int256")t.push("i");else if(n==="int256[]")t.push("a");else throw new Error("Unsupported or invalid type: "+n)}return t.join("")};gu.exports=Ae});var vu=D(sn=>{"use strict";P();O();Object.defineProperty(sn,"__esModule",{value:!0});sn.SoliditySHA3=sn.RawEncode=sn.ABI=void 0;var Ca=yu();sn.ABI=Ca;function V2(e,t){return Ca.rawEncode(e,t)}sn.RawEncode=V2;function W2(e,t){return Ca.soliditySHA3(e,t)}sn.SoliditySHA3=W2});var Eu=D(de=>{"use strict";P();O();var Z2=de&&de.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),G2=de&&de.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),X2=de&&de.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Z2(t,e,r);return G2(t,e),t},Y2=de&&de.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(de,"__esModule",{value:!0});de.loadUncompressedPublicKey=de.loadCompressedPublicKey=de.publicKeyConvert=de.publicKeyCreate=de.publicKeyVerify=de.privateKeyVerify=de.loadPublicKey=de.recover=de.verifyWithNoRecovery=de.verify=de.getV=de.sign=void 0;var J2=X2(li()),wt=new J2.ec("secp256k1"),mu=mn(),bi=Y2(mt());function Q2(e,t,r=!0){let n=wt.sign(Array.from(e),I.Buffer.from(t),{canonical:r});return{signature:n.toBytes(),recovery:n.recoveryParam}}de.sign=Q2;function e3(e,t,r,n,i=!0){let o=es(n);if(o==null)throw new Error("pubkey error");let a=wt.keyPair({pub:{x:o.x,y:o.y}}).getPublic();return wt.getKeyRecoveryParam(e,{r:t,s:r},a,i)}de.getV=e3;function t3(e,t,r,n){let i=wu(t,r,e,!0);if(i==null)return!1;let o=xu(n,!0);return o==null?!1:i.equals(o)}de.verify=t3;function r3(e,t,r){let n=es(r);if(n==null)throw new Error("pubkey error");let i=wt.keyPair({pub:{x:n.x,y:n.y}}),o={r:(0,mu.toHex)(t.slice(0,32)),s:(0,mu.toHex)(t.slice(32,64))};return i.verify(e,o)}de.verifyWithNoRecovery=r3;function wu(e,t,r,n){let i={r:Array.from(e.slice(0,32)),s:Array.from(e.slice(32,64))},o=new bi.default(i.r),a=new bi.default(i.s);if(o.cmp(wt.curve.n)>=0||a.cmp(wt.curve.n)>=0||o.isZero()||a.isZero())return null;let f;try{f=wt.recoverPubKey(Array.from(r),i,t,null)}catch{return null}return I.Buffer.from(f.encode(null,n))}de.recover=wu;function es(e){let t=I.Buffer.from(e),r=t[0];switch(r){case 2:case 3:return t.length!==33?null:_u(r,t.subarray(1,33));case 4:case 6:case 7:return t.length!==65?null:Su(r,t.subarray(1,33),t.subarray(33,65));default:return null}}de.loadPublicKey=es;function n3(e){let t=new bi.default(Array.from(e));return t.cmp(wt.curve.n)<0&&!t.isZero()}de.privateKeyVerify=n3;function i3(e){return es(e)!==null}de.publicKeyVerify=i3;function s3(e,t){let r=wt.keyFromPrivate(Array.from(e),"bytes").getPublic();return I.Buffer.from(r.encode(null,t))}de.publicKeyCreate=s3;function xu(e,t){let r=es(e);if(r==null)return null;let n=wt.keyPair({pub:{x:r.x,y:r.y}}).getPublic();return I.Buffer.from(n.encode(null,t))}de.publicKeyConvert=xu;function _u(e,t){let r=new bi.default(Array.from(t));if(r.cmp(wt.curve.p)>=0)return null;let n=r.toRed(wt.curve.red),i=n.redSqr().redIMul(n).redIAdd(wt.curve.b).redSqrt();e===3!==i.isOdd()&&(i=i.redNeg());let o=n.redSqr().redIMul(n);return i.redSqr().redISub(o.redIAdd(wt.curve.b)).isZero()?{x:n,y:i}:null}de.loadCompressedPublicKey=_u;function Su(e,t,r){let n=new bi.default(Array.from(t)),i=new bi.default(Array.from(r));if(n.cmp(wt.curve.p)>=0||i.cmp(wt.curve.p)>=0)return null;let o=n.toRed(wt.curve.red),a=i.toRed(wt.curve.red);if((e===6||e===7)&&a.isOdd()!==(e===7))return null;let f=o.redSqr().redIMul(o);return a.redSqr().redISub(f.redIAdd(wt.curve.b)).isZero()?{x:o,y:a}:null}de.loadUncompressedPublicKey=Su});var qu=D(ce=>{"use strict";P();O();var o3=ce&&ce.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),a3=ce&&ce.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),f3=ce&&ce.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&o3(t,e,r);return a3(t,e),t},c3=ce&&ce.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ce,"__esModule",{value:!0});ce.ed25519_getDerivedPrivateKey=ce.isValidPath=ce.ed25519_getRandomPrivateKey=ce.ed25519SignTest=ce.fromSecret=ce.fromSeed=ce.privateKeyVerify=ce.publicKeyVerify=ce.publicKeyCreate=ce.verify=ce.sign=ce.ed25519MulBase=void 0;var Mu=f3(li()),ur=mn(),d3=c3(mt()),u3=La(),Nr=new Mu.eddsa("ed25519"),Au=Nr.curve;function l3(e){let t=Nr.curve.g;return Nr.encodePoint(t.mul(Mu.utils.intFromLE(e)))}ce.ed25519MulBase=l3;function Bu(e,t){let r=t;r.length==64&&(r=r.slice(0,32));let i=Nr.keyFromSecret(Array.from(r)).sign(Array.from(e)).toBytes();return Uint8Array.from(i)}ce.sign=Bu;function Iu(e,t,r){return Nr.keyFromPublic(Array.from(r)).verify(Array.from(e),Array.from(t))}ce.verify=Iu;function Ws(e){let t=e;t.length==64&&(t=t.slice(0,32));let n=Nr.keyFromSecret(Array.from(t)).getPublic();if(e.length==64&&!h3(e.slice(32,64),n))throw new Error("invalid public key");return Uint8Array.from(n)}ce.publicKeyCreate=Ws;function h3(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function b3(e){let t=Nr.decodePoint(Array.from(e));return Au.validate(t)}ce.publicKeyVerify=b3;function Pu(e){let t=new d3.default(Array.from(e));return t.cmp(Au.n)<0&&!t.isZero()}ce.privateKeyVerify=Pu;function p3(e){let t=Nr.keyFromSecret(Array.from(e)),r=Uint8Array.from(t.getPublic());return{publicKey:r,secretKey:(0,ur.concatBytes)(e,r)}}ce.fromSeed=p3;function g3(e){let t=e.slice(0,32),r=Nr.keyFromSecret(Array.from(t));return{publicKey:Uint8Array.from(r.getPublic()),secretKey:Uint8Array.from(t)}}ce.fromSecret=g3;function Ou(e){let t=(0,ur.sha256)("ed25519-test"),r=Ws(e),n=Bu(t,e);return Iu(t,n,r)}ce.ed25519SignTest=Ou;function y3(e,t){for(;;){let r=(0,ur.randomBytes)(32);if(Pu(r)&&Ou(r)){let n=Ws(r),i=e?(0,ur.concatBytes)(r,n):r;return t==="base58"?(0,ur.toBase58)(i):(0,ur.toHex)(i)}}}ce.ed25519_getRandomPrivateKey=y3;var v3=new RegExp("^m(\\/[0-9]+')+$"),Tu=e=>e.replace("'",""),m3=2147483648;function w3(e){let t=(0,ur.hmacSHA512)("ed25519 seed",e),r=t.slice(0,32),n=t.slice(32);return{key:r,chainCode:n}}function x3({key:e,chainCode:t},r){let n=I.Buffer.allocUnsafe(4);n.writeUInt32BE(r,0);let i=I.Buffer.concat([I.Buffer.alloc(1,0),e,n]),o=(0,ur.hmacSHA512)(t,i),a=o.slice(0,32),f=o.slice(32);return{key:a,chainCode:f}}var _3=e=>v3.test(e)?!e.split("/").slice(1).map(Tu).some(isNaN):!1;ce.isValidPath=_3;function S3(e,t,r=m3){if(!(0,ce.isValidPath)(e))throw new Error("Invalid derivation path");let{key:n,chainCode:i}=w3(t);return e.split("/").slice(1).map(Tu).map(a=>parseInt(a,10)).reduce((a,f)=>x3(a,f+r),{key:n,chainCode:i})}async function E3(e,t,r,n){let i=await(0,u3.mnemonicToSeed)(e),o=S3(t,i).key,a=Ws(o),f=r?(0,ur.concatBytes)(o,a):o;return n==="base58"?Promise.resolve((0,ur.toBase58)(f)):Promise.resolve((0,ur.toHex)(f))}ce.ed25519_getDerivedPrivateKey=E3});var Hu=D(ve=>{"use strict";P();O();var M3=ve&&ve.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),A3=ve&&ve.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),B3=ve&&ve.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&M3(t,e,r);return A3(t,e),t},I3=ve&&ve.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ve,"__esModule",{value:!0});ve.loadUncompressedPublicKey=ve.loadCompressedPublicKey=ve.publicKeyConvert=ve.publicKeyCreate=ve.publicKeyVerify=ve.privateKeyVerify=ve.loadPublicKey=ve.recover=ve.verify=ve.sign=void 0;var P3=B3(li()),Ut=new P3.ec("p256"),pi=I3(mt());function O3(e,t,r=!0){let n=Ut.sign(Array.from(e),I.Buffer.from(t),{canonical:r});return{signature:n.toBytes(),recovery:n.recoveryParam}}ve.sign=O3;function T3(e,t,r,n){let i=ku(t,r,e,!1);return i==null?!1:i.equals(n)}ve.verify=T3;function ku(e,t,r,n){let i={r:Array.from(e.slice(0,32)),s:Array.from(e.slice(32,64))},o=new pi.default(i.r),a=new pi.default(i.s);if(o.cmp(Ut.curve.n)>=0||a.cmp(Ut.curve.n)>=0||o.isZero()||a.isZero())return null;let f;try{f=Ut.recoverPubKey(Array.from(r),i,t,null)}catch{return null}return I.Buffer.from(f.encode(null,n))}ve.recover=ku;function za(e){let t=I.Buffer.from(e),r=t[0];switch(r){case 2:case 3:return t.length!==33?null:Nu(r,t.subarray(1,33));case 4:case 6:case 7:return t.length!==65?null:Lu(r,t.subarray(1,33),t.subarray(33,65));default:return null}}ve.loadPublicKey=za;function q3(e){let t=new pi.default(Array.from(e));return t.cmp(Ut.curve.n)<0&&!t.isZero()}ve.privateKeyVerify=q3;function k3(e){return za(e)!==null}ve.publicKeyVerify=k3;function N3(e,t){let r=Ut.keyFromPrivate(Array.from(e),"bytes").getPublic();return I.Buffer.from(r.encode(null,t))}ve.publicKeyCreate=N3;function L3(e,t){let r=za(e);if(r==null)return null;let n=Ut.keyPair({pub:{x:r.x,y:r.y}}).getPublic();return I.Buffer.from(n.encode(null,t))}ve.publicKeyConvert=L3;function Nu(e,t){let r=new pi.default(Array.from(t));if(r.cmp(Ut.curve.p)>=0)return null;let n=r.toRed(Ut.curve.red),i=n.redSqr().redIMul(n).redIAdd(Ut.curve.b).redSqrt();return e===3!==i.isOdd()&&(i=i.redNeg()),{x:n,y:i}}ve.loadCompressedPublicKey=Nu;function Lu(e,t,r){let n=new pi.default(Array.from(t)),i=new pi.default(Array.from(r));if(n.cmp(Ut.curve.p)>=0||i.cmp(Ut.curve.p)>=0)return null;let o=n.toRed(Ut.curve.red),a=i.toRed(Ut.curve.red);if((e===6||e===7)&&a.isOdd()!==(e===7))return null;let f=o.redSqr().redIMul(o);return a.redSqr().redISub(f.redIAdd(Ut.curve.b)).isZero()?{x:o,y:a}:null}ve.loadUncompressedPublicKey=Lu});var Lr=D(ie=>{"use strict";P();O();Object.defineProperty(ie,"__esModule",{value:!0});ie.validateObject=ie.createHmacDrbg=ie.bitMask=ie.bitSet=ie.bitGet=ie.bitLen=ie.utf8ToBytes=ie.equalBytes=ie.concatBytes=ie.ensureBytes=ie.numberToVarBytesBE=ie.numberToBytesLE=ie.numberToBytesBE=ie.bytesToNumberLE=ie.bytesToNumberBE=ie.hexToBytes=ie.hexToNumber=ie.numberToHexUnpadded=ie.bytesToHex=void 0;var ju=BigInt(0),Zs=BigInt(1),H3=BigInt(2),Gs=e=>e instanceof Uint8Array,K3=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function $a(e){if(!Gs(e))throw new Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=K3[e[r]];return t}ie.bytesToHex=$a;function Ru(e){let t=e.toString(16);return t.length&1?`0${t}`:t}ie.numberToHexUnpadded=Ru;function Va(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return BigInt(e===""?"0":`0x${e}`)}ie.hexToNumber=Va;function Xs(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(e.length%2)throw new Error("hex string is invalid: unpadded "+e.length);let t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){let n=r*2,i=e.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("invalid byte sequence");t[r]=o}return t}ie.hexToBytes=Xs;function j3(e){return Va($a(e))}ie.bytesToNumberBE=j3;function R3(e){if(!Gs(e))throw new Error("Uint8Array expected");return Va($a(Uint8Array.from(e).reverse()))}ie.bytesToNumberLE=R3;var U3=(e,t)=>Xs(e.toString(16).padStart(t*2,"0"));ie.numberToBytesBE=U3;var D3=(e,t)=>(0,ie.numberToBytesBE)(e,t).reverse();ie.numberToBytesLE=D3;var C3=e=>Xs(Ru(e));ie.numberToVarBytesBE=C3;function z3(e,t,r){let n;if(typeof t=="string")try{n=Xs(t)}catch(o){throw new Error(`${e} must be valid hex string, got "${t}". Cause: ${o}`)}else if(Gs(t))n=Uint8Array.from(t);else throw new Error(`${e} must be hex string or Uint8Array`);let i=n.length;if(typeof r=="number"&&i!==r)throw new Error(`${e} expected ${r} bytes, got ${i}`);return n}ie.ensureBytes=z3;function Uu(...e){let t=new Uint8Array(e.reduce((n,i)=>n+i.length,0)),r=0;return e.forEach(n=>{if(!Gs(n))throw new Error("Uint8Array expected");t.set(n,r),r+=n.length}),t}ie.concatBytes=Uu;function F3(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}ie.equalBytes=F3;function $3(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new TextEncoder().encode(e)}ie.utf8ToBytes=$3;function V3(e){let t;for(t=0;e>ju;e>>=Zs,t+=1);return t}ie.bitLen=V3;var W3=(e,t)=>e>>BigInt(t)&Zs;ie.bitGet=W3;var Z3=(e,t,r)=>e|(r?Zs:ju)<<BigInt(t);ie.bitSet=Z3;var G3=e=>(H3<<BigInt(e-1))-Zs;ie.bitMask=G3;var Fa=e=>new Uint8Array(e),Ku=e=>Uint8Array.from(e);function X3(e,t,r){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=Fa(e),i=Fa(e),o=0,a=()=>{n.fill(1),i.fill(0),o=0},f=(...g)=>r(i,n,...g),u=(g=Fa())=>{i=f(Ku([0]),g),n=f(),g.length!==0&&(i=f(Ku([1]),g),n=f())},p=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let g=0,x=[];for(;g<t;){n=f();let w=n.slice();x.push(w),g+=n.length}return Uu(...x)};return(g,x)=>{a(),u(g);let w;for(;!(w=x(p()));)u();return a(),w}}ie.createHmacDrbg=X3;var Y3={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function J3(e,t,r={}){let n=(i,o,a)=>{let f=Y3[o];if(typeof f!="function")throw new Error(`Invalid validator "${o}", expected function`);let u=e[i];if(!(a&&u===void 0)&&!f(u,e))throw new Error(`Invalid param ${String(i)}=${u} (${typeof u}), expected ${o}`)};for(let[i,o]of Object.entries(t))n(i,o,!1);for(let[i,o]of Object.entries(r))n(i,o,!0);return e}ie.validateObject=J3});var Bn=D(ae=>{"use strict";P();O();Object.defineProperty(ae,"__esModule",{value:!0});ae.hashToPrivateScalar=ae.FpSqrtEven=ae.FpSqrtOdd=ae.Field=ae.nLength=ae.FpIsSquare=ae.FpDiv=ae.FpInvertBatch=ae.FpPow=ae.validateField=ae.isNegativeLE=ae.FpSqrt=ae.tonelliShanks=ae.invert=ae.pow2=ae.pow=ae.mod=void 0;var Hr=Lr(),xt=BigInt(0),Se=BigInt(1),on=BigInt(2),Q3=BigInt(3),Wa=BigInt(4),Du=BigInt(5),Cu=BigInt(8),ep=BigInt(9),tp=BigInt(16);function er(e,t){let r=e%t;return r>=xt?r:t+r}ae.mod=er;function zu(e,t,r){if(r<=xt||t<xt)throw new Error("Expected power/modulo > 0");if(r===Se)return xt;let n=Se;for(;t>xt;)t&Se&&(n=n*e%r),e=e*e%r,t>>=Se;return n}ae.pow=zu;function rp(e,t,r){let n=e;for(;t-- >xt;)n*=n,n%=r;return n}ae.pow2=rp;function Ys(e,t){if(e===xt||t<=xt)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=er(e,t),n=t,i=xt,o=Se,a=Se,f=xt;for(;r!==xt;){let p=n/r,y=n%r,g=i-a*p,x=o-f*p;n=r,r=y,i=a,o=f,a=g,f=x}if(n!==Se)throw new Error("invert: does not exist");return er(i,t)}ae.invert=Ys;function Fu(e){let t=(e-Se)/on,r,n,i;for(r=e-Se,n=0;r%on===xt;r/=on,n++);for(i=on;i<e&&zu(i,t,e)!==e-Se;i++);if(n===1){let a=(e+Se)/Wa;return function(u,p){let y=u.pow(p,a);if(!u.eql(u.sqr(y),p))throw new Error("Cannot find square root");return y}}let o=(r+Se)/on;return function(f,u){if(f.pow(u,t)===f.neg(f.ONE))throw new Error("Cannot find square root");let p=n,y=f.pow(f.mul(f.ONE,i),r),g=f.pow(u,o),x=f.pow(u,r);for(;!f.eql(x,f.ONE);){if(f.eql(x,f.ZERO))return f.ZERO;let w=1;for(let v=f.sqr(x);w<p&&!f.eql(v,f.ONE);w++)v=f.sqr(v);let _=f.pow(y,Se<<BigInt(p-w-1));y=f.sqr(_),g=f.mul(g,_),x=f.mul(x,y),p=w}return g}}ae.tonelliShanks=Fu;function $u(e){if(e%Wa===Q3){let t=(e+Se)/Wa;return function(n,i){let o=n.pow(i,t);if(!n.eql(n.sqr(o),i))throw new Error("Cannot find square root");return o}}if(e%Cu===Du){let t=(e-Du)/Cu;return function(n,i){let o=n.mul(i,on),a=n.pow(o,t),f=n.mul(i,a),u=n.mul(n.mul(f,on),a),p=n.mul(f,n.sub(u,n.ONE));if(!n.eql(n.sqr(p),i))throw new Error("Cannot find square root");return p}}return e%tp,Fu(e)}ae.FpSqrt=$u;var np=(e,t)=>(er(e,t)&Se)===Se;ae.isNegativeLE=np;var ip=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function sp(e){let t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=ip.reduce((n,i)=>(n[i]="function",n),t);return(0,Hr.validateObject)(e,r)}ae.validateField=sp;function Vu(e,t,r){if(r<xt)throw new Error("Expected power > 0");if(r===xt)return e.ONE;if(r===Se)return t;let n=e.ONE,i=t;for(;r>xt;)r&Se&&(n=e.mul(n,i)),i=e.sqr(i),r>>=Se;return n}ae.FpPow=Vu;function Wu(e,t){let r=new Array(t.length),n=t.reduce((o,a,f)=>e.is0(a)?o:(r[f]=o,e.mul(o,a)),e.ONE),i=e.inv(n);return t.reduceRight((o,a,f)=>e.is0(a)?o:(r[f]=e.mul(o,r[f]),e.mul(o,a)),i),r}ae.FpInvertBatch=Wu;function op(e,t,r){return e.mul(t,typeof r=="bigint"?Ys(r,e.ORDER):e.inv(r))}ae.FpDiv=op;function ap(e){let t=(e.ORDER-Se)/on;return r=>{let n=e.pow(r,t);return e.eql(n,e.ZERO)||e.eql(n,e.ONE)}}ae.FpIsSquare=ap;function Za(e,t){let r=t!==void 0?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}ae.nLength=Za;function fp(e,t,r=!1,n={}){if(e<=xt)throw new Error(`Expected Fp ORDER > 0, got ${e}`);let{nBitLength:i,nByteLength:o}=Za(e,t);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");let a=$u(e),f=Object.freeze({ORDER:e,BITS:i,BYTES:o,MASK:(0,Hr.bitMask)(i),ZERO:xt,ONE:Se,create:u=>er(u,e),isValid:u=>{if(typeof u!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof u}`);return xt<=u&&u<e},is0:u=>u===xt,isOdd:u=>(u&Se)===Se,neg:u=>er(-u,e),eql:(u,p)=>u===p,sqr:u=>er(u*u,e),add:(u,p)=>er(u+p,e),sub:(u,p)=>er(u-p,e),mul:(u,p)=>er(u*p,e),pow:(u,p)=>Vu(f,u,p),div:(u,p)=>er(u*Ys(p,e),e),sqrN:u=>u*u,addN:(u,p)=>u+p,subN:(u,p)=>u-p,mulN:(u,p)=>u*p,inv:u=>Ys(u,e),sqrt:n.sqrt||(u=>a(f,u)),invertBatch:u=>Wu(f,u),cmov:(u,p,y)=>y?p:u,toBytes:u=>r?(0,Hr.numberToBytesLE)(u,o):(0,Hr.numberToBytesBE)(u,o),fromBytes:u=>{if(u.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${u.length}`);return r?(0,Hr.bytesToNumberLE)(u):(0,Hr.bytesToNumberBE)(u)}});return Object.freeze(f)}ae.Field=fp;function cp(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");let r=e.sqrt(t);return e.isOdd(r)?r:e.neg(r)}ae.FpSqrtOdd=cp;function dp(e,t){if(!e.isOdd)throw new Error("Field doesn't have isOdd");let r=e.sqrt(t);return e.isOdd(r)?e.neg(r):r}ae.FpSqrtEven=dp;function up(e,t,r=!1){e=(0,Hr.ensureBytes)("privateHash",e);let n=e.length,i=Za(t).nByteLength+8;if(i<24||n<i||n>1024)throw new Error(`hashToPrivateScalar: expected ${i}-1024 bytes of input, got ${n}`);let o=r?(0,Hr.bytesToNumberLE)(e):(0,Hr.bytesToNumberBE)(e);return er(o,t-Se)+Se}ae.hashToPrivateScalar=up});var Gu=D(gi=>{"use strict";P();O();Object.defineProperty(gi,"__esModule",{value:!0});gi.validateBasic=gi.wNAF=void 0;var Zu=Bn(),lp=Lr(),hp=BigInt(0),Ga=BigInt(1);function bp(e,t){let r=(i,o)=>{let a=o.negate();return i?a:o},n=i=>{let o=Math.ceil(t/i)+1,a=2**(i-1);return{windows:o,windowSize:a}};return{constTimeNegate:r,unsafeLadder(i,o){let a=e.ZERO,f=i;for(;o>hp;)o&Ga&&(a=a.add(f)),f=f.double(),o>>=Ga;return a},precomputeWindow(i,o){let{windows:a,windowSize:f}=n(o),u=[],p=i,y=p;for(let g=0;g<a;g++){y=p,u.push(y);for(let x=1;x<f;x++)y=y.add(p),u.push(y);p=y.double()}return u},wNAF(i,o,a){let{windows:f,windowSize:u}=n(i),p=e.ZERO,y=e.BASE,g=BigInt(2**i-1),x=2**i,w=BigInt(i);for(let _=0;_<f;_++){let v=_*u,A=Number(a&g);a>>=w,A>u&&(A-=x,a+=Ga);let T=v,N=v+Math.abs(A)-1,q=_%2!==0,K=A<0;A===0?y=y.add(r(q,o[T])):p=p.add(r(K,o[N]))}return{p,f:y}},wNAFCached(i,o,a,f){let u=i._WINDOW_SIZE||1,p=o.get(i);return p||(p=this.precomputeWindow(i,u),u!==1&&o.set(i,f(p))),this.wNAF(u,p,a)}}}gi.wNAF=bp;function pp(e){return(0,Zu.validateField)(e.Fp),(0,lp.validateObject)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,Zu.nLength)(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}gi.validateBasic=pp});var Qs=D(Ee=>{"use strict";P();O();var gp=Ee&&Ee.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),yp=Ee&&Ee.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Yu=Ee&&Ee.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&gp(t,e,r);return yp(t,e),t};Object.defineProperty(Ee,"__esModule",{value:!0});Ee.mapToCurveSimpleSWU=Ee.SWUFpSqrtRatio=Ee.weierstrass=Ee.weierstrassPoints=Ee.DER=void 0;var ts=Yu(Bn()),ht=Yu(Lr()),Pr=Lr(),Xa=Gu();function vp(e){let t=(0,Xa.validateBasic)(e);ht.validateObject(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:r,Fp:n,a:i}=t;if(r){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}var{bytesToNumberBE:mp,hexToBytes:wp}=ht;Ee.DER={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(e){let{Err:t}=Ee.DER;if(e.length<2||e[0]!==2)throw new t("Invalid signature integer tag");let r=e[1],n=e.subarray(2,r+2);if(!r||n.length!==r)throw new t("Invalid signature integer: wrong length");if(n[0]&128)throw new t("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new t("Invalid signature integer: unnecessary leading zero");return{d:mp(n),l:e.subarray(r+2)}},toSig(e){let{Err:t}=Ee.DER,r=typeof e=="string"?wp(e):e;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");let n=r.length;if(n<2||r[0]!=48)throw new t("Invalid signature tag");if(r[1]!==n-2)throw new t("Invalid signature: incorrect length");let{d:i,l:o}=Ee.DER._parseInt(r.subarray(2)),{d:a,l:f}=Ee.DER._parseInt(o);if(f.length)throw new t("Invalid signature: left bytes after parsing");return{r:i,s:a}},hexFromSig(e){let t=p=>Number.parseInt(p[0],16)&8?"00"+p:p,r=p=>{let y=p.toString(16);return y.length&1?`0${y}`:y},n=t(r(e.s)),i=t(r(e.r)),o=n.length/2,a=i.length/2,f=r(o),u=r(a);return`30${r(a+o+4)}02${u}${i}02${f}${n}`}};var lr=BigInt(0),Ne=BigInt(1),an=BigInt(2),Js=BigInt(3),Xu=BigInt(4);function Ju(e){let t=vp(e),{Fp:r}=t,n=t.toBytes||((_,v,A)=>{let T=v.toAffine();return ht.concatBytes(Uint8Array.from([4]),r.toBytes(T.x),r.toBytes(T.y))}),i=t.fromBytes||(_=>{let v=_.subarray(1),A=r.fromBytes(v.subarray(0,r.BYTES)),T=r.fromBytes(v.subarray(r.BYTES,2*r.BYTES));return{x:A,y:T}});function o(_){let{a:v,b:A}=t,T=r.sqr(_),N=r.mul(T,_);return r.add(r.add(N,r.mul(_,v)),A)}if(!r.eql(r.sqr(t.Gy),o(t.Gx)))throw new Error("bad generator point: equation left != right");function a(_){return typeof _=="bigint"&&lr<_&&_<t.n}function f(_){if(!a(_))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function u(_){let{allowedPrivateKeyLengths:v,nByteLength:A,wrapPrivateKey:T,n:N}=t;if(v&&typeof _!="bigint"){if(_ instanceof Uint8Array&&(_=ht.bytesToHex(_)),typeof _!="string"||!v.includes(_.length))throw new Error("Invalid key");_=_.padStart(A*2,"0")}let q;try{q=typeof _=="bigint"?_:ht.bytesToNumberBE((0,Pr.ensureBytes)("private key",_,A))}catch{throw new Error(`private key must be ${A} bytes, hex or bigint, not ${typeof _}`)}return T&&(q=ts.mod(q,N)),f(q),q}let p=new Map;function y(_){if(!(_ instanceof g))throw new Error("ProjectivePoint expected")}class g{constructor(v,A,T){if(this.px=v,this.py=A,this.pz=T,v==null||!r.isValid(v))throw new Error("x required");if(A==null||!r.isValid(A))throw new Error("y required");if(T==null||!r.isValid(T))throw new Error("z required")}static fromAffine(v){let{x:A,y:T}=v||{};if(!v||!r.isValid(A)||!r.isValid(T))throw new Error("invalid affine point");if(v instanceof g)throw new Error("projective point not allowed");let N=q=>r.eql(q,r.ZERO);return N(A)&&N(T)?g.ZERO:new g(A,T,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(v){let A=r.invertBatch(v.map(T=>T.pz));return v.map((T,N)=>T.toAffine(A[N])).map(g.fromAffine)}static fromHex(v){let A=g.fromAffine(i((0,Pr.ensureBytes)("pointHex",v)));return A.assertValidity(),A}static fromPrivateKey(v){return g.BASE.multiply(u(v))}_setWindowSize(v){this._WINDOW_SIZE=v,p.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint)return;throw new Error("bad point: ZERO")}let{x:v,y:A}=this.toAffine();if(!r.isValid(v)||!r.isValid(A))throw new Error("bad point: x or y not FE");let T=r.sqr(A),N=o(v);if(!r.eql(T,N))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:v}=this.toAffine();if(r.isOdd)return!r.isOdd(v);throw new Error("Field doesn't support isOdd")}equals(v){y(v);let{px:A,py:T,pz:N}=this,{px:q,py:K,pz:L}=v,k=r.eql(r.mul(A,L),r.mul(q,N)),j=r.eql(r.mul(T,L),r.mul(K,N));return k&&j}negate(){return new g(this.px,r.neg(this.py),this.pz)}double(){let{a:v,b:A}=t,T=r.mul(A,Js),{px:N,py:q,pz:K}=this,L=r.ZERO,k=r.ZERO,j=r.ZERO,H=r.mul(N,N),G=r.mul(q,q),M=r.mul(K,K),s=r.mul(N,q);return s=r.add(s,s),j=r.mul(N,K),j=r.add(j,j),L=r.mul(v,j),k=r.mul(T,M),k=r.add(L,k),L=r.sub(G,k),k=r.add(G,k),k=r.mul(L,k),L=r.mul(s,L),j=r.mul(T,j),M=r.mul(v,M),s=r.sub(H,M),s=r.mul(v,s),s=r.add(s,j),j=r.add(H,H),H=r.add(j,H),H=r.add(H,M),H=r.mul(H,s),k=r.add(k,H),M=r.mul(q,K),M=r.add(M,M),H=r.mul(M,s),L=r.sub(L,H),j=r.mul(M,G),j=r.add(j,j),j=r.add(j,j),new g(L,k,j)}add(v){y(v);let{px:A,py:T,pz:N}=this,{px:q,py:K,pz:L}=v,k=r.ZERO,j=r.ZERO,H=r.ZERO,G=t.a,M=r.mul(t.b,Js),s=r.mul(A,q),l=r.mul(T,K),h=r.mul(N,L),d=r.add(A,T),b=r.add(q,K);d=r.mul(d,b),b=r.add(s,l),d=r.sub(d,b),b=r.add(A,N);let E=r.add(q,L);return b=r.mul(b,E),E=r.add(s,h),b=r.sub(b,E),E=r.add(T,N),k=r.add(K,L),E=r.mul(E,k),k=r.add(l,h),E=r.sub(E,k),H=r.mul(G,b),k=r.mul(M,h),H=r.add(k,H),k=r.sub(l,H),H=r.add(l,H),j=r.mul(k,H),l=r.add(s,s),l=r.add(l,s),h=r.mul(G,h),b=r.mul(M,b),l=r.add(l,h),h=r.sub(s,h),h=r.mul(G,h),b=r.add(b,h),s=r.mul(l,b),j=r.add(j,s),s=r.mul(E,b),k=r.mul(d,k),k=r.sub(k,s),s=r.mul(d,l),H=r.mul(E,H),H=r.add(H,s),new g(k,j,H)}subtract(v){return this.add(v.negate())}is0(){return this.equals(g.ZERO)}wNAF(v){return w.wNAFCached(this,p,v,A=>{let T=r.invertBatch(A.map(N=>N.pz));return A.map((N,q)=>N.toAffine(T[q])).map(g.fromAffine)})}multiplyUnsafe(v){let A=g.ZERO;if(v===lr)return A;if(f(v),v===Ne)return this;let{endo:T}=t;if(!T)return w.unsafeLadder(this,v);let{k1neg:N,k1:q,k2neg:K,k2:L}=T.splitScalar(v),k=A,j=A,H=this;for(;q>lr||L>lr;)q&Ne&&(k=k.add(H)),L&Ne&&(j=j.add(H)),H=H.double(),q>>=Ne,L>>=Ne;return N&&(k=k.negate()),K&&(j=j.negate()),j=new g(r.mul(j.px,T.beta),j.py,j.pz),k.add(j)}multiply(v){f(v);let A=v,T,N,{endo:q}=t;if(q){let{k1neg:K,k1:L,k2neg:k,k2:j}=q.splitScalar(A),{p:H,f:G}=this.wNAF(L),{p:M,f:s}=this.wNAF(j);H=w.constTimeNegate(K,H),M=w.constTimeNegate(k,M),M=new g(r.mul(M.px,q.beta),M.py,M.pz),T=H.add(M),N=G.add(s)}else{let{p:K,f:L}=this.wNAF(A);T=K,N=L}return g.normalizeZ([T,N])[0]}multiplyAndAddUnsafe(v,A,T){let N=g.BASE,q=(L,k)=>k===lr||k===Ne||!L.equals(N)?L.multiplyUnsafe(k):L.multiply(k),K=q(this,A).add(q(v,T));return K.is0()?void 0:K}toAffine(v){let{px:A,py:T,pz:N}=this,q=this.is0();v==null&&(v=q?r.ONE:r.inv(N));let K=r.mul(A,v),L=r.mul(T,v),k=r.mul(N,v);if(q)return{x:r.ZERO,y:r.ZERO};if(!r.eql(k,r.ONE))throw new Error("invZ was invalid");return{x:K,y:L}}isTorsionFree(){let{h:v,isTorsionFree:A}=t;if(v===Ne)return!0;if(A)return A(g,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:v,clearCofactor:A}=t;return v===Ne?this:A?A(g,this):this.multiplyUnsafe(t.h)}toRawBytes(v=!0){return this.assertValidity(),n(g,this,v)}toHex(v=!0){return ht.bytesToHex(this.toRawBytes(v))}}g.BASE=new g(t.Gx,t.Gy,r.ONE),g.ZERO=new g(r.ZERO,r.ONE,r.ZERO);let x=t.nBitLength,w=(0,Xa.wNAF)(g,t.endo?Math.ceil(x/2):x);return{CURVE:t,ProjectivePoint:g,normPrivateKeyToScalar:u,weierstrassEquation:o,isWithinCurveOrder:a}}Ee.weierstrassPoints=Ju;function xp(e){let t=(0,Xa.validateBasic)(e);return ht.validateObject(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function _p(e){let t=xp(e),{Fp:r,n}=t,i=r.BYTES+1,o=2*r.BYTES+1;function a(b){return lr<b&&b<r.ORDER}function f(b){return ts.mod(b,n)}function u(b){return ts.invert(b,n)}let{ProjectivePoint:p,normPrivateKeyToScalar:y,weierstrassEquation:g,isWithinCurveOrder:x}=Ju({...t,toBytes(b,E,B){let m=E.toAffine(),c=r.toBytes(m.x),S=ht.concatBytes;return B?S(Uint8Array.from([E.hasEvenY()?2:3]),c):S(Uint8Array.from([4]),c,r.toBytes(m.y))},fromBytes(b){let E=b.length,B=b[0],m=b.subarray(1);if(E===i&&(B===2||B===3)){let c=ht.bytesToNumberBE(m);if(!a(c))throw new Error("Point is not on curve");let S=g(c),R=r.sqrt(S),U=(R&Ne)===Ne;return(B&1)===1!==U&&(R=r.neg(R)),{x:c,y:R}}else if(E===o&&B===4){let c=r.fromBytes(m.subarray(0,r.BYTES)),S=r.fromBytes(m.subarray(r.BYTES,2*r.BYTES));return{x:c,y:S}}else throw new Error(`Point of length ${E} was invalid. Expected ${i} compressed bytes or ${o} uncompressed bytes`)}}),w=b=>ht.bytesToHex(ht.numberToBytesBE(b,t.nByteLength));function _(b){let E=n>>Ne;return b>E}function v(b){return _(b)?f(-b):b}let A=(b,E,B)=>ht.bytesToNumberBE(b.slice(E,B));class T{constructor(E,B,m){this.r=E,this.s=B,this.recovery=m,this.assertValidity()}static fromCompact(E){let B=t.nByteLength;return E=(0,Pr.ensureBytes)("compactSignature",E,B*2),new T(A(E,0,B),A(E,B,2*B))}static fromDER(E){let{r:B,s:m}=Ee.DER.toSig((0,Pr.ensureBytes)("DER",E));return new T(B,m)}assertValidity(){if(!x(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!x(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(E){return new T(this.r,this.s,E)}recoverPublicKey(E){let{r:B,s:m,recovery:c}=this,S=j((0,Pr.ensureBytes)("msgHash",E));if(c==null||![0,1,2,3].includes(c))throw new Error("recovery id invalid");let R=c===2||c===3?B+t.n:B;if(R>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");let U=(c&1)===0?"02":"03",C=p.fromHex(U+w(R)),W=u(R),J=f(-S*W),Q=f(m*W),Oe=p.BASE.multiplyAndAddUnsafe(C,J,Q);if(!Oe)throw new Error("point at infinify");return Oe.assertValidity(),Oe}hasHighS(){return _(this.s)}normalizeS(){return this.hasHighS()?new T(this.r,f(-this.s),this.recovery):this}toDERRawBytes(){return ht.hexToBytes(this.toDERHex())}toDERHex(){return Ee.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return ht.hexToBytes(this.toCompactHex())}toCompactHex(){return w(this.r)+w(this.s)}}let N={isValidPrivateKey(b){try{return y(b),!0}catch{return!1}},normPrivateKeyToScalar:y,randomPrivateKey:()=>{let b=t.randomBytes(r.BYTES+8),E=ts.hashToPrivateScalar(b,n);return ht.numberToBytesBE(E,t.nByteLength)},precompute(b=8,E=p.BASE){return E._setWindowSize(b),E.multiply(BigInt(3)),E}};function q(b,E=!0){return p.fromPrivateKey(b).toRawBytes(E)}function K(b){let E=b instanceof Uint8Array,B=typeof b=="string",m=(E||B)&&b.length;return E?m===i||m===o:B?m===2*i||m===2*o:b instanceof p}function L(b,E,B=!0){if(K(b))throw new Error("first arg must be private key");if(!K(E))throw new Error("second arg must be public key");return p.fromHex(E).multiply(y(b)).toRawBytes(B)}let k=t.bits2int||function(b){let E=ht.bytesToNumberBE(b),B=b.length*8-t.nBitLength;return B>0?E>>BigInt(B):E},j=t.bits2int_modN||function(b){return f(k(b))},H=ht.bitMask(t.nBitLength);function G(b){if(typeof b!="bigint")throw new Error("bigint expected");if(!(lr<=b&&b<H))throw new Error(`bigint expected < 2^${t.nBitLength}`);return ht.numberToBytesBE(b,t.nByteLength)}function M(b,E,B=s){if(["recovered","canonical"].some(ue=>ue in B))throw new Error("sign() legacy options not supported");let{hash:m,randomBytes:c}=t,{lowS:S,prehash:R,extraEntropy:U}=B;S==null&&(S=!0),b=(0,Pr.ensureBytes)("msgHash",b),R&&(b=(0,Pr.ensureBytes)("prehashed msgHash",m(b)));let C=j(b),W=y(E),J=[G(W),G(C)];if(U!=null){let ue=U===!0?c(r.BYTES):U;J.push((0,Pr.ensureBytes)("extraEntropy",ue,r.BYTES))}let Q=ht.concatBytes(...J),Oe=C;function ye(ue){let Or=k(ue);if(!x(Or))return;let Ie=u(Or),pe=p.BASE.multiply(Or).toAffine(),Tr=f(pe.x);if(Tr===lr)return;let xe=f(Ie*f(Oe+Tr*W));if(xe===lr)return;let Pe=(pe.x===Tr?0:2)|Number(pe.y&Ne),qi=xe;return S&&_(xe)&&(qi=v(xe),Pe^=1),new T(Tr,qi,Pe)}return{seed:Q,k2sig:ye}}let s={lowS:t.lowS,prehash:!1},l={lowS:t.lowS,prehash:!1};function h(b,E,B=s){let{seed:m,k2sig:c}=M(b,E,B),S=t;return ht.createHmacDrbg(S.hash.outputLen,S.nByteLength,S.hmac)(m,c)}p.BASE._setWindowSize(8);function d(b,E,B,m=l){let c=b;if(E=(0,Pr.ensureBytes)("msgHash",E),B=(0,Pr.ensureBytes)("publicKey",B),"strict"in m)throw new Error("options.strict was renamed to lowS");let{lowS:S,prehash:R}=m,U,C;try{if(typeof c=="string"||c instanceof Uint8Array)try{U=T.fromDER(c)}catch(pe){if(!(pe instanceof Ee.DER.Err))throw pe;U=T.fromCompact(c)}else if(typeof c=="object"&&typeof c.r=="bigint"&&typeof c.s=="bigint"){let{r:pe,s:Tr}=c;U=new T(pe,Tr)}else throw new Error("PARSE");C=p.fromHex(B)}catch(pe){if(pe.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(S&&U.hasHighS())return!1;R&&(E=t.hash(E));let{r:W,s:J}=U,Q=j(E),Oe=u(J),ye=f(Q*Oe),ue=f(W*Oe),Or=p.BASE.multiplyAndAddUnsafe(C,ye,ue)?.toAffine();return Or?f(Or.x)===W:!1}return{CURVE:t,getPublicKey:q,getSharedSecret:L,sign:h,verify:d,ProjectivePoint:p,Signature:T,utils:N}}Ee.weierstrass=_p;function Qu(e,t){let r=e.ORDER,n=lr;for(let _=r-Ne;_%an===lr;_/=an)n+=Ne;let i=n,o=an<<i-Ne-Ne,a=o*an,f=(r-Ne)/a,u=(f-Ne)/an,p=a-Ne,y=o,g=e.pow(t,f),x=e.pow(t,(f+Ne)/an),w=(_,v)=>{let A=g,T=e.pow(v,p),N=e.sqr(T);N=e.mul(N,v);let q=e.mul(_,N);q=e.pow(q,u),q=e.mul(q,T),T=e.mul(q,v),N=e.mul(q,_);let K=e.mul(N,T);q=e.pow(K,y);let L=e.eql(q,e.ONE);T=e.mul(N,x),q=e.mul(K,A),N=e.cmov(T,N,L),K=e.cmov(q,K,L);for(let k=i;k>Ne;k--){let j=k-an;j=an<<j-Ne;let H=e.pow(K,j),G=e.eql(H,e.ONE);T=e.mul(N,A),A=e.mul(A,A),H=e.mul(K,A),N=e.cmov(T,N,G),K=e.cmov(H,K,G)}return{isValid:L,value:N}};if(e.ORDER%Xu===Js){let _=(e.ORDER-Js)/Xu,v=e.sqrt(e.neg(t));w=(A,T)=>{let N=e.sqr(T),q=e.mul(A,T);N=e.mul(N,q);let K=e.pow(N,_);K=e.mul(K,q);let L=e.mul(K,v),k=e.mul(e.sqr(K),T),j=e.eql(k,A),H=e.cmov(L,K,j);return{isValid:j,value:H}}}return w}Ee.SWUFpSqrtRatio=Qu;function Sp(e,t){if(ts.validateField(e),!e.isValid(t.A)||!e.isValid(t.B)||!e.isValid(t.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");let r=Qu(e,t.Z);if(!e.isOdd)throw new Error("Fp.isOdd is not implemented!");return n=>{let i,o,a,f,u,p,y,g;i=e.sqr(n),i=e.mul(i,t.Z),o=e.sqr(i),o=e.add(o,i),a=e.add(o,e.ONE),a=e.mul(a,t.B),f=e.cmov(t.Z,e.neg(o),!e.eql(o,e.ZERO)),f=e.mul(f,t.A),o=e.sqr(a),p=e.sqr(f),u=e.mul(p,t.A),o=e.add(o,u),o=e.mul(o,a),p=e.mul(p,f),u=e.mul(p,t.B),o=e.add(o,u),y=e.mul(i,a);let{isValid:x,value:w}=r(o,p);g=e.mul(i,n),g=e.mul(g,w),y=e.cmov(y,a,x),g=e.cmov(g,w,x);let _=e.isOdd(n)===e.isOdd(g);return g=e.cmov(e.neg(g),g,_),y=e.div(y,f),{x:y,y:g}}}Ee.mapToCurveSimpleSWU=Sp});var r0=D(tr=>{"use strict";P();O();Object.defineProperty(tr,"__esModule",{value:!0});tr.createHasher=tr.isogenyMap=tr.hash_to_field=tr.expand_message_xof=tr.expand_message_xmd=void 0;var Ep=Bn(),hr=Lr();function Mp(e){if(e instanceof Uint8Array)return e;if(typeof e=="string")return(0,hr.utf8ToBytes)(e);throw new Error("DST must be Uint8Array or string")}var Ap=hr.bytesToNumberBE;function fn(e,t){if(e<0||e>=1<<8*t)throw new Error(`bad I2OSP call: value=${e} length=${t}`);let r=Array.from({length:t}).fill(0);for(let n=t-1;n>=0;n--)r[n]=e&255,e>>>=8;return new Uint8Array(r)}function Bp(e,t){let r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e[n]^t[n];return r}function rs(e){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected")}function Ja(e){if(!Number.isSafeInteger(e))throw new Error("number expected")}function e0(e,t,r,n){rs(e),rs(t),Ja(r),t.length>255&&(t=n((0,hr.concatBytes)((0,hr.utf8ToBytes)("H2C-OVERSIZE-DST-"),t)));let{outputLen:i,blockLen:o}=n,a=Math.ceil(r/i);if(a>255)throw new Error("Invalid xmd length");let f=(0,hr.concatBytes)(t,fn(t.length,1)),u=fn(0,o),p=fn(r,2),y=new Array(a),g=n((0,hr.concatBytes)(u,e,p,fn(0,1),f));y[0]=n((0,hr.concatBytes)(g,fn(1,1),f));for(let w=1;w<=a;w++){let _=[Bp(g,y[w-1]),fn(w+1,1),f];y[w]=n((0,hr.concatBytes)(..._))}return(0,hr.concatBytes)(...y).slice(0,r)}tr.expand_message_xmd=e0;function t0(e,t,r,n,i){if(rs(e),rs(t),Ja(r),t.length>255){let o=Math.ceil(2*n/8);t=i.create({dkLen:o}).update((0,hr.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(t).digest()}if(r>65535||t.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return i.create({dkLen:r}).update(e).update(fn(r,2)).update(t).update(fn(t.length,1)).digest()}tr.expand_message_xof=t0;function Ya(e,t,r){(0,hr.validateObject)(r,{DST:"string",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});let{p:n,k:i,m:o,hash:a,expand:f,DST:u}=r;rs(e),Ja(t);let p=Mp(u),y=n.toString(2).length,g=Math.ceil((y+i)/8),x=t*o*g,w;if(f==="xmd")w=e0(e,p,x,a);else if(f==="xof")w=t0(e,p,x,i,a);else if(f==="_internal_pass")w=e;else throw new Error('expand must be "xmd" or "xof"');let _=new Array(t);for(let v=0;v<t;v++){let A=new Array(o);for(let T=0;T<o;T++){let N=g*(T+v*o),q=w.subarray(N,N+g);A[T]=(0,Ep.mod)(Ap(q),n)}_[v]=A}return _}tr.hash_to_field=Ya;function Ip(e,t){let r=t.map(n=>Array.from(n).reverse());return(n,i)=>{let[o,a,f,u]=r.map(p=>p.reduce((y,g)=>e.add(e.mul(y,n),g)));return n=e.div(o,a),i=e.mul(i,e.div(f,u)),{x:n,y:i}}}tr.isogenyMap=Ip;function Pp(e,t,r){if(typeof t!="function")throw new Error("mapToCurve() must be defined");return{hashToCurve(n,i){let o=Ya(n,2,{...r,DST:r.DST,...i}),a=e.fromAffine(t(o[0])),f=e.fromAffine(t(o[1])),u=a.add(f).clearCofactor();return u.assertValidity(),u},encodeToCurve(n,i){let o=Ya(n,1,{...r,DST:r.encodeDST,...i}),a=e.fromAffine(t(o[0])).clearCofactor();return a.assertValidity(),a}}}tr.createHasher=Pp});var Qa=D(yi=>{"use strict";P();O();Object.defineProperty(yi,"__esModule",{value:!0});yi.createCurve=yi.getHash=void 0;var Op=Ci(),n0=It(),Tp=Qs();function i0(e){return{hash:e,hmac:(t,...r)=>(0,Op.hmac)(e,t,(0,n0.concatBytes)(...r)),randomBytes:n0.randomBytes}}yi.getHash=i0;function qp(e,t){let r=n=>(0,Tp.weierstrass)({...e,...i0(n)});return Object.freeze({...r(t),create:r})}yi.createCurve=qp});var b0=D(bt=>{"use strict";P();O();var kp=bt&&bt.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Np=bt&&bt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Lp=bt&&bt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&kp(t,e,r);return Np(t,e),t},ef;Object.defineProperty(bt,"__esModule",{value:!0});bt.encodeToCurve=bt.hashToCurve=bt.schnorr=bt.secp256k1=void 0;var eo=$n(),Hp=It(),At=Bn(),Kp=Qs(),Lt=Lr(),a0=Lp(r0()),jp=Qa(),io=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),to=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),f0=BigInt(1),ro=BigInt(2),s0=(e,t)=>(e+t/ro)/t;function c0(e){let t=io,r=BigInt(3),n=BigInt(6),i=BigInt(11),o=BigInt(22),a=BigInt(23),f=BigInt(44),u=BigInt(88),p=e*e*e%t,y=p*p*e%t,g=(0,At.pow2)(y,r,t)*y%t,x=(0,At.pow2)(g,r,t)*y%t,w=(0,At.pow2)(x,ro,t)*p%t,_=(0,At.pow2)(w,i,t)*w%t,v=(0,At.pow2)(_,o,t)*_%t,A=(0,At.pow2)(v,f,t)*v%t,T=(0,At.pow2)(A,u,t)*A%t,N=(0,At.pow2)(T,f,t)*v%t,q=(0,At.pow2)(N,r,t)*y%t,K=(0,At.pow2)(q,a,t)*_%t,L=(0,At.pow2)(K,n,t)*p%t,k=(0,At.pow2)(L,ro,t);if(!cn.eql(cn.sqr(k),e))throw new Error("Cannot find square root");return k}var cn=(0,At.Field)(io,void 0,void 0,{sqrt:c0});bt.secp256k1=(0,jp.createCurve)({a:BigInt(0),b:BigInt(7),Fp:cn,n:to,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{let t=to,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-f0*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,a=BigInt("0x100000000000000000000000000000000"),f=s0(o*e,t),u=s0(-n*e,t),p=(0,At.mod)(e-f*r-u*i,t),y=(0,At.mod)(-f*n-u*o,t),g=p>a,x=y>a;if(g&&(p=t-p),x&&(y=t-y),p>a||y>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:g,k1:p,k2neg:x,k2:y}}}},eo.sha256);var so=BigInt(0),d0=e=>typeof e=="bigint"&&so<e&&e<io,Rp=e=>typeof e=="bigint"&&so<e&&e<to,o0={};function no(e,...t){let r=o0[e];if(r===void 0){let n=(0,eo.sha256)(Uint8Array.from(e,i=>i.charCodeAt(0)));r=(0,Lt.concatBytes)(n,n),o0[e]=r}return(0,eo.sha256)((0,Lt.concatBytes)(r,...t))}var sf=e=>e.toRawBytes(!0).slice(1),rf=e=>(0,Lt.numberToBytesBE)(e,32),tf=e=>(0,At.mod)(e,io),ns=e=>(0,At.mod)(e,to),of=bt.secp256k1.ProjectivePoint,Up=(e,t,r)=>of.BASE.multiplyAndAddUnsafe(e,t,r);function nf(e){let t=bt.secp256k1.utils.normPrivateKeyToScalar(e),r=of.fromPrivateKey(t);return{scalar:r.hasEvenY()?t:ns(-t),bytes:sf(r)}}function u0(e){if(!d0(e))throw new Error("bad x: need 0 < x < p");let t=tf(e*e),r=tf(t*e+BigInt(7)),n=c0(r);n%ro!==so&&(n=tf(-n));let i=new of(e,n,f0);return i.assertValidity(),i}function l0(...e){return ns((0,Lt.bytesToNumberBE)(no("BIP0340/challenge",...e)))}function Dp(e){return nf(e).bytes}function Cp(e,t,r=(0,Hp.randomBytes)(32)){let n=(0,Lt.ensureBytes)("message",e),{bytes:i,scalar:o}=nf(t),a=(0,Lt.ensureBytes)("auxRand",r,32),f=rf(o^(0,Lt.bytesToNumberBE)(no("BIP0340/aux",a))),u=no("BIP0340/nonce",f,i,n),p=ns((0,Lt.bytesToNumberBE)(u));if(p===so)throw new Error("sign failed: k is zero");let{bytes:y,scalar:g}=nf(p),x=l0(y,i,n),w=new Uint8Array(64);if(w.set(y,0),w.set(rf(ns(g+x*o)),32),!h0(w,n,i))throw new Error("sign: Invalid signature produced");return w}function h0(e,t,r){let n=(0,Lt.ensureBytes)("signature",e,64),i=(0,Lt.ensureBytes)("message",t),o=(0,Lt.ensureBytes)("publicKey",r,32);try{let a=u0((0,Lt.bytesToNumberBE)(o)),f=(0,Lt.bytesToNumberBE)(n.subarray(0,32));if(!d0(f))return!1;let u=(0,Lt.bytesToNumberBE)(n.subarray(32,64));if(!Rp(u))return!1;let p=l0(rf(f),sf(a),i),y=Up(a,u,ns(-p));return!(!y||!y.hasEvenY()||y.toAffine().x!==f)}catch{return!1}}bt.schnorr={getPublicKey:Dp,sign:Cp,verify:h0,utils:{randomPrivateKey:bt.secp256k1.utils.randomPrivateKey,lift_x:u0,pointToBytes:sf,numberToBytesBE:Lt.numberToBytesBE,bytesToNumberBE:Lt.bytesToNumberBE,taggedHash:no,mod:At.mod}};var zp=a0.isogenyMap(cn,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(e=>e.map(t=>BigInt(t)))),Fp=(0,Kp.mapToCurveSimpleSWU)(cn,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:cn.create(BigInt("-11"))});ef=a0.createHasher(bt.secp256k1.ProjectivePoint,e=>{let{x:t,y:r}=Fp(cn.create(e[0]));return zp(t,r)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:cn.ORDER,m:1,k:128,expand:"xmd",hash:eo.sha256}),bt.hashToCurve=ef.hashToCurve,bt.encodeToCurve=ef.encodeToCurve});var y0=D(dn=>{"use strict";P();O();Object.defineProperty(dn,"__esModule",{value:!0});dn.poseidon=dn.splitConstants=dn.validateOpts=void 0;var p0=Bn();function g0(e){let{Fp:t}=e;(0,p0.validateField)(t);for(let u of["t","roundsFull","roundsPartial"])if(typeof e[u]!="number"||!Number.isSafeInteger(e[u]))throw new Error(`Poseidon: invalid param ${u}=${e[u]} (${typeof e[u]})`);if(e.reversePartialPowIdx!==void 0&&typeof e.reversePartialPowIdx!="boolean")throw new Error(`Poseidon: invalid param reversePartialPowIdx=${e.reversePartialPowIdx}`);let r=e.sboxPower;if(r===void 0&&(r=5),typeof r!="number"||!Number.isSafeInteger(r))throw new Error(`Poseidon wrong sboxPower=${r}`);let n=BigInt(r),i=u=>(0,p0.FpPow)(t,u,n);if(r===3?i=u=>t.mul(t.sqrN(u),u):r===5&&(i=u=>t.mul(t.sqrN(t.sqrN(u)),u)),e.roundsFull%2!==0)throw new Error(`Poseidon roundsFull is not even: ${e.roundsFull}`);let o=e.roundsFull+e.roundsPartial;if(!Array.isArray(e.roundConstants)||e.roundConstants.length!==o)throw new Error("Poseidon: wrong round constants");let a=e.roundConstants.map(u=>{if(!Array.isArray(u)||u.length!==e.t)throw new Error(`Poseidon wrong round constants: ${u}`);return u.map(p=>{if(typeof p!="bigint"||!t.isValid(p))throw new Error(`Poseidon wrong round constant=${p}`);return t.create(p)})});if(!Array.isArray(e.mds)||e.mds.length!==e.t)throw new Error("Poseidon: wrong MDS matrix");let f=e.mds.map(u=>{if(!Array.isArray(u)||u.length!==e.t)throw new Error(`Poseidon MDS matrix row: ${u}`);return u.map(p=>{if(typeof p!="bigint")throw new Error(`Poseidon MDS matrix value=${p}`);return t.create(p)})});return Object.freeze({...e,rounds:o,sboxFn:i,roundConstants:a,mds:f})}dn.validateOpts=g0;function $p(e,t){if(typeof t!="number")throw new Error("poseidonSplitConstants: wrong t");if(!Array.isArray(e)||e.length%t)throw new Error("poseidonSplitConstants: wrong rc");let r=[],n=[];for(let i=0;i<e.length;i++)n.push(e[i]),n.length===t&&(r.push(n),n=[]);return r}dn.splitConstants=$p;function Vp(e){let{t,Fp:r,rounds:n,sboxFn:i,reversePartialPowIdx:o}=g0(e),a=Math.floor(e.roundsFull/2),f=o?t-1:0,u=(y,g,x)=>(y=y.map((w,_)=>r.add(w,e.roundConstants[x][_])),g?y=y.map(w=>i(w)):y[f]=i(y[f]),y=e.mds.map(w=>w.reduce((_,v,A)=>r.add(_,r.mulN(v,y[A])),r.ZERO)),y),p=function(g){if(!Array.isArray(g)||g.length!==t)throw new Error(`Poseidon: wrong values (expected array of bigints with length ${t})`);g=g.map(w=>{if(typeof w!="bigint")throw new Error(`Poseidon: wrong value=${w} (${typeof w})`);return r.create(w)});let x=0;for(let w=0;w<a;w++)g=u(g,!0,x++);for(let w=0;w<e.roundsPartial;w++)g=u(g,!1,x++);for(let w=0;w<a;w++)g=u(g,!0,x++);if(x!==n)throw new Error(`Poseidon: wrong number of rounds: last round=${x}, total=${n}`);return g};return p.roundConstants=e.roundConstants,p}dn.poseidon=Vp});var O0=D(V=>{"use strict";P();O();var Wp=V&&V.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Zp=V&&V.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Gp=V&&V.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Wp(t,e,r);return Zp(t,e),t};Object.defineProperty(V,"__esModule",{value:!0});V.poseidonHashMany=V.poseidonHashSingle=V.poseidonHashFunc=V.poseidonHash=V.poseidonSmall=V.poseidonCreate=V.poseidonBasic=V._poseidonMDS=V.Fp251=V.Fp253=V.keccak=V.computeHashOnElements=V.hashChain=V.pedersen=V.getAccountPath=V.ethSigToPrivate=V.getStarkKey=V.grindKey=V.utils=V.Signature=V.ProjectivePoint=V.CURVE=V.verify=V.sign=V.getSharedSecret=V.getPublicKey=V._starkCurve=void 0;var Xp=ws(),cf=$n(),Yp=It(),Pn=Bn(),Jp=y0(),Qp=Qs(),Ht=Gp(Lr()),e6=Qa(),ao=BigInt("3618502788666131213697322783095070105526743751716087489154079457884512865583"),w0=252;function v0(e){for(;e[0]===0;)e=e.subarray(1);let t=e.length*8-w0,r=Ht.bytesToNumberBE(e);return t>0?r>>BigInt(t):r}function x0(e){return typeof e=="string"&&(e=uf(e),e.length&1&&(e="0"+e)),Ht.hexToBytes(e)}var On=(0,Qp.weierstrass)({a:BigInt(1),b:BigInt("3141592653589793238462643383279502884197169399375105820974944592307816406665"),Fp:(0,Pn.Field)(BigInt("0x800000000000011000000000000000000000000000000000000000000000001")),n:ao,nBitLength:w0,Gx:BigInt("874739451078007766457464989774322083649278607533249481151382481072868806602"),Gy:BigInt("152666792071518830868575557812948353041420400780739481342941381225525861407"),h:BigInt(1),lowS:!1,...(0,e6.getHash)(cf.sha256),bits2int:v0,bits2int_modN:e=>{let t=Ht.bytesToNumberBE(e).toString(16);return t.length===63&&(e=x0(t+"0")),(0,Pn.mod)(v0(e),ao)}});V._starkCurve=On;function In(e){return Ht.ensureBytes("",typeof e=="string"?x0(e):e)}function df(e){return Ht.bytesToHex(In(e)).padStart(64,"0")}function _0(e,t=!1){return On.getPublicKey(df(e),t)}V.getPublicKey=_0;function t6(e,t){return On.getSharedSecret(df(e),t)}V.getSharedSecret=t6;function r6(e,t,r){return On.sign(In(e),df(t),r)}V.sign=r6;function n6(e,t,r){let n=e instanceof S0?e:In(e);return On.verify(n,In(t),In(r))}V.verify=n6;var{CURVE:i6,ProjectivePoint:vi,Signature:S0,utils:s6}=On;V.CURVE=i6;V.ProjectivePoint=vi;V.Signature=S0;V.utils=s6;function E0(e){return`0x${Ht.bytesToHex(e.subarray(1)).replace(/^0+/gm,"")}`}function uf(e){return e.replace(/^0x/i,"")}function o6(e){return`0x${e.toString(16)}`}function M0(e){let t=In(e),r=2n**256n,n=r-(0,Pn.mod)(r,ao);for(let i=0;;i++){let o=af(Ht.concatBytes(t,Ht.numberToVarBytesBE(BigInt(i))));if(o<n)return(0,Pn.mod)(o,ao).toString(16);if(i===1e5)throw new Error("grindKey is broken: tried 100k vals")}}V.grindKey=M0;function a6(e){return E0(_0(e,!0))}V.getStarkKey=a6;function f6(e){if(e=uf(e),e.length!==130)throw new Error("Wrong ethereum signature");return M0(e.substring(0,64))}V.ethSigToPrivate=f6;var c6=2n**31n-1n,oo=e=>Number(e&c6);function d6(e,t,r,n){let i=oo(af(e)),o=oo(af(t)),a=Ht.hexToNumber(uf(r));return`m/2645'/${i}'/${o}'/${oo(a)}'/${oo(a>>31n)}'/${n}`}V.getAccountPath=d6;var is=[new vi(2089986280348253421170679821480865132823066470938446095505822317253594081284n,1713931329540660377023406109199410414810705867260802078187082345529207694986n,1n),new vi(996781205833008774514500082376783249102396023663454813447423147977397232763n,1668503676786377725805489344771023921079126552019160156920634619255970485781n,1n),new vi(2251563274489750535117886426533222435294046428347329203627021249169616184184n,1798716007562728905295480679789526322175868328062420237419143593021674992973n,1n),new vi(2138414695194151160943305727036575959195309218611738193261179310511854807447n,113410276730064486255102093846540133784865286929052426931474106396135072156n,1n),new vi(2379962749567351885752724891227938183011949129833673362440656643086021394946n,776496453633298175483985398648758586525933812536653089401905292063708816422n,1n)];function A0(e,t){let r=[],n=e;for(let i=0;i<248;i++)r.push(n),n=n.double();n=t;for(let i=0;i<4;i++)r.push(n),n=n.double();return r}var u6=A0(is[1],is[2]),l6=A0(is[3],is[4]);function B0(e){let t;if(typeof e=="bigint")t=e;else if(typeof e=="number"){if(!Number.isSafeInteger(e))throw new Error(`Invalid pedersenArg: ${e}`);t=BigInt(e)}else t=Ht.bytesToNumberBE(In(e));if(!(0n<=t&&t<On.CURVE.Fp.ORDER))throw new Error(`PedersenArg should be 0 <= value < CURVE.P: ${t}`);return t}function m0(e,t,r){let n=B0(t);for(let i=0;i<252;i++){let o=r[i];if(o.equals(e))throw new Error("Same point");(n&1n)!==0n&&(e=e.add(o)),n>>=1n}return e}function lf(e,t){let r=is[0];return r=m0(r,e,u6),r=m0(r,t,l6),E0(r.toRawBytes(!0))}V.pedersen=lf;function h6(e,t=lf){if(!Array.isArray(e)||e.length<1)throw new Error("data should be array of at least 1 element");return e.length===1?o6(B0(e[0])):Array.from(e).reverse().reduce((r,n)=>t(n,r))}V.hashChain=h6;var b6=(e,t=lf)=>[0,...e,e.length].reduce((r,n)=>t(r,n));V.computeHashOnElements=b6;var p6=Ht.bitMask(250),g6=e=>Ht.bytesToNumberBE((0,Xp.keccak_256)(e))&p6;V.keccak=g6;var af=e=>Ht.bytesToNumberBE((0,cf.sha256)(e));V.Fp253=(0,Pn.Field)(BigInt("14474011154664525231415395255581126252639794253786371766033694892385558855681"));V.Fp251=(0,Pn.Field)(BigInt("3618502788666131213697322783095070105623107215331596699973092056135872020481"));function ff(e,t,r){let n=e.fromBytes((0,cf.sha256)((0,Yp.utf8ToBytes)(`${t}${r}`)));return e.create(n)}function I0(e,t,r,n=0){let i=[],o=[];for(let a=0;a<r;a++)i.push(ff(e,`${t}x`,n*r+a)),o.push(ff(e,`${t}y`,n*r+a));if(new Set([...i,...o]).size!==2*r)throw new Error("X and Y values are not distinct");return i.map(a=>o.map(f=>e.inv(e.sub(a,f))))}V._poseidonMDS=I0;var y6=[[3,1,1],[1,-1,1],[1,1,-2]].map(e=>e.map(BigInt));function hf(e,t){if((0,Pn.validateField)(e.Fp),!Number.isSafeInteger(e.rate)||!Number.isSafeInteger(e.capacity))throw new Error(`Wrong poseidon opts: ${e}`);let r=e.rate+e.capacity,n=e.roundsFull+e.roundsPartial,i=[];for(let a=0;a<n;a++){let f=[];for(let u=0;u<r;u++)f.push(ff(e.Fp,"Hades",r*a+u));i.push(f)}let o=(0,Jp.poseidon)({...e,t:r,sboxPower:3,reversePartialPowIdx:!0,mds:t,roundConstants:i});return o.m=r,o.rate=e.rate,o.capacity=e.capacity,o}V.poseidonBasic=hf;function v6(e,t=0){let r=e.rate+e.capacity;if(!Number.isSafeInteger(t))throw new Error(`Wrong mdsAttempt=${t}`);return hf(e,I0(e.Fp,"HadesMDS",r,t))}V.poseidonCreate=v6;V.poseidonSmall=hf({Fp:V.Fp251,rate:2,capacity:1,roundsFull:8,roundsPartial:83},y6);function P0(e,t,r=V.poseidonSmall){return r([e,t,2n])[0]}V.poseidonHash=P0;function m6(e,t,r=V.poseidonSmall){return Ht.numberToVarBytesBE(P0(Ht.bytesToNumberBE(e),Ht.bytesToNumberBE(t),r))}V.poseidonHashFunc=m6;function w6(e,t=V.poseidonSmall){return t([e,0n,1n])[0]}V.poseidonHashSingle=w6;function x6(e,t=V.poseidonSmall){let{m:r,rate:n}=t;if(!Array.isArray(e))throw new Error("bigint array expected in values");let i=Array.from(e);for(i.push(1n);i.length%n!==0;)i.push(0n);let o=new Array(r).fill(0n);for(let a=0;a<i.length;a+=n){for(let f=0;f<n;f++)o[f]+=i[a+f];o=t(o)}return o[0]}V.poseidonHashMany=x6});var k0=D(Kt=>{"use strict";P();O();var _6=Kt&&Kt.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),S6=Kt&&Kt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),T0=Kt&&Kt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&_6(t,e,r);return S6(t,e),t};Object.defineProperty(Kt,"__esModule",{value:!0});Kt.bytesToHex=Kt.hexToBytes=Kt.stark=Kt.secp256k1=void 0;Kt.secp256k1=T0(b0());Kt.stark=T0(O0());var q0=Lr();Object.defineProperty(Kt,"hexToBytes",{enumerable:!0,get:function(){return q0.hexToBytes}});Object.defineProperty(Kt,"bytesToHex",{enumerable:!0,get:function(){return q0.bytesToHex}})});var N0=D(jt=>{"use strict";P();O();var E6=jt&&jt.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),M6=jt&&jt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),fo=jt&&jt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&E6(t,e,r);return M6(t,e),t};Object.defineProperty(jt,"__esModule",{value:!0});jt.schnorr=jt.p256=jt.ed25519=jt.secp256k1=void 0;jt.secp256k1=fo(Eu());jt.ed25519=fo(qu());jt.p256=fo(Hu());jt.schnorr=fo(k0())});var H0=D(mi=>{"use strict";P();O();var A6=mi&&mi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(mi,"__esModule",{value:!0});mi.Decimal=void 0;var Tn=A6(mt()),L0=100,pt=class{static fromUserInput(t,r){pt.verifyFractionalDigits(r);let n=t.match(/[^0-9.]/);if(n)throw new Error(`Invalid character at position ${n.index+1}`);let i,o;if(t.search(/\./)===-1)i=t,o="";else{let f=t.split(".");switch(f.length){case 0:case 1:throw new Error("Fewer than two elements in split result. This must not happen here.");case 2:if(!f[1])throw new Error("Fractional part missing");i=f[0],o=f[1].replace(/0+$/,"");break;default:throw new Error("More than one separator found")}}if(o.length>r)throw new Error("Got more fractional digits than supported");let a=`${i}${o.padEnd(r,"0")}`;return new pt(a,r)}static fromAtomics(t,r){return pt.verifyFractionalDigits(r),new pt(t,r)}static zero(t){return pt.verifyFractionalDigits(t),new pt("0",t)}static one(t){return pt.verifyFractionalDigits(t),new pt("1"+"0".repeat(t),t)}static verifyFractionalDigits(t){if(!Number.isInteger(t))throw new Error("Fractional digits is not an integer");if(t<0)throw new Error("Fractional digits must not be negative");if(t>L0)throw new Error(`Fractional digits must not exceed ${L0}`)}static compare(t,r){if(t.fractionalDigits!==r.fractionalDigits)throw new Error("Fractional digits do not match");return t.data.atomics.cmp(new Tn.default(r.atomics))}get atomics(){return this.data.atomics.toString()}get fractionalDigits(){return this.data.fractionalDigits}constructor(t,r){this.data={atomics:new Tn.default(t),fractionalDigits:r}}toString(){let t=new Tn.default(10).pow(new Tn.default(this.data.fractionalDigits)),r=this.data.atomics.div(t),n=this.data.atomics.mod(t);if(n.isZero())return r.toString();{let o=n.toString().padStart(this.data.fractionalDigits,"0").replace(/0+$/,"");return`${r.toString()}.${o}`}}toFloatApproximation(){let t=Number(this.toString());if(Number.isNaN(t))throw new Error("Conversion to number failed");return t}plus(t){if(this.fractionalDigits!==t.fractionalDigits)throw new Error("Fractional digits do not match");let r=this.data.atomics.add(new Tn.default(t.atomics));return new pt(r.toString(),this.fractionalDigits)}minus(t){if(this.fractionalDigits!==t.fractionalDigits)throw new Error("Fractional digits do not match");let r=this.data.atomics.sub(new Tn.default(t.atomics));if(r.ltn(0))throw new Error("Difference must not be negative");return new pt(r.toString(),this.fractionalDigits)}multiply(t){let r=this.data.atomics.mul(new Tn.default(t.toString()));return new pt(r.toString(),this.fractionalDigits)}equals(t){return pt.compare(this,t)===0}isLessThan(t){return pt.compare(this,t)<0}isLessThanOrEqual(t){return pt.compare(this,t)<=0}isGreaterThan(t){return pt.compare(this,t)>0}isGreaterThanOrEqual(t){return pt.compare(this,t)>=0}};mi.Decimal=pt});var K0=D(rr=>{"use strict";P();O();var B6=rr&&rr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(rr,"__esModule",{value:!0});rr.Uint64=rr.Uint53=rr.Int53=rr.Uint32=void 0;var co=B6(mt()),I6=new co.default("18446744073709551615",10,"be"),qn=class{static fromBigEndianBytes(t){return qn.fromBytes(t)}static fromBytes(t,r="be"){if(t.length!==4)throw new Error("Invalid input length. Expected 4 bytes.");for(let i=0;i<t.length;++i)if(!Number.isInteger(t[i])||t[i]>255||t[i]<0)throw new Error("Invalid value in byte. Found: "+t[i]);let n=r==="be"?t:Array.from(t).reverse();return new qn(n[0]*2**24+n[1]*2**16+n[2]*2**8+n[3])}static fromString(t){if(!t.match(/^[0-9]+$/))throw new Error("Invalid string format");return new qn(Number.parseInt(t,10))}constructor(t){if(Number.isNaN(t))throw new Error("Input is not a number");if(!Number.isInteger(t))throw new Error("Input is not an integer");if(t<0||t>4294967295)throw new Error("Input not in uint32 range: "+t.toString());this.data=t}toBytesBigEndian(){return new Uint8Array([Math.floor(this.data/2**24)&255,Math.floor(this.data/2**16)&255,Math.floor(this.data/2**8)&255,Math.floor(this.data/2**0)&255])}toBytesLittleEndian(){return new Uint8Array([Math.floor(this.data/2**0)&255,Math.floor(this.data/2**8)&255,Math.floor(this.data/2**16)&255,Math.floor(this.data/2**24)&255])}toNumber(){return this.data}toString(){return this.data.toString()}};rr.Uint32=qn;var kn=class{static fromString(t){if(!t.match(/^-?[0-9]+$/))throw new Error("Invalid string format");return new kn(Number.parseInt(t,10))}constructor(t){if(Number.isNaN(t))throw new Error("Input is not a number");if(!Number.isInteger(t))throw new Error("Input is not an integer");if(t<Number.MIN_SAFE_INTEGER||t>Number.MAX_SAFE_INTEGER)throw new Error("Input not in int53 range: "+t.toString());this.data=t}toNumber(){return this.data}toString(){return this.data.toString()}};rr.Int53=kn;var ss=class{static fromString(t){let r=kn.fromString(t);return new ss(r.toNumber())}constructor(t){let r=new kn(t);if(r.toNumber()<0)throw new Error("Input is negative");this.data=r}toNumber(){return this.data.toNumber()}toString(){return this.data.toString()}};rr.Uint53=ss;var un=class{static fromBytesBigEndian(t){return un.fromBytes(t)}static fromBytes(t,r="be"){if(t.length!==8)throw new Error("Invalid input length. Expected 8 bytes.");for(let i=0;i<t.length;++i)if(!Number.isInteger(t[i])||t[i]>255||t[i]<0)throw new Error("Invalid value in byte. Found: "+t[i]);let n=r==="be"?Array.from(t):Array.from(t).reverse();return new un(new co.default(n))}static fromString(t){if(!t.match(/^[0-9]+$/))throw new Error("Invalid string format");return new un(new co.default(t,10,"be"))}static fromNumber(t){if(Number.isNaN(t))throw new Error("Input is not a number");if(!Number.isInteger(t))throw new Error("Input is not an integer");let r;try{r=new co.default(t)}catch{throw new Error("Input is not a safe integer")}return new un(r)}constructor(t){if(t.isNeg())throw new Error("Input is negative");if(t.gt(I6))throw new Error("Input exceeds uint64 range");this.data=t}toBytesBigEndian(){return Uint8Array.from(this.data.toArray("be",8))}toBytesLittleEndian(){return Uint8Array.from(this.data.toArray("le",8))}toString(){return this.data.toString(10)}toNumber(){return this.data.toNumber()}};rr.Uint64=un});var j0=D(nr=>{"use strict";P();O();Object.defineProperty(nr,"__esModule",{value:!0});nr.Uint64=nr.Uint53=nr.Uint32=nr.Int53=nr.Decimal=void 0;var P6=H0();Object.defineProperty(nr,"Decimal",{enumerable:!0,get:function(){return P6.Decimal}});var uo=K0();Object.defineProperty(nr,"Int53",{enumerable:!0,get:function(){return uo.Int53}});Object.defineProperty(nr,"Uint32",{enumerable:!0,get:function(){return uo.Uint32}});Object.defineProperty(nr,"Uint53",{enumerable:!0,get:function(){return uo.Uint53}});Object.defineProperty(nr,"Uint64",{enumerable:!0,get:function(){return uo.Uint64}})});var D0=D((U0,bf)=>{P();O();var R0=function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function r(h,d,b){this.low=h|0,this.high=d|0,this.unsigned=!!b}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0});function n(h){return(h&&h.__isLong__)===!0}function i(h){var d=Math.clz32(h&-h);return h?31-d:d}r.isLong=n;var o={},a={};function f(h,d){var b,E,B;return d?(h>>>=0,(B=0<=h&&h<256)&&(E=a[h],E)?E:(b=p(h,0,!0),B&&(a[h]=b),b)):(h|=0,(B=-128<=h&&h<128)&&(E=o[h],E)?E:(b=p(h,h<0?-1:0,!1),B&&(o[h]=b),b))}r.fromInt=f;function u(h,d){if(isNaN(h))return d?K:q;if(d){if(h<0)return K;if(h>=A)return G}else{if(h<=-T)return M;if(h+1>=T)return H}return h<0?u(-h,d).neg():p(h%v|0,h/v|0,d)}r.fromNumber=u;function p(h,d,b){return new r(h,d,b)}r.fromBits=p;var y=Math.pow;function g(h,d,b){if(h.length===0)throw Error("empty string");if(typeof d=="number"?(b=d,d=!1):d=!!d,h==="NaN"||h==="Infinity"||h==="+Infinity"||h==="-Infinity")return d?K:q;if(b=b||10,b<2||36<b)throw RangeError("radix");var E;if((E=h.indexOf("-"))>0)throw Error("interior hyphen");if(E===0)return g(h.substring(1),d,b).neg();for(var B=u(y(b,8)),m=q,c=0;c<h.length;c+=8){var S=Math.min(8,h.length-c),R=parseInt(h.substring(c,c+S),b);if(S<8){var U=u(y(b,S));m=m.mul(U).add(u(R))}else m=m.mul(B),m=m.add(u(R))}return m.unsigned=d,m}r.fromString=g;function x(h,d){return typeof h=="number"?u(h,d):typeof h=="string"?g(h,d):p(h.low,h.high,typeof d=="boolean"?d:h.unsigned)}r.fromValue=x;var w=1<<16,_=1<<24,v=w*w,A=v*v,T=A/2,N=f(_),q=f(0);r.ZERO=q;var K=f(0,!0);r.UZERO=K;var L=f(1);r.ONE=L;var k=f(1,!0);r.UONE=k;var j=f(-1);r.NEG_ONE=j;var H=p(-1,2147483647,!1);r.MAX_VALUE=H;var G=p(-1,-1,!0);r.MAX_UNSIGNED_VALUE=G;var M=p(0,-2147483648,!1);r.MIN_VALUE=M;var s=r.prototype;s.toInt=function(){return this.unsigned?this.low>>>0:this.low},s.toNumber=function(){return this.unsigned?(this.high>>>0)*v+(this.low>>>0):this.high*v+(this.low>>>0)},s.toString=function(d){if(d=d||10,d<2||36<d)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(M)){var b=u(d),E=this.div(b),B=E.mul(b).sub(this);return E.toString(d)+B.toInt().toString(d)}else return"-"+this.neg().toString(d);for(var m=u(y(d,6),this.unsigned),c=this,S="";;){var R=c.div(m),U=c.sub(R.mul(m)).toInt()>>>0,C=U.toString(d);if(c=R,c.isZero())return C+S;for(;C.length<6;)C="0"+C;S=""+C+S}},s.getHighBits=function(){return this.high},s.getHighBitsUnsigned=function(){return this.high>>>0},s.getLowBits=function(){return this.low},s.getLowBitsUnsigned=function(){return this.low>>>0},s.getNumBitsAbs=function(){if(this.isNegative())return this.eq(M)?64:this.neg().getNumBitsAbs();for(var d=this.high!=0?this.high:this.low,b=31;b>0&&(d&1<<b)==0;b--);return this.high!=0?b+33:b+1},s.isZero=function(){return this.high===0&&this.low===0},s.eqz=s.isZero,s.isNegative=function(){return!this.unsigned&&this.high<0},s.isPositive=function(){return this.unsigned||this.high>=0},s.isOdd=function(){return(this.low&1)===1},s.isEven=function(){return(this.low&1)===0},s.equals=function(d){return n(d)||(d=x(d)),this.unsigned!==d.unsigned&&this.high>>>31===1&&d.high>>>31===1?!1:this.high===d.high&&this.low===d.low},s.eq=s.equals,s.notEquals=function(d){return!this.eq(d)},s.neq=s.notEquals,s.ne=s.notEquals,s.lessThan=function(d){return this.comp(d)<0},s.lt=s.lessThan,s.lessThanOrEqual=function(d){return this.comp(d)<=0},s.lte=s.lessThanOrEqual,s.le=s.lessThanOrEqual,s.greaterThan=function(d){return this.comp(d)>0},s.gt=s.greaterThan,s.greaterThanOrEqual=function(d){return this.comp(d)>=0},s.gte=s.greaterThanOrEqual,s.ge=s.greaterThanOrEqual,s.compare=function(d){if(n(d)||(d=x(d)),this.eq(d))return 0;var b=this.isNegative(),E=d.isNegative();return b&&!E?-1:!b&&E?1:this.unsigned?d.high>>>0>this.high>>>0||d.high===this.high&&d.low>>>0>this.low>>>0?-1:1:this.sub(d).isNegative()?-1:1},s.comp=s.compare,s.negate=function(){return!this.unsigned&&this.eq(M)?M:this.not().add(L)},s.neg=s.negate,s.add=function(d){n(d)||(d=x(d));var b=this.high>>>16,E=this.high&65535,B=this.low>>>16,m=this.low&65535,c=d.high>>>16,S=d.high&65535,R=d.low>>>16,U=d.low&65535,C=0,W=0,J=0,Q=0;return Q+=m+U,J+=Q>>>16,Q&=65535,J+=B+R,W+=J>>>16,J&=65535,W+=E+S,C+=W>>>16,W&=65535,C+=b+c,C&=65535,p(J<<16|Q,C<<16|W,this.unsigned)},s.subtract=function(d){return n(d)||(d=x(d)),this.add(d.neg())},s.sub=s.subtract,s.multiply=function(d){if(this.isZero())return this;if(n(d)||(d=x(d)),t){var b=t.mul(this.low,this.high,d.low,d.high);return p(b,t.get_high(),this.unsigned)}if(d.isZero())return this.unsigned?K:q;if(this.eq(M))return d.isOdd()?M:q;if(d.eq(M))return this.isOdd()?M:q;if(this.isNegative())return d.isNegative()?this.neg().mul(d.neg()):this.neg().mul(d).neg();if(d.isNegative())return this.mul(d.neg()).neg();if(this.lt(N)&&d.lt(N))return u(this.toNumber()*d.toNumber(),this.unsigned);var E=this.high>>>16,B=this.high&65535,m=this.low>>>16,c=this.low&65535,S=d.high>>>16,R=d.high&65535,U=d.low>>>16,C=d.low&65535,W=0,J=0,Q=0,Oe=0;return Oe+=c*C,Q+=Oe>>>16,Oe&=65535,Q+=m*C,J+=Q>>>16,Q&=65535,Q+=c*U,J+=Q>>>16,Q&=65535,J+=B*C,W+=J>>>16,J&=65535,J+=m*U,W+=J>>>16,J&=65535,J+=c*R,W+=J>>>16,J&=65535,W+=E*C+B*U+m*R+c*S,W&=65535,p(Q<<16|Oe,W<<16|J,this.unsigned)},s.mul=s.multiply,s.divide=function(d){if(n(d)||(d=x(d)),d.isZero())throw Error("division by zero");if(t){if(!this.unsigned&&this.high===-2147483648&&d.low===-1&&d.high===-1)return this;var b=(this.unsigned?t.div_u:t.div_s)(this.low,this.high,d.low,d.high);return p(b,t.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?K:q;var E,B,m;if(this.unsigned){if(d.unsigned||(d=d.toUnsigned()),d.gt(this))return K;if(d.gt(this.shru(1)))return k;m=K}else{if(this.eq(M)){if(d.eq(L)||d.eq(j))return M;if(d.eq(M))return L;var c=this.shr(1);return E=c.div(d).shl(1),E.eq(q)?d.isNegative()?L:j:(B=this.sub(d.mul(E)),m=E.add(B.div(d)),m)}else if(d.eq(M))return this.unsigned?K:q;if(this.isNegative())return d.isNegative()?this.neg().div(d.neg()):this.neg().div(d).neg();if(d.isNegative())return this.div(d.neg()).neg();m=q}for(B=this;B.gte(d);){E=Math.max(1,Math.floor(B.toNumber()/d.toNumber()));for(var S=Math.ceil(Math.log(E)/Math.LN2),R=S<=48?1:y(2,S-48),U=u(E),C=U.mul(d);C.isNegative()||C.gt(B);)E-=R,U=u(E,this.unsigned),C=U.mul(d);U.isZero()&&(U=L),m=m.add(U),B=B.sub(C)}return m},s.div=s.divide,s.modulo=function(d){if(n(d)||(d=x(d)),t){var b=(this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,d.low,d.high);return p(b,t.get_high(),this.unsigned)}return this.sub(this.div(d).mul(d))},s.mod=s.modulo,s.rem=s.modulo,s.not=function(){return p(~this.low,~this.high,this.unsigned)},s.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},s.clz=s.countLeadingZeros,s.countTrailingZeros=function(){return this.low?i(this.low):i(this.high)+32},s.ctz=s.countTrailingZeros,s.and=function(d){return n(d)||(d=x(d)),p(this.low&d.low,this.high&d.high,this.unsigned)},s.or=function(d){return n(d)||(d=x(d)),p(this.low|d.low,this.high|d.high,this.unsigned)},s.xor=function(d){return n(d)||(d=x(d)),p(this.low^d.low,this.high^d.high,this.unsigned)},s.shiftLeft=function(d){return n(d)&&(d=d.toInt()),(d&=63)===0?this:d<32?p(this.low<<d,this.high<<d|this.low>>>32-d,this.unsigned):p(0,this.low<<d-32,this.unsigned)},s.shl=s.shiftLeft,s.shiftRight=function(d){return n(d)&&(d=d.toInt()),(d&=63)===0?this:d<32?p(this.low>>>d|this.high<<32-d,this.high>>d,this.unsigned):p(this.high>>d-32,this.high>=0?0:-1,this.unsigned)},s.shr=s.shiftRight,s.shiftRightUnsigned=function(d){return n(d)&&(d=d.toInt()),(d&=63)===0?this:d<32?p(this.low>>>d|this.high<<32-d,this.high>>>d,this.unsigned):d===32?p(this.high,0,this.unsigned):p(this.high>>>d-32,0,this.unsigned)},s.shru=s.shiftRightUnsigned,s.shr_u=s.shiftRightUnsigned,s.rotateLeft=function(d){var b;return n(d)&&(d=d.toInt()),(d&=63)===0?this:d===32?p(this.high,this.low,this.unsigned):d<32?(b=32-d,p(this.low<<d|this.high>>>b,this.high<<d|this.low>>>b,this.unsigned)):(d-=32,b=32-d,p(this.high<<d|this.low>>>b,this.low<<d|this.high>>>b,this.unsigned))},s.rotl=s.rotateLeft,s.rotateRight=function(d){var b;return n(d)&&(d=d.toInt()),(d&=63)===0?this:d===32?p(this.high,this.low,this.unsigned):d<32?(b=32-d,p(this.high<<b|this.low>>>d,this.low<<b|this.high>>>d,this.unsigned)):(d-=32,b=32-d,p(this.low<<b|this.high>>>d,this.high<<b|this.low>>>d,this.unsigned))},s.rotr=s.rotateRight,s.toSigned=function(){return this.unsigned?p(this.low,this.high,!1):this},s.toUnsigned=function(){return this.unsigned?this:p(this.low,this.high,!0)},s.toBytes=function(d){return d?this.toBytesLE():this.toBytesBE()},s.toBytesLE=function(){var d=this.high,b=this.low;return[b&255,b>>>8&255,b>>>16&255,b>>>24,d&255,d>>>8&255,d>>>16&255,d>>>24]},s.toBytesBE=function(){var d=this.high,b=this.low;return[d>>>24,d>>>16&255,d>>>8&255,d&255,b>>>24,b>>>16&255,b>>>8&255,b&255]},r.fromBytes=function(d,b,E){return E?r.fromBytesLE(d,b):r.fromBytesBE(d,b)},r.fromBytesLE=function(d,b){return new r(d[0]|d[1]<<8|d[2]<<16|d[3]<<24,d[4]|d[5]<<8|d[6]<<16|d[7]<<24,b)},r.fromBytesBE=function(d,b){return new r(d[4]<<24|d[5]<<16|d[6]<<8|d[7],d[0]<<24|d[1]<<16|d[2]<<8|d[3],b)};var l=r;return e.default=l,"default"in e?e.default:e}({});typeof define=="function"&&define.amd?define([],function(){return R0}):typeof bf=="object"&&typeof U0=="object"&&(bf.exports=R0)});var Gr=D(re=>{"use strict";P();O();var C0=re&&re.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),O6=re&&re.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),br=re&&re.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&C0(t,e,r);return O6(t,e),t},z0=re&&re.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&C0(t,e,r)},lo=re&&re.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(re,"__esModule",{value:!0});re.secp256k1=re.ed25519=re.Long=re._m0=re.protobuf=re.typeforce=re.safeBuffer=re.BigNumber=re.BN=re.math=re.signUtil=re.abi=re.elliptic=re.bip39=re.bip32=re.base=void 0;re.base=br(mn());re.bip32=br($d());re.bip39=br(La());re.elliptic=br(li());re.abi=br(vu());re.signUtil=br(N0());re.math=br(j0());var T6=lo(mt());re.BN=T6.default;var q6=lo(bl());re.BigNumber=q6.default;var k6=lo(al());re.safeBuffer=k6.default;var N6=zf();re.typeforce=N6;re.protobuf=br(gl());re._m0=br(yl());var L6=lo(D0());re.Long=L6.default;re.ed25519=br(vl());re.secp256k1=br(ml());z0((xl(),Df(wl)),re);z0((Sl(),Df(_l)),re)});var gf=D(Nn=>{"use strict";P();O();Object.defineProperty(Nn,"__esModule",{value:!0});Nn.PublicKey=Nn.KeyType=void 0;var H6=Uo(),pf=Do(),K6=Gr(),wi;(function(e){e[e.ED25519=0]="ED25519"})(wi=Nn.KeyType||(Nn.KeyType={}));function j6(e){switch(e){case wi.ED25519:return"ed25519";default:throw new Error(`Unknown key type ${e}`)}}function R6(e){switch(e.toLowerCase()){case"ed25519":return wi.ED25519;default:throw new Error(`Unknown key type ${e}`)}}var ln=class extends H6.Assignable{static fromRaw(t){return new ln({keyType:wi.ED25519,data:t})}static from(t){return typeof t=="string"?ln.fromString(t):t}static fromString(t){let r=t.split(":");if(r.length===1)return new ln({keyType:wi.ED25519,data:(0,pf.base_decode)(r[0])});if(r.length===2)return new ln({keyType:R6(r[0]),data:(0,pf.base_decode)(r[1])});throw new Error("Invalid encoded key format, must be <curve>:<encoded key>")}toString(){return`${j6(this.keyType)}:${(0,pf.base_encode)(this.data)}`}verify(t,r){switch(this.keyType){case wi.ED25519:return K6.signUtil.ed25519.verify(t,r,this.data);default:throw new Error(`Unknown key type ${this.keyType}`)}}};Nn.PublicKey=ln});var yf=D(os=>{"use strict";P();O();Object.defineProperty(os,"__esModule",{value:!0});os.SignType=void 0;var U6;(function(e){e[e.Secp256k1=1]="Secp256k1",e[e.ECDSA_P256=2]="ECDSA_P256",e[e.ED25519=3]="ED25519",e[e.StarknetSignType=4]="StarknetSignType",e[e.TezosSignType=5]="TezosSignType"})(U6=os.SignType||(os.SignType={}))});var F0=D(ir=>{"use strict";P();O();Object.defineProperty(ir,"__esModule",{value:!0});ir.CoinCurveMap=ir.MultiAddressCoins=ir.segwitType=ir.Currency=void 0;var oe;(function(e){e[e.NULL=-1]="NULL",e[e.BTC=0]="BTC",e[e.TBTC=1]="TBTC",e[e.ETH=60]="ETH",e[e.LTC=2]="LTC",e[e.DOGE=3]="DOGE",e[e.BCH=145]="BCH",e[e.BSV=236]="BSV",e[e.TRX=195]="TRX",e[e.SOL=501]="SOL",e[e.APTOS=637]="APTOS",e[e.OMNI_USDT=20001]="OMNI_USDT",e[e.OMNI_USDT_TEST=20002]="OMNI_USDT_TEST",e[e.SUI=784]="SUI",e[e.ATOM=118]="ATOM",e[e.OSMO=1e3]="OSMO",e[e.EVMOS=1001]="EVMOS",e[e.AXL=1002]="AXL",e[e.CRO=1003]="CRO",e[e.Iris=1004]="Iris",e[e.Juno=1005]="Juno",e[e.Kava=1006]="Kava",e[e.Kujira=1007]="Kujira",e[e.SCRT=1008]="SCRT",e[e.Stargaze=1009]="Stargaze",e[e.Terra=1010]="Terra",e[e.ZKSPACE=1011]="ZKSPACE",e[e.ZKSYNC=804]="ZKSYNC",e[e.Stx=5757]="Stx",e[e.SEI=2837]="SEI",e[e.WAX=14001]="WAX",e[e.Starknet=9004]="Starknet",e[e.ADA=1815]="ADA",e[e.INJ=2892]="INJ",e[e.Celestia=2854]="Celestia",e[e.DYDX=2897]="DYDX",e[e.Kaspa=111111]="Kaspa",e[e.TON=607]="TON",e[e.NostrAssets=1237]="NostrAssets",e[e.Near=397]="Near"})(oe=ir.Currency||(ir.Currency={}));var D6;(function(e){e[e.SEGWIT_NESTED=1]="SEGWIT_NESTED",e[e.SEGWIT_NESTED_49=2]="SEGWIT_NESTED_49",e[e.SEGWIT_NATIVE=3]="SEGWIT_NATIVE",e[e.SEGWIT_TAPROOT=4]="SEGWIT_TAPROOT"})(D6=ir.segwitType||(ir.segwitType={}));ir.MultiAddressCoins=[oe.BTC,oe.TBTC,oe.LTC,oe.DOGE,oe.BSV,oe.OMNI_USDT,oe.OMNI_USDT_TEST];var Me="secp256k1",ho="ed25519";ir.CoinCurveMap=new Map([[oe.BTC,Me],[oe.TBTC,Me],[oe.ETH,Me],[oe.LTC,Me],[oe.DOGE,Me],[oe.BCH,Me],[oe.BSV,Me],[oe.TRX,Me],[oe.OMNI_USDT,Me],[oe.OMNI_USDT_TEST,Me],[oe.ATOM,Me],[oe.OSMO,Me],[oe.EVMOS,Me],[oe.AXL,Me],[oe.CRO,Me],[oe.Iris,Me],[oe.Juno,Me],[oe.Kava,Me],[oe.Kujira,Me],[oe.SCRT,Me],[oe.Stargaze,Me],[oe.Terra,Me],[oe.SEI,Me],[oe.Celestia,Me],[oe.DYDX,Me],[oe.SOL,ho],[oe.APTOS,ho],[oe.SUI,ho],[oe.TON,ho]])});var vf=D($=>{"use strict";P();O();Object.defineProperty($,"__esModule",{value:!0});$.SignCommonMsgError=$.EstimateFeeError=$.validSignedTransactionError=$.GetPayLoadError=$.HardwareDerivePubKeyError=$.CalcTxHashError=$.SignMsgStep3Error=$.SignMsgSetupError=$.Ed25519Step3Error=$.Ed25519Step2Error=$.Ed25519Step1Error=$.Ed25519SetupError=$.EcdsaStep3Error=$.EcdsaStep2Error=$.EcdsaStep1Error=$.EcdsaSetupError=$.MPCShakeHandsError=$.MPCStepError=$.MPCAesKeyMissError=$.GetHardWareMessageHashError=$.GetHardwareSignedTransactionError=$.GetHardwareRawTransactionError=$.GetMpcTransactionError=$.GetMpcRawTransactionError=$.DerivePathError=$.GenMnemonicError=$.GenPrivateKeyError=$.UnsupportedCoinError=$.SignMsgError=$.SignTxError=$.ValidAddressError=$.NewAddressError=$.NotImplementedError=void 0;$.NotImplementedError="no implementation method";$.NewAddressError="generate address error";$.ValidAddressError="valid address error";$.SignTxError="sign tx error";$.SignMsgError="sign message error";$.UnsupportedCoinError="unsupported currency";$.GenPrivateKeyError="generate private key error";$.GenMnemonicError="generate mnemonic error";$.DerivePathError="derive hdPath error";$.GetMpcRawTransactionError="get mpc raw transaction error";$.GetMpcTransactionError="get mpc transaction error";$.GetHardwareRawTransactionError="get hardware raw transaction error";$.GetHardwareSignedTransactionError="get hardware signed transaction error";$.GetHardWareMessageHashError="get hardware message hash error";$.MPCAesKeyMissError="mpc get aes key error";$.MPCStepError="mpc step error";$.MPCShakeHandsError="mpc shake hands error";$.EcdsaSetupError="ecdsa setup error";$.EcdsaStep1Error="ecdsa step1 error";$.EcdsaStep2Error="ecdsa step2 error";$.EcdsaStep3Error="ecdsa step3 error";$.Ed25519SetupError="ed25519 setup error";$.Ed25519Step1Error="ed25519 step1 error";$.Ed25519Step2Error="ed25519 step2 error";$.Ed25519Step3Error="ed25519 step3 error";$.SignMsgSetupError="sign message setup error";$.SignMsgStep3Error="sign message step3 error";$.CalcTxHashError="calculate tx hash error";$.HardwareDerivePubKeyError="derive sub pub key error";$.GetPayLoadError="get payload error";$.validSignedTransactionError="valid signed transaction error";$.EstimateFeeError="estimate fee error";$.SignCommonMsgError="sign common msg error"});var $0=D(Ft=>{"use strict";P();O();Object.defineProperty(Ft,"__esModule",{value:!0});Ft.jsonStringifyUniform=Ft.cloneObject=Ft.assertBufferLength=Ft.convert2BigNumber=Ft.convert2Number=Ft.buildCommonSignMsg=void 0;var bo=Gr();function C6(e,t){return`OKX Wallet Sign In
|
||
|
||
publicKey: ${e}
|
||
walletId: ${t}
|
||
host: api.wallet.okx
|
||
OKX Wallet Sign In`}Ft.buildCommonSignMsg=C6;function z6(e){if(e!=null)return typeof e=="string"?parseInt(e):e}Ft.convert2Number=z6;function F6(e){if(e!=null)return bo.BigNumber.isBigNumber(e)?e:new bo.BigNumber(e)}Ft.convert2BigNumber=F6;function $6(e,t){if(e.length!=t)throw Error("buffer length is illegal")}Ft.assertBufferLength=$6;function V6(e){return JSON.parse(JSON.stringify(e))}Ft.cloneObject=V6;function W6(e){return JSON.stringify(e,(t,r)=>r&&(r.type==="Buffer"||r instanceof Uint8Array?bo.base.toHex(r):typeof r=="bigint"?r.toString():r))}Ft.jsonStringifyUniform=W6});var mf=D(Ln=>{"use strict";P();O();var Z6=Ln&&Ln.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),G6=Ln&&Ln.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Z6(t,e,r)};Object.defineProperty(Ln,"__esModule",{value:!0});G6($0(),Ln)});var X0=D(Be=>{"use strict";P();O();Object.defineProperty(Be,"__esModule",{value:!0});Be.SimpleWallet=Be.BaseWallet=Be.ecdsaSign=Be.fromSigned=Be.padWithZeroes=Be.toUnsigned=Be.intToHex=Be.makeSignature=Be.secp256k1SignTest=void 0;var gt=vf(),xi=yf(),yt=Gr(),X6=mf();function V0(e){let t=yt.base.sha256("secp256k1-test"),r=yt.signUtil.secp256k1.publicKeyCreate(e,!1),{signature:n,recovery:i}=yt.signUtil.secp256k1.sign(I.Buffer.from(t),e);return yt.signUtil.secp256k1.verify(t,n,i,r)}Be.secp256k1SignTest=V0;function W0(e,t,r){let n=(0,Be.fromSigned)(t),i=(0,Be.fromSigned)(r),o=e,a=wf((0,Be.toUnsigned)(n).toString("hex"),64),f=wf((0,Be.toUnsigned)(i).toString("hex"),64);return yt.base.stripHexPrefix(Z0(o)).concat(a,f)}Be.makeSignature=W0;function Z0(e){return`0x${e.toString(16)}`}Be.intToHex=Z0;var Y6=function(e){return I.Buffer.from(e.toTwos(256).toArray())};Be.toUnsigned=Y6;function wf(e,t){if(e!==""&&!/^[a-f0-9]+$/iu.test(e))throw new Error(`Expected an unprefixed hex string. Received: ${e}`);if(t<0)throw new Error(`Expected a non-negative integer target length. Received: ${t}`);return String.prototype.padStart.call(e,t,"0")}Be.padWithZeroes=wf;var J6=function(e){return new yt.BN(e).fromTwos(256)};Be.fromSigned=J6;function G0(e,t,r){let{signature:n,recovery:i}=yt.signUtil.secp256k1.sign(e,t),o=I.Buffer.from(n.slice(0,32)),a=I.Buffer.from(n.slice(32,64));if(r&&!Number.isSafeInteger(r))throw new Error("The provided number is greater than MAX_SAFE_INTEGER (please use an alternative input type)");return{v:r?i+(r*2+35):i+27,r:o,s:a}}Be.ecdsaSign=G0;var po=class{getRandomPrivateKey(){try{for(;;){let t=yt.base.randomBytes(32);if(V0(t))return Promise.resolve(yt.base.toHex(t,!0))}}catch{}return Promise.reject(gt.GenPrivateKeyError)}getDerivedPrivateKey(t){return yt.bip39.mnemonicToSeed(t.mnemonic).then(r=>{let n=yt.bip32.fromSeed(r).derivePath(t.hdPath);if(n.privateKey){let i=yt.base.toHex(n.privateKey);return Promise.resolve("0x"+i)}else return Promise.reject(gt.GenPrivateKeyError)}).catch(r=>Promise.reject(gt.GenPrivateKeyError))}getDerivedPath(t){return Promise.reject(gt.NotImplementedError)}validPrivateKey(t){return Promise.reject(gt.NotImplementedError)}signMessage(t){return Promise.reject(gt.NotImplementedError)}async signCommonMsg(t){t.signType||(t.signType=xi.SignType.Secp256k1);let r;if(t.message.text)r=t.message.text;else{let f;if(t.publicKey?f=t.publicKey:f=(await this.getNewAddress({privateKey:t.privateKey,addressType:t.addressType,hrp:t.hrp,version:t.version})).publicKey,f.startsWith("0x")&&(f=f.substring(2)),!t.message.walletId)return Promise.reject("invalid walletId");r=(0,X6.buildCommonSignMsg)(f,t.message.walletId)}let n=yt.base.magicHash(r),i=t.privateKeyHex?t.privateKeyHex:t.privateKey,o=yt.base.fromHex(i);var a;switch(t.signType){case xi.SignType.Secp256k1:let{v:f,r:u,s:p}=G0(I.Buffer.from(n),o);return Promise.resolve(W0(f,u,p));case xi.SignType.ECDSA_P256:return a=yt.signUtil.p256.sign(I.Buffer.from(n),o).signature,Promise.resolve(yt.base.toHex(a));case xi.SignType.ED25519:return a=yt.signUtil.ed25519.sign(n,o),Promise.resolve(yt.base.toHex(a));case xi.SignType.StarknetSignType:return a=yt.signUtil.schnorr.stark.sign(n,o).toCompactRawBytes(),Promise.resolve(yt.base.toHex(a));case xi.SignType.TezosSignType:return Promise.reject("not support")}}verifyMessage(t){return Promise.reject(gt.NotImplementedError)}ecRecover(t,r){return Promise.reject(gt.NotImplementedError)}getAddressByPublicKey(t){return Promise.reject(gt.NotImplementedError)}getMPCRawTransaction(t){return Promise.reject(gt.NotImplementedError)}getMPCTransaction(t){return Promise.reject(gt.NotImplementedError)}getMPCRawMessage(t){return Promise.reject(gt.NotImplementedError)}getMPCSignedMessage(t){return Promise.reject(gt.NotImplementedError)}getHardWareRawTransaction(t){return Promise.reject(gt.NotImplementedError)}getHardWareSignedTransaction(t){return Promise.reject(gt.NotImplementedError)}getHardWareMessageHash(t){return Promise.reject(gt.NotImplementedError)}calcTxHash(t){return Promise.reject(gt.NotImplementedError)}getRawTransaction(t){return Promise.reject(gt.NotImplementedError)}validSignedTransaction(t){return Promise.reject(gt.NotImplementedError)}estimateFee(t){return Promise.reject(gt.NotImplementedError)}};Be.BaseWallet=po;var xf=class extends po{mockData(t,r){this.mockAddress=t,this.mockPublicKey=r}getNewAddress(t){return Promise.resolve({address:this.mockAddress,publicKey:this.mockPublicKey})}validAddress(t){throw new Error("Method not implemented.")}signTransaction(t){throw new Error("Method not implemented.")}};Be.SimpleWallet=xf});var _f=D(pr=>{"use strict";P();O();var Q6=pr&&pr.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),as=pr&&pr.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&Q6(t,e,r)};Object.defineProperty(pr,"__esModule",{value:!0});as(yf(),pr);as(F0(),pr);as(vf(),pr);as(X0(),pr);as(mf(),pr)});var Ef=D(go=>{"use strict";P();O();Object.defineProperty(go,"__esModule",{value:!0});go.MessagePayload=void 0;var Sf=class{constructor(t){this.tag=2147484061,this.message=t.message,this.nonce=t.nonce,this.recipient=t.recipient,t.callbackUrl&&(this.callbackUrl=t.callbackUrl)}};go.MessagePayload=Sf});var el=D(F=>{"use strict";P();O();Object.defineProperty(F,"__esModule",{value:!0});F.functionCallAccessKey=F.fullAccessKey=F.signTransaction=F.createTransaction=F.SCHEMA=F.SignedTransaction=F.Signature=F.Action=F.Transaction=F.deleteAccount=F.deleteKey=F.addKey=F.stake=F.transfer=F.functionCall=F.stringifyJsonOrBytes=F.deployContract=F.createAccount=F.DeleteAccount=F.DeleteKey=F.AddKey=F.Stake=F.Transfer=F.FunctionCall=F.DeployContract=F.CreateAccount=F.IAction=F.AccessKey=F.AccessKeyPermission=F.FullAccessPermission=F.FunctionCallPermission=void 0;var Hn=gf(),jr=Uo(),fs=Ko(),Kn=Gr(),e5=Do(),t5=Ef(),_i=class extends jr.Assignable{};F.FunctionCallPermission=_i;var Si=class extends jr.Assignable{};F.FullAccessPermission=Si;var jn=class extends jr.Enum{};F.AccessKeyPermission=jn;var Rn=class extends jr.Assignable{};F.AccessKey=Rn;var gr=class extends jr.Assignable{};F.IAction=gr;var Ei=class extends gr{};F.CreateAccount=Ei;var Mi=class extends gr{};F.DeployContract=Mi;var Un=class extends gr{};F.FunctionCall=Un;var Ai=class extends gr{};F.Transfer=Ai;var Bi=class extends gr{};F.Stake=Bi;var Ii=class extends gr{};F.AddKey=Ii;var Pi=class extends gr{};F.DeleteKey=Pi;var Oi=class extends gr{};F.DeleteAccount=Oi;function r5(){return new $t({createAccount:new Ei({})})}F.createAccount=r5;function n5(e){return new $t({deployContract:new Mi({code:e})})}F.deployContract=n5;function J0(e){return e.byteLength!==void 0&&e.byteLength===e.length?e:I.Buffer.from(JSON.stringify(e))}F.stringifyJsonOrBytes=J0;function i5(e,t,r=new Kn.BN(0),n=new Kn.BN(0),i=J0,o=!1){return o?new $t({functionCall:new Un({methodName:e,args:t,gas:r,deposit:n})}):new $t({functionCall:new Un({methodName:e,args:i(t),gas:r,deposit:n})})}F.functionCall=i5;function s5(e){return new $t({transfer:new Ai({deposit:e})})}F.transfer=s5;function o5(e,t){return new $t({stake:new Bi({stake:e,publicKey:t})})}F.stake=o5;function a5(e,t){return new $t({addKey:new Ii({publicKey:e,accessKey:t})})}F.addKey=a5;function f5(e){return new $t({deleteKey:new Pi({publicKey:e})})}F.deleteKey=f5;function c5(e){return new $t({deleteAccount:new Oi({beneficiaryId:e})})}F.deleteAccount=c5;var Kr=class extends jr.Assignable{encode(){return(0,fs.serialize)(F.SCHEMA,this)}static decode(t){return(0,fs.deserialize)(F.SCHEMA,Kr,t)}};F.Transaction=Kr;var $t=class extends jr.Enum{};F.Action=$t;var Ti=class extends jr.Assignable{};F.Signature=Ti;var Dn=class extends jr.Assignable{encode(){return(0,fs.serialize)(F.SCHEMA,this)}static decode(t){return(0,fs.deserialize)(F.SCHEMA,Dn,t)}};F.SignedTransaction=Dn;F.SCHEMA=new Map([[t5.MessagePayload,{kind:"struct",fields:[["tag","u32"],["message","string"],["nonce",[32]],["recipient","string"],["callbackUrl",{kind:"option",type:"string"}]]}],[Ti,{kind:"struct",fields:[["keyType","u8"],["data",[64]]]}],[Dn,{kind:"struct",fields:[["transaction",Kr],["signature",Ti]]}],[Kr,{kind:"struct",fields:[["signerId","string"],["publicKey",Hn.PublicKey],["nonce","u64"],["receiverId","string"],["blockHash",[32]],["actions",[$t]]]}],[Hn.PublicKey,{kind:"struct",fields:[["keyType","u8"],["data",[32]]]}],[Rn,{kind:"struct",fields:[["nonce","u64"],["permission",jn]]}],[jn,{kind:"enum",field:"enum",values:[["functionCall",_i],["fullAccess",Si]]}],[_i,{kind:"struct",fields:[["allowance",{kind:"option",type:"u128"}],["receiverId","string"],["methodNames",["string"]]]}],[Si,{kind:"struct",fields:[]}],[$t,{kind:"enum",field:"enum",values:[["createAccount",Ei],["deployContract",Mi],["functionCall",Un],["transfer",Ai],["stake",Bi],["addKey",Ii],["deleteKey",Pi],["deleteAccount",Oi]]}],[Ei,{kind:"struct",fields:[]}],[Mi,{kind:"struct",fields:[["code",["u8"]]]}],[Un,{kind:"struct",fields:[["methodName","string"],["args",["u8"]],["gas","u64"],["deposit","u128"]]}],[Ai,{kind:"struct",fields:[["deposit","u128"]]}],[Bi,{kind:"struct",fields:[["stake","u128"],["publicKey",Hn.PublicKey]]}],[Ii,{kind:"struct",fields:[["publicKey",Hn.PublicKey],["accessKey",Rn]]}],[Pi,{kind:"struct",fields:[["publicKey",Hn.PublicKey]]}],[Oi,{kind:"struct",fields:[["beneficiaryId","string"]]}]]);function Q0(e,t,r,n,i,o){return new Kr({signerId:e,publicKey:t,nonce:n,receiverId:r,actions:i,blockHash:o})}F.createTransaction=Q0;async function Y0(e,t){let r=(0,fs.serialize)(F.SCHEMA,e),n=Kn.base.sha256(r),i=Kn.base.fromHex(t),o=Kn.signUtil.ed25519.sign(n,i),a=new Dn({transaction:e,signature:new Ti({keyType:Hn.KeyType.ED25519,data:o})});return[n,a]}async function d5(...e){if(e[0].constructor===Kr){let[t,r]=e;return Y0(t,r)}else{let[t,r,n,i,o,a]=e,f=Kn.signUtil.ed25519.publicKeyCreate(Kn.base.fromHex(o)),u=Hn.PublicKey.from((0,e5.base_encode)(f)),p=Q0(a,u,t,r,n,i);return Y0(p,o)}}F.signTransaction=d5;function u5(){return new Rn({nonce:0,permission:new jn({fullAccess:new Si({})})})}F.fullAccessKey=u5;function l5(e,t,r){return new Rn({nonce:0,permission:new jn({functionCall:new _i({receiverId:e,allowance:r,methodNames:t})})})}F.functionCallAccessKey=l5});var tl=D(zn=>{"use strict";P();O();Object.defineProperty(zn,"__esModule",{value:!0});zn.NearWallet=zn.NearTypes=void 0;var Bt=_f(),Y=Gr(),be=rl(),h5=Ef(),b5=Ko(),Cn;(function(e){e[e.TransferNear=0]="TransferNear",e[e.TransferToken=1]="TransferToken",e[e.DAppTx=2]="DAppTx",e[e.DAppTxs=3]="DAppTxs",e[e.AddKey=4]="AddKey",e[e.DelKey=5]="DelKey"})(Cn=zn.NearTypes||(zn.NearTypes={}));var Mf=class extends Bt.BaseWallet{async getDerivedPath(t){return`m/44'/397'/${t.index}'`}async getRandomPrivateKey(){try{let t=Y.signUtil.ed25519.ed25519_getRandomPrivateKey(!1,"hex"),r=Y.base.toHex(Y.signUtil.ed25519.publicKeyCreate(Y.base.fromHex(t)),!1);return Promise.resolve("ed25519:"+Y.base.toBase58(Y.base.fromHex(t+r)))}catch{return Promise.reject(Bt.GenPrivateKeyError)}}async getDerivedPrivateKey(t){try{let r=await Y.signUtil.ed25519.ed25519_getDerivedPrivateKey(t.mnemonic,t.hdPath,!1,"hex"),n=Y.base.toHex(Y.signUtil.ed25519.publicKeyCreate(Y.base.fromHex(r)));return Promise.resolve("ed25519:"+Y.base.toBase58(Y.base.fromHex(r+n)))}catch{return Promise.reject(Bt.GenPrivateKeyError)}}async getNewAddress(t){try{if(!t.privateKey)throw Bt.NewAddressError;if(t.privateKey.startsWith("0x")||t.privateKey.startsWith("0X")){let a=t.privateKey.substring(2);if(Y.base.isHexString("0x"+a))return Promise.resolve({address:(0,be.getAddress)(t.privateKey),publicKey:(0,be.getPubkey)(t.privateKey)})}if(!t.privateKey.startsWith("0x")&&!t.privateKey.startsWith("0X")&&Y.base.isHexString("0x"+t.privateKey))return Promise.resolve({address:(0,be.getAddress)(t.privateKey),publicKey:(0,be.getPubkey)(t.privateKey)});let r=t.privateKey.split(":");if(r.length!=2||r[0]!="ed25519")throw Bt.NewAddressError;let n=Y.base.fromBase58(r[1]),i=Y.base.toHex(n.slice(0,32)),o=(0,be.getAddress)(i);return Promise.resolve({address:o,publicKey:(0,be.getPubkey)(i)})}catch{return Promise.reject(Bt.NewAddressError)}}async validPrivateKey(t){let r=t.privateKey.startsWith("0x")?t.privateKey:"0x"+t.privateKey,n;if(Y.base.isHexString(r))try{n=(0,be.checkPrivateKey)(t.privateKey)}catch{n=!1}else{let o=t.privateKey.split(":");if(o.length!=2||o[0]!="ed25519")n=!1;else{let a=Y.base.fromBase58(o[1]),f=Y.base.toHex(a.slice(0,32));try{n=(0,be.checkPrivateKey)(f)}catch{n=!1}}}let i={isValid:n,privateKey:t.privateKey};return Promise.resolve(i)}getBase58Address(t){let r=t.split(":");if(r.length!=2||r[0]!="ed25519")throw Bt.NewAddressError;let n=Y.base.fromBase58(r[1]),i=Y.base.toHex(n.slice(0,32));return(0,be.getAddress)(i)}getPrvFromBase58(t){let r=t.split(":");if(r.length!=2||r[0]!="ed25519")throw Bt.NewAddressError;let n=Y.base.fromBase58(r[1]);return Y.base.toHex(n)}getBase58Pubkey(t){let r=t.split(":");if(r.length!=2||r[0]!="ed25519")throw Bt.NewAddressError;let n=Y.base.fromBase58(r[1]),i=Y.base.toHex(n.slice(0,32));return(0,be.publicKeyFromSeed)(i)}async signCommonMsg(t){let r=t.privateKey.startsWith("0x")||t.privateKey.startsWith("0X")?t.privateKey.substring(2):t.privateKey;if(!t.privateKey.startsWith("0x")&&!t.privateKey.startsWith("0X")&&!Y.base.isHexString("0x"+t.privateKey)){let n=t.privateKey.split(":");if(n.length!=2||n[0]!="ed25519")throw Error("invalid privateKey");let i=Y.base.fromBase58(n[1]);r=Y.base.toHex(i.slice(0,32))}return super.signCommonMsg({privateKey:t.privateKey,privateKeyHex:r,message:t.message,signType:Bt.SignType.ED25519})}async signMessage(t){try{let r=t.data,{message:n,nonce:i,recipient:o,callbackUrl:a,state:f}=r,u=I.Buffer.from(i);if(u.length!==32)throw Error("Expected nonce to be a 32 bytes buffer");let p=new h5.MessagePayload({message:n,nonce:u,recipient:o,callbackUrl:a}),y=(0,b5.serialize)(be.SCHEMA,p),g=Y.base.sha256(y),x=this.getPrvFromBase58(t.privateKey),w=Y.base.fromHex(x),_=Y.signUtil.ed25519.sign(g,w);return Promise.resolve(I.Buffer.from(_).toString("base64"))}catch{return Promise.reject(Bt.SignMsgError)}}async signTransaction(t){try{let r=t.data.type||0,n=this.getBase58Address(t.privateKey),i=this.getBase58Pubkey(t.privateKey),o=this.getPrvFromBase58(t.privateKey);if(r===Cn.TransferNear){let a=t.data,f=(0,be.createTransaction)(a.from==null||null||a.from==""?n:a.from,i,a.receiverId,a.nonce,[],Y.base.fromBase58(a.blockHash));f.actions.push((0,be.transfer)(new Y.BN(a.amount)));let[u,p]=await(0,be.signTransaction)(f,o);return Promise.resolve(Y.base.toBase64(p.encode()))}else if(r===Cn.AddKey){let a=t.data;if(a.publicKey==null||null||a.accessKey==null)return Promise.reject(Bt.SignTxError);let f=(0,be.createTransaction)(a.from==null||null||a.from==""?n:a.from,i,a.receiverId,a.nonce,[],Y.base.fromBase58(a.blockHash));f.actions.push((0,be.addKey)((0,be.publicKeyFromBase58)(a.publicKey),a.accessKey));let[u,p]=await(0,be.signTransaction)(f,o);return Promise.resolve(Y.base.toBase64(p.encode()))}else if(r===Cn.DelKey){let a=t.data;if(a.publicKey==null)return Promise.reject(Bt.SignTxError);let f=(0,be.createTransaction)(a.from==null||null||a.from==""?n:a.from,i,a.receiverId,a.nonce,[],Y.base.fromBase58(a.blockHash));f.actions.push((0,be.deleteKey)((0,be.publicKeyFromBase58)(a.publicKey)));let[u,p]=await(0,be.signTransaction)(f,o);return Promise.resolve(Y.base.toBase64(p.encode()))}else if(r===Cn.TransferToken){let a=t.data,f=(0,be.createTransaction)(a.from==null||null||a.from==""?n:a.from,i,a.contract,a.nonce,[],Y.base.fromBase58(a.blockHash));if(a.shouldDeposit){let x={account_id:a.receiverId},w=(0,be.functionCall)("storage_deposit",x,new Y.BN(a.depositGas),new Y.BN(a.depositValue));f.actions.push(w)}let u={amount:a.amount,receiver_id:a.receiverId},p=(0,be.functionCall)("ft_transfer",u,new Y.BN(a.transferGas),new Y.BN(a.minTransferTokenValue));f.actions.push(p);let[y,g]=await(0,be.signTransaction)(f,o);return Promise.resolve(Y.base.toBase64(g.encode()))}else if(r===Cn.DAppTx){let a=t.data;if(a.actions==null||a.actions==null||a.actions.length==0)return Promise.reject(Bt.SignTxError);let f=a.actions.map(y=>(0,be.functionCall)(y.methodName,y.args,new Y.BN(y.gas),new Y.BN(y.deposit))),[u,p]=await(0,be.signTransaction)(a.receiverId,a.nonce,f,Y.base.fromBase58(a.blockHash),o,a.from==null||null||a.from==""?n:a.from);return Promise.resolve(Y.base.toBase64(p.encode()))}else if(r===Cn.DAppTxs){let a=t.data;if(a.transactions==null||a.transactions==null||a.transactions.length==0)return Promise.reject(Bt.SignTxError);let f=[];for(let u=0;u<a.transactions.length;u++){let p=a.transactions[u],y=p.actions.map(w=>(0,be.functionCall)(w.methodName,w.args,new Y.BN(w.gas),new Y.BN(w.deposit))),[g,x]=await(0,be.signTransaction)(p.receiverId,new Y.BN(a.nonce).add(new Y.BN(u)).toNumber(),y,Y.base.fromBase58(a.blockHash),o,a.from==null||null||a.from==""?n:a.from);f.push(Y.base.toBase64(x.encode()))}return Promise.resolve(f)}else return Promise.reject(Bt.SignTxError)}catch{return Promise.reject(Bt.SignTxError)}}async validAddress(t){let r=!1;try{r=(0,be.validateAddress)(t.address)}catch{}let n={isValid:r,address:t.address};return Promise.resolve(n)}async calcTxHash(t){try{let r=be.SignedTransaction.decode(I.Buffer.from(Y.base.fromBase64(t.data))),n=Y.base.toBase58(Y.base.sha256(r.transaction.encode()));return Promise.resolve(n)}catch{throw Bt.CalcTxHashError}}};zn.NearWallet=Mf});var rl=D(Le=>{P();O();var p5=Le&&Le.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),nl=Le&&Le.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&p5(t,e,r)};Object.defineProperty(Le,"__esModule",{value:!0});Le.publicKeyFromBase58=Le.publicKeyFromSeed=Le.checkName=Le.validateAddress=Le.getPubkey=Le.checkPrivateKey=Le.getAddress=void 0;var il=gf(),sr=Gr(),g5=_f();nl(el(),Le);nl(tl(),Le);function y5(e){if(!Af(e))throw new Error("invalid key");let r=e;(e.startsWith("0x")||e.startsWith("0X"))&&(r=e.substring(2));let n=sr.signUtil.ed25519.publicKeyCreate(sr.base.fromHex(r));return sr.base.toHex(n)}Le.getAddress=y5;function Af(e){if(!e)throw new Error("invalid key");let t="";if(e.startsWith("0x")||e.startsWith("0X")){if(t=e.substring(2),!sr.base.isHexString("0x"+t))throw new Error("invalid key");if(e.length!=130&&e.length!=66)throw new Error("invalid key")}else{if(!sr.base.isHexString("0x"+e))throw new Error("invalid key");if(e.length!=128&&e.length!=64)throw new Error("invalid key");t=e}let r=sr.base.fromHex(t);if(r.length!=64&&r.length!=32||r.every(n=>n===0))throw new Error("invalid key");return!0}Le.checkPrivateKey=Af;function v5(e){Af(e);let t=sr.signUtil.ed25519.publicKeyCreate(sr.base.fromHex(e));return"ed25519:"+sr.base.toBase58(t)}Le.getPubkey=v5;function m5(e){return e.length>=2&&e.length<=64&&sl(e)}Le.validateAddress=m5;function sl(e){return new RegExp("^(([a-z\\d]+[\\-_])*[a-z\\d]+\\.)*([a-z\\d]+[\\-_])*[a-z\\d]+$").test(e)}Le.checkName=sl;function w5(e){let t=sr.signUtil.ed25519.publicKeyCreate(sr.base.fromHex(e));return il.PublicKey.fromRaw(t)}Le.publicKeyFromSeed=w5;function x5(e){let t=e.split(":");if(t.length!=2||t[0]!="ed25519")throw g5.SignTxError;return il.PublicKey.fromRaw(sr.base.fromBase58(t[1]))}Le.publicKeyFromBase58=x5});export{rl as a};
|
||
|
||
window.inOKXExtension = true;
|
||
window.inMiniApp = false;
|
||
window.ASSETS_BUILD_TYPE = "publish";
|
||
|
||
//# sourceMappingURL=chunk-LPNMZBGS.js.map
|