Files
to_session/text/3.65.22_0/scripts/ui/chunk-I7TWOSV5.js
Administrator a0720d80dc fefdwef
2025-11-12 12:54:37 +08:00

20 lines
405 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{a as u1,b as d1,c as b1,d as p1,e as g1,f as y1}from"./chunk-YUSIJWOC.js";import{a as c1}from"./chunk-YHVKZE66.js";import{k as l1}from"./chunk-2DSLTDTL.js";import{a as h1}from"./chunk-UVIVAH5I.js";import{a as Uu,b as f1}from"./chunk-ALIHWT7Z.js";import{a as t1,b as n1,e as i1,g as s1,h as o1,k as Du,l as a1}from"./chunk-IAFVNOEB.js";import{a as pc,q as r1}from"./chunk-DUYWEMAT.js";import{d as Qb,e as e1}from"./chunk-WMCBVXPA.js";import{c as K,g as Cu,o as I,p as T,q as O}from"./chunk-QTLWQ5AJ.js";var ui=K(ce=>{"use strict";I();O();Object.defineProperty(ce,"__esModule",{value:!0});ce.bytes=ce.stringToBytes=ce.str=ce.bytesToString=ce.hex=ce.utf8=ce.bech32m=ce.bech32=ce.base58check=ce.base58xmr=ce.base58xrp=ce.base58flickr=ce.base58=ce.base64url=ce.base64=ce.base32crockford=ce.base32hex=ce.base32=ce.base16=ce.utils=ce.assertNumber=void 0;function Pn(t){if(!Number.isSafeInteger(t))throw new Error(`Wrong integer: ${t}`)}ce.assertNumber=Pn;function Vr(...t){let e=(i,s)=>a=>i(s(a)),r=Array.from(t).reverse().reduce((i,s)=>i?e(i,s.encode):s.encode,void 0),n=t.reduce((i,s)=>i?e(i,s.decode):s.decode,void 0);return{encode:r,decode:n}}function cn(t){return{encode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return e.map(r=>{if(Pn(r),r<0||r>=t.length)throw new Error(`Digit index outside alphabet: ${r} (alphabet: ${t.length})`);return t[r]})},decode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="string")throw new Error("alphabet.decode input should be array of strings");return e.map(r=>{if(typeof r!="string")throw new Error(`alphabet.decode: not string element=${r}`);let n=t.indexOf(r);if(n===-1)throw new Error(`Unknown letter: "${r}". Allowed: ${t}`);return n})}}}function fn(t=""){if(typeof t!="string")throw new Error("join separator should be string");return{encode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="string")throw new Error("join.encode input should be array of strings");for(let r of e)if(typeof r!="string")throw new Error(`join.encode: non-string input=${r}`);return e.join(t)},decode:e=>{if(typeof e!="string")throw new Error("join.decode input should be string");return e.split(t)}}}function js(t,e="="){if(Pn(t),typeof e!="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*t%8;)r.push(e);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*t%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;n>0&&r[n-1]===e;n--)if(!((n-1)*t%8))throw new Error("Invalid padding: string has too much padding");return r.slice(0,n)}}}function Vu(t){if(typeof t!="function")throw new Error("normalize fn should be function");return{encode:e=>e,decode:e=>t(e)}}function Lu(t,e,r){if(e<2)throw new Error(`convertRadix: wrong from=${e}, 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(t))throw new Error("convertRadix: data should be array");if(!t.length)return[];let n=0,i=[],s=Array.from(t);for(s.forEach(a=>{if(Pn(a),a<0||a>=e)throw new Error(`Wrong integer: ${a}`)});;){let a=0,c=!0;for(let d=n;d<s.length;d++){let h=s[d],y=e*a+h;if(!Number.isSafeInteger(y)||e*a/e!==a||y-h!==e*a)throw new Error("convertRadix: carry overflow");if(a=y%r,s[d]=Math.floor(y/r),!Number.isSafeInteger(s[d])||s[d]*r+a!==y)throw new Error("convertRadix: carry overflow");if(c)s[d]?c=!1:n=d;else continue}if(i.push(a),c)break}for(let a=0;a<t.length-1&&t[a]===0;a++)i.push(0);return i.reverse()}var $u=(t,e)=>e?$u(e,t%e):t,bo=(t,e)=>t+(e-$u(t,e));function gc(t,e,r,n){if(!Array.isArray(t))throw new Error("convertRadix2: data should be array");if(e<=0||e>32)throw new Error(`convertRadix2: wrong from=${e}`);if(r<=0||r>32)throw new Error(`convertRadix2: wrong to=${r}`);if(bo(e,r)>32)throw new Error(`convertRadix2: carry overflow from=${e} to=${r} carryBits=${bo(e,r)}`);let i=0,s=0,a=2**r-1,c=[];for(let d of t){if(Pn(d),d>=2**e)throw new Error(`convertRadix2: invalid data word=${d} from=${e}`);if(i=i<<e|d,s+e>32)throw new Error(`convertRadix2: carry overflow pos=${s} from=${e}`);for(s+=e;s>=r;s-=r)c.push((i>>s-r&a)>>>0);i&=2**s-1}if(i=i<<r-s&a,!n&&s>=e)throw new Error("Excess padding");if(!n&&i)throw new Error(`Non-zero padding: ${i}`);return n&&s>0&&c.push(i>>>0),c}function Gu(t){return Pn(t),{encode:e=>{if(!(e instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return Lu(Array.from(e),2**8,t)},decode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(Lu(e,t,2**8))}}}function xn(t,e=!1){if(Pn(t),t<=0||t>32)throw new Error("radix2: bits should be in (0..32]");if(bo(8,t)>32||bo(t,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 gc(Array.from(r),8,t,!e)},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(gc(r,t,8,e))}}}function Hu(t){if(typeof t!="function")throw new Error("unsafeWrapper fn should be function");return function(...e){try{return t.apply(null,e)}catch{}}}function Wu(t,e){if(Pn(t),typeof e!="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=e(r).slice(0,t),i=new Uint8Array(r.length+t);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,-t),i=e(n).slice(0,t),s=r.slice(-t);for(let a=0;a<t;a++)if(i[a]!==s[a])throw new Error("Invalid checksum");return n}}}ce.utils={alphabet:cn,chain:Vr,checksum:Wu,radix:Gu,radix2:xn,join:fn,padding:js};ce.base16=Vr(xn(4),cn("0123456789ABCDEF"),fn(""));ce.base32=Vr(xn(5),cn("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),js(5),fn(""));ce.base32hex=Vr(xn(5),cn("0123456789ABCDEFGHIJKLMNOPQRSTUV"),js(5),fn(""));ce.base32crockford=Vr(xn(5),cn("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),fn(""),Vu(t=>t.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")));ce.base64=Vr(xn(6),cn("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),js(6),fn(""));ce.base64url=Vr(xn(6),cn("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),js(6),fn(""));var mc=t=>Vr(Gu(58),cn(t),fn(""));ce.base58=mc("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");ce.base58flickr=mc("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ");ce.base58xrp=mc("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");var Ku=[0,2,3,5,6,7,9,10,11];ce.base58xmr={encode(t){let e="";for(let r=0;r<t.length;r+=8){let n=t.subarray(r,r+8);e+=ce.base58.encode(n).padStart(Ku[n.length],"1")}return e},decode(t){let e=[];for(let r=0;r<t.length;r+=11){let n=t.slice(r,r+11),i=Ku.indexOf(n.length),s=ce.base58.decode(n);for(let a=0;a<s.length-i;a++)if(s[a]!==0)throw new Error("base58xmr: wrong padding");e=e.concat(Array.from(s.slice(s.length-i)))}return Uint8Array.from(e)}};var m1=t=>Vr(Wu(4,e=>t(t(e))),ce.base58);ce.base58check=m1;var yc=Vr(cn("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),fn("")),Fu=[996825010,642813549,513874426,1027748829,705979059];function Bs(t){let e=t>>25,r=(t&33554431)<<5;for(let n=0;n<Fu.length;n++)(e>>n&1)===1&&(r^=Fu[n]);return r}function zu(t,e,r=1){let n=t.length,i=1;for(let s=0;s<n;s++){let a=t.charCodeAt(s);if(a<33||a>126)throw new Error(`Invalid prefix (${t})`);i=Bs(i)^a>>5}i=Bs(i);for(let s=0;s<n;s++)i=Bs(i)^t.charCodeAt(s)&31;for(let s of e)i=Bs(i)^s;for(let s=0;s<6;s++)i=Bs(i);return i^=r,yc.encode(gc([i%2**30],30,5,!1))}function Zu(t){let e=t==="bech32"?1:734539939,r=xn(5),n=r.decode,i=r.encode,s=Hu(n);function a(y,p,w=90){if(typeof y!="string")throw new Error(`bech32.encode prefix should be string, not ${typeof y}`);if(!Array.isArray(p)||p.length&&typeof p[0]!="number")throw new Error(`bech32.encode words should be array of numbers, not ${typeof p}`);let v=y.length+7+p.length;if(w!==!1&&v>w)throw new TypeError(`Length ${v} exceeds limit ${w}`);return y=y.toLowerCase(),`${y}1${yc.encode(p)}${zu(y,p,e)}`}function c(y,p=90){if(typeof y!="string")throw new Error(`bech32.decode input should be string, not ${typeof y}`);if(y.length<8||p!==!1&&y.length>p)throw new TypeError(`Wrong string length: ${y.length} (${y}). Expected (8..${p})`);let w=y.toLowerCase();if(y!==w&&y!==y.toUpperCase())throw new Error("String must be lowercase or uppercase");y=w;let v=y.lastIndexOf("1");if(v===0||v===-1)throw new Error('Letter "1" must be present between prefix and data only');let[_,m]=[y.slice(0,v),y.slice(v+1)];if(m.length<6)throw new Error("Data must be at least 6 characters long");let M=yc.decode(m).slice(0,-6),N=zu(_,M,e);if(!m.endsWith(N))throw new Error(`Invalid checksum in ${y}: expected "${N}"`);return{prefix:_,words:M}}let d=Hu(c);function h(y){let{prefix:p,words:w}=c(y,!1);return{prefix:p,words:w,bytes:n(w)}}return{encode:a,decode:c,decodeToBytes:h,decodeUnsafe:d,fromWords:n,fromWordsUnsafe:s,toWords:i}}ce.bech32=Zu("bech32");ce.bech32m=Zu("bech32m");ce.utf8={encode:t=>new TextDecoder().decode(t),decode:t=>new TextEncoder().encode(t)};ce.hex=Vr(xn(4),cn("0123456789abcdef"),fn(""),Vu(t=>{if(typeof t!="string"||t.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof t} with length ${t.length}`);return t.toLowerCase()}));var Ps={utf8:ce.utf8,hex:ce.hex,base16:ce.base16,base32:ce.base32,base64:ce.base64,base64url:ce.base64url,base58:ce.base58,base58xmr:ce.base58xmr},Xu=`Invalid encoding type. Available types: ${Object.keys(Ps).join(", ")}`,v1=(t,e)=>{if(typeof t!="string"||!Ps.hasOwnProperty(t))throw new TypeError(Xu);if(!(e instanceof Uint8Array))throw new TypeError("bytesToString() expects Uint8Array");return Ps[t].encode(e)};ce.bytesToString=v1;ce.str=ce.bytesToString;var w1=(t,e)=>{if(!Ps.hasOwnProperty(t))throw new TypeError(Xu);if(typeof e!="string")throw new TypeError("stringToBytes() expects string");return Ps[t].decode(e)};ce.stringToBytes=w1;ce.bytes=ce.stringToBytes});var Yu=K(jn=>{"use strict";I();O();Object.defineProperty(jn,"__esModule",{value:!0});jn.base58=jn.fromBase58=jn.toBase58=void 0;var vc=ui();Object.defineProperty(jn,"base58",{enumerable:!0,get:function(){return vc.base58}});function S1(t){let e=T.Buffer.from(t);return vc.base58.encode(Uint8Array.from(e))}jn.toBase58=S1;function _1(t){return vc.base58.decode(t)}jn.fromBase58=_1});var Ju=K(po=>{"use strict";I();O();Object.defineProperty(po,"__esModule",{value:!0});po.crypto=void 0;po.crypto={node:void 0,web:typeof self=="object"&&"crypto"in self?self.crypto:void 0}});var rr=K((he,Ns)=>{"use strict";I();O();Object.defineProperty(he,"__esModule",{value:!0});he.randomBytes=he.wrapConstructorWithOpts=he.wrapConstructor=he.checkOpts=he.Hash=he.assertHash=he.assertBytes=he.assertBool=he.assertNumber=he.concatBytes=he.toBytes=he.utf8ToBytes=he.asyncLoop=he.nextTick=he.hexToBytes=he.bytesToHex=he.isLE=he.rotr=he.createView=he.u32=he.u8=void 0;var go=Ju(),E1=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength);he.u8=E1;var x1=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4));he.u32=x1;var A1=t=>new DataView(t.buffer,t.byteOffset,t.byteLength);he.createView=A1;var M1=(t,e)=>t<<32-e|t>>>e;he.rotr=M1;he.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!he.isLE)throw new Error("Non little-endian hardware is not supported");var T1=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function I1(t){let e="";for(let r=0;r<t.length;r++)e+=T1[t[r]];return e}he.bytesToHex=I1;function O1(t){if(typeof t!="string")throw new TypeError("hexToBytes: expected string, got "+typeof t);if(t.length%2)throw new Error("hexToBytes: received invalid unpadded hex");let e=new Uint8Array(t.length/2);for(let r=0;r<e.length;r++){let n=r*2,i=t.slice(n,n+2),s=Number.parseInt(i,16);if(Number.isNaN(s))throw new Error("Invalid byte sequence");e[r]=s}return e}he.hexToBytes=O1;he.nextTick=(()=>{let t=typeof Ns<"u"&&typeof Ns.require=="function"&&Ns.require.bind(Ns);try{if(t){let{setImmediate:e}=t("timers");return()=>new Promise(r=>e(r))}}catch{}return()=>new Promise(e=>setTimeout(e,0))})();async function B1(t,e,r){let n=Date.now();for(let i=0;i<t;i++){r(i);let s=Date.now()-n;s>=0&&s<e||(await(0,he.nextTick)(),n+=s)}}he.asyncLoop=B1;function Qu(t){if(typeof t!="string")throw new TypeError(`utf8ToBytes expected string, got ${typeof t}`);return new TextEncoder().encode(t)}he.utf8ToBytes=Qu;function _c(t){if(typeof t=="string"&&(t=Qu(t)),!(t instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof t})`);return t}he.toBytes=_c;function P1(...t){if(!t.every(n=>n instanceof Uint8Array))throw new Error("Uint8Array list expected");if(t.length===1)return t[0];let e=t.reduce((n,i)=>n+i.length,0),r=new Uint8Array(e);for(let n=0,i=0;n<t.length;n++){let s=t[n];r.set(s,i),i+=s.length}return r}he.concatBytes=P1;function wc(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}he.assertNumber=wc;function j1(t){if(typeof t!="boolean")throw new Error(`Expected boolean, not ${t}`)}he.assertBool=j1;function N1(t,...e){if(!(t instanceof Uint8Array&&(!e.length||e.includes(t.length))))throw new TypeError(`Expected ${e} bytes, not ${typeof t} with length=${t.length}`)}he.assertBytes=N1;function k1(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");wc(t.outputLen),wc(t.blockLen)}he.assertHash=k1;var Sc=class{clone(){return this._cloneInto()}};he.Hash=Sc;var R1=t=>Object.prototype.toString.call(t)==="[object Object]"&&t.constructor===Object;function q1(t,e){if(e!==void 0&&(typeof e!="object"||!R1(e)))throw new TypeError("Options should be object or undefined");return Object.assign(t,e)}he.checkOpts=q1;function C1(t){let e=n=>t().update(_c(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}he.wrapConstructor=C1;function D1(t){let e=(n,i)=>t(i).update(_c(n)).digest(),r=t({});return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=n=>t(n),e}he.wrapConstructorWithOpts=D1;function U1(t=32){if(go.crypto.web)return go.crypto.web.getRandomValues(new Uint8Array(t));if(go.crypto.node)return new Uint8Array(go.crypto.node.randomBytes(t).buffer);throw new Error("The environment doesn't have randomBytes function")}he.randomBytes=U1});var mo=K(yo=>{"use strict";I();O();Object.defineProperty(yo,"__esModule",{value:!0});yo.SHA2=void 0;var ks=rr();function L1(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);let i=BigInt(32),s=BigInt(4294967295),a=Number(r>>i&s),c=Number(r&s),d=n?4:0,h=n?0:4;t.setUint32(e+d,a,n),t.setUint32(e+h,c,n)}var Ec=class extends ks.Hash{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,ks.createView)(this.buffer)}update(e){if(this.destroyed)throw new Error("instance is destroyed");let{view:r,buffer:n,blockLen:i,finished:s}=this;if(s)throw new Error("digest() was already called");e=(0,ks.toBytes)(e);let a=e.length;for(let c=0;c<a;){let d=Math.min(i-this.pos,a-c);if(d===i){let h=(0,ks.createView)(e);for(;i<=a-c;c+=i)this.process(h,c);continue}n.set(e.subarray(c,c+d),this.pos),this.pos+=d,c+=d,this.pos===i&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){if(this.destroyed)throw new Error("instance is destroyed");if(!(e instanceof Uint8Array)||e.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:s}=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 d=a;d<i;d++)r[d]=0;L1(n,i-8,BigInt(this.length*8),s),this.process(n,0);let c=(0,ks.createView)(e);this.get().forEach((d,h)=>c.setUint32(4*h,d,s))}digest(){let{buffer:e,outputLen:r}=this;this.digestInto(e);let n=e.slice(0,r);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:r,buffer:n,length:i,finished:s,destroyed:a,pos:c}=this;return e.length=i,e.pos=c,e.finished=s,e.destroyed=a,i%r&&e.buffer.set(n),e}};yo.SHA2=Ec});var Di=K(vo=>{"use strict";I();O();Object.defineProperty(vo,"__esModule",{value:!0});vo.sha256=void 0;var H1=mo(),$r=rr(),K1=(t,e,r)=>t&e^~t&r,F1=(t,e,r)=>t&e^t&r^e&r,z1=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]),Nn=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),kn=new Uint32Array(64),xc=class extends H1.SHA2{constructor(){super(64,32,8,!1),this.A=Nn[0]|0,this.B=Nn[1]|0,this.C=Nn[2]|0,this.D=Nn[3]|0,this.E=Nn[4]|0,this.F=Nn[5]|0,this.G=Nn[6]|0,this.H=Nn[7]|0}get(){let{A:e,B:r,C:n,D:i,E:s,F:a,G:c,H:d}=this;return[e,r,n,i,s,a,c,d]}set(e,r,n,i,s,a,c,d){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=s|0,this.F=a|0,this.G=c|0,this.H=d|0}process(e,r){for(let p=0;p<16;p++,r+=4)kn[p]=e.getUint32(r,!1);for(let p=16;p<64;p++){let w=kn[p-15],v=kn[p-2],_=(0,$r.rotr)(w,7)^(0,$r.rotr)(w,18)^w>>>3,m=(0,$r.rotr)(v,17)^(0,$r.rotr)(v,19)^v>>>10;kn[p]=m+kn[p-7]+_+kn[p-16]|0}let{A:n,B:i,C:s,D:a,E:c,F:d,G:h,H:y}=this;for(let p=0;p<64;p++){let w=(0,$r.rotr)(c,6)^(0,$r.rotr)(c,11)^(0,$r.rotr)(c,25),v=y+w+K1(c,d,h)+z1[p]+kn[p]|0,m=((0,$r.rotr)(n,2)^(0,$r.rotr)(n,13)^(0,$r.rotr)(n,22))+F1(n,i,s)|0;y=h,h=d,d=c,c=a+v|0,a=s,s=i,i=n,n=v+m|0}n=n+this.A|0,i=i+this.B|0,s=s+this.C|0,a=a+this.D|0,c=c+this.E|0,d=d+this.F|0,h=h+this.G|0,y=y+this.H|0,this.set(n,i,s,a,c,d,h,y)}roundClean(){kn.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};vo.sha256=(0,$r.wrapConstructor)(()=>new xc)});var Ui=K(be=>{"use strict";I();O();Object.defineProperty(be,"__esModule",{value:!0});be.add5H=be.add5L=be.add4H=be.add4L=be.add3H=be.add3L=be.add=be.rotlBL=be.rotlBH=be.rotlSL=be.rotlSH=be.rotr32L=be.rotr32H=be.rotrBL=be.rotrBH=be.rotrSL=be.rotrSH=be.shrSL=be.shrSH=be.toBig=be.split=be.fromBig=void 0;var wo=BigInt(2**32-1),Ac=BigInt(32);function ed(t,e=!1){return e?{h:Number(t&wo),l:Number(t>>Ac&wo)}:{h:Number(t>>Ac&wo)|0,l:Number(t&wo)|0}}be.fromBig=ed;function V1(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;i<t.length;i++){let{h:s,l:a}=ed(t[i],e);[r[i],n[i]]=[s,a]}return[r,n]}be.split=V1;var $1=(t,e)=>BigInt(t>>>0)<<Ac|BigInt(e>>>0);be.toBig=$1;var G1=(t,e,r)=>t>>>r;be.shrSH=G1;var W1=(t,e,r)=>t<<32-r|e>>>r;be.shrSL=W1;var Z1=(t,e,r)=>t>>>r|e<<32-r;be.rotrSH=Z1;var X1=(t,e,r)=>t<<32-r|e>>>r;be.rotrSL=X1;var Y1=(t,e,r)=>t<<64-r|e>>>r-32;be.rotrBH=Y1;var J1=(t,e,r)=>t>>>r-32|e<<64-r;be.rotrBL=J1;var Q1=(t,e)=>e;be.rotr32H=Q1;var ep=(t,e)=>t;be.rotr32L=ep;var tp=(t,e,r)=>t<<r|e>>>32-r;be.rotlSH=tp;var rp=(t,e,r)=>e<<r|t>>>32-r;be.rotlSL=rp;var np=(t,e,r)=>e<<r-32|t>>>64-r;be.rotlBH=np;var ip=(t,e,r)=>t<<r-32|e>>>64-r;be.rotlBL=ip;function sp(t,e,r,n){let i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}be.add=sp;var op=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0);be.add3L=op;var ap=(t,e,r,n)=>e+r+n+(t/2**32|0)|0;be.add3H=ap;var cp=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0);be.add4L=cp;var fp=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0;be.add4H=fp;var up=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0);be.add5L=up;var dp=(t,e,r,n,i,s)=>e+r+n+i+s+(t/2**32|0)|0;be.add5H=dp});var So=K(or=>{"use strict";I();O();var lp=or&&or.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),hp=or&&or.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),bp=or&&or.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&lp(e,t,r);return hp(e,t),e};Object.defineProperty(or,"__esModule",{value:!0});or.sha384=or.sha512_256=or.sha512=or.SHA512=void 0;var pp=mo(),Se=bp(Ui()),Ic=rr(),[gp,yp]=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(t=>BigInt(t))),Rn=new Uint32Array(80),qn=new Uint32Array(80),Li=class extends pp.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:e,Al:r,Bh:n,Bl:i,Ch:s,Cl:a,Dh:c,Dl:d,Eh:h,El:y,Fh:p,Fl:w,Gh:v,Gl:_,Hh:m,Hl:M}=this;return[e,r,n,i,s,a,c,d,h,y,p,w,v,_,m,M]}set(e,r,n,i,s,a,c,d,h,y,p,w,v,_,m,M){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=s|0,this.Cl=a|0,this.Dh=c|0,this.Dl=d|0,this.Eh=h|0,this.El=y|0,this.Fh=p|0,this.Fl=w|0,this.Gh=v|0,this.Gl=_|0,this.Hh=m|0,this.Hl=M|0}process(e,r){for(let C=0;C<16;C++,r+=4)Rn[C]=e.getUint32(r),qn[C]=e.getUint32(r+=4);for(let C=16;C<80;C++){let V=Rn[C-15]|0,F=qn[C-15]|0,H=Se.rotrSH(V,F,1)^Se.rotrSH(V,F,8)^Se.shrSH(V,F,7),G=Se.rotrSL(V,F,1)^Se.rotrSL(V,F,8)^Se.shrSL(V,F,7),z=Rn[C-2]|0,se=qn[C-2]|0,A=Se.rotrSH(z,se,19)^Se.rotrBH(z,se,61)^Se.shrSH(z,se,6),o=Se.rotrSL(z,se,19)^Se.rotrBL(z,se,61)^Se.shrSL(z,se,6),l=Se.add4L(G,o,qn[C-7],qn[C-16]),b=Se.add4H(l,H,A,Rn[C-7],Rn[C-16]);Rn[C]=b|0,qn[C]=l|0}let{Ah:n,Al:i,Bh:s,Bl:a,Ch:c,Cl:d,Dh:h,Dl:y,Eh:p,El:w,Fh:v,Fl:_,Gh:m,Gl:M,Hh:N,Hl:L}=this;for(let C=0;C<80;C++){let V=Se.rotrSH(p,w,14)^Se.rotrSH(p,w,18)^Se.rotrBH(p,w,41),F=Se.rotrSL(p,w,14)^Se.rotrSL(p,w,18)^Se.rotrBL(p,w,41),H=p&v^~p&m,G=w&_^~w&M,z=Se.add5L(L,F,G,yp[C],qn[C]),se=Se.add5H(z,N,V,H,gp[C],Rn[C]),A=z|0,o=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),b=n&s^n&c^s&c,u=i&a^i&d^a&d;N=m|0,L=M|0,m=v|0,M=_|0,v=p|0,_=w|0,{h:p,l:w}=Se.add(h|0,y|0,se|0,A|0),h=c|0,y=d|0,c=s|0,d=a|0,s=n|0,a=i|0;let g=Se.add3L(A,l,u);n=Se.add3H(g,se,o,b),i=g|0}({h:n,l:i}=Se.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:s,l:a}=Se.add(this.Bh|0,this.Bl|0,s|0,a|0),{h:c,l:d}=Se.add(this.Ch|0,this.Cl|0,c|0,d|0),{h,l:y}=Se.add(this.Dh|0,this.Dl|0,h|0,y|0),{h:p,l:w}=Se.add(this.Eh|0,this.El|0,p|0,w|0),{h:v,l:_}=Se.add(this.Fh|0,this.Fl|0,v|0,_|0),{h:m,l:M}=Se.add(this.Gh|0,this.Gl|0,m|0,M|0),{h:N,l:L}=Se.add(this.Hh|0,this.Hl|0,N|0,L|0),this.set(n,i,s,a,c,d,h,y,p,w,v,_,m,M,N,L)}roundClean(){Rn.fill(0),qn.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)}};or.SHA512=Li;var Mc=class extends Li{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}},Tc=class extends Li{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}};or.sha512=(0,Ic.wrapConstructor)(()=>new Li);or.sha512_256=(0,Ic.wrapConstructor)(()=>new Mc);or.sha384=(0,Ic.wrapConstructor)(()=>new Tc)});var Pc=K(Hi=>{"use strict";I();O();Object.defineProperty(Hi,"__esModule",{value:!0});Hi.ripemd160=Hi.RIPEMD160=void 0;var mp=mo(),vp=rr(),wp=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),rd=Uint8Array.from({length:16},(t,e)=>e),Sp=rd.map(t=>(9*t+5)%16),Oc=[rd],Bc=[Sp];for(let t=0;t<4;t++)for(let e of[Oc,Bc])e.push(e[t].map(r=>wp[r]));var nd=[[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(t=>new Uint8Array(t)),_p=Oc.map((t,e)=>t.map(r=>nd[e][r])),Ep=Bc.map((t,e)=>t.map(r=>nd[e][r])),xp=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),Ap=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),_o=(t,e)=>t<<e|t>>>32-e;function td(t,e,r,n){return t===0?e^r^n:t===1?e&r|~e&n:t===2?(e|~r)^n:t===3?e&n|r&~n:e^(r|~n)}var Eo=new Uint32Array(16),xo=class extends mp.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:e,h1:r,h2:n,h3:i,h4:s}=this;return[e,r,n,i,s]}set(e,r,n,i,s){this.h0=e|0,this.h1=r|0,this.h2=n|0,this.h3=i|0,this.h4=s|0}process(e,r){for(let v=0;v<16;v++,r+=4)Eo[v]=e.getUint32(r,!0);let n=this.h0|0,i=n,s=this.h1|0,a=s,c=this.h2|0,d=c,h=this.h3|0,y=h,p=this.h4|0,w=p;for(let v=0;v<5;v++){let _=4-v,m=xp[v],M=Ap[v],N=Oc[v],L=Bc[v],C=_p[v],V=Ep[v];for(let F=0;F<16;F++){let H=_o(n+td(v,s,c,h)+Eo[N[F]]+m,C[F])+p|0;n=p,p=h,h=_o(c,10)|0,c=s,s=H}for(let F=0;F<16;F++){let H=_o(i+td(_,a,d,y)+Eo[L[F]]+M,V[F])+w|0;i=w,w=y,y=_o(d,10)|0,d=a,a=H}}this.set(this.h1+c+y|0,this.h2+h+w|0,this.h3+p+i|0,this.h4+n+a|0,this.h0+s+d|0)}roundClean(){Eo.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}};Hi.RIPEMD160=xo;Hi.ripemd160=(0,vp.wrapConstructor)(()=>new xo)});var Ao=K(Ce=>{"use strict";I();O();var Mp=Ce&&Ce.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Tp=Ce&&Ce.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Ip=Ce&&Ce.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Mp(e,t,r);return Tp(e,t),e};Object.defineProperty(Ce,"__esModule",{value:!0});Ce.shake256=Ce.shake128=Ce.keccak_512=Ce.keccak_384=Ce.keccak_256=Ce.keccak_224=Ce.sha3_512=Ce.sha3_384=Ce.sha3_256=Ce.sha3_224=Ce.Keccak=Ce.keccakP=void 0;var qs=Ip(Ui()),di=rr(),[od,ad,cd]=[[],[],[]],Op=BigInt(0),Rs=BigInt(1),Bp=BigInt(2),Pp=BigInt(7),jp=BigInt(256),Np=BigInt(113);for(let t=0,e=Rs,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],od.push(2*(5*n+r)),ad.push((t+1)*(t+2)/2%64);let i=Op;for(let s=0;s<7;s++)e=(e<<Rs^(e>>Pp)*Np)%jp,e&Bp&&(i^=Rs<<(Rs<<BigInt(s))-Rs);cd.push(i)}var[kp,Rp]=qs.split(cd,!0),id=(t,e,r)=>r>32?qs.rotlBH(t,e,r):qs.rotlSH(t,e,r),sd=(t,e,r)=>r>32?qs.rotlBL(t,e,r):qs.rotlSL(t,e,r);function fd(t,e=24){let r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let a=0;a<10;a++)r[a]=t[a]^t[a+10]^t[a+20]^t[a+30]^t[a+40];for(let a=0;a<10;a+=2){let c=(a+8)%10,d=(a+2)%10,h=r[d],y=r[d+1],p=id(h,y,1)^r[c],w=sd(h,y,1)^r[c+1];for(let v=0;v<50;v+=10)t[a+v]^=p,t[a+v+1]^=w}let i=t[2],s=t[3];for(let a=0;a<24;a++){let c=ad[a],d=id(i,s,c),h=sd(i,s,c),y=od[a];i=t[y],s=t[y+1],t[y]=d,t[y+1]=h}for(let a=0;a<50;a+=10){for(let c=0;c<10;c++)r[c]=t[a+c];for(let c=0;c<10;c++)t[a+c]^=~r[(c+2)%10]&r[(c+4)%10]}t[0]^=kp[n],t[1]^=Rp[n]}r.fill(0)}Ce.keccakP=fd;var li=class extends di.Hash{constructor(e,r,n,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,di.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,di.u32)(this.state)}keccak(){fd(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){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;e=(0,di.toBytes)(e);let i=e.length;for(let s=0;s<i;){let a=Math.min(r-this.pos,i-s);for(let c=0;c<a;c++)n[this.pos++]^=e[s++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:r,pos:n,blockLen:i}=this;e[n]^=r,(r&128)!==0&&n===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){if(this.destroyed)throw new Error("instance is destroyed");if(!(e instanceof Uint8Array))throw new Error("Keccak: invalid output buffer");this.finish();for(let r=0,n=e.length;r<n;){this.posOut>=this.blockLen&&this.keccak();let i=Math.min(this.blockLen-this.posOut,n-r);e.set(this.state.subarray(this.posOut,this.posOut+i),r),this.posOut+=i,r+=i}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,di.assertNumber)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(e.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(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){let{blockLen:r,suffix:n,outputLen:i,rounds:s,enableXOF:a}=this;return e||(e=new li(r,n,i,a,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=n,e.outputLen=i,e.enableXOF=a,e.destroyed=this.destroyed,e}};Ce.Keccak=li;var Cn=(t,e,r)=>(0,di.wrapConstructor)(()=>new li(e,t,r));Ce.sha3_224=Cn(6,144,224/8);Ce.sha3_256=Cn(6,136,256/8);Ce.sha3_384=Cn(6,104,384/8);Ce.sha3_512=Cn(6,72,512/8);Ce.keccak_224=Cn(1,144,224/8);Ce.keccak_256=Cn(1,136,256/8);Ce.keccak_384=Cn(1,104,384/8);Ce.keccak_512=Cn(1,72,512/8);var ud=(t,e,r)=>(0,di.wrapConstructorWithOpts)((n={})=>new li(e,t,n.dkLen!==void 0?n.dkLen:r,!0));Ce.shake128=ud(31,168,128/8);Ce.shake256=ud(31,136,256/8)});var Mo=K(Ki=>{"use strict";I();O();Object.defineProperty(Ki,"__esModule",{value:!0});Ki.BLAKE2=Ki.SIGMA=void 0;var hi=rr();Ki.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 jc=class extends hi.Hash{constructor(e,r,n={},i,s,a){if(super(),this.blockLen=e,this.outputLen=r,this.length=0,this.pos=0,this.finished=!1,this.destroyed=!1,(0,hi.assertNumber)(e),(0,hi.assertNumber)(r),(0,hi.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!==s)throw new Error(`Salt should be ${s} 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,hi.u32)(this.buffer=new Uint8Array(e))}update(e){if(this.destroyed)throw new Error("instance is destroyed");let{finished:r,blockLen:n,buffer:i,buffer32:s}=this;if(r)throw new Error("digest() was already called");e=(0,hi.toBytes)(e);let a=e.length;for(let c=0;c<a;){this.pos===n&&(this.compress(s,0,!1),this.pos=0);let d=Math.min(n-this.pos,a-c),h=e.byteOffset+c;if(d===n&&!(h%4)&&c+d<a){let y=new Uint32Array(e.buffer,h,Math.floor((a-c)/4));for(let p=0;c+n<a;p+=s.length,c+=n)this.length+=n,this.compress(y,p,!1);continue}i.set(e.subarray(c,c+d),this.pos),this.pos+=d,this.length+=d,c+=d}return this}digestInto(e){if(this.destroyed)throw new Error("instance is destroyed");if(!(e instanceof Uint8Array)||e.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 s=(0,hi.u32)(e);this.get().forEach((a,c)=>s[c]=a)}digest(){let{buffer:e,outputLen:r}=this;this.digestInto(e);let n=e.slice(0,r);return this.destroy(),n}_cloneInto(e){let{buffer:r,length:n,finished:i,destroyed:s,outputLen:a,pos:c}=this;return e||(e=new this.constructor({dkLen:a})),e.set(...this.get()),e.length=n,e.finished=i,e.destroyed=s,e.outputLen=a,e.buffer.set(r),e.pos=c,e}};Ki.BLAKE2=jc});var kc=K(un=>{"use strict";I();O();var qp=un&&un.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Cp=un&&un.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ld=un&&un.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&qp(e,t,r);return Cp(e,t),e};Object.defineProperty(un,"__esModule",{value:!0});un.blake2b=void 0;var dd=ld(Mo()),hr=ld(Ui()),Fi=rr(),zt=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),Q=new Uint32Array(32);function Dn(t,e,r,n,i,s){let a=i[s],c=i[s+1],d=Q[2*t],h=Q[2*t+1],y=Q[2*e],p=Q[2*e+1],w=Q[2*r],v=Q[2*r+1],_=Q[2*n],m=Q[2*n+1],M=hr.add3L(d,y,a);h=hr.add3H(M,h,p,c),d=M|0,{Dh:m,Dl:_}={Dh:m^h,Dl:_^d},{Dh:m,Dl:_}={Dh:hr.rotr32H(m,_),Dl:hr.rotr32L(m,_)},{h:v,l:w}=hr.add(v,w,m,_),{Bh:p,Bl:y}={Bh:p^v,Bl:y^w},{Bh:p,Bl:y}={Bh:hr.rotrSH(p,y,24),Bl:hr.rotrSL(p,y,24)},Q[2*t]=d,Q[2*t+1]=h,Q[2*e]=y,Q[2*e+1]=p,Q[2*r]=w,Q[2*r+1]=v,Q[2*n]=_,Q[2*n+1]=m}function Un(t,e,r,n,i,s){let a=i[s],c=i[s+1],d=Q[2*t],h=Q[2*t+1],y=Q[2*e],p=Q[2*e+1],w=Q[2*r],v=Q[2*r+1],_=Q[2*n],m=Q[2*n+1],M=hr.add3L(d,y,a);h=hr.add3H(M,h,p,c),d=M|0,{Dh:m,Dl:_}={Dh:m^h,Dl:_^d},{Dh:m,Dl:_}={Dh:hr.rotrSH(m,_,16),Dl:hr.rotrSL(m,_,16)},{h:v,l:w}=hr.add(v,w,m,_),{Bh:p,Bl:y}={Bh:p^v,Bl:y^w},{Bh:p,Bl:y}={Bh:hr.rotrBH(p,y,63),Bl:hr.rotrBL(p,y,63)},Q[2*t]=d,Q[2*t+1]=h,Q[2*e]=y,Q[2*e+1]=p,Q[2*r]=w,Q[2*r+1]=v,Q[2*n]=_,Q[2*n+1]=m}var Nc=class extends dd.BLAKE2{constructor(e={}){super(128,e.dkLen===void 0?64:e.dkLen,e,64,16,16),this.v0l=zt[0]|0,this.v0h=zt[1]|0,this.v1l=zt[2]|0,this.v1h=zt[3]|0,this.v2l=zt[4]|0,this.v2h=zt[5]|0,this.v3l=zt[6]|0,this.v3h=zt[7]|0,this.v4l=zt[8]|0,this.v4h=zt[9]|0,this.v5l=zt[10]|0,this.v5h=zt[11]|0,this.v6l=zt[12]|0,this.v6h=zt[13]|0,this.v7l=zt[14]|0,this.v7h=zt[15]|0;let r=e.key?e.key.length:0;if(this.v0l^=this.outputLen|r<<8|1<<16|1<<24,e.salt){let n=(0,Fi.u32)((0,Fi.toBytes)(e.salt));this.v4l^=n[0],this.v4h^=n[1],this.v5l^=n[2],this.v5h^=n[3]}if(e.personalization){let n=(0,Fi.u32)((0,Fi.toBytes)(e.personalization));this.v6l^=n[0],this.v6h^=n[1],this.v7l^=n[2],this.v7h^=n[3]}if(e.key){let n=new Uint8Array(this.blockLen);n.set((0,Fi.toBytes)(e.key)),this.update(n)}}get(){let{v0l:e,v0h:r,v1l:n,v1h:i,v2l:s,v2h:a,v3l:c,v3h:d,v4l:h,v4h:y,v5l:p,v5h:w,v6l:v,v6h:_,v7l:m,v7h:M}=this;return[e,r,n,i,s,a,c,d,h,y,p,w,v,_,m,M]}set(e,r,n,i,s,a,c,d,h,y,p,w,v,_,m,M){this.v0l=e|0,this.v0h=r|0,this.v1l=n|0,this.v1h=i|0,this.v2l=s|0,this.v2h=a|0,this.v3l=c|0,this.v3h=d|0,this.v4l=h|0,this.v4h=y|0,this.v5l=p|0,this.v5h=w|0,this.v6l=v|0,this.v6h=_|0,this.v7l=m|0,this.v7h=M|0}compress(e,r,n){this.get().forEach((d,h)=>Q[h]=d),Q.set(zt,16);let{h:i,l:s}=hr.fromBig(BigInt(this.length));Q[24]=zt[8]^s,Q[25]=zt[9]^i,n&&(Q[28]=~Q[28],Q[29]=~Q[29]);let a=0,c=dd.SIGMA;for(let d=0;d<12;d++)Dn(0,4,8,12,e,r+2*c[a++]),Un(0,4,8,12,e,r+2*c[a++]),Dn(1,5,9,13,e,r+2*c[a++]),Un(1,5,9,13,e,r+2*c[a++]),Dn(2,6,10,14,e,r+2*c[a++]),Un(2,6,10,14,e,r+2*c[a++]),Dn(3,7,11,15,e,r+2*c[a++]),Un(3,7,11,15,e,r+2*c[a++]),Dn(0,5,10,15,e,r+2*c[a++]),Un(0,5,10,15,e,r+2*c[a++]),Dn(1,6,11,12,e,r+2*c[a++]),Un(1,6,11,12,e,r+2*c[a++]),Dn(2,7,8,13,e,r+2*c[a++]),Un(2,7,8,13,e,r+2*c[a++]),Dn(3,4,9,14,e,r+2*c[a++]),Un(3,4,9,14,e,r+2*c[a++]);this.v0l^=Q[0]^Q[16],this.v0h^=Q[1]^Q[17],this.v1l^=Q[2]^Q[18],this.v1h^=Q[3]^Q[19],this.v2l^=Q[4]^Q[20],this.v2h^=Q[5]^Q[21],this.v3l^=Q[6]^Q[22],this.v3h^=Q[7]^Q[23],this.v4l^=Q[8]^Q[24],this.v4h^=Q[9]^Q[25],this.v5l^=Q[10]^Q[26],this.v5h^=Q[11]^Q[27],this.v6l^=Q[12]^Q[28],this.v6h^=Q[13]^Q[29],this.v7l^=Q[14]^Q[30],this.v7h^=Q[15]^Q[31],Q.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)}};un.blake2b=(0,Fi.wrapConstructorWithOpts)(t=>new Nc(t))});var Cs=K(tt=>{"use strict";I();O();Object.defineProperty(tt,"__esModule",{value:!0});tt.sha3_512=tt.sha3_256=tt.ripemd160=tt.sha512=tt.sha256=tt.magicHash=tt.blake2=tt.keccak256=tt.keccak=tt.hash160=tt.doubleSha256=void 0;var To=Di();Object.defineProperty(tt,"sha256",{enumerable:!0,get:function(){return To.sha256}});var Dp=So();Object.defineProperty(tt,"sha512",{enumerable:!0,get:function(){return Dp.sha512}});var bd=Pc();Object.defineProperty(tt,"ripemd160",{enumerable:!0,get:function(){return bd.ripemd160}});var zi=Ao();Object.defineProperty(tt,"sha3_256",{enumerable:!0,get:function(){return zi.sha3_256}});Object.defineProperty(tt,"sha3_512",{enumerable:!0,get:function(){return zi.sha3_512}});var Up=kc();function pd(t){let e=(0,To.sha256)(t);return(0,To.sha256)(e)}tt.doubleSha256=pd;function Lp(t){let e=(0,To.sha256)(t);return(0,bd.ripemd160)(e)}tt.hash160=Lp;var Hp=function(t,e=256){let r=T.Buffer.from(t);switch(e){case 224:return T.Buffer.from((0,zi.keccak_224)(r));case 256:return T.Buffer.from((0,zi.keccak_256)(r));case 384:return T.Buffer.from((0,zi.keccak_384)(r));case 512:return T.Buffer.from((0,zi.keccak_512)(r));default:throw new Error(`Invald algorithm: keccak${e}`)}};tt.keccak=Hp;var Kp=function(t){return(0,tt.keccak)(t)};tt.keccak256=Kp;function Fp(t,e,r){let n=Math.ceil(e/8);return(0,Up.blake2b)(t,{dkLen:n,key:r})}tt.blake2=Fp;function hd(t){let e;return t<253?(e=T.Buffer.alloc(1),e.writeUInt8(t,0)):t<65536?(e=T.Buffer.alloc(1+2),e.writeUInt8(253,0),e.writeUInt16LE(t,1)):t<4294967296?(e=T.Buffer.alloc(1+4),e.writeUInt8(254,0),e.writeUInt32LE(t,1)):(e=T.Buffer.alloc(1+8),e.writeUInt8(255,0),e.writeInt32LE(t&-1,1),e.writeUInt32LE(Math.floor(t/4294967296),5)),e}var zp=T.Buffer.from(`Bitcoin Signed Message:
`);function Vp(t,e){let r=e?T.Buffer.from(e,"utf8"):zp,n=hd(r.length),i=T.Buffer.from(t),s=hd(i.length),a=T.Buffer.concat([n,r,s,i]);return pd(a)}tt.magicHash=Vp});var md=K(Vi=>{"use strict";I();O();Object.defineProperty(Vi,"__esModule",{value:!0});Vi.fromBase58Check=Vi.toBase58Check=void 0;var gd=Cs(),J8=n1(),yd=ui();function $p(t){return(0,yd.base58check)(gd.sha256).encode(T.Buffer.from(t))}Vi.toBase58Check=$p;function Gp(t){let e=(0,yd.base58check)(gd.sha256);return T.Buffer.from(e.decode(t))}Vi.fromBase58Check=Gp});var vd=K($i=>{"use strict";I();O();Object.defineProperty($i,"__esModule",{value:!0});$i.fromBech32=$i.toBech32=void 0;var Io=ui();function Wp(t,e,r){let n=T.Buffer.from(e),i=Io.bech32.toWords(Uint8Array.from(n));return Io.bech32.encode(t,i,r)}$i.toBech32=Wp;function Zp(t,e){let r=Io.bech32.decode(t,e),n=Io.bech32.fromWords(r.words);return[r.prefix,T.Buffer.from(n)]}$i.fromBech32=Zp});var wd=K(dn=>{"use strict";I();O();Object.defineProperty(dn,"__esModule",{value:!0});dn.isHexPrefixed=dn.stripHexPrefix=dn.fromHex=dn.toHex=void 0;function Xp(t,e=!1){let r=T.Buffer.from(t);return e?"0x"+r.toString("hex"):r.toString("hex")}dn.toHex=Xp;function Yp(t){return t.startsWith("0x")&&(t=t.substring(2)),T.Buffer.from(t,"hex")}dn.fromHex=Yp;function Jp(t){return t.startsWith("0x")?t.substring(2):t}dn.stripHexPrefix=Jp;function Qp(t){return t.startsWith("0x")}dn.isHexPrefixed=Qp});var _d=K(Gi=>{"use strict";I();O();Object.defineProperty(Gi,"__esModule",{value:!0});Gi.fromBase64=Gi.toBase64=void 0;var Sd=ui();function eg(t){let e=T.Buffer.from(t);return Sd.base64.encode(Uint8Array.from(e))}Gi.toBase64=eg;function tg(t){return Sd.base64.decode(t)}Gi.fromBase64=tg});var Us=K(Ds=>{"use strict";I();O();Object.defineProperty(Ds,"__esModule",{value:!0});Ds.hmac=void 0;var Oo=rr(),Bo=class extends Oo.Hash{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,(0,Oo.assertHash)(e);let n=(0,Oo.toBytes)(r);if(this.iHash=e.create(),!(this.iHash instanceof Oo.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 s=new Uint8Array(i);s.set(n.length>this.iHash.blockLen?e.create().update(n).digest():n);for(let a=0;a<s.length;a++)s[a]^=54;this.iHash.update(s),this.oHash=e.create();for(let a=0;a<s.length;a++)s[a]^=106;this.oHash.update(s),s.fill(0)}update(e){if(this.destroyed)throw new Error("instance is destroyed");return this.iHash.update(e),this}digestInto(e){if(this.destroyed)throw new Error("instance is destroyed");if(!(e instanceof Uint8Array)||e.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(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));let{oHash:r,iHash:n,finished:i,destroyed:s,blockLen:a,outputLen:c}=this;return e=e,e.finished=i,e.destroyed=s,e.blockLen=a,e.outputLen=c,e.oHash=r._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},rg=(t,e,r)=>new Bo(t,e).update(r).digest();Ds.hmac=rg;Ds.hmac.create=(t,e)=>new Bo(t,e)});var Ad=K(Wi=>{"use strict";I();O();Object.defineProperty(Wi,"__esModule",{value:!0});Wi.hmacSHA512=Wi.hmacSHA256=void 0;var Ed=Us(),xd=Cs();function ng(t,e){return T.Buffer.from((0,Ed.hmac)(xd.sha256,t,e))}Wi.hmacSHA256=ng;function ig(t,e){return T.Buffer.from((0,Ed.hmac)(xd.sha512,t,e))}Wi.hmacSHA512=ig});var Md=K(Zi=>{"use strict";I();O();Object.defineProperty(Zi,"__esModule",{value:!0});Zi.fromUtf8=Zi.toUtf8=void 0;function sg(t){return new TextEncoder().encode(t)}Zi.toUtf8=sg;function og(t){return new TextDecoder("utf-8",{fatal:!0}).decode(t)}Zi.fromUtf8=og});var qc=K(Ln=>{"use strict";I();O();Object.defineProperty(Ln,"__esModule",{value:!0});Ln.checkIsUndefined=Ln.checkIsDefined=Ln.check=void 0;var Rc=(t,e)=>{if(!t)throw e=e||"Invalid statement",e=e instanceof Error?e:new Error(e),e};Ln.check=Rc;var ag=(t,e)=>(Rc(typeof t<"u",e||"Expect defined but actually undefined"),t);Ln.checkIsDefined=ag;var cg=(t,e)=>{Rc(typeof t>"u",e||`Expect undefined but actually ${t}`)};Ln.checkIsUndefined=cg});var Id=K(ln=>{"use strict";I();O();Object.defineProperty(ln,"__esModule",{value:!0});ln.string2BigNumber=ln.bigNumber2String=ln.fromBigIntHex=ln.toBigIntHex=void 0;var Td=Gr(),fg=qc(),ug=t=>{let e=t.integerValue().toString(16);return e="0x"+e,e};ln.toBigIntHex=ug;var dg=t=>((0,fg.check)(t&&t.startsWith("0x"),`Invalid hex string. value: ${t}`),new Td.BigNumber(t).integerValue());ln.fromBigIntHex=dg;var lg=(t,e)=>t.integerValue().toString(e);ln.bigNumber2String=lg;var hg=(t,e)=>new Td.BigNumber(t,e);ln.string2BigNumber=hg});var Vt=K((Od,Cc)=>{I();O();(function(t,e){"use strict";function r(A,o){if(!A)throw new Error(o||"Assertion failed")}function n(A,o){A.super_=o;var l=function(){};l.prototype=o.prototype,A.prototype=new l,A.prototype.constructor=A}function i(A,o,l){if(i.isBN(A))return A;this.negative=0,this.words=null,this.length=0,this.red=null,A!==null&&((o==="le"||o==="be")&&(l=o,o=10),this._init(A||0,o||10,l||"be"))}typeof t=="object"?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=Qb().Buffer}catch{}i.isBN=function(o){return o instanceof i?!0:o!==null&&typeof o=="object"&&o.constructor.wordSize===i.wordSize&&Array.isArray(o.words)},i.max=function(o,l){return o.cmp(l)>0?o:l},i.min=function(o,l){return o.cmp(l)<0?o:l},i.prototype._init=function(o,l,b){if(typeof o=="number")return this._initNumber(o,l,b);if(typeof o=="object")return this._initArray(o,l,b);l==="hex"&&(l=16),r(l===(l|0)&&l>=2&&l<=36),o=o.toString().replace(/\s+/g,"");var u=0;o[0]==="-"&&(u++,this.negative=1),u<o.length&&(l===16?this._parseHex(o,u,b):(this._parseBase(o,l,u),b==="le"&&this._initArray(this.toArray(),l,b)))},i.prototype._initNumber=function(o,l,b){o<0&&(this.negative=1,o=-o),o<67108864?(this.words=[o&67108863],this.length=1):o<4503599627370496?(this.words=[o&67108863,o/67108864&67108863],this.length=2):(r(o<9007199254740992),this.words=[o&67108863,o/67108864&67108863,1],this.length=3),b==="le"&&this._initArray(this.toArray(),l,b)},i.prototype._initArray=function(o,l,b){if(r(typeof o.length=="number"),o.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(o.length/3),this.words=new Array(this.length);for(var u=0;u<this.length;u++)this.words[u]=0;var g,x,B=0;if(b==="be")for(u=o.length-1,g=0;u>=0;u-=3)x=o[u]|o[u-1]<<8|o[u-2]<<16,this.words[g]|=x<<B&67108863,this.words[g+1]=x>>>26-B&67108863,B+=24,B>=26&&(B-=26,g++);else if(b==="le")for(u=0,g=0;u<o.length;u+=3)x=o[u]|o[u+1]<<8|o[u+2]<<16,this.words[g]|=x<<B&67108863,this.words[g+1]=x>>>26-B&67108863,B+=24,B>=26&&(B-=26,g++);return this.strip()};function a(A,o){var l=A.charCodeAt(o);return l>=65&&l<=70?l-55:l>=97&&l<=102?l-87:l-48&15}function c(A,o,l){var b=a(A,l);return l-1>=o&&(b|=a(A,l-1)<<4),b}i.prototype._parseHex=function(o,l,b){this.length=Math.ceil((o.length-l)/6),this.words=new Array(this.length);for(var u=0;u<this.length;u++)this.words[u]=0;var g=0,x=0,B;if(b==="be")for(u=o.length-1;u>=l;u-=2)B=c(o,l,u)<<g,this.words[x]|=B&67108863,g>=18?(g-=18,x+=1,this.words[x]|=B>>>26):g+=8;else{var S=o.length-l;for(u=S%2===0?l+1:l;u<o.length;u+=2)B=c(o,l,u)<<g,this.words[x]|=B&67108863,g>=18?(g-=18,x+=1,this.words[x]|=B>>>26):g+=8}this.strip()};function d(A,o,l,b){for(var u=0,g=Math.min(A.length,l),x=o;x<g;x++){var B=A.charCodeAt(x)-48;u*=b,B>=49?u+=B-49+10:B>=17?u+=B-17+10:u+=B}return u}i.prototype._parseBase=function(o,l,b){this.words=[0],this.length=1;for(var u=0,g=1;g<=67108863;g*=l)u++;u--,g=g/l|0;for(var x=o.length-b,B=x%u,S=Math.min(x,x-B)+b,f=0,E=b;E<S;E+=u)f=d(o,E,E+u,l),this.imuln(g),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f);if(B!==0){var W=1;for(f=d(o,E,o.length,l),E=0;E<B;E++)W*=l;this.imuln(W),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f)}this.strip()},i.prototype.copy=function(o){o.words=new Array(this.length);for(var l=0;l<this.length;l++)o.words[l]=this.words[l];o.length=this.length,o.negative=this.negative,o.red=this.red},i.prototype.clone=function(){var o=new i(null);return this.copy(o),o},i.prototype._expand=function(o){for(;this.length<o;)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 h=["","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],p=[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(o,l){o=o||10,l=l|0||1;var b;if(o===16||o==="hex"){b="";for(var u=0,g=0,x=0;x<this.length;x++){var B=this.words[x],S=((B<<u|g)&16777215).toString(16);g=B>>>24-u&16777215,g!==0||x!==this.length-1?b=h[6-S.length]+S+b:b=S+b,u+=2,u>=26&&(u-=26,x--)}for(g!==0&&(b=g.toString(16)+b);b.length%l!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}if(o===(o|0)&&o>=2&&o<=36){var f=y[o],E=p[o];b="";var W=this.clone();for(W.negative=0;!W.isZero();){var X=W.modn(E).toString(o);W=W.idivn(E),W.isZero()?b=X+b:b=h[f-X.length]+X+b}for(this.isZero()&&(b="0"+b);b.length%l!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var o=this.words[0];return this.length===2?o+=this.words[1]*67108864:this.length===3&&this.words[2]===1?o+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-o:o},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(o,l){return r(typeof s<"u"),this.toArrayLike(s,o,l)},i.prototype.toArray=function(o,l){return this.toArrayLike(Array,o,l)},i.prototype.toArrayLike=function(o,l,b){var u=this.byteLength(),g=b||Math.max(1,u);r(u<=g,"byte array longer than desired length"),r(g>0,"Requested array length <= 0"),this.strip();var x=l==="le",B=new o(g),S,f,E=this.clone();if(x){for(f=0;!E.isZero();f++)S=E.andln(255),E.iushrn(8),B[f]=S;for(;f<g;f++)B[f]=0}else{for(f=0;f<g-u;f++)B[f]=0;for(f=0;!E.isZero();f++)S=E.andln(255),E.iushrn(8),B[g-f-1]=S}return B},Math.clz32?i.prototype._countBits=function(o){return 32-Math.clz32(o)}:i.prototype._countBits=function(o){var l=o,b=0;return l>=4096&&(b+=13,l>>>=13),l>=64&&(b+=7,l>>>=7),l>=8&&(b+=4,l>>>=4),l>=2&&(b+=2,l>>>=2),b+l},i.prototype._zeroBits=function(o){if(o===0)return 26;var l=o,b=0;return(l&8191)===0&&(b+=13,l>>>=13),(l&127)===0&&(b+=7,l>>>=7),(l&15)===0&&(b+=4,l>>>=4),(l&3)===0&&(b+=2,l>>>=2),(l&1)===0&&b++,b},i.prototype.bitLength=function(){var o=this.words[this.length-1],l=this._countBits(o);return(this.length-1)*26+l};function w(A){for(var o=new Array(A.bitLength()),l=0;l<o.length;l++){var b=l/26|0,u=l%26;o[l]=(A.words[b]&1<<u)>>>u}return o}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var o=0,l=0;l<this.length;l++){var b=this._zeroBits(this.words[l]);if(o+=b,b!==26)break}return o},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(o){return this.negative!==0?this.abs().inotn(o).iaddn(1):this.clone()},i.prototype.fromTwos=function(o){return this.testn(o-1)?this.notn(o).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(o){for(;this.length<o.length;)this.words[this.length++]=0;for(var l=0;l<o.length;l++)this.words[l]=this.words[l]|o.words[l];return this.strip()},i.prototype.ior=function(o){return r((this.negative|o.negative)===0),this.iuor(o)},i.prototype.or=function(o){return this.length>o.length?this.clone().ior(o):o.clone().ior(this)},i.prototype.uor=function(o){return this.length>o.length?this.clone().iuor(o):o.clone().iuor(this)},i.prototype.iuand=function(o){var l;this.length>o.length?l=o:l=this;for(var b=0;b<l.length;b++)this.words[b]=this.words[b]&o.words[b];return this.length=l.length,this.strip()},i.prototype.iand=function(o){return r((this.negative|o.negative)===0),this.iuand(o)},i.prototype.and=function(o){return this.length>o.length?this.clone().iand(o):o.clone().iand(this)},i.prototype.uand=function(o){return this.length>o.length?this.clone().iuand(o):o.clone().iuand(this)},i.prototype.iuxor=function(o){var l,b;this.length>o.length?(l=this,b=o):(l=o,b=this);for(var u=0;u<b.length;u++)this.words[u]=l.words[u]^b.words[u];if(this!==l)for(;u<l.length;u++)this.words[u]=l.words[u];return this.length=l.length,this.strip()},i.prototype.ixor=function(o){return r((this.negative|o.negative)===0),this.iuxor(o)},i.prototype.xor=function(o){return this.length>o.length?this.clone().ixor(o):o.clone().ixor(this)},i.prototype.uxor=function(o){return this.length>o.length?this.clone().iuxor(o):o.clone().iuxor(this)},i.prototype.inotn=function(o){r(typeof o=="number"&&o>=0);var l=Math.ceil(o/26)|0,b=o%26;this._expand(l),b>0&&l--;for(var u=0;u<l;u++)this.words[u]=~this.words[u]&67108863;return b>0&&(this.words[u]=~this.words[u]&67108863>>26-b),this.strip()},i.prototype.notn=function(o){return this.clone().inotn(o)},i.prototype.setn=function(o,l){r(typeof o=="number"&&o>=0);var b=o/26|0,u=o%26;return this._expand(b+1),l?this.words[b]=this.words[b]|1<<u:this.words[b]=this.words[b]&~(1<<u),this.strip()},i.prototype.iadd=function(o){var l;if(this.negative!==0&&o.negative===0)return this.negative=0,l=this.isub(o),this.negative^=1,this._normSign();if(this.negative===0&&o.negative!==0)return o.negative=0,l=this.isub(o),o.negative=1,l._normSign();var b,u;this.length>o.length?(b=this,u=o):(b=o,u=this);for(var g=0,x=0;x<u.length;x++)l=(b.words[x]|0)+(u.words[x]|0)+g,this.words[x]=l&67108863,g=l>>>26;for(;g!==0&&x<b.length;x++)l=(b.words[x]|0)+g,this.words[x]=l&67108863,g=l>>>26;if(this.length=b.length,g!==0)this.words[this.length]=g,this.length++;else if(b!==this)for(;x<b.length;x++)this.words[x]=b.words[x];return this},i.prototype.add=function(o){var l;return o.negative!==0&&this.negative===0?(o.negative=0,l=this.sub(o),o.negative^=1,l):o.negative===0&&this.negative!==0?(this.negative=0,l=o.sub(this),this.negative=1,l):this.length>o.length?this.clone().iadd(o):o.clone().iadd(this)},i.prototype.isub=function(o){if(o.negative!==0){o.negative=0;var l=this.iadd(o);return o.negative=1,l._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(o),this.negative=1,this._normSign();var b=this.cmp(o);if(b===0)return this.negative=0,this.length=1,this.words[0]=0,this;var u,g;b>0?(u=this,g=o):(u=o,g=this);for(var x=0,B=0;B<g.length;B++)l=(u.words[B]|0)-(g.words[B]|0)+x,x=l>>26,this.words[B]=l&67108863;for(;x!==0&&B<u.length;B++)l=(u.words[B]|0)+x,x=l>>26,this.words[B]=l&67108863;if(x===0&&B<u.length&&u!==this)for(;B<u.length;B++)this.words[B]=u.words[B];return this.length=Math.max(this.length,B),u!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(o){return this.clone().isub(o)};function v(A,o,l){l.negative=o.negative^A.negative;var b=A.length+o.length|0;l.length=b,b=b-1|0;var u=A.words[0]|0,g=o.words[0]|0,x=u*g,B=x&67108863,S=x/67108864|0;l.words[0]=B;for(var f=1;f<b;f++){for(var E=S>>>26,W=S&67108863,X=Math.min(f,o.length-1),J=Math.max(0,f-A.length+1);J<=X;J++){var te=f-J|0;u=A.words[te]|0,g=o.words[J]|0,x=u*g+W,E+=x/67108864|0,W=x&67108863}l.words[f]=W|0,S=E|0}return S!==0?l.words[f]=S|0:l.length--,l.strip()}var _=function(o,l,b){var u=o.words,g=l.words,x=b.words,B=0,S,f,E,W=u[0]|0,X=W&8191,J=W>>>13,te=u[1]|0,ae=te&8191,le=te>>>13,st=u[2]|0,qe=st&8191,Te=st>>>13,zr=u[3]|0,ze=zr&8191,ke=zr>>>13,Ir=u[4]|0,Ve=Ir&8191,Je=Ir>>>13,fi=u[5]|0,ut=fi&8191,ct=fi>>>13,uo=u[6]|0,dt=uo&8191,lt=uo>>>13,lo=u[7]|0,ht=lo&8191,$e=lo>>>13,P=u[8]|0,k=P&8191,R=P>>>13,U=u[9]|0,Y=U&8191,ie=U>>>13,Le=g[0]|0,ye=Le&8191,me=Le>>>13,Qe=g[1]|0,Re=Qe&8191,bt=Qe>>>13,ho=g[2]|0,et=ho&8191,_t=ho>>>13,Bu=g[3]|0,Et=Bu&8191,xt=Bu>>>13,Pu=g[4]|0,At=Pu&8191,Mt=Pu>>>13,ju=g[5]|0,Tt=ju&8191,It=ju>>>13,Nu=g[6]|0,Ot=Nu&8191,Bt=Nu>>>13,ku=g[7]|0,Pt=ku&8191,jt=ku>>>13,Ru=g[8]|0,Nt=Ru&8191,kt=Ru>>>13,qu=g[9]|0,Rt=qu&8191,qt=qu>>>13;b.negative=o.negative^l.negative,b.length=19,S=Math.imul(X,ye),f=Math.imul(X,me),f=f+Math.imul(J,ye)|0,E=Math.imul(J,me);var Xa=(B+S|0)+((f&8191)<<13)|0;B=(E+(f>>>13)|0)+(Xa>>>26)|0,Xa&=67108863,S=Math.imul(ae,ye),f=Math.imul(ae,me),f=f+Math.imul(le,ye)|0,E=Math.imul(le,me),S=S+Math.imul(X,Re)|0,f=f+Math.imul(X,bt)|0,f=f+Math.imul(J,Re)|0,E=E+Math.imul(J,bt)|0;var Ya=(B+S|0)+((f&8191)<<13)|0;B=(E+(f>>>13)|0)+(Ya>>>26)|0,Ya&=67108863,S=Math.imul(qe,ye),f=Math.imul(qe,me),f=f+Math.imul(Te,ye)|0,E=Math.imul(Te,me),S=S+Math.imul(ae,Re)|0,f=f+Math.imul(ae,bt)|0,f=f+Math.imul(le,Re)|0,E=E+Math.imul(le,bt)|0,S=S+Math.imul(X,et)|0,f=f+Math.imul(X,_t)|0,f=f+Math.imul(J,et)|0,E=E+Math.imul(J,_t)|0;var Ja=(B+S|0)+((f&8191)<<13)|0;B=(E+(f>>>13)|0)+(Ja>>>26)|0,Ja&=67108863,S=Math.imul(ze,ye),f=Math.imul(ze,me),f=f+Math.imul(ke,ye)|0,E=Math.imul(ke,me),S=S+Math.imul(qe,Re)|0,f=f+Math.imul(qe,bt)|0,f=f+Math.imul(Te,Re)|0,E=E+Math.imul(Te,bt)|0,S=S+Math.imul(ae,et)|0,f=f+Math.imul(ae,_t)|0,f=f+Math.imul(le,et)|0,E=E+Math.imul(le,_t)|0,S=S+Math.imul(X,Et)|0,f=f+Math.imul(X,xt)|0,f=f+Math.imul(J,Et)|0,E=E+Math.imul(J,xt)|0;var Qa=(B+S|0)+((f&8191)<<13)|0;B=(E+(f>>>13)|0)+(Qa>>>26)|0,Qa&=67108863,S=Math.imul(Ve,ye),f=Math.imul(Ve,me),f=f+Math.imul(Je,ye)|0,E=Math.imul(Je,me),S=S+Math.imul(ze,Re)|0,f=f+Math.imul(ze,bt)|0,f=f+Math.imul(ke,Re)|0,E=E+Math.imul(ke,bt)|0,S=S+Math.imul(qe,et)|0,f=f+Math.imul(qe,_t)|0,f=f+Math.imul(Te,et)|0,E=E+Math.imul(Te,_t)|0,S=S+Math.imul(ae,Et)|0,f=f+Math.imul(ae,xt)|0,f=f+Math.imul(le,Et)|0,E=E+Math.imul(le,xt)|0,S=S+Math.imul(X,At)|0,f=f+Math.imul(X,Mt)|0,f=f+Math.imul(J,At)|0,E=E+Math.imul(J,Mt)|0;var ec=(B+S|0)+((f&8191)<<13)|0;B=(E+(f>>>13)|0)+(ec>>>26)|0,ec&=67108863,S=Math.imul(ut,ye),f=Math.imul(ut,me),f=f+Math.imul(ct,ye)|0,E=Math.imul(ct,me),S=S+Math.imul(Ve,Re)|0,f=f+Math.imul(Ve,bt)|0,f=f+Math.imul(Je,Re)|0,E=E+Math.imul(Je,bt)|0,S=S+Math.imul(ze,et)|0,f=f+Math.imul(ze,_t)|0,f=f+Math.imul(ke,et)|0,E=E+Math.imul(ke,_t)|0,S=S+Math.imul(qe,Et)|0,f=f+Math.imul(qe,xt)|0,f=f+Math.imul(Te,Et)|0,E=E+Math.imul(Te,xt)|0,S=S+Math.imul(ae,At)|0,f=f+Math.imul(ae,Mt)|0,f=f+Math.imul(le,At)|0,E=E+Math.imul(le,Mt)|0,S=S+Math.imul(X,Tt)|0,f=f+Math.imul(X,It)|0,f=f+Math.imul(J,Tt)|0,E=E+Math.imul(J,It)|0;var tc=(B+S|0)+((f&8191)<<13)|0;B=(E+(f>>>13)|0)+(tc>>>26)|0,tc&=67108863,S=Math.imul(dt,ye),f=Math.imul(dt,me),f=f+Math.imul(lt,ye)|0,E=Math.imul(lt,me),S=S+Math.imul(ut,Re)|0,f=f+Math.imul(ut,bt)|0,f=f+Math.imul(ct,Re)|0,E=E+Math.imul(ct,bt)|0,S=S+Math.imul(Ve,et)|0,f=f+Math.imul(Ve,_t)|0,f=f+Math.imul(Je,et)|0,E=E+Math.imul(Je,_t)|0,S=S+Math.imul(ze,Et)|0,f=f+Math.imul(ze,xt)|0,f=f+Math.imul(ke,Et)|0,E=E+Math.imul(ke,xt)|0,S=S+Math.imul(qe,At)|0,f=f+Math.imul(qe,Mt)|0,f=f+Math.imul(Te,At)|0,E=E+Math.imul(Te,Mt)|0,S=S+Math.imul(ae,Tt)|0,f=f+Math.imul(ae,It)|0,f=f+Math.imul(le,Tt)|0,E=E+Math.imul(le,It)|0,S=S+Math.imul(X,Ot)|0,f=f+Math.imul(X,Bt)|0,f=f+Math.imul(J,Ot)|0,E=E+Math.imul(J,Bt)|0;var rc=(B+S|0)+((f&8191)<<13)|0;B=(E+(f>>>13)|0)+(rc>>>26)|0,rc&=67108863,S=Math.imul(ht,ye),f=Math.imul(ht,me),f=f+Math.imul($e,ye)|0,E=Math.imul($e,me),S=S+Math.imul(dt,Re)|0,f=f+Math.imul(dt,bt)|0,f=f+Math.imul(lt,Re)|0,E=E+Math.imul(lt,bt)|0,S=S+Math.imul(ut,et)|0,f=f+Math.imul(ut,_t)|0,f=f+Math.imul(ct,et)|0,E=E+Math.imul(ct,_t)|0,S=S+Math.imul(Ve,Et)|0,f=f+Math.imul(Ve,xt)|0,f=f+Math.imul(Je,Et)|0,E=E+Math.imul(Je,xt)|0,S=S+Math.imul(ze,At)|0,f=f+Math.imul(ze,Mt)|0,f=f+Math.imul(ke,At)|0,E=E+Math.imul(ke,Mt)|0,S=S+Math.imul(qe,Tt)|0,f=f+Math.imul(qe,It)|0,f=f+Math.imul(Te,Tt)|0,E=E+Math.imul(Te,It)|0,S=S+Math.imul(ae,Ot)|0,f=f+Math.imul(ae,Bt)|0,f=f+Math.imul(le,Ot)|0,E=E+Math.imul(le,Bt)|0,S=S+Math.imul(X,Pt)|0,f=f+Math.imul(X,jt)|0,f=f+Math.imul(J,Pt)|0,E=E+Math.imul(J,jt)|0;var nc=(B+S|0)+((f&8191)<<13)|0;B=(E+(f>>>13)|0)+(nc>>>26)|0,nc&=67108863,S=Math.imul(k,ye),f=Math.imul(k,me),f=f+Math.imul(R,ye)|0,E=Math.imul(R,me),S=S+Math.imul(ht,Re)|0,f=f+Math.imul(ht,bt)|0,f=f+Math.imul($e,Re)|0,E=E+Math.imul($e,bt)|0,S=S+Math.imul(dt,et)|0,f=f+Math.imul(dt,_t)|0,f=f+Math.imul(lt,et)|0,E=E+Math.imul(lt,_t)|0,S=S+Math.imul(ut,Et)|0,f=f+Math.imul(ut,xt)|0,f=f+Math.imul(ct,Et)|0,E=E+Math.imul(ct,xt)|0,S=S+Math.imul(Ve,At)|0,f=f+Math.imul(Ve,Mt)|0,f=f+Math.imul(Je,At)|0,E=E+Math.imul(Je,Mt)|0,S=S+Math.imul(ze,Tt)|0,f=f+Math.imul(ze,It)|0,f=f+Math.imul(ke,Tt)|0,E=E+Math.imul(ke,It)|0,S=S+Math.imul(qe,Ot)|0,f=f+Math.imul(qe,Bt)|0,f=f+Math.imul(Te,Ot)|0,E=E+Math.imul(Te,Bt)|0,S=S+Math.imul(ae,Pt)|0,f=f+Math.imul(ae,jt)|0,f=f+Math.imul(le,Pt)|0,E=E+Math.imul(le,jt)|0,S=S+Math.imul(X,Nt)|0,f=f+Math.imul(X,kt)|0,f=f+Math.imul(J,Nt)|0,E=E+Math.imul(J,kt)|0;var ic=(B+S|0)+((f&8191)<<13)|0;B=(E+(f>>>13)|0)+(ic>>>26)|0,ic&=67108863,S=Math.imul(Y,ye),f=Math.imul(Y,me),f=f+Math.imul(ie,ye)|0,E=Math.imul(ie,me),S=S+Math.imul(k,Re)|0,f=f+Math.imul(k,bt)|0,f=f+Math.imul(R,Re)|0,E=E+Math.imul(R,bt)|0,S=S+Math.imul(ht,et)|0,f=f+Math.imul(ht,_t)|0,f=f+Math.imul($e,et)|0,E=E+Math.imul($e,_t)|0,S=S+Math.imul(dt,Et)|0,f=f+Math.imul(dt,xt)|0,f=f+Math.imul(lt,Et)|0,E=E+Math.imul(lt,xt)|0,S=S+Math.imul(ut,At)|0,f=f+Math.imul(ut,Mt)|0,f=f+Math.imul(ct,At)|0,E=E+Math.imul(ct,Mt)|0,S=S+Math.imul(Ve,Tt)|0,f=f+Math.imul(Ve,It)|0,f=f+Math.imul(Je,Tt)|0,E=E+Math.imul(Je,It)|0,S=S+Math.imul(ze,Ot)|0,f=f+Math.imul(ze,Bt)|0,f=f+Math.imul(ke,Ot)|0,E=E+Math.imul(ke,Bt)|0,S=S+Math.imul(qe,Pt)|0,f=f+Math.imul(qe,jt)|0,f=f+Math.imul(Te,Pt)|0,E=E+Math.imul(Te,jt)|0,S=S+Math.imul(ae,Nt)|0,f=f+Math.imul(ae,kt)|0,f=f+Math.imul(le,Nt)|0,E=E+Math.imul(le,kt)|0,S=S+Math.imul(X,Rt)|0,f=f+Math.imul(X,qt)|0,f=f+Math.imul(J,Rt)|0,E=E+Math.imul(J,qt)|0;var sc=(B+S|0)+((f&8191)<<13)|0;B=(E+(f>>>13)|0)+(sc>>>26)|0,sc&=67108863,S=Math.imul(Y,Re),f=Math.imul(Y,bt),f=f+Math.imul(ie,Re)|0,E=Math.imul(ie,bt),S=S+Math.imul(k,et)|0,f=f+Math.imul(k,_t)|0,f=f+Math.imul(R,et)|0,E=E+Math.imul(R,_t)|0,S=S+Math.imul(ht,Et)|0,f=f+Math.imul(ht,xt)|0,f=f+Math.imul($e,Et)|0,E=E+Math.imul($e,xt)|0,S=S+Math.imul(dt,At)|0,f=f+Math.imul(dt,Mt)|0,f=f+Math.imul(lt,At)|0,E=E+Math.imul(lt,Mt)|0,S=S+Math.imul(ut,Tt)|0,f=f+Math.imul(ut,It)|0,f=f+Math.imul(ct,Tt)|0,E=E+Math.imul(ct,It)|0,S=S+Math.imul(Ve,Ot)|0,f=f+Math.imul(Ve,Bt)|0,f=f+Math.imul(Je,Ot)|0,E=E+Math.imul(Je,Bt)|0,S=S+Math.imul(ze,Pt)|0,f=f+Math.imul(ze,jt)|0,f=f+Math.imul(ke,Pt)|0,E=E+Math.imul(ke,jt)|0,S=S+Math.imul(qe,Nt)|0,f=f+Math.imul(qe,kt)|0,f=f+Math.imul(Te,Nt)|0,E=E+Math.imul(Te,kt)|0,S=S+Math.imul(ae,Rt)|0,f=f+Math.imul(ae,qt)|0,f=f+Math.imul(le,Rt)|0,E=E+Math.imul(le,qt)|0;var oc=(B+S|0)+((f&8191)<<13)|0;B=(E+(f>>>13)|0)+(oc>>>26)|0,oc&=67108863,S=Math.imul(Y,et),f=Math.imul(Y,_t),f=f+Math.imul(ie,et)|0,E=Math.imul(ie,_t),S=S+Math.imul(k,Et)|0,f=f+Math.imul(k,xt)|0,f=f+Math.imul(R,Et)|0,E=E+Math.imul(R,xt)|0,S=S+Math.imul(ht,At)|0,f=f+Math.imul(ht,Mt)|0,f=f+Math.imul($e,At)|0,E=E+Math.imul($e,Mt)|0,S=S+Math.imul(dt,Tt)|0,f=f+Math.imul(dt,It)|0,f=f+Math.imul(lt,Tt)|0,E=E+Math.imul(lt,It)|0,S=S+Math.imul(ut,Ot)|0,f=f+Math.imul(ut,Bt)|0,f=f+Math.imul(ct,Ot)|0,E=E+Math.imul(ct,Bt)|0,S=S+Math.imul(Ve,Pt)|0,f=f+Math.imul(Ve,jt)|0,f=f+Math.imul(Je,Pt)|0,E=E+Math.imul(Je,jt)|0,S=S+Math.imul(ze,Nt)|0,f=f+Math.imul(ze,kt)|0,f=f+Math.imul(ke,Nt)|0,E=E+Math.imul(ke,kt)|0,S=S+Math.imul(qe,Rt)|0,f=f+Math.imul(qe,qt)|0,f=f+Math.imul(Te,Rt)|0,E=E+Math.imul(Te,qt)|0;var ac=(B+S|0)+((f&8191)<<13)|0;B=(E+(f>>>13)|0)+(ac>>>26)|0,ac&=67108863,S=Math.imul(Y,Et),f=Math.imul(Y,xt),f=f+Math.imul(ie,Et)|0,E=Math.imul(ie,xt),S=S+Math.imul(k,At)|0,f=f+Math.imul(k,Mt)|0,f=f+Math.imul(R,At)|0,E=E+Math.imul(R,Mt)|0,S=S+Math.imul(ht,Tt)|0,f=f+Math.imul(ht,It)|0,f=f+Math.imul($e,Tt)|0,E=E+Math.imul($e,It)|0,S=S+Math.imul(dt,Ot)|0,f=f+Math.imul(dt,Bt)|0,f=f+Math.imul(lt,Ot)|0,E=E+Math.imul(lt,Bt)|0,S=S+Math.imul(ut,Pt)|0,f=f+Math.imul(ut,jt)|0,f=f+Math.imul(ct,Pt)|0,E=E+Math.imul(ct,jt)|0,S=S+Math.imul(Ve,Nt)|0,f=f+Math.imul(Ve,kt)|0,f=f+Math.imul(Je,Nt)|0,E=E+Math.imul(Je,kt)|0,S=S+Math.imul(ze,Rt)|0,f=f+Math.imul(ze,qt)|0,f=f+Math.imul(ke,Rt)|0,E=E+Math.imul(ke,qt)|0;var cc=(B+S|0)+((f&8191)<<13)|0;B=(E+(f>>>13)|0)+(cc>>>26)|0,cc&=67108863,S=Math.imul(Y,At),f=Math.imul(Y,Mt),f=f+Math.imul(ie,At)|0,E=Math.imul(ie,Mt),S=S+Math.imul(k,Tt)|0,f=f+Math.imul(k,It)|0,f=f+Math.imul(R,Tt)|0,E=E+Math.imul(R,It)|0,S=S+Math.imul(ht,Ot)|0,f=f+Math.imul(ht,Bt)|0,f=f+Math.imul($e,Ot)|0,E=E+Math.imul($e,Bt)|0,S=S+Math.imul(dt,Pt)|0,f=f+Math.imul(dt,jt)|0,f=f+Math.imul(lt,Pt)|0,E=E+Math.imul(lt,jt)|0,S=S+Math.imul(ut,Nt)|0,f=f+Math.imul(ut,kt)|0,f=f+Math.imul(ct,Nt)|0,E=E+Math.imul(ct,kt)|0,S=S+Math.imul(Ve,Rt)|0,f=f+Math.imul(Ve,qt)|0,f=f+Math.imul(Je,Rt)|0,E=E+Math.imul(Je,qt)|0;var fc=(B+S|0)+((f&8191)<<13)|0;B=(E+(f>>>13)|0)+(fc>>>26)|0,fc&=67108863,S=Math.imul(Y,Tt),f=Math.imul(Y,It),f=f+Math.imul(ie,Tt)|0,E=Math.imul(ie,It),S=S+Math.imul(k,Ot)|0,f=f+Math.imul(k,Bt)|0,f=f+Math.imul(R,Ot)|0,E=E+Math.imul(R,Bt)|0,S=S+Math.imul(ht,Pt)|0,f=f+Math.imul(ht,jt)|0,f=f+Math.imul($e,Pt)|0,E=E+Math.imul($e,jt)|0,S=S+Math.imul(dt,Nt)|0,f=f+Math.imul(dt,kt)|0,f=f+Math.imul(lt,Nt)|0,E=E+Math.imul(lt,kt)|0,S=S+Math.imul(ut,Rt)|0,f=f+Math.imul(ut,qt)|0,f=f+Math.imul(ct,Rt)|0,E=E+Math.imul(ct,qt)|0;var uc=(B+S|0)+((f&8191)<<13)|0;B=(E+(f>>>13)|0)+(uc>>>26)|0,uc&=67108863,S=Math.imul(Y,Ot),f=Math.imul(Y,Bt),f=f+Math.imul(ie,Ot)|0,E=Math.imul(ie,Bt),S=S+Math.imul(k,Pt)|0,f=f+Math.imul(k,jt)|0,f=f+Math.imul(R,Pt)|0,E=E+Math.imul(R,jt)|0,S=S+Math.imul(ht,Nt)|0,f=f+Math.imul(ht,kt)|0,f=f+Math.imul($e,Nt)|0,E=E+Math.imul($e,kt)|0,S=S+Math.imul(dt,Rt)|0,f=f+Math.imul(dt,qt)|0,f=f+Math.imul(lt,Rt)|0,E=E+Math.imul(lt,qt)|0;var dc=(B+S|0)+((f&8191)<<13)|0;B=(E+(f>>>13)|0)+(dc>>>26)|0,dc&=67108863,S=Math.imul(Y,Pt),f=Math.imul(Y,jt),f=f+Math.imul(ie,Pt)|0,E=Math.imul(ie,jt),S=S+Math.imul(k,Nt)|0,f=f+Math.imul(k,kt)|0,f=f+Math.imul(R,Nt)|0,E=E+Math.imul(R,kt)|0,S=S+Math.imul(ht,Rt)|0,f=f+Math.imul(ht,qt)|0,f=f+Math.imul($e,Rt)|0,E=E+Math.imul($e,qt)|0;var lc=(B+S|0)+((f&8191)<<13)|0;B=(E+(f>>>13)|0)+(lc>>>26)|0,lc&=67108863,S=Math.imul(Y,Nt),f=Math.imul(Y,kt),f=f+Math.imul(ie,Nt)|0,E=Math.imul(ie,kt),S=S+Math.imul(k,Rt)|0,f=f+Math.imul(k,qt)|0,f=f+Math.imul(R,Rt)|0,E=E+Math.imul(R,qt)|0;var hc=(B+S|0)+((f&8191)<<13)|0;B=(E+(f>>>13)|0)+(hc>>>26)|0,hc&=67108863,S=Math.imul(Y,Rt),f=Math.imul(Y,qt),f=f+Math.imul(ie,Rt)|0,E=Math.imul(ie,qt);var bc=(B+S|0)+((f&8191)<<13)|0;return B=(E+(f>>>13)|0)+(bc>>>26)|0,bc&=67108863,x[0]=Xa,x[1]=Ya,x[2]=Ja,x[3]=Qa,x[4]=ec,x[5]=tc,x[6]=rc,x[7]=nc,x[8]=ic,x[9]=sc,x[10]=oc,x[11]=ac,x[12]=cc,x[13]=fc,x[14]=uc,x[15]=dc,x[16]=lc,x[17]=hc,x[18]=bc,B!==0&&(x[19]=B,b.length++),b};Math.imul||(_=v);function m(A,o,l){l.negative=o.negative^A.negative,l.length=A.length+o.length;for(var b=0,u=0,g=0;g<l.length-1;g++){var x=u;u=0;for(var B=b&67108863,S=Math.min(g,o.length-1),f=Math.max(0,g-A.length+1);f<=S;f++){var E=g-f,W=A.words[E]|0,X=o.words[f]|0,J=W*X,te=J&67108863;x=x+(J/67108864|0)|0,te=te+B|0,B=te&67108863,x=x+(te>>>26)|0,u+=x>>>26,x&=67108863}l.words[g]=B,b=x,x=u}return b!==0?l.words[g]=b:l.length--,l.strip()}function M(A,o,l){var b=new N;return b.mulp(A,o,l)}i.prototype.mulTo=function(o,l){var b,u=this.length+o.length;return this.length===10&&o.length===10?b=_(this,o,l):u<63?b=v(this,o,l):u<1024?b=m(this,o,l):b=M(this,o,l),b};function N(A,o){this.x=A,this.y=o}N.prototype.makeRBT=function(o){for(var l=new Array(o),b=i.prototype._countBits(o)-1,u=0;u<o;u++)l[u]=this.revBin(u,b,o);return l},N.prototype.revBin=function(o,l,b){if(o===0||o===b-1)return o;for(var u=0,g=0;g<l;g++)u|=(o&1)<<l-g-1,o>>=1;return u},N.prototype.permute=function(o,l,b,u,g,x){for(var B=0;B<x;B++)u[B]=l[o[B]],g[B]=b[o[B]]},N.prototype.transform=function(o,l,b,u,g,x){this.permute(x,o,l,b,u,g);for(var B=1;B<g;B<<=1)for(var S=B<<1,f=Math.cos(2*Math.PI/S),E=Math.sin(2*Math.PI/S),W=0;W<g;W+=S)for(var X=f,J=E,te=0;te<B;te++){var ae=b[W+te],le=u[W+te],st=b[W+te+B],qe=u[W+te+B],Te=X*st-J*qe;qe=X*qe+J*st,st=Te,b[W+te]=ae+st,u[W+te]=le+qe,b[W+te+B]=ae-st,u[W+te+B]=le-qe,te!==S&&(Te=f*X-E*J,J=f*J+E*X,X=Te)}},N.prototype.guessLen13b=function(o,l){var b=Math.max(l,o)|1,u=b&1,g=0;for(b=b/2|0;b;b=b>>>1)g++;return 1<<g+1+u},N.prototype.conjugate=function(o,l,b){if(!(b<=1))for(var u=0;u<b/2;u++){var g=o[u];o[u]=o[b-u-1],o[b-u-1]=g,g=l[u],l[u]=-l[b-u-1],l[b-u-1]=-g}},N.prototype.normalize13b=function(o,l){for(var b=0,u=0;u<l/2;u++){var g=Math.round(o[2*u+1]/l)*8192+Math.round(o[2*u]/l)+b;o[u]=g&67108863,g<67108864?b=0:b=g/67108864|0}return o},N.prototype.convert13b=function(o,l,b,u){for(var g=0,x=0;x<l;x++)g=g+(o[x]|0),b[2*x]=g&8191,g=g>>>13,b[2*x+1]=g&8191,g=g>>>13;for(x=2*l;x<u;++x)b[x]=0;r(g===0),r((g&-8192)===0)},N.prototype.stub=function(o){for(var l=new Array(o),b=0;b<o;b++)l[b]=0;return l},N.prototype.mulp=function(o,l,b){var u=2*this.guessLen13b(o.length,l.length),g=this.makeRBT(u),x=this.stub(u),B=new Array(u),S=new Array(u),f=new Array(u),E=new Array(u),W=new Array(u),X=new Array(u),J=b.words;J.length=u,this.convert13b(o.words,o.length,B,u),this.convert13b(l.words,l.length,E,u),this.transform(B,x,S,f,u,g),this.transform(E,x,W,X,u,g);for(var te=0;te<u;te++){var ae=S[te]*W[te]-f[te]*X[te];f[te]=S[te]*X[te]+f[te]*W[te],S[te]=ae}return this.conjugate(S,f,u),this.transform(S,f,J,x,u,g),this.conjugate(J,x,u),this.normalize13b(J,u),b.negative=o.negative^l.negative,b.length=o.length+l.length,b.strip()},i.prototype.mul=function(o){var l=new i(null);return l.words=new Array(this.length+o.length),this.mulTo(o,l)},i.prototype.mulf=function(o){var l=new i(null);return l.words=new Array(this.length+o.length),M(this,o,l)},i.prototype.imul=function(o){return this.clone().mulTo(o,this)},i.prototype.imuln=function(o){r(typeof o=="number"),r(o<67108864);for(var l=0,b=0;b<this.length;b++){var u=(this.words[b]|0)*o,g=(u&67108863)+(l&67108863);l>>=26,l+=u/67108864|0,l+=g>>>26,this.words[b]=g&67108863}return l!==0&&(this.words[b]=l,this.length++),this},i.prototype.muln=function(o){return this.clone().imuln(o)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(o){var l=w(o);if(l.length===0)return new i(1);for(var b=this,u=0;u<l.length&&l[u]===0;u++,b=b.sqr());if(++u<l.length)for(var g=b.sqr();u<l.length;u++,g=g.sqr())l[u]!==0&&(b=b.mul(g));return b},i.prototype.iushln=function(o){r(typeof o=="number"&&o>=0);var l=o%26,b=(o-l)/26,u=67108863>>>26-l<<26-l,g;if(l!==0){var x=0;for(g=0;g<this.length;g++){var B=this.words[g]&u,S=(this.words[g]|0)-B<<l;this.words[g]=S|x,x=B>>>26-l}x&&(this.words[g]=x,this.length++)}if(b!==0){for(g=this.length-1;g>=0;g--)this.words[g+b]=this.words[g];for(g=0;g<b;g++)this.words[g]=0;this.length+=b}return this.strip()},i.prototype.ishln=function(o){return r(this.negative===0),this.iushln(o)},i.prototype.iushrn=function(o,l,b){r(typeof o=="number"&&o>=0);var u;l?u=(l-l%26)/26:u=0;var g=o%26,x=Math.min((o-g)/26,this.length),B=67108863^67108863>>>g<<g,S=b;if(u-=x,u=Math.max(0,u),S){for(var f=0;f<x;f++)S.words[f]=this.words[f];S.length=x}if(x!==0)if(this.length>x)for(this.length-=x,f=0;f<this.length;f++)this.words[f]=this.words[f+x];else this.words[0]=0,this.length=1;var E=0;for(f=this.length-1;f>=0&&(E!==0||f>=u);f--){var W=this.words[f]|0;this.words[f]=E<<26-g|W>>>g,E=W&B}return S&&E!==0&&(S.words[S.length++]=E),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(o,l,b){return r(this.negative===0),this.iushrn(o,l,b)},i.prototype.shln=function(o){return this.clone().ishln(o)},i.prototype.ushln=function(o){return this.clone().iushln(o)},i.prototype.shrn=function(o){return this.clone().ishrn(o)},i.prototype.ushrn=function(o){return this.clone().iushrn(o)},i.prototype.testn=function(o){r(typeof o=="number"&&o>=0);var l=o%26,b=(o-l)/26,u=1<<l;if(this.length<=b)return!1;var g=this.words[b];return!!(g&u)},i.prototype.imaskn=function(o){r(typeof o=="number"&&o>=0);var l=o%26,b=(o-l)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=b)return this;if(l!==0&&b++,this.length=Math.min(b,this.length),l!==0){var u=67108863^67108863>>>l<<l;this.words[this.length-1]&=u}return this.strip()},i.prototype.maskn=function(o){return this.clone().imaskn(o)},i.prototype.iaddn=function(o){return r(typeof o=="number"),r(o<67108864),o<0?this.isubn(-o):this.negative!==0?this.length===1&&(this.words[0]|0)<o?(this.words[0]=o-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(o),this.negative=1,this):this._iaddn(o)},i.prototype._iaddn=function(o){this.words[0]+=o;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(o){if(r(typeof o=="number"),r(o<67108864),o<0)return this.iaddn(-o);if(this.negative!==0)return this.negative=0,this.iaddn(o),this.negative=1,this;if(this.words[0]-=o,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(o){return this.clone().iaddn(o)},i.prototype.subn=function(o){return this.clone().isubn(o)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(o,l,b){var u=o.length+b,g;this._expand(u);var x,B=0;for(g=0;g<o.length;g++){x=(this.words[g+b]|0)+B;var S=(o.words[g]|0)*l;x-=S&67108863,B=(x>>26)-(S/67108864|0),this.words[g+b]=x&67108863}for(;g<this.length-b;g++)x=(this.words[g+b]|0)+B,B=x>>26,this.words[g+b]=x&67108863;if(B===0)return this.strip();for(r(B===-1),B=0,g=0;g<this.length;g++)x=-(this.words[g]|0)+B,B=x>>26,this.words[g]=x&67108863;return this.negative=1,this.strip()},i.prototype._wordDiv=function(o,l){var b=this.length-o.length,u=this.clone(),g=o,x=g.words[g.length-1]|0,B=this._countBits(x);b=26-B,b!==0&&(g=g.ushln(b),u.iushln(b),x=g.words[g.length-1]|0);var S=u.length-g.length,f;if(l!=="mod"){f=new i(null),f.length=S+1,f.words=new Array(f.length);for(var E=0;E<f.length;E++)f.words[E]=0}var W=u.clone()._ishlnsubmul(g,1,S);W.negative===0&&(u=W,f&&(f.words[S]=1));for(var X=S-1;X>=0;X--){var J=(u.words[g.length+X]|0)*67108864+(u.words[g.length+X-1]|0);for(J=Math.min(J/x|0,67108863),u._ishlnsubmul(g,J,X);u.negative!==0;)J--,u.negative=0,u._ishlnsubmul(g,1,X),u.isZero()||(u.negative^=1);f&&(f.words[X]=J)}return f&&f.strip(),u.strip(),l!=="div"&&b!==0&&u.iushrn(b),{div:f||null,mod:u}},i.prototype.divmod=function(o,l,b){if(r(!o.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var u,g,x;return this.negative!==0&&o.negative===0?(x=this.neg().divmod(o,l),l!=="mod"&&(u=x.div.neg()),l!=="div"&&(g=x.mod.neg(),b&&g.negative!==0&&g.iadd(o)),{div:u,mod:g}):this.negative===0&&o.negative!==0?(x=this.divmod(o.neg(),l),l!=="mod"&&(u=x.div.neg()),{div:u,mod:x.mod}):(this.negative&o.negative)!==0?(x=this.neg().divmod(o.neg(),l),l!=="div"&&(g=x.mod.neg(),b&&g.negative!==0&&g.isub(o)),{div:x.div,mod:g}):o.length>this.length||this.cmp(o)<0?{div:new i(0),mod:this}:o.length===1?l==="div"?{div:this.divn(o.words[0]),mod:null}:l==="mod"?{div:null,mod:new i(this.modn(o.words[0]))}:{div:this.divn(o.words[0]),mod:new i(this.modn(o.words[0]))}:this._wordDiv(o,l)},i.prototype.div=function(o){return this.divmod(o,"div",!1).div},i.prototype.mod=function(o){return this.divmod(o,"mod",!1).mod},i.prototype.umod=function(o){return this.divmod(o,"mod",!0).mod},i.prototype.divRound=function(o){var l=this.divmod(o);if(l.mod.isZero())return l.div;var b=l.div.negative!==0?l.mod.isub(o):l.mod,u=o.ushrn(1),g=o.andln(1),x=b.cmp(u);return x<0||g===1&&x===0?l.div:l.div.negative!==0?l.div.isubn(1):l.div.iaddn(1)},i.prototype.modn=function(o){r(o<=67108863);for(var l=(1<<26)%o,b=0,u=this.length-1;u>=0;u--)b=(l*b+(this.words[u]|0))%o;return b},i.prototype.idivn=function(o){r(o<=67108863);for(var l=0,b=this.length-1;b>=0;b--){var u=(this.words[b]|0)+l*67108864;this.words[b]=u/o|0,l=u%o}return this.strip()},i.prototype.divn=function(o){return this.clone().idivn(o)},i.prototype.egcd=function(o){r(o.negative===0),r(!o.isZero());var l=this,b=o.clone();l.negative!==0?l=l.umod(o):l=l.clone();for(var u=new i(1),g=new i(0),x=new i(0),B=new i(1),S=0;l.isEven()&&b.isEven();)l.iushrn(1),b.iushrn(1),++S;for(var f=b.clone(),E=l.clone();!l.isZero();){for(var W=0,X=1;(l.words[0]&X)===0&&W<26;++W,X<<=1);if(W>0)for(l.iushrn(W);W-- >0;)(u.isOdd()||g.isOdd())&&(u.iadd(f),g.isub(E)),u.iushrn(1),g.iushrn(1);for(var J=0,te=1;(b.words[0]&te)===0&&J<26;++J,te<<=1);if(J>0)for(b.iushrn(J);J-- >0;)(x.isOdd()||B.isOdd())&&(x.iadd(f),B.isub(E)),x.iushrn(1),B.iushrn(1);l.cmp(b)>=0?(l.isub(b),u.isub(x),g.isub(B)):(b.isub(l),x.isub(u),B.isub(g))}return{a:x,b:B,gcd:b.iushln(S)}},i.prototype._invmp=function(o){r(o.negative===0),r(!o.isZero());var l=this,b=o.clone();l.negative!==0?l=l.umod(o):l=l.clone();for(var u=new i(1),g=new i(0),x=b.clone();l.cmpn(1)>0&&b.cmpn(1)>0;){for(var B=0,S=1;(l.words[0]&S)===0&&B<26;++B,S<<=1);if(B>0)for(l.iushrn(B);B-- >0;)u.isOdd()&&u.iadd(x),u.iushrn(1);for(var f=0,E=1;(b.words[0]&E)===0&&f<26;++f,E<<=1);if(f>0)for(b.iushrn(f);f-- >0;)g.isOdd()&&g.iadd(x),g.iushrn(1);l.cmp(b)>=0?(l.isub(b),u.isub(g)):(b.isub(l),g.isub(u))}var W;return l.cmpn(1)===0?W=u:W=g,W.cmpn(0)<0&&W.iadd(o),W},i.prototype.gcd=function(o){if(this.isZero())return o.abs();if(o.isZero())return this.abs();var l=this.clone(),b=o.clone();l.negative=0,b.negative=0;for(var u=0;l.isEven()&&b.isEven();u++)l.iushrn(1),b.iushrn(1);do{for(;l.isEven();)l.iushrn(1);for(;b.isEven();)b.iushrn(1);var g=l.cmp(b);if(g<0){var x=l;l=b,b=x}else if(g===0||b.cmpn(1)===0)break;l.isub(b)}while(!0);return b.iushln(u)},i.prototype.invm=function(o){return this.egcd(o).a.umod(o)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(o){return this.words[0]&o},i.prototype.bincn=function(o){r(typeof o=="number");var l=o%26,b=(o-l)/26,u=1<<l;if(this.length<=b)return this._expand(b+1),this.words[b]|=u,this;for(var g=u,x=b;g!==0&&x<this.length;x++){var B=this.words[x]|0;B+=g,g=B>>>26,B&=67108863,this.words[x]=B}return g!==0&&(this.words[x]=g,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(o){var l=o<0;if(this.negative!==0&&!l)return-1;if(this.negative===0&&l)return 1;this.strip();var b;if(this.length>1)b=1;else{l&&(o=-o),r(o<=67108863,"Number is too big");var u=this.words[0]|0;b=u===o?0:u<o?-1:1}return this.negative!==0?-b|0:b},i.prototype.cmp=function(o){if(this.negative!==0&&o.negative===0)return-1;if(this.negative===0&&o.negative!==0)return 1;var l=this.ucmp(o);return this.negative!==0?-l|0:l},i.prototype.ucmp=function(o){if(this.length>o.length)return 1;if(this.length<o.length)return-1;for(var l=0,b=this.length-1;b>=0;b--){var u=this.words[b]|0,g=o.words[b]|0;if(u!==g){u<g?l=-1:u>g&&(l=1);break}}return l},i.prototype.gtn=function(o){return this.cmpn(o)===1},i.prototype.gt=function(o){return this.cmp(o)===1},i.prototype.gten=function(o){return this.cmpn(o)>=0},i.prototype.gte=function(o){return this.cmp(o)>=0},i.prototype.ltn=function(o){return this.cmpn(o)===-1},i.prototype.lt=function(o){return this.cmp(o)===-1},i.prototype.lten=function(o){return this.cmpn(o)<=0},i.prototype.lte=function(o){return this.cmp(o)<=0},i.prototype.eqn=function(o){return this.cmpn(o)===0},i.prototype.eq=function(o){return this.cmp(o)===0},i.red=function(o){return new z(o)},i.prototype.toRed=function(o){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),o.convertTo(this)._forceRed(o)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(o){return this.red=o,this},i.prototype.forceRed=function(o){return r(!this.red,"Already a number in reduction context"),this._forceRed(o)},i.prototype.redAdd=function(o){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,o)},i.prototype.redIAdd=function(o){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,o)},i.prototype.redSub=function(o){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,o)},i.prototype.redISub=function(o){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,o)},i.prototype.redShl=function(o){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,o)},i.prototype.redMul=function(o){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.mul(this,o)},i.prototype.redIMul=function(o){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.imul(this,o)},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(o){return r(this.red&&!o.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,o)};var L={k256:null,p224:null,p192:null,p25519:null};function C(A,o){this.name=A,this.p=new i(o,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}C.prototype._tmp=function(){var o=new i(null);return o.words=new Array(Math.ceil(this.n/13)),o},C.prototype.ireduce=function(o){var l=o,b;do this.split(l,this.tmp),l=this.imulK(l),l=l.iadd(this.tmp),b=l.bitLength();while(b>this.n);var u=b<this.n?-1:l.ucmp(this.p);return u===0?(l.words[0]=0,l.length=1):u>0?l.isub(this.p):l.strip!==void 0?l.strip():l._strip(),l},C.prototype.split=function(o,l){o.iushrn(this.n,0,l)},C.prototype.imulK=function(o){return o.imul(this.k)};function V(){C.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(V,C),V.prototype.split=function(o,l){for(var b=4194303,u=Math.min(o.length,9),g=0;g<u;g++)l.words[g]=o.words[g];if(l.length=u,o.length<=9){o.words[0]=0,o.length=1;return}var x=o.words[9];for(l.words[l.length++]=x&b,g=10;g<o.length;g++){var B=o.words[g]|0;o.words[g-10]=(B&b)<<4|x>>>22,x=B}x>>>=22,o.words[g-10]=x,x===0&&o.length>10?o.length-=10:o.length-=9},V.prototype.imulK=function(o){o.words[o.length]=0,o.words[o.length+1]=0,o.length+=2;for(var l=0,b=0;b<o.length;b++){var u=o.words[b]|0;l+=u*977,o.words[b]=l&67108863,l=u*64+(l/67108864|0)}return o.words[o.length-1]===0&&(o.length--,o.words[o.length-1]===0&&o.length--),o};function F(){C.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(F,C);function H(){C.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(H,C);function G(){C.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(G,C),G.prototype.imulK=function(o){for(var l=0,b=0;b<o.length;b++){var u=(o.words[b]|0)*19+l,g=u&67108863;u>>>=26,o.words[b]=g,l=u}return l!==0&&(o.words[o.length++]=l),o},i._prime=function(o){if(L[o])return L[o];var l;if(o==="k256")l=new V;else if(o==="p224")l=new F;else if(o==="p192")l=new H;else if(o==="p25519")l=new G;else throw new Error("Unknown prime "+o);return L[o]=l,l};function z(A){if(typeof A=="string"){var o=i._prime(A);this.m=o.p,this.prime=o}else r(A.gtn(1),"modulus must be greater than 1"),this.m=A,this.prime=null}z.prototype._verify1=function(o){r(o.negative===0,"red works only with positives"),r(o.red,"red works only with red numbers")},z.prototype._verify2=function(o,l){r((o.negative|l.negative)===0,"red works only with positives"),r(o.red&&o.red===l.red,"red works only with red numbers")},z.prototype.imod=function(o){return this.prime?this.prime.ireduce(o)._forceRed(this):o.umod(this.m)._forceRed(this)},z.prototype.neg=function(o){return o.isZero()?o.clone():this.m.sub(o)._forceRed(this)},z.prototype.add=function(o,l){this._verify2(o,l);var b=o.add(l);return b.cmp(this.m)>=0&&b.isub(this.m),b._forceRed(this)},z.prototype.iadd=function(o,l){this._verify2(o,l);var b=o.iadd(l);return b.cmp(this.m)>=0&&b.isub(this.m),b},z.prototype.sub=function(o,l){this._verify2(o,l);var b=o.sub(l);return b.cmpn(0)<0&&b.iadd(this.m),b._forceRed(this)},z.prototype.isub=function(o,l){this._verify2(o,l);var b=o.isub(l);return b.cmpn(0)<0&&b.iadd(this.m),b},z.prototype.shl=function(o,l){return this._verify1(o),this.imod(o.ushln(l))},z.prototype.imul=function(o,l){return this._verify2(o,l),this.imod(o.imul(l))},z.prototype.mul=function(o,l){return this._verify2(o,l),this.imod(o.mul(l))},z.prototype.isqr=function(o){return this.imul(o,o.clone())},z.prototype.sqr=function(o){return this.mul(o,o)},z.prototype.sqrt=function(o){if(o.isZero())return o.clone();var l=this.m.andln(3);if(r(l%2===1),l===3){var b=this.m.add(new i(1)).iushrn(2);return this.pow(o,b)}for(var u=this.m.subn(1),g=0;!u.isZero()&&u.andln(1)===0;)g++,u.iushrn(1);r(!u.isZero());var x=new i(1).toRed(this),B=x.redNeg(),S=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);this.pow(f,S).cmp(B)!==0;)f.redIAdd(B);for(var E=this.pow(f,u),W=this.pow(o,u.addn(1).iushrn(1)),X=this.pow(o,u),J=g;X.cmp(x)!==0;){for(var te=X,ae=0;te.cmp(x)!==0;ae++)te=te.redSqr();r(ae<J);var le=this.pow(E,new i(1).iushln(J-ae-1));W=W.redMul(le),E=le.redSqr(),X=X.redMul(E),J=ae}return W},z.prototype.invm=function(o){var l=o._invmp(this.m);return l.negative!==0?(l.negative=0,this.imod(l).redNeg()):this.imod(l)},z.prototype.pow=function(o,l){if(l.isZero())return new i(1).toRed(this);if(l.cmpn(1)===0)return o.clone();var b=4,u=new Array(1<<b);u[0]=new i(1).toRed(this),u[1]=o;for(var g=2;g<u.length;g++)u[g]=this.mul(u[g-1],o);var x=u[0],B=0,S=0,f=l.bitLength()%26;for(f===0&&(f=26),g=l.length-1;g>=0;g--){for(var E=l.words[g],W=f-1;W>=0;W--){var X=E>>W&1;if(x!==u[0]&&(x=this.sqr(x)),X===0&&B===0){S=0;continue}B<<=1,B|=X,S++,!(S!==b&&(g!==0||W!==0))&&(x=this.mul(x,u[B]),S=0,B=0)}f=26}return x},z.prototype.convertTo=function(o){var l=o.umod(this.m);return l===o?l.clone():l},z.prototype.convertFrom=function(o){var l=o.clone();return l.red=null,l},i.mont=function(o){return new se(o)};function se(A){z.call(this,A),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(se,z),se.prototype.convertTo=function(o){return this.imod(o.ushln(this.shift))},se.prototype.convertFrom=function(o){var l=this.imod(o.mul(this.rinv));return l.red=null,l},se.prototype.imul=function(o,l){if(o.isZero()||l.isZero())return o.words[0]=0,o.length=1,o;var b=o.imul(l),u=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),g=b.isub(u).iushrn(this.shift),x=g;return g.cmp(this.m)>=0?x=g.isub(this.m):g.cmpn(0)<0&&(x=g.iadd(this.m)),x._forceRed(this)},se.prototype.mul=function(o,l){if(o.isZero()||l.isZero())return new i(0)._forceRed(this);var b=o.mul(l),u=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),g=b.isub(u).iushrn(this.shift),x=g;return g.cmp(this.m)>=0?x=g.isub(this.m):g.cmpn(0)<0&&(x=g.iadd(this.m)),x._forceRed(this)},se.prototype.invm=function(o){var l=this.imod(o._invmp(this.m).mul(this.r2));return l._forceRed(this)}})(typeof Cc>"u"||Cc,Od)});var Nd=K(gr=>{"use strict";I();O();var bg=gr&&gr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(gr,"__esModule",{value:!0});gr.stripHexPrefix=gr.isHexPrefixed=gr.getLength=gr.decode=gr.encode=void 0;var pg=bg(Vt());function Pd(t){if(Array.isArray(t)){let e=[];for(let n=0;n<t.length;n++)e.push(Pd(t[n]));let r=T.Buffer.concat(e);return T.Buffer.concat([Bd(r.length,192),r])}else{let e=Kc(t);return e.length===1&&e[0]<128?e:T.Buffer.concat([Bd(e.length,128),e])}}gr.encode=Pd;function Dc(t,e){if(t[0]==="0"&&t[1]==="0")throw new Error("invalid RLP: extra zeros");return parseInt(t,e)}function Bd(t,e){if(t<56)return T.Buffer.from([t+e]);{let r=Lc(t),n=r.length/2,i=Lc(e+55+n);return T.Buffer.from(i+r,"hex")}}function gg(t,e=!1){if(!t||t.length===0)return T.Buffer.from([]);let r=Kc(t),n=Uc(r);if(e)return n;if(n.remainder.length!==0)throw new Error("invalid remainder");return n.data}gr.decode=gg;function yg(t){if(!t||t.length===0)return T.Buffer.from([]);let e=Kc(t),r=e[0];if(r<=127)return e.length;if(r<=183)return r-127;if(r<=191)return r-182;if(r<=247)return r-191;{let n=r-246,i=Dc(e.slice(1,n).toString("hex"),16);return n+i}}gr.getLength=yg;function Uc(t){let e,r,n,i,s,a=[],c=t[0];if(c<=127)return{data:t.slice(0,1),remainder:t.slice(1)};if(c<=183){if(e=c-127,c===128?n=T.Buffer.from([]):n=t.slice(1,e),e===2&&n[0]<128)throw new Error("invalid rlp encoding: byte must be less 0x80");return{data:n,remainder:t.slice(e)}}else if(c<=191){if(r=c-182,t.length-1<r)throw new Error("invalid RLP: not enough bytes for string length");if(e=Dc(t.slice(1,r).toString("hex"),16),e<=55)throw new Error("invalid RLP: expected string length to be greater than 55");if(n=t.slice(r,e+r),n.length<e)throw new Error("invalid RLP: not enough bytes for string");return{data:n,remainder:t.slice(e+r)}}else if(c<=247){for(e=c-191,i=t.slice(1,e);i.length;)s=Uc(i),a.push(s.data),i=s.remainder;return{data:a,remainder:t.slice(e)}}else{r=c-246,e=Dc(t.slice(1,r).toString("hex"),16);let d=r+e;if(d>t.length)throw new Error("invalid rlp: total length is larger than the data");if(i=t.slice(r,d),i.length===0)throw new Error("invalid rlp, List has a invalid length");for(;i.length;)s=Uc(i),a.push(s.data),i=s.remainder;return{data:a,remainder:t.slice(d)}}}function Hc(t){return t.slice(0,2)==="0x"}gr.isHexPrefixed=Hc;function jd(t){return Hc(t)?t.slice(2):t}gr.stripHexPrefix=jd;function Lc(t){if(t<0)throw new Error("Invalid integer as argument, must be unsigned!");let e=t.toString(16);return e.length%2?`0${e}`:e}function mg(t){return t.length%2?`0${t}`:t}function vg(t){let e=Lc(t);return T.Buffer.from(e,"hex")}function Kc(t){if(!T.Buffer.isBuffer(t)){if(typeof t=="string")return Hc(t)?T.Buffer.from(mg(jd(t)),"hex"):T.Buffer.from(t);if(typeof t=="number"||typeof t=="bigint")return t?vg(t):T.Buffer.from([]);if(t==null)return T.Buffer.from([]);if(t instanceof Uint8Array)return T.Buffer.from(t);if(pg.default.isBN(t))return T.Buffer.from(t.toArray());throw new Error("invalid type")}return t}});var kd=K(Xi=>{"use strict";I();O();Object.defineProperty(Xi,"__esModule",{value:!0});Xi.validateHexString=Xi.isHexString=void 0;function wg(t,e){return t.match(/^0x[0-9A-Fa-f]*$/)?!(e&&t.length!==2+2*e):!1}Xi.isHexString=wg;function Sg(t){if(!t)return!1;let e=t.toLowerCase().startsWith("0x")?t.substring(2).toLowerCase():t.toLowerCase();return!(e.length===0||e.length%2!==0||!e.match(/^[0-9A-Fa-f]*$/))}Xi.validateHexString=Sg});var Rd=K(Po=>{"use strict";I();O();Object.defineProperty(Po,"__esModule",{value:!0});Po.encode=void 0;function _g(t){var e="0123456789abcdef";function r(F){var H,G="";for(H=0;H<=3;H++)G+=e.charAt(F>>H*8+4&15)+e.charAt(F>>H*8&15);return G}function n(F,H){var G=(F&65535)+(H&65535),z=(F>>16)+(H>>16)+(G>>16);return z<<16|G&65535}function i(F,H){return F<<H|F>>>32-H}function s(F,H,G,z,se,A){return n(i(n(n(H,F),n(z,A)),se),G)}function a(F,H,G,z,se,A,o){return s(H&G|~H&z,F,H,se,A,o)}function c(F,H,G,z,se,A,o){return s(H&z|G&~z,F,H,se,A,o)}function d(F,H,G,z,se,A,o){return s(H^G^z,F,H,se,A,o)}function h(F,H,G,z,se,A,o){return s(G^(H|~z),F,H,se,A,o)}function y(F){var H,G=(F.length+8>>6)+1,z=new Array(G*16);for(H=0;H<G*16;H++)z[H]=0;for(H=0;H<F.length;H++)z[H>>2]|=F.charCodeAt(H)<<H%4*8;return z[H>>2]|=128<<H%4*8,z[G*16-2]=F.length*8,z}var p,w=y(""+t),v=1732584193,_=-271733879,m=-1732584194,M=271733878,N,L,C,V;for(p=0;p<w.length;p+=16)N=v,L=_,C=m,V=M,v=a(v,_,m,M,w[p+0],7,-680876936),M=a(M,v,_,m,w[p+1],12,-389564586),m=a(m,M,v,_,w[p+2],17,606105819),_=a(_,m,M,v,w[p+3],22,-1044525330),v=a(v,_,m,M,w[p+4],7,-176418897),M=a(M,v,_,m,w[p+5],12,1200080426),m=a(m,M,v,_,w[p+6],17,-1473231341),_=a(_,m,M,v,w[p+7],22,-45705983),v=a(v,_,m,M,w[p+8],7,1770035416),M=a(M,v,_,m,w[p+9],12,-1958414417),m=a(m,M,v,_,w[p+10],17,-42063),_=a(_,m,M,v,w[p+11],22,-1990404162),v=a(v,_,m,M,w[p+12],7,1804603682),M=a(M,v,_,m,w[p+13],12,-40341101),m=a(m,M,v,_,w[p+14],17,-1502002290),_=a(_,m,M,v,w[p+15],22,1236535329),v=c(v,_,m,M,w[p+1],5,-165796510),M=c(M,v,_,m,w[p+6],9,-1069501632),m=c(m,M,v,_,w[p+11],14,643717713),_=c(_,m,M,v,w[p+0],20,-373897302),v=c(v,_,m,M,w[p+5],5,-701558691),M=c(M,v,_,m,w[p+10],9,38016083),m=c(m,M,v,_,w[p+15],14,-660478335),_=c(_,m,M,v,w[p+4],20,-405537848),v=c(v,_,m,M,w[p+9],5,568446438),M=c(M,v,_,m,w[p+14],9,-1019803690),m=c(m,M,v,_,w[p+3],14,-187363961),_=c(_,m,M,v,w[p+8],20,1163531501),v=c(v,_,m,M,w[p+13],5,-1444681467),M=c(M,v,_,m,w[p+2],9,-51403784),m=c(m,M,v,_,w[p+7],14,1735328473),_=c(_,m,M,v,w[p+12],20,-1926607734),v=d(v,_,m,M,w[p+5],4,-378558),M=d(M,v,_,m,w[p+8],11,-2022574463),m=d(m,M,v,_,w[p+11],16,1839030562),_=d(_,m,M,v,w[p+14],23,-35309556),v=d(v,_,m,M,w[p+1],4,-1530992060),M=d(M,v,_,m,w[p+4],11,1272893353),m=d(m,M,v,_,w[p+7],16,-155497632),_=d(_,m,M,v,w[p+10],23,-1094730640),v=d(v,_,m,M,w[p+13],4,681279174),M=d(M,v,_,m,w[p+0],11,-358537222),m=d(m,M,v,_,w[p+3],16,-722521979),_=d(_,m,M,v,w[p+6],23,76029189),v=d(v,_,m,M,w[p+9],4,-640364487),M=d(M,v,_,m,w[p+12],11,-421815835),m=d(m,M,v,_,w[p+15],16,530742520),_=d(_,m,M,v,w[p+2],23,-995338651),v=h(v,_,m,M,w[p+0],6,-198630844),M=h(M,v,_,m,w[p+7],10,1126891415),m=h(m,M,v,_,w[p+14],15,-1416354905),_=h(_,m,M,v,w[p+5],21,-57434055),v=h(v,_,m,M,w[p+12],6,1700485571),M=h(M,v,_,m,w[p+3],10,-1894986606),m=h(m,M,v,_,w[p+10],15,-1051523),_=h(_,m,M,v,w[p+1],21,-2054922799),v=h(v,_,m,M,w[p+8],6,1873313359),M=h(M,v,_,m,w[p+15],10,-30611744),m=h(m,M,v,_,w[p+6],15,-1560198380),_=h(_,m,M,v,w[p+13],21,1309151649),v=h(v,_,m,M,w[p+4],6,-145523070),M=h(M,v,_,m,w[p+11],10,-1120210379),m=h(m,M,v,_,w[p+2],15,718787259),_=h(_,m,M,v,w[p+9],21,-343485551),v=n(v,N),_=n(_,L),m=n(m,C),M=n(M,V);return r(v)+r(_)+r(m)+r(M)}Po.encode=_g});var zc=K(He=>{"use strict";I();O();var Eg=He&&He.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),xg=He&&He.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Cd=He&&He.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Eg(e,t,r);return xg(e,t),e};Object.defineProperty(He,"__esModule",{value:!0});He.blake2s=He.compress=He.IV=void 0;var Ag=Cd(Ui()),qd=Cd(Mo()),hn=rr();He.IV=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);function Hn(t,e,r,n,i){return t=t+e+i|0,n=(0,hn.rotr)(n^t,16),r=r+n|0,e=(0,hn.rotr)(e^r,12),{a:t,b:e,c:r,d:n}}function Kn(t,e,r,n,i){return t=t+e+i|0,n=(0,hn.rotr)(n^t,8),r=r+n|0,e=(0,hn.rotr)(e^r,7),{a:t,b:e,c:r,d:n}}function Dd(t,e,r,n,i,s,a,c,d,h,y,p,w,v,_,m,M,N,L,C){let V=0;for(let F=0;F<n;F++)({a:i,b:d,c:w,d:M}=Hn(i,d,w,M,r[e+t[V++]])),{a:i,b:d,c:w,d:M}=Kn(i,d,w,M,r[e+t[V++]]),{a:s,b:h,c:v,d:N}=Hn(s,h,v,N,r[e+t[V++]]),{a:s,b:h,c:v,d:N}=Kn(s,h,v,N,r[e+t[V++]]),{a,b:y,c:_,d:L}=Hn(a,y,_,L,r[e+t[V++]]),{a,b:y,c:_,d:L}=Kn(a,y,_,L,r[e+t[V++]]),{a:c,b:p,c:m,d:C}=Hn(c,p,m,C,r[e+t[V++]]),{a:c,b:p,c:m,d:C}=Kn(c,p,m,C,r[e+t[V++]]),{a:i,b:h,c:_,d:C}=Hn(i,h,_,C,r[e+t[V++]]),{a:i,b:h,c:_,d:C}=Kn(i,h,_,C,r[e+t[V++]]),{a:s,b:y,c:m,d:M}=Hn(s,y,m,M,r[e+t[V++]]),{a:s,b:y,c:m,d:M}=Kn(s,y,m,M,r[e+t[V++]]),{a,b:p,c:w,d:N}=Hn(a,p,w,N,r[e+t[V++]]),{a,b:p,c:w,d:N}=Kn(a,p,w,N,r[e+t[V++]]),{a:c,b:d,c:v,d:L}=Hn(c,d,v,L,r[e+t[V++]]),{a:c,b:d,c:v,d:L}=Kn(c,d,v,L,r[e+t[V++]]);return{v0:i,v1:s,v2:a,v3:c,v4:d,v5:h,v6:y,v7:p,v8:w,v9:v,v10:_,v11:m,v12:M,v13:N,v14:L,v15:C}}He.compress=Dd;var Fc=class extends qd.BLAKE2{constructor(e={}){super(64,e.dkLen===void 0?32:e.dkLen,e,32,8,8),this.v0=He.IV[0]|0,this.v1=He.IV[1]|0,this.v2=He.IV[2]|0,this.v3=He.IV[3]|0,this.v4=He.IV[4]|0,this.v5=He.IV[5]|0,this.v6=He.IV[6]|0,this.v7=He.IV[7]|0;let r=e.key?e.key.length:0;if(this.v0^=this.outputLen|r<<8|1<<16|1<<24,e.salt){let n=(0,hn.u32)((0,hn.toBytes)(e.salt));this.v4^=n[0],this.v5^=n[1]}if(e.personalization){let n=(0,hn.u32)((0,hn.toBytes)(e.personalization));this.v6^=n[0],this.v7^=n[1]}if(e.key){let n=new Uint8Array(this.blockLen);n.set((0,hn.toBytes)(e.key)),this.update(n)}}get(){let{v0:e,v1:r,v2:n,v3:i,v4:s,v5:a,v6:c,v7:d}=this;return[e,r,n,i,s,a,c,d]}set(e,r,n,i,s,a,c,d){this.v0=e|0,this.v1=r|0,this.v2=n|0,this.v3=i|0,this.v4=s|0,this.v5=a|0,this.v6=c|0,this.v7=d|0}compress(e,r,n){let{h:i,l:s}=Ag.fromBig(BigInt(this.length)),{v0:a,v1:c,v2:d,v3:h,v4:y,v5:p,v6:w,v7:v,v8:_,v9:m,v10:M,v11:N,v12:L,v13:C,v14:V,v15:F}=Dd(qd.SIGMA,r,e,10,this.v0,this.v1,this.v2,this.v3,this.v4,this.v5,this.v6,this.v7,He.IV[0],He.IV[1],He.IV[2],He.IV[3],s^He.IV[4],i^He.IV[5],n?~He.IV[6]:He.IV[6],He.IV[7]);this.v0^=a^_,this.v1^=c^m,this.v2^=d^M,this.v3^=h^N,this.v4^=y^L,this.v5^=p^C,this.v6^=w^V,this.v7^=v^F}destroy(){this.destroyed=!0,this.buffer32.fill(0),this.set(0,0,0,0,0,0,0,0)}};He.blake2s=(0,hn.wrapConstructorWithOpts)(t=>new Fc(t))});var jo=K(Yi=>{"use strict";I();O();Object.defineProperty(Yi,"__esModule",{value:!0});Yi.pbkdf2Async=Yi.pbkdf2=void 0;var Mg=Us(),bn=rr();function Ud(t,e,r,n){(0,bn.assertHash)(t);let i=(0,bn.checkOpts)({dkLen:32,asyncTick:10},n),{c:s,dkLen:a,asyncTick:c}=i;if((0,bn.assertNumber)(s),(0,bn.assertNumber)(a),(0,bn.assertNumber)(c),s<1)throw new Error("PBKDF2: iterations (c) should be >= 1");let d=(0,bn.toBytes)(e),h=(0,bn.toBytes)(r),y=new Uint8Array(a),p=Mg.hmac.create(t,d),w=p._cloneInto().update(h);return{c:s,dkLen:a,asyncTick:c,DK:y,PRF:p,PRFSalt:w}}function Ld(t,e,r,n,i){return t.destroy(),e.destroy(),n&&n.destroy(),i.fill(0),r}function Tg(t,e,r,n){let{c:i,dkLen:s,DK:a,PRF:c,PRFSalt:d}=Ud(t,e,r,n),h,y=new Uint8Array(4),p=(0,bn.createView)(y),w=new Uint8Array(c.outputLen);for(let v=1,_=0;_<s;v++,_+=c.outputLen){let m=a.subarray(_,_+c.outputLen);p.setInt32(0,v,!1),(h=d._cloneInto(h)).update(y).digestInto(w),m.set(w.subarray(0,m.length));for(let M=1;M<i;M++){c._cloneInto(h).update(w).digestInto(w);for(let N=0;N<m.length;N++)m[N]^=w[N]}}return Ld(c,d,a,h,w)}Yi.pbkdf2=Tg;async function Ig(t,e,r,n){let{c:i,dkLen:s,asyncTick:a,DK:c,PRF:d,PRFSalt:h}=Ud(t,e,r,n),y,p=new Uint8Array(4),w=(0,bn.createView)(p),v=new Uint8Array(d.outputLen);for(let _=1,m=0;m<s;_++,m+=d.outputLen){let M=c.subarray(m,m+d.outputLen);w.setInt32(0,_,!1),(y=h._cloneInto(y)).update(p).digestInto(v),M.set(v.subarray(0,M.length)),await(0,bn.asyncLoop)(i-1,a,N=>{d._cloneInto(y).update(v).digestInto(v);for(let L=0;L<M.length;L++)M[L]^=v[L]})}return Ld(d,h,c,y,v)}Yi.pbkdf2Async=Ig});var $d=K(Qi=>{"use strict";I();O();Object.defineProperty(Qi,"__esModule",{value:!0});Qi.scryptAsync=Qi.scrypt=void 0;var Kd=Di(),Fd=jo(),Or=rr(),De=(t,e)=>t<<e|t>>>32-e;function Hd(t,e,r,n,i,s){let a=t[e++]^r[n++],c=t[e++]^r[n++],d=t[e++]^r[n++],h=t[e++]^r[n++],y=t[e++]^r[n++],p=t[e++]^r[n++],w=t[e++]^r[n++],v=t[e++]^r[n++],_=t[e++]^r[n++],m=t[e++]^r[n++],M=t[e++]^r[n++],N=t[e++]^r[n++],L=t[e++]^r[n++],C=t[e++]^r[n++],V=t[e++]^r[n++],F=t[e++]^r[n++],H=a,G=c,z=d,se=h,A=y,o=p,l=w,b=v,u=_,g=m,x=M,B=N,S=L,f=C,E=V,W=F;for(let X=0;X<8;X+=2)A^=De(H+S|0,7),u^=De(A+H|0,9),S^=De(u+A|0,13),H^=De(S+u|0,18),g^=De(o+G|0,7),f^=De(g+o|0,9),G^=De(f+g|0,13),o^=De(G+f|0,18),E^=De(x+l|0,7),z^=De(E+x|0,9),l^=De(z+E|0,13),x^=De(l+z|0,18),se^=De(W+B|0,7),b^=De(se+W|0,9),B^=De(b+se|0,13),W^=De(B+b|0,18),G^=De(H+se|0,7),z^=De(G+H|0,9),se^=De(z+G|0,13),H^=De(se+z|0,18),l^=De(o+A|0,7),b^=De(l+o|0,9),A^=De(b+l|0,13),o^=De(A+b|0,18),B^=De(x+g|0,7),u^=De(B+x|0,9),g^=De(u+B|0,13),x^=De(g+u|0,18),S^=De(W+E|0,7),f^=De(S+W|0,9),E^=De(f+S|0,13),W^=De(E+f|0,18);i[s++]=a+H|0,i[s++]=c+G|0,i[s++]=d+z|0,i[s++]=h+se|0,i[s++]=y+A|0,i[s++]=p+o|0,i[s++]=w+l|0,i[s++]=v+b|0,i[s++]=_+u|0,i[s++]=m+g|0,i[s++]=M+x|0,i[s++]=N+B|0,i[s++]=L+S|0,i[s++]=C+f|0,i[s++]=V+E|0,i[s++]=F+W|0}function Ji(t,e,r,n,i){let s=n+0,a=n+16*i;for(let c=0;c<16;c++)r[a+c]=t[e+(2*i-1)*16+c];for(let c=0;c<i;c++,s+=16,e+=16)Hd(r,a,t,e,r,s),c>0&&(a+=16),Hd(r,s,t,e+=16,r,a)}function zd(t,e,r){let n=(0,Or.checkOpts)({dkLen:32,asyncTick:10,maxmem:1073742848},r),{N:i,r:s,p:a,dkLen:c,asyncTick:d,maxmem:h,onProgress:y}=n;if((0,Or.assertNumber)(i),(0,Or.assertNumber)(s),(0,Or.assertNumber)(a),(0,Or.assertNumber)(c),(0,Or.assertNumber)(d),(0,Or.assertNumber)(h),y!==void 0&&typeof y!="function")throw new Error("progressCb should be function");let p=128*s,w=p/4;if(i<=1||(i&i-1)!==0||i>=2**(p/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/p)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(c<0||c>(2**32-1)*32)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");let v=p*(i+a);if(v>h)throw new Error(`Scrypt: parameters too large, ${v} (128 * r * (N + p)) > ${h} (maxmem)`);let _=(0,Fd.pbkdf2)(Kd.sha256,t,e,{c:1,dkLen:p*a}),m=(0,Or.u32)(_),M=(0,Or.u32)(new Uint8Array(p*i)),N=(0,Or.u32)(new Uint8Array(p)),L=()=>{};if(y){let C=2*i*a,V=Math.max(Math.floor(C/1e4),1),F=0;L=()=>{F++,y&&(!(F%V)||F===C)&&y(F/C)}}return{N:i,r:s,p:a,dkLen:c,blockSize32:w,V:M,B32:m,B:_,tmp:N,blockMixCb:L,asyncTick:d}}function Vd(t,e,r,n,i){let s=(0,Fd.pbkdf2)(Kd.sha256,t,r,{c:1,dkLen:e});return r.fill(0),n.fill(0),i.fill(0),s}function Og(t,e,r){let{N:n,r:i,p:s,dkLen:a,blockSize32:c,V:d,B32:h,B:y,tmp:p,blockMixCb:w}=zd(t,e,r);for(let v=0;v<s;v++){let _=c*v;for(let m=0;m<c;m++)d[m]=h[_+m];for(let m=0,M=0;m<n-1;m++)Ji(d,M,d,M+=c,i),w();Ji(d,(n-1)*c,h,_,i),w();for(let m=0;m<n;m++){let M=h[_+c-16]%n;for(let N=0;N<c;N++)p[N]=h[_+N]^d[M*c+N];Ji(p,0,h,_,i),w()}}return Vd(t,a,y,d,p)}Qi.scrypt=Og;async function Bg(t,e,r){let{N:n,r:i,p:s,dkLen:a,blockSize32:c,V:d,B32:h,B:y,tmp:p,blockMixCb:w,asyncTick:v}=zd(t,e,r);for(let _=0;_<s;_++){let m=c*_;for(let N=0;N<c;N++)d[N]=h[m+N];let M=0;await(0,Or.asyncLoop)(n-1,v,N=>{Ji(d,M,d,M+=c,i),w()}),Ji(d,(n-1)*c,h,m,i),w(),await(0,Or.asyncLoop)(n,v,N=>{let L=h[m+c-16]%n;for(let C=0;C<c;C++)p[C]=h[m+C]^d[L*c+C];Ji(p,0,h,m,i),w()})}return Vd(t,a,y,d,p)}Qi.scryptAsync=Bg});var Zd=K(pn=>{"use strict";I();O();var Pg=pn&&pn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),jg=pn&&pn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Vc=pn&&pn.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Pg(e,t,r);return jg(e,t),e};Object.defineProperty(pn,"__esModule",{value:!0});pn.blake3=void 0;var Gd=Vc(Ui()),Ng=Vc(Mo()),Wr=Vc(zc()),bi=rr(),Br;(function(t){t[t.CHUNK_START=1]="CHUNK_START",t[t.CHUNK_END=2]="CHUNK_END",t[t.PARENT=4]="PARENT",t[t.ROOT=8]="ROOT",t[t.KEYED_HASH=16]="KEYED_HASH",t[t.DERIVE_KEY_CONTEXT=32]="DERIVE_KEY_CONTEXT",t[t.DERIVE_KEY_MATERIAL=64]="DERIVE_KEY_MATERIAL"})(Br||(Br={}));var Wd=(()=>{let t=Array.from({length:16},(n,i)=>i),e=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=t;n<7;n++,i=e(i))r.push(...i);return Uint8Array.from(r)})(),Ls=class extends Ng.BLAKE2{constructor(e={},r=0){if(super(64,e.dkLen===void 0?32:e.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=e.dkLen===void 0?32:e.dkLen,(0,bi.assertNumber)(this.outputLen),e.key!==void 0&&e.context!==void 0)throw new Error("Blake3: only key or context can be specified at same time");if(e.key!==void 0){let n=(0,bi.toBytes)(e.key);if(n.length!==32)throw new Error("Blake3: key should be 32 byte");this.IV=(0,bi.u32)(n),this.flags=r|Br.KEYED_HASH}else if(e.context!==void 0){let n=new Ls({dkLen:32},Br.DERIVE_KEY_CONTEXT).update(e.context).digest();this.IV=(0,bi.u32)(n),this.flags=r|Br.DERIVE_KEY_MATERIAL}else this.IV=Wr.IV.slice(),this.flags=r;this.state=this.IV.slice(),this.bufferOut=(0,bi.u8)(this.bufferOut32)}get(){return[]}set(){}b2Compress(e,r,n,i=0){let{state:s,pos:a}=this,{h:c,l:d}=Gd.fromBig(BigInt(e),!0),{v0:h,v1:y,v2:p,v3:w,v4:v,v5:_,v6:m,v7:M,v8:N,v9:L,v10:C,v11:V,v12:F,v13:H,v14:G,v15:z}=Wr.compress(Wd,i,n,7,s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7],Wr.IV[0],Wr.IV[1],Wr.IV[2],Wr.IV[3],c,d,a,r);s[0]=h^N,s[1]=y^L,s[2]=p^C,s[3]=w^V,s[4]=v^F,s[5]=_^H,s[6]=m^G,s[7]=M^z}compress(e,r=0,n=!1){let i=this.flags;if(this.chunkPos||(i|=Br.CHUNK_START),(this.chunkPos===15||n)&&(i|=Br.CHUNK_END),n||(this.pos=this.blockLen),this.b2Compress(this.chunksDone,i,e,r),this.chunkPos+=1,this.chunkPos===16||n){let s=this.state;this.state=this.IV.slice();for(let a,c=this.chunksDone+1;(n||!(c&1))&&(a=this.stack.pop());c>>=1)this.buffer32.set(a,0),this.buffer32.set(s,8),this.pos=this.blockLen,this.b2Compress(0,this.flags|Br.PARENT,this.buffer32,0),s=this.state,this.state=this.IV.slice();this.chunksDone++,this.chunkPos=0,this.stack.push(s)}this.pos=0}_cloneInto(e){e=super._cloneInto(e);let{IV:r,flags:n,state:i,chunkPos:s,posOut:a,chunkOut:c,stack:d,chunksDone:h}=this;return e.state.set(i.slice()),e.stack=d.map(y=>Uint32Array.from(y)),e.IV.set(r),e.flags=n,e.chunkPos=s,e.chunksDone=h,e.posOut=a,e.chunkOut=c,e.enableXOF=this.enableXOF,e.bufferOut32.set(this.bufferOut32),e}destroy(){this.destroyed=!0,this.state.fill(0),this.buffer32.fill(0),this.IV.fill(0),this.bufferOut32.fill(0);for(let e of this.stack)e.fill(0)}b2CompressOut(){let{state:e,pos:r,flags:n,buffer32:i,bufferOut32:s}=this,{h:a,l:c}=Gd.fromBig(BigInt(this.chunkOut++)),{v0:d,v1:h,v2:y,v3:p,v4:w,v5:v,v6:_,v7:m,v8:M,v9:N,v10:L,v11:C,v12:V,v13:F,v14:H,v15:G}=Wr.compress(Wd,0,i,7,e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],Wr.IV[0],Wr.IV[1],Wr.IV[2],Wr.IV[3],c,a,r,n);s[0]=d^M,s[1]=h^N,s[2]=y^L,s[3]=p^C,s[4]=w^V,s[5]=v^F,s[6]=_^H,s[7]=m^G,s[8]=e[0]^M,s[9]=e[1]^N,s[10]=e[2]^L,s[11]=e[3]^C,s[12]=e[4]^V,s[13]=e[5]^F,s[14]=e[6]^H,s[15]=e[7]^G,this.posOut=0}finish(){if(this.finished)return;this.finished=!0,this.buffer.fill(0,this.pos);let e=this.flags|Br.ROOT;this.stack.length?(e|=Br.PARENT,this.compress(this.buffer32,0,!0),this.chunksDone=0,this.pos=this.blockLen):e|=(this.chunkPos?0:Br.CHUNK_START)|Br.CHUNK_END,this.flags=e,this.b2CompressOut()}writeInto(e){if(this.destroyed)throw new Error("instance is destroyed");if(!(e instanceof Uint8Array))throw new Error("Blake3: Invalid output buffer");this.finish();let{blockLen:r,bufferOut:n}=this;for(let i=0,s=e.length;i<s;){this.posOut>=r&&this.b2CompressOut();let a=Math.min(this.blockLen-this.posOut,s-i);e.set(n.subarray(this.posOut,this.posOut+a),i),this.posOut+=a,i+=a}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF impossible after digest call");return this.writeInto(e)}xof(e){return(0,bi.assertNumber)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(e.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(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}};pn.blake3=(0,bi.wrapConstructorWithOpts)(t=>new Ls(t))});var pi=K(ve=>{"use strict";I();O();var Xd=ve&&ve.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),kg=ve&&ve.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),pt=ve&&ve.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Xd(e,t,r)},$c=ve&&ve.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Xd(e,t,r);return kg(e,t),e};Object.defineProperty(ve,"__esModule",{value:!0});ve.randomBytes=ve.concatBytes=ve.reverseBuffer=ve.md5=ve.rlp=void 0;pt(Yu(),ve);pt(md(),ve);pt(vd(),ve);pt(wd(),ve);pt(_d(),ve);pt(Cs(),ve);pt(Ad(),ve);pt(Md(),ve);pt(Id(),ve);pt(qc(),ve);ve.rlp=$c(Nd());pt(kd(),ve);ve.md5=$c(Rd());pt(ui(),ve);pt(Di(),ve);pt(Us(),ve);pt(Pc(),ve);pt(So(),ve);pt(Ao(),ve);pt(kc(),ve);pt(zc(),ve);pt(jo(),ve);pt($d(),ve);pt(Zd(),ve);var Rg=$c(rr()),qg=t1();function Cg(t){if(t.length<1)return t;let e=t.length-1,r=0;for(let n=0;n<t.length/2;n++)r=t[n],t[n]=t[e],t[e]=r,e--;return t}ve.reverseBuffer=Cg;function Dg(t,e){return Rg.concatBytes(Uint8Array.from(t),Uint8Array.from(e))}ve.concatBytes=Dg;function Ug(t){return qg(t)}ve.randomBytes=Ug});var Er=K(Yd=>{"use strict";I();O();var Zr=Yd,Lg=Vt(),Hg=i1(),No=o1();Zr.assert=Hg;Zr.toArray=No.toArray;Zr.zero2=No.zero2;Zr.toHex=No.toHex;Zr.encode=No.encode;function Kg(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<<e+1,s=t.clone(),a=0;a<n.length;a++){var c,d=s.andln(i-1);s.isOdd()?(d>(i>>1)-1?c=(i>>1)-d:c=d,s.isubn(c)):c=0,n[a]=c,s.iushrn(1)}return n}Zr.getNAF=Kg;function Fg(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n=0,i=0,s;t.cmpn(-n)>0||e.cmpn(-i)>0;){var a=t.andln(3)+n&3,c=e.andln(3)+i&3;a===3&&(a=-1),c===3&&(c=-1);var d;(a&1)===0?d=0:(s=t.andln(7)+n&7,(s===3||s===5)&&c===2?d=-a:d=a),r[0].push(d);var h;(c&1)===0?h=0:(s=e.andln(7)+i&7,(s===3||s===5)&&a===2?h=-c:h=c),r[1].push(h),2*n===d+1&&(n=1-n),2*i===h+1&&(i=1-i),t.iushrn(1),e.iushrn(1)}return r}Zr.getJSF=Fg;function zg(t,e,r){var n="_"+e;t.prototype[e]=function(){return this[n]!==void 0?this[n]:this[n]=r.call(this)}}Zr.cachedProperty=zg;function Vg(t){return typeof t=="string"?Zr.toArray(t,"hex"):t}Zr.parseBytes=Vg;function $g(t){return new Lg(t,"hex","le")}Zr.intFromLE=$g});var Ks=K((tw,Jd)=>{"use strict";I();O();var Hs=Er(),gi=Vt(),ko=Hs.getNAF,Gg=Hs.getJSF,Ro=Hs.assert;function Fn(t,e){this.type=t,this.p=new gi(e.p,16),this.red=e.prime?gi.red(e.prime):gi.mont(this.p),this.zero=new gi(0).toRed(this.red),this.one=new gi(1).toRed(this.red),this.two=new gi(2).toRed(this.red),this.n=e.n&&new gi(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.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))}Jd.exports=Fn;Fn.prototype.point=function(){throw new Error("Not implemented")};Fn.prototype.validate=function(){throw new Error("Not implemented")};Fn.prototype._fixedNafMul=function(e,r){Ro(e.precomputed);var n=e._getDoubles(),i=ko(r,1,this._bitLength),s=(1<<n.step+1)-(n.step%2===0?2:1);s/=3;var a=[],c,d;for(c=0;c<i.length;c+=n.step){d=0;for(var h=c+n.step-1;h>=c;h--)d=(d<<1)+i[h];a.push(d)}for(var y=this.jpoint(null,null,null),p=this.jpoint(null,null,null),w=s;w>0;w--){for(c=0;c<a.length;c++)d=a[c],d===w?p=p.mixedAdd(n.points[c]):d===-w&&(p=p.mixedAdd(n.points[c].neg()));y=y.add(p)}return y.toP()};Fn.prototype._wnafMul=function(e,r){var n=4,i=e._getNAFPoints(n);n=i.wnd;for(var s=i.points,a=ko(r,n,this._bitLength),c=this.jpoint(null,null,null),d=a.length-1;d>=0;d--){for(var h=0;d>=0&&a[d]===0;d--)h++;if(d>=0&&h++,c=c.dblp(h),d<0)break;var y=a[d];Ro(y!==0),e.type==="affine"?y>0?c=c.mixedAdd(s[y-1>>1]):c=c.mixedAdd(s[-y-1>>1].neg()):y>0?c=c.add(s[y-1>>1]):c=c.add(s[-y-1>>1].neg())}return e.type==="affine"?c.toP():c};Fn.prototype._wnafMulAdd=function(e,r,n,i,s){var a=this._wnafT1,c=this._wnafT2,d=this._wnafT3,h=0,y,p,w;for(y=0;y<i;y++){w=r[y];var v=w._getNAFPoints(e);a[y]=v.wnd,c[y]=v.points}for(y=i-1;y>=1;y-=2){var _=y-1,m=y;if(a[_]!==1||a[m]!==1){d[_]=ko(n[_],a[_],this._bitLength),d[m]=ko(n[m],a[m],this._bitLength),h=Math.max(d[_].length,h),h=Math.max(d[m].length,h);continue}var M=[r[_],null,null,r[m]];r[_].y.cmp(r[m].y)===0?(M[1]=r[_].add(r[m]),M[2]=r[_].toJ().mixedAdd(r[m].neg())):r[_].y.cmp(r[m].y.redNeg())===0?(M[1]=r[_].toJ().mixedAdd(r[m]),M[2]=r[_].add(r[m].neg())):(M[1]=r[_].toJ().mixedAdd(r[m]),M[2]=r[_].toJ().mixedAdd(r[m].neg()));var N=[-3,-1,-5,-7,0,7,5,1,3],L=Gg(n[_],n[m]);for(h=Math.max(L[0].length,h),d[_]=new Array(h),d[m]=new Array(h),p=0;p<h;p++){var C=L[0][p]|0,V=L[1][p]|0;d[_][p]=N[(C+1)*3+(V+1)],d[m][p]=0,c[_]=M}}var F=this.jpoint(null,null,null),H=this._wnafT4;for(y=h;y>=0;y--){for(var G=0;y>=0;){var z=!0;for(p=0;p<i;p++)H[p]=d[p][y]|0,H[p]!==0&&(z=!1);if(!z)break;G++,y--}if(y>=0&&G++,F=F.dblp(G),y<0)break;for(p=0;p<i;p++){var se=H[p];se!==0&&(se>0?w=c[p][se-1>>1]:se<0&&(w=c[p][-se-1>>1].neg()),w.type==="affine"?F=F.mixedAdd(w):F=F.add(w))}}for(y=0;y<i;y++)c[y]=null;return s?F:F.toP()};function Pr(t,e){this.curve=t,this.type=e,this.precomputed=null}Fn.BasePoint=Pr;Pr.prototype.eq=function(){throw new Error("Not implemented")};Pr.prototype.validate=function(){return this.curve.validate(this)};Fn.prototype.decodePoint=function(e,r){e=Hs.toArray(e,r);var n=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*n){e[0]===6?Ro(e[e.length-1]%2===0):e[0]===7&&Ro(e[e.length-1]%2===1);var i=this.point(e.slice(1,1+n),e.slice(1+n,1+2*n));return i}else if((e[0]===2||e[0]===3)&&e.length-1===n)return this.pointFromX(e.slice(1,1+n),e[0]===3);throw new Error("Unknown point format")};Pr.prototype.encodeCompressed=function(e){return this.encode(e,!0)};Pr.prototype._encode=function(e){var r=this.curve.p.byteLength(),n=this.getX().toArray("be",r);return e?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",r))};Pr.prototype.encode=function(e,r){return Hs.encode(this._encode(r),e)};Pr.prototype.precompute=function(e){if(this.precomputed)return this;var r={doubles:null,naf:null,beta:null};return r.naf=this._getNAFPoints(8),r.doubles=this._getDoubles(4,e),r.beta=this._getBeta(),this.precomputed=r,this};Pr.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var r=this.precomputed.doubles;return r?r.points.length>=Math.ceil((e.bitLength()+1)/r.step):!1};Pr.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,s=0;s<r;s+=e){for(var a=0;a<e;a++)i=i.dbl();n.push(i)}return{step:e,points:n}};Pr.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var r=[this],n=(1<<e)-1,i=n===1?null:this.dbl(),s=1;s<n;s++)r[s]=r[s-1].add(i);return{wnd:e,points:r}};Pr.prototype._getBeta=function(){return null};Pr.prototype.dblp=function(e){for(var r=this,n=0;n<e;n++)r=r.dbl();return r}});var e0=K((iw,Qd)=>{"use strict";I();O();var Wg=Er(),gt=Vt(),Gc=pc(),es=Ks(),Zg=Wg.assert;function jr(t){es.call(this,"short",t),this.a=new gt(t.a,16).toRed(this.red),this.b=new gt(t.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(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}Gc(jr,es);Qd.exports=jr;jr.prototype._getEndomorphism=function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var r,n;if(e.beta)r=new gt(e.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(e.lambda)n=new gt(e.lambda,16);else{var s=this._getEndoRoots(this.n);this.g.mul(s[0]).x.cmp(this.g.x.redMul(r))===0?n=s[0]:(n=s[1],Zg(this.g.mul(n).x.cmp(this.g.x.redMul(r))===0))}var a;return e.basis?a=e.basis.map(function(c){return{a:new gt(c.a,16),b:new gt(c.b,16)}}):a=this._getEndoBasis(n),{beta:r,lambda:n,basis:a}}};jr.prototype._getEndoRoots=function(e){var r=e===this.p?this.red:gt.mont(e),n=new gt(2).toRed(r).redInvm(),i=n.redNeg(),s=new gt(3).toRed(r).redNeg().redSqrt().redMul(n),a=i.redAdd(s).fromRed(),c=i.redSub(s).fromRed();return[a,c]};jr.prototype._getEndoBasis=function(e){for(var r=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=e,i=this.n.clone(),s=new gt(1),a=new gt(0),c=new gt(0),d=new gt(1),h,y,p,w,v,_,m,M=0,N,L;n.cmpn(0)!==0;){var C=i.div(n);N=i.sub(C.mul(n)),L=c.sub(C.mul(s));var V=d.sub(C.mul(a));if(!p&&N.cmp(r)<0)h=m.neg(),y=s,p=N.neg(),w=L;else if(p&&++M===2)break;m=N,i=n,n=N,c=s,s=L,d=a,a=V}v=N.neg(),_=L;var F=p.sqr().add(w.sqr()),H=v.sqr().add(_.sqr());return H.cmp(F)>=0&&(v=h,_=y),p.negative&&(p=p.neg(),w=w.neg()),v.negative&&(v=v.neg(),_=_.neg()),[{a:p,b:w},{a:v,b:_}]};jr.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],s=i.b.mul(e).divRound(this.n),a=n.b.neg().mul(e).divRound(this.n),c=s.mul(n.a),d=a.mul(i.a),h=s.mul(n.b),y=a.mul(i.b),p=e.sub(c).sub(d),w=h.add(y).neg();return{k1:p,k2:w}};jr.prototype.pointFromX=function(e,r){e=new gt(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var s=i.fromRed().isOdd();return(r&&!s||!r&&s)&&(i=i.redNeg()),this.point(e,i)};jr.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0};jr.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,s=this._endoWnafT2,a=0;a<e.length;a++){var c=this._endoSplit(r[a]),d=e[a],h=d._getBeta();c.k1.negative&&(c.k1.ineg(),d=d.neg(!0)),c.k2.negative&&(c.k2.ineg(),h=h.neg(!0)),i[a*2]=d,i[a*2+1]=h,s[a*2]=c.k1,s[a*2+1]=c.k2}for(var y=this._wnafMulAdd(1,i,s,a*2,n),p=0;p<a*2;p++)i[p]=null,s[p]=null;return y};function Zt(t,e,r,n){es.BasePoint.call(this,t,"affine"),e===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new gt(e,16),this.y=new gt(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)}Gc(Zt,es.BasePoint);jr.prototype.point=function(e,r,n){return new Zt(this,e,r,n)};jr.prototype.pointFromJSON=function(e,r){return Zt.fromJSON(this,e,r)};Zt.prototype._getBeta=function(){if(!!this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var r=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var n=this.curve,i=function(s){return n.point(s.x.redMul(n.endo.beta),s.y)};e.beta=r,r.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(i)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(i)}}}return r}};Zt.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]};Zt.fromJSON=function(e,r,n){typeof r=="string"&&(r=JSON.parse(r));var i=e.point(r[0],r[1],n);if(!r[2])return i;function s(c){return e.point(c[0],c[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(s))},naf:a.naf&&{wnd:a.naf.wnd,points:[i].concat(a.naf.points.map(s))}},i};Zt.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)+">"};Zt.prototype.isInfinity=function(){return this.inf};Zt.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};Zt.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),a=s.redSqr().redISub(this.x.redAdd(this.x)),c=s.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,c)};Zt.prototype.getX=function(){return this.x.fromRed()};Zt.prototype.getY=function(){return this.y.fromRed()};Zt.prototype.mul=function(e){return e=new gt(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};Zt.prototype.mulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s):this.curve._wnafMulAdd(1,i,s,2)};Zt.prototype.jmulAdd=function(e,r,n){var i=[this,r],s=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,s,!0):this.curve._wnafMulAdd(1,i,s,2,!0)};Zt.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};Zt.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=function(s){return s.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};Zt.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function nr(t,e,r,n){es.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new gt(0)):(this.x=new gt(e,16),this.y=new gt(r,16),this.z=new gt(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}Gc(nr,es.BasePoint);jr.prototype.jpoint=function(e,r,n){return new nr(this,e,r,n)};nr.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)};nr.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};nr.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),s=e.x.redMul(n),a=this.y.redMul(r.redMul(e.z)),c=e.y.redMul(n.redMul(this.z)),d=i.redSub(s),h=a.redSub(c);if(d.cmpn(0)===0)return h.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var y=d.redSqr(),p=y.redMul(d),w=i.redMul(y),v=h.redSqr().redIAdd(p).redISub(w).redISub(w),_=h.redMul(w.redISub(v)).redISub(a.redMul(p)),m=this.z.redMul(e.z).redMul(d);return this.curve.jpoint(v,_,m)};nr.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),s=this.y,a=e.y.redMul(r).redMul(this.z),c=n.redSub(i),d=s.redSub(a);if(c.cmpn(0)===0)return d.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var h=c.redSqr(),y=h.redMul(c),p=n.redMul(h),w=d.redSqr().redIAdd(y).redISub(p).redISub(p),v=d.redMul(p.redISub(w)).redISub(s.redMul(y)),_=this.z.redMul(c);return this.curve.jpoint(w,v,_)};nr.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r<e;r++)n=n.dbl();return n}var i=this.curve.a,s=this.curve.tinv,a=this.x,c=this.y,d=this.z,h=d.redSqr().redSqr(),y=c.redAdd(c);for(r=0;r<e;r++){var p=a.redSqr(),w=y.redSqr(),v=w.redSqr(),_=p.redAdd(p).redIAdd(p).redIAdd(i.redMul(h)),m=a.redMul(w),M=_.redSqr().redISub(m.redAdd(m)),N=m.redISub(M),L=_.redMul(N);L=L.redIAdd(L).redISub(v);var C=y.redMul(d);r+1<e&&(h=h.redMul(v)),a=M,d=C,y=L}return this.curve.jpoint(a,y.redMul(s),d)};nr.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};nr.prototype._zeroDbl=function(){var e,r,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),a=s.redSqr(),c=this.x.redAdd(s).redSqr().redISub(i).redISub(a);c=c.redIAdd(c);var d=i.redAdd(i).redIAdd(i),h=d.redSqr().redISub(c).redISub(c),y=a.redIAdd(a);y=y.redIAdd(y),y=y.redIAdd(y),e=h,r=d.redMul(c.redISub(h)).redISub(y),n=this.y.redAdd(this.y)}else{var p=this.x.redSqr(),w=this.y.redSqr(),v=w.redSqr(),_=this.x.redAdd(w).redSqr().redISub(p).redISub(v);_=_.redIAdd(_);var m=p.redAdd(p).redIAdd(p),M=m.redSqr(),N=v.redIAdd(v);N=N.redIAdd(N),N=N.redIAdd(N),e=M.redISub(_).redISub(_),r=m.redMul(_.redISub(e)).redISub(N),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(e,r,n)};nr.prototype._threeDbl=function(){var e,r,n;if(this.zOne){var i=this.x.redSqr(),s=this.y.redSqr(),a=s.redSqr(),c=this.x.redAdd(s).redSqr().redISub(i).redISub(a);c=c.redIAdd(c);var d=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),h=d.redSqr().redISub(c).redISub(c);e=h;var y=a.redIAdd(a);y=y.redIAdd(y),y=y.redIAdd(y),r=d.redMul(c.redISub(h)).redISub(y),n=this.y.redAdd(this.y)}else{var p=this.z.redSqr(),w=this.y.redSqr(),v=this.x.redMul(w),_=this.x.redSub(p).redMul(this.x.redAdd(p));_=_.redAdd(_).redIAdd(_);var m=v.redIAdd(v);m=m.redIAdd(m);var M=m.redAdd(m);e=_.redSqr().redISub(M),n=this.y.redAdd(this.z).redSqr().redISub(w).redISub(p);var N=w.redSqr();N=N.redIAdd(N),N=N.redIAdd(N),N=N.redIAdd(N),r=_.redMul(m.redISub(e)).redISub(N)}return this.curve.jpoint(e,r,n)};nr.prototype._dbl=function(){var e=this.curve.a,r=this.x,n=this.y,i=this.z,s=i.redSqr().redSqr(),a=r.redSqr(),c=n.redSqr(),d=a.redAdd(a).redIAdd(a).redIAdd(e.redMul(s)),h=r.redAdd(r);h=h.redIAdd(h);var y=h.redMul(c),p=d.redSqr().redISub(y.redAdd(y)),w=y.redISub(p),v=c.redSqr();v=v.redIAdd(v),v=v.redIAdd(v),v=v.redIAdd(v);var _=d.redMul(w).redISub(v),m=n.redAdd(n).redMul(i);return this.curve.jpoint(p,_,m)};nr.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr(),i=r.redSqr(),s=e.redAdd(e).redIAdd(e),a=s.redSqr(),c=this.x.redAdd(r).redSqr().redISub(e).redISub(i);c=c.redIAdd(c),c=c.redAdd(c).redIAdd(c),c=c.redISub(a);var d=c.redSqr(),h=i.redIAdd(i);h=h.redIAdd(h),h=h.redIAdd(h),h=h.redIAdd(h);var y=s.redIAdd(c).redSqr().redISub(a).redISub(d).redISub(h),p=r.redMul(y);p=p.redIAdd(p),p=p.redIAdd(p);var w=this.x.redMul(d).redISub(p);w=w.redIAdd(w),w=w.redIAdd(w);var v=this.y.redMul(y.redMul(h.redISub(y)).redISub(c.redMul(d)));v=v.redIAdd(v),v=v.redIAdd(v),v=v.redIAdd(v);var _=this.z.redAdd(c).redSqr().redISub(n).redISub(d);return this.curve.jpoint(w,v,_)};nr.prototype.mul=function(e,r){return e=new gt(e,r),this.curve._wnafMul(this,e)};nr.prototype.eq=function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var r=this.z.redSqr(),n=e.z.redSqr();if(this.x.redMul(n).redISub(e.x.redMul(r)).cmpn(0)!==0)return!1;var i=r.redMul(this.z),s=n.redMul(e.z);return this.y.redMul(s).redISub(e.y.redMul(i)).cmpn(0)===0};nr.prototype.eqXToP=function(e){var r=this.z.redSqr(),n=e.toRed(this.curve.red).redMul(r);if(this.x.cmp(n)===0)return!0;for(var i=e.clone(),s=this.curve.redN.redMul(r);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}};nr.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)+">"};nr.prototype.isInfinity=function(){return this.z.cmpn(0)===0}});var n0=K((aw,r0)=>{"use strict";I();O();var ts=Vt(),t0=pc(),qo=Ks(),Xg=Er();function rs(t){qo.call(this,"mont",t),this.a=new ts(t.a,16).toRed(this.red),this.b=new ts(t.b,16).toRed(this.red),this.i4=new ts(4).toRed(this.red).redInvm(),this.two=new ts(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}t0(rs,qo);r0.exports=rs;rs.prototype.validate=function(e){var r=e.normalize().x,n=r.redSqr(),i=n.redMul(r).redAdd(n.redMul(this.a)).redAdd(r),s=i.redSqrt();return s.redSqr().cmp(i)===0};function Xt(t,e,r){qo.BasePoint.call(this,t,"projective"),e===null&&r===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new ts(e,16),this.z=new ts(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}t0(Xt,qo.BasePoint);rs.prototype.decodePoint=function(e,r){return this.point(Xg.toArray(e,r),1)};rs.prototype.point=function(e,r){return new Xt(this,e,r)};rs.prototype.pointFromJSON=function(e){return Xt.fromJSON(this,e)};Xt.prototype.precompute=function(){};Xt.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};Xt.fromJSON=function(e,r){return new Xt(e,r[0],r[1]||e.one)};Xt.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)+">"};Xt.prototype.isInfinity=function(){return this.z.cmpn(0)===0};Xt.prototype.dbl=function(){var e=this.x.redAdd(this.z),r=e.redSqr(),n=this.x.redSub(this.z),i=n.redSqr(),s=r.redSub(i),a=r.redMul(i),c=s.redMul(i.redAdd(this.curve.a24.redMul(s)));return this.curve.point(a,c)};Xt.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};Xt.prototype.diffAdd=function(e,r){var n=this.x.redAdd(this.z),i=this.x.redSub(this.z),s=e.x.redAdd(e.z),a=e.x.redSub(e.z),c=a.redMul(n),d=s.redMul(i),h=r.z.redMul(c.redAdd(d).redSqr()),y=r.x.redMul(c.redISub(d).redSqr());return this.curve.point(h,y)};Xt.prototype.mul=function(e){for(var r=e.clone(),n=this,i=this.curve.point(null,null),s=this,a=[];r.cmpn(0)!==0;r.iushrn(1))a.push(r.andln(1));for(var c=a.length-1;c>=0;c--)a[c]===0?(n=n.diffAdd(i,s),i=i.dbl()):(i=n.diffAdd(i,s),n=n.dbl());return i};Xt.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};Xt.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};Xt.prototype.eq=function(e){return this.getX().cmp(e.getX())===0};Xt.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};Xt.prototype.getX=function(){return this.normalize(),this.x.fromRed()}});var o0=K((uw,s0)=>{"use strict";I();O();var Yg=Er(),An=Vt(),i0=pc(),Co=Ks(),Jg=Yg.assert;function gn(t){this.twisted=(t.a|0)!==1,this.mOneA=this.twisted&&(t.a|0)===-1,this.extended=this.mOneA,Co.call(this,"edwards",t),this.a=new An(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new An(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new An(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),Jg(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(t.c|0)===1}i0(gn,Co);s0.exports=gn;gn.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)};gn.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)};gn.prototype.jpoint=function(e,r,n,i){return this.point(e,r,n,i)};gn.prototype.pointFromX=function(e,r){e=new An(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=this.c2.redSub(this.a.redMul(n)),s=this.one.redSub(this.c2.redMul(this.d).redMul(n)),a=i.redMul(s.redInvm()),c=a.redSqrt();if(c.redSqr().redSub(a).cmp(this.zero)!==0)throw new Error("invalid point");var d=c.fromRed().isOdd();return(r&&!d||!r&&d)&&(c=c.redNeg()),this.point(e,c)};gn.prototype.pointFromY=function(e,r){e=new An(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=n.redSub(this.c2),s=n.redMul(this.d).redMul(this.c2).redSub(this.a),a=i.redMul(s.redInvm());if(a.cmp(this.zero)===0){if(r)throw new Error("invalid point");return this.point(this.zero,e)}var c=a.redSqrt();if(c.redSqr().redSub(a).cmp(this.zero)!==0)throw new Error("invalid point");return c.fromRed().isOdd()!==r&&(c=c.redNeg()),this.point(c,e)};gn.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var r=e.x.redSqr(),n=e.y.redSqr(),i=r.redMul(this.a).redAdd(n),s=this.c2.redMul(this.one.redAdd(this.d.redMul(r).redMul(n)));return i.cmp(s)===0};function We(t,e,r,n,i){Co.BasePoint.call(this,t,"projective"),e===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 An(e,16),this.y=new An(r,16),this.z=n?new An(n,16):this.curve.one,this.t=i&&new An(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()))))}i0(We,Co.BasePoint);gn.prototype.pointFromJSON=function(e){return We.fromJSON(this,e)};gn.prototype.point=function(e,r,n,i){return new We(this,e,r,n,i)};We.fromJSON=function(e,r){return new We(e,r[0],r[1],r[2])};We.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)+">"};We.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};We.prototype._extDbl=function(){var e=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var i=this.curve._mulA(e),s=this.x.redAdd(this.y).redSqr().redISub(e).redISub(r),a=i.redAdd(r),c=a.redSub(n),d=i.redSub(r),h=s.redMul(c),y=a.redMul(d),p=s.redMul(d),w=c.redMul(a);return this.curve.point(h,y,w,p)};We.prototype._projDbl=function(){var e=this.x.redAdd(this.y).redSqr(),r=this.x.redSqr(),n=this.y.redSqr(),i,s,a,c,d,h;if(this.curve.twisted){c=this.curve._mulA(r);var y=c.redAdd(n);this.zOne?(i=e.redSub(r).redSub(n).redMul(y.redSub(this.curve.two)),s=y.redMul(c.redSub(n)),a=y.redSqr().redSub(y).redSub(y)):(d=this.z.redSqr(),h=y.redSub(d).redISub(d),i=e.redSub(r).redISub(n).redMul(h),s=y.redMul(c.redSub(n)),a=y.redMul(h))}else c=r.redAdd(n),d=this.curve._mulC(this.z).redSqr(),h=c.redSub(d).redSub(d),i=this.curve._mulC(e.redISub(c)).redMul(h),s=this.curve._mulC(c).redMul(r.redISub(n)),a=c.redMul(h);return this.curve.point(i,s,a)};We.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};We.prototype._extAdd=function(e){var r=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),n=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),s=this.z.redMul(e.z.redAdd(e.z)),a=n.redSub(r),c=s.redSub(i),d=s.redAdd(i),h=n.redAdd(r),y=a.redMul(c),p=d.redMul(h),w=a.redMul(h),v=c.redMul(d);return this.curve.point(y,p,v,w)};We.prototype._projAdd=function(e){var r=this.z.redMul(e.z),n=r.redSqr(),i=this.x.redMul(e.x),s=this.y.redMul(e.y),a=this.curve.d.redMul(i).redMul(s),c=n.redSub(a),d=n.redAdd(a),h=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(s),y=r.redMul(c).redMul(h),p,w;return this.curve.twisted?(p=r.redMul(d).redMul(s.redSub(this.curve._mulA(i))),w=c.redMul(d)):(p=r.redMul(d).redMul(s.redSub(i)),w=this.curve._mulC(c).redMul(d)),this.curve.point(y,p,w)};We.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)};We.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)};We.prototype.mulAdd=function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!1)};We.prototype.jmulAdd=function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!0)};We.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this};We.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};We.prototype.getX=function(){return this.normalize(),this.x.fromRed()};We.prototype.getY=function(){return this.normalize(),this.y.fromRed()};We.prototype.eq=function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0};We.prototype.eqXToP=function(e){var r=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(r)===0)return!0;for(var n=e.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}};We.prototype.toP=We.prototype.normalize;We.prototype.mixedAdd=We.prototype.add});var Wc=K(a0=>{"use strict";I();O();var Do=a0;Do.base=Ks();Do.short=e0();Do.mont=n0();Do.edwards=o0()});var f0=K((gw,c0)=>{"use strict";I();O();c0.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 Uo=K(l0=>{"use strict";I();O();var Xc=l0,zn=Du(),Zc=Wc(),Qg=Er(),u0=Qg.assert;function d0(t){t.type==="short"?this.curve=new Zc.short(t):t.type==="edwards"?this.curve=new Zc.edwards(t):this.curve=new Zc.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,u0(this.g.validate(),"Invalid curve"),u0(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}Xc.PresetCurve=d0;function Vn(t,e){Object.defineProperty(Xc,t,{configurable:!0,enumerable:!0,get:function(){var r=new d0(e);return Object.defineProperty(Xc,t,{configurable:!0,enumerable:!0,value:r}),r}})}Vn("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:zn.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]});Vn("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:zn.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]});Vn("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:zn.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]});Vn("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:zn.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"]});Vn("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:zn.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"]});Vn("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:zn.sha256,gRed:!1,g:["9"]});Vn("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:zn.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var Yc;try{Yc=f0()}catch{Yc=void 0}Vn("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:zn.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",Yc]})});var b0=K((_w,h0)=>{"use strict";I();O();var e2=Vt(),t2=Er(),Jc=t2.assert;function ar(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}h0.exports=ar;ar.fromPublic=function(e,r,n){return r instanceof ar?r:new ar(e,{pub:r,pubEnc:n})};ar.fromPrivate=function(e,r,n){return r instanceof ar?r:new ar(e,{priv:r,privEnc:n})};ar.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.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"}};ar.prototype.getPublic=function(e,r){return typeof e=="string"&&(r=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),r?this.pub.encode(r,e):this.pub};ar.prototype.getPrivate=function(e){return e==="hex"?this.priv.toString(16,2):this.priv};ar.prototype._importPrivate=function(e,r){this.priv=new e2(e,r||16),this.priv=this.priv.umod(this.ec.curve.n)};ar.prototype._importPublic=function(e,r){if(e.x||e.y){this.ec.curve.type==="mont"?Jc(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&Jc(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,r)};ar.prototype.derive=function(e){return e.validate()||Jc(e.validate(),"public point not validated"),e.mul(this.priv).getX()};ar.prototype.sign=function(e,r,n){return this.ec.sign(e,this,r,n)};ar.prototype.verify=function(e,r){return this.ec.verify(e,r,this)};ar.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}});var y0=K((Aw,g0)=>{"use strict";I();O();var Lo=Vt(),tf=Er(),r2=tf.assert;function Fs(t,e,r){if(e instanceof Fs)return e;this._importDER(e,r)||(r2(e.r&&e.s,"Signature without r or s"),this.r=new Lo(e.r,16),this.s=new Lo(e.s,16),e.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=e.recoveryParam,this.curve=t,this.byteLength=this.curve.n.byteLength())}g0.exports=Fs;function n2(){this.place=0}function Qc(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,s=0,a=e.place;s<n;s++,a++)i<<=8,i|=t[a],i>>>=0;return i<=127?!1:(e.place=a,i)}function p0(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e<r;)e++;return e===0?t:t.slice(e)}Fs.prototype._importDER=function(e,r){e=tf.toArray(e,r);var n=new n2;if(e[n.place++]!==48)return!1;var i=Qc(e,n);if(i===!1||i+n.place!==e.length||e[n.place++]!==2)return!1;var s=Qc(e,n);if(s===!1)return!1;var a=e.slice(n.place,s+n.place);if(n.place+=s,e[n.place++]!==2)return!1;var c=Qc(e,n);if(c===!1||e.length!==c+n.place)return!1;var d=e.slice(n.place,c+n.place);if(a[0]===0)if(a[1]&128)a=a.slice(1);else return!1;if(d[0]===0)if(d[1]&128)d=d.slice(1);else return!1;return this.r=new Lo(a),this.s=new Lo(d),this.recoveryParam=null,!0};function ef(t,e){if(e<128){t.push(e);return}var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}Fs.prototype.toDER=function(e){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=p0(r),n=p0(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];ef(i,r.length),i=i.concat(r),i.push(2),ef(i,n.length);var s=i.concat(n),a=[48];return ef(a,s.length),a=a.concat(s),tf.encode(a,e)};Fs.prototype.toBytes=function(){let e=this.r.toArray("be",this.byteLength),r=this.s.toArray("be",this.byteLength);return e.concat(r)}});var S0=K((Iw,w0)=>{"use strict";I();O();var yi=Vt(),m0=a1(),i2=Er(),rf=Uo(),s2=s1(),v0=i2.assert,nf=b0(),Ho=y0();function Nr(t){if(!(this instanceof Nr))return new Nr(t);typeof t=="string"&&(v0(Object.prototype.hasOwnProperty.call(rf,t),"Unknown curve "+t),t=rf[t]),t instanceof rf.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}w0.exports=Nr;Nr.prototype.keyPair=function(e){return new nf(this,e)};Nr.prototype.keyFromPrivate=function(e,r){return nf.fromPrivate(this,e,r)};Nr.prototype.keyFromPublic=function(e,r){return nf.fromPublic(this,e,r)};Nr.prototype.genKeyPair=function(e){e||(e={});for(var r=new m0({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||s2(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new yi(2));;){var s=new yi(r.generate(n));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}};Nr.prototype._truncateToN=function(e,r){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};Nr.prototype.sign=function(e,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),e=this._truncateToN(new yi(e,16));for(var s=this.n.byteLength(),a=r.getPrivate().toArray("be",s),c=e.toArray("be",s),d=new m0({hash:this.hash,entropy:a,nonce:c,pers:i.pers,persEnc:i.persEnc||"utf8"}),h=this.n.sub(new yi(1)),y=0;;y++){var p=i.k?i.k(y):new yi(d.generate(this.n.byteLength()));if(p=this._truncateToN(p,!0),!(p.cmpn(1)<=0||p.cmp(h)>=0)){var w=this.g.mul(p);if(!w.isInfinity()){var v=w.getX(),_=v.umod(this.n);if(_.cmpn(0)!==0){var m=p.invm(this.n).mul(_.mul(r.getPrivate()).iadd(e));if(m=m.umod(this.n),m.cmpn(0)!==0){var M=(w.getY().isOdd()?1:0)|(v.cmp(_)!==0?2:0);return i.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),M^=1),new Ho(this.curve,{r:_,s:m,recoveryParam:M})}}}}}};Nr.prototype.verify=function(e,r,n,i){e=this._truncateToN(new yi(e,16)),n=this.keyFromPublic(n,i),r=new Ho(this.curve,r,"hex");var s=r.r,a=r.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var c=a.invm(this.n),d=c.mul(e).umod(this.n),h=c.mul(s).umod(this.n),y;return this.curve._maxwellTrick?(y=this.g.jmulAdd(d,n.getPublic(),h),y.isInfinity()?!1:y.eqXToP(s)):(y=this.g.mulAdd(d,n.getPublic(),h),y.isInfinity()?!1:y.getX().umod(this.n).cmp(s)===0)};Nr.prototype.recoverPubKey=function(t,e,r,n){v0((3&r)===r,"The recovery param is more than two bits"),e=new Ho(this.curve,e,n);var i=this.n,s=new yi(t),a=e.r,c=e.s,d=r&1,h=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");h?a=this.curve.pointFromX(a.add(this.curve.n),d):a=this.curve.pointFromX(a,d);var y=e.r.invm(i),p=i.sub(s).mul(y).umod(i),w=c.mul(y).umod(i);return this.g.mulAdd(p,a,w)};Nr.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new Ho(this.curve,e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(t,e,i)}catch{continue}if(s.eq(r))return i}throw new Error("Unable to find valid recovery factor")}});var A0=K((Pw,x0)=>{"use strict";I();O();var zs=Er(),E0=zs.assert,_0=zs.parseBytes,ns=zs.cachedProperty;function Yt(t,e){this.eddsa=t,this._secret=_0(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=_0(e.pub)}Yt.fromPublic=function(e,r){return r instanceof Yt?r:new Yt(e,{pub:r})};Yt.fromSecret=function(e,r){return r instanceof Yt?r:new Yt(e,{secret:r})};Yt.prototype.secret=function(){return this._secret};ns(Yt,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});ns(Yt,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});ns(Yt,"privBytes",function(){var e=this.eddsa,r=this.hash(),n=e.encodingLength-1,i=r.slice(0,e.encodingLength);return i[0]&=248,i[n]&=127,i[n]|=64,i});ns(Yt,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});ns(Yt,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});ns(Yt,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});Yt.prototype.sign=function(e){return E0(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)};Yt.prototype.verify=function(e,r){return this.eddsa.verify(e,r,this)};Yt.prototype.getSecret=function(e){return E0(this._secret,"KeyPair is public only"),zs.encode(this.secret(),e)};Yt.prototype.getPublic=function(e){return zs.encode(this.pubBytes(),e)};x0.exports=Yt});var T0=K((kw,M0)=>{"use strict";I();O();var o2=Vt(),Ko=Er(),a2=Ko.assert,Fo=Ko.cachedProperty,c2=Ko.parseBytes;function mi(t,e){this.eddsa=t,typeof e!="object"&&(e=c2(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),a2(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof o2&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}Fo(mi,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});Fo(mi,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});Fo(mi,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});Fo(mi,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});mi.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};mi.prototype.toHex=function(){return Ko.encode(this.toBytes(),"hex").toUpperCase()};M0.exports=mi});var j0=K((Cw,P0)=>{"use strict";I();O();var f2=Du(),u2=Uo(),is=Er(),d2=is.assert,O0=is.parseBytes,B0=A0(),I0=T0();function yr(t){if(d2(t==="ed25519","only tested with ed25519 so far"),!(this instanceof yr))return new yr(t);t=u2[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=f2.sha512}P0.exports=yr;yr.prototype.sign=function(e,r){e=O0(e);var n=this.keyFromSecret(r),i=this.hashInt(n.messagePrefix(),e),s=this.g.mul(i),a=this.encodePoint(s),c=this.hashInt(a,n.pubBytes(),e).mul(n.priv()),d=i.add(c).umod(this.curve.n);return this.makeSignature({R:s,S:d,Rencoded:a})};yr.prototype.verify=function(e,r,n){e=O0(e),r=this.makeSignature(r);var i=this.keyFromPublic(n),s=this.hashInt(r.Rencoded(),i.pubBytes(),e),a=this.g.mul(r.S()),c=r.R().add(i.pub().mul(s));return c.eq(a)};yr.prototype.hashInt=function(){for(var e=this.hash(),r=0;r<arguments.length;r++)e.update(arguments[r]);return is.intFromLE(e.digest()).umod(this.curve.n)};yr.prototype.keyFromPublic=function(e){return B0.fromPublic(this,e)};yr.prototype.keyFromSecret=function(e){return B0.fromSecret(this,e)};yr.prototype.makeSignature=function(e){return e instanceof I0?e:new I0(this,e)};yr.prototype.encodePoint=function(e){var r=e.getY().toArray("le",this.encodingLength);return r[this.encodingLength-1]|=e.getX().isOdd()?128:0,r};yr.prototype.decodePoint=function(e){e=is.parseBytes(e);var r=e.length-1,n=e.slice(0,r).concat(e[r]&-129),i=(e[r]&128)!==0,s=is.intFromLE(n);return this.curve.pointFromY(s,i)};yr.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)};yr.prototype.decodeInt=function(e){return is.intFromLE(e)};yr.prototype.isPoint=function(e){return e instanceof this.pointClass}});var ss=K(kr=>{"use strict";I();O();Object.defineProperty(kr,"__esModule",{value:!0});kr.utils=kr.curves=kr.curve=kr.eddsa=kr.ec=void 0;var l2=Wc();kr.curve=l2;var h2=Uo();kr.curves=h2;var b2=S0();kr.ec=b2;var p2=j0();kr.eddsa=p2;var g2=Er();kr.utils=g2});var R0=K((N0,k0)=>{"use strict";I();O();Object.defineProperty(N0,"__esModule",{value:!0});var y2=ss(),yn=new y2.ec("secp256k1"),Ie=yn.curve,Ze=Vt();function m2(t,e){let r=new Ze(e);if(r.cmp(Ie.p)>=0)return null;r=r.toRed(Ie.red);let n=r.redSqr().redIMul(r).redIAdd(Ie.b).redSqrt();t===3!==n.isOdd()&&(n=n.redNeg());let i=r.redSqr().redIMul(r);return n.redSqr().redISub(i.redIAdd(Ie.b)).isZero()?yn.keyPair({pub:{x:r,y:n}}):null}function v2(t,e,r){let n=new Ze(e),i=new Ze(r);if(n.cmp(Ie.p)>=0||i.cmp(Ie.p)>=0||(n=n.toRed(Ie.red),i=i.toRed(Ie.red),(t===6||t===7)&&i.isOdd()!==(t===7)))return null;let s=n.redSqr().redIMul(n);return i.redSqr().redISub(s.redIAdd(Ie.b)).isZero()?yn.keyPair({pub:{x:n,y:i}}):null}function $n(t){let e=t[0];switch(e){case 2:case 3:return t.length!==33?null:m2(e,t.subarray(1,33));case 4:case 6:case 7:return t.length!==65?null:v2(e,t.subarray(1,33),t.subarray(33,65));default:return null}}k0.exports={contextRandomize(){return 0},privateKeyVerify(t){let e=new Ze(t);return e.cmp(Ie.n)<0&&!e.isZero()},privateKeyNegate(t){let e=new Ze(t);return T.Buffer.from(Ie.n.sub(e).umod(Ie.n).toArray("be",32))},privateKeyTweakAdd(t,e){let r=new Ze(e);return r.cmp(Ie.n)>=0||(r.iadd(new Ze(t)),r.cmp(Ie.n)>=0&&r.isub(Ie.n),r.isZero())?null:T.Buffer.from(r.toArray("be",32))},privateKeyTweakMul(t,e){let r=new Ze(e);return r.cmp(Ie.n)>=0||r.isZero()?1:(r.imul(new Ze(t)),r.cmp(Ie.n)>=0&&(r=r.umod(Ie.n)),T.Buffer.from(r.toArray("be",32)))},publicKeyVerify(t){let e=$n(t);return e==null?null:e.validate().result},publicKeyCreate(t,e){let r=new Ze(t);if(r.cmp(Ie.n)>=0||r.isZero())return null;let n=yn.keyFromPrivate(t,null).getPublic();return T.Buffer.from(n.encode(null,e))},publicKeyConvert(t,e){let n=$n(t).getPublic();return T.Buffer.from(n.encode(null,e))},publicKeyNegate(t,e){let r=$n(t);if(r===null)return 1;let n=r.getPublic();return n.y=n.y.redNeg(),T.Buffer.from(n.encode(null,e))},publicKeyCombine(t,e){let r=new Array(t.length);for(let i=0;i<t.length;++i)if(r[i]=$n(t[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:T.Buffer.from(n.encode(null,e))},publicKeyTweakAdd(t,e,r){let n=$n(t);if(n===null||new Ze(e).cmp(Ie.n)>=0)return null;let s=n.getPublic().add(Ie.g.mul(e));return s.isInfinity()?null:T.Buffer.from(s.encode(null,r))},publicKeyTweakMul(t,e,r){let n=$n(t);if(n===null)return null;let i=new Ze(e);if(i.cmp(Ie.n)>=0||i.isZero())return null;let s=n.getPublic().mul(e);return T.Buffer.from(s.encode(null,r))},signatureNormalize(t){let e=new Ze(t.subarray(0,32)),r=new Ze(t.subarray(32,64));return e.cmp(Ie.n)>=0||r.cmp(Ie.n)>=0?null:(r.cmp(yn.nh)===1&&t.set(Ie.n.sub(r).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(t,e){let r=e.subarray(0,32),n=e.subarray(32,64);if(new Ze(r).cmp(Ie.n)>=0||new Ze(n).cmp(Ie.n)>=0)return 1;let{output:i}=t,s=i.subarray(4,4+33);s[0]=0,s.set(r,1);let a=33,c=0;for(;a>1&&s[c]===0&&!(s[c+1]&128);--a,++c);if(s=s.subarray(c),s[0]&128||a>1&&s[0]===0&&!(s[1]&128))return 1;let d=i.subarray(6+33,6+33+33);d[0]=0,d.set(n,1);let h=33,y=0;for(;h>1&&d[y]===0&&!(d[y+1]&128);--h,++y);return d=d.subarray(y),d[0]&128||h>1&&d[0]===0&&!(d[1]&128)?1:(t.outputlen=6+a+h,i[0]=48,i[1]=t.outputlen-2,i[2]=2,i[3]=s.length,i.set(s,4),i[4+a]=2,i[5+a]=d.length,i.set(d,6+a),0)},signatureImport(t,e){if(e.length<8||e.length>72||e[0]!==48||e[1]!==e.length-2||e[2]!==2)return 1;let r=e[3];if(r===0||5+r>=e.length||e[4+r]!==2)return 1;let n=e[5+r];if(n===0||6+r+n!==e.length||e[4]&128||r>1&&e[4]===0&&!(e[5]&128)||e[r+6]&128||n>1&&e[r+6]===0&&!(e[r+7]&128))return 1;let i=e.subarray(4,4+r);if(i.length===33&&i[0]===0&&(i=i.subarray(1)),i.length>32)return 1;let s=e.subarray(6+r);if(s.length===33&&s[0]===0&&(s=s.slice(1)),s.length>32)throw new Error("S length is too long");let a=new Ze(i);a.cmp(Ie.n)>=0&&(a=new Ze(0));let c=new Ze(e.subarray(6+r));return c.cmp(Ie.n)>=0&&(c=new Ze(0)),t.set(a.toArrayLike(Uint8Array,"be",32),0),t.set(c.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(t,e){let r=new Ze(e);return r.cmp(Ie.n)>=0||r.isZero()?null:yn.sign(t,e,{canonical:!0}).toBytes()},ecdsaVerify(t,e,r){let n={r:t.subarray(0,32),s:t.subarray(32,64)},i=new Ze(n.r),s=new Ze(n.s);if(i.cmp(Ie.n)>=0||s.cmp(Ie.n)>=0)return 1;if(s.cmp(yn.nh)===1||i.isZero()||s.isZero())return 3;let a=$n(r);if(a===null)return 2;let c=a.getPublic();return yn.verify(e,n,c)},ecdsaRecover(t,e,r,n){let i={r:t.slice(0,32),s:t.slice(32,64)},s=new Ze(i.r),a=new Ze(i.s);if(s.cmp(Ie.n)>=0||a.cmp(Ie.n)>=0)return 1;if(s.isZero()||a.isZero())return 2;let c;try{c=yn.recoverPubKey(r,i,e,null)}catch{return 2}return T.Buffer.from(c.encode(null,n))},ecdh(t,e,r,n,i,s,a){let c=$n(e);if(c===null)return 1;let d=new Ze(r);if(d.cmp(Ie.n)>=0||d.isZero())return 2;let h=c.getPublic().mul(d);if(i===void 0){let y=h.encode(null,!0),p=yn.hash().update(y).digest();for(let w=0;w<32;++w)t[w]=p[w]}else{s||(s=new Uint8Array(32));let y=h.getX().toArray("be",32);for(let _=0;_<32;++_)s[_]=y[_];a||(a=new Uint8Array(32));let p=h.getY().toArray("be",32);for(let _=0;_<32;++_)a[_]=p[_];let w=i(s,a,n);if(!(w instanceof Uint8Array&&w.length===t.length))return 2;t.set(w)}return 0}}});var L0=K(Jt=>{"use strict";I();O();var w2=Jt&&Jt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),S2=Jt&&Jt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),_2=Jt&&Jt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&w2(e,t,r);return S2(e,t),e};Object.defineProperty(Jt,"__esModule",{value:!0});Jt.fromSeed=Jt.fromPublicKey=Jt.fromPrivateKey=Jt.fromBase58=Jt.tinySecp256k1Interface=void 0;var sf=_2(pi()),E2=ui(),x2=Cs(),C0=(0,E2.base58check)(x2.sha256),D0=R0(),ir=Uu(),A2=f1();function M2(t){return{isPoint:e=>t.publicKeyVerify(e),isPrivate:e=>t.privateKeyVerify(e),pointAddScalar:(e,r,n)=>t.publicKeyTweakAdd(e,r,n),pointFromScalar:(e,r)=>t.publicKeyCreate(e,r),privateAdd:(e,r)=>t.privateKeyTweakAdd(new Uint8Array(e),r),sign:(e,r)=>t.ecdsaSign(e,r),verify:(e,r,n)=>t.ecdsaVerify(n,e,r)}}function T2(t){return{isPoint:e=>t.publicKeyVerify(e),pointCompress:(e,r)=>Uint8Array.from(t.publicKeyConvert(e,r??!0)),isPrivate:e=>t.privateKeyVerify(e),pointFromScalar:(e,r)=>{let n=t.publicKeyCreate(e,r??!0);return n==null?null:Uint8Array.from(n)},sign:(e,r,n)=>Uint8Array.from(t.ecdsaSign(e,r)),verify:(e,r,n,i)=>t.ecdsaVerify(n,e,r)}}var Gn=M2(D0);Jt.tinySecp256k1Interface=T2(D0);var of=ir.BufferN(32),I2=ir.compile({wif:ir.UInt8,bip32:{public:ir.UInt32,private:ir.UInt32}}),$o={messagePrefix:`Bitcoin Signed Message:
`,bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},q0=2147483648,O2=Math.pow(2,31)-1;function B2(t){return ir.String(t)&&t.match(/^(m\/)?(\d+'?\/)*\d+'?$/)!==null}function P2(t){return ir.UInt32(t)&&t<=O2}var zo=class{constructor(e,r,n,i,s=0,a=0,c=0){this.__D=e,this.__Q=r,this.chainCode=n,this.network=i,this.__DEPTH=s,this.__INDEX=a,this.__PARENT_FINGERPRINT=c,ir(I2,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=T.Buffer.from(Gn.pointFromScalar(this.__D,!0))),this.__Q}get privateKey(){return this.__D}get identifier(){return T.Buffer.from(sf.hash160(this.publicKey))}get fingerprint(){return this.identifier.slice(0,4)}get compressed(){return!0}isNeutered(){return this.__D===void 0}neutered(){return Vo(this.publicKey,this.chainCode,this.network,this.depth,this.index,this.parentFingerprint)}toBase58(){let e=this.network,r=this.isNeutered()?e.bip32.public:e.bip32.private,n=T.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)),C0.encode(n)}toWIF(){if(!this.privateKey)throw new TypeError("Missing private key");return A2.encode(this.network.wif,this.privateKey,!0)}derive(e){ir(ir.UInt32,e);let r=e>=q0,n=T.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(e,33)}else this.publicKey.copy(n,0),n.writeUInt32BE(e,33);let i=sf.hmacSHA512(this.chainCode,n),s=i.slice(0,32),a=i.slice(32);if(!Gn.isPrivate(s))return this.derive(e+1);let c;if(this.isNeutered()){let d=Gn.pointAddScalar(this.publicKey,s,!0);if(d===null)return this.derive(e+1);c=Vo(d,a,this.network,this.depth+1,e,this.fingerprint.readUInt32BE(0))}else{let d=Gn.privateAdd(this.privateKey,s);if(d==null)return this.derive(e+1);c=af(d,a,this.network,this.depth+1,e,this.fingerprint.readUInt32BE(0))}return c}deriveHardened(e){return ir(P2,e),this.derive(e+q0)}derivePath(e){ir(B2,e);let r=e.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 s;return i.slice(-1)==="'"?(s=parseInt(i.slice(0,-1),10),n.deriveHardened(s)):(s=parseInt(i,10),n.derive(s))},this)}sign(e){if(!this.privateKey)throw new Error("Missing private key");return Gn.sign(e,this.privateKey)}verify(e,r){return Gn.verify(e,this.publicKey,r)}};function j2(t,e){let r=T.Buffer.from(C0.decode(t));if(r.length!==78)throw new TypeError("Invalid buffer length");e=e||$o;let n=r.readUInt32BE(0);if(n!==e.bip32.private&&n!==e.bip32.public)throw new TypeError("Invalid network version");let i=r[4],s=r.readUInt32BE(5);if(i===0&&s!==0)throw new TypeError("Invalid parent fingerprint");let a=r.readUInt32BE(9);if(i===0&&a!==0)throw new TypeError("Invalid index");let c=r.slice(13,45),d;if(n===e.bip32.private){if(r.readUInt8(45)!==0)throw new TypeError("Invalid private key");let h=r.slice(46,78);d=af(h,c,e,i,a,s)}else{let h=r.slice(45,78);d=Vo(h,c,e,i,a,s)}return d}Jt.fromBase58=j2;function U0(t,e,r){return af(t,e,r)}Jt.fromPrivateKey=U0;function af(t,e,r,n,i,s){if(ir({privateKey:of,chainCode:of},{privateKey:t,chainCode:e}),r=r||$o,!Gn.isPrivate(t))throw new TypeError("Private key not in range [1, n)");return new zo(t,void 0,e,r,n,i,s)}function N2(t,e,r){return Vo(t,e,r)}Jt.fromPublicKey=N2;function Vo(t,e,r,n,i,s){if(ir({publicKey:ir.BufferN(33),chainCode:of},{publicKey:t,chainCode:e}),r=r||$o,!Gn.isPoint(t))throw new TypeError("Point is not on the curve");return new zo(void 0,t,e,r,n,i,s)}function k2(t,e){if(ir(ir.Buffer,t),t.length<16)throw new TypeError("Seed should be at least 128 bits");if(t.length>64)throw new TypeError("Seed should be at most 512 bits");e=e||$o;let r=sf.hmacSHA512(T.Buffer.from("Bitcoin seed","utf8"),t),n=r.slice(0,32),i=r.slice(32);return U0(n,i,e)}Jt.fromSeed=k2});var H0=K(Rr=>{"use strict";I();O();Object.defineProperty(Rr,"__esModule",{value:!0});Rr.fromPrivateKey=Rr.fromPublicKey=Rr.fromBase58=Rr.fromSeed=Rr.tinySecp256k1Interface=void 0;var Vs=L0();Object.defineProperty(Rr,"tinySecp256k1Interface",{enumerable:!0,get:function(){return Vs.tinySecp256k1Interface}});Object.defineProperty(Rr,"fromSeed",{enumerable:!0,get:function(){return Vs.fromSeed}});Object.defineProperty(Rr,"fromBase58",{enumerable:!0,get:function(){return Vs.fromBase58}});Object.defineProperty(Rr,"fromPublicKey",{enumerable:!0,get:function(){return Vs.fromPublicKey}});Object.defineProperty(Rr,"fromPrivateKey",{enumerable:!0,get:function(){return Vs.fromPrivateKey}})});var K0=K((Yw,R2)=>{R2.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 ff=K(vi=>{"use strict";I();O();Object.defineProperty(vi,"__esModule",{value:!0});vi._default=vi.wordlists=void 0;var cf={};vi.wordlists=cf;var Go;vi._default=Go;try{vi._default=Go=K0(),cf.english=Go,cf.EN=Go}catch{}});var uf=K(Ct=>{"use strict";I();O();Object.defineProperty(Ct,"__esModule",{value:!0});Ct.wordlists=Ct.getDefaultWordlist=Ct.setDefaultWordlist=Ct.validateMnemonic=Ct.generateMnemonic=Ct.entropyToMnemonic=Ct.mnemonicToEntropy=Ct.mnemonicToSeed=Ct.mnemonicToSeedSync=void 0;var z0=pi(),V0=jo(),Wo=ff(),$0=So(),$s=Wo._default,F0="Invalid mnemonic",wi="Invalid entropy",q2="Invalid mnemonic checksum",G0=`A wordlist is required but a default could not be found.
Please pass a 2048 word array explicitly.`;function C2(t,e,r,n,i){let s=(0,V0.pbkdf2)($0.sha512,t,e,{c:r,dkLen:n});return Promise.resolve(T.Buffer.from(s))}function Gs(t){return(t||"").normalize("NFKD")}function W0(t,e,r){for(;t.length<r;)t=e+t;return t}function Z0(t){return parseInt(t,2)}function X0(t){return t.map(e=>W0(e.toString(2),"0",8)).join("")}function Y0(t){let r=t.length*8/32,n=(0,z0.sha256)(t);return X0(Array.from(n)).slice(0,r)}function J0(t){return"mnemonic"+(t||"")}function D2(t,e){let r=T.Buffer.from(Gs(t),"utf8"),n=T.Buffer.from(J0(Gs(e)),"utf8"),i=(0,V0.pbkdf2)($0.sha512,r,n,{c:2048,dkLen:64});return T.Buffer.from(i)}Ct.mnemonicToSeedSync=D2;function U2(t,e){return Promise.resolve().then(()=>{let r=T.Buffer.from(Gs(t),"utf8"),n=T.Buffer.from(J0(Gs(e)),"utf8");return C2(r,n,2048,64,"sha512")})}Ct.mnemonicToSeed=U2;function Q0(t,e){if(e=e||$s,!e)throw new Error(G0);let r=Gs(t).split(" ");if(r.length%3!==0)throw new Error(F0);let n=r.map(y=>{let p=e.indexOf(y);if(p===-1)throw new Error(F0);return W0(p.toString(2),"0",11)}).join(""),i=Math.floor(n.length/33)*32,s=n.slice(0,i),a=n.slice(i),c=s.match(/(.{1,8})/g).map(Z0);if(c.length<16)throw new Error(wi);if(c.length>32)throw new Error(wi);if(c.length%4!==0)throw new Error(wi);let d=T.Buffer.from(c);if(Y0(d)!==a)throw new Error(q2);return d.toString("hex")}Ct.mnemonicToEntropy=Q0;function el(t,e){if(T.Buffer.isBuffer(t)||(t=T.Buffer.from(t,"hex")),e=e||$s,!e)throw new Error(G0);if(t.length<16)throw new TypeError(wi);if(t.length>32)throw new TypeError(wi);if(t.length%4!==0)throw new TypeError(wi);let r=X0(Array.from(t)),n=Y0(t),a=(r+n).match(/(.{1,11})/g).map(c=>{let d=Z0(c);return e[d]});return e[0]==="\u3042\u3044\u3053\u304F\u3057\u3093"?a.join("\u3000"):a.join(" ")}Ct.entropyToMnemonic=el;function L2(t,e,r){if(t=t||128,t%32!==0)throw new TypeError(wi);return e=e||z0.randomBytes,el(e(t/8),r)}Ct.generateMnemonic=L2;function H2(t,e){try{Q0(t,e)}catch{return!1}return!0}Ct.validateMnemonic=H2;function K2(t){let e=Wo.wordlists[t];if(e)$s=e;else throw new Error('Could not find wordlist for language "'+t+'"')}Ct.setDefaultWordlist=K2;function F2(){if(!$s)throw new Error("No Default Wordlist set");return Object.keys(Wo.wordlists).filter(t=>t==="JA"||t==="EN"?!1:Wo.wordlists[t].every((e,r)=>e===$s[r]))[0]}Ct.getDefaultWordlist=F2;var z2=ff();Object.defineProperty(Ct,"wordlists",{enumerable:!0,get:function(){return z2.wordlists}})});var rl=K(cr=>{"use strict";I();O();Object.defineProperty(cr,"__esModule",{value:!0});cr.unpadBuffer=cr.stripZeros=cr.setLengthRight=cr.setLengthLeft=cr.zeros=cr.assertIsBuffer=void 0;var V2=function(t){if(!T.Buffer.isBuffer(t)){let e=`This method only supports Buffer but input was: ${t}`;throw new Error(e)}};cr.assertIsBuffer=V2;var $2=function(t){return T.Buffer.allocUnsafe(t).fill(0)};cr.zeros=$2;var tl=function(t,e,r){let n=(0,cr.zeros)(e);return r?t.length<e?(t.copy(n),n):t.slice(0,e):t.length<e?(t.copy(n,e-t.length),n):t.slice(-e)},G2=function(t,e){return T.Buffer.isBuffer(t)||(t=T.Buffer.from(t)),tl(t,e,!1)};cr.setLengthLeft=G2;var W2=function(t,e){return T.Buffer.isBuffer(t)||(t=T.Buffer.from(t)),tl(t,e,!0)};cr.setLengthRight=W2;var Z2=function(t){let e=t[0];for(;t.length>0&&e.toString()==="0";)t=t.slice(1),e=t[0];return t};cr.stripZeros=Z2;var X2=function(t){return T.Buffer.isBuffer(t)||(t=T.Buffer.from(t)),(0,cr.stripZeros)(t)};cr.unpadBuffer=X2});var Zo=K(yt=>{"use strict";I();O();Object.defineProperty(yt,"__esModule",{value:!0});yt.isHexString=yt.getKeys=yt.fromAscii=yt.fromUtf8=yt.toAscii=yt.arrayContainsArray=yt.getBinarySize=yt.padToEven=yt.stripHexPrefix=yt.isHexPrefixed=void 0;function nl(t){if(typeof t!="string")throw new Error(`[isHexPrefixed] input must be type 'string', received type ${typeof t}`);return t[0]==="0"&&t[1]==="x"}yt.isHexPrefixed=nl;var Y2=t=>{if(typeof t!="string")throw new Error(`[stripHexPrefix] input must be type 'string', received ${typeof t}`);return nl(t)?t.slice(2):t};yt.stripHexPrefix=Y2;function il(t){let e=t;if(typeof e!="string")throw new Error(`[padToEven] value must be type 'string', received ${typeof e}`);return e.length%2&&(e=`0${e}`),e}yt.padToEven=il;function J2(t){if(typeof t!="string")throw new Error(`[getBinarySize] method requires input type 'string', received ${typeof t}`);return T.Buffer.byteLength(t,"utf8")}yt.getBinarySize=J2;function Q2(t,e,r){if(Array.isArray(t)!==!0)throw new Error(`[arrayContainsArray] method requires input 'superset' to be an array, got type '${typeof t}'`);if(Array.isArray(e)!==!0)throw new Error(`[arrayContainsArray] method requires input 'subset' to be an array, got type '${typeof e}'`);return e[r===!0?"some":"every"](n=>t.indexOf(n)>=0)}yt.arrayContainsArray=Q2;function ey(t){let e="",r=0,n=t.length;for(t.substring(0,2)==="0x"&&(r=2);r<n;r+=2){let i=parseInt(t.substr(r,2),16);e+=String.fromCharCode(i)}return e}yt.toAscii=ey;function ty(t){let e=T.Buffer.from(t,"utf8");return`0x${il(e.toString("hex")).replace(/^0+|0+$/g,"")}`}yt.fromUtf8=ty;function ry(t){let e="";for(let r=0;r<t.length;r++){let i=t.charCodeAt(r).toString(16);e+=i.length<2?`0${i}`:i}return`0x${e}`}yt.fromAscii=ry;function ny(t,e,r){if(!Array.isArray(t))throw new Error(`[getKeys] method expects input 'params' to be an array, got ${typeof t}`);if(typeof e!="string")throw new Error(`[getKeys] method expects input 'key' to be type 'string', got ${typeof t}`);let n=[];for(let i=0;i<t.length;i++){let s=t[i][e];if(r===!0&&!s)s="";else if(typeof s!="string")throw new Error(`invalid abi - expected type 'string', received ${typeof s}`);n.push(s)}return n}yt.getKeys=ny;function iy(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||typeof e<"u"&&e>0&&t.length!==2+2*e)}yt.isHexString=iy});var sl=K(mn=>{"use strict";I();O();Object.defineProperty(mn,"__esModule",{value:!0});mn.assertIsString=mn.assertIsArray=mn.assertIsBuffer=mn.assertIsHexString=void 0;var sy=Zo(),oy=function(t){if(!(0,sy.isHexString)(t)){let e=`This method only supports 0x-prefixed hex strings but input was: ${t}`;throw new Error(e)}};mn.assertIsHexString=oy;var ay=function(t){if(!T.Buffer.isBuffer(t)){let e=`This method only supports Buffer but input was: ${t}`;throw new Error(e)}};mn.assertIsBuffer=ay;var cy=function(t){if(!Array.isArray(t)){let e=`This method only supports number arrays but input was: ${t}`;throw new Error(e)}};mn.assertIsArray=cy;var fy=function(t){if(typeof t!="string"){let e=`This method only supports strings but input was: ${t}`;throw new Error(e)}};mn.assertIsString=fy});var fl=K(oe=>{"use strict";I();O();Object.defineProperty(oe,"__esModule",{value:!0});oe.intToUnpaddedBuffer=oe.bigIntToUnpaddedBuffer=oe.bigIntToHex=oe.bufArrToArr=oe.arrToBufArr=oe.validateNoLeadingZeroes=oe.baToJSON=oe.toUtf8=oe.short=oe.addHexPrefix=oe.toUnsigned=oe.fromSigned=oe.bufferToInt=oe.bigIntToBuffer=oe.bufferToBigInt=oe.bufferToHex=oe.toBuffer=oe.unpadHexString=oe.unpadArray=oe.unpadBuffer=oe.setLengthRight=oe.setLengthLeft=oe.zeros=oe.intToBuffer=oe.intToHex=void 0;var Ws=sl(),Si=Zo(),uy=function(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Received an invalid integer type: ${t}`);return`0x${t.toString(16)}`};oe.intToHex=uy;var dy=function(t){let e=(0,oe.intToHex)(t);return T.Buffer.from((0,Si.padToEven)(e.slice(2)),"hex")};oe.intToBuffer=dy;var ly=function(t){return T.Buffer.allocUnsafe(t).fill(0)};oe.zeros=ly;var ol=function(t,e,r){let n=(0,oe.zeros)(e);return r?t.length<e?(t.copy(n),n):t.slice(0,e):t.length<e?(t.copy(n,e-t.length),n):t.slice(-e)},hy=function(t,e){return(0,Ws.assertIsBuffer)(t),ol(t,e,!1)};oe.setLengthLeft=hy;var by=function(t,e){return(0,Ws.assertIsBuffer)(t),ol(t,e,!0)};oe.setLengthRight=by;var df=function(t){let e=t[0];for(;t.length>0&&e.toString()==="0";)t=t.slice(1),e=t[0];return t},py=function(t){return(0,Ws.assertIsBuffer)(t),df(t)};oe.unpadBuffer=py;var gy=function(t){return(0,Ws.assertIsArray)(t),df(t)};oe.unpadArray=gy;var yy=function(t){return(0,Ws.assertIsHexString)(t),t=(0,Si.stripHexPrefix)(t),"0x"+df(t)};oe.unpadHexString=yy;var my=function(t){if(t==null)return T.Buffer.allocUnsafe(0);if(T.Buffer.isBuffer(t))return T.Buffer.from(t);if(Array.isArray(t)||t instanceof Uint8Array)return T.Buffer.from(t);if(typeof t=="string"){if(!(0,Si.isHexString)(t))throw new Error(`Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ${t}`);return T.Buffer.from((0,Si.padToEven)((0,Si.stripHexPrefix)(t)),"hex")}if(typeof t=="number")return(0,oe.intToBuffer)(t);if(typeof t=="bigint"){if(t<BigInt(0))throw new Error(`Cannot convert negative bigint to buffer. Given: ${t}`);let e=t.toString(16);return e.length%2&&(e="0"+e),T.Buffer.from(e,"hex")}if(t.toArray)return T.Buffer.from(t.toArray());if(t.toBuffer)return T.Buffer.from(t.toBuffer());throw new Error("invalid type")};oe.toBuffer=my;var vy=function(t){return t=(0,oe.toBuffer)(t),"0x"+t.toString("hex")};oe.bufferToHex=vy;function lf(t){let e=(0,oe.bufferToHex)(t);return BigInt(e==="0x"?0:e)}oe.bufferToBigInt=lf;function hf(t){return(0,oe.toBuffer)("0x"+t.toString(16))}oe.bigIntToBuffer=hf;var wy=function(t){let e=Number(lf(t));if(!Number.isSafeInteger(e))throw new Error("Number exceeds 53 bits");return e};oe.bufferToInt=wy;var Sy=function(t){return BigInt.asIntN(256,lf(t))};oe.fromSigned=Sy;var _y=function(t){return hf(BigInt.asUintN(256,t))};oe.toUnsigned=_y;var Ey=function(t){return typeof t!="string"||(0,Si.isHexPrefixed)(t)?t:"0x"+t};oe.addHexPrefix=Ey;function xy(t,e=50){let r=T.Buffer.isBuffer(t)?t.toString("hex"):t;return r.length<=e?r:r.slice(0,e)+"\u2026"}oe.short=xy;var Ay=function(t){let e=/^(00)+|(00)+$/g;if(t=(0,Si.stripHexPrefix)(t),t.length%2!==0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return T.Buffer.from(t.replace(e,""),"hex").toString("utf8")};oe.toUtf8=Ay;var My=function(t){if(T.Buffer.isBuffer(t))return`0x${t.toString("hex")}`;if(t instanceof Array){let e=[];for(let r=0;r<t.length;r++)e.push((0,oe.baToJSON)(t[r]));return e}};oe.baToJSON=My;var Ty=function(t){for(let[e,r]of Object.entries(t))if(r!==void 0&&r.length>0&&r[0]===0)throw new Error(`${e} cannot have leading zeroes, received: ${r.toString("hex")}`)};oe.validateNoLeadingZeroes=Ty;function al(t){return Array.isArray(t)?t.map(e=>al(e)):T.Buffer.from(t)}oe.arrToBufArr=al;function cl(t){return Array.isArray(t)?t.map(e=>cl(e)):Uint8Array.from(t??[])}oe.bufArrToArr=cl;var Iy=t=>"0x"+t.toString(16);oe.bigIntToHex=Iy;function Oy(t){return(0,oe.unpadBuffer)(hf(t))}oe.bigIntToUnpaddedBuffer=Oy;function By(t){return(0,oe.unpadBuffer)((0,oe.intToBuffer)(t))}oe.intToUnpaddedBuffer=By});var hl=K((g7,ll)=>{"use strict";I();O();var Xo=rl(),os=pi(),mr=Vt(),{isHexString:Py,stripHexPrefix:jy,padToEven:Ny}=Zo(),{intToBuffer:ky,addHexPrefix:Ry,bufferToHex:qy}=fl(),ot=function(){};function Yo(t){return t.startsWith("int[")?"int256"+t.slice(3):t==="int"?"int256":t.startsWith("uint[")?"uint256"+t.slice(4):t==="uint"?"uint256":t.startsWith("fixed[")?"fixed128x128"+t.slice(5):t==="fixed"?"fixed128x128":t.startsWith("ufixed[")?"ufixed128x128"+t.slice(6):t==="ufixed"?"ufixed128x128":t}function bf(t){if(t==null)return T.Buffer.allocUnsafe(0);if(T.Buffer.isBuffer(t))return T.Buffer.from(t);if(Array.isArray(t)||t instanceof Uint8Array)return T.Buffer.from(t);if(typeof t=="string"){if(!Py(t))throw new Error(`Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ${t}`);return T.Buffer.from(Ny(jy(t)),"hex")}if(typeof t=="number")return ky(t);if(typeof t=="bigint"){if(t<BigInt(0))throw new Error(`Cannot convert negative bigint to buffer. Given: ${t}`);let e=t.toString(16);return e.length%2&&(e="0"+e),T.Buffer.from(e,"hex")}if(t.toArray)return T.Buffer.from(t.toArray());if(t.toBuffer)return T.Buffer.from(t.toBuffer());throw new Error("invalid type")}function Cy(t){if(!!t){if(typeof t=="number"){if(t<0)return"0x";let e=bf(t);t=qy(e)}if(typeof t!="string"){let e="eth-sig-util.normalize() requires hex string or integer input.";throw e+=` received ${typeof t}: ${t}`,new Error(e)}return Ry(t.toLowerCase())}}ot.eventID=function(t,e){var r=t+"("+e.map(Yo).join(",")+")";return os.keccak256(T.Buffer.from(r))};ot.methodID=function(t,e){return ot.eventID(t,e).slice(0,4)};function Wn(t){return parseInt(/^\D+(\d+)$/.exec(t)[1],10)}function pf(t){var e=/^\D+(\d+)x(\d+)$/.exec(t);return[parseInt(e[1],10),parseInt(e[2],10)]}function Xs(t){var e=t.match(/(.*)\[(.*?)\]$/);return e?e[2]===""?"dynamic":parseInt(e[2],10):null}function _i(t){var e=typeof t;if(e==="string")return os.isHexPrefixed(t)?new mr(os.stripHexPrefix(t),16):new mr(t,10);if(e==="number")return new mr(t);if(t.toArray)return t;throw new Error("Argument is not a number")}function dl(t){var e=/^(\w+)\((.*)\)$/.exec(t);if(e.length!==3)throw new Error("Invalid method signature");var r=/^(.+)\):\((.+)$/.exec(e[2]);if(r!==null&&r.length===3)return{method:e[1],args:r[1].split(","),retargs:r[2].split(",")};var n=e[2].split(",");return n.length===1&&n[0]===""&&(n=[]),{method:e[1],args:n}}function vn(t,e){var r,n,i,s;if(t==="address")return vn("uint160",_i(e));if(t==="bool")return vn("uint8",e?1:0);if(t==="string")return vn("bytes",T.Buffer.from(e,"utf8"));if(Zs(t)){if(typeof e.length>"u")throw new Error("Not an array?");if(r=Xs(t),r!=="dynamic"&&r!==0&&e.length>r)throw new Error("Elements exceed array size: "+r);i=[],t=t.slice(0,t.lastIndexOf("[")),typeof e=="string"&&(e=JSON.parse(e));for(s in e)i.push(vn(t,e[s]));if(r==="dynamic"){var a=vn("uint256",e.length);i.unshift(a)}return T.Buffer.concat(i)}else{if(t==="bytes")return e=T.Buffer.from(e),i=T.Buffer.concat([vn("uint256",e.length),e]),e.length%32!==0&&(i=T.Buffer.concat([i,Xo.zeros(32-e.length%32)])),i;if(t.startsWith("bytes")){if(r=Wn(t),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return Xo.setLengthRight(e,32)}else if(t.startsWith("uint")){if(r=Wn(t),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=_i(e),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(T.Buffer,"be",32)}else if(t.startsWith("int")){if(r=Wn(t),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=_i(e),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(T.Buffer,"be",32)}else if(t.startsWith("ufixed")){if(r=pf(t),n=_i(e),n<0)throw new Error("Supplied ufixed is negative");return vn("uint256",n.mul(new mr(2).pow(new mr(r[1]))))}else if(t.startsWith("fixed"))return r=pf(t),vn("int256",_i(e).mul(new mr(2).pow(new mr(r[1]))))}throw new Error("Unsupported or invalid type: "+t)}function Xr(t,e,r){typeof t=="string"&&(t=gf(t));var n,i,s,a;if(t.name==="address")return Xr(t.rawType,e,r).toArrayLike(T.Buffer,"be",20).toString("hex");if(t.name==="bool")return Xr(t.rawType,e,r).toString()===new mr(1).toString();if(t.name==="string"){var c=Xr(t.rawType,e,r);return T.Buffer.from(c,"utf8").toString()}else if(t.isArray){for(s=[],n=t.size,t.size==="dynamic"&&(r=Xr("uint256",e,r).toNumber(),n=Xr("uint256",e,r).toNumber(),r=r+32),a=0;a<n;a++){var d=Xr(t.subArray,e,r);s.push(d),r+=t.subArray.memoryUsage}return s}else{if(t.name==="bytes")return r=Xr("uint256",e,r).toNumber(),n=Xr("uint256",e,r).toNumber(),e.slice(r+32,r+32+n);if(t.name.startsWith("bytes"))return e.slice(r,r+t.size);if(t.name.startsWith("uint")){if(i=new mr(e.slice(r,r+32),16,"be"),i.bitLength()>t.size)throw new Error("Decoded int exceeds width: "+t.size+" vs "+i.bitLength());return i}else if(t.name.startsWith("int")){if(i=new mr(e.slice(r,r+32),16,"be").fromTwos(256),i.bitLength()>t.size)throw new Error("Decoded uint exceeds width: "+t.size+" vs "+i.bitLength());return i}else if(t.name.startsWith("ufixed")){if(n=new mr(2).pow(new mr(t.size[1])),i=Xr("uint256",e,r),!i.mod(n).isZero())throw new Error("Decimals not supported yet");return i.div(n)}else if(t.name.startsWith("fixed")){if(n=new mr(2).pow(new mr(t.size[1])),i=Xr("int256",e,r),!i.mod(n).isZero())throw new Error("Decimals not supported yet");return i.div(n)}}throw new Error("Unsupported or invalid type: "+t.name)}function gf(t){var e,r;if(Zs(t)){e=Xs(t);var n=t.slice(0,t.lastIndexOf("["));return n=gf(n),r={isArray:!0,name:t,size:e,memoryUsage:e==="dynamic"?32:n.memoryUsage*e,subArray:n},r}else{var i;switch(t){case"address":i="uint160";break;case"bool":i="uint8";break;case"string":i="bytes";break}if(r={rawType:i,name:t,memoryUsage:32},t.startsWith("bytes")&&t!=="bytes"||t.startsWith("uint")||t.startsWith("int")?r.size=Wn(t):(t.startsWith("ufixed")||t.startsWith("fixed"))&&(r.size=pf(t)),t.startsWith("bytes")&&t!=="bytes"&&(r.size<1||r.size>32))throw new Error("Invalid bytes<N> width: "+r.size);if((t.startsWith("uint")||t.startsWith("int"))&&(r.size%8||r.size<8||r.size>256))throw new Error("Invalid int/uint<N> width: "+r.size);return r}}function Dy(t){return t==="string"||t==="bytes"||Xs(t)==="dynamic"}function Zs(t){return t.lastIndexOf("]")===t.length-1}ot.rawEncode=function(t,e){var r=[],n=[],i=0;t.forEach(function(h){if(Zs(h)){var y=Xs(h);y!=="dynamic"?i+=32*y:i+=32}else i+=32});for(var s=0;s<t.length;s++){var a=Yo(t[s]),c=e[s],d=vn(a,c);Dy(a)?(r.push(vn("uint256",i)),n.push(d),i+=d.length):r.push(d)}return T.Buffer.concat(r.concat(n))};ot.rawDecode=function(t,e){var r=[];e=T.Buffer.from(e);for(var n=0,i=0;i<t.length;i++){var s=Yo(t[i]),a=gf(s,e,n),c=Xr(a,e,n);n+=a.memoryUsage,r.push(c)}return r};ot.simpleEncode=function(t){var e=Array.prototype.slice.call(arguments).slice(1),r=dl(t);if(e.length!==r.args.length)throw new Error("Argument count mismatch");return T.Buffer.concat([ot.methodID(r.method,r.args),ot.rawEncode(r.args,e)])};ot.simpleDecode=function(t,e){var r=dl(t);if(!r.retargs)throw new Error("No return values in method");return ot.rawDecode(r.retargs,e)};function ul(t,e){return t.startsWith("address")||t.startsWith("bytes")?"0x"+e.toString("hex"):e.toString()}ot.stringify=function(t,e){var r=[];for(var n in t){var i=t[n],s=e[n];/^[^\[]+\[.*\]$/.test(i)?s=s.map(function(a){return ul(i,a)}).join(", "):s=ul(i,s),r.push(s)}return r};ot.solidityHexValue=function(t,e,r){var n,i;if(Zs(t)){var s=t.replace(/\[.*?\]/,"");if(!Zs(s)){var a=Xs(t);if(a!=="dynamic"&&a!==0&&e.length>a)throw new Error("Elements exceed array size: "+a)}var c=e.map(function(y){return ot.solidityHexValue(s,y,256)});return T.Buffer.concat(c)}else{if(t==="bytes")return e;if(t==="string")return T.Buffer.from(e,"utf8");if(t==="bool"){r=r||8;var d=Array(r/4).join("0");return T.Buffer.from(e?d+"1":d+"0","hex")}else if(t==="address"){var h=20;return r&&(h=r/8),Xo.setLengthLeft(bf(e),h)}else if(t.startsWith("bytes")){if(n=Wn(t),n<1||n>32)throw new Error("Invalid bytes<N> width: "+n);return typeof e=="number"&&(e=Cy(e)),Xo.setLengthRight(bf(e),n)}else if(t.startsWith("uint")){if(n=Wn(t),n%8||n<8||n>256)throw new Error("Invalid uint<N> width: "+n);if(i=_i(e),i.bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+i.bitLength());return r=r||n,i.toArrayLike(T.Buffer,"be",r/8)}else if(t.startsWith("int")){if(n=Wn(t),n%8||n<8||n>256)throw new Error("Invalid int<N> width: "+n);if(i=_i(e),i.bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+i.bitLength());return r=r||n,i.toTwos(n).toArrayLike(T.Buffer,"be",r/8)}else throw new Error("Unsupported or invalid type: "+t)}};ot.solidityPack=function(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var r=[],n=0;n<t.length;n++){var i=Yo(t[n]),s=e[n];r.push(ot.solidityHexValue(i,s,null))}return T.Buffer.concat(r)};ot.soliditySHA3=function(t,e){return os.keccak256(ot.solidityPack(t,e))};ot.soliditySHA256=function(t,e){return os.sha256(ot.solidityPack(t,e))};ot.solidityRIPEMD160=function(t,e){return os.ripemd160(ot.solidityPack(t,e),!0)};function Uy(t){return t>="0"&&t<="9"}ot.fromSerpent=function(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];if(n==="s")e.push("bytes");else if(n==="b"){for(var i="bytes",s=r+1;s<t.length&&Uy(t[s]);)i+=t[s]-"0",s++;r=s-1,e.push(i)}else if(n==="i")e.push("int256");else if(n==="a")e.push("int256[]");else throw new Error("Unsupported or invalid type: "+n)}return e};ot.toSerpent=function(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];if(n==="bytes")e.push("s");else if(n.startsWith("bytes"))e.push("b"+Wn(n));else if(n==="int256")e.push("i");else if(n==="int256[]")e.push("a");else throw new Error("Unsupported or invalid type: "+n)}return e.join("")};ll.exports=ot});var bl=K(Zn=>{"use strict";I();O();Object.defineProperty(Zn,"__esModule",{value:!0});Zn.SoliditySHA3=Zn.RawEncode=Zn.ABI=void 0;var yf=hl();Zn.ABI=yf;function Ly(t,e){return yf.rawEncode(t,e)}Zn.RawEncode=Ly;function Hy(t,e){return yf.soliditySHA3(t,e)}Zn.SoliditySHA3=Hy});var wl=K(Pe=>{"use strict";I();O();var Ky=Pe&&Pe.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Fy=Pe&&Pe.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),zy=Pe&&Pe.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Ky(e,t,r);return Fy(e,t),e},Vy=Pe&&Pe.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Pe,"__esModule",{value:!0});Pe.loadUncompressedPublicKey=Pe.loadCompressedPublicKey=Pe.publicKeyConvert=Pe.publicKeyCreate=Pe.publicKeyVerify=Pe.privateKeyVerify=Pe.loadPublicKey=Pe.recover=Pe.verifyWithNoRecovery=Pe.verify=Pe.getV=Pe.sign=void 0;var $y=zy(ss()),$t=new $y.ec("secp256k1"),pl=pi(),as=Vy(Vt());function Gy(t,e,r=!0){let n=$t.sign(Array.from(t),T.Buffer.from(e),{canonical:r});return{signature:n.toBytes(),recovery:n.recoveryParam}}Pe.sign=Gy;function Wy(t,e,r,n,i=!0){let s=Ys(n);if(s==null)throw new Error("pubkey error");let a=$t.keyPair({pub:{x:s.x,y:s.y}}).getPublic();return $t.getKeyRecoveryParam(t,{r:e,s:r},a,i)}Pe.getV=Wy;function Zy(t,e,r,n){let i=gl(e,r,t,!0);if(i==null)return!1;let s=yl(n,!0);return s==null?!1:i.equals(s)}Pe.verify=Zy;function Xy(t,e,r){let n=Ys(r);if(n==null)throw new Error("pubkey error");let i=$t.keyPair({pub:{x:n.x,y:n.y}}),s={r:(0,pl.toHex)(e.slice(0,32)),s:(0,pl.toHex)(e.slice(32,64))};return i.verify(t,s)}Pe.verifyWithNoRecovery=Xy;function gl(t,e,r,n){let i={r:Array.from(t.slice(0,32)),s:Array.from(t.slice(32,64))},s=new as.default(i.r),a=new as.default(i.s);if(s.cmp($t.curve.n)>=0||a.cmp($t.curve.n)>=0||s.isZero()||a.isZero())return null;let c;try{c=$t.recoverPubKey(Array.from(r),i,e,null)}catch{return null}return T.Buffer.from(c.encode(null,n))}Pe.recover=gl;function Ys(t){let e=T.Buffer.from(t),r=e[0];switch(r){case 2:case 3:return e.length!==33?null:ml(r,e.subarray(1,33));case 4:case 6:case 7:return e.length!==65?null:vl(r,e.subarray(1,33),e.subarray(33,65));default:return null}}Pe.loadPublicKey=Ys;function Yy(t){let e=new as.default(Array.from(t));return e.cmp($t.curve.n)<0&&!e.isZero()}Pe.privateKeyVerify=Yy;function Jy(t){return Ys(t)!==null}Pe.publicKeyVerify=Jy;function Qy(t,e){let r=$t.keyFromPrivate(Array.from(t),"bytes").getPublic();return T.Buffer.from(r.encode(null,e))}Pe.publicKeyCreate=Qy;function yl(t,e){let r=Ys(t);if(r==null)return null;let n=$t.keyPair({pub:{x:r.x,y:r.y}}).getPublic();return T.Buffer.from(n.encode(null,e))}Pe.publicKeyConvert=yl;function ml(t,e){let r=new as.default(Array.from(e));if(r.cmp($t.curve.p)>=0)return null;let n=r.toRed($t.curve.red),i=n.redSqr().redIMul(n).redIAdd($t.curve.b).redSqrt();t===3!==i.isOdd()&&(i=i.redNeg());let s=n.redSqr().redIMul(n);return i.redSqr().redISub(s.redIAdd($t.curve.b)).isZero()?{x:n,y:i}:null}Pe.loadCompressedPublicKey=ml;function vl(t,e,r){let n=new as.default(Array.from(e)),i=new as.default(Array.from(r));if(n.cmp($t.curve.p)>=0||i.cmp($t.curve.p)>=0)return null;let s=n.toRed($t.curve.red),a=i.toRed($t.curve.red);if((t===6||t===7)&&a.isOdd()!==(t===7))return null;let c=s.redSqr().redIMul(s);return a.redSqr().redISub(c.redIAdd($t.curve.b)).isZero()?{x:s,y:a}:null}Pe.loadUncompressedPublicKey=vl});var Il=K(Oe=>{"use strict";I();O();var em=Oe&&Oe.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),tm=Oe&&Oe.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),rm=Oe&&Oe.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&em(e,t,r);return tm(e,t),e},nm=Oe&&Oe.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Oe,"__esModule",{value:!0});Oe.ed25519_getDerivedPrivateKey=Oe.isValidPath=Oe.ed25519_getRandomPrivateKey=Oe.ed25519SignTest=Oe.fromSecret=Oe.fromSeed=Oe.privateKeyVerify=Oe.publicKeyVerify=Oe.publicKeyCreate=Oe.verify=Oe.sign=Oe.ed25519MulBase=void 0;var Sl=rm(ss()),Yr=pi(),im=nm(Vt()),sm=uf(),Mn=new Sl.eddsa("ed25519"),_l=Mn.curve;function om(t){let e=Mn.curve.g;return Mn.encodePoint(e.mul(Sl.utils.intFromLE(t)))}Oe.ed25519MulBase=om;function El(t,e){let r=e;r.length==64&&(r=r.slice(0,32));let i=Mn.keyFromSecret(Array.from(r)).sign(Array.from(t)).toBytes();return Uint8Array.from(i)}Oe.sign=El;function xl(t,e,r){return Mn.keyFromPublic(Array.from(r)).verify(Array.from(t),Array.from(e))}Oe.verify=xl;function Jo(t){let e=t;e.length==64&&(e=e.slice(0,32));let n=Mn.keyFromSecret(Array.from(e)).getPublic();if(t.length==64&&!am(t.slice(32,64),n))throw new Error("invalid public key");return Uint8Array.from(n)}Oe.publicKeyCreate=Jo;function am(t,e){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function cm(t){let e=Mn.decodePoint(Array.from(t));return _l.validate(e)}Oe.publicKeyVerify=cm;function Al(t){let e=new im.default(Array.from(t));return e.cmp(_l.n)<0&&!e.isZero()}Oe.privateKeyVerify=Al;function fm(t){let e=Mn.keyFromSecret(Array.from(t)),r=Uint8Array.from(e.getPublic());return{publicKey:r,secretKey:(0,Yr.concatBytes)(t,r)}}Oe.fromSeed=fm;function um(t){let e=t.slice(0,32),r=Mn.keyFromSecret(Array.from(e));return{publicKey:Uint8Array.from(r.getPublic()),secretKey:Uint8Array.from(e)}}Oe.fromSecret=um;function Ml(t){let e=(0,Yr.sha256)("ed25519-test"),r=Jo(t),n=El(e,t);return xl(e,n,r)}Oe.ed25519SignTest=Ml;function dm(t,e){for(;;){let r=(0,Yr.randomBytes)(32);if(Al(r)&&Ml(r)){let n=Jo(r),i=t?(0,Yr.concatBytes)(r,n):r;return e==="base58"?(0,Yr.toBase58)(i):(0,Yr.toHex)(i)}}}Oe.ed25519_getRandomPrivateKey=dm;var lm=new RegExp("^m(\\/[0-9]+')+$"),Tl=t=>t.replace("'",""),hm=2147483648;function bm(t){let e=(0,Yr.hmacSHA512)("ed25519 seed",t),r=e.slice(0,32),n=e.slice(32);return{key:r,chainCode:n}}function pm({key:t,chainCode:e},r){let n=T.Buffer.allocUnsafe(4);n.writeUInt32BE(r,0);let i=T.Buffer.concat([T.Buffer.alloc(1,0),t,n]),s=(0,Yr.hmacSHA512)(e,i),a=s.slice(0,32),c=s.slice(32);return{key:a,chainCode:c}}var gm=t=>lm.test(t)?!t.split("/").slice(1).map(Tl).some(isNaN):!1;Oe.isValidPath=gm;function ym(t,e,r=hm){if(!(0,Oe.isValidPath)(t))throw new Error("Invalid derivation path");let{key:n,chainCode:i}=bm(e);return t.split("/").slice(1).map(Tl).map(a=>parseInt(a,10)).reduce((a,c)=>pm(a,c+r),{key:n,chainCode:i})}async function mm(t,e,r,n){let i=await(0,sm.mnemonicToSeed)(t),s=ym(e,i).key,a=Jo(s),c=r?(0,Yr.concatBytes)(s,a):s;return n==="base58"?Promise.resolve((0,Yr.toBase58)(c)):Promise.resolve((0,Yr.toHex)(c))}Oe.ed25519_getDerivedPrivateKey=mm});var jl=K(Ke=>{"use strict";I();O();var vm=Ke&&Ke.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),wm=Ke&&Ke.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Sm=Ke&&Ke.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&vm(e,t,r);return wm(e,t),e},_m=Ke&&Ke.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ke,"__esModule",{value:!0});Ke.loadUncompressedPublicKey=Ke.loadCompressedPublicKey=Ke.publicKeyConvert=Ke.publicKeyCreate=Ke.publicKeyVerify=Ke.privateKeyVerify=Ke.loadPublicKey=Ke.recover=Ke.verify=Ke.sign=void 0;var Em=Sm(ss()),br=new Em.ec("p256"),cs=_m(Vt());function xm(t,e,r=!0){let n=br.sign(Array.from(t),T.Buffer.from(e),{canonical:r});return{signature:n.toBytes(),recovery:n.recoveryParam}}Ke.sign=xm;function Am(t,e,r,n){let i=Ol(e,r,t,!1);return i==null?!1:i.equals(n)}Ke.verify=Am;function Ol(t,e,r,n){let i={r:Array.from(t.slice(0,32)),s:Array.from(t.slice(32,64))},s=new cs.default(i.r),a=new cs.default(i.s);if(s.cmp(br.curve.n)>=0||a.cmp(br.curve.n)>=0||s.isZero()||a.isZero())return null;let c;try{c=br.recoverPubKey(Array.from(r),i,e,null)}catch{return null}return T.Buffer.from(c.encode(null,n))}Ke.recover=Ol;function mf(t){let e=T.Buffer.from(t),r=e[0];switch(r){case 2:case 3:return e.length!==33?null:Bl(r,e.subarray(1,33));case 4:case 6:case 7:return e.length!==65?null:Pl(r,e.subarray(1,33),e.subarray(33,65));default:return null}}Ke.loadPublicKey=mf;function Mm(t){let e=new cs.default(Array.from(t));return e.cmp(br.curve.n)<0&&!e.isZero()}Ke.privateKeyVerify=Mm;function Tm(t){return mf(t)!==null}Ke.publicKeyVerify=Tm;function Im(t,e){let r=br.keyFromPrivate(Array.from(t),"bytes").getPublic();return T.Buffer.from(r.encode(null,e))}Ke.publicKeyCreate=Im;function Om(t,e){let r=mf(t);if(r==null)return null;let n=br.keyPair({pub:{x:r.x,y:r.y}}).getPublic();return T.Buffer.from(n.encode(null,e))}Ke.publicKeyConvert=Om;function Bl(t,e){let r=new cs.default(Array.from(e));if(r.cmp(br.curve.p)>=0)return null;let n=r.toRed(br.curve.red),i=n.redSqr().redIMul(n).redIAdd(br.curve.b).redSqrt();return t===3!==i.isOdd()&&(i=i.redNeg()),{x:n,y:i}}Ke.loadCompressedPublicKey=Bl;function Pl(t,e,r){let n=new cs.default(Array.from(e)),i=new cs.default(Array.from(r));if(n.cmp(br.curve.p)>=0||i.cmp(br.curve.p)>=0)return null;let s=n.toRed(br.curve.red),a=i.toRed(br.curve.red);if((t===6||t===7)&&a.isOdd()!==(t===7))return null;let c=s.redSqr().redIMul(s);return a.redSqr().redISub(c.redIAdd(br.curve.b)).isZero()?{x:s,y:a}:null}Ke.loadUncompressedPublicKey=Pl});var Tn=K(we=>{"use strict";I();O();Object.defineProperty(we,"__esModule",{value:!0});we.validateObject=we.createHmacDrbg=we.bitMask=we.bitSet=we.bitGet=we.bitLen=we.utf8ToBytes=we.equalBytes=we.concatBytes=we.ensureBytes=we.numberToVarBytesBE=we.numberToBytesLE=we.numberToBytesBE=we.bytesToNumberLE=we.bytesToNumberBE=we.hexToBytes=we.hexToNumber=we.numberToHexUnpadded=we.bytesToHex=void 0;var kl=BigInt(0),Qo=BigInt(1),Bm=BigInt(2),ea=t=>t instanceof Uint8Array,Pm=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function wf(t){if(!ea(t))throw new Error("Uint8Array expected");let e="";for(let r=0;r<t.length;r++)e+=Pm[t[r]];return e}we.bytesToHex=wf;function Rl(t){let e=t.toString(16);return e.length&1?`0${e}`:e}we.numberToHexUnpadded=Rl;function Sf(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return BigInt(t===""?"0":`0x${t}`)}we.hexToNumber=Sf;function ta(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);if(t.length%2)throw new Error("hex string is invalid: unpadded "+t.length);let e=new Uint8Array(t.length/2);for(let r=0;r<e.length;r++){let n=r*2,i=t.slice(n,n+2),s=Number.parseInt(i,16);if(Number.isNaN(s)||s<0)throw new Error("invalid byte sequence");e[r]=s}return e}we.hexToBytes=ta;function jm(t){return Sf(wf(t))}we.bytesToNumberBE=jm;function Nm(t){if(!ea(t))throw new Error("Uint8Array expected");return Sf(wf(Uint8Array.from(t).reverse()))}we.bytesToNumberLE=Nm;var km=(t,e)=>ta(t.toString(16).padStart(e*2,"0"));we.numberToBytesBE=km;var Rm=(t,e)=>(0,we.numberToBytesBE)(t,e).reverse();we.numberToBytesLE=Rm;var qm=t=>ta(Rl(t));we.numberToVarBytesBE=qm;function Cm(t,e,r){let n;if(typeof e=="string")try{n=ta(e)}catch(s){throw new Error(`${t} must be valid hex string, got "${e}". Cause: ${s}`)}else if(ea(e))n=Uint8Array.from(e);else throw new Error(`${t} must be hex string or Uint8Array`);let i=n.length;if(typeof r=="number"&&i!==r)throw new Error(`${t} expected ${r} bytes, got ${i}`);return n}we.ensureBytes=Cm;function ql(...t){let e=new Uint8Array(t.reduce((n,i)=>n+i.length,0)),r=0;return t.forEach(n=>{if(!ea(n))throw new Error("Uint8Array expected");e.set(n,r),r+=n.length}),e}we.concatBytes=ql;function Dm(t,e){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}we.equalBytes=Dm;function Um(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new TextEncoder().encode(t)}we.utf8ToBytes=Um;function Lm(t){let e;for(e=0;t>kl;t>>=Qo,e+=1);return e}we.bitLen=Lm;var Hm=(t,e)=>t>>BigInt(e)&Qo;we.bitGet=Hm;var Km=(t,e,r)=>t|(r?Qo:kl)<<BigInt(e);we.bitSet=Km;var Fm=t=>(Bm<<BigInt(t-1))-Qo;we.bitMask=Fm;var vf=t=>new Uint8Array(t),Nl=t=>Uint8Array.from(t);function zm(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=vf(t),i=vf(t),s=0,a=()=>{n.fill(1),i.fill(0),s=0},c=(...p)=>r(i,n,...p),d=(p=vf())=>{i=c(Nl([0]),p),n=c(),p.length!==0&&(i=c(Nl([1]),p),n=c())},h=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let p=0,w=[];for(;p<e;){n=c();let v=n.slice();w.push(v),p+=n.length}return ql(...w)};return(p,w)=>{a(),d(p);let v;for(;!(v=w(h()));)d();return a(),v}}we.createHmacDrbg=zm;var Vm={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function $m(t,e,r={}){let n=(i,s,a)=>{let c=Vm[s];if(typeof c!="function")throw new Error(`Invalid validator "${s}", expected function`);let d=t[i];if(!(a&&d===void 0)&&!c(d,t))throw new Error(`Invalid param ${String(i)}=${d} (${typeof d}), expected ${s}`)};for(let[i,s]of Object.entries(e))n(i,s,!1);for(let[i,s]of Object.entries(r))n(i,s,!0);return t}we.validateObject=$m});var Ei=K(Me=>{"use strict";I();O();Object.defineProperty(Me,"__esModule",{value:!0});Me.hashToPrivateScalar=Me.FpSqrtEven=Me.FpSqrtOdd=Me.Field=Me.nLength=Me.FpIsSquare=Me.FpDiv=Me.FpInvertBatch=Me.FpPow=Me.validateField=Me.isNegativeLE=Me.FpSqrt=Me.tonelliShanks=Me.invert=Me.pow2=Me.pow=Me.mod=void 0;var In=Tn(),Gt=BigInt(0),rt=BigInt(1),Xn=BigInt(2),Gm=BigInt(3),_f=BigInt(4),Cl=BigInt(5),Dl=BigInt(8),Wm=BigInt(9),Zm=BigInt(16);function qr(t,e){let r=t%e;return r>=Gt?r:e+r}Me.mod=qr;function Ul(t,e,r){if(r<=Gt||e<Gt)throw new Error("Expected power/modulo > 0");if(r===rt)return Gt;let n=rt;for(;e>Gt;)e&rt&&(n=n*t%r),t=t*t%r,e>>=rt;return n}Me.pow=Ul;function Xm(t,e,r){let n=t;for(;e-- >Gt;)n*=n,n%=r;return n}Me.pow2=Xm;function ra(t,e){if(t===Gt||e<=Gt)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=qr(t,e),n=e,i=Gt,s=rt,a=rt,c=Gt;for(;r!==Gt;){let h=n/r,y=n%r,p=i-a*h,w=s-c*h;n=r,r=y,i=a,s=c,a=p,c=w}if(n!==rt)throw new Error("invert: does not exist");return qr(i,e)}Me.invert=ra;function Ll(t){let e=(t-rt)/Xn,r,n,i;for(r=t-rt,n=0;r%Xn===Gt;r/=Xn,n++);for(i=Xn;i<t&&Ul(i,e,t)!==t-rt;i++);if(n===1){let a=(t+rt)/_f;return function(d,h){let y=d.pow(h,a);if(!d.eql(d.sqr(y),h))throw new Error("Cannot find square root");return y}}let s=(r+rt)/Xn;return function(c,d){if(c.pow(d,e)===c.neg(c.ONE))throw new Error("Cannot find square root");let h=n,y=c.pow(c.mul(c.ONE,i),r),p=c.pow(d,s),w=c.pow(d,r);for(;!c.eql(w,c.ONE);){if(c.eql(w,c.ZERO))return c.ZERO;let v=1;for(let m=c.sqr(w);v<h&&!c.eql(m,c.ONE);v++)m=c.sqr(m);let _=c.pow(y,rt<<BigInt(h-v-1));y=c.sqr(_),p=c.mul(p,_),w=c.mul(w,y),h=v}return p}}Me.tonelliShanks=Ll;function Hl(t){if(t%_f===Gm){let e=(t+rt)/_f;return function(n,i){let s=n.pow(i,e);if(!n.eql(n.sqr(s),i))throw new Error("Cannot find square root");return s}}if(t%Dl===Cl){let e=(t-Cl)/Dl;return function(n,i){let s=n.mul(i,Xn),a=n.pow(s,e),c=n.mul(i,a),d=n.mul(n.mul(c,Xn),a),h=n.mul(c,n.sub(d,n.ONE));if(!n.eql(n.sqr(h),i))throw new Error("Cannot find square root");return h}}return t%Zm,Ll(t)}Me.FpSqrt=Hl;var Ym=(t,e)=>(qr(t,e)&rt)===rt;Me.isNegativeLE=Ym;var Jm=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Qm(t){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=Jm.reduce((n,i)=>(n[i]="function",n),e);return(0,In.validateObject)(t,r)}Me.validateField=Qm;function Kl(t,e,r){if(r<Gt)throw new Error("Expected power > 0");if(r===Gt)return t.ONE;if(r===rt)return e;let n=t.ONE,i=e;for(;r>Gt;)r&rt&&(n=t.mul(n,i)),i=t.sqr(i),r>>=rt;return n}Me.FpPow=Kl;function Fl(t,e){let r=new Array(e.length),n=e.reduce((s,a,c)=>t.is0(a)?s:(r[c]=s,t.mul(s,a)),t.ONE),i=t.inv(n);return e.reduceRight((s,a,c)=>t.is0(a)?s:(r[c]=t.mul(s,r[c]),t.mul(s,a)),i),r}Me.FpInvertBatch=Fl;function e3(t,e,r){return t.mul(e,typeof r=="bigint"?ra(r,t.ORDER):t.inv(r))}Me.FpDiv=e3;function t3(t){let e=(t.ORDER-rt)/Xn;return r=>{let n=t.pow(r,e);return t.eql(n,t.ZERO)||t.eql(n,t.ONE)}}Me.FpIsSquare=t3;function Ef(t,e){let r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}Me.nLength=Ef;function r3(t,e,r=!1,n={}){if(t<=Gt)throw new Error(`Expected Fp ORDER > 0, got ${t}`);let{nBitLength:i,nByteLength:s}=Ef(t,e);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");let a=Hl(t),c=Object.freeze({ORDER:t,BITS:i,BYTES:s,MASK:(0,In.bitMask)(i),ZERO:Gt,ONE:rt,create:d=>qr(d,t),isValid:d=>{if(typeof d!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof d}`);return Gt<=d&&d<t},is0:d=>d===Gt,isOdd:d=>(d&rt)===rt,neg:d=>qr(-d,t),eql:(d,h)=>d===h,sqr:d=>qr(d*d,t),add:(d,h)=>qr(d+h,t),sub:(d,h)=>qr(d-h,t),mul:(d,h)=>qr(d*h,t),pow:(d,h)=>Kl(c,d,h),div:(d,h)=>qr(d*ra(h,t),t),sqrN:d=>d*d,addN:(d,h)=>d+h,subN:(d,h)=>d-h,mulN:(d,h)=>d*h,inv:d=>ra(d,t),sqrt:n.sqrt||(d=>a(c,d)),invertBatch:d=>Fl(c,d),cmov:(d,h,y)=>y?h:d,toBytes:d=>r?(0,In.numberToBytesLE)(d,s):(0,In.numberToBytesBE)(d,s),fromBytes:d=>{if(d.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${d.length}`);return r?(0,In.bytesToNumberLE)(d):(0,In.bytesToNumberBE)(d)}});return Object.freeze(c)}Me.Field=r3;function n3(t,e){if(!t.isOdd)throw new Error("Field doesn't have isOdd");let r=t.sqrt(e);return t.isOdd(r)?r:t.neg(r)}Me.FpSqrtOdd=n3;function i3(t,e){if(!t.isOdd)throw new Error("Field doesn't have isOdd");let r=t.sqrt(e);return t.isOdd(r)?t.neg(r):r}Me.FpSqrtEven=i3;function s3(t,e,r=!1){t=(0,In.ensureBytes)("privateHash",t);let n=t.length,i=Ef(e).nByteLength+8;if(i<24||n<i||n>1024)throw new Error(`hashToPrivateScalar: expected ${i}-1024 bytes of input, got ${n}`);let s=r?(0,In.bytesToNumberLE)(t):(0,In.bytesToNumberBE)(t);return qr(s,e-rt)+rt}Me.hashToPrivateScalar=s3});var Vl=K(fs=>{"use strict";I();O();Object.defineProperty(fs,"__esModule",{value:!0});fs.validateBasic=fs.wNAF=void 0;var zl=Ei(),o3=Tn(),a3=BigInt(0),xf=BigInt(1);function c3(t,e){let r=(i,s)=>{let a=s.negate();return i?a:s},n=i=>{let s=Math.ceil(e/i)+1,a=2**(i-1);return{windows:s,windowSize:a}};return{constTimeNegate:r,unsafeLadder(i,s){let a=t.ZERO,c=i;for(;s>a3;)s&xf&&(a=a.add(c)),c=c.double(),s>>=xf;return a},precomputeWindow(i,s){let{windows:a,windowSize:c}=n(s),d=[],h=i,y=h;for(let p=0;p<a;p++){y=h,d.push(y);for(let w=1;w<c;w++)y=y.add(h),d.push(y);h=y.double()}return d},wNAF(i,s,a){let{windows:c,windowSize:d}=n(i),h=t.ZERO,y=t.BASE,p=BigInt(2**i-1),w=2**i,v=BigInt(i);for(let _=0;_<c;_++){let m=_*d,M=Number(a&p);a>>=v,M>d&&(M-=w,a+=xf);let N=m,L=m+Math.abs(M)-1,C=_%2!==0,V=M<0;M===0?y=y.add(r(C,s[N])):h=h.add(r(V,s[L]))}return{p:h,f:y}},wNAFCached(i,s,a,c){let d=i._WINDOW_SIZE||1,h=s.get(i);return h||(h=this.precomputeWindow(i,d),d!==1&&s.set(i,c(h))),this.wNAF(d,h,a)}}}fs.wNAF=c3;function f3(t){return(0,zl.validateField)(t.Fp),(0,o3.validateObject)(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,zl.nLength)(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}fs.validateBasic=f3});var ia=K(nt=>{"use strict";I();O();var u3=nt&&nt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),d3=nt&&nt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Gl=nt&&nt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&u3(e,t,r);return d3(e,t),e};Object.defineProperty(nt,"__esModule",{value:!0});nt.mapToCurveSimpleSWU=nt.SWUFpSqrtRatio=nt.weierstrass=nt.weierstrassPoints=nt.DER=void 0;var Js=Gl(Ei()),Dt=Gl(Tn()),wn=Tn(),Af=Vl();function l3(t){let e=(0,Af.validateBasic)(t);Dt.validateObject(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}var{bytesToNumberBE:h3,hexToBytes:b3}=Dt;nt.DER={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){let{Err:e}=nt.DER;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");let r=t[1],n=t.subarray(2,r+2);if(!r||n.length!==r)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:h3(n),l:t.subarray(r+2)}},toSig(t){let{Err:e}=nt.DER,r=typeof t=="string"?b3(t):t;if(!(r instanceof Uint8Array))throw new Error("ui8a expected");let n=r.length;if(n<2||r[0]!=48)throw new e("Invalid signature tag");if(r[1]!==n-2)throw new e("Invalid signature: incorrect length");let{d:i,l:s}=nt.DER._parseInt(r.subarray(2)),{d:a,l:c}=nt.DER._parseInt(s);if(c.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s:a}},hexFromSig(t){let e=h=>Number.parseInt(h[0],16)&8?"00"+h:h,r=h=>{let y=h.toString(16);return y.length&1?`0${y}`:y},n=e(r(t.s)),i=e(r(t.r)),s=n.length/2,a=i.length/2,c=r(s),d=r(a);return`30${r(a+s+4)}02${d}${i}02${c}${n}`}};var Jr=BigInt(0),mt=BigInt(1),Yn=BigInt(2),na=BigInt(3),$l=BigInt(4);function Wl(t){let e=l3(t),{Fp:r}=e,n=e.toBytes||((_,m,M)=>{let N=m.toAffine();return Dt.concatBytes(Uint8Array.from([4]),r.toBytes(N.x),r.toBytes(N.y))}),i=e.fromBytes||(_=>{let m=_.subarray(1),M=r.fromBytes(m.subarray(0,r.BYTES)),N=r.fromBytes(m.subarray(r.BYTES,2*r.BYTES));return{x:M,y:N}});function s(_){let{a:m,b:M}=e,N=r.sqr(_),L=r.mul(N,_);return r.add(r.add(L,r.mul(_,m)),M)}if(!r.eql(r.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function a(_){return typeof _=="bigint"&&Jr<_&&_<e.n}function c(_){if(!a(_))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function d(_){let{allowedPrivateKeyLengths:m,nByteLength:M,wrapPrivateKey:N,n:L}=e;if(m&&typeof _!="bigint"){if(_ instanceof Uint8Array&&(_=Dt.bytesToHex(_)),typeof _!="string"||!m.includes(_.length))throw new Error("Invalid key");_=_.padStart(M*2,"0")}let C;try{C=typeof _=="bigint"?_:Dt.bytesToNumberBE((0,wn.ensureBytes)("private key",_,M))}catch{throw new Error(`private key must be ${M} bytes, hex or bigint, not ${typeof _}`)}return N&&(C=Js.mod(C,L)),c(C),C}let h=new Map;function y(_){if(!(_ instanceof p))throw new Error("ProjectivePoint expected")}class p{constructor(m,M,N){if(this.px=m,this.py=M,this.pz=N,m==null||!r.isValid(m))throw new Error("x required");if(M==null||!r.isValid(M))throw new Error("y required");if(N==null||!r.isValid(N))throw new Error("z required")}static fromAffine(m){let{x:M,y:N}=m||{};if(!m||!r.isValid(M)||!r.isValid(N))throw new Error("invalid affine point");if(m instanceof p)throw new Error("projective point not allowed");let L=C=>r.eql(C,r.ZERO);return L(M)&&L(N)?p.ZERO:new p(M,N,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(m){let M=r.invertBatch(m.map(N=>N.pz));return m.map((N,L)=>N.toAffine(M[L])).map(p.fromAffine)}static fromHex(m){let M=p.fromAffine(i((0,wn.ensureBytes)("pointHex",m)));return M.assertValidity(),M}static fromPrivateKey(m){return p.BASE.multiply(d(m))}_setWindowSize(m){this._WINDOW_SIZE=m,h.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint)return;throw new Error("bad point: ZERO")}let{x:m,y:M}=this.toAffine();if(!r.isValid(m)||!r.isValid(M))throw new Error("bad point: x or y not FE");let N=r.sqr(M),L=s(m);if(!r.eql(N,L))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:m}=this.toAffine();if(r.isOdd)return!r.isOdd(m);throw new Error("Field doesn't support isOdd")}equals(m){y(m);let{px:M,py:N,pz:L}=this,{px:C,py:V,pz:F}=m,H=r.eql(r.mul(M,F),r.mul(C,L)),G=r.eql(r.mul(N,F),r.mul(V,L));return H&&G}negate(){return new p(this.px,r.neg(this.py),this.pz)}double(){let{a:m,b:M}=e,N=r.mul(M,na),{px:L,py:C,pz:V}=this,F=r.ZERO,H=r.ZERO,G=r.ZERO,z=r.mul(L,L),se=r.mul(C,C),A=r.mul(V,V),o=r.mul(L,C);return o=r.add(o,o),G=r.mul(L,V),G=r.add(G,G),F=r.mul(m,G),H=r.mul(N,A),H=r.add(F,H),F=r.sub(se,H),H=r.add(se,H),H=r.mul(F,H),F=r.mul(o,F),G=r.mul(N,G),A=r.mul(m,A),o=r.sub(z,A),o=r.mul(m,o),o=r.add(o,G),G=r.add(z,z),z=r.add(G,z),z=r.add(z,A),z=r.mul(z,o),H=r.add(H,z),A=r.mul(C,V),A=r.add(A,A),z=r.mul(A,o),F=r.sub(F,z),G=r.mul(A,se),G=r.add(G,G),G=r.add(G,G),new p(F,H,G)}add(m){y(m);let{px:M,py:N,pz:L}=this,{px:C,py:V,pz:F}=m,H=r.ZERO,G=r.ZERO,z=r.ZERO,se=e.a,A=r.mul(e.b,na),o=r.mul(M,C),l=r.mul(N,V),b=r.mul(L,F),u=r.add(M,N),g=r.add(C,V);u=r.mul(u,g),g=r.add(o,l),u=r.sub(u,g),g=r.add(M,L);let x=r.add(C,F);return g=r.mul(g,x),x=r.add(o,b),g=r.sub(g,x),x=r.add(N,L),H=r.add(V,F),x=r.mul(x,H),H=r.add(l,b),x=r.sub(x,H),z=r.mul(se,g),H=r.mul(A,b),z=r.add(H,z),H=r.sub(l,z),z=r.add(l,z),G=r.mul(H,z),l=r.add(o,o),l=r.add(l,o),b=r.mul(se,b),g=r.mul(A,g),l=r.add(l,b),b=r.sub(o,b),b=r.mul(se,b),g=r.add(g,b),o=r.mul(l,g),G=r.add(G,o),o=r.mul(x,g),H=r.mul(u,H),H=r.sub(H,o),o=r.mul(u,l),z=r.mul(x,z),z=r.add(z,o),new p(H,G,z)}subtract(m){return this.add(m.negate())}is0(){return this.equals(p.ZERO)}wNAF(m){return v.wNAFCached(this,h,m,M=>{let N=r.invertBatch(M.map(L=>L.pz));return M.map((L,C)=>L.toAffine(N[C])).map(p.fromAffine)})}multiplyUnsafe(m){let M=p.ZERO;if(m===Jr)return M;if(c(m),m===mt)return this;let{endo:N}=e;if(!N)return v.unsafeLadder(this,m);let{k1neg:L,k1:C,k2neg:V,k2:F}=N.splitScalar(m),H=M,G=M,z=this;for(;C>Jr||F>Jr;)C&mt&&(H=H.add(z)),F&mt&&(G=G.add(z)),z=z.double(),C>>=mt,F>>=mt;return L&&(H=H.negate()),V&&(G=G.negate()),G=new p(r.mul(G.px,N.beta),G.py,G.pz),H.add(G)}multiply(m){c(m);let M=m,N,L,{endo:C}=e;if(C){let{k1neg:V,k1:F,k2neg:H,k2:G}=C.splitScalar(M),{p:z,f:se}=this.wNAF(F),{p:A,f:o}=this.wNAF(G);z=v.constTimeNegate(V,z),A=v.constTimeNegate(H,A),A=new p(r.mul(A.px,C.beta),A.py,A.pz),N=z.add(A),L=se.add(o)}else{let{p:V,f:F}=this.wNAF(M);N=V,L=F}return p.normalizeZ([N,L])[0]}multiplyAndAddUnsafe(m,M,N){let L=p.BASE,C=(F,H)=>H===Jr||H===mt||!F.equals(L)?F.multiplyUnsafe(H):F.multiply(H),V=C(this,M).add(C(m,N));return V.is0()?void 0:V}toAffine(m){let{px:M,py:N,pz:L}=this,C=this.is0();m==null&&(m=C?r.ONE:r.inv(L));let V=r.mul(M,m),F=r.mul(N,m),H=r.mul(L,m);if(C)return{x:r.ZERO,y:r.ZERO};if(!r.eql(H,r.ONE))throw new Error("invZ was invalid");return{x:V,y:F}}isTorsionFree(){let{h:m,isTorsionFree:M}=e;if(m===mt)return!0;if(M)return M(p,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:m,clearCofactor:M}=e;return m===mt?this:M?M(p,this):this.multiplyUnsafe(e.h)}toRawBytes(m=!0){return this.assertValidity(),n(p,this,m)}toHex(m=!0){return Dt.bytesToHex(this.toRawBytes(m))}}p.BASE=new p(e.Gx,e.Gy,r.ONE),p.ZERO=new p(r.ZERO,r.ONE,r.ZERO);let w=e.nBitLength,v=(0,Af.wNAF)(p,e.endo?Math.ceil(w/2):w);return{CURVE:e,ProjectivePoint:p,normPrivateKeyToScalar:d,weierstrassEquation:s,isWithinCurveOrder:a}}nt.weierstrassPoints=Wl;function p3(t){let e=(0,Af.validateBasic)(t);return Dt.validateObject(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function g3(t){let e=p3(t),{Fp:r,n}=e,i=r.BYTES+1,s=2*r.BYTES+1;function a(g){return Jr<g&&g<r.ORDER}function c(g){return Js.mod(g,n)}function d(g){return Js.invert(g,n)}let{ProjectivePoint:h,normPrivateKeyToScalar:y,weierstrassEquation:p,isWithinCurveOrder:w}=Wl({...e,toBytes(g,x,B){let S=x.toAffine(),f=r.toBytes(S.x),E=Dt.concatBytes;return B?E(Uint8Array.from([x.hasEvenY()?2:3]),f):E(Uint8Array.from([4]),f,r.toBytes(S.y))},fromBytes(g){let x=g.length,B=g[0],S=g.subarray(1);if(x===i&&(B===2||B===3)){let f=Dt.bytesToNumberBE(S);if(!a(f))throw new Error("Point is not on curve");let E=p(f),W=r.sqrt(E),X=(W&mt)===mt;return(B&1)===1!==X&&(W=r.neg(W)),{x:f,y:W}}else if(x===s&&B===4){let f=r.fromBytes(S.subarray(0,r.BYTES)),E=r.fromBytes(S.subarray(r.BYTES,2*r.BYTES));return{x:f,y:E}}else throw new Error(`Point of length ${x} was invalid. Expected ${i} compressed bytes or ${s} uncompressed bytes`)}}),v=g=>Dt.bytesToHex(Dt.numberToBytesBE(g,e.nByteLength));function _(g){let x=n>>mt;return g>x}function m(g){return _(g)?c(-g):g}let M=(g,x,B)=>Dt.bytesToNumberBE(g.slice(x,B));class N{constructor(x,B,S){this.r=x,this.s=B,this.recovery=S,this.assertValidity()}static fromCompact(x){let B=e.nByteLength;return x=(0,wn.ensureBytes)("compactSignature",x,B*2),new N(M(x,0,B),M(x,B,2*B))}static fromDER(x){let{r:B,s:S}=nt.DER.toSig((0,wn.ensureBytes)("DER",x));return new N(B,S)}assertValidity(){if(!w(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!w(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(x){return new N(this.r,this.s,x)}recoverPublicKey(x){let{r:B,s:S,recovery:f}=this,E=G((0,wn.ensureBytes)("msgHash",x));if(f==null||![0,1,2,3].includes(f))throw new Error("recovery id invalid");let W=f===2||f===3?B+e.n:B;if(W>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");let X=(f&1)===0?"02":"03",J=h.fromHex(X+v(W)),te=d(W),ae=c(-E*te),le=c(S*te),st=h.BASE.multiplyAndAddUnsafe(J,ae,le);if(!st)throw new Error("point at infinify");return st.assertValidity(),st}hasHighS(){return _(this.s)}normalizeS(){return this.hasHighS()?new N(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return Dt.hexToBytes(this.toDERHex())}toDERHex(){return nt.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Dt.hexToBytes(this.toCompactHex())}toCompactHex(){return v(this.r)+v(this.s)}}let L={isValidPrivateKey(g){try{return y(g),!0}catch{return!1}},normPrivateKeyToScalar:y,randomPrivateKey:()=>{let g=e.randomBytes(r.BYTES+8),x=Js.hashToPrivateScalar(g,n);return Dt.numberToBytesBE(x,e.nByteLength)},precompute(g=8,x=h.BASE){return x._setWindowSize(g),x.multiply(BigInt(3)),x}};function C(g,x=!0){return h.fromPrivateKey(g).toRawBytes(x)}function V(g){let x=g instanceof Uint8Array,B=typeof g=="string",S=(x||B)&&g.length;return x?S===i||S===s:B?S===2*i||S===2*s:g instanceof h}function F(g,x,B=!0){if(V(g))throw new Error("first arg must be private key");if(!V(x))throw new Error("second arg must be public key");return h.fromHex(x).multiply(y(g)).toRawBytes(B)}let H=e.bits2int||function(g){let x=Dt.bytesToNumberBE(g),B=g.length*8-e.nBitLength;return B>0?x>>BigInt(B):x},G=e.bits2int_modN||function(g){return c(H(g))},z=Dt.bitMask(e.nBitLength);function se(g){if(typeof g!="bigint")throw new Error("bigint expected");if(!(Jr<=g&&g<z))throw new Error(`bigint expected < 2^${e.nBitLength}`);return Dt.numberToBytesBE(g,e.nByteLength)}function A(g,x,B=o){if(["recovered","canonical"].some(Te=>Te in B))throw new Error("sign() legacy options not supported");let{hash:S,randomBytes:f}=e,{lowS:E,prehash:W,extraEntropy:X}=B;E==null&&(E=!0),g=(0,wn.ensureBytes)("msgHash",g),W&&(g=(0,wn.ensureBytes)("prehashed msgHash",S(g)));let J=G(g),te=y(x),ae=[se(te),se(J)];if(X!=null){let Te=X===!0?f(r.BYTES):X;ae.push((0,wn.ensureBytes)("extraEntropy",Te,r.BYTES))}let le=Dt.concatBytes(...ae),st=J;function qe(Te){let zr=H(Te);if(!w(zr))return;let ze=d(zr),ke=h.BASE.multiply(zr).toAffine(),Ir=c(ke.x);if(Ir===Jr)return;let Ve=c(ze*c(st+Ir*te));if(Ve===Jr)return;let Je=(ke.x===Ir?0:2)|Number(ke.y&mt),fi=Ve;return E&&_(Ve)&&(fi=m(Ve),Je^=1),new N(Ir,fi,Je)}return{seed:le,k2sig:qe}}let o={lowS:e.lowS,prehash:!1},l={lowS:e.lowS,prehash:!1};function b(g,x,B=o){let{seed:S,k2sig:f}=A(g,x,B),E=e;return Dt.createHmacDrbg(E.hash.outputLen,E.nByteLength,E.hmac)(S,f)}h.BASE._setWindowSize(8);function u(g,x,B,S=l){let f=g;if(x=(0,wn.ensureBytes)("msgHash",x),B=(0,wn.ensureBytes)("publicKey",B),"strict"in S)throw new Error("options.strict was renamed to lowS");let{lowS:E,prehash:W}=S,X,J;try{if(typeof f=="string"||f instanceof Uint8Array)try{X=N.fromDER(f)}catch(ke){if(!(ke instanceof nt.DER.Err))throw ke;X=N.fromCompact(f)}else if(typeof f=="object"&&typeof f.r=="bigint"&&typeof f.s=="bigint"){let{r:ke,s:Ir}=f;X=new N(ke,Ir)}else throw new Error("PARSE");J=h.fromHex(B)}catch(ke){if(ke.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(E&&X.hasHighS())return!1;W&&(x=e.hash(x));let{r:te,s:ae}=X,le=G(x),st=d(ae),qe=c(le*st),Te=c(te*st),zr=h.BASE.multiplyAndAddUnsafe(J,qe,Te)?.toAffine();return zr?c(zr.x)===te:!1}return{CURVE:e,getPublicKey:C,getSharedSecret:F,sign:b,verify:u,ProjectivePoint:h,Signature:N,utils:L}}nt.weierstrass=g3;function Zl(t,e){let r=t.ORDER,n=Jr;for(let _=r-mt;_%Yn===Jr;_/=Yn)n+=mt;let i=n,s=Yn<<i-mt-mt,a=s*Yn,c=(r-mt)/a,d=(c-mt)/Yn,h=a-mt,y=s,p=t.pow(e,c),w=t.pow(e,(c+mt)/Yn),v=(_,m)=>{let M=p,N=t.pow(m,h),L=t.sqr(N);L=t.mul(L,m);let C=t.mul(_,L);C=t.pow(C,d),C=t.mul(C,N),N=t.mul(C,m),L=t.mul(C,_);let V=t.mul(L,N);C=t.pow(V,y);let F=t.eql(C,t.ONE);N=t.mul(L,w),C=t.mul(V,M),L=t.cmov(N,L,F),V=t.cmov(C,V,F);for(let H=i;H>mt;H--){let G=H-Yn;G=Yn<<G-mt;let z=t.pow(V,G),se=t.eql(z,t.ONE);N=t.mul(L,M),M=t.mul(M,M),z=t.mul(V,M),L=t.cmov(N,L,se),V=t.cmov(z,V,se)}return{isValid:F,value:L}};if(t.ORDER%$l===na){let _=(t.ORDER-na)/$l,m=t.sqrt(t.neg(e));v=(M,N)=>{let L=t.sqr(N),C=t.mul(M,N);L=t.mul(L,C);let V=t.pow(L,_);V=t.mul(V,C);let F=t.mul(V,m),H=t.mul(t.sqr(V),N),G=t.eql(H,M),z=t.cmov(F,V,G);return{isValid:G,value:z}}}return v}nt.SWUFpSqrtRatio=Zl;function y3(t,e){if(Js.validateField(t),!t.isValid(e.A)||!t.isValid(e.B)||!t.isValid(e.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");let r=Zl(t,e.Z);if(!t.isOdd)throw new Error("Fp.isOdd is not implemented!");return n=>{let i,s,a,c,d,h,y,p;i=t.sqr(n),i=t.mul(i,e.Z),s=t.sqr(i),s=t.add(s,i),a=t.add(s,t.ONE),a=t.mul(a,e.B),c=t.cmov(e.Z,t.neg(s),!t.eql(s,t.ZERO)),c=t.mul(c,e.A),s=t.sqr(a),h=t.sqr(c),d=t.mul(h,e.A),s=t.add(s,d),s=t.mul(s,a),h=t.mul(h,c),d=t.mul(h,e.B),s=t.add(s,d),y=t.mul(i,a);let{isValid:w,value:v}=r(s,h);p=t.mul(i,n),p=t.mul(p,v),y=t.cmov(y,a,w),p=t.cmov(p,v,w);let _=t.isOdd(n)===t.isOdd(p);return p=t.cmov(t.neg(p),p,_),y=t.div(y,c),{x:y,y:p}}}nt.mapToCurveSimpleSWU=y3});var Jl=K(Cr=>{"use strict";I();O();Object.defineProperty(Cr,"__esModule",{value:!0});Cr.createHasher=Cr.isogenyMap=Cr.hash_to_field=Cr.expand_message_xof=Cr.expand_message_xmd=void 0;var m3=Ei(),Qr=Tn();function v3(t){if(t instanceof Uint8Array)return t;if(typeof t=="string")return(0,Qr.utf8ToBytes)(t);throw new Error("DST must be Uint8Array or string")}var w3=Qr.bytesToNumberBE;function Jn(t,e){if(t<0||t>=1<<8*e)throw new Error(`bad I2OSP call: value=${t} length=${e}`);let r=Array.from({length:e}).fill(0);for(let n=e-1;n>=0;n--)r[n]=t&255,t>>>=8;return new Uint8Array(r)}function S3(t,e){let r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t[n]^e[n];return r}function Qs(t){if(!(t instanceof Uint8Array))throw new Error("Uint8Array expected")}function Tf(t){if(!Number.isSafeInteger(t))throw new Error("number expected")}function Xl(t,e,r,n){Qs(t),Qs(e),Tf(r),e.length>255&&(e=n((0,Qr.concatBytes)((0,Qr.utf8ToBytes)("H2C-OVERSIZE-DST-"),e)));let{outputLen:i,blockLen:s}=n,a=Math.ceil(r/i);if(a>255)throw new Error("Invalid xmd length");let c=(0,Qr.concatBytes)(e,Jn(e.length,1)),d=Jn(0,s),h=Jn(r,2),y=new Array(a),p=n((0,Qr.concatBytes)(d,t,h,Jn(0,1),c));y[0]=n((0,Qr.concatBytes)(p,Jn(1,1),c));for(let v=1;v<=a;v++){let _=[S3(p,y[v-1]),Jn(v+1,1),c];y[v]=n((0,Qr.concatBytes)(..._))}return(0,Qr.concatBytes)(...y).slice(0,r)}Cr.expand_message_xmd=Xl;function Yl(t,e,r,n,i){if(Qs(t),Qs(e),Tf(r),e.length>255){let s=Math.ceil(2*n/8);e=i.create({dkLen:s}).update((0,Qr.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(e).digest()}if(r>65535||e.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return i.create({dkLen:r}).update(t).update(Jn(r,2)).update(e).update(Jn(e.length,1)).digest()}Cr.expand_message_xof=Yl;function Mf(t,e,r){(0,Qr.validateObject)(r,{DST:"string",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});let{p:n,k:i,m:s,hash:a,expand:c,DST:d}=r;Qs(t),Tf(e);let h=v3(d),y=n.toString(2).length,p=Math.ceil((y+i)/8),w=e*s*p,v;if(c==="xmd")v=Xl(t,h,w,a);else if(c==="xof")v=Yl(t,h,w,i,a);else if(c==="_internal_pass")v=t;else throw new Error('expand must be "xmd" or "xof"');let _=new Array(e);for(let m=0;m<e;m++){let M=new Array(s);for(let N=0;N<s;N++){let L=p*(N+m*s),C=v.subarray(L,L+p);M[N]=(0,m3.mod)(w3(C),n)}_[m]=M}return _}Cr.hash_to_field=Mf;function _3(t,e){let r=e.map(n=>Array.from(n).reverse());return(n,i)=>{let[s,a,c,d]=r.map(h=>h.reduce((y,p)=>t.add(t.mul(y,n),p)));return n=t.div(s,a),i=t.mul(i,t.div(c,d)),{x:n,y:i}}}Cr.isogenyMap=_3;function E3(t,e,r){if(typeof e!="function")throw new Error("mapToCurve() must be defined");return{hashToCurve(n,i){let s=Mf(n,2,{...r,DST:r.DST,...i}),a=t.fromAffine(e(s[0])),c=t.fromAffine(e(s[1])),d=a.add(c).clearCofactor();return d.assertValidity(),d},encodeToCurve(n,i){let s=Mf(n,1,{...r,DST:r.encodeDST,...i}),a=t.fromAffine(e(s[0])).clearCofactor();return a.assertValidity(),a}}}Cr.createHasher=E3});var If=K(us=>{"use strict";I();O();Object.defineProperty(us,"__esModule",{value:!0});us.createCurve=us.getHash=void 0;var x3=Us(),Ql=rr(),A3=ia();function eh(t){return{hash:t,hmac:(e,...r)=>(0,x3.hmac)(t,e,(0,Ql.concatBytes)(...r)),randomBytes:Ql.randomBytes}}us.getHash=eh;function M3(t,e){let r=n=>(0,A3.weierstrass)({...t,...eh(n)});return Object.freeze({...r(e),create:r})}us.createCurve=M3});var uh=K(Ut=>{"use strict";I();O();var T3=Ut&&Ut.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),I3=Ut&&Ut.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),O3=Ut&&Ut.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&T3(e,t,r);return I3(e,t),e},Of;Object.defineProperty(Ut,"__esModule",{value:!0});Ut.encodeToCurve=Ut.hashToCurve=Ut.schnorr=Ut.secp256k1=void 0;var sa=Di(),B3=rr(),Qt=Ei(),P3=ia(),fr=Tn(),nh=O3(Jl()),j3=If(),fa=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),oa=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),ih=BigInt(1),aa=BigInt(2),th=(t,e)=>(t+e/aa)/e;function sh(t){let e=fa,r=BigInt(3),n=BigInt(6),i=BigInt(11),s=BigInt(22),a=BigInt(23),c=BigInt(44),d=BigInt(88),h=t*t*t%e,y=h*h*t%e,p=(0,Qt.pow2)(y,r,e)*y%e,w=(0,Qt.pow2)(p,r,e)*y%e,v=(0,Qt.pow2)(w,aa,e)*h%e,_=(0,Qt.pow2)(v,i,e)*v%e,m=(0,Qt.pow2)(_,s,e)*_%e,M=(0,Qt.pow2)(m,c,e)*m%e,N=(0,Qt.pow2)(M,d,e)*M%e,L=(0,Qt.pow2)(N,c,e)*m%e,C=(0,Qt.pow2)(L,r,e)*y%e,V=(0,Qt.pow2)(C,a,e)*_%e,F=(0,Qt.pow2)(V,n,e)*h%e,H=(0,Qt.pow2)(F,aa,e);if(!Qn.eql(Qn.sqr(H),t))throw new Error("Cannot find square root");return H}var Qn=(0,Qt.Field)(fa,void 0,void 0,{sqrt:sh});Ut.secp256k1=(0,j3.createCurve)({a:BigInt(0),b:BigInt(7),Fp:Qn,n:oa,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{let e=oa,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-ih*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,a=BigInt("0x100000000000000000000000000000000"),c=th(s*t,e),d=th(-n*t,e),h=(0,Qt.mod)(t-c*r-d*i,e),y=(0,Qt.mod)(-c*n-d*s,e),p=h>a,w=y>a;if(p&&(h=e-h),w&&(y=e-y),h>a||y>a)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:p,k1:h,k2neg:w,k2:y}}}},sa.sha256);var ua=BigInt(0),oh=t=>typeof t=="bigint"&&ua<t&&t<fa,N3=t=>typeof t=="bigint"&&ua<t&&t<oa,rh={};function ca(t,...e){let r=rh[t];if(r===void 0){let n=(0,sa.sha256)(Uint8Array.from(t,i=>i.charCodeAt(0)));r=(0,fr.concatBytes)(n,n),rh[t]=r}return(0,sa.sha256)((0,fr.concatBytes)(r,...e))}var Nf=t=>t.toRawBytes(!0).slice(1),Pf=t=>(0,fr.numberToBytesBE)(t,32),Bf=t=>(0,Qt.mod)(t,fa),eo=t=>(0,Qt.mod)(t,oa),kf=Ut.secp256k1.ProjectivePoint,k3=(t,e,r)=>kf.BASE.multiplyAndAddUnsafe(t,e,r);function jf(t){let e=Ut.secp256k1.utils.normPrivateKeyToScalar(t),r=kf.fromPrivateKey(e);return{scalar:r.hasEvenY()?e:eo(-e),bytes:Nf(r)}}function ah(t){if(!oh(t))throw new Error("bad x: need 0 < x < p");let e=Bf(t*t),r=Bf(e*t+BigInt(7)),n=sh(r);n%aa!==ua&&(n=Bf(-n));let i=new kf(t,n,ih);return i.assertValidity(),i}function ch(...t){return eo((0,fr.bytesToNumberBE)(ca("BIP0340/challenge",...t)))}function R3(t){return jf(t).bytes}function q3(t,e,r=(0,B3.randomBytes)(32)){let n=(0,fr.ensureBytes)("message",t),{bytes:i,scalar:s}=jf(e),a=(0,fr.ensureBytes)("auxRand",r,32),c=Pf(s^(0,fr.bytesToNumberBE)(ca("BIP0340/aux",a))),d=ca("BIP0340/nonce",c,i,n),h=eo((0,fr.bytesToNumberBE)(d));if(h===ua)throw new Error("sign failed: k is zero");let{bytes:y,scalar:p}=jf(h),w=ch(y,i,n),v=new Uint8Array(64);if(v.set(y,0),v.set(Pf(eo(p+w*s)),32),!fh(v,n,i))throw new Error("sign: Invalid signature produced");return v}function fh(t,e,r){let n=(0,fr.ensureBytes)("signature",t,64),i=(0,fr.ensureBytes)("message",e),s=(0,fr.ensureBytes)("publicKey",r,32);try{let a=ah((0,fr.bytesToNumberBE)(s)),c=(0,fr.bytesToNumberBE)(n.subarray(0,32));if(!oh(c))return!1;let d=(0,fr.bytesToNumberBE)(n.subarray(32,64));if(!N3(d))return!1;let h=ch(Pf(c),Nf(a),i),y=k3(a,d,eo(-h));return!(!y||!y.hasEvenY()||y.toAffine().x!==c)}catch{return!1}}Ut.schnorr={getPublicKey:R3,sign:q3,verify:fh,utils:{randomPrivateKey:Ut.secp256k1.utils.randomPrivateKey,lift_x:ah,pointToBytes:Nf,numberToBytesBE:fr.numberToBytesBE,bytesToNumberBE:fr.bytesToNumberBE,taggedHash:ca,mod:Qt.mod}};var C3=nh.isogenyMap(Qn,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(t=>t.map(e=>BigInt(e)))),D3=(0,P3.mapToCurveSimpleSWU)(Qn,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:Qn.create(BigInt("-11"))});Of=nh.createHasher(Ut.secp256k1.ProjectivePoint,t=>{let{x:e,y:r}=D3(Qn.create(t[0]));return C3(e,r)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:Qn.ORDER,m:1,k:128,expand:"xmd",hash:sa.sha256}),Ut.hashToCurve=Of.hashToCurve,Ut.encodeToCurve=Of.encodeToCurve});var hh=K(ei=>{"use strict";I();O();Object.defineProperty(ei,"__esModule",{value:!0});ei.poseidon=ei.splitConstants=ei.validateOpts=void 0;var dh=Ei();function lh(t){let{Fp:e}=t;(0,dh.validateField)(e);for(let d of["t","roundsFull","roundsPartial"])if(typeof t[d]!="number"||!Number.isSafeInteger(t[d]))throw new Error(`Poseidon: invalid param ${d}=${t[d]} (${typeof t[d]})`);if(t.reversePartialPowIdx!==void 0&&typeof t.reversePartialPowIdx!="boolean")throw new Error(`Poseidon: invalid param reversePartialPowIdx=${t.reversePartialPowIdx}`);let r=t.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=d=>(0,dh.FpPow)(e,d,n);if(r===3?i=d=>e.mul(e.sqrN(d),d):r===5&&(i=d=>e.mul(e.sqrN(e.sqrN(d)),d)),t.roundsFull%2!==0)throw new Error(`Poseidon roundsFull is not even: ${t.roundsFull}`);let s=t.roundsFull+t.roundsPartial;if(!Array.isArray(t.roundConstants)||t.roundConstants.length!==s)throw new Error("Poseidon: wrong round constants");let a=t.roundConstants.map(d=>{if(!Array.isArray(d)||d.length!==t.t)throw new Error(`Poseidon wrong round constants: ${d}`);return d.map(h=>{if(typeof h!="bigint"||!e.isValid(h))throw new Error(`Poseidon wrong round constant=${h}`);return e.create(h)})});if(!Array.isArray(t.mds)||t.mds.length!==t.t)throw new Error("Poseidon: wrong MDS matrix");let c=t.mds.map(d=>{if(!Array.isArray(d)||d.length!==t.t)throw new Error(`Poseidon MDS matrix row: ${d}`);return d.map(h=>{if(typeof h!="bigint")throw new Error(`Poseidon MDS matrix value=${h}`);return e.create(h)})});return Object.freeze({...t,rounds:s,sboxFn:i,roundConstants:a,mds:c})}ei.validateOpts=lh;function U3(t,e){if(typeof e!="number")throw new Error("poseidonSplitConstants: wrong t");if(!Array.isArray(t)||t.length%e)throw new Error("poseidonSplitConstants: wrong rc");let r=[],n=[];for(let i=0;i<t.length;i++)n.push(t[i]),n.length===e&&(r.push(n),n=[]);return r}ei.splitConstants=U3;function L3(t){let{t:e,Fp:r,rounds:n,sboxFn:i,reversePartialPowIdx:s}=lh(t),a=Math.floor(t.roundsFull/2),c=s?e-1:0,d=(y,p,w)=>(y=y.map((v,_)=>r.add(v,t.roundConstants[w][_])),p?y=y.map(v=>i(v)):y[c]=i(y[c]),y=t.mds.map(v=>v.reduce((_,m,M)=>r.add(_,r.mulN(m,y[M])),r.ZERO)),y),h=function(p){if(!Array.isArray(p)||p.length!==e)throw new Error(`Poseidon: wrong values (expected array of bigints with length ${e})`);p=p.map(v=>{if(typeof v!="bigint")throw new Error(`Poseidon: wrong value=${v} (${typeof v})`);return r.create(v)});let w=0;for(let v=0;v<a;v++)p=d(p,!0,w++);for(let v=0;v<t.roundsPartial;v++)p=d(p,!1,w++);for(let v=0;v<a;v++)p=d(p,!0,w++);if(w!==n)throw new Error(`Poseidon: wrong number of rounds: last round=${w}, total=${n}`);return p};return h.roundConstants=t.roundConstants,h}ei.poseidon=L3});var Mh=K(ne=>{"use strict";I();O();var H3=ne&&ne.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),K3=ne&&ne.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),F3=ne&&ne.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&H3(e,t,r);return K3(e,t),e};Object.defineProperty(ne,"__esModule",{value:!0});ne.poseidonHashMany=ne.poseidonHashSingle=ne.poseidonHashFunc=ne.poseidonHash=ne.poseidonSmall=ne.poseidonCreate=ne.poseidonBasic=ne._poseidonMDS=ne.Fp251=ne.Fp253=ne.keccak=ne.computeHashOnElements=ne.hashChain=ne.pedersen=ne.getAccountPath=ne.ethSigToPrivate=ne.getStarkKey=ne.grindKey=ne.utils=ne.Signature=ne.ProjectivePoint=ne.CURVE=ne.verify=ne.sign=ne.getSharedSecret=ne.getPublicKey=ne._starkCurve=void 0;var z3=Ao(),Cf=Di(),V3=rr(),Ai=Ei(),$3=hh(),G3=ia(),ur=F3(Tn()),W3=If(),la=BigInt("3618502788666131213697322783095070105526743751716087489154079457884512865583"),gh=252;function bh(t){for(;t[0]===0;)t=t.subarray(1);let e=t.length*8-gh,r=ur.bytesToNumberBE(t);return e>0?r>>BigInt(e):r}function yh(t){return typeof t=="string"&&(t=Uf(t),t.length&1&&(t="0"+t)),ur.hexToBytes(t)}var Mi=(0,G3.weierstrass)({a:BigInt(1),b:BigInt("3141592653589793238462643383279502884197169399375105820974944592307816406665"),Fp:(0,Ai.Field)(BigInt("0x800000000000011000000000000000000000000000000000000000000000001")),n:la,nBitLength:gh,Gx:BigInt("874739451078007766457464989774322083649278607533249481151382481072868806602"),Gy:BigInt("152666792071518830868575557812948353041420400780739481342941381225525861407"),h:BigInt(1),lowS:!1,...(0,W3.getHash)(Cf.sha256),bits2int:bh,bits2int_modN:t=>{let e=ur.bytesToNumberBE(t).toString(16);return e.length===63&&(t=yh(e+"0")),(0,Ai.mod)(bh(t),la)}});ne._starkCurve=Mi;function xi(t){return ur.ensureBytes("",typeof t=="string"?yh(t):t)}function Df(t){return ur.bytesToHex(xi(t)).padStart(64,"0")}function mh(t,e=!1){return Mi.getPublicKey(Df(t),e)}ne.getPublicKey=mh;function Z3(t,e){return Mi.getSharedSecret(Df(t),e)}ne.getSharedSecret=Z3;function X3(t,e,r){return Mi.sign(xi(t),Df(e),r)}ne.sign=X3;function Y3(t,e,r){let n=t instanceof vh?t:xi(t);return Mi.verify(n,xi(e),xi(r))}ne.verify=Y3;var{CURVE:J3,ProjectivePoint:ds,Signature:vh,utils:Q3}=Mi;ne.CURVE=J3;ne.ProjectivePoint=ds;ne.Signature=vh;ne.utils=Q3;function wh(t){return`0x${ur.bytesToHex(t.subarray(1)).replace(/^0+/gm,"")}`}function Uf(t){return t.replace(/^0x/i,"")}function e6(t){return`0x${t.toString(16)}`}function Sh(t){let e=xi(t),r=2n**256n,n=r-(0,Ai.mod)(r,la);for(let i=0;;i++){let s=Rf(ur.concatBytes(e,ur.numberToVarBytesBE(BigInt(i))));if(s<n)return(0,Ai.mod)(s,la).toString(16);if(i===1e5)throw new Error("grindKey is broken: tried 100k vals")}}ne.grindKey=Sh;function t6(t){return wh(mh(t,!0))}ne.getStarkKey=t6;function r6(t){if(t=Uf(t),t.length!==130)throw new Error("Wrong ethereum signature");return Sh(t.substring(0,64))}ne.ethSigToPrivate=r6;var n6=2n**31n-1n,da=t=>Number(t&n6);function i6(t,e,r,n){let i=da(Rf(t)),s=da(Rf(e)),a=ur.hexToNumber(Uf(r));return`m/2645'/${i}'/${s}'/${da(a)}'/${da(a>>31n)}'/${n}`}ne.getAccountPath=i6;var to=[new ds(2089986280348253421170679821480865132823066470938446095505822317253594081284n,1713931329540660377023406109199410414810705867260802078187082345529207694986n,1n),new ds(996781205833008774514500082376783249102396023663454813447423147977397232763n,1668503676786377725805489344771023921079126552019160156920634619255970485781n,1n),new ds(2251563274489750535117886426533222435294046428347329203627021249169616184184n,1798716007562728905295480679789526322175868328062420237419143593021674992973n,1n),new ds(2138414695194151160943305727036575959195309218611738193261179310511854807447n,113410276730064486255102093846540133784865286929052426931474106396135072156n,1n),new ds(2379962749567351885752724891227938183011949129833673362440656643086021394946n,776496453633298175483985398648758586525933812536653089401905292063708816422n,1n)];function _h(t,e){let r=[],n=t;for(let i=0;i<248;i++)r.push(n),n=n.double();n=e;for(let i=0;i<4;i++)r.push(n),n=n.double();return r}var s6=_h(to[1],to[2]),o6=_h(to[3],to[4]);function Eh(t){let e;if(typeof t=="bigint")e=t;else if(typeof t=="number"){if(!Number.isSafeInteger(t))throw new Error(`Invalid pedersenArg: ${t}`);e=BigInt(t)}else e=ur.bytesToNumberBE(xi(t));if(!(0n<=e&&e<Mi.CURVE.Fp.ORDER))throw new Error(`PedersenArg should be 0 <= value < CURVE.P: ${e}`);return e}function ph(t,e,r){let n=Eh(e);for(let i=0;i<252;i++){let s=r[i];if(s.equals(t))throw new Error("Same point");(n&1n)!==0n&&(t=t.add(s)),n>>=1n}return t}function Lf(t,e){let r=to[0];return r=ph(r,t,s6),r=ph(r,e,o6),wh(r.toRawBytes(!0))}ne.pedersen=Lf;function a6(t,e=Lf){if(!Array.isArray(t)||t.length<1)throw new Error("data should be array of at least 1 element");return t.length===1?e6(Eh(t[0])):Array.from(t).reverse().reduce((r,n)=>e(n,r))}ne.hashChain=a6;var c6=(t,e=Lf)=>[0,...t,t.length].reduce((r,n)=>e(r,n));ne.computeHashOnElements=c6;var f6=ur.bitMask(250),u6=t=>ur.bytesToNumberBE((0,z3.keccak_256)(t))&f6;ne.keccak=u6;var Rf=t=>ur.bytesToNumberBE((0,Cf.sha256)(t));ne.Fp253=(0,Ai.Field)(BigInt("14474011154664525231415395255581126252639794253786371766033694892385558855681"));ne.Fp251=(0,Ai.Field)(BigInt("3618502788666131213697322783095070105623107215331596699973092056135872020481"));function qf(t,e,r){let n=t.fromBytes((0,Cf.sha256)((0,V3.utf8ToBytes)(`${e}${r}`)));return t.create(n)}function xh(t,e,r,n=0){let i=[],s=[];for(let a=0;a<r;a++)i.push(qf(t,`${e}x`,n*r+a)),s.push(qf(t,`${e}y`,n*r+a));if(new Set([...i,...s]).size!==2*r)throw new Error("X and Y values are not distinct");return i.map(a=>s.map(c=>t.inv(t.sub(a,c))))}ne._poseidonMDS=xh;var d6=[[3,1,1],[1,-1,1],[1,1,-2]].map(t=>t.map(BigInt));function Hf(t,e){if((0,Ai.validateField)(t.Fp),!Number.isSafeInteger(t.rate)||!Number.isSafeInteger(t.capacity))throw new Error(`Wrong poseidon opts: ${t}`);let r=t.rate+t.capacity,n=t.roundsFull+t.roundsPartial,i=[];for(let a=0;a<n;a++){let c=[];for(let d=0;d<r;d++)c.push(qf(t.Fp,"Hades",r*a+d));i.push(c)}let s=(0,$3.poseidon)({...t,t:r,sboxPower:3,reversePartialPowIdx:!0,mds:e,roundConstants:i});return s.m=r,s.rate=t.rate,s.capacity=t.capacity,s}ne.poseidonBasic=Hf;function l6(t,e=0){let r=t.rate+t.capacity;if(!Number.isSafeInteger(e))throw new Error(`Wrong mdsAttempt=${e}`);return Hf(t,xh(t.Fp,"HadesMDS",r,e))}ne.poseidonCreate=l6;ne.poseidonSmall=Hf({Fp:ne.Fp251,rate:2,capacity:1,roundsFull:8,roundsPartial:83},d6);function Ah(t,e,r=ne.poseidonSmall){return r([t,e,2n])[0]}ne.poseidonHash=Ah;function h6(t,e,r=ne.poseidonSmall){return ur.numberToVarBytesBE(Ah(ur.bytesToNumberBE(t),ur.bytesToNumberBE(e),r))}ne.poseidonHashFunc=h6;function b6(t,e=ne.poseidonSmall){return e([t,0n,1n])[0]}ne.poseidonHashSingle=b6;function p6(t,e=ne.poseidonSmall){let{m:r,rate:n}=e;if(!Array.isArray(t))throw new Error("bigint array expected in values");let i=Array.from(t);for(i.push(1n);i.length%n!==0;)i.push(0n);let s=new Array(r).fill(0n);for(let a=0;a<i.length;a+=n){for(let c=0;c<n;c++)s[c]+=i[a+c];s=e(s)}return s[0]}ne.poseidonHashMany=p6});var Oh=K(dr=>{"use strict";I();O();var g6=dr&&dr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),y6=dr&&dr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Th=dr&&dr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&g6(e,t,r);return y6(e,t),e};Object.defineProperty(dr,"__esModule",{value:!0});dr.bytesToHex=dr.hexToBytes=dr.stark=dr.secp256k1=void 0;dr.secp256k1=Th(uh());dr.stark=Th(Mh());var Ih=Tn();Object.defineProperty(dr,"hexToBytes",{enumerable:!0,get:function(){return Ih.hexToBytes}});Object.defineProperty(dr,"bytesToHex",{enumerable:!0,get:function(){return Ih.bytesToHex}})});var Bh=K(lr=>{"use strict";I();O();var m6=lr&&lr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),v6=lr&&lr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ha=lr&&lr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&m6(e,t,r);return v6(e,t),e};Object.defineProperty(lr,"__esModule",{value:!0});lr.schnorr=lr.p256=lr.ed25519=lr.secp256k1=void 0;lr.secp256k1=ha(wl());lr.ed25519=ha(Il());lr.p256=ha(jl());lr.schnorr=ha(Oh())});var jh=K(ls=>{"use strict";I();O();var w6=ls&&ls.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ls,"__esModule",{value:!0});ls.Decimal=void 0;var Ti=w6(Vt()),Ph=100,Lt=class{static fromUserInput(e,r){Lt.verifyFractionalDigits(r);let n=e.match(/[^0-9.]/);if(n)throw new Error(`Invalid character at position ${n.index+1}`);let i,s;if(e.search(/\./)===-1)i=e,s="";else{let c=e.split(".");switch(c.length){case 0:case 1:throw new Error("Fewer than two elements in split result. This must not happen here.");case 2:if(!c[1])throw new Error("Fractional part missing");i=c[0],s=c[1].replace(/0+$/,"");break;default:throw new Error("More than one separator found")}}if(s.length>r)throw new Error("Got more fractional digits than supported");let a=`${i}${s.padEnd(r,"0")}`;return new Lt(a,r)}static fromAtomics(e,r){return Lt.verifyFractionalDigits(r),new Lt(e,r)}static zero(e){return Lt.verifyFractionalDigits(e),new Lt("0",e)}static one(e){return Lt.verifyFractionalDigits(e),new Lt("1"+"0".repeat(e),e)}static verifyFractionalDigits(e){if(!Number.isInteger(e))throw new Error("Fractional digits is not an integer");if(e<0)throw new Error("Fractional digits must not be negative");if(e>Ph)throw new Error(`Fractional digits must not exceed ${Ph}`)}static compare(e,r){if(e.fractionalDigits!==r.fractionalDigits)throw new Error("Fractional digits do not match");return e.data.atomics.cmp(new Ti.default(r.atomics))}get atomics(){return this.data.atomics.toString()}get fractionalDigits(){return this.data.fractionalDigits}constructor(e,r){this.data={atomics:new Ti.default(e),fractionalDigits:r}}toString(){let e=new Ti.default(10).pow(new Ti.default(this.data.fractionalDigits)),r=this.data.atomics.div(e),n=this.data.atomics.mod(e);if(n.isZero())return r.toString();{let s=n.toString().padStart(this.data.fractionalDigits,"0").replace(/0+$/,"");return`${r.toString()}.${s}`}}toFloatApproximation(){let e=Number(this.toString());if(Number.isNaN(e))throw new Error("Conversion to number failed");return e}plus(e){if(this.fractionalDigits!==e.fractionalDigits)throw new Error("Fractional digits do not match");let r=this.data.atomics.add(new Ti.default(e.atomics));return new Lt(r.toString(),this.fractionalDigits)}minus(e){if(this.fractionalDigits!==e.fractionalDigits)throw new Error("Fractional digits do not match");let r=this.data.atomics.sub(new Ti.default(e.atomics));if(r.ltn(0))throw new Error("Difference must not be negative");return new Lt(r.toString(),this.fractionalDigits)}multiply(e){let r=this.data.atomics.mul(new Ti.default(e.toString()));return new Lt(r.toString(),this.fractionalDigits)}equals(e){return Lt.compare(this,e)===0}isLessThan(e){return Lt.compare(this,e)<0}isLessThanOrEqual(e){return Lt.compare(this,e)<=0}isGreaterThan(e){return Lt.compare(this,e)>0}isGreaterThanOrEqual(e){return Lt.compare(this,e)>=0}};ls.Decimal=Lt});var Nh=K(Dr=>{"use strict";I();O();var S6=Dr&&Dr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Dr,"__esModule",{value:!0});Dr.Uint64=Dr.Uint53=Dr.Int53=Dr.Uint32=void 0;var ba=S6(Vt()),_6=new ba.default("18446744073709551615",10,"be"),Ii=class{static fromBigEndianBytes(e){return Ii.fromBytes(e)}static fromBytes(e,r="be"){if(e.length!==4)throw new Error("Invalid input length. Expected 4 bytes.");for(let i=0;i<e.length;++i)if(!Number.isInteger(e[i])||e[i]>255||e[i]<0)throw new Error("Invalid value in byte. Found: "+e[i]);let n=r==="be"?e:Array.from(e).reverse();return new Ii(n[0]*2**24+n[1]*2**16+n[2]*2**8+n[3])}static fromString(e){if(!e.match(/^[0-9]+$/))throw new Error("Invalid string format");return new Ii(Number.parseInt(e,10))}constructor(e){if(Number.isNaN(e))throw new Error("Input is not a number");if(!Number.isInteger(e))throw new Error("Input is not an integer");if(e<0||e>4294967295)throw new Error("Input not in uint32 range: "+e.toString());this.data=e}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()}};Dr.Uint32=Ii;var Oi=class{static fromString(e){if(!e.match(/^-?[0-9]+$/))throw new Error("Invalid string format");return new Oi(Number.parseInt(e,10))}constructor(e){if(Number.isNaN(e))throw new Error("Input is not a number");if(!Number.isInteger(e))throw new Error("Input is not an integer");if(e<Number.MIN_SAFE_INTEGER||e>Number.MAX_SAFE_INTEGER)throw new Error("Input not in int53 range: "+e.toString());this.data=e}toNumber(){return this.data}toString(){return this.data.toString()}};Dr.Int53=Oi;var ro=class{static fromString(e){let r=Oi.fromString(e);return new ro(r.toNumber())}constructor(e){let r=new Oi(e);if(r.toNumber()<0)throw new Error("Input is negative");this.data=r}toNumber(){return this.data.toNumber()}toString(){return this.data.toString()}};Dr.Uint53=ro;var ti=class{static fromBytesBigEndian(e){return ti.fromBytes(e)}static fromBytes(e,r="be"){if(e.length!==8)throw new Error("Invalid input length. Expected 8 bytes.");for(let i=0;i<e.length;++i)if(!Number.isInteger(e[i])||e[i]>255||e[i]<0)throw new Error("Invalid value in byte. Found: "+e[i]);let n=r==="be"?Array.from(e):Array.from(e).reverse();return new ti(new ba.default(n))}static fromString(e){if(!e.match(/^[0-9]+$/))throw new Error("Invalid string format");return new ti(new ba.default(e,10,"be"))}static fromNumber(e){if(Number.isNaN(e))throw new Error("Input is not a number");if(!Number.isInteger(e))throw new Error("Input is not an integer");let r;try{r=new ba.default(e)}catch{throw new Error("Input is not a safe integer")}return new ti(r)}constructor(e){if(e.isNeg())throw new Error("Input is negative");if(e.gt(_6))throw new Error("Input exceeds uint64 range");this.data=e}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()}};Dr.Uint64=ti});var kh=K(Ur=>{"use strict";I();O();Object.defineProperty(Ur,"__esModule",{value:!0});Ur.Uint64=Ur.Uint53=Ur.Uint32=Ur.Int53=Ur.Decimal=void 0;var E6=jh();Object.defineProperty(Ur,"Decimal",{enumerable:!0,get:function(){return E6.Decimal}});var pa=Nh();Object.defineProperty(Ur,"Int53",{enumerable:!0,get:function(){return pa.Int53}});Object.defineProperty(Ur,"Uint32",{enumerable:!0,get:function(){return pa.Uint32}});Object.defineProperty(Ur,"Uint53",{enumerable:!0,get:function(){return pa.Uint53}});Object.defineProperty(Ur,"Uint64",{enumerable:!0,get:function(){return pa.Uint64}})});var Ch=K((qh,Kf)=>{I();O();var Rh=function(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=null;try{e=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(b,u,g){this.low=b|0,this.high=u|0,this.unsigned=!!g}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0});function n(b){return(b&&b.__isLong__)===!0}function i(b){var u=Math.clz32(b&-b);return b?31-u:u}r.isLong=n;var s={},a={};function c(b,u){var g,x,B;return u?(b>>>=0,(B=0<=b&&b<256)&&(x=a[b],x)?x:(g=h(b,0,!0),B&&(a[b]=g),g)):(b|=0,(B=-128<=b&&b<128)&&(x=s[b],x)?x:(g=h(b,b<0?-1:0,!1),B&&(s[b]=g),g))}r.fromInt=c;function d(b,u){if(isNaN(b))return u?V:C;if(u){if(b<0)return V;if(b>=M)return se}else{if(b<=-N)return A;if(b+1>=N)return z}return b<0?d(-b,u).neg():h(b%m|0,b/m|0,u)}r.fromNumber=d;function h(b,u,g){return new r(b,u,g)}r.fromBits=h;var y=Math.pow;function p(b,u,g){if(b.length===0)throw Error("empty string");if(typeof u=="number"?(g=u,u=!1):u=!!u,b==="NaN"||b==="Infinity"||b==="+Infinity"||b==="-Infinity")return u?V:C;if(g=g||10,g<2||36<g)throw RangeError("radix");var x;if((x=b.indexOf("-"))>0)throw Error("interior hyphen");if(x===0)return p(b.substring(1),u,g).neg();for(var B=d(y(g,8)),S=C,f=0;f<b.length;f+=8){var E=Math.min(8,b.length-f),W=parseInt(b.substring(f,f+E),g);if(E<8){var X=d(y(g,E));S=S.mul(X).add(d(W))}else S=S.mul(B),S=S.add(d(W))}return S.unsigned=u,S}r.fromString=p;function w(b,u){return typeof b=="number"?d(b,u):typeof b=="string"?p(b,u):h(b.low,b.high,typeof u=="boolean"?u:b.unsigned)}r.fromValue=w;var v=1<<16,_=1<<24,m=v*v,M=m*m,N=M/2,L=c(_),C=c(0);r.ZERO=C;var V=c(0,!0);r.UZERO=V;var F=c(1);r.ONE=F;var H=c(1,!0);r.UONE=H;var G=c(-1);r.NEG_ONE=G;var z=h(-1,2147483647,!1);r.MAX_VALUE=z;var se=h(-1,-1,!0);r.MAX_UNSIGNED_VALUE=se;var A=h(0,-2147483648,!1);r.MIN_VALUE=A;var o=r.prototype;o.toInt=function(){return this.unsigned?this.low>>>0:this.low},o.toNumber=function(){return this.unsigned?(this.high>>>0)*m+(this.low>>>0):this.high*m+(this.low>>>0)},o.toString=function(u){if(u=u||10,u<2||36<u)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(A)){var g=d(u),x=this.div(g),B=x.mul(g).sub(this);return x.toString(u)+B.toInt().toString(u)}else return"-"+this.neg().toString(u);for(var S=d(y(u,6),this.unsigned),f=this,E="";;){var W=f.div(S),X=f.sub(W.mul(S)).toInt()>>>0,J=X.toString(u);if(f=W,f.isZero())return J+E;for(;J.length<6;)J="0"+J;E=""+J+E}},o.getHighBits=function(){return this.high},o.getHighBitsUnsigned=function(){return this.high>>>0},o.getLowBits=function(){return this.low},o.getLowBitsUnsigned=function(){return this.low>>>0},o.getNumBitsAbs=function(){if(this.isNegative())return this.eq(A)?64:this.neg().getNumBitsAbs();for(var u=this.high!=0?this.high:this.low,g=31;g>0&&(u&1<<g)==0;g--);return this.high!=0?g+33:g+1},o.isZero=function(){return this.high===0&&this.low===0},o.eqz=o.isZero,o.isNegative=function(){return!this.unsigned&&this.high<0},o.isPositive=function(){return this.unsigned||this.high>=0},o.isOdd=function(){return(this.low&1)===1},o.isEven=function(){return(this.low&1)===0},o.equals=function(u){return n(u)||(u=w(u)),this.unsigned!==u.unsigned&&this.high>>>31===1&&u.high>>>31===1?!1:this.high===u.high&&this.low===u.low},o.eq=o.equals,o.notEquals=function(u){return!this.eq(u)},o.neq=o.notEquals,o.ne=o.notEquals,o.lessThan=function(u){return this.comp(u)<0},o.lt=o.lessThan,o.lessThanOrEqual=function(u){return this.comp(u)<=0},o.lte=o.lessThanOrEqual,o.le=o.lessThanOrEqual,o.greaterThan=function(u){return this.comp(u)>0},o.gt=o.greaterThan,o.greaterThanOrEqual=function(u){return this.comp(u)>=0},o.gte=o.greaterThanOrEqual,o.ge=o.greaterThanOrEqual,o.compare=function(u){if(n(u)||(u=w(u)),this.eq(u))return 0;var g=this.isNegative(),x=u.isNegative();return g&&!x?-1:!g&&x?1:this.unsigned?u.high>>>0>this.high>>>0||u.high===this.high&&u.low>>>0>this.low>>>0?-1:1:this.sub(u).isNegative()?-1:1},o.comp=o.compare,o.negate=function(){return!this.unsigned&&this.eq(A)?A:this.not().add(F)},o.neg=o.negate,o.add=function(u){n(u)||(u=w(u));var g=this.high>>>16,x=this.high&65535,B=this.low>>>16,S=this.low&65535,f=u.high>>>16,E=u.high&65535,W=u.low>>>16,X=u.low&65535,J=0,te=0,ae=0,le=0;return le+=S+X,ae+=le>>>16,le&=65535,ae+=B+W,te+=ae>>>16,ae&=65535,te+=x+E,J+=te>>>16,te&=65535,J+=g+f,J&=65535,h(ae<<16|le,J<<16|te,this.unsigned)},o.subtract=function(u){return n(u)||(u=w(u)),this.add(u.neg())},o.sub=o.subtract,o.multiply=function(u){if(this.isZero())return this;if(n(u)||(u=w(u)),e){var g=e.mul(this.low,this.high,u.low,u.high);return h(g,e.get_high(),this.unsigned)}if(u.isZero())return this.unsigned?V:C;if(this.eq(A))return u.isOdd()?A:C;if(u.eq(A))return this.isOdd()?A:C;if(this.isNegative())return u.isNegative()?this.neg().mul(u.neg()):this.neg().mul(u).neg();if(u.isNegative())return this.mul(u.neg()).neg();if(this.lt(L)&&u.lt(L))return d(this.toNumber()*u.toNumber(),this.unsigned);var x=this.high>>>16,B=this.high&65535,S=this.low>>>16,f=this.low&65535,E=u.high>>>16,W=u.high&65535,X=u.low>>>16,J=u.low&65535,te=0,ae=0,le=0,st=0;return st+=f*J,le+=st>>>16,st&=65535,le+=S*J,ae+=le>>>16,le&=65535,le+=f*X,ae+=le>>>16,le&=65535,ae+=B*J,te+=ae>>>16,ae&=65535,ae+=S*X,te+=ae>>>16,ae&=65535,ae+=f*W,te+=ae>>>16,ae&=65535,te+=x*J+B*X+S*W+f*E,te&=65535,h(le<<16|st,te<<16|ae,this.unsigned)},o.mul=o.multiply,o.divide=function(u){if(n(u)||(u=w(u)),u.isZero())throw Error("division by zero");if(e){if(!this.unsigned&&this.high===-2147483648&&u.low===-1&&u.high===-1)return this;var g=(this.unsigned?e.div_u:e.div_s)(this.low,this.high,u.low,u.high);return h(g,e.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?V:C;var x,B,S;if(this.unsigned){if(u.unsigned||(u=u.toUnsigned()),u.gt(this))return V;if(u.gt(this.shru(1)))return H;S=V}else{if(this.eq(A)){if(u.eq(F)||u.eq(G))return A;if(u.eq(A))return F;var f=this.shr(1);return x=f.div(u).shl(1),x.eq(C)?u.isNegative()?F:G:(B=this.sub(u.mul(x)),S=x.add(B.div(u)),S)}else if(u.eq(A))return this.unsigned?V:C;if(this.isNegative())return u.isNegative()?this.neg().div(u.neg()):this.neg().div(u).neg();if(u.isNegative())return this.div(u.neg()).neg();S=C}for(B=this;B.gte(u);){x=Math.max(1,Math.floor(B.toNumber()/u.toNumber()));for(var E=Math.ceil(Math.log(x)/Math.LN2),W=E<=48?1:y(2,E-48),X=d(x),J=X.mul(u);J.isNegative()||J.gt(B);)x-=W,X=d(x,this.unsigned),J=X.mul(u);X.isZero()&&(X=F),S=S.add(X),B=B.sub(J)}return S},o.div=o.divide,o.modulo=function(u){if(n(u)||(u=w(u)),e){var g=(this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,u.low,u.high);return h(g,e.get_high(),this.unsigned)}return this.sub(this.div(u).mul(u))},o.mod=o.modulo,o.rem=o.modulo,o.not=function(){return h(~this.low,~this.high,this.unsigned)},o.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},o.clz=o.countLeadingZeros,o.countTrailingZeros=function(){return this.low?i(this.low):i(this.high)+32},o.ctz=o.countTrailingZeros,o.and=function(u){return n(u)||(u=w(u)),h(this.low&u.low,this.high&u.high,this.unsigned)},o.or=function(u){return n(u)||(u=w(u)),h(this.low|u.low,this.high|u.high,this.unsigned)},o.xor=function(u){return n(u)||(u=w(u)),h(this.low^u.low,this.high^u.high,this.unsigned)},o.shiftLeft=function(u){return n(u)&&(u=u.toInt()),(u&=63)===0?this:u<32?h(this.low<<u,this.high<<u|this.low>>>32-u,this.unsigned):h(0,this.low<<u-32,this.unsigned)},o.shl=o.shiftLeft,o.shiftRight=function(u){return n(u)&&(u=u.toInt()),(u&=63)===0?this:u<32?h(this.low>>>u|this.high<<32-u,this.high>>u,this.unsigned):h(this.high>>u-32,this.high>=0?0:-1,this.unsigned)},o.shr=o.shiftRight,o.shiftRightUnsigned=function(u){return n(u)&&(u=u.toInt()),(u&=63)===0?this:u<32?h(this.low>>>u|this.high<<32-u,this.high>>>u,this.unsigned):u===32?h(this.high,0,this.unsigned):h(this.high>>>u-32,0,this.unsigned)},o.shru=o.shiftRightUnsigned,o.shr_u=o.shiftRightUnsigned,o.rotateLeft=function(u){var g;return n(u)&&(u=u.toInt()),(u&=63)===0?this:u===32?h(this.high,this.low,this.unsigned):u<32?(g=32-u,h(this.low<<u|this.high>>>g,this.high<<u|this.low>>>g,this.unsigned)):(u-=32,g=32-u,h(this.high<<u|this.low>>>g,this.low<<u|this.high>>>g,this.unsigned))},o.rotl=o.rotateLeft,o.rotateRight=function(u){var g;return n(u)&&(u=u.toInt()),(u&=63)===0?this:u===32?h(this.high,this.low,this.unsigned):u<32?(g=32-u,h(this.high<<g|this.low>>>u,this.low<<g|this.high>>>u,this.unsigned)):(u-=32,g=32-u,h(this.low<<g|this.high>>>u,this.high<<g|this.low>>>u,this.unsigned))},o.rotr=o.rotateRight,o.toSigned=function(){return this.unsigned?h(this.low,this.high,!1):this},o.toUnsigned=function(){return this.unsigned?this:h(this.low,this.high,!0)},o.toBytes=function(u){return u?this.toBytesLE():this.toBytesBE()},o.toBytesLE=function(){var u=this.high,g=this.low;return[g&255,g>>>8&255,g>>>16&255,g>>>24,u&255,u>>>8&255,u>>>16&255,u>>>24]},o.toBytesBE=function(){var u=this.high,g=this.low;return[u>>>24,u>>>16&255,u>>>8&255,u&255,g>>>24,g>>>16&255,g>>>8&255,g&255]},r.fromBytes=function(u,g,x){return x?r.fromBytesLE(u,g):r.fromBytesBE(u,g)},r.fromBytesLE=function(u,g){return new r(u[0]|u[1]<<8|u[2]<<16|u[3]<<24,u[4]|u[5]<<8|u[6]<<16|u[7]<<24,g)},r.fromBytesBE=function(u,g){return new r(u[4]<<24|u[5]<<16|u[6]<<8|u[7],u[0]<<24|u[1]<<16|u[2]<<8|u[3],g)};var l=r;return t.default=l,"default"in t?t.default:t}({});typeof define=="function"&&define.amd?define([],function(){return Rh}):typeof Kf=="object"&&typeof qh=="object"&&(Kf.exports=Rh)});var Gr=K(pe=>{"use strict";I();O();var Dh=pe&&pe.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),x6=pe&&pe.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),en=pe&&pe.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Dh(e,t,r);return x6(e,t),e},Uh=pe&&pe.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Dh(e,t,r)},ga=pe&&pe.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(pe,"__esModule",{value:!0});pe.secp256k1=pe.ed25519=pe.Long=pe._m0=pe.protobuf=pe.typeforce=pe.safeBuffer=pe.BigNumber=pe.BN=pe.math=pe.signUtil=pe.abi=pe.elliptic=pe.bip39=pe.bip32=pe.base=void 0;pe.base=en(pi());pe.bip32=en(H0());pe.bip39=en(uf());pe.elliptic=en(ss());pe.abi=en(bl());pe.signUtil=en(Bh());pe.math=en(kh());var A6=ga(Vt());pe.BN=A6.default;var M6=ga(c1());pe.BigNumber=M6.default;var T6=ga(e1());pe.safeBuffer=T6.default;var I6=Uu();pe.typeforce=I6;pe.protobuf=en(u1());pe._m0=en(d1());var O6=ga(Ch());pe.Long=O6.default;pe.ed25519=en(l1());pe.secp256k1=en(h1());Uh((p1(),Cu(b1)),pe);Uh((y1(),Cu(g1)),pe)});var Lh=K(hs=>{"use strict";I();O();Object.defineProperty(hs,"__esModule",{value:!0});hs.toB64=hs.fromB64=void 0;function B6(t){return t>64&&t<91?t-65:t>96&&t<123?t-71:t>47&&t<58?t+4:t===43?62:t===47?63:0}function P6(t,e){for(var r=t.replace(/[^A-Za-z0-9+/]/g,""),n=r.length,i=e?Math.ceil((n*3+1>>2)/e)*e:n*3+1>>2,s=new Uint8Array(i),a,c,d=0,h=0,y=0;y<n;y++)if(c=y&3,d|=B6(r.charCodeAt(y))<<6*(3-c),c===3||n-y===1){for(a=0;a<3&&h<i;a++,h++)s[h]=d>>>(16>>>a&24)&255;d=0}return s}hs.fromB64=P6;function ya(t){return t<26?t+65:t<52?t+71:t<62?t-4:t===62?43:t===63?47:65}function j6(t){for(var e=2,r="",n=t.length,i=0,s=0;s<n;s++)e=s%3,s>0&&s*4/3%76===0&&(r+=""),i|=t[s]<<(16>>>e&24),(e===2||t.length-s===1)&&(r+=String.fromCodePoint(ya(i>>>18&63),ya(i>>>12&63),ya(i>>>6&63),ya(i&63)),i=0);return r.slice(0,r.length-2+e)+(e===2?"":e===1?"=":"==")}hs.toB64=j6});var Hh=K(bs=>{"use strict";I();O();Object.defineProperty(bs,"__esModule",{value:!0});bs.toHEX=bs.fromHEX=void 0;function N6(t){let e=t.replace("0x","").match(/.{1,2}/g).map(r=>parseInt(r,16));if(e===null)throw new Error(`Unable to parse HEX: ${t}`);return Uint8Array.from(e)}bs.fromHEX=N6;function k6(t){return t.reduce((e,r)=>e+r.toString(16).padStart(2,"0"),"")}bs.toHEX=k6});var tn=K(Fe=>{"use strict";I();O();Object.defineProperty(Fe,"__esModule",{value:!0});Fe.getSuiMoveConfig=Fe.getRustConfig=Fe.registerPrimitives=Fe.decodeStr=Fe.encodeStr=Fe.BCS=Fe.BcsWriter=Fe.BcsReader=Fe.toHEX=Fe.fromHEX=Fe.fromB64=Fe.toB64=Fe.fromB58=Fe.toB58=void 0;var ri=Lh();Object.defineProperty(Fe,"toB64",{enumerable:!0,get:function(){return ri.toB64}});Object.defineProperty(Fe,"fromB64",{enumerable:!0,get:function(){return ri.fromB64}});var ni=Hh();Object.defineProperty(Fe,"toHEX",{enumerable:!0,get:function(){return ni.toHEX}});Object.defineProperty(Fe,"fromHEX",{enumerable:!0,get:function(){return ni.fromHEX}});var Kh=Gr(),Fh=32;function Ff(t,e){let r=new Uint8Array(e),n=0;for(;t>0;)r[n]=Number(t%BigInt(256)),t=t/BigInt(256),n+=1;return r}var zf=t=>Kh.base.toBase58(t);Fe.toB58=zf;var Vf=t=>Kh.base.fromBase58(t);Fe.fromB58=Vf;var ma=class{constructor(e){this.bytePosition=0,this.dataView=new DataView(e.buffer)}shift(e){return this.bytePosition+=e,this}read8(){let e=this.dataView.getUint8(this.bytePosition);return this.shift(1),e}read16(){let e=this.dataView.getUint16(this.bytePosition,!0);return this.shift(2),e}read32(){let e=this.dataView.getUint32(this.bytePosition,!0);return this.shift(4),e}read64(){let e=this.read32(),n=this.read32().toString(16)+e.toString(16).padStart(8,"0");return BigInt("0x"+n).toString(10)}read128(){let e=BigInt(this.read64()),n=BigInt(this.read64()).toString(16)+e.toString(16).padStart(8,"0");return BigInt("0x"+n).toString(10)}read256(){let e=BigInt(this.read128()),n=BigInt(this.read128()).toString(16)+e.toString(16).padStart(16,"0");return BigInt("0x"+n).toString(10)}readBytes(e){let r=this.bytePosition+this.dataView.byteOffset,n=new Uint8Array(this.dataView.buffer,r,e);return this.shift(e),n}readULEB(){let e=this.bytePosition+this.dataView.byteOffset,r=new Uint8Array(this.dataView.buffer,e),{value:n,length:i}=q6(r);return this.shift(i),n}readVec(e){let r=this.readULEB(),n=[];for(let i=0;i<r;i++)n.push(e(this,i,r));return n}};Fe.BcsReader=ma;var va=class{constructor({size:e=1024,maxSize:r,allocateSize:n=1024}={}){this.bytePosition=0,this.size=e,this.maxSize=r||e,this.allocateSize=n,this.dataView=new DataView(new ArrayBuffer(e))}ensureSizeOrGrow(e){let r=this.bytePosition+e;if(r>this.size){let n=Math.min(this.maxSize,this.size+this.allocateSize);if(r>n)throw new Error(`Attempting to serialize to BCS, but buffer does not have enough size. Allocated size: ${this.size}, Max size: ${this.maxSize}, Required size: ${r}`);this.size=n;let i=new ArrayBuffer(this.size);new Uint8Array(i).set(new Uint8Array(this.dataView.buffer)),this.dataView=new DataView(i)}}shift(e){return this.bytePosition+=e,this}write8(e){return this.ensureSizeOrGrow(1),this.dataView.setUint8(this.bytePosition,Number(e)),this.shift(1)}write16(e){return this.ensureSizeOrGrow(2),this.dataView.setUint16(this.bytePosition,Number(e),!0),this.shift(2)}write32(e){return this.ensureSizeOrGrow(4),this.dataView.setUint32(this.bytePosition,Number(e),!0),this.shift(4)}write64(e){return Ff(BigInt(e),8).forEach(r=>this.write8(r)),this}write128(e){return Ff(BigInt(e),16).forEach(r=>this.write8(r)),this}write256(e){return Ff(BigInt(e),32).forEach(r=>this.write8(r)),this}writeULEB(e){return R6(e).forEach(r=>this.write8(r)),this}writeVec(e,r){return this.writeULEB(e.length),Array.from(e).forEach((n,i)=>r(this,n,i,e.length)),this}*[Symbol.iterator](){for(let e=0;e<this.bytePosition;e++)yield this.dataView.getUint8(e);return this.toBytes()}toBytes(){return new Uint8Array(this.dataView.buffer.slice(0,this.bytePosition))}toString(e){return zh(this.toBytes(),e)}};Fe.BcsWriter=va;function R6(t){let e=[],r=0;if(t===0)return[0];for(;t>0;)e[r]=t&127,(t>>=7)&&(e[r]|=128),r+=1;return e}function q6(t){let e=0,r=0,n=0;for(;;){let i=t[n];if(n+=1,e|=(i&127)<<r,(i&128)===0)break;r+=7}return{value:e,length:n}}var Ue=class{tempKey(){return`bcs-struct-${++this.counter}`}constructor(e){if(this.types=new Map,this.counter=0,e instanceof Ue){this.schema=e.schema,this.types=new Map(e.types);return}if(this.schema=e,this.registerAddressType(Ue.ADDRESS,e.addressLength,e.addressEncoding),this.registerVectorType(e.vectorType),e.types&&e.types.structs)for(let r of Object.keys(e.types.structs))this.registerStructType(r,e.types.structs[r]);if(e.types&&e.types.enums)for(let r of Object.keys(e.types.enums))this.registerEnumType(r,e.types.enums[r]);if(e.types&&e.types.aliases)for(let r of Object.keys(e.types.aliases))this.registerAlias(r,e.types.aliases[r]);e.withPrimitives!==!1&&$h(this)}ser(e,r,n){if(typeof e=="string"||Array.isArray(e)){let{name:i,params:s}=this.parseTypeName(e);return this.getTypeInterface(i).encode(this,r,n,s)}if(typeof e=="object"){let i=this.tempKey();return new Ue(this).registerStructType(i,e).ser(i,r,n)}throw new Error(`Incorrect type passed into the '.ser()' function.
${JSON.stringify(e)}`)}de(e,r,n){if(typeof r=="string")if(n)r=Vh(r,n);else throw new Error("To pass a string to `bcs.de`, specify encoding");if(typeof e=="string"||Array.isArray(e)){let{name:i,params:s}=this.parseTypeName(e);return this.getTypeInterface(i).decode(this,r,s)}if(typeof e=="object"){let i=new Ue(this),s=this.tempKey();return i.registerStructType(s,e).de(s,r,n)}throw new Error(`Incorrect type passed into the '.de()' function.
${JSON.stringify(e)}`)}hasType(e){return this.types.has(e)}registerAlias(e,r){return this.types.set(e,r),this}registerType(e,r,n,i=()=>!0){let{name:s,params:a}=this.parseTypeName(e);return this.types.set(s,{encode(c,d,h,y){let p=a.reduce((w,v,_)=>Object.assign(w,{[v]:y[_]}),{});return this._encodeRaw.call(c,new va(h),d,y,p)},decode(c,d,h){let y=a.reduce((p,w,v)=>Object.assign(p,{[w]:h[v]}),{});return this._decodeRaw.call(c,new ma(d),h,y)},_encodeRaw(c,d,h,y){if(i(d))return r.call(this,c,d,h,y);throw new Error(`Validation failed for type ${s}, data: ${d}`)},_decodeRaw(c,d,h){return n.call(this,c,d,h)}}),this}registerAddressType(e,r,n="hex"){switch(n){case"base64":return this.registerType(e,function(s,a){return(0,ri.fromB64)(a).reduce((c,d)=>c.write8(d),s)},function(s){return(0,ri.toB64)(s.readBytes(r))});case"hex":return this.registerType(e,function(s,a){return(0,ni.fromHEX)(a).reduce((c,d)=>c.write8(d),s)},function(s){return(0,ni.toHEX)(s.readBytes(r))});default:throw new Error("Unsupported encoding! Use either hex or base64")}}registerVectorType(e){let{name:r,params:n}=this.parseTypeName(e);if(n.length>1)throw new Error("Vector can have only one type parameter; got "+r);return this.registerType(e,function(s,a,c,d){return s.writeVec(a,(h,y)=>{let p=c[0];if(!p)throw new Error(`Incorrect number of type parameters passed a to vector '${e}'`);let{name:w,params:v}=this.parseTypeName(p);if(this.hasType(w))return this.getTypeInterface(w)._encodeRaw.call(this,h,y,v,d);if(!(w in d))throw new Error(`Unable to find a matching type definition for ${w} in vector; make sure you passed a generic`);let{name:_,params:m}=this.parseTypeName(d[w]);return this.getTypeInterface(_)._encodeRaw.call(this,h,y,m,d)})},function(s,a,c){return s.readVec(d=>{let h=a[0];if(!h)throw new Error(`Incorrect number of type parameters passed to a vector '${e}'`);let{name:y,params:p}=this.parseTypeName(h);if(this.hasType(y))return this.getTypeInterface(y)._decodeRaw.call(this,d,p,c);if(!(y in c))throw new Error(`Unable to find a matching type definition for ${y} in vector; make sure you passed a generic`);let{name:w,params:v}=this.parseTypeName(c[y]);this.getTypeInterface(w)._decodeRaw.call(this,d,v,c)})})}registerStructType(e,r){for(let c in r){let d=this.tempKey(),h=r[c];!Array.isArray(h)&&typeof h!="string"&&(r[c]=d,this.registerStructType(d,h))}let n=Object.freeze(r),i=Object.keys(n),{name:s,params:a}=this.parseTypeName(e);return this.registerType(e,function(d,h,y,p){if(!h||h.constructor!==Object)throw new Error(`Expected ${s} to be an Object, got: ${h}`);if(y.length!==a.length)throw new Error(`Incorrect number of generic parameters passed; expected: ${a.length}, got: ${y.length}`);for(let w of i){if(!(w in h))throw new Error(`Struct ${s} requires field ${w}:${n[w]}`);let{name:v,params:_}=this.parseTypeName(n[w]);if(!a.includes(v))this.getTypeInterface(v)._encodeRaw.call(this,d,h[w],_,p);else{let m=a.indexOf(v),{name:M,params:N}=this.parseTypeName(y[m]);if(this.hasType(M)){this.getTypeInterface(M)._encodeRaw.call(this,d,h[w],N,p);continue}if(!(M in p))throw new Error(`Unable to find a matching type definition for ${M} in ${s}; make sure you passed a generic`);let{name:L,params:C}=this.parseTypeName(p[M]);this.getTypeInterface(L)._encodeRaw.call(this,d,h[w],C,p)}}return d},function(d,h,y){if(h.length!==a.length)throw new Error(`Incorrect number of generic parameters passed; expected: ${a.length}, got: ${h.length}`);let p={};for(let w of i){let{name:v,params:_}=this.parseTypeName(n[w]);if(!a.includes(v))p[w]=this.getTypeInterface(v)._decodeRaw.call(this,d,_,y);else{let m=a.indexOf(v),{name:M,params:N}=this.parseTypeName(h[m]);if(this.hasType(M)){p[w]=this.getTypeInterface(M)._decodeRaw.call(this,d,N,y);continue}if(!(M in y))throw new Error(`Unable to find a matching type definition for ${M} in ${s}; make sure you passed a generic`);let{name:L,params:C}=this.parseTypeName(y[M]);p[w]=this.getTypeInterface(L)._decodeRaw.call(this,d,C,y)}}return p})}registerEnumType(e,r){for(let c in r){let d=this.tempKey(),h=r[c];h!==null&&!Array.isArray(h)&&typeof h!="string"&&(r[c]=d,this.registerStructType(d,h))}let n=Object.freeze(r),i=Object.keys(n),{name:s,params:a}=this.parseTypeName(e);return this.registerType(e,function(d,h,y,p){if(!h)throw new Error(`Unable to write enum "${s}", missing data.
Received: "${h}"`);if(typeof h!="object")throw new Error(`Incorrect data passed into enum "${s}", expected object with properties: "${i.join(" | ")}".
Received: "${JSON.stringify(h)}"`);let w=Object.keys(h)[0];if(w===void 0)throw new Error(`Empty object passed as invariant of the enum "${s}"`);let v=i.indexOf(w);if(v===-1)throw new Error(`Unknown invariant of the enum "${s}", allowed values: "${i.join(" | ")}"; received "${w}"`);let _=i[v],m=n[_];if(d.write8(v),m===null)return d;let M=a.indexOf(m),N=M===-1?m:y[M];{let{name:L,params:C}=this.parseTypeName(N);return this.getTypeInterface(L)._encodeRaw.call(this,d,h[w],C,p)}},function(d,h,y){let p=d.readULEB(),w=i[p],v=n[w];if(p===-1)throw new Error(`Decoding type mismatch, expected enum "${s}" invariant index, received "${p}"`);if(v===null)return{[w]:!0};let _=a.indexOf(v),m=_===-1?v:h[_];{let{name:M,params:N}=this.parseTypeName(m);return{[w]:this.getTypeInterface(M)._decodeRaw.call(this,d,N,y)}}})}getTypeInterface(e){let r=this.types.get(e);if(typeof r=="string"){let n=[];for(;typeof r=="string";){if(n.includes(r))throw new Error(`Recursive definition found: ${n.join(" -> ")} -> ${r}`);n.push(r),r=this.types.get(r)}}if(r===void 0)throw new Error(`Type ${e} is not registered`);return r}parseTypeName(e){if(Array.isArray(e)){let[d,...h]=e;return{name:d,params:h}}if(typeof e!="string")throw new Error(`Illegal type passed as a name of the type: ${e}`);let[r,n]=this.schema.genericSeparators||["<",">"],i=e.indexOf(r),s=Array.from(e).reverse().indexOf(n);if(i===-1&&s===-1)return{name:e,params:[]};if(i===-1||s===-1)throw new Error(`Unclosed generic in name '${e}'`);let a=e.slice(0,i),c=e.slice(i+1,e.length-s-1).split(",").map(d=>d.trim());return{name:a,params:c}}};Fe.BCS=Ue;Ue.U8="u8";Ue.U16="u16";Ue.U32="u32";Ue.U64="u64";Ue.U128="u128";Ue.U256="u256";Ue.BOOL="bool";Ue.VECTOR="vector";Ue.ADDRESS="address";Ue.STRING="string";Ue.HEX="hex-string";Ue.BASE58="base58-string";Ue.BASE64="base64-string";function zh(t,e){switch(e){case"base58":return zf(t);case"base64":return(0,ri.toB64)(t);case"hex":return(0,ni.toHEX)(t);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}Fe.encodeStr=zh;function Vh(t,e){switch(e){case"base58":return Vf(t);case"base64":return(0,ri.fromB64)(t);case"hex":return(0,ni.fromHEX)(t);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}Fe.decodeStr=Vh;function $h(t){t.registerType(Ue.U8,function(e,r){return e.write8(r)},function(e){return e.read8()},e=>e<256),t.registerType(Ue.U16,function(e,r){return e.write16(r)},function(e){return e.read16()},e=>e<65536),t.registerType(Ue.U32,function(e,r){return e.write32(r)},function(e){return e.read32()},e=>e<=4294967296n),t.registerType(Ue.U64,function(e,r){return e.write64(r)},function(e){return e.read64()}),t.registerType(Ue.U128,function(e,r){return e.write128(r)},function(e){return e.read128()}),t.registerType(Ue.U256,function(e,r){return e.write256(r)},function(e){return e.read256()}),t.registerType(Ue.BOOL,function(e,r){return e.write8(r)},function(e){return e.read8().toString(10)==="1"}),t.registerType(Ue.STRING,function(e,r){return e.writeVec(Array.from(r),(n,i)=>n.write8(i.charCodeAt(0)))},function(e){return e.readVec(r=>r.read8()).map(r=>String.fromCharCode(Number(r))).join("")},e=>!0),t.registerType(Ue.HEX,function(e,r){return e.writeVec(Array.from((0,ni.fromHEX)(r)),(n,i)=>n.write8(i))},function(e){let r=e.readVec(n=>n.read8());return(0,ni.toHEX)(new Uint8Array(r))}),t.registerType(Ue.BASE58,function(e,r){return e.writeVec(Array.from(Vf(r)),(n,i)=>n.write8(i))},function(e){let r=e.readVec(n=>n.read8());return zf(new Uint8Array(r))}),t.registerType(Ue.BASE64,function(e,r){return e.writeVec(Array.from((0,ri.fromB64)(r)),(n,i)=>n.write8(i))},function(e){let r=e.readVec(n=>n.read8());return(0,ri.toB64)(new Uint8Array(r))})}Fe.registerPrimitives=$h;function C6(){return{genericSeparators:["<",">"],vectorType:"Vec",addressLength:Fh,addressEncoding:"hex"}}Fe.getRustConfig=C6;function D6(){return{genericSeparators:["<",">"],vectorType:"vector",addressLength:Fh,addressEncoding:"hex"}}Fe.getSuiMoveConfig=D6});var $f=K(ps=>{"use strict";I();O();Object.defineProperty(ps,"__esModule",{value:!0});ps.publicKeyFromSerialized=ps.bytesEqual=void 0;var U6=gs();function L6(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}ps.bytesEqual=L6;function H6(t,e){if(t==="ED25519")return new U6.Ed25519PublicKey(e);throw new Error("Unknown public key schema")}ps.publicKeyFromSerialized=H6});var wa=K(Lr=>{"use strict";I();O();Object.defineProperty(Lr,"__esModule",{value:!0});Lr.fromSerializedSignature=Lr.toSerializedSignature=Lr.SIGNATURE_FLAG_TO_SCHEME=Lr.SIGNATURE_SCHEME_TO_FLAG=void 0;var Gh=tn(),K6=gs();Lr.SIGNATURE_SCHEME_TO_FLAG={ED25519:0,Secp256k1:1};Lr.SIGNATURE_FLAG_TO_SCHEME={0:"ED25519",1:"Secp256k1"};function F6({signature:t,signatureScheme:e,pubKey:r}){let n=new Uint8Array(1+t.length+r.toBytes().length);return n.set([Lr.SIGNATURE_SCHEME_TO_FLAG[e]]),n.set(t,1),n.set(r.toBytes(),1+t.length),(0,Gh.toB64)(n)}Lr.toSerializedSignature=F6;function z6(t){let e=(0,Gh.fromB64)(t),r=Lr.SIGNATURE_FLAG_TO_SCHEME[e[0]],n=K6.Ed25519PublicKey,i=e.slice(1,e.length-n.SIZE),s=e.slice(1+i.length),a=new n(s);return{signatureScheme:r,signature:i,pubKey:a}}Lr.fromSerializedSignature=z6});var sr=K((Sa,Wh)=>{I();O();(function(t,e){typeof Sa=="object"&&typeof Wh<"u"?e(Sa):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.Superstruct={}))})(Sa,function(t){"use strict";class e extends TypeError{constructor(k,R){let U,{message:Y,explanation:ie,...Le}=k,{path:ye}=k,me=ye.length===0?Y:`At path: ${ye.join(".")} -- ${Y}`;super(ie??me),ie!=null&&(this.cause=me),Object.assign(this,Le),this.name=this.constructor.name,this.failures=()=>U??(U=[k,...R()])}}function r(P){return n(P)&&typeof P[Symbol.iterator]=="function"}function n(P){return typeof P=="object"&&P!=null}function i(P){if(Object.prototype.toString.call(P)!=="[object Object]")return!1;let k=Object.getPrototypeOf(P);return k===null||k===Object.prototype}function s(P){return typeof P=="symbol"?P.toString():typeof P=="string"?JSON.stringify(P):`${P}`}function a(P){let{done:k,value:R}=P.next();return k?void 0:R}function c(P,k,R,U){if(P===!0)return;P===!1?P={}:typeof P=="string"&&(P={message:P});let{path:Y,branch:ie}=k,{type:Le}=R,{refinement:ye,message:me=`Expected a value of type \`${Le}\`${ye?` with refinement \`${ye}\``:""}, but received: \`${s(U)}\``}=P;return{value:U,type:Le,refinement:ye,key:Y[Y.length-1],path:Y,branch:ie,...P,message:me}}function*d(P,k,R,U){r(P)||(P=[P]);for(let Y of P){let ie=c(Y,k,R,U);ie&&(yield ie)}}function*h(P,k,R={}){let{path:U=[],branch:Y=[P],coerce:ie=!1,mask:Le=!1}=R,ye={path:U,branch:Y};if(ie&&(P=k.coercer(P,ye),Le&&k.type!=="type"&&n(k.schema)&&n(P)&&!Array.isArray(P)))for(let Qe in P)k.schema[Qe]===void 0&&delete P[Qe];let me="valid";for(let Qe of k.validator(P,ye))Qe.explanation=R.message,me="not_valid",yield[Qe,void 0];for(let[Qe,Re,bt]of k.entries(P,ye)){let ho=h(Re,bt,{path:Qe===void 0?U:[...U,Qe],branch:Qe===void 0?Y:[...Y,Re],coerce:ie,mask:Le,message:R.message});for(let et of ho)et[0]?(me=et[0].refinement!=null?"not_refined":"not_valid",yield[et[0],void 0]):ie&&(Re=et[1],Qe===void 0?P=Re:P instanceof Map?P.set(Qe,Re):P instanceof Set?P.add(Re):n(P)&&(Re!==void 0||Qe in P)&&(P[Qe]=Re))}if(me!=="not_valid")for(let Qe of k.refiner(P,ye))Qe.explanation=R.message,me="not_refined",yield[Qe,void 0];me==="valid"&&(yield[void 0,P])}class y{constructor(k){let{type:R,schema:U,validator:Y,refiner:ie,coercer:Le=me=>me,entries:ye=function*(){}}=k;this.type=R,this.schema=U,this.entries=ye,this.coercer=Le,Y?this.validator=(me,Qe)=>{let Re=Y(me,Qe);return d(Re,Qe,this,me)}:this.validator=()=>[],ie?this.refiner=(me,Qe)=>{let Re=ie(me,Qe);return d(Re,Qe,this,me)}:this.refiner=()=>[]}assert(k,R){return p(k,this,R)}create(k,R){return w(k,this,R)}is(k){return _(k,this)}mask(k,R){return v(k,this,R)}validate(k,R={}){return m(k,this,R)}}function p(P,k,R){let U=m(P,k,{message:R});if(U[0])throw U[0]}function w(P,k,R){let U=m(P,k,{coerce:!0,message:R});if(U[0])throw U[0];return U[1]}function v(P,k,R){let U=m(P,k,{coerce:!0,mask:!0,message:R});if(U[0])throw U[0];return U[1]}function _(P,k){return!m(P,k)[0]}function m(P,k,R={}){let U=h(P,k,R),Y=a(U);return Y[0]?[new e(Y[0],function*(){for(let Le of U)Le[0]&&(yield Le[0])}),void 0]:[void 0,Y[1]]}function M(...P){let k=P[0].type==="type",R=P.map(Y=>Y.schema),U=Object.assign({},...R);return k?ze(U):te(U)}function N(P,k){return new y({type:P,schema:null,validator:k})}function L(P,k){return new y({...P,refiner:(R,U)=>R===void 0||P.refiner(R,U),validator(R,U){return R===void 0?!0:(k(R,U),P.validator(R,U))}})}function C(P){return new y({type:"dynamic",schema:null,*entries(k,R){yield*P(k,R).entries(k,R)},validator(k,R){return P(k,R).validator(k,R)},coercer(k,R){return P(k,R).coercer(k,R)},refiner(k,R){return P(k,R).refiner(k,R)}})}function V(P){let k;return new y({type:"lazy",schema:null,*entries(R,U){k??(k=P()),yield*k.entries(R,U)},validator(R,U){return k??(k=P()),k.validator(R,U)},coercer(R,U){return k??(k=P()),k.coercer(R,U)},refiner(R,U){return k??(k=P()),k.refiner(R,U)}})}function F(P,k){let{schema:R}=P,U={...R};for(let Y of k)delete U[Y];switch(P.type){case"type":return ze(U);default:return te(U)}}function H(P){let k=P instanceof y,R=k?{...P.schema}:{...P};for(let U in R)R[U]=ae(R[U]);return k&&P.type==="type"?ze(R):te(R)}function G(P,k){let{schema:R}=P,U={};for(let Y of k)U[Y]=R[Y];switch(P.type){case"type":return ze(U);default:return te(U)}}function z(P,k){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),N(P,k)}function se(){return N("any",()=>!0)}function A(P){return new y({type:"array",schema:P,*entries(k){if(P&&Array.isArray(k))for(let[R,U]of k.entries())yield[R,U,P]},coercer(k){return Array.isArray(k)?k.slice():k},validator(k){return Array.isArray(k)||`Expected an array value, but received: ${s(k)}`}})}function o(){return N("bigint",P=>typeof P=="bigint")}function l(){return N("boolean",P=>typeof P=="boolean")}function b(){return N("date",P=>P instanceof Date&&!isNaN(P.getTime())||`Expected a valid \`Date\` object, but received: ${s(P)}`)}function u(P){let k={},R=P.map(U=>s(U)).join();for(let U of P)k[U]=U;return new y({type:"enums",schema:k,validator(U){return P.includes(U)||`Expected one of \`${R}\`, but received: ${s(U)}`}})}function g(){return N("func",P=>typeof P=="function"||`Expected a function, but received: ${s(P)}`)}function x(P){return N("instance",k=>k instanceof P||`Expected a \`${P.name}\` instance, but received: ${s(k)}`)}function B(){return N("integer",P=>typeof P=="number"&&!isNaN(P)&&Number.isInteger(P)||`Expected an integer, but received: ${s(P)}`)}function S(P){return new y({type:"intersection",schema:null,*entries(k,R){for(let U of P)yield*U.entries(k,R)},*validator(k,R){for(let U of P)yield*U.validator(k,R)},*refiner(k,R){for(let U of P)yield*U.refiner(k,R)}})}function f(P){let k=s(P),R=typeof P;return new y({type:"literal",schema:R==="string"||R==="number"||R==="boolean"?P:null,validator(U){return U===P||`Expected the literal \`${k}\`, but received: ${s(U)}`}})}function E(P,k){return new y({type:"map",schema:null,*entries(R){if(P&&k&&R instanceof Map)for(let[U,Y]of R.entries())yield[U,U,P],yield[U,Y,k]},coercer(R){return R instanceof Map?new Map(R):R},validator(R){return R instanceof Map||`Expected a \`Map\` object, but received: ${s(R)}`}})}function W(){return N("never",()=>!1)}function X(P){return new y({...P,validator:(k,R)=>k===null||P.validator(k,R),refiner:(k,R)=>k===null||P.refiner(k,R)})}function J(){return N("number",P=>typeof P=="number"&&!isNaN(P)||`Expected a number, but received: ${s(P)}`)}function te(P){let k=P?Object.keys(P):[],R=W();return new y({type:"object",schema:P||null,*entries(U){if(P&&n(U)){let Y=new Set(Object.keys(U));for(let ie of k)Y.delete(ie),yield[ie,U[ie],P[ie]];for(let ie of Y)yield[ie,U[ie],R]}},validator(U){return n(U)||`Expected an object, but received: ${s(U)}`},coercer(U){return n(U)?{...U}:U}})}function ae(P){return new y({...P,validator:(k,R)=>k===void 0||P.validator(k,R),refiner:(k,R)=>k===void 0||P.refiner(k,R)})}function le(P,k){return new y({type:"record",schema:null,*entries(R){if(n(R))for(let U in R){let Y=R[U];yield[U,U,P],yield[U,Y,k]}},validator(R){return n(R)||`Expected an object, but received: ${s(R)}`}})}function st(){return N("regexp",P=>P instanceof RegExp)}function qe(P){return new y({type:"set",schema:null,*entries(k){if(P&&k instanceof Set)for(let R of k)yield[R,R,P]},coercer(k){return k instanceof Set?new Set(k):k},validator(k){return k instanceof Set||`Expected a \`Set\` object, but received: ${s(k)}`}})}function Te(){return N("string",P=>typeof P=="string"||`Expected a string, but received: ${s(P)}`)}function zr(P){let k=W();return new y({type:"tuple",schema:null,*entries(R){if(Array.isArray(R)){let U=Math.max(P.length,R.length);for(let Y=0;Y<U;Y++)yield[Y,R[Y],P[Y]||k]}},validator(R){return Array.isArray(R)||`Expected an array, but received: ${s(R)}`}})}function ze(P){let k=Object.keys(P);return new y({type:"type",schema:P,*entries(R){if(n(R))for(let U of k)yield[U,R[U],P[U]]},validator(R){return n(R)||`Expected an object, but received: ${s(R)}`},coercer(R){return n(R)?{...R}:R}})}function ke(P){let k=P.map(R=>R.type).join(" | ");return new y({type:"union",schema:null,coercer(R){for(let U of P){let[Y,ie]=U.validate(R,{coerce:!0});if(!Y)return ie}return R},validator(R,U){let Y=[];for(let ie of P){let[...Le]=h(R,ie,U),[ye]=Le;if(ye[0])for(let[me]of Le)me&&Y.push(me);else return[]}return[`Expected the value to satisfy a union of \`${k}\`, but received: ${s(R)}`,...Y]}})}function Ir(){return N("unknown",()=>!0)}function Ve(P,k,R){return new y({...P,coercer:(U,Y)=>_(U,k)?P.coercer(R(U,Y),Y):P.coercer(U,Y)})}function Je(P,k,R={}){return Ve(P,Ir(),U=>{let Y=typeof k=="function"?k():k;if(U===void 0)return Y;if(!R.strict&&i(U)&&i(Y)){let ie={...U},Le=!1;for(let ye in Y)ie[ye]===void 0&&(ie[ye]=Y[ye],Le=!0);if(Le)return ie}return U})}function fi(P){return Ve(P,Te(),k=>k.trim())}function ut(P){return $e(P,"empty",k=>{let R=ct(k);return R===0||`Expected an empty ${P.type} but received one with a size of \`${R}\``})}function ct(P){return P instanceof Map||P instanceof Set?P.size:P.length}function uo(P,k,R={}){let{exclusive:U}=R;return $e(P,"max",Y=>U?Y<k:Y<=k||`Expected a ${P.type} less than ${U?"":"or equal to "}${k} but received \`${Y}\``)}function dt(P,k,R={}){let{exclusive:U}=R;return $e(P,"min",Y=>U?Y>k:Y>=k||`Expected a ${P.type} greater than ${U?"":"or equal to "}${k} but received \`${Y}\``)}function lt(P){return $e(P,"nonempty",k=>ct(k)>0||`Expected a nonempty ${P.type} but received an empty one`)}function lo(P,k){return $e(P,"pattern",R=>k.test(R)||`Expected a ${P.type} matching \`/${k.source}/\` but received "${R}"`)}function ht(P,k,R=k){let U=`Expected a ${P.type}`,Y=k===R?`of \`${k}\``:`between \`${k}\` and \`${R}\``;return $e(P,"size",ie=>{if(typeof ie=="number"||ie instanceof Date)return k<=ie&&ie<=R||`${U} ${Y} but received \`${ie}\``;if(ie instanceof Map||ie instanceof Set){let{size:Le}=ie;return k<=Le&&Le<=R||`${U} with a size ${Y} but received one with a size of \`${Le}\``}else{let{length:Le}=ie;return k<=Le&&Le<=R||`${U} with a length ${Y} but received one with a length of \`${Le}\``}})}function $e(P,k,R){return new y({...P,*refiner(U,Y){yield*P.refiner(U,Y);let ie=R(U,Y),Le=d(ie,Y,P,U);for(let ye of Le)yield{...ye,refinement:k}}})}t.Struct=y,t.StructError=e,t.any=se,t.array=A,t.assert=p,t.assign=M,t.bigint=o,t.boolean=l,t.coerce=Ve,t.create=w,t.date=b,t.defaulted=Je,t.define=N,t.deprecated=L,t.dynamic=C,t.empty=ut,t.enums=u,t.func=g,t.instance=x,t.integer=B,t.intersection=S,t.is=_,t.lazy=V,t.literal=f,t.map=E,t.mask=v,t.max=uo,t.min=dt,t.never=W,t.nonempty=lt,t.nullable=X,t.number=J,t.object=te,t.omit=F,t.optional=ae,t.partial=H,t.pattern=lo,t.pick=G,t.record=le,t.refine=$e,t.regexp=st,t.set=qe,t.size=ht,t.string=Te,t.struct=z,t.trimmed=fi,t.tuple=zr,t.type=ze,t.union=ke,t.unknown=Ir,t.validate=m})});var rn=K(je=>{"use strict";I();O();Object.defineProperty(je,"__esModule",{value:!0});je.normalizeSuiObjectId=je.normalizeSuiAddress=je.isValidSuiObjectId=je.isValidSuiAddress=je.SUI_ADDRESS_LENGTH=je.isValidTransactionDigest=je.SuiJsonValue=je.ObjectOwner=je.SequenceNumber=je.SuiAddress=je.ObjectId=je.TransactionEventDigest=je.TransactionEffectsDigest=je.TransactionDigest=void 0;var vr=sr(),V6=tn();je.TransactionDigest=(0,vr.string)();je.TransactionEffectsDigest=(0,vr.string)();je.TransactionEventDigest=(0,vr.string)();je.ObjectId=(0,vr.string)();je.SuiAddress=(0,vr.string)();je.SequenceNumber=(0,vr.number)();je.ObjectOwner=(0,vr.union)([(0,vr.object)({AddressOwner:je.SuiAddress}),(0,vr.object)({ObjectOwner:je.SuiAddress}),(0,vr.object)({Shared:(0,vr.object)({initial_shared_version:(0,vr.number)()})}),(0,vr.literal)("Immutable")]);je.SuiJsonValue=(0,vr.define)("SuiJsonValue",()=>!0);var $6=32;function G6(t){try{return(0,V6.fromB58)(t).length===$6}catch{return!1}}je.isValidTransactionDigest=G6;je.SUI_ADDRESS_LENGTH=32;function Zh(t){return X6(t)&&Y6(t)===je.SUI_ADDRESS_LENGTH}je.isValidSuiAddress=Zh;function W6(t){return Zh(t)}je.isValidSuiObjectId=W6;function Xh(t,e=!1){let r=t.toLowerCase();return!e&&r.startsWith("0x")&&(r=r.slice(2)),`0x${r.padStart(je.SUI_ADDRESS_LENGTH*2,"0")}`}je.normalizeSuiAddress=Xh;function Z6(t,e=!1){return Xh(t,e)}je.normalizeSuiObjectId=Z6;function X6(t){return/^(0x|0X)?[a-fA-F0-9]+$/.test(t)&&t.length%2===0}function Y6(t){return/^(0x|0X)/.test(t)?(t.length-2)/2:t.length/2}});var xa=K($=>{"use strict";I();O();Object.defineProperty($,"__esModule",{value:!0});$.PaginatedObjectsResponse=$.CheckpointedObjectId=$.getMovePackageContent=$.hasPublicTransfer=$.getMoveObject=$.getObjectFields=$.getMoveObjectType=$.isImmutableObject=$.isSharedObject=$.getSharedObjectInitialVersion=$.getObjectDisplay=$.getObjectOwner=$.getObjectPreviousTransactionDigest=$.getObjectType=$.isSuiObjectResponse=$.getObjectVersion=$.getObjectId=$.getObjectReference=$.getObjectNotExistsResponse=$.getObjectDeletedResponse=$.getSuiObjectData=$.SuiObjectResponse=$.SuiObjectResponseError=$.GetOwnedObjectsResponse=$.ObjectStatus=$.SuiObjectDataOptions=$.SuiObjectData=$.ObjectDigest=$.MIST_PER_SUI=$.SuiRawData=$.SuiRawMovePackage=$.SuiRawMoveObject=$.SuiParsedData=$.SuiMovePackage=$.SuiMoveObject=$.MovePackageContent=$.ObjectContentFields=$.SuiObjectInfo=$.SuiGasData=$.SuiObjectRef=$.ObjectType=void 0;var Z=sr(),xr=rn();$.ObjectType=(0,Z.union)([(0,Z.string)(),(0,Z.literal)("package")]);$.SuiObjectRef=(0,Z.object)({digest:xr.TransactionDigest,objectId:(0,Z.string)(),version:(0,Z.union)([(0,Z.number)(),(0,Z.string)()])});$.SuiGasData=(0,Z.object)({payment:(0,Z.array)($.SuiObjectRef),owner:(0,Z.string)(),price:(0,Z.number)(),budget:(0,Z.number)()});$.SuiObjectInfo=(0,Z.assign)($.SuiObjectRef,(0,Z.object)({type:(0,Z.string)(),owner:xr.ObjectOwner,previousTransaction:xr.TransactionDigest}));$.ObjectContentFields=(0,Z.record)((0,Z.string)(),(0,Z.any)());$.MovePackageContent=(0,Z.record)((0,Z.string)(),(0,Z.string)());$.SuiMoveObject=(0,Z.object)({type:(0,Z.string)(),fields:$.ObjectContentFields,hasPublicTransfer:(0,Z.boolean)()});$.SuiMovePackage=(0,Z.object)({disassembled:$.MovePackageContent});$.SuiParsedData=(0,Z.union)([(0,Z.assign)($.SuiMoveObject,(0,Z.object)({dataType:(0,Z.literal)("moveObject")})),(0,Z.assign)($.SuiMovePackage,(0,Z.object)({dataType:(0,Z.literal)("package")}))]);$.SuiRawMoveObject=(0,Z.object)({type:(0,Z.string)(),hasPublicTransfer:(0,Z.boolean)(),version:xr.SequenceNumber,bcsBytes:(0,Z.array)((0,Z.number)())});$.SuiRawMovePackage=(0,Z.object)({id:xr.ObjectId,moduleMap:(0,Z.record)((0,Z.string)(),(0,Z.string)())});$.SuiRawData=(0,Z.union)([(0,Z.assign)($.SuiMoveObject,(0,Z.object)({dataType:(0,Z.literal)("moveObject")})),(0,Z.assign)($.SuiRawMovePackage,(0,Z.object)({dataType:(0,Z.literal)("package")}))]);$.MIST_PER_SUI=BigInt(1e9);$.ObjectDigest=(0,Z.string)();$.SuiObjectData=(0,Z.object)({objectId:xr.ObjectId,version:xr.SequenceNumber,digest:$.ObjectDigest,type:(0,Z.optional)((0,Z.string)()),content:(0,Z.optional)($.SuiParsedData),bcs:(0,Z.optional)($.SuiRawData),owner:(0,Z.optional)(xr.ObjectOwner),previousTransaction:(0,Z.optional)(xr.TransactionDigest),storageRebate:(0,Z.optional)((0,Z.number)()),display:(0,Z.optional)((0,Z.record)((0,Z.string)(),(0,Z.string)()))});$.SuiObjectDataOptions=(0,Z.object)({showType:(0,Z.optional)((0,Z.boolean)()),showContent:(0,Z.optional)((0,Z.boolean)()),showBcs:(0,Z.optional)((0,Z.boolean)()),showOwner:(0,Z.optional)((0,Z.boolean)()),showPreviousTransaction:(0,Z.optional)((0,Z.boolean)()),showStorageRebate:(0,Z.optional)((0,Z.boolean)()),showDisplay:(0,Z.optional)((0,Z.boolean)())});$.ObjectStatus=(0,Z.union)([(0,Z.literal)("Exists"),(0,Z.literal)("NotExists"),(0,Z.literal)("Deleted")]);$.GetOwnedObjectsResponse=(0,Z.array)($.SuiObjectInfo);$.SuiObjectResponseError=(0,Z.object)({tag:(0,Z.string)(),object_id:(0,Z.optional)(xr.ObjectId),version:(0,Z.optional)(xr.SequenceNumber),digest:(0,Z.optional)($.ObjectDigest)});$.SuiObjectResponse=(0,Z.object)({data:(0,Z.optional)($.SuiObjectData),error:(0,Z.optional)($.SuiObjectResponseError)});function Bi(t){return t.data}$.getSuiObjectData=Bi;function Yh(t){if(t.error&&"object_id"in t.error&&"version"in t.error&&"digest"in t.error){let e=t.error;return{objectId:e.object_id,version:e.version,digest:e.digest}}}$.getObjectDeletedResponse=Yh;function Jh(t){if(t.error&&"object_id"in t.error&&!("version"in t.error)&&!("digest"in t.error))return t.error.object_id}$.getObjectNotExistsResponse=Jh;function Gf(t){if("reference"in t)return t.reference;let e=Bi(t);return e?{objectId:e.objectId,version:e.version,digest:e.digest}:Yh(t)}$.getObjectReference=Gf;function J6(t){return"objectId"in t?t.objectId:Gf(t)?.objectId??Jh(t)}$.getObjectId=J6;function Q6(t){return"version"in t?t.version:Gf(t)?.version}$.getObjectVersion=Q6;function Qh(t){return t.data!==void 0}$.isSuiObjectResponse=Qh;function ev(t){let e=Qh(t)?t.data:t;return!e?.type&&"data"in t?e?.content?.dataType==="package"?"package":eb(t):e?.type}$.getObjectType=ev;function tv(t){return Bi(t)?.previousTransaction}$.getObjectPreviousTransactionDigest=tv;function _a(t){return(0,Z.is)(t,xr.ObjectOwner)?t:Bi(t)?.owner}$.getObjectOwner=_a;function rv(t){return Bi(t)?.display}$.getObjectDisplay=rv;function nv(t){let e=_a(t);if(typeof e=="object"&&"Shared"in e)return e.Shared.initial_shared_version}$.getSharedObjectInitialVersion=nv;function iv(t){let e=_a(t);return typeof e=="object"&&"Shared"in e}$.isSharedObject=iv;function sv(t){return _a(t)==="Immutable"}$.isImmutableObject=sv;function eb(t){return Ea(t)?.type}$.getMoveObjectType=eb;function ov(t){return"fields"in t?t.fields:Ea(t)?.fields}$.getObjectFields=ov;function av(t){return t.content!==void 0}function Ea(t){let e="data"in t?Bi(t):t;if(!(!e||!av(e)||e.content.dataType!=="moveObject"))return e.content}$.getMoveObject=Ea;function cv(t){return Ea(t)?.hasPublicTransfer??!1}$.hasPublicTransfer=cv;function fv(t){if("disassembled"in t)return t.disassembled;let e=Bi(t);if(e?.content?.dataType==="package")return e.content.disassembled}$.getMovePackageContent=fv;$.CheckpointedObjectId=(0,Z.object)({objectId:xr.ObjectId,atCheckpoint:(0,Z.optional)((0,Z.number)())});$.PaginatedObjectsResponse=(0,Z.object)({data:(0,Z.array)($.SuiObjectResponse),nextCursor:(0,Z.optional)($.CheckpointedObjectId),hasNextPage:(0,Z.boolean)()})});var Wf=K(St=>{"use strict";I();O();Object.defineProperty(St,"__esModule",{value:!0});St.getEventPackage=St.getEventSender=St.SubscriptionEvent=St.SubscriptionId=St.PaginatedEvents=St.SuiEvent=St.EventId=void 0;var Wt=sr(),Aa=rn();St.EventId=(0,Wt.object)({txDigest:Aa.TransactionDigest,eventSeq:Aa.SequenceNumber});St.SuiEvent=(0,Wt.object)({id:St.EventId,packageId:Aa.ObjectId,transactionModule:(0,Wt.string)(),sender:Aa.SuiAddress,type:(0,Wt.string)(),parsedJson:(0,Wt.optional)((0,Wt.record)((0,Wt.string)(),(0,Wt.any)())),bcs:(0,Wt.optional)((0,Wt.string)()),timestampMs:(0,Wt.optional)((0,Wt.integer)())});St.PaginatedEvents=(0,Wt.object)({data:(0,Wt.array)(St.SuiEvent),nextCursor:(0,Wt.union)([St.EventId,(0,Wt.literal)(null)]),hasNextPage:(0,Wt.boolean)()});St.SubscriptionId=(0,Wt.number)();St.SubscriptionEvent=(0,Wt.object)({subscription:St.SubscriptionId,result:St.SuiEvent});function uv(t){return t.sender}St.getEventSender=uv;function dv(t){return t.packageId}St.getEventPackage=dv});var Yf=K(q=>{"use strict";I();O();Object.defineProperty(q,"__esModule",{value:!0});q.getExecutionStatusType=q.getProgrammableTransaction=q.getTransactionKindName=q.getTransactionKind=q.getConsensusCommitPrologueTransaction=q.getChangeEpochTransaction=q.getTransactionGasBudget=q.getTransactionGasPrice=q.getTransactionGasObject=q.getGasData=q.getTransactionSender=q.getTransactionSignature=q.getTransactionDigest=q.getTransaction=q.DryRunTransactionBlockResponse=q.PaginatedTransactionResponse=q.SuiTransactionBlockResponseOptions=q.SuiTransactionBlockResponse=q.BalanceChange=q.SuiObjectChange=q.SuiObjectChangeCreated=q.SuiObjectChangeWrapped=q.SuiObjectChangeDeleted=q.SuiObjectChangeMutated=q.SuiObjectChangeTransferred=q.SuiObjectChangePublished=q.SuiTransactionBlock=q.AuthorityName=q.DevInspectResults=q.TransactionEvents=q.TransactionEffects=q.TransactionEffectsModifiedAtVersions=q.OwnedObjectRef=q.ExecutionStatus=q.ExecutionStatusType=q.GasCostSummary=q.AuthorityQuorumSignInfo=q.GenericAuthoritySignature=q.AuthoritySignature=q.SuiTransactionBlockData=q.SuiTransactionBlockKind=q.ProgrammableTransaction=q.SuiCallArg=q.SuiTransaction=q.MoveCallSuiTransaction=q.SuiArgument=q.Genesis=q.SuiConsensusCommitPrologue=q.SuiChangeEpoch=q.EpochId=void 0;q.getPublishedObjectChanges=q.getObjectChanges=q.getNewlyCreatedCoinRefsAfterSplit=q.getTimestampFromTransactionResponse=q.getCreatedObjects=q.getEvents=q.getTransactionEffects=q.getTotalGasUsedUpperBound=q.getTotalGasUsed=q.getExecutionStatusGasSummary=q.getExecutionStatusError=q.getExecutionStatus=void 0;var j=sr(),xe=rn(),lv=Wf(),Hr=xa();q.EpochId=(0,j.string)();q.SuiChangeEpoch=(0,j.object)({epoch:q.EpochId,storage_charge:(0,j.number)(),computation_charge:(0,j.number)(),storage_rebate:(0,j.number)(),epoch_start_timestamp_ms:(0,j.optional)((0,j.number)())});q.SuiConsensusCommitPrologue=(0,j.object)({epoch:(0,j.number)(),round:(0,j.number)(),commit_timestamp_ms:(0,j.number)()});q.Genesis=(0,j.object)({objects:(0,j.array)(xe.ObjectId)});q.SuiArgument=(0,j.union)([(0,j.literal)("GasCoin"),(0,j.object)({Input:(0,j.number)()}),(0,j.object)({Result:(0,j.number)()}),(0,j.object)({NestedResult:(0,j.tuple)([(0,j.number)(),(0,j.number)()])})]);q.MoveCallSuiTransaction=(0,j.object)({arguments:(0,j.optional)((0,j.array)(q.SuiArgument)),type_arguments:(0,j.optional)((0,j.array)((0,j.string)())),package:xe.ObjectId,module:(0,j.string)(),function:(0,j.string)()});q.SuiTransaction=(0,j.union)([(0,j.object)({MoveCall:q.MoveCallSuiTransaction}),(0,j.object)({TransferObjects:(0,j.tuple)([(0,j.array)(q.SuiArgument),q.SuiArgument])}),(0,j.object)({SplitCoins:(0,j.tuple)([q.SuiArgument,(0,j.array)(q.SuiArgument)])}),(0,j.object)({MergeCoins:(0,j.tuple)([q.SuiArgument,(0,j.array)(q.SuiArgument)])}),(0,j.object)({Publish:Hr.SuiMovePackage}),(0,j.object)({MakeMoveVec:(0,j.tuple)([(0,j.nullable)((0,j.string)()),(0,j.array)(q.SuiArgument)])})]);q.SuiCallArg=(0,j.union)([(0,j.object)({type:(0,j.literal)("pure"),valueType:(0,j.optional)((0,j.string)()),value:xe.SuiJsonValue}),(0,j.object)({type:(0,j.literal)("object"),objectType:(0,j.literal)("immOrOwnedObject"),objectId:xe.ObjectId,version:xe.SequenceNumber,digest:Hr.ObjectDigest}),(0,j.object)({type:(0,j.literal)("object"),objectType:(0,j.literal)("sharedObject"),objectId:xe.ObjectId,initialSharedVersion:xe.SequenceNumber,mutable:(0,j.boolean)()})]);q.ProgrammableTransaction=(0,j.object)({transactions:(0,j.array)(q.SuiTransaction),inputs:(0,j.array)(q.SuiCallArg)});q.SuiTransactionBlockKind=(0,j.union)([(0,j.assign)(q.SuiChangeEpoch,(0,j.object)({kind:(0,j.literal)("ChangeEpoch")})),(0,j.assign)(q.SuiConsensusCommitPrologue,(0,j.object)({kind:(0,j.literal)("ConsensusCommitPrologue")})),(0,j.assign)(q.Genesis,(0,j.object)({kind:(0,j.literal)("Genesis")})),(0,j.assign)(q.ProgrammableTransaction,(0,j.object)({kind:(0,j.literal)("ProgrammableTransaction")}))]);q.SuiTransactionBlockData=(0,j.object)({messageVersion:(0,j.literal)("v1"),transaction:q.SuiTransactionBlockKind,sender:xe.SuiAddress,gasData:Hr.SuiGasData});q.AuthoritySignature=(0,j.string)();q.GenericAuthoritySignature=(0,j.union)([q.AuthoritySignature,(0,j.array)(q.AuthoritySignature)]);q.AuthorityQuorumSignInfo=(0,j.object)({epoch:q.EpochId,signature:q.GenericAuthoritySignature,signers_map:(0,j.array)((0,j.number)())});q.GasCostSummary=(0,j.object)({computationCost:(0,j.string)(),storageCost:(0,j.string)(),storageRebate:(0,j.string)(),nonRefundableStorageFee:(0,j.string)()});q.ExecutionStatusType=(0,j.union)([(0,j.literal)("success"),(0,j.literal)("failure")]);q.ExecutionStatus=(0,j.object)({status:q.ExecutionStatusType,error:(0,j.optional)((0,j.string)())});q.OwnedObjectRef=(0,j.object)({owner:xe.ObjectOwner,reference:Hr.SuiObjectRef});q.TransactionEffectsModifiedAtVersions=(0,j.object)({objectId:xe.ObjectId,sequenceNumber:xe.SequenceNumber});q.TransactionEffects=(0,j.object)({messageVersion:(0,j.literal)("v1"),status:q.ExecutionStatus,executedEpoch:q.EpochId,modifiedAtVersions:(0,j.optional)((0,j.array)(q.TransactionEffectsModifiedAtVersions)),gasUsed:q.GasCostSummary,sharedObjects:(0,j.optional)((0,j.array)(Hr.SuiObjectRef)),transactionDigest:xe.TransactionDigest,created:(0,j.optional)((0,j.array)(q.OwnedObjectRef)),mutated:(0,j.optional)((0,j.array)(q.OwnedObjectRef)),unwrapped:(0,j.optional)((0,j.array)(q.OwnedObjectRef)),deleted:(0,j.optional)((0,j.array)(Hr.SuiObjectRef)),unwrapped_then_deleted:(0,j.optional)((0,j.array)(Hr.SuiObjectRef)),wrapped:(0,j.optional)((0,j.array)(Hr.SuiObjectRef)),gasObject:q.OwnedObjectRef,eventsDigest:(0,j.optional)(xe.TransactionEventDigest),dependencies:(0,j.optional)((0,j.array)(xe.TransactionDigest))});q.TransactionEvents=(0,j.array)(lv.SuiEvent);var hv=(0,j.tuple)([(0,j.array)((0,j.number)()),(0,j.string)()]),bv=(0,j.tuple)([q.SuiArgument,(0,j.array)((0,j.number)()),(0,j.string)()]),pv=(0,j.object)({mutableReferenceOutputs:(0,j.optional)((0,j.array)(bv)),returnValues:(0,j.optional)((0,j.array)(hv))});q.DevInspectResults=(0,j.object)({effects:q.TransactionEffects,events:q.TransactionEvents,results:(0,j.optional)((0,j.array)(pv)),error:(0,j.optional)((0,j.string)())});q.AuthorityName=(0,j.string)();q.SuiTransactionBlock=(0,j.object)({data:q.SuiTransactionBlockData,txSignatures:(0,j.array)((0,j.string)())});q.SuiObjectChangePublished=(0,j.object)({type:(0,j.literal)("published"),packageId:xe.ObjectId,version:xe.SequenceNumber,digest:Hr.ObjectDigest,modules:(0,j.array)((0,j.string)())});q.SuiObjectChangeTransferred=(0,j.object)({type:(0,j.literal)("transferred"),sender:xe.SuiAddress,recipient:xe.ObjectOwner,objectType:(0,j.string)(),objectId:xe.ObjectId,version:xe.SequenceNumber,digest:Hr.ObjectDigest});q.SuiObjectChangeMutated=(0,j.object)({type:(0,j.literal)("mutated"),sender:xe.SuiAddress,owner:xe.ObjectOwner,objectType:(0,j.string)(),objectId:xe.ObjectId,version:xe.SequenceNumber,previousVersion:xe.SequenceNumber,digest:Hr.ObjectDigest});q.SuiObjectChangeDeleted=(0,j.object)({type:(0,j.literal)("deleted"),sender:xe.SuiAddress,objectType:(0,j.string)(),objectId:xe.ObjectId,version:xe.SequenceNumber});q.SuiObjectChangeWrapped=(0,j.object)({type:(0,j.literal)("wrapped"),sender:xe.SuiAddress,objectType:(0,j.string)(),objectId:xe.ObjectId,version:xe.SequenceNumber});q.SuiObjectChangeCreated=(0,j.object)({type:(0,j.literal)("created"),sender:xe.SuiAddress,owner:xe.ObjectOwner,objectType:(0,j.string)(),objectId:xe.ObjectId,version:xe.SequenceNumber,digest:Hr.ObjectDigest});q.SuiObjectChange=(0,j.union)([q.SuiObjectChangePublished,q.SuiObjectChangeTransferred,q.SuiObjectChangeMutated,q.SuiObjectChangeDeleted,q.SuiObjectChangeWrapped,q.SuiObjectChangeCreated]);q.BalanceChange=(0,j.object)({owner:xe.ObjectOwner,coinType:(0,j.string)(),amount:(0,j.string)()});q.SuiTransactionBlockResponse=(0,j.object)({digest:xe.TransactionDigest,transaction:(0,j.optional)(q.SuiTransactionBlock),effects:(0,j.optional)(q.TransactionEffects),events:(0,j.optional)(q.TransactionEvents),timestampMs:(0,j.optional)((0,j.number)()),checkpoint:(0,j.optional)((0,j.number)()),confirmedLocalExecution:(0,j.optional)((0,j.boolean)()),objectChanges:(0,j.optional)((0,j.array)(q.SuiObjectChange)),balanceChanges:(0,j.optional)((0,j.array)(q.BalanceChange)),errors:(0,j.optional)((0,j.array)((0,j.string)()))});q.SuiTransactionBlockResponseOptions=(0,j.object)({showInput:(0,j.optional)((0,j.boolean)()),showEffects:(0,j.optional)((0,j.boolean)()),showEvents:(0,j.optional)((0,j.boolean)()),showObjectChanges:(0,j.optional)((0,j.boolean)()),showBalanceChanges:(0,j.optional)((0,j.boolean)())});q.PaginatedTransactionResponse=(0,j.object)({data:(0,j.array)(q.SuiTransactionBlockResponse),nextCursor:(0,j.union)([xe.TransactionDigest,(0,j.literal)(null)]),hasNextPage:(0,j.boolean)()});q.DryRunTransactionBlockResponse=(0,j.object)({effects:q.TransactionEffects,events:q.TransactionEvents,objectChanges:(0,j.array)(q.SuiObjectChange),balanceChanges:(0,j.array)(q.BalanceChange)});function gv(t){return t.transaction}q.getTransaction=gv;function yv(t){return t.digest}q.getTransactionDigest=yv;function mv(t){return t.transaction?.txSignatures}q.getTransactionSignature=mv;function vv(t){return t.transaction?.data.sender}q.getTransactionSender=vv;function Ma(t){return t.transaction?.data.gasData}q.getGasData=Ma;function wv(t){return Ma(t)?.payment}q.getTransactionGasObject=wv;function Sv(t){return Ma(t)?.price}q.getTransactionGasPrice=Sv;function _v(t){return Ma(t)?.budget}q.getTransactionGasBudget=_v;function Ev(t){return t.kind==="ChangeEpoch"?t:void 0}q.getChangeEpochTransaction=Ev;function xv(t){return t.kind==="ConsensusCommitPrologue"?t:void 0}q.getConsensusCommitPrologueTransaction=xv;function Av(t){return t.transaction?.data.transaction}q.getTransactionKind=Av;function Mv(t){return t.kind}q.getTransactionKindName=Mv;function Tv(t){return t.kind==="ProgrammableTransaction"?t:void 0}q.getProgrammableTransaction=Tv;function Iv(t){return Zf(t)?.status}q.getExecutionStatusType=Iv;function Zf(t){return no(t)?.status}q.getExecutionStatus=Zf;function Ov(t){return Zf(t)?.error}q.getExecutionStatusError=Ov;function Xf(t){return(0,j.is)(t,q.TransactionEffects)?t.gasUsed:no(t)?.gasUsed}q.getExecutionStatusGasSummary=Xf;function Bv(t){let e=Xf(t);return e?BigInt(e.computationCost)+BigInt(e.storageCost)-BigInt(e.storageRebate):void 0}q.getTotalGasUsed=Bv;function Pv(t){let e=Xf(t);return e?BigInt(e.computationCost)+BigInt(e.storageCost):void 0}q.getTotalGasUsedUpperBound=Pv;function no(t){return t.effects}q.getTransactionEffects=no;function jv(t){return t.events}q.getEvents=jv;function Nv(t){return no(t)?.created}q.getCreatedObjects=Nv;function kv(t){return t.timestampMs??void 0}q.getTimestampFromTransactionResponse=kv;function Rv(t){return no(t)?.created?.map(e=>e.reference)}q.getNewlyCreatedCoinRefsAfterSplit=Rv;function qv(t){return t.objectChanges}q.getObjectChanges=qv;function Cv(t){return t.objectChanges?.filter(e=>(0,j.is)(e,q.SuiObjectChangePublished))??[]}q.getPublishedObjectChanges=Cv});var tb=K(Ta=>{"use strict";I();O();Object.defineProperty(Ta,"__esModule",{value:!0});Ta.getOption=void 0;function Dv(t){if(!(typeof t=="object"&&t!==null&&"type"in t&&t.type.startsWith("0x1::option::Option<")))return t}Ta.getOption=Dv});var eu=K(Ae=>{"use strict";I();O();Object.defineProperty(Ae,"__esModule",{value:!0});Ae.Delegation=Ae.Coin=Ae.CoinMetadataStruct=Ae.isObjectDataFull=Ae.COIN_TYPE_ARG_REGEX=Ae.PAY_JOIN_COIN_FUNC_NAME=Ae.PAY_SPLIT_COIN_VEC_FUNC_NAME=Ae.PAY_MODULE_NAME=Ae.SUI_CLOCK_OBJECT_ID=Ae.SUI_TYPE_ARG=Ae.ID_STRUCT_NAME=Ae.UID_STRUCT_NAME=Ae.OBJECT_MODULE_NAME=Ae.MOVE_STDLIB_ADDRESS=Ae.SUI_FRAMEWORK_ADDRESS=Ae.SUI_SYSTEM_ADDRESS=void 0;var Jf=xa(),Qf=rn(),rb=tb(),Sn=sr();Ae.SUI_SYSTEM_ADDRESS="0x3";Ae.SUI_FRAMEWORK_ADDRESS="0x2";Ae.MOVE_STDLIB_ADDRESS="0x1";Ae.OBJECT_MODULE_NAME="object";Ae.UID_STRUCT_NAME="UID";Ae.ID_STRUCT_NAME="ID";Ae.SUI_TYPE_ARG=`${Ae.SUI_FRAMEWORK_ADDRESS}::sui::SUI`;Ae.SUI_CLOCK_OBJECT_ID=(0,Qf.normalizeSuiObjectId)("0x6");Ae.PAY_MODULE_NAME="pay";Ae.PAY_SPLIT_COIN_VEC_FUNC_NAME="split_vec";Ae.PAY_JOIN_COIN_FUNC_NAME="join";Ae.COIN_TYPE_ARG_REGEX=/^0x2::coin::Coin<(.+)>$/;function nb(t){return!!t.data||!!t.type}Ae.isObjectDataFull=nb;Ae.CoinMetadataStruct=(0,Sn.object)({decimals:(0,Sn.number)(),name:(0,Sn.string)(),symbol:(0,Sn.string)(),description:(0,Sn.string)(),iconUrl:(0,Sn.union)([(0,Sn.string)(),(0,Sn.literal)(null)]),id:(0,Sn.union)([Qf.ObjectId,(0,Sn.literal)(null)])});var pr=class{static isCoin(e){return pr.getType(e)?.match(Ae.COIN_TYPE_ARG_REGEX)!=null}static getCoinType(e){let[,r]=e.match(Ae.COIN_TYPE_ARG_REGEX)??[];return r||null}static getCoinTypeArg(e){let r=pr.getType(e);return r?pr.getCoinType(r):null}static isSUI(e){let r=pr.getCoinTypeArg(e);return r?pr.getCoinSymbol(r)==="SUI":!1}static getCoinSymbol(e){return e.substring(e.lastIndexOf(":")+1)}static getCoinStructTag(e){return{address:(0,Qf.normalizeSuiObjectId)(e.split("::")[0]),module:e.split("::")[1],name:e.split("::")[2],typeParams:[]}}static getID(e){return"fields"in e?e.fields.id.id:(0,Jf.getObjectId)(e)}static totalBalance(e){return e.reduce((r,n)=>r+pr.getBalanceFromCoinStruct(n),BigInt(0))}static sortByBalance(e){return[...e].sort((r,n)=>pr.getBalanceFromCoinStruct(r)<pr.getBalanceFromCoinStruct(n)?-1:pr.getBalanceFromCoinStruct(r)>pr.getBalanceFromCoinStruct(n)?1:0)}static getBalanceFromCoinStruct(e){return BigInt(e.balance)}static getBalance(e){if(!pr.isCoin(e))return;let r=(0,Jf.getObjectFields)(e)?.balance;return BigInt(r)}static getType(e){return nb(e)?(0,Jf.getObjectType)(e):e.type}};Ae.Coin=pr;var ys=class{static isDelegationSuiObject(e){return"type"in e&&e.type===ys.SUI_OBJECT_TYPE}constructor(e){this.suiObject=e}nextRewardUnclaimedEpoch(){return this.suiObject.data.fields.next_reward_unclaimed_epoch}activeDelegation(){return BigInt((0,rb.getOption)(this.suiObject.data.fields.active_delegation)||0)}delegateAmount(){return this.suiObject.data.fields.delegate_amount}endingEpoch(){return(0,rb.getOption)(this.suiObject.data.fields.ending_epoch)}validatorAddress(){return this.suiObject.data.fields.validator_address}isActive(){return this.activeDelegation()>0&&!this.endingEpoch()}hasUnclaimedRewards(e){return this.nextRewardUnclaimedEpoch()<=e&&(this.isActive()||(this.endingEpoch()||0)>e)}};Ae.Delegation=ys;ys.SUI_OBJECT_TYPE="0x2::delegation::Delegation"});var tu=K(vs=>{"use strict";I();O();Object.defineProperty(vs,"__esModule",{value:!0});vs.bcs=vs.isPureArg=void 0;var er=tn(),ib=r1();function Uv(t){t.registerType("utf8string",(e,r)=>{let n=Array.from(new ib.TextEncoder().encode(r));return e.writeVec(n,(i,s)=>i.write8(s))},e=>{let r=e.readVec(n=>n.read8());return new ib.TextDecoder().decode(new Uint8Array(r))})}function Lv(t){return t.Pure!==void 0}vs.isPureArg=Lv;var ms="vector",Hv={kind:"TransactionKind",sender:er.BCS.ADDRESS,gasData:"GasData",expiration:"TransactionExpiration"},Kv={enums:{"Option<T>":{None:null,Some:"T"},ObjectArg:{ImmOrOwned:"SuiObjectRef",Shared:"SharedObjectRef"},CallArg:{Pure:[ms,er.BCS.U8],Object:"ObjectArg",ObjVec:[ms,"ObjectArg"]},TypeTag:{bool:null,u8:null,u64:null,u128:null,address:null,signer:null,vector:"TypeTag",struct:"StructTag",u16:null,u32:null,u256:null},TransactionKind:{ProgrammableTransaction:"ProgrammableTransaction",ChangeEpoch:null,Genesis:null,ConsensusCommitPrologue:null},TransactionExpiration:{None:null,Epoch:er.BCS.U64},TransactionData:{V1:"TransactionDataV1"}},structs:{SuiObjectRef:{objectId:er.BCS.ADDRESS,version:er.BCS.U64,digest:"ObjectDigest"},SharedObjectRef:{objectId:er.BCS.ADDRESS,initialSharedVersion:er.BCS.U64,mutable:er.BCS.BOOL},StructTag:{address:er.BCS.ADDRESS,module:er.BCS.STRING,name:er.BCS.STRING,typeParams:[ms,"TypeTag"]},GasData:{payment:[ms,"SuiObjectRef"],owner:er.BCS.ADDRESS,price:er.BCS.U64,budget:er.BCS.U64},SenderSignedData:{data:"TransactionData",txSignatures:[ms,[ms,er.BCS.U8]]},TransactionDataV1:Hv},aliases:{ObjectDigest:er.BCS.BASE58}},sb=new er.BCS({...(0,er.getSuiMoveConfig)(),types:Kv});vs.bcs=sb;Uv(sb)});var ab=K(Pi=>{"use strict";I();O();Object.defineProperty(Pi,"__esModule",{value:!0});Pi.FaucetResponse=Pi.FaucetCoinInfo=void 0;var ws=sr(),ob=rn();Pi.FaucetCoinInfo=(0,ws.object)({amount:(0,ws.number)(),id:ob.ObjectId,transferTxDigest:ob.TransactionDigest});Pi.FaucetResponse=(0,ws.object)({transferredGasObjects:(0,ws.array)(Pi.FaucetCoinInfo),error:(0,ws.nullable)((0,ws.string)())})});var lb=K(ue=>{"use strict";I();O();Object.defineProperty(ue,"__esModule",{value:!0});ue.extractStructTag=ue.extractReference=ue.extractMutableReference=ue.SuiMoveNormalizedModules=ue.SuiMoveNormalizedModule=ue.SuiMoveNormalizedStruct=ue.SuiMoveNormalizedField=ue.SuiMoveNormalizedFunction=ue.SuiMoveNormalizedStructType=ue.SuiMoveNormalizedType=ue.SuiMoveNormalizedTypeParameterType=ue.SuiMoveStructTypeParameter=ue.SuiMoveAbilitySet=ue.SuiMoveVisibility=ue.SuiMoveModuleId=ue.SuiMoveFunctionArgTypes=ue.SuiMoveFunctionArgType=void 0;var ge=sr();ue.SuiMoveFunctionArgType=(0,ge.union)([(0,ge.string)(),(0,ge.object)({Object:(0,ge.string)()})]);ue.SuiMoveFunctionArgTypes=(0,ge.array)(ue.SuiMoveFunctionArgType);ue.SuiMoveModuleId=(0,ge.object)({address:(0,ge.string)(),name:(0,ge.string)()});ue.SuiMoveVisibility=(0,ge.union)([(0,ge.literal)("Private"),(0,ge.literal)("Public"),(0,ge.literal)("Friend")]);ue.SuiMoveAbilitySet=(0,ge.object)({abilities:(0,ge.array)((0,ge.string)())});ue.SuiMoveStructTypeParameter=(0,ge.object)({constraints:ue.SuiMoveAbilitySet,isPhantom:(0,ge.boolean)()});ue.SuiMoveNormalizedTypeParameterType=(0,ge.object)({TypeParameter:(0,ge.number)()});function cb(t){if(!t)return!1;if(typeof t=="string"||(0,ge.is)(t,ue.SuiMoveNormalizedTypeParameterType)||fb(t))return!0;if(typeof t!="object")return!1;let e=t;return!!((0,ge.is)(e.Reference,ue.SuiMoveNormalizedType)||(0,ge.is)(e.MutableReference,ue.SuiMoveNormalizedType)||(0,ge.is)(e.Vector,ue.SuiMoveNormalizedType))}ue.SuiMoveNormalizedType=(0,ge.define)("SuiMoveNormalizedType",cb);function fb(t){if(!t||typeof t!="object")return!1;let e=t;if(!e.Struct||typeof e.Struct!="object")return!1;let r=e.Struct;return!(typeof r.address!="string"||typeof r.module!="string"||typeof r.name!="string"||!Array.isArray(r.typeArguments)||!r.typeArguments.every(n=>cb(n)))}ue.SuiMoveNormalizedStructType=(0,ge.define)("SuiMoveNormalizedStructType",fb);ue.SuiMoveNormalizedFunction=(0,ge.object)({visibility:ue.SuiMoveVisibility,isEntry:(0,ge.boolean)(),typeParameters:(0,ge.array)(ue.SuiMoveAbilitySet),parameters:(0,ge.array)(ue.SuiMoveNormalizedType),return:(0,ge.array)(ue.SuiMoveNormalizedType)});ue.SuiMoveNormalizedField=(0,ge.object)({name:(0,ge.string)(),type:ue.SuiMoveNormalizedType});ue.SuiMoveNormalizedStruct=(0,ge.object)({abilities:ue.SuiMoveAbilitySet,typeParameters:(0,ge.array)(ue.SuiMoveStructTypeParameter),fields:(0,ge.array)(ue.SuiMoveNormalizedField)});ue.SuiMoveNormalizedModule=(0,ge.object)({fileFormatVersion:(0,ge.number)(),address:(0,ge.string)(),name:(0,ge.string)(),friends:(0,ge.array)(ue.SuiMoveModuleId),structs:(0,ge.record)((0,ge.string)(),ue.SuiMoveNormalizedStruct),exposedFunctions:(0,ge.record)((0,ge.string)(),ue.SuiMoveNormalizedFunction)});ue.SuiMoveNormalizedModules=(0,ge.record)((0,ge.string)(),ue.SuiMoveNormalizedModule);function ub(t){return typeof t=="object"&&"MutableReference"in t?t.MutableReference:void 0}ue.extractMutableReference=ub;function db(t){return typeof t=="object"&&"Reference"in t?t.Reference:void 0}ue.extractReference=db;function Fv(t){if(typeof t=="object"&&"Struct"in t)return t;let e=db(t),r=ub(t);if(typeof e=="object"&&"Struct"in e)return e;if(typeof r=="object"&&"Struct"in r)return r}ue.extractStructTag=Fv});var hb=K(Be=>{"use strict";I();O();Object.defineProperty(Be,"__esModule",{value:!0});Be.SuiSystemStateSummary=Be.SuiValidatorSummary=Be.CommitteeInfo=Be.DelegationStakingPool=Be.DelegationStakingPoolFields=Be.Contents=Be.ContentsFieldsWithdraw=Be.ContentsFields=Be.SuiSupplyFields=Be.StakeSubsidy=Be.StakeSubsidyFields=Be.DelegatedStake=Be.StakeObject=Be.Balance=void 0;var D=sr(),ji=rn(),ru=Yf();Be.Balance=(0,D.object)({value:(0,D.number)()});Be.StakeObject=(0,D.object)({stakedSuiId:ji.ObjectId,stakeRequestEpoch:ru.EpochId,stakeActiveEpoch:ru.EpochId,principal:(0,D.number)(),status:(0,D.union)([(0,D.literal)("Active"),(0,D.literal)("Pending"),(0,D.literal)("Unstaked")]),estimatedReward:(0,D.optional)((0,D.number)())});Be.DelegatedStake=(0,D.object)({validatorAddress:ji.SuiAddress,stakingPool:ji.ObjectId,stakes:(0,D.array)(Be.StakeObject)});Be.StakeSubsidyFields=(0,D.object)({balance:(0,D.object)({value:(0,D.number)()}),distribution_counter:(0,D.number)(),current_distribution_amount:(0,D.number)(),stake_subsidy_period_length:(0,D.number)(),stake_subsidy_decrease_rate:(0,D.number)()});Be.StakeSubsidy=(0,D.object)({type:(0,D.string)(),fields:Be.StakeSubsidyFields});Be.SuiSupplyFields=(0,D.object)({value:(0,D.number)()});Be.ContentsFields=(0,D.object)({id:(0,D.string)(),size:(0,D.number)(),head:(0,D.object)({vec:(0,D.array)()}),tail:(0,D.object)({vec:(0,D.array)()})});Be.ContentsFieldsWithdraw=(0,D.object)({id:(0,D.string)(),size:(0,D.number)()});Be.Contents=(0,D.object)({type:(0,D.string)(),fields:Be.ContentsFields});Be.DelegationStakingPoolFields=(0,D.object)({exchangeRates:(0,D.object)({id:(0,D.string)(),size:(0,D.number)()}),id:(0,D.string)(),pendingStake:(0,D.number)(),pendingPoolTokenWithdraw:(0,D.number)(),pendingTotalSuiWithdraw:(0,D.number)(),poolTokenBalance:(0,D.number)(),rewardsPool:(0,D.object)({value:(0,D.number)()}),activationEpoch:(0,D.object)({vec:(0,D.array)()}),deactivationEpoch:(0,D.object)({vec:(0,D.array)()}),suiBalance:(0,D.number)()});Be.DelegationStakingPool=(0,D.object)({type:(0,D.string)(),fields:Be.DelegationStakingPoolFields});Be.CommitteeInfo=(0,D.object)({epoch:(0,D.number)(),validators:(0,D.optional)((0,D.array)((0,D.tuple)([ru.AuthorityName,(0,D.number)()])))});Be.SuiValidatorSummary=(0,D.object)({suiAddress:ji.SuiAddress,protocolPubkeyBytes:(0,D.string)(),networkPubkeyBytes:(0,D.string)(),workerPubkeyBytes:(0,D.string)(),proofOfPossessionBytes:(0,D.string)(),operationCapId:(0,D.string)(),name:(0,D.string)(),description:(0,D.string)(),imageUrl:(0,D.string)(),projectUrl:(0,D.string)(),p2pAddress:(0,D.string)(),netAddress:(0,D.string)(),primaryAddress:(0,D.string)(),workerAddress:(0,D.string)(),nextEpochProtocolPubkeyBytes:(0,D.nullable)((0,D.string)()),nextEpochProofOfPossession:(0,D.nullable)((0,D.string)()),nextEpochNetworkPubkeyBytes:(0,D.nullable)((0,D.string)()),nextEpochWorkerPubkeyBytes:(0,D.nullable)((0,D.string)()),nextEpochNetAddress:(0,D.nullable)((0,D.string)()),nextEpochP2pAddress:(0,D.nullable)((0,D.string)()),nextEpochPrimaryAddress:(0,D.nullable)((0,D.string)()),nextEpochWorkerAddress:(0,D.nullable)((0,D.string)()),votingPower:(0,D.number)(),gasPrice:(0,D.number)(),commissionRate:(0,D.number)(),nextEpochStake:(0,D.number)(),nextEpochGasPrice:(0,D.number)(),nextEpochCommissionRate:(0,D.number)(),stakingPoolId:(0,D.string)(),stakingPoolActivationEpoch:(0,D.nullable)((0,D.number)()),stakingPoolDeactivationEpoch:(0,D.nullable)((0,D.number)()),stakingPoolSuiBalance:(0,D.number)(),rewardsPool:(0,D.number)(),poolTokenBalance:(0,D.number)(),pendingStake:(0,D.number)(),pendingPoolTokenWithdraw:(0,D.number)(),pendingTotalSuiWithdraw:(0,D.number)(),exchangeRatesId:(0,D.string)(),exchangeRatesSize:(0,D.number)()});Be.SuiSystemStateSummary=(0,D.object)({epoch:(0,D.number)(),protocolVersion:(0,D.number)(),systemStateVersion:(0,D.number)(),storageFundTotalObjectStorageRebates:(0,D.number)(),storageFundNonRefundableBalance:(0,D.number)(),referenceGasPrice:(0,D.number)(),safeMode:(0,D.boolean)(),safeModeStorageRewards:(0,D.number)(),safeModeComputationRewards:(0,D.number)(),safeModeStorageRebates:(0,D.number)(),safeModeNonRefundableStorageFee:(0,D.number)(),epochStartTimestampMs:(0,D.number)(),epochDurationMs:(0,D.number)(),stakeSubsidyStartEpoch:(0,D.number)(),maxValidatorCount:(0,D.number)(),minValidatorJoiningStake:(0,D.number)(),validatorLowStakeThreshold:(0,D.number)(),validatorVeryLowStakeThreshold:(0,D.number)(),validatorLowStakeGracePeriod:(0,D.number)(),stakeSubsidyBalance:(0,D.number)(),stakeSubsidyDistributionCounter:(0,D.number)(),stakeSubsidyCurrentDistributionAmount:(0,D.number)(),stakeSubsidyPeriodLength:(0,D.number)(),stakeSubsidyDecreaseRate:(0,D.number)(),totalStake:(0,D.number)(),activeValidators:(0,D.array)(Be.SuiValidatorSummary),pendingActiveValidatorsId:(0,D.string)(),pendingActiveValidatorsSize:(0,D.number)(),pendingRemovals:(0,D.array)((0,D.number)()),stakingPoolMappingsId:(0,D.string)(),stakingPoolMappingsSize:(0,D.number)(),inactivePoolsId:(0,D.string)(),inactivePoolsSize:(0,D.number)(),validatorCandidatesId:(0,D.string)(),validatorCandidatesSize:(0,D.number)(),atRiskValidators:(0,D.array)((0,D.tuple)([ji.SuiAddress,(0,D.number)()])),validatorReportRecords:(0,D.array)((0,D.tuple)([ji.SuiAddress,(0,D.array)(ji.SuiAddress)]))})});var bb=K(nn=>{"use strict";I();O();Object.defineProperty(nn,"__esModule",{value:!0});nn.CoinSupply=nn.CoinBalance=nn.PaginatedCoins=nn.CoinStruct=void 0;var vt=sr(),Ia=rn();nn.CoinStruct=(0,vt.object)({coinType:(0,vt.string)(),coinObjectId:Ia.ObjectId,version:(0,vt.number)(),digest:Ia.TransactionDigest,balance:(0,vt.number)(),lockedUntilEpoch:(0,vt.nullable)((0,vt.number)()),previousTransaction:Ia.TransactionDigest});nn.PaginatedCoins=(0,vt.object)({data:(0,vt.array)(nn.CoinStruct),nextCursor:(0,vt.union)([Ia.ObjectId,(0,vt.literal)(null)]),hasNextPage:(0,vt.boolean)()});nn.CoinBalance=(0,vt.object)({coinType:(0,vt.string)(),coinObjectCount:(0,vt.number)(),totalBalance:(0,vt.number)(),lockedBalance:(0,vt.object)({epochId:(0,vt.optional)((0,vt.number)()),number:(0,vt.optional)((0,vt.number)())})});nn.CoinSupply=(0,vt.object)({value:(0,vt.number)()})});var pb=K(Ge=>{"use strict";I();O();Object.defineProperty(Ge,"__esModule",{value:!0});Ge.CheckpointPage=Ge.Checkpoint=Ge.ExecutionDigests=Ge.EndOfEpochData=Ge.CheckpointCommitment=Ge.ECMHLiveObjectSetDigest=Ge.CheckpointDigest=Ge.CheckPointContentsDigest=Ge.GasCostSummary=void 0;var Ne=sr(),nu=rn();Ge.GasCostSummary=(0,Ne.object)({computationCost:(0,Ne.number)(),storageCost:(0,Ne.number)(),storageRebate:(0,Ne.number)(),nonRefundableStorageFee:(0,Ne.number)()});Ge.CheckPointContentsDigest=(0,Ne.string)();Ge.CheckpointDigest=(0,Ne.string)();Ge.ECMHLiveObjectSetDigest=(0,Ne.object)({digest:(0,Ne.array)((0,Ne.number)())});Ge.CheckpointCommitment=(0,Ne.any)();Ge.EndOfEpochData=(0,Ne.object)({nextEpochCommittee:(0,Ne.array)((0,Ne.tuple)([(0,Ne.string)(),(0,Ne.number)()])),nextEpochProtocolVersion:(0,Ne.number)(),epochCommitments:(0,Ne.array)(Ge.CheckpointCommitment)});Ge.ExecutionDigests=(0,Ne.object)({transaction:nu.TransactionDigest,effects:nu.TransactionEffectsDigest});Ge.Checkpoint=(0,Ne.object)({epoch:(0,Ne.number)(),sequenceNumber:(0,Ne.string)(),digest:Ge.CheckpointDigest,networkTotalTransactions:(0,Ne.number)(),previousDigest:(0,Ne.optional)(Ge.CheckpointDigest),epochRollingGasCostSummary:Ge.GasCostSummary,timestampMs:(0,Ne.number)(),endOfEpochData:(0,Ne.optional)(Ge.EndOfEpochData),transactions:(0,Ne.array)(nu.TransactionDigest),checkpointCommitments:(0,Ne.array)(Ge.CheckpointCommitment)});Ge.CheckpointPage=(0,Ne.object)({data:(0,Ne.array)(Ge.Checkpoint),nextCursor:(0,Ne.union)([(0,Ne.string)(),(0,Ne.literal)(null)]),hasNextPage:(0,Ne.boolean)()})});var sn=K(wt=>{"use strict";I();O();var zv=wt&&wt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),_n=wt&&wt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&zv(e,t,r)};Object.defineProperty(wt,"__esModule",{value:!0});wt.Checkpoint=wt.CheckpointDigest=wt.GasCostSummary=void 0;_n(rn(),wt);_n(xa(),wt);_n(Wf(),wt);_n(Yf(),wt);_n(eu(),wt);_n(tu(),wt);_n(ab(),wt);_n(lb(),wt);_n(hb(),wt);_n(bb(),wt);var iu=pb();Object.defineProperty(wt,"GasCostSummary",{enumerable:!0,get:function(){return iu.GasCostSummary}});Object.defineProperty(wt,"CheckpointDigest",{enumerable:!0,get:function(){return iu.CheckpointDigest}});Object.defineProperty(wt,"Checkpoint",{enumerable:!0,get:function(){return iu.Checkpoint}})});var gs=K(Pa=>{"use strict";I();O();Object.defineProperty(Pa,"__esModule",{value:!0});Pa.Ed25519PublicKey=void 0;var gb=Gr(),yb=tn(),Vv=$f(),$v=wa(),mb=sn(),Oa=32,Ba=class{constructor(e){if(typeof e=="string"?this.data=(0,yb.fromB64)(e):e instanceof Uint8Array?this.data=e:this.data=Uint8Array.from(e),this.data.length!==Oa)throw new Error(`Invalid public key input. Expected ${Oa} bytes, got ${this.data.length}`)}equals(e){return(0,Vv.bytesEqual)(this.toBytes(),e.toBytes())}toBase64(){return(0,yb.toB64)(this.toBytes())}toBytes(){return this.data}toString(){return this.toBase64()}toSuiAddress(){let e=new Uint8Array(Oa+1);return e.set([$v.SIGNATURE_SCHEME_TO_FLAG.ED25519]),e.set(this.toBytes(),1),(0,mb.normalizeSuiAddress)(gb.base.toHex(gb.base.blake2b(e,{dkLen:32})).slice(0,mb.SUI_ADDRESS_LENGTH*2))}};Pa.Ed25519PublicKey=Ba;Ba.SIZE=Oa});var su=K(_s=>{"use strict";I();O();Object.defineProperty(_s,"__esModule",{value:!0});_s.Ed25519Keypair=_s.DEFAULT_ED25519_DERIVATION_PATH=void 0;var Gv=gs(),io=Gr();_s.DEFAULT_ED25519_DERIVATION_PATH="m/44'/784'/0'/0'/0'";var Ss=class{constructor(e){this.keypair=e}getKeyScheme(){return"ED25519"}static fromSecretKey(e,r){let n=e.length;if(n!=64)throw n==32?new Error("Wrong secretKey size. Expected 64 bytes, got 32. Similar function exists: fromSeed(seed: Uint8Array)"):new Error(`Wrong secretKey size. Expected 64 bytes, got ${n}.`);let i=io.signUtil.ed25519.fromSecret(e);if(!r||!r.skipValidation){let a=new TextEncoder().encode("sui validation"),c=io.signUtil.ed25519.sign(a,i.secretKey);if(!io.signUtil.ed25519.verify(a,c,i.publicKey))throw new Error("provided secretKey is invalid")}return new Ss(i)}static fromSeed(e){let r=e.length;if(r!=32)throw new Error(`Wrong seed size. Expected 32 bytes, got ${r}.`);return new Ss(io.signUtil.ed25519.fromSeed(e))}getPublicKey(){return new Gv.Ed25519PublicKey(this.keypair.publicKey)}signData(e){return io.signUtil.ed25519.sign(e,this.keypair.secretKey)}};_s.Ed25519Keypair=Ss});var ou=K(Es=>{"use strict";I();O();Object.defineProperty(Es,"__esModule",{value:!0});Es.LEGACY_PRIVATE_KEY_SIZE=Es.PRIVATE_KEY_SIZE=void 0;Es.PRIVATE_KEY_SIZE=32;Es.LEGACY_PRIVATE_KEY_SIZE=64});var au=K(ja=>{"use strict";I();O();Object.defineProperty(ja,"__esModule",{value:!0});ja.TypeTagSerializer=void 0;var Wv=sn(),Zv=/^vector<(.+)>$/,Xv=/^([^:]+)::([^:]+)::([^<]+)(<(.+)>)?/,On=class{static parseFromStr(e,r=!1){if(e==="address")return{address:null};if(e==="bool")return{bool:null};if(e==="u8")return{u8:null};if(e==="u16")return{u16:null};if(e==="u32")return{u32:null};if(e==="u64")return{u64:null};if(e==="u128")return{u128:null};if(e==="u256")return{u256:null};if(e==="signer")return{signer:null};let n=e.match(Zv);if(n)return{vector:On.parseFromStr(n[1],r)};let i=e.match(Xv);if(i)return{struct:{address:r?(0,Wv.normalizeSuiAddress)(i[1]):i[1],module:i[2],name:i[3],typeParams:i[5]===void 0?[]:On.parseStructTypeArgs(i[5],r)}};throw new Error(`Encountered unexpected token when parsing type args for ${e}`)}static parseStructTypeArgs(e,r=!1){let n=[],i="",s=0;for(let a=0;a<e.length;a++){let c=e[a];if(c==="<"&&s++,c===">"&&s--,s===0&&c===","){n.push(i.trim()),i="";continue}i+=c}return n.push(i.trim()),n.map(a=>On.parseFromStr(a,r))}static tagToString(e){if("bool"in e)return"bool";if("u8"in e)return"u8";if("u16"in e)return"u16";if("u32"in e)return"u32";if("u64"in e)return"u64";if("u128"in e)return"u128";if("u256"in e)return"u256";if("address"in e)return"address";if("signer"in e)return"signer";if("vector"in e)return`vector<${On.tagToString(e.vector)}>`;if("struct"in e){let r=e.struct,n=r.typeParams.map(On.tagToString).join(", ");return`${r.address}::${r.module}::${r.name}${n?`<${n}>`:""}`}throw new Error("Invalid TypeTag")}};ja.TypeTagSerializer=On});var wb=K(vb=>{"use strict";I();O();Object.defineProperty(vb,"__esModule",{value:!0})});var Na=K(xs=>{"use strict";I();O();Object.defineProperty(xs,"__esModule",{value:!0});xs.TRANSACTION_TYPE=xs.create=void 0;var Yv=sr();function Jv(t,e){return(0,Yv.create)(t,e)}xs.create=Jv;xs.TRANSACTION_TYPE=Symbol("transaction-argument-type")});var ka=K(de=>{"use strict";I();O();Object.defineProperty(de,"__esModule",{value:!0});de.Transactions=de.getTransactionType=de.TransactionType=de.PublishTransaction=de.MakeMoveVecTransaction=de.MergeCoinsTransaction=de.SplitCoinsTransaction=de.TransferObjectsTransaction=de.MoveCallTransaction=de.PureTransactionArgument=de.ObjectTransactionArgument=de.TransactionArgument=de.TransactionBlockInput=void 0;var Qv=tn(),fe=sr(),e5=rn(),ii=Na(),t5=t=>(0,fe.union)([(0,fe.object)({None:(0,fe.literal)(null)}),(0,fe.object)({Some:t})]);de.TransactionBlockInput=(0,fe.object)({kind:(0,fe.literal)("Input"),index:(0,fe.integer)(),value:(0,fe.optional)((0,fe.any)()),type:(0,fe.optional)((0,fe.union)([(0,fe.literal)("pure"),(0,fe.literal)("object")]))});var cu=[de.TransactionBlockInput,(0,fe.object)({kind:(0,fe.literal)("GasCoin")}),(0,fe.object)({kind:(0,fe.literal)("Result"),index:(0,fe.integer)()}),(0,fe.object)({kind:(0,fe.literal)("NestedResult"),index:(0,fe.integer)(),resultIndex:(0,fe.integer)()})];de.TransactionArgument=(0,fe.union)([...cu]);de.ObjectTransactionArgument=(0,fe.union)([...cu]);de.ObjectTransactionArgument[ii.TRANSACTION_TYPE]={kind:"object"};var r5=t=>{let e=(0,fe.union)([...cu]);return e[ii.TRANSACTION_TYPE]={kind:"pure",type:t},e};de.PureTransactionArgument=r5;de.MoveCallTransaction=(0,fe.object)({kind:(0,fe.literal)("MoveCall"),target:(0,fe.define)("target",(0,fe.string)().validator),typeArguments:(0,fe.array)((0,fe.string)()),arguments:(0,fe.array)(de.TransactionArgument)});de.TransferObjectsTransaction=(0,fe.object)({kind:(0,fe.literal)("TransferObjects"),objects:(0,fe.array)(de.ObjectTransactionArgument),address:(0,de.PureTransactionArgument)(Qv.BCS.ADDRESS)});de.SplitCoinsTransaction=(0,fe.object)({kind:(0,fe.literal)("SplitCoins"),coin:de.ObjectTransactionArgument,amounts:(0,fe.array)((0,de.PureTransactionArgument)("u64"))});de.MergeCoinsTransaction=(0,fe.object)({kind:(0,fe.literal)("MergeCoins"),destination:de.ObjectTransactionArgument,sources:(0,fe.array)(de.ObjectTransactionArgument)});de.MakeMoveVecTransaction=(0,fe.object)({kind:(0,fe.literal)("MakeMoveVec"),type:(0,fe.optional)(t5((0,fe.string)())),objects:(0,fe.array)(de.ObjectTransactionArgument)});de.PublishTransaction=(0,fe.object)({kind:(0,fe.literal)("Publish"),modules:(0,fe.array)((0,fe.array)((0,fe.integer)())),dependencies:(0,fe.array)(e5.ObjectId)});var Sb=[de.MoveCallTransaction,de.TransferObjectsTransaction,de.SplitCoinsTransaction,de.MergeCoinsTransaction,de.PublishTransaction,de.MakeMoveVecTransaction];de.TransactionType=(0,fe.union)([...Sb]);function n5(t){return(0,fe.assert)(t,de.TransactionType),Sb.find(e=>(0,fe.is)(t,e))}de.getTransactionType=n5;de.Transactions={MoveCall(t){return(0,ii.create)({kind:"MoveCall",target:t.target,arguments:t.arguments??[],typeArguments:t.typeArguments??[]},de.MoveCallTransaction)},TransferObjects(t,e){return(0,ii.create)({kind:"TransferObjects",objects:t,address:e},de.TransferObjectsTransaction)},SplitCoins(t,e){return(0,ii.create)({kind:"SplitCoins",coin:t,amounts:e},de.SplitCoinsTransaction)},MergeCoins(t,e){return(0,ii.create)({kind:"MergeCoins",destination:t,sources:e},de.MergeCoinsTransaction)},Publish(t,e){return(0,ii.create)({kind:"Publish",modules:t,dependencies:e},de.PublishTransaction)},MakeMoveVec({type:t,objects:e}){return(0,ii.create)({kind:"MakeMoveVec",type:t?{Some:t}:{None:null},objects:e},de.MakeMoveVecTransaction)}}});var Ra=K(ee=>{"use strict";I();O();Object.defineProperty(ee,"__esModule",{value:!0});ee.builder=ee.PROGRAMMABLE_CALL=ee.ARGUMENT=ee.TRANSACTION=ee.ENUM_KIND=ee.TRANSACTION_INNER=ee.PROGRAMMABLE_CALL_INNER=ee.PROGRAMMABLE_TX_BLOCK=ee.OBJECT_ARG=ee.TYPE_TAG=ee.CALL_ARG=ee.OPTION=ee.VECTOR=ee.ARGUMENT_INNER=void 0;var En=tn(),i5=tu(),s5=sn(),_b=au();ee.ARGUMENT_INNER="Argument";ee.VECTOR="vector";ee.OPTION="Option";ee.CALL_ARG="CallArg";ee.TYPE_TAG="TypeTag";ee.OBJECT_ARG="ObjectArg";ee.PROGRAMMABLE_TX_BLOCK="ProgrammableTransaction";ee.PROGRAMMABLE_CALL_INNER="ProgrammableMoveCall";ee.TRANSACTION_INNER="Transaction";ee.ENUM_KIND="EnumKind";ee.TRANSACTION=[ee.ENUM_KIND,ee.TRANSACTION_INNER];ee.ARGUMENT=[ee.ENUM_KIND,ee.ARGUMENT_INNER];ee.PROGRAMMABLE_CALL="SimpleProgrammableMoveCall";ee.builder=new En.BCS(i5.bcs).registerStructType(ee.PROGRAMMABLE_TX_BLOCK,{inputs:[ee.VECTOR,ee.CALL_ARG],transactions:[ee.VECTOR,ee.TRANSACTION]}).registerEnumType(ee.ARGUMENT_INNER,{GasCoin:null,Input:{index:En.BCS.U16},Result:{index:En.BCS.U16},NestedResult:{index:En.BCS.U16,resultIndex:En.BCS.U16}}).registerStructType(ee.PROGRAMMABLE_CALL_INNER,{package:En.BCS.ADDRESS,module:En.BCS.STRING,function:En.BCS.STRING,type_arguments:[ee.VECTOR,ee.TYPE_TAG],arguments:[ee.VECTOR,ee.ARGUMENT]}).registerEnumType(ee.TRANSACTION_INNER,{MoveCall:ee.PROGRAMMABLE_CALL,TransferObjects:{objects:[ee.VECTOR,ee.ARGUMENT],address:ee.ARGUMENT},SplitCoins:{coin:ee.ARGUMENT,amounts:[ee.VECTOR,ee.ARGUMENT]},MergeCoins:{destination:ee.ARGUMENT,sources:[ee.VECTOR,ee.ARGUMENT]},Publish:{modules:[ee.VECTOR,[ee.VECTOR,En.BCS.U8]],dependencies:[ee.VECTOR,En.BCS.ADDRESS]},MakeMoveVec:{type:[ee.OPTION,ee.TYPE_TAG],objects:[ee.VECTOR,ee.ARGUMENT]}});ee.builder.registerType([ee.ENUM_KIND,"T"],function(e,r,n,i){let a={[r.kind]:r},[c]=n;return this.getTypeInterface(c)._encodeRaw.call(this,e,a,n,i)},function(e,r,n){let[i]=r,s=this.getTypeInterface(i)._decodeRaw.call(this,e,r,n),a=Object.keys(s)[0];return{kind:a,...s[a]}},t=>{if(typeof t!="object"&&!("kind"in t))throw new Error(`EnumKind: Missing property "kind" in the input ${JSON.stringify(t)}`);return!0});ee.builder.registerType(ee.PROGRAMMABLE_CALL,function(e,r,n,i){let[s,a,c]=r.target.split("::"),d=r.typeArguments.map(h=>_b.TypeTagSerializer.parseFromStr(h,!0));return this.getTypeInterface(ee.PROGRAMMABLE_CALL_INNER)._encodeRaw.call(this,e,{package:(0,s5.normalizeSuiAddress)(s),module:a,function:c,type_arguments:d,arguments:r.arguments},n,i)},function(e,r,n){let i=ee.builder.getTypeInterface(ee.PROGRAMMABLE_CALL_INNER)._decodeRaw.call(this,e,r,n);return{target:[i.package,i.module,i.function].join("::"),arguments:i.arguments,typeArguments:i.type_arguments.map(_b.TypeTagSerializer.tagToString)}},t=>t.target.split("::").length===3)});var qa=K(Ht=>{"use strict";I();O();Object.defineProperty(Ht,"__esModule",{value:!0});Ht.isMutableSharedObjectInput=Ht.isSharedObjectInput=Ht.getSharedObjectInput=Ht.getIdFromCallArg=Ht.Inputs=Ht.BuilderCallArg=Ht.ObjectCallArg=Ht.PureCallArg=void 0;var wr=sr(),Eb=sn(),o5=Ra(),a5=(0,wr.union)([(0,wr.object)({ImmOrOwned:Eb.SuiObjectRef}),(0,wr.object)({Shared:(0,wr.object)({objectId:(0,wr.string)(),initialSharedVersion:(0,wr.union)([(0,wr.integer)(),(0,wr.string)()]),mutable:(0,wr.boolean)()})})]);Ht.PureCallArg=(0,wr.object)({Pure:(0,wr.array)((0,wr.integer)())});Ht.ObjectCallArg=(0,wr.object)({Object:a5});Ht.BuilderCallArg=(0,wr.union)([Ht.PureCallArg,Ht.ObjectCallArg]);Ht.Inputs={Pure(t,e){return{Pure:Array.from(t instanceof Uint8Array?t:o5.builder.ser(e,t).toBytes())}},ObjectRef(t){return{Object:{ImmOrOwned:t}}},SharedObjectRef(t){return{Object:{Shared:t}}}};function c5(t){return typeof t=="string"?(0,Eb.normalizeSuiAddress)(t):"ImmOrOwned"in t.Object?t.Object.ImmOrOwned.objectId:t.Object.Shared.objectId}Ht.getIdFromCallArg=c5;function fu(t){return typeof t=="object"&&"Object"in t&&"Shared"in t.Object?t.Object.Shared:void 0}Ht.getSharedObjectInput=fu;function f5(t){return!!fu(t)}Ht.isSharedObjectInput=f5;function u5(t){return fu(t)?.mutable??!1}Ht.isMutableSharedObjectInput=u5});var xb=K(Ca=>{"use strict";I();O();Object.defineProperty(Ca,"__esModule",{value:!0});Ca.hashTypedData=void 0;var d5=Gr();function l5(t,e){let r=Array.from(`${t}::`).map(i=>i.charCodeAt(0)),n=new Uint8Array(r.length+e.length);return n.set(r),n.set(e,r.length),d5.base.blake2b(n,{dkLen:32})}Ca.hashTypedData=l5});var La=K(Ar=>{"use strict";I();O();Object.defineProperty(Ar,"__esModule",{value:!0});Ar.TransactionBlockDataBuilder=Ar.SerializedTransactionDataBuilder=Ar.TransactionExpiration=void 0;var h5=tn(),Xe=sr(),b5=xb(),Ib=sn(),Da=Ra(),Ua=ka(),uu=qa(),so=Na();Ar.TransactionExpiration=(0,Xe.optional)((0,Xe.nullable)((0,Xe.union)([(0,Xe.object)({Epoch:(0,Xe.integer)()}),(0,Xe.object)({None:(0,Xe.union)([(0,Xe.literal)(!0),(0,Xe.literal)(null)])})])));var Ob=(0,Xe.string)(),Ab=(0,Xe.define)("StringEncodedBigint",t=>{if(!["string","number","bigint"].includes(typeof t))return!1;try{return BigInt(t),!0}catch{return!1}}),p5=(0,Xe.object)({budget:(0,Xe.optional)(Ab),price:(0,Xe.optional)(Ab),payment:(0,Xe.optional)((0,Xe.array)(Ib.SuiObjectRef)),owner:(0,Xe.optional)(Ob)});Ar.SerializedTransactionDataBuilder=(0,Xe.object)({version:(0,Xe.literal)(1),sender:(0,Xe.optional)(Ob),expiration:Ar.TransactionExpiration,gasConfig:p5,inputs:(0,Xe.array)(Ua.TransactionBlockInput),transactions:(0,Xe.array)(Ua.TransactionType)});function Mb(t){return(0,Ib.normalizeSuiAddress)(t).replace("0x","")}var Tb=128*1024,si=class{static fromKindBytes(e){let n=Da.builder.de("TransactionKind",e)?.ProgrammableTransaction;if(!n)throw new Error("Unable to deserialize from bytes.");let i=(0,so.create)({version:1,gasConfig:{},inputs:n.inputs.map((s,a)=>(0,so.create)({kind:"Input",value:s,index:a,type:(0,Xe.is)(s,uu.PureCallArg)?"pure":"object"},Ua.TransactionBlockInput)),transactions:n.transactions},Ar.SerializedTransactionDataBuilder);return si.restore(i)}static fromBytes(e){let n=Da.builder.de("TransactionData",e)?.V1,i=n?.kind?.ProgrammableTransaction;if(!n||!i)throw new Error("Unable to deserialize from bytes.");let s=(0,so.create)({version:1,sender:n.sender,expiration:n.expiration,gasConfig:n.gasData,inputs:i.inputs.map((a,c)=>(0,so.create)({kind:"Input",value:a,index:c,type:(0,Xe.is)(a,uu.PureCallArg)?"pure":"object"},Ua.TransactionBlockInput)),transactions:i.transactions},Ar.SerializedTransactionDataBuilder);return si.restore(s)}static restore(e){(0,Xe.assert)(e,Ar.SerializedTransactionDataBuilder);let r=new si;return Object.assign(r,e),r}static getDigestFromBytes(e){let r=(0,b5.hashTypedData)("TransactionData",e);return(0,h5.toB58)(r)}constructor(e){this.version=1,this.sender=e?.sender,this.expiration=e?.expiration,this.gasConfig=e?.gasConfig??{},this.inputs=e?.inputs??[],this.transactions=e?.transactions??[]}build({overrides:e,onlyTransactionKind:r}={}){let n=this.inputs.map(h=>((0,Xe.assert)(h.value,uu.BuilderCallArg),h.value)),i={ProgrammableTransaction:{inputs:n,transactions:this.transactions}};if(r)return Da.builder.ser("TransactionKind",i,{maxSize:Tb}).toBytes();let s=e?.expiration??this.expiration,a=e?.sender??this.sender,c={...this.gasConfig,...e?.gasConfig};if(!a)throw new Error("Missing transaction sender");if(!c.budget)throw new Error("Missing gas budget");if(!c.payment)throw new Error("Missing gas payment");if(!c.price)throw new Error("Missing gas price");let d={sender:Mb(a),expiration:s||{None:!0},gasData:{payment:c.payment,owner:Mb(this.gasConfig.owner??a),price:BigInt(c.price),budget:BigInt(c.budget)},kind:{ProgrammableTransaction:{inputs:n,transactions:this.transactions}}};return Da.builder.ser("TransactionData",{V1:d},{maxSize:Tb}).toBytes()}getDigest(){let e=this.build({onlyTransactionKind:!1});return si.getDigestFromBytes(e)}snapshot(){return(0,so.create)(this,Ar.SerializedTransactionDataBuilder)}};Ar.TransactionBlockDataBuilder=si});var Nb=K(ai=>{"use strict";I();O();var Ha=ai&&ai.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},ft=ai&&ai.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},As,it,lu,hu;Object.defineProperty(ai,"__esModule",{value:!0});ai.TransactionBlock=void 0;var Bb=tn(),bu=sr(),g5=sn(),Bn=ka(),oi=qa(),Ka=La(),du=Na();function y5(t){let e={kind:"Result",index:t},r=[],n=i=>r[i]??(r[i]={kind:"NestedResult",index:t,resultIndex:i});return new Proxy(e,{set(){throw new Error("The transaction result is a proxy, and does not support setting properties directly")},get(i,s){if(s in i)return Reflect.get(i,s);if(s===Symbol.iterator)return function*(){let c=0;for(;;)yield n(c),c++};if(typeof s=="symbol")return;let a=parseInt(s,10);if(!(Number.isNaN(a)||a<0))return n(a)}})}var Pb=Symbol.for("../transaction"),jb=256,Ms=class{static is(e){return!!e&&typeof e=="object"&&e[Pb]===!0}static fromKind(e){let r=new Ms;return Ha(r,it,Ka.TransactionBlockDataBuilder.fromKindBytes(typeof e=="string"?(0,Bb.fromB64)(e):e),"f"),r}static from(e){let r=new Ms;return typeof e!="string"||!e.startsWith("{")?Ha(r,it,Ka.TransactionBlockDataBuilder.fromBytes(typeof e=="string"?(0,Bb.fromB64)(e):e),"f"):Ha(r,it,Ka.TransactionBlockDataBuilder.restore(JSON.parse(e)),"f"),r}static get Transactions(){return Bn.Transactions}static get Inputs(){return oi.Inputs}setSender(e){ft(this,it,"f").sender=e}setSenderIfNotSet(e){ft(this,it,"f").sender||(ft(this,it,"f").sender=e)}setExpiration(e){ft(this,it,"f").expiration=e}setGasPrice(e){ft(this,it,"f").gasConfig.price=String(e)}setGasBudget(e){ft(this,it,"f").gasConfig.budget=String(e)}setGasOwner(e){ft(this,it,"f").gasConfig.owner=e}setGasPayment(e){if(e.length>=jb)throw new Error(`Payment objects exceed maximum amount ${jb}`);ft(this,it,"f").gasConfig.payment=e.map(r=>(0,bu.mask)(r,g5.SuiObjectRef))}get blockData(){return ft(this,it,"f").snapshot()}get[(it=new WeakMap,As=new WeakSet,Pb)](){return!0}constructor(e){As.add(this),it.set(this,void 0),Ha(this,it,new Ka.TransactionBlockDataBuilder(e?ft(e,it,"f"):void 0),"f")}get gas(){return{kind:"GasCoin"}}object(e){let r=(0,oi.getIdFromCallArg)(e);return ft(this,it,"f").inputs.find(i=>i.type==="object"&&r===(0,oi.getIdFromCallArg)(i.value))??ft(this,As,"m",lu).call(this,"object",e)}pure(e,r){return ft(this,As,"m",lu).call(this,"pure",e instanceof Uint8Array?oi.Inputs.Pure(e):r?oi.Inputs.Pure(e,r):e)}add(e){let r=ft(this,it,"f").transactions.push(e);return y5(r-1)}splitCoins(...e){return this.add(Bn.Transactions.SplitCoins(...e))}mergeCoins(...e){return this.add(Bn.Transactions.MergeCoins(...e))}publish(...e){return this.add(Bn.Transactions.Publish(...e))}moveCall(...e){return this.add(Bn.Transactions.MoveCall(...e))}transferObjects(...e){return this.add(Bn.Transactions.TransferObjects(...e))}makeMoveVec(...e){return this.add(Bn.Transactions.MakeMoveVec(...e))}serialize(){return JSON.stringify(ft(this,it,"f").snapshot())}async build({onlyTransactionKind:e}={}){return await ft(this,As,"m",hu).call(this,{onlyTransactionKind:e}),ft(this,it,"f").build({onlyTransactionKind:e})}async getDigest({}={}){return await ft(this,As,"m",hu).call(this,{}),ft(this,it,"f").getDigest()}};ai.TransactionBlock=Ms;lu=function(e,r){let n=ft(this,it,"f").inputs.length,i=(0,du.create)({kind:"Input",value:typeof r=="bigint"?String(r):r,index:n,type:e},Bn.TransactionBlockInput);return ft(this,it,"f").inputs.push(i),i},hu=async function({onlyTransactionKind:e}){if(!e&&!ft(this,it,"f").sender)throw new Error("Missing transaction sender");let{inputs:r,transactions:n}=ft(this,it,"f"),i=[],s=[];if(n.forEach(a=>{if(a.kind==="MoveCall"){a.arguments.some(h=>h.kind==="Input"&&!(0,bu.is)(r[h.index].value,oi.BuilderCallArg))&&i.push(a);return}let c=(0,Bn.getTransactionType)(a);!c.schema||Object.entries(a).forEach(([d,h])=>{if(d==="kind")return;let y=c.schema[d],p=y.type==="array",w=p?y.schema[du.TRANSACTION_TYPE]:y[du.TRANSACTION_TYPE];if(!w)return;let v=_=>{let m=r[_];if(!m)throw new Error(`Missing input ${h.index}`);if(!(0,bu.is)(m.value,oi.BuilderCallArg))if(w.kind==="object"&&typeof m.value=="string")s.push({id:m.value,input:m});else if(w.kind==="pure")m.value=oi.Inputs.Pure(m.value,w.type);else throw new Error("Unexpected input format.")};if(p)h.forEach(_=>{_.kind==="Input"&&v(_.index)});else{if(h.kind!=="Input")return;v(h.index)}})}),i.length)throw new Error("No provider passed to Transaction#build, but transaction data has move modules to resolve.");if(s.length)throw new Error("No provider passed to Transaction#build, but transaction data has objects to resolve.")}});var kb=K(Ts=>{"use strict";I();O();Object.defineProperty(Ts,"__esModule",{value:!0});Ts.getPureSerializationType=Ts.isTxContext=void 0;var ci=sn(),m5="ascii",v5="String",w5="string",S5="String",_5="option",E5="Option",x5={address:ci.SUI_FRAMEWORK_ADDRESS,module:ci.OBJECT_MODULE_NAME,name:ci.ID_STRUCT_NAME},A5={address:ci.MOVE_STDLIB_ADDRESS,module:m5,name:v5},M5={address:ci.MOVE_STDLIB_ADDRESS,module:w5,name:S5},T5={address:ci.MOVE_STDLIB_ADDRESS,module:_5,name:E5},Fa=(t,e)=>t.address===e.address&&t.module===e.module&&t.name===e.name;function I5(t){let e=(0,ci.extractStructTag)(t)?.Struct;return e?.address==="0x2"&&e?.module==="tx_context"&&e?.name==="TxContext"}Ts.isTxContext=I5;function pu(t,e){if(!(typeof e>"u")&&typeof e!==t)throw new Error(`Expect ${e} to be ${t}, received ${typeof e}`)}var O5=["Address","Bool","U8","U16","U32","U64","U128","U256"];function gu(t,e){if(typeof t=="string"&&O5.includes(t)){if(t in["U8","U16","U32","U64","U128","U256"])pu("number",e);else if(t==="Bool")pu("boolean",e);else if(t==="Address"&&(pu("string",e),e&&!(0,ci.isValidSuiAddress)(e)))throw new Error("Invalid Sui Address");return t.toLowerCase()}else if(typeof t=="string")throw new Error(`Unknown pure normalized type ${JSON.stringify(t,null,2)}`);if("Vector"in t){if((e===void 0||typeof e=="string")&&t.Vector==="U8")return"string";if(e!==void 0&&!Array.isArray(e))throw new Error(`Expect ${e} to be a array, received ${typeof e}`);let r=gu(t.Vector,e?e[0]:void 0);return r===void 0?void 0:`vector<${r}>`}if("Struct"in t){if(Fa(t.Struct,A5))return"string";if(Fa(t.Struct,M5))return"utf8string";if(Fa(t.Struct,x5))return"address";if(Fa(t.Struct,T5)){let r={Vector:t.Struct.typeArguments[0]};return gu(r,e)}}}Ts.getPureSerializationType=gu});var yu=K(Mr=>{"use strict";I();O();var B5=Mr&&Mr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),oo=Mr&&Mr.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&B5(e,t,r)};Object.defineProperty(Mr,"__esModule",{value:!0});Mr.TransactionBlockDataBuilder=void 0;oo(Nb(),Mr);var P5=La();Object.defineProperty(Mr,"TransactionBlockDataBuilder",{enumerable:!0,get:function(){return P5.TransactionBlockDataBuilder}});oo(ka(),Mr);oo(qa(),Mr);oo(Ra(),Mr);oo(kb(),Mr)});var mu=K(Tr=>{"use strict";I();O();Object.defineProperty(Tr,"__esModule",{value:!0});Tr.messageWithIntent=Tr.IntentScope=Tr.IntentVersion=Tr.AppId=void 0;var Rb;(function(t){t[t.Sui=0]="Sui"})(Rb=Tr.AppId||(Tr.AppId={}));var qb;(function(t){t[t.V0=0]="V0"})(qb=Tr.IntentVersion||(Tr.IntentVersion={}));var j5;(function(t){t[t.TransactionData=0]="TransactionData",t[t.TransactionEffects=1]="TransactionEffects",t[t.CheckpointSummary=2]="CheckpointSummary",t[t.PersonalMessage=3]="PersonalMessage"})(j5=Tr.IntentScope||(Tr.IntentScope={}));function N5(t){return[t,qb.V0,Rb.Sui]}function k5(t,e){let r=N5(t),n=new Uint8Array(r.length+e.length);return n.set(r),n.set(e,r.length),n}Tr.messageWithIntent=k5});var wu=K(Va=>{"use strict";I();O();Object.defineProperty(Va,"__esModule",{value:!0});Va.SignerWithProvider=void 0;var R5=tn(),q5=yu(),C5=sn(),za=mu(),D5=La(),vu=class{constructor(){}async signMessage(e){let r=C5.bcs.ser("vector<u8>",e.message).toBytes();return await this.signData((0,za.messageWithIntent)(za.IntentScope.PersonalMessage,r))}async signTransactionBlock(e){let r;if(q5.TransactionBlock.is(e.transactionBlock))e.transactionBlock.setSenderIfNotSet(await this.getAddress()),r=await e.transactionBlock.build({});else if(e.transactionBlock instanceof Uint8Array)r=e.transactionBlock;else throw new Error("Unknown transaction format");let n=(0,za.messageWithIntent)(za.IntentScope.TransactionData,r),i=await this.signData(n);return{transactionBlockBytes:(0,R5.toB64)(r),hash:D5.TransactionBlockDataBuilder.getDigestFromBytes(r),signature:i}}};Va.SignerWithProvider=vu});var _u=K($a=>{"use strict";I();O();Object.defineProperty($a,"__esModule",{value:!0});$a.RawSigner=void 0;var U5=wa(),L5=wu(),H5=Gr(),Su=class extends L5.SignerWithProvider{constructor(e){super(),this.keypair=e}async getAddress(){return this.keypair.getPublicKey().toSuiAddress()}async signData(e){let r=this.keypair.getPublicKey(),n=H5.base.blake2b(e,{dkLen:32}),i=this.keypair.signData(n),s=this.keypair.getKeyScheme();return(0,U5.toSerializedSignature)({signatureScheme:s,signature:i,pubKey:r})}};$a.RawSigner=Su});var Db=K(Cb=>{"use strict";I();O();Object.defineProperty(Cb,"__esModule",{value:!0})});var Lb=K(Is=>{"use strict";I();O();Object.defineProperty(Is,"__esModule",{value:!0});Is.formatDigest=Is.formatAddress=void 0;var Ub="\u2026";function K5(t){let e=t.startsWith("0x")?2:0;return`0x${t.slice(e,e+4)}${Ub}${t.slice(-4)}`}Is.formatAddress=K5;function F5(t){return`${t.slice(0,10)}${Ub}`}Is.formatDigest=F5});var Hb=K(Ni=>{"use strict";I();O();var z5=Ni&&Ni.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),V5=Ni&&Ni.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&z5(e,t,r)};Object.defineProperty(Ni,"__esModule",{value:!0});V5(eu(),Ni)});var Eu=K(ki=>{"use strict";I();O();Object.defineProperty(ki,"__esModule",{value:!0});ki.isHexStr=ki.SignType=void 0;var $5;(function(t){t[t.Secp256k1=1]="Secp256k1",t[t.ECDSA_P256=2]="ECDSA_P256",t[t.ED25519=3]="ED25519",t[t.StarknetSignType=4]="StarknetSignType",t[t.TezosSignType=5]="TezosSignType"})($5=ki.SignType||(ki.SignType={}));function G5(t){return!(t.length<=1||(t.startsWith("0x")||(t="0x"+t),!t.match(/^0x[0-9A-Fa-f]*$/)))}ki.isHexStr=G5});var Kb=K(Kr=>{"use strict";I();O();Object.defineProperty(Kr,"__esModule",{value:!0});Kr.CoinCurveMap=Kr.MultiAddressCoins=Kr.segwitType=Kr.Currency=void 0;var Ee;(function(t){t[t.NULL=-1]="NULL",t[t.BTC=0]="BTC",t[t.TBTC=1]="TBTC",t[t.ETH=60]="ETH",t[t.LTC=2]="LTC",t[t.DOGE=3]="DOGE",t[t.BCH=145]="BCH",t[t.BSV=236]="BSV",t[t.TRX=195]="TRX",t[t.SOL=501]="SOL",t[t.APTOS=637]="APTOS",t[t.OMNI_USDT=20001]="OMNI_USDT",t[t.OMNI_USDT_TEST=20002]="OMNI_USDT_TEST",t[t.SUI=784]="SUI",t[t.ATOM=118]="ATOM",t[t.OSMO=1e3]="OSMO",t[t.EVMOS=1001]="EVMOS",t[t.AXL=1002]="AXL",t[t.CRO=1003]="CRO",t[t.Iris=1004]="Iris",t[t.Juno=1005]="Juno",t[t.Kava=1006]="Kava",t[t.Kujira=1007]="Kujira",t[t.SCRT=1008]="SCRT",t[t.Stargaze=1009]="Stargaze",t[t.Terra=1010]="Terra",t[t.ZKSPACE=1011]="ZKSPACE",t[t.ZKSYNC=804]="ZKSYNC",t[t.Stx=5757]="Stx",t[t.SEI=2837]="SEI",t[t.WAX=14001]="WAX",t[t.Starknet=9004]="Starknet",t[t.ADA=1815]="ADA",t[t.INJ=2892]="INJ",t[t.Celestia=2854]="Celestia",t[t.DYDX=2897]="DYDX",t[t.Kaspa=111111]="Kaspa",t[t.TON=607]="TON",t[t.NostrAssets=1237]="NostrAssets",t[t.Near=397]="Near",t[t.Kaia=8217]="Kaia",t[t.PI=70000074]="PI"})(Ee=Kr.Currency||(Kr.Currency={}));var W5;(function(t){t[t.SEGWIT_NESTED=1]="SEGWIT_NESTED",t[t.SEGWIT_NESTED_49=2]="SEGWIT_NESTED_49",t[t.SEGWIT_NATIVE=3]="SEGWIT_NATIVE",t[t.SEGWIT_TAPROOT=4]="SEGWIT_TAPROOT"})(W5=Kr.segwitType||(Kr.segwitType={}));Kr.MultiAddressCoins=[Ee.BTC,Ee.TBTC,Ee.LTC,Ee.DOGE,Ee.BSV,Ee.OMNI_USDT,Ee.OMNI_USDT_TEST];var Ye="secp256k1",ao="ed25519";Kr.CoinCurveMap=new Map([[Ee.BTC,Ye],[Ee.TBTC,Ye],[Ee.ETH,Ye],[Ee.LTC,Ye],[Ee.DOGE,Ye],[Ee.BCH,Ye],[Ee.BSV,Ye],[Ee.TRX,Ye],[Ee.OMNI_USDT,Ye],[Ee.OMNI_USDT_TEST,Ye],[Ee.ATOM,Ye],[Ee.OSMO,Ye],[Ee.EVMOS,Ye],[Ee.AXL,Ye],[Ee.CRO,Ye],[Ee.Iris,Ye],[Ee.Juno,Ye],[Ee.Kava,Ye],[Ee.Kujira,Ye],[Ee.SCRT,Ye],[Ee.Stargaze,Ye],[Ee.Terra,Ye],[Ee.SEI,Ye],[Ee.Celestia,Ye],[Ee.DYDX,Ye],[Ee.Kaia,Ye],[Ee.SOL,ao],[Ee.APTOS,ao],[Ee.SUI,ao],[Ee.TON,ao],[Ee.PI,ao]])});var xu=K(re=>{"use strict";I();O();Object.defineProperty(re,"__esModule",{value:!0});re.SignCommonMsgError=re.EstimateFeeError=re.validSignedTransactionError=re.GetPayLoadError=re.HardwareDerivePubKeyError=re.CalcTxHashError=re.SignMsgStep3Error=re.SignMsgSetupError=re.Ed25519Step3Error=re.Ed25519Step2Error=re.Ed25519Step1Error=re.Ed25519SetupError=re.EcdsaStep3Error=re.EcdsaStep2Error=re.EcdsaStep1Error=re.EcdsaSetupError=re.MPCShakeHandsError=re.MPCStepError=re.MPCAesKeyMissError=re.GetHardWareMessageHashError=re.GetHardwareSignedTransactionError=re.GetHardwareRawTransactionError=re.GetMpcTransactionError=re.GetMpcRawTransactionError=re.DerivePathError=re.GenMnemonicError=re.GenPrivateKeyError=re.UnsupportedCoinError=re.SignMsgError=re.SignTxError=re.ValidAddressError=re.NewAddressError=re.NotImplementedError=void 0;re.NotImplementedError="no implementation method";re.NewAddressError="generate address error";re.ValidAddressError="valid address error";re.SignTxError="sign tx error";re.SignMsgError="sign message error";re.UnsupportedCoinError="unsupported currency";re.GenPrivateKeyError="generate private key error";re.GenMnemonicError="generate mnemonic error";re.DerivePathError="derive hdPath error";re.GetMpcRawTransactionError="get mpc raw transaction error";re.GetMpcTransactionError="get mpc transaction error";re.GetHardwareRawTransactionError="get hardware raw transaction error";re.GetHardwareSignedTransactionError="get hardware signed transaction error";re.GetHardWareMessageHashError="get hardware message hash error";re.MPCAesKeyMissError="mpc get aes key error";re.MPCStepError="mpc step error";re.MPCShakeHandsError="mpc shake hands error";re.EcdsaSetupError="ecdsa setup error";re.EcdsaStep1Error="ecdsa step1 error";re.EcdsaStep2Error="ecdsa step2 error";re.EcdsaStep3Error="ecdsa step3 error";re.Ed25519SetupError="ed25519 setup error";re.Ed25519Step1Error="ed25519 step1 error";re.Ed25519Step2Error="ed25519 step2 error";re.Ed25519Step3Error="ed25519 step3 error";re.SignMsgSetupError="sign message setup error";re.SignMsgStep3Error="sign message step3 error";re.CalcTxHashError="calculate tx hash error";re.HardwareDerivePubKeyError="derive sub pub key error";re.GetPayLoadError="get payload error";re.validSignedTransactionError="valid signed transaction error";re.EstimateFeeError="estimate fee error";re.SignCommonMsgError="sign common msg error"});var Fb=K(Sr=>{"use strict";I();O();Object.defineProperty(Sr,"__esModule",{value:!0});Sr.jsonStringifyUniform=Sr.cloneObject=Sr.assertBufferLength=Sr.convert2BigNumber=Sr.convert2Number=Sr.buildCommonSignMsg=void 0;var Ga=Gr();function Z5(t,e){return`OKX Wallet Sign In
publicKey: ${t}
walletId: ${e}
host: api.wallet.okx
OKX Wallet Sign In`}Sr.buildCommonSignMsg=Z5;function X5(t){if(t!=null)return typeof t=="string"?parseInt(t):t}Sr.convert2Number=X5;function Y5(t){if(t!=null)return Ga.BigNumber.isBigNumber(t)?t:new Ga.BigNumber(t)}Sr.convert2BigNumber=Y5;function J5(t,e){if(t.length!=e)throw Error("buffer length is illegal")}Sr.assertBufferLength=J5;function Q5(t){return JSON.parse(JSON.stringify(t))}Sr.cloneObject=Q5;function e8(t){return JSON.stringify(t,(e,r)=>r&&(r.type==="Buffer"||r instanceof Uint8Array?Ga.base.toHex(r):typeof r=="bigint"?r.toString():r))}Sr.jsonStringifyUniform=e8});var Au=K(Ri=>{"use strict";I();O();var t8=Ri&&Ri.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),r8=Ri&&Ri.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&t8(e,t,r)};Object.defineProperty(Ri,"__esModule",{value:!0});r8(Fb(),Ri)});var Wb=K(at=>{"use strict";I();O();Object.defineProperty(at,"__esModule",{value:!0});at.SimpleWallet=at.BaseWallet=at.ecdsaSign=at.fromSigned=at.padWithZeroes=at.toUnsigned=at.intToHex=at.makeSignature=at.secp256k1SignTest=void 0;var Kt=xu(),qi=Eu(),Ft=Gr(),n8=Au();function zb(t){let e=Ft.base.sha256("secp256k1-test"),r=Ft.signUtil.secp256k1.publicKeyCreate(t,!1),{signature:n,recovery:i}=Ft.signUtil.secp256k1.sign(T.Buffer.from(e),t);return Ft.signUtil.secp256k1.verify(e,n,i,r)}at.secp256k1SignTest=zb;function Vb(t,e,r){let n=(0,at.fromSigned)(e),i=(0,at.fromSigned)(r),s=t,a=Mu((0,at.toUnsigned)(n).toString("hex"),64),c=Mu((0,at.toUnsigned)(i).toString("hex"),64);return Ft.base.stripHexPrefix($b(s)).concat(a,c)}at.makeSignature=Vb;function $b(t){return`0x${t.toString(16)}`}at.intToHex=$b;var i8=function(t){return T.Buffer.from(t.toTwos(256).toArray())};at.toUnsigned=i8;function Mu(t,e){if(t!==""&&!/^[a-f0-9]+$/iu.test(t))throw new Error(`Expected an unprefixed hex string. Received: ${t}`);if(e<0)throw new Error(`Expected a non-negative integer target length. Received: ${e}`);return String.prototype.padStart.call(t,e,"0")}at.padWithZeroes=Mu;var s8=function(t){return new Ft.BN(t).fromTwos(256)};at.fromSigned=s8;function Gb(t,e,r){let{signature:n,recovery:i}=Ft.signUtil.secp256k1.sign(t,e),s=T.Buffer.from(n.slice(0,32)),a=T.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:s,s:a}}at.ecdsaSign=Gb;var Wa=class{getRandomPrivateKey(){try{for(;;){let e=Ft.base.randomBytes(32);if(zb(e))return Promise.resolve(Ft.base.toHex(e,!0))}}catch{}return Promise.reject(Kt.GenPrivateKeyError)}getDerivedPrivateKey(e){return Ft.bip39.mnemonicToSeed(e.mnemonic).then(r=>{let n=Ft.bip32.fromSeed(r).derivePath(e.hdPath);if(n.privateKey){let i=Ft.base.toHex(n.privateKey);return Promise.resolve("0x"+i)}else return Promise.reject(Kt.GenPrivateKeyError)}).catch(r=>Promise.reject(Kt.GenPrivateKeyError))}getDerivedPath(e){return Promise.reject(Kt.NotImplementedError)}validPrivateKey(e){return Promise.reject(Kt.NotImplementedError)}signMessage(e){return Promise.reject(Kt.NotImplementedError)}async signCommonMsg(e){e.signType||(e.signType=qi.SignType.Secp256k1);let r;if(e.message.text)r=e.message.text;else{let c;if(e.publicKey?c=e.publicKey:c=(await this.getNewAddress({privateKey:e.privateKey,addressType:e.addressType,hrp:e.hrp,version:e.version})).publicKey,e.chainName&&e.chainName=="sui"?(0,qi.isHexStr)(c)&&c.startsWith("0x")&&(c=c.substring(2)):c.startsWith("0x")&&(c=c.substring(2)),!e.message.walletId)return Promise.reject("invalid walletId");r=(0,n8.buildCommonSignMsg)(c,e.message.walletId)}let n=Ft.base.magicHash(r),i=e.privateKeyHex?e.privateKeyHex:e.privateKey,s=Ft.base.fromHex(i);var a;switch(e.signType){case qi.SignType.Secp256k1:let{v:c,r:d,s:h}=Gb(T.Buffer.from(n),s);return Promise.resolve(Vb(c,d,h));case qi.SignType.ECDSA_P256:return a=Ft.signUtil.p256.sign(T.Buffer.from(n),s).signature,Promise.resolve(Ft.base.toHex(a));case qi.SignType.ED25519:return a=Ft.signUtil.ed25519.sign(n,s),Promise.resolve(Ft.base.toHex(a));case qi.SignType.StarknetSignType:return a=Ft.signUtil.schnorr.stark.sign(n,s).toCompactRawBytes(),Promise.resolve(Ft.base.toHex(a));case qi.SignType.TezosSignType:return Promise.reject("not support")}}verifyMessage(e){return Promise.reject(Kt.NotImplementedError)}ecRecover(e,r){return Promise.reject(Kt.NotImplementedError)}getAddressByPublicKey(e){return Promise.reject(Kt.NotImplementedError)}getMPCRawTransaction(e){return Promise.reject(Kt.NotImplementedError)}getMPCTransaction(e){return Promise.reject(Kt.NotImplementedError)}getMPCRawMessage(e){return Promise.reject(Kt.NotImplementedError)}getMPCSignedMessage(e){return Promise.reject(Kt.NotImplementedError)}getHardWareRawTransaction(e){return Promise.reject(Kt.NotImplementedError)}getHardWareSignedTransaction(e){return Promise.reject(Kt.NotImplementedError)}getHardWareMessageHash(e){return Promise.reject(Kt.NotImplementedError)}calcTxHash(e){return Promise.reject(Kt.NotImplementedError)}getRawTransaction(e){return Promise.reject(Kt.NotImplementedError)}validSignedTransaction(e){return Promise.reject(Kt.NotImplementedError)}estimateFee(e){return Promise.reject(Kt.NotImplementedError)}};at.BaseWallet=Wa;var Tu=class extends Wa{mockData(e,r){this.mockAddress=e,this.mockPublicKey=r}getNewAddress(e){return Promise.resolve({address:this.mockAddress,publicKey:this.mockPublicKey})}validAddress(e){throw new Error("Method not implemented.")}signTransaction(e){throw new Error("Method not implemented.")}};at.SimpleWallet=Tu});var Zb=K(on=>{"use strict";I();O();var o8=on&&on.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),co=on&&on.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&o8(e,t,r)};Object.defineProperty(on,"__esModule",{value:!0});co(Eu(),on);co(Kb(),on);co(xu(),on);co(Wb(),on);co(Au(),on)});var Ou=K(Os=>{"use strict";I();O();Object.defineProperty(Os,"__esModule",{value:!0});Os.SuiWallet=Os.SUI_PRIVATE_KEY_PREFIX=void 0;var an=Zb(),Ci=Gr(),_r=Xb();Os.SUI_PRIVATE_KEY_PREFIX="suiprivkey";var Iu=class extends an.BaseWallet{async getDerivedPath(e){return`m/44'/784'/0'/0'/${e.index}'`}async getRandomPrivateKey(){try{let e=Ci.signUtil.ed25519.ed25519_getRandomPrivateKey(!1,"hex");return Promise.resolve((0,_r.encodeSuiPrivateKey)(e))}catch{return Promise.reject(an.GenPrivateKeyError)}}async getDerivedPrivateKey(e){try{let r=await Ci.signUtil.ed25519.ed25519_getDerivedPrivateKey(e.mnemonic,e.hdPath,!1,"hex");return Promise.resolve((0,_r.encodeSuiPrivateKey)(r))}catch{return Promise.reject(an.GenPrivateKeyError)}}getNewAddress(e){try{let r=(0,_r.getAddressFromPrivate)((0,_r.tryDecodeSuiPrivateKey)(e.privateKey)),n={address:r.address,publicKey:r.publicKey};return Promise.resolve(n)}catch{return Promise.reject(an.NewAddressError)}}async validPrivateKey(e){let r=!0;try{(0,_r.tryDecodeSuiPrivateKey)(e.privateKey)}catch{r=!1}let n={isValid:r,privateKey:e.privateKey};return Promise.resolve(n)}async signCommonMsg(e){let r=(0,_r.tryDecodeSuiPrivateKey)(e.privateKey);return super.signCommonMsg({privateKey:e.privateKey,privateKeyHex:r,message:e.message,signType:an.SignType.ED25519,chainName:"sui"})}async signMessage(e){try{if(!(e.data instanceof Uint8Array))return Promise.reject(an.SignMsgError);let r=e.data,n=_r.Ed25519Keypair.fromSeed(Ci.base.fromHex((0,_r.tryDecodeSuiPrivateKey)(e.privateKey))),i=new _r.RawSigner(n);return Promise.resolve(i.signMessage({message:r}))}catch{return Promise.reject(an.SignTxError)}}signTransaction(e){try{let r=e.data,n=_r.Ed25519Keypair.fromSeed(Ci.base.fromHex((0,_r.tryDecodeSuiPrivateKey)(e.privateKey))),i=new _r.RawSigner(n);if(r.type=="raw"){let s=r.data,a=Ci.base.fromBase64(s),c=i.signTransactionBlock({transactionBlock:a});return Promise.resolve(c)}else if(r.type=="paySUI"){let s=new _r.TransactionBlock,a=r.data;return a.inputCoins==null||a.inputCoins.length==0?Promise.reject(an.SignTxError):(s.setGasPrice(BigInt(a.gasPrice)),s.setGasBudget(BigInt(a.gasBudget)),a.epoch&&s.setExpiration({Epoch:a.epoch}),s.setGasPayment(a.inputCoins),i.getAddress().then(c=>{s.setSender(c);let d=s.splitCoins(s.gas,[s.pure(BigInt(a.amount))]);return s.transferObjects([d],s.pure(a.recipient)),s.build().then(h=>{let y=i.signTransactionBlock({transactionBlock:h});return Promise.resolve(y)}).catch(h=>Promise.reject(h))}).catch(c=>Promise.reject(c)))}return Promise.reject(an.SignTxError)}catch{return Promise.reject(an.SignTxError)}}validAddress(e){let r;try{r=Ci.base.fromHex(e.address).length==32}catch{r=!1}let n={isValid:r,address:e.address};return Promise.resolve(n)}async calcTxHash(e){try{let r=_r.TransactionBlockDataBuilder.getDigestFromBytes(Ci.base.fromBase64(e.data));return Promise.resolve(r)}catch{return Promise.reject(an.CalcTxHashError)}}};Os.SuiWallet=Iu});var Xb=K(_e=>{I();O();var a8=_e&&_e.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),tr=_e&&_e.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&a8(e,t,r)};Object.defineProperty(_e,"__esModule",{value:!0});_e.tryDecodeSuiPrivateKey=_e.encodeSuiPrivateKey=_e.getAddressFromPublic=_e.getAddressFromPrivate=_e.assert=_e.is=_e.toB64=_e.fromB64=void 0;var c8=su();tr(su(),_e);tr(ou(),_e);tr(gs(),_e);tr($f(),_e);tr(wa(),_e);tr(au(),_e);tr(wb(),_e);tr(_u(),_e);tr(Db(),_e);tr(sn(),_e);tr(Lb(),_e);tr(mu(),_e);tr(Hb(),_e);tr(yu(),_e);var Yb=tn();Object.defineProperty(_e,"fromB64",{enumerable:!0,get:function(){return Yb.fromB64}});Object.defineProperty(_e,"toB64",{enumerable:!0,get:function(){return Yb.toB64}});var Jb=sr();Object.defineProperty(_e,"is",{enumerable:!0,get:function(){return Jb.is}});Object.defineProperty(_e,"assert",{enumerable:!0,get:function(){return Jb.assert}});var Fr=Gr(),f8=gs(),Za=ou(),fo=Ou();tr(_u(),_e);tr(wu(),_e);tr(sn(),_e);tr(Ou(),_e);function u8(t){if(!Fr.base.validateHexString(t))throw new Error("invalid key");let e=Fr.base.fromHex(t.toLowerCase()),r=c8.Ed25519Keypair.fromSeed(e);return{address:r.getPublicKey().toSuiAddress(),publicKey:Fr.base.toBase64(r.getPublicKey().toBytes())}}_e.getAddressFromPrivate=u8;function d8(t){let e=Fr.base.fromBase64(t);return new f8.Ed25519PublicKey(e).toSuiAddress()}_e.getAddressFromPublic=d8;function l8(t){if(t==null||null||t.length==0)throw new Error("Invalid bytes length");if(t.startsWith(fo.SUI_PRIVATE_KEY_PREFIX)){let[n,i]=Fr.base.fromBech32(t);if(n!==fo.SUI_PRIVATE_KEY_PREFIX)throw new Error("invalid private key prefix");if(i[0]!=0)throw new Error("invalid private key prefix");if(i.length!==Za.PRIVATE_KEY_SIZE+1)throw new Error("invalid key");return t}if(!Fr.base.validateHexString(t))throw new Error("invalid key");let e=Fr.base.fromHex(t.toLowerCase());if(e.length!==Za.PRIVATE_KEY_SIZE)throw new Error("invalid key");let r=new Uint8Array(e.length+1);return r.set([0]),r.set(e,1),Fr.base.toBech32(fo.SUI_PRIVATE_KEY_PREFIX,r)}_e.encodeSuiPrivateKey=l8;function h8(t){if(t==null||null||t.length==0)throw new Error("invalid private key prefix");if(!t.startsWith(fo.SUI_PRIVATE_KEY_PREFIX)){if(!Fr.base.validateHexString(t))throw new Error("invalid key");let n=Fr.base.fromHex(t.toLowerCase());if(n.length!==Za.PRIVATE_KEY_SIZE||n.every(i=>i===0))throw new Error("invalid key");return t}let[e,r]=Fr.base.fromBech32(t);if(e!==fo.SUI_PRIVATE_KEY_PREFIX)throw new Error("invalid private key prefix");if(r[0]!=0)throw new Error("invalid private key prefix");if(r.length!==Za.PRIVATE_KEY_SIZE+1)throw new Error("invalid key");return Fr.base.toHex(r.slice(1),!0)}_e.tryDecodeSuiPrivateKey=h8});export{Xb as a};
window.inOKXExtension = true;
window.inMiniApp = false;
window.ASSETS_BUILD_TYPE = "publish";
//# sourceMappingURL=chunk-I7TWOSV5.js.map