const w=Object.freeze({ignoreUnknown:!1,respectType:!1,respectFunctionNames:!1,respectFunctionProperties:!1,unorderedObjects:!0,unorderedArrays:!1,unorderedSets:!1,excludeKeys:void 0,excludeValues:void 0,replacer:void 0});function O(n,r){r?r={...w,...r}:r=w;const s=b(r);return s.dispatch(n),s.toString()}const U=Object.freeze(["prototype","__proto__","constructor"]);function b(n){let r="",s=new Map;const t=e=>{r+=e};return{toString(){return r},getContext(){return s},dispatch(e){return n.replacer&&(e=n.replacer(e)),this[e===null?"null":typeof e](e)},object(e){if(e&&typeof e.toJSON=="function")return this.object(e.toJSON());const i=Object.prototype.toString.call(e);let a="";const u=i.length;u<10?a="unknown:["+i+"]":a=i.slice(8,u-1),a=a.toLowerCase();let o=null;if((o=s.get(e))===void 0)s.set(e,s.size);else return this.dispatch("[CIRCULAR:"+o+"]");if(typeof Buffer<"u"&&Buffer.isBuffer&&Buffer.isBuffer(e))return t("buffer:"),t(e.toString("utf8"));if(a!=="object"&&a!=="function"&&a!=="asyncfunction")this[a]?this[a](e):n.ignoreUnknown||this.unkown(e,a);else{let l=Object.keys(e);n.unorderedObjects&&(l=l.sort());let h=[];n.respectType!==!1&&!m(e)&&(h=U),n.excludeKeys&&(l=l.filter(c=>!n.excludeKeys(c)),h=h.filter(c=>!n.excludeKeys(c))),t("object:"+(l.length+h.length)+":");const f=c=>{this.dispatch(c),t(":"),n.excludeValues||this.dispatch(e[c]),t(",")};for(const c of l)f(c);for(const c of h)f(c)}},array(e,i){if(i=i===void 0?n.unorderedArrays!==!1:i,t("array:"+e.length+":"),!i||e.length<=1){for(const o of e)this.dispatch(o);return}const a=new Map,u=e.map(o=>{const l=b(n);l.dispatch(o);for(const[h,f]of l.getContext())a.set(h,f);return l.toString()});return s=a,u.sort(),this.array(u,!1)},date(e){return t("date:"+e.toJSON())},symbol(e){return t("symbol:"+e.toString())},unkown(e,i){if(t(i),!!e&&(t(":"),e&&typeof e.entries=="function"))return this.array(Array.from(e.entries()),!0)},error(e){return t("error:"+e.toString())},boolean(e){return t("bool:"+e)},string(e){t("string:"+e.length+":"),t(e)},function(e){t("fn:"),m(e)?this.dispatch("[native]"):this.dispatch(e.toString()),n.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(e.name)),n.respectFunctionProperties&&this.object(e)},number(e){return t("number:"+e)},xml(e){return t("xml:"+e.toString())},null(){return t("Null")},undefined(){return t("Undefined")},regexp(e){return t("regex:"+e.toString())},uint8array(e){return t("uint8array:"),this.dispatch(Array.prototype.slice.call(e))},uint8clampedarray(e){return t("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(e))},int8array(e){return t("int8array:"),this.dispatch(Array.prototype.slice.call(e))},uint16array(e){return t("uint16array:"),this.dispatch(Array.prototype.slice.call(e))},int16array(e){return t("int16array:"),this.dispatch(Array.prototype.slice.call(e))},uint32array(e){return t("uint32array:"),this.dispatch(Array.prototype.slice.call(e))},int32array(e){return t("int32array:"),this.dispatch(Array.prototype.slice.call(e))},float32array(e){return t("float32array:"),this.dispatch(Array.prototype.slice.call(e))},float64array(e){return t("float64array:"),this.dispatch(Array.prototype.slice.call(e))},arraybuffer(e){return t("arraybuffer:"),this.dispatch(new Uint8Array(e))},url(e){return t("url:"+e.toString())},map(e){t("map:");const i=[...e];return this.array(i,n.unorderedSets!==!1)},set(e){t("set:");const i=[...e];return this.array(i,n.unorderedSets!==!1)},file(e){return t("file:"),this.dispatch([e.name,e.size,e.type,e.lastModfied])},blob(){if(n.ignoreUnknown)return t("[blob]");throw new Error(`Hashing Blob objects is currently not supported
Use "options.replacer" or "options.ignoreUnknown"
`)},domwindow(){return t("domwindow")},bigint(e){return t("bigint:"+e.toString())},process(){return t("process")},timer(){return t("timer")},pipe(){return t("pipe")},tcp(){return t("tcp")},udp(){return t("udp")},tty(){return t("tty")},statwatcher(){return t("statwatcher")},securecontext(){return t("securecontext")},connection(){return t("connection")},zlib(){return t("zlib")},context(){return t("context")},nodescript(){return t("nodescript")},httpparser(){return t("httpparser")},dataview(){return t("dataview")},signal(){return t("signal")},fsevent(){return t("fsevent")},tlswrap(){return t("tlswrap")}}}const S="[native code] }",j=S.length;function m(n){return typeof n!="function"?!1:Function.prototype.toString.call(n).slice(-j)===S}class d{words;sigBytes;constructor(r,s){r=this.words=r||[],this.sigBytes=s===void 0?r.length*4:s}toString(r){return(r||H).stringify(this)}concat(r){if(this.clamp(),this.sigBytes%4)for(let s=0;s<r.sigBytes;s++){const t=r.words[s>>>2]>>>24-s%4*8&255;this.words[this.sigBytes+s>>>2]|=t<<24-(this.sigBytes+s)%4*8}else for(let s=0;s<r.sigBytes;s+=4)this.words[this.sigBytes+s>>>2]=r.words[s>>>2];return this.sigBytes+=r.sigBytes,this}clamp(){this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4)}clone(){return new d([...this.words])}}const H={stringify(n){const r=[];for(let s=0;s<n.sigBytes;s++){const t=n.words[s>>>2]>>>24-s%4*8&255;r.push((t>>>4).toString(16),(t&15).toString(16))}return r.join("")}},K={stringify(n){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",s=[];for(let t=0;t<n.sigBytes;t+=3){const e=n.words[t>>>2]>>>24-t%4*8&255,i=n.words[t+1>>>2]>>>24-(t+1)%4*8&255,a=n.words[t+2>>>2]>>>24-(t+2)%4*8&255,u=e<<16|i<<8|a;for(let o=0;o<4&&t*8+o*6<n.sigBytes*8;o++)s.push(r.charAt(u>>>6*(3-o)&63))}return s.join("")}},M={parse(n){const r=n.length,s=[];for(let t=0;t<r;t++)s[t>>>2]|=(n.charCodeAt(t)&255)<<24-t%4*8;return new d(s,r)}},N={parse(n){return M.parse(unescape(encodeURIComponent(n)))}};class L{_data=new d;_nDataBytes=0;_minBufferSize=0;blockSize=512/32;reset(){this._data=new d,this._nDataBytes=0}_append(r){typeof r=="string"&&(r=N.parse(r)),this._data.concat(r),this._nDataBytes+=r.sigBytes}_doProcessBlock(r,s){}_process(r){let s,t=this._data.sigBytes/(this.blockSize*4);r?t=Math.ceil(t):t=Math.max((t|0)-this._minBufferSize,0);const e=t*this.blockSize,i=Math.min(e*4,this._data.sigBytes);if(e){for(let a=0;a<e;a+=this.blockSize)this._doProcessBlock(this._data.words,a);s=this._data.words.splice(0,e),this._data.sigBytes-=i}return new d(s,i)}}class P extends L{update(r){return this._append(r),this._process(),this}finalize(r){r&&this._append(r)}}const _=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],R=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],y=[];class D extends P{_hash=new d([..._]);reset(){super.reset(),this._hash=new d([..._])}_doProcessBlock(r,s){const t=this._hash.words;let e=t[0],i=t[1],a=t[2],u=t[3],o=t[4],l=t[5],h=t[6],f=t[7];for(let c=0;c<64;c++){if(c<16)y[c]=r[s+c]|0;else{const p=y[c-15],C=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,g=y[c-2],F=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;y[c]=C+y[c-7]+F+y[c-16]}const x=o&l^~o&h,k=e&i^e&a^i&a,z=(e<<30|e>>>2)^(e<<19|e>>>13)^(e<<10|e>>>22),A=(o<<26|o>>>6)^(o<<21|o>>>11)^(o<<7|o>>>25),B=f+A+x+R[c]+y[c],v=z+k;f=h,h=l,l=o,o=u+B|0,u=a,a=i,i=e,e=B+v|0}t[0]=t[0]+e|0,t[1]=t[1]+i|0,t[2]=t[2]+a|0,t[3]=t[3]+u|0,t[4]=t[4]+o|0,t[5]=t[5]+l|0,t[6]=t[6]+h|0,t[7]=t[7]+f|0}finalize(r){super.finalize(r);const s=this._nDataBytes*8,t=this._data.sigBytes*8;return this._data.words[t>>>5]|=128<<24-t%32,this._data.words[(t+64>>>9<<4)+14]=Math.floor(s/4294967296),this._data.words[(t+64>>>9<<4)+15]=s,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}}function T(n){return new D().finalize(n).toString(K)}function W(n,r={}){const s=typeof n=="string"?n:O(n,r);return T(s).slice(0,10)}export{W as h};
