kaspa-simple-wallet
Version:
Simple, reliable Kaspa wallet generation and HD address derivation for browsers and Node.js. No complex setup required.
1 lines • 970 kB
JavaScript
var KaspaWallet=(()=>{var pE=Object.create;var Fu=Object.defineProperty;var bE=Object.getOwnPropertyDescriptor;var mE=Object.getOwnPropertyNames;var gE=Object.getPrototypeOf,vE=Object.prototype.hasOwnProperty;var Ku=(t,e)=>()=>(t&&(e=t(t=0)),e);var U=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),y0=(t,e)=>{for(var r in e)Fu(t,r,{get:e[r],enumerable:!0})},Tg=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of mE(e))!vE.call(t,i)&&i!==r&&Fu(t,i,{get:()=>e[i],enumerable:!(n=bE(e,i))||n.enumerable});return t};var ac=(t,e,r)=>(r=t!=null?pE(gE(t)):{},Tg(e||!t||!t.__esModule?Fu(r,"default",{value:t,enumerable:!0}):r,t)),w0=t=>Tg(Fu({},"__esModule",{value:!0}),t);var Ng=U(Vu=>{"use strict";_();Vu.byteLength=wE;Vu.toByteArray=_E;Vu.fromByteArray=BE;var si=[],un=[],yE=typeof Uint8Array<"u"?Uint8Array:Array,x0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Ma=0,zg=x0.length;Ma<zg;++Ma)si[Ma]=x0[Ma],un[x0.charCodeAt(Ma)]=Ma;var Ma,zg;un["-".charCodeAt(0)]=62;un["_".charCodeAt(0)]=63;function Rg(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function wE(t){var e=Rg(t),r=e[0],n=e[1];return(r+n)*3/4-n}function xE(t,e,r){return(e+r)*3/4-r}function _E(t){var e,r=Rg(t),n=r[0],i=r[1],o=new yE(xE(t,n,i)),a=0,s=i>0?n-4:n,f;for(f=0;f<s;f+=4)e=un[t.charCodeAt(f)]<<18|un[t.charCodeAt(f+1)]<<12|un[t.charCodeAt(f+2)]<<6|un[t.charCodeAt(f+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return i===2&&(e=un[t.charCodeAt(f)]<<2|un[t.charCodeAt(f+1)]>>4,o[a++]=e&255),i===1&&(e=un[t.charCodeAt(f)]<<10|un[t.charCodeAt(f+1)]<<4|un[t.charCodeAt(f+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}function EE(t){return si[t>>18&63]+si[t>>12&63]+si[t>>6&63]+si[t&63]}function SE(t,e,r){for(var n,i=[],o=e;o<r;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),i.push(EE(n));return i.join("")}function BE(t){for(var e,r=t.length,n=r%3,i=[],o=16383,a=0,s=r-n;a<s;a+=o)i.push(SE(t,a,a+o>s?s:a+o));return n===1?(e=t[r-1],i.push(si[e>>2]+si[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(si[e>>10]+si[e>>4&63]+si[e<<2&63]+"=")),i.join("")}});var Pg=U(_0=>{_();_0.read=function(t,e,r,n,i){var o,a,s=i*8-n-1,f=(1<<s)-1,c=f>>1,d=-7,l=r?i-1:0,p=r?-1:1,g=t[e+l];for(l+=p,o=g&(1<<-d)-1,g>>=-d,d+=s;d>0;o=o*256+t[e+l],l+=p,d-=8);for(a=o&(1<<-d)-1,o>>=-d,d+=n;d>0;a=a*256+t[e+l],l+=p,d-=8);if(o===0)o=1-c;else{if(o===f)return a?NaN:(g?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-c}return(g?-1:1)*a*Math.pow(2,o-n)};_0.write=function(t,e,r,n,i,o){var a,s,f,c=o*8-i-1,d=(1<<c)-1,l=d>>1,p=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:o-1,y=n?1:-1,w=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=d):(a=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-a))<1&&(a--,f*=2),a+l>=1?e+=p/f:e+=p*Math.pow(2,1-l),e*f>=2&&(a++,f/=2),a+l>=d?(s=0,a=d):a+l>=1?(s=(e*f-1)*Math.pow(2,i),a=a+l):(s=e*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[r+g]=s&255,g+=y,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;t[r+g]=a&255,g+=y,a/=256,c-=8);t[r+g-y]|=w*128}});var Bo=U(Us=>{"use strict";_();var E0=Ng(),Hs=Pg(),Lg=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Us.Buffer=Q;Us.SlowBuffer=qE;Us.INSPECT_MAX_BYTES=50;var $u=2147483647;Us.kMaxLength=$u;Q.TYPED_ARRAY_SUPPORT=AE();!Q.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function AE(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}Object.defineProperty(Q.prototype,"parent",{enumerable:!0,get:function(){if(Q.isBuffer(this))return this.buffer}});Object.defineProperty(Q.prototype,"offset",{enumerable:!0,get:function(){if(Q.isBuffer(this))return this.byteOffset}});function Zi(t){if(t>$u)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,Q.prototype),e}function Q(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return k0(t)}return Cg(t,e,r)}Q.poolSize=8192;function Cg(t,e,r){if(typeof t=="string")return IE(t,e);if(ArrayBuffer.isView(t))return OE(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(fi(t,ArrayBuffer)||t&&fi(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(fi(t,SharedArrayBuffer)||t&&fi(t.buffer,SharedArrayBuffer)))return B0(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=t.valueOf&&t.valueOf();if(n!=null&&n!==t)return Q.from(n,e,r);let i=ME(t);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return Q.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}Q.from=function(t,e,r){return Cg(t,e,r)};Object.setPrototypeOf(Q.prototype,Uint8Array.prototype);Object.setPrototypeOf(Q,Uint8Array);function Dg(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function kE(t,e,r){return Dg(t),t<=0?Zi(t):e!==void 0?typeof r=="string"?Zi(t).fill(e,r):Zi(t).fill(e):Zi(t)}Q.alloc=function(t,e,r){return kE(t,e,r)};function k0(t){return Dg(t),Zi(t<0?0:I0(t)|0)}Q.allocUnsafe=function(t){return k0(t)};Q.allocUnsafeSlow=function(t){return k0(t)};function IE(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!Q.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=Fg(t,e)|0,n=Zi(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}function S0(t){let e=t.length<0?0:I0(t.length)|0,r=Zi(e);for(let n=0;n<e;n+=1)r[n]=t[n]&255;return r}function OE(t){if(fi(t,Uint8Array)){let e=new Uint8Array(t);return B0(e.buffer,e.byteOffset,e.byteLength)}return S0(t)}function B0(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return e===void 0&&r===void 0?n=new Uint8Array(t):r===void 0?n=new Uint8Array(t,e):n=new Uint8Array(t,e,r),Object.setPrototypeOf(n,Q.prototype),n}function ME(t){if(Q.isBuffer(t)){let e=I0(t.length)|0,r=Zi(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||M0(t.length)?Zi(0):S0(t);if(t.type==="Buffer"&&Array.isArray(t.data))return S0(t.data)}function I0(t){if(t>=$u)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+$u.toString(16)+" bytes");return t|0}function qE(t){return+t!=t&&(t=0),Q.alloc(+t)}Q.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==Q.prototype};Q.compare=function(e,r){if(fi(e,Uint8Array)&&(e=Q.from(e,e.offset,e.byteLength)),fi(r,Uint8Array)&&(r=Q.from(r,r.offset,r.byteLength)),!Q.isBuffer(e)||!Q.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let n=e.length,i=r.length;for(let o=0,a=Math.min(n,i);o<a;++o)if(e[o]!==r[o]){n=e[o],i=r[o];break}return n<i?-1:i<n?1:0};Q.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};Q.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return Q.alloc(0);let n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;let i=Q.allocUnsafe(r),o=0;for(n=0;n<e.length;++n){let a=e[n];if(fi(a,Uint8Array))o+a.length>i.length?(Q.isBuffer(a)||(a=Q.from(a)),a.copy(i,o)):Uint8Array.prototype.set.call(i,a,o);else if(Q.isBuffer(a))a.copy(i,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return i};function Fg(t,e){if(Q.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||fi(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return A0(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Yg(t).length;default:if(i)return n?-1:A0(t).length;e=(""+e).toLowerCase(),i=!0}}Q.byteLength=Fg;function TE(t,e,r){let n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return DE(this,e,r);case"utf8":case"utf-8":return Vg(this,e,r);case"ascii":return UE(this,e,r);case"latin1":case"binary":return CE(this,e,r);case"base64":return HE(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return FE(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}Q.prototype._isBuffer=!0;function qa(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}Q.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<e;r+=2)qa(this,r,r+1);return this};Q.prototype.swap32=function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<e;r+=4)qa(this,r,r+3),qa(this,r+1,r+2);return this};Q.prototype.swap64=function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<e;r+=8)qa(this,r,r+7),qa(this,r+1,r+6),qa(this,r+2,r+5),qa(this,r+3,r+4);return this};Q.prototype.toString=function(){let e=this.length;return e===0?"":arguments.length===0?Vg(this,0,e):TE.apply(this,arguments)};Q.prototype.toLocaleString=Q.prototype.toString;Q.prototype.equals=function(e){if(!Q.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:Q.compare(this,e)===0};Q.prototype.inspect=function(){let e="",r=Us.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"};Lg&&(Q.prototype[Lg]=Q.prototype.inspect);Q.prototype.compare=function(e,r,n,i,o){if(fi(e,Uint8Array)&&(e=Q.from(e,e.offset,e.byteLength)),!Q.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),r<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===e)return 0;let a=o-i,s=n-r,f=Math.min(a,s),c=this.slice(i,o),d=e.slice(r,n);for(let l=0;l<f;++l)if(c[l]!==d[l]){a=c[l],s=d[l];break}return a<s?-1:s<a?1:0};function Kg(t,e,r,n,i){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,M0(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof e=="string"&&(e=Q.from(e,n)),Q.isBuffer(e))return e.length===0?-1:Hg(t,e,r,n,i);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Hg(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Hg(t,e,r,n,i){let o=1,a=t.length,s=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,a/=2,s/=2,r/=2}function f(d,l){return o===1?d[l]:d.readUInt16BE(l*o)}let c;if(i){let d=-1;for(c=r;c<a;c++)if(f(t,c)===f(e,d===-1?0:c-d)){if(d===-1&&(d=c),c-d+1===s)return d*o}else d!==-1&&(c-=c-d),d=-1}else for(r+s>a&&(r=a-s),c=r;c>=0;c--){let d=!0;for(let l=0;l<s;l++)if(f(t,c+l)!==f(e,l)){d=!1;break}if(d)return c}return-1}Q.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};Q.prototype.indexOf=function(e,r,n){return Kg(this,e,r,n,!0)};Q.prototype.lastIndexOf=function(e,r,n){return Kg(this,e,r,n,!1)};function zE(t,e,r,n){r=Number(r)||0;let i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;let o=e.length;n>o/2&&(n=o/2);let a;for(a=0;a<n;++a){let s=parseInt(e.substr(a*2,2),16);if(M0(s))return a;t[r+a]=s}return a}function RE(t,e,r,n){return Wu(A0(e,t.length-r),t,r,n)}function NE(t,e,r,n){return Wu(WE(e),t,r,n)}function PE(t,e,r,n){return Wu(Yg(e),t,r,n)}function LE(t,e,r,n){return Wu(GE(e,t.length-r),t,r,n)}Q.prototype.write=function(e,r,n,i){if(r===void 0)i="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")i=r,n=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-r;if((n===void 0||n>o)&&(n=o),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let a=!1;for(;;)switch(i){case"hex":return zE(this,e,r,n);case"utf8":case"utf-8":return RE(this,e,r,n);case"ascii":case"latin1":case"binary":return NE(this,e,r,n);case"base64":return PE(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return LE(this,e,r,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};Q.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function HE(t,e,r){return e===0&&r===t.length?E0.fromByteArray(t):E0.fromByteArray(t.slice(e,r))}function Vg(t,e,r){r=Math.min(t.length,r);let n=[],i=e;for(;i<r;){let o=t[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s<=r){let f,c,d,l;switch(s){case 1:o<128&&(a=o);break;case 2:f=t[i+1],(f&192)===128&&(l=(o&31)<<6|f&63,l>127&&(a=l));break;case 3:f=t[i+1],c=t[i+2],(f&192)===128&&(c&192)===128&&(l=(o&15)<<12|(f&63)<<6|c&63,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:f=t[i+1],c=t[i+2],d=t[i+3],(f&192)===128&&(c&192)===128&&(d&192)===128&&(l=(o&15)<<18|(f&63)<<12|(c&63)<<6|d&63,l>65535&&l<1114112&&(a=l))}}a===null?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=s}return jE(n)}var jg=4096;function jE(t){let e=t.length;if(e<=jg)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=jg));return r}function UE(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]&127);return n}function CE(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function DE(t,e,r){let n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let o=e;o<r;++o)i+=ZE[t[o]];return i}function FE(t,e,r){let n=t.slice(e,r),i="";for(let o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}Q.prototype.slice=function(e,r){let n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);let i=this.subarray(e,r);return Object.setPrototypeOf(i,Q.prototype),i};function ar(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}Q.prototype.readUintLE=Q.prototype.readUIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||ar(e,r,this.length);let i=this[e],o=1,a=0;for(;++a<r&&(o*=256);)i+=this[e+a]*o;return i};Q.prototype.readUintBE=Q.prototype.readUIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||ar(e,r,this.length);let i=this[e+--r],o=1;for(;r>0&&(o*=256);)i+=this[e+--r]*o;return i};Q.prototype.readUint8=Q.prototype.readUInt8=function(e,r){return e=e>>>0,r||ar(e,1,this.length),this[e]};Q.prototype.readUint16LE=Q.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||ar(e,2,this.length),this[e]|this[e+1]<<8};Q.prototype.readUint16BE=Q.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||ar(e,2,this.length),this[e]<<8|this[e+1]};Q.prototype.readUint32LE=Q.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||ar(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};Q.prototype.readUint32BE=Q.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||ar(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};Q.prototype.readBigUInt64LE=So(function(e){e=e>>>0,js(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&sc(e,this.length-8);let i=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,o=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(i)+(BigInt(o)<<BigInt(32))});Q.prototype.readBigUInt64BE=So(function(e){e=e>>>0,js(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&sc(e,this.length-8);let i=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],o=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(i)<<BigInt(32))+BigInt(o)});Q.prototype.readIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||ar(e,r,this.length);let i=this[e],o=1,a=0;for(;++a<r&&(o*=256);)i+=this[e+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*r)),i};Q.prototype.readIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||ar(e,r,this.length);let i=r,o=1,a=this[e+--i];for(;i>0&&(o*=256);)a+=this[e+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*r)),a};Q.prototype.readInt8=function(e,r){return e=e>>>0,r||ar(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};Q.prototype.readInt16LE=function(e,r){e=e>>>0,r||ar(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};Q.prototype.readInt16BE=function(e,r){e=e>>>0,r||ar(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};Q.prototype.readInt32LE=function(e,r){return e=e>>>0,r||ar(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};Q.prototype.readInt32BE=function(e,r){return e=e>>>0,r||ar(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};Q.prototype.readBigInt64LE=So(function(e){e=e>>>0,js(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&sc(e,this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(i)<<BigInt(32))+BigInt(r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)});Q.prototype.readBigInt64BE=So(function(e){e=e>>>0,js(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&sc(e,this.length-8);let i=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(i)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)});Q.prototype.readFloatLE=function(e,r){return e=e>>>0,r||ar(e,4,this.length),Hs.read(this,e,!0,23,4)};Q.prototype.readFloatBE=function(e,r){return e=e>>>0,r||ar(e,4,this.length),Hs.read(this,e,!1,23,4)};Q.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||ar(e,8,this.length),Hs.read(this,e,!0,52,8)};Q.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||ar(e,8,this.length),Hs.read(this,e,!1,52,8)};function Gr(t,e,r,n,i,o){if(!Q.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}Q.prototype.writeUintLE=Q.prototype.writeUIntLE=function(e,r,n,i){if(e=+e,r=r>>>0,n=n>>>0,!i){let s=Math.pow(2,8*n)-1;Gr(this,e,r,n,s,0)}let o=1,a=0;for(this[r]=e&255;++a<n&&(o*=256);)this[r+a]=e/o&255;return r+n};Q.prototype.writeUintBE=Q.prototype.writeUIntBE=function(e,r,n,i){if(e=+e,r=r>>>0,n=n>>>0,!i){let s=Math.pow(2,8*n)-1;Gr(this,e,r,n,s,0)}let o=n-1,a=1;for(this[r+o]=e&255;--o>=0&&(a*=256);)this[r+o]=e/a&255;return r+n};Q.prototype.writeUint8=Q.prototype.writeUInt8=function(e,r,n){return e=+e,r=r>>>0,n||Gr(this,e,r,1,255,0),this[r]=e&255,r+1};Q.prototype.writeUint16LE=Q.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||Gr(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};Q.prototype.writeUint16BE=Q.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||Gr(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};Q.prototype.writeUint32LE=Q.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||Gr(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};Q.prototype.writeUint32BE=Q.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||Gr(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function $g(t,e,r,n,i){Jg(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=a,a=a>>8,t[r++]=a,a=a>>8,t[r++]=a,a=a>>8,t[r++]=a,r}function Wg(t,e,r,n,i){Jg(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o=o>>8,t[r+6]=o,o=o>>8,t[r+5]=o,o=o>>8,t[r+4]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=a,a=a>>8,t[r+2]=a,a=a>>8,t[r+1]=a,a=a>>8,t[r]=a,r+8}Q.prototype.writeBigUInt64LE=So(function(e,r=0){return $g(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});Q.prototype.writeBigUInt64BE=So(function(e,r=0){return Wg(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});Q.prototype.writeIntLE=function(e,r,n,i){if(e=+e,r=r>>>0,!i){let f=Math.pow(2,8*n-1);Gr(this,e,r,n,f-1,-f)}let o=0,a=1,s=0;for(this[r]=e&255;++o<n&&(a*=256);)e<0&&s===0&&this[r+o-1]!==0&&(s=1),this[r+o]=(e/a>>0)-s&255;return r+n};Q.prototype.writeIntBE=function(e,r,n,i){if(e=+e,r=r>>>0,!i){let f=Math.pow(2,8*n-1);Gr(this,e,r,n,f-1,-f)}let o=n-1,a=1,s=0;for(this[r+o]=e&255;--o>=0&&(a*=256);)e<0&&s===0&&this[r+o+1]!==0&&(s=1),this[r+o]=(e/a>>0)-s&255;return r+n};Q.prototype.writeInt8=function(e,r,n){return e=+e,r=r>>>0,n||Gr(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};Q.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||Gr(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};Q.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||Gr(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};Q.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||Gr(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};Q.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||Gr(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};Q.prototype.writeBigInt64LE=So(function(e,r=0){return $g(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});Q.prototype.writeBigInt64BE=So(function(e,r=0){return Wg(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Gg(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Zg(t,e,r,n,i){return e=+e,r=r>>>0,i||Gg(t,e,r,4,34028234663852886e22,-34028234663852886e22),Hs.write(t,e,r,n,23,4),r+4}Q.prototype.writeFloatLE=function(e,r,n){return Zg(this,e,r,!0,n)};Q.prototype.writeFloatBE=function(e,r,n){return Zg(this,e,r,!1,n)};function Xg(t,e,r,n,i){return e=+e,r=r>>>0,i||Gg(t,e,r,8,17976931348623157e292,-17976931348623157e292),Hs.write(t,e,r,n,52,8),r+8}Q.prototype.writeDoubleLE=function(e,r,n){return Xg(this,e,r,!0,n)};Q.prototype.writeDoubleBE=function(e,r,n){return Xg(this,e,r,!1,n)};Q.prototype.copy=function(e,r,n,i){if(!Q.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i<n&&(i=n),i===n||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-r<i-n&&(i=e.length-r+n);let o=i-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,i):Uint8Array.prototype.set.call(e,this.subarray(n,i),r),o};Q.prototype.fill=function(e,r,n,i){if(typeof e=="string"){if(typeof r=="string"?(i=r,r=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!Q.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(e.length===1){let a=e.charCodeAt(0);(i==="utf8"&&a<128||i==="latin1")&&(e=a)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);let o;if(typeof e=="number")for(o=r;o<n;++o)this[o]=e;else{let a=Q.isBuffer(e)?e:Q.from(e,i),s=a.length;if(s===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-r;++o)this[o+r]=a[o%s]}return this};var Ls={};function O0(t,e,r){Ls[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(i){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:i,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}O0("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);O0("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);O0("ERR_OUT_OF_RANGE",function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=Ug(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=Ug(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n},RangeError);function Ug(t){let e="",r=t.length,n=t[0]==="-"?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function KE(t,e,r){js(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&sc(e,t.length-(r+1))}function Jg(t,e,r,n,i,o){if(t>r||t<e){let a=typeof e=="bigint"?"n":"",s;throw o>3?e===0||e===BigInt(0)?s=`>= 0${a} and < 2${a} ** ${(o+1)*8}${a}`:s=`>= -(2${a} ** ${(o+1)*8-1}${a}) and < 2 ** ${(o+1)*8-1}${a}`:s=`>= ${e}${a} and <= ${r}${a}`,new Ls.ERR_OUT_OF_RANGE("value",s,t)}KE(n,i,o)}function js(t,e){if(typeof t!="number")throw new Ls.ERR_INVALID_ARG_TYPE(e,"number",t)}function sc(t,e,r){throw Math.floor(t)!==t?(js(t,r),new Ls.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new Ls.ERR_BUFFER_OUT_OF_BOUNDS:new Ls.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}var VE=/[^+/0-9A-Za-z-_]/g;function $E(t){if(t=t.split("=")[0],t=t.trim().replace(VE,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function A0(t,e){e=e||1/0;let r,n=t.length,i=null,o=[];for(let a=0;a<n;++a){if(r=t.charCodeAt(a),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}function WE(t){let e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function GE(t,e){let r,n,i,o=[];for(let a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function Yg(t){return E0.toByteArray($E(t))}function Wu(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function fi(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function M0(t){return t!==t}var ZE=function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function So(t){return typeof BigInt>"u"?XE:t}function XE(){throw new Error("BigInt not supported")}});var n2=U((kC,r2)=>{_();var At=r2.exports={},ci,ui;function q0(){throw new Error("setTimeout has not been defined")}function T0(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?ci=setTimeout:ci=q0}catch{ci=q0}try{typeof clearTimeout=="function"?ui=clearTimeout:ui=T0}catch{ui=T0}})();function Qg(t){if(ci===setTimeout)return setTimeout(t,0);if((ci===q0||!ci)&&setTimeout)return ci=setTimeout,setTimeout(t,0);try{return ci(t,0)}catch{try{return ci.call(null,t,0)}catch{return ci.call(this,t,0)}}}function JE(t){if(ui===clearTimeout)return clearTimeout(t);if((ui===T0||!ui)&&clearTimeout)return ui=clearTimeout,clearTimeout(t);try{return ui(t)}catch{try{return ui.call(null,t)}catch{return ui.call(this,t)}}}var Xi=[],Cs=!1,Ta,Gu=-1;function YE(){!Cs||!Ta||(Cs=!1,Ta.length?Xi=Ta.concat(Xi):Gu=-1,Xi.length&&e2())}function e2(){if(!Cs){var t=Qg(YE);Cs=!0;for(var e=Xi.length;e;){for(Ta=Xi,Xi=[];++Gu<e;)Ta&&Ta[Gu].run();Gu=-1,e=Xi.length}Ta=null,Cs=!1,JE(t)}}At.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];Xi.push(new t2(t,e)),Xi.length===1&&!Cs&&Qg(e2)};function t2(t,e){this.fun=t,this.array=e}t2.prototype.run=function(){this.fun.apply(null,this.array)};At.title="browser";At.browser=!0;At.env={};At.argv=[];At.version="";At.versions={};function Ji(){}At.on=Ji;At.addListener=Ji;At.once=Ji;At.off=Ji;At.removeListener=Ji;At.removeAllListeners=Ji;At.emit=Ji;At.prependListener=Ji;At.prependOnceListener=Ji;At.listeners=function(t){return[]};At.binding=function(t){throw new Error("process.binding is not supported")};At.cwd=function(){return"/"};At.chdir=function(t){throw new Error("process.chdir is not supported")};At.umask=function(){return 0}});var i2,o2,_=Ku(()=>{i2=ac(Bo()),o2=ac(n2());globalThis.Buffer=i2.Buffer;globalThis.process=o2.default});var a2=U(Zu=>{"use strict";_();Object.defineProperty(Zu,"__esModule",{value:!0});Zu.crypto=void 0;Zu.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0});var Ks=U(ye=>{"use strict";_();Object.defineProperty(ye,"__esModule",{value:!0});ye.wrapXOFConstructorWithOpts=ye.wrapConstructorWithOpts=ye.wrapConstructor=ye.Hash=ye.nextTick=ye.swap32IfBE=ye.byteSwapIfBE=ye.swap8IfBE=ye.isLE=void 0;ye.isBytes=f2;ye.anumber=z0;ye.abytes=Fs;ye.ahash=QE;ye.aexists=eS;ye.aoutput=tS;ye.u8=rS;ye.u32=nS;ye.clean=iS;ye.createView=oS;ye.rotr=aS;ye.rotl=sS;ye.byteSwap=N0;ye.byteSwap32=c2;ye.bytesToHex=cS;ye.hexToBytes=uS;ye.asyncLoop=dS;ye.utf8ToBytes=P0;ye.bytesToUtf8=hS;ye.toBytes=Xu;ye.kdfInputToBytes=pS;ye.concatBytes=bS;ye.checkOpts=mS;ye.createHasher=l2;ye.createOptHasher=d2;ye.createXOFer=h2;ye.randomBytes=gS;var Ds=a2();function f2(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function z0(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function Fs(t,...e){if(!f2(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function QE(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");z0(t.outputLen),z0(t.blockLen)}function eS(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function tS(t,e){Fs(t);let r=e.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function rS(t){return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}function nS(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function iS(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function oS(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function aS(t,e){return t<<32-e|t>>>e}function sS(t,e){return t<<e|t>>>32-e>>>0}ye.isLE=(()=>new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68)();function N0(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}ye.swap8IfBE=ye.isLE?t=>t:t=>N0(t);ye.byteSwapIfBE=ye.swap8IfBE;function c2(t){for(let e=0;e<t.length;e++)t[e]=N0(t[e]);return t}ye.swap32IfBE=ye.isLE?t=>t:c2;var u2=(()=>typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function")(),fS=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function cS(t){if(Fs(t),u2)return t.toHex();let e="";for(let r=0;r<t.length;r++)e+=fS[t[r]];return e}var Yi={_0:48,_9:57,A:65,F:70,a:97,f:102};function s2(t){if(t>=Yi._0&&t<=Yi._9)return t-Yi._0;if(t>=Yi.A&&t<=Yi.F)return t-(Yi.A-10);if(t>=Yi.a&&t<=Yi.f)return t-(Yi.a-10)}function uS(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);if(u2)return Uint8Array.fromHex(t);let e=t.length,r=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);let n=new Uint8Array(r);for(let i=0,o=0;i<r;i++,o+=2){let a=s2(t.charCodeAt(o)),s=s2(t.charCodeAt(o+1));if(a===void 0||s===void 0){let f=t[o]+t[o+1];throw new Error('hex string expected, got non-hex character "'+f+'" at index '+o)}n[i]=a*16+s}return n}var lS=async()=>{};ye.nextTick=lS;async function dS(t,e,r){let n=Date.now();for(let i=0;i<t;i++){r(i);let o=Date.now()-n;o>=0&&o<e||(await(0,ye.nextTick)(),n+=o)}}function P0(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function hS(t){return new TextDecoder().decode(t)}function Xu(t){return typeof t=="string"&&(t=P0(t)),Fs(t),t}function pS(t){return typeof t=="string"&&(t=P0(t)),Fs(t),t}function bS(...t){let e=0;for(let n=0;n<t.length;n++){let i=t[n];Fs(i),e+=i.length}let r=new Uint8Array(e);for(let n=0,i=0;n<t.length;n++){let o=t[n];r.set(o,i),i+=o.length}return r}function mS(t,e){if(e!==void 0&&{}.toString.call(e)!=="[object Object]")throw new Error("options should be object or undefined");return Object.assign(t,e)}var R0=class{};ye.Hash=R0;function l2(t){let e=n=>t().update(Xu(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function d2(t){let e=(n,i)=>t(i).update(Xu(n)).digest(),r=t({});return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=n=>t(n),e}function h2(t){let e=(n,i)=>t(i).update(Xu(n)).digest(),r=t({});return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=n=>t(n),e}ye.wrapConstructor=l2;ye.wrapConstructorWithOpts=d2;ye.wrapXOFConstructorWithOpts=h2;function gS(t=32){if(Ds.crypto&&typeof Ds.crypto.getRandomValues=="function")return Ds.crypto.getRandomValues(new Uint8Array(t));if(Ds.crypto&&typeof Ds.crypto.randomBytes=="function")return Uint8Array.from(Ds.crypto.randomBytes(t));throw new Error("crypto.getRandomValues must be defined")}});var b2=U(Ur=>{"use strict";_();Object.defineProperty(Ur,"__esModule",{value:!0});Ur.SHA512_IV=Ur.SHA384_IV=Ur.SHA224_IV=Ur.SHA256_IV=Ur.HashMD=void 0;Ur.setBigUint64=p2;Ur.Chi=vS;Ur.Maj=yS;var li=Ks();function p2(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);let i=BigInt(32),o=BigInt(4294967295),a=Number(r>>i&o),s=Number(r&o),f=n?4:0,c=n?0:4;t.setUint32(e+f,a,n),t.setUint32(e+c,s,n)}function vS(t,e,r){return t&e^~t&r}function yS(t,e,r){return t&e^t&r^e&r}var L0=class extends li.Hash{constructor(e,r,n,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.buffer=new Uint8Array(e),this.view=(0,li.createView)(this.buffer)}update(e){(0,li.aexists)(this),e=(0,li.toBytes)(e),(0,li.abytes)(e);let{view:r,buffer:n,blockLen:i}=this,o=e.length;for(let a=0;a<o;){let s=Math.min(i-this.pos,o-a);if(s===i){let f=(0,li.createView)(e);for(;i<=o-a;a+=i)this.process(f,a);continue}n.set(e.subarray(a,a+s),this.pos),this.pos+=s,a+=s,this.pos===i&&(this.process(r,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,li.aexists)(this),(0,li.aoutput)(e,this),this.finished=!0;let{buffer:r,view:n,blockLen:i,isLE:o}=this,{pos:a}=this;r[a++]=128,(0,li.clean)(this.buffer.subarray(a)),this.padOffset>i-a&&(this.process(n,0),a=0);for(let l=a;l<i;l++)r[l]=0;p2(n,i-8,BigInt(this.length*8),o),this.process(n,0);let s=(0,li.createView)(e),f=this.outputLen;if(f%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let c=f/4,d=this.get();if(c>d.length)throw new Error("_sha2: outputLen bigger than state");for(let l=0;l<c;l++)s.setUint32(4*l,d[l],o)}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:o,destroyed:a,pos:s}=this;return e.destroyed=a,e.finished=o,e.length=i,e.pos=s,i%r&&e.buffer.set(n),e}clone(){return this._cloneInto()}};Ur.HashMD=L0;Ur.SHA256_IV=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);Ur.SHA224_IV=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]);Ur.SHA384_IV=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]);Ur.SHA512_IV=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209])});var L2=U(Se=>{"use strict";_();Object.defineProperty(Se,"__esModule",{value:!0});Se.toBig=Se.shrSL=Se.shrSH=Se.rotrSL=Se.rotrSH=Se.rotrBL=Se.rotrBH=Se.rotr32L=Se.rotr32H=Se.rotlSL=Se.rotlSH=Se.rotlBL=Se.rotlBH=Se.add5L=Se.add5H=Se.add4L=Se.add4H=Se.add3L=Se.add3H=void 0;Se.add=M2;Se.fromBig=j0;Se.split=m2;var Ju=BigInt(2**32-1),H0=BigInt(32);function j0(t,e=!1){return e?{h:Number(t&Ju),l:Number(t>>H0&Ju)}:{h:Number(t>>H0&Ju)|0,l:Number(t&Ju)|0}}function m2(t,e=!1){let r=t.length,n=new Uint32Array(r),i=new Uint32Array(r);for(let o=0;o<r;o++){let{h:a,l:s}=j0(t[o],e);[n[o],i[o]]=[a,s]}return[n,i]}var g2=(t,e)=>BigInt(t>>>0)<<H0|BigInt(e>>>0);Se.toBig=g2;var v2=(t,e,r)=>t>>>r;Se.shrSH=v2;var y2=(t,e,r)=>t<<32-r|e>>>r;Se.shrSL=y2;var w2=(t,e,r)=>t>>>r|e<<32-r;Se.rotrSH=w2;var x2=(t,e,r)=>t<<32-r|e>>>r;Se.rotrSL=x2;var _2=(t,e,r)=>t<<64-r|e>>>r-32;Se.rotrBH=_2;var E2=(t,e,r)=>t>>>r-32|e<<64-r;Se.rotrBL=E2;var S2=(t,e)=>e;Se.rotr32H=S2;var B2=(t,e)=>t;Se.rotr32L=B2;var A2=(t,e,r)=>t<<r|e>>>32-r;Se.rotlSH=A2;var k2=(t,e,r)=>e<<r|t>>>32-r;Se.rotlSL=k2;var I2=(t,e,r)=>e<<r-32|t>>>64-r;Se.rotlBH=I2;var O2=(t,e,r)=>t<<r-32|e>>>64-r;Se.rotlBL=O2;function M2(t,e,r,n){let i=(e>>>0)+(n>>>0);return{h:t+r+(i/2**32|0)|0,l:i|0}}var q2=(t,e,r)=>(t>>>0)+(e>>>0)+(r>>>0);Se.add3L=q2;var T2=(t,e,r,n)=>e+r+n+(t/2**32|0)|0;Se.add3H=T2;var z2=(t,e,r,n)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0);Se.add4L=z2;var R2=(t,e,r,n,i)=>e+r+n+i+(t/2**32|0)|0;Se.add4H=R2;var N2=(t,e,r,n,i)=>(t>>>0)+(e>>>0)+(r>>>0)+(n>>>0)+(i>>>0);Se.add5L=N2;var P2=(t,e,r,n,i,o)=>e+r+n+i+o+(t/2**32|0)|0;Se.add5H=P2;var wS={fromBig:j0,split:m2,toBig:g2,shrSH:v2,shrSL:y2,rotrSH:w2,rotrSL:x2,rotrBH:_2,rotrBL:E2,rotr32H:S2,rotr32L:B2,rotlSH:A2,rotlSL:k2,rotlBH:I2,rotlBL:O2,add:M2,add3L:q2,add3H:T2,add4L:z2,add4H:R2,add5H:P2,add5L:N2};Se.default=wS});var U0=U(rt=>{"use strict";_();Object.defineProperty(rt,"__esModule",{value:!0});rt.sha512_224=rt.sha512_256=rt.sha384=rt.sha512=rt.sha224=rt.sha256=rt.SHA512_256=rt.SHA512_224=rt.SHA384=rt.SHA512=rt.SHA224=rt.SHA256=void 0;var ve=b2(),Oe=L2(),$t=Ks(),xS=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Ao=new Uint32Array(64),fc=class extends ve.HashMD{constructor(e=32){super(64,e,8,!1),this.A=ve.SHA256_IV[0]|0,this.B=ve.SHA256_IV[1]|0,this.C=ve.SHA256_IV[2]|0,this.D=ve.SHA256_IV[3]|0,this.E=ve.SHA256_IV[4]|0,this.F=ve.SHA256_IV[5]|0,this.G=ve.SHA256_IV[6]|0,this.H=ve.SHA256_IV[7]|0}get(){let{A:e,B:r,C:n,D:i,E:o,F:a,G:s,H:f}=this;return[e,r,n,i,o,a,s,f]}set(e,r,n,i,o,a,s,f){this.A=e|0,this.B=r|0,this.C=n|0,this.D=i|0,this.E=o|0,this.F=a|0,this.G=s|0,this.H=f|0}process(e,r){for(let l=0;l<16;l++,r+=4)Ao[l]=e.getUint32(r,!1);for(let l=16;l<64;l++){let p=Ao[l-15],g=Ao[l-2],y=(0,$t.rotr)(p,7)^(0,$t.rotr)(p,18)^p>>>3,w=(0,$t.rotr)(g,17)^(0,$t.rotr)(g,19)^g>>>10;Ao[l]=w+Ao[l-7]+y+Ao[l-16]|0}let{A:n,B:i,C:o,D:a,E:s,F:f,G:c,H:d}=this;for(let l=0;l<64;l++){let p=(0,$t.rotr)(s,6)^(0,$t.rotr)(s,11)^(0,$t.rotr)(s,25),g=d+p+(0,ve.Chi)(s,f,c)+xS[l]+Ao[l]|0,w=((0,$t.rotr)(n,2)^(0,$t.rotr)(n,13)^(0,$t.rotr)(n,22))+(0,ve.Maj)(n,i,o)|0;d=c,c=f,f=s,s=a+g|0,a=o,o=i,i=n,n=g+w|0}n=n+this.A|0,i=i+this.B|0,o=o+this.C|0,a=a+this.D|0,s=s+this.E|0,f=f+this.F|0,c=c+this.G|0,d=d+this.H|0,this.set(n,i,o,a,s,f,c,d)}roundClean(){(0,$t.clean)(Ao)}destroy(){this.set(0,0,0,0,0,0,0,0),(0,$t.clean)(this.buffer)}};rt.SHA256=fc;var Yu=class extends fc{constructor(){super(28),this.A=ve.SHA224_IV[0]|0,this.B=ve.SHA224_IV[1]|0,this.C=ve.SHA224_IV[2]|0,this.D=ve.SHA224_IV[3]|0,this.E=ve.SHA224_IV[4]|0,this.F=ve.SHA224_IV[5]|0,this.G=ve.SHA224_IV[6]|0,this.H=ve.SHA224_IV[7]|0}};rt.SHA224=Yu;var H2=(()=>Oe.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))))(),_S=(()=>H2[0])(),ES=(()=>H2[1])(),ko=new Uint32Array(80),Io=new Uint32Array(80),za=class extends ve.HashMD{constructor(e=64){super(128,e,16,!1),this.Ah=ve.SHA512_IV[0]|0,this.Al=ve.SHA512_IV[1]|0,this.Bh=ve.SHA512_IV[2]|0,this.Bl=ve.SHA512_IV[3]|0,this.Ch=ve.SHA512_IV[4]|0,this.Cl=ve.SHA512_IV[5]|0,this.Dh=ve.SHA512_IV[6]|0,this.Dl=ve.SHA512_IV[7]|0,this.Eh=ve.SHA512_IV[8]|0,this.El=ve.SHA512_IV[9]|0,this.Fh=ve.SHA512_IV[10]|0,this.Fl=ve.SHA512_IV[11]|0,this.Gh=ve.SHA512_IV[12]|0,this.Gl=ve.SHA512_IV[13]|0,this.Hh=ve.SHA512_IV[14]|0,this.Hl=ve.SHA512_IV[15]|0}get(){let{Ah:e,Al:r,Bh:n,Bl:i,Ch:o,Cl:a,Dh:s,Dl:f,Eh:c,El:d,Fh:l,Fl:p,Gh:g,Gl:y,Hh:w,Hl:S}=this;return[e,r,n,i,o,a,s,f,c,d,l,p,g,y,w,S]}set(e,r,n,i,o,a,s,f,c,d,l,p,g,y,w,S){this.Ah=e|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=o|0,this.Cl=a|0,this.Dh=s|0,this.Dl=f|0,this.Eh=c|0,this.El=d|0,this.Fh=l|0,this.Fl=p|0,this.Gh=g|0,this.Gl=y|0,this.Hh=w|0,this.Hl=S|0}process(e,r){for(let N=0;N<16;N++,r+=4)ko[N]=e.getUint32(r),Io[N]=e.getUint32(r+=4);for(let N=16;N<80;N++){let D=ko[N-15]|0,z=Io[N-15]|0,H=Oe.rotrSH(D,z,1)^Oe.rotrSH(D,z,8)^Oe.shrSH(D,z,7),W=Oe.rotrSL(D,z,1)^Oe.rotrSL(D,z,8)^Oe.shrSL(D,z,7),F=ko[N-2]|0,R=Io[N-2]|0,B=Oe.rotrSH(F,R,19)^Oe.rotrBH(F,R,61)^Oe.shrSH(F,R,6),u=Oe.rotrSL(F,R,19)^Oe.rotrBL(F,R,61)^Oe.shrSL(F,R,6),b=Oe.add4L(W,u,Io[N-7],Io[N-16]),v=Oe.add4H(b,H,B,ko[N-7],ko[N-16]);ko[N]=v|0,Io[N]=b|0}let{Ah:n,Al:i,Bh:o,Bl:a,Ch:s,Cl:f,Dh:c,Dl:d,Eh:l,El:p,Fh:g,Fl:y,Gh:w,Gl:S,Hh:q,Hl:P}=this;for(let N=0;N<80;N++){let D=Oe.rotrSH(l,p,14)^Oe.rotrSH(l,p,18)^Oe.rotrBH(l,p,41),z=Oe.rotrSL(l,p,14)^Oe.rotrSL(l,p,18)^Oe.rotrBL(l,p,41),H=l&g^~l&w,W=p&y^~p&S,F=Oe.add5L(P,z,W,ES[N],Io[N]),R=Oe.add5H(F,q,D,H,_S[N],ko[N]),B=F|0,u=Oe.rotrSH(n,i,28)^Oe.rotrBH(n,i,34)^Oe.rotrBH(n,i,39),b=Oe.rotrSL(n,i,28)^Oe.rotrBL(n,i,34)^Oe.rotrBL(n,i,39),v=n&o^n&s^o&s,h=i&a^i&f^a&f;q=w|0,P=S|0,w=g|0,S=y|0,g=l|0,y=p|0,{h:l,l:p}=Oe.add(c|0,d|0,R|0,B|0),c=s|0,d=f|0,s=o|0,f=a|0,o=n|0,a=i|0;let x=Oe.add3L(B,b,h);n=Oe.add3H(x,R,u,v),i=x|0}({h:n,l:i}=Oe.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:o,l:a}=Oe.add(this.Bh|0,this.Bl|0,o|0,a|0),{h:s,l:f}=Oe.add(this.Ch|0,this.Cl|0,s|0,f|0),{h:c,l:d}=Oe.add(this.Dh|0,this.Dl|0,c|0,d|0),{h:l,l:p}=Oe.add(this.Eh|0,this.El|0,l|0,p|0),{h:g,l:y}=Oe.add(this.Fh|0,this.Fl|0,g|0,y|0),{h:w,l:S}=Oe.add(this.Gh|0,this.Gl|0,w|0,S|0),{h:q,l:P}=Oe.add(this.Hh|0,this.Hl|0,q|0,P|0),this.set(n,i,o,a,s,f,c,d,l,p,g,y,w,S,q,P)}roundClean(){(0,$t.clean)(ko,Io)}destroy(){(0,$t.clean)(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};rt.SHA512=za;var Qu=class extends za{constructor(){super(48),this.Ah=ve.SHA384_IV[0]|0,this.Al=ve.SHA384_IV[1]|0,this.Bh=ve.SHA384_IV[2]|0,this.Bl=ve.SHA384_IV[3]|0,this.Ch=ve.SHA384_IV[4]|0,this.Cl=ve.SHA384_IV[5]|0,this.Dh=ve.SHA384_IV[6]|0,this.Dl=ve.SHA384_IV[7]|0,this.Eh=ve.SHA384_IV[8]|0,this.El=ve.SHA384_IV[9]|0,this.Fh=ve.SHA384_IV[10]|0,this.Fl=ve.SHA384_IV[11]|0,this.Gh=ve.SHA384_IV[12]|0,this.Gl=ve.SHA384_IV[13]|0,this.Hh=ve.SHA384_IV[14]|0,this.Hl=ve.SHA384_IV[15]|0}};rt.SHA384=Qu;var _r=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),Er=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]),el=class extends za{constructor(){super(28),this.Ah=_r[0]|0,this.Al=_r[1]|0,this.Bh=_r[2]|0,this.Bl=_r[3]|0,this.Ch=_r[4]|0,this.Cl=_r[5]|0,this.Dh=_r[6]|0,this.Dl=_r[7]|0,this.Eh=_r[8]|0,this.El=_r[9]|0,this.Fh=_r[10]|0,this.Fl=_r[11]|0,this.Gh=_r[12]|0,this.Gl=_r[13]|0,this.Hh=_r[14]|0,this.Hl=_r[15]|0}};rt.SHA512_224=el;var tl=class extends za{constructor(){super(32),this.Ah=Er[0]|0,this.Al=Er[1]|0,this.Bh=Er[2]|0,this.Bl=Er[3]|0,this.Ch=Er[4]|0,this.Cl=Er[5]|0,this.Dh=Er[6]|0,this.Dl=Er[7]|0,this.Eh=Er[8]|0,this.El=Er[9]|0,this.Fh=Er[10]|0,this.Fl=Er[11]|0,this.Gh=Er[12]|0,this.Gl=Er[13]|0,this.Hh=Er[14]|0,this.Hl=Er[15]|0}};rt.SHA512_256=tl;rt.sha256=(0,$t.createHasher)(()=>new fc);rt.sha224=(0,$t.createHasher)(()=>new Yu);rt.sha512=(0,$t.createHasher)(()=>new za);rt.sha384=(0,$t.createHasher)(()=>new Qu);rt.sha512_256=(0,$t.createHasher)(()=>new tl);rt.sha512_224=(0,$t.createHasher)(()=>new el)});var j2=U(di=>{"use strict";_();Object.defineProperty(di,"__esModule",{value:!0});di.sha224=di.SHA224=di.sha256=di.SHA256=void 0;var rl=U0();di.SHA256=rl.SHA256;di.sha256=rl.sha256;di.SHA224=rl.SHA224;di.sha224=rl.sha224});var U2=U(sr=>{"use strict";_();Object.defineProperty(sr,"__esModule",{value:!0});sr.sha512_256=sr.SHA512_256=sr.sha512_224=sr.SHA512_224=sr.sha384=sr.SHA384=sr.sha512=sr.SHA512=void 0;var Oo=U0();sr.SHA512=Oo.SHA512;sr.sha512=Oo.sha512;sr.SHA384=Oo.SHA384;sr.sha384=Oo.sha384;sr.SHA512_224=Oo.SHA512_224;sr.sha512_224=Oo.sha512_224;sr.SHA512_256=Oo.SHA512_256;sr.sha512_256=Oo.sha512_256});var C2=U(Na=>{"use strict";_();Object.defineProperty(Na,"__esModule",{value:!0});Na.hmac=Na.HMAC=void 0;var Ra=Ks(),cc=class extends Ra.Hash{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,(0,Ra.ahash)(e);let n=(0,Ra.toBytes)(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let i=this.blockLen,o=new Uint8Array(i);o.set(n.length>i?e.create().update(n).digest():n);for(let a=0;a<o.length;a++)o[a]^=54;this.iHash.update(o),this.oHash=e.create();for(let a=0;a<o.length;a++)o[a]^=106;this.oHash.update(o),(0,Ra.clean)(o)}update(e){return(0,Ra.aexists)(this),this.iHash.update(e),this}digestInto(e){(0,Ra.aexists)(this),(0,Ra.abytes)(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));let{oHash:r,iHash:n,finished:i,destroyed:o,blockLen:a,outputLen:s}=this;return e=e,e.finished=i,e.destroyed=o,e.blockLen=a,e.outputLen=s,e.oHash=r.